From 6902357aa1be62762dbda94dbd1dcca1ea43bded Mon Sep 17 00:00:00 2001 From: Jelmer Veen Date: Mon, 1 Jul 2024 12:22:02 +0200 Subject: [PATCH 1/3] chore: reversed de-duplication, as a trade-off for search --- .../flightkit.js | 75 ++++++++++++------- .../flightkit.min.js | 2 +- docs/cdn/ibiss-v0.0.4/avian.min.css | 1 + docs/cdn/ibiss-v0.0.4/flightkit.min.js | 1 + docs/cdn/ibiss-v0.0.4/htmx-ibiss-ui.min.js | 1 + docs/cdn/ibiss-v0.0.4/rocket.min.js | 1 + docs/js/flightkit.min.js | 2 +- .../public/cdn/ibiss-v0.0.4/avian.min.css | 1 + .../public/cdn/ibiss-v0.0.4/flightkit.min.js | 1 + .../cdn/ibiss-v0.0.4/htmx-ibiss-ui.min.js | 1 + .../public/cdn/ibiss-v0.0.4/rocket.min.js | 1 + documentation/public/js/flightkit.min.js | 2 +- flightkit/components/tree-navigation.js | 23 ++---- flightkit/index.html | 24 +++++- package-lock.json | 11 +-- package.json | 4 +- 16 files changed, 92 insertions(+), 59 deletions(-) rename dist/{flightkit-v0.0.3 => flightkit-v0.0.4}/flightkit.js (99%) rename dist/{flightkit-v0.0.3 => flightkit-v0.0.4}/flightkit.min.js (91%) create mode 100644 docs/cdn/ibiss-v0.0.4/avian.min.css create mode 100644 docs/cdn/ibiss-v0.0.4/flightkit.min.js create mode 100644 docs/cdn/ibiss-v0.0.4/htmx-ibiss-ui.min.js create mode 100644 docs/cdn/ibiss-v0.0.4/rocket.min.js create mode 100644 documentation/public/cdn/ibiss-v0.0.4/avian.min.css create mode 100644 documentation/public/cdn/ibiss-v0.0.4/flightkit.min.js create mode 100644 documentation/public/cdn/ibiss-v0.0.4/htmx-ibiss-ui.min.js create mode 100644 documentation/public/cdn/ibiss-v0.0.4/rocket.min.js diff --git a/dist/flightkit-v0.0.3/flightkit.js b/dist/flightkit-v0.0.4/flightkit.js similarity index 99% rename from dist/flightkit-v0.0.3/flightkit.js rename to dist/flightkit-v0.0.4/flightkit.js index ecba6b6..52279fb 100644 --- a/dist/flightkit-v0.0.3/flightkit.js +++ b/dist/flightkit-v0.0.4/flightkit.js @@ -967,7 +967,7 @@ const chevronUpIcon = ''; const folderListIcon = ''; - const fileListIcon = ''; + const fileListIcon = ''; /** adapted so it works with fill. */ const databaseListIcon = ''; @@ -9654,12 +9654,27 @@ const trail = item.split('.'); for (const crumb of trail) { - data = data[crumb]; + if (data[crumb]) { + data = data[crumb]; + } + else { + /** Dealing with an array of objects */ + let extractedData = []; + + for (const obj of data) { + if (obj[crumb]) { + extractedData.push(obj[crumb]); + } + } + data = extractedData; + } } /** because of internal array, we have to do a substring. */ const path = item.substring(item.indexOf('.') + 1); - flkElement._emit('tree-click', flkElement, { path, data, branch: typeof data === 'object' }); + + let leafText = flkElement.createLeafText(trail.reverse()[0]); + flkElement._emit('tree-click', flkElement, { path, data, key: `${leafText.titleText} ${leafText.commentText}`.trim(), branch: typeof data === 'object' }); } convertJsonKeyToTitle(jsonKey) { @@ -9780,30 +9795,49 @@ this.filterTree(); } - createTextTag(text, element) { + + createLeafText(text) { let hasComment = typeof text === 'string' ? text.includes('(') || text.includes('[') : false; + let titleText = ''; + let commentText = ''; + if (hasComment) { - let tagContainer = document.createElement('div'); let roundBracketIndex = text.indexOf('('); let squareBracketIndex = text.indexOf('['); - let indexToCut = squareBracketIndex === -1 ? roundBracketIndex : squareBracketIndex; + titleText = this.convertJsonKeyToTitle(text.substring(0, indexToCut)); + commentText = text.substring(indexToCut); + } + else { + titleText = this.convertJsonKeyToTitle(text); + } + + return { titleText, commentText } + } + + createTextTag(text, element) { + let leafText = this.createLeafText(text); + + if (leafText.commentText) { + let tagContainer = document.createElement('div'); let mainTitleElement = document.createElement('span'); - mainTitleElement.innerText = this.convertJsonKeyToTitle(text.substring(0, indexToCut)); + mainTitleElement.innerText = leafText.titleText; let commentElement = document.createElement('small'); - commentElement.innerText = text.substring(indexToCut); + commentElement.innerText = leafText.commentText; commentElement.style.marginLeft = '1rem'; + tagContainer.append(mainTitleElement, commentElement); tagContainer.style.display = 'inline-flex'; tagContainer.style.alignItems = 'center'; + element.append(tagContainer); } else { - element.innerText = this.convertJsonKeyToTitle(text); + element.innerText = leafText.titleText; } } @@ -9871,24 +9905,9 @@ } } else if (Array.isArray(node)) { - const isObjectArray = typeof node[0] === 'object'; - let allKeys = []; - if (isObjectArray) { - for (const obj of node) { - allKeys = allKeys.concat(Object.keys(obj)); - } - let uniqueKeys = [...new Set(allKeys)]; - - for (let nodeKey of uniqueKeys) { - let branch = document.createElement(this.listType); - element.append(this.createBranch(nodeKey, branch, `${key}.${nodeKey}`, depth + 1)); - } - } - else { - for (let nodeKey in node) { - let branch = document.createElement(this.listType); - element.append(this.createBranch(node[nodeKey], branch, `${key}.${nodeKey}`, depth + 1)); - } + for (let nodeKey in node) { + let branch = document.createElement(this.listType); + element.append(this.createBranch(node[nodeKey], branch, `${key}.${nodeKey}`, depth + 1)); } } else if (node !== null && typeof node === 'object') { @@ -9938,6 +9957,8 @@ } } else { + + console.trace({ node, element, key }); this.createLeaf(node, element, key); } return element; diff --git a/dist/flightkit-v0.0.3/flightkit.min.js b/dist/flightkit-v0.0.4/flightkit.min.js similarity index 91% rename from dist/flightkit-v0.0.3/flightkit.min.js rename to dist/flightkit-v0.0.4/flightkit.min.js index 1bf4e4d..a5a8ef8 100644 --- a/dist/flightkit-v0.0.3/flightkit.min.js +++ b/dist/flightkit-v0.0.4/flightkit.min.js @@ -1 +1 @@ -!function(e,n,s,i){"use strict";function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a,u,g,e=c(e),n=c(n),s=c(s),i=c(i);(t=a=a||{}).Date="date",t.String="string",t.Float="float",t.Number="number",t.Array="array",t.Object="object",t.Bool="bool",t.Currency="currency",t.Undefined="undefined",t.Null="null";const h={date:/^(\d{1,4}-\d{1,4}-\d{1,4}(T)?)/gim,currency:/^[$|€]\s?[0-9]*(\.|,)?\d*(\.|,)?\d*/gim,float:/\d+[,|.]\d+[,|.]?\d*/gim,currencySign:/\$|€/gim,array:/^\s?[[].[^,]+[\]],?/gi,precision:/[-+$€,.]/gm,string:/[a-zA-Z]/gim},m=e=>{return null===e||"null"===e?a.Null:e||0===e||!1===e?null===new RegExp(h.date).exec(e)||isNaN(Date.parse(e))?new RegExp(h.currency).exec(e)?a.Currency:!new RegExp(h.string).exec(e)&&new RegExp(h.float).exec(e.toString())?a.Float:isNaN(e)&&0!==e?Array.isArray(e)?a.Array:"object"==typeof e?a.Object:a.String:a.Number:a.Date:a.Undefined},y=(t,e)=>{const r={value:void 0,type:e=e||m(t),currencySign:""};switch(r.type){case a.String:r.value=t.toString();break;case a.Float:case a.Currency:var n=(t=t.toString()).match(new RegExp(/(,)/gim)),s=t.match(new RegExp(/(\.)/gim));if(n)for(let e=1;e<=n.length;e++)t=e!==n.length||s?t.replace(",",""):t.replace(",",".");if(r.type===a.Currency){const o=new RegExp(h.currencySign);var i=o.exec(t);r.currencySign=null!==i?i[0]:"",t=t.replace(o,"")}r.value=parseFloat(t).toPrecision(12);break;case a.Number:r.value=Number(t);break;case a.Date:r.value=Date.parse(t);break;case a.Array:t.length?"object"==typeof t[0]?r.value=t.map(e=>JSON.stringify(e)).join(", "):r.value=t.join(", "):r.value="";break;case a.Object:r.value=t;break;case a.Undefined:r.value="";break;case a.Null:r.value=null}return r};function v(e,t){var r;let n;for(r of e.split("."))r=r.trim(),n?"object"!=typeof n||Array.isArray(n)||(n=n[r]):n=t[r];return n}const b=(e,t)=>tet<=e,S=(e,t)=>e<=t,x=(e,t,r)=>r?e.toLowerCase()==t.toLowerCase():e==t,A=(e,t)=>e===t,k=(e,t)=>e!=t,E=(e,t)=>e!==t,O=(e,t)=>null!=t&&"string"==typeof e&&0<=e.toLowerCase().indexOf(t.toString().toLowerCase()),L=(e,t)=>null!=t&&0<=e.toString().toLowerCase().indexOf(t.toString().toLowerCase()),M=(e,t)=>null!=t&&"string"==typeof e&&e.toLowerCase().indexOf(t.toString().toLowerCase())<0;function P(r,n){if(0===n.length)return r;{var s=r;const o=[],a=[];let e=[];for(const l of n)l.type&&l.type!==u.And?(e.length&&a.push(e),e=[l]):e.push(l);a.push(e);let t=[];for(const e of a)t=t.concat(R(s,e));t=[...new Set(t)];var i=s.length;for(let e=0;e":return b;case"<":return _;case">=":return C;case"<=":return S;case"is":case"==":return x;case"!is":case"!=":return k;case"===":return A;case"!==":return E;case"like":case"~":case"contains":return O;case"!contains":case"!like":case"!~":return M;default:return L}}(a.operator);if(!l(i,o,a.ignoreCase)){e=!1;break}}e&&r.push(n)}return r};function I(e,t){if(!t||0===t.length)return e;if(1{if(0===r.length)r=r.concat(T(s,e));else{for(const t of r)n=n.concat(T(t,e));r=n,n=[]}}),r}return T(e,t[0])}function T(e,t){const r=[],n=[];do{if(!e||0===e.length)break;var s=e.shift();if(!s)break;const o=s[t];var i=n.indexOf(o.toString());0<=i?r[i].push(s):(n.push(o.toString()),void 0!==r[n.length-1]?r[n.length-1].push(s):r.push([s]))}while(0{if(t){var r=e;const n={};for(const s of t){let e=r.map(e=>e[s].toString());const i=e.map(e=>m(e));i.some(e=>e===a.Float)?(e=e.map(e=>parseFloat(e)),n[s]=parseFloat(e.reduce((e,t)=>e+t).toFixed(2))):(e=e.map(e=>parseInt(e)),n[s]=e.reduce((e,t)=>e+t))}return n}return{}};class D{model;sortDetails=[];filterDetails=[];selection=[];groupByProperties=[];distinctProperties=[];concatenationToken=", ";constructor(e){this.model=JSON.parse(JSON.stringify(e))}sort(e){return this.sortDetails=e,this}orderBy(e,t){return this.sortDetails.push({propertyName:e,direction:t}),this}thenOrderBy(e,t){return this.orderBy(e,t)}filter(e){return Array.isArray(e)?this.filterDetails=e:this.filterDetails.push(e),this}where(e,t,r,n,s){return this.filterDetails.push({propertyName:e,operator:t,value:r,type:n,ignoreCase:s}),this}andWhere(e,t,r,n){return this.where(e,t,r,u.And,n),this}orWhere(e,t,r,n){return this.where(e,t,r,u.Or,n),this}group(e){return this.groupByProperties=e,this}groupBy(e){return this.groupByProperties.push(e),this}thenGroupBy(e){return this.groupByProperties.push(e),this}select(e){return Array.isArray(e)?this.selection=e:"*"!==e&&(this.selection=[e]),this}distinct(e,t){return t&&(this.concatenationToken=t),Array.isArray(e)?this.distinctProperties=e:e&&(this.distinctProperties=[e]),this}execute(){return I(function(t,r){if(0===r.length)return t;{var n=r;let e=[];for(const s of t){const i={};for(const o of n)i[o]=s[o];e.push(i)}return e}}(function(r,n,u){if(!n||!n.length)return r;const s=[],h=[];for(const f of r){const o={};let t="";for(const e of n){var p=v(e,f);o[e]=p,t+=p}if(!h.includes(t)){let e=r;for(const a of Object.keys(o))e=e.filter(e=>e[a]===o[a]);h.push(t),s.push(e)}}const t=[];for(const m of s){let e={};for(const l of m){var i,d=Object.keys(e);if(d.length)for(const c of d)n.includes(c)||(i=e[c],Array.isArray(i)?(i=l[c],Array.isArray(i)?e[c]=[...new Set(...e[c].concat(l[c]))]:e[c].includes(l[c])||e[c].push(l[c])):isNaN(e[c])&&isNaN(l[c])?e[c]!==l[c]&&(e[c]=[e[c],l[c]]):e[c]=e[c]+l[c]);else e=l}t.push(e)}return t.forEach(e=>{for(const t in e)Array.isArray(e[t])&&(e[t]=e[t].join(u))}),t}(B(P(JSON.parse(JSON.stringify(this.model)),this.filterDetails),this.sortDetails),this.distinctProperties,this.concatenationToken),this.selection),this.groupByProperties)}sum(e,t){e=Array.isArray(e)?e:[e];return j(t||this.model,e)}}function U(e,t){t=t?t.toUpperCase():"FLK-";return e.toUpperCase().includes(t)}function F(e,t){var{timeStamp:r,type:n,x:s,y:i}=e;let o=e.target;do{if(!o||"HTML"===o.tagName||U(o.tagName,t)){"HTML"===o.tagName&&(o=null);break}}while(o=o.parentNode||o.parentElement,!U(o.tagName,t));return{target:o,timeStamp:r,type:n,x:s,y:i}}function z(e,t){let r=e.target,n="";for(;r.dataset[t]?n=r.dataset[t]:r=r.parentNode,!n;);return n}class ${constructor(){}_topLevelClasses=[];_events=[];generateId(){return"flk-"+function e(){const t=([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)),r=t.split("-")[0];return window.$flightkitUUIDStore||(window.$flightkitUUIDStore=[]),window.$flightkitUUIDStore.some(e=>e===r)?e():(window.$flightkitUUIDStore.push(r),r)}()}render(t){if(!t.component)throw new Error("Component is not assigned! Can't render");t.id=t.id||this.generateId();var e=this._getAllEventAttributes(t);if(e){var r="#"+t.id;for(const i of e){var n="e-"+i;this.addEvent(r,i,t.getAttribute(n))}}var s=Object.keys(t.classList).length;if(s){for(let e=0;e{this._assignToDom(t,t.component),clearTimeout(this._renderTimer)},10)}addEvent(e,t,r){this._events.push({selector:e,eventType:t,callback:r})}_getExternalCallback(e){let t=void 0;for(const r of e.split("."))t=(t||window)[r];return t}_getAllEventAttributes(e){e=e.attributes;const t=Array.from(e).filter(e=>e.name.startsWith("e-"));return t.map(e=>e.name.slice(2))}_isFlightkitElement(e){return e.toUpperCase().includes("FLK-")}_outerEventHandler(e){const t=F(e),r=(t.contents=e.detail,t.target.getAttribute("e-"+t.type));let n=void 0;for(const s of r.split("."))n=(n||window)[s];return e.preventDefault(),e.stopPropagation(),n(t)}_addEvents(e){if(e.isConnected)for(const r of this._events)if(r.selector.startsWith("."))for(const n of document.querySelectorAll(r.selector))this._addEventToElement(r,n);else{var t=document.querySelector(r.selector);this._addEventToElement(r,t)}}_addEventToElement(e,t){t&&("function"==typeof e.callback?(t.removeEventListener(e.eventType,e.callback),t.addEventListener(e.eventType,e.callback)):(t.removeEventListener(e.eventType,this._outerEventHandler),t.addEventListener(e.eventType,this._outerEventHandler)))}removeEvents(){for(const t of this._events)if(t.selector.startsWith("."))for(const r of document.querySelectorAll(t.selector))this._addEventToElement(t,r);else{var e=document.querySelector(t.selector);this._addEventToElement(t,e)}this._events=[]}_removeEventToElement(e,t){t&&("function"==typeof e.callback?t.removeEventListener(e.eventType,e.callback):t.removeEventListener(e.eventType,this._outerEventHandler))}_assignToDom(e,t){e.innerHTML="";for(const n of Array.isArray(t)?t:[t])e.append(n);const r=setTimeout(()=>{this._addEvents(e),clearTimeout(r)},10)}}const G='',H='';function V(e){const t=new DOMParser;return t.parseFromString(e,"image/svg+xml").documentElement}class W extends HTMLElement{base;component=null;_contents=[];_orderBy=[];properties=new Set;_columnOrder=[];_filter="";_selectionProperty="";_selectedIds=new Set;uniqueEntriesByProperties={};propertyLabelDictionary={};_templates={};_templateClasses={};static get observedAttributes(){return["contents","columns","order","filter","selection-property","templates"]}get columnOrder(){return this._columnOrder.length?this._columnOrder:this.properties}set columnOrder(e){let t;"string"==typeof e&&(t=e.split(",")),t=e,this._columnOrder=t}get contents(){return this._contents}set contents(e){this.analyzeData(e),this._contents=new D(e)}get orderBy(){return this._orderBy}set orderBy(e){if(Array.isArray(e))this._orderBy=e;else{const n=[];for(const s of e.split(",")){var t=s.split("|"),r=t[0],t=1e[r._selectionProperty])):new Set;e=t?r.contents.execute():[];r._emit("select",r,{selection:e}),r._updateCheckboxes(r)}emitSelect(e){var t=e.target.checked,r=e.target.dataset.objectId;const n=F(e).target,s=(t?n._selectedIds.add(r):n._selectedIds.delete(r),n._selectionProperty);e=n.contents.execute().filter(e=>n._selectedIds.has(e[s]));n._emit("select",n,{selection:e}),n._updateCheckboxes(n)}sortData(e){const t=F(e).target,r=z(e,"column");r&&(-1<(e=t._orderBy.findIndex(e=>e.propertyName===r))?"asc"===t._orderBy[e].direction?t._orderBy[e].direction="desc":t._orderBy.splice(e,1):t._orderBy.push({propertyName:r,direction:"asc"}),t.createHtml(),t.base.render(t))}setColumnOrder(e){this._columnOrder=e?Array.isArray(e)?e:e.split(","):[]}analyzeData(t){this.properties=new Set;var r=t.length;for(let e=0;e"_"===e?" ":" "+e.toLowerCase()).trim();var r=t.charAt(0).toUpperCase()+t.slice(1);return this.propertyLabelDictionary[e]=r}parseTemplate(e,n){return e.replace(/\{\{([\s\S]+?)\}\}/gim,(e,t)=>{let r="";t=t.trim();t=n[t];return t&&(r=t),Array.isArray(r)?r.join(", "):r.toString().trim()})}createSelectionCheckbox(e){const t=document.createElement("input");return t.setAttribute("type","checkbox"),t.classList.add("flk-selection-checkbox"),e&&(t.dataset.selected=e[this._selectionProperty]),t}createRow(e){const t=document.createElement("tr");if(this._selectionProperty.length){const s=document.createElement("td");var r=this.base.generateId();const i=this.createSelectionCheckbox(e);i.id=r,i.dataset.objectId=e[this._selectionProperty];var n=e[this._selectionProperty];this._selectedIds.has(n)?i.checked=!0:i.checked=!1,this.base.addEvent("#"+r,"change",this.emitSelect),s.append(i),t.append(s)}for(const o of this.columnOrder){const a=document.createElement("td");this._templates[o]?(a.innerHTML=this.parseTemplate(this._templates[o],e),this._templateClasses[o]&&a.classList.add(...this._templateClasses[o])):a.innerText=e[o],t.append(a)}return t}createBody(e){const t=document.createElement("tbody");for(const n of e){var r=this.createRow(n,null);t.append(r)}return t}createHead(){const e=document.createElement("thead"),t=document.createElement("tr");if(t.classList.add("cursor-pointer"),this._selectionProperty.length){const s=document.createElement("th");var r=this.base.generateId();const i=this.createSelectionCheckbox();i.id=r;var u=this.contents.execute().length;0e.propertyName===o);if(n){const c=document.createElement("span");c.innerHTML="asc"===n.direction?'':'',a.append(c)}t.append(a)}return e.append(t),e}addEvent(e,t,r){this.base.addEvent(e,t,r)}init(){this.createHtml(),this.base.render(this)}}class J extends HTMLElement{base;componentId;constructor(){super(),this.base=new $}connectedCallback(){var e=this.getAttribute("top"),t=this.getAttribute("left"),r=this.getAttribute("center"),n=this.getAttribute("zIndex");this.id||(this.id=this.base.generateId()),this.style.display="block",this.style.position="fixed","string"==typeof r?(this.style.top=e||"50%",this.style.left="50%",this.style.transform="translate(-50%, -50%)"):(this.style.top=e||this.clientTop+"px",this.style.left=t||this.clientLeft+"px"),n&&(this.style.zIndex=n),this.componentId=this.getAttribute("handle");const s=document.createElement("div");s.innerHTML=this.innerHTML,this.component=s;r="#"+(this.componentId||this.id);this.base.addEvent(r,"mousedown",this._dragElement),this.base.addEvent(r,"mouseup",this._reset),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this)}_dragElement(e){const r=F(e,"flk-draggable").target;let n,s;function t(e){n=e.clientX-r.offsetLeft,s=e.clientY-r.offsetTop}function i(e){var t=e.clientX-n,e=e.clientY-s;r.style.left=t+"px",r.style.top=e+"px"}function o(e){e.preventDefault()}function a(){r.removeAttribute("draggable"),r.removeEventListener("dragstart",t),r.removeEventListener("dragend",a),document.removeEventListener("dragover",o),document.removeEventListener("drop",i)}r.setAttribute("draggable",!0),r.addEventListener("dragstart",t),r.addEventListener("dragend",a),document.addEventListener("dragover",o),document.addEventListener("drop",i)}}class q extends HTMLElement{_id;base;_draggableId;constructor(){super(),this.base=new $}_emit(e,t,r){e=new CustomEvent(e,{detail:r,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}_closeModal(e){e.stopPropagation();const t=F(e,"flk-modal").target;t.classList.add("hidden")}closeModal(e){this.classList.add("hidden")}openModal(e=!0){const t=document.getElementById(this._draggableId);e&&(t.style.top="40%",t.style.left="50%"),this.classList.remove("hidden")}connectedCallback(){this.id||(this.id=this.base.generateId());const e=document.createElement("div");var t=this.base.generateId();const r=document.createElement("flk-draggable"),n=(this._draggableId=this.base.generateId(),r.id=this._draggableId,r.setAttribute("center",""),r.setAttribute("top","40%"),r.setAttribute("handle",t),r.setAttribute("zIndex","1080"),r.classList.add("border","shadow-lg","bg-white"),r.style.width="max-content",document.createElement("div"));var s=this.getAttribute("modal-title");if(s){const c=document.createElement("span");c.innerText=s,c.classList.add("ml-1","mr-auto"),n.append(c)}n.id=t;const i=this.getAttribute("header-class");let o=[];i?o=o.concat(i.split(" ")):o.push("bg-gray-light"),n.classList.add(...o,"border-bottom","row","justify-end","cursor-no-select");s=this.base.generateId();const a=document.createElement("button"),l=(a.classList.add("py-0","px-1","outline-hover","no-border","cursor-default",...o),a.innerText="X",a.id=s,n.append(a),r.append(n),document.createElement("div"));l.innerHTML=this.innerHTML,r.append(l),e.append(r),this.component=e,this.base.addEvent("#"+s,"click",this._closeModal),this.base.render(this),this.classList.add("hidden")}disconnectedCallback(){this.base.removeEvents(this)}}class K extends HTMLElement{base;_buttonId;_drawerId;_iconId;constructor(){super(),this.base=new $}connectedCallback(){this.style.position="relative",this.style.display="flex",this.style.width="fit-content",this._buttonId=this.base.generateId();const e=document.createElement("button"),t=(e.classList.add("row"),e.id=this._buttonId,document.createElement("span")),r=(t.innerText=this.getAttribute("text"),this._iconId=this.base.generateId(),document.createElement("span"));var n=V('');const s=V(''),i=(s.classList.add("hidden"),r.append(n,s),r.id=this._iconId,e.append(t,r),this._drawerId=this.base.generateId(),document.createElement("div"));i.id=this._drawerId,i.classList.add("shadow","inline-block","bg-white"),i.style.position="absolute",i.style.zIndex="1040";n=this.querySelector("template");n.innerHTML.length?i.innerHTML=n.innerHTML:i.append(n.firstChild),i.style.display="none",this.component=[e,i],this.base.addEvent("#"+this._buttonId,"click",this.toggleMenu);const o=document.querySelector("body");""!==o.getAttribute("flk-close-dropdown")&&(o.setAttribute("flk-close-dropdown",""),o.addEventListener("click",this.closeAllDropdownButtons)),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this);var e=document.querySelectorAll("flk-dropdown");if(!e||!e.length){const t=document.querySelector("body");t.removeAttribute("flk-close-dropdown"),t.removeEventListener("click",this.closeAllDropdownButtons)}}toggleMenu(e){const t=F(e).target;e=t._drawerId;const r=document.getElementById(e);var e="none"!==r.style.display,n=(r.style.display=e?"none":"block",t.getAttribute("drawer-width")),n=("string"==typeof t.getAttribute("right")&&(r.style.right="0px"),r.style.top=t.offsetHeight+"px",r.style.width=n||t.offsetWidth+"px",t._iconId);const s=document.getElementById(n);e?(s.childNodes[0].classList.remove("hidden"),s.childNodes[1].classList.add("hidden")):(s.childNodes[0].classList.add("hidden"),s.childNodes[1].classList.remove("hidden"))}_closeDropdown(){var e=this._drawerId;const t=document.getElementById(e);if("none"!==t.style.display){e=this._iconId;const r=document.getElementById(e);t.style.display="none",r.childNodes[0].classList.remove("hidden"),r.childNodes[1].classList.add("hidden")}}closeAllDropdownButtons(e){var t,r=F(e,"flk-dropdown").target,e=document.querySelectorAll("flk-dropdown");if(r)for(const n of e)r._buttonId!==n._buttonId&&(t=n._drawerId,"none"!==document.getElementById(t).style.display&&n._closeDropdown());else for(const s of e)s._closeDropdown()}}var t={exports:{}};let Z=e.default,Y=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||"win32"===process.platform||Z.isatty(1)&&"dumb"!==process.env.TERM||"CI"in process.env),r=(r,n,s=r)=>e=>{let t=""+e;e=t.indexOf(n,r.length);return~e?r+X(t,n,s,e)+n:r+t+n},X=(e,t,r,n)=>{var s=e.substring(0,n)+r;let i=e.substring(n+t.length);e=i.indexOf(t);return~e?s+X(i,t,r,e):s+i};e=(e=Y)=>({isColorSupported:e,reset:e?e=>`${e}`:String,bold:e?r("","",""):String,dim:e?r("","",""):String,italic:e?r("",""):String,underline:e?r("",""):String,inverse:e?r("",""):String,hidden:e?r("",""):String,strikethrough:e?r("",""):String,black:e?r("",""):String,red:e?r("",""):String,green:e?r("",""):String,yellow:e?r("",""):String,blue:e?r("",""):String,magenta:e?r("",""):String,cyan:e?r("",""):String,white:e?r("",""):String,gray:e?r("",""):String,bgBlack:e?r("",""):String,bgRed:e?r("",""):String,bgGreen:e?r("",""):String,bgYellow:e?r("",""):String,bgBlue:e?r("",""):String,bgMagenta:e?r("",""):String,bgCyan:e?r("",""):String,bgWhite:e?r("",""):String});t.exports=e(),t.exports.createColors=e;const Q="'".charCodeAt(0),ee='"'.charCodeAt(0),te="\\".charCodeAt(0),re="/".charCodeAt(0),ne="\n".charCodeAt(0),se=" ".charCodeAt(0),ie="\f".charCodeAt(0),oe="\t".charCodeAt(0),ae="\r".charCodeAt(0),le="[".charCodeAt(0),ce="]".charCodeAt(0),ue="(".charCodeAt(0),he=")".charCodeAt(0),pe="{".charCodeAt(0),de="}".charCodeAt(0),fe=";".charCodeAt(0),me="*".charCodeAt(0),ge=":".charCodeAt(0),ye="@".charCodeAt(0),ve=/[\t\n\f\r "#'()/;[\\\]{}]/g,we=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,be=/.[\r\n"'(/\\]/,_e=/[\da-f]/i;function Ce(t,e={}){let n=t.css.valueOf(),d=e.ignoreErrors,s,i,f,m,o,a,l,g,c,u,y=n.length,h=0,v=[],p=[];function w(e){throw t.error("Unclosed "+e,h)}return{back:function(e){p.push(e)},endOfFile:function(){return 0===p.length&&h>=y},nextToken:function(e){if(p.length)return p.pop();if(!(h>=y)){var t=!!e&&e.ignoreUnclosed;switch(s=n.charCodeAt(h),s){case ne:case se:case oe:case ae:case ie:for(i=h;i+=1,s=n.charCodeAt(i),s===se||s===ne||s===oe||s===ae||s===ie;);u=["space",n.slice(h,i)],h=i-1;break;case le:case ce:case pe:case de:case ge:case fe:case he:var r=String.fromCharCode(s);u=[r,r,h];break;case ue:if(g=v.length?v.pop()[1]:"",c=n.charCodeAt(h+1),"url"===g&&c!==Q&&c!==ee&&c!==se&&c!==ne&&c!==oe&&c!==ie&&c!==ae){i=h;do{if(a=!1,i=n.indexOf(")",i+1),-1===i){if(d||t){i=h;break}w("bracket")}for(l=i;n.charCodeAt(l-1)===te;)--l,a=!a}while(a);u=["brackets",n.slice(h,i+1),h,i],h=i}else i=n.indexOf(")",h+1),m=n.slice(h,i+1),-1===i||be.test(m)?u=["(","(",h]:(u=["brackets",m,h,i],h=i);break;case Q:case ee:f=s===Q?"'":'"',i=h;do{if(a=!1,i=n.indexOf(f,i+1),-1===i){if(d||t){i=h+1;break}w("string")}for(l=i;n.charCodeAt(l-1)===te;)--l,a=!a}while(a);u=["string",n.slice(h,i+1),h,i],h=i;break;case ye:ve.lastIndex=h+1,ve.test(n),i=0===ve.lastIndex?n.length-1:ve.lastIndex-2,u=["at-word",n.slice(h,i+1),h,i],h=i;break;case te:for(i=h,o=!0;n.charCodeAt(i+1)===te;)i+=1,o=!o;if(s=n.charCodeAt(i+1),o&&s!==re&&s!==se&&s!==ne&&s!==oe&&s!==ae&&s!==ie&&(i+=1,_e.test(n.charAt(i)))){for(;_e.test(n.charAt(i+1));)i+=1;n.charCodeAt(i+1)===se&&(i+=1)}u=["word",n.slice(h,i+1),h,i],h=i;break;default:h=(s===re&&n.charCodeAt(h+1)===me?(i=n.indexOf("*/",h+2)+1,0===i&&(d||t?i=n.length:w("comment")),u=["comment",n.slice(h,i+1),h,i]):(we.lastIndex=h+1,we.test(n),i=0===we.lastIndex?n.length-1:we.lastIndex-2,u=["word",n.slice(h,i+1),h,i],v.push(u)),i)}return h++,u}},position:function(){return h}}}e=t.exports;let Se=Ce,xe;const Ae={";":e.yellow,":":e.yellow,"(":e.cyan,")":e.cyan,"[":e.yellow,"]":e.yellow,"{":e.yellow,"}":e.yellow,"at-word":e.cyan,brackets:e.cyan,call:e.cyan,class:e.yellow,comment:e.gray,hash:e.magenta,string:e.green};function ke(e){let r=Se(new xe(e),{ignoreErrors:!0}),n="";for(;!r.endOfFile();){let e=r.nextToken(),t=Ae[function([e,t],r){if("word"===e){if("."===t[0])return"class";if("#"===t[0])return"hash"}if(!r.endOfFile()){t=r.nextToken();if(r.back(t),"brackets"===t[0]||"("===t[0])return"call"}return e}(e,r)];t?n+=e[1].split(/\r?\n/).map(e=>t(e)).join("\n"):n+=e[1]}return n}ke.registerInput=function(e){xe=e};e=ke;let Ee=t.exports,Oe=e;class Le extends Error{constructor(e,t,r,n,s,i){super(e),this.name="CssSyntaxError",this.reason=e,s&&(this.file=s),n&&(this.source=n),i&&(this.plugin=i),void 0!==t&&void 0!==r&&("number"==typeof t?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,Le)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file||"",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source,r=(null==e&&(e=Ee.isColorSupported),Oe&&e&&(t=Oe(t)),t.split(/\r?\n/)),n=Math.max(this.line-3,0);var s=Math.min(this.line+2,r.length);let i=String(s).length,o,a;if(e){let{bold:t,gray:r,red:n}=Ee.createColors(!0);o=e=>t(n(e)),a=e=>r(e)}else o=a=e=>e;return r.slice(n,s).map((e,t)=>{var t=n+1+t;let r=" "+(" "+t).slice(-i)+" | ";return t===this.line?(t=a(r.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," "),o(">")+a(r)+e+"\n "+t+o("^")):" "+a(r)+e}).join("\n")}toString(){let e=this.showSourceCode();return e=e&&"\n\n"+e+"\n",this.name+": "+this.message+e}}var t=Le,Me=(Le.default=Le,{});Me.isClean=Symbol("isClean"),Me.my=Symbol("my");const Pe={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class Re{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name;var n=e.params?this.rawValue(e,"params"):"";void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes?this.block(e,r+n):(t=(e.raws.between||"")+(t?";":""),this.builder(r+n+t,e))}beforeAfter(e,t){let r,n=(r="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose"),e.parent),s=0;for(;n&&"root"!==n.type;)s+=1,n=n.parent;if(r.includes("\n")){var i=this.raw(e,null,"indent");if(i.length)for(let e=0;e{if(n=e.raws[t],void 0!==n)return!1}),void 0===n&&(n=Pe[r]),i.rawCache[r]=n,n}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&0{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=void 0===r?this.raw(t,null,"beforeDecl"):r&&r.replace(/\S/g,""),r}rawBeforeDecl(e,t){let r;return e.walkDecls(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=void 0===r?this.raw(t,null,"beforeRule"):r&&r.replace(/\S/g,""),r}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(t){let r;return t.walk(e=>{if(e.nodes&&(e.parent!==t||t.first!==e)&&void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=r&&r.replace(/\S/g,""),r}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(r){if(r.raws.indent)return r.raws.indent;let n;return r.walk(e=>{var t=e.parent;if(t&&t!==r&&t.parent&&t.parent===r&&void 0!==e.raws.before)return t=e.raws.before.split("\n"),n=t[t.length-1],n=n.replace(/\S/g,""),!1}),n}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){var r=e[t],e=e.raws[t];return e&&e.value===r?e.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}}var Ie=Re;Re.default=Re;let Te=Ie;function Be(e,t){let r=new Te(t);r.stringify(e)}var Ne=Be;Be.default=Be;let{isClean:je,my:De}=Me,Ue=t,Fe=Ie,ze=Ne;function $e(t,r){let n=new t.constructor;for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&"proxyCache"!==s){let e=t[s];var i=typeof e;"parent"===s&&"object"==i?r&&(n[s]=r):"source"===s?n[s]=e:Array.isArray(e)?n[s]=e.map(e=>$e(e,n)):("object"==i&&null!==e&&(e=$e(e)),n[s]=e)}return n}class Ge{constructor(e={}){for(var t in this.raws={},this[je]=!1,this[De]=!0,e)if("nodes"===t){this.nodes=[];for(var r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){var t;return e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)&&(t=this.source,e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)),e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(var t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=$e(this);for(var r in e)t[r]=e[r];return t}cloneAfter(e={}){e=this.clone(e);return this.parent.insertAfter(this,e),e}cloneBefore(e={}){e=this.clone(e);return this.parent.insertBefore(this,e),e}error(e,t={}){var r,n;return this.source?({end:r,start:n}=this.rangeBy(t),this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)):new Ue(e)}getProxyProcessor(){return{get(e,t){return"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t]},set(e,t,r){return e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0}}}markDirty(){if(this[je]){this[je]=!1;let e=this;for(;e=e.parent;)e[je]=!1}}next(){var e;if(this.parent)return e=this.parent.index(this),this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;return e.index?r=this.positionInside(e.index,t):!e.word||-1!==(e=(t=this.toString()).indexOf(e.word))&&(r=this.positionInside(e,t)),r}positionInside(t,e){var r=e||this.toString();let n=this.source.start.column,s=this.source.start.line;for(let e=0;e"object"==typeof e&&e.toJSON?e.toJSON(null,r):e);else if("object"==typeof t&&t.toJSON)n[s]=t.toJSON(null,r);else if("source"===s){let e=r.get(t.input);null==e&&(e=i,r.set(t.input,i),i++),n[s]={end:t.end,inputId:e,start:t.start}}else n[s]=t}return t&&(n.inputs=[...r.keys()].map(e=>e.toJSON())),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=ze){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(var s in r)n[s]=r[s];return e.warn(t,n)}get proxyOf(){return this}}var Ie=Ge,He=(Ge.default=Ge,Ie);class Ve extends He{constructor(e){super(e=e&&void 0!==e.value&&"string"!=typeof e.value?{...e,value:String(e.value)}:e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}}var He=Ve,We=(Ve.default=Ve,{}),Je={},qe={},Ke={},Ze="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),Ye=(Ke.encode=function(e){if(0<=e&&e>>=5)&&(t|=32),r+=Ye.encode(t),0>1,1==(1&a)?-i:i),r.rest=t};var Ke={},l=Ke,Xe=(l.getArg=function(e,t,r){if(t in e)return e[t];if(3===arguments.length)return r;throw new Error('"'+t+'" is a required argument.')},/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/),Qe=/^data:.+\,.+$/;function et(e){e=e.match(Xe);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}function tt(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}l.urlParse=et,l.urlGenerate=tt,rt=function(e){var t=e,r=et(e);if(r){if(!r.path)return e;t=r.path}for(var n,e=l.isAbsolute(t),s=[],i=0;;){if(n=i,-1===(i=t.indexOf("/",n))){s.push(t.slice(n));break}for(s.push(t.slice(n,i));in;e--){var o=r[e-1],a=r[e];if(Pt(o,a)<=0)break;r[e-1]=a,r[e]=o}else Lt(r,Pt,n)}function It(e,s){var t=e,e=("string"==typeof e&&(t=w.parseSourceMapInput(e)),w.getArg(t,"version")),t=w.getArg(t,"sections");if(e!=this._version)throw new Error("Unsupported version: "+e);this._sources=new Et,this._names=new Et;var i={line:-1,column:0};this._sections=t.map(function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var t=w.getArg(e,"offset"),r=w.getArg(t,"line"),n=w.getArg(t,"column");if(r=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))},p.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;var r=this._findSourceIndex(e);if(0<=r)return this.sourcesContent[r];var n,r=e;if(null!=this.sourceRoot&&(r=w.relative(this.sourceRoot,r)),null!=this.sourceRoot&&(n=w.urlParse(this.sourceRoot))){e=r.replace(/^file:\/\//,"");if("file"==n.scheme&&this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];if((!n.path||"/"==n.path)&&this._sources.has("/"+r))return this.sourcesContent[this._sources.indexOf("/"+r)]}if(t)return null;throw new Error('"'+r+'" is not in the SourceMap.')},p.prototype.generatedPositionFor=function(e){var t=w.getArg(e,"source");if((t=this._findSourceIndex(t))<0)return{line:null,column:null,lastColumn:null};t={source:t,originalLine:w.getArg(e,"line"),originalColumn:w.getArg(e,"column")},e=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",w.compareByOriginalPositions,w.getArg(e,"bias",f.GREATEST_LOWER_BOUND));if(0<=e){e=this._originalMappings[e];if(e.source===t.source)return{line:w.getArg(e,"generatedLine",null),column:w.getArg(e,"generatedColumn",null),lastColumn:w.getArg(e,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},ft.BasicSourceMapConsumer=p,(It.prototype=Object.create(f.prototype)).constructor=f,It.prototype._version=3,Object.defineProperty(It.prototype,"sources",{get:function(){for(var e=[],t=0;t{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(n,s=21)=>(e=s)=>{let t="",r=e;for(;r--;)t+=n[Math.random()*n.length|0];return t}};let{SourceMapConsumer:Ut,SourceMapGenerator:Ft}=We,{existsSync:zt,readFileSync:$t}=i.default,{dirname:Gt,join:Ht}=n.default;class Vt{constructor(e,t){!1!==t.map&&(this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:"),e=t.map?t.map.prev:void 0,e=this.loadMap(t.from,e),!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Gt(this.mapFile)),e&&(this.text=e))}consumer(){return this.consumerCache||(this.consumerCache=new Ut(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+t)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);var r,n;t&&(r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r),-1"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,i,o;t&&"object"==typeof t?(a=r,r="number"==typeof(l=t).offset?(t=(c=this.fromOffset(l.offset)).line,c.col):(t=l.line,l.column),o="number"==typeof a.offset?(c=this.fromOffset(a.offset),i=c.line,c.col):(i=a.line,a.column)):r||(t=(l=this.fromOffset(t)).line,r=l.col);var a,l,c=this.origin(t,r,i,o);return s=c?new Xt(e,void 0===c.endLine?c.line:{column:c.column,line:c.line},void 0===c.endLine?c.column:{column:c.endColumn,line:c.endLine},c.source,c.file,n.plugin):new Xt(e,void 0===i?t:{column:r,line:t},void 0===i?r:{column:o,line:i},this.css,this.file,n.plugin),s.input={column:r,endColumn:o,endLine:i,line:t,source:this.css},this.file&&(Jt&&(s.input.url=Jt(this.file).toString()),s.input.file=this.file),s}fromOffset(t){let n;if(this[er])n=this[er];else{var s=this.css.split("\n");n=new Array(s.length);let r=0;for(let e=0,t=s.length;e>1),t=n[i+1])){r=i;break}r=i+1}}return{col:t-n[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Kt(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let s=this.map.consumer();t=s.originalPositionFor({column:t,line:e});if(!t.source)return!1;let i;"number"==typeof r&&(i=s.originalPositionFor({column:n,line:r}));let o,a=(o=qt(t.source)?Jt(t.source):new URL(t.source,this.map.consumer().sourceRoot||Jt(this.map.mapFile)),{column:t.column,endColumn:i&&i.column,endLine:i&&i.line,line:t.line,url:o.toString()});if("file:"===o.protocol){if(!Wt)throw new Error("file: protocol is not available in this PostCSS build");a.file=Wt(o)}e=s.sourceContentFor(t.source);return e&&(a.source=e),a}toJSON(){let e={};for(var t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}}Je=nr;nr.default=nr,Yt&&Yt.registerInput&&Yt.registerInput(nr);let{SourceMapConsumer:sr,SourceMapGenerator:ir}=We,{dirname:or,relative:ar,resolve:lr,sep:cr}=n.default,ur=s.default["pathToFileURL"],hr=Je,pr=Boolean(sr&&ir),dr=Boolean(or&&lr&&ar&&cr);ft=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e,t=(e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map","\n");this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(var t of this.previous()){var r=this.toUrl(this.path(t.file)),n=t.root||or(t.file);let e;!1===this.mapOpts.sourcesContent?(e=new sr(t.text),e.sourcesContent&&(e.sourcesContent=null)):e=t.consumer(),this.map.applySourceMap(e,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let t;for(let e=this.root.nodes.length-1;0<=e;e--)t=this.root.nodes[e],"comment"===t.type&&0===t.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(e)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),dr&&pr&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,e=>{t+=e}),[t]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=ir.fromSourceMap(e)}else this.map=new ir({file:this.outputFile()}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):""});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&0",o={generated:{column:0,line:0},original:{column:0,line:0},source:""},a,l;this.stringify(this.root,(e,t,r)=>{this.css+=e,t&&"end"!==r&&(o.generated.line=n,o.generated.column=s-1,t.source&&t.source.start?(o.source=this.sourcePath(t),o.original.line=t.source.start.line,o.original.column=t.source.start.column-1):(o.source=i,o.original.line=1,o.original.column=0),this.map.addMapping(o)),a=e.match(/\n/g),a?(n+=a.length,l=e.lastIndexOf("\n"),s=e.length-l):s+=e.length,t&&"start"!==r&&(e=t.parent||{raws:{}},("decl"===t.type||"atrule"===t.type&&!t.nodes)&&t===e.last&&!e.raws.semicolon||(t.source&&t.source.end?(o.source=this.sourcePath(t),o.original.line=t.source.end.line,o.original.column=t.source.end.column-1,o.generated.line=n,o.generated.column=s-2):(o.source=i,o.original.line=1,o.original.column=0,o.generated.line=n,o.generated.column=s-1),this.map.addMapping(o)))})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;var e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:0e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;var t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?or(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=or(lr(r,this.mapOpts.annotation)));t=ar(r,e);return this.memoizedPaths.set(e,t),t}previous(){var e;return this.previousMaps||(this.previousMaps=[],this.root?this.root.walk(e=>{e.source&&e.source.input.map&&(e=e.source.input.map,this.previousMaps.includes(e)||this.previousMaps.push(e))}):(e=new hr(this.originalCSS,this.opts)).map&&this.previousMaps.push(e.map)),this.previousMaps}setSourcesContent(){let r={};var e;this.root?this.root.walk(e=>{var t;!e.source||(t=e.source.input.from)&&!r[t]&&(r[t]=!0,t=this.usesFileUrls?this.toFileUrl(t):this.toUrl(this.path(t)),this.map.setSourceContent(t,e.source.input.css))}):this.css&&(e=this.opts.from?this.toUrl(this.path(this.opts.from)):"",this.map.setSourceContent(e,this.css))}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){var t=this.memoizedFileURLs.get(e);if(t)return t;if(ur)return t=ur(e).toString(),this.memoizedFileURLs.set(e,t),t;throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){var t=this.memoizedURLs.get(e);if(t)return t;"\\"===cr&&(e=e.replace(/\\/g,"/"));t=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,t),t}};class fr extends Ie{constructor(e){super(e),this.type="comment"}}Ct=fr;fr.default=fr;let{isClean:mr,my:gr}=Me,yr=He,vr=Ct,wr,br,_r,Cr;class Sr extends Ie{append(...e){for(var t of e){var r;for(r of this.normalize(t,this.last))this.proxyOf.nodes.push(r)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(var t of this.nodes)t.cleanRaws(e)}each(r){if(this.proxyOf.nodes){var n=this.getIterator();let e,t;for(;this.indexes[n]t[n](...e.map(r=>"function"==typeof r?(e,t)=>r(e.toProxy(),t):r)):"every"===n||"some"===n?r=>t[n]((e,...t)=>r(e.toProxy(),...t)):"root"===n?()=>t.root().toProxy():"nodes"===n?t.nodes.map(e=>e.toProxy()):"first"===n||"last"===n?t[n].toProxy():t[n])},set(e,t,r){return e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0}}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){var r,n,s,i=this.index(e),o=this.normalize(t,this.proxyOf.nodes[i]).reverse(),i=this.index(e);for(r of o)this.proxyOf.nodes.splice(i+1,0,r);for(s in this.indexes)i<(n=this.indexes[s])&&(this.indexes[s]=n+o.length);return this.markDirty(),this}insertBefore(e,t){var r,n,s,i=this.index(e),o=this.normalize(t,this.proxyOf.nodes[i],0===i&&"prepend").reverse(),i=this.index(e);for(r of o)this.proxyOf.nodes.splice(i,0,r);for(s in this.indexes)i<=(n=this.indexes[s])&&(this.indexes[s]=n+o.length);return this.markDirty(),this}normalize(e,t){if("string"==typeof e)e=function t(e){return e.map(e=>(e.nodes&&(e.nodes=t(e.nodes)),delete e.source,e))}(wr(e).nodes);else if(void 0===e)e=[];else if(Array.isArray(e))for(var r of e=e.slice(0))r.parent&&r.parent.removeChild(r,"ignore");else if("root"===e.type&&"document"!==this.type)for(var n of e=e.nodes.slice(0))n.parent&&n.parent.removeChild(n,"ignore");else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new yr(e)]}else if(e.selector)e=[new br(e)];else if(e.name)e=[new _r(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new vr(e)]}return e.map(e=>(e[gr]||Sr.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[mr]&&function e(t){if(t[mr]=!1,t.proxyOf.nodes)for(var r of t.proxyOf.nodes)e(r)}(e),void 0===e.raws.before&&t&&void 0!==t.raws.before&&(e.raws.before=t.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}prepend(...e){for(var t of e=e.reverse()){var r,n,s=this.normalize(t,this.first,"prepend").reverse();for(r of s)this.proxyOf.nodes.unshift(r);for(n in this.indexes)this.indexes[n]=this.indexes[n]+s.length}return this.markDirty(),this}push(e){return(e.parent=this).proxyOf.nodes.push(e),this}removeAll(){for(var e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){var t,r;for(r in e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1),this.indexes)e<=(t=this.indexes[r])&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(t,r,n){return n||(n=r,r={}),this.walkDecls(e=>{r.props&&!r.props.includes(e.prop)||r.fast&&!e.value.includes(r.fast)||(e.value=e.value.replace(t,n))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(n){return this.each((t,e)=>{let r;try{r=n(t,e)}catch(e){throw t.addToError(e)}return!1!==r&&t.walk&&(r=t.walk(n)),r})}walkAtRules(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("atrule"===e.type&&r.test(e.name))return n(e,t)}):this.walk((e,t)=>{if("atrule"===e.type&&e.name===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("atrule"===e.type)return n(e,t)}))}walkComments(r){return this.walk((e,t)=>{if("comment"===e.type)return r(e,t)})}walkDecls(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("decl"===e.type&&r.test(e.prop))return n(e,t)}):this.walk((e,t)=>{if("decl"===e.type&&e.prop===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("decl"===e.type)return n(e,t)}))}walkRules(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("rule"===e.type&&r.test(e.selector))return n(e,t)}):this.walk((e,t)=>{if("rule"===e.type&&e.selector===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("rule"===e.type)return n(e,t)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}Sr.registerParse=e=>{wr=e},Sr.registerRule=e=>{br=e},Sr.registerAtRule=e=>{_r=e},Sr.registerRoot=e=>{Cr=e};i=Sr,Sr.default=Sr,Sr.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,_r.prototype):"rule"===e.type?Object.setPrototypeOf(e,br.prototype):"decl"===e.type?Object.setPrototypeOf(e,yr.prototype):"comment"===e.type?Object.setPrototypeOf(e,vr.prototype):"root"===e.type&&Object.setPrototypeOf(e,Cr.prototype),e[gr]=!0,e.nodes&&e.nodes.forEach(e=>{Sr.rebuild(e)})},ot=i;let xr,Ar;class kr extends ot{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){let t=new xr(new Ar,this,e);return t.stringify()}}kr.registerLazyResult=e=>{xr=e},kr.registerProcessor=e=>{Ar=e};e=kr;kr.default=kr;let Er={};function Or(e){Er[e]||(Er[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))}class Lr{constructor(e,t={}){for(var r in this.type="warning",this.text=e,t.node&&t.node.source&&(e=t.node.rangeBy(t),this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column),t)this[r]=t[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}St=Lr;Lr.default=Lr;let Mr=St;class Pr{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);e=new Mr(e,t);return this.messages.push(e),e}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}}Ke=Pr;Pr.default=Pr;let Rr=i;class Ir extends Rr{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}We=Ir;Ir.default=Ir,Rr.registerAtRule(Ir);let Tr=i,Br,Nr;class jr extends Tr{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){e=super.normalize(e);if(t)if("prepend"===r)1{Br=e},jr.registerProcessor=e=>{Nr=e};n=jr;jr.default=jr,Tr.registerRoot(jr);let Dr={comma(e){return Dr.split(e,[","],!0)},space(e){return Dr.split(e,[" ","\n","\t"])},split(e,t,u){let r=[],n="",s=!1,i=0,o=!1,a="",l=!1;for(var c of e)l?l=!1:"\\"===c?l=!0:o?c===a&&(o=!1):'"'===c||"'"===c?(o=!0,a=c):"("===c?i+=1:")"===c?0"space"!==e[0]&&"comment"!==e[0])&&(s.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(s,"value",a.concat(e),t),s.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new Jr;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){var t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1;var r;let n=!1,s=null,i=[];var o=e[1].startsWith("--");let a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)s=s||l,i.push("("===r?")":"]");else if(o&&n&&"{"===r)s=s||l,i.push("}");else if(0===i.length){if(";"===r){if(n)return void this.decl(a,o);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===i[i.length-1]&&(i.pop(),0===i.length&&(s=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),0e+t[1],""),e.raws[t]={raw:o,value:l}),e[t]=l}rule(e){e.pop();let t=new Jr;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){var t;let r="";for(;e.length&&("space"===(t=e[e.length-1][0])||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){var t;let r="";for(;e.length&&("space"===(t=e[0][0])||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t="";for(;e.length&&"space"===e[e.length-1][0];)t=e.pop()[1]+t;return t}stringFrom(t,r){let n="";for(let e=r;evn(e)),e}let wn={};class bn{constructor(e,t,r){this.stringified=!1,this.processed=!1;let n;if("object"!=typeof t||null===t||"root"!==t.type&&"document"!==t.type)if(t instanceof bn||t instanceof ln)n=vn(t.root),t.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=t.map);else{let e=cn;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{n=e(t,r)}catch(e){this.processed=!0,this.error=e}n&&!n[tn]&&sn.rebuild(n)}else n=vn(t);this.result=new ln(e,n,r),this.helpers={...wn,postcss:wn,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){var r=this.result.lastPlugin;try{if(t&&t.addToError(e),"CssSyntaxError"!==(this.error=e).name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){var n=r.postcssPlugin;let e=r.postcssVersion,t=this.result.processor.version;var s=e.split("."),i=t.split(".");(s[0]!==i[0]||parseInt(s[1])>parseInt(i[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+t+", but "+n+" uses "+e+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};var e,t=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(e of this.plugins)if("object"==typeof e)for(var r in e){if(!pn[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${e.postcssPlugin}. `+`Try to update PostCSS (${this.processor.version} now).`);if(!dn[r])if("object"==typeof e[r])for(var n in e[r])"*"===n?t(e,r,e[r][n]):t(e,r+"-"+n.toLowerCase(),e[r][n]);else"function"==typeof e[r]&&t(e,r,e[r])}this.hasListener=0t(e,this.helpers)),await Promise.all(i)):await t(r,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{var e;if("object"==typeof t&&t.Once)return"document"===this.result.root.type?mn((e=this.result.root.nodes.map(e=>t.Once(e,this.helpers)))[0])?Promise.all(e):e:t.Once(this.result.root,this.helpers);if("function"==typeof t)return t(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();var e=this.result.opts;let t=nn,r=(e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify),new rn(t,this.result.root,this.result.opts));e=r.generate();return this.result.css=e[0],this.result.map=e[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(var e of this.plugins)if(mn(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[en];)e[en]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(var t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||an("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(var[r,n]of e){this.result.lastPlugin=r;let e;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(mn(e))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:s}=r;if("root"===n.type||"document"===n.type||n.parent){if(0{e[en]||this.walkSync(e)});else{var r=this.listeners[t];if(r&&this.visitSync(r,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}bn.registerPostcss=e=>{wn=e};Me=bn;bn.default=bn,un.registerLazyResult(bn),on.registerLazyResult(bn);let _n=ft,Cn=Ne,Sn=Or,xn=Qr;const An=Ke;class kn{constructor(e,t,r){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;var e=Cn;this.result=new An(this._processor,void 0,this._opts),this.result.css=t;let n=this,s=(Object.defineProperty(this.result,"root",{get(){return n.root}}),new _n(e,void 0,this._opts,t));s.isMap()?([r,e]=s.generate(),r&&(this.result.css=r),e&&(this.result.map=e)):(s.clearAnnotation(),this.result.css=s.css)}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||Sn("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=xn;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}}ft=kn;kn.default=kn;let En=ft,On=Me,Ln=e,Mn=n;class Pn{constructor(e=[]){this.version="8.4.35",this.plugins=this.normalize(e)}normalize(e){let t=[];for(var r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return new(this.plugins.length||t.parser||t.stringifier||t.syntax?On:En)(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}ft=Pn;Pn.default=Pn,Mn.registerProcessor(Pn),Ln.registerProcessor(Pn);let Rn=He,In=qe,Tn=Ct,Bn=We,Nn=Je,jn=n,Dn=ot;function Un(e,r){if(Array.isArray(e))return e.map(e=>Un(e));let{inputs:t,...n}=e;if(t){r=[];for(var s of t){let e={...s,__proto__:Nn.prototype};e.map&&(e.map={...e.map,__proto__:In.prototype}),r.push(e)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>Un(e,r))),n.source){let{inputId:e,...t}=n.source;n.source=t,null!=e&&(n.source.input=r[e])}if("root"===n.type)return new jn(n);if("decl"===n.type)return new Rn(n);if("rule"===n.type)return new Dn(n);if("comment"===n.type)return new Tn(n);if("atrule"===n.type)return new Bn(n);throw new Error("Unknown node type: "+e.type)}qe=Un,Un.default=Un;let Fn=He,zn=Me;He=i;let $n=ft;Me=Ne,i=qe;let Gn=e;ft=St;let Hn=Ct,Vn=We;Ne=Ke,qe=Je,e=Qr,St=s;let Wn=ot,Jn=n;Ct=Ie;function o(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new $n(e)}o.plugin=function(r,n){let s=!1;function i(...e){console&&console.warn&&!s&&(s=!0,console.warn(r+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(r+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let t=n(...e);return t.postcssPlugin=r,t.postcssVersion=(new $n).version,t}let e;return Object.defineProperty(i,"postcss",{get(){return e=e||i(),e}}),i.process=function(e,t,r){return o([i(r)]).process(e,t)},i},o.stringify=Me,o.parse=e,o.fromJSON=i,o.list=St,o.comment=e=>new Hn(e),o.atRule=e=>new Vn(e),o.decl=e=>new Fn(e),o.rule=e=>new Wn(e),o.root=e=>new Jn(e),o.document=e=>new Gn(e),o.CssSyntaxError=t,o.Declaration=Fn,o.Container=He,o.Processor=$n,o.Document=Gn,o.Comment=Hn,o.Warning=ft,o.AtRule=Vn,o.Result=Ne,o.Input=qe,o.Rule=Wn,o.Root=Jn,o.Node=Ct,zn.registerPostcss(o);o.default=o;class qn extends HTMLElement{base;contents;component;listType="ul";iconSet;filter={value:"",caseSensitive:!1};static get observedAttributes(){return["contents","icon-set","max-depth","filter"]}_jsonToValueArray(e){let t=JSON.stringify(e);t=t.replace(/[\[\]{}\"]/g,"");let r=[];for(const n of t.split(","))r=r.concat(n.split(":"));return[...new Set(r)]}_emit(e,t,r){e=new CustomEvent(e,{detail:r,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}constructor(){super(),this.base=new $,this.setContents(this.getAttribute("contents")),this.iconSet=this.getAttribute("icon-set")?this.getAttribute("icon-type"):"file",this.maxDepth=this.getAttribute("max-depth")?parseInt(this.getAttribute("max-depth")):-1,this.setFilter(this.getAttribute("filter")),this.style.display="block",this.style.maxWidth="fit-content",this.style.margin="0 1rem 0 0",this.base.addEvent(".flk-branch","click",this.emitNodeToggle)}emitNodeToggle(e){e.stopPropagation();const t=F(e,"flk-tree-nav").target,r=z(e,"branchKey");let n=t.contents;for(const s of r.split("."))n=n[s];e=r.substring(r.indexOf(".")+1);t._emit("tree-click",t,{path:e,data:n,branch:"object"==typeof n})}convertJsonKeyToTitle(e){if(!e)return"";const t=(e="string"!=typeof e?e.toString():e).replace(/([A-Z_])/g,e=>"_"===e?" ":" "+e).trim();return t.charAt(0).toUpperCase()+t.slice(1)}setContents(e){var t=e||this.contents||[];try{switch(typeof t){case"string":this.contents=JSON.parse(t);break;case"object":Array.isArray(t)?this.contents=t:this.contents=[t]}}catch(e){console.log(e)}}applyFilter(e){let t;var r="details"===e.tagName.toLowerCase();t=this.filter.caseSensitive?e.dataset.branchValues.includes(this.filter.value):e.dataset.branchValues.toLowerCase().includes(this.filter.value.toLowerCase()),t?e.parentElement.classList.remove("hidden"):e.parentElement.classList.add("hidden"),r&&t?e.setAttribute("open",""):e.removeAttribute("open")}resetTree(e){e.parentElement.classList.remove("hidden"),e.removeAttribute("open")}filterTree(){let t=setTimeout(()=>{for(const e of this.querySelectorAll("[data-branch-values]"))void 0===this.filter.value||0===this.filter.value.length?this.resetTree(e):this.applyFilter(e);clearTimeout(t)},10)}setFilter(e){const t=e||{};try{switch(typeof t){case"string":t.includes("{")?(this.filter=JSON.parse(t),!1===this.filter.caseSensitive&&(this.filter.value=this.filter.value.toLowerCase())):this.filter.value=e.toLowerCase();break;case"object":this.filter=t}}catch(e){console.log(e)}this.filterTree()}createTextTag(n,s){if("string"==typeof n&&(n.includes("(")||n.includes("["))){let e=document.createElement("div");var i=n.indexOf("("),o=n.indexOf("["),i=-1===o?i:o;let t=document.createElement("span"),r=(t.innerText=this.convertJsonKeyToTitle(n.substring(0,i)),document.createElement("small"));r.innerText=n.substring(i),r.style.marginLeft="1rem",e.append(t,r),e.style.display="inline-flex",e.style.alignItems="center",s.append(e)}else s.innerText=this.convertJsonKeyToTitle(n)}createLeaf(e,t,r,n=[]){let s=document.createElement("li");s.classList.add("cursor-no-select"),s.style.marginTop="0.4rem",s.dataset.branchKey=r;const i="file"===this.iconSet?'':'';s.style.listStyleImage=`url('data:image/svg+xml,${i}')`,s.style.position="relative",s.style.left="2px";let o=document.createElement("span");r=[e].concat(n);if(o.dataset.branchValues=[...new Set(r)].join(),this.createTextTag(e,o),o.style.position="relative",o.style.top="-3px",s.append(o),t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);const i="file"===this.iconSet?G:H;e.style.listStyleImage=`url('data:image/svg+xml,${i}')`,e.append(s),t.append(e)}else t.append(s)}createBranch(r,t,n,s){if(s===this.maxDepth&&"object"==typeof r){var i,o=Array.isArray(r)?r:Object.keys(r);if("object"==typeof o[0]){let e=[];for(const g of o)e=e.concat(Object.keys(g));for(i of[...new Set(e)]){var h=document.createElement(this.listType);t.append(this.createBranch(i,h,n+"."+i,s+1))}}else for(const l of o){let e;r[l]&&(e=this._jsonToValueArray(r[l])),this.createLeaf(l,t,n,e)}}else if(Array.isArray(r)){var a;let e=[];if("object"==typeof r[0]){for(const y of r)e=e.concat(Object.keys(y));for(a of[...new Set(e)]){var p=document.createElement(this.listType);t.append(this.createBranch(a,p,n+"."+a,s+1))}}else for(var d in r){var f=document.createElement(this.listType);t.append(this.createBranch(r[d],f,n+"."+d,s+1))}}else if(null!==r&&"object"==typeof r){const c=[];for(const u of Object.keys(r)){let e=document.createElement("li"),t=(e.classList.add("cursor-no-select"),e.style.position="relative",e.style.left="2px",e.dataset.branchKey=n+"."+u,document.createElement("details"));t.classList.add("flk-branch"),t.dataset.branchValues=[u].concat(this._jsonToValueArray(r[u])),t.style.position="relative",t.style.top="-3px",t.classList.add("cursor-default");var m=document.createElement("summary");this.createTextTag(u,m),t.append(m),e.append(this.createBranch(r[u],t,n+"."+u,s+1)),c.push(e)}if(t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);o="file"===this.iconSet?G:H;e.style.listStyleImage=`url('data:image/svg+xml,${o}')`;for(const v of c)e.append(v);t.append(e)}else for(const e of c)t.append(e)}else this.createLeaf(r,t,n);return t}createHtml(){let e=document.createElement(this.listType);var t="file"===this.iconSet?G:'';if(e.style.listStyleImage=`url('data:image/svg+xml,${t}')`,e.style.marginLeft="3rem",this.contents.length){for(const r in this.contents)e=this.createBranch(this.contents[r],e,r,0);this.component=e}else this.component=e}attributeChangedCallback(e,t,r){switch(e){case"contents":this.setContents(r);break;case"icon-set":this.iconSet=r;break;case"max-depth":this.maxDepth="string"==typeof r?parseInt(r):r;break;case"filter":this.setFilter(r)}this.init()}connectedCallback(){this.init()}disconnectedCallback(){this.base.removeEvents(this)}init(){this.createHtml(),this.base.render(this)}}customElements.define("flk-table",W),customElements.define("flk-draggable",J),customElements.define("flk-modal",q),customElements.define("flk-dropdown",K),customElements.define("flk-tree-nav",qn)}(require$$0,require$$2,require$$1$1,require$$1); \ No newline at end of file +!function(e,n,s,i){"use strict";function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a,u,g,e=c(e),n=c(n),s=c(s),i=c(i);(t=a=a||{}).Date="date",t.String="string",t.Float="float",t.Number="number",t.Array="array",t.Object="object",t.Bool="bool",t.Currency="currency",t.Undefined="undefined",t.Null="null";const h={date:/^(\d{1,4}-\d{1,4}-\d{1,4}(T)?)/gim,currency:/^[$|€]\s?[0-9]*(\.|,)?\d*(\.|,)?\d*/gim,float:/\d+[,|.]\d+[,|.]?\d*/gim,currencySign:/\$|€/gim,array:/^\s?[[].[^,]+[\]],?/gi,precision:/[-+$€,.]/gm,string:/[a-zA-Z]/gim},m=e=>{return null===e||"null"===e?a.Null:e||0===e||!1===e?null===new RegExp(h.date).exec(e)||isNaN(Date.parse(e))?new RegExp(h.currency).exec(e)?a.Currency:!new RegExp(h.string).exec(e)&&new RegExp(h.float).exec(e.toString())?a.Float:isNaN(e)&&0!==e?Array.isArray(e)?a.Array:"object"==typeof e?a.Object:a.String:a.Number:a.Date:a.Undefined},y=(t,e)=>{const r={value:void 0,type:e=e||m(t),currencySign:""};switch(r.type){case a.String:r.value=t.toString();break;case a.Float:case a.Currency:var n=(t=t.toString()).match(new RegExp(/(,)/gim)),s=t.match(new RegExp(/(\.)/gim));if(n)for(let e=1;e<=n.length;e++)t=e!==n.length||s?t.replace(",",""):t.replace(",",".");if(r.type===a.Currency){const o=new RegExp(h.currencySign);var i=o.exec(t);r.currencySign=null!==i?i[0]:"",t=t.replace(o,"")}r.value=parseFloat(t).toPrecision(12);break;case a.Number:r.value=Number(t);break;case a.Date:r.value=Date.parse(t);break;case a.Array:t.length?"object"==typeof t[0]?r.value=t.map(e=>JSON.stringify(e)).join(", "):r.value=t.join(", "):r.value="";break;case a.Object:r.value=t;break;case a.Undefined:r.value="";break;case a.Null:r.value=null}return r};function v(e,t){var r;let n;for(r of e.split("."))r=r.trim(),n?"object"!=typeof n||Array.isArray(n)||(n=n[r]):n=t[r];return n}const b=(e,t)=>tet<=e,S=(e,t)=>e<=t,x=(e,t,r)=>r?e.toLowerCase()==t.toLowerCase():e==t,A=(e,t)=>e===t,k=(e,t)=>e!=t,E=(e,t)=>e!==t,L=(e,t)=>null!=t&&"string"==typeof e&&0<=e.toLowerCase().indexOf(t.toString().toLowerCase()),O=(e,t)=>null!=t&&0<=e.toString().toLowerCase().indexOf(t.toString().toLowerCase()),M=(e,t)=>null!=t&&"string"==typeof e&&e.toLowerCase().indexOf(t.toString().toLowerCase())<0;function P(r,n){if(0===n.length)return r;{var s=r;const o=[],a=[];let e=[];for(const l of n)l.type&&l.type!==u.And?(e.length&&a.push(e),e=[l]):e.push(l);a.push(e);let t=[];for(const e of a)t=t.concat(R(s,e));t=[...new Set(t)];var i=s.length;for(let e=0;e":return b;case"<":return _;case">=":return C;case"<=":return S;case"is":case"==":return x;case"!is":case"!=":return k;case"===":return A;case"!==":return E;case"like":case"~":case"contains":return L;case"!contains":case"!like":case"!~":return M;default:return O}}(a.operator);if(!l(i,o,a.ignoreCase)){e=!1;break}}e&&r.push(n)}return r};function T(e,t){if(!t||0===t.length)return e;if(1{if(0===r.length)r=r.concat(I(s,e));else{for(const t of r)n=n.concat(I(t,e));r=n,n=[]}}),r}return I(e,t[0])}function I(e,t){const r=[],n=[];do{if(!e||0===e.length)break;var s=e.shift();if(!s)break;const o=s[t];var i=n.indexOf(o.toString());0<=i?r[i].push(s):(n.push(o.toString()),void 0!==r[n.length-1]?r[n.length-1].push(s):r.push([s]))}while(0{if(t){var r=e;const n={};for(const s of t){let e=r.map(e=>e[s].toString());const i=e.map(e=>m(e));i.some(e=>e===a.Float)?(e=e.map(e=>parseFloat(e)),n[s]=parseFloat(e.reduce((e,t)=>e+t).toFixed(2))):(e=e.map(e=>parseInt(e)),n[s]=e.reduce((e,t)=>e+t))}return n}return{}};class D{model;sortDetails=[];filterDetails=[];selection=[];groupByProperties=[];distinctProperties=[];concatenationToken=", ";constructor(e){this.model=JSON.parse(JSON.stringify(e))}sort(e){return this.sortDetails=e,this}orderBy(e,t){return this.sortDetails.push({propertyName:e,direction:t}),this}thenOrderBy(e,t){return this.orderBy(e,t)}filter(e){return Array.isArray(e)?this.filterDetails=e:this.filterDetails.push(e),this}where(e,t,r,n,s){return this.filterDetails.push({propertyName:e,operator:t,value:r,type:n,ignoreCase:s}),this}andWhere(e,t,r,n){return this.where(e,t,r,u.And,n),this}orWhere(e,t,r,n){return this.where(e,t,r,u.Or,n),this}group(e){return this.groupByProperties=e,this}groupBy(e){return this.groupByProperties.push(e),this}thenGroupBy(e){return this.groupByProperties.push(e),this}select(e){return Array.isArray(e)?this.selection=e:"*"!==e&&(this.selection=[e]),this}distinct(e,t){return t&&(this.concatenationToken=t),Array.isArray(e)?this.distinctProperties=e:e&&(this.distinctProperties=[e]),this}execute(){return T(function(t,r){if(0===r.length)return t;{var n=r;let e=[];for(const s of t){const i={};for(const o of n)i[o]=s[o];e.push(i)}return e}}(function(r,n,u){if(!n||!n.length)return r;const s=[],h=[];for(const f of r){const o={};let t="";for(const e of n){var p=v(e,f);o[e]=p,t+=p}if(!h.includes(t)){let e=r;for(const a of Object.keys(o))e=e.filter(e=>e[a]===o[a]);h.push(t),s.push(e)}}const t=[];for(const m of s){let e={};for(const l of m){var i,d=Object.keys(e);if(d.length)for(const c of d)n.includes(c)||(i=e[c],Array.isArray(i)?(i=l[c],Array.isArray(i)?e[c]=[...new Set(...e[c].concat(l[c]))]:e[c].includes(l[c])||e[c].push(l[c])):isNaN(e[c])&&isNaN(l[c])?e[c]!==l[c]&&(e[c]=[e[c],l[c]]):e[c]=e[c]+l[c]);else e=l}t.push(e)}return t.forEach(e=>{for(const t in e)Array.isArray(e[t])&&(e[t]=e[t].join(u))}),t}(B(P(JSON.parse(JSON.stringify(this.model)),this.filterDetails),this.sortDetails),this.distinctProperties,this.concatenationToken),this.selection),this.groupByProperties)}sum(e,t){e=Array.isArray(e)?e:[e];return j(t||this.model,e)}}function U(e,t){t=t?t.toUpperCase():"FLK-";return e.toUpperCase().includes(t)}function F(e,t){var{timeStamp:r,type:n,x:s,y:i}=e;let o=e.target;do{if(!o||"HTML"===o.tagName||U(o.tagName,t)){"HTML"===o.tagName&&(o=null);break}}while(o=o.parentNode||o.parentElement,!U(o.tagName,t));return{target:o,timeStamp:r,type:n,x:s,y:i}}function z(e,t){let r=e.target,n="";for(;r.dataset[t]?n=r.dataset[t]:r=r.parentNode,!n;);return n}class ${constructor(){}_topLevelClasses=[];_events=[];generateId(){return"flk-"+function e(){const t=([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)),r=t.split("-")[0];return window.$flightkitUUIDStore||(window.$flightkitUUIDStore=[]),window.$flightkitUUIDStore.some(e=>e===r)?e():(window.$flightkitUUIDStore.push(r),r)}()}render(t){if(!t.component)throw new Error("Component is not assigned! Can't render");t.id=t.id||this.generateId();var e=this._getAllEventAttributes(t);if(e){var r="#"+t.id;for(const i of e){var n="e-"+i;this.addEvent(r,i,t.getAttribute(n))}}var s=Object.keys(t.classList).length;if(s){for(let e=0;e{this._assignToDom(t,t.component),clearTimeout(this._renderTimer)},10)}addEvent(e,t,r){this._events.push({selector:e,eventType:t,callback:r})}_getExternalCallback(e){let t=void 0;for(const r of e.split("."))t=(t||window)[r];return t}_getAllEventAttributes(e){e=e.attributes;const t=Array.from(e).filter(e=>e.name.startsWith("e-"));return t.map(e=>e.name.slice(2))}_isFlightkitElement(e){return e.toUpperCase().includes("FLK-")}_outerEventHandler(e){const t=F(e),r=(t.contents=e.detail,t.target.getAttribute("e-"+t.type));let n=void 0;for(const s of r.split("."))n=(n||window)[s];return e.preventDefault(),e.stopPropagation(),n(t)}_addEvents(e){if(e.isConnected)for(const r of this._events)if(r.selector.startsWith("."))for(const n of document.querySelectorAll(r.selector))this._addEventToElement(r,n);else{var t=document.querySelector(r.selector);this._addEventToElement(r,t)}}_addEventToElement(e,t){t&&("function"==typeof e.callback?(t.removeEventListener(e.eventType,e.callback),t.addEventListener(e.eventType,e.callback)):(t.removeEventListener(e.eventType,this._outerEventHandler),t.addEventListener(e.eventType,this._outerEventHandler)))}removeEvents(){for(const t of this._events)if(t.selector.startsWith("."))for(const r of document.querySelectorAll(t.selector))this._addEventToElement(t,r);else{var e=document.querySelector(t.selector);this._addEventToElement(t,e)}this._events=[]}_removeEventToElement(e,t){t&&("function"==typeof e.callback?t.removeEventListener(e.eventType,e.callback):t.removeEventListener(e.eventType,this._outerEventHandler))}_assignToDom(e,t){e.innerHTML="";for(const n of Array.isArray(t)?t:[t])e.append(n);const r=setTimeout(()=>{this._addEvents(e),clearTimeout(r)},10)}}const G='',H='';function V(e){const t=new DOMParser;return t.parseFromString(e,"image/svg+xml").documentElement}class W extends HTMLElement{base;component=null;_contents=[];_orderBy=[];properties=new Set;_columnOrder=[];_filter="";_selectionProperty="";_selectedIds=new Set;uniqueEntriesByProperties={};propertyLabelDictionary={};_templates={};_templateClasses={};static get observedAttributes(){return["contents","columns","order","filter","selection-property","templates"]}get columnOrder(){return this._columnOrder.length?this._columnOrder:this.properties}set columnOrder(e){let t;"string"==typeof e&&(t=e.split(",")),t=e,this._columnOrder=t}get contents(){return this._contents}set contents(e){this.analyzeData(e),this._contents=new D(e)}get orderBy(){return this._orderBy}set orderBy(e){if(Array.isArray(e))this._orderBy=e;else{const n=[];for(const s of e.split(",")){var t=s.split("|"),r=t[0],t=1e[r._selectionProperty])):new Set;e=t?r.contents.execute():[];r._emit("select",r,{selection:e}),r._updateCheckboxes(r)}emitSelect(e){var t=e.target.checked,r=e.target.dataset.objectId;const n=F(e).target,s=(t?n._selectedIds.add(r):n._selectedIds.delete(r),n._selectionProperty);e=n.contents.execute().filter(e=>n._selectedIds.has(e[s]));n._emit("select",n,{selection:e}),n._updateCheckboxes(n)}sortData(e){const t=F(e).target,r=z(e,"column");r&&(-1<(e=t._orderBy.findIndex(e=>e.propertyName===r))?"asc"===t._orderBy[e].direction?t._orderBy[e].direction="desc":t._orderBy.splice(e,1):t._orderBy.push({propertyName:r,direction:"asc"}),t.createHtml(),t.base.render(t))}setColumnOrder(e){this._columnOrder=e?Array.isArray(e)?e:e.split(","):[]}analyzeData(t){this.properties=new Set;var r=t.length;for(let e=0;e"_"===e?" ":" "+e.toLowerCase()).trim();var r=t.charAt(0).toUpperCase()+t.slice(1);return this.propertyLabelDictionary[e]=r}parseTemplate(e,n){return e.replace(/\{\{([\s\S]+?)\}\}/gim,(e,t)=>{let r="";t=t.trim();t=n[t];return t&&(r=t),Array.isArray(r)?r.join(", "):r.toString().trim()})}createSelectionCheckbox(e){const t=document.createElement("input");return t.setAttribute("type","checkbox"),t.classList.add("flk-selection-checkbox"),e&&(t.dataset.selected=e[this._selectionProperty]),t}createRow(e){const t=document.createElement("tr");if(this._selectionProperty.length){const s=document.createElement("td");var r=this.base.generateId();const i=this.createSelectionCheckbox(e);i.id=r,i.dataset.objectId=e[this._selectionProperty];var n=e[this._selectionProperty];this._selectedIds.has(n)?i.checked=!0:i.checked=!1,this.base.addEvent("#"+r,"change",this.emitSelect),s.append(i),t.append(s)}for(const o of this.columnOrder){const a=document.createElement("td");this._templates[o]?(a.innerHTML=this.parseTemplate(this._templates[o],e),this._templateClasses[o]&&a.classList.add(...this._templateClasses[o])):a.innerText=e[o],t.append(a)}return t}createBody(e){const t=document.createElement("tbody");for(const n of e){var r=this.createRow(n,null);t.append(r)}return t}createHead(){const e=document.createElement("thead"),t=document.createElement("tr");if(t.classList.add("cursor-pointer"),this._selectionProperty.length){const s=document.createElement("th");var r=this.base.generateId();const i=this.createSelectionCheckbox();i.id=r;var u=this.contents.execute().length;0e.propertyName===o);if(n){const c=document.createElement("span");c.innerHTML="asc"===n.direction?'':'',a.append(c)}t.append(a)}return e.append(t),e}addEvent(e,t,r){this.base.addEvent(e,t,r)}init(){this.createHtml(),this.base.render(this)}}class J extends HTMLElement{base;componentId;constructor(){super(),this.base=new $}connectedCallback(){var e=this.getAttribute("top"),t=this.getAttribute("left"),r=this.getAttribute("center"),n=this.getAttribute("zIndex");this.id||(this.id=this.base.generateId()),this.style.display="block",this.style.position="fixed","string"==typeof r?(this.style.top=e||"50%",this.style.left="50%",this.style.transform="translate(-50%, -50%)"):(this.style.top=e||this.clientTop+"px",this.style.left=t||this.clientLeft+"px"),n&&(this.style.zIndex=n),this.componentId=this.getAttribute("handle");const s=document.createElement("div");s.innerHTML=this.innerHTML,this.component=s;r="#"+(this.componentId||this.id);this.base.addEvent(r,"mousedown",this._dragElement),this.base.addEvent(r,"mouseup",this._reset),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this)}_dragElement(e){const r=F(e,"flk-draggable").target;let n,s;function t(e){n=e.clientX-r.offsetLeft,s=e.clientY-r.offsetTop}function i(e){var t=e.clientX-n,e=e.clientY-s;r.style.left=t+"px",r.style.top=e+"px"}function o(e){e.preventDefault()}function a(){r.removeAttribute("draggable"),r.removeEventListener("dragstart",t),r.removeEventListener("dragend",a),document.removeEventListener("dragover",o),document.removeEventListener("drop",i)}r.setAttribute("draggable",!0),r.addEventListener("dragstart",t),r.addEventListener("dragend",a),document.addEventListener("dragover",o),document.addEventListener("drop",i)}}class q extends HTMLElement{_id;base;_draggableId;constructor(){super(),this.base=new $}_emit(e,t,r){e=new CustomEvent(e,{detail:r,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}_closeModal(e){e.stopPropagation();const t=F(e,"flk-modal").target;t.classList.add("hidden")}closeModal(e){this.classList.add("hidden")}openModal(e=!0){const t=document.getElementById(this._draggableId);e&&(t.style.top="40%",t.style.left="50%"),this.classList.remove("hidden")}connectedCallback(){this.id||(this.id=this.base.generateId());const e=document.createElement("div");var t=this.base.generateId();const r=document.createElement("flk-draggable"),n=(this._draggableId=this.base.generateId(),r.id=this._draggableId,r.setAttribute("center",""),r.setAttribute("top","40%"),r.setAttribute("handle",t),r.setAttribute("zIndex","1080"),r.classList.add("border","shadow-lg","bg-white"),r.style.width="max-content",document.createElement("div"));var s=this.getAttribute("modal-title");if(s){const c=document.createElement("span");c.innerText=s,c.classList.add("ml-1","mr-auto"),n.append(c)}n.id=t;const i=this.getAttribute("header-class");let o=[];i?o=o.concat(i.split(" ")):o.push("bg-gray-light"),n.classList.add(...o,"border-bottom","row","justify-end","cursor-no-select");s=this.base.generateId();const a=document.createElement("button"),l=(a.classList.add("py-0","px-1","outline-hover","no-border","cursor-default",...o),a.innerText="X",a.id=s,n.append(a),r.append(n),document.createElement("div"));l.innerHTML=this.innerHTML,r.append(l),e.append(r),this.component=e,this.base.addEvent("#"+s,"click",this._closeModal),this.base.render(this),this.classList.add("hidden")}disconnectedCallback(){this.base.removeEvents(this)}}class K extends HTMLElement{base;_buttonId;_drawerId;_iconId;constructor(){super(),this.base=new $}connectedCallback(){this.style.position="relative",this.style.display="flex",this.style.width="fit-content",this._buttonId=this.base.generateId();const e=document.createElement("button"),t=(e.classList.add("row"),e.id=this._buttonId,document.createElement("span")),r=(t.innerText=this.getAttribute("text"),this._iconId=this.base.generateId(),document.createElement("span"));var n=V('');const s=V(''),i=(s.classList.add("hidden"),r.append(n,s),r.id=this._iconId,e.append(t,r),this._drawerId=this.base.generateId(),document.createElement("div"));i.id=this._drawerId,i.classList.add("shadow","inline-block","bg-white"),i.style.position="absolute",i.style.zIndex="1040";n=this.querySelector("template");n.innerHTML.length?i.innerHTML=n.innerHTML:i.append(n.firstChild),i.style.display="none",this.component=[e,i],this.base.addEvent("#"+this._buttonId,"click",this.toggleMenu);const o=document.querySelector("body");""!==o.getAttribute("flk-close-dropdown")&&(o.setAttribute("flk-close-dropdown",""),o.addEventListener("click",this.closeAllDropdownButtons)),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this);var e=document.querySelectorAll("flk-dropdown");if(!e||!e.length){const t=document.querySelector("body");t.removeAttribute("flk-close-dropdown"),t.removeEventListener("click",this.closeAllDropdownButtons)}}toggleMenu(e){const t=F(e).target;e=t._drawerId;const r=document.getElementById(e);var e="none"!==r.style.display,n=(r.style.display=e?"none":"block",t.getAttribute("drawer-width")),n=("string"==typeof t.getAttribute("right")&&(r.style.right="0px"),r.style.top=t.offsetHeight+"px",r.style.width=n||t.offsetWidth+"px",t._iconId);const s=document.getElementById(n);e?(s.childNodes[0].classList.remove("hidden"),s.childNodes[1].classList.add("hidden")):(s.childNodes[0].classList.add("hidden"),s.childNodes[1].classList.remove("hidden"))}_closeDropdown(){var e=this._drawerId;const t=document.getElementById(e);if("none"!==t.style.display){e=this._iconId;const r=document.getElementById(e);t.style.display="none",r.childNodes[0].classList.remove("hidden"),r.childNodes[1].classList.add("hidden")}}closeAllDropdownButtons(e){var t,r=F(e,"flk-dropdown").target,e=document.querySelectorAll("flk-dropdown");if(r)for(const n of e)r._buttonId!==n._buttonId&&(t=n._drawerId,"none"!==document.getElementById(t).style.display&&n._closeDropdown());else for(const s of e)s._closeDropdown()}}var t={exports:{}};let Z=e.default,Y=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||"win32"===process.platform||Z.isatty(1)&&"dumb"!==process.env.TERM||"CI"in process.env),r=(r,n,s=r)=>e=>{let t=""+e;e=t.indexOf(n,r.length);return~e?r+X(t,n,s,e)+n:r+t+n},X=(e,t,r,n)=>{var s=e.substring(0,n)+r;let i=e.substring(n+t.length);e=i.indexOf(t);return~e?s+X(i,t,r,e):s+i};e=(e=Y)=>({isColorSupported:e,reset:e?e=>`${e}`:String,bold:e?r("","",""):String,dim:e?r("","",""):String,italic:e?r("",""):String,underline:e?r("",""):String,inverse:e?r("",""):String,hidden:e?r("",""):String,strikethrough:e?r("",""):String,black:e?r("",""):String,red:e?r("",""):String,green:e?r("",""):String,yellow:e?r("",""):String,blue:e?r("",""):String,magenta:e?r("",""):String,cyan:e?r("",""):String,white:e?r("",""):String,gray:e?r("",""):String,bgBlack:e?r("",""):String,bgRed:e?r("",""):String,bgGreen:e?r("",""):String,bgYellow:e?r("",""):String,bgBlue:e?r("",""):String,bgMagenta:e?r("",""):String,bgCyan:e?r("",""):String,bgWhite:e?r("",""):String});t.exports=e(),t.exports.createColors=e;const Q="'".charCodeAt(0),ee='"'.charCodeAt(0),te="\\".charCodeAt(0),re="/".charCodeAt(0),ne="\n".charCodeAt(0),se=" ".charCodeAt(0),ie="\f".charCodeAt(0),oe="\t".charCodeAt(0),ae="\r".charCodeAt(0),le="[".charCodeAt(0),ce="]".charCodeAt(0),ue="(".charCodeAt(0),he=")".charCodeAt(0),pe="{".charCodeAt(0),de="}".charCodeAt(0),fe=";".charCodeAt(0),me="*".charCodeAt(0),ge=":".charCodeAt(0),ye="@".charCodeAt(0),ve=/[\t\n\f\r "#'()/;[\\\]{}]/g,we=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,be=/.[\r\n"'(/\\]/,_e=/[\da-f]/i;function Ce(t,e={}){let n=t.css.valueOf(),d=e.ignoreErrors,s,i,f,m,o,a,l,g,c,u,y=n.length,h=0,v=[],p=[];function w(e){throw t.error("Unclosed "+e,h)}return{back:function(e){p.push(e)},endOfFile:function(){return 0===p.length&&h>=y},nextToken:function(e){if(p.length)return p.pop();if(!(h>=y)){var t=!!e&&e.ignoreUnclosed;switch(s=n.charCodeAt(h),s){case ne:case se:case oe:case ae:case ie:for(i=h;i+=1,s=n.charCodeAt(i),s===se||s===ne||s===oe||s===ae||s===ie;);u=["space",n.slice(h,i)],h=i-1;break;case le:case ce:case pe:case de:case ge:case fe:case he:var r=String.fromCharCode(s);u=[r,r,h];break;case ue:if(g=v.length?v.pop()[1]:"",c=n.charCodeAt(h+1),"url"===g&&c!==Q&&c!==ee&&c!==se&&c!==ne&&c!==oe&&c!==ie&&c!==ae){i=h;do{if(a=!1,i=n.indexOf(")",i+1),-1===i){if(d||t){i=h;break}w("bracket")}for(l=i;n.charCodeAt(l-1)===te;)--l,a=!a}while(a);u=["brackets",n.slice(h,i+1),h,i],h=i}else i=n.indexOf(")",h+1),m=n.slice(h,i+1),-1===i||be.test(m)?u=["(","(",h]:(u=["brackets",m,h,i],h=i);break;case Q:case ee:f=s===Q?"'":'"',i=h;do{if(a=!1,i=n.indexOf(f,i+1),-1===i){if(d||t){i=h+1;break}w("string")}for(l=i;n.charCodeAt(l-1)===te;)--l,a=!a}while(a);u=["string",n.slice(h,i+1),h,i],h=i;break;case ye:ve.lastIndex=h+1,ve.test(n),i=0===ve.lastIndex?n.length-1:ve.lastIndex-2,u=["at-word",n.slice(h,i+1),h,i],h=i;break;case te:for(i=h,o=!0;n.charCodeAt(i+1)===te;)i+=1,o=!o;if(s=n.charCodeAt(i+1),o&&s!==re&&s!==se&&s!==ne&&s!==oe&&s!==ae&&s!==ie&&(i+=1,_e.test(n.charAt(i)))){for(;_e.test(n.charAt(i+1));)i+=1;n.charCodeAt(i+1)===se&&(i+=1)}u=["word",n.slice(h,i+1),h,i],h=i;break;default:h=(s===re&&n.charCodeAt(h+1)===me?(i=n.indexOf("*/",h+2)+1,0===i&&(d||t?i=n.length:w("comment")),u=["comment",n.slice(h,i+1),h,i]):(we.lastIndex=h+1,we.test(n),i=0===we.lastIndex?n.length-1:we.lastIndex-2,u=["word",n.slice(h,i+1),h,i],v.push(u)),i)}return h++,u}},position:function(){return h}}}e=t.exports;let Se=Ce,xe;const Ae={";":e.yellow,":":e.yellow,"(":e.cyan,")":e.cyan,"[":e.yellow,"]":e.yellow,"{":e.yellow,"}":e.yellow,"at-word":e.cyan,brackets:e.cyan,call:e.cyan,class:e.yellow,comment:e.gray,hash:e.magenta,string:e.green};function ke(e){let r=Se(new xe(e),{ignoreErrors:!0}),n="";for(;!r.endOfFile();){let e=r.nextToken(),t=Ae[function([e,t],r){if("word"===e){if("."===t[0])return"class";if("#"===t[0])return"hash"}if(!r.endOfFile()){t=r.nextToken();if(r.back(t),"brackets"===t[0]||"("===t[0])return"call"}return e}(e,r)];t?n+=e[1].split(/\r?\n/).map(e=>t(e)).join("\n"):n+=e[1]}return n}ke.registerInput=function(e){xe=e};e=ke;let Ee=t.exports,Le=e;class Oe extends Error{constructor(e,t,r,n,s,i){super(e),this.name="CssSyntaxError",this.reason=e,s&&(this.file=s),n&&(this.source=n),i&&(this.plugin=i),void 0!==t&&void 0!==r&&("number"==typeof t?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,Oe)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file||"",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source,r=(null==e&&(e=Ee.isColorSupported),Le&&e&&(t=Le(t)),t.split(/\r?\n/)),n=Math.max(this.line-3,0);var s=Math.min(this.line+2,r.length);let i=String(s).length,o,a;if(e){let{bold:t,gray:r,red:n}=Ee.createColors(!0);o=e=>t(n(e)),a=e=>r(e)}else o=a=e=>e;return r.slice(n,s).map((e,t)=>{var t=n+1+t;let r=" "+(" "+t).slice(-i)+" | ";return t===this.line?(t=a(r.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," "),o(">")+a(r)+e+"\n "+t+o("^")):" "+a(r)+e}).join("\n")}toString(){let e=this.showSourceCode();return e=e&&"\n\n"+e+"\n",this.name+": "+this.message+e}}var t=Oe,Me=(Oe.default=Oe,{});Me.isClean=Symbol("isClean"),Me.my=Symbol("my");const Pe={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class Re{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name;var n=e.params?this.rawValue(e,"params"):"";void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes?this.block(e,r+n):(t=(e.raws.between||"")+(t?";":""),this.builder(r+n+t,e))}beforeAfter(e,t){let r,n=(r="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose"),e.parent),s=0;for(;n&&"root"!==n.type;)s+=1,n=n.parent;if(r.includes("\n")){var i=this.raw(e,null,"indent");if(i.length)for(let e=0;e{if(n=e.raws[t],void 0!==n)return!1}),void 0===n&&(n=Pe[r]),i.rawCache[r]=n,n}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&0{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=void 0===r?this.raw(t,null,"beforeDecl"):r&&r.replace(/\S/g,""),r}rawBeforeDecl(e,t){let r;return e.walkDecls(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=void 0===r?this.raw(t,null,"beforeRule"):r&&r.replace(/\S/g,""),r}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(t){let r;return t.walk(e=>{if(e.nodes&&(e.parent!==t||t.first!==e)&&void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=r&&r.replace(/\S/g,""),r}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(r){if(r.raws.indent)return r.raws.indent;let n;return r.walk(e=>{var t=e.parent;if(t&&t!==r&&t.parent&&t.parent===r&&void 0!==e.raws.before)return t=e.raws.before.split("\n"),n=t[t.length-1],n=n.replace(/\S/g,""),!1}),n}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){var r=e[t],e=e.raws[t];return e&&e.value===r?e.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}}var Te=Re;Re.default=Re;let Ie=Te;function Be(e,t){let r=new Ie(t);r.stringify(e)}var Ne=Be;Be.default=Be;let{isClean:je,my:De}=Me,Ue=t,Fe=Te,ze=Ne;function $e(t,r){let n=new t.constructor;for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&"proxyCache"!==s){let e=t[s];var i=typeof e;"parent"===s&&"object"==i?r&&(n[s]=r):"source"===s?n[s]=e:Array.isArray(e)?n[s]=e.map(e=>$e(e,n)):("object"==i&&null!==e&&(e=$e(e)),n[s]=e)}return n}class Ge{constructor(e={}){for(var t in this.raws={},this[je]=!1,this[De]=!0,e)if("nodes"===t){this.nodes=[];for(var r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){var t;return e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)&&(t=this.source,e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)),e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(var t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=$e(this);for(var r in e)t[r]=e[r];return t}cloneAfter(e={}){e=this.clone(e);return this.parent.insertAfter(this,e),e}cloneBefore(e={}){e=this.clone(e);return this.parent.insertBefore(this,e),e}error(e,t={}){var r,n;return this.source?({end:r,start:n}=this.rangeBy(t),this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)):new Ue(e)}getProxyProcessor(){return{get(e,t){return"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t]},set(e,t,r){return e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0}}}markDirty(){if(this[je]){this[je]=!1;let e=this;for(;e=e.parent;)e[je]=!1}}next(){var e;if(this.parent)return e=this.parent.index(this),this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;return e.index?r=this.positionInside(e.index,t):!e.word||-1!==(e=(t=this.toString()).indexOf(e.word))&&(r=this.positionInside(e,t)),r}positionInside(t,e){var r=e||this.toString();let n=this.source.start.column,s=this.source.start.line;for(let e=0;e"object"==typeof e&&e.toJSON?e.toJSON(null,r):e);else if("object"==typeof t&&t.toJSON)n[s]=t.toJSON(null,r);else if("source"===s){let e=r.get(t.input);null==e&&(e=i,r.set(t.input,i),i++),n[s]={end:t.end,inputId:e,start:t.start}}else n[s]=t}return t&&(n.inputs=[...r.keys()].map(e=>e.toJSON())),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=ze){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(var s in r)n[s]=r[s];return e.warn(t,n)}get proxyOf(){return this}}var Te=Ge,He=(Ge.default=Ge,Te);class Ve extends He{constructor(e){super(e=e&&void 0!==e.value&&"string"!=typeof e.value?{...e,value:String(e.value)}:e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}}var He=Ve,We=(Ve.default=Ve,{}),Je={},qe={},Ke={},Ze="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),Ye=(Ke.encode=function(e){if(0<=e&&e>>=5)&&(t|=32),r+=Ye.encode(t),0>1,1==(1&a)?-i:i),r.rest=t};var Ke={},l=Ke,Xe=(l.getArg=function(e,t,r){if(t in e)return e[t];if(3===arguments.length)return r;throw new Error('"'+t+'" is a required argument.')},/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/),Qe=/^data:.+\,.+$/;function et(e){e=e.match(Xe);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}function tt(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}l.urlParse=et,l.urlGenerate=tt,rt=function(e){var t=e,r=et(e);if(r){if(!r.path)return e;t=r.path}for(var n,e=l.isAbsolute(t),s=[],i=0;;){if(n=i,-1===(i=t.indexOf("/",n))){s.push(t.slice(n));break}for(s.push(t.slice(n,i));in;e--){var o=r[e-1],a=r[e];if(Pt(o,a)<=0)break;r[e-1]=a,r[e]=o}else Ot(r,Pt,n)}function Tt(e,s){var t=e,e=("string"==typeof e&&(t=w.parseSourceMapInput(e)),w.getArg(t,"version")),t=w.getArg(t,"sections");if(e!=this._version)throw new Error("Unsupported version: "+e);this._sources=new Et,this._names=new Et;var i={line:-1,column:0};this._sections=t.map(function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var t=w.getArg(e,"offset"),r=w.getArg(t,"line"),n=w.getArg(t,"column");if(r=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))},p.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;var r=this._findSourceIndex(e);if(0<=r)return this.sourcesContent[r];var n,r=e;if(null!=this.sourceRoot&&(r=w.relative(this.sourceRoot,r)),null!=this.sourceRoot&&(n=w.urlParse(this.sourceRoot))){e=r.replace(/^file:\/\//,"");if("file"==n.scheme&&this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];if((!n.path||"/"==n.path)&&this._sources.has("/"+r))return this.sourcesContent[this._sources.indexOf("/"+r)]}if(t)return null;throw new Error('"'+r+'" is not in the SourceMap.')},p.prototype.generatedPositionFor=function(e){var t=w.getArg(e,"source");if((t=this._findSourceIndex(t))<0)return{line:null,column:null,lastColumn:null};t={source:t,originalLine:w.getArg(e,"line"),originalColumn:w.getArg(e,"column")},e=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",w.compareByOriginalPositions,w.getArg(e,"bias",f.GREATEST_LOWER_BOUND));if(0<=e){e=this._originalMappings[e];if(e.source===t.source)return{line:w.getArg(e,"generatedLine",null),column:w.getArg(e,"generatedColumn",null),lastColumn:w.getArg(e,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},ft.BasicSourceMapConsumer=p,(Tt.prototype=Object.create(f.prototype)).constructor=f,Tt.prototype._version=3,Object.defineProperty(Tt.prototype,"sources",{get:function(){for(var e=[],t=0;t{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(n,s=21)=>(e=s)=>{let t="",r=e;for(;r--;)t+=n[Math.random()*n.length|0];return t}};let{SourceMapConsumer:Ut,SourceMapGenerator:Ft}=We,{existsSync:zt,readFileSync:$t}=i.default,{dirname:Gt,join:Ht}=n.default;class Vt{constructor(e,t){!1!==t.map&&(this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:"),e=t.map?t.map.prev:void 0,e=this.loadMap(t.from,e),!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Gt(this.mapFile)),e&&(this.text=e))}consumer(){return this.consumerCache||(this.consumerCache=new Ut(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+t)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);var r,n;t&&(r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r),-1"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,i,o;t&&"object"==typeof t?(a=r,r="number"==typeof(l=t).offset?(t=(c=this.fromOffset(l.offset)).line,c.col):(t=l.line,l.column),o="number"==typeof a.offset?(c=this.fromOffset(a.offset),i=c.line,c.col):(i=a.line,a.column)):r||(t=(l=this.fromOffset(t)).line,r=l.col);var a,l,c=this.origin(t,r,i,o);return s=c?new Xt(e,void 0===c.endLine?c.line:{column:c.column,line:c.line},void 0===c.endLine?c.column:{column:c.endColumn,line:c.endLine},c.source,c.file,n.plugin):new Xt(e,void 0===i?t:{column:r,line:t},void 0===i?r:{column:o,line:i},this.css,this.file,n.plugin),s.input={column:r,endColumn:o,endLine:i,line:t,source:this.css},this.file&&(Jt&&(s.input.url=Jt(this.file).toString()),s.input.file=this.file),s}fromOffset(t){let n;if(this[er])n=this[er];else{var s=this.css.split("\n");n=new Array(s.length);let r=0;for(let e=0,t=s.length;e>1),t=n[i+1])){r=i;break}r=i+1}}return{col:t-n[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Kt(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let s=this.map.consumer();t=s.originalPositionFor({column:t,line:e});if(!t.source)return!1;let i;"number"==typeof r&&(i=s.originalPositionFor({column:n,line:r}));let o,a=(o=qt(t.source)?Jt(t.source):new URL(t.source,this.map.consumer().sourceRoot||Jt(this.map.mapFile)),{column:t.column,endColumn:i&&i.column,endLine:i&&i.line,line:t.line,url:o.toString()});if("file:"===o.protocol){if(!Wt)throw new Error("file: protocol is not available in this PostCSS build");a.file=Wt(o)}e=s.sourceContentFor(t.source);return e&&(a.source=e),a}toJSON(){let e={};for(var t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}}Je=nr;nr.default=nr,Yt&&Yt.registerInput&&Yt.registerInput(nr);let{SourceMapConsumer:sr,SourceMapGenerator:ir}=We,{dirname:or,relative:ar,resolve:lr,sep:cr}=n.default,ur=s.default["pathToFileURL"],hr=Je,pr=Boolean(sr&&ir),dr=Boolean(or&&lr&&ar&&cr);ft=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e,t=(e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map","\n");this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(var t of this.previous()){var r=this.toUrl(this.path(t.file)),n=t.root||or(t.file);let e;!1===this.mapOpts.sourcesContent?(e=new sr(t.text),e.sourcesContent&&(e.sourcesContent=null)):e=t.consumer(),this.map.applySourceMap(e,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let t;for(let e=this.root.nodes.length-1;0<=e;e--)t=this.root.nodes[e],"comment"===t.type&&0===t.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(e)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),dr&&pr&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,e=>{t+=e}),[t]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=ir.fromSourceMap(e)}else this.map=new ir({file:this.outputFile()}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):""});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&0",o={generated:{column:0,line:0},original:{column:0,line:0},source:""},a,l;this.stringify(this.root,(e,t,r)=>{this.css+=e,t&&"end"!==r&&(o.generated.line=n,o.generated.column=s-1,t.source&&t.source.start?(o.source=this.sourcePath(t),o.original.line=t.source.start.line,o.original.column=t.source.start.column-1):(o.source=i,o.original.line=1,o.original.column=0),this.map.addMapping(o)),a=e.match(/\n/g),a?(n+=a.length,l=e.lastIndexOf("\n"),s=e.length-l):s+=e.length,t&&"start"!==r&&(e=t.parent||{raws:{}},("decl"===t.type||"atrule"===t.type&&!t.nodes)&&t===e.last&&!e.raws.semicolon||(t.source&&t.source.end?(o.source=this.sourcePath(t),o.original.line=t.source.end.line,o.original.column=t.source.end.column-1,o.generated.line=n,o.generated.column=s-2):(o.source=i,o.original.line=1,o.original.column=0,o.generated.line=n,o.generated.column=s-1),this.map.addMapping(o)))})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;var e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:0e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;var t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?or(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=or(lr(r,this.mapOpts.annotation)));t=ar(r,e);return this.memoizedPaths.set(e,t),t}previous(){var e;return this.previousMaps||(this.previousMaps=[],this.root?this.root.walk(e=>{e.source&&e.source.input.map&&(e=e.source.input.map,this.previousMaps.includes(e)||this.previousMaps.push(e))}):(e=new hr(this.originalCSS,this.opts)).map&&this.previousMaps.push(e.map)),this.previousMaps}setSourcesContent(){let r={};var e;this.root?this.root.walk(e=>{var t;!e.source||(t=e.source.input.from)&&!r[t]&&(r[t]=!0,t=this.usesFileUrls?this.toFileUrl(t):this.toUrl(this.path(t)),this.map.setSourceContent(t,e.source.input.css))}):this.css&&(e=this.opts.from?this.toUrl(this.path(this.opts.from)):"",this.map.setSourceContent(e,this.css))}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){var t=this.memoizedFileURLs.get(e);if(t)return t;if(ur)return t=ur(e).toString(),this.memoizedFileURLs.set(e,t),t;throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){var t=this.memoizedURLs.get(e);if(t)return t;"\\"===cr&&(e=e.replace(/\\/g,"/"));t=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,t),t}};class fr extends Te{constructor(e){super(e),this.type="comment"}}Ct=fr;fr.default=fr;let{isClean:mr,my:gr}=Me,yr=He,vr=Ct,wr,br,_r,Cr;class Sr extends Te{append(...e){for(var t of e){var r;for(r of this.normalize(t,this.last))this.proxyOf.nodes.push(r)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(var t of this.nodes)t.cleanRaws(e)}each(r){if(this.proxyOf.nodes){var n=this.getIterator();let e,t;for(;this.indexes[n]t[n](...e.map(r=>"function"==typeof r?(e,t)=>r(e.toProxy(),t):r)):"every"===n||"some"===n?r=>t[n]((e,...t)=>r(e.toProxy(),...t)):"root"===n?()=>t.root().toProxy():"nodes"===n?t.nodes.map(e=>e.toProxy()):"first"===n||"last"===n?t[n].toProxy():t[n])},set(e,t,r){return e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0}}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){var r,n,s,i=this.index(e),o=this.normalize(t,this.proxyOf.nodes[i]).reverse(),i=this.index(e);for(r of o)this.proxyOf.nodes.splice(i+1,0,r);for(s in this.indexes)i<(n=this.indexes[s])&&(this.indexes[s]=n+o.length);return this.markDirty(),this}insertBefore(e,t){var r,n,s,i=this.index(e),o=this.normalize(t,this.proxyOf.nodes[i],0===i&&"prepend").reverse(),i=this.index(e);for(r of o)this.proxyOf.nodes.splice(i,0,r);for(s in this.indexes)i<=(n=this.indexes[s])&&(this.indexes[s]=n+o.length);return this.markDirty(),this}normalize(e,t){if("string"==typeof e)e=function t(e){return e.map(e=>(e.nodes&&(e.nodes=t(e.nodes)),delete e.source,e))}(wr(e).nodes);else if(void 0===e)e=[];else if(Array.isArray(e))for(var r of e=e.slice(0))r.parent&&r.parent.removeChild(r,"ignore");else if("root"===e.type&&"document"!==this.type)for(var n of e=e.nodes.slice(0))n.parent&&n.parent.removeChild(n,"ignore");else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new yr(e)]}else if(e.selector)e=[new br(e)];else if(e.name)e=[new _r(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new vr(e)]}return e.map(e=>(e[gr]||Sr.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[mr]&&function e(t){if(t[mr]=!1,t.proxyOf.nodes)for(var r of t.proxyOf.nodes)e(r)}(e),void 0===e.raws.before&&t&&void 0!==t.raws.before&&(e.raws.before=t.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}prepend(...e){for(var t of e=e.reverse()){var r,n,s=this.normalize(t,this.first,"prepend").reverse();for(r of s)this.proxyOf.nodes.unshift(r);for(n in this.indexes)this.indexes[n]=this.indexes[n]+s.length}return this.markDirty(),this}push(e){return(e.parent=this).proxyOf.nodes.push(e),this}removeAll(){for(var e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){var t,r;for(r in e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1),this.indexes)e<=(t=this.indexes[r])&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(t,r,n){return n||(n=r,r={}),this.walkDecls(e=>{r.props&&!r.props.includes(e.prop)||r.fast&&!e.value.includes(r.fast)||(e.value=e.value.replace(t,n))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(n){return this.each((t,e)=>{let r;try{r=n(t,e)}catch(e){throw t.addToError(e)}return!1!==r&&t.walk&&(r=t.walk(n)),r})}walkAtRules(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("atrule"===e.type&&r.test(e.name))return n(e,t)}):this.walk((e,t)=>{if("atrule"===e.type&&e.name===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("atrule"===e.type)return n(e,t)}))}walkComments(r){return this.walk((e,t)=>{if("comment"===e.type)return r(e,t)})}walkDecls(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("decl"===e.type&&r.test(e.prop))return n(e,t)}):this.walk((e,t)=>{if("decl"===e.type&&e.prop===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("decl"===e.type)return n(e,t)}))}walkRules(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("rule"===e.type&&r.test(e.selector))return n(e,t)}):this.walk((e,t)=>{if("rule"===e.type&&e.selector===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("rule"===e.type)return n(e,t)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}Sr.registerParse=e=>{wr=e},Sr.registerRule=e=>{br=e},Sr.registerAtRule=e=>{_r=e},Sr.registerRoot=e=>{Cr=e};i=Sr,Sr.default=Sr,Sr.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,_r.prototype):"rule"===e.type?Object.setPrototypeOf(e,br.prototype):"decl"===e.type?Object.setPrototypeOf(e,yr.prototype):"comment"===e.type?Object.setPrototypeOf(e,vr.prototype):"root"===e.type&&Object.setPrototypeOf(e,Cr.prototype),e[gr]=!0,e.nodes&&e.nodes.forEach(e=>{Sr.rebuild(e)})},ot=i;let xr,Ar;class kr extends ot{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){let t=new xr(new Ar,this,e);return t.stringify()}}kr.registerLazyResult=e=>{xr=e},kr.registerProcessor=e=>{Ar=e};e=kr;kr.default=kr;let Er={};function Lr(e){Er[e]||(Er[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))}class Or{constructor(e,t={}){for(var r in this.type="warning",this.text=e,t.node&&t.node.source&&(e=t.node.rangeBy(t),this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column),t)this[r]=t[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}St=Or;Or.default=Or;let Mr=St;class Pr{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);e=new Mr(e,t);return this.messages.push(e),e}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}}Ke=Pr;Pr.default=Pr;let Rr=i;class Tr extends Rr{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}We=Tr;Tr.default=Tr,Rr.registerAtRule(Tr);let Ir=i,Br,Nr;class jr extends Ir{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){e=super.normalize(e);if(t)if("prepend"===r)1{Br=e},jr.registerProcessor=e=>{Nr=e};n=jr;jr.default=jr,Ir.registerRoot(jr);let Dr={comma(e){return Dr.split(e,[","],!0)},space(e){return Dr.split(e,[" ","\n","\t"])},split(e,t,u){let r=[],n="",s=!1,i=0,o=!1,a="",l=!1;for(var c of e)l?l=!1:"\\"===c?l=!0:o?c===a&&(o=!1):'"'===c||"'"===c?(o=!0,a=c):"("===c?i+=1:")"===c?0"space"!==e[0]&&"comment"!==e[0])&&(s.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(s,"value",a.concat(e),t),s.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new Jr;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){var t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1;var r;let n=!1,s=null,i=[];var o=e[1].startsWith("--");let a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)s=s||l,i.push("("===r?")":"]");else if(o&&n&&"{"===r)s=s||l,i.push("}");else if(0===i.length){if(";"===r){if(n)return void this.decl(a,o);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===i[i.length-1]&&(i.pop(),0===i.length&&(s=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),0e+t[1],""),e.raws[t]={raw:o,value:l}),e[t]=l}rule(e){e.pop();let t=new Jr;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){var t;let r="";for(;e.length&&("space"===(t=e[e.length-1][0])||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){var t;let r="";for(;e.length&&("space"===(t=e[0][0])||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t="";for(;e.length&&"space"===e[e.length-1][0];)t=e.pop()[1]+t;return t}stringFrom(t,r){let n="";for(let e=r;evn(e)),e}let wn={};class bn{constructor(e,t,r){this.stringified=!1,this.processed=!1;let n;if("object"!=typeof t||null===t||"root"!==t.type&&"document"!==t.type)if(t instanceof bn||t instanceof ln)n=vn(t.root),t.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=t.map);else{let e=cn;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{n=e(t,r)}catch(e){this.processed=!0,this.error=e}n&&!n[tn]&&sn.rebuild(n)}else n=vn(t);this.result=new ln(e,n,r),this.helpers={...wn,postcss:wn,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){var r=this.result.lastPlugin;try{if(t&&t.addToError(e),"CssSyntaxError"!==(this.error=e).name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){var n=r.postcssPlugin;let e=r.postcssVersion,t=this.result.processor.version;var s=e.split("."),i=t.split(".");(s[0]!==i[0]||parseInt(s[1])>parseInt(i[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+t+", but "+n+" uses "+e+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};var e,t=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(e of this.plugins)if("object"==typeof e)for(var r in e){if(!pn[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${e.postcssPlugin}. `+`Try to update PostCSS (${this.processor.version} now).`);if(!dn[r])if("object"==typeof e[r])for(var n in e[r])"*"===n?t(e,r,e[r][n]):t(e,r+"-"+n.toLowerCase(),e[r][n]);else"function"==typeof e[r]&&t(e,r,e[r])}this.hasListener=0t(e,this.helpers)),await Promise.all(i)):await t(r,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{var e;if("object"==typeof t&&t.Once)return"document"===this.result.root.type?mn((e=this.result.root.nodes.map(e=>t.Once(e,this.helpers)))[0])?Promise.all(e):e:t.Once(this.result.root,this.helpers);if("function"==typeof t)return t(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();var e=this.result.opts;let t=nn,r=(e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify),new rn(t,this.result.root,this.result.opts));e=r.generate();return this.result.css=e[0],this.result.map=e[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(var e of this.plugins)if(mn(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[en];)e[en]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(var t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||an("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(var[r,n]of e){this.result.lastPlugin=r;let e;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(mn(e))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:s}=r;if("root"===n.type||"document"===n.type||n.parent){if(0{e[en]||this.walkSync(e)});else{var r=this.listeners[t];if(r&&this.visitSync(r,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}bn.registerPostcss=e=>{wn=e};Me=bn;bn.default=bn,un.registerLazyResult(bn),on.registerLazyResult(bn);let _n=ft,Cn=Ne,Sn=Lr,xn=Qr;const An=Ke;class kn{constructor(e,t,r){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;var e=Cn;this.result=new An(this._processor,void 0,this._opts),this.result.css=t;let n=this,s=(Object.defineProperty(this.result,"root",{get(){return n.root}}),new _n(e,void 0,this._opts,t));s.isMap()?([r,e]=s.generate(),r&&(this.result.css=r),e&&(this.result.map=e)):(s.clearAnnotation(),this.result.css=s.css)}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||Sn("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=xn;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}}ft=kn;kn.default=kn;let En=ft,Ln=Me,On=e,Mn=n;class Pn{constructor(e=[]){this.version="8.4.35",this.plugins=this.normalize(e)}normalize(e){let t=[];for(var r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return new(this.plugins.length||t.parser||t.stringifier||t.syntax?Ln:En)(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}ft=Pn;Pn.default=Pn,Mn.registerProcessor(Pn),On.registerProcessor(Pn);let Rn=He,Tn=qe,In=Ct,Bn=We,Nn=Je,jn=n,Dn=ot;function Un(e,r){if(Array.isArray(e))return e.map(e=>Un(e));let{inputs:t,...n}=e;if(t){r=[];for(var s of t){let e={...s,__proto__:Nn.prototype};e.map&&(e.map={...e.map,__proto__:Tn.prototype}),r.push(e)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>Un(e,r))),n.source){let{inputId:e,...t}=n.source;n.source=t,null!=e&&(n.source.input=r[e])}if("root"===n.type)return new jn(n);if("decl"===n.type)return new Rn(n);if("rule"===n.type)return new Dn(n);if("comment"===n.type)return new In(n);if("atrule"===n.type)return new Bn(n);throw new Error("Unknown node type: "+e.type)}qe=Un,Un.default=Un;let Fn=He,zn=Me;He=i;let $n=ft;Me=Ne,i=qe;let Gn=e;ft=St;let Hn=Ct,Vn=We;Ne=Ke,qe=Je,e=Qr,St=s;let Wn=ot,Jn=n;Ct=Te;function o(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new $n(e)}o.plugin=function(r,n){let s=!1;function i(...e){console&&console.warn&&!s&&(s=!0,console.warn(r+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(r+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let t=n(...e);return t.postcssPlugin=r,t.postcssVersion=(new $n).version,t}let e;return Object.defineProperty(i,"postcss",{get(){return e=e||i(),e}}),i.process=function(e,t,r){return o([i(r)]).process(e,t)},i},o.stringify=Me,o.parse=e,o.fromJSON=i,o.list=St,o.comment=e=>new Hn(e),o.atRule=e=>new Vn(e),o.decl=e=>new Fn(e),o.rule=e=>new Wn(e),o.root=e=>new Jn(e),o.document=e=>new Gn(e),o.CssSyntaxError=t,o.Declaration=Fn,o.Container=He,o.Processor=$n,o.Document=Gn,o.Comment=Hn,o.Warning=ft,o.AtRule=Vn,o.Result=Ne,o.Input=qe,o.Rule=Wn,o.Root=Jn,o.Node=Ct,zn.registerPostcss(o);o.default=o;class qn extends HTMLElement{base;contents;component;listType="ul";iconSet;filter={value:"",caseSensitive:!1};static get observedAttributes(){return["contents","icon-set","max-depth","filter"]}_jsonToValueArray(e){let t=JSON.stringify(e);t=t.replace(/[\[\]{}\"]/g,"");let r=[];for(const n of t.split(","))r=r.concat(n.split(":"));return[...new Set(r)]}_emit(e,t,r){e=new CustomEvent(e,{detail:r,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}constructor(){super(),this.base=new $,this.setContents(this.getAttribute("contents")),this.iconSet=this.getAttribute("icon-set")?this.getAttribute("icon-type"):"file",this.maxDepth=this.getAttribute("max-depth")?parseInt(this.getAttribute("max-depth")):-1,this.setFilter(this.getAttribute("filter")),this.style.display="block",this.style.maxWidth="fit-content",this.style.margin="0 1rem 0 0",this.base.addEvent(".flk-branch","click",this.emitNodeToggle)}emitNodeToggle(e){e.stopPropagation();const t=F(e,"flk-tree-nav").target,r=z(e,"branchKey");let n=t.contents;const s=r.split(".");for(const o of s)if(n[o])n=n[o];else{let e=[];for(const a of n)a[o]&&e.push(a[o]);n=e}var e=r.substring(r.indexOf(".")+1),i=t.createLeafText(s.reverse()[0]);t._emit("tree-click",t,{path:e,data:n,key:(i.titleText+" "+i.commentText).trim(),branch:"object"==typeof n})}convertJsonKeyToTitle(e){if(!e)return"";const t=(e="string"!=typeof e?e.toString():e).replace(/([A-Z_])/g,e=>"_"===e?" ":" "+e).trim();return t.charAt(0).toUpperCase()+t.slice(1)}setContents(e){var t=e||this.contents||[];try{switch(typeof t){case"string":this.contents=JSON.parse(t);break;case"object":Array.isArray(t)?this.contents=t:this.contents=[t]}}catch(e){console.log(e)}}applyFilter(e){let t;var r="details"===e.tagName.toLowerCase();t=this.filter.caseSensitive?e.dataset.branchValues.includes(this.filter.value):e.dataset.branchValues.toLowerCase().includes(this.filter.value.toLowerCase()),t?e.parentElement.classList.remove("hidden"):e.parentElement.classList.add("hidden"),r&&t?e.setAttribute("open",""):e.removeAttribute("open")}resetTree(e){e.parentElement.classList.remove("hidden"),e.removeAttribute("open")}filterTree(){let t=setTimeout(()=>{for(const e of this.querySelectorAll("[data-branch-values]"))void 0===this.filter.value||0===this.filter.value.length?this.resetTree(e):this.applyFilter(e);clearTimeout(t)},10)}setFilter(e){const t=e||{};try{switch(typeof t){case"string":t.includes("{")?(this.filter=JSON.parse(t),!1===this.filter.caseSensitive&&(this.filter.value=this.filter.value.toLowerCase())):this.filter.value=e.toLowerCase();break;case"object":this.filter=t}}catch(e){console.log(e)}this.filterTree()}createLeafText(e){var t,r;let n="",s="";return"string"==typeof e&&(e.includes("(")||e.includes("["))?(r=e.indexOf("("),r=-1===(t=e.indexOf("["))?r:t,n=this.convertJsonKeyToTitle(e.substring(0,r)),s=e.substring(r)):n=this.convertJsonKeyToTitle(e),{titleText:n,commentText:s}}createTextTag(n,s){n=this.createLeafText(n);if(n.commentText){let e=document.createElement("div"),t=document.createElement("span"),r=(t.innerText=n.titleText,document.createElement("small"));r.innerText=n.commentText,r.style.marginLeft="1rem",e.append(t,r),e.style.display="inline-flex",e.style.alignItems="center",s.append(e)}else s.innerText=n.titleText}createLeaf(e,t,r,n=[]){let s=document.createElement("li");s.classList.add("cursor-no-select"),s.style.marginTop="0.4rem",s.dataset.branchKey=r;const i="file"===this.iconSet?'':'';s.style.listStyleImage=`url('data:image/svg+xml,${i}')`,s.style.position="relative",s.style.left="2px";let o=document.createElement("span");r=[e].concat(n);if(o.dataset.branchValues=[...new Set(r)].join(),this.createTextTag(e,o),o.style.position="relative",o.style.top="-3px",s.append(o),t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);const i="file"===this.iconSet?G:H;e.style.listStyleImage=`url('data:image/svg+xml,${i}')`,e.append(s),t.append(e)}else t.append(s)}createBranch(r,t,n,s){if(s===this.maxDepth&&"object"==typeof r){var i,o=Array.isArray(r)?r:Object.keys(r);if("object"==typeof o[0]){let e=[];for(const d of o)e=e.concat(Object.keys(d));for(i of[...new Set(e)]){var u=document.createElement(this.listType);t.append(this.createBranch(i,u,n+"."+i,s+1))}}else for(const a of o){let e;r[a]&&(e=this._jsonToValueArray(r[a])),this.createLeaf(a,t,n,e)}}else if(Array.isArray(r))for(var e in r){var h=document.createElement(this.listType);t.append(this.createBranch(r[e],h,n+"."+e,s+1))}else if(null!==r&&"object"==typeof r){const l=[];for(const c of Object.keys(r)){let e=document.createElement("li"),t=(e.classList.add("cursor-no-select"),e.style.position="relative",e.style.left="2px",e.dataset.branchKey=n+"."+c,document.createElement("details"));t.classList.add("flk-branch"),t.dataset.branchValues=[c].concat(this._jsonToValueArray(r[c])),t.style.position="relative",t.style.top="-3px",t.classList.add("cursor-default");var p=document.createElement("summary");this.createTextTag(c,p),t.append(p),e.append(this.createBranch(r[c],t,n+"."+c,s+1)),l.push(e)}if(t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);o="file"===this.iconSet?G:H;e.style.listStyleImage=`url('data:image/svg+xml,${o}')`;for(const f of l)e.append(f);t.append(e)}else for(const m of l)t.append(m)}else console.trace({node:r,element:t,key:n}),this.createLeaf(r,t,n);return t}createHtml(){let e=document.createElement(this.listType);var t="file"===this.iconSet?G:'';if(e.style.listStyleImage=`url('data:image/svg+xml,${t}')`,e.style.marginLeft="3rem",this.contents.length){for(const r in this.contents)e=this.createBranch(this.contents[r],e,r,0);this.component=e}else this.component=e}attributeChangedCallback(e,t,r){switch(e){case"contents":this.setContents(r);break;case"icon-set":this.iconSet=r;break;case"max-depth":this.maxDepth="string"==typeof r?parseInt(r):r;break;case"filter":this.setFilter(r)}this.init()}connectedCallback(){this.init()}disconnectedCallback(){this.base.removeEvents(this)}init(){this.createHtml(),this.base.render(this)}}customElements.define("flk-table",W),customElements.define("flk-draggable",J),customElements.define("flk-modal",q),customElements.define("flk-dropdown",K),customElements.define("flk-tree-nav",qn)}(require$$0,require$$2,require$$1$1,require$$1); \ No newline at end of file diff --git a/docs/cdn/ibiss-v0.0.4/avian.min.css b/docs/cdn/ibiss-v0.0.4/avian.min.css new file mode 100644 index 0000000..53c6f0a --- /dev/null +++ b/docs/cdn/ibiss-v0.0.4/avian.min.css @@ -0,0 +1 @@ +:root{--html-background:#faf9f8;--background:#fff;--code-background:#f3f2f1;--overlay-background:0,0,0;--color-on-black:#c8c6c4;--font-color:#323130;--shadow-color:0,0,0;--hr-color:#d2d0ce;--border-color:#8a8886;--gray-light:#edebe9;--color-on-gray-light:#000;--gray:#a19f9d;--color-on-gray:#000;--gray-dark:#605e5c;--color-on-gray-dark:#faf9f8;--gray-darker:#8a8886;--light:#d2d0ce;--black:#000;--white:#fff;--icon:#605e5c;--icon-disabled:#a19f9d;--icon-error:#a80000;--icon-success:#107c10;--icon-warning:#797673;--primary:#0078d4;--primary-hover:#0068b8;--color-on-primary:#fff;--accent:#fce100;--accent-hover:#e6cf00;--color-on-accent:#000;--danger:#d13438;--danger-hover:#bb2a2f;--color-on-danger:#fff;--warning:#fff4ce;--color-on-warning:#323130;--error:#fde7e9;--color-on-error:#323130;--success:#dff6dd;--color-on-success:#323130;--contrast:#ccc;--contrast-hover:#b2b2b2;--color-on-contrast:#000;--disabled:#d2d0ce;--color-on-disabled:#a19f9d;--button-background:#fff;--button-hover:#e1dfdd;--button-outline-color:#000;--button-color:#000;--disabled-button-background:#f3f2f1;--disabled-button-color:#a19f9d;--colored-disabled-button-color:#d2d0ce;--input-border-color:#605e5c;--input-hover:#c8c6c4;--range-track-color:#c8c6c4;--range-filled-track-color:#605e5c;--range-track-hover-color:#e0f2ff;--switch-border-color:#000;--switch-toggle-off-color:#000;--switch-toggle-on-color:#fff;--table-hover:#e1dfdd;--table-striped-hover:#d2d0ce;--table-stripe:#edebe9;--default-distance:1.5rem;--distance-0:0;--distance-1:0.5rem;--distance-2:1rem;--distance-3:1.5rem;--distance-4:2rem;--distance-5:2.5rem;--h1-font-size:3.2rem;--h2-font-size:3rem;--h3-font-size:2.8rem;--h4-font-size:2.6rem;--h5-font-size:2.4rem;--h6-font-size:2.2rem;--th-font-size:2.2rem;--paragraph-font-size:1.6rem;--label-font-size:1.6rem;--small-font-size:1.2rem;--font-weight-normal:400;--font-weight-semibold:600;--font-weight-bold:700}*,:after,:before{box-sizing:border-box;font:inherit;font-weight:var(--font-weight-normal);margin:0;padding:0}html{font-size:62.5%;hanging-punctuation:first last}body{font-family:Segoe UI,"Segoe UI Web (West European)",-apple-system,BlinkMacSystemFont,Roboto,Helvetica Neue,sans-serif;font-size:1.6rem;height:100svh;line-height:1.5;text-rendering:optimizeSpeed}h1,h2,h3,h4,h5,h6{text-wrap:balance}p{text-wrap:pretty;max-width:75ch}ol,ul{margin-left:2rem}img,picture{display:block;max-width:100%}.lucide{left:2px;position:relative;top:3px}@media (prefers-reduced-motion:reduce){html:focus-within{scroll-behavior:auto}*,:after,:before{animation-duration:.01ms;animation-iteration-count:1;scroll-behavior:auto;transition-duration:.01ms}}@media (prefers-reduced-motion:no-preference){:has(:target),html{scroll-behavior:smooth;scroll-padding-top:3rem}}h1{font-size:var(--h1-font-size)}h1,h2{font-weight:var(--font-weight-bold)}h2{font-size:var(--h2-font-size)}h3{font-size:var(--h3-font-size);font-weight:var(--font-weight-bold)}h4{font-size:var(--h4-font-size)}h4,h5{font-weight:var(--font-weight-semibold)}h5{font-size:var(--h5-font-size)}h6{font-size:var(--h6-font-size);font-weight:var(--font-weight-semibold)}p{font-size:var(--paragraph-font-size)}label{font-size:var(--label-font-size)}small{font-size:var(--small-font-size)}b,strong{font-weight:var(--font-weight-bold)}cite,em,i{font-style:italic}code:not([class*=language]),kbd{background-color:var(--code-background);border:.5px solid var(--border-color);border-radius:.2rem;bottom:.1rem;margin:0 .2rem;padding:.2rem .4rem;position:relative}mark{background-color:var(--accent)}th{font-size:var(--th-font-size);font-weight:var(--font-weight-semibold)}.font-size-68{font-size:6.8rem!important}.font-size-42{font-size:4.2rem!important}.font-size-32{font-size:3.2rem!important}.font-size-28{font-size:2.8rem!important}.font-size-24{font-size:2.4rem!important}.font-size-20{font-size:2rem!important}.font-size-18{font-size:1.8rem!important}.font-size-16{font-size:1.6rem!important}.font-size-14{font-size:1.4rem!important}.font-size-12{font-size:1.2rem!important}.font-size-10{font-size:1rem!important}.font-weight-normal{font-weight:400!important}.font-weight-semibold{font-weight:600!important}.font-weight-bold{font-weight:700!important}.align-center{align-items:center}.align-end{align-items:flex-end}.align-start{align-items:flex-start}.align-stretch{align-items:stretch}.align-between{align-content:space-between}.align-around{align-content:space-around}.align-evenly{align-content:space-evenly}.self-align-stretch{align-self:stretch}.self-align-center{align-self:center}.self-align-start{align-self:flex-start}.self-align-end{align-self:flex-end}.row{display:flex;flex-wrap:wrap}.column{display:flex;flex-direction:column}.no-wrap{flex-wrap:nowrap}.wrap-reverse{flex-wrap:wrap-reverse}.row-reverse{flex-direction:row-reverse}.column-reverse{flex-direction:column-reverse}@media (min-width:993px){.drow-reverse{flex-direction:row-reverse}.dcolumn-reverse{flex-direction:column-reverse}}@media (min-width:768px) and (max-width:992px){.trow-reverse{flex-direction:row-reverse}.tcolumn-reverse{flex-direction:column-reverse}}@media (max-width:767px){.mrow-reverse{flex-direction:row-reverse}.mcolumn-reverse{flex-direction:column-reverse}}.gap-0{gap:var(--distance-0)}.gap-1{gap:var(--distance-1)}.gap-2{gap:var(--distance-2)}.gap-3{gap:var(--distance-3)}.gap-4{gap:var(--distance-4)}.gap-5{gap:var(--distance-5)}.justify-center{justify-content:center}.justify-around{justify-content:space-around}.justify-evenly{justify-content:space-evenly}.justify-end{justify-content:flex-end}.justify-between{justify-content:space-between}.justify-start{justify-content:flex-start}.f-100{flex:1 1 100%}.f-90{flex:0 0 90%}.f-80{flex:0 0 80%}.f-75{flex:0 0 75%}.f-70{flex:0 0 70%}.f-60{flex:0 0 60%}.f-50{flex:0 0 50%}.f-33{flex:0 0 33.33%}.f-30{flex:0 0 30%}.f-25{flex:0 0 25%}.f-20{flex:0 0 20%}.f-16{flex:0 0 16.67%}.f-10{flex:0 0 10%}.f-8{flex:0 0 8.33%}.f-auto{flex:1 1 auto;max-width:fitcontent;min-width:auto;width:auto}.f-fill{flex:1;max-width:none;min-width:auto;width:100%}@media (min-width:768px) and (max-width:992px){.tf-100{flex:1 1 100%}.tf-90{flex:0 0 90%}.tf-80{flex:0 0 80%}.tf-75{flex:0 0 75%}.tf-70{flex:0 0 70%}.tf-60{flex:0 0 60%}.tf-50{flex:0 0 50%}.tf-33{flex:0 0 33.33%}.tf-30{flex:0 0 30%}.tf-25{flex:0 0 25%}.tf-20{flex:0 0 20%}.tf-16{flex:0 0 16.67%}.tf-10{flex:0 0 10%}.tf-8{flex:0 0 8.33%}.tf-auto{flex:1 1 auto;max-width:fitcontent;min-width:auto;width:auto}.tf-fill{flex:1;max-width:none;min-width:auto;width:100%}}@media (max-width:767px){.mf-100{flex:1 1 100%}.mf-90{flex:0 0 90%}.mf-80{flex:0 0 80%}.mf-75{flex:0 0 75%}.mf-70{flex:0 0 70%}.mf-60{flex:0 0 60%}.mf-50{flex:0 0 50%}.mf-33{flex:0 0 33.33%}.mf-30{flex:0 0 30%}.mf-25{flex:0 0 25%}.mf-20{flex:0 0 20%}.mf-16{flex:0 0 16.67%}.mf-10{flex:0 0 10%}.mf-8{flex:0 0 8.33%}.mf-auto{flex:1 1 auto;max-width:fitcontent;min-width:auto;width:auto}.mf-fill{flex:1;max-width:none;min-width:auto;width:100%}}.no-scroll{overflow:hidden}.text-no-wrap{white-space:nowrap}.text-normal{font-weight:400}.sticky{height:auto;position:sticky;position:-webkit-sticky;top:0;z-index:1000}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.block{display:block}.hidden{display:none}@media (min-width:768px){.mobile{display:none!important}}.tablet{display:none}@media (min-width:768px) and (max-width:992px){.tablet{display:inherit!important}}@media (max-width:992px){.desktop{display:none!important}}@media (min-width:769px){.small-screen{display:none!important}}@media (max-width:768px){.large-screen{display:none!important}}.fit-content{max-width:fit-content!important;max-width:-moz-fit-content!important}.list-style-none{list-style:none!important}.m-0{margin:var(--distance-0)!important}.ml-0{margin-left:var(--distance-0)!important}.mr-0{margin-right:var(--distance-0)!important}.mt-0{margin-top:var(--distance-0)!important}.mb-0{margin-bottom:var(--distance-0)!important}.mx-0{margin-left:var(--distance-0)!important;margin-right:var(--distance-0)!important}.m-1{margin:var(--distance-1)!important}.m-2{margin:var(--distance-2)!important}.m-3{margin:var(--distance-3)!important}.m-4{margin:var(--distance-4)!important}.m-5{margin:var(--distance-5)!important}.mx-auto{margin-left:auto!important;margin-right:auto!important}.mx-1{margin-left:var(--distance-1)!important;margin-right:var(--distance-1)!important}.mx-2{margin-left:var(--distance-2)!important;margin-right:var(--distance-2)!important}.mx-3{margin-left:var(--distance-3)!important;margin-right:var(--distance-3)!important}.mx-4{margin-left:var(--distance-4)!important;margin-right:var(--distance-4)!important}.mx-5{margin-left:var(--distance-5)!important;margin-right:var(--distance-5)!important}.my-auto{margin-bottom:auto!important;margin-top:auto!important}.my-0{margin-bottom:var(--distance-0)!important;margin-top:var(--distance-0)!important}.my-1{margin-bottom:var(--distance-1)!important;margin-top:var(--distance-1)!important}.my-2{margin-bottom:var(--distance-2)!important;margin-top:var(--distance-2)!important}.my-3{margin-bottom:var(--distance-3)!important;margin-top:var(--distance-3)!important}.my-4{margin-bottom:var(--distance-4)!important;margin-top:var(--distance-4)!important}.my-5{margin-bottom:var(--distance-5)!important;margin-top:var(--distance-5)!important}.mt-auto{margin-top:auto!important}.mt-1{margin-top:var(--distance-1)!important}.mt-2{margin-top:var(--distance-2)!important}.mt-3{margin-top:var(--distance-3)!important}.mt-4{margin-top:var(--distance-4)!important}.mt-5{margin-top:var(--distance-5)!important}.ml-auto{margin-left:auto!important}.ml-1{margin-left:var(--distance-1)!important}.ml-2{margin-left:var(--distance-2)!important}.ml-3{margin-left:var(--distance-3)!important}.ml-4{margin-left:var(--distance-4)!important}.ml-5{margin-left:var(--distance-5)!important}.mr-auto{margin-right:auto!important}.mr-1{margin-right:var(--distance-1)!important}.mr-2{margin-right:var(--distance-2)!important}.mr-3{margin-right:var(--distance-3)!important}.mr-4{margin-right:var(--distance-4)!important}.mr-5{margin-right:var(--distance-5)!important}.mb-auto{margin-bottom:auto!important}.mb-1{margin-bottom:var(--distance-1)!important}.mb-2{margin-bottom:var(--distance-2)!important}.mb-3{margin-bottom:var(--distance-3)!important}.mb-4{margin-bottom:var(--distance-4)!important}.mb-5{margin-bottom:var(--distance-5)!important}@media (min-width:768px) and (max-width:992px){.tm-0{margin:var(--distance-0)!important}.tml-0{margin-left:var(--distance-0)!important}.tmr-0{margin-right:var(--distance-0)!important}.tmt-0{margin-top:var(--distance-0)!important}.tmb-0{margin-bottom:var(--distance-0)!important}.tmx-0{margin-left:var(--distance-0)!important;margin-right:var(--distance-0)!important}.tm-1{margin:var(--distance-1)!important}.tm-2{margin:var(--distance-2)!important}.tm-3{margin:var(--distance-3)!important}.tm-4{margin:var(--distance-4)!important}.tm-5{margin:var(--distance-5)!important}.tmx-auto{margin-left:auto!important;margin-right:auto!important}.tmx-1{margin-left:var(--distance-1)!important;margin-right:var(--distance-1)!important}.tmx-2{margin-left:var(--distance-2)!important;margin-right:var(--distance-2)!important}.tmx-3{margin-left:var(--distance-3)!important;margin-right:var(--distance-3)!important}.tmx-4{margin-left:var(--distance-4)!important;margin-right:var(--distance-4)!important}.tmx-5{margin-left:var(--distance-5)!important;margin-right:var(--distance-5)!important}.tmy-auto{margin-bottom:auto!important;margin-top:auto!important}.tmy-0{margin-bottom:var(--distance-0)!important;margin-top:var(--distance-0)!important}.tmy-1{margin-bottom:var(--distance-1)!important;margin-top:var(--distance-1)!important}.tmy-2{margin-bottom:var(--distance-2)!important;margin-top:var(--distance-2)!important}.tmy-3{margin-bottom:var(--distance-3)!important;margin-top:var(--distance-3)!important}.tmy-4{margin-bottom:var(--distance-4)!important;margin-top:var(--distance-4)!important}.tmy-5{margin-bottom:var(--distance-5)!important;margin-top:var(--distance-5)!important}.tmt-auto{margin-top:auto!important}.tmt-1{margin-top:var(--distance-1)!important}.tmt-2{margin-top:var(--distance-2)!important}.tmt-3{margin-top:var(--distance-3)!important}.tmt-4{margin-top:var(--distance-4)!important}.tmt-5{margin-top:var(--distance-5)!important}.tml-auto{margin-left:auto!important}.tml-1{margin-left:var(--distance-1)!important}.tml-2{margin-left:var(--distance-2)!important}.tml-3{margin-left:var(--distance-3)!important}.tml-4{margin-left:var(--distance-4)!important}.tml-5{margin-left:var(--distance-5)!important}.tmr-auto{margin-right:auto!important}.tmr-1{margin-right:var(--distance-1)!important}.tmr-2{margin-right:var(--distance-2)!important}.tmr-3{margin-right:var(--distance-3)!important}.tmr-4{margin-right:var(--distance-4)!important}.tmr-5{margin-right:var(--distance-5)!important}.tmb-auto{margin-bottom:auto!important}.tmb-1{margin-bottom:var(--distance-1)!important}.tmb-2{margin-bottom:var(--distance-2)!important}.tmb-3{margin-bottom:var(--distance-3)!important}.tmb-4{margin-bottom:var(--distance-4)!important}.tmb-5{margin-bottom:var(--distance-5)!important}}@media (max-width:767px){.mm-0{margin:var(--distance-0)!important}.mml-0{margin-left:var(--distance-0)!important}.mmr-0{margin-right:var(--distance-0)!important}.mmt-0{margin-top:var(--distance-0)!important}.mmb-0{margin-bottom:var(--distance-0)!important}.mmx-0{margin-left:var(--distance-0)!important;margin-right:var(--distance-0)!important}.mm-1{margin:var(--distance-1)!important}.mm-2{margin:var(--distance-2)!important}.mm-3{margin:var(--distance-3)!important}.mm-4{margin:var(--distance-4)!important}.mm-5{margin:var(--distance-5)!important}.mmx-auto{margin-left:auto!important;margin-right:auto!important}.mmx-1{margin-left:var(--distance-1)!important;margin-right:var(--distance-1)!important}.mmx-2{margin-left:var(--distance-2)!important;margin-right:var(--distance-2)!important}.mmx-3{margin-left:var(--distance-3)!important;margin-right:var(--distance-3)!important}.mmx-4{margin-left:var(--distance-4)!important;margin-right:var(--distance-4)!important}.mmx-5{margin-left:var(--distance-5)!important;margin-right:var(--distance-5)!important}.mmy-auto{margin-bottom:auto!important;margin-top:auto!important}.mmy-0{margin-bottom:var(--distance-0)!important;margin-top:var(--distance-0)!important}.mmy-1{margin-bottom:var(--distance-1)!important;margin-top:var(--distance-1)!important}.mmy-2{margin-bottom:var(--distance-2)!important;margin-top:var(--distance-2)!important}.mmy-3{margin-bottom:var(--distance-3)!important;margin-top:var(--distance-3)!important}.mmy-4{margin-bottom:var(--distance-4)!important;margin-top:var(--distance-4)!important}.mmy-5{margin-bottom:var(--distance-5)!important;margin-top:var(--distance-5)!important}.mmt-auto{margin-top:auto!important}.mmt-1{margin-top:var(--distance-1)!important}.mmt-2{margin-top:var(--distance-2)!important}.mmt-3{margin-top:var(--distance-3)!important}.mmt-4{margin-top:var(--distance-4)!important}.mmt-5{margin-top:var(--distance-5)!important}.mml-auto{margin-left:auto!important}.mml-1{margin-left:var(--distance-1)!important}.mml-2{margin-left:var(--distance-2)!important}.mml-3{margin-left:var(--distance-3)!important}.mml-4{margin-left:var(--distance-4)!important}.mml-5{margin-left:var(--distance-5)!important}.mmr-auto{margin-right:auto!important}.mmr-1{margin-right:var(--distance-1)!important}.mmr-2{margin-right:var(--distance-2)!important}.mmr-3{margin-right:var(--distance-3)!important}.mmr-4{margin-right:var(--distance-4)!important}.mmr-5{margin-right:var(--distance-5)!important}.mmb-auto{margin-bottom:auto!important}.mmb-1{margin-bottom:var(--distance-1)!important}.mmb-2{margin-bottom:var(--distance-2)!important}.mmb-3{margin-bottom:var(--distance-3)!important}.mmb-4{margin-bottom:var(--distance-4)!important}.mmb-5{margin-bottom:var(--distance-5)!important}}.p-0{padding:var(--distance-0)}.pl-0{padding-left:var(--distance-0)}.pr-0{padding-right:var(--distance-0)}.pt-0{padding-top:var(--distance-0)}.pb-0{padding-bottom:var(--distance-0)}.p-1{padding:var(--distance-1)}.p-2{padding:var(--distance-2)}.p-3{padding:var(--distance-3)}.p-4{padding:var(--distance-4)}.p-5{padding:var(--distance-5)}.px-0{padding-left:var(--distance-0);padding-right:var(--distance-0)}.px-auto{padding-left:auto;padding-right:auto}.px-1{padding-left:var(--distance-1);padding-right:var(--distance-1)}.px-2{padding-left:var(--distance-2);padding-right:var(--distance-2)}.px-3{padding-left:var(--distance-3);padding-right:var(--distance-3)}.px-4{padding-left:var(--distance-4);padding-right:var(--distance-4)}.px-5{padding-left:var(--distance-5);padding-right:var(--distance-5)}.py-auto{padding-bottom:auto;padding-top:auto}.py-0{padding-bottom:var(--distance-0);padding-top:var(--distance-0)}.py-1{padding-bottom:var(--distance-1);padding-top:var(--distance-1)}.py-2{padding-bottom:var(--distance-2);padding-top:var(--distance-2)}.py-3{padding-bottom:var(--distance-3);padding-top:var(--distance-3)}.py-4{padding-bottom:var(--distance-4);padding-top:var(--distance-4)}.py-5{padding-bottom:var(--distance-5);padding-top:var(--distance-5)}.pt-auto{padding-top:auto}.pt-1{padding-top:var(--distance-1)}.pt-2{padding-top:var(--distance-2)}.pt-3{padding-top:var(--distance-3)}.pt-4{padding-top:var(--distance-4)}.pt-5{padding-top:var(--distance-5)}.pl-auto{padding-left:auto}.pl-1{padding-left:var(--distance-1)}.pl-2{padding-left:var(--distance-2)}.pl-3{padding-left:var(--distance-3)}.pl-4{padding-left:var(--distance-4)}.pl-5{padding-left:var(--distance-5)}.pr-auto{padding-right:auto}.pr-1{padding-right:var(--distance-1)}.pr-2{padding-right:var(--distance-2)}.pr-3{padding-right:var(--distance-3)}.pr-4{padding-right:var(--distance-4)}.pr-5{padding-right:var(--distance-5)}.pb-auto{padding-bottom:auto}.pb-1{padding-bottom:var(--distance-1)}.pb-2{padding-bottom:var(--distance-2)}.pb-3{padding-bottom:var(--distance-3)}.pb-4{padding-bottom:var(--distance-4)}.pb-5{padding-bottom:var(--distance-5)}@media (min-width:768px) and (max-width:992px){.tp-0{padding:var(--distance-0)}.tpl-0{padding-left:var(--distance-0)}.tpr-0{padding-right:var(--distance-0)}.tpt-0{padding-top:var(--distance-0)}.tpb-0{padding-bottom:var(--distance-0)}.tpx-0{padding-left:var(--distance-0);padding-right:var(--distance-0)}.tp-1{padding:var(--distance-1)}.tp-2{padding:var(--distance-2)}.tp-3{padding:var(--distance-3)}.tp-4{padding:var(--distance-4)}.tp-5{padding:var(--distance-5)}.tpx-auto{padding-left:auto;padding-right:auto}.tpx-1{padding-left:var(--distance-1);padding-right:var(--distance-1)}.tpx-2{padding-left:var(--distance-2);padding-right:var(--distance-2)}.tpx-3{padding-left:var(--distance-3);padding-right:var(--distance-3)}.tpx-4{padding-left:var(--distance-4);padding-right:var(--distance-4)}.tpx-5{padding-left:var(--distance-5);padding-right:var(--distance-5)}.tpy-auto{padding-bottom:auto;padding-top:auto}.tpy-0{padding-bottom:var(--distance-0);padding-top:var(--distance-0)}.tpy-1{padding-bottom:var(--distance-1);padding-top:var(--distance-1)}.tpy-2{padding-bottom:var(--distance-2);padding-top:var(--distance-2)}.tpy-3{padding-bottom:var(--distance-3);padding-top:var(--distance-3)}.tpy-4{padding-bottom:var(--distance-4);padding-top:var(--distance-4)}.tpy-5{padding-bottom:var(--distance-5);padding-top:var(--distance-5)}.tpt-auto{padding-top:auto}.tpt-1{padding-top:var(--distance-1)}.tpt-2{padding-top:var(--distance-2)}.tpt-3{padding-top:var(--distance-3)}.tpt-4{padding-top:var(--distance-4)}.tpt-5{padding-top:var(--distance-5)}.tpl-auto{padding-left:auto}.tpl-1{padding-left:var(--distance-1)}.tpl-2{padding-left:var(--distance-2)}.tpl-3{padding-left:var(--distance-3)}.tpl-4{padding-left:var(--distance-4)}.tpl-5{padding-left:var(--distance-5)}.tpr-auto{padding-right:auto}.tpr-1{padding-right:var(--distance-1)}.tpr-2{padding-right:var(--distance-2)}.tpr-3{padding-right:var(--distance-3)}.tpr-4{padding-right:var(--distance-4)}.tpr-5{padding-right:var(--distance-5)}.tpb-auto{padding-bottom:auto}.tpb-1{padding-bottom:var(--distance-1)}.tpb-2{padding-bottom:var(--distance-2)}.tpb-3{padding-bottom:var(--distance-3)}.tpb-4{padding-bottom:var(--distance-4)}.tpb-5{padding-bottom:var(--distance-5)}}@media (max-width:767px){.mp-0{padding:var(--distance-0)}.mpl-0{padding-left:var(--distance-0)}.mpr-0{padding-right:var(--distance-0)}.mpt-0{padding-top:var(--distance-0)}.mpb-0{padding-bottom:var(--distance-0)}.mpx-0{padding-left:var(--distance-0);padding-right:var(--distance-0)}.mp-1{padding:var(--distance-1)}.mp-2{padding:var(--distance-2)}.mp-3{padding:var(--distance-3)}.mp-4{padding:var(--distance-4)}.mp-5{padding:var(--distance-5)}.mpx-auto{padding-left:auto;padding-right:auto}.mpx-1{padding-left:var(--distance-1);padding-right:var(--distance-1)}.mpx-2{padding-left:var(--distance-2);padding-right:var(--distance-2)}.mpx-3{padding-left:var(--distance-3);padding-right:var(--distance-3)}.mpx-4{padding-left:var(--distance-4);padding-right:var(--distance-4)}.mpx-5{padding-left:var(--distance-5);padding-right:var(--distance-5)}.mpy-auto{padding-bottom:auto;padding-top:auto}.mpy-0{padding-bottom:var(--distance-0);padding-top:var(--distance-0)}.mpy-1{padding-bottom:var(--distance-1);padding-top:var(--distance-1)}.mpy-2{padding-bottom:var(--distance-2);padding-top:var(--distance-2)}.mpy-3{padding-bottom:var(--distance-3);padding-top:var(--distance-3)}.mpy-4{padding-bottom:var(--distance-4);padding-top:var(--distance-4)}.mpy-5{padding-bottom:var(--distance-5);padding-top:var(--distance-5)}.mpt-auto{padding-top:auto}.mpt-1{padding-top:var(--distance-1)}.mpt-2{padding-top:var(--distance-2)}.mpt-3{padding-top:var(--distance-3)}.mpt-4{padding-top:var(--distance-4)}.mpt-5{padding-top:var(--distance-5)}.mpl-auto{padding-left:auto}.mpl-1{padding-left:var(--distance-1)}.mpl-2{padding-left:var(--distance-2)}.mpl-3{padding-left:var(--distance-3)}.mpl-4{padding-left:var(--distance-4)}.mpl-5{padding-left:var(--distance-5)}.mpr-auto{padding-right:auto}.mpr-1{padding-right:var(--distance-1)}.mpr-2{padding-right:var(--distance-2)}.mpr-3{padding-right:var(--distance-3)}.mpr-4{padding-right:var(--distance-4)}.mpr-5{padding-right:var(--distance-5)}.mpb-auto{padding-bottom:auto}.mpb-1{padding-bottom:var(--distance-1)}.mpb-2{padding-bottom:var(--distance-2)}.mpb-3{padding-bottom:var(--distance-3)}.mpb-4{padding-bottom:var(--distance-4)}.mpb-5{padding-bottom:var(--distance-5)}}hr{border-color:var(--hr-color);border-style:solid;border-width:0 0 .5px;margin-bottom:var(--default-distance)}button{background-color:var(--button-background);border:.5px solid var(--border-color);border-radius:2px;padding:.6rem 1.5rem}@supports (-moz-appearance:none){button{padding:.6rem 1.5rem .9rem}}button:active,button:focus{box-shadow:0 0 0 1px var(--button-outline-color);cursor:pointer;outline:none}button.no-border{background-color:transparent!important;border:none!important}button:hover{background-color:var(--button-hover)!important;cursor:pointer}button.icon{color:var(--icon)!important;display:flex;flex-direction:column;padding:0;width:auto}button.icon:disabled{color:var(--icon-disabled)!important}button.icon:disabled:hover{background-color:transparent!important}button.primary{background-color:var(--primary)!important;border:0;color:var(--color-on-primary)!important}button.primary:hover{background-color:var(--primary-hover)!important}button.danger{background-color:var(--danger)!important;border:0;color:var(--color-on-danger)!important}button.danger:hover{background-color:var(--danger-hover)!important}button.accent{background-color:var(--accent)!important;border:0;color:var(--color-on-accent)!important}button.accent:hover{background-color:var(--accent-hover)!important}button.contrast{background-color:var(--contrast)!important;border:0;color:var(--color-on-contrast)!important}button.contrast:hover{background-color:var(--contrast-hover)!important}button.accent:active,button.accent:focus,button.contrast:active,button.contrast:focus,button.danger:active,button.danger:focus,button.primary:active,button.primary:focus{box-shadow:0 0 0 1px var(--button-outline-color)!important}button.accent.disabled,button.accent:disabled,button.contrast.disabled,button.contrast:disabled,button.danger.disabled,button.danger:disabled,button.primary.disabled,button.primary:disabled{color:var(--colored-disabled-button-color)!important;cursor:auto;outline:none}button.accent.disabled:not(.link),button.accent:disabled:not(.link),button.contrast.disabled:not(.link),button.contrast:disabled:not(.link),button.danger.disabled:not(.link),button.danger:disabled:not(.link),button.primary.disabled:not(.link),button.primary:disabled:not(.link){background-color:var(--disabled-button-background)!important;border-color:var(--disabled-button-background)!important}button.outline-hover:hover{background-color:transparent!important;outline:.5px solid var(--button-outline-color)!important}button.link{background-color:transparent!important;border:0;color:var(--primary)!important;padding:0}button.link.accent{color:var(--accent)!important}button.link.contrast{color:var(--contrast)!important}button.link.danger{color:var(--danger)!important}button.link:active,button.link:focus,button.link:hover{background-color:transparent!important;box-shadow:unset!important;text-decoration:underline!important}button.disabled,button:disabled{color:var(--disabled-button-color)!important;cursor:auto}button.disabled:not(.link):not(.icon),button:disabled:not(.link):not(.icon){background-color:var(--disabled-button-background)!important;border-color:var(--disabled-button-background)!important}button.disabled.link,button:disabled.link{color:var(--disabled-button-color)!important}button.disabled:hover,button:disabled:hover{outline:none;text-decoration:none}select{background-color:var(--background);border:.5px solid var(--input-border-color);outline:var(--primary) none 0;padding:.5rem}select:focus{border-color:var(--primary);box-shadow:inset 1px 1px 0 var(--primary),inset -1px -1px 0 var(--primary)}select:disabled{background-color:var(--disabled-button-background);border-color:var(--disabled-button-background);box-shadow:none;color:var(--disabled-button-colour);cursor:auto}input,textarea{accent-color:var(--primary);border:.5px solid var(--input-border-color);border-radius:2px;min-height:3rem;outline:0 none currentcolor;padding:0 1rem}input:focus,textarea:focus{border-color:var(--primary);box-shadow:inset 1px 1px 0 var(--primary),inset -1px -1px 0 var(--primary)}input:invalid:not([invalid=false]):not([required]),input[invalid]:not([invalid=false]),textarea:invalid:not([invalid=false]):not([required]),textarea[invalid]:not([invalid=false]){border-color:var(--danger)}input:invalid:not([invalid=false]):not([required]):focus,input:invalid:not([invalid=false]):not([required]):hover,input[invalid]:not([invalid=false]):focus,input[invalid]:not([invalid=false]):hover,textarea:invalid:not([invalid=false]):not([required]):focus,textarea:invalid:not([invalid=false]):not([required]):hover,textarea[invalid]:not([invalid=false]):focus,textarea[invalid]:not([invalid=false]):hover{box-shadow:inset 1px 1px 0 var(--danger),inset -1px -1px 0 var(--danger)}input:disabled,textarea:disabled{background-color:var(--disabled-button-background);border-color:var(--disabled-button-background);box-shadow:none;color:var(--disabled-button-color);cursor:auto}input[type=checkbox],input[type=color],input[type=file],input[type=image],input[type=radio],input[type=range],textarea[type=checkbox],textarea[type=color],textarea[type=file],textarea[type=image],textarea[type=radio],textarea[type=range]{border:none;min-height:unset;padding-left:0}input[type=checkbox]:focus-visible,input[type=radio]:focus-visible,textarea[type=checkbox]:focus-visible,textarea[type=radio]:focus-visible{outline:var(--button-outline-color) dashed .1rem;outline-offset:.1rem}input[type=button],input[type=reset],input[type=submit],textarea[type=button],textarea[type=reset],textarea[type=submit]{border:0;padding:.6rem 1.5rem}@supports (-moz-appearance:none){input[type=button],input[type=reset],input[type=submit],textarea[type=button],textarea[type=reset],textarea[type=submit]{padding:.6rem 1.5rem .9rem}}input[type=button]:hover,input[type=reset]:hover,input[type=submit]:hover,textarea[type=button]:hover,textarea[type=reset]:hover,textarea[type=submit]:hover{background-color:var(--button-hover);cursor:pointer}input[type=button]:active,input[type=button]:focus,input[type=reset]:active,input[type=reset]:focus,input[type=submit]:active,input[type=submit]:focus,textarea[type=button]:active,textarea[type=button]:focus,textarea[type=reset]:active,textarea[type=reset]:focus,textarea[type=submit]:active,textarea[type=submit]:focus{box-shadow:0 0 0 2px var(--button-outline-color);cursor:pointer;outline:none}input[type=button]:disabled,input[type=button]:hover:disabled,input[type=reset]:disabled,input[type=reset]:hover:disabled,input[type=submit]:disabled,input[type=submit]:hover:disabled,textarea[type=button]:disabled,textarea[type=button]:hover:disabled,textarea[type=reset]:disabled,textarea[type=reset]:hover:disabled,textarea[type=submit]:disabled,textarea[type=submit]:hover:disabled{background-color:var(--disabled-button-background);border-color:var(--disabled-button-background);box-shadow:none;color:var(--disabled-button-color);cursor:auto}input[type=reset],textarea[type=reset]{background-color:var(--background);border:.5px solid var(--border-color)}input[type=reset]:active,input[type=reset]:focus,textarea[type=reset]:active,textarea[type=reset]:focus{box-shadow:0 0 0 1px var(--button-outline-color);cursor:pointer;outline:none}input[type=button],input[type=submit],textarea[type=button],textarea[type=submit]{background-color:var(--primary);color:var(--color-on-primary)}input[type=button]:hover,input[type=submit]:hover,textarea[type=button]:hover,textarea[type=submit]:hover{background-color:var(--primary-hover)}input[type=color],input[type=file],input[type=range],textarea[type=color],textarea[type=file],textarea[type=range]{border:none}input[type=color]:focus,input[type=file]:focus,input[type=range]:focus,textarea[type=color]:focus,textarea[type=file]:focus,textarea[type=range]:focus{box-shadow:none;outline:var(--primary) solid 2px;outline-offset:2px}input[type=file]::-webkit-file-upload-button,input[type=file]::file-selector-button,textarea[type=file]::-webkit-file-upload-button,textarea[type=file]::file-selector-button{background-color:var(--primary);border:0;border-radius:2px;color:var(--color-on-primary);padding:.6rem 1.5rem}input[type=file]:active::-webkit-file-upload-button,input[type=file]:active::file-selector-button,textarea[type=file]:active::-webkit-file-upload-button,textarea[type=file]:active::file-selector-button{box-shadow:inset 0 0 0 2px var(--button-outline-color)}input[type=file]:hover::-webkit-file-upload-button,input[type=file]:hover::file-selector-button,textarea[type=file]:hover::-webkit-file-upload-button,textarea[type=file]:hover::file-selector-button{background-color:var(--primary-hover);cursor:pointer}input[type=file]:focus,textarea[type=file]:focus{outline:var(--button-outline-color) solid .2rem;outline-offset:.1rem}input[type=color],textarea[type=color]{background-color:transparent;padding:0;width:8rem}input[type=range],textarea[type=range]{appearance:none;-webkit-appearance:none;background:transparent;padding:0}input[type=range]::-moz-range-thumb,textarea[type=range]::-moz-range-thumb{background:var(--background);border:2px solid var(--range-filled-track-color);border-radius:100px;height:1.2rem;width:1.2rem}input[type=range]::-moz-range-track,textarea[type=range]::-moz-range-track{background-color:var(--range-track-color);height:.3rem}input[type=range]::-moz-range-progress,textarea[type=range]::-moz-range-progress{background-color:var(--range-filled-track-color);height:.3rem}input[type=range]::-webkit-slider-thumb,textarea[type=range]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;background:var(--background);border:2px solid var(--range-filled-track-color);border-radius:100px;height:1.6rem;margin-top:-6px;width:1.6rem}input[type=range]::-webkit-slider-runnable-track,textarea[type=range]::-webkit-slider-runnable-track{background:var(--range-track-color);border:none;border-radius:3px;height:3px}input[type=range]:focus,input[type=range]:hover,textarea[type=range]:focus,textarea[type=range]:hover{background:transparent;outline:none}input[type=range]:focus::-moz-range-progress,input[type=range]:hover::-moz-range-progress,textarea[type=range]:focus::-moz-range-progress,textarea[type=range]:hover::-moz-range-progress{background-color:var(--primary)}input[type=range]:focus::-moz-range-thumb,input[type=range]:hover::-moz-range-thumb,textarea[type=range]:focus::-moz-range-thumb,textarea[type=range]:hover::-moz-range-thumb{border:2px solid var(--primary)}input[type=range]:focus::-webkit-slider-runnable-track,input[type=range]:hover::-webkit-slider-runnable-track,textarea[type=range]:focus::-webkit-slider-runnable-track,textarea[type=range]:hover::-webkit-slider-runnable-track{background-color:var(--primary)}input[type=range]:focus::-webkit-slider-thumb,input[type=range]:hover::-webkit-slider-thumb,textarea[type=range]:focus::-webkit-slider-thumb,textarea[type=range]:hover::-webkit-slider-thumb{border:2px solid var(--primary)}input[type=range]:disabled:focus,input[type=range]:disabled:hover,textarea[type=range]:disabled:focus,textarea[type=range]:disabled:hover{background:transparent;outline:none}input[type=range]:disabled:focus::-moz-range-progress,input[type=range]:disabled:hover::-moz-range-progress,textarea[type=range]:disabled:focus::-moz-range-progress,textarea[type=range]:disabled:hover::-moz-range-progress{background-color:var(--range-filled-track-color)}input[type=range]:disabled:focus::-moz-range-thumb,input[type=range]:disabled:hover::-moz-range-thumb,textarea[type=range]:disabled:focus::-moz-range-thumb,textarea[type=range]:disabled:hover::-moz-range-thumb{border:2px solid var(--range-filled-track-color)}input[type=range]:disabled:focus::-webkit-slider-runnable-track,input[type=range]:disabled:hover::-webkit-slider-runnable-track,textarea[type=range]:disabled:focus::-webkit-slider-runnable-track,textarea[type=range]:disabled:hover::-webkit-slider-runnable-track{background-color:var(--range-filled-track-color)}input[type=range]:disabled:focus::-webkit-slider-thumb,input[type=range]:disabled:hover::-webkit-slider-thumb,textarea[type=range]:disabled:focus::-webkit-slider-thumb,textarea[type=range]:disabled:hover::-webkit-slider-thumb{border:2px solid var(--range-filled-track-color)}input.underline,textarea.underline{background-color:transparent;border-left:0;border-radius:0;border-right:0;border-top:0;padding:0}input.underline:focus,textarea.underline:focus{box-shadow:none}input.underline:focus,input.underline:hover,textarea.underline:focus,textarea.underline:hover{border-color:var(--primary);box-shadow:inset 0 -1px 0 var(--primary)}input.underline:disabled:focus,input.underline:disabled:hover,input.underline:invalid:not([invalid=false]):not([required]):focus,input.underline:invalid:not([invalid=false]):not([required]):hover,textarea.underline:disabled:focus,textarea.underline:disabled:hover,textarea.underline:invalid:not([invalid=false]):not([required]):focus,textarea.underline:invalid:not([invalid=false]):not([required]):hover{border-left:0;border-right:0;border-top:0;box-shadow:none}input.underline:invalid:not([invalid=false]):not([required]):focus,input.underline:invalid:not([invalid=false]):not([required]):hover,input.underline[invalid]:not([invalid=false]):focus,input.underline[invalid]:not([invalid=false]):hover,textarea.underline:invalid:not([invalid=false]):not([required]):focus,textarea.underline:invalid:not([invalid=false]):not([required]):hover,textarea.underline[invalid]:not([invalid=false]):focus,textarea.underline[invalid]:not([invalid=false]):hover{border-color:var(--danger);box-shadow:inset 0 -1px 0 var(--danger)}input.underline:disabled:focus,input.underline:disabled:hover,textarea.underline:disabled:focus,textarea.underline:disabled:hover{border-color:var(--disabled-button-background)}a{color:var(--primary)}a:active,a:focus,a:focus-visible,a:hover{outline:unset}a.accent{color:var(--accent)}a.danger{color:var(--danger)}a.contrast{color:var(--contrast)}a.button{background-color:transparent;border-radius:2px;color:var(--button-color);display:inline-block;padding:.9rem 1.5rem;text-align:center;text-decoration:none}a.button.normal{border:.5px solid var(--border-color)}a.button.normal.disabled{background-color:var(--disabled-button-background);border-color:var(--disabled-button-background);color:var(--disabled-button-color);cursor:default}a.button:hover{background-color:var(--button-hover);cursor:pointer}a.button:active,a.button:focus{box-shadow:0 0 0 1px var(--button-outline-color);cursor:pointer;outline:none}a.button.primary{background-color:var(--primary);border:0;color:var(--color-on-primary)}a.button.primary:hover{background-color:var(--primary-hover)}a.button.danger{background-color:var(--danger);border:0;color:var(--color-on-danger)}a.button.danger:hover{background-color:var(--danger-hover)}a.button.accent{background-color:var(--accent);border:0;color:var(--color-on-accent)}a.button.accent:hover{background-color:var(--accent-hover)}a.button.contrast{background-color:var(--contrast);border:0;color:var(--color-on-contrast)}a.button.contrast:hover{background-color:var(--contrast-hover)}a.button.accent:active,a.button.accent:focus,a.button.contrast:active,a.button.contrast:focus,a.button.danger:active,a.button.danger:focus,a.button.primary:active,a.button.primary:focus{box-shadow:0 0 0 2px var(--button-outline-color)}a.button.accent.disabled,a.button.contrast.disabled,a.button.danger.disabled,a.button.primary.disabled{background-color:var(--disabled-button-background);border-color:var(--disabled-button-background);color:var(--colored-disabled-button-color);cursor:default}table{border-collapse:collapse}table td,table th{padding:.5rem 2.5rem .6rem .5rem;text-align:left;vertical-align:top}table:not(.no-hover) tbody tr:hover{background-color:var(--table-hover)}table.table tbody tr,table.table thead{border-bottom:.5px solid var(--border-color)}table.table tbody tr{border-color:var(--light)}table.table tfoot{font-size:small;font-style:italic}table.sticky-header>thead{background-color:var(--background);border-bottom:0;-webkit-box-shadow:0 1px 4px 0 rgba(var(--shadow-color),.16),0 1px 4px 0 rgba(var(--shadow-color),.12);box-shadow:0 1px 4px 0 rgba(var(--shadow-color),.16),0 1px 4px 0 rgba(var(--shadow-color),.12);position:sticky;position:-webkit-sticky;top:0;white-space:nowrap;z-index:2}table.striped tbody tr:nth-child(odd){background-color:var(--table-stripe)}table.striped tbody tr:hover{background-color:var(--table-striped-hover)}.table-container{border:.5px solid var(--border-color);border-color:var(--light);display:inline-block;overflow-x:hidden;overflow-y:auto;width:fit-content}@-moz-document url-prefix(){.table-container{padding-right:1.7rem}}.cursor-not-allowed:hover{cursor:not-allowed!important}.cursor-pointer{-webkit-user-select:none;-ms-user-select:none;user-select:none}.cursor-pointer:hover{cursor:pointer!important}.cursor-grab:hover{cursor:grab!important}.cursor-grabbing:hover{cursor:grabbing!important}.cursor-zoom-in:hover{cursor:zoom-in!important}.cursor-zoom-out:hover{cursor:zoom-out!important}.cursor-wait:hover{cursor:wait!important}.cursor-help:hover{cursor:help!important}.cursor-default,.cursor-default:hover{cursor:default!important}.cursor-no-select{-webkit-user-select:none!important;-ms-user-select:none!important;user-select:none!important}.border{border:.5px solid var(--border-color)}.border-bottom{border-bottom:.5px solid var(--border-color)}.border-top{border-top:.5px solid var(--border-color)}.border-right{border-right:.5px solid var(--border-color)}.border-left{border-left:.5px solid var(--border-color)}.border-black{border-color:var(--black)}.border-white{border-color:var(--white)}.border-primary{border-color:var(--primary)}.border-accent{border-color:var(--accent)}.border-danger{border-color:var(--danger)}.border-light{border-color:var(--light)}.border-success{border-color:var(--icon-success)}html{background-color:var(--html-background)!important}.bg-gray-light{background-color:var(--gray-light)!important;color:var(--color-on-gray-light)!important}.bg-gray{background-color:var(--gray)!important;color:var(--color-on-gray)!important}.bg-gray-dark{background-color:var(--gray-dark)!important;color:var(--color-on-gray-dark)!important}.bg-black{background-color:var(--black)!important;color:var(--color-on-black)!important}.bg-white{background-color:var(--white)!important;color:var(--font-color)!important}.bg-primary{background-color:var(--primary)!important;color:var(--color-on-primary)!important}.bg-accent{background-color:var(--accent)!important;color:var(--color-on-accent)!important}.bg-danger{background-color:var(--danger)!important;color:var(--color-on-danger)!important}.bg-success{background-color:var(--success)!important;color:var(--color-on-success)!important}.bg-error{background-color:var(--error)!important;color:var(--color-on-error)!important}.bg-warning{background-color:var(--warning)!important;color:var(--color-on-warning)!important}.bg-transparent{background-color:transparent!important}.text-black{color:var(--black)!important}.text-white{color:var(--white)!important}.text-gray{color:var(--gray-darker)!important}.text-primary{color:var(--primary)!important}.text-accent{color:var(--accent)!important}.text-danger{color:var(--danger)!important}.text-success{color:var(--icon-success)!important}.icon-gray{color:var(--gray)!important}.icon-gray-dark{color:var(--gray-dark)!important}.icon-success{color:var(--icon-success)!important}.icon-primary{color:var(--primary)!important}.icon-accent{color:var(--accent)!important}.icon-danger{color:var(--danger)!important}.icon-black{color:var(--black)!important}.icon-white{color:var(--white)!important}.shadow{box-shadow:0 .6px 3.6px 0 rgba(var(--shadow-color),.132),0 .3px .9px 0 rgba(var(--shadow-color),.108)!important}.shadow-top{box-shadow:0 -1.6px 3.6px 0 rgba(var(--shadow-color),.132),0 -.3px .9px 0 rgba(var(--shadow-color),.108)!important}.shadow-left{box-shadow:-1.6px 0 3.6px 0 rgba(var(--shadow-color),.132),.3px 0 .9px 0 rgba(var(--shadow-color),.108)!important}.shadow-right{box-shadow:1.6px 0 3.6px 0 rgba(var(--shadow-color),.132),-.3px 0 .9px 0 rgba(var(--shadow-color),.108)!important}.shadow-bottom{box-shadow:0 1.6px 3.6px 0 rgba(var(--shadow-color),.132),0 .3px .9px 0 rgba(var(--shadow-color),.108)!important}.shadow-lg{box-shadow:0 0 5px 0 rgba(var(--shadow-color),.132)!important}.shadow-top-lg{box-shadow:0 -3px 5px 0 rgba(var(--shadow-color),.132)!important}.shadow-bottom-lg{box-shadow:0 3px 5px 0 rgba(var(--shadow-color),.132)!important}.shadow-left-lg{box-shadow:-3px 0 5px 0 rgba(var(--shadow-color),.132)!important}.shadow-right-lg{box-shadow:3px 0 5px 0 rgba(var(--shadow-color),.132)!important} \ No newline at end of file diff --git a/docs/cdn/ibiss-v0.0.4/flightkit.min.js b/docs/cdn/ibiss-v0.0.4/flightkit.min.js new file mode 100644 index 0000000..a5a8ef8 --- /dev/null +++ b/docs/cdn/ibiss-v0.0.4/flightkit.min.js @@ -0,0 +1 @@ +!function(e,n,s,i){"use strict";function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a,u,g,e=c(e),n=c(n),s=c(s),i=c(i);(t=a=a||{}).Date="date",t.String="string",t.Float="float",t.Number="number",t.Array="array",t.Object="object",t.Bool="bool",t.Currency="currency",t.Undefined="undefined",t.Null="null";const h={date:/^(\d{1,4}-\d{1,4}-\d{1,4}(T)?)/gim,currency:/^[$|€]\s?[0-9]*(\.|,)?\d*(\.|,)?\d*/gim,float:/\d+[,|.]\d+[,|.]?\d*/gim,currencySign:/\$|€/gim,array:/^\s?[[].[^,]+[\]],?/gi,precision:/[-+$€,.]/gm,string:/[a-zA-Z]/gim},m=e=>{return null===e||"null"===e?a.Null:e||0===e||!1===e?null===new RegExp(h.date).exec(e)||isNaN(Date.parse(e))?new RegExp(h.currency).exec(e)?a.Currency:!new RegExp(h.string).exec(e)&&new RegExp(h.float).exec(e.toString())?a.Float:isNaN(e)&&0!==e?Array.isArray(e)?a.Array:"object"==typeof e?a.Object:a.String:a.Number:a.Date:a.Undefined},y=(t,e)=>{const r={value:void 0,type:e=e||m(t),currencySign:""};switch(r.type){case a.String:r.value=t.toString();break;case a.Float:case a.Currency:var n=(t=t.toString()).match(new RegExp(/(,)/gim)),s=t.match(new RegExp(/(\.)/gim));if(n)for(let e=1;e<=n.length;e++)t=e!==n.length||s?t.replace(",",""):t.replace(",",".");if(r.type===a.Currency){const o=new RegExp(h.currencySign);var i=o.exec(t);r.currencySign=null!==i?i[0]:"",t=t.replace(o,"")}r.value=parseFloat(t).toPrecision(12);break;case a.Number:r.value=Number(t);break;case a.Date:r.value=Date.parse(t);break;case a.Array:t.length?"object"==typeof t[0]?r.value=t.map(e=>JSON.stringify(e)).join(", "):r.value=t.join(", "):r.value="";break;case a.Object:r.value=t;break;case a.Undefined:r.value="";break;case a.Null:r.value=null}return r};function v(e,t){var r;let n;for(r of e.split("."))r=r.trim(),n?"object"!=typeof n||Array.isArray(n)||(n=n[r]):n=t[r];return n}const b=(e,t)=>tet<=e,S=(e,t)=>e<=t,x=(e,t,r)=>r?e.toLowerCase()==t.toLowerCase():e==t,A=(e,t)=>e===t,k=(e,t)=>e!=t,E=(e,t)=>e!==t,L=(e,t)=>null!=t&&"string"==typeof e&&0<=e.toLowerCase().indexOf(t.toString().toLowerCase()),O=(e,t)=>null!=t&&0<=e.toString().toLowerCase().indexOf(t.toString().toLowerCase()),M=(e,t)=>null!=t&&"string"==typeof e&&e.toLowerCase().indexOf(t.toString().toLowerCase())<0;function P(r,n){if(0===n.length)return r;{var s=r;const o=[],a=[];let e=[];for(const l of n)l.type&&l.type!==u.And?(e.length&&a.push(e),e=[l]):e.push(l);a.push(e);let t=[];for(const e of a)t=t.concat(R(s,e));t=[...new Set(t)];var i=s.length;for(let e=0;e":return b;case"<":return _;case">=":return C;case"<=":return S;case"is":case"==":return x;case"!is":case"!=":return k;case"===":return A;case"!==":return E;case"like":case"~":case"contains":return L;case"!contains":case"!like":case"!~":return M;default:return O}}(a.operator);if(!l(i,o,a.ignoreCase)){e=!1;break}}e&&r.push(n)}return r};function T(e,t){if(!t||0===t.length)return e;if(1{if(0===r.length)r=r.concat(I(s,e));else{for(const t of r)n=n.concat(I(t,e));r=n,n=[]}}),r}return I(e,t[0])}function I(e,t){const r=[],n=[];do{if(!e||0===e.length)break;var s=e.shift();if(!s)break;const o=s[t];var i=n.indexOf(o.toString());0<=i?r[i].push(s):(n.push(o.toString()),void 0!==r[n.length-1]?r[n.length-1].push(s):r.push([s]))}while(0{if(t){var r=e;const n={};for(const s of t){let e=r.map(e=>e[s].toString());const i=e.map(e=>m(e));i.some(e=>e===a.Float)?(e=e.map(e=>parseFloat(e)),n[s]=parseFloat(e.reduce((e,t)=>e+t).toFixed(2))):(e=e.map(e=>parseInt(e)),n[s]=e.reduce((e,t)=>e+t))}return n}return{}};class D{model;sortDetails=[];filterDetails=[];selection=[];groupByProperties=[];distinctProperties=[];concatenationToken=", ";constructor(e){this.model=JSON.parse(JSON.stringify(e))}sort(e){return this.sortDetails=e,this}orderBy(e,t){return this.sortDetails.push({propertyName:e,direction:t}),this}thenOrderBy(e,t){return this.orderBy(e,t)}filter(e){return Array.isArray(e)?this.filterDetails=e:this.filterDetails.push(e),this}where(e,t,r,n,s){return this.filterDetails.push({propertyName:e,operator:t,value:r,type:n,ignoreCase:s}),this}andWhere(e,t,r,n){return this.where(e,t,r,u.And,n),this}orWhere(e,t,r,n){return this.where(e,t,r,u.Or,n),this}group(e){return this.groupByProperties=e,this}groupBy(e){return this.groupByProperties.push(e),this}thenGroupBy(e){return this.groupByProperties.push(e),this}select(e){return Array.isArray(e)?this.selection=e:"*"!==e&&(this.selection=[e]),this}distinct(e,t){return t&&(this.concatenationToken=t),Array.isArray(e)?this.distinctProperties=e:e&&(this.distinctProperties=[e]),this}execute(){return T(function(t,r){if(0===r.length)return t;{var n=r;let e=[];for(const s of t){const i={};for(const o of n)i[o]=s[o];e.push(i)}return e}}(function(r,n,u){if(!n||!n.length)return r;const s=[],h=[];for(const f of r){const o={};let t="";for(const e of n){var p=v(e,f);o[e]=p,t+=p}if(!h.includes(t)){let e=r;for(const a of Object.keys(o))e=e.filter(e=>e[a]===o[a]);h.push(t),s.push(e)}}const t=[];for(const m of s){let e={};for(const l of m){var i,d=Object.keys(e);if(d.length)for(const c of d)n.includes(c)||(i=e[c],Array.isArray(i)?(i=l[c],Array.isArray(i)?e[c]=[...new Set(...e[c].concat(l[c]))]:e[c].includes(l[c])||e[c].push(l[c])):isNaN(e[c])&&isNaN(l[c])?e[c]!==l[c]&&(e[c]=[e[c],l[c]]):e[c]=e[c]+l[c]);else e=l}t.push(e)}return t.forEach(e=>{for(const t in e)Array.isArray(e[t])&&(e[t]=e[t].join(u))}),t}(B(P(JSON.parse(JSON.stringify(this.model)),this.filterDetails),this.sortDetails),this.distinctProperties,this.concatenationToken),this.selection),this.groupByProperties)}sum(e,t){e=Array.isArray(e)?e:[e];return j(t||this.model,e)}}function U(e,t){t=t?t.toUpperCase():"FLK-";return e.toUpperCase().includes(t)}function F(e,t){var{timeStamp:r,type:n,x:s,y:i}=e;let o=e.target;do{if(!o||"HTML"===o.tagName||U(o.tagName,t)){"HTML"===o.tagName&&(o=null);break}}while(o=o.parentNode||o.parentElement,!U(o.tagName,t));return{target:o,timeStamp:r,type:n,x:s,y:i}}function z(e,t){let r=e.target,n="";for(;r.dataset[t]?n=r.dataset[t]:r=r.parentNode,!n;);return n}class ${constructor(){}_topLevelClasses=[];_events=[];generateId(){return"flk-"+function e(){const t=([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)),r=t.split("-")[0];return window.$flightkitUUIDStore||(window.$flightkitUUIDStore=[]),window.$flightkitUUIDStore.some(e=>e===r)?e():(window.$flightkitUUIDStore.push(r),r)}()}render(t){if(!t.component)throw new Error("Component is not assigned! Can't render");t.id=t.id||this.generateId();var e=this._getAllEventAttributes(t);if(e){var r="#"+t.id;for(const i of e){var n="e-"+i;this.addEvent(r,i,t.getAttribute(n))}}var s=Object.keys(t.classList).length;if(s){for(let e=0;e{this._assignToDom(t,t.component),clearTimeout(this._renderTimer)},10)}addEvent(e,t,r){this._events.push({selector:e,eventType:t,callback:r})}_getExternalCallback(e){let t=void 0;for(const r of e.split("."))t=(t||window)[r];return t}_getAllEventAttributes(e){e=e.attributes;const t=Array.from(e).filter(e=>e.name.startsWith("e-"));return t.map(e=>e.name.slice(2))}_isFlightkitElement(e){return e.toUpperCase().includes("FLK-")}_outerEventHandler(e){const t=F(e),r=(t.contents=e.detail,t.target.getAttribute("e-"+t.type));let n=void 0;for(const s of r.split("."))n=(n||window)[s];return e.preventDefault(),e.stopPropagation(),n(t)}_addEvents(e){if(e.isConnected)for(const r of this._events)if(r.selector.startsWith("."))for(const n of document.querySelectorAll(r.selector))this._addEventToElement(r,n);else{var t=document.querySelector(r.selector);this._addEventToElement(r,t)}}_addEventToElement(e,t){t&&("function"==typeof e.callback?(t.removeEventListener(e.eventType,e.callback),t.addEventListener(e.eventType,e.callback)):(t.removeEventListener(e.eventType,this._outerEventHandler),t.addEventListener(e.eventType,this._outerEventHandler)))}removeEvents(){for(const t of this._events)if(t.selector.startsWith("."))for(const r of document.querySelectorAll(t.selector))this._addEventToElement(t,r);else{var e=document.querySelector(t.selector);this._addEventToElement(t,e)}this._events=[]}_removeEventToElement(e,t){t&&("function"==typeof e.callback?t.removeEventListener(e.eventType,e.callback):t.removeEventListener(e.eventType,this._outerEventHandler))}_assignToDom(e,t){e.innerHTML="";for(const n of Array.isArray(t)?t:[t])e.append(n);const r=setTimeout(()=>{this._addEvents(e),clearTimeout(r)},10)}}const G='',H='';function V(e){const t=new DOMParser;return t.parseFromString(e,"image/svg+xml").documentElement}class W extends HTMLElement{base;component=null;_contents=[];_orderBy=[];properties=new Set;_columnOrder=[];_filter="";_selectionProperty="";_selectedIds=new Set;uniqueEntriesByProperties={};propertyLabelDictionary={};_templates={};_templateClasses={};static get observedAttributes(){return["contents","columns","order","filter","selection-property","templates"]}get columnOrder(){return this._columnOrder.length?this._columnOrder:this.properties}set columnOrder(e){let t;"string"==typeof e&&(t=e.split(",")),t=e,this._columnOrder=t}get contents(){return this._contents}set contents(e){this.analyzeData(e),this._contents=new D(e)}get orderBy(){return this._orderBy}set orderBy(e){if(Array.isArray(e))this._orderBy=e;else{const n=[];for(const s of e.split(",")){var t=s.split("|"),r=t[0],t=1e[r._selectionProperty])):new Set;e=t?r.contents.execute():[];r._emit("select",r,{selection:e}),r._updateCheckboxes(r)}emitSelect(e){var t=e.target.checked,r=e.target.dataset.objectId;const n=F(e).target,s=(t?n._selectedIds.add(r):n._selectedIds.delete(r),n._selectionProperty);e=n.contents.execute().filter(e=>n._selectedIds.has(e[s]));n._emit("select",n,{selection:e}),n._updateCheckboxes(n)}sortData(e){const t=F(e).target,r=z(e,"column");r&&(-1<(e=t._orderBy.findIndex(e=>e.propertyName===r))?"asc"===t._orderBy[e].direction?t._orderBy[e].direction="desc":t._orderBy.splice(e,1):t._orderBy.push({propertyName:r,direction:"asc"}),t.createHtml(),t.base.render(t))}setColumnOrder(e){this._columnOrder=e?Array.isArray(e)?e:e.split(","):[]}analyzeData(t){this.properties=new Set;var r=t.length;for(let e=0;e"_"===e?" ":" "+e.toLowerCase()).trim();var r=t.charAt(0).toUpperCase()+t.slice(1);return this.propertyLabelDictionary[e]=r}parseTemplate(e,n){return e.replace(/\{\{([\s\S]+?)\}\}/gim,(e,t)=>{let r="";t=t.trim();t=n[t];return t&&(r=t),Array.isArray(r)?r.join(", "):r.toString().trim()})}createSelectionCheckbox(e){const t=document.createElement("input");return t.setAttribute("type","checkbox"),t.classList.add("flk-selection-checkbox"),e&&(t.dataset.selected=e[this._selectionProperty]),t}createRow(e){const t=document.createElement("tr");if(this._selectionProperty.length){const s=document.createElement("td");var r=this.base.generateId();const i=this.createSelectionCheckbox(e);i.id=r,i.dataset.objectId=e[this._selectionProperty];var n=e[this._selectionProperty];this._selectedIds.has(n)?i.checked=!0:i.checked=!1,this.base.addEvent("#"+r,"change",this.emitSelect),s.append(i),t.append(s)}for(const o of this.columnOrder){const a=document.createElement("td");this._templates[o]?(a.innerHTML=this.parseTemplate(this._templates[o],e),this._templateClasses[o]&&a.classList.add(...this._templateClasses[o])):a.innerText=e[o],t.append(a)}return t}createBody(e){const t=document.createElement("tbody");for(const n of e){var r=this.createRow(n,null);t.append(r)}return t}createHead(){const e=document.createElement("thead"),t=document.createElement("tr");if(t.classList.add("cursor-pointer"),this._selectionProperty.length){const s=document.createElement("th");var r=this.base.generateId();const i=this.createSelectionCheckbox();i.id=r;var u=this.contents.execute().length;0e.propertyName===o);if(n){const c=document.createElement("span");c.innerHTML="asc"===n.direction?'':'',a.append(c)}t.append(a)}return e.append(t),e}addEvent(e,t,r){this.base.addEvent(e,t,r)}init(){this.createHtml(),this.base.render(this)}}class J extends HTMLElement{base;componentId;constructor(){super(),this.base=new $}connectedCallback(){var e=this.getAttribute("top"),t=this.getAttribute("left"),r=this.getAttribute("center"),n=this.getAttribute("zIndex");this.id||(this.id=this.base.generateId()),this.style.display="block",this.style.position="fixed","string"==typeof r?(this.style.top=e||"50%",this.style.left="50%",this.style.transform="translate(-50%, -50%)"):(this.style.top=e||this.clientTop+"px",this.style.left=t||this.clientLeft+"px"),n&&(this.style.zIndex=n),this.componentId=this.getAttribute("handle");const s=document.createElement("div");s.innerHTML=this.innerHTML,this.component=s;r="#"+(this.componentId||this.id);this.base.addEvent(r,"mousedown",this._dragElement),this.base.addEvent(r,"mouseup",this._reset),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this)}_dragElement(e){const r=F(e,"flk-draggable").target;let n,s;function t(e){n=e.clientX-r.offsetLeft,s=e.clientY-r.offsetTop}function i(e){var t=e.clientX-n,e=e.clientY-s;r.style.left=t+"px",r.style.top=e+"px"}function o(e){e.preventDefault()}function a(){r.removeAttribute("draggable"),r.removeEventListener("dragstart",t),r.removeEventListener("dragend",a),document.removeEventListener("dragover",o),document.removeEventListener("drop",i)}r.setAttribute("draggable",!0),r.addEventListener("dragstart",t),r.addEventListener("dragend",a),document.addEventListener("dragover",o),document.addEventListener("drop",i)}}class q extends HTMLElement{_id;base;_draggableId;constructor(){super(),this.base=new $}_emit(e,t,r){e=new CustomEvent(e,{detail:r,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}_closeModal(e){e.stopPropagation();const t=F(e,"flk-modal").target;t.classList.add("hidden")}closeModal(e){this.classList.add("hidden")}openModal(e=!0){const t=document.getElementById(this._draggableId);e&&(t.style.top="40%",t.style.left="50%"),this.classList.remove("hidden")}connectedCallback(){this.id||(this.id=this.base.generateId());const e=document.createElement("div");var t=this.base.generateId();const r=document.createElement("flk-draggable"),n=(this._draggableId=this.base.generateId(),r.id=this._draggableId,r.setAttribute("center",""),r.setAttribute("top","40%"),r.setAttribute("handle",t),r.setAttribute("zIndex","1080"),r.classList.add("border","shadow-lg","bg-white"),r.style.width="max-content",document.createElement("div"));var s=this.getAttribute("modal-title");if(s){const c=document.createElement("span");c.innerText=s,c.classList.add("ml-1","mr-auto"),n.append(c)}n.id=t;const i=this.getAttribute("header-class");let o=[];i?o=o.concat(i.split(" ")):o.push("bg-gray-light"),n.classList.add(...o,"border-bottom","row","justify-end","cursor-no-select");s=this.base.generateId();const a=document.createElement("button"),l=(a.classList.add("py-0","px-1","outline-hover","no-border","cursor-default",...o),a.innerText="X",a.id=s,n.append(a),r.append(n),document.createElement("div"));l.innerHTML=this.innerHTML,r.append(l),e.append(r),this.component=e,this.base.addEvent("#"+s,"click",this._closeModal),this.base.render(this),this.classList.add("hidden")}disconnectedCallback(){this.base.removeEvents(this)}}class K extends HTMLElement{base;_buttonId;_drawerId;_iconId;constructor(){super(),this.base=new $}connectedCallback(){this.style.position="relative",this.style.display="flex",this.style.width="fit-content",this._buttonId=this.base.generateId();const e=document.createElement("button"),t=(e.classList.add("row"),e.id=this._buttonId,document.createElement("span")),r=(t.innerText=this.getAttribute("text"),this._iconId=this.base.generateId(),document.createElement("span"));var n=V('');const s=V(''),i=(s.classList.add("hidden"),r.append(n,s),r.id=this._iconId,e.append(t,r),this._drawerId=this.base.generateId(),document.createElement("div"));i.id=this._drawerId,i.classList.add("shadow","inline-block","bg-white"),i.style.position="absolute",i.style.zIndex="1040";n=this.querySelector("template");n.innerHTML.length?i.innerHTML=n.innerHTML:i.append(n.firstChild),i.style.display="none",this.component=[e,i],this.base.addEvent("#"+this._buttonId,"click",this.toggleMenu);const o=document.querySelector("body");""!==o.getAttribute("flk-close-dropdown")&&(o.setAttribute("flk-close-dropdown",""),o.addEventListener("click",this.closeAllDropdownButtons)),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this);var e=document.querySelectorAll("flk-dropdown");if(!e||!e.length){const t=document.querySelector("body");t.removeAttribute("flk-close-dropdown"),t.removeEventListener("click",this.closeAllDropdownButtons)}}toggleMenu(e){const t=F(e).target;e=t._drawerId;const r=document.getElementById(e);var e="none"!==r.style.display,n=(r.style.display=e?"none":"block",t.getAttribute("drawer-width")),n=("string"==typeof t.getAttribute("right")&&(r.style.right="0px"),r.style.top=t.offsetHeight+"px",r.style.width=n||t.offsetWidth+"px",t._iconId);const s=document.getElementById(n);e?(s.childNodes[0].classList.remove("hidden"),s.childNodes[1].classList.add("hidden")):(s.childNodes[0].classList.add("hidden"),s.childNodes[1].classList.remove("hidden"))}_closeDropdown(){var e=this._drawerId;const t=document.getElementById(e);if("none"!==t.style.display){e=this._iconId;const r=document.getElementById(e);t.style.display="none",r.childNodes[0].classList.remove("hidden"),r.childNodes[1].classList.add("hidden")}}closeAllDropdownButtons(e){var t,r=F(e,"flk-dropdown").target,e=document.querySelectorAll("flk-dropdown");if(r)for(const n of e)r._buttonId!==n._buttonId&&(t=n._drawerId,"none"!==document.getElementById(t).style.display&&n._closeDropdown());else for(const s of e)s._closeDropdown()}}var t={exports:{}};let Z=e.default,Y=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||"win32"===process.platform||Z.isatty(1)&&"dumb"!==process.env.TERM||"CI"in process.env),r=(r,n,s=r)=>e=>{let t=""+e;e=t.indexOf(n,r.length);return~e?r+X(t,n,s,e)+n:r+t+n},X=(e,t,r,n)=>{var s=e.substring(0,n)+r;let i=e.substring(n+t.length);e=i.indexOf(t);return~e?s+X(i,t,r,e):s+i};e=(e=Y)=>({isColorSupported:e,reset:e?e=>`${e}`:String,bold:e?r("","",""):String,dim:e?r("","",""):String,italic:e?r("",""):String,underline:e?r("",""):String,inverse:e?r("",""):String,hidden:e?r("",""):String,strikethrough:e?r("",""):String,black:e?r("",""):String,red:e?r("",""):String,green:e?r("",""):String,yellow:e?r("",""):String,blue:e?r("",""):String,magenta:e?r("",""):String,cyan:e?r("",""):String,white:e?r("",""):String,gray:e?r("",""):String,bgBlack:e?r("",""):String,bgRed:e?r("",""):String,bgGreen:e?r("",""):String,bgYellow:e?r("",""):String,bgBlue:e?r("",""):String,bgMagenta:e?r("",""):String,bgCyan:e?r("",""):String,bgWhite:e?r("",""):String});t.exports=e(),t.exports.createColors=e;const Q="'".charCodeAt(0),ee='"'.charCodeAt(0),te="\\".charCodeAt(0),re="/".charCodeAt(0),ne="\n".charCodeAt(0),se=" ".charCodeAt(0),ie="\f".charCodeAt(0),oe="\t".charCodeAt(0),ae="\r".charCodeAt(0),le="[".charCodeAt(0),ce="]".charCodeAt(0),ue="(".charCodeAt(0),he=")".charCodeAt(0),pe="{".charCodeAt(0),de="}".charCodeAt(0),fe=";".charCodeAt(0),me="*".charCodeAt(0),ge=":".charCodeAt(0),ye="@".charCodeAt(0),ve=/[\t\n\f\r "#'()/;[\\\]{}]/g,we=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,be=/.[\r\n"'(/\\]/,_e=/[\da-f]/i;function Ce(t,e={}){let n=t.css.valueOf(),d=e.ignoreErrors,s,i,f,m,o,a,l,g,c,u,y=n.length,h=0,v=[],p=[];function w(e){throw t.error("Unclosed "+e,h)}return{back:function(e){p.push(e)},endOfFile:function(){return 0===p.length&&h>=y},nextToken:function(e){if(p.length)return p.pop();if(!(h>=y)){var t=!!e&&e.ignoreUnclosed;switch(s=n.charCodeAt(h),s){case ne:case se:case oe:case ae:case ie:for(i=h;i+=1,s=n.charCodeAt(i),s===se||s===ne||s===oe||s===ae||s===ie;);u=["space",n.slice(h,i)],h=i-1;break;case le:case ce:case pe:case de:case ge:case fe:case he:var r=String.fromCharCode(s);u=[r,r,h];break;case ue:if(g=v.length?v.pop()[1]:"",c=n.charCodeAt(h+1),"url"===g&&c!==Q&&c!==ee&&c!==se&&c!==ne&&c!==oe&&c!==ie&&c!==ae){i=h;do{if(a=!1,i=n.indexOf(")",i+1),-1===i){if(d||t){i=h;break}w("bracket")}for(l=i;n.charCodeAt(l-1)===te;)--l,a=!a}while(a);u=["brackets",n.slice(h,i+1),h,i],h=i}else i=n.indexOf(")",h+1),m=n.slice(h,i+1),-1===i||be.test(m)?u=["(","(",h]:(u=["brackets",m,h,i],h=i);break;case Q:case ee:f=s===Q?"'":'"',i=h;do{if(a=!1,i=n.indexOf(f,i+1),-1===i){if(d||t){i=h+1;break}w("string")}for(l=i;n.charCodeAt(l-1)===te;)--l,a=!a}while(a);u=["string",n.slice(h,i+1),h,i],h=i;break;case ye:ve.lastIndex=h+1,ve.test(n),i=0===ve.lastIndex?n.length-1:ve.lastIndex-2,u=["at-word",n.slice(h,i+1),h,i],h=i;break;case te:for(i=h,o=!0;n.charCodeAt(i+1)===te;)i+=1,o=!o;if(s=n.charCodeAt(i+1),o&&s!==re&&s!==se&&s!==ne&&s!==oe&&s!==ae&&s!==ie&&(i+=1,_e.test(n.charAt(i)))){for(;_e.test(n.charAt(i+1));)i+=1;n.charCodeAt(i+1)===se&&(i+=1)}u=["word",n.slice(h,i+1),h,i],h=i;break;default:h=(s===re&&n.charCodeAt(h+1)===me?(i=n.indexOf("*/",h+2)+1,0===i&&(d||t?i=n.length:w("comment")),u=["comment",n.slice(h,i+1),h,i]):(we.lastIndex=h+1,we.test(n),i=0===we.lastIndex?n.length-1:we.lastIndex-2,u=["word",n.slice(h,i+1),h,i],v.push(u)),i)}return h++,u}},position:function(){return h}}}e=t.exports;let Se=Ce,xe;const Ae={";":e.yellow,":":e.yellow,"(":e.cyan,")":e.cyan,"[":e.yellow,"]":e.yellow,"{":e.yellow,"}":e.yellow,"at-word":e.cyan,brackets:e.cyan,call:e.cyan,class:e.yellow,comment:e.gray,hash:e.magenta,string:e.green};function ke(e){let r=Se(new xe(e),{ignoreErrors:!0}),n="";for(;!r.endOfFile();){let e=r.nextToken(),t=Ae[function([e,t],r){if("word"===e){if("."===t[0])return"class";if("#"===t[0])return"hash"}if(!r.endOfFile()){t=r.nextToken();if(r.back(t),"brackets"===t[0]||"("===t[0])return"call"}return e}(e,r)];t?n+=e[1].split(/\r?\n/).map(e=>t(e)).join("\n"):n+=e[1]}return n}ke.registerInput=function(e){xe=e};e=ke;let Ee=t.exports,Le=e;class Oe extends Error{constructor(e,t,r,n,s,i){super(e),this.name="CssSyntaxError",this.reason=e,s&&(this.file=s),n&&(this.source=n),i&&(this.plugin=i),void 0!==t&&void 0!==r&&("number"==typeof t?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,Oe)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file||"",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source,r=(null==e&&(e=Ee.isColorSupported),Le&&e&&(t=Le(t)),t.split(/\r?\n/)),n=Math.max(this.line-3,0);var s=Math.min(this.line+2,r.length);let i=String(s).length,o,a;if(e){let{bold:t,gray:r,red:n}=Ee.createColors(!0);o=e=>t(n(e)),a=e=>r(e)}else o=a=e=>e;return r.slice(n,s).map((e,t)=>{var t=n+1+t;let r=" "+(" "+t).slice(-i)+" | ";return t===this.line?(t=a(r.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," "),o(">")+a(r)+e+"\n "+t+o("^")):" "+a(r)+e}).join("\n")}toString(){let e=this.showSourceCode();return e=e&&"\n\n"+e+"\n",this.name+": "+this.message+e}}var t=Oe,Me=(Oe.default=Oe,{});Me.isClean=Symbol("isClean"),Me.my=Symbol("my");const Pe={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class Re{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name;var n=e.params?this.rawValue(e,"params"):"";void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes?this.block(e,r+n):(t=(e.raws.between||"")+(t?";":""),this.builder(r+n+t,e))}beforeAfter(e,t){let r,n=(r="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose"),e.parent),s=0;for(;n&&"root"!==n.type;)s+=1,n=n.parent;if(r.includes("\n")){var i=this.raw(e,null,"indent");if(i.length)for(let e=0;e{if(n=e.raws[t],void 0!==n)return!1}),void 0===n&&(n=Pe[r]),i.rawCache[r]=n,n}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&0{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=void 0===r?this.raw(t,null,"beforeDecl"):r&&r.replace(/\S/g,""),r}rawBeforeDecl(e,t){let r;return e.walkDecls(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=void 0===r?this.raw(t,null,"beforeRule"):r&&r.replace(/\S/g,""),r}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(t){let r;return t.walk(e=>{if(e.nodes&&(e.parent!==t||t.first!==e)&&void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=r&&r.replace(/\S/g,""),r}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(r){if(r.raws.indent)return r.raws.indent;let n;return r.walk(e=>{var t=e.parent;if(t&&t!==r&&t.parent&&t.parent===r&&void 0!==e.raws.before)return t=e.raws.before.split("\n"),n=t[t.length-1],n=n.replace(/\S/g,""),!1}),n}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){var r=e[t],e=e.raws[t];return e&&e.value===r?e.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}}var Te=Re;Re.default=Re;let Ie=Te;function Be(e,t){let r=new Ie(t);r.stringify(e)}var Ne=Be;Be.default=Be;let{isClean:je,my:De}=Me,Ue=t,Fe=Te,ze=Ne;function $e(t,r){let n=new t.constructor;for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&"proxyCache"!==s){let e=t[s];var i=typeof e;"parent"===s&&"object"==i?r&&(n[s]=r):"source"===s?n[s]=e:Array.isArray(e)?n[s]=e.map(e=>$e(e,n)):("object"==i&&null!==e&&(e=$e(e)),n[s]=e)}return n}class Ge{constructor(e={}){for(var t in this.raws={},this[je]=!1,this[De]=!0,e)if("nodes"===t){this.nodes=[];for(var r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){var t;return e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)&&(t=this.source,e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)),e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(var t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=$e(this);for(var r in e)t[r]=e[r];return t}cloneAfter(e={}){e=this.clone(e);return this.parent.insertAfter(this,e),e}cloneBefore(e={}){e=this.clone(e);return this.parent.insertBefore(this,e),e}error(e,t={}){var r,n;return this.source?({end:r,start:n}=this.rangeBy(t),this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)):new Ue(e)}getProxyProcessor(){return{get(e,t){return"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t]},set(e,t,r){return e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0}}}markDirty(){if(this[je]){this[je]=!1;let e=this;for(;e=e.parent;)e[je]=!1}}next(){var e;if(this.parent)return e=this.parent.index(this),this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;return e.index?r=this.positionInside(e.index,t):!e.word||-1!==(e=(t=this.toString()).indexOf(e.word))&&(r=this.positionInside(e,t)),r}positionInside(t,e){var r=e||this.toString();let n=this.source.start.column,s=this.source.start.line;for(let e=0;e"object"==typeof e&&e.toJSON?e.toJSON(null,r):e);else if("object"==typeof t&&t.toJSON)n[s]=t.toJSON(null,r);else if("source"===s){let e=r.get(t.input);null==e&&(e=i,r.set(t.input,i),i++),n[s]={end:t.end,inputId:e,start:t.start}}else n[s]=t}return t&&(n.inputs=[...r.keys()].map(e=>e.toJSON())),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=ze){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(var s in r)n[s]=r[s];return e.warn(t,n)}get proxyOf(){return this}}var Te=Ge,He=(Ge.default=Ge,Te);class Ve extends He{constructor(e){super(e=e&&void 0!==e.value&&"string"!=typeof e.value?{...e,value:String(e.value)}:e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}}var He=Ve,We=(Ve.default=Ve,{}),Je={},qe={},Ke={},Ze="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),Ye=(Ke.encode=function(e){if(0<=e&&e>>=5)&&(t|=32),r+=Ye.encode(t),0>1,1==(1&a)?-i:i),r.rest=t};var Ke={},l=Ke,Xe=(l.getArg=function(e,t,r){if(t in e)return e[t];if(3===arguments.length)return r;throw new Error('"'+t+'" is a required argument.')},/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/),Qe=/^data:.+\,.+$/;function et(e){e=e.match(Xe);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}function tt(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}l.urlParse=et,l.urlGenerate=tt,rt=function(e){var t=e,r=et(e);if(r){if(!r.path)return e;t=r.path}for(var n,e=l.isAbsolute(t),s=[],i=0;;){if(n=i,-1===(i=t.indexOf("/",n))){s.push(t.slice(n));break}for(s.push(t.slice(n,i));in;e--){var o=r[e-1],a=r[e];if(Pt(o,a)<=0)break;r[e-1]=a,r[e]=o}else Ot(r,Pt,n)}function Tt(e,s){var t=e,e=("string"==typeof e&&(t=w.parseSourceMapInput(e)),w.getArg(t,"version")),t=w.getArg(t,"sections");if(e!=this._version)throw new Error("Unsupported version: "+e);this._sources=new Et,this._names=new Et;var i={line:-1,column:0};this._sections=t.map(function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var t=w.getArg(e,"offset"),r=w.getArg(t,"line"),n=w.getArg(t,"column");if(r=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))},p.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;var r=this._findSourceIndex(e);if(0<=r)return this.sourcesContent[r];var n,r=e;if(null!=this.sourceRoot&&(r=w.relative(this.sourceRoot,r)),null!=this.sourceRoot&&(n=w.urlParse(this.sourceRoot))){e=r.replace(/^file:\/\//,"");if("file"==n.scheme&&this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];if((!n.path||"/"==n.path)&&this._sources.has("/"+r))return this.sourcesContent[this._sources.indexOf("/"+r)]}if(t)return null;throw new Error('"'+r+'" is not in the SourceMap.')},p.prototype.generatedPositionFor=function(e){var t=w.getArg(e,"source");if((t=this._findSourceIndex(t))<0)return{line:null,column:null,lastColumn:null};t={source:t,originalLine:w.getArg(e,"line"),originalColumn:w.getArg(e,"column")},e=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",w.compareByOriginalPositions,w.getArg(e,"bias",f.GREATEST_LOWER_BOUND));if(0<=e){e=this._originalMappings[e];if(e.source===t.source)return{line:w.getArg(e,"generatedLine",null),column:w.getArg(e,"generatedColumn",null),lastColumn:w.getArg(e,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},ft.BasicSourceMapConsumer=p,(Tt.prototype=Object.create(f.prototype)).constructor=f,Tt.prototype._version=3,Object.defineProperty(Tt.prototype,"sources",{get:function(){for(var e=[],t=0;t{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(n,s=21)=>(e=s)=>{let t="",r=e;for(;r--;)t+=n[Math.random()*n.length|0];return t}};let{SourceMapConsumer:Ut,SourceMapGenerator:Ft}=We,{existsSync:zt,readFileSync:$t}=i.default,{dirname:Gt,join:Ht}=n.default;class Vt{constructor(e,t){!1!==t.map&&(this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:"),e=t.map?t.map.prev:void 0,e=this.loadMap(t.from,e),!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Gt(this.mapFile)),e&&(this.text=e))}consumer(){return this.consumerCache||(this.consumerCache=new Ut(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+t)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);var r,n;t&&(r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r),-1"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,i,o;t&&"object"==typeof t?(a=r,r="number"==typeof(l=t).offset?(t=(c=this.fromOffset(l.offset)).line,c.col):(t=l.line,l.column),o="number"==typeof a.offset?(c=this.fromOffset(a.offset),i=c.line,c.col):(i=a.line,a.column)):r||(t=(l=this.fromOffset(t)).line,r=l.col);var a,l,c=this.origin(t,r,i,o);return s=c?new Xt(e,void 0===c.endLine?c.line:{column:c.column,line:c.line},void 0===c.endLine?c.column:{column:c.endColumn,line:c.endLine},c.source,c.file,n.plugin):new Xt(e,void 0===i?t:{column:r,line:t},void 0===i?r:{column:o,line:i},this.css,this.file,n.plugin),s.input={column:r,endColumn:o,endLine:i,line:t,source:this.css},this.file&&(Jt&&(s.input.url=Jt(this.file).toString()),s.input.file=this.file),s}fromOffset(t){let n;if(this[er])n=this[er];else{var s=this.css.split("\n");n=new Array(s.length);let r=0;for(let e=0,t=s.length;e>1),t=n[i+1])){r=i;break}r=i+1}}return{col:t-n[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Kt(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let s=this.map.consumer();t=s.originalPositionFor({column:t,line:e});if(!t.source)return!1;let i;"number"==typeof r&&(i=s.originalPositionFor({column:n,line:r}));let o,a=(o=qt(t.source)?Jt(t.source):new URL(t.source,this.map.consumer().sourceRoot||Jt(this.map.mapFile)),{column:t.column,endColumn:i&&i.column,endLine:i&&i.line,line:t.line,url:o.toString()});if("file:"===o.protocol){if(!Wt)throw new Error("file: protocol is not available in this PostCSS build");a.file=Wt(o)}e=s.sourceContentFor(t.source);return e&&(a.source=e),a}toJSON(){let e={};for(var t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}}Je=nr;nr.default=nr,Yt&&Yt.registerInput&&Yt.registerInput(nr);let{SourceMapConsumer:sr,SourceMapGenerator:ir}=We,{dirname:or,relative:ar,resolve:lr,sep:cr}=n.default,ur=s.default["pathToFileURL"],hr=Je,pr=Boolean(sr&&ir),dr=Boolean(or&&lr&&ar&&cr);ft=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e,t=(e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map","\n");this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(var t of this.previous()){var r=this.toUrl(this.path(t.file)),n=t.root||or(t.file);let e;!1===this.mapOpts.sourcesContent?(e=new sr(t.text),e.sourcesContent&&(e.sourcesContent=null)):e=t.consumer(),this.map.applySourceMap(e,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let t;for(let e=this.root.nodes.length-1;0<=e;e--)t=this.root.nodes[e],"comment"===t.type&&0===t.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(e)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),dr&&pr&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,e=>{t+=e}),[t]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=ir.fromSourceMap(e)}else this.map=new ir({file:this.outputFile()}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):""});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&0",o={generated:{column:0,line:0},original:{column:0,line:0},source:""},a,l;this.stringify(this.root,(e,t,r)=>{this.css+=e,t&&"end"!==r&&(o.generated.line=n,o.generated.column=s-1,t.source&&t.source.start?(o.source=this.sourcePath(t),o.original.line=t.source.start.line,o.original.column=t.source.start.column-1):(o.source=i,o.original.line=1,o.original.column=0),this.map.addMapping(o)),a=e.match(/\n/g),a?(n+=a.length,l=e.lastIndexOf("\n"),s=e.length-l):s+=e.length,t&&"start"!==r&&(e=t.parent||{raws:{}},("decl"===t.type||"atrule"===t.type&&!t.nodes)&&t===e.last&&!e.raws.semicolon||(t.source&&t.source.end?(o.source=this.sourcePath(t),o.original.line=t.source.end.line,o.original.column=t.source.end.column-1,o.generated.line=n,o.generated.column=s-2):(o.source=i,o.original.line=1,o.original.column=0,o.generated.line=n,o.generated.column=s-1),this.map.addMapping(o)))})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;var e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:0e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;var t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?or(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=or(lr(r,this.mapOpts.annotation)));t=ar(r,e);return this.memoizedPaths.set(e,t),t}previous(){var e;return this.previousMaps||(this.previousMaps=[],this.root?this.root.walk(e=>{e.source&&e.source.input.map&&(e=e.source.input.map,this.previousMaps.includes(e)||this.previousMaps.push(e))}):(e=new hr(this.originalCSS,this.opts)).map&&this.previousMaps.push(e.map)),this.previousMaps}setSourcesContent(){let r={};var e;this.root?this.root.walk(e=>{var t;!e.source||(t=e.source.input.from)&&!r[t]&&(r[t]=!0,t=this.usesFileUrls?this.toFileUrl(t):this.toUrl(this.path(t)),this.map.setSourceContent(t,e.source.input.css))}):this.css&&(e=this.opts.from?this.toUrl(this.path(this.opts.from)):"",this.map.setSourceContent(e,this.css))}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){var t=this.memoizedFileURLs.get(e);if(t)return t;if(ur)return t=ur(e).toString(),this.memoizedFileURLs.set(e,t),t;throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){var t=this.memoizedURLs.get(e);if(t)return t;"\\"===cr&&(e=e.replace(/\\/g,"/"));t=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,t),t}};class fr extends Te{constructor(e){super(e),this.type="comment"}}Ct=fr;fr.default=fr;let{isClean:mr,my:gr}=Me,yr=He,vr=Ct,wr,br,_r,Cr;class Sr extends Te{append(...e){for(var t of e){var r;for(r of this.normalize(t,this.last))this.proxyOf.nodes.push(r)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(var t of this.nodes)t.cleanRaws(e)}each(r){if(this.proxyOf.nodes){var n=this.getIterator();let e,t;for(;this.indexes[n]t[n](...e.map(r=>"function"==typeof r?(e,t)=>r(e.toProxy(),t):r)):"every"===n||"some"===n?r=>t[n]((e,...t)=>r(e.toProxy(),...t)):"root"===n?()=>t.root().toProxy():"nodes"===n?t.nodes.map(e=>e.toProxy()):"first"===n||"last"===n?t[n].toProxy():t[n])},set(e,t,r){return e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0}}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){var r,n,s,i=this.index(e),o=this.normalize(t,this.proxyOf.nodes[i]).reverse(),i=this.index(e);for(r of o)this.proxyOf.nodes.splice(i+1,0,r);for(s in this.indexes)i<(n=this.indexes[s])&&(this.indexes[s]=n+o.length);return this.markDirty(),this}insertBefore(e,t){var r,n,s,i=this.index(e),o=this.normalize(t,this.proxyOf.nodes[i],0===i&&"prepend").reverse(),i=this.index(e);for(r of o)this.proxyOf.nodes.splice(i,0,r);for(s in this.indexes)i<=(n=this.indexes[s])&&(this.indexes[s]=n+o.length);return this.markDirty(),this}normalize(e,t){if("string"==typeof e)e=function t(e){return e.map(e=>(e.nodes&&(e.nodes=t(e.nodes)),delete e.source,e))}(wr(e).nodes);else if(void 0===e)e=[];else if(Array.isArray(e))for(var r of e=e.slice(0))r.parent&&r.parent.removeChild(r,"ignore");else if("root"===e.type&&"document"!==this.type)for(var n of e=e.nodes.slice(0))n.parent&&n.parent.removeChild(n,"ignore");else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new yr(e)]}else if(e.selector)e=[new br(e)];else if(e.name)e=[new _r(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new vr(e)]}return e.map(e=>(e[gr]||Sr.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[mr]&&function e(t){if(t[mr]=!1,t.proxyOf.nodes)for(var r of t.proxyOf.nodes)e(r)}(e),void 0===e.raws.before&&t&&void 0!==t.raws.before&&(e.raws.before=t.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}prepend(...e){for(var t of e=e.reverse()){var r,n,s=this.normalize(t,this.first,"prepend").reverse();for(r of s)this.proxyOf.nodes.unshift(r);for(n in this.indexes)this.indexes[n]=this.indexes[n]+s.length}return this.markDirty(),this}push(e){return(e.parent=this).proxyOf.nodes.push(e),this}removeAll(){for(var e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){var t,r;for(r in e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1),this.indexes)e<=(t=this.indexes[r])&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(t,r,n){return n||(n=r,r={}),this.walkDecls(e=>{r.props&&!r.props.includes(e.prop)||r.fast&&!e.value.includes(r.fast)||(e.value=e.value.replace(t,n))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(n){return this.each((t,e)=>{let r;try{r=n(t,e)}catch(e){throw t.addToError(e)}return!1!==r&&t.walk&&(r=t.walk(n)),r})}walkAtRules(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("atrule"===e.type&&r.test(e.name))return n(e,t)}):this.walk((e,t)=>{if("atrule"===e.type&&e.name===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("atrule"===e.type)return n(e,t)}))}walkComments(r){return this.walk((e,t)=>{if("comment"===e.type)return r(e,t)})}walkDecls(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("decl"===e.type&&r.test(e.prop))return n(e,t)}):this.walk((e,t)=>{if("decl"===e.type&&e.prop===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("decl"===e.type)return n(e,t)}))}walkRules(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("rule"===e.type&&r.test(e.selector))return n(e,t)}):this.walk((e,t)=>{if("rule"===e.type&&e.selector===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("rule"===e.type)return n(e,t)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}Sr.registerParse=e=>{wr=e},Sr.registerRule=e=>{br=e},Sr.registerAtRule=e=>{_r=e},Sr.registerRoot=e=>{Cr=e};i=Sr,Sr.default=Sr,Sr.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,_r.prototype):"rule"===e.type?Object.setPrototypeOf(e,br.prototype):"decl"===e.type?Object.setPrototypeOf(e,yr.prototype):"comment"===e.type?Object.setPrototypeOf(e,vr.prototype):"root"===e.type&&Object.setPrototypeOf(e,Cr.prototype),e[gr]=!0,e.nodes&&e.nodes.forEach(e=>{Sr.rebuild(e)})},ot=i;let xr,Ar;class kr extends ot{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){let t=new xr(new Ar,this,e);return t.stringify()}}kr.registerLazyResult=e=>{xr=e},kr.registerProcessor=e=>{Ar=e};e=kr;kr.default=kr;let Er={};function Lr(e){Er[e]||(Er[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))}class Or{constructor(e,t={}){for(var r in this.type="warning",this.text=e,t.node&&t.node.source&&(e=t.node.rangeBy(t),this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column),t)this[r]=t[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}St=Or;Or.default=Or;let Mr=St;class Pr{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);e=new Mr(e,t);return this.messages.push(e),e}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}}Ke=Pr;Pr.default=Pr;let Rr=i;class Tr extends Rr{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}We=Tr;Tr.default=Tr,Rr.registerAtRule(Tr);let Ir=i,Br,Nr;class jr extends Ir{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){e=super.normalize(e);if(t)if("prepend"===r)1{Br=e},jr.registerProcessor=e=>{Nr=e};n=jr;jr.default=jr,Ir.registerRoot(jr);let Dr={comma(e){return Dr.split(e,[","],!0)},space(e){return Dr.split(e,[" ","\n","\t"])},split(e,t,u){let r=[],n="",s=!1,i=0,o=!1,a="",l=!1;for(var c of e)l?l=!1:"\\"===c?l=!0:o?c===a&&(o=!1):'"'===c||"'"===c?(o=!0,a=c):"("===c?i+=1:")"===c?0"space"!==e[0]&&"comment"!==e[0])&&(s.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(s,"value",a.concat(e),t),s.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new Jr;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){var t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1;var r;let n=!1,s=null,i=[];var o=e[1].startsWith("--");let a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)s=s||l,i.push("("===r?")":"]");else if(o&&n&&"{"===r)s=s||l,i.push("}");else if(0===i.length){if(";"===r){if(n)return void this.decl(a,o);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===i[i.length-1]&&(i.pop(),0===i.length&&(s=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),0e+t[1],""),e.raws[t]={raw:o,value:l}),e[t]=l}rule(e){e.pop();let t=new Jr;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){var t;let r="";for(;e.length&&("space"===(t=e[e.length-1][0])||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){var t;let r="";for(;e.length&&("space"===(t=e[0][0])||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t="";for(;e.length&&"space"===e[e.length-1][0];)t=e.pop()[1]+t;return t}stringFrom(t,r){let n="";for(let e=r;evn(e)),e}let wn={};class bn{constructor(e,t,r){this.stringified=!1,this.processed=!1;let n;if("object"!=typeof t||null===t||"root"!==t.type&&"document"!==t.type)if(t instanceof bn||t instanceof ln)n=vn(t.root),t.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=t.map);else{let e=cn;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{n=e(t,r)}catch(e){this.processed=!0,this.error=e}n&&!n[tn]&&sn.rebuild(n)}else n=vn(t);this.result=new ln(e,n,r),this.helpers={...wn,postcss:wn,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){var r=this.result.lastPlugin;try{if(t&&t.addToError(e),"CssSyntaxError"!==(this.error=e).name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){var n=r.postcssPlugin;let e=r.postcssVersion,t=this.result.processor.version;var s=e.split("."),i=t.split(".");(s[0]!==i[0]||parseInt(s[1])>parseInt(i[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+t+", but "+n+" uses "+e+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};var e,t=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(e of this.plugins)if("object"==typeof e)for(var r in e){if(!pn[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${e.postcssPlugin}. `+`Try to update PostCSS (${this.processor.version} now).`);if(!dn[r])if("object"==typeof e[r])for(var n in e[r])"*"===n?t(e,r,e[r][n]):t(e,r+"-"+n.toLowerCase(),e[r][n]);else"function"==typeof e[r]&&t(e,r,e[r])}this.hasListener=0t(e,this.helpers)),await Promise.all(i)):await t(r,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{var e;if("object"==typeof t&&t.Once)return"document"===this.result.root.type?mn((e=this.result.root.nodes.map(e=>t.Once(e,this.helpers)))[0])?Promise.all(e):e:t.Once(this.result.root,this.helpers);if("function"==typeof t)return t(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();var e=this.result.opts;let t=nn,r=(e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify),new rn(t,this.result.root,this.result.opts));e=r.generate();return this.result.css=e[0],this.result.map=e[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(var e of this.plugins)if(mn(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[en];)e[en]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(var t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||an("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(var[r,n]of e){this.result.lastPlugin=r;let e;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(mn(e))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:s}=r;if("root"===n.type||"document"===n.type||n.parent){if(0{e[en]||this.walkSync(e)});else{var r=this.listeners[t];if(r&&this.visitSync(r,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}bn.registerPostcss=e=>{wn=e};Me=bn;bn.default=bn,un.registerLazyResult(bn),on.registerLazyResult(bn);let _n=ft,Cn=Ne,Sn=Lr,xn=Qr;const An=Ke;class kn{constructor(e,t,r){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;var e=Cn;this.result=new An(this._processor,void 0,this._opts),this.result.css=t;let n=this,s=(Object.defineProperty(this.result,"root",{get(){return n.root}}),new _n(e,void 0,this._opts,t));s.isMap()?([r,e]=s.generate(),r&&(this.result.css=r),e&&(this.result.map=e)):(s.clearAnnotation(),this.result.css=s.css)}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||Sn("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=xn;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}}ft=kn;kn.default=kn;let En=ft,Ln=Me,On=e,Mn=n;class Pn{constructor(e=[]){this.version="8.4.35",this.plugins=this.normalize(e)}normalize(e){let t=[];for(var r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return new(this.plugins.length||t.parser||t.stringifier||t.syntax?Ln:En)(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}ft=Pn;Pn.default=Pn,Mn.registerProcessor(Pn),On.registerProcessor(Pn);let Rn=He,Tn=qe,In=Ct,Bn=We,Nn=Je,jn=n,Dn=ot;function Un(e,r){if(Array.isArray(e))return e.map(e=>Un(e));let{inputs:t,...n}=e;if(t){r=[];for(var s of t){let e={...s,__proto__:Nn.prototype};e.map&&(e.map={...e.map,__proto__:Tn.prototype}),r.push(e)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>Un(e,r))),n.source){let{inputId:e,...t}=n.source;n.source=t,null!=e&&(n.source.input=r[e])}if("root"===n.type)return new jn(n);if("decl"===n.type)return new Rn(n);if("rule"===n.type)return new Dn(n);if("comment"===n.type)return new In(n);if("atrule"===n.type)return new Bn(n);throw new Error("Unknown node type: "+e.type)}qe=Un,Un.default=Un;let Fn=He,zn=Me;He=i;let $n=ft;Me=Ne,i=qe;let Gn=e;ft=St;let Hn=Ct,Vn=We;Ne=Ke,qe=Je,e=Qr,St=s;let Wn=ot,Jn=n;Ct=Te;function o(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new $n(e)}o.plugin=function(r,n){let s=!1;function i(...e){console&&console.warn&&!s&&(s=!0,console.warn(r+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(r+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let t=n(...e);return t.postcssPlugin=r,t.postcssVersion=(new $n).version,t}let e;return Object.defineProperty(i,"postcss",{get(){return e=e||i(),e}}),i.process=function(e,t,r){return o([i(r)]).process(e,t)},i},o.stringify=Me,o.parse=e,o.fromJSON=i,o.list=St,o.comment=e=>new Hn(e),o.atRule=e=>new Vn(e),o.decl=e=>new Fn(e),o.rule=e=>new Wn(e),o.root=e=>new Jn(e),o.document=e=>new Gn(e),o.CssSyntaxError=t,o.Declaration=Fn,o.Container=He,o.Processor=$n,o.Document=Gn,o.Comment=Hn,o.Warning=ft,o.AtRule=Vn,o.Result=Ne,o.Input=qe,o.Rule=Wn,o.Root=Jn,o.Node=Ct,zn.registerPostcss(o);o.default=o;class qn extends HTMLElement{base;contents;component;listType="ul";iconSet;filter={value:"",caseSensitive:!1};static get observedAttributes(){return["contents","icon-set","max-depth","filter"]}_jsonToValueArray(e){let t=JSON.stringify(e);t=t.replace(/[\[\]{}\"]/g,"");let r=[];for(const n of t.split(","))r=r.concat(n.split(":"));return[...new Set(r)]}_emit(e,t,r){e=new CustomEvent(e,{detail:r,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}constructor(){super(),this.base=new $,this.setContents(this.getAttribute("contents")),this.iconSet=this.getAttribute("icon-set")?this.getAttribute("icon-type"):"file",this.maxDepth=this.getAttribute("max-depth")?parseInt(this.getAttribute("max-depth")):-1,this.setFilter(this.getAttribute("filter")),this.style.display="block",this.style.maxWidth="fit-content",this.style.margin="0 1rem 0 0",this.base.addEvent(".flk-branch","click",this.emitNodeToggle)}emitNodeToggle(e){e.stopPropagation();const t=F(e,"flk-tree-nav").target,r=z(e,"branchKey");let n=t.contents;const s=r.split(".");for(const o of s)if(n[o])n=n[o];else{let e=[];for(const a of n)a[o]&&e.push(a[o]);n=e}var e=r.substring(r.indexOf(".")+1),i=t.createLeafText(s.reverse()[0]);t._emit("tree-click",t,{path:e,data:n,key:(i.titleText+" "+i.commentText).trim(),branch:"object"==typeof n})}convertJsonKeyToTitle(e){if(!e)return"";const t=(e="string"!=typeof e?e.toString():e).replace(/([A-Z_])/g,e=>"_"===e?" ":" "+e).trim();return t.charAt(0).toUpperCase()+t.slice(1)}setContents(e){var t=e||this.contents||[];try{switch(typeof t){case"string":this.contents=JSON.parse(t);break;case"object":Array.isArray(t)?this.contents=t:this.contents=[t]}}catch(e){console.log(e)}}applyFilter(e){let t;var r="details"===e.tagName.toLowerCase();t=this.filter.caseSensitive?e.dataset.branchValues.includes(this.filter.value):e.dataset.branchValues.toLowerCase().includes(this.filter.value.toLowerCase()),t?e.parentElement.classList.remove("hidden"):e.parentElement.classList.add("hidden"),r&&t?e.setAttribute("open",""):e.removeAttribute("open")}resetTree(e){e.parentElement.classList.remove("hidden"),e.removeAttribute("open")}filterTree(){let t=setTimeout(()=>{for(const e of this.querySelectorAll("[data-branch-values]"))void 0===this.filter.value||0===this.filter.value.length?this.resetTree(e):this.applyFilter(e);clearTimeout(t)},10)}setFilter(e){const t=e||{};try{switch(typeof t){case"string":t.includes("{")?(this.filter=JSON.parse(t),!1===this.filter.caseSensitive&&(this.filter.value=this.filter.value.toLowerCase())):this.filter.value=e.toLowerCase();break;case"object":this.filter=t}}catch(e){console.log(e)}this.filterTree()}createLeafText(e){var t,r;let n="",s="";return"string"==typeof e&&(e.includes("(")||e.includes("["))?(r=e.indexOf("("),r=-1===(t=e.indexOf("["))?r:t,n=this.convertJsonKeyToTitle(e.substring(0,r)),s=e.substring(r)):n=this.convertJsonKeyToTitle(e),{titleText:n,commentText:s}}createTextTag(n,s){n=this.createLeafText(n);if(n.commentText){let e=document.createElement("div"),t=document.createElement("span"),r=(t.innerText=n.titleText,document.createElement("small"));r.innerText=n.commentText,r.style.marginLeft="1rem",e.append(t,r),e.style.display="inline-flex",e.style.alignItems="center",s.append(e)}else s.innerText=n.titleText}createLeaf(e,t,r,n=[]){let s=document.createElement("li");s.classList.add("cursor-no-select"),s.style.marginTop="0.4rem",s.dataset.branchKey=r;const i="file"===this.iconSet?'':'';s.style.listStyleImage=`url('data:image/svg+xml,${i}')`,s.style.position="relative",s.style.left="2px";let o=document.createElement("span");r=[e].concat(n);if(o.dataset.branchValues=[...new Set(r)].join(),this.createTextTag(e,o),o.style.position="relative",o.style.top="-3px",s.append(o),t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);const i="file"===this.iconSet?G:H;e.style.listStyleImage=`url('data:image/svg+xml,${i}')`,e.append(s),t.append(e)}else t.append(s)}createBranch(r,t,n,s){if(s===this.maxDepth&&"object"==typeof r){var i,o=Array.isArray(r)?r:Object.keys(r);if("object"==typeof o[0]){let e=[];for(const d of o)e=e.concat(Object.keys(d));for(i of[...new Set(e)]){var u=document.createElement(this.listType);t.append(this.createBranch(i,u,n+"."+i,s+1))}}else for(const a of o){let e;r[a]&&(e=this._jsonToValueArray(r[a])),this.createLeaf(a,t,n,e)}}else if(Array.isArray(r))for(var e in r){var h=document.createElement(this.listType);t.append(this.createBranch(r[e],h,n+"."+e,s+1))}else if(null!==r&&"object"==typeof r){const l=[];for(const c of Object.keys(r)){let e=document.createElement("li"),t=(e.classList.add("cursor-no-select"),e.style.position="relative",e.style.left="2px",e.dataset.branchKey=n+"."+c,document.createElement("details"));t.classList.add("flk-branch"),t.dataset.branchValues=[c].concat(this._jsonToValueArray(r[c])),t.style.position="relative",t.style.top="-3px",t.classList.add("cursor-default");var p=document.createElement("summary");this.createTextTag(c,p),t.append(p),e.append(this.createBranch(r[c],t,n+"."+c,s+1)),l.push(e)}if(t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);o="file"===this.iconSet?G:H;e.style.listStyleImage=`url('data:image/svg+xml,${o}')`;for(const f of l)e.append(f);t.append(e)}else for(const m of l)t.append(m)}else console.trace({node:r,element:t,key:n}),this.createLeaf(r,t,n);return t}createHtml(){let e=document.createElement(this.listType);var t="file"===this.iconSet?G:'';if(e.style.listStyleImage=`url('data:image/svg+xml,${t}')`,e.style.marginLeft="3rem",this.contents.length){for(const r in this.contents)e=this.createBranch(this.contents[r],e,r,0);this.component=e}else this.component=e}attributeChangedCallback(e,t,r){switch(e){case"contents":this.setContents(r);break;case"icon-set":this.iconSet=r;break;case"max-depth":this.maxDepth="string"==typeof r?parseInt(r):r;break;case"filter":this.setFilter(r)}this.init()}connectedCallback(){this.init()}disconnectedCallback(){this.base.removeEvents(this)}init(){this.createHtml(),this.base.render(this)}}customElements.define("flk-table",W),customElements.define("flk-draggable",J),customElements.define("flk-modal",q),customElements.define("flk-dropdown",K),customElements.define("flk-tree-nav",qn)}(require$$0,require$$2,require$$1$1,require$$1); \ No newline at end of file diff --git a/docs/cdn/ibiss-v0.0.4/htmx-ibiss-ui.min.js b/docs/cdn/ibiss-v0.0.4/htmx-ibiss-ui.min.js new file mode 100644 index 0000000..c035056 --- /dev/null +++ b/docs/cdn/ibiss-v0.0.4/htmx-ibiss-ui.min.js @@ -0,0 +1 @@ +!function(t){"function"==typeof define&&define.amd?define(t):t()}(function(){"use strict";htmx.defineExtension("ibiss-ui",{onEvent:function(t,e){if("htmx:beforeRequest"===t){const{target:i,detail:n}=e;t=i.getAttribute("ibiss-router");if(window[t]&&"function"==typeof window[t])return window[t](i,n,e),!1}}})}); \ No newline at end of file diff --git a/docs/cdn/ibiss-v0.0.4/rocket.min.js b/docs/cdn/ibiss-v0.0.4/rocket.min.js new file mode 100644 index 0000000..0a7f9d0 --- /dev/null +++ b/docs/cdn/ibiss-v0.0.4/rocket.min.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).rocketjs=t()}(this,function(){"use strict";function y(e,t){let r=0,l=e.indexOf(t);for(;-1!==l;)r++,l=e.indexOf(t,l+1);return r}function e(){return{sequence:"",match:!1}}function v(e,t,r){let l=r.sequence;return l.length===t.length&&(l=l.substring(1)),l+=e,r.sequence=l,r.match=l===t,r}class g{static getTemplates(t,r,l){if(r.length!==l.length)throw new Error("Template start is not the same length as template end");var g=t.length;let a=e(),o=e(),n=0,s=0,i=[],p=[];const u=[];for(let e=0;ee.replace(new RegExp(t,"g"),r));return l=l.replace(/if([\s\S]+?)\s|is|not/gm,e=>e.replace(new RegExp(t,"g"),r)),l=l.replace(/(of|in)([\s\S]+?)(?=<|{)/gm,e=>e.replace(new RegExp(t,"g"),r)),l}}class o{static resolvePartials(e,t){let r=e;for(const a of g.getTemplates(e,"{{#","#}}")){var l=g.getInnerTemplate(a),l=g.getPropertyValue(l,t);let e=l?l:"";r=r.replace(a,e)}if(r.includes("{{#")){if(e===r)return r;r=o.resolvePartials(r,t)}return r}}class s{static interpolateTemplate(e,r){let l=e;for(const n of g.getTemplates(e,"{{","}}")){let e=g.getInnerTemplate(n,2);var a="!"===e[0],o=(a&&(e=e.substr(1).trim()),g.getPropertyValue(e,r));let t=o?o:"";t=Array.isArray(t)?t.join(", "):t.toString().trim();o=a?s.escapeHtml(t):t;l=l.replace(n,o)}return l}static escapeHtml(e){return e=(e=(e=(e=(e=e.replace(/&/gm,"&")).replace(//gm,">")).replace(/"/gm,""")).replace(/\//gm,"'")}}class r{static buildTemplate(e,t){e=o.resolvePartials(e,t),e=class{static resolveWrapper(e){let t=e;for(const o of g.getTemplates(e,"{{$","$}}")){var r=g.getWrapperProperty(o),l=g.getTemplates(r.templateToFill,"{{","}}"),l=g.getToplevelTemplates(l);let e=r.templateToFill;for(const n of l){var a=g.getProperty(n);e=e.replace(new RegExp(a,"g"),r.property+"."+a)}t=t.replace(o,e)}return t}}.resolveWrapper(e);return e=c.resolveLoop(e,t),class{static resolveConditional(e,l){let a=e;for(const p of g.getTemplates(e,"{{~","~}}")){const c=g.getConditionalLogic(p);var o=c.property,n=c.logiclessTemplate,s=c.truthy,i=!c.truthy;let e="",t=(c.comparison&&(e=c.comparison),""),r=g.getPropertyValue(o,l);r&&(r=Array.isArray(r)?r:r.toString().trim().toLocaleLowerCase(),e=c.comparison?c.comparison.toLocaleLowerCase():null),e?(s&&(t=r===e?n:""),i&&(t=r!==e?n:"")):t="false"===r||!r||Array.isArray(r)&&!r.length?"":n,a=a.replace(p,t)}return a}}.resolveConditional(e,t)}static interpolateTemplate(e,t){return s.interpolateTemplate(e,t)}static render(e,t){e=r.buildTemplate(e,t);return r.interpolateTemplate(e,t)}}return r}); \ No newline at end of file diff --git a/docs/js/flightkit.min.js b/docs/js/flightkit.min.js index 1bf4e4d..a5a8ef8 100644 --- a/docs/js/flightkit.min.js +++ b/docs/js/flightkit.min.js @@ -1 +1 @@ -!function(e,n,s,i){"use strict";function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a,u,g,e=c(e),n=c(n),s=c(s),i=c(i);(t=a=a||{}).Date="date",t.String="string",t.Float="float",t.Number="number",t.Array="array",t.Object="object",t.Bool="bool",t.Currency="currency",t.Undefined="undefined",t.Null="null";const h={date:/^(\d{1,4}-\d{1,4}-\d{1,4}(T)?)/gim,currency:/^[$|€]\s?[0-9]*(\.|,)?\d*(\.|,)?\d*/gim,float:/\d+[,|.]\d+[,|.]?\d*/gim,currencySign:/\$|€/gim,array:/^\s?[[].[^,]+[\]],?/gi,precision:/[-+$€,.]/gm,string:/[a-zA-Z]/gim},m=e=>{return null===e||"null"===e?a.Null:e||0===e||!1===e?null===new RegExp(h.date).exec(e)||isNaN(Date.parse(e))?new RegExp(h.currency).exec(e)?a.Currency:!new RegExp(h.string).exec(e)&&new RegExp(h.float).exec(e.toString())?a.Float:isNaN(e)&&0!==e?Array.isArray(e)?a.Array:"object"==typeof e?a.Object:a.String:a.Number:a.Date:a.Undefined},y=(t,e)=>{const r={value:void 0,type:e=e||m(t),currencySign:""};switch(r.type){case a.String:r.value=t.toString();break;case a.Float:case a.Currency:var n=(t=t.toString()).match(new RegExp(/(,)/gim)),s=t.match(new RegExp(/(\.)/gim));if(n)for(let e=1;e<=n.length;e++)t=e!==n.length||s?t.replace(",",""):t.replace(",",".");if(r.type===a.Currency){const o=new RegExp(h.currencySign);var i=o.exec(t);r.currencySign=null!==i?i[0]:"",t=t.replace(o,"")}r.value=parseFloat(t).toPrecision(12);break;case a.Number:r.value=Number(t);break;case a.Date:r.value=Date.parse(t);break;case a.Array:t.length?"object"==typeof t[0]?r.value=t.map(e=>JSON.stringify(e)).join(", "):r.value=t.join(", "):r.value="";break;case a.Object:r.value=t;break;case a.Undefined:r.value="";break;case a.Null:r.value=null}return r};function v(e,t){var r;let n;for(r of e.split("."))r=r.trim(),n?"object"!=typeof n||Array.isArray(n)||(n=n[r]):n=t[r];return n}const b=(e,t)=>tet<=e,S=(e,t)=>e<=t,x=(e,t,r)=>r?e.toLowerCase()==t.toLowerCase():e==t,A=(e,t)=>e===t,k=(e,t)=>e!=t,E=(e,t)=>e!==t,O=(e,t)=>null!=t&&"string"==typeof e&&0<=e.toLowerCase().indexOf(t.toString().toLowerCase()),L=(e,t)=>null!=t&&0<=e.toString().toLowerCase().indexOf(t.toString().toLowerCase()),M=(e,t)=>null!=t&&"string"==typeof e&&e.toLowerCase().indexOf(t.toString().toLowerCase())<0;function P(r,n){if(0===n.length)return r;{var s=r;const o=[],a=[];let e=[];for(const l of n)l.type&&l.type!==u.And?(e.length&&a.push(e),e=[l]):e.push(l);a.push(e);let t=[];for(const e of a)t=t.concat(R(s,e));t=[...new Set(t)];var i=s.length;for(let e=0;e":return b;case"<":return _;case">=":return C;case"<=":return S;case"is":case"==":return x;case"!is":case"!=":return k;case"===":return A;case"!==":return E;case"like":case"~":case"contains":return O;case"!contains":case"!like":case"!~":return M;default:return L}}(a.operator);if(!l(i,o,a.ignoreCase)){e=!1;break}}e&&r.push(n)}return r};function I(e,t){if(!t||0===t.length)return e;if(1{if(0===r.length)r=r.concat(T(s,e));else{for(const t of r)n=n.concat(T(t,e));r=n,n=[]}}),r}return T(e,t[0])}function T(e,t){const r=[],n=[];do{if(!e||0===e.length)break;var s=e.shift();if(!s)break;const o=s[t];var i=n.indexOf(o.toString());0<=i?r[i].push(s):(n.push(o.toString()),void 0!==r[n.length-1]?r[n.length-1].push(s):r.push([s]))}while(0{if(t){var r=e;const n={};for(const s of t){let e=r.map(e=>e[s].toString());const i=e.map(e=>m(e));i.some(e=>e===a.Float)?(e=e.map(e=>parseFloat(e)),n[s]=parseFloat(e.reduce((e,t)=>e+t).toFixed(2))):(e=e.map(e=>parseInt(e)),n[s]=e.reduce((e,t)=>e+t))}return n}return{}};class D{model;sortDetails=[];filterDetails=[];selection=[];groupByProperties=[];distinctProperties=[];concatenationToken=", ";constructor(e){this.model=JSON.parse(JSON.stringify(e))}sort(e){return this.sortDetails=e,this}orderBy(e,t){return this.sortDetails.push({propertyName:e,direction:t}),this}thenOrderBy(e,t){return this.orderBy(e,t)}filter(e){return Array.isArray(e)?this.filterDetails=e:this.filterDetails.push(e),this}where(e,t,r,n,s){return this.filterDetails.push({propertyName:e,operator:t,value:r,type:n,ignoreCase:s}),this}andWhere(e,t,r,n){return this.where(e,t,r,u.And,n),this}orWhere(e,t,r,n){return this.where(e,t,r,u.Or,n),this}group(e){return this.groupByProperties=e,this}groupBy(e){return this.groupByProperties.push(e),this}thenGroupBy(e){return this.groupByProperties.push(e),this}select(e){return Array.isArray(e)?this.selection=e:"*"!==e&&(this.selection=[e]),this}distinct(e,t){return t&&(this.concatenationToken=t),Array.isArray(e)?this.distinctProperties=e:e&&(this.distinctProperties=[e]),this}execute(){return I(function(t,r){if(0===r.length)return t;{var n=r;let e=[];for(const s of t){const i={};for(const o of n)i[o]=s[o];e.push(i)}return e}}(function(r,n,u){if(!n||!n.length)return r;const s=[],h=[];for(const f of r){const o={};let t="";for(const e of n){var p=v(e,f);o[e]=p,t+=p}if(!h.includes(t)){let e=r;for(const a of Object.keys(o))e=e.filter(e=>e[a]===o[a]);h.push(t),s.push(e)}}const t=[];for(const m of s){let e={};for(const l of m){var i,d=Object.keys(e);if(d.length)for(const c of d)n.includes(c)||(i=e[c],Array.isArray(i)?(i=l[c],Array.isArray(i)?e[c]=[...new Set(...e[c].concat(l[c]))]:e[c].includes(l[c])||e[c].push(l[c])):isNaN(e[c])&&isNaN(l[c])?e[c]!==l[c]&&(e[c]=[e[c],l[c]]):e[c]=e[c]+l[c]);else e=l}t.push(e)}return t.forEach(e=>{for(const t in e)Array.isArray(e[t])&&(e[t]=e[t].join(u))}),t}(B(P(JSON.parse(JSON.stringify(this.model)),this.filterDetails),this.sortDetails),this.distinctProperties,this.concatenationToken),this.selection),this.groupByProperties)}sum(e,t){e=Array.isArray(e)?e:[e];return j(t||this.model,e)}}function U(e,t){t=t?t.toUpperCase():"FLK-";return e.toUpperCase().includes(t)}function F(e,t){var{timeStamp:r,type:n,x:s,y:i}=e;let o=e.target;do{if(!o||"HTML"===o.tagName||U(o.tagName,t)){"HTML"===o.tagName&&(o=null);break}}while(o=o.parentNode||o.parentElement,!U(o.tagName,t));return{target:o,timeStamp:r,type:n,x:s,y:i}}function z(e,t){let r=e.target,n="";for(;r.dataset[t]?n=r.dataset[t]:r=r.parentNode,!n;);return n}class ${constructor(){}_topLevelClasses=[];_events=[];generateId(){return"flk-"+function e(){const t=([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)),r=t.split("-")[0];return window.$flightkitUUIDStore||(window.$flightkitUUIDStore=[]),window.$flightkitUUIDStore.some(e=>e===r)?e():(window.$flightkitUUIDStore.push(r),r)}()}render(t){if(!t.component)throw new Error("Component is not assigned! Can't render");t.id=t.id||this.generateId();var e=this._getAllEventAttributes(t);if(e){var r="#"+t.id;for(const i of e){var n="e-"+i;this.addEvent(r,i,t.getAttribute(n))}}var s=Object.keys(t.classList).length;if(s){for(let e=0;e{this._assignToDom(t,t.component),clearTimeout(this._renderTimer)},10)}addEvent(e,t,r){this._events.push({selector:e,eventType:t,callback:r})}_getExternalCallback(e){let t=void 0;for(const r of e.split("."))t=(t||window)[r];return t}_getAllEventAttributes(e){e=e.attributes;const t=Array.from(e).filter(e=>e.name.startsWith("e-"));return t.map(e=>e.name.slice(2))}_isFlightkitElement(e){return e.toUpperCase().includes("FLK-")}_outerEventHandler(e){const t=F(e),r=(t.contents=e.detail,t.target.getAttribute("e-"+t.type));let n=void 0;for(const s of r.split("."))n=(n||window)[s];return e.preventDefault(),e.stopPropagation(),n(t)}_addEvents(e){if(e.isConnected)for(const r of this._events)if(r.selector.startsWith("."))for(const n of document.querySelectorAll(r.selector))this._addEventToElement(r,n);else{var t=document.querySelector(r.selector);this._addEventToElement(r,t)}}_addEventToElement(e,t){t&&("function"==typeof e.callback?(t.removeEventListener(e.eventType,e.callback),t.addEventListener(e.eventType,e.callback)):(t.removeEventListener(e.eventType,this._outerEventHandler),t.addEventListener(e.eventType,this._outerEventHandler)))}removeEvents(){for(const t of this._events)if(t.selector.startsWith("."))for(const r of document.querySelectorAll(t.selector))this._addEventToElement(t,r);else{var e=document.querySelector(t.selector);this._addEventToElement(t,e)}this._events=[]}_removeEventToElement(e,t){t&&("function"==typeof e.callback?t.removeEventListener(e.eventType,e.callback):t.removeEventListener(e.eventType,this._outerEventHandler))}_assignToDom(e,t){e.innerHTML="";for(const n of Array.isArray(t)?t:[t])e.append(n);const r=setTimeout(()=>{this._addEvents(e),clearTimeout(r)},10)}}const G='',H='';function V(e){const t=new DOMParser;return t.parseFromString(e,"image/svg+xml").documentElement}class W extends HTMLElement{base;component=null;_contents=[];_orderBy=[];properties=new Set;_columnOrder=[];_filter="";_selectionProperty="";_selectedIds=new Set;uniqueEntriesByProperties={};propertyLabelDictionary={};_templates={};_templateClasses={};static get observedAttributes(){return["contents","columns","order","filter","selection-property","templates"]}get columnOrder(){return this._columnOrder.length?this._columnOrder:this.properties}set columnOrder(e){let t;"string"==typeof e&&(t=e.split(",")),t=e,this._columnOrder=t}get contents(){return this._contents}set contents(e){this.analyzeData(e),this._contents=new D(e)}get orderBy(){return this._orderBy}set orderBy(e){if(Array.isArray(e))this._orderBy=e;else{const n=[];for(const s of e.split(",")){var t=s.split("|"),r=t[0],t=1e[r._selectionProperty])):new Set;e=t?r.contents.execute():[];r._emit("select",r,{selection:e}),r._updateCheckboxes(r)}emitSelect(e){var t=e.target.checked,r=e.target.dataset.objectId;const n=F(e).target,s=(t?n._selectedIds.add(r):n._selectedIds.delete(r),n._selectionProperty);e=n.contents.execute().filter(e=>n._selectedIds.has(e[s]));n._emit("select",n,{selection:e}),n._updateCheckboxes(n)}sortData(e){const t=F(e).target,r=z(e,"column");r&&(-1<(e=t._orderBy.findIndex(e=>e.propertyName===r))?"asc"===t._orderBy[e].direction?t._orderBy[e].direction="desc":t._orderBy.splice(e,1):t._orderBy.push({propertyName:r,direction:"asc"}),t.createHtml(),t.base.render(t))}setColumnOrder(e){this._columnOrder=e?Array.isArray(e)?e:e.split(","):[]}analyzeData(t){this.properties=new Set;var r=t.length;for(let e=0;e"_"===e?" ":" "+e.toLowerCase()).trim();var r=t.charAt(0).toUpperCase()+t.slice(1);return this.propertyLabelDictionary[e]=r}parseTemplate(e,n){return e.replace(/\{\{([\s\S]+?)\}\}/gim,(e,t)=>{let r="";t=t.trim();t=n[t];return t&&(r=t),Array.isArray(r)?r.join(", "):r.toString().trim()})}createSelectionCheckbox(e){const t=document.createElement("input");return t.setAttribute("type","checkbox"),t.classList.add("flk-selection-checkbox"),e&&(t.dataset.selected=e[this._selectionProperty]),t}createRow(e){const t=document.createElement("tr");if(this._selectionProperty.length){const s=document.createElement("td");var r=this.base.generateId();const i=this.createSelectionCheckbox(e);i.id=r,i.dataset.objectId=e[this._selectionProperty];var n=e[this._selectionProperty];this._selectedIds.has(n)?i.checked=!0:i.checked=!1,this.base.addEvent("#"+r,"change",this.emitSelect),s.append(i),t.append(s)}for(const o of this.columnOrder){const a=document.createElement("td");this._templates[o]?(a.innerHTML=this.parseTemplate(this._templates[o],e),this._templateClasses[o]&&a.classList.add(...this._templateClasses[o])):a.innerText=e[o],t.append(a)}return t}createBody(e){const t=document.createElement("tbody");for(const n of e){var r=this.createRow(n,null);t.append(r)}return t}createHead(){const e=document.createElement("thead"),t=document.createElement("tr");if(t.classList.add("cursor-pointer"),this._selectionProperty.length){const s=document.createElement("th");var r=this.base.generateId();const i=this.createSelectionCheckbox();i.id=r;var u=this.contents.execute().length;0e.propertyName===o);if(n){const c=document.createElement("span");c.innerHTML="asc"===n.direction?'':'',a.append(c)}t.append(a)}return e.append(t),e}addEvent(e,t,r){this.base.addEvent(e,t,r)}init(){this.createHtml(),this.base.render(this)}}class J extends HTMLElement{base;componentId;constructor(){super(),this.base=new $}connectedCallback(){var e=this.getAttribute("top"),t=this.getAttribute("left"),r=this.getAttribute("center"),n=this.getAttribute("zIndex");this.id||(this.id=this.base.generateId()),this.style.display="block",this.style.position="fixed","string"==typeof r?(this.style.top=e||"50%",this.style.left="50%",this.style.transform="translate(-50%, -50%)"):(this.style.top=e||this.clientTop+"px",this.style.left=t||this.clientLeft+"px"),n&&(this.style.zIndex=n),this.componentId=this.getAttribute("handle");const s=document.createElement("div");s.innerHTML=this.innerHTML,this.component=s;r="#"+(this.componentId||this.id);this.base.addEvent(r,"mousedown",this._dragElement),this.base.addEvent(r,"mouseup",this._reset),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this)}_dragElement(e){const r=F(e,"flk-draggable").target;let n,s;function t(e){n=e.clientX-r.offsetLeft,s=e.clientY-r.offsetTop}function i(e){var t=e.clientX-n,e=e.clientY-s;r.style.left=t+"px",r.style.top=e+"px"}function o(e){e.preventDefault()}function a(){r.removeAttribute("draggable"),r.removeEventListener("dragstart",t),r.removeEventListener("dragend",a),document.removeEventListener("dragover",o),document.removeEventListener("drop",i)}r.setAttribute("draggable",!0),r.addEventListener("dragstart",t),r.addEventListener("dragend",a),document.addEventListener("dragover",o),document.addEventListener("drop",i)}}class q extends HTMLElement{_id;base;_draggableId;constructor(){super(),this.base=new $}_emit(e,t,r){e=new CustomEvent(e,{detail:r,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}_closeModal(e){e.stopPropagation();const t=F(e,"flk-modal").target;t.classList.add("hidden")}closeModal(e){this.classList.add("hidden")}openModal(e=!0){const t=document.getElementById(this._draggableId);e&&(t.style.top="40%",t.style.left="50%"),this.classList.remove("hidden")}connectedCallback(){this.id||(this.id=this.base.generateId());const e=document.createElement("div");var t=this.base.generateId();const r=document.createElement("flk-draggable"),n=(this._draggableId=this.base.generateId(),r.id=this._draggableId,r.setAttribute("center",""),r.setAttribute("top","40%"),r.setAttribute("handle",t),r.setAttribute("zIndex","1080"),r.classList.add("border","shadow-lg","bg-white"),r.style.width="max-content",document.createElement("div"));var s=this.getAttribute("modal-title");if(s){const c=document.createElement("span");c.innerText=s,c.classList.add("ml-1","mr-auto"),n.append(c)}n.id=t;const i=this.getAttribute("header-class");let o=[];i?o=o.concat(i.split(" ")):o.push("bg-gray-light"),n.classList.add(...o,"border-bottom","row","justify-end","cursor-no-select");s=this.base.generateId();const a=document.createElement("button"),l=(a.classList.add("py-0","px-1","outline-hover","no-border","cursor-default",...o),a.innerText="X",a.id=s,n.append(a),r.append(n),document.createElement("div"));l.innerHTML=this.innerHTML,r.append(l),e.append(r),this.component=e,this.base.addEvent("#"+s,"click",this._closeModal),this.base.render(this),this.classList.add("hidden")}disconnectedCallback(){this.base.removeEvents(this)}}class K extends HTMLElement{base;_buttonId;_drawerId;_iconId;constructor(){super(),this.base=new $}connectedCallback(){this.style.position="relative",this.style.display="flex",this.style.width="fit-content",this._buttonId=this.base.generateId();const e=document.createElement("button"),t=(e.classList.add("row"),e.id=this._buttonId,document.createElement("span")),r=(t.innerText=this.getAttribute("text"),this._iconId=this.base.generateId(),document.createElement("span"));var n=V('');const s=V(''),i=(s.classList.add("hidden"),r.append(n,s),r.id=this._iconId,e.append(t,r),this._drawerId=this.base.generateId(),document.createElement("div"));i.id=this._drawerId,i.classList.add("shadow","inline-block","bg-white"),i.style.position="absolute",i.style.zIndex="1040";n=this.querySelector("template");n.innerHTML.length?i.innerHTML=n.innerHTML:i.append(n.firstChild),i.style.display="none",this.component=[e,i],this.base.addEvent("#"+this._buttonId,"click",this.toggleMenu);const o=document.querySelector("body");""!==o.getAttribute("flk-close-dropdown")&&(o.setAttribute("flk-close-dropdown",""),o.addEventListener("click",this.closeAllDropdownButtons)),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this);var e=document.querySelectorAll("flk-dropdown");if(!e||!e.length){const t=document.querySelector("body");t.removeAttribute("flk-close-dropdown"),t.removeEventListener("click",this.closeAllDropdownButtons)}}toggleMenu(e){const t=F(e).target;e=t._drawerId;const r=document.getElementById(e);var e="none"!==r.style.display,n=(r.style.display=e?"none":"block",t.getAttribute("drawer-width")),n=("string"==typeof t.getAttribute("right")&&(r.style.right="0px"),r.style.top=t.offsetHeight+"px",r.style.width=n||t.offsetWidth+"px",t._iconId);const s=document.getElementById(n);e?(s.childNodes[0].classList.remove("hidden"),s.childNodes[1].classList.add("hidden")):(s.childNodes[0].classList.add("hidden"),s.childNodes[1].classList.remove("hidden"))}_closeDropdown(){var e=this._drawerId;const t=document.getElementById(e);if("none"!==t.style.display){e=this._iconId;const r=document.getElementById(e);t.style.display="none",r.childNodes[0].classList.remove("hidden"),r.childNodes[1].classList.add("hidden")}}closeAllDropdownButtons(e){var t,r=F(e,"flk-dropdown").target,e=document.querySelectorAll("flk-dropdown");if(r)for(const n of e)r._buttonId!==n._buttonId&&(t=n._drawerId,"none"!==document.getElementById(t).style.display&&n._closeDropdown());else for(const s of e)s._closeDropdown()}}var t={exports:{}};let Z=e.default,Y=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||"win32"===process.platform||Z.isatty(1)&&"dumb"!==process.env.TERM||"CI"in process.env),r=(r,n,s=r)=>e=>{let t=""+e;e=t.indexOf(n,r.length);return~e?r+X(t,n,s,e)+n:r+t+n},X=(e,t,r,n)=>{var s=e.substring(0,n)+r;let i=e.substring(n+t.length);e=i.indexOf(t);return~e?s+X(i,t,r,e):s+i};e=(e=Y)=>({isColorSupported:e,reset:e?e=>`${e}`:String,bold:e?r("","",""):String,dim:e?r("","",""):String,italic:e?r("",""):String,underline:e?r("",""):String,inverse:e?r("",""):String,hidden:e?r("",""):String,strikethrough:e?r("",""):String,black:e?r("",""):String,red:e?r("",""):String,green:e?r("",""):String,yellow:e?r("",""):String,blue:e?r("",""):String,magenta:e?r("",""):String,cyan:e?r("",""):String,white:e?r("",""):String,gray:e?r("",""):String,bgBlack:e?r("",""):String,bgRed:e?r("",""):String,bgGreen:e?r("",""):String,bgYellow:e?r("",""):String,bgBlue:e?r("",""):String,bgMagenta:e?r("",""):String,bgCyan:e?r("",""):String,bgWhite:e?r("",""):String});t.exports=e(),t.exports.createColors=e;const Q="'".charCodeAt(0),ee='"'.charCodeAt(0),te="\\".charCodeAt(0),re="/".charCodeAt(0),ne="\n".charCodeAt(0),se=" ".charCodeAt(0),ie="\f".charCodeAt(0),oe="\t".charCodeAt(0),ae="\r".charCodeAt(0),le="[".charCodeAt(0),ce="]".charCodeAt(0),ue="(".charCodeAt(0),he=")".charCodeAt(0),pe="{".charCodeAt(0),de="}".charCodeAt(0),fe=";".charCodeAt(0),me="*".charCodeAt(0),ge=":".charCodeAt(0),ye="@".charCodeAt(0),ve=/[\t\n\f\r "#'()/;[\\\]{}]/g,we=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,be=/.[\r\n"'(/\\]/,_e=/[\da-f]/i;function Ce(t,e={}){let n=t.css.valueOf(),d=e.ignoreErrors,s,i,f,m,o,a,l,g,c,u,y=n.length,h=0,v=[],p=[];function w(e){throw t.error("Unclosed "+e,h)}return{back:function(e){p.push(e)},endOfFile:function(){return 0===p.length&&h>=y},nextToken:function(e){if(p.length)return p.pop();if(!(h>=y)){var t=!!e&&e.ignoreUnclosed;switch(s=n.charCodeAt(h),s){case ne:case se:case oe:case ae:case ie:for(i=h;i+=1,s=n.charCodeAt(i),s===se||s===ne||s===oe||s===ae||s===ie;);u=["space",n.slice(h,i)],h=i-1;break;case le:case ce:case pe:case de:case ge:case fe:case he:var r=String.fromCharCode(s);u=[r,r,h];break;case ue:if(g=v.length?v.pop()[1]:"",c=n.charCodeAt(h+1),"url"===g&&c!==Q&&c!==ee&&c!==se&&c!==ne&&c!==oe&&c!==ie&&c!==ae){i=h;do{if(a=!1,i=n.indexOf(")",i+1),-1===i){if(d||t){i=h;break}w("bracket")}for(l=i;n.charCodeAt(l-1)===te;)--l,a=!a}while(a);u=["brackets",n.slice(h,i+1),h,i],h=i}else i=n.indexOf(")",h+1),m=n.slice(h,i+1),-1===i||be.test(m)?u=["(","(",h]:(u=["brackets",m,h,i],h=i);break;case Q:case ee:f=s===Q?"'":'"',i=h;do{if(a=!1,i=n.indexOf(f,i+1),-1===i){if(d||t){i=h+1;break}w("string")}for(l=i;n.charCodeAt(l-1)===te;)--l,a=!a}while(a);u=["string",n.slice(h,i+1),h,i],h=i;break;case ye:ve.lastIndex=h+1,ve.test(n),i=0===ve.lastIndex?n.length-1:ve.lastIndex-2,u=["at-word",n.slice(h,i+1),h,i],h=i;break;case te:for(i=h,o=!0;n.charCodeAt(i+1)===te;)i+=1,o=!o;if(s=n.charCodeAt(i+1),o&&s!==re&&s!==se&&s!==ne&&s!==oe&&s!==ae&&s!==ie&&(i+=1,_e.test(n.charAt(i)))){for(;_e.test(n.charAt(i+1));)i+=1;n.charCodeAt(i+1)===se&&(i+=1)}u=["word",n.slice(h,i+1),h,i],h=i;break;default:h=(s===re&&n.charCodeAt(h+1)===me?(i=n.indexOf("*/",h+2)+1,0===i&&(d||t?i=n.length:w("comment")),u=["comment",n.slice(h,i+1),h,i]):(we.lastIndex=h+1,we.test(n),i=0===we.lastIndex?n.length-1:we.lastIndex-2,u=["word",n.slice(h,i+1),h,i],v.push(u)),i)}return h++,u}},position:function(){return h}}}e=t.exports;let Se=Ce,xe;const Ae={";":e.yellow,":":e.yellow,"(":e.cyan,")":e.cyan,"[":e.yellow,"]":e.yellow,"{":e.yellow,"}":e.yellow,"at-word":e.cyan,brackets:e.cyan,call:e.cyan,class:e.yellow,comment:e.gray,hash:e.magenta,string:e.green};function ke(e){let r=Se(new xe(e),{ignoreErrors:!0}),n="";for(;!r.endOfFile();){let e=r.nextToken(),t=Ae[function([e,t],r){if("word"===e){if("."===t[0])return"class";if("#"===t[0])return"hash"}if(!r.endOfFile()){t=r.nextToken();if(r.back(t),"brackets"===t[0]||"("===t[0])return"call"}return e}(e,r)];t?n+=e[1].split(/\r?\n/).map(e=>t(e)).join("\n"):n+=e[1]}return n}ke.registerInput=function(e){xe=e};e=ke;let Ee=t.exports,Oe=e;class Le extends Error{constructor(e,t,r,n,s,i){super(e),this.name="CssSyntaxError",this.reason=e,s&&(this.file=s),n&&(this.source=n),i&&(this.plugin=i),void 0!==t&&void 0!==r&&("number"==typeof t?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,Le)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file||"",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source,r=(null==e&&(e=Ee.isColorSupported),Oe&&e&&(t=Oe(t)),t.split(/\r?\n/)),n=Math.max(this.line-3,0);var s=Math.min(this.line+2,r.length);let i=String(s).length,o,a;if(e){let{bold:t,gray:r,red:n}=Ee.createColors(!0);o=e=>t(n(e)),a=e=>r(e)}else o=a=e=>e;return r.slice(n,s).map((e,t)=>{var t=n+1+t;let r=" "+(" "+t).slice(-i)+" | ";return t===this.line?(t=a(r.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," "),o(">")+a(r)+e+"\n "+t+o("^")):" "+a(r)+e}).join("\n")}toString(){let e=this.showSourceCode();return e=e&&"\n\n"+e+"\n",this.name+": "+this.message+e}}var t=Le,Me=(Le.default=Le,{});Me.isClean=Symbol("isClean"),Me.my=Symbol("my");const Pe={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class Re{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name;var n=e.params?this.rawValue(e,"params"):"";void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes?this.block(e,r+n):(t=(e.raws.between||"")+(t?";":""),this.builder(r+n+t,e))}beforeAfter(e,t){let r,n=(r="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose"),e.parent),s=0;for(;n&&"root"!==n.type;)s+=1,n=n.parent;if(r.includes("\n")){var i=this.raw(e,null,"indent");if(i.length)for(let e=0;e{if(n=e.raws[t],void 0!==n)return!1}),void 0===n&&(n=Pe[r]),i.rawCache[r]=n,n}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&0{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=void 0===r?this.raw(t,null,"beforeDecl"):r&&r.replace(/\S/g,""),r}rawBeforeDecl(e,t){let r;return e.walkDecls(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=void 0===r?this.raw(t,null,"beforeRule"):r&&r.replace(/\S/g,""),r}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(t){let r;return t.walk(e=>{if(e.nodes&&(e.parent!==t||t.first!==e)&&void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=r&&r.replace(/\S/g,""),r}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(r){if(r.raws.indent)return r.raws.indent;let n;return r.walk(e=>{var t=e.parent;if(t&&t!==r&&t.parent&&t.parent===r&&void 0!==e.raws.before)return t=e.raws.before.split("\n"),n=t[t.length-1],n=n.replace(/\S/g,""),!1}),n}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){var r=e[t],e=e.raws[t];return e&&e.value===r?e.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}}var Ie=Re;Re.default=Re;let Te=Ie;function Be(e,t){let r=new Te(t);r.stringify(e)}var Ne=Be;Be.default=Be;let{isClean:je,my:De}=Me,Ue=t,Fe=Ie,ze=Ne;function $e(t,r){let n=new t.constructor;for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&"proxyCache"!==s){let e=t[s];var i=typeof e;"parent"===s&&"object"==i?r&&(n[s]=r):"source"===s?n[s]=e:Array.isArray(e)?n[s]=e.map(e=>$e(e,n)):("object"==i&&null!==e&&(e=$e(e)),n[s]=e)}return n}class Ge{constructor(e={}){for(var t in this.raws={},this[je]=!1,this[De]=!0,e)if("nodes"===t){this.nodes=[];for(var r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){var t;return e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)&&(t=this.source,e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)),e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(var t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=$e(this);for(var r in e)t[r]=e[r];return t}cloneAfter(e={}){e=this.clone(e);return this.parent.insertAfter(this,e),e}cloneBefore(e={}){e=this.clone(e);return this.parent.insertBefore(this,e),e}error(e,t={}){var r,n;return this.source?({end:r,start:n}=this.rangeBy(t),this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)):new Ue(e)}getProxyProcessor(){return{get(e,t){return"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t]},set(e,t,r){return e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0}}}markDirty(){if(this[je]){this[je]=!1;let e=this;for(;e=e.parent;)e[je]=!1}}next(){var e;if(this.parent)return e=this.parent.index(this),this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;return e.index?r=this.positionInside(e.index,t):!e.word||-1!==(e=(t=this.toString()).indexOf(e.word))&&(r=this.positionInside(e,t)),r}positionInside(t,e){var r=e||this.toString();let n=this.source.start.column,s=this.source.start.line;for(let e=0;e"object"==typeof e&&e.toJSON?e.toJSON(null,r):e);else if("object"==typeof t&&t.toJSON)n[s]=t.toJSON(null,r);else if("source"===s){let e=r.get(t.input);null==e&&(e=i,r.set(t.input,i),i++),n[s]={end:t.end,inputId:e,start:t.start}}else n[s]=t}return t&&(n.inputs=[...r.keys()].map(e=>e.toJSON())),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=ze){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(var s in r)n[s]=r[s];return e.warn(t,n)}get proxyOf(){return this}}var Ie=Ge,He=(Ge.default=Ge,Ie);class Ve extends He{constructor(e){super(e=e&&void 0!==e.value&&"string"!=typeof e.value?{...e,value:String(e.value)}:e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}}var He=Ve,We=(Ve.default=Ve,{}),Je={},qe={},Ke={},Ze="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),Ye=(Ke.encode=function(e){if(0<=e&&e>>=5)&&(t|=32),r+=Ye.encode(t),0>1,1==(1&a)?-i:i),r.rest=t};var Ke={},l=Ke,Xe=(l.getArg=function(e,t,r){if(t in e)return e[t];if(3===arguments.length)return r;throw new Error('"'+t+'" is a required argument.')},/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/),Qe=/^data:.+\,.+$/;function et(e){e=e.match(Xe);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}function tt(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}l.urlParse=et,l.urlGenerate=tt,rt=function(e){var t=e,r=et(e);if(r){if(!r.path)return e;t=r.path}for(var n,e=l.isAbsolute(t),s=[],i=0;;){if(n=i,-1===(i=t.indexOf("/",n))){s.push(t.slice(n));break}for(s.push(t.slice(n,i));in;e--){var o=r[e-1],a=r[e];if(Pt(o,a)<=0)break;r[e-1]=a,r[e]=o}else Lt(r,Pt,n)}function It(e,s){var t=e,e=("string"==typeof e&&(t=w.parseSourceMapInput(e)),w.getArg(t,"version")),t=w.getArg(t,"sections");if(e!=this._version)throw new Error("Unsupported version: "+e);this._sources=new Et,this._names=new Et;var i={line:-1,column:0};this._sections=t.map(function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var t=w.getArg(e,"offset"),r=w.getArg(t,"line"),n=w.getArg(t,"column");if(r=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))},p.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;var r=this._findSourceIndex(e);if(0<=r)return this.sourcesContent[r];var n,r=e;if(null!=this.sourceRoot&&(r=w.relative(this.sourceRoot,r)),null!=this.sourceRoot&&(n=w.urlParse(this.sourceRoot))){e=r.replace(/^file:\/\//,"");if("file"==n.scheme&&this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];if((!n.path||"/"==n.path)&&this._sources.has("/"+r))return this.sourcesContent[this._sources.indexOf("/"+r)]}if(t)return null;throw new Error('"'+r+'" is not in the SourceMap.')},p.prototype.generatedPositionFor=function(e){var t=w.getArg(e,"source");if((t=this._findSourceIndex(t))<0)return{line:null,column:null,lastColumn:null};t={source:t,originalLine:w.getArg(e,"line"),originalColumn:w.getArg(e,"column")},e=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",w.compareByOriginalPositions,w.getArg(e,"bias",f.GREATEST_LOWER_BOUND));if(0<=e){e=this._originalMappings[e];if(e.source===t.source)return{line:w.getArg(e,"generatedLine",null),column:w.getArg(e,"generatedColumn",null),lastColumn:w.getArg(e,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},ft.BasicSourceMapConsumer=p,(It.prototype=Object.create(f.prototype)).constructor=f,It.prototype._version=3,Object.defineProperty(It.prototype,"sources",{get:function(){for(var e=[],t=0;t{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(n,s=21)=>(e=s)=>{let t="",r=e;for(;r--;)t+=n[Math.random()*n.length|0];return t}};let{SourceMapConsumer:Ut,SourceMapGenerator:Ft}=We,{existsSync:zt,readFileSync:$t}=i.default,{dirname:Gt,join:Ht}=n.default;class Vt{constructor(e,t){!1!==t.map&&(this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:"),e=t.map?t.map.prev:void 0,e=this.loadMap(t.from,e),!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Gt(this.mapFile)),e&&(this.text=e))}consumer(){return this.consumerCache||(this.consumerCache=new Ut(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+t)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);var r,n;t&&(r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r),-1"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,i,o;t&&"object"==typeof t?(a=r,r="number"==typeof(l=t).offset?(t=(c=this.fromOffset(l.offset)).line,c.col):(t=l.line,l.column),o="number"==typeof a.offset?(c=this.fromOffset(a.offset),i=c.line,c.col):(i=a.line,a.column)):r||(t=(l=this.fromOffset(t)).line,r=l.col);var a,l,c=this.origin(t,r,i,o);return s=c?new Xt(e,void 0===c.endLine?c.line:{column:c.column,line:c.line},void 0===c.endLine?c.column:{column:c.endColumn,line:c.endLine},c.source,c.file,n.plugin):new Xt(e,void 0===i?t:{column:r,line:t},void 0===i?r:{column:o,line:i},this.css,this.file,n.plugin),s.input={column:r,endColumn:o,endLine:i,line:t,source:this.css},this.file&&(Jt&&(s.input.url=Jt(this.file).toString()),s.input.file=this.file),s}fromOffset(t){let n;if(this[er])n=this[er];else{var s=this.css.split("\n");n=new Array(s.length);let r=0;for(let e=0,t=s.length;e>1),t=n[i+1])){r=i;break}r=i+1}}return{col:t-n[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Kt(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let s=this.map.consumer();t=s.originalPositionFor({column:t,line:e});if(!t.source)return!1;let i;"number"==typeof r&&(i=s.originalPositionFor({column:n,line:r}));let o,a=(o=qt(t.source)?Jt(t.source):new URL(t.source,this.map.consumer().sourceRoot||Jt(this.map.mapFile)),{column:t.column,endColumn:i&&i.column,endLine:i&&i.line,line:t.line,url:o.toString()});if("file:"===o.protocol){if(!Wt)throw new Error("file: protocol is not available in this PostCSS build");a.file=Wt(o)}e=s.sourceContentFor(t.source);return e&&(a.source=e),a}toJSON(){let e={};for(var t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}}Je=nr;nr.default=nr,Yt&&Yt.registerInput&&Yt.registerInput(nr);let{SourceMapConsumer:sr,SourceMapGenerator:ir}=We,{dirname:or,relative:ar,resolve:lr,sep:cr}=n.default,ur=s.default["pathToFileURL"],hr=Je,pr=Boolean(sr&&ir),dr=Boolean(or&&lr&&ar&&cr);ft=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e,t=(e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map","\n");this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(var t of this.previous()){var r=this.toUrl(this.path(t.file)),n=t.root||or(t.file);let e;!1===this.mapOpts.sourcesContent?(e=new sr(t.text),e.sourcesContent&&(e.sourcesContent=null)):e=t.consumer(),this.map.applySourceMap(e,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let t;for(let e=this.root.nodes.length-1;0<=e;e--)t=this.root.nodes[e],"comment"===t.type&&0===t.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(e)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),dr&&pr&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,e=>{t+=e}),[t]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=ir.fromSourceMap(e)}else this.map=new ir({file:this.outputFile()}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):""});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&0",o={generated:{column:0,line:0},original:{column:0,line:0},source:""},a,l;this.stringify(this.root,(e,t,r)=>{this.css+=e,t&&"end"!==r&&(o.generated.line=n,o.generated.column=s-1,t.source&&t.source.start?(o.source=this.sourcePath(t),o.original.line=t.source.start.line,o.original.column=t.source.start.column-1):(o.source=i,o.original.line=1,o.original.column=0),this.map.addMapping(o)),a=e.match(/\n/g),a?(n+=a.length,l=e.lastIndexOf("\n"),s=e.length-l):s+=e.length,t&&"start"!==r&&(e=t.parent||{raws:{}},("decl"===t.type||"atrule"===t.type&&!t.nodes)&&t===e.last&&!e.raws.semicolon||(t.source&&t.source.end?(o.source=this.sourcePath(t),o.original.line=t.source.end.line,o.original.column=t.source.end.column-1,o.generated.line=n,o.generated.column=s-2):(o.source=i,o.original.line=1,o.original.column=0,o.generated.line=n,o.generated.column=s-1),this.map.addMapping(o)))})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;var e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:0e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;var t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?or(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=or(lr(r,this.mapOpts.annotation)));t=ar(r,e);return this.memoizedPaths.set(e,t),t}previous(){var e;return this.previousMaps||(this.previousMaps=[],this.root?this.root.walk(e=>{e.source&&e.source.input.map&&(e=e.source.input.map,this.previousMaps.includes(e)||this.previousMaps.push(e))}):(e=new hr(this.originalCSS,this.opts)).map&&this.previousMaps.push(e.map)),this.previousMaps}setSourcesContent(){let r={};var e;this.root?this.root.walk(e=>{var t;!e.source||(t=e.source.input.from)&&!r[t]&&(r[t]=!0,t=this.usesFileUrls?this.toFileUrl(t):this.toUrl(this.path(t)),this.map.setSourceContent(t,e.source.input.css))}):this.css&&(e=this.opts.from?this.toUrl(this.path(this.opts.from)):"",this.map.setSourceContent(e,this.css))}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){var t=this.memoizedFileURLs.get(e);if(t)return t;if(ur)return t=ur(e).toString(),this.memoizedFileURLs.set(e,t),t;throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){var t=this.memoizedURLs.get(e);if(t)return t;"\\"===cr&&(e=e.replace(/\\/g,"/"));t=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,t),t}};class fr extends Ie{constructor(e){super(e),this.type="comment"}}Ct=fr;fr.default=fr;let{isClean:mr,my:gr}=Me,yr=He,vr=Ct,wr,br,_r,Cr;class Sr extends Ie{append(...e){for(var t of e){var r;for(r of this.normalize(t,this.last))this.proxyOf.nodes.push(r)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(var t of this.nodes)t.cleanRaws(e)}each(r){if(this.proxyOf.nodes){var n=this.getIterator();let e,t;for(;this.indexes[n]t[n](...e.map(r=>"function"==typeof r?(e,t)=>r(e.toProxy(),t):r)):"every"===n||"some"===n?r=>t[n]((e,...t)=>r(e.toProxy(),...t)):"root"===n?()=>t.root().toProxy():"nodes"===n?t.nodes.map(e=>e.toProxy()):"first"===n||"last"===n?t[n].toProxy():t[n])},set(e,t,r){return e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0}}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){var r,n,s,i=this.index(e),o=this.normalize(t,this.proxyOf.nodes[i]).reverse(),i=this.index(e);for(r of o)this.proxyOf.nodes.splice(i+1,0,r);for(s in this.indexes)i<(n=this.indexes[s])&&(this.indexes[s]=n+o.length);return this.markDirty(),this}insertBefore(e,t){var r,n,s,i=this.index(e),o=this.normalize(t,this.proxyOf.nodes[i],0===i&&"prepend").reverse(),i=this.index(e);for(r of o)this.proxyOf.nodes.splice(i,0,r);for(s in this.indexes)i<=(n=this.indexes[s])&&(this.indexes[s]=n+o.length);return this.markDirty(),this}normalize(e,t){if("string"==typeof e)e=function t(e){return e.map(e=>(e.nodes&&(e.nodes=t(e.nodes)),delete e.source,e))}(wr(e).nodes);else if(void 0===e)e=[];else if(Array.isArray(e))for(var r of e=e.slice(0))r.parent&&r.parent.removeChild(r,"ignore");else if("root"===e.type&&"document"!==this.type)for(var n of e=e.nodes.slice(0))n.parent&&n.parent.removeChild(n,"ignore");else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new yr(e)]}else if(e.selector)e=[new br(e)];else if(e.name)e=[new _r(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new vr(e)]}return e.map(e=>(e[gr]||Sr.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[mr]&&function e(t){if(t[mr]=!1,t.proxyOf.nodes)for(var r of t.proxyOf.nodes)e(r)}(e),void 0===e.raws.before&&t&&void 0!==t.raws.before&&(e.raws.before=t.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}prepend(...e){for(var t of e=e.reverse()){var r,n,s=this.normalize(t,this.first,"prepend").reverse();for(r of s)this.proxyOf.nodes.unshift(r);for(n in this.indexes)this.indexes[n]=this.indexes[n]+s.length}return this.markDirty(),this}push(e){return(e.parent=this).proxyOf.nodes.push(e),this}removeAll(){for(var e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){var t,r;for(r in e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1),this.indexes)e<=(t=this.indexes[r])&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(t,r,n){return n||(n=r,r={}),this.walkDecls(e=>{r.props&&!r.props.includes(e.prop)||r.fast&&!e.value.includes(r.fast)||(e.value=e.value.replace(t,n))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(n){return this.each((t,e)=>{let r;try{r=n(t,e)}catch(e){throw t.addToError(e)}return!1!==r&&t.walk&&(r=t.walk(n)),r})}walkAtRules(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("atrule"===e.type&&r.test(e.name))return n(e,t)}):this.walk((e,t)=>{if("atrule"===e.type&&e.name===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("atrule"===e.type)return n(e,t)}))}walkComments(r){return this.walk((e,t)=>{if("comment"===e.type)return r(e,t)})}walkDecls(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("decl"===e.type&&r.test(e.prop))return n(e,t)}):this.walk((e,t)=>{if("decl"===e.type&&e.prop===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("decl"===e.type)return n(e,t)}))}walkRules(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("rule"===e.type&&r.test(e.selector))return n(e,t)}):this.walk((e,t)=>{if("rule"===e.type&&e.selector===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("rule"===e.type)return n(e,t)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}Sr.registerParse=e=>{wr=e},Sr.registerRule=e=>{br=e},Sr.registerAtRule=e=>{_r=e},Sr.registerRoot=e=>{Cr=e};i=Sr,Sr.default=Sr,Sr.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,_r.prototype):"rule"===e.type?Object.setPrototypeOf(e,br.prototype):"decl"===e.type?Object.setPrototypeOf(e,yr.prototype):"comment"===e.type?Object.setPrototypeOf(e,vr.prototype):"root"===e.type&&Object.setPrototypeOf(e,Cr.prototype),e[gr]=!0,e.nodes&&e.nodes.forEach(e=>{Sr.rebuild(e)})},ot=i;let xr,Ar;class kr extends ot{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){let t=new xr(new Ar,this,e);return t.stringify()}}kr.registerLazyResult=e=>{xr=e},kr.registerProcessor=e=>{Ar=e};e=kr;kr.default=kr;let Er={};function Or(e){Er[e]||(Er[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))}class Lr{constructor(e,t={}){for(var r in this.type="warning",this.text=e,t.node&&t.node.source&&(e=t.node.rangeBy(t),this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column),t)this[r]=t[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}St=Lr;Lr.default=Lr;let Mr=St;class Pr{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);e=new Mr(e,t);return this.messages.push(e),e}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}}Ke=Pr;Pr.default=Pr;let Rr=i;class Ir extends Rr{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}We=Ir;Ir.default=Ir,Rr.registerAtRule(Ir);let Tr=i,Br,Nr;class jr extends Tr{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){e=super.normalize(e);if(t)if("prepend"===r)1{Br=e},jr.registerProcessor=e=>{Nr=e};n=jr;jr.default=jr,Tr.registerRoot(jr);let Dr={comma(e){return Dr.split(e,[","],!0)},space(e){return Dr.split(e,[" ","\n","\t"])},split(e,t,u){let r=[],n="",s=!1,i=0,o=!1,a="",l=!1;for(var c of e)l?l=!1:"\\"===c?l=!0:o?c===a&&(o=!1):'"'===c||"'"===c?(o=!0,a=c):"("===c?i+=1:")"===c?0"space"!==e[0]&&"comment"!==e[0])&&(s.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(s,"value",a.concat(e),t),s.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new Jr;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){var t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1;var r;let n=!1,s=null,i=[];var o=e[1].startsWith("--");let a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)s=s||l,i.push("("===r?")":"]");else if(o&&n&&"{"===r)s=s||l,i.push("}");else if(0===i.length){if(";"===r){if(n)return void this.decl(a,o);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===i[i.length-1]&&(i.pop(),0===i.length&&(s=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),0e+t[1],""),e.raws[t]={raw:o,value:l}),e[t]=l}rule(e){e.pop();let t=new Jr;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){var t;let r="";for(;e.length&&("space"===(t=e[e.length-1][0])||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){var t;let r="";for(;e.length&&("space"===(t=e[0][0])||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t="";for(;e.length&&"space"===e[e.length-1][0];)t=e.pop()[1]+t;return t}stringFrom(t,r){let n="";for(let e=r;evn(e)),e}let wn={};class bn{constructor(e,t,r){this.stringified=!1,this.processed=!1;let n;if("object"!=typeof t||null===t||"root"!==t.type&&"document"!==t.type)if(t instanceof bn||t instanceof ln)n=vn(t.root),t.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=t.map);else{let e=cn;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{n=e(t,r)}catch(e){this.processed=!0,this.error=e}n&&!n[tn]&&sn.rebuild(n)}else n=vn(t);this.result=new ln(e,n,r),this.helpers={...wn,postcss:wn,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){var r=this.result.lastPlugin;try{if(t&&t.addToError(e),"CssSyntaxError"!==(this.error=e).name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){var n=r.postcssPlugin;let e=r.postcssVersion,t=this.result.processor.version;var s=e.split("."),i=t.split(".");(s[0]!==i[0]||parseInt(s[1])>parseInt(i[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+t+", but "+n+" uses "+e+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};var e,t=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(e of this.plugins)if("object"==typeof e)for(var r in e){if(!pn[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${e.postcssPlugin}. `+`Try to update PostCSS (${this.processor.version} now).`);if(!dn[r])if("object"==typeof e[r])for(var n in e[r])"*"===n?t(e,r,e[r][n]):t(e,r+"-"+n.toLowerCase(),e[r][n]);else"function"==typeof e[r]&&t(e,r,e[r])}this.hasListener=0t(e,this.helpers)),await Promise.all(i)):await t(r,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{var e;if("object"==typeof t&&t.Once)return"document"===this.result.root.type?mn((e=this.result.root.nodes.map(e=>t.Once(e,this.helpers)))[0])?Promise.all(e):e:t.Once(this.result.root,this.helpers);if("function"==typeof t)return t(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();var e=this.result.opts;let t=nn,r=(e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify),new rn(t,this.result.root,this.result.opts));e=r.generate();return this.result.css=e[0],this.result.map=e[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(var e of this.plugins)if(mn(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[en];)e[en]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(var t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||an("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(var[r,n]of e){this.result.lastPlugin=r;let e;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(mn(e))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:s}=r;if("root"===n.type||"document"===n.type||n.parent){if(0{e[en]||this.walkSync(e)});else{var r=this.listeners[t];if(r&&this.visitSync(r,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}bn.registerPostcss=e=>{wn=e};Me=bn;bn.default=bn,un.registerLazyResult(bn),on.registerLazyResult(bn);let _n=ft,Cn=Ne,Sn=Or,xn=Qr;const An=Ke;class kn{constructor(e,t,r){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;var e=Cn;this.result=new An(this._processor,void 0,this._opts),this.result.css=t;let n=this,s=(Object.defineProperty(this.result,"root",{get(){return n.root}}),new _n(e,void 0,this._opts,t));s.isMap()?([r,e]=s.generate(),r&&(this.result.css=r),e&&(this.result.map=e)):(s.clearAnnotation(),this.result.css=s.css)}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||Sn("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=xn;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}}ft=kn;kn.default=kn;let En=ft,On=Me,Ln=e,Mn=n;class Pn{constructor(e=[]){this.version="8.4.35",this.plugins=this.normalize(e)}normalize(e){let t=[];for(var r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return new(this.plugins.length||t.parser||t.stringifier||t.syntax?On:En)(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}ft=Pn;Pn.default=Pn,Mn.registerProcessor(Pn),Ln.registerProcessor(Pn);let Rn=He,In=qe,Tn=Ct,Bn=We,Nn=Je,jn=n,Dn=ot;function Un(e,r){if(Array.isArray(e))return e.map(e=>Un(e));let{inputs:t,...n}=e;if(t){r=[];for(var s of t){let e={...s,__proto__:Nn.prototype};e.map&&(e.map={...e.map,__proto__:In.prototype}),r.push(e)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>Un(e,r))),n.source){let{inputId:e,...t}=n.source;n.source=t,null!=e&&(n.source.input=r[e])}if("root"===n.type)return new jn(n);if("decl"===n.type)return new Rn(n);if("rule"===n.type)return new Dn(n);if("comment"===n.type)return new Tn(n);if("atrule"===n.type)return new Bn(n);throw new Error("Unknown node type: "+e.type)}qe=Un,Un.default=Un;let Fn=He,zn=Me;He=i;let $n=ft;Me=Ne,i=qe;let Gn=e;ft=St;let Hn=Ct,Vn=We;Ne=Ke,qe=Je,e=Qr,St=s;let Wn=ot,Jn=n;Ct=Ie;function o(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new $n(e)}o.plugin=function(r,n){let s=!1;function i(...e){console&&console.warn&&!s&&(s=!0,console.warn(r+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(r+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let t=n(...e);return t.postcssPlugin=r,t.postcssVersion=(new $n).version,t}let e;return Object.defineProperty(i,"postcss",{get(){return e=e||i(),e}}),i.process=function(e,t,r){return o([i(r)]).process(e,t)},i},o.stringify=Me,o.parse=e,o.fromJSON=i,o.list=St,o.comment=e=>new Hn(e),o.atRule=e=>new Vn(e),o.decl=e=>new Fn(e),o.rule=e=>new Wn(e),o.root=e=>new Jn(e),o.document=e=>new Gn(e),o.CssSyntaxError=t,o.Declaration=Fn,o.Container=He,o.Processor=$n,o.Document=Gn,o.Comment=Hn,o.Warning=ft,o.AtRule=Vn,o.Result=Ne,o.Input=qe,o.Rule=Wn,o.Root=Jn,o.Node=Ct,zn.registerPostcss(o);o.default=o;class qn extends HTMLElement{base;contents;component;listType="ul";iconSet;filter={value:"",caseSensitive:!1};static get observedAttributes(){return["contents","icon-set","max-depth","filter"]}_jsonToValueArray(e){let t=JSON.stringify(e);t=t.replace(/[\[\]{}\"]/g,"");let r=[];for(const n of t.split(","))r=r.concat(n.split(":"));return[...new Set(r)]}_emit(e,t,r){e=new CustomEvent(e,{detail:r,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}constructor(){super(),this.base=new $,this.setContents(this.getAttribute("contents")),this.iconSet=this.getAttribute("icon-set")?this.getAttribute("icon-type"):"file",this.maxDepth=this.getAttribute("max-depth")?parseInt(this.getAttribute("max-depth")):-1,this.setFilter(this.getAttribute("filter")),this.style.display="block",this.style.maxWidth="fit-content",this.style.margin="0 1rem 0 0",this.base.addEvent(".flk-branch","click",this.emitNodeToggle)}emitNodeToggle(e){e.stopPropagation();const t=F(e,"flk-tree-nav").target,r=z(e,"branchKey");let n=t.contents;for(const s of r.split("."))n=n[s];e=r.substring(r.indexOf(".")+1);t._emit("tree-click",t,{path:e,data:n,branch:"object"==typeof n})}convertJsonKeyToTitle(e){if(!e)return"";const t=(e="string"!=typeof e?e.toString():e).replace(/([A-Z_])/g,e=>"_"===e?" ":" "+e).trim();return t.charAt(0).toUpperCase()+t.slice(1)}setContents(e){var t=e||this.contents||[];try{switch(typeof t){case"string":this.contents=JSON.parse(t);break;case"object":Array.isArray(t)?this.contents=t:this.contents=[t]}}catch(e){console.log(e)}}applyFilter(e){let t;var r="details"===e.tagName.toLowerCase();t=this.filter.caseSensitive?e.dataset.branchValues.includes(this.filter.value):e.dataset.branchValues.toLowerCase().includes(this.filter.value.toLowerCase()),t?e.parentElement.classList.remove("hidden"):e.parentElement.classList.add("hidden"),r&&t?e.setAttribute("open",""):e.removeAttribute("open")}resetTree(e){e.parentElement.classList.remove("hidden"),e.removeAttribute("open")}filterTree(){let t=setTimeout(()=>{for(const e of this.querySelectorAll("[data-branch-values]"))void 0===this.filter.value||0===this.filter.value.length?this.resetTree(e):this.applyFilter(e);clearTimeout(t)},10)}setFilter(e){const t=e||{};try{switch(typeof t){case"string":t.includes("{")?(this.filter=JSON.parse(t),!1===this.filter.caseSensitive&&(this.filter.value=this.filter.value.toLowerCase())):this.filter.value=e.toLowerCase();break;case"object":this.filter=t}}catch(e){console.log(e)}this.filterTree()}createTextTag(n,s){if("string"==typeof n&&(n.includes("(")||n.includes("["))){let e=document.createElement("div");var i=n.indexOf("("),o=n.indexOf("["),i=-1===o?i:o;let t=document.createElement("span"),r=(t.innerText=this.convertJsonKeyToTitle(n.substring(0,i)),document.createElement("small"));r.innerText=n.substring(i),r.style.marginLeft="1rem",e.append(t,r),e.style.display="inline-flex",e.style.alignItems="center",s.append(e)}else s.innerText=this.convertJsonKeyToTitle(n)}createLeaf(e,t,r,n=[]){let s=document.createElement("li");s.classList.add("cursor-no-select"),s.style.marginTop="0.4rem",s.dataset.branchKey=r;const i="file"===this.iconSet?'':'';s.style.listStyleImage=`url('data:image/svg+xml,${i}')`,s.style.position="relative",s.style.left="2px";let o=document.createElement("span");r=[e].concat(n);if(o.dataset.branchValues=[...new Set(r)].join(),this.createTextTag(e,o),o.style.position="relative",o.style.top="-3px",s.append(o),t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);const i="file"===this.iconSet?G:H;e.style.listStyleImage=`url('data:image/svg+xml,${i}')`,e.append(s),t.append(e)}else t.append(s)}createBranch(r,t,n,s){if(s===this.maxDepth&&"object"==typeof r){var i,o=Array.isArray(r)?r:Object.keys(r);if("object"==typeof o[0]){let e=[];for(const g of o)e=e.concat(Object.keys(g));for(i of[...new Set(e)]){var h=document.createElement(this.listType);t.append(this.createBranch(i,h,n+"."+i,s+1))}}else for(const l of o){let e;r[l]&&(e=this._jsonToValueArray(r[l])),this.createLeaf(l,t,n,e)}}else if(Array.isArray(r)){var a;let e=[];if("object"==typeof r[0]){for(const y of r)e=e.concat(Object.keys(y));for(a of[...new Set(e)]){var p=document.createElement(this.listType);t.append(this.createBranch(a,p,n+"."+a,s+1))}}else for(var d in r){var f=document.createElement(this.listType);t.append(this.createBranch(r[d],f,n+"."+d,s+1))}}else if(null!==r&&"object"==typeof r){const c=[];for(const u of Object.keys(r)){let e=document.createElement("li"),t=(e.classList.add("cursor-no-select"),e.style.position="relative",e.style.left="2px",e.dataset.branchKey=n+"."+u,document.createElement("details"));t.classList.add("flk-branch"),t.dataset.branchValues=[u].concat(this._jsonToValueArray(r[u])),t.style.position="relative",t.style.top="-3px",t.classList.add("cursor-default");var m=document.createElement("summary");this.createTextTag(u,m),t.append(m),e.append(this.createBranch(r[u],t,n+"."+u,s+1)),c.push(e)}if(t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);o="file"===this.iconSet?G:H;e.style.listStyleImage=`url('data:image/svg+xml,${o}')`;for(const v of c)e.append(v);t.append(e)}else for(const e of c)t.append(e)}else this.createLeaf(r,t,n);return t}createHtml(){let e=document.createElement(this.listType);var t="file"===this.iconSet?G:'';if(e.style.listStyleImage=`url('data:image/svg+xml,${t}')`,e.style.marginLeft="3rem",this.contents.length){for(const r in this.contents)e=this.createBranch(this.contents[r],e,r,0);this.component=e}else this.component=e}attributeChangedCallback(e,t,r){switch(e){case"contents":this.setContents(r);break;case"icon-set":this.iconSet=r;break;case"max-depth":this.maxDepth="string"==typeof r?parseInt(r):r;break;case"filter":this.setFilter(r)}this.init()}connectedCallback(){this.init()}disconnectedCallback(){this.base.removeEvents(this)}init(){this.createHtml(),this.base.render(this)}}customElements.define("flk-table",W),customElements.define("flk-draggable",J),customElements.define("flk-modal",q),customElements.define("flk-dropdown",K),customElements.define("flk-tree-nav",qn)}(require$$0,require$$2,require$$1$1,require$$1); \ No newline at end of file +!function(e,n,s,i){"use strict";function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a,u,g,e=c(e),n=c(n),s=c(s),i=c(i);(t=a=a||{}).Date="date",t.String="string",t.Float="float",t.Number="number",t.Array="array",t.Object="object",t.Bool="bool",t.Currency="currency",t.Undefined="undefined",t.Null="null";const h={date:/^(\d{1,4}-\d{1,4}-\d{1,4}(T)?)/gim,currency:/^[$|€]\s?[0-9]*(\.|,)?\d*(\.|,)?\d*/gim,float:/\d+[,|.]\d+[,|.]?\d*/gim,currencySign:/\$|€/gim,array:/^\s?[[].[^,]+[\]],?/gi,precision:/[-+$€,.]/gm,string:/[a-zA-Z]/gim},m=e=>{return null===e||"null"===e?a.Null:e||0===e||!1===e?null===new RegExp(h.date).exec(e)||isNaN(Date.parse(e))?new RegExp(h.currency).exec(e)?a.Currency:!new RegExp(h.string).exec(e)&&new RegExp(h.float).exec(e.toString())?a.Float:isNaN(e)&&0!==e?Array.isArray(e)?a.Array:"object"==typeof e?a.Object:a.String:a.Number:a.Date:a.Undefined},y=(t,e)=>{const r={value:void 0,type:e=e||m(t),currencySign:""};switch(r.type){case a.String:r.value=t.toString();break;case a.Float:case a.Currency:var n=(t=t.toString()).match(new RegExp(/(,)/gim)),s=t.match(new RegExp(/(\.)/gim));if(n)for(let e=1;e<=n.length;e++)t=e!==n.length||s?t.replace(",",""):t.replace(",",".");if(r.type===a.Currency){const o=new RegExp(h.currencySign);var i=o.exec(t);r.currencySign=null!==i?i[0]:"",t=t.replace(o,"")}r.value=parseFloat(t).toPrecision(12);break;case a.Number:r.value=Number(t);break;case a.Date:r.value=Date.parse(t);break;case a.Array:t.length?"object"==typeof t[0]?r.value=t.map(e=>JSON.stringify(e)).join(", "):r.value=t.join(", "):r.value="";break;case a.Object:r.value=t;break;case a.Undefined:r.value="";break;case a.Null:r.value=null}return r};function v(e,t){var r;let n;for(r of e.split("."))r=r.trim(),n?"object"!=typeof n||Array.isArray(n)||(n=n[r]):n=t[r];return n}const b=(e,t)=>tet<=e,S=(e,t)=>e<=t,x=(e,t,r)=>r?e.toLowerCase()==t.toLowerCase():e==t,A=(e,t)=>e===t,k=(e,t)=>e!=t,E=(e,t)=>e!==t,L=(e,t)=>null!=t&&"string"==typeof e&&0<=e.toLowerCase().indexOf(t.toString().toLowerCase()),O=(e,t)=>null!=t&&0<=e.toString().toLowerCase().indexOf(t.toString().toLowerCase()),M=(e,t)=>null!=t&&"string"==typeof e&&e.toLowerCase().indexOf(t.toString().toLowerCase())<0;function P(r,n){if(0===n.length)return r;{var s=r;const o=[],a=[];let e=[];for(const l of n)l.type&&l.type!==u.And?(e.length&&a.push(e),e=[l]):e.push(l);a.push(e);let t=[];for(const e of a)t=t.concat(R(s,e));t=[...new Set(t)];var i=s.length;for(let e=0;e":return b;case"<":return _;case">=":return C;case"<=":return S;case"is":case"==":return x;case"!is":case"!=":return k;case"===":return A;case"!==":return E;case"like":case"~":case"contains":return L;case"!contains":case"!like":case"!~":return M;default:return O}}(a.operator);if(!l(i,o,a.ignoreCase)){e=!1;break}}e&&r.push(n)}return r};function T(e,t){if(!t||0===t.length)return e;if(1{if(0===r.length)r=r.concat(I(s,e));else{for(const t of r)n=n.concat(I(t,e));r=n,n=[]}}),r}return I(e,t[0])}function I(e,t){const r=[],n=[];do{if(!e||0===e.length)break;var s=e.shift();if(!s)break;const o=s[t];var i=n.indexOf(o.toString());0<=i?r[i].push(s):(n.push(o.toString()),void 0!==r[n.length-1]?r[n.length-1].push(s):r.push([s]))}while(0{if(t){var r=e;const n={};for(const s of t){let e=r.map(e=>e[s].toString());const i=e.map(e=>m(e));i.some(e=>e===a.Float)?(e=e.map(e=>parseFloat(e)),n[s]=parseFloat(e.reduce((e,t)=>e+t).toFixed(2))):(e=e.map(e=>parseInt(e)),n[s]=e.reduce((e,t)=>e+t))}return n}return{}};class D{model;sortDetails=[];filterDetails=[];selection=[];groupByProperties=[];distinctProperties=[];concatenationToken=", ";constructor(e){this.model=JSON.parse(JSON.stringify(e))}sort(e){return this.sortDetails=e,this}orderBy(e,t){return this.sortDetails.push({propertyName:e,direction:t}),this}thenOrderBy(e,t){return this.orderBy(e,t)}filter(e){return Array.isArray(e)?this.filterDetails=e:this.filterDetails.push(e),this}where(e,t,r,n,s){return this.filterDetails.push({propertyName:e,operator:t,value:r,type:n,ignoreCase:s}),this}andWhere(e,t,r,n){return this.where(e,t,r,u.And,n),this}orWhere(e,t,r,n){return this.where(e,t,r,u.Or,n),this}group(e){return this.groupByProperties=e,this}groupBy(e){return this.groupByProperties.push(e),this}thenGroupBy(e){return this.groupByProperties.push(e),this}select(e){return Array.isArray(e)?this.selection=e:"*"!==e&&(this.selection=[e]),this}distinct(e,t){return t&&(this.concatenationToken=t),Array.isArray(e)?this.distinctProperties=e:e&&(this.distinctProperties=[e]),this}execute(){return T(function(t,r){if(0===r.length)return t;{var n=r;let e=[];for(const s of t){const i={};for(const o of n)i[o]=s[o];e.push(i)}return e}}(function(r,n,u){if(!n||!n.length)return r;const s=[],h=[];for(const f of r){const o={};let t="";for(const e of n){var p=v(e,f);o[e]=p,t+=p}if(!h.includes(t)){let e=r;for(const a of Object.keys(o))e=e.filter(e=>e[a]===o[a]);h.push(t),s.push(e)}}const t=[];for(const m of s){let e={};for(const l of m){var i,d=Object.keys(e);if(d.length)for(const c of d)n.includes(c)||(i=e[c],Array.isArray(i)?(i=l[c],Array.isArray(i)?e[c]=[...new Set(...e[c].concat(l[c]))]:e[c].includes(l[c])||e[c].push(l[c])):isNaN(e[c])&&isNaN(l[c])?e[c]!==l[c]&&(e[c]=[e[c],l[c]]):e[c]=e[c]+l[c]);else e=l}t.push(e)}return t.forEach(e=>{for(const t in e)Array.isArray(e[t])&&(e[t]=e[t].join(u))}),t}(B(P(JSON.parse(JSON.stringify(this.model)),this.filterDetails),this.sortDetails),this.distinctProperties,this.concatenationToken),this.selection),this.groupByProperties)}sum(e,t){e=Array.isArray(e)?e:[e];return j(t||this.model,e)}}function U(e,t){t=t?t.toUpperCase():"FLK-";return e.toUpperCase().includes(t)}function F(e,t){var{timeStamp:r,type:n,x:s,y:i}=e;let o=e.target;do{if(!o||"HTML"===o.tagName||U(o.tagName,t)){"HTML"===o.tagName&&(o=null);break}}while(o=o.parentNode||o.parentElement,!U(o.tagName,t));return{target:o,timeStamp:r,type:n,x:s,y:i}}function z(e,t){let r=e.target,n="";for(;r.dataset[t]?n=r.dataset[t]:r=r.parentNode,!n;);return n}class ${constructor(){}_topLevelClasses=[];_events=[];generateId(){return"flk-"+function e(){const t=([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)),r=t.split("-")[0];return window.$flightkitUUIDStore||(window.$flightkitUUIDStore=[]),window.$flightkitUUIDStore.some(e=>e===r)?e():(window.$flightkitUUIDStore.push(r),r)}()}render(t){if(!t.component)throw new Error("Component is not assigned! Can't render");t.id=t.id||this.generateId();var e=this._getAllEventAttributes(t);if(e){var r="#"+t.id;for(const i of e){var n="e-"+i;this.addEvent(r,i,t.getAttribute(n))}}var s=Object.keys(t.classList).length;if(s){for(let e=0;e{this._assignToDom(t,t.component),clearTimeout(this._renderTimer)},10)}addEvent(e,t,r){this._events.push({selector:e,eventType:t,callback:r})}_getExternalCallback(e){let t=void 0;for(const r of e.split("."))t=(t||window)[r];return t}_getAllEventAttributes(e){e=e.attributes;const t=Array.from(e).filter(e=>e.name.startsWith("e-"));return t.map(e=>e.name.slice(2))}_isFlightkitElement(e){return e.toUpperCase().includes("FLK-")}_outerEventHandler(e){const t=F(e),r=(t.contents=e.detail,t.target.getAttribute("e-"+t.type));let n=void 0;for(const s of r.split("."))n=(n||window)[s];return e.preventDefault(),e.stopPropagation(),n(t)}_addEvents(e){if(e.isConnected)for(const r of this._events)if(r.selector.startsWith("."))for(const n of document.querySelectorAll(r.selector))this._addEventToElement(r,n);else{var t=document.querySelector(r.selector);this._addEventToElement(r,t)}}_addEventToElement(e,t){t&&("function"==typeof e.callback?(t.removeEventListener(e.eventType,e.callback),t.addEventListener(e.eventType,e.callback)):(t.removeEventListener(e.eventType,this._outerEventHandler),t.addEventListener(e.eventType,this._outerEventHandler)))}removeEvents(){for(const t of this._events)if(t.selector.startsWith("."))for(const r of document.querySelectorAll(t.selector))this._addEventToElement(t,r);else{var e=document.querySelector(t.selector);this._addEventToElement(t,e)}this._events=[]}_removeEventToElement(e,t){t&&("function"==typeof e.callback?t.removeEventListener(e.eventType,e.callback):t.removeEventListener(e.eventType,this._outerEventHandler))}_assignToDom(e,t){e.innerHTML="";for(const n of Array.isArray(t)?t:[t])e.append(n);const r=setTimeout(()=>{this._addEvents(e),clearTimeout(r)},10)}}const G='',H='';function V(e){const t=new DOMParser;return t.parseFromString(e,"image/svg+xml").documentElement}class W extends HTMLElement{base;component=null;_contents=[];_orderBy=[];properties=new Set;_columnOrder=[];_filter="";_selectionProperty="";_selectedIds=new Set;uniqueEntriesByProperties={};propertyLabelDictionary={};_templates={};_templateClasses={};static get observedAttributes(){return["contents","columns","order","filter","selection-property","templates"]}get columnOrder(){return this._columnOrder.length?this._columnOrder:this.properties}set columnOrder(e){let t;"string"==typeof e&&(t=e.split(",")),t=e,this._columnOrder=t}get contents(){return this._contents}set contents(e){this.analyzeData(e),this._contents=new D(e)}get orderBy(){return this._orderBy}set orderBy(e){if(Array.isArray(e))this._orderBy=e;else{const n=[];for(const s of e.split(",")){var t=s.split("|"),r=t[0],t=1e[r._selectionProperty])):new Set;e=t?r.contents.execute():[];r._emit("select",r,{selection:e}),r._updateCheckboxes(r)}emitSelect(e){var t=e.target.checked,r=e.target.dataset.objectId;const n=F(e).target,s=(t?n._selectedIds.add(r):n._selectedIds.delete(r),n._selectionProperty);e=n.contents.execute().filter(e=>n._selectedIds.has(e[s]));n._emit("select",n,{selection:e}),n._updateCheckboxes(n)}sortData(e){const t=F(e).target,r=z(e,"column");r&&(-1<(e=t._orderBy.findIndex(e=>e.propertyName===r))?"asc"===t._orderBy[e].direction?t._orderBy[e].direction="desc":t._orderBy.splice(e,1):t._orderBy.push({propertyName:r,direction:"asc"}),t.createHtml(),t.base.render(t))}setColumnOrder(e){this._columnOrder=e?Array.isArray(e)?e:e.split(","):[]}analyzeData(t){this.properties=new Set;var r=t.length;for(let e=0;e"_"===e?" ":" "+e.toLowerCase()).trim();var r=t.charAt(0).toUpperCase()+t.slice(1);return this.propertyLabelDictionary[e]=r}parseTemplate(e,n){return e.replace(/\{\{([\s\S]+?)\}\}/gim,(e,t)=>{let r="";t=t.trim();t=n[t];return t&&(r=t),Array.isArray(r)?r.join(", "):r.toString().trim()})}createSelectionCheckbox(e){const t=document.createElement("input");return t.setAttribute("type","checkbox"),t.classList.add("flk-selection-checkbox"),e&&(t.dataset.selected=e[this._selectionProperty]),t}createRow(e){const t=document.createElement("tr");if(this._selectionProperty.length){const s=document.createElement("td");var r=this.base.generateId();const i=this.createSelectionCheckbox(e);i.id=r,i.dataset.objectId=e[this._selectionProperty];var n=e[this._selectionProperty];this._selectedIds.has(n)?i.checked=!0:i.checked=!1,this.base.addEvent("#"+r,"change",this.emitSelect),s.append(i),t.append(s)}for(const o of this.columnOrder){const a=document.createElement("td");this._templates[o]?(a.innerHTML=this.parseTemplate(this._templates[o],e),this._templateClasses[o]&&a.classList.add(...this._templateClasses[o])):a.innerText=e[o],t.append(a)}return t}createBody(e){const t=document.createElement("tbody");for(const n of e){var r=this.createRow(n,null);t.append(r)}return t}createHead(){const e=document.createElement("thead"),t=document.createElement("tr");if(t.classList.add("cursor-pointer"),this._selectionProperty.length){const s=document.createElement("th");var r=this.base.generateId();const i=this.createSelectionCheckbox();i.id=r;var u=this.contents.execute().length;0e.propertyName===o);if(n){const c=document.createElement("span");c.innerHTML="asc"===n.direction?'':'',a.append(c)}t.append(a)}return e.append(t),e}addEvent(e,t,r){this.base.addEvent(e,t,r)}init(){this.createHtml(),this.base.render(this)}}class J extends HTMLElement{base;componentId;constructor(){super(),this.base=new $}connectedCallback(){var e=this.getAttribute("top"),t=this.getAttribute("left"),r=this.getAttribute("center"),n=this.getAttribute("zIndex");this.id||(this.id=this.base.generateId()),this.style.display="block",this.style.position="fixed","string"==typeof r?(this.style.top=e||"50%",this.style.left="50%",this.style.transform="translate(-50%, -50%)"):(this.style.top=e||this.clientTop+"px",this.style.left=t||this.clientLeft+"px"),n&&(this.style.zIndex=n),this.componentId=this.getAttribute("handle");const s=document.createElement("div");s.innerHTML=this.innerHTML,this.component=s;r="#"+(this.componentId||this.id);this.base.addEvent(r,"mousedown",this._dragElement),this.base.addEvent(r,"mouseup",this._reset),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this)}_dragElement(e){const r=F(e,"flk-draggable").target;let n,s;function t(e){n=e.clientX-r.offsetLeft,s=e.clientY-r.offsetTop}function i(e){var t=e.clientX-n,e=e.clientY-s;r.style.left=t+"px",r.style.top=e+"px"}function o(e){e.preventDefault()}function a(){r.removeAttribute("draggable"),r.removeEventListener("dragstart",t),r.removeEventListener("dragend",a),document.removeEventListener("dragover",o),document.removeEventListener("drop",i)}r.setAttribute("draggable",!0),r.addEventListener("dragstart",t),r.addEventListener("dragend",a),document.addEventListener("dragover",o),document.addEventListener("drop",i)}}class q extends HTMLElement{_id;base;_draggableId;constructor(){super(),this.base=new $}_emit(e,t,r){e=new CustomEvent(e,{detail:r,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}_closeModal(e){e.stopPropagation();const t=F(e,"flk-modal").target;t.classList.add("hidden")}closeModal(e){this.classList.add("hidden")}openModal(e=!0){const t=document.getElementById(this._draggableId);e&&(t.style.top="40%",t.style.left="50%"),this.classList.remove("hidden")}connectedCallback(){this.id||(this.id=this.base.generateId());const e=document.createElement("div");var t=this.base.generateId();const r=document.createElement("flk-draggable"),n=(this._draggableId=this.base.generateId(),r.id=this._draggableId,r.setAttribute("center",""),r.setAttribute("top","40%"),r.setAttribute("handle",t),r.setAttribute("zIndex","1080"),r.classList.add("border","shadow-lg","bg-white"),r.style.width="max-content",document.createElement("div"));var s=this.getAttribute("modal-title");if(s){const c=document.createElement("span");c.innerText=s,c.classList.add("ml-1","mr-auto"),n.append(c)}n.id=t;const i=this.getAttribute("header-class");let o=[];i?o=o.concat(i.split(" ")):o.push("bg-gray-light"),n.classList.add(...o,"border-bottom","row","justify-end","cursor-no-select");s=this.base.generateId();const a=document.createElement("button"),l=(a.classList.add("py-0","px-1","outline-hover","no-border","cursor-default",...o),a.innerText="X",a.id=s,n.append(a),r.append(n),document.createElement("div"));l.innerHTML=this.innerHTML,r.append(l),e.append(r),this.component=e,this.base.addEvent("#"+s,"click",this._closeModal),this.base.render(this),this.classList.add("hidden")}disconnectedCallback(){this.base.removeEvents(this)}}class K extends HTMLElement{base;_buttonId;_drawerId;_iconId;constructor(){super(),this.base=new $}connectedCallback(){this.style.position="relative",this.style.display="flex",this.style.width="fit-content",this._buttonId=this.base.generateId();const e=document.createElement("button"),t=(e.classList.add("row"),e.id=this._buttonId,document.createElement("span")),r=(t.innerText=this.getAttribute("text"),this._iconId=this.base.generateId(),document.createElement("span"));var n=V('');const s=V(''),i=(s.classList.add("hidden"),r.append(n,s),r.id=this._iconId,e.append(t,r),this._drawerId=this.base.generateId(),document.createElement("div"));i.id=this._drawerId,i.classList.add("shadow","inline-block","bg-white"),i.style.position="absolute",i.style.zIndex="1040";n=this.querySelector("template");n.innerHTML.length?i.innerHTML=n.innerHTML:i.append(n.firstChild),i.style.display="none",this.component=[e,i],this.base.addEvent("#"+this._buttonId,"click",this.toggleMenu);const o=document.querySelector("body");""!==o.getAttribute("flk-close-dropdown")&&(o.setAttribute("flk-close-dropdown",""),o.addEventListener("click",this.closeAllDropdownButtons)),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this);var e=document.querySelectorAll("flk-dropdown");if(!e||!e.length){const t=document.querySelector("body");t.removeAttribute("flk-close-dropdown"),t.removeEventListener("click",this.closeAllDropdownButtons)}}toggleMenu(e){const t=F(e).target;e=t._drawerId;const r=document.getElementById(e);var e="none"!==r.style.display,n=(r.style.display=e?"none":"block",t.getAttribute("drawer-width")),n=("string"==typeof t.getAttribute("right")&&(r.style.right="0px"),r.style.top=t.offsetHeight+"px",r.style.width=n||t.offsetWidth+"px",t._iconId);const s=document.getElementById(n);e?(s.childNodes[0].classList.remove("hidden"),s.childNodes[1].classList.add("hidden")):(s.childNodes[0].classList.add("hidden"),s.childNodes[1].classList.remove("hidden"))}_closeDropdown(){var e=this._drawerId;const t=document.getElementById(e);if("none"!==t.style.display){e=this._iconId;const r=document.getElementById(e);t.style.display="none",r.childNodes[0].classList.remove("hidden"),r.childNodes[1].classList.add("hidden")}}closeAllDropdownButtons(e){var t,r=F(e,"flk-dropdown").target,e=document.querySelectorAll("flk-dropdown");if(r)for(const n of e)r._buttonId!==n._buttonId&&(t=n._drawerId,"none"!==document.getElementById(t).style.display&&n._closeDropdown());else for(const s of e)s._closeDropdown()}}var t={exports:{}};let Z=e.default,Y=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||"win32"===process.platform||Z.isatty(1)&&"dumb"!==process.env.TERM||"CI"in process.env),r=(r,n,s=r)=>e=>{let t=""+e;e=t.indexOf(n,r.length);return~e?r+X(t,n,s,e)+n:r+t+n},X=(e,t,r,n)=>{var s=e.substring(0,n)+r;let i=e.substring(n+t.length);e=i.indexOf(t);return~e?s+X(i,t,r,e):s+i};e=(e=Y)=>({isColorSupported:e,reset:e?e=>`${e}`:String,bold:e?r("","",""):String,dim:e?r("","",""):String,italic:e?r("",""):String,underline:e?r("",""):String,inverse:e?r("",""):String,hidden:e?r("",""):String,strikethrough:e?r("",""):String,black:e?r("",""):String,red:e?r("",""):String,green:e?r("",""):String,yellow:e?r("",""):String,blue:e?r("",""):String,magenta:e?r("",""):String,cyan:e?r("",""):String,white:e?r("",""):String,gray:e?r("",""):String,bgBlack:e?r("",""):String,bgRed:e?r("",""):String,bgGreen:e?r("",""):String,bgYellow:e?r("",""):String,bgBlue:e?r("",""):String,bgMagenta:e?r("",""):String,bgCyan:e?r("",""):String,bgWhite:e?r("",""):String});t.exports=e(),t.exports.createColors=e;const Q="'".charCodeAt(0),ee='"'.charCodeAt(0),te="\\".charCodeAt(0),re="/".charCodeAt(0),ne="\n".charCodeAt(0),se=" ".charCodeAt(0),ie="\f".charCodeAt(0),oe="\t".charCodeAt(0),ae="\r".charCodeAt(0),le="[".charCodeAt(0),ce="]".charCodeAt(0),ue="(".charCodeAt(0),he=")".charCodeAt(0),pe="{".charCodeAt(0),de="}".charCodeAt(0),fe=";".charCodeAt(0),me="*".charCodeAt(0),ge=":".charCodeAt(0),ye="@".charCodeAt(0),ve=/[\t\n\f\r "#'()/;[\\\]{}]/g,we=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,be=/.[\r\n"'(/\\]/,_e=/[\da-f]/i;function Ce(t,e={}){let n=t.css.valueOf(),d=e.ignoreErrors,s,i,f,m,o,a,l,g,c,u,y=n.length,h=0,v=[],p=[];function w(e){throw t.error("Unclosed "+e,h)}return{back:function(e){p.push(e)},endOfFile:function(){return 0===p.length&&h>=y},nextToken:function(e){if(p.length)return p.pop();if(!(h>=y)){var t=!!e&&e.ignoreUnclosed;switch(s=n.charCodeAt(h),s){case ne:case se:case oe:case ae:case ie:for(i=h;i+=1,s=n.charCodeAt(i),s===se||s===ne||s===oe||s===ae||s===ie;);u=["space",n.slice(h,i)],h=i-1;break;case le:case ce:case pe:case de:case ge:case fe:case he:var r=String.fromCharCode(s);u=[r,r,h];break;case ue:if(g=v.length?v.pop()[1]:"",c=n.charCodeAt(h+1),"url"===g&&c!==Q&&c!==ee&&c!==se&&c!==ne&&c!==oe&&c!==ie&&c!==ae){i=h;do{if(a=!1,i=n.indexOf(")",i+1),-1===i){if(d||t){i=h;break}w("bracket")}for(l=i;n.charCodeAt(l-1)===te;)--l,a=!a}while(a);u=["brackets",n.slice(h,i+1),h,i],h=i}else i=n.indexOf(")",h+1),m=n.slice(h,i+1),-1===i||be.test(m)?u=["(","(",h]:(u=["brackets",m,h,i],h=i);break;case Q:case ee:f=s===Q?"'":'"',i=h;do{if(a=!1,i=n.indexOf(f,i+1),-1===i){if(d||t){i=h+1;break}w("string")}for(l=i;n.charCodeAt(l-1)===te;)--l,a=!a}while(a);u=["string",n.slice(h,i+1),h,i],h=i;break;case ye:ve.lastIndex=h+1,ve.test(n),i=0===ve.lastIndex?n.length-1:ve.lastIndex-2,u=["at-word",n.slice(h,i+1),h,i],h=i;break;case te:for(i=h,o=!0;n.charCodeAt(i+1)===te;)i+=1,o=!o;if(s=n.charCodeAt(i+1),o&&s!==re&&s!==se&&s!==ne&&s!==oe&&s!==ae&&s!==ie&&(i+=1,_e.test(n.charAt(i)))){for(;_e.test(n.charAt(i+1));)i+=1;n.charCodeAt(i+1)===se&&(i+=1)}u=["word",n.slice(h,i+1),h,i],h=i;break;default:h=(s===re&&n.charCodeAt(h+1)===me?(i=n.indexOf("*/",h+2)+1,0===i&&(d||t?i=n.length:w("comment")),u=["comment",n.slice(h,i+1),h,i]):(we.lastIndex=h+1,we.test(n),i=0===we.lastIndex?n.length-1:we.lastIndex-2,u=["word",n.slice(h,i+1),h,i],v.push(u)),i)}return h++,u}},position:function(){return h}}}e=t.exports;let Se=Ce,xe;const Ae={";":e.yellow,":":e.yellow,"(":e.cyan,")":e.cyan,"[":e.yellow,"]":e.yellow,"{":e.yellow,"}":e.yellow,"at-word":e.cyan,brackets:e.cyan,call:e.cyan,class:e.yellow,comment:e.gray,hash:e.magenta,string:e.green};function ke(e){let r=Se(new xe(e),{ignoreErrors:!0}),n="";for(;!r.endOfFile();){let e=r.nextToken(),t=Ae[function([e,t],r){if("word"===e){if("."===t[0])return"class";if("#"===t[0])return"hash"}if(!r.endOfFile()){t=r.nextToken();if(r.back(t),"brackets"===t[0]||"("===t[0])return"call"}return e}(e,r)];t?n+=e[1].split(/\r?\n/).map(e=>t(e)).join("\n"):n+=e[1]}return n}ke.registerInput=function(e){xe=e};e=ke;let Ee=t.exports,Le=e;class Oe extends Error{constructor(e,t,r,n,s,i){super(e),this.name="CssSyntaxError",this.reason=e,s&&(this.file=s),n&&(this.source=n),i&&(this.plugin=i),void 0!==t&&void 0!==r&&("number"==typeof t?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,Oe)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file||"",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source,r=(null==e&&(e=Ee.isColorSupported),Le&&e&&(t=Le(t)),t.split(/\r?\n/)),n=Math.max(this.line-3,0);var s=Math.min(this.line+2,r.length);let i=String(s).length,o,a;if(e){let{bold:t,gray:r,red:n}=Ee.createColors(!0);o=e=>t(n(e)),a=e=>r(e)}else o=a=e=>e;return r.slice(n,s).map((e,t)=>{var t=n+1+t;let r=" "+(" "+t).slice(-i)+" | ";return t===this.line?(t=a(r.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," "),o(">")+a(r)+e+"\n "+t+o("^")):" "+a(r)+e}).join("\n")}toString(){let e=this.showSourceCode();return e=e&&"\n\n"+e+"\n",this.name+": "+this.message+e}}var t=Oe,Me=(Oe.default=Oe,{});Me.isClean=Symbol("isClean"),Me.my=Symbol("my");const Pe={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class Re{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name;var n=e.params?this.rawValue(e,"params"):"";void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes?this.block(e,r+n):(t=(e.raws.between||"")+(t?";":""),this.builder(r+n+t,e))}beforeAfter(e,t){let r,n=(r="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose"),e.parent),s=0;for(;n&&"root"!==n.type;)s+=1,n=n.parent;if(r.includes("\n")){var i=this.raw(e,null,"indent");if(i.length)for(let e=0;e{if(n=e.raws[t],void 0!==n)return!1}),void 0===n&&(n=Pe[r]),i.rawCache[r]=n,n}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&0{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=void 0===r?this.raw(t,null,"beforeDecl"):r&&r.replace(/\S/g,""),r}rawBeforeDecl(e,t){let r;return e.walkDecls(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=void 0===r?this.raw(t,null,"beforeRule"):r&&r.replace(/\S/g,""),r}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(t){let r;return t.walk(e=>{if(e.nodes&&(e.parent!==t||t.first!==e)&&void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=r&&r.replace(/\S/g,""),r}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(r){if(r.raws.indent)return r.raws.indent;let n;return r.walk(e=>{var t=e.parent;if(t&&t!==r&&t.parent&&t.parent===r&&void 0!==e.raws.before)return t=e.raws.before.split("\n"),n=t[t.length-1],n=n.replace(/\S/g,""),!1}),n}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){var r=e[t],e=e.raws[t];return e&&e.value===r?e.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}}var Te=Re;Re.default=Re;let Ie=Te;function Be(e,t){let r=new Ie(t);r.stringify(e)}var Ne=Be;Be.default=Be;let{isClean:je,my:De}=Me,Ue=t,Fe=Te,ze=Ne;function $e(t,r){let n=new t.constructor;for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&"proxyCache"!==s){let e=t[s];var i=typeof e;"parent"===s&&"object"==i?r&&(n[s]=r):"source"===s?n[s]=e:Array.isArray(e)?n[s]=e.map(e=>$e(e,n)):("object"==i&&null!==e&&(e=$e(e)),n[s]=e)}return n}class Ge{constructor(e={}){for(var t in this.raws={},this[je]=!1,this[De]=!0,e)if("nodes"===t){this.nodes=[];for(var r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){var t;return e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)&&(t=this.source,e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)),e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(var t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=$e(this);for(var r in e)t[r]=e[r];return t}cloneAfter(e={}){e=this.clone(e);return this.parent.insertAfter(this,e),e}cloneBefore(e={}){e=this.clone(e);return this.parent.insertBefore(this,e),e}error(e,t={}){var r,n;return this.source?({end:r,start:n}=this.rangeBy(t),this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)):new Ue(e)}getProxyProcessor(){return{get(e,t){return"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t]},set(e,t,r){return e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0}}}markDirty(){if(this[je]){this[je]=!1;let e=this;for(;e=e.parent;)e[je]=!1}}next(){var e;if(this.parent)return e=this.parent.index(this),this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;return e.index?r=this.positionInside(e.index,t):!e.word||-1!==(e=(t=this.toString()).indexOf(e.word))&&(r=this.positionInside(e,t)),r}positionInside(t,e){var r=e||this.toString();let n=this.source.start.column,s=this.source.start.line;for(let e=0;e"object"==typeof e&&e.toJSON?e.toJSON(null,r):e);else if("object"==typeof t&&t.toJSON)n[s]=t.toJSON(null,r);else if("source"===s){let e=r.get(t.input);null==e&&(e=i,r.set(t.input,i),i++),n[s]={end:t.end,inputId:e,start:t.start}}else n[s]=t}return t&&(n.inputs=[...r.keys()].map(e=>e.toJSON())),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=ze){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(var s in r)n[s]=r[s];return e.warn(t,n)}get proxyOf(){return this}}var Te=Ge,He=(Ge.default=Ge,Te);class Ve extends He{constructor(e){super(e=e&&void 0!==e.value&&"string"!=typeof e.value?{...e,value:String(e.value)}:e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}}var He=Ve,We=(Ve.default=Ve,{}),Je={},qe={},Ke={},Ze="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),Ye=(Ke.encode=function(e){if(0<=e&&e>>=5)&&(t|=32),r+=Ye.encode(t),0>1,1==(1&a)?-i:i),r.rest=t};var Ke={},l=Ke,Xe=(l.getArg=function(e,t,r){if(t in e)return e[t];if(3===arguments.length)return r;throw new Error('"'+t+'" is a required argument.')},/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/),Qe=/^data:.+\,.+$/;function et(e){e=e.match(Xe);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}function tt(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}l.urlParse=et,l.urlGenerate=tt,rt=function(e){var t=e,r=et(e);if(r){if(!r.path)return e;t=r.path}for(var n,e=l.isAbsolute(t),s=[],i=0;;){if(n=i,-1===(i=t.indexOf("/",n))){s.push(t.slice(n));break}for(s.push(t.slice(n,i));in;e--){var o=r[e-1],a=r[e];if(Pt(o,a)<=0)break;r[e-1]=a,r[e]=o}else Ot(r,Pt,n)}function Tt(e,s){var t=e,e=("string"==typeof e&&(t=w.parseSourceMapInput(e)),w.getArg(t,"version")),t=w.getArg(t,"sections");if(e!=this._version)throw new Error("Unsupported version: "+e);this._sources=new Et,this._names=new Et;var i={line:-1,column:0};this._sections=t.map(function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var t=w.getArg(e,"offset"),r=w.getArg(t,"line"),n=w.getArg(t,"column");if(r=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))},p.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;var r=this._findSourceIndex(e);if(0<=r)return this.sourcesContent[r];var n,r=e;if(null!=this.sourceRoot&&(r=w.relative(this.sourceRoot,r)),null!=this.sourceRoot&&(n=w.urlParse(this.sourceRoot))){e=r.replace(/^file:\/\//,"");if("file"==n.scheme&&this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];if((!n.path||"/"==n.path)&&this._sources.has("/"+r))return this.sourcesContent[this._sources.indexOf("/"+r)]}if(t)return null;throw new Error('"'+r+'" is not in the SourceMap.')},p.prototype.generatedPositionFor=function(e){var t=w.getArg(e,"source");if((t=this._findSourceIndex(t))<0)return{line:null,column:null,lastColumn:null};t={source:t,originalLine:w.getArg(e,"line"),originalColumn:w.getArg(e,"column")},e=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",w.compareByOriginalPositions,w.getArg(e,"bias",f.GREATEST_LOWER_BOUND));if(0<=e){e=this._originalMappings[e];if(e.source===t.source)return{line:w.getArg(e,"generatedLine",null),column:w.getArg(e,"generatedColumn",null),lastColumn:w.getArg(e,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},ft.BasicSourceMapConsumer=p,(Tt.prototype=Object.create(f.prototype)).constructor=f,Tt.prototype._version=3,Object.defineProperty(Tt.prototype,"sources",{get:function(){for(var e=[],t=0;t{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(n,s=21)=>(e=s)=>{let t="",r=e;for(;r--;)t+=n[Math.random()*n.length|0];return t}};let{SourceMapConsumer:Ut,SourceMapGenerator:Ft}=We,{existsSync:zt,readFileSync:$t}=i.default,{dirname:Gt,join:Ht}=n.default;class Vt{constructor(e,t){!1!==t.map&&(this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:"),e=t.map?t.map.prev:void 0,e=this.loadMap(t.from,e),!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Gt(this.mapFile)),e&&(this.text=e))}consumer(){return this.consumerCache||(this.consumerCache=new Ut(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+t)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);var r,n;t&&(r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r),-1"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,i,o;t&&"object"==typeof t?(a=r,r="number"==typeof(l=t).offset?(t=(c=this.fromOffset(l.offset)).line,c.col):(t=l.line,l.column),o="number"==typeof a.offset?(c=this.fromOffset(a.offset),i=c.line,c.col):(i=a.line,a.column)):r||(t=(l=this.fromOffset(t)).line,r=l.col);var a,l,c=this.origin(t,r,i,o);return s=c?new Xt(e,void 0===c.endLine?c.line:{column:c.column,line:c.line},void 0===c.endLine?c.column:{column:c.endColumn,line:c.endLine},c.source,c.file,n.plugin):new Xt(e,void 0===i?t:{column:r,line:t},void 0===i?r:{column:o,line:i},this.css,this.file,n.plugin),s.input={column:r,endColumn:o,endLine:i,line:t,source:this.css},this.file&&(Jt&&(s.input.url=Jt(this.file).toString()),s.input.file=this.file),s}fromOffset(t){let n;if(this[er])n=this[er];else{var s=this.css.split("\n");n=new Array(s.length);let r=0;for(let e=0,t=s.length;e>1),t=n[i+1])){r=i;break}r=i+1}}return{col:t-n[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Kt(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let s=this.map.consumer();t=s.originalPositionFor({column:t,line:e});if(!t.source)return!1;let i;"number"==typeof r&&(i=s.originalPositionFor({column:n,line:r}));let o,a=(o=qt(t.source)?Jt(t.source):new URL(t.source,this.map.consumer().sourceRoot||Jt(this.map.mapFile)),{column:t.column,endColumn:i&&i.column,endLine:i&&i.line,line:t.line,url:o.toString()});if("file:"===o.protocol){if(!Wt)throw new Error("file: protocol is not available in this PostCSS build");a.file=Wt(o)}e=s.sourceContentFor(t.source);return e&&(a.source=e),a}toJSON(){let e={};for(var t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}}Je=nr;nr.default=nr,Yt&&Yt.registerInput&&Yt.registerInput(nr);let{SourceMapConsumer:sr,SourceMapGenerator:ir}=We,{dirname:or,relative:ar,resolve:lr,sep:cr}=n.default,ur=s.default["pathToFileURL"],hr=Je,pr=Boolean(sr&&ir),dr=Boolean(or&&lr&&ar&&cr);ft=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e,t=(e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map","\n");this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(var t of this.previous()){var r=this.toUrl(this.path(t.file)),n=t.root||or(t.file);let e;!1===this.mapOpts.sourcesContent?(e=new sr(t.text),e.sourcesContent&&(e.sourcesContent=null)):e=t.consumer(),this.map.applySourceMap(e,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let t;for(let e=this.root.nodes.length-1;0<=e;e--)t=this.root.nodes[e],"comment"===t.type&&0===t.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(e)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),dr&&pr&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,e=>{t+=e}),[t]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=ir.fromSourceMap(e)}else this.map=new ir({file:this.outputFile()}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):""});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&0",o={generated:{column:0,line:0},original:{column:0,line:0},source:""},a,l;this.stringify(this.root,(e,t,r)=>{this.css+=e,t&&"end"!==r&&(o.generated.line=n,o.generated.column=s-1,t.source&&t.source.start?(o.source=this.sourcePath(t),o.original.line=t.source.start.line,o.original.column=t.source.start.column-1):(o.source=i,o.original.line=1,o.original.column=0),this.map.addMapping(o)),a=e.match(/\n/g),a?(n+=a.length,l=e.lastIndexOf("\n"),s=e.length-l):s+=e.length,t&&"start"!==r&&(e=t.parent||{raws:{}},("decl"===t.type||"atrule"===t.type&&!t.nodes)&&t===e.last&&!e.raws.semicolon||(t.source&&t.source.end?(o.source=this.sourcePath(t),o.original.line=t.source.end.line,o.original.column=t.source.end.column-1,o.generated.line=n,o.generated.column=s-2):(o.source=i,o.original.line=1,o.original.column=0,o.generated.line=n,o.generated.column=s-1),this.map.addMapping(o)))})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;var e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:0e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;var t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?or(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=or(lr(r,this.mapOpts.annotation)));t=ar(r,e);return this.memoizedPaths.set(e,t),t}previous(){var e;return this.previousMaps||(this.previousMaps=[],this.root?this.root.walk(e=>{e.source&&e.source.input.map&&(e=e.source.input.map,this.previousMaps.includes(e)||this.previousMaps.push(e))}):(e=new hr(this.originalCSS,this.opts)).map&&this.previousMaps.push(e.map)),this.previousMaps}setSourcesContent(){let r={};var e;this.root?this.root.walk(e=>{var t;!e.source||(t=e.source.input.from)&&!r[t]&&(r[t]=!0,t=this.usesFileUrls?this.toFileUrl(t):this.toUrl(this.path(t)),this.map.setSourceContent(t,e.source.input.css))}):this.css&&(e=this.opts.from?this.toUrl(this.path(this.opts.from)):"",this.map.setSourceContent(e,this.css))}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){var t=this.memoizedFileURLs.get(e);if(t)return t;if(ur)return t=ur(e).toString(),this.memoizedFileURLs.set(e,t),t;throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){var t=this.memoizedURLs.get(e);if(t)return t;"\\"===cr&&(e=e.replace(/\\/g,"/"));t=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,t),t}};class fr extends Te{constructor(e){super(e),this.type="comment"}}Ct=fr;fr.default=fr;let{isClean:mr,my:gr}=Me,yr=He,vr=Ct,wr,br,_r,Cr;class Sr extends Te{append(...e){for(var t of e){var r;for(r of this.normalize(t,this.last))this.proxyOf.nodes.push(r)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(var t of this.nodes)t.cleanRaws(e)}each(r){if(this.proxyOf.nodes){var n=this.getIterator();let e,t;for(;this.indexes[n]t[n](...e.map(r=>"function"==typeof r?(e,t)=>r(e.toProxy(),t):r)):"every"===n||"some"===n?r=>t[n]((e,...t)=>r(e.toProxy(),...t)):"root"===n?()=>t.root().toProxy():"nodes"===n?t.nodes.map(e=>e.toProxy()):"first"===n||"last"===n?t[n].toProxy():t[n])},set(e,t,r){return e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0}}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){var r,n,s,i=this.index(e),o=this.normalize(t,this.proxyOf.nodes[i]).reverse(),i=this.index(e);for(r of o)this.proxyOf.nodes.splice(i+1,0,r);for(s in this.indexes)i<(n=this.indexes[s])&&(this.indexes[s]=n+o.length);return this.markDirty(),this}insertBefore(e,t){var r,n,s,i=this.index(e),o=this.normalize(t,this.proxyOf.nodes[i],0===i&&"prepend").reverse(),i=this.index(e);for(r of o)this.proxyOf.nodes.splice(i,0,r);for(s in this.indexes)i<=(n=this.indexes[s])&&(this.indexes[s]=n+o.length);return this.markDirty(),this}normalize(e,t){if("string"==typeof e)e=function t(e){return e.map(e=>(e.nodes&&(e.nodes=t(e.nodes)),delete e.source,e))}(wr(e).nodes);else if(void 0===e)e=[];else if(Array.isArray(e))for(var r of e=e.slice(0))r.parent&&r.parent.removeChild(r,"ignore");else if("root"===e.type&&"document"!==this.type)for(var n of e=e.nodes.slice(0))n.parent&&n.parent.removeChild(n,"ignore");else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new yr(e)]}else if(e.selector)e=[new br(e)];else if(e.name)e=[new _r(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new vr(e)]}return e.map(e=>(e[gr]||Sr.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[mr]&&function e(t){if(t[mr]=!1,t.proxyOf.nodes)for(var r of t.proxyOf.nodes)e(r)}(e),void 0===e.raws.before&&t&&void 0!==t.raws.before&&(e.raws.before=t.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}prepend(...e){for(var t of e=e.reverse()){var r,n,s=this.normalize(t,this.first,"prepend").reverse();for(r of s)this.proxyOf.nodes.unshift(r);for(n in this.indexes)this.indexes[n]=this.indexes[n]+s.length}return this.markDirty(),this}push(e){return(e.parent=this).proxyOf.nodes.push(e),this}removeAll(){for(var e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){var t,r;for(r in e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1),this.indexes)e<=(t=this.indexes[r])&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(t,r,n){return n||(n=r,r={}),this.walkDecls(e=>{r.props&&!r.props.includes(e.prop)||r.fast&&!e.value.includes(r.fast)||(e.value=e.value.replace(t,n))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(n){return this.each((t,e)=>{let r;try{r=n(t,e)}catch(e){throw t.addToError(e)}return!1!==r&&t.walk&&(r=t.walk(n)),r})}walkAtRules(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("atrule"===e.type&&r.test(e.name))return n(e,t)}):this.walk((e,t)=>{if("atrule"===e.type&&e.name===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("atrule"===e.type)return n(e,t)}))}walkComments(r){return this.walk((e,t)=>{if("comment"===e.type)return r(e,t)})}walkDecls(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("decl"===e.type&&r.test(e.prop))return n(e,t)}):this.walk((e,t)=>{if("decl"===e.type&&e.prop===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("decl"===e.type)return n(e,t)}))}walkRules(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("rule"===e.type&&r.test(e.selector))return n(e,t)}):this.walk((e,t)=>{if("rule"===e.type&&e.selector===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("rule"===e.type)return n(e,t)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}Sr.registerParse=e=>{wr=e},Sr.registerRule=e=>{br=e},Sr.registerAtRule=e=>{_r=e},Sr.registerRoot=e=>{Cr=e};i=Sr,Sr.default=Sr,Sr.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,_r.prototype):"rule"===e.type?Object.setPrototypeOf(e,br.prototype):"decl"===e.type?Object.setPrototypeOf(e,yr.prototype):"comment"===e.type?Object.setPrototypeOf(e,vr.prototype):"root"===e.type&&Object.setPrototypeOf(e,Cr.prototype),e[gr]=!0,e.nodes&&e.nodes.forEach(e=>{Sr.rebuild(e)})},ot=i;let xr,Ar;class kr extends ot{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){let t=new xr(new Ar,this,e);return t.stringify()}}kr.registerLazyResult=e=>{xr=e},kr.registerProcessor=e=>{Ar=e};e=kr;kr.default=kr;let Er={};function Lr(e){Er[e]||(Er[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))}class Or{constructor(e,t={}){for(var r in this.type="warning",this.text=e,t.node&&t.node.source&&(e=t.node.rangeBy(t),this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column),t)this[r]=t[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}St=Or;Or.default=Or;let Mr=St;class Pr{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);e=new Mr(e,t);return this.messages.push(e),e}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}}Ke=Pr;Pr.default=Pr;let Rr=i;class Tr extends Rr{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}We=Tr;Tr.default=Tr,Rr.registerAtRule(Tr);let Ir=i,Br,Nr;class jr extends Ir{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){e=super.normalize(e);if(t)if("prepend"===r)1{Br=e},jr.registerProcessor=e=>{Nr=e};n=jr;jr.default=jr,Ir.registerRoot(jr);let Dr={comma(e){return Dr.split(e,[","],!0)},space(e){return Dr.split(e,[" ","\n","\t"])},split(e,t,u){let r=[],n="",s=!1,i=0,o=!1,a="",l=!1;for(var c of e)l?l=!1:"\\"===c?l=!0:o?c===a&&(o=!1):'"'===c||"'"===c?(o=!0,a=c):"("===c?i+=1:")"===c?0"space"!==e[0]&&"comment"!==e[0])&&(s.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(s,"value",a.concat(e),t),s.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new Jr;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){var t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1;var r;let n=!1,s=null,i=[];var o=e[1].startsWith("--");let a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)s=s||l,i.push("("===r?")":"]");else if(o&&n&&"{"===r)s=s||l,i.push("}");else if(0===i.length){if(";"===r){if(n)return void this.decl(a,o);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===i[i.length-1]&&(i.pop(),0===i.length&&(s=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),0e+t[1],""),e.raws[t]={raw:o,value:l}),e[t]=l}rule(e){e.pop();let t=new Jr;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){var t;let r="";for(;e.length&&("space"===(t=e[e.length-1][0])||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){var t;let r="";for(;e.length&&("space"===(t=e[0][0])||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t="";for(;e.length&&"space"===e[e.length-1][0];)t=e.pop()[1]+t;return t}stringFrom(t,r){let n="";for(let e=r;evn(e)),e}let wn={};class bn{constructor(e,t,r){this.stringified=!1,this.processed=!1;let n;if("object"!=typeof t||null===t||"root"!==t.type&&"document"!==t.type)if(t instanceof bn||t instanceof ln)n=vn(t.root),t.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=t.map);else{let e=cn;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{n=e(t,r)}catch(e){this.processed=!0,this.error=e}n&&!n[tn]&&sn.rebuild(n)}else n=vn(t);this.result=new ln(e,n,r),this.helpers={...wn,postcss:wn,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){var r=this.result.lastPlugin;try{if(t&&t.addToError(e),"CssSyntaxError"!==(this.error=e).name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){var n=r.postcssPlugin;let e=r.postcssVersion,t=this.result.processor.version;var s=e.split("."),i=t.split(".");(s[0]!==i[0]||parseInt(s[1])>parseInt(i[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+t+", but "+n+" uses "+e+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};var e,t=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(e of this.plugins)if("object"==typeof e)for(var r in e){if(!pn[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${e.postcssPlugin}. `+`Try to update PostCSS (${this.processor.version} now).`);if(!dn[r])if("object"==typeof e[r])for(var n in e[r])"*"===n?t(e,r,e[r][n]):t(e,r+"-"+n.toLowerCase(),e[r][n]);else"function"==typeof e[r]&&t(e,r,e[r])}this.hasListener=0t(e,this.helpers)),await Promise.all(i)):await t(r,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{var e;if("object"==typeof t&&t.Once)return"document"===this.result.root.type?mn((e=this.result.root.nodes.map(e=>t.Once(e,this.helpers)))[0])?Promise.all(e):e:t.Once(this.result.root,this.helpers);if("function"==typeof t)return t(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();var e=this.result.opts;let t=nn,r=(e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify),new rn(t,this.result.root,this.result.opts));e=r.generate();return this.result.css=e[0],this.result.map=e[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(var e of this.plugins)if(mn(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[en];)e[en]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(var t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||an("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(var[r,n]of e){this.result.lastPlugin=r;let e;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(mn(e))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:s}=r;if("root"===n.type||"document"===n.type||n.parent){if(0{e[en]||this.walkSync(e)});else{var r=this.listeners[t];if(r&&this.visitSync(r,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}bn.registerPostcss=e=>{wn=e};Me=bn;bn.default=bn,un.registerLazyResult(bn),on.registerLazyResult(bn);let _n=ft,Cn=Ne,Sn=Lr,xn=Qr;const An=Ke;class kn{constructor(e,t,r){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;var e=Cn;this.result=new An(this._processor,void 0,this._opts),this.result.css=t;let n=this,s=(Object.defineProperty(this.result,"root",{get(){return n.root}}),new _n(e,void 0,this._opts,t));s.isMap()?([r,e]=s.generate(),r&&(this.result.css=r),e&&(this.result.map=e)):(s.clearAnnotation(),this.result.css=s.css)}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||Sn("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=xn;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}}ft=kn;kn.default=kn;let En=ft,Ln=Me,On=e,Mn=n;class Pn{constructor(e=[]){this.version="8.4.35",this.plugins=this.normalize(e)}normalize(e){let t=[];for(var r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return new(this.plugins.length||t.parser||t.stringifier||t.syntax?Ln:En)(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}ft=Pn;Pn.default=Pn,Mn.registerProcessor(Pn),On.registerProcessor(Pn);let Rn=He,Tn=qe,In=Ct,Bn=We,Nn=Je,jn=n,Dn=ot;function Un(e,r){if(Array.isArray(e))return e.map(e=>Un(e));let{inputs:t,...n}=e;if(t){r=[];for(var s of t){let e={...s,__proto__:Nn.prototype};e.map&&(e.map={...e.map,__proto__:Tn.prototype}),r.push(e)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>Un(e,r))),n.source){let{inputId:e,...t}=n.source;n.source=t,null!=e&&(n.source.input=r[e])}if("root"===n.type)return new jn(n);if("decl"===n.type)return new Rn(n);if("rule"===n.type)return new Dn(n);if("comment"===n.type)return new In(n);if("atrule"===n.type)return new Bn(n);throw new Error("Unknown node type: "+e.type)}qe=Un,Un.default=Un;let Fn=He,zn=Me;He=i;let $n=ft;Me=Ne,i=qe;let Gn=e;ft=St;let Hn=Ct,Vn=We;Ne=Ke,qe=Je,e=Qr,St=s;let Wn=ot,Jn=n;Ct=Te;function o(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new $n(e)}o.plugin=function(r,n){let s=!1;function i(...e){console&&console.warn&&!s&&(s=!0,console.warn(r+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(r+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let t=n(...e);return t.postcssPlugin=r,t.postcssVersion=(new $n).version,t}let e;return Object.defineProperty(i,"postcss",{get(){return e=e||i(),e}}),i.process=function(e,t,r){return o([i(r)]).process(e,t)},i},o.stringify=Me,o.parse=e,o.fromJSON=i,o.list=St,o.comment=e=>new Hn(e),o.atRule=e=>new Vn(e),o.decl=e=>new Fn(e),o.rule=e=>new Wn(e),o.root=e=>new Jn(e),o.document=e=>new Gn(e),o.CssSyntaxError=t,o.Declaration=Fn,o.Container=He,o.Processor=$n,o.Document=Gn,o.Comment=Hn,o.Warning=ft,o.AtRule=Vn,o.Result=Ne,o.Input=qe,o.Rule=Wn,o.Root=Jn,o.Node=Ct,zn.registerPostcss(o);o.default=o;class qn extends HTMLElement{base;contents;component;listType="ul";iconSet;filter={value:"",caseSensitive:!1};static get observedAttributes(){return["contents","icon-set","max-depth","filter"]}_jsonToValueArray(e){let t=JSON.stringify(e);t=t.replace(/[\[\]{}\"]/g,"");let r=[];for(const n of t.split(","))r=r.concat(n.split(":"));return[...new Set(r)]}_emit(e,t,r){e=new CustomEvent(e,{detail:r,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}constructor(){super(),this.base=new $,this.setContents(this.getAttribute("contents")),this.iconSet=this.getAttribute("icon-set")?this.getAttribute("icon-type"):"file",this.maxDepth=this.getAttribute("max-depth")?parseInt(this.getAttribute("max-depth")):-1,this.setFilter(this.getAttribute("filter")),this.style.display="block",this.style.maxWidth="fit-content",this.style.margin="0 1rem 0 0",this.base.addEvent(".flk-branch","click",this.emitNodeToggle)}emitNodeToggle(e){e.stopPropagation();const t=F(e,"flk-tree-nav").target,r=z(e,"branchKey");let n=t.contents;const s=r.split(".");for(const o of s)if(n[o])n=n[o];else{let e=[];for(const a of n)a[o]&&e.push(a[o]);n=e}var e=r.substring(r.indexOf(".")+1),i=t.createLeafText(s.reverse()[0]);t._emit("tree-click",t,{path:e,data:n,key:(i.titleText+" "+i.commentText).trim(),branch:"object"==typeof n})}convertJsonKeyToTitle(e){if(!e)return"";const t=(e="string"!=typeof e?e.toString():e).replace(/([A-Z_])/g,e=>"_"===e?" ":" "+e).trim();return t.charAt(0).toUpperCase()+t.slice(1)}setContents(e){var t=e||this.contents||[];try{switch(typeof t){case"string":this.contents=JSON.parse(t);break;case"object":Array.isArray(t)?this.contents=t:this.contents=[t]}}catch(e){console.log(e)}}applyFilter(e){let t;var r="details"===e.tagName.toLowerCase();t=this.filter.caseSensitive?e.dataset.branchValues.includes(this.filter.value):e.dataset.branchValues.toLowerCase().includes(this.filter.value.toLowerCase()),t?e.parentElement.classList.remove("hidden"):e.parentElement.classList.add("hidden"),r&&t?e.setAttribute("open",""):e.removeAttribute("open")}resetTree(e){e.parentElement.classList.remove("hidden"),e.removeAttribute("open")}filterTree(){let t=setTimeout(()=>{for(const e of this.querySelectorAll("[data-branch-values]"))void 0===this.filter.value||0===this.filter.value.length?this.resetTree(e):this.applyFilter(e);clearTimeout(t)},10)}setFilter(e){const t=e||{};try{switch(typeof t){case"string":t.includes("{")?(this.filter=JSON.parse(t),!1===this.filter.caseSensitive&&(this.filter.value=this.filter.value.toLowerCase())):this.filter.value=e.toLowerCase();break;case"object":this.filter=t}}catch(e){console.log(e)}this.filterTree()}createLeafText(e){var t,r;let n="",s="";return"string"==typeof e&&(e.includes("(")||e.includes("["))?(r=e.indexOf("("),r=-1===(t=e.indexOf("["))?r:t,n=this.convertJsonKeyToTitle(e.substring(0,r)),s=e.substring(r)):n=this.convertJsonKeyToTitle(e),{titleText:n,commentText:s}}createTextTag(n,s){n=this.createLeafText(n);if(n.commentText){let e=document.createElement("div"),t=document.createElement("span"),r=(t.innerText=n.titleText,document.createElement("small"));r.innerText=n.commentText,r.style.marginLeft="1rem",e.append(t,r),e.style.display="inline-flex",e.style.alignItems="center",s.append(e)}else s.innerText=n.titleText}createLeaf(e,t,r,n=[]){let s=document.createElement("li");s.classList.add("cursor-no-select"),s.style.marginTop="0.4rem",s.dataset.branchKey=r;const i="file"===this.iconSet?'':'';s.style.listStyleImage=`url('data:image/svg+xml,${i}')`,s.style.position="relative",s.style.left="2px";let o=document.createElement("span");r=[e].concat(n);if(o.dataset.branchValues=[...new Set(r)].join(),this.createTextTag(e,o),o.style.position="relative",o.style.top="-3px",s.append(o),t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);const i="file"===this.iconSet?G:H;e.style.listStyleImage=`url('data:image/svg+xml,${i}')`,e.append(s),t.append(e)}else t.append(s)}createBranch(r,t,n,s){if(s===this.maxDepth&&"object"==typeof r){var i,o=Array.isArray(r)?r:Object.keys(r);if("object"==typeof o[0]){let e=[];for(const d of o)e=e.concat(Object.keys(d));for(i of[...new Set(e)]){var u=document.createElement(this.listType);t.append(this.createBranch(i,u,n+"."+i,s+1))}}else for(const a of o){let e;r[a]&&(e=this._jsonToValueArray(r[a])),this.createLeaf(a,t,n,e)}}else if(Array.isArray(r))for(var e in r){var h=document.createElement(this.listType);t.append(this.createBranch(r[e],h,n+"."+e,s+1))}else if(null!==r&&"object"==typeof r){const l=[];for(const c of Object.keys(r)){let e=document.createElement("li"),t=(e.classList.add("cursor-no-select"),e.style.position="relative",e.style.left="2px",e.dataset.branchKey=n+"."+c,document.createElement("details"));t.classList.add("flk-branch"),t.dataset.branchValues=[c].concat(this._jsonToValueArray(r[c])),t.style.position="relative",t.style.top="-3px",t.classList.add("cursor-default");var p=document.createElement("summary");this.createTextTag(c,p),t.append(p),e.append(this.createBranch(r[c],t,n+"."+c,s+1)),l.push(e)}if(t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);o="file"===this.iconSet?G:H;e.style.listStyleImage=`url('data:image/svg+xml,${o}')`;for(const f of l)e.append(f);t.append(e)}else for(const m of l)t.append(m)}else console.trace({node:r,element:t,key:n}),this.createLeaf(r,t,n);return t}createHtml(){let e=document.createElement(this.listType);var t="file"===this.iconSet?G:'';if(e.style.listStyleImage=`url('data:image/svg+xml,${t}')`,e.style.marginLeft="3rem",this.contents.length){for(const r in this.contents)e=this.createBranch(this.contents[r],e,r,0);this.component=e}else this.component=e}attributeChangedCallback(e,t,r){switch(e){case"contents":this.setContents(r);break;case"icon-set":this.iconSet=r;break;case"max-depth":this.maxDepth="string"==typeof r?parseInt(r):r;break;case"filter":this.setFilter(r)}this.init()}connectedCallback(){this.init()}disconnectedCallback(){this.base.removeEvents(this)}init(){this.createHtml(),this.base.render(this)}}customElements.define("flk-table",W),customElements.define("flk-draggable",J),customElements.define("flk-modal",q),customElements.define("flk-dropdown",K),customElements.define("flk-tree-nav",qn)}(require$$0,require$$2,require$$1$1,require$$1); \ No newline at end of file diff --git a/documentation/public/cdn/ibiss-v0.0.4/avian.min.css b/documentation/public/cdn/ibiss-v0.0.4/avian.min.css new file mode 100644 index 0000000..53c6f0a --- /dev/null +++ b/documentation/public/cdn/ibiss-v0.0.4/avian.min.css @@ -0,0 +1 @@ +:root{--html-background:#faf9f8;--background:#fff;--code-background:#f3f2f1;--overlay-background:0,0,0;--color-on-black:#c8c6c4;--font-color:#323130;--shadow-color:0,0,0;--hr-color:#d2d0ce;--border-color:#8a8886;--gray-light:#edebe9;--color-on-gray-light:#000;--gray:#a19f9d;--color-on-gray:#000;--gray-dark:#605e5c;--color-on-gray-dark:#faf9f8;--gray-darker:#8a8886;--light:#d2d0ce;--black:#000;--white:#fff;--icon:#605e5c;--icon-disabled:#a19f9d;--icon-error:#a80000;--icon-success:#107c10;--icon-warning:#797673;--primary:#0078d4;--primary-hover:#0068b8;--color-on-primary:#fff;--accent:#fce100;--accent-hover:#e6cf00;--color-on-accent:#000;--danger:#d13438;--danger-hover:#bb2a2f;--color-on-danger:#fff;--warning:#fff4ce;--color-on-warning:#323130;--error:#fde7e9;--color-on-error:#323130;--success:#dff6dd;--color-on-success:#323130;--contrast:#ccc;--contrast-hover:#b2b2b2;--color-on-contrast:#000;--disabled:#d2d0ce;--color-on-disabled:#a19f9d;--button-background:#fff;--button-hover:#e1dfdd;--button-outline-color:#000;--button-color:#000;--disabled-button-background:#f3f2f1;--disabled-button-color:#a19f9d;--colored-disabled-button-color:#d2d0ce;--input-border-color:#605e5c;--input-hover:#c8c6c4;--range-track-color:#c8c6c4;--range-filled-track-color:#605e5c;--range-track-hover-color:#e0f2ff;--switch-border-color:#000;--switch-toggle-off-color:#000;--switch-toggle-on-color:#fff;--table-hover:#e1dfdd;--table-striped-hover:#d2d0ce;--table-stripe:#edebe9;--default-distance:1.5rem;--distance-0:0;--distance-1:0.5rem;--distance-2:1rem;--distance-3:1.5rem;--distance-4:2rem;--distance-5:2.5rem;--h1-font-size:3.2rem;--h2-font-size:3rem;--h3-font-size:2.8rem;--h4-font-size:2.6rem;--h5-font-size:2.4rem;--h6-font-size:2.2rem;--th-font-size:2.2rem;--paragraph-font-size:1.6rem;--label-font-size:1.6rem;--small-font-size:1.2rem;--font-weight-normal:400;--font-weight-semibold:600;--font-weight-bold:700}*,:after,:before{box-sizing:border-box;font:inherit;font-weight:var(--font-weight-normal);margin:0;padding:0}html{font-size:62.5%;hanging-punctuation:first last}body{font-family:Segoe UI,"Segoe UI Web (West European)",-apple-system,BlinkMacSystemFont,Roboto,Helvetica Neue,sans-serif;font-size:1.6rem;height:100svh;line-height:1.5;text-rendering:optimizeSpeed}h1,h2,h3,h4,h5,h6{text-wrap:balance}p{text-wrap:pretty;max-width:75ch}ol,ul{margin-left:2rem}img,picture{display:block;max-width:100%}.lucide{left:2px;position:relative;top:3px}@media (prefers-reduced-motion:reduce){html:focus-within{scroll-behavior:auto}*,:after,:before{animation-duration:.01ms;animation-iteration-count:1;scroll-behavior:auto;transition-duration:.01ms}}@media (prefers-reduced-motion:no-preference){:has(:target),html{scroll-behavior:smooth;scroll-padding-top:3rem}}h1{font-size:var(--h1-font-size)}h1,h2{font-weight:var(--font-weight-bold)}h2{font-size:var(--h2-font-size)}h3{font-size:var(--h3-font-size);font-weight:var(--font-weight-bold)}h4{font-size:var(--h4-font-size)}h4,h5{font-weight:var(--font-weight-semibold)}h5{font-size:var(--h5-font-size)}h6{font-size:var(--h6-font-size);font-weight:var(--font-weight-semibold)}p{font-size:var(--paragraph-font-size)}label{font-size:var(--label-font-size)}small{font-size:var(--small-font-size)}b,strong{font-weight:var(--font-weight-bold)}cite,em,i{font-style:italic}code:not([class*=language]),kbd{background-color:var(--code-background);border:.5px solid var(--border-color);border-radius:.2rem;bottom:.1rem;margin:0 .2rem;padding:.2rem .4rem;position:relative}mark{background-color:var(--accent)}th{font-size:var(--th-font-size);font-weight:var(--font-weight-semibold)}.font-size-68{font-size:6.8rem!important}.font-size-42{font-size:4.2rem!important}.font-size-32{font-size:3.2rem!important}.font-size-28{font-size:2.8rem!important}.font-size-24{font-size:2.4rem!important}.font-size-20{font-size:2rem!important}.font-size-18{font-size:1.8rem!important}.font-size-16{font-size:1.6rem!important}.font-size-14{font-size:1.4rem!important}.font-size-12{font-size:1.2rem!important}.font-size-10{font-size:1rem!important}.font-weight-normal{font-weight:400!important}.font-weight-semibold{font-weight:600!important}.font-weight-bold{font-weight:700!important}.align-center{align-items:center}.align-end{align-items:flex-end}.align-start{align-items:flex-start}.align-stretch{align-items:stretch}.align-between{align-content:space-between}.align-around{align-content:space-around}.align-evenly{align-content:space-evenly}.self-align-stretch{align-self:stretch}.self-align-center{align-self:center}.self-align-start{align-self:flex-start}.self-align-end{align-self:flex-end}.row{display:flex;flex-wrap:wrap}.column{display:flex;flex-direction:column}.no-wrap{flex-wrap:nowrap}.wrap-reverse{flex-wrap:wrap-reverse}.row-reverse{flex-direction:row-reverse}.column-reverse{flex-direction:column-reverse}@media (min-width:993px){.drow-reverse{flex-direction:row-reverse}.dcolumn-reverse{flex-direction:column-reverse}}@media (min-width:768px) and (max-width:992px){.trow-reverse{flex-direction:row-reverse}.tcolumn-reverse{flex-direction:column-reverse}}@media (max-width:767px){.mrow-reverse{flex-direction:row-reverse}.mcolumn-reverse{flex-direction:column-reverse}}.gap-0{gap:var(--distance-0)}.gap-1{gap:var(--distance-1)}.gap-2{gap:var(--distance-2)}.gap-3{gap:var(--distance-3)}.gap-4{gap:var(--distance-4)}.gap-5{gap:var(--distance-5)}.justify-center{justify-content:center}.justify-around{justify-content:space-around}.justify-evenly{justify-content:space-evenly}.justify-end{justify-content:flex-end}.justify-between{justify-content:space-between}.justify-start{justify-content:flex-start}.f-100{flex:1 1 100%}.f-90{flex:0 0 90%}.f-80{flex:0 0 80%}.f-75{flex:0 0 75%}.f-70{flex:0 0 70%}.f-60{flex:0 0 60%}.f-50{flex:0 0 50%}.f-33{flex:0 0 33.33%}.f-30{flex:0 0 30%}.f-25{flex:0 0 25%}.f-20{flex:0 0 20%}.f-16{flex:0 0 16.67%}.f-10{flex:0 0 10%}.f-8{flex:0 0 8.33%}.f-auto{flex:1 1 auto;max-width:fitcontent;min-width:auto;width:auto}.f-fill{flex:1;max-width:none;min-width:auto;width:100%}@media (min-width:768px) and (max-width:992px){.tf-100{flex:1 1 100%}.tf-90{flex:0 0 90%}.tf-80{flex:0 0 80%}.tf-75{flex:0 0 75%}.tf-70{flex:0 0 70%}.tf-60{flex:0 0 60%}.tf-50{flex:0 0 50%}.tf-33{flex:0 0 33.33%}.tf-30{flex:0 0 30%}.tf-25{flex:0 0 25%}.tf-20{flex:0 0 20%}.tf-16{flex:0 0 16.67%}.tf-10{flex:0 0 10%}.tf-8{flex:0 0 8.33%}.tf-auto{flex:1 1 auto;max-width:fitcontent;min-width:auto;width:auto}.tf-fill{flex:1;max-width:none;min-width:auto;width:100%}}@media (max-width:767px){.mf-100{flex:1 1 100%}.mf-90{flex:0 0 90%}.mf-80{flex:0 0 80%}.mf-75{flex:0 0 75%}.mf-70{flex:0 0 70%}.mf-60{flex:0 0 60%}.mf-50{flex:0 0 50%}.mf-33{flex:0 0 33.33%}.mf-30{flex:0 0 30%}.mf-25{flex:0 0 25%}.mf-20{flex:0 0 20%}.mf-16{flex:0 0 16.67%}.mf-10{flex:0 0 10%}.mf-8{flex:0 0 8.33%}.mf-auto{flex:1 1 auto;max-width:fitcontent;min-width:auto;width:auto}.mf-fill{flex:1;max-width:none;min-width:auto;width:100%}}.no-scroll{overflow:hidden}.text-no-wrap{white-space:nowrap}.text-normal{font-weight:400}.sticky{height:auto;position:sticky;position:-webkit-sticky;top:0;z-index:1000}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.block{display:block}.hidden{display:none}@media (min-width:768px){.mobile{display:none!important}}.tablet{display:none}@media (min-width:768px) and (max-width:992px){.tablet{display:inherit!important}}@media (max-width:992px){.desktop{display:none!important}}@media (min-width:769px){.small-screen{display:none!important}}@media (max-width:768px){.large-screen{display:none!important}}.fit-content{max-width:fit-content!important;max-width:-moz-fit-content!important}.list-style-none{list-style:none!important}.m-0{margin:var(--distance-0)!important}.ml-0{margin-left:var(--distance-0)!important}.mr-0{margin-right:var(--distance-0)!important}.mt-0{margin-top:var(--distance-0)!important}.mb-0{margin-bottom:var(--distance-0)!important}.mx-0{margin-left:var(--distance-0)!important;margin-right:var(--distance-0)!important}.m-1{margin:var(--distance-1)!important}.m-2{margin:var(--distance-2)!important}.m-3{margin:var(--distance-3)!important}.m-4{margin:var(--distance-4)!important}.m-5{margin:var(--distance-5)!important}.mx-auto{margin-left:auto!important;margin-right:auto!important}.mx-1{margin-left:var(--distance-1)!important;margin-right:var(--distance-1)!important}.mx-2{margin-left:var(--distance-2)!important;margin-right:var(--distance-2)!important}.mx-3{margin-left:var(--distance-3)!important;margin-right:var(--distance-3)!important}.mx-4{margin-left:var(--distance-4)!important;margin-right:var(--distance-4)!important}.mx-5{margin-left:var(--distance-5)!important;margin-right:var(--distance-5)!important}.my-auto{margin-bottom:auto!important;margin-top:auto!important}.my-0{margin-bottom:var(--distance-0)!important;margin-top:var(--distance-0)!important}.my-1{margin-bottom:var(--distance-1)!important;margin-top:var(--distance-1)!important}.my-2{margin-bottom:var(--distance-2)!important;margin-top:var(--distance-2)!important}.my-3{margin-bottom:var(--distance-3)!important;margin-top:var(--distance-3)!important}.my-4{margin-bottom:var(--distance-4)!important;margin-top:var(--distance-4)!important}.my-5{margin-bottom:var(--distance-5)!important;margin-top:var(--distance-5)!important}.mt-auto{margin-top:auto!important}.mt-1{margin-top:var(--distance-1)!important}.mt-2{margin-top:var(--distance-2)!important}.mt-3{margin-top:var(--distance-3)!important}.mt-4{margin-top:var(--distance-4)!important}.mt-5{margin-top:var(--distance-5)!important}.ml-auto{margin-left:auto!important}.ml-1{margin-left:var(--distance-1)!important}.ml-2{margin-left:var(--distance-2)!important}.ml-3{margin-left:var(--distance-3)!important}.ml-4{margin-left:var(--distance-4)!important}.ml-5{margin-left:var(--distance-5)!important}.mr-auto{margin-right:auto!important}.mr-1{margin-right:var(--distance-1)!important}.mr-2{margin-right:var(--distance-2)!important}.mr-3{margin-right:var(--distance-3)!important}.mr-4{margin-right:var(--distance-4)!important}.mr-5{margin-right:var(--distance-5)!important}.mb-auto{margin-bottom:auto!important}.mb-1{margin-bottom:var(--distance-1)!important}.mb-2{margin-bottom:var(--distance-2)!important}.mb-3{margin-bottom:var(--distance-3)!important}.mb-4{margin-bottom:var(--distance-4)!important}.mb-5{margin-bottom:var(--distance-5)!important}@media (min-width:768px) and (max-width:992px){.tm-0{margin:var(--distance-0)!important}.tml-0{margin-left:var(--distance-0)!important}.tmr-0{margin-right:var(--distance-0)!important}.tmt-0{margin-top:var(--distance-0)!important}.tmb-0{margin-bottom:var(--distance-0)!important}.tmx-0{margin-left:var(--distance-0)!important;margin-right:var(--distance-0)!important}.tm-1{margin:var(--distance-1)!important}.tm-2{margin:var(--distance-2)!important}.tm-3{margin:var(--distance-3)!important}.tm-4{margin:var(--distance-4)!important}.tm-5{margin:var(--distance-5)!important}.tmx-auto{margin-left:auto!important;margin-right:auto!important}.tmx-1{margin-left:var(--distance-1)!important;margin-right:var(--distance-1)!important}.tmx-2{margin-left:var(--distance-2)!important;margin-right:var(--distance-2)!important}.tmx-3{margin-left:var(--distance-3)!important;margin-right:var(--distance-3)!important}.tmx-4{margin-left:var(--distance-4)!important;margin-right:var(--distance-4)!important}.tmx-5{margin-left:var(--distance-5)!important;margin-right:var(--distance-5)!important}.tmy-auto{margin-bottom:auto!important;margin-top:auto!important}.tmy-0{margin-bottom:var(--distance-0)!important;margin-top:var(--distance-0)!important}.tmy-1{margin-bottom:var(--distance-1)!important;margin-top:var(--distance-1)!important}.tmy-2{margin-bottom:var(--distance-2)!important;margin-top:var(--distance-2)!important}.tmy-3{margin-bottom:var(--distance-3)!important;margin-top:var(--distance-3)!important}.tmy-4{margin-bottom:var(--distance-4)!important;margin-top:var(--distance-4)!important}.tmy-5{margin-bottom:var(--distance-5)!important;margin-top:var(--distance-5)!important}.tmt-auto{margin-top:auto!important}.tmt-1{margin-top:var(--distance-1)!important}.tmt-2{margin-top:var(--distance-2)!important}.tmt-3{margin-top:var(--distance-3)!important}.tmt-4{margin-top:var(--distance-4)!important}.tmt-5{margin-top:var(--distance-5)!important}.tml-auto{margin-left:auto!important}.tml-1{margin-left:var(--distance-1)!important}.tml-2{margin-left:var(--distance-2)!important}.tml-3{margin-left:var(--distance-3)!important}.tml-4{margin-left:var(--distance-4)!important}.tml-5{margin-left:var(--distance-5)!important}.tmr-auto{margin-right:auto!important}.tmr-1{margin-right:var(--distance-1)!important}.tmr-2{margin-right:var(--distance-2)!important}.tmr-3{margin-right:var(--distance-3)!important}.tmr-4{margin-right:var(--distance-4)!important}.tmr-5{margin-right:var(--distance-5)!important}.tmb-auto{margin-bottom:auto!important}.tmb-1{margin-bottom:var(--distance-1)!important}.tmb-2{margin-bottom:var(--distance-2)!important}.tmb-3{margin-bottom:var(--distance-3)!important}.tmb-4{margin-bottom:var(--distance-4)!important}.tmb-5{margin-bottom:var(--distance-5)!important}}@media (max-width:767px){.mm-0{margin:var(--distance-0)!important}.mml-0{margin-left:var(--distance-0)!important}.mmr-0{margin-right:var(--distance-0)!important}.mmt-0{margin-top:var(--distance-0)!important}.mmb-0{margin-bottom:var(--distance-0)!important}.mmx-0{margin-left:var(--distance-0)!important;margin-right:var(--distance-0)!important}.mm-1{margin:var(--distance-1)!important}.mm-2{margin:var(--distance-2)!important}.mm-3{margin:var(--distance-3)!important}.mm-4{margin:var(--distance-4)!important}.mm-5{margin:var(--distance-5)!important}.mmx-auto{margin-left:auto!important;margin-right:auto!important}.mmx-1{margin-left:var(--distance-1)!important;margin-right:var(--distance-1)!important}.mmx-2{margin-left:var(--distance-2)!important;margin-right:var(--distance-2)!important}.mmx-3{margin-left:var(--distance-3)!important;margin-right:var(--distance-3)!important}.mmx-4{margin-left:var(--distance-4)!important;margin-right:var(--distance-4)!important}.mmx-5{margin-left:var(--distance-5)!important;margin-right:var(--distance-5)!important}.mmy-auto{margin-bottom:auto!important;margin-top:auto!important}.mmy-0{margin-bottom:var(--distance-0)!important;margin-top:var(--distance-0)!important}.mmy-1{margin-bottom:var(--distance-1)!important;margin-top:var(--distance-1)!important}.mmy-2{margin-bottom:var(--distance-2)!important;margin-top:var(--distance-2)!important}.mmy-3{margin-bottom:var(--distance-3)!important;margin-top:var(--distance-3)!important}.mmy-4{margin-bottom:var(--distance-4)!important;margin-top:var(--distance-4)!important}.mmy-5{margin-bottom:var(--distance-5)!important;margin-top:var(--distance-5)!important}.mmt-auto{margin-top:auto!important}.mmt-1{margin-top:var(--distance-1)!important}.mmt-2{margin-top:var(--distance-2)!important}.mmt-3{margin-top:var(--distance-3)!important}.mmt-4{margin-top:var(--distance-4)!important}.mmt-5{margin-top:var(--distance-5)!important}.mml-auto{margin-left:auto!important}.mml-1{margin-left:var(--distance-1)!important}.mml-2{margin-left:var(--distance-2)!important}.mml-3{margin-left:var(--distance-3)!important}.mml-4{margin-left:var(--distance-4)!important}.mml-5{margin-left:var(--distance-5)!important}.mmr-auto{margin-right:auto!important}.mmr-1{margin-right:var(--distance-1)!important}.mmr-2{margin-right:var(--distance-2)!important}.mmr-3{margin-right:var(--distance-3)!important}.mmr-4{margin-right:var(--distance-4)!important}.mmr-5{margin-right:var(--distance-5)!important}.mmb-auto{margin-bottom:auto!important}.mmb-1{margin-bottom:var(--distance-1)!important}.mmb-2{margin-bottom:var(--distance-2)!important}.mmb-3{margin-bottom:var(--distance-3)!important}.mmb-4{margin-bottom:var(--distance-4)!important}.mmb-5{margin-bottom:var(--distance-5)!important}}.p-0{padding:var(--distance-0)}.pl-0{padding-left:var(--distance-0)}.pr-0{padding-right:var(--distance-0)}.pt-0{padding-top:var(--distance-0)}.pb-0{padding-bottom:var(--distance-0)}.p-1{padding:var(--distance-1)}.p-2{padding:var(--distance-2)}.p-3{padding:var(--distance-3)}.p-4{padding:var(--distance-4)}.p-5{padding:var(--distance-5)}.px-0{padding-left:var(--distance-0);padding-right:var(--distance-0)}.px-auto{padding-left:auto;padding-right:auto}.px-1{padding-left:var(--distance-1);padding-right:var(--distance-1)}.px-2{padding-left:var(--distance-2);padding-right:var(--distance-2)}.px-3{padding-left:var(--distance-3);padding-right:var(--distance-3)}.px-4{padding-left:var(--distance-4);padding-right:var(--distance-4)}.px-5{padding-left:var(--distance-5);padding-right:var(--distance-5)}.py-auto{padding-bottom:auto;padding-top:auto}.py-0{padding-bottom:var(--distance-0);padding-top:var(--distance-0)}.py-1{padding-bottom:var(--distance-1);padding-top:var(--distance-1)}.py-2{padding-bottom:var(--distance-2);padding-top:var(--distance-2)}.py-3{padding-bottom:var(--distance-3);padding-top:var(--distance-3)}.py-4{padding-bottom:var(--distance-4);padding-top:var(--distance-4)}.py-5{padding-bottom:var(--distance-5);padding-top:var(--distance-5)}.pt-auto{padding-top:auto}.pt-1{padding-top:var(--distance-1)}.pt-2{padding-top:var(--distance-2)}.pt-3{padding-top:var(--distance-3)}.pt-4{padding-top:var(--distance-4)}.pt-5{padding-top:var(--distance-5)}.pl-auto{padding-left:auto}.pl-1{padding-left:var(--distance-1)}.pl-2{padding-left:var(--distance-2)}.pl-3{padding-left:var(--distance-3)}.pl-4{padding-left:var(--distance-4)}.pl-5{padding-left:var(--distance-5)}.pr-auto{padding-right:auto}.pr-1{padding-right:var(--distance-1)}.pr-2{padding-right:var(--distance-2)}.pr-3{padding-right:var(--distance-3)}.pr-4{padding-right:var(--distance-4)}.pr-5{padding-right:var(--distance-5)}.pb-auto{padding-bottom:auto}.pb-1{padding-bottom:var(--distance-1)}.pb-2{padding-bottom:var(--distance-2)}.pb-3{padding-bottom:var(--distance-3)}.pb-4{padding-bottom:var(--distance-4)}.pb-5{padding-bottom:var(--distance-5)}@media (min-width:768px) and (max-width:992px){.tp-0{padding:var(--distance-0)}.tpl-0{padding-left:var(--distance-0)}.tpr-0{padding-right:var(--distance-0)}.tpt-0{padding-top:var(--distance-0)}.tpb-0{padding-bottom:var(--distance-0)}.tpx-0{padding-left:var(--distance-0);padding-right:var(--distance-0)}.tp-1{padding:var(--distance-1)}.tp-2{padding:var(--distance-2)}.tp-3{padding:var(--distance-3)}.tp-4{padding:var(--distance-4)}.tp-5{padding:var(--distance-5)}.tpx-auto{padding-left:auto;padding-right:auto}.tpx-1{padding-left:var(--distance-1);padding-right:var(--distance-1)}.tpx-2{padding-left:var(--distance-2);padding-right:var(--distance-2)}.tpx-3{padding-left:var(--distance-3);padding-right:var(--distance-3)}.tpx-4{padding-left:var(--distance-4);padding-right:var(--distance-4)}.tpx-5{padding-left:var(--distance-5);padding-right:var(--distance-5)}.tpy-auto{padding-bottom:auto;padding-top:auto}.tpy-0{padding-bottom:var(--distance-0);padding-top:var(--distance-0)}.tpy-1{padding-bottom:var(--distance-1);padding-top:var(--distance-1)}.tpy-2{padding-bottom:var(--distance-2);padding-top:var(--distance-2)}.tpy-3{padding-bottom:var(--distance-3);padding-top:var(--distance-3)}.tpy-4{padding-bottom:var(--distance-4);padding-top:var(--distance-4)}.tpy-5{padding-bottom:var(--distance-5);padding-top:var(--distance-5)}.tpt-auto{padding-top:auto}.tpt-1{padding-top:var(--distance-1)}.tpt-2{padding-top:var(--distance-2)}.tpt-3{padding-top:var(--distance-3)}.tpt-4{padding-top:var(--distance-4)}.tpt-5{padding-top:var(--distance-5)}.tpl-auto{padding-left:auto}.tpl-1{padding-left:var(--distance-1)}.tpl-2{padding-left:var(--distance-2)}.tpl-3{padding-left:var(--distance-3)}.tpl-4{padding-left:var(--distance-4)}.tpl-5{padding-left:var(--distance-5)}.tpr-auto{padding-right:auto}.tpr-1{padding-right:var(--distance-1)}.tpr-2{padding-right:var(--distance-2)}.tpr-3{padding-right:var(--distance-3)}.tpr-4{padding-right:var(--distance-4)}.tpr-5{padding-right:var(--distance-5)}.tpb-auto{padding-bottom:auto}.tpb-1{padding-bottom:var(--distance-1)}.tpb-2{padding-bottom:var(--distance-2)}.tpb-3{padding-bottom:var(--distance-3)}.tpb-4{padding-bottom:var(--distance-4)}.tpb-5{padding-bottom:var(--distance-5)}}@media (max-width:767px){.mp-0{padding:var(--distance-0)}.mpl-0{padding-left:var(--distance-0)}.mpr-0{padding-right:var(--distance-0)}.mpt-0{padding-top:var(--distance-0)}.mpb-0{padding-bottom:var(--distance-0)}.mpx-0{padding-left:var(--distance-0);padding-right:var(--distance-0)}.mp-1{padding:var(--distance-1)}.mp-2{padding:var(--distance-2)}.mp-3{padding:var(--distance-3)}.mp-4{padding:var(--distance-4)}.mp-5{padding:var(--distance-5)}.mpx-auto{padding-left:auto;padding-right:auto}.mpx-1{padding-left:var(--distance-1);padding-right:var(--distance-1)}.mpx-2{padding-left:var(--distance-2);padding-right:var(--distance-2)}.mpx-3{padding-left:var(--distance-3);padding-right:var(--distance-3)}.mpx-4{padding-left:var(--distance-4);padding-right:var(--distance-4)}.mpx-5{padding-left:var(--distance-5);padding-right:var(--distance-5)}.mpy-auto{padding-bottom:auto;padding-top:auto}.mpy-0{padding-bottom:var(--distance-0);padding-top:var(--distance-0)}.mpy-1{padding-bottom:var(--distance-1);padding-top:var(--distance-1)}.mpy-2{padding-bottom:var(--distance-2);padding-top:var(--distance-2)}.mpy-3{padding-bottom:var(--distance-3);padding-top:var(--distance-3)}.mpy-4{padding-bottom:var(--distance-4);padding-top:var(--distance-4)}.mpy-5{padding-bottom:var(--distance-5);padding-top:var(--distance-5)}.mpt-auto{padding-top:auto}.mpt-1{padding-top:var(--distance-1)}.mpt-2{padding-top:var(--distance-2)}.mpt-3{padding-top:var(--distance-3)}.mpt-4{padding-top:var(--distance-4)}.mpt-5{padding-top:var(--distance-5)}.mpl-auto{padding-left:auto}.mpl-1{padding-left:var(--distance-1)}.mpl-2{padding-left:var(--distance-2)}.mpl-3{padding-left:var(--distance-3)}.mpl-4{padding-left:var(--distance-4)}.mpl-5{padding-left:var(--distance-5)}.mpr-auto{padding-right:auto}.mpr-1{padding-right:var(--distance-1)}.mpr-2{padding-right:var(--distance-2)}.mpr-3{padding-right:var(--distance-3)}.mpr-4{padding-right:var(--distance-4)}.mpr-5{padding-right:var(--distance-5)}.mpb-auto{padding-bottom:auto}.mpb-1{padding-bottom:var(--distance-1)}.mpb-2{padding-bottom:var(--distance-2)}.mpb-3{padding-bottom:var(--distance-3)}.mpb-4{padding-bottom:var(--distance-4)}.mpb-5{padding-bottom:var(--distance-5)}}hr{border-color:var(--hr-color);border-style:solid;border-width:0 0 .5px;margin-bottom:var(--default-distance)}button{background-color:var(--button-background);border:.5px solid var(--border-color);border-radius:2px;padding:.6rem 1.5rem}@supports (-moz-appearance:none){button{padding:.6rem 1.5rem .9rem}}button:active,button:focus{box-shadow:0 0 0 1px var(--button-outline-color);cursor:pointer;outline:none}button.no-border{background-color:transparent!important;border:none!important}button:hover{background-color:var(--button-hover)!important;cursor:pointer}button.icon{color:var(--icon)!important;display:flex;flex-direction:column;padding:0;width:auto}button.icon:disabled{color:var(--icon-disabled)!important}button.icon:disabled:hover{background-color:transparent!important}button.primary{background-color:var(--primary)!important;border:0;color:var(--color-on-primary)!important}button.primary:hover{background-color:var(--primary-hover)!important}button.danger{background-color:var(--danger)!important;border:0;color:var(--color-on-danger)!important}button.danger:hover{background-color:var(--danger-hover)!important}button.accent{background-color:var(--accent)!important;border:0;color:var(--color-on-accent)!important}button.accent:hover{background-color:var(--accent-hover)!important}button.contrast{background-color:var(--contrast)!important;border:0;color:var(--color-on-contrast)!important}button.contrast:hover{background-color:var(--contrast-hover)!important}button.accent:active,button.accent:focus,button.contrast:active,button.contrast:focus,button.danger:active,button.danger:focus,button.primary:active,button.primary:focus{box-shadow:0 0 0 1px var(--button-outline-color)!important}button.accent.disabled,button.accent:disabled,button.contrast.disabled,button.contrast:disabled,button.danger.disabled,button.danger:disabled,button.primary.disabled,button.primary:disabled{color:var(--colored-disabled-button-color)!important;cursor:auto;outline:none}button.accent.disabled:not(.link),button.accent:disabled:not(.link),button.contrast.disabled:not(.link),button.contrast:disabled:not(.link),button.danger.disabled:not(.link),button.danger:disabled:not(.link),button.primary.disabled:not(.link),button.primary:disabled:not(.link){background-color:var(--disabled-button-background)!important;border-color:var(--disabled-button-background)!important}button.outline-hover:hover{background-color:transparent!important;outline:.5px solid var(--button-outline-color)!important}button.link{background-color:transparent!important;border:0;color:var(--primary)!important;padding:0}button.link.accent{color:var(--accent)!important}button.link.contrast{color:var(--contrast)!important}button.link.danger{color:var(--danger)!important}button.link:active,button.link:focus,button.link:hover{background-color:transparent!important;box-shadow:unset!important;text-decoration:underline!important}button.disabled,button:disabled{color:var(--disabled-button-color)!important;cursor:auto}button.disabled:not(.link):not(.icon),button:disabled:not(.link):not(.icon){background-color:var(--disabled-button-background)!important;border-color:var(--disabled-button-background)!important}button.disabled.link,button:disabled.link{color:var(--disabled-button-color)!important}button.disabled:hover,button:disabled:hover{outline:none;text-decoration:none}select{background-color:var(--background);border:.5px solid var(--input-border-color);outline:var(--primary) none 0;padding:.5rem}select:focus{border-color:var(--primary);box-shadow:inset 1px 1px 0 var(--primary),inset -1px -1px 0 var(--primary)}select:disabled{background-color:var(--disabled-button-background);border-color:var(--disabled-button-background);box-shadow:none;color:var(--disabled-button-colour);cursor:auto}input,textarea{accent-color:var(--primary);border:.5px solid var(--input-border-color);border-radius:2px;min-height:3rem;outline:0 none currentcolor;padding:0 1rem}input:focus,textarea:focus{border-color:var(--primary);box-shadow:inset 1px 1px 0 var(--primary),inset -1px -1px 0 var(--primary)}input:invalid:not([invalid=false]):not([required]),input[invalid]:not([invalid=false]),textarea:invalid:not([invalid=false]):not([required]),textarea[invalid]:not([invalid=false]){border-color:var(--danger)}input:invalid:not([invalid=false]):not([required]):focus,input:invalid:not([invalid=false]):not([required]):hover,input[invalid]:not([invalid=false]):focus,input[invalid]:not([invalid=false]):hover,textarea:invalid:not([invalid=false]):not([required]):focus,textarea:invalid:not([invalid=false]):not([required]):hover,textarea[invalid]:not([invalid=false]):focus,textarea[invalid]:not([invalid=false]):hover{box-shadow:inset 1px 1px 0 var(--danger),inset -1px -1px 0 var(--danger)}input:disabled,textarea:disabled{background-color:var(--disabled-button-background);border-color:var(--disabled-button-background);box-shadow:none;color:var(--disabled-button-color);cursor:auto}input[type=checkbox],input[type=color],input[type=file],input[type=image],input[type=radio],input[type=range],textarea[type=checkbox],textarea[type=color],textarea[type=file],textarea[type=image],textarea[type=radio],textarea[type=range]{border:none;min-height:unset;padding-left:0}input[type=checkbox]:focus-visible,input[type=radio]:focus-visible,textarea[type=checkbox]:focus-visible,textarea[type=radio]:focus-visible{outline:var(--button-outline-color) dashed .1rem;outline-offset:.1rem}input[type=button],input[type=reset],input[type=submit],textarea[type=button],textarea[type=reset],textarea[type=submit]{border:0;padding:.6rem 1.5rem}@supports (-moz-appearance:none){input[type=button],input[type=reset],input[type=submit],textarea[type=button],textarea[type=reset],textarea[type=submit]{padding:.6rem 1.5rem .9rem}}input[type=button]:hover,input[type=reset]:hover,input[type=submit]:hover,textarea[type=button]:hover,textarea[type=reset]:hover,textarea[type=submit]:hover{background-color:var(--button-hover);cursor:pointer}input[type=button]:active,input[type=button]:focus,input[type=reset]:active,input[type=reset]:focus,input[type=submit]:active,input[type=submit]:focus,textarea[type=button]:active,textarea[type=button]:focus,textarea[type=reset]:active,textarea[type=reset]:focus,textarea[type=submit]:active,textarea[type=submit]:focus{box-shadow:0 0 0 2px var(--button-outline-color);cursor:pointer;outline:none}input[type=button]:disabled,input[type=button]:hover:disabled,input[type=reset]:disabled,input[type=reset]:hover:disabled,input[type=submit]:disabled,input[type=submit]:hover:disabled,textarea[type=button]:disabled,textarea[type=button]:hover:disabled,textarea[type=reset]:disabled,textarea[type=reset]:hover:disabled,textarea[type=submit]:disabled,textarea[type=submit]:hover:disabled{background-color:var(--disabled-button-background);border-color:var(--disabled-button-background);box-shadow:none;color:var(--disabled-button-color);cursor:auto}input[type=reset],textarea[type=reset]{background-color:var(--background);border:.5px solid var(--border-color)}input[type=reset]:active,input[type=reset]:focus,textarea[type=reset]:active,textarea[type=reset]:focus{box-shadow:0 0 0 1px var(--button-outline-color);cursor:pointer;outline:none}input[type=button],input[type=submit],textarea[type=button],textarea[type=submit]{background-color:var(--primary);color:var(--color-on-primary)}input[type=button]:hover,input[type=submit]:hover,textarea[type=button]:hover,textarea[type=submit]:hover{background-color:var(--primary-hover)}input[type=color],input[type=file],input[type=range],textarea[type=color],textarea[type=file],textarea[type=range]{border:none}input[type=color]:focus,input[type=file]:focus,input[type=range]:focus,textarea[type=color]:focus,textarea[type=file]:focus,textarea[type=range]:focus{box-shadow:none;outline:var(--primary) solid 2px;outline-offset:2px}input[type=file]::-webkit-file-upload-button,input[type=file]::file-selector-button,textarea[type=file]::-webkit-file-upload-button,textarea[type=file]::file-selector-button{background-color:var(--primary);border:0;border-radius:2px;color:var(--color-on-primary);padding:.6rem 1.5rem}input[type=file]:active::-webkit-file-upload-button,input[type=file]:active::file-selector-button,textarea[type=file]:active::-webkit-file-upload-button,textarea[type=file]:active::file-selector-button{box-shadow:inset 0 0 0 2px var(--button-outline-color)}input[type=file]:hover::-webkit-file-upload-button,input[type=file]:hover::file-selector-button,textarea[type=file]:hover::-webkit-file-upload-button,textarea[type=file]:hover::file-selector-button{background-color:var(--primary-hover);cursor:pointer}input[type=file]:focus,textarea[type=file]:focus{outline:var(--button-outline-color) solid .2rem;outline-offset:.1rem}input[type=color],textarea[type=color]{background-color:transparent;padding:0;width:8rem}input[type=range],textarea[type=range]{appearance:none;-webkit-appearance:none;background:transparent;padding:0}input[type=range]::-moz-range-thumb,textarea[type=range]::-moz-range-thumb{background:var(--background);border:2px solid var(--range-filled-track-color);border-radius:100px;height:1.2rem;width:1.2rem}input[type=range]::-moz-range-track,textarea[type=range]::-moz-range-track{background-color:var(--range-track-color);height:.3rem}input[type=range]::-moz-range-progress,textarea[type=range]::-moz-range-progress{background-color:var(--range-filled-track-color);height:.3rem}input[type=range]::-webkit-slider-thumb,textarea[type=range]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;background:var(--background);border:2px solid var(--range-filled-track-color);border-radius:100px;height:1.6rem;margin-top:-6px;width:1.6rem}input[type=range]::-webkit-slider-runnable-track,textarea[type=range]::-webkit-slider-runnable-track{background:var(--range-track-color);border:none;border-radius:3px;height:3px}input[type=range]:focus,input[type=range]:hover,textarea[type=range]:focus,textarea[type=range]:hover{background:transparent;outline:none}input[type=range]:focus::-moz-range-progress,input[type=range]:hover::-moz-range-progress,textarea[type=range]:focus::-moz-range-progress,textarea[type=range]:hover::-moz-range-progress{background-color:var(--primary)}input[type=range]:focus::-moz-range-thumb,input[type=range]:hover::-moz-range-thumb,textarea[type=range]:focus::-moz-range-thumb,textarea[type=range]:hover::-moz-range-thumb{border:2px solid var(--primary)}input[type=range]:focus::-webkit-slider-runnable-track,input[type=range]:hover::-webkit-slider-runnable-track,textarea[type=range]:focus::-webkit-slider-runnable-track,textarea[type=range]:hover::-webkit-slider-runnable-track{background-color:var(--primary)}input[type=range]:focus::-webkit-slider-thumb,input[type=range]:hover::-webkit-slider-thumb,textarea[type=range]:focus::-webkit-slider-thumb,textarea[type=range]:hover::-webkit-slider-thumb{border:2px solid var(--primary)}input[type=range]:disabled:focus,input[type=range]:disabled:hover,textarea[type=range]:disabled:focus,textarea[type=range]:disabled:hover{background:transparent;outline:none}input[type=range]:disabled:focus::-moz-range-progress,input[type=range]:disabled:hover::-moz-range-progress,textarea[type=range]:disabled:focus::-moz-range-progress,textarea[type=range]:disabled:hover::-moz-range-progress{background-color:var(--range-filled-track-color)}input[type=range]:disabled:focus::-moz-range-thumb,input[type=range]:disabled:hover::-moz-range-thumb,textarea[type=range]:disabled:focus::-moz-range-thumb,textarea[type=range]:disabled:hover::-moz-range-thumb{border:2px solid var(--range-filled-track-color)}input[type=range]:disabled:focus::-webkit-slider-runnable-track,input[type=range]:disabled:hover::-webkit-slider-runnable-track,textarea[type=range]:disabled:focus::-webkit-slider-runnable-track,textarea[type=range]:disabled:hover::-webkit-slider-runnable-track{background-color:var(--range-filled-track-color)}input[type=range]:disabled:focus::-webkit-slider-thumb,input[type=range]:disabled:hover::-webkit-slider-thumb,textarea[type=range]:disabled:focus::-webkit-slider-thumb,textarea[type=range]:disabled:hover::-webkit-slider-thumb{border:2px solid var(--range-filled-track-color)}input.underline,textarea.underline{background-color:transparent;border-left:0;border-radius:0;border-right:0;border-top:0;padding:0}input.underline:focus,textarea.underline:focus{box-shadow:none}input.underline:focus,input.underline:hover,textarea.underline:focus,textarea.underline:hover{border-color:var(--primary);box-shadow:inset 0 -1px 0 var(--primary)}input.underline:disabled:focus,input.underline:disabled:hover,input.underline:invalid:not([invalid=false]):not([required]):focus,input.underline:invalid:not([invalid=false]):not([required]):hover,textarea.underline:disabled:focus,textarea.underline:disabled:hover,textarea.underline:invalid:not([invalid=false]):not([required]):focus,textarea.underline:invalid:not([invalid=false]):not([required]):hover{border-left:0;border-right:0;border-top:0;box-shadow:none}input.underline:invalid:not([invalid=false]):not([required]):focus,input.underline:invalid:not([invalid=false]):not([required]):hover,input.underline[invalid]:not([invalid=false]):focus,input.underline[invalid]:not([invalid=false]):hover,textarea.underline:invalid:not([invalid=false]):not([required]):focus,textarea.underline:invalid:not([invalid=false]):not([required]):hover,textarea.underline[invalid]:not([invalid=false]):focus,textarea.underline[invalid]:not([invalid=false]):hover{border-color:var(--danger);box-shadow:inset 0 -1px 0 var(--danger)}input.underline:disabled:focus,input.underline:disabled:hover,textarea.underline:disabled:focus,textarea.underline:disabled:hover{border-color:var(--disabled-button-background)}a{color:var(--primary)}a:active,a:focus,a:focus-visible,a:hover{outline:unset}a.accent{color:var(--accent)}a.danger{color:var(--danger)}a.contrast{color:var(--contrast)}a.button{background-color:transparent;border-radius:2px;color:var(--button-color);display:inline-block;padding:.9rem 1.5rem;text-align:center;text-decoration:none}a.button.normal{border:.5px solid var(--border-color)}a.button.normal.disabled{background-color:var(--disabled-button-background);border-color:var(--disabled-button-background);color:var(--disabled-button-color);cursor:default}a.button:hover{background-color:var(--button-hover);cursor:pointer}a.button:active,a.button:focus{box-shadow:0 0 0 1px var(--button-outline-color);cursor:pointer;outline:none}a.button.primary{background-color:var(--primary);border:0;color:var(--color-on-primary)}a.button.primary:hover{background-color:var(--primary-hover)}a.button.danger{background-color:var(--danger);border:0;color:var(--color-on-danger)}a.button.danger:hover{background-color:var(--danger-hover)}a.button.accent{background-color:var(--accent);border:0;color:var(--color-on-accent)}a.button.accent:hover{background-color:var(--accent-hover)}a.button.contrast{background-color:var(--contrast);border:0;color:var(--color-on-contrast)}a.button.contrast:hover{background-color:var(--contrast-hover)}a.button.accent:active,a.button.accent:focus,a.button.contrast:active,a.button.contrast:focus,a.button.danger:active,a.button.danger:focus,a.button.primary:active,a.button.primary:focus{box-shadow:0 0 0 2px var(--button-outline-color)}a.button.accent.disabled,a.button.contrast.disabled,a.button.danger.disabled,a.button.primary.disabled{background-color:var(--disabled-button-background);border-color:var(--disabled-button-background);color:var(--colored-disabled-button-color);cursor:default}table{border-collapse:collapse}table td,table th{padding:.5rem 2.5rem .6rem .5rem;text-align:left;vertical-align:top}table:not(.no-hover) tbody tr:hover{background-color:var(--table-hover)}table.table tbody tr,table.table thead{border-bottom:.5px solid var(--border-color)}table.table tbody tr{border-color:var(--light)}table.table tfoot{font-size:small;font-style:italic}table.sticky-header>thead{background-color:var(--background);border-bottom:0;-webkit-box-shadow:0 1px 4px 0 rgba(var(--shadow-color),.16),0 1px 4px 0 rgba(var(--shadow-color),.12);box-shadow:0 1px 4px 0 rgba(var(--shadow-color),.16),0 1px 4px 0 rgba(var(--shadow-color),.12);position:sticky;position:-webkit-sticky;top:0;white-space:nowrap;z-index:2}table.striped tbody tr:nth-child(odd){background-color:var(--table-stripe)}table.striped tbody tr:hover{background-color:var(--table-striped-hover)}.table-container{border:.5px solid var(--border-color);border-color:var(--light);display:inline-block;overflow-x:hidden;overflow-y:auto;width:fit-content}@-moz-document url-prefix(){.table-container{padding-right:1.7rem}}.cursor-not-allowed:hover{cursor:not-allowed!important}.cursor-pointer{-webkit-user-select:none;-ms-user-select:none;user-select:none}.cursor-pointer:hover{cursor:pointer!important}.cursor-grab:hover{cursor:grab!important}.cursor-grabbing:hover{cursor:grabbing!important}.cursor-zoom-in:hover{cursor:zoom-in!important}.cursor-zoom-out:hover{cursor:zoom-out!important}.cursor-wait:hover{cursor:wait!important}.cursor-help:hover{cursor:help!important}.cursor-default,.cursor-default:hover{cursor:default!important}.cursor-no-select{-webkit-user-select:none!important;-ms-user-select:none!important;user-select:none!important}.border{border:.5px solid var(--border-color)}.border-bottom{border-bottom:.5px solid var(--border-color)}.border-top{border-top:.5px solid var(--border-color)}.border-right{border-right:.5px solid var(--border-color)}.border-left{border-left:.5px solid var(--border-color)}.border-black{border-color:var(--black)}.border-white{border-color:var(--white)}.border-primary{border-color:var(--primary)}.border-accent{border-color:var(--accent)}.border-danger{border-color:var(--danger)}.border-light{border-color:var(--light)}.border-success{border-color:var(--icon-success)}html{background-color:var(--html-background)!important}.bg-gray-light{background-color:var(--gray-light)!important;color:var(--color-on-gray-light)!important}.bg-gray{background-color:var(--gray)!important;color:var(--color-on-gray)!important}.bg-gray-dark{background-color:var(--gray-dark)!important;color:var(--color-on-gray-dark)!important}.bg-black{background-color:var(--black)!important;color:var(--color-on-black)!important}.bg-white{background-color:var(--white)!important;color:var(--font-color)!important}.bg-primary{background-color:var(--primary)!important;color:var(--color-on-primary)!important}.bg-accent{background-color:var(--accent)!important;color:var(--color-on-accent)!important}.bg-danger{background-color:var(--danger)!important;color:var(--color-on-danger)!important}.bg-success{background-color:var(--success)!important;color:var(--color-on-success)!important}.bg-error{background-color:var(--error)!important;color:var(--color-on-error)!important}.bg-warning{background-color:var(--warning)!important;color:var(--color-on-warning)!important}.bg-transparent{background-color:transparent!important}.text-black{color:var(--black)!important}.text-white{color:var(--white)!important}.text-gray{color:var(--gray-darker)!important}.text-primary{color:var(--primary)!important}.text-accent{color:var(--accent)!important}.text-danger{color:var(--danger)!important}.text-success{color:var(--icon-success)!important}.icon-gray{color:var(--gray)!important}.icon-gray-dark{color:var(--gray-dark)!important}.icon-success{color:var(--icon-success)!important}.icon-primary{color:var(--primary)!important}.icon-accent{color:var(--accent)!important}.icon-danger{color:var(--danger)!important}.icon-black{color:var(--black)!important}.icon-white{color:var(--white)!important}.shadow{box-shadow:0 .6px 3.6px 0 rgba(var(--shadow-color),.132),0 .3px .9px 0 rgba(var(--shadow-color),.108)!important}.shadow-top{box-shadow:0 -1.6px 3.6px 0 rgba(var(--shadow-color),.132),0 -.3px .9px 0 rgba(var(--shadow-color),.108)!important}.shadow-left{box-shadow:-1.6px 0 3.6px 0 rgba(var(--shadow-color),.132),.3px 0 .9px 0 rgba(var(--shadow-color),.108)!important}.shadow-right{box-shadow:1.6px 0 3.6px 0 rgba(var(--shadow-color),.132),-.3px 0 .9px 0 rgba(var(--shadow-color),.108)!important}.shadow-bottom{box-shadow:0 1.6px 3.6px 0 rgba(var(--shadow-color),.132),0 .3px .9px 0 rgba(var(--shadow-color),.108)!important}.shadow-lg{box-shadow:0 0 5px 0 rgba(var(--shadow-color),.132)!important}.shadow-top-lg{box-shadow:0 -3px 5px 0 rgba(var(--shadow-color),.132)!important}.shadow-bottom-lg{box-shadow:0 3px 5px 0 rgba(var(--shadow-color),.132)!important}.shadow-left-lg{box-shadow:-3px 0 5px 0 rgba(var(--shadow-color),.132)!important}.shadow-right-lg{box-shadow:3px 0 5px 0 rgba(var(--shadow-color),.132)!important} \ No newline at end of file diff --git a/documentation/public/cdn/ibiss-v0.0.4/flightkit.min.js b/documentation/public/cdn/ibiss-v0.0.4/flightkit.min.js new file mode 100644 index 0000000..a5a8ef8 --- /dev/null +++ b/documentation/public/cdn/ibiss-v0.0.4/flightkit.min.js @@ -0,0 +1 @@ +!function(e,n,s,i){"use strict";function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a,u,g,e=c(e),n=c(n),s=c(s),i=c(i);(t=a=a||{}).Date="date",t.String="string",t.Float="float",t.Number="number",t.Array="array",t.Object="object",t.Bool="bool",t.Currency="currency",t.Undefined="undefined",t.Null="null";const h={date:/^(\d{1,4}-\d{1,4}-\d{1,4}(T)?)/gim,currency:/^[$|€]\s?[0-9]*(\.|,)?\d*(\.|,)?\d*/gim,float:/\d+[,|.]\d+[,|.]?\d*/gim,currencySign:/\$|€/gim,array:/^\s?[[].[^,]+[\]],?/gi,precision:/[-+$€,.]/gm,string:/[a-zA-Z]/gim},m=e=>{return null===e||"null"===e?a.Null:e||0===e||!1===e?null===new RegExp(h.date).exec(e)||isNaN(Date.parse(e))?new RegExp(h.currency).exec(e)?a.Currency:!new RegExp(h.string).exec(e)&&new RegExp(h.float).exec(e.toString())?a.Float:isNaN(e)&&0!==e?Array.isArray(e)?a.Array:"object"==typeof e?a.Object:a.String:a.Number:a.Date:a.Undefined},y=(t,e)=>{const r={value:void 0,type:e=e||m(t),currencySign:""};switch(r.type){case a.String:r.value=t.toString();break;case a.Float:case a.Currency:var n=(t=t.toString()).match(new RegExp(/(,)/gim)),s=t.match(new RegExp(/(\.)/gim));if(n)for(let e=1;e<=n.length;e++)t=e!==n.length||s?t.replace(",",""):t.replace(",",".");if(r.type===a.Currency){const o=new RegExp(h.currencySign);var i=o.exec(t);r.currencySign=null!==i?i[0]:"",t=t.replace(o,"")}r.value=parseFloat(t).toPrecision(12);break;case a.Number:r.value=Number(t);break;case a.Date:r.value=Date.parse(t);break;case a.Array:t.length?"object"==typeof t[0]?r.value=t.map(e=>JSON.stringify(e)).join(", "):r.value=t.join(", "):r.value="";break;case a.Object:r.value=t;break;case a.Undefined:r.value="";break;case a.Null:r.value=null}return r};function v(e,t){var r;let n;for(r of e.split("."))r=r.trim(),n?"object"!=typeof n||Array.isArray(n)||(n=n[r]):n=t[r];return n}const b=(e,t)=>tet<=e,S=(e,t)=>e<=t,x=(e,t,r)=>r?e.toLowerCase()==t.toLowerCase():e==t,A=(e,t)=>e===t,k=(e,t)=>e!=t,E=(e,t)=>e!==t,L=(e,t)=>null!=t&&"string"==typeof e&&0<=e.toLowerCase().indexOf(t.toString().toLowerCase()),O=(e,t)=>null!=t&&0<=e.toString().toLowerCase().indexOf(t.toString().toLowerCase()),M=(e,t)=>null!=t&&"string"==typeof e&&e.toLowerCase().indexOf(t.toString().toLowerCase())<0;function P(r,n){if(0===n.length)return r;{var s=r;const o=[],a=[];let e=[];for(const l of n)l.type&&l.type!==u.And?(e.length&&a.push(e),e=[l]):e.push(l);a.push(e);let t=[];for(const e of a)t=t.concat(R(s,e));t=[...new Set(t)];var i=s.length;for(let e=0;e":return b;case"<":return _;case">=":return C;case"<=":return S;case"is":case"==":return x;case"!is":case"!=":return k;case"===":return A;case"!==":return E;case"like":case"~":case"contains":return L;case"!contains":case"!like":case"!~":return M;default:return O}}(a.operator);if(!l(i,o,a.ignoreCase)){e=!1;break}}e&&r.push(n)}return r};function T(e,t){if(!t||0===t.length)return e;if(1{if(0===r.length)r=r.concat(I(s,e));else{for(const t of r)n=n.concat(I(t,e));r=n,n=[]}}),r}return I(e,t[0])}function I(e,t){const r=[],n=[];do{if(!e||0===e.length)break;var s=e.shift();if(!s)break;const o=s[t];var i=n.indexOf(o.toString());0<=i?r[i].push(s):(n.push(o.toString()),void 0!==r[n.length-1]?r[n.length-1].push(s):r.push([s]))}while(0{if(t){var r=e;const n={};for(const s of t){let e=r.map(e=>e[s].toString());const i=e.map(e=>m(e));i.some(e=>e===a.Float)?(e=e.map(e=>parseFloat(e)),n[s]=parseFloat(e.reduce((e,t)=>e+t).toFixed(2))):(e=e.map(e=>parseInt(e)),n[s]=e.reduce((e,t)=>e+t))}return n}return{}};class D{model;sortDetails=[];filterDetails=[];selection=[];groupByProperties=[];distinctProperties=[];concatenationToken=", ";constructor(e){this.model=JSON.parse(JSON.stringify(e))}sort(e){return this.sortDetails=e,this}orderBy(e,t){return this.sortDetails.push({propertyName:e,direction:t}),this}thenOrderBy(e,t){return this.orderBy(e,t)}filter(e){return Array.isArray(e)?this.filterDetails=e:this.filterDetails.push(e),this}where(e,t,r,n,s){return this.filterDetails.push({propertyName:e,operator:t,value:r,type:n,ignoreCase:s}),this}andWhere(e,t,r,n){return this.where(e,t,r,u.And,n),this}orWhere(e,t,r,n){return this.where(e,t,r,u.Or,n),this}group(e){return this.groupByProperties=e,this}groupBy(e){return this.groupByProperties.push(e),this}thenGroupBy(e){return this.groupByProperties.push(e),this}select(e){return Array.isArray(e)?this.selection=e:"*"!==e&&(this.selection=[e]),this}distinct(e,t){return t&&(this.concatenationToken=t),Array.isArray(e)?this.distinctProperties=e:e&&(this.distinctProperties=[e]),this}execute(){return T(function(t,r){if(0===r.length)return t;{var n=r;let e=[];for(const s of t){const i={};for(const o of n)i[o]=s[o];e.push(i)}return e}}(function(r,n,u){if(!n||!n.length)return r;const s=[],h=[];for(const f of r){const o={};let t="";for(const e of n){var p=v(e,f);o[e]=p,t+=p}if(!h.includes(t)){let e=r;for(const a of Object.keys(o))e=e.filter(e=>e[a]===o[a]);h.push(t),s.push(e)}}const t=[];for(const m of s){let e={};for(const l of m){var i,d=Object.keys(e);if(d.length)for(const c of d)n.includes(c)||(i=e[c],Array.isArray(i)?(i=l[c],Array.isArray(i)?e[c]=[...new Set(...e[c].concat(l[c]))]:e[c].includes(l[c])||e[c].push(l[c])):isNaN(e[c])&&isNaN(l[c])?e[c]!==l[c]&&(e[c]=[e[c],l[c]]):e[c]=e[c]+l[c]);else e=l}t.push(e)}return t.forEach(e=>{for(const t in e)Array.isArray(e[t])&&(e[t]=e[t].join(u))}),t}(B(P(JSON.parse(JSON.stringify(this.model)),this.filterDetails),this.sortDetails),this.distinctProperties,this.concatenationToken),this.selection),this.groupByProperties)}sum(e,t){e=Array.isArray(e)?e:[e];return j(t||this.model,e)}}function U(e,t){t=t?t.toUpperCase():"FLK-";return e.toUpperCase().includes(t)}function F(e,t){var{timeStamp:r,type:n,x:s,y:i}=e;let o=e.target;do{if(!o||"HTML"===o.tagName||U(o.tagName,t)){"HTML"===o.tagName&&(o=null);break}}while(o=o.parentNode||o.parentElement,!U(o.tagName,t));return{target:o,timeStamp:r,type:n,x:s,y:i}}function z(e,t){let r=e.target,n="";for(;r.dataset[t]?n=r.dataset[t]:r=r.parentNode,!n;);return n}class ${constructor(){}_topLevelClasses=[];_events=[];generateId(){return"flk-"+function e(){const t=([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)),r=t.split("-")[0];return window.$flightkitUUIDStore||(window.$flightkitUUIDStore=[]),window.$flightkitUUIDStore.some(e=>e===r)?e():(window.$flightkitUUIDStore.push(r),r)}()}render(t){if(!t.component)throw new Error("Component is not assigned! Can't render");t.id=t.id||this.generateId();var e=this._getAllEventAttributes(t);if(e){var r="#"+t.id;for(const i of e){var n="e-"+i;this.addEvent(r,i,t.getAttribute(n))}}var s=Object.keys(t.classList).length;if(s){for(let e=0;e{this._assignToDom(t,t.component),clearTimeout(this._renderTimer)},10)}addEvent(e,t,r){this._events.push({selector:e,eventType:t,callback:r})}_getExternalCallback(e){let t=void 0;for(const r of e.split("."))t=(t||window)[r];return t}_getAllEventAttributes(e){e=e.attributes;const t=Array.from(e).filter(e=>e.name.startsWith("e-"));return t.map(e=>e.name.slice(2))}_isFlightkitElement(e){return e.toUpperCase().includes("FLK-")}_outerEventHandler(e){const t=F(e),r=(t.contents=e.detail,t.target.getAttribute("e-"+t.type));let n=void 0;for(const s of r.split("."))n=(n||window)[s];return e.preventDefault(),e.stopPropagation(),n(t)}_addEvents(e){if(e.isConnected)for(const r of this._events)if(r.selector.startsWith("."))for(const n of document.querySelectorAll(r.selector))this._addEventToElement(r,n);else{var t=document.querySelector(r.selector);this._addEventToElement(r,t)}}_addEventToElement(e,t){t&&("function"==typeof e.callback?(t.removeEventListener(e.eventType,e.callback),t.addEventListener(e.eventType,e.callback)):(t.removeEventListener(e.eventType,this._outerEventHandler),t.addEventListener(e.eventType,this._outerEventHandler)))}removeEvents(){for(const t of this._events)if(t.selector.startsWith("."))for(const r of document.querySelectorAll(t.selector))this._addEventToElement(t,r);else{var e=document.querySelector(t.selector);this._addEventToElement(t,e)}this._events=[]}_removeEventToElement(e,t){t&&("function"==typeof e.callback?t.removeEventListener(e.eventType,e.callback):t.removeEventListener(e.eventType,this._outerEventHandler))}_assignToDom(e,t){e.innerHTML="";for(const n of Array.isArray(t)?t:[t])e.append(n);const r=setTimeout(()=>{this._addEvents(e),clearTimeout(r)},10)}}const G='',H='';function V(e){const t=new DOMParser;return t.parseFromString(e,"image/svg+xml").documentElement}class W extends HTMLElement{base;component=null;_contents=[];_orderBy=[];properties=new Set;_columnOrder=[];_filter="";_selectionProperty="";_selectedIds=new Set;uniqueEntriesByProperties={};propertyLabelDictionary={};_templates={};_templateClasses={};static get observedAttributes(){return["contents","columns","order","filter","selection-property","templates"]}get columnOrder(){return this._columnOrder.length?this._columnOrder:this.properties}set columnOrder(e){let t;"string"==typeof e&&(t=e.split(",")),t=e,this._columnOrder=t}get contents(){return this._contents}set contents(e){this.analyzeData(e),this._contents=new D(e)}get orderBy(){return this._orderBy}set orderBy(e){if(Array.isArray(e))this._orderBy=e;else{const n=[];for(const s of e.split(",")){var t=s.split("|"),r=t[0],t=1e[r._selectionProperty])):new Set;e=t?r.contents.execute():[];r._emit("select",r,{selection:e}),r._updateCheckboxes(r)}emitSelect(e){var t=e.target.checked,r=e.target.dataset.objectId;const n=F(e).target,s=(t?n._selectedIds.add(r):n._selectedIds.delete(r),n._selectionProperty);e=n.contents.execute().filter(e=>n._selectedIds.has(e[s]));n._emit("select",n,{selection:e}),n._updateCheckboxes(n)}sortData(e){const t=F(e).target,r=z(e,"column");r&&(-1<(e=t._orderBy.findIndex(e=>e.propertyName===r))?"asc"===t._orderBy[e].direction?t._orderBy[e].direction="desc":t._orderBy.splice(e,1):t._orderBy.push({propertyName:r,direction:"asc"}),t.createHtml(),t.base.render(t))}setColumnOrder(e){this._columnOrder=e?Array.isArray(e)?e:e.split(","):[]}analyzeData(t){this.properties=new Set;var r=t.length;for(let e=0;e"_"===e?" ":" "+e.toLowerCase()).trim();var r=t.charAt(0).toUpperCase()+t.slice(1);return this.propertyLabelDictionary[e]=r}parseTemplate(e,n){return e.replace(/\{\{([\s\S]+?)\}\}/gim,(e,t)=>{let r="";t=t.trim();t=n[t];return t&&(r=t),Array.isArray(r)?r.join(", "):r.toString().trim()})}createSelectionCheckbox(e){const t=document.createElement("input");return t.setAttribute("type","checkbox"),t.classList.add("flk-selection-checkbox"),e&&(t.dataset.selected=e[this._selectionProperty]),t}createRow(e){const t=document.createElement("tr");if(this._selectionProperty.length){const s=document.createElement("td");var r=this.base.generateId();const i=this.createSelectionCheckbox(e);i.id=r,i.dataset.objectId=e[this._selectionProperty];var n=e[this._selectionProperty];this._selectedIds.has(n)?i.checked=!0:i.checked=!1,this.base.addEvent("#"+r,"change",this.emitSelect),s.append(i),t.append(s)}for(const o of this.columnOrder){const a=document.createElement("td");this._templates[o]?(a.innerHTML=this.parseTemplate(this._templates[o],e),this._templateClasses[o]&&a.classList.add(...this._templateClasses[o])):a.innerText=e[o],t.append(a)}return t}createBody(e){const t=document.createElement("tbody");for(const n of e){var r=this.createRow(n,null);t.append(r)}return t}createHead(){const e=document.createElement("thead"),t=document.createElement("tr");if(t.classList.add("cursor-pointer"),this._selectionProperty.length){const s=document.createElement("th");var r=this.base.generateId();const i=this.createSelectionCheckbox();i.id=r;var u=this.contents.execute().length;0e.propertyName===o);if(n){const c=document.createElement("span");c.innerHTML="asc"===n.direction?'':'',a.append(c)}t.append(a)}return e.append(t),e}addEvent(e,t,r){this.base.addEvent(e,t,r)}init(){this.createHtml(),this.base.render(this)}}class J extends HTMLElement{base;componentId;constructor(){super(),this.base=new $}connectedCallback(){var e=this.getAttribute("top"),t=this.getAttribute("left"),r=this.getAttribute("center"),n=this.getAttribute("zIndex");this.id||(this.id=this.base.generateId()),this.style.display="block",this.style.position="fixed","string"==typeof r?(this.style.top=e||"50%",this.style.left="50%",this.style.transform="translate(-50%, -50%)"):(this.style.top=e||this.clientTop+"px",this.style.left=t||this.clientLeft+"px"),n&&(this.style.zIndex=n),this.componentId=this.getAttribute("handle");const s=document.createElement("div");s.innerHTML=this.innerHTML,this.component=s;r="#"+(this.componentId||this.id);this.base.addEvent(r,"mousedown",this._dragElement),this.base.addEvent(r,"mouseup",this._reset),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this)}_dragElement(e){const r=F(e,"flk-draggable").target;let n,s;function t(e){n=e.clientX-r.offsetLeft,s=e.clientY-r.offsetTop}function i(e){var t=e.clientX-n,e=e.clientY-s;r.style.left=t+"px",r.style.top=e+"px"}function o(e){e.preventDefault()}function a(){r.removeAttribute("draggable"),r.removeEventListener("dragstart",t),r.removeEventListener("dragend",a),document.removeEventListener("dragover",o),document.removeEventListener("drop",i)}r.setAttribute("draggable",!0),r.addEventListener("dragstart",t),r.addEventListener("dragend",a),document.addEventListener("dragover",o),document.addEventListener("drop",i)}}class q extends HTMLElement{_id;base;_draggableId;constructor(){super(),this.base=new $}_emit(e,t,r){e=new CustomEvent(e,{detail:r,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}_closeModal(e){e.stopPropagation();const t=F(e,"flk-modal").target;t.classList.add("hidden")}closeModal(e){this.classList.add("hidden")}openModal(e=!0){const t=document.getElementById(this._draggableId);e&&(t.style.top="40%",t.style.left="50%"),this.classList.remove("hidden")}connectedCallback(){this.id||(this.id=this.base.generateId());const e=document.createElement("div");var t=this.base.generateId();const r=document.createElement("flk-draggable"),n=(this._draggableId=this.base.generateId(),r.id=this._draggableId,r.setAttribute("center",""),r.setAttribute("top","40%"),r.setAttribute("handle",t),r.setAttribute("zIndex","1080"),r.classList.add("border","shadow-lg","bg-white"),r.style.width="max-content",document.createElement("div"));var s=this.getAttribute("modal-title");if(s){const c=document.createElement("span");c.innerText=s,c.classList.add("ml-1","mr-auto"),n.append(c)}n.id=t;const i=this.getAttribute("header-class");let o=[];i?o=o.concat(i.split(" ")):o.push("bg-gray-light"),n.classList.add(...o,"border-bottom","row","justify-end","cursor-no-select");s=this.base.generateId();const a=document.createElement("button"),l=(a.classList.add("py-0","px-1","outline-hover","no-border","cursor-default",...o),a.innerText="X",a.id=s,n.append(a),r.append(n),document.createElement("div"));l.innerHTML=this.innerHTML,r.append(l),e.append(r),this.component=e,this.base.addEvent("#"+s,"click",this._closeModal),this.base.render(this),this.classList.add("hidden")}disconnectedCallback(){this.base.removeEvents(this)}}class K extends HTMLElement{base;_buttonId;_drawerId;_iconId;constructor(){super(),this.base=new $}connectedCallback(){this.style.position="relative",this.style.display="flex",this.style.width="fit-content",this._buttonId=this.base.generateId();const e=document.createElement("button"),t=(e.classList.add("row"),e.id=this._buttonId,document.createElement("span")),r=(t.innerText=this.getAttribute("text"),this._iconId=this.base.generateId(),document.createElement("span"));var n=V('');const s=V(''),i=(s.classList.add("hidden"),r.append(n,s),r.id=this._iconId,e.append(t,r),this._drawerId=this.base.generateId(),document.createElement("div"));i.id=this._drawerId,i.classList.add("shadow","inline-block","bg-white"),i.style.position="absolute",i.style.zIndex="1040";n=this.querySelector("template");n.innerHTML.length?i.innerHTML=n.innerHTML:i.append(n.firstChild),i.style.display="none",this.component=[e,i],this.base.addEvent("#"+this._buttonId,"click",this.toggleMenu);const o=document.querySelector("body");""!==o.getAttribute("flk-close-dropdown")&&(o.setAttribute("flk-close-dropdown",""),o.addEventListener("click",this.closeAllDropdownButtons)),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this);var e=document.querySelectorAll("flk-dropdown");if(!e||!e.length){const t=document.querySelector("body");t.removeAttribute("flk-close-dropdown"),t.removeEventListener("click",this.closeAllDropdownButtons)}}toggleMenu(e){const t=F(e).target;e=t._drawerId;const r=document.getElementById(e);var e="none"!==r.style.display,n=(r.style.display=e?"none":"block",t.getAttribute("drawer-width")),n=("string"==typeof t.getAttribute("right")&&(r.style.right="0px"),r.style.top=t.offsetHeight+"px",r.style.width=n||t.offsetWidth+"px",t._iconId);const s=document.getElementById(n);e?(s.childNodes[0].classList.remove("hidden"),s.childNodes[1].classList.add("hidden")):(s.childNodes[0].classList.add("hidden"),s.childNodes[1].classList.remove("hidden"))}_closeDropdown(){var e=this._drawerId;const t=document.getElementById(e);if("none"!==t.style.display){e=this._iconId;const r=document.getElementById(e);t.style.display="none",r.childNodes[0].classList.remove("hidden"),r.childNodes[1].classList.add("hidden")}}closeAllDropdownButtons(e){var t,r=F(e,"flk-dropdown").target,e=document.querySelectorAll("flk-dropdown");if(r)for(const n of e)r._buttonId!==n._buttonId&&(t=n._drawerId,"none"!==document.getElementById(t).style.display&&n._closeDropdown());else for(const s of e)s._closeDropdown()}}var t={exports:{}};let Z=e.default,Y=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||"win32"===process.platform||Z.isatty(1)&&"dumb"!==process.env.TERM||"CI"in process.env),r=(r,n,s=r)=>e=>{let t=""+e;e=t.indexOf(n,r.length);return~e?r+X(t,n,s,e)+n:r+t+n},X=(e,t,r,n)=>{var s=e.substring(0,n)+r;let i=e.substring(n+t.length);e=i.indexOf(t);return~e?s+X(i,t,r,e):s+i};e=(e=Y)=>({isColorSupported:e,reset:e?e=>`${e}`:String,bold:e?r("","",""):String,dim:e?r("","",""):String,italic:e?r("",""):String,underline:e?r("",""):String,inverse:e?r("",""):String,hidden:e?r("",""):String,strikethrough:e?r("",""):String,black:e?r("",""):String,red:e?r("",""):String,green:e?r("",""):String,yellow:e?r("",""):String,blue:e?r("",""):String,magenta:e?r("",""):String,cyan:e?r("",""):String,white:e?r("",""):String,gray:e?r("",""):String,bgBlack:e?r("",""):String,bgRed:e?r("",""):String,bgGreen:e?r("",""):String,bgYellow:e?r("",""):String,bgBlue:e?r("",""):String,bgMagenta:e?r("",""):String,bgCyan:e?r("",""):String,bgWhite:e?r("",""):String});t.exports=e(),t.exports.createColors=e;const Q="'".charCodeAt(0),ee='"'.charCodeAt(0),te="\\".charCodeAt(0),re="/".charCodeAt(0),ne="\n".charCodeAt(0),se=" ".charCodeAt(0),ie="\f".charCodeAt(0),oe="\t".charCodeAt(0),ae="\r".charCodeAt(0),le="[".charCodeAt(0),ce="]".charCodeAt(0),ue="(".charCodeAt(0),he=")".charCodeAt(0),pe="{".charCodeAt(0),de="}".charCodeAt(0),fe=";".charCodeAt(0),me="*".charCodeAt(0),ge=":".charCodeAt(0),ye="@".charCodeAt(0),ve=/[\t\n\f\r "#'()/;[\\\]{}]/g,we=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,be=/.[\r\n"'(/\\]/,_e=/[\da-f]/i;function Ce(t,e={}){let n=t.css.valueOf(),d=e.ignoreErrors,s,i,f,m,o,a,l,g,c,u,y=n.length,h=0,v=[],p=[];function w(e){throw t.error("Unclosed "+e,h)}return{back:function(e){p.push(e)},endOfFile:function(){return 0===p.length&&h>=y},nextToken:function(e){if(p.length)return p.pop();if(!(h>=y)){var t=!!e&&e.ignoreUnclosed;switch(s=n.charCodeAt(h),s){case ne:case se:case oe:case ae:case ie:for(i=h;i+=1,s=n.charCodeAt(i),s===se||s===ne||s===oe||s===ae||s===ie;);u=["space",n.slice(h,i)],h=i-1;break;case le:case ce:case pe:case de:case ge:case fe:case he:var r=String.fromCharCode(s);u=[r,r,h];break;case ue:if(g=v.length?v.pop()[1]:"",c=n.charCodeAt(h+1),"url"===g&&c!==Q&&c!==ee&&c!==se&&c!==ne&&c!==oe&&c!==ie&&c!==ae){i=h;do{if(a=!1,i=n.indexOf(")",i+1),-1===i){if(d||t){i=h;break}w("bracket")}for(l=i;n.charCodeAt(l-1)===te;)--l,a=!a}while(a);u=["brackets",n.slice(h,i+1),h,i],h=i}else i=n.indexOf(")",h+1),m=n.slice(h,i+1),-1===i||be.test(m)?u=["(","(",h]:(u=["brackets",m,h,i],h=i);break;case Q:case ee:f=s===Q?"'":'"',i=h;do{if(a=!1,i=n.indexOf(f,i+1),-1===i){if(d||t){i=h+1;break}w("string")}for(l=i;n.charCodeAt(l-1)===te;)--l,a=!a}while(a);u=["string",n.slice(h,i+1),h,i],h=i;break;case ye:ve.lastIndex=h+1,ve.test(n),i=0===ve.lastIndex?n.length-1:ve.lastIndex-2,u=["at-word",n.slice(h,i+1),h,i],h=i;break;case te:for(i=h,o=!0;n.charCodeAt(i+1)===te;)i+=1,o=!o;if(s=n.charCodeAt(i+1),o&&s!==re&&s!==se&&s!==ne&&s!==oe&&s!==ae&&s!==ie&&(i+=1,_e.test(n.charAt(i)))){for(;_e.test(n.charAt(i+1));)i+=1;n.charCodeAt(i+1)===se&&(i+=1)}u=["word",n.slice(h,i+1),h,i],h=i;break;default:h=(s===re&&n.charCodeAt(h+1)===me?(i=n.indexOf("*/",h+2)+1,0===i&&(d||t?i=n.length:w("comment")),u=["comment",n.slice(h,i+1),h,i]):(we.lastIndex=h+1,we.test(n),i=0===we.lastIndex?n.length-1:we.lastIndex-2,u=["word",n.slice(h,i+1),h,i],v.push(u)),i)}return h++,u}},position:function(){return h}}}e=t.exports;let Se=Ce,xe;const Ae={";":e.yellow,":":e.yellow,"(":e.cyan,")":e.cyan,"[":e.yellow,"]":e.yellow,"{":e.yellow,"}":e.yellow,"at-word":e.cyan,brackets:e.cyan,call:e.cyan,class:e.yellow,comment:e.gray,hash:e.magenta,string:e.green};function ke(e){let r=Se(new xe(e),{ignoreErrors:!0}),n="";for(;!r.endOfFile();){let e=r.nextToken(),t=Ae[function([e,t],r){if("word"===e){if("."===t[0])return"class";if("#"===t[0])return"hash"}if(!r.endOfFile()){t=r.nextToken();if(r.back(t),"brackets"===t[0]||"("===t[0])return"call"}return e}(e,r)];t?n+=e[1].split(/\r?\n/).map(e=>t(e)).join("\n"):n+=e[1]}return n}ke.registerInput=function(e){xe=e};e=ke;let Ee=t.exports,Le=e;class Oe extends Error{constructor(e,t,r,n,s,i){super(e),this.name="CssSyntaxError",this.reason=e,s&&(this.file=s),n&&(this.source=n),i&&(this.plugin=i),void 0!==t&&void 0!==r&&("number"==typeof t?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,Oe)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file||"",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source,r=(null==e&&(e=Ee.isColorSupported),Le&&e&&(t=Le(t)),t.split(/\r?\n/)),n=Math.max(this.line-3,0);var s=Math.min(this.line+2,r.length);let i=String(s).length,o,a;if(e){let{bold:t,gray:r,red:n}=Ee.createColors(!0);o=e=>t(n(e)),a=e=>r(e)}else o=a=e=>e;return r.slice(n,s).map((e,t)=>{var t=n+1+t;let r=" "+(" "+t).slice(-i)+" | ";return t===this.line?(t=a(r.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," "),o(">")+a(r)+e+"\n "+t+o("^")):" "+a(r)+e}).join("\n")}toString(){let e=this.showSourceCode();return e=e&&"\n\n"+e+"\n",this.name+": "+this.message+e}}var t=Oe,Me=(Oe.default=Oe,{});Me.isClean=Symbol("isClean"),Me.my=Symbol("my");const Pe={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class Re{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name;var n=e.params?this.rawValue(e,"params"):"";void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes?this.block(e,r+n):(t=(e.raws.between||"")+(t?";":""),this.builder(r+n+t,e))}beforeAfter(e,t){let r,n=(r="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose"),e.parent),s=0;for(;n&&"root"!==n.type;)s+=1,n=n.parent;if(r.includes("\n")){var i=this.raw(e,null,"indent");if(i.length)for(let e=0;e{if(n=e.raws[t],void 0!==n)return!1}),void 0===n&&(n=Pe[r]),i.rawCache[r]=n,n}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&0{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=void 0===r?this.raw(t,null,"beforeDecl"):r&&r.replace(/\S/g,""),r}rawBeforeDecl(e,t){let r;return e.walkDecls(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=void 0===r?this.raw(t,null,"beforeRule"):r&&r.replace(/\S/g,""),r}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(t){let r;return t.walk(e=>{if(e.nodes&&(e.parent!==t||t.first!==e)&&void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=r&&r.replace(/\S/g,""),r}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(r){if(r.raws.indent)return r.raws.indent;let n;return r.walk(e=>{var t=e.parent;if(t&&t!==r&&t.parent&&t.parent===r&&void 0!==e.raws.before)return t=e.raws.before.split("\n"),n=t[t.length-1],n=n.replace(/\S/g,""),!1}),n}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){var r=e[t],e=e.raws[t];return e&&e.value===r?e.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}}var Te=Re;Re.default=Re;let Ie=Te;function Be(e,t){let r=new Ie(t);r.stringify(e)}var Ne=Be;Be.default=Be;let{isClean:je,my:De}=Me,Ue=t,Fe=Te,ze=Ne;function $e(t,r){let n=new t.constructor;for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&"proxyCache"!==s){let e=t[s];var i=typeof e;"parent"===s&&"object"==i?r&&(n[s]=r):"source"===s?n[s]=e:Array.isArray(e)?n[s]=e.map(e=>$e(e,n)):("object"==i&&null!==e&&(e=$e(e)),n[s]=e)}return n}class Ge{constructor(e={}){for(var t in this.raws={},this[je]=!1,this[De]=!0,e)if("nodes"===t){this.nodes=[];for(var r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){var t;return e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)&&(t=this.source,e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)),e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(var t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=$e(this);for(var r in e)t[r]=e[r];return t}cloneAfter(e={}){e=this.clone(e);return this.parent.insertAfter(this,e),e}cloneBefore(e={}){e=this.clone(e);return this.parent.insertBefore(this,e),e}error(e,t={}){var r,n;return this.source?({end:r,start:n}=this.rangeBy(t),this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)):new Ue(e)}getProxyProcessor(){return{get(e,t){return"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t]},set(e,t,r){return e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0}}}markDirty(){if(this[je]){this[je]=!1;let e=this;for(;e=e.parent;)e[je]=!1}}next(){var e;if(this.parent)return e=this.parent.index(this),this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;return e.index?r=this.positionInside(e.index,t):!e.word||-1!==(e=(t=this.toString()).indexOf(e.word))&&(r=this.positionInside(e,t)),r}positionInside(t,e){var r=e||this.toString();let n=this.source.start.column,s=this.source.start.line;for(let e=0;e"object"==typeof e&&e.toJSON?e.toJSON(null,r):e);else if("object"==typeof t&&t.toJSON)n[s]=t.toJSON(null,r);else if("source"===s){let e=r.get(t.input);null==e&&(e=i,r.set(t.input,i),i++),n[s]={end:t.end,inputId:e,start:t.start}}else n[s]=t}return t&&(n.inputs=[...r.keys()].map(e=>e.toJSON())),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=ze){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(var s in r)n[s]=r[s];return e.warn(t,n)}get proxyOf(){return this}}var Te=Ge,He=(Ge.default=Ge,Te);class Ve extends He{constructor(e){super(e=e&&void 0!==e.value&&"string"!=typeof e.value?{...e,value:String(e.value)}:e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}}var He=Ve,We=(Ve.default=Ve,{}),Je={},qe={},Ke={},Ze="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),Ye=(Ke.encode=function(e){if(0<=e&&e>>=5)&&(t|=32),r+=Ye.encode(t),0>1,1==(1&a)?-i:i),r.rest=t};var Ke={},l=Ke,Xe=(l.getArg=function(e,t,r){if(t in e)return e[t];if(3===arguments.length)return r;throw new Error('"'+t+'" is a required argument.')},/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/),Qe=/^data:.+\,.+$/;function et(e){e=e.match(Xe);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}function tt(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}l.urlParse=et,l.urlGenerate=tt,rt=function(e){var t=e,r=et(e);if(r){if(!r.path)return e;t=r.path}for(var n,e=l.isAbsolute(t),s=[],i=0;;){if(n=i,-1===(i=t.indexOf("/",n))){s.push(t.slice(n));break}for(s.push(t.slice(n,i));in;e--){var o=r[e-1],a=r[e];if(Pt(o,a)<=0)break;r[e-1]=a,r[e]=o}else Ot(r,Pt,n)}function Tt(e,s){var t=e,e=("string"==typeof e&&(t=w.parseSourceMapInput(e)),w.getArg(t,"version")),t=w.getArg(t,"sections");if(e!=this._version)throw new Error("Unsupported version: "+e);this._sources=new Et,this._names=new Et;var i={line:-1,column:0};this._sections=t.map(function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var t=w.getArg(e,"offset"),r=w.getArg(t,"line"),n=w.getArg(t,"column");if(r=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))},p.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;var r=this._findSourceIndex(e);if(0<=r)return this.sourcesContent[r];var n,r=e;if(null!=this.sourceRoot&&(r=w.relative(this.sourceRoot,r)),null!=this.sourceRoot&&(n=w.urlParse(this.sourceRoot))){e=r.replace(/^file:\/\//,"");if("file"==n.scheme&&this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];if((!n.path||"/"==n.path)&&this._sources.has("/"+r))return this.sourcesContent[this._sources.indexOf("/"+r)]}if(t)return null;throw new Error('"'+r+'" is not in the SourceMap.')},p.prototype.generatedPositionFor=function(e){var t=w.getArg(e,"source");if((t=this._findSourceIndex(t))<0)return{line:null,column:null,lastColumn:null};t={source:t,originalLine:w.getArg(e,"line"),originalColumn:w.getArg(e,"column")},e=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",w.compareByOriginalPositions,w.getArg(e,"bias",f.GREATEST_LOWER_BOUND));if(0<=e){e=this._originalMappings[e];if(e.source===t.source)return{line:w.getArg(e,"generatedLine",null),column:w.getArg(e,"generatedColumn",null),lastColumn:w.getArg(e,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},ft.BasicSourceMapConsumer=p,(Tt.prototype=Object.create(f.prototype)).constructor=f,Tt.prototype._version=3,Object.defineProperty(Tt.prototype,"sources",{get:function(){for(var e=[],t=0;t{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(n,s=21)=>(e=s)=>{let t="",r=e;for(;r--;)t+=n[Math.random()*n.length|0];return t}};let{SourceMapConsumer:Ut,SourceMapGenerator:Ft}=We,{existsSync:zt,readFileSync:$t}=i.default,{dirname:Gt,join:Ht}=n.default;class Vt{constructor(e,t){!1!==t.map&&(this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:"),e=t.map?t.map.prev:void 0,e=this.loadMap(t.from,e),!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Gt(this.mapFile)),e&&(this.text=e))}consumer(){return this.consumerCache||(this.consumerCache=new Ut(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+t)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);var r,n;t&&(r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r),-1"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,i,o;t&&"object"==typeof t?(a=r,r="number"==typeof(l=t).offset?(t=(c=this.fromOffset(l.offset)).line,c.col):(t=l.line,l.column),o="number"==typeof a.offset?(c=this.fromOffset(a.offset),i=c.line,c.col):(i=a.line,a.column)):r||(t=(l=this.fromOffset(t)).line,r=l.col);var a,l,c=this.origin(t,r,i,o);return s=c?new Xt(e,void 0===c.endLine?c.line:{column:c.column,line:c.line},void 0===c.endLine?c.column:{column:c.endColumn,line:c.endLine},c.source,c.file,n.plugin):new Xt(e,void 0===i?t:{column:r,line:t},void 0===i?r:{column:o,line:i},this.css,this.file,n.plugin),s.input={column:r,endColumn:o,endLine:i,line:t,source:this.css},this.file&&(Jt&&(s.input.url=Jt(this.file).toString()),s.input.file=this.file),s}fromOffset(t){let n;if(this[er])n=this[er];else{var s=this.css.split("\n");n=new Array(s.length);let r=0;for(let e=0,t=s.length;e>1),t=n[i+1])){r=i;break}r=i+1}}return{col:t-n[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Kt(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let s=this.map.consumer();t=s.originalPositionFor({column:t,line:e});if(!t.source)return!1;let i;"number"==typeof r&&(i=s.originalPositionFor({column:n,line:r}));let o,a=(o=qt(t.source)?Jt(t.source):new URL(t.source,this.map.consumer().sourceRoot||Jt(this.map.mapFile)),{column:t.column,endColumn:i&&i.column,endLine:i&&i.line,line:t.line,url:o.toString()});if("file:"===o.protocol){if(!Wt)throw new Error("file: protocol is not available in this PostCSS build");a.file=Wt(o)}e=s.sourceContentFor(t.source);return e&&(a.source=e),a}toJSON(){let e={};for(var t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}}Je=nr;nr.default=nr,Yt&&Yt.registerInput&&Yt.registerInput(nr);let{SourceMapConsumer:sr,SourceMapGenerator:ir}=We,{dirname:or,relative:ar,resolve:lr,sep:cr}=n.default,ur=s.default["pathToFileURL"],hr=Je,pr=Boolean(sr&&ir),dr=Boolean(or&&lr&&ar&&cr);ft=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e,t=(e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map","\n");this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(var t of this.previous()){var r=this.toUrl(this.path(t.file)),n=t.root||or(t.file);let e;!1===this.mapOpts.sourcesContent?(e=new sr(t.text),e.sourcesContent&&(e.sourcesContent=null)):e=t.consumer(),this.map.applySourceMap(e,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let t;for(let e=this.root.nodes.length-1;0<=e;e--)t=this.root.nodes[e],"comment"===t.type&&0===t.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(e)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),dr&&pr&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,e=>{t+=e}),[t]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=ir.fromSourceMap(e)}else this.map=new ir({file:this.outputFile()}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):""});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&0",o={generated:{column:0,line:0},original:{column:0,line:0},source:""},a,l;this.stringify(this.root,(e,t,r)=>{this.css+=e,t&&"end"!==r&&(o.generated.line=n,o.generated.column=s-1,t.source&&t.source.start?(o.source=this.sourcePath(t),o.original.line=t.source.start.line,o.original.column=t.source.start.column-1):(o.source=i,o.original.line=1,o.original.column=0),this.map.addMapping(o)),a=e.match(/\n/g),a?(n+=a.length,l=e.lastIndexOf("\n"),s=e.length-l):s+=e.length,t&&"start"!==r&&(e=t.parent||{raws:{}},("decl"===t.type||"atrule"===t.type&&!t.nodes)&&t===e.last&&!e.raws.semicolon||(t.source&&t.source.end?(o.source=this.sourcePath(t),o.original.line=t.source.end.line,o.original.column=t.source.end.column-1,o.generated.line=n,o.generated.column=s-2):(o.source=i,o.original.line=1,o.original.column=0,o.generated.line=n,o.generated.column=s-1),this.map.addMapping(o)))})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;var e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:0e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;var t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?or(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=or(lr(r,this.mapOpts.annotation)));t=ar(r,e);return this.memoizedPaths.set(e,t),t}previous(){var e;return this.previousMaps||(this.previousMaps=[],this.root?this.root.walk(e=>{e.source&&e.source.input.map&&(e=e.source.input.map,this.previousMaps.includes(e)||this.previousMaps.push(e))}):(e=new hr(this.originalCSS,this.opts)).map&&this.previousMaps.push(e.map)),this.previousMaps}setSourcesContent(){let r={};var e;this.root?this.root.walk(e=>{var t;!e.source||(t=e.source.input.from)&&!r[t]&&(r[t]=!0,t=this.usesFileUrls?this.toFileUrl(t):this.toUrl(this.path(t)),this.map.setSourceContent(t,e.source.input.css))}):this.css&&(e=this.opts.from?this.toUrl(this.path(this.opts.from)):"",this.map.setSourceContent(e,this.css))}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){var t=this.memoizedFileURLs.get(e);if(t)return t;if(ur)return t=ur(e).toString(),this.memoizedFileURLs.set(e,t),t;throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){var t=this.memoizedURLs.get(e);if(t)return t;"\\"===cr&&(e=e.replace(/\\/g,"/"));t=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,t),t}};class fr extends Te{constructor(e){super(e),this.type="comment"}}Ct=fr;fr.default=fr;let{isClean:mr,my:gr}=Me,yr=He,vr=Ct,wr,br,_r,Cr;class Sr extends Te{append(...e){for(var t of e){var r;for(r of this.normalize(t,this.last))this.proxyOf.nodes.push(r)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(var t of this.nodes)t.cleanRaws(e)}each(r){if(this.proxyOf.nodes){var n=this.getIterator();let e,t;for(;this.indexes[n]t[n](...e.map(r=>"function"==typeof r?(e,t)=>r(e.toProxy(),t):r)):"every"===n||"some"===n?r=>t[n]((e,...t)=>r(e.toProxy(),...t)):"root"===n?()=>t.root().toProxy():"nodes"===n?t.nodes.map(e=>e.toProxy()):"first"===n||"last"===n?t[n].toProxy():t[n])},set(e,t,r){return e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0}}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){var r,n,s,i=this.index(e),o=this.normalize(t,this.proxyOf.nodes[i]).reverse(),i=this.index(e);for(r of o)this.proxyOf.nodes.splice(i+1,0,r);for(s in this.indexes)i<(n=this.indexes[s])&&(this.indexes[s]=n+o.length);return this.markDirty(),this}insertBefore(e,t){var r,n,s,i=this.index(e),o=this.normalize(t,this.proxyOf.nodes[i],0===i&&"prepend").reverse(),i=this.index(e);for(r of o)this.proxyOf.nodes.splice(i,0,r);for(s in this.indexes)i<=(n=this.indexes[s])&&(this.indexes[s]=n+o.length);return this.markDirty(),this}normalize(e,t){if("string"==typeof e)e=function t(e){return e.map(e=>(e.nodes&&(e.nodes=t(e.nodes)),delete e.source,e))}(wr(e).nodes);else if(void 0===e)e=[];else if(Array.isArray(e))for(var r of e=e.slice(0))r.parent&&r.parent.removeChild(r,"ignore");else if("root"===e.type&&"document"!==this.type)for(var n of e=e.nodes.slice(0))n.parent&&n.parent.removeChild(n,"ignore");else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new yr(e)]}else if(e.selector)e=[new br(e)];else if(e.name)e=[new _r(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new vr(e)]}return e.map(e=>(e[gr]||Sr.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[mr]&&function e(t){if(t[mr]=!1,t.proxyOf.nodes)for(var r of t.proxyOf.nodes)e(r)}(e),void 0===e.raws.before&&t&&void 0!==t.raws.before&&(e.raws.before=t.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}prepend(...e){for(var t of e=e.reverse()){var r,n,s=this.normalize(t,this.first,"prepend").reverse();for(r of s)this.proxyOf.nodes.unshift(r);for(n in this.indexes)this.indexes[n]=this.indexes[n]+s.length}return this.markDirty(),this}push(e){return(e.parent=this).proxyOf.nodes.push(e),this}removeAll(){for(var e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){var t,r;for(r in e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1),this.indexes)e<=(t=this.indexes[r])&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(t,r,n){return n||(n=r,r={}),this.walkDecls(e=>{r.props&&!r.props.includes(e.prop)||r.fast&&!e.value.includes(r.fast)||(e.value=e.value.replace(t,n))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(n){return this.each((t,e)=>{let r;try{r=n(t,e)}catch(e){throw t.addToError(e)}return!1!==r&&t.walk&&(r=t.walk(n)),r})}walkAtRules(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("atrule"===e.type&&r.test(e.name))return n(e,t)}):this.walk((e,t)=>{if("atrule"===e.type&&e.name===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("atrule"===e.type)return n(e,t)}))}walkComments(r){return this.walk((e,t)=>{if("comment"===e.type)return r(e,t)})}walkDecls(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("decl"===e.type&&r.test(e.prop))return n(e,t)}):this.walk((e,t)=>{if("decl"===e.type&&e.prop===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("decl"===e.type)return n(e,t)}))}walkRules(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("rule"===e.type&&r.test(e.selector))return n(e,t)}):this.walk((e,t)=>{if("rule"===e.type&&e.selector===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("rule"===e.type)return n(e,t)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}Sr.registerParse=e=>{wr=e},Sr.registerRule=e=>{br=e},Sr.registerAtRule=e=>{_r=e},Sr.registerRoot=e=>{Cr=e};i=Sr,Sr.default=Sr,Sr.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,_r.prototype):"rule"===e.type?Object.setPrototypeOf(e,br.prototype):"decl"===e.type?Object.setPrototypeOf(e,yr.prototype):"comment"===e.type?Object.setPrototypeOf(e,vr.prototype):"root"===e.type&&Object.setPrototypeOf(e,Cr.prototype),e[gr]=!0,e.nodes&&e.nodes.forEach(e=>{Sr.rebuild(e)})},ot=i;let xr,Ar;class kr extends ot{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){let t=new xr(new Ar,this,e);return t.stringify()}}kr.registerLazyResult=e=>{xr=e},kr.registerProcessor=e=>{Ar=e};e=kr;kr.default=kr;let Er={};function Lr(e){Er[e]||(Er[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))}class Or{constructor(e,t={}){for(var r in this.type="warning",this.text=e,t.node&&t.node.source&&(e=t.node.rangeBy(t),this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column),t)this[r]=t[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}St=Or;Or.default=Or;let Mr=St;class Pr{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);e=new Mr(e,t);return this.messages.push(e),e}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}}Ke=Pr;Pr.default=Pr;let Rr=i;class Tr extends Rr{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}We=Tr;Tr.default=Tr,Rr.registerAtRule(Tr);let Ir=i,Br,Nr;class jr extends Ir{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){e=super.normalize(e);if(t)if("prepend"===r)1{Br=e},jr.registerProcessor=e=>{Nr=e};n=jr;jr.default=jr,Ir.registerRoot(jr);let Dr={comma(e){return Dr.split(e,[","],!0)},space(e){return Dr.split(e,[" ","\n","\t"])},split(e,t,u){let r=[],n="",s=!1,i=0,o=!1,a="",l=!1;for(var c of e)l?l=!1:"\\"===c?l=!0:o?c===a&&(o=!1):'"'===c||"'"===c?(o=!0,a=c):"("===c?i+=1:")"===c?0"space"!==e[0]&&"comment"!==e[0])&&(s.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(s,"value",a.concat(e),t),s.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new Jr;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){var t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1;var r;let n=!1,s=null,i=[];var o=e[1].startsWith("--");let a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)s=s||l,i.push("("===r?")":"]");else if(o&&n&&"{"===r)s=s||l,i.push("}");else if(0===i.length){if(";"===r){if(n)return void this.decl(a,o);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===i[i.length-1]&&(i.pop(),0===i.length&&(s=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),0e+t[1],""),e.raws[t]={raw:o,value:l}),e[t]=l}rule(e){e.pop();let t=new Jr;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){var t;let r="";for(;e.length&&("space"===(t=e[e.length-1][0])||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){var t;let r="";for(;e.length&&("space"===(t=e[0][0])||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t="";for(;e.length&&"space"===e[e.length-1][0];)t=e.pop()[1]+t;return t}stringFrom(t,r){let n="";for(let e=r;evn(e)),e}let wn={};class bn{constructor(e,t,r){this.stringified=!1,this.processed=!1;let n;if("object"!=typeof t||null===t||"root"!==t.type&&"document"!==t.type)if(t instanceof bn||t instanceof ln)n=vn(t.root),t.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=t.map);else{let e=cn;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{n=e(t,r)}catch(e){this.processed=!0,this.error=e}n&&!n[tn]&&sn.rebuild(n)}else n=vn(t);this.result=new ln(e,n,r),this.helpers={...wn,postcss:wn,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){var r=this.result.lastPlugin;try{if(t&&t.addToError(e),"CssSyntaxError"!==(this.error=e).name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){var n=r.postcssPlugin;let e=r.postcssVersion,t=this.result.processor.version;var s=e.split("."),i=t.split(".");(s[0]!==i[0]||parseInt(s[1])>parseInt(i[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+t+", but "+n+" uses "+e+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};var e,t=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(e of this.plugins)if("object"==typeof e)for(var r in e){if(!pn[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${e.postcssPlugin}. `+`Try to update PostCSS (${this.processor.version} now).`);if(!dn[r])if("object"==typeof e[r])for(var n in e[r])"*"===n?t(e,r,e[r][n]):t(e,r+"-"+n.toLowerCase(),e[r][n]);else"function"==typeof e[r]&&t(e,r,e[r])}this.hasListener=0t(e,this.helpers)),await Promise.all(i)):await t(r,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{var e;if("object"==typeof t&&t.Once)return"document"===this.result.root.type?mn((e=this.result.root.nodes.map(e=>t.Once(e,this.helpers)))[0])?Promise.all(e):e:t.Once(this.result.root,this.helpers);if("function"==typeof t)return t(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();var e=this.result.opts;let t=nn,r=(e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify),new rn(t,this.result.root,this.result.opts));e=r.generate();return this.result.css=e[0],this.result.map=e[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(var e of this.plugins)if(mn(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[en];)e[en]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(var t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||an("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(var[r,n]of e){this.result.lastPlugin=r;let e;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(mn(e))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:s}=r;if("root"===n.type||"document"===n.type||n.parent){if(0{e[en]||this.walkSync(e)});else{var r=this.listeners[t];if(r&&this.visitSync(r,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}bn.registerPostcss=e=>{wn=e};Me=bn;bn.default=bn,un.registerLazyResult(bn),on.registerLazyResult(bn);let _n=ft,Cn=Ne,Sn=Lr,xn=Qr;const An=Ke;class kn{constructor(e,t,r){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;var e=Cn;this.result=new An(this._processor,void 0,this._opts),this.result.css=t;let n=this,s=(Object.defineProperty(this.result,"root",{get(){return n.root}}),new _n(e,void 0,this._opts,t));s.isMap()?([r,e]=s.generate(),r&&(this.result.css=r),e&&(this.result.map=e)):(s.clearAnnotation(),this.result.css=s.css)}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||Sn("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=xn;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}}ft=kn;kn.default=kn;let En=ft,Ln=Me,On=e,Mn=n;class Pn{constructor(e=[]){this.version="8.4.35",this.plugins=this.normalize(e)}normalize(e){let t=[];for(var r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return new(this.plugins.length||t.parser||t.stringifier||t.syntax?Ln:En)(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}ft=Pn;Pn.default=Pn,Mn.registerProcessor(Pn),On.registerProcessor(Pn);let Rn=He,Tn=qe,In=Ct,Bn=We,Nn=Je,jn=n,Dn=ot;function Un(e,r){if(Array.isArray(e))return e.map(e=>Un(e));let{inputs:t,...n}=e;if(t){r=[];for(var s of t){let e={...s,__proto__:Nn.prototype};e.map&&(e.map={...e.map,__proto__:Tn.prototype}),r.push(e)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>Un(e,r))),n.source){let{inputId:e,...t}=n.source;n.source=t,null!=e&&(n.source.input=r[e])}if("root"===n.type)return new jn(n);if("decl"===n.type)return new Rn(n);if("rule"===n.type)return new Dn(n);if("comment"===n.type)return new In(n);if("atrule"===n.type)return new Bn(n);throw new Error("Unknown node type: "+e.type)}qe=Un,Un.default=Un;let Fn=He,zn=Me;He=i;let $n=ft;Me=Ne,i=qe;let Gn=e;ft=St;let Hn=Ct,Vn=We;Ne=Ke,qe=Je,e=Qr,St=s;let Wn=ot,Jn=n;Ct=Te;function o(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new $n(e)}o.plugin=function(r,n){let s=!1;function i(...e){console&&console.warn&&!s&&(s=!0,console.warn(r+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(r+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let t=n(...e);return t.postcssPlugin=r,t.postcssVersion=(new $n).version,t}let e;return Object.defineProperty(i,"postcss",{get(){return e=e||i(),e}}),i.process=function(e,t,r){return o([i(r)]).process(e,t)},i},o.stringify=Me,o.parse=e,o.fromJSON=i,o.list=St,o.comment=e=>new Hn(e),o.atRule=e=>new Vn(e),o.decl=e=>new Fn(e),o.rule=e=>new Wn(e),o.root=e=>new Jn(e),o.document=e=>new Gn(e),o.CssSyntaxError=t,o.Declaration=Fn,o.Container=He,o.Processor=$n,o.Document=Gn,o.Comment=Hn,o.Warning=ft,o.AtRule=Vn,o.Result=Ne,o.Input=qe,o.Rule=Wn,o.Root=Jn,o.Node=Ct,zn.registerPostcss(o);o.default=o;class qn extends HTMLElement{base;contents;component;listType="ul";iconSet;filter={value:"",caseSensitive:!1};static get observedAttributes(){return["contents","icon-set","max-depth","filter"]}_jsonToValueArray(e){let t=JSON.stringify(e);t=t.replace(/[\[\]{}\"]/g,"");let r=[];for(const n of t.split(","))r=r.concat(n.split(":"));return[...new Set(r)]}_emit(e,t,r){e=new CustomEvent(e,{detail:r,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}constructor(){super(),this.base=new $,this.setContents(this.getAttribute("contents")),this.iconSet=this.getAttribute("icon-set")?this.getAttribute("icon-type"):"file",this.maxDepth=this.getAttribute("max-depth")?parseInt(this.getAttribute("max-depth")):-1,this.setFilter(this.getAttribute("filter")),this.style.display="block",this.style.maxWidth="fit-content",this.style.margin="0 1rem 0 0",this.base.addEvent(".flk-branch","click",this.emitNodeToggle)}emitNodeToggle(e){e.stopPropagation();const t=F(e,"flk-tree-nav").target,r=z(e,"branchKey");let n=t.contents;const s=r.split(".");for(const o of s)if(n[o])n=n[o];else{let e=[];for(const a of n)a[o]&&e.push(a[o]);n=e}var e=r.substring(r.indexOf(".")+1),i=t.createLeafText(s.reverse()[0]);t._emit("tree-click",t,{path:e,data:n,key:(i.titleText+" "+i.commentText).trim(),branch:"object"==typeof n})}convertJsonKeyToTitle(e){if(!e)return"";const t=(e="string"!=typeof e?e.toString():e).replace(/([A-Z_])/g,e=>"_"===e?" ":" "+e).trim();return t.charAt(0).toUpperCase()+t.slice(1)}setContents(e){var t=e||this.contents||[];try{switch(typeof t){case"string":this.contents=JSON.parse(t);break;case"object":Array.isArray(t)?this.contents=t:this.contents=[t]}}catch(e){console.log(e)}}applyFilter(e){let t;var r="details"===e.tagName.toLowerCase();t=this.filter.caseSensitive?e.dataset.branchValues.includes(this.filter.value):e.dataset.branchValues.toLowerCase().includes(this.filter.value.toLowerCase()),t?e.parentElement.classList.remove("hidden"):e.parentElement.classList.add("hidden"),r&&t?e.setAttribute("open",""):e.removeAttribute("open")}resetTree(e){e.parentElement.classList.remove("hidden"),e.removeAttribute("open")}filterTree(){let t=setTimeout(()=>{for(const e of this.querySelectorAll("[data-branch-values]"))void 0===this.filter.value||0===this.filter.value.length?this.resetTree(e):this.applyFilter(e);clearTimeout(t)},10)}setFilter(e){const t=e||{};try{switch(typeof t){case"string":t.includes("{")?(this.filter=JSON.parse(t),!1===this.filter.caseSensitive&&(this.filter.value=this.filter.value.toLowerCase())):this.filter.value=e.toLowerCase();break;case"object":this.filter=t}}catch(e){console.log(e)}this.filterTree()}createLeafText(e){var t,r;let n="",s="";return"string"==typeof e&&(e.includes("(")||e.includes("["))?(r=e.indexOf("("),r=-1===(t=e.indexOf("["))?r:t,n=this.convertJsonKeyToTitle(e.substring(0,r)),s=e.substring(r)):n=this.convertJsonKeyToTitle(e),{titleText:n,commentText:s}}createTextTag(n,s){n=this.createLeafText(n);if(n.commentText){let e=document.createElement("div"),t=document.createElement("span"),r=(t.innerText=n.titleText,document.createElement("small"));r.innerText=n.commentText,r.style.marginLeft="1rem",e.append(t,r),e.style.display="inline-flex",e.style.alignItems="center",s.append(e)}else s.innerText=n.titleText}createLeaf(e,t,r,n=[]){let s=document.createElement("li");s.classList.add("cursor-no-select"),s.style.marginTop="0.4rem",s.dataset.branchKey=r;const i="file"===this.iconSet?'':'';s.style.listStyleImage=`url('data:image/svg+xml,${i}')`,s.style.position="relative",s.style.left="2px";let o=document.createElement("span");r=[e].concat(n);if(o.dataset.branchValues=[...new Set(r)].join(),this.createTextTag(e,o),o.style.position="relative",o.style.top="-3px",s.append(o),t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);const i="file"===this.iconSet?G:H;e.style.listStyleImage=`url('data:image/svg+xml,${i}')`,e.append(s),t.append(e)}else t.append(s)}createBranch(r,t,n,s){if(s===this.maxDepth&&"object"==typeof r){var i,o=Array.isArray(r)?r:Object.keys(r);if("object"==typeof o[0]){let e=[];for(const d of o)e=e.concat(Object.keys(d));for(i of[...new Set(e)]){var u=document.createElement(this.listType);t.append(this.createBranch(i,u,n+"."+i,s+1))}}else for(const a of o){let e;r[a]&&(e=this._jsonToValueArray(r[a])),this.createLeaf(a,t,n,e)}}else if(Array.isArray(r))for(var e in r){var h=document.createElement(this.listType);t.append(this.createBranch(r[e],h,n+"."+e,s+1))}else if(null!==r&&"object"==typeof r){const l=[];for(const c of Object.keys(r)){let e=document.createElement("li"),t=(e.classList.add("cursor-no-select"),e.style.position="relative",e.style.left="2px",e.dataset.branchKey=n+"."+c,document.createElement("details"));t.classList.add("flk-branch"),t.dataset.branchValues=[c].concat(this._jsonToValueArray(r[c])),t.style.position="relative",t.style.top="-3px",t.classList.add("cursor-default");var p=document.createElement("summary");this.createTextTag(c,p),t.append(p),e.append(this.createBranch(r[c],t,n+"."+c,s+1)),l.push(e)}if(t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);o="file"===this.iconSet?G:H;e.style.listStyleImage=`url('data:image/svg+xml,${o}')`;for(const f of l)e.append(f);t.append(e)}else for(const m of l)t.append(m)}else console.trace({node:r,element:t,key:n}),this.createLeaf(r,t,n);return t}createHtml(){let e=document.createElement(this.listType);var t="file"===this.iconSet?G:'';if(e.style.listStyleImage=`url('data:image/svg+xml,${t}')`,e.style.marginLeft="3rem",this.contents.length){for(const r in this.contents)e=this.createBranch(this.contents[r],e,r,0);this.component=e}else this.component=e}attributeChangedCallback(e,t,r){switch(e){case"contents":this.setContents(r);break;case"icon-set":this.iconSet=r;break;case"max-depth":this.maxDepth="string"==typeof r?parseInt(r):r;break;case"filter":this.setFilter(r)}this.init()}connectedCallback(){this.init()}disconnectedCallback(){this.base.removeEvents(this)}init(){this.createHtml(),this.base.render(this)}}customElements.define("flk-table",W),customElements.define("flk-draggable",J),customElements.define("flk-modal",q),customElements.define("flk-dropdown",K),customElements.define("flk-tree-nav",qn)}(require$$0,require$$2,require$$1$1,require$$1); \ No newline at end of file diff --git a/documentation/public/cdn/ibiss-v0.0.4/htmx-ibiss-ui.min.js b/documentation/public/cdn/ibiss-v0.0.4/htmx-ibiss-ui.min.js new file mode 100644 index 0000000..c035056 --- /dev/null +++ b/documentation/public/cdn/ibiss-v0.0.4/htmx-ibiss-ui.min.js @@ -0,0 +1 @@ +!function(t){"function"==typeof define&&define.amd?define(t):t()}(function(){"use strict";htmx.defineExtension("ibiss-ui",{onEvent:function(t,e){if("htmx:beforeRequest"===t){const{target:i,detail:n}=e;t=i.getAttribute("ibiss-router");if(window[t]&&"function"==typeof window[t])return window[t](i,n,e),!1}}})}); \ No newline at end of file diff --git a/documentation/public/cdn/ibiss-v0.0.4/rocket.min.js b/documentation/public/cdn/ibiss-v0.0.4/rocket.min.js new file mode 100644 index 0000000..0a7f9d0 --- /dev/null +++ b/documentation/public/cdn/ibiss-v0.0.4/rocket.min.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).rocketjs=t()}(this,function(){"use strict";function y(e,t){let r=0,l=e.indexOf(t);for(;-1!==l;)r++,l=e.indexOf(t,l+1);return r}function e(){return{sequence:"",match:!1}}function v(e,t,r){let l=r.sequence;return l.length===t.length&&(l=l.substring(1)),l+=e,r.sequence=l,r.match=l===t,r}class g{static getTemplates(t,r,l){if(r.length!==l.length)throw new Error("Template start is not the same length as template end");var g=t.length;let a=e(),o=e(),n=0,s=0,i=[],p=[];const u=[];for(let e=0;ee.replace(new RegExp(t,"g"),r));return l=l.replace(/if([\s\S]+?)\s|is|not/gm,e=>e.replace(new RegExp(t,"g"),r)),l=l.replace(/(of|in)([\s\S]+?)(?=<|{)/gm,e=>e.replace(new RegExp(t,"g"),r)),l}}class o{static resolvePartials(e,t){let r=e;for(const a of g.getTemplates(e,"{{#","#}}")){var l=g.getInnerTemplate(a),l=g.getPropertyValue(l,t);let e=l?l:"";r=r.replace(a,e)}if(r.includes("{{#")){if(e===r)return r;r=o.resolvePartials(r,t)}return r}}class s{static interpolateTemplate(e,r){let l=e;for(const n of g.getTemplates(e,"{{","}}")){let e=g.getInnerTemplate(n,2);var a="!"===e[0],o=(a&&(e=e.substr(1).trim()),g.getPropertyValue(e,r));let t=o?o:"";t=Array.isArray(t)?t.join(", "):t.toString().trim();o=a?s.escapeHtml(t):t;l=l.replace(n,o)}return l}static escapeHtml(e){return e=(e=(e=(e=(e=e.replace(/&/gm,"&")).replace(//gm,">")).replace(/"/gm,""")).replace(/\//gm,"'")}}class r{static buildTemplate(e,t){e=o.resolvePartials(e,t),e=class{static resolveWrapper(e){let t=e;for(const o of g.getTemplates(e,"{{$","$}}")){var r=g.getWrapperProperty(o),l=g.getTemplates(r.templateToFill,"{{","}}"),l=g.getToplevelTemplates(l);let e=r.templateToFill;for(const n of l){var a=g.getProperty(n);e=e.replace(new RegExp(a,"g"),r.property+"."+a)}t=t.replace(o,e)}return t}}.resolveWrapper(e);return e=c.resolveLoop(e,t),class{static resolveConditional(e,l){let a=e;for(const p of g.getTemplates(e,"{{~","~}}")){const c=g.getConditionalLogic(p);var o=c.property,n=c.logiclessTemplate,s=c.truthy,i=!c.truthy;let e="",t=(c.comparison&&(e=c.comparison),""),r=g.getPropertyValue(o,l);r&&(r=Array.isArray(r)?r:r.toString().trim().toLocaleLowerCase(),e=c.comparison?c.comparison.toLocaleLowerCase():null),e?(s&&(t=r===e?n:""),i&&(t=r!==e?n:"")):t="false"===r||!r||Array.isArray(r)&&!r.length?"":n,a=a.replace(p,t)}return a}}.resolveConditional(e,t)}static interpolateTemplate(e,t){return s.interpolateTemplate(e,t)}static render(e,t){e=r.buildTemplate(e,t);return r.interpolateTemplate(e,t)}}return r}); \ No newline at end of file diff --git a/documentation/public/js/flightkit.min.js b/documentation/public/js/flightkit.min.js index 1bf4e4d..a5a8ef8 100644 --- a/documentation/public/js/flightkit.min.js +++ b/documentation/public/js/flightkit.min.js @@ -1 +1 @@ -!function(e,n,s,i){"use strict";function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a,u,g,e=c(e),n=c(n),s=c(s),i=c(i);(t=a=a||{}).Date="date",t.String="string",t.Float="float",t.Number="number",t.Array="array",t.Object="object",t.Bool="bool",t.Currency="currency",t.Undefined="undefined",t.Null="null";const h={date:/^(\d{1,4}-\d{1,4}-\d{1,4}(T)?)/gim,currency:/^[$|€]\s?[0-9]*(\.|,)?\d*(\.|,)?\d*/gim,float:/\d+[,|.]\d+[,|.]?\d*/gim,currencySign:/\$|€/gim,array:/^\s?[[].[^,]+[\]],?/gi,precision:/[-+$€,.]/gm,string:/[a-zA-Z]/gim},m=e=>{return null===e||"null"===e?a.Null:e||0===e||!1===e?null===new RegExp(h.date).exec(e)||isNaN(Date.parse(e))?new RegExp(h.currency).exec(e)?a.Currency:!new RegExp(h.string).exec(e)&&new RegExp(h.float).exec(e.toString())?a.Float:isNaN(e)&&0!==e?Array.isArray(e)?a.Array:"object"==typeof e?a.Object:a.String:a.Number:a.Date:a.Undefined},y=(t,e)=>{const r={value:void 0,type:e=e||m(t),currencySign:""};switch(r.type){case a.String:r.value=t.toString();break;case a.Float:case a.Currency:var n=(t=t.toString()).match(new RegExp(/(,)/gim)),s=t.match(new RegExp(/(\.)/gim));if(n)for(let e=1;e<=n.length;e++)t=e!==n.length||s?t.replace(",",""):t.replace(",",".");if(r.type===a.Currency){const o=new RegExp(h.currencySign);var i=o.exec(t);r.currencySign=null!==i?i[0]:"",t=t.replace(o,"")}r.value=parseFloat(t).toPrecision(12);break;case a.Number:r.value=Number(t);break;case a.Date:r.value=Date.parse(t);break;case a.Array:t.length?"object"==typeof t[0]?r.value=t.map(e=>JSON.stringify(e)).join(", "):r.value=t.join(", "):r.value="";break;case a.Object:r.value=t;break;case a.Undefined:r.value="";break;case a.Null:r.value=null}return r};function v(e,t){var r;let n;for(r of e.split("."))r=r.trim(),n?"object"!=typeof n||Array.isArray(n)||(n=n[r]):n=t[r];return n}const b=(e,t)=>tet<=e,S=(e,t)=>e<=t,x=(e,t,r)=>r?e.toLowerCase()==t.toLowerCase():e==t,A=(e,t)=>e===t,k=(e,t)=>e!=t,E=(e,t)=>e!==t,O=(e,t)=>null!=t&&"string"==typeof e&&0<=e.toLowerCase().indexOf(t.toString().toLowerCase()),L=(e,t)=>null!=t&&0<=e.toString().toLowerCase().indexOf(t.toString().toLowerCase()),M=(e,t)=>null!=t&&"string"==typeof e&&e.toLowerCase().indexOf(t.toString().toLowerCase())<0;function P(r,n){if(0===n.length)return r;{var s=r;const o=[],a=[];let e=[];for(const l of n)l.type&&l.type!==u.And?(e.length&&a.push(e),e=[l]):e.push(l);a.push(e);let t=[];for(const e of a)t=t.concat(R(s,e));t=[...new Set(t)];var i=s.length;for(let e=0;e":return b;case"<":return _;case">=":return C;case"<=":return S;case"is":case"==":return x;case"!is":case"!=":return k;case"===":return A;case"!==":return E;case"like":case"~":case"contains":return O;case"!contains":case"!like":case"!~":return M;default:return L}}(a.operator);if(!l(i,o,a.ignoreCase)){e=!1;break}}e&&r.push(n)}return r};function I(e,t){if(!t||0===t.length)return e;if(1{if(0===r.length)r=r.concat(T(s,e));else{for(const t of r)n=n.concat(T(t,e));r=n,n=[]}}),r}return T(e,t[0])}function T(e,t){const r=[],n=[];do{if(!e||0===e.length)break;var s=e.shift();if(!s)break;const o=s[t];var i=n.indexOf(o.toString());0<=i?r[i].push(s):(n.push(o.toString()),void 0!==r[n.length-1]?r[n.length-1].push(s):r.push([s]))}while(0{if(t){var r=e;const n={};for(const s of t){let e=r.map(e=>e[s].toString());const i=e.map(e=>m(e));i.some(e=>e===a.Float)?(e=e.map(e=>parseFloat(e)),n[s]=parseFloat(e.reduce((e,t)=>e+t).toFixed(2))):(e=e.map(e=>parseInt(e)),n[s]=e.reduce((e,t)=>e+t))}return n}return{}};class D{model;sortDetails=[];filterDetails=[];selection=[];groupByProperties=[];distinctProperties=[];concatenationToken=", ";constructor(e){this.model=JSON.parse(JSON.stringify(e))}sort(e){return this.sortDetails=e,this}orderBy(e,t){return this.sortDetails.push({propertyName:e,direction:t}),this}thenOrderBy(e,t){return this.orderBy(e,t)}filter(e){return Array.isArray(e)?this.filterDetails=e:this.filterDetails.push(e),this}where(e,t,r,n,s){return this.filterDetails.push({propertyName:e,operator:t,value:r,type:n,ignoreCase:s}),this}andWhere(e,t,r,n){return this.where(e,t,r,u.And,n),this}orWhere(e,t,r,n){return this.where(e,t,r,u.Or,n),this}group(e){return this.groupByProperties=e,this}groupBy(e){return this.groupByProperties.push(e),this}thenGroupBy(e){return this.groupByProperties.push(e),this}select(e){return Array.isArray(e)?this.selection=e:"*"!==e&&(this.selection=[e]),this}distinct(e,t){return t&&(this.concatenationToken=t),Array.isArray(e)?this.distinctProperties=e:e&&(this.distinctProperties=[e]),this}execute(){return I(function(t,r){if(0===r.length)return t;{var n=r;let e=[];for(const s of t){const i={};for(const o of n)i[o]=s[o];e.push(i)}return e}}(function(r,n,u){if(!n||!n.length)return r;const s=[],h=[];for(const f of r){const o={};let t="";for(const e of n){var p=v(e,f);o[e]=p,t+=p}if(!h.includes(t)){let e=r;for(const a of Object.keys(o))e=e.filter(e=>e[a]===o[a]);h.push(t),s.push(e)}}const t=[];for(const m of s){let e={};for(const l of m){var i,d=Object.keys(e);if(d.length)for(const c of d)n.includes(c)||(i=e[c],Array.isArray(i)?(i=l[c],Array.isArray(i)?e[c]=[...new Set(...e[c].concat(l[c]))]:e[c].includes(l[c])||e[c].push(l[c])):isNaN(e[c])&&isNaN(l[c])?e[c]!==l[c]&&(e[c]=[e[c],l[c]]):e[c]=e[c]+l[c]);else e=l}t.push(e)}return t.forEach(e=>{for(const t in e)Array.isArray(e[t])&&(e[t]=e[t].join(u))}),t}(B(P(JSON.parse(JSON.stringify(this.model)),this.filterDetails),this.sortDetails),this.distinctProperties,this.concatenationToken),this.selection),this.groupByProperties)}sum(e,t){e=Array.isArray(e)?e:[e];return j(t||this.model,e)}}function U(e,t){t=t?t.toUpperCase():"FLK-";return e.toUpperCase().includes(t)}function F(e,t){var{timeStamp:r,type:n,x:s,y:i}=e;let o=e.target;do{if(!o||"HTML"===o.tagName||U(o.tagName,t)){"HTML"===o.tagName&&(o=null);break}}while(o=o.parentNode||o.parentElement,!U(o.tagName,t));return{target:o,timeStamp:r,type:n,x:s,y:i}}function z(e,t){let r=e.target,n="";for(;r.dataset[t]?n=r.dataset[t]:r=r.parentNode,!n;);return n}class ${constructor(){}_topLevelClasses=[];_events=[];generateId(){return"flk-"+function e(){const t=([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)),r=t.split("-")[0];return window.$flightkitUUIDStore||(window.$flightkitUUIDStore=[]),window.$flightkitUUIDStore.some(e=>e===r)?e():(window.$flightkitUUIDStore.push(r),r)}()}render(t){if(!t.component)throw new Error("Component is not assigned! Can't render");t.id=t.id||this.generateId();var e=this._getAllEventAttributes(t);if(e){var r="#"+t.id;for(const i of e){var n="e-"+i;this.addEvent(r,i,t.getAttribute(n))}}var s=Object.keys(t.classList).length;if(s){for(let e=0;e{this._assignToDom(t,t.component),clearTimeout(this._renderTimer)},10)}addEvent(e,t,r){this._events.push({selector:e,eventType:t,callback:r})}_getExternalCallback(e){let t=void 0;for(const r of e.split("."))t=(t||window)[r];return t}_getAllEventAttributes(e){e=e.attributes;const t=Array.from(e).filter(e=>e.name.startsWith("e-"));return t.map(e=>e.name.slice(2))}_isFlightkitElement(e){return e.toUpperCase().includes("FLK-")}_outerEventHandler(e){const t=F(e),r=(t.contents=e.detail,t.target.getAttribute("e-"+t.type));let n=void 0;for(const s of r.split("."))n=(n||window)[s];return e.preventDefault(),e.stopPropagation(),n(t)}_addEvents(e){if(e.isConnected)for(const r of this._events)if(r.selector.startsWith("."))for(const n of document.querySelectorAll(r.selector))this._addEventToElement(r,n);else{var t=document.querySelector(r.selector);this._addEventToElement(r,t)}}_addEventToElement(e,t){t&&("function"==typeof e.callback?(t.removeEventListener(e.eventType,e.callback),t.addEventListener(e.eventType,e.callback)):(t.removeEventListener(e.eventType,this._outerEventHandler),t.addEventListener(e.eventType,this._outerEventHandler)))}removeEvents(){for(const t of this._events)if(t.selector.startsWith("."))for(const r of document.querySelectorAll(t.selector))this._addEventToElement(t,r);else{var e=document.querySelector(t.selector);this._addEventToElement(t,e)}this._events=[]}_removeEventToElement(e,t){t&&("function"==typeof e.callback?t.removeEventListener(e.eventType,e.callback):t.removeEventListener(e.eventType,this._outerEventHandler))}_assignToDom(e,t){e.innerHTML="";for(const n of Array.isArray(t)?t:[t])e.append(n);const r=setTimeout(()=>{this._addEvents(e),clearTimeout(r)},10)}}const G='',H='';function V(e){const t=new DOMParser;return t.parseFromString(e,"image/svg+xml").documentElement}class W extends HTMLElement{base;component=null;_contents=[];_orderBy=[];properties=new Set;_columnOrder=[];_filter="";_selectionProperty="";_selectedIds=new Set;uniqueEntriesByProperties={};propertyLabelDictionary={};_templates={};_templateClasses={};static get observedAttributes(){return["contents","columns","order","filter","selection-property","templates"]}get columnOrder(){return this._columnOrder.length?this._columnOrder:this.properties}set columnOrder(e){let t;"string"==typeof e&&(t=e.split(",")),t=e,this._columnOrder=t}get contents(){return this._contents}set contents(e){this.analyzeData(e),this._contents=new D(e)}get orderBy(){return this._orderBy}set orderBy(e){if(Array.isArray(e))this._orderBy=e;else{const n=[];for(const s of e.split(",")){var t=s.split("|"),r=t[0],t=1e[r._selectionProperty])):new Set;e=t?r.contents.execute():[];r._emit("select",r,{selection:e}),r._updateCheckboxes(r)}emitSelect(e){var t=e.target.checked,r=e.target.dataset.objectId;const n=F(e).target,s=(t?n._selectedIds.add(r):n._selectedIds.delete(r),n._selectionProperty);e=n.contents.execute().filter(e=>n._selectedIds.has(e[s]));n._emit("select",n,{selection:e}),n._updateCheckboxes(n)}sortData(e){const t=F(e).target,r=z(e,"column");r&&(-1<(e=t._orderBy.findIndex(e=>e.propertyName===r))?"asc"===t._orderBy[e].direction?t._orderBy[e].direction="desc":t._orderBy.splice(e,1):t._orderBy.push({propertyName:r,direction:"asc"}),t.createHtml(),t.base.render(t))}setColumnOrder(e){this._columnOrder=e?Array.isArray(e)?e:e.split(","):[]}analyzeData(t){this.properties=new Set;var r=t.length;for(let e=0;e"_"===e?" ":" "+e.toLowerCase()).trim();var r=t.charAt(0).toUpperCase()+t.slice(1);return this.propertyLabelDictionary[e]=r}parseTemplate(e,n){return e.replace(/\{\{([\s\S]+?)\}\}/gim,(e,t)=>{let r="";t=t.trim();t=n[t];return t&&(r=t),Array.isArray(r)?r.join(", "):r.toString().trim()})}createSelectionCheckbox(e){const t=document.createElement("input");return t.setAttribute("type","checkbox"),t.classList.add("flk-selection-checkbox"),e&&(t.dataset.selected=e[this._selectionProperty]),t}createRow(e){const t=document.createElement("tr");if(this._selectionProperty.length){const s=document.createElement("td");var r=this.base.generateId();const i=this.createSelectionCheckbox(e);i.id=r,i.dataset.objectId=e[this._selectionProperty];var n=e[this._selectionProperty];this._selectedIds.has(n)?i.checked=!0:i.checked=!1,this.base.addEvent("#"+r,"change",this.emitSelect),s.append(i),t.append(s)}for(const o of this.columnOrder){const a=document.createElement("td");this._templates[o]?(a.innerHTML=this.parseTemplate(this._templates[o],e),this._templateClasses[o]&&a.classList.add(...this._templateClasses[o])):a.innerText=e[o],t.append(a)}return t}createBody(e){const t=document.createElement("tbody");for(const n of e){var r=this.createRow(n,null);t.append(r)}return t}createHead(){const e=document.createElement("thead"),t=document.createElement("tr");if(t.classList.add("cursor-pointer"),this._selectionProperty.length){const s=document.createElement("th");var r=this.base.generateId();const i=this.createSelectionCheckbox();i.id=r;var u=this.contents.execute().length;0e.propertyName===o);if(n){const c=document.createElement("span");c.innerHTML="asc"===n.direction?'':'',a.append(c)}t.append(a)}return e.append(t),e}addEvent(e,t,r){this.base.addEvent(e,t,r)}init(){this.createHtml(),this.base.render(this)}}class J extends HTMLElement{base;componentId;constructor(){super(),this.base=new $}connectedCallback(){var e=this.getAttribute("top"),t=this.getAttribute("left"),r=this.getAttribute("center"),n=this.getAttribute("zIndex");this.id||(this.id=this.base.generateId()),this.style.display="block",this.style.position="fixed","string"==typeof r?(this.style.top=e||"50%",this.style.left="50%",this.style.transform="translate(-50%, -50%)"):(this.style.top=e||this.clientTop+"px",this.style.left=t||this.clientLeft+"px"),n&&(this.style.zIndex=n),this.componentId=this.getAttribute("handle");const s=document.createElement("div");s.innerHTML=this.innerHTML,this.component=s;r="#"+(this.componentId||this.id);this.base.addEvent(r,"mousedown",this._dragElement),this.base.addEvent(r,"mouseup",this._reset),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this)}_dragElement(e){const r=F(e,"flk-draggable").target;let n,s;function t(e){n=e.clientX-r.offsetLeft,s=e.clientY-r.offsetTop}function i(e){var t=e.clientX-n,e=e.clientY-s;r.style.left=t+"px",r.style.top=e+"px"}function o(e){e.preventDefault()}function a(){r.removeAttribute("draggable"),r.removeEventListener("dragstart",t),r.removeEventListener("dragend",a),document.removeEventListener("dragover",o),document.removeEventListener("drop",i)}r.setAttribute("draggable",!0),r.addEventListener("dragstart",t),r.addEventListener("dragend",a),document.addEventListener("dragover",o),document.addEventListener("drop",i)}}class q extends HTMLElement{_id;base;_draggableId;constructor(){super(),this.base=new $}_emit(e,t,r){e=new CustomEvent(e,{detail:r,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}_closeModal(e){e.stopPropagation();const t=F(e,"flk-modal").target;t.classList.add("hidden")}closeModal(e){this.classList.add("hidden")}openModal(e=!0){const t=document.getElementById(this._draggableId);e&&(t.style.top="40%",t.style.left="50%"),this.classList.remove("hidden")}connectedCallback(){this.id||(this.id=this.base.generateId());const e=document.createElement("div");var t=this.base.generateId();const r=document.createElement("flk-draggable"),n=(this._draggableId=this.base.generateId(),r.id=this._draggableId,r.setAttribute("center",""),r.setAttribute("top","40%"),r.setAttribute("handle",t),r.setAttribute("zIndex","1080"),r.classList.add("border","shadow-lg","bg-white"),r.style.width="max-content",document.createElement("div"));var s=this.getAttribute("modal-title");if(s){const c=document.createElement("span");c.innerText=s,c.classList.add("ml-1","mr-auto"),n.append(c)}n.id=t;const i=this.getAttribute("header-class");let o=[];i?o=o.concat(i.split(" ")):o.push("bg-gray-light"),n.classList.add(...o,"border-bottom","row","justify-end","cursor-no-select");s=this.base.generateId();const a=document.createElement("button"),l=(a.classList.add("py-0","px-1","outline-hover","no-border","cursor-default",...o),a.innerText="X",a.id=s,n.append(a),r.append(n),document.createElement("div"));l.innerHTML=this.innerHTML,r.append(l),e.append(r),this.component=e,this.base.addEvent("#"+s,"click",this._closeModal),this.base.render(this),this.classList.add("hidden")}disconnectedCallback(){this.base.removeEvents(this)}}class K extends HTMLElement{base;_buttonId;_drawerId;_iconId;constructor(){super(),this.base=new $}connectedCallback(){this.style.position="relative",this.style.display="flex",this.style.width="fit-content",this._buttonId=this.base.generateId();const e=document.createElement("button"),t=(e.classList.add("row"),e.id=this._buttonId,document.createElement("span")),r=(t.innerText=this.getAttribute("text"),this._iconId=this.base.generateId(),document.createElement("span"));var n=V('');const s=V(''),i=(s.classList.add("hidden"),r.append(n,s),r.id=this._iconId,e.append(t,r),this._drawerId=this.base.generateId(),document.createElement("div"));i.id=this._drawerId,i.classList.add("shadow","inline-block","bg-white"),i.style.position="absolute",i.style.zIndex="1040";n=this.querySelector("template");n.innerHTML.length?i.innerHTML=n.innerHTML:i.append(n.firstChild),i.style.display="none",this.component=[e,i],this.base.addEvent("#"+this._buttonId,"click",this.toggleMenu);const o=document.querySelector("body");""!==o.getAttribute("flk-close-dropdown")&&(o.setAttribute("flk-close-dropdown",""),o.addEventListener("click",this.closeAllDropdownButtons)),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this);var e=document.querySelectorAll("flk-dropdown");if(!e||!e.length){const t=document.querySelector("body");t.removeAttribute("flk-close-dropdown"),t.removeEventListener("click",this.closeAllDropdownButtons)}}toggleMenu(e){const t=F(e).target;e=t._drawerId;const r=document.getElementById(e);var e="none"!==r.style.display,n=(r.style.display=e?"none":"block",t.getAttribute("drawer-width")),n=("string"==typeof t.getAttribute("right")&&(r.style.right="0px"),r.style.top=t.offsetHeight+"px",r.style.width=n||t.offsetWidth+"px",t._iconId);const s=document.getElementById(n);e?(s.childNodes[0].classList.remove("hidden"),s.childNodes[1].classList.add("hidden")):(s.childNodes[0].classList.add("hidden"),s.childNodes[1].classList.remove("hidden"))}_closeDropdown(){var e=this._drawerId;const t=document.getElementById(e);if("none"!==t.style.display){e=this._iconId;const r=document.getElementById(e);t.style.display="none",r.childNodes[0].classList.remove("hidden"),r.childNodes[1].classList.add("hidden")}}closeAllDropdownButtons(e){var t,r=F(e,"flk-dropdown").target,e=document.querySelectorAll("flk-dropdown");if(r)for(const n of e)r._buttonId!==n._buttonId&&(t=n._drawerId,"none"!==document.getElementById(t).style.display&&n._closeDropdown());else for(const s of e)s._closeDropdown()}}var t={exports:{}};let Z=e.default,Y=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||"win32"===process.platform||Z.isatty(1)&&"dumb"!==process.env.TERM||"CI"in process.env),r=(r,n,s=r)=>e=>{let t=""+e;e=t.indexOf(n,r.length);return~e?r+X(t,n,s,e)+n:r+t+n},X=(e,t,r,n)=>{var s=e.substring(0,n)+r;let i=e.substring(n+t.length);e=i.indexOf(t);return~e?s+X(i,t,r,e):s+i};e=(e=Y)=>({isColorSupported:e,reset:e?e=>`${e}`:String,bold:e?r("","",""):String,dim:e?r("","",""):String,italic:e?r("",""):String,underline:e?r("",""):String,inverse:e?r("",""):String,hidden:e?r("",""):String,strikethrough:e?r("",""):String,black:e?r("",""):String,red:e?r("",""):String,green:e?r("",""):String,yellow:e?r("",""):String,blue:e?r("",""):String,magenta:e?r("",""):String,cyan:e?r("",""):String,white:e?r("",""):String,gray:e?r("",""):String,bgBlack:e?r("",""):String,bgRed:e?r("",""):String,bgGreen:e?r("",""):String,bgYellow:e?r("",""):String,bgBlue:e?r("",""):String,bgMagenta:e?r("",""):String,bgCyan:e?r("",""):String,bgWhite:e?r("",""):String});t.exports=e(),t.exports.createColors=e;const Q="'".charCodeAt(0),ee='"'.charCodeAt(0),te="\\".charCodeAt(0),re="/".charCodeAt(0),ne="\n".charCodeAt(0),se=" ".charCodeAt(0),ie="\f".charCodeAt(0),oe="\t".charCodeAt(0),ae="\r".charCodeAt(0),le="[".charCodeAt(0),ce="]".charCodeAt(0),ue="(".charCodeAt(0),he=")".charCodeAt(0),pe="{".charCodeAt(0),de="}".charCodeAt(0),fe=";".charCodeAt(0),me="*".charCodeAt(0),ge=":".charCodeAt(0),ye="@".charCodeAt(0),ve=/[\t\n\f\r "#'()/;[\\\]{}]/g,we=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,be=/.[\r\n"'(/\\]/,_e=/[\da-f]/i;function Ce(t,e={}){let n=t.css.valueOf(),d=e.ignoreErrors,s,i,f,m,o,a,l,g,c,u,y=n.length,h=0,v=[],p=[];function w(e){throw t.error("Unclosed "+e,h)}return{back:function(e){p.push(e)},endOfFile:function(){return 0===p.length&&h>=y},nextToken:function(e){if(p.length)return p.pop();if(!(h>=y)){var t=!!e&&e.ignoreUnclosed;switch(s=n.charCodeAt(h),s){case ne:case se:case oe:case ae:case ie:for(i=h;i+=1,s=n.charCodeAt(i),s===se||s===ne||s===oe||s===ae||s===ie;);u=["space",n.slice(h,i)],h=i-1;break;case le:case ce:case pe:case de:case ge:case fe:case he:var r=String.fromCharCode(s);u=[r,r,h];break;case ue:if(g=v.length?v.pop()[1]:"",c=n.charCodeAt(h+1),"url"===g&&c!==Q&&c!==ee&&c!==se&&c!==ne&&c!==oe&&c!==ie&&c!==ae){i=h;do{if(a=!1,i=n.indexOf(")",i+1),-1===i){if(d||t){i=h;break}w("bracket")}for(l=i;n.charCodeAt(l-1)===te;)--l,a=!a}while(a);u=["brackets",n.slice(h,i+1),h,i],h=i}else i=n.indexOf(")",h+1),m=n.slice(h,i+1),-1===i||be.test(m)?u=["(","(",h]:(u=["brackets",m,h,i],h=i);break;case Q:case ee:f=s===Q?"'":'"',i=h;do{if(a=!1,i=n.indexOf(f,i+1),-1===i){if(d||t){i=h+1;break}w("string")}for(l=i;n.charCodeAt(l-1)===te;)--l,a=!a}while(a);u=["string",n.slice(h,i+1),h,i],h=i;break;case ye:ve.lastIndex=h+1,ve.test(n),i=0===ve.lastIndex?n.length-1:ve.lastIndex-2,u=["at-word",n.slice(h,i+1),h,i],h=i;break;case te:for(i=h,o=!0;n.charCodeAt(i+1)===te;)i+=1,o=!o;if(s=n.charCodeAt(i+1),o&&s!==re&&s!==se&&s!==ne&&s!==oe&&s!==ae&&s!==ie&&(i+=1,_e.test(n.charAt(i)))){for(;_e.test(n.charAt(i+1));)i+=1;n.charCodeAt(i+1)===se&&(i+=1)}u=["word",n.slice(h,i+1),h,i],h=i;break;default:h=(s===re&&n.charCodeAt(h+1)===me?(i=n.indexOf("*/",h+2)+1,0===i&&(d||t?i=n.length:w("comment")),u=["comment",n.slice(h,i+1),h,i]):(we.lastIndex=h+1,we.test(n),i=0===we.lastIndex?n.length-1:we.lastIndex-2,u=["word",n.slice(h,i+1),h,i],v.push(u)),i)}return h++,u}},position:function(){return h}}}e=t.exports;let Se=Ce,xe;const Ae={";":e.yellow,":":e.yellow,"(":e.cyan,")":e.cyan,"[":e.yellow,"]":e.yellow,"{":e.yellow,"}":e.yellow,"at-word":e.cyan,brackets:e.cyan,call:e.cyan,class:e.yellow,comment:e.gray,hash:e.magenta,string:e.green};function ke(e){let r=Se(new xe(e),{ignoreErrors:!0}),n="";for(;!r.endOfFile();){let e=r.nextToken(),t=Ae[function([e,t],r){if("word"===e){if("."===t[0])return"class";if("#"===t[0])return"hash"}if(!r.endOfFile()){t=r.nextToken();if(r.back(t),"brackets"===t[0]||"("===t[0])return"call"}return e}(e,r)];t?n+=e[1].split(/\r?\n/).map(e=>t(e)).join("\n"):n+=e[1]}return n}ke.registerInput=function(e){xe=e};e=ke;let Ee=t.exports,Oe=e;class Le extends Error{constructor(e,t,r,n,s,i){super(e),this.name="CssSyntaxError",this.reason=e,s&&(this.file=s),n&&(this.source=n),i&&(this.plugin=i),void 0!==t&&void 0!==r&&("number"==typeof t?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,Le)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file||"",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source,r=(null==e&&(e=Ee.isColorSupported),Oe&&e&&(t=Oe(t)),t.split(/\r?\n/)),n=Math.max(this.line-3,0);var s=Math.min(this.line+2,r.length);let i=String(s).length,o,a;if(e){let{bold:t,gray:r,red:n}=Ee.createColors(!0);o=e=>t(n(e)),a=e=>r(e)}else o=a=e=>e;return r.slice(n,s).map((e,t)=>{var t=n+1+t;let r=" "+(" "+t).slice(-i)+" | ";return t===this.line?(t=a(r.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," "),o(">")+a(r)+e+"\n "+t+o("^")):" "+a(r)+e}).join("\n")}toString(){let e=this.showSourceCode();return e=e&&"\n\n"+e+"\n",this.name+": "+this.message+e}}var t=Le,Me=(Le.default=Le,{});Me.isClean=Symbol("isClean"),Me.my=Symbol("my");const Pe={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class Re{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name;var n=e.params?this.rawValue(e,"params"):"";void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes?this.block(e,r+n):(t=(e.raws.between||"")+(t?";":""),this.builder(r+n+t,e))}beforeAfter(e,t){let r,n=(r="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose"),e.parent),s=0;for(;n&&"root"!==n.type;)s+=1,n=n.parent;if(r.includes("\n")){var i=this.raw(e,null,"indent");if(i.length)for(let e=0;e{if(n=e.raws[t],void 0!==n)return!1}),void 0===n&&(n=Pe[r]),i.rawCache[r]=n,n}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&0{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=void 0===r?this.raw(t,null,"beforeDecl"):r&&r.replace(/\S/g,""),r}rawBeforeDecl(e,t){let r;return e.walkDecls(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=void 0===r?this.raw(t,null,"beforeRule"):r&&r.replace(/\S/g,""),r}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(t){let r;return t.walk(e=>{if(e.nodes&&(e.parent!==t||t.first!==e)&&void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=r&&r.replace(/\S/g,""),r}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(r){if(r.raws.indent)return r.raws.indent;let n;return r.walk(e=>{var t=e.parent;if(t&&t!==r&&t.parent&&t.parent===r&&void 0!==e.raws.before)return t=e.raws.before.split("\n"),n=t[t.length-1],n=n.replace(/\S/g,""),!1}),n}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){var r=e[t],e=e.raws[t];return e&&e.value===r?e.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}}var Ie=Re;Re.default=Re;let Te=Ie;function Be(e,t){let r=new Te(t);r.stringify(e)}var Ne=Be;Be.default=Be;let{isClean:je,my:De}=Me,Ue=t,Fe=Ie,ze=Ne;function $e(t,r){let n=new t.constructor;for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&"proxyCache"!==s){let e=t[s];var i=typeof e;"parent"===s&&"object"==i?r&&(n[s]=r):"source"===s?n[s]=e:Array.isArray(e)?n[s]=e.map(e=>$e(e,n)):("object"==i&&null!==e&&(e=$e(e)),n[s]=e)}return n}class Ge{constructor(e={}){for(var t in this.raws={},this[je]=!1,this[De]=!0,e)if("nodes"===t){this.nodes=[];for(var r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){var t;return e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)&&(t=this.source,e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)),e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(var t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=$e(this);for(var r in e)t[r]=e[r];return t}cloneAfter(e={}){e=this.clone(e);return this.parent.insertAfter(this,e),e}cloneBefore(e={}){e=this.clone(e);return this.parent.insertBefore(this,e),e}error(e,t={}){var r,n;return this.source?({end:r,start:n}=this.rangeBy(t),this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)):new Ue(e)}getProxyProcessor(){return{get(e,t){return"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t]},set(e,t,r){return e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0}}}markDirty(){if(this[je]){this[je]=!1;let e=this;for(;e=e.parent;)e[je]=!1}}next(){var e;if(this.parent)return e=this.parent.index(this),this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;return e.index?r=this.positionInside(e.index,t):!e.word||-1!==(e=(t=this.toString()).indexOf(e.word))&&(r=this.positionInside(e,t)),r}positionInside(t,e){var r=e||this.toString();let n=this.source.start.column,s=this.source.start.line;for(let e=0;e"object"==typeof e&&e.toJSON?e.toJSON(null,r):e);else if("object"==typeof t&&t.toJSON)n[s]=t.toJSON(null,r);else if("source"===s){let e=r.get(t.input);null==e&&(e=i,r.set(t.input,i),i++),n[s]={end:t.end,inputId:e,start:t.start}}else n[s]=t}return t&&(n.inputs=[...r.keys()].map(e=>e.toJSON())),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=ze){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(var s in r)n[s]=r[s];return e.warn(t,n)}get proxyOf(){return this}}var Ie=Ge,He=(Ge.default=Ge,Ie);class Ve extends He{constructor(e){super(e=e&&void 0!==e.value&&"string"!=typeof e.value?{...e,value:String(e.value)}:e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}}var He=Ve,We=(Ve.default=Ve,{}),Je={},qe={},Ke={},Ze="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),Ye=(Ke.encode=function(e){if(0<=e&&e>>=5)&&(t|=32),r+=Ye.encode(t),0>1,1==(1&a)?-i:i),r.rest=t};var Ke={},l=Ke,Xe=(l.getArg=function(e,t,r){if(t in e)return e[t];if(3===arguments.length)return r;throw new Error('"'+t+'" is a required argument.')},/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/),Qe=/^data:.+\,.+$/;function et(e){e=e.match(Xe);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}function tt(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}l.urlParse=et,l.urlGenerate=tt,rt=function(e){var t=e,r=et(e);if(r){if(!r.path)return e;t=r.path}for(var n,e=l.isAbsolute(t),s=[],i=0;;){if(n=i,-1===(i=t.indexOf("/",n))){s.push(t.slice(n));break}for(s.push(t.slice(n,i));in;e--){var o=r[e-1],a=r[e];if(Pt(o,a)<=0)break;r[e-1]=a,r[e]=o}else Lt(r,Pt,n)}function It(e,s){var t=e,e=("string"==typeof e&&(t=w.parseSourceMapInput(e)),w.getArg(t,"version")),t=w.getArg(t,"sections");if(e!=this._version)throw new Error("Unsupported version: "+e);this._sources=new Et,this._names=new Et;var i={line:-1,column:0};this._sections=t.map(function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var t=w.getArg(e,"offset"),r=w.getArg(t,"line"),n=w.getArg(t,"column");if(r=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))},p.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;var r=this._findSourceIndex(e);if(0<=r)return this.sourcesContent[r];var n,r=e;if(null!=this.sourceRoot&&(r=w.relative(this.sourceRoot,r)),null!=this.sourceRoot&&(n=w.urlParse(this.sourceRoot))){e=r.replace(/^file:\/\//,"");if("file"==n.scheme&&this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];if((!n.path||"/"==n.path)&&this._sources.has("/"+r))return this.sourcesContent[this._sources.indexOf("/"+r)]}if(t)return null;throw new Error('"'+r+'" is not in the SourceMap.')},p.prototype.generatedPositionFor=function(e){var t=w.getArg(e,"source");if((t=this._findSourceIndex(t))<0)return{line:null,column:null,lastColumn:null};t={source:t,originalLine:w.getArg(e,"line"),originalColumn:w.getArg(e,"column")},e=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",w.compareByOriginalPositions,w.getArg(e,"bias",f.GREATEST_LOWER_BOUND));if(0<=e){e=this._originalMappings[e];if(e.source===t.source)return{line:w.getArg(e,"generatedLine",null),column:w.getArg(e,"generatedColumn",null),lastColumn:w.getArg(e,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},ft.BasicSourceMapConsumer=p,(It.prototype=Object.create(f.prototype)).constructor=f,It.prototype._version=3,Object.defineProperty(It.prototype,"sources",{get:function(){for(var e=[],t=0;t{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(n,s=21)=>(e=s)=>{let t="",r=e;for(;r--;)t+=n[Math.random()*n.length|0];return t}};let{SourceMapConsumer:Ut,SourceMapGenerator:Ft}=We,{existsSync:zt,readFileSync:$t}=i.default,{dirname:Gt,join:Ht}=n.default;class Vt{constructor(e,t){!1!==t.map&&(this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:"),e=t.map?t.map.prev:void 0,e=this.loadMap(t.from,e),!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Gt(this.mapFile)),e&&(this.text=e))}consumer(){return this.consumerCache||(this.consumerCache=new Ut(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+t)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);var r,n;t&&(r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r),-1"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,i,o;t&&"object"==typeof t?(a=r,r="number"==typeof(l=t).offset?(t=(c=this.fromOffset(l.offset)).line,c.col):(t=l.line,l.column),o="number"==typeof a.offset?(c=this.fromOffset(a.offset),i=c.line,c.col):(i=a.line,a.column)):r||(t=(l=this.fromOffset(t)).line,r=l.col);var a,l,c=this.origin(t,r,i,o);return s=c?new Xt(e,void 0===c.endLine?c.line:{column:c.column,line:c.line},void 0===c.endLine?c.column:{column:c.endColumn,line:c.endLine},c.source,c.file,n.plugin):new Xt(e,void 0===i?t:{column:r,line:t},void 0===i?r:{column:o,line:i},this.css,this.file,n.plugin),s.input={column:r,endColumn:o,endLine:i,line:t,source:this.css},this.file&&(Jt&&(s.input.url=Jt(this.file).toString()),s.input.file=this.file),s}fromOffset(t){let n;if(this[er])n=this[er];else{var s=this.css.split("\n");n=new Array(s.length);let r=0;for(let e=0,t=s.length;e>1),t=n[i+1])){r=i;break}r=i+1}}return{col:t-n[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Kt(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let s=this.map.consumer();t=s.originalPositionFor({column:t,line:e});if(!t.source)return!1;let i;"number"==typeof r&&(i=s.originalPositionFor({column:n,line:r}));let o,a=(o=qt(t.source)?Jt(t.source):new URL(t.source,this.map.consumer().sourceRoot||Jt(this.map.mapFile)),{column:t.column,endColumn:i&&i.column,endLine:i&&i.line,line:t.line,url:o.toString()});if("file:"===o.protocol){if(!Wt)throw new Error("file: protocol is not available in this PostCSS build");a.file=Wt(o)}e=s.sourceContentFor(t.source);return e&&(a.source=e),a}toJSON(){let e={};for(var t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}}Je=nr;nr.default=nr,Yt&&Yt.registerInput&&Yt.registerInput(nr);let{SourceMapConsumer:sr,SourceMapGenerator:ir}=We,{dirname:or,relative:ar,resolve:lr,sep:cr}=n.default,ur=s.default["pathToFileURL"],hr=Je,pr=Boolean(sr&&ir),dr=Boolean(or&&lr&&ar&&cr);ft=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e,t=(e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map","\n");this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(var t of this.previous()){var r=this.toUrl(this.path(t.file)),n=t.root||or(t.file);let e;!1===this.mapOpts.sourcesContent?(e=new sr(t.text),e.sourcesContent&&(e.sourcesContent=null)):e=t.consumer(),this.map.applySourceMap(e,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let t;for(let e=this.root.nodes.length-1;0<=e;e--)t=this.root.nodes[e],"comment"===t.type&&0===t.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(e)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),dr&&pr&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,e=>{t+=e}),[t]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=ir.fromSourceMap(e)}else this.map=new ir({file:this.outputFile()}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):""});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&0",o={generated:{column:0,line:0},original:{column:0,line:0},source:""},a,l;this.stringify(this.root,(e,t,r)=>{this.css+=e,t&&"end"!==r&&(o.generated.line=n,o.generated.column=s-1,t.source&&t.source.start?(o.source=this.sourcePath(t),o.original.line=t.source.start.line,o.original.column=t.source.start.column-1):(o.source=i,o.original.line=1,o.original.column=0),this.map.addMapping(o)),a=e.match(/\n/g),a?(n+=a.length,l=e.lastIndexOf("\n"),s=e.length-l):s+=e.length,t&&"start"!==r&&(e=t.parent||{raws:{}},("decl"===t.type||"atrule"===t.type&&!t.nodes)&&t===e.last&&!e.raws.semicolon||(t.source&&t.source.end?(o.source=this.sourcePath(t),o.original.line=t.source.end.line,o.original.column=t.source.end.column-1,o.generated.line=n,o.generated.column=s-2):(o.source=i,o.original.line=1,o.original.column=0,o.generated.line=n,o.generated.column=s-1),this.map.addMapping(o)))})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;var e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:0e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;var t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?or(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=or(lr(r,this.mapOpts.annotation)));t=ar(r,e);return this.memoizedPaths.set(e,t),t}previous(){var e;return this.previousMaps||(this.previousMaps=[],this.root?this.root.walk(e=>{e.source&&e.source.input.map&&(e=e.source.input.map,this.previousMaps.includes(e)||this.previousMaps.push(e))}):(e=new hr(this.originalCSS,this.opts)).map&&this.previousMaps.push(e.map)),this.previousMaps}setSourcesContent(){let r={};var e;this.root?this.root.walk(e=>{var t;!e.source||(t=e.source.input.from)&&!r[t]&&(r[t]=!0,t=this.usesFileUrls?this.toFileUrl(t):this.toUrl(this.path(t)),this.map.setSourceContent(t,e.source.input.css))}):this.css&&(e=this.opts.from?this.toUrl(this.path(this.opts.from)):"",this.map.setSourceContent(e,this.css))}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){var t=this.memoizedFileURLs.get(e);if(t)return t;if(ur)return t=ur(e).toString(),this.memoizedFileURLs.set(e,t),t;throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){var t=this.memoizedURLs.get(e);if(t)return t;"\\"===cr&&(e=e.replace(/\\/g,"/"));t=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,t),t}};class fr extends Ie{constructor(e){super(e),this.type="comment"}}Ct=fr;fr.default=fr;let{isClean:mr,my:gr}=Me,yr=He,vr=Ct,wr,br,_r,Cr;class Sr extends Ie{append(...e){for(var t of e){var r;for(r of this.normalize(t,this.last))this.proxyOf.nodes.push(r)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(var t of this.nodes)t.cleanRaws(e)}each(r){if(this.proxyOf.nodes){var n=this.getIterator();let e,t;for(;this.indexes[n]t[n](...e.map(r=>"function"==typeof r?(e,t)=>r(e.toProxy(),t):r)):"every"===n||"some"===n?r=>t[n]((e,...t)=>r(e.toProxy(),...t)):"root"===n?()=>t.root().toProxy():"nodes"===n?t.nodes.map(e=>e.toProxy()):"first"===n||"last"===n?t[n].toProxy():t[n])},set(e,t,r){return e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0}}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){var r,n,s,i=this.index(e),o=this.normalize(t,this.proxyOf.nodes[i]).reverse(),i=this.index(e);for(r of o)this.proxyOf.nodes.splice(i+1,0,r);for(s in this.indexes)i<(n=this.indexes[s])&&(this.indexes[s]=n+o.length);return this.markDirty(),this}insertBefore(e,t){var r,n,s,i=this.index(e),o=this.normalize(t,this.proxyOf.nodes[i],0===i&&"prepend").reverse(),i=this.index(e);for(r of o)this.proxyOf.nodes.splice(i,0,r);for(s in this.indexes)i<=(n=this.indexes[s])&&(this.indexes[s]=n+o.length);return this.markDirty(),this}normalize(e,t){if("string"==typeof e)e=function t(e){return e.map(e=>(e.nodes&&(e.nodes=t(e.nodes)),delete e.source,e))}(wr(e).nodes);else if(void 0===e)e=[];else if(Array.isArray(e))for(var r of e=e.slice(0))r.parent&&r.parent.removeChild(r,"ignore");else if("root"===e.type&&"document"!==this.type)for(var n of e=e.nodes.slice(0))n.parent&&n.parent.removeChild(n,"ignore");else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new yr(e)]}else if(e.selector)e=[new br(e)];else if(e.name)e=[new _r(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new vr(e)]}return e.map(e=>(e[gr]||Sr.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[mr]&&function e(t){if(t[mr]=!1,t.proxyOf.nodes)for(var r of t.proxyOf.nodes)e(r)}(e),void 0===e.raws.before&&t&&void 0!==t.raws.before&&(e.raws.before=t.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}prepend(...e){for(var t of e=e.reverse()){var r,n,s=this.normalize(t,this.first,"prepend").reverse();for(r of s)this.proxyOf.nodes.unshift(r);for(n in this.indexes)this.indexes[n]=this.indexes[n]+s.length}return this.markDirty(),this}push(e){return(e.parent=this).proxyOf.nodes.push(e),this}removeAll(){for(var e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){var t,r;for(r in e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1),this.indexes)e<=(t=this.indexes[r])&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(t,r,n){return n||(n=r,r={}),this.walkDecls(e=>{r.props&&!r.props.includes(e.prop)||r.fast&&!e.value.includes(r.fast)||(e.value=e.value.replace(t,n))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(n){return this.each((t,e)=>{let r;try{r=n(t,e)}catch(e){throw t.addToError(e)}return!1!==r&&t.walk&&(r=t.walk(n)),r})}walkAtRules(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("atrule"===e.type&&r.test(e.name))return n(e,t)}):this.walk((e,t)=>{if("atrule"===e.type&&e.name===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("atrule"===e.type)return n(e,t)}))}walkComments(r){return this.walk((e,t)=>{if("comment"===e.type)return r(e,t)})}walkDecls(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("decl"===e.type&&r.test(e.prop))return n(e,t)}):this.walk((e,t)=>{if("decl"===e.type&&e.prop===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("decl"===e.type)return n(e,t)}))}walkRules(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("rule"===e.type&&r.test(e.selector))return n(e,t)}):this.walk((e,t)=>{if("rule"===e.type&&e.selector===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("rule"===e.type)return n(e,t)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}Sr.registerParse=e=>{wr=e},Sr.registerRule=e=>{br=e},Sr.registerAtRule=e=>{_r=e},Sr.registerRoot=e=>{Cr=e};i=Sr,Sr.default=Sr,Sr.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,_r.prototype):"rule"===e.type?Object.setPrototypeOf(e,br.prototype):"decl"===e.type?Object.setPrototypeOf(e,yr.prototype):"comment"===e.type?Object.setPrototypeOf(e,vr.prototype):"root"===e.type&&Object.setPrototypeOf(e,Cr.prototype),e[gr]=!0,e.nodes&&e.nodes.forEach(e=>{Sr.rebuild(e)})},ot=i;let xr,Ar;class kr extends ot{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){let t=new xr(new Ar,this,e);return t.stringify()}}kr.registerLazyResult=e=>{xr=e},kr.registerProcessor=e=>{Ar=e};e=kr;kr.default=kr;let Er={};function Or(e){Er[e]||(Er[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))}class Lr{constructor(e,t={}){for(var r in this.type="warning",this.text=e,t.node&&t.node.source&&(e=t.node.rangeBy(t),this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column),t)this[r]=t[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}St=Lr;Lr.default=Lr;let Mr=St;class Pr{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);e=new Mr(e,t);return this.messages.push(e),e}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}}Ke=Pr;Pr.default=Pr;let Rr=i;class Ir extends Rr{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}We=Ir;Ir.default=Ir,Rr.registerAtRule(Ir);let Tr=i,Br,Nr;class jr extends Tr{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){e=super.normalize(e);if(t)if("prepend"===r)1{Br=e},jr.registerProcessor=e=>{Nr=e};n=jr;jr.default=jr,Tr.registerRoot(jr);let Dr={comma(e){return Dr.split(e,[","],!0)},space(e){return Dr.split(e,[" ","\n","\t"])},split(e,t,u){let r=[],n="",s=!1,i=0,o=!1,a="",l=!1;for(var c of e)l?l=!1:"\\"===c?l=!0:o?c===a&&(o=!1):'"'===c||"'"===c?(o=!0,a=c):"("===c?i+=1:")"===c?0"space"!==e[0]&&"comment"!==e[0])&&(s.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(s,"value",a.concat(e),t),s.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new Jr;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){var t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1;var r;let n=!1,s=null,i=[];var o=e[1].startsWith("--");let a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)s=s||l,i.push("("===r?")":"]");else if(o&&n&&"{"===r)s=s||l,i.push("}");else if(0===i.length){if(";"===r){if(n)return void this.decl(a,o);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===i[i.length-1]&&(i.pop(),0===i.length&&(s=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),0e+t[1],""),e.raws[t]={raw:o,value:l}),e[t]=l}rule(e){e.pop();let t=new Jr;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){var t;let r="";for(;e.length&&("space"===(t=e[e.length-1][0])||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){var t;let r="";for(;e.length&&("space"===(t=e[0][0])||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t="";for(;e.length&&"space"===e[e.length-1][0];)t=e.pop()[1]+t;return t}stringFrom(t,r){let n="";for(let e=r;evn(e)),e}let wn={};class bn{constructor(e,t,r){this.stringified=!1,this.processed=!1;let n;if("object"!=typeof t||null===t||"root"!==t.type&&"document"!==t.type)if(t instanceof bn||t instanceof ln)n=vn(t.root),t.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=t.map);else{let e=cn;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{n=e(t,r)}catch(e){this.processed=!0,this.error=e}n&&!n[tn]&&sn.rebuild(n)}else n=vn(t);this.result=new ln(e,n,r),this.helpers={...wn,postcss:wn,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){var r=this.result.lastPlugin;try{if(t&&t.addToError(e),"CssSyntaxError"!==(this.error=e).name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){var n=r.postcssPlugin;let e=r.postcssVersion,t=this.result.processor.version;var s=e.split("."),i=t.split(".");(s[0]!==i[0]||parseInt(s[1])>parseInt(i[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+t+", but "+n+" uses "+e+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};var e,t=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(e of this.plugins)if("object"==typeof e)for(var r in e){if(!pn[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${e.postcssPlugin}. `+`Try to update PostCSS (${this.processor.version} now).`);if(!dn[r])if("object"==typeof e[r])for(var n in e[r])"*"===n?t(e,r,e[r][n]):t(e,r+"-"+n.toLowerCase(),e[r][n]);else"function"==typeof e[r]&&t(e,r,e[r])}this.hasListener=0t(e,this.helpers)),await Promise.all(i)):await t(r,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{var e;if("object"==typeof t&&t.Once)return"document"===this.result.root.type?mn((e=this.result.root.nodes.map(e=>t.Once(e,this.helpers)))[0])?Promise.all(e):e:t.Once(this.result.root,this.helpers);if("function"==typeof t)return t(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();var e=this.result.opts;let t=nn,r=(e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify),new rn(t,this.result.root,this.result.opts));e=r.generate();return this.result.css=e[0],this.result.map=e[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(var e of this.plugins)if(mn(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[en];)e[en]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(var t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||an("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(var[r,n]of e){this.result.lastPlugin=r;let e;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(mn(e))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:s}=r;if("root"===n.type||"document"===n.type||n.parent){if(0{e[en]||this.walkSync(e)});else{var r=this.listeners[t];if(r&&this.visitSync(r,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}bn.registerPostcss=e=>{wn=e};Me=bn;bn.default=bn,un.registerLazyResult(bn),on.registerLazyResult(bn);let _n=ft,Cn=Ne,Sn=Or,xn=Qr;const An=Ke;class kn{constructor(e,t,r){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;var e=Cn;this.result=new An(this._processor,void 0,this._opts),this.result.css=t;let n=this,s=(Object.defineProperty(this.result,"root",{get(){return n.root}}),new _n(e,void 0,this._opts,t));s.isMap()?([r,e]=s.generate(),r&&(this.result.css=r),e&&(this.result.map=e)):(s.clearAnnotation(),this.result.css=s.css)}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||Sn("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=xn;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}}ft=kn;kn.default=kn;let En=ft,On=Me,Ln=e,Mn=n;class Pn{constructor(e=[]){this.version="8.4.35",this.plugins=this.normalize(e)}normalize(e){let t=[];for(var r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return new(this.plugins.length||t.parser||t.stringifier||t.syntax?On:En)(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}ft=Pn;Pn.default=Pn,Mn.registerProcessor(Pn),Ln.registerProcessor(Pn);let Rn=He,In=qe,Tn=Ct,Bn=We,Nn=Je,jn=n,Dn=ot;function Un(e,r){if(Array.isArray(e))return e.map(e=>Un(e));let{inputs:t,...n}=e;if(t){r=[];for(var s of t){let e={...s,__proto__:Nn.prototype};e.map&&(e.map={...e.map,__proto__:In.prototype}),r.push(e)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>Un(e,r))),n.source){let{inputId:e,...t}=n.source;n.source=t,null!=e&&(n.source.input=r[e])}if("root"===n.type)return new jn(n);if("decl"===n.type)return new Rn(n);if("rule"===n.type)return new Dn(n);if("comment"===n.type)return new Tn(n);if("atrule"===n.type)return new Bn(n);throw new Error("Unknown node type: "+e.type)}qe=Un,Un.default=Un;let Fn=He,zn=Me;He=i;let $n=ft;Me=Ne,i=qe;let Gn=e;ft=St;let Hn=Ct,Vn=We;Ne=Ke,qe=Je,e=Qr,St=s;let Wn=ot,Jn=n;Ct=Ie;function o(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new $n(e)}o.plugin=function(r,n){let s=!1;function i(...e){console&&console.warn&&!s&&(s=!0,console.warn(r+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(r+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let t=n(...e);return t.postcssPlugin=r,t.postcssVersion=(new $n).version,t}let e;return Object.defineProperty(i,"postcss",{get(){return e=e||i(),e}}),i.process=function(e,t,r){return o([i(r)]).process(e,t)},i},o.stringify=Me,o.parse=e,o.fromJSON=i,o.list=St,o.comment=e=>new Hn(e),o.atRule=e=>new Vn(e),o.decl=e=>new Fn(e),o.rule=e=>new Wn(e),o.root=e=>new Jn(e),o.document=e=>new Gn(e),o.CssSyntaxError=t,o.Declaration=Fn,o.Container=He,o.Processor=$n,o.Document=Gn,o.Comment=Hn,o.Warning=ft,o.AtRule=Vn,o.Result=Ne,o.Input=qe,o.Rule=Wn,o.Root=Jn,o.Node=Ct,zn.registerPostcss(o);o.default=o;class qn extends HTMLElement{base;contents;component;listType="ul";iconSet;filter={value:"",caseSensitive:!1};static get observedAttributes(){return["contents","icon-set","max-depth","filter"]}_jsonToValueArray(e){let t=JSON.stringify(e);t=t.replace(/[\[\]{}\"]/g,"");let r=[];for(const n of t.split(","))r=r.concat(n.split(":"));return[...new Set(r)]}_emit(e,t,r){e=new CustomEvent(e,{detail:r,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}constructor(){super(),this.base=new $,this.setContents(this.getAttribute("contents")),this.iconSet=this.getAttribute("icon-set")?this.getAttribute("icon-type"):"file",this.maxDepth=this.getAttribute("max-depth")?parseInt(this.getAttribute("max-depth")):-1,this.setFilter(this.getAttribute("filter")),this.style.display="block",this.style.maxWidth="fit-content",this.style.margin="0 1rem 0 0",this.base.addEvent(".flk-branch","click",this.emitNodeToggle)}emitNodeToggle(e){e.stopPropagation();const t=F(e,"flk-tree-nav").target,r=z(e,"branchKey");let n=t.contents;for(const s of r.split("."))n=n[s];e=r.substring(r.indexOf(".")+1);t._emit("tree-click",t,{path:e,data:n,branch:"object"==typeof n})}convertJsonKeyToTitle(e){if(!e)return"";const t=(e="string"!=typeof e?e.toString():e).replace(/([A-Z_])/g,e=>"_"===e?" ":" "+e).trim();return t.charAt(0).toUpperCase()+t.slice(1)}setContents(e){var t=e||this.contents||[];try{switch(typeof t){case"string":this.contents=JSON.parse(t);break;case"object":Array.isArray(t)?this.contents=t:this.contents=[t]}}catch(e){console.log(e)}}applyFilter(e){let t;var r="details"===e.tagName.toLowerCase();t=this.filter.caseSensitive?e.dataset.branchValues.includes(this.filter.value):e.dataset.branchValues.toLowerCase().includes(this.filter.value.toLowerCase()),t?e.parentElement.classList.remove("hidden"):e.parentElement.classList.add("hidden"),r&&t?e.setAttribute("open",""):e.removeAttribute("open")}resetTree(e){e.parentElement.classList.remove("hidden"),e.removeAttribute("open")}filterTree(){let t=setTimeout(()=>{for(const e of this.querySelectorAll("[data-branch-values]"))void 0===this.filter.value||0===this.filter.value.length?this.resetTree(e):this.applyFilter(e);clearTimeout(t)},10)}setFilter(e){const t=e||{};try{switch(typeof t){case"string":t.includes("{")?(this.filter=JSON.parse(t),!1===this.filter.caseSensitive&&(this.filter.value=this.filter.value.toLowerCase())):this.filter.value=e.toLowerCase();break;case"object":this.filter=t}}catch(e){console.log(e)}this.filterTree()}createTextTag(n,s){if("string"==typeof n&&(n.includes("(")||n.includes("["))){let e=document.createElement("div");var i=n.indexOf("("),o=n.indexOf("["),i=-1===o?i:o;let t=document.createElement("span"),r=(t.innerText=this.convertJsonKeyToTitle(n.substring(0,i)),document.createElement("small"));r.innerText=n.substring(i),r.style.marginLeft="1rem",e.append(t,r),e.style.display="inline-flex",e.style.alignItems="center",s.append(e)}else s.innerText=this.convertJsonKeyToTitle(n)}createLeaf(e,t,r,n=[]){let s=document.createElement("li");s.classList.add("cursor-no-select"),s.style.marginTop="0.4rem",s.dataset.branchKey=r;const i="file"===this.iconSet?'':'';s.style.listStyleImage=`url('data:image/svg+xml,${i}')`,s.style.position="relative",s.style.left="2px";let o=document.createElement("span");r=[e].concat(n);if(o.dataset.branchValues=[...new Set(r)].join(),this.createTextTag(e,o),o.style.position="relative",o.style.top="-3px",s.append(o),t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);const i="file"===this.iconSet?G:H;e.style.listStyleImage=`url('data:image/svg+xml,${i}')`,e.append(s),t.append(e)}else t.append(s)}createBranch(r,t,n,s){if(s===this.maxDepth&&"object"==typeof r){var i,o=Array.isArray(r)?r:Object.keys(r);if("object"==typeof o[0]){let e=[];for(const g of o)e=e.concat(Object.keys(g));for(i of[...new Set(e)]){var h=document.createElement(this.listType);t.append(this.createBranch(i,h,n+"."+i,s+1))}}else for(const l of o){let e;r[l]&&(e=this._jsonToValueArray(r[l])),this.createLeaf(l,t,n,e)}}else if(Array.isArray(r)){var a;let e=[];if("object"==typeof r[0]){for(const y of r)e=e.concat(Object.keys(y));for(a of[...new Set(e)]){var p=document.createElement(this.listType);t.append(this.createBranch(a,p,n+"."+a,s+1))}}else for(var d in r){var f=document.createElement(this.listType);t.append(this.createBranch(r[d],f,n+"."+d,s+1))}}else if(null!==r&&"object"==typeof r){const c=[];for(const u of Object.keys(r)){let e=document.createElement("li"),t=(e.classList.add("cursor-no-select"),e.style.position="relative",e.style.left="2px",e.dataset.branchKey=n+"."+u,document.createElement("details"));t.classList.add("flk-branch"),t.dataset.branchValues=[u].concat(this._jsonToValueArray(r[u])),t.style.position="relative",t.style.top="-3px",t.classList.add("cursor-default");var m=document.createElement("summary");this.createTextTag(u,m),t.append(m),e.append(this.createBranch(r[u],t,n+"."+u,s+1)),c.push(e)}if(t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);o="file"===this.iconSet?G:H;e.style.listStyleImage=`url('data:image/svg+xml,${o}')`;for(const v of c)e.append(v);t.append(e)}else for(const e of c)t.append(e)}else this.createLeaf(r,t,n);return t}createHtml(){let e=document.createElement(this.listType);var t="file"===this.iconSet?G:'';if(e.style.listStyleImage=`url('data:image/svg+xml,${t}')`,e.style.marginLeft="3rem",this.contents.length){for(const r in this.contents)e=this.createBranch(this.contents[r],e,r,0);this.component=e}else this.component=e}attributeChangedCallback(e,t,r){switch(e){case"contents":this.setContents(r);break;case"icon-set":this.iconSet=r;break;case"max-depth":this.maxDepth="string"==typeof r?parseInt(r):r;break;case"filter":this.setFilter(r)}this.init()}connectedCallback(){this.init()}disconnectedCallback(){this.base.removeEvents(this)}init(){this.createHtml(),this.base.render(this)}}customElements.define("flk-table",W),customElements.define("flk-draggable",J),customElements.define("flk-modal",q),customElements.define("flk-dropdown",K),customElements.define("flk-tree-nav",qn)}(require$$0,require$$2,require$$1$1,require$$1); \ No newline at end of file +!function(e,n,s,i){"use strict";function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a,u,g,e=c(e),n=c(n),s=c(s),i=c(i);(t=a=a||{}).Date="date",t.String="string",t.Float="float",t.Number="number",t.Array="array",t.Object="object",t.Bool="bool",t.Currency="currency",t.Undefined="undefined",t.Null="null";const h={date:/^(\d{1,4}-\d{1,4}-\d{1,4}(T)?)/gim,currency:/^[$|€]\s?[0-9]*(\.|,)?\d*(\.|,)?\d*/gim,float:/\d+[,|.]\d+[,|.]?\d*/gim,currencySign:/\$|€/gim,array:/^\s?[[].[^,]+[\]],?/gi,precision:/[-+$€,.]/gm,string:/[a-zA-Z]/gim},m=e=>{return null===e||"null"===e?a.Null:e||0===e||!1===e?null===new RegExp(h.date).exec(e)||isNaN(Date.parse(e))?new RegExp(h.currency).exec(e)?a.Currency:!new RegExp(h.string).exec(e)&&new RegExp(h.float).exec(e.toString())?a.Float:isNaN(e)&&0!==e?Array.isArray(e)?a.Array:"object"==typeof e?a.Object:a.String:a.Number:a.Date:a.Undefined},y=(t,e)=>{const r={value:void 0,type:e=e||m(t),currencySign:""};switch(r.type){case a.String:r.value=t.toString();break;case a.Float:case a.Currency:var n=(t=t.toString()).match(new RegExp(/(,)/gim)),s=t.match(new RegExp(/(\.)/gim));if(n)for(let e=1;e<=n.length;e++)t=e!==n.length||s?t.replace(",",""):t.replace(",",".");if(r.type===a.Currency){const o=new RegExp(h.currencySign);var i=o.exec(t);r.currencySign=null!==i?i[0]:"",t=t.replace(o,"")}r.value=parseFloat(t).toPrecision(12);break;case a.Number:r.value=Number(t);break;case a.Date:r.value=Date.parse(t);break;case a.Array:t.length?"object"==typeof t[0]?r.value=t.map(e=>JSON.stringify(e)).join(", "):r.value=t.join(", "):r.value="";break;case a.Object:r.value=t;break;case a.Undefined:r.value="";break;case a.Null:r.value=null}return r};function v(e,t){var r;let n;for(r of e.split("."))r=r.trim(),n?"object"!=typeof n||Array.isArray(n)||(n=n[r]):n=t[r];return n}const b=(e,t)=>tet<=e,S=(e,t)=>e<=t,x=(e,t,r)=>r?e.toLowerCase()==t.toLowerCase():e==t,A=(e,t)=>e===t,k=(e,t)=>e!=t,E=(e,t)=>e!==t,L=(e,t)=>null!=t&&"string"==typeof e&&0<=e.toLowerCase().indexOf(t.toString().toLowerCase()),O=(e,t)=>null!=t&&0<=e.toString().toLowerCase().indexOf(t.toString().toLowerCase()),M=(e,t)=>null!=t&&"string"==typeof e&&e.toLowerCase().indexOf(t.toString().toLowerCase())<0;function P(r,n){if(0===n.length)return r;{var s=r;const o=[],a=[];let e=[];for(const l of n)l.type&&l.type!==u.And?(e.length&&a.push(e),e=[l]):e.push(l);a.push(e);let t=[];for(const e of a)t=t.concat(R(s,e));t=[...new Set(t)];var i=s.length;for(let e=0;e":return b;case"<":return _;case">=":return C;case"<=":return S;case"is":case"==":return x;case"!is":case"!=":return k;case"===":return A;case"!==":return E;case"like":case"~":case"contains":return L;case"!contains":case"!like":case"!~":return M;default:return O}}(a.operator);if(!l(i,o,a.ignoreCase)){e=!1;break}}e&&r.push(n)}return r};function T(e,t){if(!t||0===t.length)return e;if(1{if(0===r.length)r=r.concat(I(s,e));else{for(const t of r)n=n.concat(I(t,e));r=n,n=[]}}),r}return I(e,t[0])}function I(e,t){const r=[],n=[];do{if(!e||0===e.length)break;var s=e.shift();if(!s)break;const o=s[t];var i=n.indexOf(o.toString());0<=i?r[i].push(s):(n.push(o.toString()),void 0!==r[n.length-1]?r[n.length-1].push(s):r.push([s]))}while(0{if(t){var r=e;const n={};for(const s of t){let e=r.map(e=>e[s].toString());const i=e.map(e=>m(e));i.some(e=>e===a.Float)?(e=e.map(e=>parseFloat(e)),n[s]=parseFloat(e.reduce((e,t)=>e+t).toFixed(2))):(e=e.map(e=>parseInt(e)),n[s]=e.reduce((e,t)=>e+t))}return n}return{}};class D{model;sortDetails=[];filterDetails=[];selection=[];groupByProperties=[];distinctProperties=[];concatenationToken=", ";constructor(e){this.model=JSON.parse(JSON.stringify(e))}sort(e){return this.sortDetails=e,this}orderBy(e,t){return this.sortDetails.push({propertyName:e,direction:t}),this}thenOrderBy(e,t){return this.orderBy(e,t)}filter(e){return Array.isArray(e)?this.filterDetails=e:this.filterDetails.push(e),this}where(e,t,r,n,s){return this.filterDetails.push({propertyName:e,operator:t,value:r,type:n,ignoreCase:s}),this}andWhere(e,t,r,n){return this.where(e,t,r,u.And,n),this}orWhere(e,t,r,n){return this.where(e,t,r,u.Or,n),this}group(e){return this.groupByProperties=e,this}groupBy(e){return this.groupByProperties.push(e),this}thenGroupBy(e){return this.groupByProperties.push(e),this}select(e){return Array.isArray(e)?this.selection=e:"*"!==e&&(this.selection=[e]),this}distinct(e,t){return t&&(this.concatenationToken=t),Array.isArray(e)?this.distinctProperties=e:e&&(this.distinctProperties=[e]),this}execute(){return T(function(t,r){if(0===r.length)return t;{var n=r;let e=[];for(const s of t){const i={};for(const o of n)i[o]=s[o];e.push(i)}return e}}(function(r,n,u){if(!n||!n.length)return r;const s=[],h=[];for(const f of r){const o={};let t="";for(const e of n){var p=v(e,f);o[e]=p,t+=p}if(!h.includes(t)){let e=r;for(const a of Object.keys(o))e=e.filter(e=>e[a]===o[a]);h.push(t),s.push(e)}}const t=[];for(const m of s){let e={};for(const l of m){var i,d=Object.keys(e);if(d.length)for(const c of d)n.includes(c)||(i=e[c],Array.isArray(i)?(i=l[c],Array.isArray(i)?e[c]=[...new Set(...e[c].concat(l[c]))]:e[c].includes(l[c])||e[c].push(l[c])):isNaN(e[c])&&isNaN(l[c])?e[c]!==l[c]&&(e[c]=[e[c],l[c]]):e[c]=e[c]+l[c]);else e=l}t.push(e)}return t.forEach(e=>{for(const t in e)Array.isArray(e[t])&&(e[t]=e[t].join(u))}),t}(B(P(JSON.parse(JSON.stringify(this.model)),this.filterDetails),this.sortDetails),this.distinctProperties,this.concatenationToken),this.selection),this.groupByProperties)}sum(e,t){e=Array.isArray(e)?e:[e];return j(t||this.model,e)}}function U(e,t){t=t?t.toUpperCase():"FLK-";return e.toUpperCase().includes(t)}function F(e,t){var{timeStamp:r,type:n,x:s,y:i}=e;let o=e.target;do{if(!o||"HTML"===o.tagName||U(o.tagName,t)){"HTML"===o.tagName&&(o=null);break}}while(o=o.parentNode||o.parentElement,!U(o.tagName,t));return{target:o,timeStamp:r,type:n,x:s,y:i}}function z(e,t){let r=e.target,n="";for(;r.dataset[t]?n=r.dataset[t]:r=r.parentNode,!n;);return n}class ${constructor(){}_topLevelClasses=[];_events=[];generateId(){return"flk-"+function e(){const t=([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)),r=t.split("-")[0];return window.$flightkitUUIDStore||(window.$flightkitUUIDStore=[]),window.$flightkitUUIDStore.some(e=>e===r)?e():(window.$flightkitUUIDStore.push(r),r)}()}render(t){if(!t.component)throw new Error("Component is not assigned! Can't render");t.id=t.id||this.generateId();var e=this._getAllEventAttributes(t);if(e){var r="#"+t.id;for(const i of e){var n="e-"+i;this.addEvent(r,i,t.getAttribute(n))}}var s=Object.keys(t.classList).length;if(s){for(let e=0;e{this._assignToDom(t,t.component),clearTimeout(this._renderTimer)},10)}addEvent(e,t,r){this._events.push({selector:e,eventType:t,callback:r})}_getExternalCallback(e){let t=void 0;for(const r of e.split("."))t=(t||window)[r];return t}_getAllEventAttributes(e){e=e.attributes;const t=Array.from(e).filter(e=>e.name.startsWith("e-"));return t.map(e=>e.name.slice(2))}_isFlightkitElement(e){return e.toUpperCase().includes("FLK-")}_outerEventHandler(e){const t=F(e),r=(t.contents=e.detail,t.target.getAttribute("e-"+t.type));let n=void 0;for(const s of r.split("."))n=(n||window)[s];return e.preventDefault(),e.stopPropagation(),n(t)}_addEvents(e){if(e.isConnected)for(const r of this._events)if(r.selector.startsWith("."))for(const n of document.querySelectorAll(r.selector))this._addEventToElement(r,n);else{var t=document.querySelector(r.selector);this._addEventToElement(r,t)}}_addEventToElement(e,t){t&&("function"==typeof e.callback?(t.removeEventListener(e.eventType,e.callback),t.addEventListener(e.eventType,e.callback)):(t.removeEventListener(e.eventType,this._outerEventHandler),t.addEventListener(e.eventType,this._outerEventHandler)))}removeEvents(){for(const t of this._events)if(t.selector.startsWith("."))for(const r of document.querySelectorAll(t.selector))this._addEventToElement(t,r);else{var e=document.querySelector(t.selector);this._addEventToElement(t,e)}this._events=[]}_removeEventToElement(e,t){t&&("function"==typeof e.callback?t.removeEventListener(e.eventType,e.callback):t.removeEventListener(e.eventType,this._outerEventHandler))}_assignToDom(e,t){e.innerHTML="";for(const n of Array.isArray(t)?t:[t])e.append(n);const r=setTimeout(()=>{this._addEvents(e),clearTimeout(r)},10)}}const G='',H='';function V(e){const t=new DOMParser;return t.parseFromString(e,"image/svg+xml").documentElement}class W extends HTMLElement{base;component=null;_contents=[];_orderBy=[];properties=new Set;_columnOrder=[];_filter="";_selectionProperty="";_selectedIds=new Set;uniqueEntriesByProperties={};propertyLabelDictionary={};_templates={};_templateClasses={};static get observedAttributes(){return["contents","columns","order","filter","selection-property","templates"]}get columnOrder(){return this._columnOrder.length?this._columnOrder:this.properties}set columnOrder(e){let t;"string"==typeof e&&(t=e.split(",")),t=e,this._columnOrder=t}get contents(){return this._contents}set contents(e){this.analyzeData(e),this._contents=new D(e)}get orderBy(){return this._orderBy}set orderBy(e){if(Array.isArray(e))this._orderBy=e;else{const n=[];for(const s of e.split(",")){var t=s.split("|"),r=t[0],t=1e[r._selectionProperty])):new Set;e=t?r.contents.execute():[];r._emit("select",r,{selection:e}),r._updateCheckboxes(r)}emitSelect(e){var t=e.target.checked,r=e.target.dataset.objectId;const n=F(e).target,s=(t?n._selectedIds.add(r):n._selectedIds.delete(r),n._selectionProperty);e=n.contents.execute().filter(e=>n._selectedIds.has(e[s]));n._emit("select",n,{selection:e}),n._updateCheckboxes(n)}sortData(e){const t=F(e).target,r=z(e,"column");r&&(-1<(e=t._orderBy.findIndex(e=>e.propertyName===r))?"asc"===t._orderBy[e].direction?t._orderBy[e].direction="desc":t._orderBy.splice(e,1):t._orderBy.push({propertyName:r,direction:"asc"}),t.createHtml(),t.base.render(t))}setColumnOrder(e){this._columnOrder=e?Array.isArray(e)?e:e.split(","):[]}analyzeData(t){this.properties=new Set;var r=t.length;for(let e=0;e"_"===e?" ":" "+e.toLowerCase()).trim();var r=t.charAt(0).toUpperCase()+t.slice(1);return this.propertyLabelDictionary[e]=r}parseTemplate(e,n){return e.replace(/\{\{([\s\S]+?)\}\}/gim,(e,t)=>{let r="";t=t.trim();t=n[t];return t&&(r=t),Array.isArray(r)?r.join(", "):r.toString().trim()})}createSelectionCheckbox(e){const t=document.createElement("input");return t.setAttribute("type","checkbox"),t.classList.add("flk-selection-checkbox"),e&&(t.dataset.selected=e[this._selectionProperty]),t}createRow(e){const t=document.createElement("tr");if(this._selectionProperty.length){const s=document.createElement("td");var r=this.base.generateId();const i=this.createSelectionCheckbox(e);i.id=r,i.dataset.objectId=e[this._selectionProperty];var n=e[this._selectionProperty];this._selectedIds.has(n)?i.checked=!0:i.checked=!1,this.base.addEvent("#"+r,"change",this.emitSelect),s.append(i),t.append(s)}for(const o of this.columnOrder){const a=document.createElement("td");this._templates[o]?(a.innerHTML=this.parseTemplate(this._templates[o],e),this._templateClasses[o]&&a.classList.add(...this._templateClasses[o])):a.innerText=e[o],t.append(a)}return t}createBody(e){const t=document.createElement("tbody");for(const n of e){var r=this.createRow(n,null);t.append(r)}return t}createHead(){const e=document.createElement("thead"),t=document.createElement("tr");if(t.classList.add("cursor-pointer"),this._selectionProperty.length){const s=document.createElement("th");var r=this.base.generateId();const i=this.createSelectionCheckbox();i.id=r;var u=this.contents.execute().length;0e.propertyName===o);if(n){const c=document.createElement("span");c.innerHTML="asc"===n.direction?'':'',a.append(c)}t.append(a)}return e.append(t),e}addEvent(e,t,r){this.base.addEvent(e,t,r)}init(){this.createHtml(),this.base.render(this)}}class J extends HTMLElement{base;componentId;constructor(){super(),this.base=new $}connectedCallback(){var e=this.getAttribute("top"),t=this.getAttribute("left"),r=this.getAttribute("center"),n=this.getAttribute("zIndex");this.id||(this.id=this.base.generateId()),this.style.display="block",this.style.position="fixed","string"==typeof r?(this.style.top=e||"50%",this.style.left="50%",this.style.transform="translate(-50%, -50%)"):(this.style.top=e||this.clientTop+"px",this.style.left=t||this.clientLeft+"px"),n&&(this.style.zIndex=n),this.componentId=this.getAttribute("handle");const s=document.createElement("div");s.innerHTML=this.innerHTML,this.component=s;r="#"+(this.componentId||this.id);this.base.addEvent(r,"mousedown",this._dragElement),this.base.addEvent(r,"mouseup",this._reset),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this)}_dragElement(e){const r=F(e,"flk-draggable").target;let n,s;function t(e){n=e.clientX-r.offsetLeft,s=e.clientY-r.offsetTop}function i(e){var t=e.clientX-n,e=e.clientY-s;r.style.left=t+"px",r.style.top=e+"px"}function o(e){e.preventDefault()}function a(){r.removeAttribute("draggable"),r.removeEventListener("dragstart",t),r.removeEventListener("dragend",a),document.removeEventListener("dragover",o),document.removeEventListener("drop",i)}r.setAttribute("draggable",!0),r.addEventListener("dragstart",t),r.addEventListener("dragend",a),document.addEventListener("dragover",o),document.addEventListener("drop",i)}}class q extends HTMLElement{_id;base;_draggableId;constructor(){super(),this.base=new $}_emit(e,t,r){e=new CustomEvent(e,{detail:r,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}_closeModal(e){e.stopPropagation();const t=F(e,"flk-modal").target;t.classList.add("hidden")}closeModal(e){this.classList.add("hidden")}openModal(e=!0){const t=document.getElementById(this._draggableId);e&&(t.style.top="40%",t.style.left="50%"),this.classList.remove("hidden")}connectedCallback(){this.id||(this.id=this.base.generateId());const e=document.createElement("div");var t=this.base.generateId();const r=document.createElement("flk-draggable"),n=(this._draggableId=this.base.generateId(),r.id=this._draggableId,r.setAttribute("center",""),r.setAttribute("top","40%"),r.setAttribute("handle",t),r.setAttribute("zIndex","1080"),r.classList.add("border","shadow-lg","bg-white"),r.style.width="max-content",document.createElement("div"));var s=this.getAttribute("modal-title");if(s){const c=document.createElement("span");c.innerText=s,c.classList.add("ml-1","mr-auto"),n.append(c)}n.id=t;const i=this.getAttribute("header-class");let o=[];i?o=o.concat(i.split(" ")):o.push("bg-gray-light"),n.classList.add(...o,"border-bottom","row","justify-end","cursor-no-select");s=this.base.generateId();const a=document.createElement("button"),l=(a.classList.add("py-0","px-1","outline-hover","no-border","cursor-default",...o),a.innerText="X",a.id=s,n.append(a),r.append(n),document.createElement("div"));l.innerHTML=this.innerHTML,r.append(l),e.append(r),this.component=e,this.base.addEvent("#"+s,"click",this._closeModal),this.base.render(this),this.classList.add("hidden")}disconnectedCallback(){this.base.removeEvents(this)}}class K extends HTMLElement{base;_buttonId;_drawerId;_iconId;constructor(){super(),this.base=new $}connectedCallback(){this.style.position="relative",this.style.display="flex",this.style.width="fit-content",this._buttonId=this.base.generateId();const e=document.createElement("button"),t=(e.classList.add("row"),e.id=this._buttonId,document.createElement("span")),r=(t.innerText=this.getAttribute("text"),this._iconId=this.base.generateId(),document.createElement("span"));var n=V('');const s=V(''),i=(s.classList.add("hidden"),r.append(n,s),r.id=this._iconId,e.append(t,r),this._drawerId=this.base.generateId(),document.createElement("div"));i.id=this._drawerId,i.classList.add("shadow","inline-block","bg-white"),i.style.position="absolute",i.style.zIndex="1040";n=this.querySelector("template");n.innerHTML.length?i.innerHTML=n.innerHTML:i.append(n.firstChild),i.style.display="none",this.component=[e,i],this.base.addEvent("#"+this._buttonId,"click",this.toggleMenu);const o=document.querySelector("body");""!==o.getAttribute("flk-close-dropdown")&&(o.setAttribute("flk-close-dropdown",""),o.addEventListener("click",this.closeAllDropdownButtons)),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this);var e=document.querySelectorAll("flk-dropdown");if(!e||!e.length){const t=document.querySelector("body");t.removeAttribute("flk-close-dropdown"),t.removeEventListener("click",this.closeAllDropdownButtons)}}toggleMenu(e){const t=F(e).target;e=t._drawerId;const r=document.getElementById(e);var e="none"!==r.style.display,n=(r.style.display=e?"none":"block",t.getAttribute("drawer-width")),n=("string"==typeof t.getAttribute("right")&&(r.style.right="0px"),r.style.top=t.offsetHeight+"px",r.style.width=n||t.offsetWidth+"px",t._iconId);const s=document.getElementById(n);e?(s.childNodes[0].classList.remove("hidden"),s.childNodes[1].classList.add("hidden")):(s.childNodes[0].classList.add("hidden"),s.childNodes[1].classList.remove("hidden"))}_closeDropdown(){var e=this._drawerId;const t=document.getElementById(e);if("none"!==t.style.display){e=this._iconId;const r=document.getElementById(e);t.style.display="none",r.childNodes[0].classList.remove("hidden"),r.childNodes[1].classList.add("hidden")}}closeAllDropdownButtons(e){var t,r=F(e,"flk-dropdown").target,e=document.querySelectorAll("flk-dropdown");if(r)for(const n of e)r._buttonId!==n._buttonId&&(t=n._drawerId,"none"!==document.getElementById(t).style.display&&n._closeDropdown());else for(const s of e)s._closeDropdown()}}var t={exports:{}};let Z=e.default,Y=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||"win32"===process.platform||Z.isatty(1)&&"dumb"!==process.env.TERM||"CI"in process.env),r=(r,n,s=r)=>e=>{let t=""+e;e=t.indexOf(n,r.length);return~e?r+X(t,n,s,e)+n:r+t+n},X=(e,t,r,n)=>{var s=e.substring(0,n)+r;let i=e.substring(n+t.length);e=i.indexOf(t);return~e?s+X(i,t,r,e):s+i};e=(e=Y)=>({isColorSupported:e,reset:e?e=>`${e}`:String,bold:e?r("","",""):String,dim:e?r("","",""):String,italic:e?r("",""):String,underline:e?r("",""):String,inverse:e?r("",""):String,hidden:e?r("",""):String,strikethrough:e?r("",""):String,black:e?r("",""):String,red:e?r("",""):String,green:e?r("",""):String,yellow:e?r("",""):String,blue:e?r("",""):String,magenta:e?r("",""):String,cyan:e?r("",""):String,white:e?r("",""):String,gray:e?r("",""):String,bgBlack:e?r("",""):String,bgRed:e?r("",""):String,bgGreen:e?r("",""):String,bgYellow:e?r("",""):String,bgBlue:e?r("",""):String,bgMagenta:e?r("",""):String,bgCyan:e?r("",""):String,bgWhite:e?r("",""):String});t.exports=e(),t.exports.createColors=e;const Q="'".charCodeAt(0),ee='"'.charCodeAt(0),te="\\".charCodeAt(0),re="/".charCodeAt(0),ne="\n".charCodeAt(0),se=" ".charCodeAt(0),ie="\f".charCodeAt(0),oe="\t".charCodeAt(0),ae="\r".charCodeAt(0),le="[".charCodeAt(0),ce="]".charCodeAt(0),ue="(".charCodeAt(0),he=")".charCodeAt(0),pe="{".charCodeAt(0),de="}".charCodeAt(0),fe=";".charCodeAt(0),me="*".charCodeAt(0),ge=":".charCodeAt(0),ye="@".charCodeAt(0),ve=/[\t\n\f\r "#'()/;[\\\]{}]/g,we=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,be=/.[\r\n"'(/\\]/,_e=/[\da-f]/i;function Ce(t,e={}){let n=t.css.valueOf(),d=e.ignoreErrors,s,i,f,m,o,a,l,g,c,u,y=n.length,h=0,v=[],p=[];function w(e){throw t.error("Unclosed "+e,h)}return{back:function(e){p.push(e)},endOfFile:function(){return 0===p.length&&h>=y},nextToken:function(e){if(p.length)return p.pop();if(!(h>=y)){var t=!!e&&e.ignoreUnclosed;switch(s=n.charCodeAt(h),s){case ne:case se:case oe:case ae:case ie:for(i=h;i+=1,s=n.charCodeAt(i),s===se||s===ne||s===oe||s===ae||s===ie;);u=["space",n.slice(h,i)],h=i-1;break;case le:case ce:case pe:case de:case ge:case fe:case he:var r=String.fromCharCode(s);u=[r,r,h];break;case ue:if(g=v.length?v.pop()[1]:"",c=n.charCodeAt(h+1),"url"===g&&c!==Q&&c!==ee&&c!==se&&c!==ne&&c!==oe&&c!==ie&&c!==ae){i=h;do{if(a=!1,i=n.indexOf(")",i+1),-1===i){if(d||t){i=h;break}w("bracket")}for(l=i;n.charCodeAt(l-1)===te;)--l,a=!a}while(a);u=["brackets",n.slice(h,i+1),h,i],h=i}else i=n.indexOf(")",h+1),m=n.slice(h,i+1),-1===i||be.test(m)?u=["(","(",h]:(u=["brackets",m,h,i],h=i);break;case Q:case ee:f=s===Q?"'":'"',i=h;do{if(a=!1,i=n.indexOf(f,i+1),-1===i){if(d||t){i=h+1;break}w("string")}for(l=i;n.charCodeAt(l-1)===te;)--l,a=!a}while(a);u=["string",n.slice(h,i+1),h,i],h=i;break;case ye:ve.lastIndex=h+1,ve.test(n),i=0===ve.lastIndex?n.length-1:ve.lastIndex-2,u=["at-word",n.slice(h,i+1),h,i],h=i;break;case te:for(i=h,o=!0;n.charCodeAt(i+1)===te;)i+=1,o=!o;if(s=n.charCodeAt(i+1),o&&s!==re&&s!==se&&s!==ne&&s!==oe&&s!==ae&&s!==ie&&(i+=1,_e.test(n.charAt(i)))){for(;_e.test(n.charAt(i+1));)i+=1;n.charCodeAt(i+1)===se&&(i+=1)}u=["word",n.slice(h,i+1),h,i],h=i;break;default:h=(s===re&&n.charCodeAt(h+1)===me?(i=n.indexOf("*/",h+2)+1,0===i&&(d||t?i=n.length:w("comment")),u=["comment",n.slice(h,i+1),h,i]):(we.lastIndex=h+1,we.test(n),i=0===we.lastIndex?n.length-1:we.lastIndex-2,u=["word",n.slice(h,i+1),h,i],v.push(u)),i)}return h++,u}},position:function(){return h}}}e=t.exports;let Se=Ce,xe;const Ae={";":e.yellow,":":e.yellow,"(":e.cyan,")":e.cyan,"[":e.yellow,"]":e.yellow,"{":e.yellow,"}":e.yellow,"at-word":e.cyan,brackets:e.cyan,call:e.cyan,class:e.yellow,comment:e.gray,hash:e.magenta,string:e.green};function ke(e){let r=Se(new xe(e),{ignoreErrors:!0}),n="";for(;!r.endOfFile();){let e=r.nextToken(),t=Ae[function([e,t],r){if("word"===e){if("."===t[0])return"class";if("#"===t[0])return"hash"}if(!r.endOfFile()){t=r.nextToken();if(r.back(t),"brackets"===t[0]||"("===t[0])return"call"}return e}(e,r)];t?n+=e[1].split(/\r?\n/).map(e=>t(e)).join("\n"):n+=e[1]}return n}ke.registerInput=function(e){xe=e};e=ke;let Ee=t.exports,Le=e;class Oe extends Error{constructor(e,t,r,n,s,i){super(e),this.name="CssSyntaxError",this.reason=e,s&&(this.file=s),n&&(this.source=n),i&&(this.plugin=i),void 0!==t&&void 0!==r&&("number"==typeof t?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,Oe)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file||"",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source,r=(null==e&&(e=Ee.isColorSupported),Le&&e&&(t=Le(t)),t.split(/\r?\n/)),n=Math.max(this.line-3,0);var s=Math.min(this.line+2,r.length);let i=String(s).length,o,a;if(e){let{bold:t,gray:r,red:n}=Ee.createColors(!0);o=e=>t(n(e)),a=e=>r(e)}else o=a=e=>e;return r.slice(n,s).map((e,t)=>{var t=n+1+t;let r=" "+(" "+t).slice(-i)+" | ";return t===this.line?(t=a(r.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," "),o(">")+a(r)+e+"\n "+t+o("^")):" "+a(r)+e}).join("\n")}toString(){let e=this.showSourceCode();return e=e&&"\n\n"+e+"\n",this.name+": "+this.message+e}}var t=Oe,Me=(Oe.default=Oe,{});Me.isClean=Symbol("isClean"),Me.my=Symbol("my");const Pe={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class Re{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name;var n=e.params?this.rawValue(e,"params"):"";void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes?this.block(e,r+n):(t=(e.raws.between||"")+(t?";":""),this.builder(r+n+t,e))}beforeAfter(e,t){let r,n=(r="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose"),e.parent),s=0;for(;n&&"root"!==n.type;)s+=1,n=n.parent;if(r.includes("\n")){var i=this.raw(e,null,"indent");if(i.length)for(let e=0;e{if(n=e.raws[t],void 0!==n)return!1}),void 0===n&&(n=Pe[r]),i.rawCache[r]=n,n}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&0{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=void 0===r?this.raw(t,null,"beforeDecl"):r&&r.replace(/\S/g,""),r}rawBeforeDecl(e,t){let r;return e.walkDecls(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=void 0===r?this.raw(t,null,"beforeRule"):r&&r.replace(/\S/g,""),r}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(t){let r;return t.walk(e=>{if(e.nodes&&(e.parent!==t||t.first!==e)&&void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=r&&r.replace(/\S/g,""),r}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(r){if(r.raws.indent)return r.raws.indent;let n;return r.walk(e=>{var t=e.parent;if(t&&t!==r&&t.parent&&t.parent===r&&void 0!==e.raws.before)return t=e.raws.before.split("\n"),n=t[t.length-1],n=n.replace(/\S/g,""),!1}),n}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){var r=e[t],e=e.raws[t];return e&&e.value===r?e.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}}var Te=Re;Re.default=Re;let Ie=Te;function Be(e,t){let r=new Ie(t);r.stringify(e)}var Ne=Be;Be.default=Be;let{isClean:je,my:De}=Me,Ue=t,Fe=Te,ze=Ne;function $e(t,r){let n=new t.constructor;for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&"proxyCache"!==s){let e=t[s];var i=typeof e;"parent"===s&&"object"==i?r&&(n[s]=r):"source"===s?n[s]=e:Array.isArray(e)?n[s]=e.map(e=>$e(e,n)):("object"==i&&null!==e&&(e=$e(e)),n[s]=e)}return n}class Ge{constructor(e={}){for(var t in this.raws={},this[je]=!1,this[De]=!0,e)if("nodes"===t){this.nodes=[];for(var r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){var t;return e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)&&(t=this.source,e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)),e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(var t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=$e(this);for(var r in e)t[r]=e[r];return t}cloneAfter(e={}){e=this.clone(e);return this.parent.insertAfter(this,e),e}cloneBefore(e={}){e=this.clone(e);return this.parent.insertBefore(this,e),e}error(e,t={}){var r,n;return this.source?({end:r,start:n}=this.rangeBy(t),this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)):new Ue(e)}getProxyProcessor(){return{get(e,t){return"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t]},set(e,t,r){return e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0}}}markDirty(){if(this[je]){this[je]=!1;let e=this;for(;e=e.parent;)e[je]=!1}}next(){var e;if(this.parent)return e=this.parent.index(this),this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;return e.index?r=this.positionInside(e.index,t):!e.word||-1!==(e=(t=this.toString()).indexOf(e.word))&&(r=this.positionInside(e,t)),r}positionInside(t,e){var r=e||this.toString();let n=this.source.start.column,s=this.source.start.line;for(let e=0;e"object"==typeof e&&e.toJSON?e.toJSON(null,r):e);else if("object"==typeof t&&t.toJSON)n[s]=t.toJSON(null,r);else if("source"===s){let e=r.get(t.input);null==e&&(e=i,r.set(t.input,i),i++),n[s]={end:t.end,inputId:e,start:t.start}}else n[s]=t}return t&&(n.inputs=[...r.keys()].map(e=>e.toJSON())),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=ze){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(var s in r)n[s]=r[s];return e.warn(t,n)}get proxyOf(){return this}}var Te=Ge,He=(Ge.default=Ge,Te);class Ve extends He{constructor(e){super(e=e&&void 0!==e.value&&"string"!=typeof e.value?{...e,value:String(e.value)}:e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}}var He=Ve,We=(Ve.default=Ve,{}),Je={},qe={},Ke={},Ze="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),Ye=(Ke.encode=function(e){if(0<=e&&e>>=5)&&(t|=32),r+=Ye.encode(t),0>1,1==(1&a)?-i:i),r.rest=t};var Ke={},l=Ke,Xe=(l.getArg=function(e,t,r){if(t in e)return e[t];if(3===arguments.length)return r;throw new Error('"'+t+'" is a required argument.')},/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/),Qe=/^data:.+\,.+$/;function et(e){e=e.match(Xe);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}function tt(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}l.urlParse=et,l.urlGenerate=tt,rt=function(e){var t=e,r=et(e);if(r){if(!r.path)return e;t=r.path}for(var n,e=l.isAbsolute(t),s=[],i=0;;){if(n=i,-1===(i=t.indexOf("/",n))){s.push(t.slice(n));break}for(s.push(t.slice(n,i));in;e--){var o=r[e-1],a=r[e];if(Pt(o,a)<=0)break;r[e-1]=a,r[e]=o}else Ot(r,Pt,n)}function Tt(e,s){var t=e,e=("string"==typeof e&&(t=w.parseSourceMapInput(e)),w.getArg(t,"version")),t=w.getArg(t,"sections");if(e!=this._version)throw new Error("Unsupported version: "+e);this._sources=new Et,this._names=new Et;var i={line:-1,column:0};this._sections=t.map(function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var t=w.getArg(e,"offset"),r=w.getArg(t,"line"),n=w.getArg(t,"column");if(r=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))},p.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;var r=this._findSourceIndex(e);if(0<=r)return this.sourcesContent[r];var n,r=e;if(null!=this.sourceRoot&&(r=w.relative(this.sourceRoot,r)),null!=this.sourceRoot&&(n=w.urlParse(this.sourceRoot))){e=r.replace(/^file:\/\//,"");if("file"==n.scheme&&this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];if((!n.path||"/"==n.path)&&this._sources.has("/"+r))return this.sourcesContent[this._sources.indexOf("/"+r)]}if(t)return null;throw new Error('"'+r+'" is not in the SourceMap.')},p.prototype.generatedPositionFor=function(e){var t=w.getArg(e,"source");if((t=this._findSourceIndex(t))<0)return{line:null,column:null,lastColumn:null};t={source:t,originalLine:w.getArg(e,"line"),originalColumn:w.getArg(e,"column")},e=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",w.compareByOriginalPositions,w.getArg(e,"bias",f.GREATEST_LOWER_BOUND));if(0<=e){e=this._originalMappings[e];if(e.source===t.source)return{line:w.getArg(e,"generatedLine",null),column:w.getArg(e,"generatedColumn",null),lastColumn:w.getArg(e,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},ft.BasicSourceMapConsumer=p,(Tt.prototype=Object.create(f.prototype)).constructor=f,Tt.prototype._version=3,Object.defineProperty(Tt.prototype,"sources",{get:function(){for(var e=[],t=0;t{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(n,s=21)=>(e=s)=>{let t="",r=e;for(;r--;)t+=n[Math.random()*n.length|0];return t}};let{SourceMapConsumer:Ut,SourceMapGenerator:Ft}=We,{existsSync:zt,readFileSync:$t}=i.default,{dirname:Gt,join:Ht}=n.default;class Vt{constructor(e,t){!1!==t.map&&(this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:"),e=t.map?t.map.prev:void 0,e=this.loadMap(t.from,e),!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Gt(this.mapFile)),e&&(this.text=e))}consumer(){return this.consumerCache||(this.consumerCache=new Ut(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+t)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);var r,n;t&&(r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r),-1"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,i,o;t&&"object"==typeof t?(a=r,r="number"==typeof(l=t).offset?(t=(c=this.fromOffset(l.offset)).line,c.col):(t=l.line,l.column),o="number"==typeof a.offset?(c=this.fromOffset(a.offset),i=c.line,c.col):(i=a.line,a.column)):r||(t=(l=this.fromOffset(t)).line,r=l.col);var a,l,c=this.origin(t,r,i,o);return s=c?new Xt(e,void 0===c.endLine?c.line:{column:c.column,line:c.line},void 0===c.endLine?c.column:{column:c.endColumn,line:c.endLine},c.source,c.file,n.plugin):new Xt(e,void 0===i?t:{column:r,line:t},void 0===i?r:{column:o,line:i},this.css,this.file,n.plugin),s.input={column:r,endColumn:o,endLine:i,line:t,source:this.css},this.file&&(Jt&&(s.input.url=Jt(this.file).toString()),s.input.file=this.file),s}fromOffset(t){let n;if(this[er])n=this[er];else{var s=this.css.split("\n");n=new Array(s.length);let r=0;for(let e=0,t=s.length;e>1),t=n[i+1])){r=i;break}r=i+1}}return{col:t-n[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Kt(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let s=this.map.consumer();t=s.originalPositionFor({column:t,line:e});if(!t.source)return!1;let i;"number"==typeof r&&(i=s.originalPositionFor({column:n,line:r}));let o,a=(o=qt(t.source)?Jt(t.source):new URL(t.source,this.map.consumer().sourceRoot||Jt(this.map.mapFile)),{column:t.column,endColumn:i&&i.column,endLine:i&&i.line,line:t.line,url:o.toString()});if("file:"===o.protocol){if(!Wt)throw new Error("file: protocol is not available in this PostCSS build");a.file=Wt(o)}e=s.sourceContentFor(t.source);return e&&(a.source=e),a}toJSON(){let e={};for(var t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}}Je=nr;nr.default=nr,Yt&&Yt.registerInput&&Yt.registerInput(nr);let{SourceMapConsumer:sr,SourceMapGenerator:ir}=We,{dirname:or,relative:ar,resolve:lr,sep:cr}=n.default,ur=s.default["pathToFileURL"],hr=Je,pr=Boolean(sr&&ir),dr=Boolean(or&&lr&&ar&&cr);ft=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e,t=(e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map","\n");this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(var t of this.previous()){var r=this.toUrl(this.path(t.file)),n=t.root||or(t.file);let e;!1===this.mapOpts.sourcesContent?(e=new sr(t.text),e.sourcesContent&&(e.sourcesContent=null)):e=t.consumer(),this.map.applySourceMap(e,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let t;for(let e=this.root.nodes.length-1;0<=e;e--)t=this.root.nodes[e],"comment"===t.type&&0===t.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(e)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),dr&&pr&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,e=>{t+=e}),[t]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=ir.fromSourceMap(e)}else this.map=new ir({file:this.outputFile()}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):""});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&0",o={generated:{column:0,line:0},original:{column:0,line:0},source:""},a,l;this.stringify(this.root,(e,t,r)=>{this.css+=e,t&&"end"!==r&&(o.generated.line=n,o.generated.column=s-1,t.source&&t.source.start?(o.source=this.sourcePath(t),o.original.line=t.source.start.line,o.original.column=t.source.start.column-1):(o.source=i,o.original.line=1,o.original.column=0),this.map.addMapping(o)),a=e.match(/\n/g),a?(n+=a.length,l=e.lastIndexOf("\n"),s=e.length-l):s+=e.length,t&&"start"!==r&&(e=t.parent||{raws:{}},("decl"===t.type||"atrule"===t.type&&!t.nodes)&&t===e.last&&!e.raws.semicolon||(t.source&&t.source.end?(o.source=this.sourcePath(t),o.original.line=t.source.end.line,o.original.column=t.source.end.column-1,o.generated.line=n,o.generated.column=s-2):(o.source=i,o.original.line=1,o.original.column=0,o.generated.line=n,o.generated.column=s-1),this.map.addMapping(o)))})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;var e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:0e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;var t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?or(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=or(lr(r,this.mapOpts.annotation)));t=ar(r,e);return this.memoizedPaths.set(e,t),t}previous(){var e;return this.previousMaps||(this.previousMaps=[],this.root?this.root.walk(e=>{e.source&&e.source.input.map&&(e=e.source.input.map,this.previousMaps.includes(e)||this.previousMaps.push(e))}):(e=new hr(this.originalCSS,this.opts)).map&&this.previousMaps.push(e.map)),this.previousMaps}setSourcesContent(){let r={};var e;this.root?this.root.walk(e=>{var t;!e.source||(t=e.source.input.from)&&!r[t]&&(r[t]=!0,t=this.usesFileUrls?this.toFileUrl(t):this.toUrl(this.path(t)),this.map.setSourceContent(t,e.source.input.css))}):this.css&&(e=this.opts.from?this.toUrl(this.path(this.opts.from)):"",this.map.setSourceContent(e,this.css))}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){var t=this.memoizedFileURLs.get(e);if(t)return t;if(ur)return t=ur(e).toString(),this.memoizedFileURLs.set(e,t),t;throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){var t=this.memoizedURLs.get(e);if(t)return t;"\\"===cr&&(e=e.replace(/\\/g,"/"));t=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,t),t}};class fr extends Te{constructor(e){super(e),this.type="comment"}}Ct=fr;fr.default=fr;let{isClean:mr,my:gr}=Me,yr=He,vr=Ct,wr,br,_r,Cr;class Sr extends Te{append(...e){for(var t of e){var r;for(r of this.normalize(t,this.last))this.proxyOf.nodes.push(r)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(var t of this.nodes)t.cleanRaws(e)}each(r){if(this.proxyOf.nodes){var n=this.getIterator();let e,t;for(;this.indexes[n]t[n](...e.map(r=>"function"==typeof r?(e,t)=>r(e.toProxy(),t):r)):"every"===n||"some"===n?r=>t[n]((e,...t)=>r(e.toProxy(),...t)):"root"===n?()=>t.root().toProxy():"nodes"===n?t.nodes.map(e=>e.toProxy()):"first"===n||"last"===n?t[n].toProxy():t[n])},set(e,t,r){return e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0}}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){var r,n,s,i=this.index(e),o=this.normalize(t,this.proxyOf.nodes[i]).reverse(),i=this.index(e);for(r of o)this.proxyOf.nodes.splice(i+1,0,r);for(s in this.indexes)i<(n=this.indexes[s])&&(this.indexes[s]=n+o.length);return this.markDirty(),this}insertBefore(e,t){var r,n,s,i=this.index(e),o=this.normalize(t,this.proxyOf.nodes[i],0===i&&"prepend").reverse(),i=this.index(e);for(r of o)this.proxyOf.nodes.splice(i,0,r);for(s in this.indexes)i<=(n=this.indexes[s])&&(this.indexes[s]=n+o.length);return this.markDirty(),this}normalize(e,t){if("string"==typeof e)e=function t(e){return e.map(e=>(e.nodes&&(e.nodes=t(e.nodes)),delete e.source,e))}(wr(e).nodes);else if(void 0===e)e=[];else if(Array.isArray(e))for(var r of e=e.slice(0))r.parent&&r.parent.removeChild(r,"ignore");else if("root"===e.type&&"document"!==this.type)for(var n of e=e.nodes.slice(0))n.parent&&n.parent.removeChild(n,"ignore");else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new yr(e)]}else if(e.selector)e=[new br(e)];else if(e.name)e=[new _r(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new vr(e)]}return e.map(e=>(e[gr]||Sr.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[mr]&&function e(t){if(t[mr]=!1,t.proxyOf.nodes)for(var r of t.proxyOf.nodes)e(r)}(e),void 0===e.raws.before&&t&&void 0!==t.raws.before&&(e.raws.before=t.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}prepend(...e){for(var t of e=e.reverse()){var r,n,s=this.normalize(t,this.first,"prepend").reverse();for(r of s)this.proxyOf.nodes.unshift(r);for(n in this.indexes)this.indexes[n]=this.indexes[n]+s.length}return this.markDirty(),this}push(e){return(e.parent=this).proxyOf.nodes.push(e),this}removeAll(){for(var e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){var t,r;for(r in e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1),this.indexes)e<=(t=this.indexes[r])&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(t,r,n){return n||(n=r,r={}),this.walkDecls(e=>{r.props&&!r.props.includes(e.prop)||r.fast&&!e.value.includes(r.fast)||(e.value=e.value.replace(t,n))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(n){return this.each((t,e)=>{let r;try{r=n(t,e)}catch(e){throw t.addToError(e)}return!1!==r&&t.walk&&(r=t.walk(n)),r})}walkAtRules(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("atrule"===e.type&&r.test(e.name))return n(e,t)}):this.walk((e,t)=>{if("atrule"===e.type&&e.name===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("atrule"===e.type)return n(e,t)}))}walkComments(r){return this.walk((e,t)=>{if("comment"===e.type)return r(e,t)})}walkDecls(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("decl"===e.type&&r.test(e.prop))return n(e,t)}):this.walk((e,t)=>{if("decl"===e.type&&e.prop===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("decl"===e.type)return n(e,t)}))}walkRules(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("rule"===e.type&&r.test(e.selector))return n(e,t)}):this.walk((e,t)=>{if("rule"===e.type&&e.selector===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("rule"===e.type)return n(e,t)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}Sr.registerParse=e=>{wr=e},Sr.registerRule=e=>{br=e},Sr.registerAtRule=e=>{_r=e},Sr.registerRoot=e=>{Cr=e};i=Sr,Sr.default=Sr,Sr.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,_r.prototype):"rule"===e.type?Object.setPrototypeOf(e,br.prototype):"decl"===e.type?Object.setPrototypeOf(e,yr.prototype):"comment"===e.type?Object.setPrototypeOf(e,vr.prototype):"root"===e.type&&Object.setPrototypeOf(e,Cr.prototype),e[gr]=!0,e.nodes&&e.nodes.forEach(e=>{Sr.rebuild(e)})},ot=i;let xr,Ar;class kr extends ot{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){let t=new xr(new Ar,this,e);return t.stringify()}}kr.registerLazyResult=e=>{xr=e},kr.registerProcessor=e=>{Ar=e};e=kr;kr.default=kr;let Er={};function Lr(e){Er[e]||(Er[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))}class Or{constructor(e,t={}){for(var r in this.type="warning",this.text=e,t.node&&t.node.source&&(e=t.node.rangeBy(t),this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column),t)this[r]=t[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}St=Or;Or.default=Or;let Mr=St;class Pr{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);e=new Mr(e,t);return this.messages.push(e),e}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}}Ke=Pr;Pr.default=Pr;let Rr=i;class Tr extends Rr{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}We=Tr;Tr.default=Tr,Rr.registerAtRule(Tr);let Ir=i,Br,Nr;class jr extends Ir{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){e=super.normalize(e);if(t)if("prepend"===r)1{Br=e},jr.registerProcessor=e=>{Nr=e};n=jr;jr.default=jr,Ir.registerRoot(jr);let Dr={comma(e){return Dr.split(e,[","],!0)},space(e){return Dr.split(e,[" ","\n","\t"])},split(e,t,u){let r=[],n="",s=!1,i=0,o=!1,a="",l=!1;for(var c of e)l?l=!1:"\\"===c?l=!0:o?c===a&&(o=!1):'"'===c||"'"===c?(o=!0,a=c):"("===c?i+=1:")"===c?0"space"!==e[0]&&"comment"!==e[0])&&(s.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(s,"value",a.concat(e),t),s.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new Jr;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){var t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1;var r;let n=!1,s=null,i=[];var o=e[1].startsWith("--");let a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)s=s||l,i.push("("===r?")":"]");else if(o&&n&&"{"===r)s=s||l,i.push("}");else if(0===i.length){if(";"===r){if(n)return void this.decl(a,o);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===i[i.length-1]&&(i.pop(),0===i.length&&(s=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),0e+t[1],""),e.raws[t]={raw:o,value:l}),e[t]=l}rule(e){e.pop();let t=new Jr;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){var t;let r="";for(;e.length&&("space"===(t=e[e.length-1][0])||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){var t;let r="";for(;e.length&&("space"===(t=e[0][0])||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t="";for(;e.length&&"space"===e[e.length-1][0];)t=e.pop()[1]+t;return t}stringFrom(t,r){let n="";for(let e=r;evn(e)),e}let wn={};class bn{constructor(e,t,r){this.stringified=!1,this.processed=!1;let n;if("object"!=typeof t||null===t||"root"!==t.type&&"document"!==t.type)if(t instanceof bn||t instanceof ln)n=vn(t.root),t.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=t.map);else{let e=cn;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{n=e(t,r)}catch(e){this.processed=!0,this.error=e}n&&!n[tn]&&sn.rebuild(n)}else n=vn(t);this.result=new ln(e,n,r),this.helpers={...wn,postcss:wn,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){var r=this.result.lastPlugin;try{if(t&&t.addToError(e),"CssSyntaxError"!==(this.error=e).name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){var n=r.postcssPlugin;let e=r.postcssVersion,t=this.result.processor.version;var s=e.split("."),i=t.split(".");(s[0]!==i[0]||parseInt(s[1])>parseInt(i[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+t+", but "+n+" uses "+e+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};var e,t=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(e of this.plugins)if("object"==typeof e)for(var r in e){if(!pn[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${e.postcssPlugin}. `+`Try to update PostCSS (${this.processor.version} now).`);if(!dn[r])if("object"==typeof e[r])for(var n in e[r])"*"===n?t(e,r,e[r][n]):t(e,r+"-"+n.toLowerCase(),e[r][n]);else"function"==typeof e[r]&&t(e,r,e[r])}this.hasListener=0t(e,this.helpers)),await Promise.all(i)):await t(r,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{var e;if("object"==typeof t&&t.Once)return"document"===this.result.root.type?mn((e=this.result.root.nodes.map(e=>t.Once(e,this.helpers)))[0])?Promise.all(e):e:t.Once(this.result.root,this.helpers);if("function"==typeof t)return t(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();var e=this.result.opts;let t=nn,r=(e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify),new rn(t,this.result.root,this.result.opts));e=r.generate();return this.result.css=e[0],this.result.map=e[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(var e of this.plugins)if(mn(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[en];)e[en]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(var t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||an("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(var[r,n]of e){this.result.lastPlugin=r;let e;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(mn(e))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:s}=r;if("root"===n.type||"document"===n.type||n.parent){if(0{e[en]||this.walkSync(e)});else{var r=this.listeners[t];if(r&&this.visitSync(r,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}bn.registerPostcss=e=>{wn=e};Me=bn;bn.default=bn,un.registerLazyResult(bn),on.registerLazyResult(bn);let _n=ft,Cn=Ne,Sn=Lr,xn=Qr;const An=Ke;class kn{constructor(e,t,r){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;var e=Cn;this.result=new An(this._processor,void 0,this._opts),this.result.css=t;let n=this,s=(Object.defineProperty(this.result,"root",{get(){return n.root}}),new _n(e,void 0,this._opts,t));s.isMap()?([r,e]=s.generate(),r&&(this.result.css=r),e&&(this.result.map=e)):(s.clearAnnotation(),this.result.css=s.css)}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||Sn("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=xn;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}}ft=kn;kn.default=kn;let En=ft,Ln=Me,On=e,Mn=n;class Pn{constructor(e=[]){this.version="8.4.35",this.plugins=this.normalize(e)}normalize(e){let t=[];for(var r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return new(this.plugins.length||t.parser||t.stringifier||t.syntax?Ln:En)(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}ft=Pn;Pn.default=Pn,Mn.registerProcessor(Pn),On.registerProcessor(Pn);let Rn=He,Tn=qe,In=Ct,Bn=We,Nn=Je,jn=n,Dn=ot;function Un(e,r){if(Array.isArray(e))return e.map(e=>Un(e));let{inputs:t,...n}=e;if(t){r=[];for(var s of t){let e={...s,__proto__:Nn.prototype};e.map&&(e.map={...e.map,__proto__:Tn.prototype}),r.push(e)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>Un(e,r))),n.source){let{inputId:e,...t}=n.source;n.source=t,null!=e&&(n.source.input=r[e])}if("root"===n.type)return new jn(n);if("decl"===n.type)return new Rn(n);if("rule"===n.type)return new Dn(n);if("comment"===n.type)return new In(n);if("atrule"===n.type)return new Bn(n);throw new Error("Unknown node type: "+e.type)}qe=Un,Un.default=Un;let Fn=He,zn=Me;He=i;let $n=ft;Me=Ne,i=qe;let Gn=e;ft=St;let Hn=Ct,Vn=We;Ne=Ke,qe=Je,e=Qr,St=s;let Wn=ot,Jn=n;Ct=Te;function o(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new $n(e)}o.plugin=function(r,n){let s=!1;function i(...e){console&&console.warn&&!s&&(s=!0,console.warn(r+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(r+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let t=n(...e);return t.postcssPlugin=r,t.postcssVersion=(new $n).version,t}let e;return Object.defineProperty(i,"postcss",{get(){return e=e||i(),e}}),i.process=function(e,t,r){return o([i(r)]).process(e,t)},i},o.stringify=Me,o.parse=e,o.fromJSON=i,o.list=St,o.comment=e=>new Hn(e),o.atRule=e=>new Vn(e),o.decl=e=>new Fn(e),o.rule=e=>new Wn(e),o.root=e=>new Jn(e),o.document=e=>new Gn(e),o.CssSyntaxError=t,o.Declaration=Fn,o.Container=He,o.Processor=$n,o.Document=Gn,o.Comment=Hn,o.Warning=ft,o.AtRule=Vn,o.Result=Ne,o.Input=qe,o.Rule=Wn,o.Root=Jn,o.Node=Ct,zn.registerPostcss(o);o.default=o;class qn extends HTMLElement{base;contents;component;listType="ul";iconSet;filter={value:"",caseSensitive:!1};static get observedAttributes(){return["contents","icon-set","max-depth","filter"]}_jsonToValueArray(e){let t=JSON.stringify(e);t=t.replace(/[\[\]{}\"]/g,"");let r=[];for(const n of t.split(","))r=r.concat(n.split(":"));return[...new Set(r)]}_emit(e,t,r){e=new CustomEvent(e,{detail:r,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}constructor(){super(),this.base=new $,this.setContents(this.getAttribute("contents")),this.iconSet=this.getAttribute("icon-set")?this.getAttribute("icon-type"):"file",this.maxDepth=this.getAttribute("max-depth")?parseInt(this.getAttribute("max-depth")):-1,this.setFilter(this.getAttribute("filter")),this.style.display="block",this.style.maxWidth="fit-content",this.style.margin="0 1rem 0 0",this.base.addEvent(".flk-branch","click",this.emitNodeToggle)}emitNodeToggle(e){e.stopPropagation();const t=F(e,"flk-tree-nav").target,r=z(e,"branchKey");let n=t.contents;const s=r.split(".");for(const o of s)if(n[o])n=n[o];else{let e=[];for(const a of n)a[o]&&e.push(a[o]);n=e}var e=r.substring(r.indexOf(".")+1),i=t.createLeafText(s.reverse()[0]);t._emit("tree-click",t,{path:e,data:n,key:(i.titleText+" "+i.commentText).trim(),branch:"object"==typeof n})}convertJsonKeyToTitle(e){if(!e)return"";const t=(e="string"!=typeof e?e.toString():e).replace(/([A-Z_])/g,e=>"_"===e?" ":" "+e).trim();return t.charAt(0).toUpperCase()+t.slice(1)}setContents(e){var t=e||this.contents||[];try{switch(typeof t){case"string":this.contents=JSON.parse(t);break;case"object":Array.isArray(t)?this.contents=t:this.contents=[t]}}catch(e){console.log(e)}}applyFilter(e){let t;var r="details"===e.tagName.toLowerCase();t=this.filter.caseSensitive?e.dataset.branchValues.includes(this.filter.value):e.dataset.branchValues.toLowerCase().includes(this.filter.value.toLowerCase()),t?e.parentElement.classList.remove("hidden"):e.parentElement.classList.add("hidden"),r&&t?e.setAttribute("open",""):e.removeAttribute("open")}resetTree(e){e.parentElement.classList.remove("hidden"),e.removeAttribute("open")}filterTree(){let t=setTimeout(()=>{for(const e of this.querySelectorAll("[data-branch-values]"))void 0===this.filter.value||0===this.filter.value.length?this.resetTree(e):this.applyFilter(e);clearTimeout(t)},10)}setFilter(e){const t=e||{};try{switch(typeof t){case"string":t.includes("{")?(this.filter=JSON.parse(t),!1===this.filter.caseSensitive&&(this.filter.value=this.filter.value.toLowerCase())):this.filter.value=e.toLowerCase();break;case"object":this.filter=t}}catch(e){console.log(e)}this.filterTree()}createLeafText(e){var t,r;let n="",s="";return"string"==typeof e&&(e.includes("(")||e.includes("["))?(r=e.indexOf("("),r=-1===(t=e.indexOf("["))?r:t,n=this.convertJsonKeyToTitle(e.substring(0,r)),s=e.substring(r)):n=this.convertJsonKeyToTitle(e),{titleText:n,commentText:s}}createTextTag(n,s){n=this.createLeafText(n);if(n.commentText){let e=document.createElement("div"),t=document.createElement("span"),r=(t.innerText=n.titleText,document.createElement("small"));r.innerText=n.commentText,r.style.marginLeft="1rem",e.append(t,r),e.style.display="inline-flex",e.style.alignItems="center",s.append(e)}else s.innerText=n.titleText}createLeaf(e,t,r,n=[]){let s=document.createElement("li");s.classList.add("cursor-no-select"),s.style.marginTop="0.4rem",s.dataset.branchKey=r;const i="file"===this.iconSet?'':'';s.style.listStyleImage=`url('data:image/svg+xml,${i}')`,s.style.position="relative",s.style.left="2px";let o=document.createElement("span");r=[e].concat(n);if(o.dataset.branchValues=[...new Set(r)].join(),this.createTextTag(e,o),o.style.position="relative",o.style.top="-3px",s.append(o),t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);const i="file"===this.iconSet?G:H;e.style.listStyleImage=`url('data:image/svg+xml,${i}')`,e.append(s),t.append(e)}else t.append(s)}createBranch(r,t,n,s){if(s===this.maxDepth&&"object"==typeof r){var i,o=Array.isArray(r)?r:Object.keys(r);if("object"==typeof o[0]){let e=[];for(const d of o)e=e.concat(Object.keys(d));for(i of[...new Set(e)]){var u=document.createElement(this.listType);t.append(this.createBranch(i,u,n+"."+i,s+1))}}else for(const a of o){let e;r[a]&&(e=this._jsonToValueArray(r[a])),this.createLeaf(a,t,n,e)}}else if(Array.isArray(r))for(var e in r){var h=document.createElement(this.listType);t.append(this.createBranch(r[e],h,n+"."+e,s+1))}else if(null!==r&&"object"==typeof r){const l=[];for(const c of Object.keys(r)){let e=document.createElement("li"),t=(e.classList.add("cursor-no-select"),e.style.position="relative",e.style.left="2px",e.dataset.branchKey=n+"."+c,document.createElement("details"));t.classList.add("flk-branch"),t.dataset.branchValues=[c].concat(this._jsonToValueArray(r[c])),t.style.position="relative",t.style.top="-3px",t.classList.add("cursor-default");var p=document.createElement("summary");this.createTextTag(c,p),t.append(p),e.append(this.createBranch(r[c],t,n+"."+c,s+1)),l.push(e)}if(t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);o="file"===this.iconSet?G:H;e.style.listStyleImage=`url('data:image/svg+xml,${o}')`;for(const f of l)e.append(f);t.append(e)}else for(const m of l)t.append(m)}else console.trace({node:r,element:t,key:n}),this.createLeaf(r,t,n);return t}createHtml(){let e=document.createElement(this.listType);var t="file"===this.iconSet?G:'';if(e.style.listStyleImage=`url('data:image/svg+xml,${t}')`,e.style.marginLeft="3rem",this.contents.length){for(const r in this.contents)e=this.createBranch(this.contents[r],e,r,0);this.component=e}else this.component=e}attributeChangedCallback(e,t,r){switch(e){case"contents":this.setContents(r);break;case"icon-set":this.iconSet=r;break;case"max-depth":this.maxDepth="string"==typeof r?parseInt(r):r;break;case"filter":this.setFilter(r)}this.init()}connectedCallback(){this.init()}disconnectedCallback(){this.base.removeEvents(this)}init(){this.createHtml(),this.base.render(this)}}customElements.define("flk-table",W),customElements.define("flk-draggable",J),customElements.define("flk-modal",q),customElements.define("flk-dropdown",K),customElements.define("flk-tree-nav",qn)}(require$$0,require$$2,require$$1$1,require$$1); \ No newline at end of file diff --git a/flightkit/components/tree-navigation.js b/flightkit/components/tree-navigation.js index 79ff753..9137219 100644 --- a/flightkit/components/tree-navigation.js +++ b/flightkit/components/tree-navigation.js @@ -316,24 +316,9 @@ export class FlightkitTreeNavigation extends HTMLElement { } } else if (Array.isArray(node)) { - const isObjectArray = typeof node[0] === 'object'; - let allKeys = []; - if (isObjectArray) { - for (const obj of node) { - allKeys = allKeys.concat(Object.keys(obj)); - } - let uniqueKeys = [...new Set(allKeys)]; - - for (let nodeKey of uniqueKeys) { - let branch = document.createElement(this.listType); - element.append(this.createBranch(nodeKey, branch, `${key}.${nodeKey}`, depth + 1)); - } - } - else { - for (let nodeKey in node) { - let branch = document.createElement(this.listType); - element.append(this.createBranch(node[nodeKey], branch, `${key}.${nodeKey}`, depth + 1)); - } + for (let nodeKey in node) { + let branch = document.createElement(this.listType); + element.append(this.createBranch(node[nodeKey], branch, `${key}.${nodeKey}`, depth + 1)); } } else if (node !== null && typeof node === 'object') { @@ -383,6 +368,8 @@ export class FlightkitTreeNavigation extends HTMLElement { } } else { + + console.trace({ node, element, key }) this.createLeaf(node, element, key); } return element; diff --git a/flightkit/index.html b/flightkit/index.html index 00ec60b..3860b65 100644 --- a/flightkit/index.html +++ b/flightkit/index.html @@ -12,21 +12,37 @@ + - + +
- - + + +

+ + Click on a tree to get the Preview +
+
+        
+
+ - + diff --git a/docs/js/flightkit.min.js b/docs/js/flightkit.min.js index a5a8ef8..9a82b7a 100644 --- a/docs/js/flightkit.min.js +++ b/docs/js/flightkit.min.js @@ -1 +1 @@ -!function(e,n,s,i){"use strict";function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a,u,g,e=c(e),n=c(n),s=c(s),i=c(i);(t=a=a||{}).Date="date",t.String="string",t.Float="float",t.Number="number",t.Array="array",t.Object="object",t.Bool="bool",t.Currency="currency",t.Undefined="undefined",t.Null="null";const h={date:/^(\d{1,4}-\d{1,4}-\d{1,4}(T)?)/gim,currency:/^[$|€]\s?[0-9]*(\.|,)?\d*(\.|,)?\d*/gim,float:/\d+[,|.]\d+[,|.]?\d*/gim,currencySign:/\$|€/gim,array:/^\s?[[].[^,]+[\]],?/gi,precision:/[-+$€,.]/gm,string:/[a-zA-Z]/gim},m=e=>{return null===e||"null"===e?a.Null:e||0===e||!1===e?null===new RegExp(h.date).exec(e)||isNaN(Date.parse(e))?new RegExp(h.currency).exec(e)?a.Currency:!new RegExp(h.string).exec(e)&&new RegExp(h.float).exec(e.toString())?a.Float:isNaN(e)&&0!==e?Array.isArray(e)?a.Array:"object"==typeof e?a.Object:a.String:a.Number:a.Date:a.Undefined},y=(t,e)=>{const r={value:void 0,type:e=e||m(t),currencySign:""};switch(r.type){case a.String:r.value=t.toString();break;case a.Float:case a.Currency:var n=(t=t.toString()).match(new RegExp(/(,)/gim)),s=t.match(new RegExp(/(\.)/gim));if(n)for(let e=1;e<=n.length;e++)t=e!==n.length||s?t.replace(",",""):t.replace(",",".");if(r.type===a.Currency){const o=new RegExp(h.currencySign);var i=o.exec(t);r.currencySign=null!==i?i[0]:"",t=t.replace(o,"")}r.value=parseFloat(t).toPrecision(12);break;case a.Number:r.value=Number(t);break;case a.Date:r.value=Date.parse(t);break;case a.Array:t.length?"object"==typeof t[0]?r.value=t.map(e=>JSON.stringify(e)).join(", "):r.value=t.join(", "):r.value="";break;case a.Object:r.value=t;break;case a.Undefined:r.value="";break;case a.Null:r.value=null}return r};function v(e,t){var r;let n;for(r of e.split("."))r=r.trim(),n?"object"!=typeof n||Array.isArray(n)||(n=n[r]):n=t[r];return n}const b=(e,t)=>tet<=e,S=(e,t)=>e<=t,x=(e,t,r)=>r?e.toLowerCase()==t.toLowerCase():e==t,A=(e,t)=>e===t,k=(e,t)=>e!=t,E=(e,t)=>e!==t,L=(e,t)=>null!=t&&"string"==typeof e&&0<=e.toLowerCase().indexOf(t.toString().toLowerCase()),O=(e,t)=>null!=t&&0<=e.toString().toLowerCase().indexOf(t.toString().toLowerCase()),M=(e,t)=>null!=t&&"string"==typeof e&&e.toLowerCase().indexOf(t.toString().toLowerCase())<0;function P(r,n){if(0===n.length)return r;{var s=r;const o=[],a=[];let e=[];for(const l of n)l.type&&l.type!==u.And?(e.length&&a.push(e),e=[l]):e.push(l);a.push(e);let t=[];for(const e of a)t=t.concat(R(s,e));t=[...new Set(t)];var i=s.length;for(let e=0;e":return b;case"<":return _;case">=":return C;case"<=":return S;case"is":case"==":return x;case"!is":case"!=":return k;case"===":return A;case"!==":return E;case"like":case"~":case"contains":return L;case"!contains":case"!like":case"!~":return M;default:return O}}(a.operator);if(!l(i,o,a.ignoreCase)){e=!1;break}}e&&r.push(n)}return r};function T(e,t){if(!t||0===t.length)return e;if(1{if(0===r.length)r=r.concat(I(s,e));else{for(const t of r)n=n.concat(I(t,e));r=n,n=[]}}),r}return I(e,t[0])}function I(e,t){const r=[],n=[];do{if(!e||0===e.length)break;var s=e.shift();if(!s)break;const o=s[t];var i=n.indexOf(o.toString());0<=i?r[i].push(s):(n.push(o.toString()),void 0!==r[n.length-1]?r[n.length-1].push(s):r.push([s]))}while(0{if(t){var r=e;const n={};for(const s of t){let e=r.map(e=>e[s].toString());const i=e.map(e=>m(e));i.some(e=>e===a.Float)?(e=e.map(e=>parseFloat(e)),n[s]=parseFloat(e.reduce((e,t)=>e+t).toFixed(2))):(e=e.map(e=>parseInt(e)),n[s]=e.reduce((e,t)=>e+t))}return n}return{}};class D{model;sortDetails=[];filterDetails=[];selection=[];groupByProperties=[];distinctProperties=[];concatenationToken=", ";constructor(e){this.model=JSON.parse(JSON.stringify(e))}sort(e){return this.sortDetails=e,this}orderBy(e,t){return this.sortDetails.push({propertyName:e,direction:t}),this}thenOrderBy(e,t){return this.orderBy(e,t)}filter(e){return Array.isArray(e)?this.filterDetails=e:this.filterDetails.push(e),this}where(e,t,r,n,s){return this.filterDetails.push({propertyName:e,operator:t,value:r,type:n,ignoreCase:s}),this}andWhere(e,t,r,n){return this.where(e,t,r,u.And,n),this}orWhere(e,t,r,n){return this.where(e,t,r,u.Or,n),this}group(e){return this.groupByProperties=e,this}groupBy(e){return this.groupByProperties.push(e),this}thenGroupBy(e){return this.groupByProperties.push(e),this}select(e){return Array.isArray(e)?this.selection=e:"*"!==e&&(this.selection=[e]),this}distinct(e,t){return t&&(this.concatenationToken=t),Array.isArray(e)?this.distinctProperties=e:e&&(this.distinctProperties=[e]),this}execute(){return T(function(t,r){if(0===r.length)return t;{var n=r;let e=[];for(const s of t){const i={};for(const o of n)i[o]=s[o];e.push(i)}return e}}(function(r,n,u){if(!n||!n.length)return r;const s=[],h=[];for(const f of r){const o={};let t="";for(const e of n){var p=v(e,f);o[e]=p,t+=p}if(!h.includes(t)){let e=r;for(const a of Object.keys(o))e=e.filter(e=>e[a]===o[a]);h.push(t),s.push(e)}}const t=[];for(const m of s){let e={};for(const l of m){var i,d=Object.keys(e);if(d.length)for(const c of d)n.includes(c)||(i=e[c],Array.isArray(i)?(i=l[c],Array.isArray(i)?e[c]=[...new Set(...e[c].concat(l[c]))]:e[c].includes(l[c])||e[c].push(l[c])):isNaN(e[c])&&isNaN(l[c])?e[c]!==l[c]&&(e[c]=[e[c],l[c]]):e[c]=e[c]+l[c]);else e=l}t.push(e)}return t.forEach(e=>{for(const t in e)Array.isArray(e[t])&&(e[t]=e[t].join(u))}),t}(B(P(JSON.parse(JSON.stringify(this.model)),this.filterDetails),this.sortDetails),this.distinctProperties,this.concatenationToken),this.selection),this.groupByProperties)}sum(e,t){e=Array.isArray(e)?e:[e];return j(t||this.model,e)}}function U(e,t){t=t?t.toUpperCase():"FLK-";return e.toUpperCase().includes(t)}function F(e,t){var{timeStamp:r,type:n,x:s,y:i}=e;let o=e.target;do{if(!o||"HTML"===o.tagName||U(o.tagName,t)){"HTML"===o.tagName&&(o=null);break}}while(o=o.parentNode||o.parentElement,!U(o.tagName,t));return{target:o,timeStamp:r,type:n,x:s,y:i}}function z(e,t){let r=e.target,n="";for(;r.dataset[t]?n=r.dataset[t]:r=r.parentNode,!n;);return n}class ${constructor(){}_topLevelClasses=[];_events=[];generateId(){return"flk-"+function e(){const t=([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)),r=t.split("-")[0];return window.$flightkitUUIDStore||(window.$flightkitUUIDStore=[]),window.$flightkitUUIDStore.some(e=>e===r)?e():(window.$flightkitUUIDStore.push(r),r)}()}render(t){if(!t.component)throw new Error("Component is not assigned! Can't render");t.id=t.id||this.generateId();var e=this._getAllEventAttributes(t);if(e){var r="#"+t.id;for(const i of e){var n="e-"+i;this.addEvent(r,i,t.getAttribute(n))}}var s=Object.keys(t.classList).length;if(s){for(let e=0;e{this._assignToDom(t,t.component),clearTimeout(this._renderTimer)},10)}addEvent(e,t,r){this._events.push({selector:e,eventType:t,callback:r})}_getExternalCallback(e){let t=void 0;for(const r of e.split("."))t=(t||window)[r];return t}_getAllEventAttributes(e){e=e.attributes;const t=Array.from(e).filter(e=>e.name.startsWith("e-"));return t.map(e=>e.name.slice(2))}_isFlightkitElement(e){return e.toUpperCase().includes("FLK-")}_outerEventHandler(e){const t=F(e),r=(t.contents=e.detail,t.target.getAttribute("e-"+t.type));let n=void 0;for(const s of r.split("."))n=(n||window)[s];return e.preventDefault(),e.stopPropagation(),n(t)}_addEvents(e){if(e.isConnected)for(const r of this._events)if(r.selector.startsWith("."))for(const n of document.querySelectorAll(r.selector))this._addEventToElement(r,n);else{var t=document.querySelector(r.selector);this._addEventToElement(r,t)}}_addEventToElement(e,t){t&&("function"==typeof e.callback?(t.removeEventListener(e.eventType,e.callback),t.addEventListener(e.eventType,e.callback)):(t.removeEventListener(e.eventType,this._outerEventHandler),t.addEventListener(e.eventType,this._outerEventHandler)))}removeEvents(){for(const t of this._events)if(t.selector.startsWith("."))for(const r of document.querySelectorAll(t.selector))this._addEventToElement(t,r);else{var e=document.querySelector(t.selector);this._addEventToElement(t,e)}this._events=[]}_removeEventToElement(e,t){t&&("function"==typeof e.callback?t.removeEventListener(e.eventType,e.callback):t.removeEventListener(e.eventType,this._outerEventHandler))}_assignToDom(e,t){e.innerHTML="";for(const n of Array.isArray(t)?t:[t])e.append(n);const r=setTimeout(()=>{this._addEvents(e),clearTimeout(r)},10)}}const G='',H='';function V(e){const t=new DOMParser;return t.parseFromString(e,"image/svg+xml").documentElement}class W extends HTMLElement{base;component=null;_contents=[];_orderBy=[];properties=new Set;_columnOrder=[];_filter="";_selectionProperty="";_selectedIds=new Set;uniqueEntriesByProperties={};propertyLabelDictionary={};_templates={};_templateClasses={};static get observedAttributes(){return["contents","columns","order","filter","selection-property","templates"]}get columnOrder(){return this._columnOrder.length?this._columnOrder:this.properties}set columnOrder(e){let t;"string"==typeof e&&(t=e.split(",")),t=e,this._columnOrder=t}get contents(){return this._contents}set contents(e){this.analyzeData(e),this._contents=new D(e)}get orderBy(){return this._orderBy}set orderBy(e){if(Array.isArray(e))this._orderBy=e;else{const n=[];for(const s of e.split(",")){var t=s.split("|"),r=t[0],t=1e[r._selectionProperty])):new Set;e=t?r.contents.execute():[];r._emit("select",r,{selection:e}),r._updateCheckboxes(r)}emitSelect(e){var t=e.target.checked,r=e.target.dataset.objectId;const n=F(e).target,s=(t?n._selectedIds.add(r):n._selectedIds.delete(r),n._selectionProperty);e=n.contents.execute().filter(e=>n._selectedIds.has(e[s]));n._emit("select",n,{selection:e}),n._updateCheckboxes(n)}sortData(e){const t=F(e).target,r=z(e,"column");r&&(-1<(e=t._orderBy.findIndex(e=>e.propertyName===r))?"asc"===t._orderBy[e].direction?t._orderBy[e].direction="desc":t._orderBy.splice(e,1):t._orderBy.push({propertyName:r,direction:"asc"}),t.createHtml(),t.base.render(t))}setColumnOrder(e){this._columnOrder=e?Array.isArray(e)?e:e.split(","):[]}analyzeData(t){this.properties=new Set;var r=t.length;for(let e=0;e"_"===e?" ":" "+e.toLowerCase()).trim();var r=t.charAt(0).toUpperCase()+t.slice(1);return this.propertyLabelDictionary[e]=r}parseTemplate(e,n){return e.replace(/\{\{([\s\S]+?)\}\}/gim,(e,t)=>{let r="";t=t.trim();t=n[t];return t&&(r=t),Array.isArray(r)?r.join(", "):r.toString().trim()})}createSelectionCheckbox(e){const t=document.createElement("input");return t.setAttribute("type","checkbox"),t.classList.add("flk-selection-checkbox"),e&&(t.dataset.selected=e[this._selectionProperty]),t}createRow(e){const t=document.createElement("tr");if(this._selectionProperty.length){const s=document.createElement("td");var r=this.base.generateId();const i=this.createSelectionCheckbox(e);i.id=r,i.dataset.objectId=e[this._selectionProperty];var n=e[this._selectionProperty];this._selectedIds.has(n)?i.checked=!0:i.checked=!1,this.base.addEvent("#"+r,"change",this.emitSelect),s.append(i),t.append(s)}for(const o of this.columnOrder){const a=document.createElement("td");this._templates[o]?(a.innerHTML=this.parseTemplate(this._templates[o],e),this._templateClasses[o]&&a.classList.add(...this._templateClasses[o])):a.innerText=e[o],t.append(a)}return t}createBody(e){const t=document.createElement("tbody");for(const n of e){var r=this.createRow(n,null);t.append(r)}return t}createHead(){const e=document.createElement("thead"),t=document.createElement("tr");if(t.classList.add("cursor-pointer"),this._selectionProperty.length){const s=document.createElement("th");var r=this.base.generateId();const i=this.createSelectionCheckbox();i.id=r;var u=this.contents.execute().length;0e.propertyName===o);if(n){const c=document.createElement("span");c.innerHTML="asc"===n.direction?'':'',a.append(c)}t.append(a)}return e.append(t),e}addEvent(e,t,r){this.base.addEvent(e,t,r)}init(){this.createHtml(),this.base.render(this)}}class J extends HTMLElement{base;componentId;constructor(){super(),this.base=new $}connectedCallback(){var e=this.getAttribute("top"),t=this.getAttribute("left"),r=this.getAttribute("center"),n=this.getAttribute("zIndex");this.id||(this.id=this.base.generateId()),this.style.display="block",this.style.position="fixed","string"==typeof r?(this.style.top=e||"50%",this.style.left="50%",this.style.transform="translate(-50%, -50%)"):(this.style.top=e||this.clientTop+"px",this.style.left=t||this.clientLeft+"px"),n&&(this.style.zIndex=n),this.componentId=this.getAttribute("handle");const s=document.createElement("div");s.innerHTML=this.innerHTML,this.component=s;r="#"+(this.componentId||this.id);this.base.addEvent(r,"mousedown",this._dragElement),this.base.addEvent(r,"mouseup",this._reset),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this)}_dragElement(e){const r=F(e,"flk-draggable").target;let n,s;function t(e){n=e.clientX-r.offsetLeft,s=e.clientY-r.offsetTop}function i(e){var t=e.clientX-n,e=e.clientY-s;r.style.left=t+"px",r.style.top=e+"px"}function o(e){e.preventDefault()}function a(){r.removeAttribute("draggable"),r.removeEventListener("dragstart",t),r.removeEventListener("dragend",a),document.removeEventListener("dragover",o),document.removeEventListener("drop",i)}r.setAttribute("draggable",!0),r.addEventListener("dragstart",t),r.addEventListener("dragend",a),document.addEventListener("dragover",o),document.addEventListener("drop",i)}}class q extends HTMLElement{_id;base;_draggableId;constructor(){super(),this.base=new $}_emit(e,t,r){e=new CustomEvent(e,{detail:r,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}_closeModal(e){e.stopPropagation();const t=F(e,"flk-modal").target;t.classList.add("hidden")}closeModal(e){this.classList.add("hidden")}openModal(e=!0){const t=document.getElementById(this._draggableId);e&&(t.style.top="40%",t.style.left="50%"),this.classList.remove("hidden")}connectedCallback(){this.id||(this.id=this.base.generateId());const e=document.createElement("div");var t=this.base.generateId();const r=document.createElement("flk-draggable"),n=(this._draggableId=this.base.generateId(),r.id=this._draggableId,r.setAttribute("center",""),r.setAttribute("top","40%"),r.setAttribute("handle",t),r.setAttribute("zIndex","1080"),r.classList.add("border","shadow-lg","bg-white"),r.style.width="max-content",document.createElement("div"));var s=this.getAttribute("modal-title");if(s){const c=document.createElement("span");c.innerText=s,c.classList.add("ml-1","mr-auto"),n.append(c)}n.id=t;const i=this.getAttribute("header-class");let o=[];i?o=o.concat(i.split(" ")):o.push("bg-gray-light"),n.classList.add(...o,"border-bottom","row","justify-end","cursor-no-select");s=this.base.generateId();const a=document.createElement("button"),l=(a.classList.add("py-0","px-1","outline-hover","no-border","cursor-default",...o),a.innerText="X",a.id=s,n.append(a),r.append(n),document.createElement("div"));l.innerHTML=this.innerHTML,r.append(l),e.append(r),this.component=e,this.base.addEvent("#"+s,"click",this._closeModal),this.base.render(this),this.classList.add("hidden")}disconnectedCallback(){this.base.removeEvents(this)}}class K extends HTMLElement{base;_buttonId;_drawerId;_iconId;constructor(){super(),this.base=new $}connectedCallback(){this.style.position="relative",this.style.display="flex",this.style.width="fit-content",this._buttonId=this.base.generateId();const e=document.createElement("button"),t=(e.classList.add("row"),e.id=this._buttonId,document.createElement("span")),r=(t.innerText=this.getAttribute("text"),this._iconId=this.base.generateId(),document.createElement("span"));var n=V('');const s=V(''),i=(s.classList.add("hidden"),r.append(n,s),r.id=this._iconId,e.append(t,r),this._drawerId=this.base.generateId(),document.createElement("div"));i.id=this._drawerId,i.classList.add("shadow","inline-block","bg-white"),i.style.position="absolute",i.style.zIndex="1040";n=this.querySelector("template");n.innerHTML.length?i.innerHTML=n.innerHTML:i.append(n.firstChild),i.style.display="none",this.component=[e,i],this.base.addEvent("#"+this._buttonId,"click",this.toggleMenu);const o=document.querySelector("body");""!==o.getAttribute("flk-close-dropdown")&&(o.setAttribute("flk-close-dropdown",""),o.addEventListener("click",this.closeAllDropdownButtons)),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this);var e=document.querySelectorAll("flk-dropdown");if(!e||!e.length){const t=document.querySelector("body");t.removeAttribute("flk-close-dropdown"),t.removeEventListener("click",this.closeAllDropdownButtons)}}toggleMenu(e){const t=F(e).target;e=t._drawerId;const r=document.getElementById(e);var e="none"!==r.style.display,n=(r.style.display=e?"none":"block",t.getAttribute("drawer-width")),n=("string"==typeof t.getAttribute("right")&&(r.style.right="0px"),r.style.top=t.offsetHeight+"px",r.style.width=n||t.offsetWidth+"px",t._iconId);const s=document.getElementById(n);e?(s.childNodes[0].classList.remove("hidden"),s.childNodes[1].classList.add("hidden")):(s.childNodes[0].classList.add("hidden"),s.childNodes[1].classList.remove("hidden"))}_closeDropdown(){var e=this._drawerId;const t=document.getElementById(e);if("none"!==t.style.display){e=this._iconId;const r=document.getElementById(e);t.style.display="none",r.childNodes[0].classList.remove("hidden"),r.childNodes[1].classList.add("hidden")}}closeAllDropdownButtons(e){var t,r=F(e,"flk-dropdown").target,e=document.querySelectorAll("flk-dropdown");if(r)for(const n of e)r._buttonId!==n._buttonId&&(t=n._drawerId,"none"!==document.getElementById(t).style.display&&n._closeDropdown());else for(const s of e)s._closeDropdown()}}var t={exports:{}};let Z=e.default,Y=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||"win32"===process.platform||Z.isatty(1)&&"dumb"!==process.env.TERM||"CI"in process.env),r=(r,n,s=r)=>e=>{let t=""+e;e=t.indexOf(n,r.length);return~e?r+X(t,n,s,e)+n:r+t+n},X=(e,t,r,n)=>{var s=e.substring(0,n)+r;let i=e.substring(n+t.length);e=i.indexOf(t);return~e?s+X(i,t,r,e):s+i};e=(e=Y)=>({isColorSupported:e,reset:e?e=>`${e}`:String,bold:e?r("","",""):String,dim:e?r("","",""):String,italic:e?r("",""):String,underline:e?r("",""):String,inverse:e?r("",""):String,hidden:e?r("",""):String,strikethrough:e?r("",""):String,black:e?r("",""):String,red:e?r("",""):String,green:e?r("",""):String,yellow:e?r("",""):String,blue:e?r("",""):String,magenta:e?r("",""):String,cyan:e?r("",""):String,white:e?r("",""):String,gray:e?r("",""):String,bgBlack:e?r("",""):String,bgRed:e?r("",""):String,bgGreen:e?r("",""):String,bgYellow:e?r("",""):String,bgBlue:e?r("",""):String,bgMagenta:e?r("",""):String,bgCyan:e?r("",""):String,bgWhite:e?r("",""):String});t.exports=e(),t.exports.createColors=e;const Q="'".charCodeAt(0),ee='"'.charCodeAt(0),te="\\".charCodeAt(0),re="/".charCodeAt(0),ne="\n".charCodeAt(0),se=" ".charCodeAt(0),ie="\f".charCodeAt(0),oe="\t".charCodeAt(0),ae="\r".charCodeAt(0),le="[".charCodeAt(0),ce="]".charCodeAt(0),ue="(".charCodeAt(0),he=")".charCodeAt(0),pe="{".charCodeAt(0),de="}".charCodeAt(0),fe=";".charCodeAt(0),me="*".charCodeAt(0),ge=":".charCodeAt(0),ye="@".charCodeAt(0),ve=/[\t\n\f\r "#'()/;[\\\]{}]/g,we=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,be=/.[\r\n"'(/\\]/,_e=/[\da-f]/i;function Ce(t,e={}){let n=t.css.valueOf(),d=e.ignoreErrors,s,i,f,m,o,a,l,g,c,u,y=n.length,h=0,v=[],p=[];function w(e){throw t.error("Unclosed "+e,h)}return{back:function(e){p.push(e)},endOfFile:function(){return 0===p.length&&h>=y},nextToken:function(e){if(p.length)return p.pop();if(!(h>=y)){var t=!!e&&e.ignoreUnclosed;switch(s=n.charCodeAt(h),s){case ne:case se:case oe:case ae:case ie:for(i=h;i+=1,s=n.charCodeAt(i),s===se||s===ne||s===oe||s===ae||s===ie;);u=["space",n.slice(h,i)],h=i-1;break;case le:case ce:case pe:case de:case ge:case fe:case he:var r=String.fromCharCode(s);u=[r,r,h];break;case ue:if(g=v.length?v.pop()[1]:"",c=n.charCodeAt(h+1),"url"===g&&c!==Q&&c!==ee&&c!==se&&c!==ne&&c!==oe&&c!==ie&&c!==ae){i=h;do{if(a=!1,i=n.indexOf(")",i+1),-1===i){if(d||t){i=h;break}w("bracket")}for(l=i;n.charCodeAt(l-1)===te;)--l,a=!a}while(a);u=["brackets",n.slice(h,i+1),h,i],h=i}else i=n.indexOf(")",h+1),m=n.slice(h,i+1),-1===i||be.test(m)?u=["(","(",h]:(u=["brackets",m,h,i],h=i);break;case Q:case ee:f=s===Q?"'":'"',i=h;do{if(a=!1,i=n.indexOf(f,i+1),-1===i){if(d||t){i=h+1;break}w("string")}for(l=i;n.charCodeAt(l-1)===te;)--l,a=!a}while(a);u=["string",n.slice(h,i+1),h,i],h=i;break;case ye:ve.lastIndex=h+1,ve.test(n),i=0===ve.lastIndex?n.length-1:ve.lastIndex-2,u=["at-word",n.slice(h,i+1),h,i],h=i;break;case te:for(i=h,o=!0;n.charCodeAt(i+1)===te;)i+=1,o=!o;if(s=n.charCodeAt(i+1),o&&s!==re&&s!==se&&s!==ne&&s!==oe&&s!==ae&&s!==ie&&(i+=1,_e.test(n.charAt(i)))){for(;_e.test(n.charAt(i+1));)i+=1;n.charCodeAt(i+1)===se&&(i+=1)}u=["word",n.slice(h,i+1),h,i],h=i;break;default:h=(s===re&&n.charCodeAt(h+1)===me?(i=n.indexOf("*/",h+2)+1,0===i&&(d||t?i=n.length:w("comment")),u=["comment",n.slice(h,i+1),h,i]):(we.lastIndex=h+1,we.test(n),i=0===we.lastIndex?n.length-1:we.lastIndex-2,u=["word",n.slice(h,i+1),h,i],v.push(u)),i)}return h++,u}},position:function(){return h}}}e=t.exports;let Se=Ce,xe;const Ae={";":e.yellow,":":e.yellow,"(":e.cyan,")":e.cyan,"[":e.yellow,"]":e.yellow,"{":e.yellow,"}":e.yellow,"at-word":e.cyan,brackets:e.cyan,call:e.cyan,class:e.yellow,comment:e.gray,hash:e.magenta,string:e.green};function ke(e){let r=Se(new xe(e),{ignoreErrors:!0}),n="";for(;!r.endOfFile();){let e=r.nextToken(),t=Ae[function([e,t],r){if("word"===e){if("."===t[0])return"class";if("#"===t[0])return"hash"}if(!r.endOfFile()){t=r.nextToken();if(r.back(t),"brackets"===t[0]||"("===t[0])return"call"}return e}(e,r)];t?n+=e[1].split(/\r?\n/).map(e=>t(e)).join("\n"):n+=e[1]}return n}ke.registerInput=function(e){xe=e};e=ke;let Ee=t.exports,Le=e;class Oe extends Error{constructor(e,t,r,n,s,i){super(e),this.name="CssSyntaxError",this.reason=e,s&&(this.file=s),n&&(this.source=n),i&&(this.plugin=i),void 0!==t&&void 0!==r&&("number"==typeof t?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,Oe)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file||"",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source,r=(null==e&&(e=Ee.isColorSupported),Le&&e&&(t=Le(t)),t.split(/\r?\n/)),n=Math.max(this.line-3,0);var s=Math.min(this.line+2,r.length);let i=String(s).length,o,a;if(e){let{bold:t,gray:r,red:n}=Ee.createColors(!0);o=e=>t(n(e)),a=e=>r(e)}else o=a=e=>e;return r.slice(n,s).map((e,t)=>{var t=n+1+t;let r=" "+(" "+t).slice(-i)+" | ";return t===this.line?(t=a(r.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," "),o(">")+a(r)+e+"\n "+t+o("^")):" "+a(r)+e}).join("\n")}toString(){let e=this.showSourceCode();return e=e&&"\n\n"+e+"\n",this.name+": "+this.message+e}}var t=Oe,Me=(Oe.default=Oe,{});Me.isClean=Symbol("isClean"),Me.my=Symbol("my");const Pe={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class Re{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name;var n=e.params?this.rawValue(e,"params"):"";void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes?this.block(e,r+n):(t=(e.raws.between||"")+(t?";":""),this.builder(r+n+t,e))}beforeAfter(e,t){let r,n=(r="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose"),e.parent),s=0;for(;n&&"root"!==n.type;)s+=1,n=n.parent;if(r.includes("\n")){var i=this.raw(e,null,"indent");if(i.length)for(let e=0;e{if(n=e.raws[t],void 0!==n)return!1}),void 0===n&&(n=Pe[r]),i.rawCache[r]=n,n}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&0{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=void 0===r?this.raw(t,null,"beforeDecl"):r&&r.replace(/\S/g,""),r}rawBeforeDecl(e,t){let r;return e.walkDecls(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=void 0===r?this.raw(t,null,"beforeRule"):r&&r.replace(/\S/g,""),r}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(t){let r;return t.walk(e=>{if(e.nodes&&(e.parent!==t||t.first!==e)&&void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=r&&r.replace(/\S/g,""),r}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(r){if(r.raws.indent)return r.raws.indent;let n;return r.walk(e=>{var t=e.parent;if(t&&t!==r&&t.parent&&t.parent===r&&void 0!==e.raws.before)return t=e.raws.before.split("\n"),n=t[t.length-1],n=n.replace(/\S/g,""),!1}),n}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){var r=e[t],e=e.raws[t];return e&&e.value===r?e.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}}var Te=Re;Re.default=Re;let Ie=Te;function Be(e,t){let r=new Ie(t);r.stringify(e)}var Ne=Be;Be.default=Be;let{isClean:je,my:De}=Me,Ue=t,Fe=Te,ze=Ne;function $e(t,r){let n=new t.constructor;for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&"proxyCache"!==s){let e=t[s];var i=typeof e;"parent"===s&&"object"==i?r&&(n[s]=r):"source"===s?n[s]=e:Array.isArray(e)?n[s]=e.map(e=>$e(e,n)):("object"==i&&null!==e&&(e=$e(e)),n[s]=e)}return n}class Ge{constructor(e={}){for(var t in this.raws={},this[je]=!1,this[De]=!0,e)if("nodes"===t){this.nodes=[];for(var r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){var t;return e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)&&(t=this.source,e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)),e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(var t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=$e(this);for(var r in e)t[r]=e[r];return t}cloneAfter(e={}){e=this.clone(e);return this.parent.insertAfter(this,e),e}cloneBefore(e={}){e=this.clone(e);return this.parent.insertBefore(this,e),e}error(e,t={}){var r,n;return this.source?({end:r,start:n}=this.rangeBy(t),this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)):new Ue(e)}getProxyProcessor(){return{get(e,t){return"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t]},set(e,t,r){return e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0}}}markDirty(){if(this[je]){this[je]=!1;let e=this;for(;e=e.parent;)e[je]=!1}}next(){var e;if(this.parent)return e=this.parent.index(this),this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;return e.index?r=this.positionInside(e.index,t):!e.word||-1!==(e=(t=this.toString()).indexOf(e.word))&&(r=this.positionInside(e,t)),r}positionInside(t,e){var r=e||this.toString();let n=this.source.start.column,s=this.source.start.line;for(let e=0;e"object"==typeof e&&e.toJSON?e.toJSON(null,r):e);else if("object"==typeof t&&t.toJSON)n[s]=t.toJSON(null,r);else if("source"===s){let e=r.get(t.input);null==e&&(e=i,r.set(t.input,i),i++),n[s]={end:t.end,inputId:e,start:t.start}}else n[s]=t}return t&&(n.inputs=[...r.keys()].map(e=>e.toJSON())),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=ze){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(var s in r)n[s]=r[s];return e.warn(t,n)}get proxyOf(){return this}}var Te=Ge,He=(Ge.default=Ge,Te);class Ve extends He{constructor(e){super(e=e&&void 0!==e.value&&"string"!=typeof e.value?{...e,value:String(e.value)}:e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}}var He=Ve,We=(Ve.default=Ve,{}),Je={},qe={},Ke={},Ze="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),Ye=(Ke.encode=function(e){if(0<=e&&e>>=5)&&(t|=32),r+=Ye.encode(t),0>1,1==(1&a)?-i:i),r.rest=t};var Ke={},l=Ke,Xe=(l.getArg=function(e,t,r){if(t in e)return e[t];if(3===arguments.length)return r;throw new Error('"'+t+'" is a required argument.')},/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/),Qe=/^data:.+\,.+$/;function et(e){e=e.match(Xe);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}function tt(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}l.urlParse=et,l.urlGenerate=tt,rt=function(e){var t=e,r=et(e);if(r){if(!r.path)return e;t=r.path}for(var n,e=l.isAbsolute(t),s=[],i=0;;){if(n=i,-1===(i=t.indexOf("/",n))){s.push(t.slice(n));break}for(s.push(t.slice(n,i));in;e--){var o=r[e-1],a=r[e];if(Pt(o,a)<=0)break;r[e-1]=a,r[e]=o}else Ot(r,Pt,n)}function Tt(e,s){var t=e,e=("string"==typeof e&&(t=w.parseSourceMapInput(e)),w.getArg(t,"version")),t=w.getArg(t,"sections");if(e!=this._version)throw new Error("Unsupported version: "+e);this._sources=new Et,this._names=new Et;var i={line:-1,column:0};this._sections=t.map(function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var t=w.getArg(e,"offset"),r=w.getArg(t,"line"),n=w.getArg(t,"column");if(r=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))},p.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;var r=this._findSourceIndex(e);if(0<=r)return this.sourcesContent[r];var n,r=e;if(null!=this.sourceRoot&&(r=w.relative(this.sourceRoot,r)),null!=this.sourceRoot&&(n=w.urlParse(this.sourceRoot))){e=r.replace(/^file:\/\//,"");if("file"==n.scheme&&this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];if((!n.path||"/"==n.path)&&this._sources.has("/"+r))return this.sourcesContent[this._sources.indexOf("/"+r)]}if(t)return null;throw new Error('"'+r+'" is not in the SourceMap.')},p.prototype.generatedPositionFor=function(e){var t=w.getArg(e,"source");if((t=this._findSourceIndex(t))<0)return{line:null,column:null,lastColumn:null};t={source:t,originalLine:w.getArg(e,"line"),originalColumn:w.getArg(e,"column")},e=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",w.compareByOriginalPositions,w.getArg(e,"bias",f.GREATEST_LOWER_BOUND));if(0<=e){e=this._originalMappings[e];if(e.source===t.source)return{line:w.getArg(e,"generatedLine",null),column:w.getArg(e,"generatedColumn",null),lastColumn:w.getArg(e,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},ft.BasicSourceMapConsumer=p,(Tt.prototype=Object.create(f.prototype)).constructor=f,Tt.prototype._version=3,Object.defineProperty(Tt.prototype,"sources",{get:function(){for(var e=[],t=0;t{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(n,s=21)=>(e=s)=>{let t="",r=e;for(;r--;)t+=n[Math.random()*n.length|0];return t}};let{SourceMapConsumer:Ut,SourceMapGenerator:Ft}=We,{existsSync:zt,readFileSync:$t}=i.default,{dirname:Gt,join:Ht}=n.default;class Vt{constructor(e,t){!1!==t.map&&(this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:"),e=t.map?t.map.prev:void 0,e=this.loadMap(t.from,e),!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Gt(this.mapFile)),e&&(this.text=e))}consumer(){return this.consumerCache||(this.consumerCache=new Ut(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+t)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);var r,n;t&&(r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r),-1"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,i,o;t&&"object"==typeof t?(a=r,r="number"==typeof(l=t).offset?(t=(c=this.fromOffset(l.offset)).line,c.col):(t=l.line,l.column),o="number"==typeof a.offset?(c=this.fromOffset(a.offset),i=c.line,c.col):(i=a.line,a.column)):r||(t=(l=this.fromOffset(t)).line,r=l.col);var a,l,c=this.origin(t,r,i,o);return s=c?new Xt(e,void 0===c.endLine?c.line:{column:c.column,line:c.line},void 0===c.endLine?c.column:{column:c.endColumn,line:c.endLine},c.source,c.file,n.plugin):new Xt(e,void 0===i?t:{column:r,line:t},void 0===i?r:{column:o,line:i},this.css,this.file,n.plugin),s.input={column:r,endColumn:o,endLine:i,line:t,source:this.css},this.file&&(Jt&&(s.input.url=Jt(this.file).toString()),s.input.file=this.file),s}fromOffset(t){let n;if(this[er])n=this[er];else{var s=this.css.split("\n");n=new Array(s.length);let r=0;for(let e=0,t=s.length;e>1),t=n[i+1])){r=i;break}r=i+1}}return{col:t-n[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Kt(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let s=this.map.consumer();t=s.originalPositionFor({column:t,line:e});if(!t.source)return!1;let i;"number"==typeof r&&(i=s.originalPositionFor({column:n,line:r}));let o,a=(o=qt(t.source)?Jt(t.source):new URL(t.source,this.map.consumer().sourceRoot||Jt(this.map.mapFile)),{column:t.column,endColumn:i&&i.column,endLine:i&&i.line,line:t.line,url:o.toString()});if("file:"===o.protocol){if(!Wt)throw new Error("file: protocol is not available in this PostCSS build");a.file=Wt(o)}e=s.sourceContentFor(t.source);return e&&(a.source=e),a}toJSON(){let e={};for(var t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}}Je=nr;nr.default=nr,Yt&&Yt.registerInput&&Yt.registerInput(nr);let{SourceMapConsumer:sr,SourceMapGenerator:ir}=We,{dirname:or,relative:ar,resolve:lr,sep:cr}=n.default,ur=s.default["pathToFileURL"],hr=Je,pr=Boolean(sr&&ir),dr=Boolean(or&&lr&&ar&&cr);ft=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e,t=(e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map","\n");this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(var t of this.previous()){var r=this.toUrl(this.path(t.file)),n=t.root||or(t.file);let e;!1===this.mapOpts.sourcesContent?(e=new sr(t.text),e.sourcesContent&&(e.sourcesContent=null)):e=t.consumer(),this.map.applySourceMap(e,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let t;for(let e=this.root.nodes.length-1;0<=e;e--)t=this.root.nodes[e],"comment"===t.type&&0===t.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(e)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),dr&&pr&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,e=>{t+=e}),[t]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=ir.fromSourceMap(e)}else this.map=new ir({file:this.outputFile()}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):""});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&0",o={generated:{column:0,line:0},original:{column:0,line:0},source:""},a,l;this.stringify(this.root,(e,t,r)=>{this.css+=e,t&&"end"!==r&&(o.generated.line=n,o.generated.column=s-1,t.source&&t.source.start?(o.source=this.sourcePath(t),o.original.line=t.source.start.line,o.original.column=t.source.start.column-1):(o.source=i,o.original.line=1,o.original.column=0),this.map.addMapping(o)),a=e.match(/\n/g),a?(n+=a.length,l=e.lastIndexOf("\n"),s=e.length-l):s+=e.length,t&&"start"!==r&&(e=t.parent||{raws:{}},("decl"===t.type||"atrule"===t.type&&!t.nodes)&&t===e.last&&!e.raws.semicolon||(t.source&&t.source.end?(o.source=this.sourcePath(t),o.original.line=t.source.end.line,o.original.column=t.source.end.column-1,o.generated.line=n,o.generated.column=s-2):(o.source=i,o.original.line=1,o.original.column=0,o.generated.line=n,o.generated.column=s-1),this.map.addMapping(o)))})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;var e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:0e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;var t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?or(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=or(lr(r,this.mapOpts.annotation)));t=ar(r,e);return this.memoizedPaths.set(e,t),t}previous(){var e;return this.previousMaps||(this.previousMaps=[],this.root?this.root.walk(e=>{e.source&&e.source.input.map&&(e=e.source.input.map,this.previousMaps.includes(e)||this.previousMaps.push(e))}):(e=new hr(this.originalCSS,this.opts)).map&&this.previousMaps.push(e.map)),this.previousMaps}setSourcesContent(){let r={};var e;this.root?this.root.walk(e=>{var t;!e.source||(t=e.source.input.from)&&!r[t]&&(r[t]=!0,t=this.usesFileUrls?this.toFileUrl(t):this.toUrl(this.path(t)),this.map.setSourceContent(t,e.source.input.css))}):this.css&&(e=this.opts.from?this.toUrl(this.path(this.opts.from)):"",this.map.setSourceContent(e,this.css))}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){var t=this.memoizedFileURLs.get(e);if(t)return t;if(ur)return t=ur(e).toString(),this.memoizedFileURLs.set(e,t),t;throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){var t=this.memoizedURLs.get(e);if(t)return t;"\\"===cr&&(e=e.replace(/\\/g,"/"));t=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,t),t}};class fr extends Te{constructor(e){super(e),this.type="comment"}}Ct=fr;fr.default=fr;let{isClean:mr,my:gr}=Me,yr=He,vr=Ct,wr,br,_r,Cr;class Sr extends Te{append(...e){for(var t of e){var r;for(r of this.normalize(t,this.last))this.proxyOf.nodes.push(r)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(var t of this.nodes)t.cleanRaws(e)}each(r){if(this.proxyOf.nodes){var n=this.getIterator();let e,t;for(;this.indexes[n]t[n](...e.map(r=>"function"==typeof r?(e,t)=>r(e.toProxy(),t):r)):"every"===n||"some"===n?r=>t[n]((e,...t)=>r(e.toProxy(),...t)):"root"===n?()=>t.root().toProxy():"nodes"===n?t.nodes.map(e=>e.toProxy()):"first"===n||"last"===n?t[n].toProxy():t[n])},set(e,t,r){return e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0}}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){var r,n,s,i=this.index(e),o=this.normalize(t,this.proxyOf.nodes[i]).reverse(),i=this.index(e);for(r of o)this.proxyOf.nodes.splice(i+1,0,r);for(s in this.indexes)i<(n=this.indexes[s])&&(this.indexes[s]=n+o.length);return this.markDirty(),this}insertBefore(e,t){var r,n,s,i=this.index(e),o=this.normalize(t,this.proxyOf.nodes[i],0===i&&"prepend").reverse(),i=this.index(e);for(r of o)this.proxyOf.nodes.splice(i,0,r);for(s in this.indexes)i<=(n=this.indexes[s])&&(this.indexes[s]=n+o.length);return this.markDirty(),this}normalize(e,t){if("string"==typeof e)e=function t(e){return e.map(e=>(e.nodes&&(e.nodes=t(e.nodes)),delete e.source,e))}(wr(e).nodes);else if(void 0===e)e=[];else if(Array.isArray(e))for(var r of e=e.slice(0))r.parent&&r.parent.removeChild(r,"ignore");else if("root"===e.type&&"document"!==this.type)for(var n of e=e.nodes.slice(0))n.parent&&n.parent.removeChild(n,"ignore");else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new yr(e)]}else if(e.selector)e=[new br(e)];else if(e.name)e=[new _r(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new vr(e)]}return e.map(e=>(e[gr]||Sr.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[mr]&&function e(t){if(t[mr]=!1,t.proxyOf.nodes)for(var r of t.proxyOf.nodes)e(r)}(e),void 0===e.raws.before&&t&&void 0!==t.raws.before&&(e.raws.before=t.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}prepend(...e){for(var t of e=e.reverse()){var r,n,s=this.normalize(t,this.first,"prepend").reverse();for(r of s)this.proxyOf.nodes.unshift(r);for(n in this.indexes)this.indexes[n]=this.indexes[n]+s.length}return this.markDirty(),this}push(e){return(e.parent=this).proxyOf.nodes.push(e),this}removeAll(){for(var e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){var t,r;for(r in e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1),this.indexes)e<=(t=this.indexes[r])&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(t,r,n){return n||(n=r,r={}),this.walkDecls(e=>{r.props&&!r.props.includes(e.prop)||r.fast&&!e.value.includes(r.fast)||(e.value=e.value.replace(t,n))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(n){return this.each((t,e)=>{let r;try{r=n(t,e)}catch(e){throw t.addToError(e)}return!1!==r&&t.walk&&(r=t.walk(n)),r})}walkAtRules(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("atrule"===e.type&&r.test(e.name))return n(e,t)}):this.walk((e,t)=>{if("atrule"===e.type&&e.name===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("atrule"===e.type)return n(e,t)}))}walkComments(r){return this.walk((e,t)=>{if("comment"===e.type)return r(e,t)})}walkDecls(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("decl"===e.type&&r.test(e.prop))return n(e,t)}):this.walk((e,t)=>{if("decl"===e.type&&e.prop===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("decl"===e.type)return n(e,t)}))}walkRules(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("rule"===e.type&&r.test(e.selector))return n(e,t)}):this.walk((e,t)=>{if("rule"===e.type&&e.selector===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("rule"===e.type)return n(e,t)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}Sr.registerParse=e=>{wr=e},Sr.registerRule=e=>{br=e},Sr.registerAtRule=e=>{_r=e},Sr.registerRoot=e=>{Cr=e};i=Sr,Sr.default=Sr,Sr.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,_r.prototype):"rule"===e.type?Object.setPrototypeOf(e,br.prototype):"decl"===e.type?Object.setPrototypeOf(e,yr.prototype):"comment"===e.type?Object.setPrototypeOf(e,vr.prototype):"root"===e.type&&Object.setPrototypeOf(e,Cr.prototype),e[gr]=!0,e.nodes&&e.nodes.forEach(e=>{Sr.rebuild(e)})},ot=i;let xr,Ar;class kr extends ot{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){let t=new xr(new Ar,this,e);return t.stringify()}}kr.registerLazyResult=e=>{xr=e},kr.registerProcessor=e=>{Ar=e};e=kr;kr.default=kr;let Er={};function Lr(e){Er[e]||(Er[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))}class Or{constructor(e,t={}){for(var r in this.type="warning",this.text=e,t.node&&t.node.source&&(e=t.node.rangeBy(t),this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column),t)this[r]=t[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}St=Or;Or.default=Or;let Mr=St;class Pr{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);e=new Mr(e,t);return this.messages.push(e),e}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}}Ke=Pr;Pr.default=Pr;let Rr=i;class Tr extends Rr{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}We=Tr;Tr.default=Tr,Rr.registerAtRule(Tr);let Ir=i,Br,Nr;class jr extends Ir{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){e=super.normalize(e);if(t)if("prepend"===r)1{Br=e},jr.registerProcessor=e=>{Nr=e};n=jr;jr.default=jr,Ir.registerRoot(jr);let Dr={comma(e){return Dr.split(e,[","],!0)},space(e){return Dr.split(e,[" ","\n","\t"])},split(e,t,u){let r=[],n="",s=!1,i=0,o=!1,a="",l=!1;for(var c of e)l?l=!1:"\\"===c?l=!0:o?c===a&&(o=!1):'"'===c||"'"===c?(o=!0,a=c):"("===c?i+=1:")"===c?0"space"!==e[0]&&"comment"!==e[0])&&(s.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(s,"value",a.concat(e),t),s.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new Jr;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){var t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1;var r;let n=!1,s=null,i=[];var o=e[1].startsWith("--");let a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)s=s||l,i.push("("===r?")":"]");else if(o&&n&&"{"===r)s=s||l,i.push("}");else if(0===i.length){if(";"===r){if(n)return void this.decl(a,o);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===i[i.length-1]&&(i.pop(),0===i.length&&(s=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),0e+t[1],""),e.raws[t]={raw:o,value:l}),e[t]=l}rule(e){e.pop();let t=new Jr;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){var t;let r="";for(;e.length&&("space"===(t=e[e.length-1][0])||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){var t;let r="";for(;e.length&&("space"===(t=e[0][0])||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t="";for(;e.length&&"space"===e[e.length-1][0];)t=e.pop()[1]+t;return t}stringFrom(t,r){let n="";for(let e=r;evn(e)),e}let wn={};class bn{constructor(e,t,r){this.stringified=!1,this.processed=!1;let n;if("object"!=typeof t||null===t||"root"!==t.type&&"document"!==t.type)if(t instanceof bn||t instanceof ln)n=vn(t.root),t.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=t.map);else{let e=cn;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{n=e(t,r)}catch(e){this.processed=!0,this.error=e}n&&!n[tn]&&sn.rebuild(n)}else n=vn(t);this.result=new ln(e,n,r),this.helpers={...wn,postcss:wn,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){var r=this.result.lastPlugin;try{if(t&&t.addToError(e),"CssSyntaxError"!==(this.error=e).name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){var n=r.postcssPlugin;let e=r.postcssVersion,t=this.result.processor.version;var s=e.split("."),i=t.split(".");(s[0]!==i[0]||parseInt(s[1])>parseInt(i[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+t+", but "+n+" uses "+e+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};var e,t=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(e of this.plugins)if("object"==typeof e)for(var r in e){if(!pn[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${e.postcssPlugin}. `+`Try to update PostCSS (${this.processor.version} now).`);if(!dn[r])if("object"==typeof e[r])for(var n in e[r])"*"===n?t(e,r,e[r][n]):t(e,r+"-"+n.toLowerCase(),e[r][n]);else"function"==typeof e[r]&&t(e,r,e[r])}this.hasListener=0t(e,this.helpers)),await Promise.all(i)):await t(r,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{var e;if("object"==typeof t&&t.Once)return"document"===this.result.root.type?mn((e=this.result.root.nodes.map(e=>t.Once(e,this.helpers)))[0])?Promise.all(e):e:t.Once(this.result.root,this.helpers);if("function"==typeof t)return t(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();var e=this.result.opts;let t=nn,r=(e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify),new rn(t,this.result.root,this.result.opts));e=r.generate();return this.result.css=e[0],this.result.map=e[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(var e of this.plugins)if(mn(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[en];)e[en]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(var t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||an("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(var[r,n]of e){this.result.lastPlugin=r;let e;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(mn(e))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:s}=r;if("root"===n.type||"document"===n.type||n.parent){if(0{e[en]||this.walkSync(e)});else{var r=this.listeners[t];if(r&&this.visitSync(r,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}bn.registerPostcss=e=>{wn=e};Me=bn;bn.default=bn,un.registerLazyResult(bn),on.registerLazyResult(bn);let _n=ft,Cn=Ne,Sn=Lr,xn=Qr;const An=Ke;class kn{constructor(e,t,r){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;var e=Cn;this.result=new An(this._processor,void 0,this._opts),this.result.css=t;let n=this,s=(Object.defineProperty(this.result,"root",{get(){return n.root}}),new _n(e,void 0,this._opts,t));s.isMap()?([r,e]=s.generate(),r&&(this.result.css=r),e&&(this.result.map=e)):(s.clearAnnotation(),this.result.css=s.css)}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||Sn("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=xn;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}}ft=kn;kn.default=kn;let En=ft,Ln=Me,On=e,Mn=n;class Pn{constructor(e=[]){this.version="8.4.35",this.plugins=this.normalize(e)}normalize(e){let t=[];for(var r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return new(this.plugins.length||t.parser||t.stringifier||t.syntax?Ln:En)(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}ft=Pn;Pn.default=Pn,Mn.registerProcessor(Pn),On.registerProcessor(Pn);let Rn=He,Tn=qe,In=Ct,Bn=We,Nn=Je,jn=n,Dn=ot;function Un(e,r){if(Array.isArray(e))return e.map(e=>Un(e));let{inputs:t,...n}=e;if(t){r=[];for(var s of t){let e={...s,__proto__:Nn.prototype};e.map&&(e.map={...e.map,__proto__:Tn.prototype}),r.push(e)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>Un(e,r))),n.source){let{inputId:e,...t}=n.source;n.source=t,null!=e&&(n.source.input=r[e])}if("root"===n.type)return new jn(n);if("decl"===n.type)return new Rn(n);if("rule"===n.type)return new Dn(n);if("comment"===n.type)return new In(n);if("atrule"===n.type)return new Bn(n);throw new Error("Unknown node type: "+e.type)}qe=Un,Un.default=Un;let Fn=He,zn=Me;He=i;let $n=ft;Me=Ne,i=qe;let Gn=e;ft=St;let Hn=Ct,Vn=We;Ne=Ke,qe=Je,e=Qr,St=s;let Wn=ot,Jn=n;Ct=Te;function o(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new $n(e)}o.plugin=function(r,n){let s=!1;function i(...e){console&&console.warn&&!s&&(s=!0,console.warn(r+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(r+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let t=n(...e);return t.postcssPlugin=r,t.postcssVersion=(new $n).version,t}let e;return Object.defineProperty(i,"postcss",{get(){return e=e||i(),e}}),i.process=function(e,t,r){return o([i(r)]).process(e,t)},i},o.stringify=Me,o.parse=e,o.fromJSON=i,o.list=St,o.comment=e=>new Hn(e),o.atRule=e=>new Vn(e),o.decl=e=>new Fn(e),o.rule=e=>new Wn(e),o.root=e=>new Jn(e),o.document=e=>new Gn(e),o.CssSyntaxError=t,o.Declaration=Fn,o.Container=He,o.Processor=$n,o.Document=Gn,o.Comment=Hn,o.Warning=ft,o.AtRule=Vn,o.Result=Ne,o.Input=qe,o.Rule=Wn,o.Root=Jn,o.Node=Ct,zn.registerPostcss(o);o.default=o;class qn extends HTMLElement{base;contents;component;listType="ul";iconSet;filter={value:"",caseSensitive:!1};static get observedAttributes(){return["contents","icon-set","max-depth","filter"]}_jsonToValueArray(e){let t=JSON.stringify(e);t=t.replace(/[\[\]{}\"]/g,"");let r=[];for(const n of t.split(","))r=r.concat(n.split(":"));return[...new Set(r)]}_emit(e,t,r){e=new CustomEvent(e,{detail:r,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}constructor(){super(),this.base=new $,this.setContents(this.getAttribute("contents")),this.iconSet=this.getAttribute("icon-set")?this.getAttribute("icon-type"):"file",this.maxDepth=this.getAttribute("max-depth")?parseInt(this.getAttribute("max-depth")):-1,this.setFilter(this.getAttribute("filter")),this.style.display="block",this.style.maxWidth="fit-content",this.style.margin="0 1rem 0 0",this.base.addEvent(".flk-branch","click",this.emitNodeToggle)}emitNodeToggle(e){e.stopPropagation();const t=F(e,"flk-tree-nav").target,r=z(e,"branchKey");let n=t.contents;const s=r.split(".");for(const o of s)if(n[o])n=n[o];else{let e=[];for(const a of n)a[o]&&e.push(a[o]);n=e}var e=r.substring(r.indexOf(".")+1),i=t.createLeafText(s.reverse()[0]);t._emit("tree-click",t,{path:e,data:n,key:(i.titleText+" "+i.commentText).trim(),branch:"object"==typeof n})}convertJsonKeyToTitle(e){if(!e)return"";const t=(e="string"!=typeof e?e.toString():e).replace(/([A-Z_])/g,e=>"_"===e?" ":" "+e).trim();return t.charAt(0).toUpperCase()+t.slice(1)}setContents(e){var t=e||this.contents||[];try{switch(typeof t){case"string":this.contents=JSON.parse(t);break;case"object":Array.isArray(t)?this.contents=t:this.contents=[t]}}catch(e){console.log(e)}}applyFilter(e){let t;var r="details"===e.tagName.toLowerCase();t=this.filter.caseSensitive?e.dataset.branchValues.includes(this.filter.value):e.dataset.branchValues.toLowerCase().includes(this.filter.value.toLowerCase()),t?e.parentElement.classList.remove("hidden"):e.parentElement.classList.add("hidden"),r&&t?e.setAttribute("open",""):e.removeAttribute("open")}resetTree(e){e.parentElement.classList.remove("hidden"),e.removeAttribute("open")}filterTree(){let t=setTimeout(()=>{for(const e of this.querySelectorAll("[data-branch-values]"))void 0===this.filter.value||0===this.filter.value.length?this.resetTree(e):this.applyFilter(e);clearTimeout(t)},10)}setFilter(e){const t=e||{};try{switch(typeof t){case"string":t.includes("{")?(this.filter=JSON.parse(t),!1===this.filter.caseSensitive&&(this.filter.value=this.filter.value.toLowerCase())):this.filter.value=e.toLowerCase();break;case"object":this.filter=t}}catch(e){console.log(e)}this.filterTree()}createLeafText(e){var t,r;let n="",s="";return"string"==typeof e&&(e.includes("(")||e.includes("["))?(r=e.indexOf("("),r=-1===(t=e.indexOf("["))?r:t,n=this.convertJsonKeyToTitle(e.substring(0,r)),s=e.substring(r)):n=this.convertJsonKeyToTitle(e),{titleText:n,commentText:s}}createTextTag(n,s){n=this.createLeafText(n);if(n.commentText){let e=document.createElement("div"),t=document.createElement("span"),r=(t.innerText=n.titleText,document.createElement("small"));r.innerText=n.commentText,r.style.marginLeft="1rem",e.append(t,r),e.style.display="inline-flex",e.style.alignItems="center",s.append(e)}else s.innerText=n.titleText}createLeaf(e,t,r,n=[]){let s=document.createElement("li");s.classList.add("cursor-no-select"),s.style.marginTop="0.4rem",s.dataset.branchKey=r;const i="file"===this.iconSet?'':'';s.style.listStyleImage=`url('data:image/svg+xml,${i}')`,s.style.position="relative",s.style.left="2px";let o=document.createElement("span");r=[e].concat(n);if(o.dataset.branchValues=[...new Set(r)].join(),this.createTextTag(e,o),o.style.position="relative",o.style.top="-3px",s.append(o),t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);const i="file"===this.iconSet?G:H;e.style.listStyleImage=`url('data:image/svg+xml,${i}')`,e.append(s),t.append(e)}else t.append(s)}createBranch(r,t,n,s){if(s===this.maxDepth&&"object"==typeof r){var i,o=Array.isArray(r)?r:Object.keys(r);if("object"==typeof o[0]){let e=[];for(const d of o)e=e.concat(Object.keys(d));for(i of[...new Set(e)]){var u=document.createElement(this.listType);t.append(this.createBranch(i,u,n+"."+i,s+1))}}else for(const a of o){let e;r[a]&&(e=this._jsonToValueArray(r[a])),this.createLeaf(a,t,n,e)}}else if(Array.isArray(r))for(var e in r){var h=document.createElement(this.listType);t.append(this.createBranch(r[e],h,n+"."+e,s+1))}else if(null!==r&&"object"==typeof r){const l=[];for(const c of Object.keys(r)){let e=document.createElement("li"),t=(e.classList.add("cursor-no-select"),e.style.position="relative",e.style.left="2px",e.dataset.branchKey=n+"."+c,document.createElement("details"));t.classList.add("flk-branch"),t.dataset.branchValues=[c].concat(this._jsonToValueArray(r[c])),t.style.position="relative",t.style.top="-3px",t.classList.add("cursor-default");var p=document.createElement("summary");this.createTextTag(c,p),t.append(p),e.append(this.createBranch(r[c],t,n+"."+c,s+1)),l.push(e)}if(t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);o="file"===this.iconSet?G:H;e.style.listStyleImage=`url('data:image/svg+xml,${o}')`;for(const f of l)e.append(f);t.append(e)}else for(const m of l)t.append(m)}else console.trace({node:r,element:t,key:n}),this.createLeaf(r,t,n);return t}createHtml(){let e=document.createElement(this.listType);var t="file"===this.iconSet?G:'';if(e.style.listStyleImage=`url('data:image/svg+xml,${t}')`,e.style.marginLeft="3rem",this.contents.length){for(const r in this.contents)e=this.createBranch(this.contents[r],e,r,0);this.component=e}else this.component=e}attributeChangedCallback(e,t,r){switch(e){case"contents":this.setContents(r);break;case"icon-set":this.iconSet=r;break;case"max-depth":this.maxDepth="string"==typeof r?parseInt(r):r;break;case"filter":this.setFilter(r)}this.init()}connectedCallback(){this.init()}disconnectedCallback(){this.base.removeEvents(this)}init(){this.createHtml(),this.base.render(this)}}customElements.define("flk-table",W),customElements.define("flk-draggable",J),customElements.define("flk-modal",q),customElements.define("flk-dropdown",K),customElements.define("flk-tree-nav",qn)}(require$$0,require$$2,require$$1$1,require$$1); \ No newline at end of file +!function(e,n,s,i){"use strict";function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a,u,g,e=c(e),n=c(n),s=c(s),i=c(i);(t=a=a||{}).Date="date",t.String="string",t.Float="float",t.Number="number",t.Array="array",t.Object="object",t.Bool="bool",t.Currency="currency",t.Undefined="undefined",t.Null="null";const h={date:/^(\d{1,4}-\d{1,4}-\d{1,4}(T)?)/gim,currency:/^[$|€]\s?[0-9]*(\.|,)?\d*(\.|,)?\d*/gim,float:/\d+[,|.]\d+[,|.]?\d*/gim,currencySign:/\$|€/gim,array:/^\s?[[].[^,]+[\]],?/gi,precision:/[-+$€,.]/gm,string:/[a-zA-Z]/gim},m=e=>{return null===e||"null"===e?a.Null:e||0===e||!1===e?null===new RegExp(h.date).exec(e)||isNaN(Date.parse(e))?new RegExp(h.currency).exec(e)?a.Currency:!new RegExp(h.string).exec(e)&&new RegExp(h.float).exec(e.toString())?a.Float:isNaN(e)&&0!==e?Array.isArray(e)?a.Array:"object"==typeof e?a.Object:a.String:a.Number:a.Date:a.Undefined},y=(t,e)=>{const r={value:void 0,type:e=e||m(t),currencySign:""};switch(r.type){case a.String:r.value=t.toString();break;case a.Float:case a.Currency:var n=(t=t.toString()).match(new RegExp(/(,)/gim)),s=t.match(new RegExp(/(\.)/gim));if(n)for(let e=1;e<=n.length;e++)t=e!==n.length||s?t.replace(",",""):t.replace(",",".");if(r.type===a.Currency){const o=new RegExp(h.currencySign);var i=o.exec(t);r.currencySign=null!==i?i[0]:"",t=t.replace(o,"")}r.value=parseFloat(t).toPrecision(12);break;case a.Number:r.value=Number(t);break;case a.Date:r.value=Date.parse(t);break;case a.Array:t.length?"object"==typeof t[0]?r.value=t.map(e=>JSON.stringify(e)).join(", "):r.value=t.join(", "):r.value="";break;case a.Object:r.value=t;break;case a.Undefined:r.value="";break;case a.Null:r.value=null}return r};function v(e,t){var r;let n;for(r of e.split("."))r=r.trim(),n?"object"!=typeof n||Array.isArray(n)||(n=n[r]):n=t[r];return n}const b=(e,t)=>tet<=e,S=(e,t)=>e<=t,x=(e,t,r)=>r?e.toLowerCase()==t.toLowerCase():e==t,A=(e,t)=>e===t,k=(e,t)=>e!=t,E=(e,t)=>e!==t,L=(e,t)=>null!=t&&"string"==typeof e&&0<=e.toLowerCase().indexOf(t.toString().toLowerCase()),O=(e,t)=>null!=t&&0<=e.toString().toLowerCase().indexOf(t.toString().toLowerCase()),M=(e,t)=>null!=t&&"string"==typeof e&&e.toLowerCase().indexOf(t.toString().toLowerCase())<0;function P(r,n){if(0===n.length)return r;{var s=r;const o=[],a=[];let e=[];for(const l of n)l.type&&l.type!==u.And?(e.length&&a.push(e),e=[l]):e.push(l);a.push(e);let t=[];for(const e of a)t=t.concat(R(s,e));t=[...new Set(t)];var i=s.length;for(let e=0;e":return b;case"<":return _;case">=":return C;case"<=":return S;case"is":case"==":return x;case"!is":case"!=":return k;case"===":return A;case"!==":return E;case"like":case"~":case"contains":return L;case"!contains":case"!like":case"!~":return M;default:return O}}(a.operator);if(!l(i,o,a.ignoreCase)){e=!1;break}}e&&r.push(n)}return r};function T(e,t){if(!t||0===t.length)return e;if(1{if(0===r.length)r=r.concat(I(s,e));else{for(const t of r)n=n.concat(I(t,e));r=n,n=[]}}),r}return I(e,t[0])}function I(e,t){const r=[],n=[];do{if(!e||0===e.length)break;var s=e.shift();if(!s)break;const o=s[t];var i=n.indexOf(o.toString());0<=i?r[i].push(s):(n.push(o.toString()),void 0!==r[n.length-1]?r[n.length-1].push(s):r.push([s]))}while(0{if(t){var r=e;const n={};for(const s of t){let e=r.map(e=>e[s].toString());const i=e.map(e=>m(e));i.some(e=>e===a.Float)?(e=e.map(e=>parseFloat(e)),n[s]=parseFloat(e.reduce((e,t)=>e+t).toFixed(2))):(e=e.map(e=>parseInt(e)),n[s]=e.reduce((e,t)=>e+t))}return n}return{}};class D{model;sortDetails=[];filterDetails=[];selection=[];groupByProperties=[];distinctProperties=[];concatenationToken=", ";constructor(e){this.model=JSON.parse(JSON.stringify(e))}sort(e){return this.sortDetails=e,this}orderBy(e,t){return this.sortDetails.push({propertyName:e,direction:t}),this}thenOrderBy(e,t){return this.orderBy(e,t)}filter(e){return Array.isArray(e)?this.filterDetails=e:this.filterDetails.push(e),this}where(e,t,r,n,s){return this.filterDetails.push({propertyName:e,operator:t,value:r,type:n,ignoreCase:s}),this}andWhere(e,t,r,n){return this.where(e,t,r,u.And,n),this}orWhere(e,t,r,n){return this.where(e,t,r,u.Or,n),this}group(e){return this.groupByProperties=e,this}groupBy(e){return this.groupByProperties.push(e),this}thenGroupBy(e){return this.groupByProperties.push(e),this}select(e){return Array.isArray(e)?this.selection=e:"*"!==e&&(this.selection=[e]),this}distinct(e,t){return t&&(this.concatenationToken=t),Array.isArray(e)?this.distinctProperties=e:e&&(this.distinctProperties=[e]),this}execute(){return T(function(t,r){if(0===r.length)return t;{var n=r;let e=[];for(const s of t){const i={};for(const o of n)i[o]=s[o];e.push(i)}return e}}(function(r,n,u){if(!n||!n.length)return r;const s=[],h=[];for(const f of r){const o={};let t="";for(const e of n){var p=v(e,f);o[e]=p,t+=p}if(!h.includes(t)){let e=r;for(const a of Object.keys(o))e=e.filter(e=>e[a]===o[a]);h.push(t),s.push(e)}}const t=[];for(const m of s){let e={};for(const l of m){var i,d=Object.keys(e);if(d.length)for(const c of d)n.includes(c)||(i=e[c],Array.isArray(i)?(i=l[c],Array.isArray(i)?e[c]=[...new Set(...e[c].concat(l[c]))]:e[c].includes(l[c])||e[c].push(l[c])):isNaN(e[c])&&isNaN(l[c])?e[c]!==l[c]&&(e[c]=[e[c],l[c]]):e[c]=e[c]+l[c]);else e=l}t.push(e)}return t.forEach(e=>{for(const t in e)Array.isArray(e[t])&&(e[t]=e[t].join(u))}),t}(B(P(JSON.parse(JSON.stringify(this.model)),this.filterDetails),this.sortDetails),this.distinctProperties,this.concatenationToken),this.selection),this.groupByProperties)}sum(e,t){e=Array.isArray(e)?e:[e];return j(t||this.model,e)}}function U(e,t){t=t?t.toUpperCase():"FLK-";return e.toUpperCase().includes(t)}function F(e,t){var{timeStamp:r,type:n,x:s,y:i}=e;let o=e.target;do{if(!o||"HTML"===o.tagName||U(o.tagName,t)){"HTML"===o.tagName&&(o=null);break}}while(o=o.parentNode||o.parentElement,!U(o.tagName,t));return{target:o,timeStamp:r,type:n,x:s,y:i}}function z(e,t){let r=e.target,n="";for(;r.dataset[t]?n=r.dataset[t]:r=r.parentNode,!n;);return n}class ${constructor(){}_topLevelClasses=[];_events=[];generateId(){return"flk-"+function e(){const t=([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)),r=t.split("-")[0];return window.$flightkitUUIDStore||(window.$flightkitUUIDStore=[]),window.$flightkitUUIDStore.some(e=>e===r)?e():(window.$flightkitUUIDStore.push(r),r)}()}render(t){if(!t.component)throw new Error("Component is not assigned! Can't render");t.id=t.id||this.generateId();var e=this._getAllEventAttributes(t);if(e){var r="#"+t.id;for(const i of e){var n="e-"+i;this.addEvent(r,i,t.getAttribute(n))}}var s=Object.keys(t.classList).length;if(s){for(let e=0;e{this._assignToDom(t,t.component),clearTimeout(this._renderTimer)},10)}addEvent(e,t,r){this._events.push({selector:e,eventType:t,callback:r})}_getExternalCallback(e){let t=void 0;for(const r of e.split("."))t=(t||window)[r];return t}_getAllEventAttributes(e){e=e.attributes;const t=Array.from(e).filter(e=>e.name.startsWith("e-"));return t.map(e=>e.name.slice(2))}_isFlightkitElement(e){return e.toUpperCase().includes("FLK-")}_outerEventHandler(e){const t=F(e),r=(t.contents=e.detail,t.target.getAttribute("e-"+t.type));let n=void 0;for(const s of r.split("."))n=(n||window)[s];return e.preventDefault(),e.stopPropagation(),n(t)}_addEvents(e){if(e.isConnected)for(const r of this._events)if(r.selector.startsWith("."))for(const n of document.querySelectorAll(r.selector))this._addEventToElement(r,n);else{var t=document.querySelector(r.selector);this._addEventToElement(r,t)}}_addEventToElement(e,t){t&&("function"==typeof e.callback?(t.removeEventListener(e.eventType,e.callback),t.addEventListener(e.eventType,e.callback)):(t.removeEventListener(e.eventType,this._outerEventHandler),t.addEventListener(e.eventType,this._outerEventHandler)))}removeEvents(){for(const t of this._events)if(t.selector.startsWith("."))for(const r of document.querySelectorAll(t.selector))this._addEventToElement(t,r);else{var e=document.querySelector(t.selector);this._addEventToElement(t,e)}this._events=[]}_removeEventToElement(e,t){t&&("function"==typeof e.callback?t.removeEventListener(e.eventType,e.callback):t.removeEventListener(e.eventType,this._outerEventHandler))}_assignToDom(e,t){e.innerHTML="";for(const n of Array.isArray(t)?t:[t])e.append(n);const r=setTimeout(()=>{this._addEvents(e),clearTimeout(r)},10)}}const G='',H='';function V(e){const t=new DOMParser;return t.parseFromString(e,"image/svg+xml").documentElement}class W extends HTMLElement{base;component=null;_contents=[];_orderBy=[];properties=new Set;_columnOrder=[];_filter="";_selectionProperty="";_selectedIds=new Set;uniqueEntriesByProperties={};propertyLabelDictionary={};_templates={};_templateClasses={};static get observedAttributes(){return["contents","columns","order","filter","selection-property","templates"]}get columnOrder(){return this._columnOrder.length?this._columnOrder:this.properties}set columnOrder(e){let t;"string"==typeof e&&(t=e.split(",")),t=e,this._columnOrder=t}get contents(){return this._contents}set contents(e){this.analyzeData(e),this._contents=new D(e)}get orderBy(){return this._orderBy}set orderBy(e){if(Array.isArray(e))this._orderBy=e;else{const n=[];for(const s of e.split(",")){var t=s.split("|"),r=t[0],t=1e[r._selectionProperty])):new Set;e=t?r.contents.execute():[];r._emit("select",r,{selection:e}),r._updateCheckboxes(r)}emitSelect(e){var t=e.target.checked,r=e.target.dataset.objectId;const n=F(e).target,s=(t?n._selectedIds.add(r):n._selectedIds.delete(r),n._selectionProperty);e=n.contents.execute().filter(e=>n._selectedIds.has(e[s]));n._emit("select",n,{selection:e}),n._updateCheckboxes(n)}sortData(e){const t=F(e).target,r=z(e,"column");r&&(-1<(e=t._orderBy.findIndex(e=>e.propertyName===r))?"asc"===t._orderBy[e].direction?t._orderBy[e].direction="desc":t._orderBy.splice(e,1):t._orderBy.push({propertyName:r,direction:"asc"}),t.createHtml(),t.base.render(t))}setColumnOrder(e){this._columnOrder=e?Array.isArray(e)?e:e.split(","):[]}analyzeData(t){this.properties=new Set;var r=t.length;for(let e=0;e"_"===e?" ":" "+e.toLowerCase()).trim();var r=t.charAt(0).toUpperCase()+t.slice(1);return this.propertyLabelDictionary[e]=r}parseTemplate(e,n){return e.replace(/\{\{([\s\S]+?)\}\}/gim,(e,t)=>{let r="";t=t.trim();t=n[t];return t&&(r=t),Array.isArray(r)?r.join(", "):r.toString().trim()})}createSelectionCheckbox(e){const t=document.createElement("input");return t.setAttribute("type","checkbox"),t.classList.add("flk-selection-checkbox"),e&&(t.dataset.selected=e[this._selectionProperty]),t}createRow(e){const t=document.createElement("tr");if(this._selectionProperty.length){const s=document.createElement("td");var r=this.base.generateId();const i=this.createSelectionCheckbox(e);i.id=r,i.dataset.objectId=e[this._selectionProperty];var n=e[this._selectionProperty];this._selectedIds.has(n)?i.checked=!0:i.checked=!1,this.base.addEvent("#"+r,"change",this.emitSelect),s.append(i),t.append(s)}for(const o of this.columnOrder){const a=document.createElement("td");this._templates[o]?(a.innerHTML=this.parseTemplate(this._templates[o],e),this._templateClasses[o]&&a.classList.add(...this._templateClasses[o])):a.innerText=e[o],t.append(a)}return t}createBody(e){const t=document.createElement("tbody");for(const n of e){var r=this.createRow(n,null);t.append(r)}return t}createHead(){const e=document.createElement("thead"),t=document.createElement("tr");if(t.classList.add("cursor-pointer"),this._selectionProperty.length){const s=document.createElement("th");var r=this.base.generateId();const i=this.createSelectionCheckbox();i.id=r;var u=this.contents.execute().length;0e.propertyName===o);if(n){const c=document.createElement("span");c.innerHTML="asc"===n.direction?'':'',a.append(c)}t.append(a)}return e.append(t),e}addEvent(e,t,r){this.base.addEvent(e,t,r)}init(){this.createHtml(),this.base.render(this)}}class J extends HTMLElement{base;componentId;constructor(){super(),this.base=new $}connectedCallback(){var e=this.getAttribute("top"),t=this.getAttribute("left"),r=this.getAttribute("center"),n=this.getAttribute("zIndex");this.id||(this.id=this.base.generateId()),this.style.display="block",this.style.position="fixed","string"==typeof r?(this.style.top=e||"50%",this.style.left="50%",this.style.transform="translate(-50%, -50%)"):(this.style.top=e||this.clientTop+"px",this.style.left=t||this.clientLeft+"px"),n&&(this.style.zIndex=n),this.componentId=this.getAttribute("handle");const s=document.createElement("div");s.innerHTML=this.innerHTML,this.component=s;r="#"+(this.componentId||this.id);this.base.addEvent(r,"mousedown",this._dragElement),this.base.addEvent(r,"mouseup",this._reset),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this)}_dragElement(e){const r=F(e,"flk-draggable").target;let n,s;function t(e){n=e.clientX-r.offsetLeft,s=e.clientY-r.offsetTop}function i(e){var t=e.clientX-n,e=e.clientY-s;r.style.left=t+"px",r.style.top=e+"px"}function o(e){e.preventDefault()}function a(){r.removeAttribute("draggable"),r.removeEventListener("dragstart",t),r.removeEventListener("dragend",a),document.removeEventListener("dragover",o),document.removeEventListener("drop",i)}r.setAttribute("draggable",!0),r.addEventListener("dragstart",t),r.addEventListener("dragend",a),document.addEventListener("dragover",o),document.addEventListener("drop",i)}}class q extends HTMLElement{_id;base;_draggableId;constructor(){super(),this.base=new $}_emit(e,t,r){e=new CustomEvent(e,{detail:r,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}_closeModal(e){e.stopPropagation();const t=F(e,"flk-modal").target;t.classList.add("hidden")}closeModal(e){this.classList.add("hidden")}openModal(e=!0){const t=document.getElementById(this._draggableId);e&&(t.style.top="40%",t.style.left="50%"),this.classList.remove("hidden")}connectedCallback(){this.id||(this.id=this.base.generateId());const e=document.createElement("div");var t=this.base.generateId();const r=document.createElement("flk-draggable"),n=(this._draggableId=this.base.generateId(),r.id=this._draggableId,r.setAttribute("center",""),r.setAttribute("top","40%"),r.setAttribute("handle",t),r.setAttribute("zIndex","1080"),r.classList.add("border","shadow-lg","bg-white"),r.style.width="max-content",document.createElement("div"));var s=this.getAttribute("modal-title");if(s){const c=document.createElement("span");c.innerText=s,c.classList.add("ml-1","mr-auto"),n.append(c)}n.id=t;const i=this.getAttribute("header-class");let o=[];i?o=o.concat(i.split(" ")):o.push("bg-gray-light"),n.classList.add(...o,"border-bottom","row","justify-end","cursor-no-select");s=this.base.generateId();const a=document.createElement("button"),l=(a.classList.add("py-0","px-1","outline-hover","no-border","cursor-default",...o),a.innerText="X",a.id=s,n.append(a),r.append(n),document.createElement("div"));l.innerHTML=this.innerHTML,r.append(l),e.append(r),this.component=e,this.base.addEvent("#"+s,"click",this._closeModal),this.base.render(this),this.classList.add("hidden")}disconnectedCallback(){this.base.removeEvents(this)}}class K extends HTMLElement{base;_buttonId;_drawerId;_iconId;constructor(){super(),this.base=new $}connectedCallback(){this.style.position="relative",this.style.display="flex",this.style.width="fit-content",this._buttonId=this.base.generateId();const e=document.createElement("button"),t=(e.classList.add("row"),e.id=this._buttonId,document.createElement("span")),r=(t.innerText=this.getAttribute("text"),this._iconId=this.base.generateId(),document.createElement("span"));var n=V('');const s=V(''),i=(s.classList.add("hidden"),r.append(n,s),r.id=this._iconId,e.append(t,r),this._drawerId=this.base.generateId(),document.createElement("div"));i.id=this._drawerId,i.classList.add("shadow","inline-block","bg-white"),i.style.position="absolute",i.style.zIndex="1040";n=this.querySelector("template");n.innerHTML.length?i.innerHTML=n.innerHTML:i.append(n.firstChild),i.style.display="none",this.component=[e,i],this.base.addEvent("#"+this._buttonId,"click",this.toggleMenu);const o=document.querySelector("body");""!==o.getAttribute("flk-close-dropdown")&&(o.setAttribute("flk-close-dropdown",""),o.addEventListener("click",this.closeAllDropdownButtons)),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this);var e=document.querySelectorAll("flk-dropdown");if(!e||!e.length){const t=document.querySelector("body");t.removeAttribute("flk-close-dropdown"),t.removeEventListener("click",this.closeAllDropdownButtons)}}toggleMenu(e){const t=F(e).target;e=t._drawerId;const r=document.getElementById(e);var e="none"!==r.style.display,n=(r.style.display=e?"none":"block",t.getAttribute("drawer-width")),n=("string"==typeof t.getAttribute("right")&&(r.style.right="0px"),r.style.top=t.offsetHeight+"px",r.style.width=n||t.offsetWidth+"px",t._iconId);const s=document.getElementById(n);e?(s.childNodes[0].classList.remove("hidden"),s.childNodes[1].classList.add("hidden")):(s.childNodes[0].classList.add("hidden"),s.childNodes[1].classList.remove("hidden"))}_closeDropdown(){var e=this._drawerId;const t=document.getElementById(e);if("none"!==t.style.display){e=this._iconId;const r=document.getElementById(e);t.style.display="none",r.childNodes[0].classList.remove("hidden"),r.childNodes[1].classList.add("hidden")}}closeAllDropdownButtons(e){var t,r=F(e,"flk-dropdown").target,e=document.querySelectorAll("flk-dropdown");if(r)for(const n of e)r._buttonId!==n._buttonId&&(t=n._drawerId,"none"!==document.getElementById(t).style.display&&n._closeDropdown());else for(const s of e)s._closeDropdown()}}var t={exports:{}};let Z=e.default,Y=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||"win32"===process.platform||Z.isatty(1)&&"dumb"!==process.env.TERM||"CI"in process.env),r=(r,n,s=r)=>e=>{let t=""+e;e=t.indexOf(n,r.length);return~e?r+X(t,n,s,e)+n:r+t+n},X=(e,t,r,n)=>{var s=e.substring(0,n)+r;let i=e.substring(n+t.length);e=i.indexOf(t);return~e?s+X(i,t,r,e):s+i};e=(e=Y)=>({isColorSupported:e,reset:e?e=>`${e}`:String,bold:e?r("","",""):String,dim:e?r("","",""):String,italic:e?r("",""):String,underline:e?r("",""):String,inverse:e?r("",""):String,hidden:e?r("",""):String,strikethrough:e?r("",""):String,black:e?r("",""):String,red:e?r("",""):String,green:e?r("",""):String,yellow:e?r("",""):String,blue:e?r("",""):String,magenta:e?r("",""):String,cyan:e?r("",""):String,white:e?r("",""):String,gray:e?r("",""):String,bgBlack:e?r("",""):String,bgRed:e?r("",""):String,bgGreen:e?r("",""):String,bgYellow:e?r("",""):String,bgBlue:e?r("",""):String,bgMagenta:e?r("",""):String,bgCyan:e?r("",""):String,bgWhite:e?r("",""):String});t.exports=e(),t.exports.createColors=e;const Q="'".charCodeAt(0),ee='"'.charCodeAt(0),te="\\".charCodeAt(0),re="/".charCodeAt(0),ne="\n".charCodeAt(0),se=" ".charCodeAt(0),ie="\f".charCodeAt(0),oe="\t".charCodeAt(0),ae="\r".charCodeAt(0),le="[".charCodeAt(0),ce="]".charCodeAt(0),ue="(".charCodeAt(0),he=")".charCodeAt(0),pe="{".charCodeAt(0),de="}".charCodeAt(0),fe=";".charCodeAt(0),me="*".charCodeAt(0),ge=":".charCodeAt(0),ye="@".charCodeAt(0),ve=/[\t\n\f\r "#'()/;[\\\]{}]/g,we=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,be=/.[\r\n"'(/\\]/,_e=/[\da-f]/i;function Ce(t,e={}){let n=t.css.valueOf(),d=e.ignoreErrors,s,i,f,m,o,a,l,g,c,u,y=n.length,h=0,v=[],p=[];function w(e){throw t.error("Unclosed "+e,h)}return{back:function(e){p.push(e)},endOfFile:function(){return 0===p.length&&h>=y},nextToken:function(e){if(p.length)return p.pop();if(!(h>=y)){var t=!!e&&e.ignoreUnclosed;switch(s=n.charCodeAt(h),s){case ne:case se:case oe:case ae:case ie:for(i=h;i+=1,s=n.charCodeAt(i),s===se||s===ne||s===oe||s===ae||s===ie;);u=["space",n.slice(h,i)],h=i-1;break;case le:case ce:case pe:case de:case ge:case fe:case he:var r=String.fromCharCode(s);u=[r,r,h];break;case ue:if(g=v.length?v.pop()[1]:"",c=n.charCodeAt(h+1),"url"===g&&c!==Q&&c!==ee&&c!==se&&c!==ne&&c!==oe&&c!==ie&&c!==ae){i=h;do{if(a=!1,i=n.indexOf(")",i+1),-1===i){if(d||t){i=h;break}w("bracket")}for(l=i;n.charCodeAt(l-1)===te;)--l,a=!a}while(a);u=["brackets",n.slice(h,i+1),h,i],h=i}else i=n.indexOf(")",h+1),m=n.slice(h,i+1),-1===i||be.test(m)?u=["(","(",h]:(u=["brackets",m,h,i],h=i);break;case Q:case ee:f=s===Q?"'":'"',i=h;do{if(a=!1,i=n.indexOf(f,i+1),-1===i){if(d||t){i=h+1;break}w("string")}for(l=i;n.charCodeAt(l-1)===te;)--l,a=!a}while(a);u=["string",n.slice(h,i+1),h,i],h=i;break;case ye:ve.lastIndex=h+1,ve.test(n),i=0===ve.lastIndex?n.length-1:ve.lastIndex-2,u=["at-word",n.slice(h,i+1),h,i],h=i;break;case te:for(i=h,o=!0;n.charCodeAt(i+1)===te;)i+=1,o=!o;if(s=n.charCodeAt(i+1),o&&s!==re&&s!==se&&s!==ne&&s!==oe&&s!==ae&&s!==ie&&(i+=1,_e.test(n.charAt(i)))){for(;_e.test(n.charAt(i+1));)i+=1;n.charCodeAt(i+1)===se&&(i+=1)}u=["word",n.slice(h,i+1),h,i],h=i;break;default:h=(s===re&&n.charCodeAt(h+1)===me?(i=n.indexOf("*/",h+2)+1,0===i&&(d||t?i=n.length:w("comment")),u=["comment",n.slice(h,i+1),h,i]):(we.lastIndex=h+1,we.test(n),i=0===we.lastIndex?n.length-1:we.lastIndex-2,u=["word",n.slice(h,i+1),h,i],v.push(u)),i)}return h++,u}},position:function(){return h}}}e=t.exports;let Se=Ce,xe;const Ae={";":e.yellow,":":e.yellow,"(":e.cyan,")":e.cyan,"[":e.yellow,"]":e.yellow,"{":e.yellow,"}":e.yellow,"at-word":e.cyan,brackets:e.cyan,call:e.cyan,class:e.yellow,comment:e.gray,hash:e.magenta,string:e.green};function ke(e){let r=Se(new xe(e),{ignoreErrors:!0}),n="";for(;!r.endOfFile();){let e=r.nextToken(),t=Ae[function([e,t],r){if("word"===e){if("."===t[0])return"class";if("#"===t[0])return"hash"}if(!r.endOfFile()){t=r.nextToken();if(r.back(t),"brackets"===t[0]||"("===t[0])return"call"}return e}(e,r)];t?n+=e[1].split(/\r?\n/).map(e=>t(e)).join("\n"):n+=e[1]}return n}ke.registerInput=function(e){xe=e};e=ke;let Ee=t.exports,Le=e;class Oe extends Error{constructor(e,t,r,n,s,i){super(e),this.name="CssSyntaxError",this.reason=e,s&&(this.file=s),n&&(this.source=n),i&&(this.plugin=i),void 0!==t&&void 0!==r&&("number"==typeof t?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,Oe)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file||"",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source,r=(null==e&&(e=Ee.isColorSupported),Le&&e&&(t=Le(t)),t.split(/\r?\n/)),n=Math.max(this.line-3,0);var s=Math.min(this.line+2,r.length);let i=String(s).length,o,a;if(e){let{bold:t,gray:r,red:n}=Ee.createColors(!0);o=e=>t(n(e)),a=e=>r(e)}else o=a=e=>e;return r.slice(n,s).map((e,t)=>{var t=n+1+t;let r=" "+(" "+t).slice(-i)+" | ";return t===this.line?(t=a(r.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," "),o(">")+a(r)+e+"\n "+t+o("^")):" "+a(r)+e}).join("\n")}toString(){let e=this.showSourceCode();return e=e&&"\n\n"+e+"\n",this.name+": "+this.message+e}}var t=Oe,Me=(Oe.default=Oe,{});Me.isClean=Symbol("isClean"),Me.my=Symbol("my");const Pe={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class Re{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name;var n=e.params?this.rawValue(e,"params"):"";void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes?this.block(e,r+n):(t=(e.raws.between||"")+(t?";":""),this.builder(r+n+t,e))}beforeAfter(e,t){let r,n=(r="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose"),e.parent),s=0;for(;n&&"root"!==n.type;)s+=1,n=n.parent;if(r.includes("\n")){var i=this.raw(e,null,"indent");if(i.length)for(let e=0;e{if(n=e.raws[t],void 0!==n)return!1}),void 0===n&&(n=Pe[r]),i.rawCache[r]=n,n}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&0{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=void 0===r?this.raw(t,null,"beforeDecl"):r&&r.replace(/\S/g,""),r}rawBeforeDecl(e,t){let r;return e.walkDecls(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=void 0===r?this.raw(t,null,"beforeRule"):r&&r.replace(/\S/g,""),r}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(t){let r;return t.walk(e=>{if(e.nodes&&(e.parent!==t||t.first!==e)&&void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=r&&r.replace(/\S/g,""),r}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(r){if(r.raws.indent)return r.raws.indent;let n;return r.walk(e=>{var t=e.parent;if(t&&t!==r&&t.parent&&t.parent===r&&void 0!==e.raws.before)return t=e.raws.before.split("\n"),n=t[t.length-1],n=n.replace(/\S/g,""),!1}),n}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){var r=e[t],e=e.raws[t];return e&&e.value===r?e.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}}var Te=Re;Re.default=Re;let Ie=Te;function Be(e,t){let r=new Ie(t);r.stringify(e)}var Ne=Be;Be.default=Be;let{isClean:je,my:De}=Me,Ue=t,Fe=Te,ze=Ne;function $e(t,r){let n=new t.constructor;for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&"proxyCache"!==s){let e=t[s];var i=typeof e;"parent"===s&&"object"==i?r&&(n[s]=r):"source"===s?n[s]=e:Array.isArray(e)?n[s]=e.map(e=>$e(e,n)):("object"==i&&null!==e&&(e=$e(e)),n[s]=e)}return n}class Ge{constructor(e={}){for(var t in this.raws={},this[je]=!1,this[De]=!0,e)if("nodes"===t){this.nodes=[];for(var r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){var t;return e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)&&(t=this.source,e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)),e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(var t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=$e(this);for(var r in e)t[r]=e[r];return t}cloneAfter(e={}){e=this.clone(e);return this.parent.insertAfter(this,e),e}cloneBefore(e={}){e=this.clone(e);return this.parent.insertBefore(this,e),e}error(e,t={}){var r,n;return this.source?({end:r,start:n}=this.rangeBy(t),this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)):new Ue(e)}getProxyProcessor(){return{get(e,t){return"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t]},set(e,t,r){return e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0}}}markDirty(){if(this[je]){this[je]=!1;let e=this;for(;e=e.parent;)e[je]=!1}}next(){var e;if(this.parent)return e=this.parent.index(this),this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;return e.index?r=this.positionInside(e.index,t):!e.word||-1!==(e=(t=this.toString()).indexOf(e.word))&&(r=this.positionInside(e,t)),r}positionInside(t,e){var r=e||this.toString();let n=this.source.start.column,s=this.source.start.line;for(let e=0;e"object"==typeof e&&e.toJSON?e.toJSON(null,r):e);else if("object"==typeof t&&t.toJSON)n[s]=t.toJSON(null,r);else if("source"===s){let e=r.get(t.input);null==e&&(e=i,r.set(t.input,i),i++),n[s]={end:t.end,inputId:e,start:t.start}}else n[s]=t}return t&&(n.inputs=[...r.keys()].map(e=>e.toJSON())),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=ze){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(var s in r)n[s]=r[s];return e.warn(t,n)}get proxyOf(){return this}}var Te=Ge,He=(Ge.default=Ge,Te);class Ve extends He{constructor(e){super(e=e&&void 0!==e.value&&"string"!=typeof e.value?{...e,value:String(e.value)}:e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}}var He=Ve,We=(Ve.default=Ve,{}),Je={},qe={},Ke={},Ze="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),Ye=(Ke.encode=function(e){if(0<=e&&e>>=5)&&(t|=32),r+=Ye.encode(t),0>1,1==(1&a)?-i:i),r.rest=t};var Ke={},l=Ke,Xe=(l.getArg=function(e,t,r){if(t in e)return e[t];if(3===arguments.length)return r;throw new Error('"'+t+'" is a required argument.')},/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/),Qe=/^data:.+\,.+$/;function et(e){e=e.match(Xe);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}function tt(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}l.urlParse=et,l.urlGenerate=tt,rt=function(e){var t=e,r=et(e);if(r){if(!r.path)return e;t=r.path}for(var n,e=l.isAbsolute(t),s=[],i=0;;){if(n=i,-1===(i=t.indexOf("/",n))){s.push(t.slice(n));break}for(s.push(t.slice(n,i));in;e--){var o=r[e-1],a=r[e];if(Pt(o,a)<=0)break;r[e-1]=a,r[e]=o}else Ot(r,Pt,n)}function Tt(e,s){var t=e,e=("string"==typeof e&&(t=w.parseSourceMapInput(e)),w.getArg(t,"version")),t=w.getArg(t,"sections");if(e!=this._version)throw new Error("Unsupported version: "+e);this._sources=new Et,this._names=new Et;var i={line:-1,column:0};this._sections=t.map(function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var t=w.getArg(e,"offset"),r=w.getArg(t,"line"),n=w.getArg(t,"column");if(r=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))},p.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;var r=this._findSourceIndex(e);if(0<=r)return this.sourcesContent[r];var n,r=e;if(null!=this.sourceRoot&&(r=w.relative(this.sourceRoot,r)),null!=this.sourceRoot&&(n=w.urlParse(this.sourceRoot))){e=r.replace(/^file:\/\//,"");if("file"==n.scheme&&this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];if((!n.path||"/"==n.path)&&this._sources.has("/"+r))return this.sourcesContent[this._sources.indexOf("/"+r)]}if(t)return null;throw new Error('"'+r+'" is not in the SourceMap.')},p.prototype.generatedPositionFor=function(e){var t=w.getArg(e,"source");if((t=this._findSourceIndex(t))<0)return{line:null,column:null,lastColumn:null};t={source:t,originalLine:w.getArg(e,"line"),originalColumn:w.getArg(e,"column")},e=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",w.compareByOriginalPositions,w.getArg(e,"bias",f.GREATEST_LOWER_BOUND));if(0<=e){e=this._originalMappings[e];if(e.source===t.source)return{line:w.getArg(e,"generatedLine",null),column:w.getArg(e,"generatedColumn",null),lastColumn:w.getArg(e,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},ft.BasicSourceMapConsumer=p,(Tt.prototype=Object.create(f.prototype)).constructor=f,Tt.prototype._version=3,Object.defineProperty(Tt.prototype,"sources",{get:function(){for(var e=[],t=0;t{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(n,s=21)=>(e=s)=>{let t="",r=e;for(;r--;)t+=n[Math.random()*n.length|0];return t}};let{SourceMapConsumer:Ut,SourceMapGenerator:Ft}=We,{existsSync:zt,readFileSync:$t}=i.default,{dirname:Gt,join:Ht}=n.default;class Vt{constructor(e,t){!1!==t.map&&(this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:"),e=t.map?t.map.prev:void 0,e=this.loadMap(t.from,e),!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Gt(this.mapFile)),e&&(this.text=e))}consumer(){return this.consumerCache||(this.consumerCache=new Ut(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+t)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);var r,n;t&&(r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r),-1"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,i,o;t&&"object"==typeof t?(a=r,r="number"==typeof(l=t).offset?(t=(c=this.fromOffset(l.offset)).line,c.col):(t=l.line,l.column),o="number"==typeof a.offset?(c=this.fromOffset(a.offset),i=c.line,c.col):(i=a.line,a.column)):r||(t=(l=this.fromOffset(t)).line,r=l.col);var a,l,c=this.origin(t,r,i,o);return s=c?new Xt(e,void 0===c.endLine?c.line:{column:c.column,line:c.line},void 0===c.endLine?c.column:{column:c.endColumn,line:c.endLine},c.source,c.file,n.plugin):new Xt(e,void 0===i?t:{column:r,line:t},void 0===i?r:{column:o,line:i},this.css,this.file,n.plugin),s.input={column:r,endColumn:o,endLine:i,line:t,source:this.css},this.file&&(Jt&&(s.input.url=Jt(this.file).toString()),s.input.file=this.file),s}fromOffset(t){let n;if(this[er])n=this[er];else{var s=this.css.split("\n");n=new Array(s.length);let r=0;for(let e=0,t=s.length;e>1),t=n[i+1])){r=i;break}r=i+1}}return{col:t-n[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Kt(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let s=this.map.consumer();t=s.originalPositionFor({column:t,line:e});if(!t.source)return!1;let i;"number"==typeof r&&(i=s.originalPositionFor({column:n,line:r}));let o,a=(o=qt(t.source)?Jt(t.source):new URL(t.source,this.map.consumer().sourceRoot||Jt(this.map.mapFile)),{column:t.column,endColumn:i&&i.column,endLine:i&&i.line,line:t.line,url:o.toString()});if("file:"===o.protocol){if(!Wt)throw new Error("file: protocol is not available in this PostCSS build");a.file=Wt(o)}e=s.sourceContentFor(t.source);return e&&(a.source=e),a}toJSON(){let e={};for(var t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}}Je=nr;nr.default=nr,Yt&&Yt.registerInput&&Yt.registerInput(nr);let{SourceMapConsumer:sr,SourceMapGenerator:ir}=We,{dirname:or,relative:ar,resolve:lr,sep:cr}=n.default,ur=s.default["pathToFileURL"],hr=Je,pr=Boolean(sr&&ir),dr=Boolean(or&&lr&&ar&&cr);ft=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e,t=(e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map","\n");this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(var t of this.previous()){var r=this.toUrl(this.path(t.file)),n=t.root||or(t.file);let e;!1===this.mapOpts.sourcesContent?(e=new sr(t.text),e.sourcesContent&&(e.sourcesContent=null)):e=t.consumer(),this.map.applySourceMap(e,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let t;for(let e=this.root.nodes.length-1;0<=e;e--)t=this.root.nodes[e],"comment"===t.type&&0===t.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(e)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),dr&&pr&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,e=>{t+=e}),[t]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=ir.fromSourceMap(e)}else this.map=new ir({file:this.outputFile()}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):""});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&0",o={generated:{column:0,line:0},original:{column:0,line:0},source:""},a,l;this.stringify(this.root,(e,t,r)=>{this.css+=e,t&&"end"!==r&&(o.generated.line=n,o.generated.column=s-1,t.source&&t.source.start?(o.source=this.sourcePath(t),o.original.line=t.source.start.line,o.original.column=t.source.start.column-1):(o.source=i,o.original.line=1,o.original.column=0),this.map.addMapping(o)),a=e.match(/\n/g),a?(n+=a.length,l=e.lastIndexOf("\n"),s=e.length-l):s+=e.length,t&&"start"!==r&&(e=t.parent||{raws:{}},("decl"===t.type||"atrule"===t.type&&!t.nodes)&&t===e.last&&!e.raws.semicolon||(t.source&&t.source.end?(o.source=this.sourcePath(t),o.original.line=t.source.end.line,o.original.column=t.source.end.column-1,o.generated.line=n,o.generated.column=s-2):(o.source=i,o.original.line=1,o.original.column=0,o.generated.line=n,o.generated.column=s-1),this.map.addMapping(o)))})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;var e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:0e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;var t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?or(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=or(lr(r,this.mapOpts.annotation)));t=ar(r,e);return this.memoizedPaths.set(e,t),t}previous(){var e;return this.previousMaps||(this.previousMaps=[],this.root?this.root.walk(e=>{e.source&&e.source.input.map&&(e=e.source.input.map,this.previousMaps.includes(e)||this.previousMaps.push(e))}):(e=new hr(this.originalCSS,this.opts)).map&&this.previousMaps.push(e.map)),this.previousMaps}setSourcesContent(){let r={};var e;this.root?this.root.walk(e=>{var t;!e.source||(t=e.source.input.from)&&!r[t]&&(r[t]=!0,t=this.usesFileUrls?this.toFileUrl(t):this.toUrl(this.path(t)),this.map.setSourceContent(t,e.source.input.css))}):this.css&&(e=this.opts.from?this.toUrl(this.path(this.opts.from)):"",this.map.setSourceContent(e,this.css))}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){var t=this.memoizedFileURLs.get(e);if(t)return t;if(ur)return t=ur(e).toString(),this.memoizedFileURLs.set(e,t),t;throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){var t=this.memoizedURLs.get(e);if(t)return t;"\\"===cr&&(e=e.replace(/\\/g,"/"));t=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,t),t}};class fr extends Te{constructor(e){super(e),this.type="comment"}}Ct=fr;fr.default=fr;let{isClean:mr,my:gr}=Me,yr=He,vr=Ct,wr,br,_r,Cr;class Sr extends Te{append(...e){for(var t of e){var r;for(r of this.normalize(t,this.last))this.proxyOf.nodes.push(r)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(var t of this.nodes)t.cleanRaws(e)}each(r){if(this.proxyOf.nodes){var n=this.getIterator();let e,t;for(;this.indexes[n]t[n](...e.map(r=>"function"==typeof r?(e,t)=>r(e.toProxy(),t):r)):"every"===n||"some"===n?r=>t[n]((e,...t)=>r(e.toProxy(),...t)):"root"===n?()=>t.root().toProxy():"nodes"===n?t.nodes.map(e=>e.toProxy()):"first"===n||"last"===n?t[n].toProxy():t[n])},set(e,t,r){return e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0}}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){var r,n,s,i=this.index(e),o=this.normalize(t,this.proxyOf.nodes[i]).reverse(),i=this.index(e);for(r of o)this.proxyOf.nodes.splice(i+1,0,r);for(s in this.indexes)i<(n=this.indexes[s])&&(this.indexes[s]=n+o.length);return this.markDirty(),this}insertBefore(e,t){var r,n,s,i=this.index(e),o=this.normalize(t,this.proxyOf.nodes[i],0===i&&"prepend").reverse(),i=this.index(e);for(r of o)this.proxyOf.nodes.splice(i,0,r);for(s in this.indexes)i<=(n=this.indexes[s])&&(this.indexes[s]=n+o.length);return this.markDirty(),this}normalize(e,t){if("string"==typeof e)e=function t(e){return e.map(e=>(e.nodes&&(e.nodes=t(e.nodes)),delete e.source,e))}(wr(e).nodes);else if(void 0===e)e=[];else if(Array.isArray(e))for(var r of e=e.slice(0))r.parent&&r.parent.removeChild(r,"ignore");else if("root"===e.type&&"document"!==this.type)for(var n of e=e.nodes.slice(0))n.parent&&n.parent.removeChild(n,"ignore");else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new yr(e)]}else if(e.selector)e=[new br(e)];else if(e.name)e=[new _r(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new vr(e)]}return e.map(e=>(e[gr]||Sr.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[mr]&&function e(t){if(t[mr]=!1,t.proxyOf.nodes)for(var r of t.proxyOf.nodes)e(r)}(e),void 0===e.raws.before&&t&&void 0!==t.raws.before&&(e.raws.before=t.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}prepend(...e){for(var t of e=e.reverse()){var r,n,s=this.normalize(t,this.first,"prepend").reverse();for(r of s)this.proxyOf.nodes.unshift(r);for(n in this.indexes)this.indexes[n]=this.indexes[n]+s.length}return this.markDirty(),this}push(e){return(e.parent=this).proxyOf.nodes.push(e),this}removeAll(){for(var e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){var t,r;for(r in e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1),this.indexes)e<=(t=this.indexes[r])&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(t,r,n){return n||(n=r,r={}),this.walkDecls(e=>{r.props&&!r.props.includes(e.prop)||r.fast&&!e.value.includes(r.fast)||(e.value=e.value.replace(t,n))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(n){return this.each((t,e)=>{let r;try{r=n(t,e)}catch(e){throw t.addToError(e)}return!1!==r&&t.walk&&(r=t.walk(n)),r})}walkAtRules(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("atrule"===e.type&&r.test(e.name))return n(e,t)}):this.walk((e,t)=>{if("atrule"===e.type&&e.name===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("atrule"===e.type)return n(e,t)}))}walkComments(r){return this.walk((e,t)=>{if("comment"===e.type)return r(e,t)})}walkDecls(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("decl"===e.type&&r.test(e.prop))return n(e,t)}):this.walk((e,t)=>{if("decl"===e.type&&e.prop===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("decl"===e.type)return n(e,t)}))}walkRules(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("rule"===e.type&&r.test(e.selector))return n(e,t)}):this.walk((e,t)=>{if("rule"===e.type&&e.selector===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("rule"===e.type)return n(e,t)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}Sr.registerParse=e=>{wr=e},Sr.registerRule=e=>{br=e},Sr.registerAtRule=e=>{_r=e},Sr.registerRoot=e=>{Cr=e};i=Sr,Sr.default=Sr,Sr.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,_r.prototype):"rule"===e.type?Object.setPrototypeOf(e,br.prototype):"decl"===e.type?Object.setPrototypeOf(e,yr.prototype):"comment"===e.type?Object.setPrototypeOf(e,vr.prototype):"root"===e.type&&Object.setPrototypeOf(e,Cr.prototype),e[gr]=!0,e.nodes&&e.nodes.forEach(e=>{Sr.rebuild(e)})},ot=i;let xr,Ar;class kr extends ot{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){let t=new xr(new Ar,this,e);return t.stringify()}}kr.registerLazyResult=e=>{xr=e},kr.registerProcessor=e=>{Ar=e};e=kr;kr.default=kr;let Er={};function Lr(e){Er[e]||(Er[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))}class Or{constructor(e,t={}){for(var r in this.type="warning",this.text=e,t.node&&t.node.source&&(e=t.node.rangeBy(t),this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column),t)this[r]=t[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}St=Or;Or.default=Or;let Mr=St;class Pr{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);e=new Mr(e,t);return this.messages.push(e),e}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}}Ke=Pr;Pr.default=Pr;let Rr=i;class Tr extends Rr{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}We=Tr;Tr.default=Tr,Rr.registerAtRule(Tr);let Ir=i,Br,Nr;class jr extends Ir{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){e=super.normalize(e);if(t)if("prepend"===r)1{Br=e},jr.registerProcessor=e=>{Nr=e};n=jr;jr.default=jr,Ir.registerRoot(jr);let Dr={comma(e){return Dr.split(e,[","],!0)},space(e){return Dr.split(e,[" ","\n","\t"])},split(e,t,u){let r=[],n="",s=!1,i=0,o=!1,a="",l=!1;for(var c of e)l?l=!1:"\\"===c?l=!0:o?c===a&&(o=!1):'"'===c||"'"===c?(o=!0,a=c):"("===c?i+=1:")"===c?0"space"!==e[0]&&"comment"!==e[0])&&(s.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(s,"value",a.concat(e),t),s.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new Jr;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){var t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1;var r;let n=!1,s=null,i=[];var o=e[1].startsWith("--");let a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)s=s||l,i.push("("===r?")":"]");else if(o&&n&&"{"===r)s=s||l,i.push("}");else if(0===i.length){if(";"===r){if(n)return void this.decl(a,o);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===i[i.length-1]&&(i.pop(),0===i.length&&(s=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),0e+t[1],""),e.raws[t]={raw:o,value:l}),e[t]=l}rule(e){e.pop();let t=new Jr;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){var t;let r="";for(;e.length&&("space"===(t=e[e.length-1][0])||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){var t;let r="";for(;e.length&&("space"===(t=e[0][0])||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t="";for(;e.length&&"space"===e[e.length-1][0];)t=e.pop()[1]+t;return t}stringFrom(t,r){let n="";for(let e=r;evn(e)),e}let wn={};class bn{constructor(e,t,r){this.stringified=!1,this.processed=!1;let n;if("object"!=typeof t||null===t||"root"!==t.type&&"document"!==t.type)if(t instanceof bn||t instanceof ln)n=vn(t.root),t.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=t.map);else{let e=cn;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{n=e(t,r)}catch(e){this.processed=!0,this.error=e}n&&!n[tn]&&sn.rebuild(n)}else n=vn(t);this.result=new ln(e,n,r),this.helpers={...wn,postcss:wn,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){var r=this.result.lastPlugin;try{if(t&&t.addToError(e),"CssSyntaxError"!==(this.error=e).name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){var n=r.postcssPlugin;let e=r.postcssVersion,t=this.result.processor.version;var s=e.split("."),i=t.split(".");(s[0]!==i[0]||parseInt(s[1])>parseInt(i[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+t+", but "+n+" uses "+e+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};var e,t=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(e of this.plugins)if("object"==typeof e)for(var r in e){if(!pn[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${e.postcssPlugin}. `+`Try to update PostCSS (${this.processor.version} now).`);if(!dn[r])if("object"==typeof e[r])for(var n in e[r])"*"===n?t(e,r,e[r][n]):t(e,r+"-"+n.toLowerCase(),e[r][n]);else"function"==typeof e[r]&&t(e,r,e[r])}this.hasListener=0t(e,this.helpers)),await Promise.all(i)):await t(r,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{var e;if("object"==typeof t&&t.Once)return"document"===this.result.root.type?mn((e=this.result.root.nodes.map(e=>t.Once(e,this.helpers)))[0])?Promise.all(e):e:t.Once(this.result.root,this.helpers);if("function"==typeof t)return t(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();var e=this.result.opts;let t=nn,r=(e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify),new rn(t,this.result.root,this.result.opts));e=r.generate();return this.result.css=e[0],this.result.map=e[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(var e of this.plugins)if(mn(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[en];)e[en]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(var t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||an("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(var[r,n]of e){this.result.lastPlugin=r;let e;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(mn(e))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:s}=r;if("root"===n.type||"document"===n.type||n.parent){if(0{e[en]||this.walkSync(e)});else{var r=this.listeners[t];if(r&&this.visitSync(r,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}bn.registerPostcss=e=>{wn=e};Me=bn;bn.default=bn,un.registerLazyResult(bn),on.registerLazyResult(bn);let _n=ft,Cn=Ne,Sn=Lr,xn=Qr;const An=Ke;class kn{constructor(e,t,r){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;var e=Cn;this.result=new An(this._processor,void 0,this._opts),this.result.css=t;let n=this,s=(Object.defineProperty(this.result,"root",{get(){return n.root}}),new _n(e,void 0,this._opts,t));s.isMap()?([r,e]=s.generate(),r&&(this.result.css=r),e&&(this.result.map=e)):(s.clearAnnotation(),this.result.css=s.css)}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||Sn("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=xn;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}}ft=kn;kn.default=kn;let En=ft,Ln=Me,On=e,Mn=n;class Pn{constructor(e=[]){this.version="8.4.35",this.plugins=this.normalize(e)}normalize(e){let t=[];for(var r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return new(this.plugins.length||t.parser||t.stringifier||t.syntax?Ln:En)(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}ft=Pn;Pn.default=Pn,Mn.registerProcessor(Pn),On.registerProcessor(Pn);let Rn=He,Tn=qe,In=Ct,Bn=We,Nn=Je,jn=n,Dn=ot;function Un(e,r){if(Array.isArray(e))return e.map(e=>Un(e));let{inputs:t,...n}=e;if(t){r=[];for(var s of t){let e={...s,__proto__:Nn.prototype};e.map&&(e.map={...e.map,__proto__:Tn.prototype}),r.push(e)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>Un(e,r))),n.source){let{inputId:e,...t}=n.source;n.source=t,null!=e&&(n.source.input=r[e])}if("root"===n.type)return new jn(n);if("decl"===n.type)return new Rn(n);if("rule"===n.type)return new Dn(n);if("comment"===n.type)return new In(n);if("atrule"===n.type)return new Bn(n);throw new Error("Unknown node type: "+e.type)}qe=Un,Un.default=Un;let Fn=He,zn=Me;He=i;let $n=ft;Me=Ne,i=qe;let Gn=e;ft=St;let Hn=Ct,Vn=We;Ne=Ke,qe=Je,e=Qr,St=s;let Wn=ot,Jn=n;Ct=Te;function o(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new $n(e)}o.plugin=function(r,n){let s=!1;function i(...e){console&&console.warn&&!s&&(s=!0,console.warn(r+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(r+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let t=n(...e);return t.postcssPlugin=r,t.postcssVersion=(new $n).version,t}let e;return Object.defineProperty(i,"postcss",{get(){return e=e||i(),e}}),i.process=function(e,t,r){return o([i(r)]).process(e,t)},i},o.stringify=Me,o.parse=e,o.fromJSON=i,o.list=St,o.comment=e=>new Hn(e),o.atRule=e=>new Vn(e),o.decl=e=>new Fn(e),o.rule=e=>new Wn(e),o.root=e=>new Jn(e),o.document=e=>new Gn(e),o.CssSyntaxError=t,o.Declaration=Fn,o.Container=He,o.Processor=$n,o.Document=Gn,o.Comment=Hn,o.Warning=ft,o.AtRule=Vn,o.Result=Ne,o.Input=qe,o.Rule=Wn,o.Root=Jn,o.Node=Ct,zn.registerPostcss(o);o.default=o;class qn extends HTMLElement{base;contents;component;listType="ul";iconSet;filter={value:"",caseSensitive:!1};static get observedAttributes(){return["contents","icon-set","max-depth","filter"]}_jsonToValueArray(e){let t=JSON.stringify(e);t=t.replace(/[\[\]{}\"]/g,"");let r=[];for(const n of t.split(","))r=r.concat(n.split(":"));return[...new Set(r)]}_emit(e,t,r){e=new CustomEvent(e,{detail:r,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}constructor(){super(),this.base=new $,this.setContents(this.getAttribute("contents")),this.iconSet=this.getAttribute("icon-set")?this.getAttribute("icon-type"):"file",this.maxDepth=this.getAttribute("max-depth")?parseInt(this.getAttribute("max-depth")):-1,this.setFilter(this.getAttribute("filter")),this.style.display="block",this.style.maxWidth="fit-content",this.style.margin="0 1rem 0 0",this.base.addEvent(".flk-branch","click",this.emitNodeToggle)}emitNodeToggle(e){e.stopPropagation();const t=F(e,"flk-tree-nav").target,r=z(e,"branchKey");let n=t.contents;const s=r.split(".");for(const o of s)if(n[o])n=n[o];else if(null===n[o])n=null;else{let e=[];for(const a of n)a[o]&&e.push(a[o]);n=e}var e=r.substring(r.indexOf(".")+1),i=t.createLeafText(s.reverse()[0]);t._emit("tree-click",t,{path:e,data:n,key:(i.titleText+" "+i.commentText).trim(),branch:"object"==typeof n})}convertJsonKeyToTitle(e){if(!e)return"";const t=(e="string"!=typeof e?e.toString():e).replace(/([A-Z_])/g,e=>"_"===e?" ":" "+e).trim();return t.charAt(0).toUpperCase()+t.slice(1)}setContents(e){var t=e||this.contents||[];try{switch(typeof t){case"string":this.contents=JSON.parse(t);break;case"object":Array.isArray(t)?this.contents=t:this.contents=[t]}}catch(e){console.log(e)}}applyFilter(e){let t;var r="details"===e.tagName.toLowerCase();t=this.filter.caseSensitive?e.dataset.branchValues.includes(this.filter.value):e.dataset.branchValues.toLowerCase().includes(this.filter.value.toLowerCase()),t?e.parentElement.classList.remove("hidden"):e.parentElement.classList.add("hidden"),r&&t?e.setAttribute("open",""):e.removeAttribute("open")}resetTree(e){e.parentElement.classList.remove("hidden"),e.removeAttribute("open")}filterTree(){let t=setTimeout(()=>{for(const e of this.querySelectorAll("[data-branch-values]"))void 0===this.filter.value||0===this.filter.value.length?this.resetTree(e):this.applyFilter(e);clearTimeout(t)},10)}setFilter(e){const t=e||{};try{switch(typeof t){case"string":t.includes("{")?(this.filter=JSON.parse(t),!1===this.filter.caseSensitive&&(this.filter.value=this.filter.value.toLowerCase())):this.filter.value=e.toLowerCase();break;case"object":this.filter=t}}catch(e){console.log(e)}this.filterTree()}createLeafText(e){var t,r;let n="",s="";return"string"==typeof e&&(e.includes("(")||e.includes("["))?(r=e.indexOf("("),r=-1===(t=e.indexOf("["))?r:t,n=this.convertJsonKeyToTitle(e.substring(0,r)),s=e.substring(r)):n=this.convertJsonKeyToTitle(e),{titleText:n,commentText:s}}createTextTag(n,s){n=this.createLeafText(n);if(n.commentText){let e=document.createElement("div"),t=document.createElement("span"),r=(t.innerText=n.titleText,document.createElement("small"));r.innerText=n.commentText,r.style.marginLeft="1rem",e.append(t,r),e.style.display="inline-flex",e.style.alignItems="center",s.append(e)}else s.innerText=n.titleText}createLeaf(e,t,r,n=[]){let s=document.createElement("li");s.classList.add("cursor-no-select"),s.style.marginTop="0.4rem",s.dataset.branchKey=r;const i="file"===this.iconSet?'':'';s.style.listStyleImage=`url('data:image/svg+xml,${i}')`,s.style.position="relative",s.style.left="2px";let o=document.createElement("span");r=[e].concat(n);if(o.dataset.branchValues=[...new Set(r)].join(),n.length&&(o.dataset.leafKey=r[0]),this.createTextTag(e,o),o.style.position="relative",o.style.top="-3px",s.append(o),t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);const i="file"===this.iconSet?G:H;e.style.listStyleImage=`url('data:image/svg+xml,${i}')`,e.append(s),t.append(e)}else t.append(s)}createBranch(r,t,n,s){if(s===this.maxDepth&&"object"==typeof r)for(const o of Array.isArray(r)?r:Object.keys(r)){let e;r[o]&&(e=this._jsonToValueArray(r[o])),this.createLeaf(o,t,n+"."+o,e)}else if(Array.isArray(r))for(var e in r){var u=document.createElement(this.listType);t.append(this.createBranch(r[e],u,n+"."+e,s+1))}else if(null!==r&&"object"==typeof r){const a=[];for(const l of Object.keys(r)){let e=document.createElement("li"),t=(e.classList.add("cursor-no-select"),e.style.position="relative",e.style.left="2px",e.dataset.branchKey=n+"."+l,document.createElement("details"));t.classList.add("flk-branch"),t.dataset.branchValues=[l].concat(this._jsonToValueArray(r[l])),t.style.position="relative",t.style.top="-3px",t.classList.add("cursor-default");var i=document.createElement("summary");this.createTextTag(l,i),t.append(i),e.append(this.createBranch(r[l],t,n+"."+l,s+1)),a.push(e)}if(t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);var h="file"===this.iconSet?G:H;e.style.listStyleImage=`url('data:image/svg+xml,${h}')`;for(const c of a)e.append(c);t.append(e)}else for(const p of a)t.append(p)}else this.createLeaf(r,t,n);return t}createHtml(){let e=document.createElement(this.listType);var t="file"===this.iconSet?G:'';if(e.style.listStyleImage=`url('data:image/svg+xml,${t}')`,e.style.marginLeft="3rem",this.contents.length){for(const r in this.contents)e=this.createBranch(this.contents[r],e,r,0);this.component=e}else this.component=e}attributeChangedCallback(e,t,r){switch(e){case"contents":this.setContents(r);break;case"icon-set":this.iconSet=r;break;case"max-depth":this.maxDepth="string"==typeof r?parseInt(r):r;break;case"filter":this.setFilter(r)}this.init()}connectedCallback(){this.init()}disconnectedCallback(){this.base.removeEvents(this)}init(){this.createHtml(),this.base.render(this)}}customElements.define("flk-table",W),customElements.define("flk-draggable",J),customElements.define("flk-modal",q),customElements.define("flk-dropdown",K),customElements.define("flk-tree-nav",qn)}(require$$0,require$$2,require$$1$1,require$$1); \ No newline at end of file diff --git a/documentation/public/cdn/ibiss-v0.0.4/flightkit.min.js b/documentation/public/cdn/ibiss-v0.0.4/flightkit.min.js index a5a8ef8..9a82b7a 100644 --- a/documentation/public/cdn/ibiss-v0.0.4/flightkit.min.js +++ b/documentation/public/cdn/ibiss-v0.0.4/flightkit.min.js @@ -1 +1 @@ -!function(e,n,s,i){"use strict";function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a,u,g,e=c(e),n=c(n),s=c(s),i=c(i);(t=a=a||{}).Date="date",t.String="string",t.Float="float",t.Number="number",t.Array="array",t.Object="object",t.Bool="bool",t.Currency="currency",t.Undefined="undefined",t.Null="null";const h={date:/^(\d{1,4}-\d{1,4}-\d{1,4}(T)?)/gim,currency:/^[$|€]\s?[0-9]*(\.|,)?\d*(\.|,)?\d*/gim,float:/\d+[,|.]\d+[,|.]?\d*/gim,currencySign:/\$|€/gim,array:/^\s?[[].[^,]+[\]],?/gi,precision:/[-+$€,.]/gm,string:/[a-zA-Z]/gim},m=e=>{return null===e||"null"===e?a.Null:e||0===e||!1===e?null===new RegExp(h.date).exec(e)||isNaN(Date.parse(e))?new RegExp(h.currency).exec(e)?a.Currency:!new RegExp(h.string).exec(e)&&new RegExp(h.float).exec(e.toString())?a.Float:isNaN(e)&&0!==e?Array.isArray(e)?a.Array:"object"==typeof e?a.Object:a.String:a.Number:a.Date:a.Undefined},y=(t,e)=>{const r={value:void 0,type:e=e||m(t),currencySign:""};switch(r.type){case a.String:r.value=t.toString();break;case a.Float:case a.Currency:var n=(t=t.toString()).match(new RegExp(/(,)/gim)),s=t.match(new RegExp(/(\.)/gim));if(n)for(let e=1;e<=n.length;e++)t=e!==n.length||s?t.replace(",",""):t.replace(",",".");if(r.type===a.Currency){const o=new RegExp(h.currencySign);var i=o.exec(t);r.currencySign=null!==i?i[0]:"",t=t.replace(o,"")}r.value=parseFloat(t).toPrecision(12);break;case a.Number:r.value=Number(t);break;case a.Date:r.value=Date.parse(t);break;case a.Array:t.length?"object"==typeof t[0]?r.value=t.map(e=>JSON.stringify(e)).join(", "):r.value=t.join(", "):r.value="";break;case a.Object:r.value=t;break;case a.Undefined:r.value="";break;case a.Null:r.value=null}return r};function v(e,t){var r;let n;for(r of e.split("."))r=r.trim(),n?"object"!=typeof n||Array.isArray(n)||(n=n[r]):n=t[r];return n}const b=(e,t)=>tet<=e,S=(e,t)=>e<=t,x=(e,t,r)=>r?e.toLowerCase()==t.toLowerCase():e==t,A=(e,t)=>e===t,k=(e,t)=>e!=t,E=(e,t)=>e!==t,L=(e,t)=>null!=t&&"string"==typeof e&&0<=e.toLowerCase().indexOf(t.toString().toLowerCase()),O=(e,t)=>null!=t&&0<=e.toString().toLowerCase().indexOf(t.toString().toLowerCase()),M=(e,t)=>null!=t&&"string"==typeof e&&e.toLowerCase().indexOf(t.toString().toLowerCase())<0;function P(r,n){if(0===n.length)return r;{var s=r;const o=[],a=[];let e=[];for(const l of n)l.type&&l.type!==u.And?(e.length&&a.push(e),e=[l]):e.push(l);a.push(e);let t=[];for(const e of a)t=t.concat(R(s,e));t=[...new Set(t)];var i=s.length;for(let e=0;e":return b;case"<":return _;case">=":return C;case"<=":return S;case"is":case"==":return x;case"!is":case"!=":return k;case"===":return A;case"!==":return E;case"like":case"~":case"contains":return L;case"!contains":case"!like":case"!~":return M;default:return O}}(a.operator);if(!l(i,o,a.ignoreCase)){e=!1;break}}e&&r.push(n)}return r};function T(e,t){if(!t||0===t.length)return e;if(1{if(0===r.length)r=r.concat(I(s,e));else{for(const t of r)n=n.concat(I(t,e));r=n,n=[]}}),r}return I(e,t[0])}function I(e,t){const r=[],n=[];do{if(!e||0===e.length)break;var s=e.shift();if(!s)break;const o=s[t];var i=n.indexOf(o.toString());0<=i?r[i].push(s):(n.push(o.toString()),void 0!==r[n.length-1]?r[n.length-1].push(s):r.push([s]))}while(0{if(t){var r=e;const n={};for(const s of t){let e=r.map(e=>e[s].toString());const i=e.map(e=>m(e));i.some(e=>e===a.Float)?(e=e.map(e=>parseFloat(e)),n[s]=parseFloat(e.reduce((e,t)=>e+t).toFixed(2))):(e=e.map(e=>parseInt(e)),n[s]=e.reduce((e,t)=>e+t))}return n}return{}};class D{model;sortDetails=[];filterDetails=[];selection=[];groupByProperties=[];distinctProperties=[];concatenationToken=", ";constructor(e){this.model=JSON.parse(JSON.stringify(e))}sort(e){return this.sortDetails=e,this}orderBy(e,t){return this.sortDetails.push({propertyName:e,direction:t}),this}thenOrderBy(e,t){return this.orderBy(e,t)}filter(e){return Array.isArray(e)?this.filterDetails=e:this.filterDetails.push(e),this}where(e,t,r,n,s){return this.filterDetails.push({propertyName:e,operator:t,value:r,type:n,ignoreCase:s}),this}andWhere(e,t,r,n){return this.where(e,t,r,u.And,n),this}orWhere(e,t,r,n){return this.where(e,t,r,u.Or,n),this}group(e){return this.groupByProperties=e,this}groupBy(e){return this.groupByProperties.push(e),this}thenGroupBy(e){return this.groupByProperties.push(e),this}select(e){return Array.isArray(e)?this.selection=e:"*"!==e&&(this.selection=[e]),this}distinct(e,t){return t&&(this.concatenationToken=t),Array.isArray(e)?this.distinctProperties=e:e&&(this.distinctProperties=[e]),this}execute(){return T(function(t,r){if(0===r.length)return t;{var n=r;let e=[];for(const s of t){const i={};for(const o of n)i[o]=s[o];e.push(i)}return e}}(function(r,n,u){if(!n||!n.length)return r;const s=[],h=[];for(const f of r){const o={};let t="";for(const e of n){var p=v(e,f);o[e]=p,t+=p}if(!h.includes(t)){let e=r;for(const a of Object.keys(o))e=e.filter(e=>e[a]===o[a]);h.push(t),s.push(e)}}const t=[];for(const m of s){let e={};for(const l of m){var i,d=Object.keys(e);if(d.length)for(const c of d)n.includes(c)||(i=e[c],Array.isArray(i)?(i=l[c],Array.isArray(i)?e[c]=[...new Set(...e[c].concat(l[c]))]:e[c].includes(l[c])||e[c].push(l[c])):isNaN(e[c])&&isNaN(l[c])?e[c]!==l[c]&&(e[c]=[e[c],l[c]]):e[c]=e[c]+l[c]);else e=l}t.push(e)}return t.forEach(e=>{for(const t in e)Array.isArray(e[t])&&(e[t]=e[t].join(u))}),t}(B(P(JSON.parse(JSON.stringify(this.model)),this.filterDetails),this.sortDetails),this.distinctProperties,this.concatenationToken),this.selection),this.groupByProperties)}sum(e,t){e=Array.isArray(e)?e:[e];return j(t||this.model,e)}}function U(e,t){t=t?t.toUpperCase():"FLK-";return e.toUpperCase().includes(t)}function F(e,t){var{timeStamp:r,type:n,x:s,y:i}=e;let o=e.target;do{if(!o||"HTML"===o.tagName||U(o.tagName,t)){"HTML"===o.tagName&&(o=null);break}}while(o=o.parentNode||o.parentElement,!U(o.tagName,t));return{target:o,timeStamp:r,type:n,x:s,y:i}}function z(e,t){let r=e.target,n="";for(;r.dataset[t]?n=r.dataset[t]:r=r.parentNode,!n;);return n}class ${constructor(){}_topLevelClasses=[];_events=[];generateId(){return"flk-"+function e(){const t=([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)),r=t.split("-")[0];return window.$flightkitUUIDStore||(window.$flightkitUUIDStore=[]),window.$flightkitUUIDStore.some(e=>e===r)?e():(window.$flightkitUUIDStore.push(r),r)}()}render(t){if(!t.component)throw new Error("Component is not assigned! Can't render");t.id=t.id||this.generateId();var e=this._getAllEventAttributes(t);if(e){var r="#"+t.id;for(const i of e){var n="e-"+i;this.addEvent(r,i,t.getAttribute(n))}}var s=Object.keys(t.classList).length;if(s){for(let e=0;e{this._assignToDom(t,t.component),clearTimeout(this._renderTimer)},10)}addEvent(e,t,r){this._events.push({selector:e,eventType:t,callback:r})}_getExternalCallback(e){let t=void 0;for(const r of e.split("."))t=(t||window)[r];return t}_getAllEventAttributes(e){e=e.attributes;const t=Array.from(e).filter(e=>e.name.startsWith("e-"));return t.map(e=>e.name.slice(2))}_isFlightkitElement(e){return e.toUpperCase().includes("FLK-")}_outerEventHandler(e){const t=F(e),r=(t.contents=e.detail,t.target.getAttribute("e-"+t.type));let n=void 0;for(const s of r.split("."))n=(n||window)[s];return e.preventDefault(),e.stopPropagation(),n(t)}_addEvents(e){if(e.isConnected)for(const r of this._events)if(r.selector.startsWith("."))for(const n of document.querySelectorAll(r.selector))this._addEventToElement(r,n);else{var t=document.querySelector(r.selector);this._addEventToElement(r,t)}}_addEventToElement(e,t){t&&("function"==typeof e.callback?(t.removeEventListener(e.eventType,e.callback),t.addEventListener(e.eventType,e.callback)):(t.removeEventListener(e.eventType,this._outerEventHandler),t.addEventListener(e.eventType,this._outerEventHandler)))}removeEvents(){for(const t of this._events)if(t.selector.startsWith("."))for(const r of document.querySelectorAll(t.selector))this._addEventToElement(t,r);else{var e=document.querySelector(t.selector);this._addEventToElement(t,e)}this._events=[]}_removeEventToElement(e,t){t&&("function"==typeof e.callback?t.removeEventListener(e.eventType,e.callback):t.removeEventListener(e.eventType,this._outerEventHandler))}_assignToDom(e,t){e.innerHTML="";for(const n of Array.isArray(t)?t:[t])e.append(n);const r=setTimeout(()=>{this._addEvents(e),clearTimeout(r)},10)}}const G='',H='';function V(e){const t=new DOMParser;return t.parseFromString(e,"image/svg+xml").documentElement}class W extends HTMLElement{base;component=null;_contents=[];_orderBy=[];properties=new Set;_columnOrder=[];_filter="";_selectionProperty="";_selectedIds=new Set;uniqueEntriesByProperties={};propertyLabelDictionary={};_templates={};_templateClasses={};static get observedAttributes(){return["contents","columns","order","filter","selection-property","templates"]}get columnOrder(){return this._columnOrder.length?this._columnOrder:this.properties}set columnOrder(e){let t;"string"==typeof e&&(t=e.split(",")),t=e,this._columnOrder=t}get contents(){return this._contents}set contents(e){this.analyzeData(e),this._contents=new D(e)}get orderBy(){return this._orderBy}set orderBy(e){if(Array.isArray(e))this._orderBy=e;else{const n=[];for(const s of e.split(",")){var t=s.split("|"),r=t[0],t=1e[r._selectionProperty])):new Set;e=t?r.contents.execute():[];r._emit("select",r,{selection:e}),r._updateCheckboxes(r)}emitSelect(e){var t=e.target.checked,r=e.target.dataset.objectId;const n=F(e).target,s=(t?n._selectedIds.add(r):n._selectedIds.delete(r),n._selectionProperty);e=n.contents.execute().filter(e=>n._selectedIds.has(e[s]));n._emit("select",n,{selection:e}),n._updateCheckboxes(n)}sortData(e){const t=F(e).target,r=z(e,"column");r&&(-1<(e=t._orderBy.findIndex(e=>e.propertyName===r))?"asc"===t._orderBy[e].direction?t._orderBy[e].direction="desc":t._orderBy.splice(e,1):t._orderBy.push({propertyName:r,direction:"asc"}),t.createHtml(),t.base.render(t))}setColumnOrder(e){this._columnOrder=e?Array.isArray(e)?e:e.split(","):[]}analyzeData(t){this.properties=new Set;var r=t.length;for(let e=0;e"_"===e?" ":" "+e.toLowerCase()).trim();var r=t.charAt(0).toUpperCase()+t.slice(1);return this.propertyLabelDictionary[e]=r}parseTemplate(e,n){return e.replace(/\{\{([\s\S]+?)\}\}/gim,(e,t)=>{let r="";t=t.trim();t=n[t];return t&&(r=t),Array.isArray(r)?r.join(", "):r.toString().trim()})}createSelectionCheckbox(e){const t=document.createElement("input");return t.setAttribute("type","checkbox"),t.classList.add("flk-selection-checkbox"),e&&(t.dataset.selected=e[this._selectionProperty]),t}createRow(e){const t=document.createElement("tr");if(this._selectionProperty.length){const s=document.createElement("td");var r=this.base.generateId();const i=this.createSelectionCheckbox(e);i.id=r,i.dataset.objectId=e[this._selectionProperty];var n=e[this._selectionProperty];this._selectedIds.has(n)?i.checked=!0:i.checked=!1,this.base.addEvent("#"+r,"change",this.emitSelect),s.append(i),t.append(s)}for(const o of this.columnOrder){const a=document.createElement("td");this._templates[o]?(a.innerHTML=this.parseTemplate(this._templates[o],e),this._templateClasses[o]&&a.classList.add(...this._templateClasses[o])):a.innerText=e[o],t.append(a)}return t}createBody(e){const t=document.createElement("tbody");for(const n of e){var r=this.createRow(n,null);t.append(r)}return t}createHead(){const e=document.createElement("thead"),t=document.createElement("tr");if(t.classList.add("cursor-pointer"),this._selectionProperty.length){const s=document.createElement("th");var r=this.base.generateId();const i=this.createSelectionCheckbox();i.id=r;var u=this.contents.execute().length;0e.propertyName===o);if(n){const c=document.createElement("span");c.innerHTML="asc"===n.direction?'':'',a.append(c)}t.append(a)}return e.append(t),e}addEvent(e,t,r){this.base.addEvent(e,t,r)}init(){this.createHtml(),this.base.render(this)}}class J extends HTMLElement{base;componentId;constructor(){super(),this.base=new $}connectedCallback(){var e=this.getAttribute("top"),t=this.getAttribute("left"),r=this.getAttribute("center"),n=this.getAttribute("zIndex");this.id||(this.id=this.base.generateId()),this.style.display="block",this.style.position="fixed","string"==typeof r?(this.style.top=e||"50%",this.style.left="50%",this.style.transform="translate(-50%, -50%)"):(this.style.top=e||this.clientTop+"px",this.style.left=t||this.clientLeft+"px"),n&&(this.style.zIndex=n),this.componentId=this.getAttribute("handle");const s=document.createElement("div");s.innerHTML=this.innerHTML,this.component=s;r="#"+(this.componentId||this.id);this.base.addEvent(r,"mousedown",this._dragElement),this.base.addEvent(r,"mouseup",this._reset),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this)}_dragElement(e){const r=F(e,"flk-draggable").target;let n,s;function t(e){n=e.clientX-r.offsetLeft,s=e.clientY-r.offsetTop}function i(e){var t=e.clientX-n,e=e.clientY-s;r.style.left=t+"px",r.style.top=e+"px"}function o(e){e.preventDefault()}function a(){r.removeAttribute("draggable"),r.removeEventListener("dragstart",t),r.removeEventListener("dragend",a),document.removeEventListener("dragover",o),document.removeEventListener("drop",i)}r.setAttribute("draggable",!0),r.addEventListener("dragstart",t),r.addEventListener("dragend",a),document.addEventListener("dragover",o),document.addEventListener("drop",i)}}class q extends HTMLElement{_id;base;_draggableId;constructor(){super(),this.base=new $}_emit(e,t,r){e=new CustomEvent(e,{detail:r,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}_closeModal(e){e.stopPropagation();const t=F(e,"flk-modal").target;t.classList.add("hidden")}closeModal(e){this.classList.add("hidden")}openModal(e=!0){const t=document.getElementById(this._draggableId);e&&(t.style.top="40%",t.style.left="50%"),this.classList.remove("hidden")}connectedCallback(){this.id||(this.id=this.base.generateId());const e=document.createElement("div");var t=this.base.generateId();const r=document.createElement("flk-draggable"),n=(this._draggableId=this.base.generateId(),r.id=this._draggableId,r.setAttribute("center",""),r.setAttribute("top","40%"),r.setAttribute("handle",t),r.setAttribute("zIndex","1080"),r.classList.add("border","shadow-lg","bg-white"),r.style.width="max-content",document.createElement("div"));var s=this.getAttribute("modal-title");if(s){const c=document.createElement("span");c.innerText=s,c.classList.add("ml-1","mr-auto"),n.append(c)}n.id=t;const i=this.getAttribute("header-class");let o=[];i?o=o.concat(i.split(" ")):o.push("bg-gray-light"),n.classList.add(...o,"border-bottom","row","justify-end","cursor-no-select");s=this.base.generateId();const a=document.createElement("button"),l=(a.classList.add("py-0","px-1","outline-hover","no-border","cursor-default",...o),a.innerText="X",a.id=s,n.append(a),r.append(n),document.createElement("div"));l.innerHTML=this.innerHTML,r.append(l),e.append(r),this.component=e,this.base.addEvent("#"+s,"click",this._closeModal),this.base.render(this),this.classList.add("hidden")}disconnectedCallback(){this.base.removeEvents(this)}}class K extends HTMLElement{base;_buttonId;_drawerId;_iconId;constructor(){super(),this.base=new $}connectedCallback(){this.style.position="relative",this.style.display="flex",this.style.width="fit-content",this._buttonId=this.base.generateId();const e=document.createElement("button"),t=(e.classList.add("row"),e.id=this._buttonId,document.createElement("span")),r=(t.innerText=this.getAttribute("text"),this._iconId=this.base.generateId(),document.createElement("span"));var n=V('');const s=V(''),i=(s.classList.add("hidden"),r.append(n,s),r.id=this._iconId,e.append(t,r),this._drawerId=this.base.generateId(),document.createElement("div"));i.id=this._drawerId,i.classList.add("shadow","inline-block","bg-white"),i.style.position="absolute",i.style.zIndex="1040";n=this.querySelector("template");n.innerHTML.length?i.innerHTML=n.innerHTML:i.append(n.firstChild),i.style.display="none",this.component=[e,i],this.base.addEvent("#"+this._buttonId,"click",this.toggleMenu);const o=document.querySelector("body");""!==o.getAttribute("flk-close-dropdown")&&(o.setAttribute("flk-close-dropdown",""),o.addEventListener("click",this.closeAllDropdownButtons)),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this);var e=document.querySelectorAll("flk-dropdown");if(!e||!e.length){const t=document.querySelector("body");t.removeAttribute("flk-close-dropdown"),t.removeEventListener("click",this.closeAllDropdownButtons)}}toggleMenu(e){const t=F(e).target;e=t._drawerId;const r=document.getElementById(e);var e="none"!==r.style.display,n=(r.style.display=e?"none":"block",t.getAttribute("drawer-width")),n=("string"==typeof t.getAttribute("right")&&(r.style.right="0px"),r.style.top=t.offsetHeight+"px",r.style.width=n||t.offsetWidth+"px",t._iconId);const s=document.getElementById(n);e?(s.childNodes[0].classList.remove("hidden"),s.childNodes[1].classList.add("hidden")):(s.childNodes[0].classList.add("hidden"),s.childNodes[1].classList.remove("hidden"))}_closeDropdown(){var e=this._drawerId;const t=document.getElementById(e);if("none"!==t.style.display){e=this._iconId;const r=document.getElementById(e);t.style.display="none",r.childNodes[0].classList.remove("hidden"),r.childNodes[1].classList.add("hidden")}}closeAllDropdownButtons(e){var t,r=F(e,"flk-dropdown").target,e=document.querySelectorAll("flk-dropdown");if(r)for(const n of e)r._buttonId!==n._buttonId&&(t=n._drawerId,"none"!==document.getElementById(t).style.display&&n._closeDropdown());else for(const s of e)s._closeDropdown()}}var t={exports:{}};let Z=e.default,Y=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||"win32"===process.platform||Z.isatty(1)&&"dumb"!==process.env.TERM||"CI"in process.env),r=(r,n,s=r)=>e=>{let t=""+e;e=t.indexOf(n,r.length);return~e?r+X(t,n,s,e)+n:r+t+n},X=(e,t,r,n)=>{var s=e.substring(0,n)+r;let i=e.substring(n+t.length);e=i.indexOf(t);return~e?s+X(i,t,r,e):s+i};e=(e=Y)=>({isColorSupported:e,reset:e?e=>`${e}`:String,bold:e?r("","",""):String,dim:e?r("","",""):String,italic:e?r("",""):String,underline:e?r("",""):String,inverse:e?r("",""):String,hidden:e?r("",""):String,strikethrough:e?r("",""):String,black:e?r("",""):String,red:e?r("",""):String,green:e?r("",""):String,yellow:e?r("",""):String,blue:e?r("",""):String,magenta:e?r("",""):String,cyan:e?r("",""):String,white:e?r("",""):String,gray:e?r("",""):String,bgBlack:e?r("",""):String,bgRed:e?r("",""):String,bgGreen:e?r("",""):String,bgYellow:e?r("",""):String,bgBlue:e?r("",""):String,bgMagenta:e?r("",""):String,bgCyan:e?r("",""):String,bgWhite:e?r("",""):String});t.exports=e(),t.exports.createColors=e;const Q="'".charCodeAt(0),ee='"'.charCodeAt(0),te="\\".charCodeAt(0),re="/".charCodeAt(0),ne="\n".charCodeAt(0),se=" ".charCodeAt(0),ie="\f".charCodeAt(0),oe="\t".charCodeAt(0),ae="\r".charCodeAt(0),le="[".charCodeAt(0),ce="]".charCodeAt(0),ue="(".charCodeAt(0),he=")".charCodeAt(0),pe="{".charCodeAt(0),de="}".charCodeAt(0),fe=";".charCodeAt(0),me="*".charCodeAt(0),ge=":".charCodeAt(0),ye="@".charCodeAt(0),ve=/[\t\n\f\r "#'()/;[\\\]{}]/g,we=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,be=/.[\r\n"'(/\\]/,_e=/[\da-f]/i;function Ce(t,e={}){let n=t.css.valueOf(),d=e.ignoreErrors,s,i,f,m,o,a,l,g,c,u,y=n.length,h=0,v=[],p=[];function w(e){throw t.error("Unclosed "+e,h)}return{back:function(e){p.push(e)},endOfFile:function(){return 0===p.length&&h>=y},nextToken:function(e){if(p.length)return p.pop();if(!(h>=y)){var t=!!e&&e.ignoreUnclosed;switch(s=n.charCodeAt(h),s){case ne:case se:case oe:case ae:case ie:for(i=h;i+=1,s=n.charCodeAt(i),s===se||s===ne||s===oe||s===ae||s===ie;);u=["space",n.slice(h,i)],h=i-1;break;case le:case ce:case pe:case de:case ge:case fe:case he:var r=String.fromCharCode(s);u=[r,r,h];break;case ue:if(g=v.length?v.pop()[1]:"",c=n.charCodeAt(h+1),"url"===g&&c!==Q&&c!==ee&&c!==se&&c!==ne&&c!==oe&&c!==ie&&c!==ae){i=h;do{if(a=!1,i=n.indexOf(")",i+1),-1===i){if(d||t){i=h;break}w("bracket")}for(l=i;n.charCodeAt(l-1)===te;)--l,a=!a}while(a);u=["brackets",n.slice(h,i+1),h,i],h=i}else i=n.indexOf(")",h+1),m=n.slice(h,i+1),-1===i||be.test(m)?u=["(","(",h]:(u=["brackets",m,h,i],h=i);break;case Q:case ee:f=s===Q?"'":'"',i=h;do{if(a=!1,i=n.indexOf(f,i+1),-1===i){if(d||t){i=h+1;break}w("string")}for(l=i;n.charCodeAt(l-1)===te;)--l,a=!a}while(a);u=["string",n.slice(h,i+1),h,i],h=i;break;case ye:ve.lastIndex=h+1,ve.test(n),i=0===ve.lastIndex?n.length-1:ve.lastIndex-2,u=["at-word",n.slice(h,i+1),h,i],h=i;break;case te:for(i=h,o=!0;n.charCodeAt(i+1)===te;)i+=1,o=!o;if(s=n.charCodeAt(i+1),o&&s!==re&&s!==se&&s!==ne&&s!==oe&&s!==ae&&s!==ie&&(i+=1,_e.test(n.charAt(i)))){for(;_e.test(n.charAt(i+1));)i+=1;n.charCodeAt(i+1)===se&&(i+=1)}u=["word",n.slice(h,i+1),h,i],h=i;break;default:h=(s===re&&n.charCodeAt(h+1)===me?(i=n.indexOf("*/",h+2)+1,0===i&&(d||t?i=n.length:w("comment")),u=["comment",n.slice(h,i+1),h,i]):(we.lastIndex=h+1,we.test(n),i=0===we.lastIndex?n.length-1:we.lastIndex-2,u=["word",n.slice(h,i+1),h,i],v.push(u)),i)}return h++,u}},position:function(){return h}}}e=t.exports;let Se=Ce,xe;const Ae={";":e.yellow,":":e.yellow,"(":e.cyan,")":e.cyan,"[":e.yellow,"]":e.yellow,"{":e.yellow,"}":e.yellow,"at-word":e.cyan,brackets:e.cyan,call:e.cyan,class:e.yellow,comment:e.gray,hash:e.magenta,string:e.green};function ke(e){let r=Se(new xe(e),{ignoreErrors:!0}),n="";for(;!r.endOfFile();){let e=r.nextToken(),t=Ae[function([e,t],r){if("word"===e){if("."===t[0])return"class";if("#"===t[0])return"hash"}if(!r.endOfFile()){t=r.nextToken();if(r.back(t),"brackets"===t[0]||"("===t[0])return"call"}return e}(e,r)];t?n+=e[1].split(/\r?\n/).map(e=>t(e)).join("\n"):n+=e[1]}return n}ke.registerInput=function(e){xe=e};e=ke;let Ee=t.exports,Le=e;class Oe extends Error{constructor(e,t,r,n,s,i){super(e),this.name="CssSyntaxError",this.reason=e,s&&(this.file=s),n&&(this.source=n),i&&(this.plugin=i),void 0!==t&&void 0!==r&&("number"==typeof t?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,Oe)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file||"",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source,r=(null==e&&(e=Ee.isColorSupported),Le&&e&&(t=Le(t)),t.split(/\r?\n/)),n=Math.max(this.line-3,0);var s=Math.min(this.line+2,r.length);let i=String(s).length,o,a;if(e){let{bold:t,gray:r,red:n}=Ee.createColors(!0);o=e=>t(n(e)),a=e=>r(e)}else o=a=e=>e;return r.slice(n,s).map((e,t)=>{var t=n+1+t;let r=" "+(" "+t).slice(-i)+" | ";return t===this.line?(t=a(r.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," "),o(">")+a(r)+e+"\n "+t+o("^")):" "+a(r)+e}).join("\n")}toString(){let e=this.showSourceCode();return e=e&&"\n\n"+e+"\n",this.name+": "+this.message+e}}var t=Oe,Me=(Oe.default=Oe,{});Me.isClean=Symbol("isClean"),Me.my=Symbol("my");const Pe={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class Re{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name;var n=e.params?this.rawValue(e,"params"):"";void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes?this.block(e,r+n):(t=(e.raws.between||"")+(t?";":""),this.builder(r+n+t,e))}beforeAfter(e,t){let r,n=(r="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose"),e.parent),s=0;for(;n&&"root"!==n.type;)s+=1,n=n.parent;if(r.includes("\n")){var i=this.raw(e,null,"indent");if(i.length)for(let e=0;e{if(n=e.raws[t],void 0!==n)return!1}),void 0===n&&(n=Pe[r]),i.rawCache[r]=n,n}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&0{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=void 0===r?this.raw(t,null,"beforeDecl"):r&&r.replace(/\S/g,""),r}rawBeforeDecl(e,t){let r;return e.walkDecls(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=void 0===r?this.raw(t,null,"beforeRule"):r&&r.replace(/\S/g,""),r}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(t){let r;return t.walk(e=>{if(e.nodes&&(e.parent!==t||t.first!==e)&&void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=r&&r.replace(/\S/g,""),r}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(r){if(r.raws.indent)return r.raws.indent;let n;return r.walk(e=>{var t=e.parent;if(t&&t!==r&&t.parent&&t.parent===r&&void 0!==e.raws.before)return t=e.raws.before.split("\n"),n=t[t.length-1],n=n.replace(/\S/g,""),!1}),n}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){var r=e[t],e=e.raws[t];return e&&e.value===r?e.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}}var Te=Re;Re.default=Re;let Ie=Te;function Be(e,t){let r=new Ie(t);r.stringify(e)}var Ne=Be;Be.default=Be;let{isClean:je,my:De}=Me,Ue=t,Fe=Te,ze=Ne;function $e(t,r){let n=new t.constructor;for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&"proxyCache"!==s){let e=t[s];var i=typeof e;"parent"===s&&"object"==i?r&&(n[s]=r):"source"===s?n[s]=e:Array.isArray(e)?n[s]=e.map(e=>$e(e,n)):("object"==i&&null!==e&&(e=$e(e)),n[s]=e)}return n}class Ge{constructor(e={}){for(var t in this.raws={},this[je]=!1,this[De]=!0,e)if("nodes"===t){this.nodes=[];for(var r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){var t;return e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)&&(t=this.source,e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)),e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(var t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=$e(this);for(var r in e)t[r]=e[r];return t}cloneAfter(e={}){e=this.clone(e);return this.parent.insertAfter(this,e),e}cloneBefore(e={}){e=this.clone(e);return this.parent.insertBefore(this,e),e}error(e,t={}){var r,n;return this.source?({end:r,start:n}=this.rangeBy(t),this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)):new Ue(e)}getProxyProcessor(){return{get(e,t){return"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t]},set(e,t,r){return e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0}}}markDirty(){if(this[je]){this[je]=!1;let e=this;for(;e=e.parent;)e[je]=!1}}next(){var e;if(this.parent)return e=this.parent.index(this),this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;return e.index?r=this.positionInside(e.index,t):!e.word||-1!==(e=(t=this.toString()).indexOf(e.word))&&(r=this.positionInside(e,t)),r}positionInside(t,e){var r=e||this.toString();let n=this.source.start.column,s=this.source.start.line;for(let e=0;e"object"==typeof e&&e.toJSON?e.toJSON(null,r):e);else if("object"==typeof t&&t.toJSON)n[s]=t.toJSON(null,r);else if("source"===s){let e=r.get(t.input);null==e&&(e=i,r.set(t.input,i),i++),n[s]={end:t.end,inputId:e,start:t.start}}else n[s]=t}return t&&(n.inputs=[...r.keys()].map(e=>e.toJSON())),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=ze){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(var s in r)n[s]=r[s];return e.warn(t,n)}get proxyOf(){return this}}var Te=Ge,He=(Ge.default=Ge,Te);class Ve extends He{constructor(e){super(e=e&&void 0!==e.value&&"string"!=typeof e.value?{...e,value:String(e.value)}:e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}}var He=Ve,We=(Ve.default=Ve,{}),Je={},qe={},Ke={},Ze="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),Ye=(Ke.encode=function(e){if(0<=e&&e>>=5)&&(t|=32),r+=Ye.encode(t),0>1,1==(1&a)?-i:i),r.rest=t};var Ke={},l=Ke,Xe=(l.getArg=function(e,t,r){if(t in e)return e[t];if(3===arguments.length)return r;throw new Error('"'+t+'" is a required argument.')},/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/),Qe=/^data:.+\,.+$/;function et(e){e=e.match(Xe);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}function tt(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}l.urlParse=et,l.urlGenerate=tt,rt=function(e){var t=e,r=et(e);if(r){if(!r.path)return e;t=r.path}for(var n,e=l.isAbsolute(t),s=[],i=0;;){if(n=i,-1===(i=t.indexOf("/",n))){s.push(t.slice(n));break}for(s.push(t.slice(n,i));in;e--){var o=r[e-1],a=r[e];if(Pt(o,a)<=0)break;r[e-1]=a,r[e]=o}else Ot(r,Pt,n)}function Tt(e,s){var t=e,e=("string"==typeof e&&(t=w.parseSourceMapInput(e)),w.getArg(t,"version")),t=w.getArg(t,"sections");if(e!=this._version)throw new Error("Unsupported version: "+e);this._sources=new Et,this._names=new Et;var i={line:-1,column:0};this._sections=t.map(function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var t=w.getArg(e,"offset"),r=w.getArg(t,"line"),n=w.getArg(t,"column");if(r=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))},p.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;var r=this._findSourceIndex(e);if(0<=r)return this.sourcesContent[r];var n,r=e;if(null!=this.sourceRoot&&(r=w.relative(this.sourceRoot,r)),null!=this.sourceRoot&&(n=w.urlParse(this.sourceRoot))){e=r.replace(/^file:\/\//,"");if("file"==n.scheme&&this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];if((!n.path||"/"==n.path)&&this._sources.has("/"+r))return this.sourcesContent[this._sources.indexOf("/"+r)]}if(t)return null;throw new Error('"'+r+'" is not in the SourceMap.')},p.prototype.generatedPositionFor=function(e){var t=w.getArg(e,"source");if((t=this._findSourceIndex(t))<0)return{line:null,column:null,lastColumn:null};t={source:t,originalLine:w.getArg(e,"line"),originalColumn:w.getArg(e,"column")},e=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",w.compareByOriginalPositions,w.getArg(e,"bias",f.GREATEST_LOWER_BOUND));if(0<=e){e=this._originalMappings[e];if(e.source===t.source)return{line:w.getArg(e,"generatedLine",null),column:w.getArg(e,"generatedColumn",null),lastColumn:w.getArg(e,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},ft.BasicSourceMapConsumer=p,(Tt.prototype=Object.create(f.prototype)).constructor=f,Tt.prototype._version=3,Object.defineProperty(Tt.prototype,"sources",{get:function(){for(var e=[],t=0;t{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(n,s=21)=>(e=s)=>{let t="",r=e;for(;r--;)t+=n[Math.random()*n.length|0];return t}};let{SourceMapConsumer:Ut,SourceMapGenerator:Ft}=We,{existsSync:zt,readFileSync:$t}=i.default,{dirname:Gt,join:Ht}=n.default;class Vt{constructor(e,t){!1!==t.map&&(this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:"),e=t.map?t.map.prev:void 0,e=this.loadMap(t.from,e),!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Gt(this.mapFile)),e&&(this.text=e))}consumer(){return this.consumerCache||(this.consumerCache=new Ut(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+t)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);var r,n;t&&(r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r),-1"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,i,o;t&&"object"==typeof t?(a=r,r="number"==typeof(l=t).offset?(t=(c=this.fromOffset(l.offset)).line,c.col):(t=l.line,l.column),o="number"==typeof a.offset?(c=this.fromOffset(a.offset),i=c.line,c.col):(i=a.line,a.column)):r||(t=(l=this.fromOffset(t)).line,r=l.col);var a,l,c=this.origin(t,r,i,o);return s=c?new Xt(e,void 0===c.endLine?c.line:{column:c.column,line:c.line},void 0===c.endLine?c.column:{column:c.endColumn,line:c.endLine},c.source,c.file,n.plugin):new Xt(e,void 0===i?t:{column:r,line:t},void 0===i?r:{column:o,line:i},this.css,this.file,n.plugin),s.input={column:r,endColumn:o,endLine:i,line:t,source:this.css},this.file&&(Jt&&(s.input.url=Jt(this.file).toString()),s.input.file=this.file),s}fromOffset(t){let n;if(this[er])n=this[er];else{var s=this.css.split("\n");n=new Array(s.length);let r=0;for(let e=0,t=s.length;e>1),t=n[i+1])){r=i;break}r=i+1}}return{col:t-n[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Kt(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let s=this.map.consumer();t=s.originalPositionFor({column:t,line:e});if(!t.source)return!1;let i;"number"==typeof r&&(i=s.originalPositionFor({column:n,line:r}));let o,a=(o=qt(t.source)?Jt(t.source):new URL(t.source,this.map.consumer().sourceRoot||Jt(this.map.mapFile)),{column:t.column,endColumn:i&&i.column,endLine:i&&i.line,line:t.line,url:o.toString()});if("file:"===o.protocol){if(!Wt)throw new Error("file: protocol is not available in this PostCSS build");a.file=Wt(o)}e=s.sourceContentFor(t.source);return e&&(a.source=e),a}toJSON(){let e={};for(var t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}}Je=nr;nr.default=nr,Yt&&Yt.registerInput&&Yt.registerInput(nr);let{SourceMapConsumer:sr,SourceMapGenerator:ir}=We,{dirname:or,relative:ar,resolve:lr,sep:cr}=n.default,ur=s.default["pathToFileURL"],hr=Je,pr=Boolean(sr&&ir),dr=Boolean(or&&lr&&ar&&cr);ft=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e,t=(e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map","\n");this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(var t of this.previous()){var r=this.toUrl(this.path(t.file)),n=t.root||or(t.file);let e;!1===this.mapOpts.sourcesContent?(e=new sr(t.text),e.sourcesContent&&(e.sourcesContent=null)):e=t.consumer(),this.map.applySourceMap(e,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let t;for(let e=this.root.nodes.length-1;0<=e;e--)t=this.root.nodes[e],"comment"===t.type&&0===t.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(e)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),dr&&pr&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,e=>{t+=e}),[t]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=ir.fromSourceMap(e)}else this.map=new ir({file:this.outputFile()}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):""});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&0",o={generated:{column:0,line:0},original:{column:0,line:0},source:""},a,l;this.stringify(this.root,(e,t,r)=>{this.css+=e,t&&"end"!==r&&(o.generated.line=n,o.generated.column=s-1,t.source&&t.source.start?(o.source=this.sourcePath(t),o.original.line=t.source.start.line,o.original.column=t.source.start.column-1):(o.source=i,o.original.line=1,o.original.column=0),this.map.addMapping(o)),a=e.match(/\n/g),a?(n+=a.length,l=e.lastIndexOf("\n"),s=e.length-l):s+=e.length,t&&"start"!==r&&(e=t.parent||{raws:{}},("decl"===t.type||"atrule"===t.type&&!t.nodes)&&t===e.last&&!e.raws.semicolon||(t.source&&t.source.end?(o.source=this.sourcePath(t),o.original.line=t.source.end.line,o.original.column=t.source.end.column-1,o.generated.line=n,o.generated.column=s-2):(o.source=i,o.original.line=1,o.original.column=0,o.generated.line=n,o.generated.column=s-1),this.map.addMapping(o)))})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;var e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:0e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;var t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?or(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=or(lr(r,this.mapOpts.annotation)));t=ar(r,e);return this.memoizedPaths.set(e,t),t}previous(){var e;return this.previousMaps||(this.previousMaps=[],this.root?this.root.walk(e=>{e.source&&e.source.input.map&&(e=e.source.input.map,this.previousMaps.includes(e)||this.previousMaps.push(e))}):(e=new hr(this.originalCSS,this.opts)).map&&this.previousMaps.push(e.map)),this.previousMaps}setSourcesContent(){let r={};var e;this.root?this.root.walk(e=>{var t;!e.source||(t=e.source.input.from)&&!r[t]&&(r[t]=!0,t=this.usesFileUrls?this.toFileUrl(t):this.toUrl(this.path(t)),this.map.setSourceContent(t,e.source.input.css))}):this.css&&(e=this.opts.from?this.toUrl(this.path(this.opts.from)):"",this.map.setSourceContent(e,this.css))}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){var t=this.memoizedFileURLs.get(e);if(t)return t;if(ur)return t=ur(e).toString(),this.memoizedFileURLs.set(e,t),t;throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){var t=this.memoizedURLs.get(e);if(t)return t;"\\"===cr&&(e=e.replace(/\\/g,"/"));t=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,t),t}};class fr extends Te{constructor(e){super(e),this.type="comment"}}Ct=fr;fr.default=fr;let{isClean:mr,my:gr}=Me,yr=He,vr=Ct,wr,br,_r,Cr;class Sr extends Te{append(...e){for(var t of e){var r;for(r of this.normalize(t,this.last))this.proxyOf.nodes.push(r)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(var t of this.nodes)t.cleanRaws(e)}each(r){if(this.proxyOf.nodes){var n=this.getIterator();let e,t;for(;this.indexes[n]t[n](...e.map(r=>"function"==typeof r?(e,t)=>r(e.toProxy(),t):r)):"every"===n||"some"===n?r=>t[n]((e,...t)=>r(e.toProxy(),...t)):"root"===n?()=>t.root().toProxy():"nodes"===n?t.nodes.map(e=>e.toProxy()):"first"===n||"last"===n?t[n].toProxy():t[n])},set(e,t,r){return e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0}}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){var r,n,s,i=this.index(e),o=this.normalize(t,this.proxyOf.nodes[i]).reverse(),i=this.index(e);for(r of o)this.proxyOf.nodes.splice(i+1,0,r);for(s in this.indexes)i<(n=this.indexes[s])&&(this.indexes[s]=n+o.length);return this.markDirty(),this}insertBefore(e,t){var r,n,s,i=this.index(e),o=this.normalize(t,this.proxyOf.nodes[i],0===i&&"prepend").reverse(),i=this.index(e);for(r of o)this.proxyOf.nodes.splice(i,0,r);for(s in this.indexes)i<=(n=this.indexes[s])&&(this.indexes[s]=n+o.length);return this.markDirty(),this}normalize(e,t){if("string"==typeof e)e=function t(e){return e.map(e=>(e.nodes&&(e.nodes=t(e.nodes)),delete e.source,e))}(wr(e).nodes);else if(void 0===e)e=[];else if(Array.isArray(e))for(var r of e=e.slice(0))r.parent&&r.parent.removeChild(r,"ignore");else if("root"===e.type&&"document"!==this.type)for(var n of e=e.nodes.slice(0))n.parent&&n.parent.removeChild(n,"ignore");else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new yr(e)]}else if(e.selector)e=[new br(e)];else if(e.name)e=[new _r(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new vr(e)]}return e.map(e=>(e[gr]||Sr.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[mr]&&function e(t){if(t[mr]=!1,t.proxyOf.nodes)for(var r of t.proxyOf.nodes)e(r)}(e),void 0===e.raws.before&&t&&void 0!==t.raws.before&&(e.raws.before=t.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}prepend(...e){for(var t of e=e.reverse()){var r,n,s=this.normalize(t,this.first,"prepend").reverse();for(r of s)this.proxyOf.nodes.unshift(r);for(n in this.indexes)this.indexes[n]=this.indexes[n]+s.length}return this.markDirty(),this}push(e){return(e.parent=this).proxyOf.nodes.push(e),this}removeAll(){for(var e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){var t,r;for(r in e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1),this.indexes)e<=(t=this.indexes[r])&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(t,r,n){return n||(n=r,r={}),this.walkDecls(e=>{r.props&&!r.props.includes(e.prop)||r.fast&&!e.value.includes(r.fast)||(e.value=e.value.replace(t,n))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(n){return this.each((t,e)=>{let r;try{r=n(t,e)}catch(e){throw t.addToError(e)}return!1!==r&&t.walk&&(r=t.walk(n)),r})}walkAtRules(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("atrule"===e.type&&r.test(e.name))return n(e,t)}):this.walk((e,t)=>{if("atrule"===e.type&&e.name===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("atrule"===e.type)return n(e,t)}))}walkComments(r){return this.walk((e,t)=>{if("comment"===e.type)return r(e,t)})}walkDecls(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("decl"===e.type&&r.test(e.prop))return n(e,t)}):this.walk((e,t)=>{if("decl"===e.type&&e.prop===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("decl"===e.type)return n(e,t)}))}walkRules(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("rule"===e.type&&r.test(e.selector))return n(e,t)}):this.walk((e,t)=>{if("rule"===e.type&&e.selector===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("rule"===e.type)return n(e,t)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}Sr.registerParse=e=>{wr=e},Sr.registerRule=e=>{br=e},Sr.registerAtRule=e=>{_r=e},Sr.registerRoot=e=>{Cr=e};i=Sr,Sr.default=Sr,Sr.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,_r.prototype):"rule"===e.type?Object.setPrototypeOf(e,br.prototype):"decl"===e.type?Object.setPrototypeOf(e,yr.prototype):"comment"===e.type?Object.setPrototypeOf(e,vr.prototype):"root"===e.type&&Object.setPrototypeOf(e,Cr.prototype),e[gr]=!0,e.nodes&&e.nodes.forEach(e=>{Sr.rebuild(e)})},ot=i;let xr,Ar;class kr extends ot{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){let t=new xr(new Ar,this,e);return t.stringify()}}kr.registerLazyResult=e=>{xr=e},kr.registerProcessor=e=>{Ar=e};e=kr;kr.default=kr;let Er={};function Lr(e){Er[e]||(Er[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))}class Or{constructor(e,t={}){for(var r in this.type="warning",this.text=e,t.node&&t.node.source&&(e=t.node.rangeBy(t),this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column),t)this[r]=t[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}St=Or;Or.default=Or;let Mr=St;class Pr{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);e=new Mr(e,t);return this.messages.push(e),e}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}}Ke=Pr;Pr.default=Pr;let Rr=i;class Tr extends Rr{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}We=Tr;Tr.default=Tr,Rr.registerAtRule(Tr);let Ir=i,Br,Nr;class jr extends Ir{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){e=super.normalize(e);if(t)if("prepend"===r)1{Br=e},jr.registerProcessor=e=>{Nr=e};n=jr;jr.default=jr,Ir.registerRoot(jr);let Dr={comma(e){return Dr.split(e,[","],!0)},space(e){return Dr.split(e,[" ","\n","\t"])},split(e,t,u){let r=[],n="",s=!1,i=0,o=!1,a="",l=!1;for(var c of e)l?l=!1:"\\"===c?l=!0:o?c===a&&(o=!1):'"'===c||"'"===c?(o=!0,a=c):"("===c?i+=1:")"===c?0"space"!==e[0]&&"comment"!==e[0])&&(s.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(s,"value",a.concat(e),t),s.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new Jr;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){var t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1;var r;let n=!1,s=null,i=[];var o=e[1].startsWith("--");let a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)s=s||l,i.push("("===r?")":"]");else if(o&&n&&"{"===r)s=s||l,i.push("}");else if(0===i.length){if(";"===r){if(n)return void this.decl(a,o);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===i[i.length-1]&&(i.pop(),0===i.length&&(s=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),0e+t[1],""),e.raws[t]={raw:o,value:l}),e[t]=l}rule(e){e.pop();let t=new Jr;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){var t;let r="";for(;e.length&&("space"===(t=e[e.length-1][0])||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){var t;let r="";for(;e.length&&("space"===(t=e[0][0])||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t="";for(;e.length&&"space"===e[e.length-1][0];)t=e.pop()[1]+t;return t}stringFrom(t,r){let n="";for(let e=r;evn(e)),e}let wn={};class bn{constructor(e,t,r){this.stringified=!1,this.processed=!1;let n;if("object"!=typeof t||null===t||"root"!==t.type&&"document"!==t.type)if(t instanceof bn||t instanceof ln)n=vn(t.root),t.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=t.map);else{let e=cn;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{n=e(t,r)}catch(e){this.processed=!0,this.error=e}n&&!n[tn]&&sn.rebuild(n)}else n=vn(t);this.result=new ln(e,n,r),this.helpers={...wn,postcss:wn,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){var r=this.result.lastPlugin;try{if(t&&t.addToError(e),"CssSyntaxError"!==(this.error=e).name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){var n=r.postcssPlugin;let e=r.postcssVersion,t=this.result.processor.version;var s=e.split("."),i=t.split(".");(s[0]!==i[0]||parseInt(s[1])>parseInt(i[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+t+", but "+n+" uses "+e+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};var e,t=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(e of this.plugins)if("object"==typeof e)for(var r in e){if(!pn[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${e.postcssPlugin}. `+`Try to update PostCSS (${this.processor.version} now).`);if(!dn[r])if("object"==typeof e[r])for(var n in e[r])"*"===n?t(e,r,e[r][n]):t(e,r+"-"+n.toLowerCase(),e[r][n]);else"function"==typeof e[r]&&t(e,r,e[r])}this.hasListener=0t(e,this.helpers)),await Promise.all(i)):await t(r,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{var e;if("object"==typeof t&&t.Once)return"document"===this.result.root.type?mn((e=this.result.root.nodes.map(e=>t.Once(e,this.helpers)))[0])?Promise.all(e):e:t.Once(this.result.root,this.helpers);if("function"==typeof t)return t(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();var e=this.result.opts;let t=nn,r=(e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify),new rn(t,this.result.root,this.result.opts));e=r.generate();return this.result.css=e[0],this.result.map=e[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(var e of this.plugins)if(mn(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[en];)e[en]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(var t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||an("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(var[r,n]of e){this.result.lastPlugin=r;let e;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(mn(e))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:s}=r;if("root"===n.type||"document"===n.type||n.parent){if(0{e[en]||this.walkSync(e)});else{var r=this.listeners[t];if(r&&this.visitSync(r,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}bn.registerPostcss=e=>{wn=e};Me=bn;bn.default=bn,un.registerLazyResult(bn),on.registerLazyResult(bn);let _n=ft,Cn=Ne,Sn=Lr,xn=Qr;const An=Ke;class kn{constructor(e,t,r){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;var e=Cn;this.result=new An(this._processor,void 0,this._opts),this.result.css=t;let n=this,s=(Object.defineProperty(this.result,"root",{get(){return n.root}}),new _n(e,void 0,this._opts,t));s.isMap()?([r,e]=s.generate(),r&&(this.result.css=r),e&&(this.result.map=e)):(s.clearAnnotation(),this.result.css=s.css)}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||Sn("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=xn;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}}ft=kn;kn.default=kn;let En=ft,Ln=Me,On=e,Mn=n;class Pn{constructor(e=[]){this.version="8.4.35",this.plugins=this.normalize(e)}normalize(e){let t=[];for(var r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return new(this.plugins.length||t.parser||t.stringifier||t.syntax?Ln:En)(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}ft=Pn;Pn.default=Pn,Mn.registerProcessor(Pn),On.registerProcessor(Pn);let Rn=He,Tn=qe,In=Ct,Bn=We,Nn=Je,jn=n,Dn=ot;function Un(e,r){if(Array.isArray(e))return e.map(e=>Un(e));let{inputs:t,...n}=e;if(t){r=[];for(var s of t){let e={...s,__proto__:Nn.prototype};e.map&&(e.map={...e.map,__proto__:Tn.prototype}),r.push(e)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>Un(e,r))),n.source){let{inputId:e,...t}=n.source;n.source=t,null!=e&&(n.source.input=r[e])}if("root"===n.type)return new jn(n);if("decl"===n.type)return new Rn(n);if("rule"===n.type)return new Dn(n);if("comment"===n.type)return new In(n);if("atrule"===n.type)return new Bn(n);throw new Error("Unknown node type: "+e.type)}qe=Un,Un.default=Un;let Fn=He,zn=Me;He=i;let $n=ft;Me=Ne,i=qe;let Gn=e;ft=St;let Hn=Ct,Vn=We;Ne=Ke,qe=Je,e=Qr,St=s;let Wn=ot,Jn=n;Ct=Te;function o(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new $n(e)}o.plugin=function(r,n){let s=!1;function i(...e){console&&console.warn&&!s&&(s=!0,console.warn(r+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(r+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let t=n(...e);return t.postcssPlugin=r,t.postcssVersion=(new $n).version,t}let e;return Object.defineProperty(i,"postcss",{get(){return e=e||i(),e}}),i.process=function(e,t,r){return o([i(r)]).process(e,t)},i},o.stringify=Me,o.parse=e,o.fromJSON=i,o.list=St,o.comment=e=>new Hn(e),o.atRule=e=>new Vn(e),o.decl=e=>new Fn(e),o.rule=e=>new Wn(e),o.root=e=>new Jn(e),o.document=e=>new Gn(e),o.CssSyntaxError=t,o.Declaration=Fn,o.Container=He,o.Processor=$n,o.Document=Gn,o.Comment=Hn,o.Warning=ft,o.AtRule=Vn,o.Result=Ne,o.Input=qe,o.Rule=Wn,o.Root=Jn,o.Node=Ct,zn.registerPostcss(o);o.default=o;class qn extends HTMLElement{base;contents;component;listType="ul";iconSet;filter={value:"",caseSensitive:!1};static get observedAttributes(){return["contents","icon-set","max-depth","filter"]}_jsonToValueArray(e){let t=JSON.stringify(e);t=t.replace(/[\[\]{}\"]/g,"");let r=[];for(const n of t.split(","))r=r.concat(n.split(":"));return[...new Set(r)]}_emit(e,t,r){e=new CustomEvent(e,{detail:r,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}constructor(){super(),this.base=new $,this.setContents(this.getAttribute("contents")),this.iconSet=this.getAttribute("icon-set")?this.getAttribute("icon-type"):"file",this.maxDepth=this.getAttribute("max-depth")?parseInt(this.getAttribute("max-depth")):-1,this.setFilter(this.getAttribute("filter")),this.style.display="block",this.style.maxWidth="fit-content",this.style.margin="0 1rem 0 0",this.base.addEvent(".flk-branch","click",this.emitNodeToggle)}emitNodeToggle(e){e.stopPropagation();const t=F(e,"flk-tree-nav").target,r=z(e,"branchKey");let n=t.contents;const s=r.split(".");for(const o of s)if(n[o])n=n[o];else{let e=[];for(const a of n)a[o]&&e.push(a[o]);n=e}var e=r.substring(r.indexOf(".")+1),i=t.createLeafText(s.reverse()[0]);t._emit("tree-click",t,{path:e,data:n,key:(i.titleText+" "+i.commentText).trim(),branch:"object"==typeof n})}convertJsonKeyToTitle(e){if(!e)return"";const t=(e="string"!=typeof e?e.toString():e).replace(/([A-Z_])/g,e=>"_"===e?" ":" "+e).trim();return t.charAt(0).toUpperCase()+t.slice(1)}setContents(e){var t=e||this.contents||[];try{switch(typeof t){case"string":this.contents=JSON.parse(t);break;case"object":Array.isArray(t)?this.contents=t:this.contents=[t]}}catch(e){console.log(e)}}applyFilter(e){let t;var r="details"===e.tagName.toLowerCase();t=this.filter.caseSensitive?e.dataset.branchValues.includes(this.filter.value):e.dataset.branchValues.toLowerCase().includes(this.filter.value.toLowerCase()),t?e.parentElement.classList.remove("hidden"):e.parentElement.classList.add("hidden"),r&&t?e.setAttribute("open",""):e.removeAttribute("open")}resetTree(e){e.parentElement.classList.remove("hidden"),e.removeAttribute("open")}filterTree(){let t=setTimeout(()=>{for(const e of this.querySelectorAll("[data-branch-values]"))void 0===this.filter.value||0===this.filter.value.length?this.resetTree(e):this.applyFilter(e);clearTimeout(t)},10)}setFilter(e){const t=e||{};try{switch(typeof t){case"string":t.includes("{")?(this.filter=JSON.parse(t),!1===this.filter.caseSensitive&&(this.filter.value=this.filter.value.toLowerCase())):this.filter.value=e.toLowerCase();break;case"object":this.filter=t}}catch(e){console.log(e)}this.filterTree()}createLeafText(e){var t,r;let n="",s="";return"string"==typeof e&&(e.includes("(")||e.includes("["))?(r=e.indexOf("("),r=-1===(t=e.indexOf("["))?r:t,n=this.convertJsonKeyToTitle(e.substring(0,r)),s=e.substring(r)):n=this.convertJsonKeyToTitle(e),{titleText:n,commentText:s}}createTextTag(n,s){n=this.createLeafText(n);if(n.commentText){let e=document.createElement("div"),t=document.createElement("span"),r=(t.innerText=n.titleText,document.createElement("small"));r.innerText=n.commentText,r.style.marginLeft="1rem",e.append(t,r),e.style.display="inline-flex",e.style.alignItems="center",s.append(e)}else s.innerText=n.titleText}createLeaf(e,t,r,n=[]){let s=document.createElement("li");s.classList.add("cursor-no-select"),s.style.marginTop="0.4rem",s.dataset.branchKey=r;const i="file"===this.iconSet?'':'';s.style.listStyleImage=`url('data:image/svg+xml,${i}')`,s.style.position="relative",s.style.left="2px";let o=document.createElement("span");r=[e].concat(n);if(o.dataset.branchValues=[...new Set(r)].join(),this.createTextTag(e,o),o.style.position="relative",o.style.top="-3px",s.append(o),t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);const i="file"===this.iconSet?G:H;e.style.listStyleImage=`url('data:image/svg+xml,${i}')`,e.append(s),t.append(e)}else t.append(s)}createBranch(r,t,n,s){if(s===this.maxDepth&&"object"==typeof r){var i,o=Array.isArray(r)?r:Object.keys(r);if("object"==typeof o[0]){let e=[];for(const d of o)e=e.concat(Object.keys(d));for(i of[...new Set(e)]){var u=document.createElement(this.listType);t.append(this.createBranch(i,u,n+"."+i,s+1))}}else for(const a of o){let e;r[a]&&(e=this._jsonToValueArray(r[a])),this.createLeaf(a,t,n,e)}}else if(Array.isArray(r))for(var e in r){var h=document.createElement(this.listType);t.append(this.createBranch(r[e],h,n+"."+e,s+1))}else if(null!==r&&"object"==typeof r){const l=[];for(const c of Object.keys(r)){let e=document.createElement("li"),t=(e.classList.add("cursor-no-select"),e.style.position="relative",e.style.left="2px",e.dataset.branchKey=n+"."+c,document.createElement("details"));t.classList.add("flk-branch"),t.dataset.branchValues=[c].concat(this._jsonToValueArray(r[c])),t.style.position="relative",t.style.top="-3px",t.classList.add("cursor-default");var p=document.createElement("summary");this.createTextTag(c,p),t.append(p),e.append(this.createBranch(r[c],t,n+"."+c,s+1)),l.push(e)}if(t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);o="file"===this.iconSet?G:H;e.style.listStyleImage=`url('data:image/svg+xml,${o}')`;for(const f of l)e.append(f);t.append(e)}else for(const m of l)t.append(m)}else console.trace({node:r,element:t,key:n}),this.createLeaf(r,t,n);return t}createHtml(){let e=document.createElement(this.listType);var t="file"===this.iconSet?G:'';if(e.style.listStyleImage=`url('data:image/svg+xml,${t}')`,e.style.marginLeft="3rem",this.contents.length){for(const r in this.contents)e=this.createBranch(this.contents[r],e,r,0);this.component=e}else this.component=e}attributeChangedCallback(e,t,r){switch(e){case"contents":this.setContents(r);break;case"icon-set":this.iconSet=r;break;case"max-depth":this.maxDepth="string"==typeof r?parseInt(r):r;break;case"filter":this.setFilter(r)}this.init()}connectedCallback(){this.init()}disconnectedCallback(){this.base.removeEvents(this)}init(){this.createHtml(),this.base.render(this)}}customElements.define("flk-table",W),customElements.define("flk-draggable",J),customElements.define("flk-modal",q),customElements.define("flk-dropdown",K),customElements.define("flk-tree-nav",qn)}(require$$0,require$$2,require$$1$1,require$$1); \ No newline at end of file +!function(e,n,s,i){"use strict";function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a,u,g,e=c(e),n=c(n),s=c(s),i=c(i);(t=a=a||{}).Date="date",t.String="string",t.Float="float",t.Number="number",t.Array="array",t.Object="object",t.Bool="bool",t.Currency="currency",t.Undefined="undefined",t.Null="null";const h={date:/^(\d{1,4}-\d{1,4}-\d{1,4}(T)?)/gim,currency:/^[$|€]\s?[0-9]*(\.|,)?\d*(\.|,)?\d*/gim,float:/\d+[,|.]\d+[,|.]?\d*/gim,currencySign:/\$|€/gim,array:/^\s?[[].[^,]+[\]],?/gi,precision:/[-+$€,.]/gm,string:/[a-zA-Z]/gim},m=e=>{return null===e||"null"===e?a.Null:e||0===e||!1===e?null===new RegExp(h.date).exec(e)||isNaN(Date.parse(e))?new RegExp(h.currency).exec(e)?a.Currency:!new RegExp(h.string).exec(e)&&new RegExp(h.float).exec(e.toString())?a.Float:isNaN(e)&&0!==e?Array.isArray(e)?a.Array:"object"==typeof e?a.Object:a.String:a.Number:a.Date:a.Undefined},y=(t,e)=>{const r={value:void 0,type:e=e||m(t),currencySign:""};switch(r.type){case a.String:r.value=t.toString();break;case a.Float:case a.Currency:var n=(t=t.toString()).match(new RegExp(/(,)/gim)),s=t.match(new RegExp(/(\.)/gim));if(n)for(let e=1;e<=n.length;e++)t=e!==n.length||s?t.replace(",",""):t.replace(",",".");if(r.type===a.Currency){const o=new RegExp(h.currencySign);var i=o.exec(t);r.currencySign=null!==i?i[0]:"",t=t.replace(o,"")}r.value=parseFloat(t).toPrecision(12);break;case a.Number:r.value=Number(t);break;case a.Date:r.value=Date.parse(t);break;case a.Array:t.length?"object"==typeof t[0]?r.value=t.map(e=>JSON.stringify(e)).join(", "):r.value=t.join(", "):r.value="";break;case a.Object:r.value=t;break;case a.Undefined:r.value="";break;case a.Null:r.value=null}return r};function v(e,t){var r;let n;for(r of e.split("."))r=r.trim(),n?"object"!=typeof n||Array.isArray(n)||(n=n[r]):n=t[r];return n}const b=(e,t)=>tet<=e,S=(e,t)=>e<=t,x=(e,t,r)=>r?e.toLowerCase()==t.toLowerCase():e==t,A=(e,t)=>e===t,k=(e,t)=>e!=t,E=(e,t)=>e!==t,L=(e,t)=>null!=t&&"string"==typeof e&&0<=e.toLowerCase().indexOf(t.toString().toLowerCase()),O=(e,t)=>null!=t&&0<=e.toString().toLowerCase().indexOf(t.toString().toLowerCase()),M=(e,t)=>null!=t&&"string"==typeof e&&e.toLowerCase().indexOf(t.toString().toLowerCase())<0;function P(r,n){if(0===n.length)return r;{var s=r;const o=[],a=[];let e=[];for(const l of n)l.type&&l.type!==u.And?(e.length&&a.push(e),e=[l]):e.push(l);a.push(e);let t=[];for(const e of a)t=t.concat(R(s,e));t=[...new Set(t)];var i=s.length;for(let e=0;e":return b;case"<":return _;case">=":return C;case"<=":return S;case"is":case"==":return x;case"!is":case"!=":return k;case"===":return A;case"!==":return E;case"like":case"~":case"contains":return L;case"!contains":case"!like":case"!~":return M;default:return O}}(a.operator);if(!l(i,o,a.ignoreCase)){e=!1;break}}e&&r.push(n)}return r};function T(e,t){if(!t||0===t.length)return e;if(1{if(0===r.length)r=r.concat(I(s,e));else{for(const t of r)n=n.concat(I(t,e));r=n,n=[]}}),r}return I(e,t[0])}function I(e,t){const r=[],n=[];do{if(!e||0===e.length)break;var s=e.shift();if(!s)break;const o=s[t];var i=n.indexOf(o.toString());0<=i?r[i].push(s):(n.push(o.toString()),void 0!==r[n.length-1]?r[n.length-1].push(s):r.push([s]))}while(0{if(t){var r=e;const n={};for(const s of t){let e=r.map(e=>e[s].toString());const i=e.map(e=>m(e));i.some(e=>e===a.Float)?(e=e.map(e=>parseFloat(e)),n[s]=parseFloat(e.reduce((e,t)=>e+t).toFixed(2))):(e=e.map(e=>parseInt(e)),n[s]=e.reduce((e,t)=>e+t))}return n}return{}};class D{model;sortDetails=[];filterDetails=[];selection=[];groupByProperties=[];distinctProperties=[];concatenationToken=", ";constructor(e){this.model=JSON.parse(JSON.stringify(e))}sort(e){return this.sortDetails=e,this}orderBy(e,t){return this.sortDetails.push({propertyName:e,direction:t}),this}thenOrderBy(e,t){return this.orderBy(e,t)}filter(e){return Array.isArray(e)?this.filterDetails=e:this.filterDetails.push(e),this}where(e,t,r,n,s){return this.filterDetails.push({propertyName:e,operator:t,value:r,type:n,ignoreCase:s}),this}andWhere(e,t,r,n){return this.where(e,t,r,u.And,n),this}orWhere(e,t,r,n){return this.where(e,t,r,u.Or,n),this}group(e){return this.groupByProperties=e,this}groupBy(e){return this.groupByProperties.push(e),this}thenGroupBy(e){return this.groupByProperties.push(e),this}select(e){return Array.isArray(e)?this.selection=e:"*"!==e&&(this.selection=[e]),this}distinct(e,t){return t&&(this.concatenationToken=t),Array.isArray(e)?this.distinctProperties=e:e&&(this.distinctProperties=[e]),this}execute(){return T(function(t,r){if(0===r.length)return t;{var n=r;let e=[];for(const s of t){const i={};for(const o of n)i[o]=s[o];e.push(i)}return e}}(function(r,n,u){if(!n||!n.length)return r;const s=[],h=[];for(const f of r){const o={};let t="";for(const e of n){var p=v(e,f);o[e]=p,t+=p}if(!h.includes(t)){let e=r;for(const a of Object.keys(o))e=e.filter(e=>e[a]===o[a]);h.push(t),s.push(e)}}const t=[];for(const m of s){let e={};for(const l of m){var i,d=Object.keys(e);if(d.length)for(const c of d)n.includes(c)||(i=e[c],Array.isArray(i)?(i=l[c],Array.isArray(i)?e[c]=[...new Set(...e[c].concat(l[c]))]:e[c].includes(l[c])||e[c].push(l[c])):isNaN(e[c])&&isNaN(l[c])?e[c]!==l[c]&&(e[c]=[e[c],l[c]]):e[c]=e[c]+l[c]);else e=l}t.push(e)}return t.forEach(e=>{for(const t in e)Array.isArray(e[t])&&(e[t]=e[t].join(u))}),t}(B(P(JSON.parse(JSON.stringify(this.model)),this.filterDetails),this.sortDetails),this.distinctProperties,this.concatenationToken),this.selection),this.groupByProperties)}sum(e,t){e=Array.isArray(e)?e:[e];return j(t||this.model,e)}}function U(e,t){t=t?t.toUpperCase():"FLK-";return e.toUpperCase().includes(t)}function F(e,t){var{timeStamp:r,type:n,x:s,y:i}=e;let o=e.target;do{if(!o||"HTML"===o.tagName||U(o.tagName,t)){"HTML"===o.tagName&&(o=null);break}}while(o=o.parentNode||o.parentElement,!U(o.tagName,t));return{target:o,timeStamp:r,type:n,x:s,y:i}}function z(e,t){let r=e.target,n="";for(;r.dataset[t]?n=r.dataset[t]:r=r.parentNode,!n;);return n}class ${constructor(){}_topLevelClasses=[];_events=[];generateId(){return"flk-"+function e(){const t=([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)),r=t.split("-")[0];return window.$flightkitUUIDStore||(window.$flightkitUUIDStore=[]),window.$flightkitUUIDStore.some(e=>e===r)?e():(window.$flightkitUUIDStore.push(r),r)}()}render(t){if(!t.component)throw new Error("Component is not assigned! Can't render");t.id=t.id||this.generateId();var e=this._getAllEventAttributes(t);if(e){var r="#"+t.id;for(const i of e){var n="e-"+i;this.addEvent(r,i,t.getAttribute(n))}}var s=Object.keys(t.classList).length;if(s){for(let e=0;e{this._assignToDom(t,t.component),clearTimeout(this._renderTimer)},10)}addEvent(e,t,r){this._events.push({selector:e,eventType:t,callback:r})}_getExternalCallback(e){let t=void 0;for(const r of e.split("."))t=(t||window)[r];return t}_getAllEventAttributes(e){e=e.attributes;const t=Array.from(e).filter(e=>e.name.startsWith("e-"));return t.map(e=>e.name.slice(2))}_isFlightkitElement(e){return e.toUpperCase().includes("FLK-")}_outerEventHandler(e){const t=F(e),r=(t.contents=e.detail,t.target.getAttribute("e-"+t.type));let n=void 0;for(const s of r.split("."))n=(n||window)[s];return e.preventDefault(),e.stopPropagation(),n(t)}_addEvents(e){if(e.isConnected)for(const r of this._events)if(r.selector.startsWith("."))for(const n of document.querySelectorAll(r.selector))this._addEventToElement(r,n);else{var t=document.querySelector(r.selector);this._addEventToElement(r,t)}}_addEventToElement(e,t){t&&("function"==typeof e.callback?(t.removeEventListener(e.eventType,e.callback),t.addEventListener(e.eventType,e.callback)):(t.removeEventListener(e.eventType,this._outerEventHandler),t.addEventListener(e.eventType,this._outerEventHandler)))}removeEvents(){for(const t of this._events)if(t.selector.startsWith("."))for(const r of document.querySelectorAll(t.selector))this._addEventToElement(t,r);else{var e=document.querySelector(t.selector);this._addEventToElement(t,e)}this._events=[]}_removeEventToElement(e,t){t&&("function"==typeof e.callback?t.removeEventListener(e.eventType,e.callback):t.removeEventListener(e.eventType,this._outerEventHandler))}_assignToDom(e,t){e.innerHTML="";for(const n of Array.isArray(t)?t:[t])e.append(n);const r=setTimeout(()=>{this._addEvents(e),clearTimeout(r)},10)}}const G='',H='';function V(e){const t=new DOMParser;return t.parseFromString(e,"image/svg+xml").documentElement}class W extends HTMLElement{base;component=null;_contents=[];_orderBy=[];properties=new Set;_columnOrder=[];_filter="";_selectionProperty="";_selectedIds=new Set;uniqueEntriesByProperties={};propertyLabelDictionary={};_templates={};_templateClasses={};static get observedAttributes(){return["contents","columns","order","filter","selection-property","templates"]}get columnOrder(){return this._columnOrder.length?this._columnOrder:this.properties}set columnOrder(e){let t;"string"==typeof e&&(t=e.split(",")),t=e,this._columnOrder=t}get contents(){return this._contents}set contents(e){this.analyzeData(e),this._contents=new D(e)}get orderBy(){return this._orderBy}set orderBy(e){if(Array.isArray(e))this._orderBy=e;else{const n=[];for(const s of e.split(",")){var t=s.split("|"),r=t[0],t=1e[r._selectionProperty])):new Set;e=t?r.contents.execute():[];r._emit("select",r,{selection:e}),r._updateCheckboxes(r)}emitSelect(e){var t=e.target.checked,r=e.target.dataset.objectId;const n=F(e).target,s=(t?n._selectedIds.add(r):n._selectedIds.delete(r),n._selectionProperty);e=n.contents.execute().filter(e=>n._selectedIds.has(e[s]));n._emit("select",n,{selection:e}),n._updateCheckboxes(n)}sortData(e){const t=F(e).target,r=z(e,"column");r&&(-1<(e=t._orderBy.findIndex(e=>e.propertyName===r))?"asc"===t._orderBy[e].direction?t._orderBy[e].direction="desc":t._orderBy.splice(e,1):t._orderBy.push({propertyName:r,direction:"asc"}),t.createHtml(),t.base.render(t))}setColumnOrder(e){this._columnOrder=e?Array.isArray(e)?e:e.split(","):[]}analyzeData(t){this.properties=new Set;var r=t.length;for(let e=0;e"_"===e?" ":" "+e.toLowerCase()).trim();var r=t.charAt(0).toUpperCase()+t.slice(1);return this.propertyLabelDictionary[e]=r}parseTemplate(e,n){return e.replace(/\{\{([\s\S]+?)\}\}/gim,(e,t)=>{let r="";t=t.trim();t=n[t];return t&&(r=t),Array.isArray(r)?r.join(", "):r.toString().trim()})}createSelectionCheckbox(e){const t=document.createElement("input");return t.setAttribute("type","checkbox"),t.classList.add("flk-selection-checkbox"),e&&(t.dataset.selected=e[this._selectionProperty]),t}createRow(e){const t=document.createElement("tr");if(this._selectionProperty.length){const s=document.createElement("td");var r=this.base.generateId();const i=this.createSelectionCheckbox(e);i.id=r,i.dataset.objectId=e[this._selectionProperty];var n=e[this._selectionProperty];this._selectedIds.has(n)?i.checked=!0:i.checked=!1,this.base.addEvent("#"+r,"change",this.emitSelect),s.append(i),t.append(s)}for(const o of this.columnOrder){const a=document.createElement("td");this._templates[o]?(a.innerHTML=this.parseTemplate(this._templates[o],e),this._templateClasses[o]&&a.classList.add(...this._templateClasses[o])):a.innerText=e[o],t.append(a)}return t}createBody(e){const t=document.createElement("tbody");for(const n of e){var r=this.createRow(n,null);t.append(r)}return t}createHead(){const e=document.createElement("thead"),t=document.createElement("tr");if(t.classList.add("cursor-pointer"),this._selectionProperty.length){const s=document.createElement("th");var r=this.base.generateId();const i=this.createSelectionCheckbox();i.id=r;var u=this.contents.execute().length;0e.propertyName===o);if(n){const c=document.createElement("span");c.innerHTML="asc"===n.direction?'':'',a.append(c)}t.append(a)}return e.append(t),e}addEvent(e,t,r){this.base.addEvent(e,t,r)}init(){this.createHtml(),this.base.render(this)}}class J extends HTMLElement{base;componentId;constructor(){super(),this.base=new $}connectedCallback(){var e=this.getAttribute("top"),t=this.getAttribute("left"),r=this.getAttribute("center"),n=this.getAttribute("zIndex");this.id||(this.id=this.base.generateId()),this.style.display="block",this.style.position="fixed","string"==typeof r?(this.style.top=e||"50%",this.style.left="50%",this.style.transform="translate(-50%, -50%)"):(this.style.top=e||this.clientTop+"px",this.style.left=t||this.clientLeft+"px"),n&&(this.style.zIndex=n),this.componentId=this.getAttribute("handle");const s=document.createElement("div");s.innerHTML=this.innerHTML,this.component=s;r="#"+(this.componentId||this.id);this.base.addEvent(r,"mousedown",this._dragElement),this.base.addEvent(r,"mouseup",this._reset),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this)}_dragElement(e){const r=F(e,"flk-draggable").target;let n,s;function t(e){n=e.clientX-r.offsetLeft,s=e.clientY-r.offsetTop}function i(e){var t=e.clientX-n,e=e.clientY-s;r.style.left=t+"px",r.style.top=e+"px"}function o(e){e.preventDefault()}function a(){r.removeAttribute("draggable"),r.removeEventListener("dragstart",t),r.removeEventListener("dragend",a),document.removeEventListener("dragover",o),document.removeEventListener("drop",i)}r.setAttribute("draggable",!0),r.addEventListener("dragstart",t),r.addEventListener("dragend",a),document.addEventListener("dragover",o),document.addEventListener("drop",i)}}class q extends HTMLElement{_id;base;_draggableId;constructor(){super(),this.base=new $}_emit(e,t,r){e=new CustomEvent(e,{detail:r,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}_closeModal(e){e.stopPropagation();const t=F(e,"flk-modal").target;t.classList.add("hidden")}closeModal(e){this.classList.add("hidden")}openModal(e=!0){const t=document.getElementById(this._draggableId);e&&(t.style.top="40%",t.style.left="50%"),this.classList.remove("hidden")}connectedCallback(){this.id||(this.id=this.base.generateId());const e=document.createElement("div");var t=this.base.generateId();const r=document.createElement("flk-draggable"),n=(this._draggableId=this.base.generateId(),r.id=this._draggableId,r.setAttribute("center",""),r.setAttribute("top","40%"),r.setAttribute("handle",t),r.setAttribute("zIndex","1080"),r.classList.add("border","shadow-lg","bg-white"),r.style.width="max-content",document.createElement("div"));var s=this.getAttribute("modal-title");if(s){const c=document.createElement("span");c.innerText=s,c.classList.add("ml-1","mr-auto"),n.append(c)}n.id=t;const i=this.getAttribute("header-class");let o=[];i?o=o.concat(i.split(" ")):o.push("bg-gray-light"),n.classList.add(...o,"border-bottom","row","justify-end","cursor-no-select");s=this.base.generateId();const a=document.createElement("button"),l=(a.classList.add("py-0","px-1","outline-hover","no-border","cursor-default",...o),a.innerText="X",a.id=s,n.append(a),r.append(n),document.createElement("div"));l.innerHTML=this.innerHTML,r.append(l),e.append(r),this.component=e,this.base.addEvent("#"+s,"click",this._closeModal),this.base.render(this),this.classList.add("hidden")}disconnectedCallback(){this.base.removeEvents(this)}}class K extends HTMLElement{base;_buttonId;_drawerId;_iconId;constructor(){super(),this.base=new $}connectedCallback(){this.style.position="relative",this.style.display="flex",this.style.width="fit-content",this._buttonId=this.base.generateId();const e=document.createElement("button"),t=(e.classList.add("row"),e.id=this._buttonId,document.createElement("span")),r=(t.innerText=this.getAttribute("text"),this._iconId=this.base.generateId(),document.createElement("span"));var n=V('');const s=V(''),i=(s.classList.add("hidden"),r.append(n,s),r.id=this._iconId,e.append(t,r),this._drawerId=this.base.generateId(),document.createElement("div"));i.id=this._drawerId,i.classList.add("shadow","inline-block","bg-white"),i.style.position="absolute",i.style.zIndex="1040";n=this.querySelector("template");n.innerHTML.length?i.innerHTML=n.innerHTML:i.append(n.firstChild),i.style.display="none",this.component=[e,i],this.base.addEvent("#"+this._buttonId,"click",this.toggleMenu);const o=document.querySelector("body");""!==o.getAttribute("flk-close-dropdown")&&(o.setAttribute("flk-close-dropdown",""),o.addEventListener("click",this.closeAllDropdownButtons)),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this);var e=document.querySelectorAll("flk-dropdown");if(!e||!e.length){const t=document.querySelector("body");t.removeAttribute("flk-close-dropdown"),t.removeEventListener("click",this.closeAllDropdownButtons)}}toggleMenu(e){const t=F(e).target;e=t._drawerId;const r=document.getElementById(e);var e="none"!==r.style.display,n=(r.style.display=e?"none":"block",t.getAttribute("drawer-width")),n=("string"==typeof t.getAttribute("right")&&(r.style.right="0px"),r.style.top=t.offsetHeight+"px",r.style.width=n||t.offsetWidth+"px",t._iconId);const s=document.getElementById(n);e?(s.childNodes[0].classList.remove("hidden"),s.childNodes[1].classList.add("hidden")):(s.childNodes[0].classList.add("hidden"),s.childNodes[1].classList.remove("hidden"))}_closeDropdown(){var e=this._drawerId;const t=document.getElementById(e);if("none"!==t.style.display){e=this._iconId;const r=document.getElementById(e);t.style.display="none",r.childNodes[0].classList.remove("hidden"),r.childNodes[1].classList.add("hidden")}}closeAllDropdownButtons(e){var t,r=F(e,"flk-dropdown").target,e=document.querySelectorAll("flk-dropdown");if(r)for(const n of e)r._buttonId!==n._buttonId&&(t=n._drawerId,"none"!==document.getElementById(t).style.display&&n._closeDropdown());else for(const s of e)s._closeDropdown()}}var t={exports:{}};let Z=e.default,Y=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||"win32"===process.platform||Z.isatty(1)&&"dumb"!==process.env.TERM||"CI"in process.env),r=(r,n,s=r)=>e=>{let t=""+e;e=t.indexOf(n,r.length);return~e?r+X(t,n,s,e)+n:r+t+n},X=(e,t,r,n)=>{var s=e.substring(0,n)+r;let i=e.substring(n+t.length);e=i.indexOf(t);return~e?s+X(i,t,r,e):s+i};e=(e=Y)=>({isColorSupported:e,reset:e?e=>`${e}`:String,bold:e?r("","",""):String,dim:e?r("","",""):String,italic:e?r("",""):String,underline:e?r("",""):String,inverse:e?r("",""):String,hidden:e?r("",""):String,strikethrough:e?r("",""):String,black:e?r("",""):String,red:e?r("",""):String,green:e?r("",""):String,yellow:e?r("",""):String,blue:e?r("",""):String,magenta:e?r("",""):String,cyan:e?r("",""):String,white:e?r("",""):String,gray:e?r("",""):String,bgBlack:e?r("",""):String,bgRed:e?r("",""):String,bgGreen:e?r("",""):String,bgYellow:e?r("",""):String,bgBlue:e?r("",""):String,bgMagenta:e?r("",""):String,bgCyan:e?r("",""):String,bgWhite:e?r("",""):String});t.exports=e(),t.exports.createColors=e;const Q="'".charCodeAt(0),ee='"'.charCodeAt(0),te="\\".charCodeAt(0),re="/".charCodeAt(0),ne="\n".charCodeAt(0),se=" ".charCodeAt(0),ie="\f".charCodeAt(0),oe="\t".charCodeAt(0),ae="\r".charCodeAt(0),le="[".charCodeAt(0),ce="]".charCodeAt(0),ue="(".charCodeAt(0),he=")".charCodeAt(0),pe="{".charCodeAt(0),de="}".charCodeAt(0),fe=";".charCodeAt(0),me="*".charCodeAt(0),ge=":".charCodeAt(0),ye="@".charCodeAt(0),ve=/[\t\n\f\r "#'()/;[\\\]{}]/g,we=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,be=/.[\r\n"'(/\\]/,_e=/[\da-f]/i;function Ce(t,e={}){let n=t.css.valueOf(),d=e.ignoreErrors,s,i,f,m,o,a,l,g,c,u,y=n.length,h=0,v=[],p=[];function w(e){throw t.error("Unclosed "+e,h)}return{back:function(e){p.push(e)},endOfFile:function(){return 0===p.length&&h>=y},nextToken:function(e){if(p.length)return p.pop();if(!(h>=y)){var t=!!e&&e.ignoreUnclosed;switch(s=n.charCodeAt(h),s){case ne:case se:case oe:case ae:case ie:for(i=h;i+=1,s=n.charCodeAt(i),s===se||s===ne||s===oe||s===ae||s===ie;);u=["space",n.slice(h,i)],h=i-1;break;case le:case ce:case pe:case de:case ge:case fe:case he:var r=String.fromCharCode(s);u=[r,r,h];break;case ue:if(g=v.length?v.pop()[1]:"",c=n.charCodeAt(h+1),"url"===g&&c!==Q&&c!==ee&&c!==se&&c!==ne&&c!==oe&&c!==ie&&c!==ae){i=h;do{if(a=!1,i=n.indexOf(")",i+1),-1===i){if(d||t){i=h;break}w("bracket")}for(l=i;n.charCodeAt(l-1)===te;)--l,a=!a}while(a);u=["brackets",n.slice(h,i+1),h,i],h=i}else i=n.indexOf(")",h+1),m=n.slice(h,i+1),-1===i||be.test(m)?u=["(","(",h]:(u=["brackets",m,h,i],h=i);break;case Q:case ee:f=s===Q?"'":'"',i=h;do{if(a=!1,i=n.indexOf(f,i+1),-1===i){if(d||t){i=h+1;break}w("string")}for(l=i;n.charCodeAt(l-1)===te;)--l,a=!a}while(a);u=["string",n.slice(h,i+1),h,i],h=i;break;case ye:ve.lastIndex=h+1,ve.test(n),i=0===ve.lastIndex?n.length-1:ve.lastIndex-2,u=["at-word",n.slice(h,i+1),h,i],h=i;break;case te:for(i=h,o=!0;n.charCodeAt(i+1)===te;)i+=1,o=!o;if(s=n.charCodeAt(i+1),o&&s!==re&&s!==se&&s!==ne&&s!==oe&&s!==ae&&s!==ie&&(i+=1,_e.test(n.charAt(i)))){for(;_e.test(n.charAt(i+1));)i+=1;n.charCodeAt(i+1)===se&&(i+=1)}u=["word",n.slice(h,i+1),h,i],h=i;break;default:h=(s===re&&n.charCodeAt(h+1)===me?(i=n.indexOf("*/",h+2)+1,0===i&&(d||t?i=n.length:w("comment")),u=["comment",n.slice(h,i+1),h,i]):(we.lastIndex=h+1,we.test(n),i=0===we.lastIndex?n.length-1:we.lastIndex-2,u=["word",n.slice(h,i+1),h,i],v.push(u)),i)}return h++,u}},position:function(){return h}}}e=t.exports;let Se=Ce,xe;const Ae={";":e.yellow,":":e.yellow,"(":e.cyan,")":e.cyan,"[":e.yellow,"]":e.yellow,"{":e.yellow,"}":e.yellow,"at-word":e.cyan,brackets:e.cyan,call:e.cyan,class:e.yellow,comment:e.gray,hash:e.magenta,string:e.green};function ke(e){let r=Se(new xe(e),{ignoreErrors:!0}),n="";for(;!r.endOfFile();){let e=r.nextToken(),t=Ae[function([e,t],r){if("word"===e){if("."===t[0])return"class";if("#"===t[0])return"hash"}if(!r.endOfFile()){t=r.nextToken();if(r.back(t),"brackets"===t[0]||"("===t[0])return"call"}return e}(e,r)];t?n+=e[1].split(/\r?\n/).map(e=>t(e)).join("\n"):n+=e[1]}return n}ke.registerInput=function(e){xe=e};e=ke;let Ee=t.exports,Le=e;class Oe extends Error{constructor(e,t,r,n,s,i){super(e),this.name="CssSyntaxError",this.reason=e,s&&(this.file=s),n&&(this.source=n),i&&(this.plugin=i),void 0!==t&&void 0!==r&&("number"==typeof t?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,Oe)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file||"",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source,r=(null==e&&(e=Ee.isColorSupported),Le&&e&&(t=Le(t)),t.split(/\r?\n/)),n=Math.max(this.line-3,0);var s=Math.min(this.line+2,r.length);let i=String(s).length,o,a;if(e){let{bold:t,gray:r,red:n}=Ee.createColors(!0);o=e=>t(n(e)),a=e=>r(e)}else o=a=e=>e;return r.slice(n,s).map((e,t)=>{var t=n+1+t;let r=" "+(" "+t).slice(-i)+" | ";return t===this.line?(t=a(r.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," "),o(">")+a(r)+e+"\n "+t+o("^")):" "+a(r)+e}).join("\n")}toString(){let e=this.showSourceCode();return e=e&&"\n\n"+e+"\n",this.name+": "+this.message+e}}var t=Oe,Me=(Oe.default=Oe,{});Me.isClean=Symbol("isClean"),Me.my=Symbol("my");const Pe={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class Re{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name;var n=e.params?this.rawValue(e,"params"):"";void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes?this.block(e,r+n):(t=(e.raws.between||"")+(t?";":""),this.builder(r+n+t,e))}beforeAfter(e,t){let r,n=(r="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose"),e.parent),s=0;for(;n&&"root"!==n.type;)s+=1,n=n.parent;if(r.includes("\n")){var i=this.raw(e,null,"indent");if(i.length)for(let e=0;e{if(n=e.raws[t],void 0!==n)return!1}),void 0===n&&(n=Pe[r]),i.rawCache[r]=n,n}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&0{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=void 0===r?this.raw(t,null,"beforeDecl"):r&&r.replace(/\S/g,""),r}rawBeforeDecl(e,t){let r;return e.walkDecls(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=void 0===r?this.raw(t,null,"beforeRule"):r&&r.replace(/\S/g,""),r}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(t){let r;return t.walk(e=>{if(e.nodes&&(e.parent!==t||t.first!==e)&&void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=r&&r.replace(/\S/g,""),r}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(r){if(r.raws.indent)return r.raws.indent;let n;return r.walk(e=>{var t=e.parent;if(t&&t!==r&&t.parent&&t.parent===r&&void 0!==e.raws.before)return t=e.raws.before.split("\n"),n=t[t.length-1],n=n.replace(/\S/g,""),!1}),n}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){var r=e[t],e=e.raws[t];return e&&e.value===r?e.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}}var Te=Re;Re.default=Re;let Ie=Te;function Be(e,t){let r=new Ie(t);r.stringify(e)}var Ne=Be;Be.default=Be;let{isClean:je,my:De}=Me,Ue=t,Fe=Te,ze=Ne;function $e(t,r){let n=new t.constructor;for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&"proxyCache"!==s){let e=t[s];var i=typeof e;"parent"===s&&"object"==i?r&&(n[s]=r):"source"===s?n[s]=e:Array.isArray(e)?n[s]=e.map(e=>$e(e,n)):("object"==i&&null!==e&&(e=$e(e)),n[s]=e)}return n}class Ge{constructor(e={}){for(var t in this.raws={},this[je]=!1,this[De]=!0,e)if("nodes"===t){this.nodes=[];for(var r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){var t;return e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)&&(t=this.source,e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)),e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(var t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=$e(this);for(var r in e)t[r]=e[r];return t}cloneAfter(e={}){e=this.clone(e);return this.parent.insertAfter(this,e),e}cloneBefore(e={}){e=this.clone(e);return this.parent.insertBefore(this,e),e}error(e,t={}){var r,n;return this.source?({end:r,start:n}=this.rangeBy(t),this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)):new Ue(e)}getProxyProcessor(){return{get(e,t){return"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t]},set(e,t,r){return e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0}}}markDirty(){if(this[je]){this[je]=!1;let e=this;for(;e=e.parent;)e[je]=!1}}next(){var e;if(this.parent)return e=this.parent.index(this),this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;return e.index?r=this.positionInside(e.index,t):!e.word||-1!==(e=(t=this.toString()).indexOf(e.word))&&(r=this.positionInside(e,t)),r}positionInside(t,e){var r=e||this.toString();let n=this.source.start.column,s=this.source.start.line;for(let e=0;e"object"==typeof e&&e.toJSON?e.toJSON(null,r):e);else if("object"==typeof t&&t.toJSON)n[s]=t.toJSON(null,r);else if("source"===s){let e=r.get(t.input);null==e&&(e=i,r.set(t.input,i),i++),n[s]={end:t.end,inputId:e,start:t.start}}else n[s]=t}return t&&(n.inputs=[...r.keys()].map(e=>e.toJSON())),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=ze){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(var s in r)n[s]=r[s];return e.warn(t,n)}get proxyOf(){return this}}var Te=Ge,He=(Ge.default=Ge,Te);class Ve extends He{constructor(e){super(e=e&&void 0!==e.value&&"string"!=typeof e.value?{...e,value:String(e.value)}:e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}}var He=Ve,We=(Ve.default=Ve,{}),Je={},qe={},Ke={},Ze="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),Ye=(Ke.encode=function(e){if(0<=e&&e>>=5)&&(t|=32),r+=Ye.encode(t),0>1,1==(1&a)?-i:i),r.rest=t};var Ke={},l=Ke,Xe=(l.getArg=function(e,t,r){if(t in e)return e[t];if(3===arguments.length)return r;throw new Error('"'+t+'" is a required argument.')},/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/),Qe=/^data:.+\,.+$/;function et(e){e=e.match(Xe);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}function tt(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}l.urlParse=et,l.urlGenerate=tt,rt=function(e){var t=e,r=et(e);if(r){if(!r.path)return e;t=r.path}for(var n,e=l.isAbsolute(t),s=[],i=0;;){if(n=i,-1===(i=t.indexOf("/",n))){s.push(t.slice(n));break}for(s.push(t.slice(n,i));in;e--){var o=r[e-1],a=r[e];if(Pt(o,a)<=0)break;r[e-1]=a,r[e]=o}else Ot(r,Pt,n)}function Tt(e,s){var t=e,e=("string"==typeof e&&(t=w.parseSourceMapInput(e)),w.getArg(t,"version")),t=w.getArg(t,"sections");if(e!=this._version)throw new Error("Unsupported version: "+e);this._sources=new Et,this._names=new Et;var i={line:-1,column:0};this._sections=t.map(function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var t=w.getArg(e,"offset"),r=w.getArg(t,"line"),n=w.getArg(t,"column");if(r=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))},p.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;var r=this._findSourceIndex(e);if(0<=r)return this.sourcesContent[r];var n,r=e;if(null!=this.sourceRoot&&(r=w.relative(this.sourceRoot,r)),null!=this.sourceRoot&&(n=w.urlParse(this.sourceRoot))){e=r.replace(/^file:\/\//,"");if("file"==n.scheme&&this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];if((!n.path||"/"==n.path)&&this._sources.has("/"+r))return this.sourcesContent[this._sources.indexOf("/"+r)]}if(t)return null;throw new Error('"'+r+'" is not in the SourceMap.')},p.prototype.generatedPositionFor=function(e){var t=w.getArg(e,"source");if((t=this._findSourceIndex(t))<0)return{line:null,column:null,lastColumn:null};t={source:t,originalLine:w.getArg(e,"line"),originalColumn:w.getArg(e,"column")},e=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",w.compareByOriginalPositions,w.getArg(e,"bias",f.GREATEST_LOWER_BOUND));if(0<=e){e=this._originalMappings[e];if(e.source===t.source)return{line:w.getArg(e,"generatedLine",null),column:w.getArg(e,"generatedColumn",null),lastColumn:w.getArg(e,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},ft.BasicSourceMapConsumer=p,(Tt.prototype=Object.create(f.prototype)).constructor=f,Tt.prototype._version=3,Object.defineProperty(Tt.prototype,"sources",{get:function(){for(var e=[],t=0;t{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(n,s=21)=>(e=s)=>{let t="",r=e;for(;r--;)t+=n[Math.random()*n.length|0];return t}};let{SourceMapConsumer:Ut,SourceMapGenerator:Ft}=We,{existsSync:zt,readFileSync:$t}=i.default,{dirname:Gt,join:Ht}=n.default;class Vt{constructor(e,t){!1!==t.map&&(this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:"),e=t.map?t.map.prev:void 0,e=this.loadMap(t.from,e),!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Gt(this.mapFile)),e&&(this.text=e))}consumer(){return this.consumerCache||(this.consumerCache=new Ut(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+t)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);var r,n;t&&(r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r),-1"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,i,o;t&&"object"==typeof t?(a=r,r="number"==typeof(l=t).offset?(t=(c=this.fromOffset(l.offset)).line,c.col):(t=l.line,l.column),o="number"==typeof a.offset?(c=this.fromOffset(a.offset),i=c.line,c.col):(i=a.line,a.column)):r||(t=(l=this.fromOffset(t)).line,r=l.col);var a,l,c=this.origin(t,r,i,o);return s=c?new Xt(e,void 0===c.endLine?c.line:{column:c.column,line:c.line},void 0===c.endLine?c.column:{column:c.endColumn,line:c.endLine},c.source,c.file,n.plugin):new Xt(e,void 0===i?t:{column:r,line:t},void 0===i?r:{column:o,line:i},this.css,this.file,n.plugin),s.input={column:r,endColumn:o,endLine:i,line:t,source:this.css},this.file&&(Jt&&(s.input.url=Jt(this.file).toString()),s.input.file=this.file),s}fromOffset(t){let n;if(this[er])n=this[er];else{var s=this.css.split("\n");n=new Array(s.length);let r=0;for(let e=0,t=s.length;e>1),t=n[i+1])){r=i;break}r=i+1}}return{col:t-n[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Kt(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let s=this.map.consumer();t=s.originalPositionFor({column:t,line:e});if(!t.source)return!1;let i;"number"==typeof r&&(i=s.originalPositionFor({column:n,line:r}));let o,a=(o=qt(t.source)?Jt(t.source):new URL(t.source,this.map.consumer().sourceRoot||Jt(this.map.mapFile)),{column:t.column,endColumn:i&&i.column,endLine:i&&i.line,line:t.line,url:o.toString()});if("file:"===o.protocol){if(!Wt)throw new Error("file: protocol is not available in this PostCSS build");a.file=Wt(o)}e=s.sourceContentFor(t.source);return e&&(a.source=e),a}toJSON(){let e={};for(var t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}}Je=nr;nr.default=nr,Yt&&Yt.registerInput&&Yt.registerInput(nr);let{SourceMapConsumer:sr,SourceMapGenerator:ir}=We,{dirname:or,relative:ar,resolve:lr,sep:cr}=n.default,ur=s.default["pathToFileURL"],hr=Je,pr=Boolean(sr&&ir),dr=Boolean(or&&lr&&ar&&cr);ft=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e,t=(e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map","\n");this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(var t of this.previous()){var r=this.toUrl(this.path(t.file)),n=t.root||or(t.file);let e;!1===this.mapOpts.sourcesContent?(e=new sr(t.text),e.sourcesContent&&(e.sourcesContent=null)):e=t.consumer(),this.map.applySourceMap(e,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let t;for(let e=this.root.nodes.length-1;0<=e;e--)t=this.root.nodes[e],"comment"===t.type&&0===t.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(e)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),dr&&pr&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,e=>{t+=e}),[t]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=ir.fromSourceMap(e)}else this.map=new ir({file:this.outputFile()}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):""});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&0",o={generated:{column:0,line:0},original:{column:0,line:0},source:""},a,l;this.stringify(this.root,(e,t,r)=>{this.css+=e,t&&"end"!==r&&(o.generated.line=n,o.generated.column=s-1,t.source&&t.source.start?(o.source=this.sourcePath(t),o.original.line=t.source.start.line,o.original.column=t.source.start.column-1):(o.source=i,o.original.line=1,o.original.column=0),this.map.addMapping(o)),a=e.match(/\n/g),a?(n+=a.length,l=e.lastIndexOf("\n"),s=e.length-l):s+=e.length,t&&"start"!==r&&(e=t.parent||{raws:{}},("decl"===t.type||"atrule"===t.type&&!t.nodes)&&t===e.last&&!e.raws.semicolon||(t.source&&t.source.end?(o.source=this.sourcePath(t),o.original.line=t.source.end.line,o.original.column=t.source.end.column-1,o.generated.line=n,o.generated.column=s-2):(o.source=i,o.original.line=1,o.original.column=0,o.generated.line=n,o.generated.column=s-1),this.map.addMapping(o)))})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;var e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:0e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;var t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?or(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=or(lr(r,this.mapOpts.annotation)));t=ar(r,e);return this.memoizedPaths.set(e,t),t}previous(){var e;return this.previousMaps||(this.previousMaps=[],this.root?this.root.walk(e=>{e.source&&e.source.input.map&&(e=e.source.input.map,this.previousMaps.includes(e)||this.previousMaps.push(e))}):(e=new hr(this.originalCSS,this.opts)).map&&this.previousMaps.push(e.map)),this.previousMaps}setSourcesContent(){let r={};var e;this.root?this.root.walk(e=>{var t;!e.source||(t=e.source.input.from)&&!r[t]&&(r[t]=!0,t=this.usesFileUrls?this.toFileUrl(t):this.toUrl(this.path(t)),this.map.setSourceContent(t,e.source.input.css))}):this.css&&(e=this.opts.from?this.toUrl(this.path(this.opts.from)):"",this.map.setSourceContent(e,this.css))}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){var t=this.memoizedFileURLs.get(e);if(t)return t;if(ur)return t=ur(e).toString(),this.memoizedFileURLs.set(e,t),t;throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){var t=this.memoizedURLs.get(e);if(t)return t;"\\"===cr&&(e=e.replace(/\\/g,"/"));t=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,t),t}};class fr extends Te{constructor(e){super(e),this.type="comment"}}Ct=fr;fr.default=fr;let{isClean:mr,my:gr}=Me,yr=He,vr=Ct,wr,br,_r,Cr;class Sr extends Te{append(...e){for(var t of e){var r;for(r of this.normalize(t,this.last))this.proxyOf.nodes.push(r)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(var t of this.nodes)t.cleanRaws(e)}each(r){if(this.proxyOf.nodes){var n=this.getIterator();let e,t;for(;this.indexes[n]t[n](...e.map(r=>"function"==typeof r?(e,t)=>r(e.toProxy(),t):r)):"every"===n||"some"===n?r=>t[n]((e,...t)=>r(e.toProxy(),...t)):"root"===n?()=>t.root().toProxy():"nodes"===n?t.nodes.map(e=>e.toProxy()):"first"===n||"last"===n?t[n].toProxy():t[n])},set(e,t,r){return e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0}}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){var r,n,s,i=this.index(e),o=this.normalize(t,this.proxyOf.nodes[i]).reverse(),i=this.index(e);for(r of o)this.proxyOf.nodes.splice(i+1,0,r);for(s in this.indexes)i<(n=this.indexes[s])&&(this.indexes[s]=n+o.length);return this.markDirty(),this}insertBefore(e,t){var r,n,s,i=this.index(e),o=this.normalize(t,this.proxyOf.nodes[i],0===i&&"prepend").reverse(),i=this.index(e);for(r of o)this.proxyOf.nodes.splice(i,0,r);for(s in this.indexes)i<=(n=this.indexes[s])&&(this.indexes[s]=n+o.length);return this.markDirty(),this}normalize(e,t){if("string"==typeof e)e=function t(e){return e.map(e=>(e.nodes&&(e.nodes=t(e.nodes)),delete e.source,e))}(wr(e).nodes);else if(void 0===e)e=[];else if(Array.isArray(e))for(var r of e=e.slice(0))r.parent&&r.parent.removeChild(r,"ignore");else if("root"===e.type&&"document"!==this.type)for(var n of e=e.nodes.slice(0))n.parent&&n.parent.removeChild(n,"ignore");else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new yr(e)]}else if(e.selector)e=[new br(e)];else if(e.name)e=[new _r(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new vr(e)]}return e.map(e=>(e[gr]||Sr.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[mr]&&function e(t){if(t[mr]=!1,t.proxyOf.nodes)for(var r of t.proxyOf.nodes)e(r)}(e),void 0===e.raws.before&&t&&void 0!==t.raws.before&&(e.raws.before=t.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}prepend(...e){for(var t of e=e.reverse()){var r,n,s=this.normalize(t,this.first,"prepend").reverse();for(r of s)this.proxyOf.nodes.unshift(r);for(n in this.indexes)this.indexes[n]=this.indexes[n]+s.length}return this.markDirty(),this}push(e){return(e.parent=this).proxyOf.nodes.push(e),this}removeAll(){for(var e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){var t,r;for(r in e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1),this.indexes)e<=(t=this.indexes[r])&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(t,r,n){return n||(n=r,r={}),this.walkDecls(e=>{r.props&&!r.props.includes(e.prop)||r.fast&&!e.value.includes(r.fast)||(e.value=e.value.replace(t,n))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(n){return this.each((t,e)=>{let r;try{r=n(t,e)}catch(e){throw t.addToError(e)}return!1!==r&&t.walk&&(r=t.walk(n)),r})}walkAtRules(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("atrule"===e.type&&r.test(e.name))return n(e,t)}):this.walk((e,t)=>{if("atrule"===e.type&&e.name===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("atrule"===e.type)return n(e,t)}))}walkComments(r){return this.walk((e,t)=>{if("comment"===e.type)return r(e,t)})}walkDecls(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("decl"===e.type&&r.test(e.prop))return n(e,t)}):this.walk((e,t)=>{if("decl"===e.type&&e.prop===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("decl"===e.type)return n(e,t)}))}walkRules(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("rule"===e.type&&r.test(e.selector))return n(e,t)}):this.walk((e,t)=>{if("rule"===e.type&&e.selector===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("rule"===e.type)return n(e,t)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}Sr.registerParse=e=>{wr=e},Sr.registerRule=e=>{br=e},Sr.registerAtRule=e=>{_r=e},Sr.registerRoot=e=>{Cr=e};i=Sr,Sr.default=Sr,Sr.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,_r.prototype):"rule"===e.type?Object.setPrototypeOf(e,br.prototype):"decl"===e.type?Object.setPrototypeOf(e,yr.prototype):"comment"===e.type?Object.setPrototypeOf(e,vr.prototype):"root"===e.type&&Object.setPrototypeOf(e,Cr.prototype),e[gr]=!0,e.nodes&&e.nodes.forEach(e=>{Sr.rebuild(e)})},ot=i;let xr,Ar;class kr extends ot{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){let t=new xr(new Ar,this,e);return t.stringify()}}kr.registerLazyResult=e=>{xr=e},kr.registerProcessor=e=>{Ar=e};e=kr;kr.default=kr;let Er={};function Lr(e){Er[e]||(Er[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))}class Or{constructor(e,t={}){for(var r in this.type="warning",this.text=e,t.node&&t.node.source&&(e=t.node.rangeBy(t),this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column),t)this[r]=t[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}St=Or;Or.default=Or;let Mr=St;class Pr{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);e=new Mr(e,t);return this.messages.push(e),e}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}}Ke=Pr;Pr.default=Pr;let Rr=i;class Tr extends Rr{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}We=Tr;Tr.default=Tr,Rr.registerAtRule(Tr);let Ir=i,Br,Nr;class jr extends Ir{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){e=super.normalize(e);if(t)if("prepend"===r)1{Br=e},jr.registerProcessor=e=>{Nr=e};n=jr;jr.default=jr,Ir.registerRoot(jr);let Dr={comma(e){return Dr.split(e,[","],!0)},space(e){return Dr.split(e,[" ","\n","\t"])},split(e,t,u){let r=[],n="",s=!1,i=0,o=!1,a="",l=!1;for(var c of e)l?l=!1:"\\"===c?l=!0:o?c===a&&(o=!1):'"'===c||"'"===c?(o=!0,a=c):"("===c?i+=1:")"===c?0"space"!==e[0]&&"comment"!==e[0])&&(s.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(s,"value",a.concat(e),t),s.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new Jr;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){var t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1;var r;let n=!1,s=null,i=[];var o=e[1].startsWith("--");let a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)s=s||l,i.push("("===r?")":"]");else if(o&&n&&"{"===r)s=s||l,i.push("}");else if(0===i.length){if(";"===r){if(n)return void this.decl(a,o);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===i[i.length-1]&&(i.pop(),0===i.length&&(s=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),0e+t[1],""),e.raws[t]={raw:o,value:l}),e[t]=l}rule(e){e.pop();let t=new Jr;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){var t;let r="";for(;e.length&&("space"===(t=e[e.length-1][0])||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){var t;let r="";for(;e.length&&("space"===(t=e[0][0])||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t="";for(;e.length&&"space"===e[e.length-1][0];)t=e.pop()[1]+t;return t}stringFrom(t,r){let n="";for(let e=r;evn(e)),e}let wn={};class bn{constructor(e,t,r){this.stringified=!1,this.processed=!1;let n;if("object"!=typeof t||null===t||"root"!==t.type&&"document"!==t.type)if(t instanceof bn||t instanceof ln)n=vn(t.root),t.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=t.map);else{let e=cn;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{n=e(t,r)}catch(e){this.processed=!0,this.error=e}n&&!n[tn]&&sn.rebuild(n)}else n=vn(t);this.result=new ln(e,n,r),this.helpers={...wn,postcss:wn,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){var r=this.result.lastPlugin;try{if(t&&t.addToError(e),"CssSyntaxError"!==(this.error=e).name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){var n=r.postcssPlugin;let e=r.postcssVersion,t=this.result.processor.version;var s=e.split("."),i=t.split(".");(s[0]!==i[0]||parseInt(s[1])>parseInt(i[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+t+", but "+n+" uses "+e+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};var e,t=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(e of this.plugins)if("object"==typeof e)for(var r in e){if(!pn[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${e.postcssPlugin}. `+`Try to update PostCSS (${this.processor.version} now).`);if(!dn[r])if("object"==typeof e[r])for(var n in e[r])"*"===n?t(e,r,e[r][n]):t(e,r+"-"+n.toLowerCase(),e[r][n]);else"function"==typeof e[r]&&t(e,r,e[r])}this.hasListener=0t(e,this.helpers)),await Promise.all(i)):await t(r,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{var e;if("object"==typeof t&&t.Once)return"document"===this.result.root.type?mn((e=this.result.root.nodes.map(e=>t.Once(e,this.helpers)))[0])?Promise.all(e):e:t.Once(this.result.root,this.helpers);if("function"==typeof t)return t(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();var e=this.result.opts;let t=nn,r=(e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify),new rn(t,this.result.root,this.result.opts));e=r.generate();return this.result.css=e[0],this.result.map=e[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(var e of this.plugins)if(mn(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[en];)e[en]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(var t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||an("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(var[r,n]of e){this.result.lastPlugin=r;let e;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(mn(e))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:s}=r;if("root"===n.type||"document"===n.type||n.parent){if(0{e[en]||this.walkSync(e)});else{var r=this.listeners[t];if(r&&this.visitSync(r,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}bn.registerPostcss=e=>{wn=e};Me=bn;bn.default=bn,un.registerLazyResult(bn),on.registerLazyResult(bn);let _n=ft,Cn=Ne,Sn=Lr,xn=Qr;const An=Ke;class kn{constructor(e,t,r){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;var e=Cn;this.result=new An(this._processor,void 0,this._opts),this.result.css=t;let n=this,s=(Object.defineProperty(this.result,"root",{get(){return n.root}}),new _n(e,void 0,this._opts,t));s.isMap()?([r,e]=s.generate(),r&&(this.result.css=r),e&&(this.result.map=e)):(s.clearAnnotation(),this.result.css=s.css)}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||Sn("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=xn;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}}ft=kn;kn.default=kn;let En=ft,Ln=Me,On=e,Mn=n;class Pn{constructor(e=[]){this.version="8.4.35",this.plugins=this.normalize(e)}normalize(e){let t=[];for(var r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return new(this.plugins.length||t.parser||t.stringifier||t.syntax?Ln:En)(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}ft=Pn;Pn.default=Pn,Mn.registerProcessor(Pn),On.registerProcessor(Pn);let Rn=He,Tn=qe,In=Ct,Bn=We,Nn=Je,jn=n,Dn=ot;function Un(e,r){if(Array.isArray(e))return e.map(e=>Un(e));let{inputs:t,...n}=e;if(t){r=[];for(var s of t){let e={...s,__proto__:Nn.prototype};e.map&&(e.map={...e.map,__proto__:Tn.prototype}),r.push(e)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>Un(e,r))),n.source){let{inputId:e,...t}=n.source;n.source=t,null!=e&&(n.source.input=r[e])}if("root"===n.type)return new jn(n);if("decl"===n.type)return new Rn(n);if("rule"===n.type)return new Dn(n);if("comment"===n.type)return new In(n);if("atrule"===n.type)return new Bn(n);throw new Error("Unknown node type: "+e.type)}qe=Un,Un.default=Un;let Fn=He,zn=Me;He=i;let $n=ft;Me=Ne,i=qe;let Gn=e;ft=St;let Hn=Ct,Vn=We;Ne=Ke,qe=Je,e=Qr,St=s;let Wn=ot,Jn=n;Ct=Te;function o(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new $n(e)}o.plugin=function(r,n){let s=!1;function i(...e){console&&console.warn&&!s&&(s=!0,console.warn(r+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(r+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let t=n(...e);return t.postcssPlugin=r,t.postcssVersion=(new $n).version,t}let e;return Object.defineProperty(i,"postcss",{get(){return e=e||i(),e}}),i.process=function(e,t,r){return o([i(r)]).process(e,t)},i},o.stringify=Me,o.parse=e,o.fromJSON=i,o.list=St,o.comment=e=>new Hn(e),o.atRule=e=>new Vn(e),o.decl=e=>new Fn(e),o.rule=e=>new Wn(e),o.root=e=>new Jn(e),o.document=e=>new Gn(e),o.CssSyntaxError=t,o.Declaration=Fn,o.Container=He,o.Processor=$n,o.Document=Gn,o.Comment=Hn,o.Warning=ft,o.AtRule=Vn,o.Result=Ne,o.Input=qe,o.Rule=Wn,o.Root=Jn,o.Node=Ct,zn.registerPostcss(o);o.default=o;class qn extends HTMLElement{base;contents;component;listType="ul";iconSet;filter={value:"",caseSensitive:!1};static get observedAttributes(){return["contents","icon-set","max-depth","filter"]}_jsonToValueArray(e){let t=JSON.stringify(e);t=t.replace(/[\[\]{}\"]/g,"");let r=[];for(const n of t.split(","))r=r.concat(n.split(":"));return[...new Set(r)]}_emit(e,t,r){e=new CustomEvent(e,{detail:r,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}constructor(){super(),this.base=new $,this.setContents(this.getAttribute("contents")),this.iconSet=this.getAttribute("icon-set")?this.getAttribute("icon-type"):"file",this.maxDepth=this.getAttribute("max-depth")?parseInt(this.getAttribute("max-depth")):-1,this.setFilter(this.getAttribute("filter")),this.style.display="block",this.style.maxWidth="fit-content",this.style.margin="0 1rem 0 0",this.base.addEvent(".flk-branch","click",this.emitNodeToggle)}emitNodeToggle(e){e.stopPropagation();const t=F(e,"flk-tree-nav").target,r=z(e,"branchKey");let n=t.contents;const s=r.split(".");for(const o of s)if(n[o])n=n[o];else if(null===n[o])n=null;else{let e=[];for(const a of n)a[o]&&e.push(a[o]);n=e}var e=r.substring(r.indexOf(".")+1),i=t.createLeafText(s.reverse()[0]);t._emit("tree-click",t,{path:e,data:n,key:(i.titleText+" "+i.commentText).trim(),branch:"object"==typeof n})}convertJsonKeyToTitle(e){if(!e)return"";const t=(e="string"!=typeof e?e.toString():e).replace(/([A-Z_])/g,e=>"_"===e?" ":" "+e).trim();return t.charAt(0).toUpperCase()+t.slice(1)}setContents(e){var t=e||this.contents||[];try{switch(typeof t){case"string":this.contents=JSON.parse(t);break;case"object":Array.isArray(t)?this.contents=t:this.contents=[t]}}catch(e){console.log(e)}}applyFilter(e){let t;var r="details"===e.tagName.toLowerCase();t=this.filter.caseSensitive?e.dataset.branchValues.includes(this.filter.value):e.dataset.branchValues.toLowerCase().includes(this.filter.value.toLowerCase()),t?e.parentElement.classList.remove("hidden"):e.parentElement.classList.add("hidden"),r&&t?e.setAttribute("open",""):e.removeAttribute("open")}resetTree(e){e.parentElement.classList.remove("hidden"),e.removeAttribute("open")}filterTree(){let t=setTimeout(()=>{for(const e of this.querySelectorAll("[data-branch-values]"))void 0===this.filter.value||0===this.filter.value.length?this.resetTree(e):this.applyFilter(e);clearTimeout(t)},10)}setFilter(e){const t=e||{};try{switch(typeof t){case"string":t.includes("{")?(this.filter=JSON.parse(t),!1===this.filter.caseSensitive&&(this.filter.value=this.filter.value.toLowerCase())):this.filter.value=e.toLowerCase();break;case"object":this.filter=t}}catch(e){console.log(e)}this.filterTree()}createLeafText(e){var t,r;let n="",s="";return"string"==typeof e&&(e.includes("(")||e.includes("["))?(r=e.indexOf("("),r=-1===(t=e.indexOf("["))?r:t,n=this.convertJsonKeyToTitle(e.substring(0,r)),s=e.substring(r)):n=this.convertJsonKeyToTitle(e),{titleText:n,commentText:s}}createTextTag(n,s){n=this.createLeafText(n);if(n.commentText){let e=document.createElement("div"),t=document.createElement("span"),r=(t.innerText=n.titleText,document.createElement("small"));r.innerText=n.commentText,r.style.marginLeft="1rem",e.append(t,r),e.style.display="inline-flex",e.style.alignItems="center",s.append(e)}else s.innerText=n.titleText}createLeaf(e,t,r,n=[]){let s=document.createElement("li");s.classList.add("cursor-no-select"),s.style.marginTop="0.4rem",s.dataset.branchKey=r;const i="file"===this.iconSet?'':'';s.style.listStyleImage=`url('data:image/svg+xml,${i}')`,s.style.position="relative",s.style.left="2px";let o=document.createElement("span");r=[e].concat(n);if(o.dataset.branchValues=[...new Set(r)].join(),n.length&&(o.dataset.leafKey=r[0]),this.createTextTag(e,o),o.style.position="relative",o.style.top="-3px",s.append(o),t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);const i="file"===this.iconSet?G:H;e.style.listStyleImage=`url('data:image/svg+xml,${i}')`,e.append(s),t.append(e)}else t.append(s)}createBranch(r,t,n,s){if(s===this.maxDepth&&"object"==typeof r)for(const o of Array.isArray(r)?r:Object.keys(r)){let e;r[o]&&(e=this._jsonToValueArray(r[o])),this.createLeaf(o,t,n+"."+o,e)}else if(Array.isArray(r))for(var e in r){var u=document.createElement(this.listType);t.append(this.createBranch(r[e],u,n+"."+e,s+1))}else if(null!==r&&"object"==typeof r){const a=[];for(const l of Object.keys(r)){let e=document.createElement("li"),t=(e.classList.add("cursor-no-select"),e.style.position="relative",e.style.left="2px",e.dataset.branchKey=n+"."+l,document.createElement("details"));t.classList.add("flk-branch"),t.dataset.branchValues=[l].concat(this._jsonToValueArray(r[l])),t.style.position="relative",t.style.top="-3px",t.classList.add("cursor-default");var i=document.createElement("summary");this.createTextTag(l,i),t.append(i),e.append(this.createBranch(r[l],t,n+"."+l,s+1)),a.push(e)}if(t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);var h="file"===this.iconSet?G:H;e.style.listStyleImage=`url('data:image/svg+xml,${h}')`;for(const c of a)e.append(c);t.append(e)}else for(const p of a)t.append(p)}else this.createLeaf(r,t,n);return t}createHtml(){let e=document.createElement(this.listType);var t="file"===this.iconSet?G:'';if(e.style.listStyleImage=`url('data:image/svg+xml,${t}')`,e.style.marginLeft="3rem",this.contents.length){for(const r in this.contents)e=this.createBranch(this.contents[r],e,r,0);this.component=e}else this.component=e}attributeChangedCallback(e,t,r){switch(e){case"contents":this.setContents(r);break;case"icon-set":this.iconSet=r;break;case"max-depth":this.maxDepth="string"==typeof r?parseInt(r):r;break;case"filter":this.setFilter(r)}this.init()}connectedCallback(){this.init()}disconnectedCallback(){this.base.removeEvents(this)}init(){this.createHtml(),this.base.render(this)}}customElements.define("flk-table",W),customElements.define("flk-draggable",J),customElements.define("flk-modal",q),customElements.define("flk-dropdown",K),customElements.define("flk-tree-nav",qn)}(require$$0,require$$2,require$$1$1,require$$1); \ No newline at end of file diff --git a/documentation/public/js/flightkit.min.js b/documentation/public/js/flightkit.min.js index a5a8ef8..9a82b7a 100644 --- a/documentation/public/js/flightkit.min.js +++ b/documentation/public/js/flightkit.min.js @@ -1 +1 @@ -!function(e,n,s,i){"use strict";function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a,u,g,e=c(e),n=c(n),s=c(s),i=c(i);(t=a=a||{}).Date="date",t.String="string",t.Float="float",t.Number="number",t.Array="array",t.Object="object",t.Bool="bool",t.Currency="currency",t.Undefined="undefined",t.Null="null";const h={date:/^(\d{1,4}-\d{1,4}-\d{1,4}(T)?)/gim,currency:/^[$|€]\s?[0-9]*(\.|,)?\d*(\.|,)?\d*/gim,float:/\d+[,|.]\d+[,|.]?\d*/gim,currencySign:/\$|€/gim,array:/^\s?[[].[^,]+[\]],?/gi,precision:/[-+$€,.]/gm,string:/[a-zA-Z]/gim},m=e=>{return null===e||"null"===e?a.Null:e||0===e||!1===e?null===new RegExp(h.date).exec(e)||isNaN(Date.parse(e))?new RegExp(h.currency).exec(e)?a.Currency:!new RegExp(h.string).exec(e)&&new RegExp(h.float).exec(e.toString())?a.Float:isNaN(e)&&0!==e?Array.isArray(e)?a.Array:"object"==typeof e?a.Object:a.String:a.Number:a.Date:a.Undefined},y=(t,e)=>{const r={value:void 0,type:e=e||m(t),currencySign:""};switch(r.type){case a.String:r.value=t.toString();break;case a.Float:case a.Currency:var n=(t=t.toString()).match(new RegExp(/(,)/gim)),s=t.match(new RegExp(/(\.)/gim));if(n)for(let e=1;e<=n.length;e++)t=e!==n.length||s?t.replace(",",""):t.replace(",",".");if(r.type===a.Currency){const o=new RegExp(h.currencySign);var i=o.exec(t);r.currencySign=null!==i?i[0]:"",t=t.replace(o,"")}r.value=parseFloat(t).toPrecision(12);break;case a.Number:r.value=Number(t);break;case a.Date:r.value=Date.parse(t);break;case a.Array:t.length?"object"==typeof t[0]?r.value=t.map(e=>JSON.stringify(e)).join(", "):r.value=t.join(", "):r.value="";break;case a.Object:r.value=t;break;case a.Undefined:r.value="";break;case a.Null:r.value=null}return r};function v(e,t){var r;let n;for(r of e.split("."))r=r.trim(),n?"object"!=typeof n||Array.isArray(n)||(n=n[r]):n=t[r];return n}const b=(e,t)=>tet<=e,S=(e,t)=>e<=t,x=(e,t,r)=>r?e.toLowerCase()==t.toLowerCase():e==t,A=(e,t)=>e===t,k=(e,t)=>e!=t,E=(e,t)=>e!==t,L=(e,t)=>null!=t&&"string"==typeof e&&0<=e.toLowerCase().indexOf(t.toString().toLowerCase()),O=(e,t)=>null!=t&&0<=e.toString().toLowerCase().indexOf(t.toString().toLowerCase()),M=(e,t)=>null!=t&&"string"==typeof e&&e.toLowerCase().indexOf(t.toString().toLowerCase())<0;function P(r,n){if(0===n.length)return r;{var s=r;const o=[],a=[];let e=[];for(const l of n)l.type&&l.type!==u.And?(e.length&&a.push(e),e=[l]):e.push(l);a.push(e);let t=[];for(const e of a)t=t.concat(R(s,e));t=[...new Set(t)];var i=s.length;for(let e=0;e":return b;case"<":return _;case">=":return C;case"<=":return S;case"is":case"==":return x;case"!is":case"!=":return k;case"===":return A;case"!==":return E;case"like":case"~":case"contains":return L;case"!contains":case"!like":case"!~":return M;default:return O}}(a.operator);if(!l(i,o,a.ignoreCase)){e=!1;break}}e&&r.push(n)}return r};function T(e,t){if(!t||0===t.length)return e;if(1{if(0===r.length)r=r.concat(I(s,e));else{for(const t of r)n=n.concat(I(t,e));r=n,n=[]}}),r}return I(e,t[0])}function I(e,t){const r=[],n=[];do{if(!e||0===e.length)break;var s=e.shift();if(!s)break;const o=s[t];var i=n.indexOf(o.toString());0<=i?r[i].push(s):(n.push(o.toString()),void 0!==r[n.length-1]?r[n.length-1].push(s):r.push([s]))}while(0{if(t){var r=e;const n={};for(const s of t){let e=r.map(e=>e[s].toString());const i=e.map(e=>m(e));i.some(e=>e===a.Float)?(e=e.map(e=>parseFloat(e)),n[s]=parseFloat(e.reduce((e,t)=>e+t).toFixed(2))):(e=e.map(e=>parseInt(e)),n[s]=e.reduce((e,t)=>e+t))}return n}return{}};class D{model;sortDetails=[];filterDetails=[];selection=[];groupByProperties=[];distinctProperties=[];concatenationToken=", ";constructor(e){this.model=JSON.parse(JSON.stringify(e))}sort(e){return this.sortDetails=e,this}orderBy(e,t){return this.sortDetails.push({propertyName:e,direction:t}),this}thenOrderBy(e,t){return this.orderBy(e,t)}filter(e){return Array.isArray(e)?this.filterDetails=e:this.filterDetails.push(e),this}where(e,t,r,n,s){return this.filterDetails.push({propertyName:e,operator:t,value:r,type:n,ignoreCase:s}),this}andWhere(e,t,r,n){return this.where(e,t,r,u.And,n),this}orWhere(e,t,r,n){return this.where(e,t,r,u.Or,n),this}group(e){return this.groupByProperties=e,this}groupBy(e){return this.groupByProperties.push(e),this}thenGroupBy(e){return this.groupByProperties.push(e),this}select(e){return Array.isArray(e)?this.selection=e:"*"!==e&&(this.selection=[e]),this}distinct(e,t){return t&&(this.concatenationToken=t),Array.isArray(e)?this.distinctProperties=e:e&&(this.distinctProperties=[e]),this}execute(){return T(function(t,r){if(0===r.length)return t;{var n=r;let e=[];for(const s of t){const i={};for(const o of n)i[o]=s[o];e.push(i)}return e}}(function(r,n,u){if(!n||!n.length)return r;const s=[],h=[];for(const f of r){const o={};let t="";for(const e of n){var p=v(e,f);o[e]=p,t+=p}if(!h.includes(t)){let e=r;for(const a of Object.keys(o))e=e.filter(e=>e[a]===o[a]);h.push(t),s.push(e)}}const t=[];for(const m of s){let e={};for(const l of m){var i,d=Object.keys(e);if(d.length)for(const c of d)n.includes(c)||(i=e[c],Array.isArray(i)?(i=l[c],Array.isArray(i)?e[c]=[...new Set(...e[c].concat(l[c]))]:e[c].includes(l[c])||e[c].push(l[c])):isNaN(e[c])&&isNaN(l[c])?e[c]!==l[c]&&(e[c]=[e[c],l[c]]):e[c]=e[c]+l[c]);else e=l}t.push(e)}return t.forEach(e=>{for(const t in e)Array.isArray(e[t])&&(e[t]=e[t].join(u))}),t}(B(P(JSON.parse(JSON.stringify(this.model)),this.filterDetails),this.sortDetails),this.distinctProperties,this.concatenationToken),this.selection),this.groupByProperties)}sum(e,t){e=Array.isArray(e)?e:[e];return j(t||this.model,e)}}function U(e,t){t=t?t.toUpperCase():"FLK-";return e.toUpperCase().includes(t)}function F(e,t){var{timeStamp:r,type:n,x:s,y:i}=e;let o=e.target;do{if(!o||"HTML"===o.tagName||U(o.tagName,t)){"HTML"===o.tagName&&(o=null);break}}while(o=o.parentNode||o.parentElement,!U(o.tagName,t));return{target:o,timeStamp:r,type:n,x:s,y:i}}function z(e,t){let r=e.target,n="";for(;r.dataset[t]?n=r.dataset[t]:r=r.parentNode,!n;);return n}class ${constructor(){}_topLevelClasses=[];_events=[];generateId(){return"flk-"+function e(){const t=([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)),r=t.split("-")[0];return window.$flightkitUUIDStore||(window.$flightkitUUIDStore=[]),window.$flightkitUUIDStore.some(e=>e===r)?e():(window.$flightkitUUIDStore.push(r),r)}()}render(t){if(!t.component)throw new Error("Component is not assigned! Can't render");t.id=t.id||this.generateId();var e=this._getAllEventAttributes(t);if(e){var r="#"+t.id;for(const i of e){var n="e-"+i;this.addEvent(r,i,t.getAttribute(n))}}var s=Object.keys(t.classList).length;if(s){for(let e=0;e{this._assignToDom(t,t.component),clearTimeout(this._renderTimer)},10)}addEvent(e,t,r){this._events.push({selector:e,eventType:t,callback:r})}_getExternalCallback(e){let t=void 0;for(const r of e.split("."))t=(t||window)[r];return t}_getAllEventAttributes(e){e=e.attributes;const t=Array.from(e).filter(e=>e.name.startsWith("e-"));return t.map(e=>e.name.slice(2))}_isFlightkitElement(e){return e.toUpperCase().includes("FLK-")}_outerEventHandler(e){const t=F(e),r=(t.contents=e.detail,t.target.getAttribute("e-"+t.type));let n=void 0;for(const s of r.split("."))n=(n||window)[s];return e.preventDefault(),e.stopPropagation(),n(t)}_addEvents(e){if(e.isConnected)for(const r of this._events)if(r.selector.startsWith("."))for(const n of document.querySelectorAll(r.selector))this._addEventToElement(r,n);else{var t=document.querySelector(r.selector);this._addEventToElement(r,t)}}_addEventToElement(e,t){t&&("function"==typeof e.callback?(t.removeEventListener(e.eventType,e.callback),t.addEventListener(e.eventType,e.callback)):(t.removeEventListener(e.eventType,this._outerEventHandler),t.addEventListener(e.eventType,this._outerEventHandler)))}removeEvents(){for(const t of this._events)if(t.selector.startsWith("."))for(const r of document.querySelectorAll(t.selector))this._addEventToElement(t,r);else{var e=document.querySelector(t.selector);this._addEventToElement(t,e)}this._events=[]}_removeEventToElement(e,t){t&&("function"==typeof e.callback?t.removeEventListener(e.eventType,e.callback):t.removeEventListener(e.eventType,this._outerEventHandler))}_assignToDom(e,t){e.innerHTML="";for(const n of Array.isArray(t)?t:[t])e.append(n);const r=setTimeout(()=>{this._addEvents(e),clearTimeout(r)},10)}}const G='',H='';function V(e){const t=new DOMParser;return t.parseFromString(e,"image/svg+xml").documentElement}class W extends HTMLElement{base;component=null;_contents=[];_orderBy=[];properties=new Set;_columnOrder=[];_filter="";_selectionProperty="";_selectedIds=new Set;uniqueEntriesByProperties={};propertyLabelDictionary={};_templates={};_templateClasses={};static get observedAttributes(){return["contents","columns","order","filter","selection-property","templates"]}get columnOrder(){return this._columnOrder.length?this._columnOrder:this.properties}set columnOrder(e){let t;"string"==typeof e&&(t=e.split(",")),t=e,this._columnOrder=t}get contents(){return this._contents}set contents(e){this.analyzeData(e),this._contents=new D(e)}get orderBy(){return this._orderBy}set orderBy(e){if(Array.isArray(e))this._orderBy=e;else{const n=[];for(const s of e.split(",")){var t=s.split("|"),r=t[0],t=1e[r._selectionProperty])):new Set;e=t?r.contents.execute():[];r._emit("select",r,{selection:e}),r._updateCheckboxes(r)}emitSelect(e){var t=e.target.checked,r=e.target.dataset.objectId;const n=F(e).target,s=(t?n._selectedIds.add(r):n._selectedIds.delete(r),n._selectionProperty);e=n.contents.execute().filter(e=>n._selectedIds.has(e[s]));n._emit("select",n,{selection:e}),n._updateCheckboxes(n)}sortData(e){const t=F(e).target,r=z(e,"column");r&&(-1<(e=t._orderBy.findIndex(e=>e.propertyName===r))?"asc"===t._orderBy[e].direction?t._orderBy[e].direction="desc":t._orderBy.splice(e,1):t._orderBy.push({propertyName:r,direction:"asc"}),t.createHtml(),t.base.render(t))}setColumnOrder(e){this._columnOrder=e?Array.isArray(e)?e:e.split(","):[]}analyzeData(t){this.properties=new Set;var r=t.length;for(let e=0;e"_"===e?" ":" "+e.toLowerCase()).trim();var r=t.charAt(0).toUpperCase()+t.slice(1);return this.propertyLabelDictionary[e]=r}parseTemplate(e,n){return e.replace(/\{\{([\s\S]+?)\}\}/gim,(e,t)=>{let r="";t=t.trim();t=n[t];return t&&(r=t),Array.isArray(r)?r.join(", "):r.toString().trim()})}createSelectionCheckbox(e){const t=document.createElement("input");return t.setAttribute("type","checkbox"),t.classList.add("flk-selection-checkbox"),e&&(t.dataset.selected=e[this._selectionProperty]),t}createRow(e){const t=document.createElement("tr");if(this._selectionProperty.length){const s=document.createElement("td");var r=this.base.generateId();const i=this.createSelectionCheckbox(e);i.id=r,i.dataset.objectId=e[this._selectionProperty];var n=e[this._selectionProperty];this._selectedIds.has(n)?i.checked=!0:i.checked=!1,this.base.addEvent("#"+r,"change",this.emitSelect),s.append(i),t.append(s)}for(const o of this.columnOrder){const a=document.createElement("td");this._templates[o]?(a.innerHTML=this.parseTemplate(this._templates[o],e),this._templateClasses[o]&&a.classList.add(...this._templateClasses[o])):a.innerText=e[o],t.append(a)}return t}createBody(e){const t=document.createElement("tbody");for(const n of e){var r=this.createRow(n,null);t.append(r)}return t}createHead(){const e=document.createElement("thead"),t=document.createElement("tr");if(t.classList.add("cursor-pointer"),this._selectionProperty.length){const s=document.createElement("th");var r=this.base.generateId();const i=this.createSelectionCheckbox();i.id=r;var u=this.contents.execute().length;0e.propertyName===o);if(n){const c=document.createElement("span");c.innerHTML="asc"===n.direction?'':'',a.append(c)}t.append(a)}return e.append(t),e}addEvent(e,t,r){this.base.addEvent(e,t,r)}init(){this.createHtml(),this.base.render(this)}}class J extends HTMLElement{base;componentId;constructor(){super(),this.base=new $}connectedCallback(){var e=this.getAttribute("top"),t=this.getAttribute("left"),r=this.getAttribute("center"),n=this.getAttribute("zIndex");this.id||(this.id=this.base.generateId()),this.style.display="block",this.style.position="fixed","string"==typeof r?(this.style.top=e||"50%",this.style.left="50%",this.style.transform="translate(-50%, -50%)"):(this.style.top=e||this.clientTop+"px",this.style.left=t||this.clientLeft+"px"),n&&(this.style.zIndex=n),this.componentId=this.getAttribute("handle");const s=document.createElement("div");s.innerHTML=this.innerHTML,this.component=s;r="#"+(this.componentId||this.id);this.base.addEvent(r,"mousedown",this._dragElement),this.base.addEvent(r,"mouseup",this._reset),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this)}_dragElement(e){const r=F(e,"flk-draggable").target;let n,s;function t(e){n=e.clientX-r.offsetLeft,s=e.clientY-r.offsetTop}function i(e){var t=e.clientX-n,e=e.clientY-s;r.style.left=t+"px",r.style.top=e+"px"}function o(e){e.preventDefault()}function a(){r.removeAttribute("draggable"),r.removeEventListener("dragstart",t),r.removeEventListener("dragend",a),document.removeEventListener("dragover",o),document.removeEventListener("drop",i)}r.setAttribute("draggable",!0),r.addEventListener("dragstart",t),r.addEventListener("dragend",a),document.addEventListener("dragover",o),document.addEventListener("drop",i)}}class q extends HTMLElement{_id;base;_draggableId;constructor(){super(),this.base=new $}_emit(e,t,r){e=new CustomEvent(e,{detail:r,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}_closeModal(e){e.stopPropagation();const t=F(e,"flk-modal").target;t.classList.add("hidden")}closeModal(e){this.classList.add("hidden")}openModal(e=!0){const t=document.getElementById(this._draggableId);e&&(t.style.top="40%",t.style.left="50%"),this.classList.remove("hidden")}connectedCallback(){this.id||(this.id=this.base.generateId());const e=document.createElement("div");var t=this.base.generateId();const r=document.createElement("flk-draggable"),n=(this._draggableId=this.base.generateId(),r.id=this._draggableId,r.setAttribute("center",""),r.setAttribute("top","40%"),r.setAttribute("handle",t),r.setAttribute("zIndex","1080"),r.classList.add("border","shadow-lg","bg-white"),r.style.width="max-content",document.createElement("div"));var s=this.getAttribute("modal-title");if(s){const c=document.createElement("span");c.innerText=s,c.classList.add("ml-1","mr-auto"),n.append(c)}n.id=t;const i=this.getAttribute("header-class");let o=[];i?o=o.concat(i.split(" ")):o.push("bg-gray-light"),n.classList.add(...o,"border-bottom","row","justify-end","cursor-no-select");s=this.base.generateId();const a=document.createElement("button"),l=(a.classList.add("py-0","px-1","outline-hover","no-border","cursor-default",...o),a.innerText="X",a.id=s,n.append(a),r.append(n),document.createElement("div"));l.innerHTML=this.innerHTML,r.append(l),e.append(r),this.component=e,this.base.addEvent("#"+s,"click",this._closeModal),this.base.render(this),this.classList.add("hidden")}disconnectedCallback(){this.base.removeEvents(this)}}class K extends HTMLElement{base;_buttonId;_drawerId;_iconId;constructor(){super(),this.base=new $}connectedCallback(){this.style.position="relative",this.style.display="flex",this.style.width="fit-content",this._buttonId=this.base.generateId();const e=document.createElement("button"),t=(e.classList.add("row"),e.id=this._buttonId,document.createElement("span")),r=(t.innerText=this.getAttribute("text"),this._iconId=this.base.generateId(),document.createElement("span"));var n=V('');const s=V(''),i=(s.classList.add("hidden"),r.append(n,s),r.id=this._iconId,e.append(t,r),this._drawerId=this.base.generateId(),document.createElement("div"));i.id=this._drawerId,i.classList.add("shadow","inline-block","bg-white"),i.style.position="absolute",i.style.zIndex="1040";n=this.querySelector("template");n.innerHTML.length?i.innerHTML=n.innerHTML:i.append(n.firstChild),i.style.display="none",this.component=[e,i],this.base.addEvent("#"+this._buttonId,"click",this.toggleMenu);const o=document.querySelector("body");""!==o.getAttribute("flk-close-dropdown")&&(o.setAttribute("flk-close-dropdown",""),o.addEventListener("click",this.closeAllDropdownButtons)),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this);var e=document.querySelectorAll("flk-dropdown");if(!e||!e.length){const t=document.querySelector("body");t.removeAttribute("flk-close-dropdown"),t.removeEventListener("click",this.closeAllDropdownButtons)}}toggleMenu(e){const t=F(e).target;e=t._drawerId;const r=document.getElementById(e);var e="none"!==r.style.display,n=(r.style.display=e?"none":"block",t.getAttribute("drawer-width")),n=("string"==typeof t.getAttribute("right")&&(r.style.right="0px"),r.style.top=t.offsetHeight+"px",r.style.width=n||t.offsetWidth+"px",t._iconId);const s=document.getElementById(n);e?(s.childNodes[0].classList.remove("hidden"),s.childNodes[1].classList.add("hidden")):(s.childNodes[0].classList.add("hidden"),s.childNodes[1].classList.remove("hidden"))}_closeDropdown(){var e=this._drawerId;const t=document.getElementById(e);if("none"!==t.style.display){e=this._iconId;const r=document.getElementById(e);t.style.display="none",r.childNodes[0].classList.remove("hidden"),r.childNodes[1].classList.add("hidden")}}closeAllDropdownButtons(e){var t,r=F(e,"flk-dropdown").target,e=document.querySelectorAll("flk-dropdown");if(r)for(const n of e)r._buttonId!==n._buttonId&&(t=n._drawerId,"none"!==document.getElementById(t).style.display&&n._closeDropdown());else for(const s of e)s._closeDropdown()}}var t={exports:{}};let Z=e.default,Y=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||"win32"===process.platform||Z.isatty(1)&&"dumb"!==process.env.TERM||"CI"in process.env),r=(r,n,s=r)=>e=>{let t=""+e;e=t.indexOf(n,r.length);return~e?r+X(t,n,s,e)+n:r+t+n},X=(e,t,r,n)=>{var s=e.substring(0,n)+r;let i=e.substring(n+t.length);e=i.indexOf(t);return~e?s+X(i,t,r,e):s+i};e=(e=Y)=>({isColorSupported:e,reset:e?e=>`${e}`:String,bold:e?r("","",""):String,dim:e?r("","",""):String,italic:e?r("",""):String,underline:e?r("",""):String,inverse:e?r("",""):String,hidden:e?r("",""):String,strikethrough:e?r("",""):String,black:e?r("",""):String,red:e?r("",""):String,green:e?r("",""):String,yellow:e?r("",""):String,blue:e?r("",""):String,magenta:e?r("",""):String,cyan:e?r("",""):String,white:e?r("",""):String,gray:e?r("",""):String,bgBlack:e?r("",""):String,bgRed:e?r("",""):String,bgGreen:e?r("",""):String,bgYellow:e?r("",""):String,bgBlue:e?r("",""):String,bgMagenta:e?r("",""):String,bgCyan:e?r("",""):String,bgWhite:e?r("",""):String});t.exports=e(),t.exports.createColors=e;const Q="'".charCodeAt(0),ee='"'.charCodeAt(0),te="\\".charCodeAt(0),re="/".charCodeAt(0),ne="\n".charCodeAt(0),se=" ".charCodeAt(0),ie="\f".charCodeAt(0),oe="\t".charCodeAt(0),ae="\r".charCodeAt(0),le="[".charCodeAt(0),ce="]".charCodeAt(0),ue="(".charCodeAt(0),he=")".charCodeAt(0),pe="{".charCodeAt(0),de="}".charCodeAt(0),fe=";".charCodeAt(0),me="*".charCodeAt(0),ge=":".charCodeAt(0),ye="@".charCodeAt(0),ve=/[\t\n\f\r "#'()/;[\\\]{}]/g,we=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,be=/.[\r\n"'(/\\]/,_e=/[\da-f]/i;function Ce(t,e={}){let n=t.css.valueOf(),d=e.ignoreErrors,s,i,f,m,o,a,l,g,c,u,y=n.length,h=0,v=[],p=[];function w(e){throw t.error("Unclosed "+e,h)}return{back:function(e){p.push(e)},endOfFile:function(){return 0===p.length&&h>=y},nextToken:function(e){if(p.length)return p.pop();if(!(h>=y)){var t=!!e&&e.ignoreUnclosed;switch(s=n.charCodeAt(h),s){case ne:case se:case oe:case ae:case ie:for(i=h;i+=1,s=n.charCodeAt(i),s===se||s===ne||s===oe||s===ae||s===ie;);u=["space",n.slice(h,i)],h=i-1;break;case le:case ce:case pe:case de:case ge:case fe:case he:var r=String.fromCharCode(s);u=[r,r,h];break;case ue:if(g=v.length?v.pop()[1]:"",c=n.charCodeAt(h+1),"url"===g&&c!==Q&&c!==ee&&c!==se&&c!==ne&&c!==oe&&c!==ie&&c!==ae){i=h;do{if(a=!1,i=n.indexOf(")",i+1),-1===i){if(d||t){i=h;break}w("bracket")}for(l=i;n.charCodeAt(l-1)===te;)--l,a=!a}while(a);u=["brackets",n.slice(h,i+1),h,i],h=i}else i=n.indexOf(")",h+1),m=n.slice(h,i+1),-1===i||be.test(m)?u=["(","(",h]:(u=["brackets",m,h,i],h=i);break;case Q:case ee:f=s===Q?"'":'"',i=h;do{if(a=!1,i=n.indexOf(f,i+1),-1===i){if(d||t){i=h+1;break}w("string")}for(l=i;n.charCodeAt(l-1)===te;)--l,a=!a}while(a);u=["string",n.slice(h,i+1),h,i],h=i;break;case ye:ve.lastIndex=h+1,ve.test(n),i=0===ve.lastIndex?n.length-1:ve.lastIndex-2,u=["at-word",n.slice(h,i+1),h,i],h=i;break;case te:for(i=h,o=!0;n.charCodeAt(i+1)===te;)i+=1,o=!o;if(s=n.charCodeAt(i+1),o&&s!==re&&s!==se&&s!==ne&&s!==oe&&s!==ae&&s!==ie&&(i+=1,_e.test(n.charAt(i)))){for(;_e.test(n.charAt(i+1));)i+=1;n.charCodeAt(i+1)===se&&(i+=1)}u=["word",n.slice(h,i+1),h,i],h=i;break;default:h=(s===re&&n.charCodeAt(h+1)===me?(i=n.indexOf("*/",h+2)+1,0===i&&(d||t?i=n.length:w("comment")),u=["comment",n.slice(h,i+1),h,i]):(we.lastIndex=h+1,we.test(n),i=0===we.lastIndex?n.length-1:we.lastIndex-2,u=["word",n.slice(h,i+1),h,i],v.push(u)),i)}return h++,u}},position:function(){return h}}}e=t.exports;let Se=Ce,xe;const Ae={";":e.yellow,":":e.yellow,"(":e.cyan,")":e.cyan,"[":e.yellow,"]":e.yellow,"{":e.yellow,"}":e.yellow,"at-word":e.cyan,brackets:e.cyan,call:e.cyan,class:e.yellow,comment:e.gray,hash:e.magenta,string:e.green};function ke(e){let r=Se(new xe(e),{ignoreErrors:!0}),n="";for(;!r.endOfFile();){let e=r.nextToken(),t=Ae[function([e,t],r){if("word"===e){if("."===t[0])return"class";if("#"===t[0])return"hash"}if(!r.endOfFile()){t=r.nextToken();if(r.back(t),"brackets"===t[0]||"("===t[0])return"call"}return e}(e,r)];t?n+=e[1].split(/\r?\n/).map(e=>t(e)).join("\n"):n+=e[1]}return n}ke.registerInput=function(e){xe=e};e=ke;let Ee=t.exports,Le=e;class Oe extends Error{constructor(e,t,r,n,s,i){super(e),this.name="CssSyntaxError",this.reason=e,s&&(this.file=s),n&&(this.source=n),i&&(this.plugin=i),void 0!==t&&void 0!==r&&("number"==typeof t?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,Oe)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file||"",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source,r=(null==e&&(e=Ee.isColorSupported),Le&&e&&(t=Le(t)),t.split(/\r?\n/)),n=Math.max(this.line-3,0);var s=Math.min(this.line+2,r.length);let i=String(s).length,o,a;if(e){let{bold:t,gray:r,red:n}=Ee.createColors(!0);o=e=>t(n(e)),a=e=>r(e)}else o=a=e=>e;return r.slice(n,s).map((e,t)=>{var t=n+1+t;let r=" "+(" "+t).slice(-i)+" | ";return t===this.line?(t=a(r.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," "),o(">")+a(r)+e+"\n "+t+o("^")):" "+a(r)+e}).join("\n")}toString(){let e=this.showSourceCode();return e=e&&"\n\n"+e+"\n",this.name+": "+this.message+e}}var t=Oe,Me=(Oe.default=Oe,{});Me.isClean=Symbol("isClean"),Me.my=Symbol("my");const Pe={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class Re{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name;var n=e.params?this.rawValue(e,"params"):"";void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes?this.block(e,r+n):(t=(e.raws.between||"")+(t?";":""),this.builder(r+n+t,e))}beforeAfter(e,t){let r,n=(r="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose"),e.parent),s=0;for(;n&&"root"!==n.type;)s+=1,n=n.parent;if(r.includes("\n")){var i=this.raw(e,null,"indent");if(i.length)for(let e=0;e{if(n=e.raws[t],void 0!==n)return!1}),void 0===n&&(n=Pe[r]),i.rawCache[r]=n,n}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&0{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=void 0===r?this.raw(t,null,"beforeDecl"):r&&r.replace(/\S/g,""),r}rawBeforeDecl(e,t){let r;return e.walkDecls(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=void 0===r?this.raw(t,null,"beforeRule"):r&&r.replace(/\S/g,""),r}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(t){let r;return t.walk(e=>{if(e.nodes&&(e.parent!==t||t.first!==e)&&void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=r&&r.replace(/\S/g,""),r}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(r){if(r.raws.indent)return r.raws.indent;let n;return r.walk(e=>{var t=e.parent;if(t&&t!==r&&t.parent&&t.parent===r&&void 0!==e.raws.before)return t=e.raws.before.split("\n"),n=t[t.length-1],n=n.replace(/\S/g,""),!1}),n}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){var r=e[t],e=e.raws[t];return e&&e.value===r?e.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}}var Te=Re;Re.default=Re;let Ie=Te;function Be(e,t){let r=new Ie(t);r.stringify(e)}var Ne=Be;Be.default=Be;let{isClean:je,my:De}=Me,Ue=t,Fe=Te,ze=Ne;function $e(t,r){let n=new t.constructor;for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&"proxyCache"!==s){let e=t[s];var i=typeof e;"parent"===s&&"object"==i?r&&(n[s]=r):"source"===s?n[s]=e:Array.isArray(e)?n[s]=e.map(e=>$e(e,n)):("object"==i&&null!==e&&(e=$e(e)),n[s]=e)}return n}class Ge{constructor(e={}){for(var t in this.raws={},this[je]=!1,this[De]=!0,e)if("nodes"===t){this.nodes=[];for(var r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){var t;return e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)&&(t=this.source,e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)),e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(var t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=$e(this);for(var r in e)t[r]=e[r];return t}cloneAfter(e={}){e=this.clone(e);return this.parent.insertAfter(this,e),e}cloneBefore(e={}){e=this.clone(e);return this.parent.insertBefore(this,e),e}error(e,t={}){var r,n;return this.source?({end:r,start:n}=this.rangeBy(t),this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)):new Ue(e)}getProxyProcessor(){return{get(e,t){return"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t]},set(e,t,r){return e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0}}}markDirty(){if(this[je]){this[je]=!1;let e=this;for(;e=e.parent;)e[je]=!1}}next(){var e;if(this.parent)return e=this.parent.index(this),this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;return e.index?r=this.positionInside(e.index,t):!e.word||-1!==(e=(t=this.toString()).indexOf(e.word))&&(r=this.positionInside(e,t)),r}positionInside(t,e){var r=e||this.toString();let n=this.source.start.column,s=this.source.start.line;for(let e=0;e"object"==typeof e&&e.toJSON?e.toJSON(null,r):e);else if("object"==typeof t&&t.toJSON)n[s]=t.toJSON(null,r);else if("source"===s){let e=r.get(t.input);null==e&&(e=i,r.set(t.input,i),i++),n[s]={end:t.end,inputId:e,start:t.start}}else n[s]=t}return t&&(n.inputs=[...r.keys()].map(e=>e.toJSON())),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=ze){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(var s in r)n[s]=r[s];return e.warn(t,n)}get proxyOf(){return this}}var Te=Ge,He=(Ge.default=Ge,Te);class Ve extends He{constructor(e){super(e=e&&void 0!==e.value&&"string"!=typeof e.value?{...e,value:String(e.value)}:e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}}var He=Ve,We=(Ve.default=Ve,{}),Je={},qe={},Ke={},Ze="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),Ye=(Ke.encode=function(e){if(0<=e&&e>>=5)&&(t|=32),r+=Ye.encode(t),0>1,1==(1&a)?-i:i),r.rest=t};var Ke={},l=Ke,Xe=(l.getArg=function(e,t,r){if(t in e)return e[t];if(3===arguments.length)return r;throw new Error('"'+t+'" is a required argument.')},/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/),Qe=/^data:.+\,.+$/;function et(e){e=e.match(Xe);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}function tt(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}l.urlParse=et,l.urlGenerate=tt,rt=function(e){var t=e,r=et(e);if(r){if(!r.path)return e;t=r.path}for(var n,e=l.isAbsolute(t),s=[],i=0;;){if(n=i,-1===(i=t.indexOf("/",n))){s.push(t.slice(n));break}for(s.push(t.slice(n,i));in;e--){var o=r[e-1],a=r[e];if(Pt(o,a)<=0)break;r[e-1]=a,r[e]=o}else Ot(r,Pt,n)}function Tt(e,s){var t=e,e=("string"==typeof e&&(t=w.parseSourceMapInput(e)),w.getArg(t,"version")),t=w.getArg(t,"sections");if(e!=this._version)throw new Error("Unsupported version: "+e);this._sources=new Et,this._names=new Et;var i={line:-1,column:0};this._sections=t.map(function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var t=w.getArg(e,"offset"),r=w.getArg(t,"line"),n=w.getArg(t,"column");if(r=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))},p.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;var r=this._findSourceIndex(e);if(0<=r)return this.sourcesContent[r];var n,r=e;if(null!=this.sourceRoot&&(r=w.relative(this.sourceRoot,r)),null!=this.sourceRoot&&(n=w.urlParse(this.sourceRoot))){e=r.replace(/^file:\/\//,"");if("file"==n.scheme&&this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];if((!n.path||"/"==n.path)&&this._sources.has("/"+r))return this.sourcesContent[this._sources.indexOf("/"+r)]}if(t)return null;throw new Error('"'+r+'" is not in the SourceMap.')},p.prototype.generatedPositionFor=function(e){var t=w.getArg(e,"source");if((t=this._findSourceIndex(t))<0)return{line:null,column:null,lastColumn:null};t={source:t,originalLine:w.getArg(e,"line"),originalColumn:w.getArg(e,"column")},e=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",w.compareByOriginalPositions,w.getArg(e,"bias",f.GREATEST_LOWER_BOUND));if(0<=e){e=this._originalMappings[e];if(e.source===t.source)return{line:w.getArg(e,"generatedLine",null),column:w.getArg(e,"generatedColumn",null),lastColumn:w.getArg(e,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},ft.BasicSourceMapConsumer=p,(Tt.prototype=Object.create(f.prototype)).constructor=f,Tt.prototype._version=3,Object.defineProperty(Tt.prototype,"sources",{get:function(){for(var e=[],t=0;t{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(n,s=21)=>(e=s)=>{let t="",r=e;for(;r--;)t+=n[Math.random()*n.length|0];return t}};let{SourceMapConsumer:Ut,SourceMapGenerator:Ft}=We,{existsSync:zt,readFileSync:$t}=i.default,{dirname:Gt,join:Ht}=n.default;class Vt{constructor(e,t){!1!==t.map&&(this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:"),e=t.map?t.map.prev:void 0,e=this.loadMap(t.from,e),!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Gt(this.mapFile)),e&&(this.text=e))}consumer(){return this.consumerCache||(this.consumerCache=new Ut(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+t)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);var r,n;t&&(r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r),-1"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,i,o;t&&"object"==typeof t?(a=r,r="number"==typeof(l=t).offset?(t=(c=this.fromOffset(l.offset)).line,c.col):(t=l.line,l.column),o="number"==typeof a.offset?(c=this.fromOffset(a.offset),i=c.line,c.col):(i=a.line,a.column)):r||(t=(l=this.fromOffset(t)).line,r=l.col);var a,l,c=this.origin(t,r,i,o);return s=c?new Xt(e,void 0===c.endLine?c.line:{column:c.column,line:c.line},void 0===c.endLine?c.column:{column:c.endColumn,line:c.endLine},c.source,c.file,n.plugin):new Xt(e,void 0===i?t:{column:r,line:t},void 0===i?r:{column:o,line:i},this.css,this.file,n.plugin),s.input={column:r,endColumn:o,endLine:i,line:t,source:this.css},this.file&&(Jt&&(s.input.url=Jt(this.file).toString()),s.input.file=this.file),s}fromOffset(t){let n;if(this[er])n=this[er];else{var s=this.css.split("\n");n=new Array(s.length);let r=0;for(let e=0,t=s.length;e>1),t=n[i+1])){r=i;break}r=i+1}}return{col:t-n[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Kt(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let s=this.map.consumer();t=s.originalPositionFor({column:t,line:e});if(!t.source)return!1;let i;"number"==typeof r&&(i=s.originalPositionFor({column:n,line:r}));let o,a=(o=qt(t.source)?Jt(t.source):new URL(t.source,this.map.consumer().sourceRoot||Jt(this.map.mapFile)),{column:t.column,endColumn:i&&i.column,endLine:i&&i.line,line:t.line,url:o.toString()});if("file:"===o.protocol){if(!Wt)throw new Error("file: protocol is not available in this PostCSS build");a.file=Wt(o)}e=s.sourceContentFor(t.source);return e&&(a.source=e),a}toJSON(){let e={};for(var t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}}Je=nr;nr.default=nr,Yt&&Yt.registerInput&&Yt.registerInput(nr);let{SourceMapConsumer:sr,SourceMapGenerator:ir}=We,{dirname:or,relative:ar,resolve:lr,sep:cr}=n.default,ur=s.default["pathToFileURL"],hr=Je,pr=Boolean(sr&&ir),dr=Boolean(or&&lr&&ar&&cr);ft=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e,t=(e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map","\n");this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(var t of this.previous()){var r=this.toUrl(this.path(t.file)),n=t.root||or(t.file);let e;!1===this.mapOpts.sourcesContent?(e=new sr(t.text),e.sourcesContent&&(e.sourcesContent=null)):e=t.consumer(),this.map.applySourceMap(e,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let t;for(let e=this.root.nodes.length-1;0<=e;e--)t=this.root.nodes[e],"comment"===t.type&&0===t.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(e)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),dr&&pr&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,e=>{t+=e}),[t]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=ir.fromSourceMap(e)}else this.map=new ir({file:this.outputFile()}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):""});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&0",o={generated:{column:0,line:0},original:{column:0,line:0},source:""},a,l;this.stringify(this.root,(e,t,r)=>{this.css+=e,t&&"end"!==r&&(o.generated.line=n,o.generated.column=s-1,t.source&&t.source.start?(o.source=this.sourcePath(t),o.original.line=t.source.start.line,o.original.column=t.source.start.column-1):(o.source=i,o.original.line=1,o.original.column=0),this.map.addMapping(o)),a=e.match(/\n/g),a?(n+=a.length,l=e.lastIndexOf("\n"),s=e.length-l):s+=e.length,t&&"start"!==r&&(e=t.parent||{raws:{}},("decl"===t.type||"atrule"===t.type&&!t.nodes)&&t===e.last&&!e.raws.semicolon||(t.source&&t.source.end?(o.source=this.sourcePath(t),o.original.line=t.source.end.line,o.original.column=t.source.end.column-1,o.generated.line=n,o.generated.column=s-2):(o.source=i,o.original.line=1,o.original.column=0,o.generated.line=n,o.generated.column=s-1),this.map.addMapping(o)))})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;var e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:0e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;var t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?or(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=or(lr(r,this.mapOpts.annotation)));t=ar(r,e);return this.memoizedPaths.set(e,t),t}previous(){var e;return this.previousMaps||(this.previousMaps=[],this.root?this.root.walk(e=>{e.source&&e.source.input.map&&(e=e.source.input.map,this.previousMaps.includes(e)||this.previousMaps.push(e))}):(e=new hr(this.originalCSS,this.opts)).map&&this.previousMaps.push(e.map)),this.previousMaps}setSourcesContent(){let r={};var e;this.root?this.root.walk(e=>{var t;!e.source||(t=e.source.input.from)&&!r[t]&&(r[t]=!0,t=this.usesFileUrls?this.toFileUrl(t):this.toUrl(this.path(t)),this.map.setSourceContent(t,e.source.input.css))}):this.css&&(e=this.opts.from?this.toUrl(this.path(this.opts.from)):"",this.map.setSourceContent(e,this.css))}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){var t=this.memoizedFileURLs.get(e);if(t)return t;if(ur)return t=ur(e).toString(),this.memoizedFileURLs.set(e,t),t;throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){var t=this.memoizedURLs.get(e);if(t)return t;"\\"===cr&&(e=e.replace(/\\/g,"/"));t=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,t),t}};class fr extends Te{constructor(e){super(e),this.type="comment"}}Ct=fr;fr.default=fr;let{isClean:mr,my:gr}=Me,yr=He,vr=Ct,wr,br,_r,Cr;class Sr extends Te{append(...e){for(var t of e){var r;for(r of this.normalize(t,this.last))this.proxyOf.nodes.push(r)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(var t of this.nodes)t.cleanRaws(e)}each(r){if(this.proxyOf.nodes){var n=this.getIterator();let e,t;for(;this.indexes[n]t[n](...e.map(r=>"function"==typeof r?(e,t)=>r(e.toProxy(),t):r)):"every"===n||"some"===n?r=>t[n]((e,...t)=>r(e.toProxy(),...t)):"root"===n?()=>t.root().toProxy():"nodes"===n?t.nodes.map(e=>e.toProxy()):"first"===n||"last"===n?t[n].toProxy():t[n])},set(e,t,r){return e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0}}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){var r,n,s,i=this.index(e),o=this.normalize(t,this.proxyOf.nodes[i]).reverse(),i=this.index(e);for(r of o)this.proxyOf.nodes.splice(i+1,0,r);for(s in this.indexes)i<(n=this.indexes[s])&&(this.indexes[s]=n+o.length);return this.markDirty(),this}insertBefore(e,t){var r,n,s,i=this.index(e),o=this.normalize(t,this.proxyOf.nodes[i],0===i&&"prepend").reverse(),i=this.index(e);for(r of o)this.proxyOf.nodes.splice(i,0,r);for(s in this.indexes)i<=(n=this.indexes[s])&&(this.indexes[s]=n+o.length);return this.markDirty(),this}normalize(e,t){if("string"==typeof e)e=function t(e){return e.map(e=>(e.nodes&&(e.nodes=t(e.nodes)),delete e.source,e))}(wr(e).nodes);else if(void 0===e)e=[];else if(Array.isArray(e))for(var r of e=e.slice(0))r.parent&&r.parent.removeChild(r,"ignore");else if("root"===e.type&&"document"!==this.type)for(var n of e=e.nodes.slice(0))n.parent&&n.parent.removeChild(n,"ignore");else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new yr(e)]}else if(e.selector)e=[new br(e)];else if(e.name)e=[new _r(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new vr(e)]}return e.map(e=>(e[gr]||Sr.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[mr]&&function e(t){if(t[mr]=!1,t.proxyOf.nodes)for(var r of t.proxyOf.nodes)e(r)}(e),void 0===e.raws.before&&t&&void 0!==t.raws.before&&(e.raws.before=t.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}prepend(...e){for(var t of e=e.reverse()){var r,n,s=this.normalize(t,this.first,"prepend").reverse();for(r of s)this.proxyOf.nodes.unshift(r);for(n in this.indexes)this.indexes[n]=this.indexes[n]+s.length}return this.markDirty(),this}push(e){return(e.parent=this).proxyOf.nodes.push(e),this}removeAll(){for(var e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){var t,r;for(r in e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1),this.indexes)e<=(t=this.indexes[r])&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(t,r,n){return n||(n=r,r={}),this.walkDecls(e=>{r.props&&!r.props.includes(e.prop)||r.fast&&!e.value.includes(r.fast)||(e.value=e.value.replace(t,n))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(n){return this.each((t,e)=>{let r;try{r=n(t,e)}catch(e){throw t.addToError(e)}return!1!==r&&t.walk&&(r=t.walk(n)),r})}walkAtRules(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("atrule"===e.type&&r.test(e.name))return n(e,t)}):this.walk((e,t)=>{if("atrule"===e.type&&e.name===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("atrule"===e.type)return n(e,t)}))}walkComments(r){return this.walk((e,t)=>{if("comment"===e.type)return r(e,t)})}walkDecls(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("decl"===e.type&&r.test(e.prop))return n(e,t)}):this.walk((e,t)=>{if("decl"===e.type&&e.prop===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("decl"===e.type)return n(e,t)}))}walkRules(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("rule"===e.type&&r.test(e.selector))return n(e,t)}):this.walk((e,t)=>{if("rule"===e.type&&e.selector===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("rule"===e.type)return n(e,t)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}Sr.registerParse=e=>{wr=e},Sr.registerRule=e=>{br=e},Sr.registerAtRule=e=>{_r=e},Sr.registerRoot=e=>{Cr=e};i=Sr,Sr.default=Sr,Sr.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,_r.prototype):"rule"===e.type?Object.setPrototypeOf(e,br.prototype):"decl"===e.type?Object.setPrototypeOf(e,yr.prototype):"comment"===e.type?Object.setPrototypeOf(e,vr.prototype):"root"===e.type&&Object.setPrototypeOf(e,Cr.prototype),e[gr]=!0,e.nodes&&e.nodes.forEach(e=>{Sr.rebuild(e)})},ot=i;let xr,Ar;class kr extends ot{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){let t=new xr(new Ar,this,e);return t.stringify()}}kr.registerLazyResult=e=>{xr=e},kr.registerProcessor=e=>{Ar=e};e=kr;kr.default=kr;let Er={};function Lr(e){Er[e]||(Er[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))}class Or{constructor(e,t={}){for(var r in this.type="warning",this.text=e,t.node&&t.node.source&&(e=t.node.rangeBy(t),this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column),t)this[r]=t[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}St=Or;Or.default=Or;let Mr=St;class Pr{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);e=new Mr(e,t);return this.messages.push(e),e}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}}Ke=Pr;Pr.default=Pr;let Rr=i;class Tr extends Rr{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}We=Tr;Tr.default=Tr,Rr.registerAtRule(Tr);let Ir=i,Br,Nr;class jr extends Ir{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){e=super.normalize(e);if(t)if("prepend"===r)1{Br=e},jr.registerProcessor=e=>{Nr=e};n=jr;jr.default=jr,Ir.registerRoot(jr);let Dr={comma(e){return Dr.split(e,[","],!0)},space(e){return Dr.split(e,[" ","\n","\t"])},split(e,t,u){let r=[],n="",s=!1,i=0,o=!1,a="",l=!1;for(var c of e)l?l=!1:"\\"===c?l=!0:o?c===a&&(o=!1):'"'===c||"'"===c?(o=!0,a=c):"("===c?i+=1:")"===c?0"space"!==e[0]&&"comment"!==e[0])&&(s.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(s,"value",a.concat(e),t),s.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new Jr;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){var t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1;var r;let n=!1,s=null,i=[];var o=e[1].startsWith("--");let a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)s=s||l,i.push("("===r?")":"]");else if(o&&n&&"{"===r)s=s||l,i.push("}");else if(0===i.length){if(";"===r){if(n)return void this.decl(a,o);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===i[i.length-1]&&(i.pop(),0===i.length&&(s=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),0e+t[1],""),e.raws[t]={raw:o,value:l}),e[t]=l}rule(e){e.pop();let t=new Jr;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){var t;let r="";for(;e.length&&("space"===(t=e[e.length-1][0])||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){var t;let r="";for(;e.length&&("space"===(t=e[0][0])||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t="";for(;e.length&&"space"===e[e.length-1][0];)t=e.pop()[1]+t;return t}stringFrom(t,r){let n="";for(let e=r;evn(e)),e}let wn={};class bn{constructor(e,t,r){this.stringified=!1,this.processed=!1;let n;if("object"!=typeof t||null===t||"root"!==t.type&&"document"!==t.type)if(t instanceof bn||t instanceof ln)n=vn(t.root),t.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=t.map);else{let e=cn;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{n=e(t,r)}catch(e){this.processed=!0,this.error=e}n&&!n[tn]&&sn.rebuild(n)}else n=vn(t);this.result=new ln(e,n,r),this.helpers={...wn,postcss:wn,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){var r=this.result.lastPlugin;try{if(t&&t.addToError(e),"CssSyntaxError"!==(this.error=e).name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){var n=r.postcssPlugin;let e=r.postcssVersion,t=this.result.processor.version;var s=e.split("."),i=t.split(".");(s[0]!==i[0]||parseInt(s[1])>parseInt(i[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+t+", but "+n+" uses "+e+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};var e,t=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(e of this.plugins)if("object"==typeof e)for(var r in e){if(!pn[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${e.postcssPlugin}. `+`Try to update PostCSS (${this.processor.version} now).`);if(!dn[r])if("object"==typeof e[r])for(var n in e[r])"*"===n?t(e,r,e[r][n]):t(e,r+"-"+n.toLowerCase(),e[r][n]);else"function"==typeof e[r]&&t(e,r,e[r])}this.hasListener=0t(e,this.helpers)),await Promise.all(i)):await t(r,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{var e;if("object"==typeof t&&t.Once)return"document"===this.result.root.type?mn((e=this.result.root.nodes.map(e=>t.Once(e,this.helpers)))[0])?Promise.all(e):e:t.Once(this.result.root,this.helpers);if("function"==typeof t)return t(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();var e=this.result.opts;let t=nn,r=(e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify),new rn(t,this.result.root,this.result.opts));e=r.generate();return this.result.css=e[0],this.result.map=e[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(var e of this.plugins)if(mn(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[en];)e[en]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(var t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||an("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(var[r,n]of e){this.result.lastPlugin=r;let e;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(mn(e))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:s}=r;if("root"===n.type||"document"===n.type||n.parent){if(0{e[en]||this.walkSync(e)});else{var r=this.listeners[t];if(r&&this.visitSync(r,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}bn.registerPostcss=e=>{wn=e};Me=bn;bn.default=bn,un.registerLazyResult(bn),on.registerLazyResult(bn);let _n=ft,Cn=Ne,Sn=Lr,xn=Qr;const An=Ke;class kn{constructor(e,t,r){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;var e=Cn;this.result=new An(this._processor,void 0,this._opts),this.result.css=t;let n=this,s=(Object.defineProperty(this.result,"root",{get(){return n.root}}),new _n(e,void 0,this._opts,t));s.isMap()?([r,e]=s.generate(),r&&(this.result.css=r),e&&(this.result.map=e)):(s.clearAnnotation(),this.result.css=s.css)}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||Sn("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=xn;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}}ft=kn;kn.default=kn;let En=ft,Ln=Me,On=e,Mn=n;class Pn{constructor(e=[]){this.version="8.4.35",this.plugins=this.normalize(e)}normalize(e){let t=[];for(var r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return new(this.plugins.length||t.parser||t.stringifier||t.syntax?Ln:En)(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}ft=Pn;Pn.default=Pn,Mn.registerProcessor(Pn),On.registerProcessor(Pn);let Rn=He,Tn=qe,In=Ct,Bn=We,Nn=Je,jn=n,Dn=ot;function Un(e,r){if(Array.isArray(e))return e.map(e=>Un(e));let{inputs:t,...n}=e;if(t){r=[];for(var s of t){let e={...s,__proto__:Nn.prototype};e.map&&(e.map={...e.map,__proto__:Tn.prototype}),r.push(e)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>Un(e,r))),n.source){let{inputId:e,...t}=n.source;n.source=t,null!=e&&(n.source.input=r[e])}if("root"===n.type)return new jn(n);if("decl"===n.type)return new Rn(n);if("rule"===n.type)return new Dn(n);if("comment"===n.type)return new In(n);if("atrule"===n.type)return new Bn(n);throw new Error("Unknown node type: "+e.type)}qe=Un,Un.default=Un;let Fn=He,zn=Me;He=i;let $n=ft;Me=Ne,i=qe;let Gn=e;ft=St;let Hn=Ct,Vn=We;Ne=Ke,qe=Je,e=Qr,St=s;let Wn=ot,Jn=n;Ct=Te;function o(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new $n(e)}o.plugin=function(r,n){let s=!1;function i(...e){console&&console.warn&&!s&&(s=!0,console.warn(r+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(r+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let t=n(...e);return t.postcssPlugin=r,t.postcssVersion=(new $n).version,t}let e;return Object.defineProperty(i,"postcss",{get(){return e=e||i(),e}}),i.process=function(e,t,r){return o([i(r)]).process(e,t)},i},o.stringify=Me,o.parse=e,o.fromJSON=i,o.list=St,o.comment=e=>new Hn(e),o.atRule=e=>new Vn(e),o.decl=e=>new Fn(e),o.rule=e=>new Wn(e),o.root=e=>new Jn(e),o.document=e=>new Gn(e),o.CssSyntaxError=t,o.Declaration=Fn,o.Container=He,o.Processor=$n,o.Document=Gn,o.Comment=Hn,o.Warning=ft,o.AtRule=Vn,o.Result=Ne,o.Input=qe,o.Rule=Wn,o.Root=Jn,o.Node=Ct,zn.registerPostcss(o);o.default=o;class qn extends HTMLElement{base;contents;component;listType="ul";iconSet;filter={value:"",caseSensitive:!1};static get observedAttributes(){return["contents","icon-set","max-depth","filter"]}_jsonToValueArray(e){let t=JSON.stringify(e);t=t.replace(/[\[\]{}\"]/g,"");let r=[];for(const n of t.split(","))r=r.concat(n.split(":"));return[...new Set(r)]}_emit(e,t,r){e=new CustomEvent(e,{detail:r,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}constructor(){super(),this.base=new $,this.setContents(this.getAttribute("contents")),this.iconSet=this.getAttribute("icon-set")?this.getAttribute("icon-type"):"file",this.maxDepth=this.getAttribute("max-depth")?parseInt(this.getAttribute("max-depth")):-1,this.setFilter(this.getAttribute("filter")),this.style.display="block",this.style.maxWidth="fit-content",this.style.margin="0 1rem 0 0",this.base.addEvent(".flk-branch","click",this.emitNodeToggle)}emitNodeToggle(e){e.stopPropagation();const t=F(e,"flk-tree-nav").target,r=z(e,"branchKey");let n=t.contents;const s=r.split(".");for(const o of s)if(n[o])n=n[o];else{let e=[];for(const a of n)a[o]&&e.push(a[o]);n=e}var e=r.substring(r.indexOf(".")+1),i=t.createLeafText(s.reverse()[0]);t._emit("tree-click",t,{path:e,data:n,key:(i.titleText+" "+i.commentText).trim(),branch:"object"==typeof n})}convertJsonKeyToTitle(e){if(!e)return"";const t=(e="string"!=typeof e?e.toString():e).replace(/([A-Z_])/g,e=>"_"===e?" ":" "+e).trim();return t.charAt(0).toUpperCase()+t.slice(1)}setContents(e){var t=e||this.contents||[];try{switch(typeof t){case"string":this.contents=JSON.parse(t);break;case"object":Array.isArray(t)?this.contents=t:this.contents=[t]}}catch(e){console.log(e)}}applyFilter(e){let t;var r="details"===e.tagName.toLowerCase();t=this.filter.caseSensitive?e.dataset.branchValues.includes(this.filter.value):e.dataset.branchValues.toLowerCase().includes(this.filter.value.toLowerCase()),t?e.parentElement.classList.remove("hidden"):e.parentElement.classList.add("hidden"),r&&t?e.setAttribute("open",""):e.removeAttribute("open")}resetTree(e){e.parentElement.classList.remove("hidden"),e.removeAttribute("open")}filterTree(){let t=setTimeout(()=>{for(const e of this.querySelectorAll("[data-branch-values]"))void 0===this.filter.value||0===this.filter.value.length?this.resetTree(e):this.applyFilter(e);clearTimeout(t)},10)}setFilter(e){const t=e||{};try{switch(typeof t){case"string":t.includes("{")?(this.filter=JSON.parse(t),!1===this.filter.caseSensitive&&(this.filter.value=this.filter.value.toLowerCase())):this.filter.value=e.toLowerCase();break;case"object":this.filter=t}}catch(e){console.log(e)}this.filterTree()}createLeafText(e){var t,r;let n="",s="";return"string"==typeof e&&(e.includes("(")||e.includes("["))?(r=e.indexOf("("),r=-1===(t=e.indexOf("["))?r:t,n=this.convertJsonKeyToTitle(e.substring(0,r)),s=e.substring(r)):n=this.convertJsonKeyToTitle(e),{titleText:n,commentText:s}}createTextTag(n,s){n=this.createLeafText(n);if(n.commentText){let e=document.createElement("div"),t=document.createElement("span"),r=(t.innerText=n.titleText,document.createElement("small"));r.innerText=n.commentText,r.style.marginLeft="1rem",e.append(t,r),e.style.display="inline-flex",e.style.alignItems="center",s.append(e)}else s.innerText=n.titleText}createLeaf(e,t,r,n=[]){let s=document.createElement("li");s.classList.add("cursor-no-select"),s.style.marginTop="0.4rem",s.dataset.branchKey=r;const i="file"===this.iconSet?'':'';s.style.listStyleImage=`url('data:image/svg+xml,${i}')`,s.style.position="relative",s.style.left="2px";let o=document.createElement("span");r=[e].concat(n);if(o.dataset.branchValues=[...new Set(r)].join(),this.createTextTag(e,o),o.style.position="relative",o.style.top="-3px",s.append(o),t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);const i="file"===this.iconSet?G:H;e.style.listStyleImage=`url('data:image/svg+xml,${i}')`,e.append(s),t.append(e)}else t.append(s)}createBranch(r,t,n,s){if(s===this.maxDepth&&"object"==typeof r){var i,o=Array.isArray(r)?r:Object.keys(r);if("object"==typeof o[0]){let e=[];for(const d of o)e=e.concat(Object.keys(d));for(i of[...new Set(e)]){var u=document.createElement(this.listType);t.append(this.createBranch(i,u,n+"."+i,s+1))}}else for(const a of o){let e;r[a]&&(e=this._jsonToValueArray(r[a])),this.createLeaf(a,t,n,e)}}else if(Array.isArray(r))for(var e in r){var h=document.createElement(this.listType);t.append(this.createBranch(r[e],h,n+"."+e,s+1))}else if(null!==r&&"object"==typeof r){const l=[];for(const c of Object.keys(r)){let e=document.createElement("li"),t=(e.classList.add("cursor-no-select"),e.style.position="relative",e.style.left="2px",e.dataset.branchKey=n+"."+c,document.createElement("details"));t.classList.add("flk-branch"),t.dataset.branchValues=[c].concat(this._jsonToValueArray(r[c])),t.style.position="relative",t.style.top="-3px",t.classList.add("cursor-default");var p=document.createElement("summary");this.createTextTag(c,p),t.append(p),e.append(this.createBranch(r[c],t,n+"."+c,s+1)),l.push(e)}if(t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);o="file"===this.iconSet?G:H;e.style.listStyleImage=`url('data:image/svg+xml,${o}')`;for(const f of l)e.append(f);t.append(e)}else for(const m of l)t.append(m)}else console.trace({node:r,element:t,key:n}),this.createLeaf(r,t,n);return t}createHtml(){let e=document.createElement(this.listType);var t="file"===this.iconSet?G:'';if(e.style.listStyleImage=`url('data:image/svg+xml,${t}')`,e.style.marginLeft="3rem",this.contents.length){for(const r in this.contents)e=this.createBranch(this.contents[r],e,r,0);this.component=e}else this.component=e}attributeChangedCallback(e,t,r){switch(e){case"contents":this.setContents(r);break;case"icon-set":this.iconSet=r;break;case"max-depth":this.maxDepth="string"==typeof r?parseInt(r):r;break;case"filter":this.setFilter(r)}this.init()}connectedCallback(){this.init()}disconnectedCallback(){this.base.removeEvents(this)}init(){this.createHtml(),this.base.render(this)}}customElements.define("flk-table",W),customElements.define("flk-draggable",J),customElements.define("flk-modal",q),customElements.define("flk-dropdown",K),customElements.define("flk-tree-nav",qn)}(require$$0,require$$2,require$$1$1,require$$1); \ No newline at end of file +!function(e,n,s,i){"use strict";function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a,u,g,e=c(e),n=c(n),s=c(s),i=c(i);(t=a=a||{}).Date="date",t.String="string",t.Float="float",t.Number="number",t.Array="array",t.Object="object",t.Bool="bool",t.Currency="currency",t.Undefined="undefined",t.Null="null";const h={date:/^(\d{1,4}-\d{1,4}-\d{1,4}(T)?)/gim,currency:/^[$|€]\s?[0-9]*(\.|,)?\d*(\.|,)?\d*/gim,float:/\d+[,|.]\d+[,|.]?\d*/gim,currencySign:/\$|€/gim,array:/^\s?[[].[^,]+[\]],?/gi,precision:/[-+$€,.]/gm,string:/[a-zA-Z]/gim},m=e=>{return null===e||"null"===e?a.Null:e||0===e||!1===e?null===new RegExp(h.date).exec(e)||isNaN(Date.parse(e))?new RegExp(h.currency).exec(e)?a.Currency:!new RegExp(h.string).exec(e)&&new RegExp(h.float).exec(e.toString())?a.Float:isNaN(e)&&0!==e?Array.isArray(e)?a.Array:"object"==typeof e?a.Object:a.String:a.Number:a.Date:a.Undefined},y=(t,e)=>{const r={value:void 0,type:e=e||m(t),currencySign:""};switch(r.type){case a.String:r.value=t.toString();break;case a.Float:case a.Currency:var n=(t=t.toString()).match(new RegExp(/(,)/gim)),s=t.match(new RegExp(/(\.)/gim));if(n)for(let e=1;e<=n.length;e++)t=e!==n.length||s?t.replace(",",""):t.replace(",",".");if(r.type===a.Currency){const o=new RegExp(h.currencySign);var i=o.exec(t);r.currencySign=null!==i?i[0]:"",t=t.replace(o,"")}r.value=parseFloat(t).toPrecision(12);break;case a.Number:r.value=Number(t);break;case a.Date:r.value=Date.parse(t);break;case a.Array:t.length?"object"==typeof t[0]?r.value=t.map(e=>JSON.stringify(e)).join(", "):r.value=t.join(", "):r.value="";break;case a.Object:r.value=t;break;case a.Undefined:r.value="";break;case a.Null:r.value=null}return r};function v(e,t){var r;let n;for(r of e.split("."))r=r.trim(),n?"object"!=typeof n||Array.isArray(n)||(n=n[r]):n=t[r];return n}const b=(e,t)=>tet<=e,S=(e,t)=>e<=t,x=(e,t,r)=>r?e.toLowerCase()==t.toLowerCase():e==t,A=(e,t)=>e===t,k=(e,t)=>e!=t,E=(e,t)=>e!==t,L=(e,t)=>null!=t&&"string"==typeof e&&0<=e.toLowerCase().indexOf(t.toString().toLowerCase()),O=(e,t)=>null!=t&&0<=e.toString().toLowerCase().indexOf(t.toString().toLowerCase()),M=(e,t)=>null!=t&&"string"==typeof e&&e.toLowerCase().indexOf(t.toString().toLowerCase())<0;function P(r,n){if(0===n.length)return r;{var s=r;const o=[],a=[];let e=[];for(const l of n)l.type&&l.type!==u.And?(e.length&&a.push(e),e=[l]):e.push(l);a.push(e);let t=[];for(const e of a)t=t.concat(R(s,e));t=[...new Set(t)];var i=s.length;for(let e=0;e":return b;case"<":return _;case">=":return C;case"<=":return S;case"is":case"==":return x;case"!is":case"!=":return k;case"===":return A;case"!==":return E;case"like":case"~":case"contains":return L;case"!contains":case"!like":case"!~":return M;default:return O}}(a.operator);if(!l(i,o,a.ignoreCase)){e=!1;break}}e&&r.push(n)}return r};function T(e,t){if(!t||0===t.length)return e;if(1{if(0===r.length)r=r.concat(I(s,e));else{for(const t of r)n=n.concat(I(t,e));r=n,n=[]}}),r}return I(e,t[0])}function I(e,t){const r=[],n=[];do{if(!e||0===e.length)break;var s=e.shift();if(!s)break;const o=s[t];var i=n.indexOf(o.toString());0<=i?r[i].push(s):(n.push(o.toString()),void 0!==r[n.length-1]?r[n.length-1].push(s):r.push([s]))}while(0{if(t){var r=e;const n={};for(const s of t){let e=r.map(e=>e[s].toString());const i=e.map(e=>m(e));i.some(e=>e===a.Float)?(e=e.map(e=>parseFloat(e)),n[s]=parseFloat(e.reduce((e,t)=>e+t).toFixed(2))):(e=e.map(e=>parseInt(e)),n[s]=e.reduce((e,t)=>e+t))}return n}return{}};class D{model;sortDetails=[];filterDetails=[];selection=[];groupByProperties=[];distinctProperties=[];concatenationToken=", ";constructor(e){this.model=JSON.parse(JSON.stringify(e))}sort(e){return this.sortDetails=e,this}orderBy(e,t){return this.sortDetails.push({propertyName:e,direction:t}),this}thenOrderBy(e,t){return this.orderBy(e,t)}filter(e){return Array.isArray(e)?this.filterDetails=e:this.filterDetails.push(e),this}where(e,t,r,n,s){return this.filterDetails.push({propertyName:e,operator:t,value:r,type:n,ignoreCase:s}),this}andWhere(e,t,r,n){return this.where(e,t,r,u.And,n),this}orWhere(e,t,r,n){return this.where(e,t,r,u.Or,n),this}group(e){return this.groupByProperties=e,this}groupBy(e){return this.groupByProperties.push(e),this}thenGroupBy(e){return this.groupByProperties.push(e),this}select(e){return Array.isArray(e)?this.selection=e:"*"!==e&&(this.selection=[e]),this}distinct(e,t){return t&&(this.concatenationToken=t),Array.isArray(e)?this.distinctProperties=e:e&&(this.distinctProperties=[e]),this}execute(){return T(function(t,r){if(0===r.length)return t;{var n=r;let e=[];for(const s of t){const i={};for(const o of n)i[o]=s[o];e.push(i)}return e}}(function(r,n,u){if(!n||!n.length)return r;const s=[],h=[];for(const f of r){const o={};let t="";for(const e of n){var p=v(e,f);o[e]=p,t+=p}if(!h.includes(t)){let e=r;for(const a of Object.keys(o))e=e.filter(e=>e[a]===o[a]);h.push(t),s.push(e)}}const t=[];for(const m of s){let e={};for(const l of m){var i,d=Object.keys(e);if(d.length)for(const c of d)n.includes(c)||(i=e[c],Array.isArray(i)?(i=l[c],Array.isArray(i)?e[c]=[...new Set(...e[c].concat(l[c]))]:e[c].includes(l[c])||e[c].push(l[c])):isNaN(e[c])&&isNaN(l[c])?e[c]!==l[c]&&(e[c]=[e[c],l[c]]):e[c]=e[c]+l[c]);else e=l}t.push(e)}return t.forEach(e=>{for(const t in e)Array.isArray(e[t])&&(e[t]=e[t].join(u))}),t}(B(P(JSON.parse(JSON.stringify(this.model)),this.filterDetails),this.sortDetails),this.distinctProperties,this.concatenationToken),this.selection),this.groupByProperties)}sum(e,t){e=Array.isArray(e)?e:[e];return j(t||this.model,e)}}function U(e,t){t=t?t.toUpperCase():"FLK-";return e.toUpperCase().includes(t)}function F(e,t){var{timeStamp:r,type:n,x:s,y:i}=e;let o=e.target;do{if(!o||"HTML"===o.tagName||U(o.tagName,t)){"HTML"===o.tagName&&(o=null);break}}while(o=o.parentNode||o.parentElement,!U(o.tagName,t));return{target:o,timeStamp:r,type:n,x:s,y:i}}function z(e,t){let r=e.target,n="";for(;r.dataset[t]?n=r.dataset[t]:r=r.parentNode,!n;);return n}class ${constructor(){}_topLevelClasses=[];_events=[];generateId(){return"flk-"+function e(){const t=([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)),r=t.split("-")[0];return window.$flightkitUUIDStore||(window.$flightkitUUIDStore=[]),window.$flightkitUUIDStore.some(e=>e===r)?e():(window.$flightkitUUIDStore.push(r),r)}()}render(t){if(!t.component)throw new Error("Component is not assigned! Can't render");t.id=t.id||this.generateId();var e=this._getAllEventAttributes(t);if(e){var r="#"+t.id;for(const i of e){var n="e-"+i;this.addEvent(r,i,t.getAttribute(n))}}var s=Object.keys(t.classList).length;if(s){for(let e=0;e{this._assignToDom(t,t.component),clearTimeout(this._renderTimer)},10)}addEvent(e,t,r){this._events.push({selector:e,eventType:t,callback:r})}_getExternalCallback(e){let t=void 0;for(const r of e.split("."))t=(t||window)[r];return t}_getAllEventAttributes(e){e=e.attributes;const t=Array.from(e).filter(e=>e.name.startsWith("e-"));return t.map(e=>e.name.slice(2))}_isFlightkitElement(e){return e.toUpperCase().includes("FLK-")}_outerEventHandler(e){const t=F(e),r=(t.contents=e.detail,t.target.getAttribute("e-"+t.type));let n=void 0;for(const s of r.split("."))n=(n||window)[s];return e.preventDefault(),e.stopPropagation(),n(t)}_addEvents(e){if(e.isConnected)for(const r of this._events)if(r.selector.startsWith("."))for(const n of document.querySelectorAll(r.selector))this._addEventToElement(r,n);else{var t=document.querySelector(r.selector);this._addEventToElement(r,t)}}_addEventToElement(e,t){t&&("function"==typeof e.callback?(t.removeEventListener(e.eventType,e.callback),t.addEventListener(e.eventType,e.callback)):(t.removeEventListener(e.eventType,this._outerEventHandler),t.addEventListener(e.eventType,this._outerEventHandler)))}removeEvents(){for(const t of this._events)if(t.selector.startsWith("."))for(const r of document.querySelectorAll(t.selector))this._addEventToElement(t,r);else{var e=document.querySelector(t.selector);this._addEventToElement(t,e)}this._events=[]}_removeEventToElement(e,t){t&&("function"==typeof e.callback?t.removeEventListener(e.eventType,e.callback):t.removeEventListener(e.eventType,this._outerEventHandler))}_assignToDom(e,t){e.innerHTML="";for(const n of Array.isArray(t)?t:[t])e.append(n);const r=setTimeout(()=>{this._addEvents(e),clearTimeout(r)},10)}}const G='',H='';function V(e){const t=new DOMParser;return t.parseFromString(e,"image/svg+xml").documentElement}class W extends HTMLElement{base;component=null;_contents=[];_orderBy=[];properties=new Set;_columnOrder=[];_filter="";_selectionProperty="";_selectedIds=new Set;uniqueEntriesByProperties={};propertyLabelDictionary={};_templates={};_templateClasses={};static get observedAttributes(){return["contents","columns","order","filter","selection-property","templates"]}get columnOrder(){return this._columnOrder.length?this._columnOrder:this.properties}set columnOrder(e){let t;"string"==typeof e&&(t=e.split(",")),t=e,this._columnOrder=t}get contents(){return this._contents}set contents(e){this.analyzeData(e),this._contents=new D(e)}get orderBy(){return this._orderBy}set orderBy(e){if(Array.isArray(e))this._orderBy=e;else{const n=[];for(const s of e.split(",")){var t=s.split("|"),r=t[0],t=1e[r._selectionProperty])):new Set;e=t?r.contents.execute():[];r._emit("select",r,{selection:e}),r._updateCheckboxes(r)}emitSelect(e){var t=e.target.checked,r=e.target.dataset.objectId;const n=F(e).target,s=(t?n._selectedIds.add(r):n._selectedIds.delete(r),n._selectionProperty);e=n.contents.execute().filter(e=>n._selectedIds.has(e[s]));n._emit("select",n,{selection:e}),n._updateCheckboxes(n)}sortData(e){const t=F(e).target,r=z(e,"column");r&&(-1<(e=t._orderBy.findIndex(e=>e.propertyName===r))?"asc"===t._orderBy[e].direction?t._orderBy[e].direction="desc":t._orderBy.splice(e,1):t._orderBy.push({propertyName:r,direction:"asc"}),t.createHtml(),t.base.render(t))}setColumnOrder(e){this._columnOrder=e?Array.isArray(e)?e:e.split(","):[]}analyzeData(t){this.properties=new Set;var r=t.length;for(let e=0;e"_"===e?" ":" "+e.toLowerCase()).trim();var r=t.charAt(0).toUpperCase()+t.slice(1);return this.propertyLabelDictionary[e]=r}parseTemplate(e,n){return e.replace(/\{\{([\s\S]+?)\}\}/gim,(e,t)=>{let r="";t=t.trim();t=n[t];return t&&(r=t),Array.isArray(r)?r.join(", "):r.toString().trim()})}createSelectionCheckbox(e){const t=document.createElement("input");return t.setAttribute("type","checkbox"),t.classList.add("flk-selection-checkbox"),e&&(t.dataset.selected=e[this._selectionProperty]),t}createRow(e){const t=document.createElement("tr");if(this._selectionProperty.length){const s=document.createElement("td");var r=this.base.generateId();const i=this.createSelectionCheckbox(e);i.id=r,i.dataset.objectId=e[this._selectionProperty];var n=e[this._selectionProperty];this._selectedIds.has(n)?i.checked=!0:i.checked=!1,this.base.addEvent("#"+r,"change",this.emitSelect),s.append(i),t.append(s)}for(const o of this.columnOrder){const a=document.createElement("td");this._templates[o]?(a.innerHTML=this.parseTemplate(this._templates[o],e),this._templateClasses[o]&&a.classList.add(...this._templateClasses[o])):a.innerText=e[o],t.append(a)}return t}createBody(e){const t=document.createElement("tbody");for(const n of e){var r=this.createRow(n,null);t.append(r)}return t}createHead(){const e=document.createElement("thead"),t=document.createElement("tr");if(t.classList.add("cursor-pointer"),this._selectionProperty.length){const s=document.createElement("th");var r=this.base.generateId();const i=this.createSelectionCheckbox();i.id=r;var u=this.contents.execute().length;0e.propertyName===o);if(n){const c=document.createElement("span");c.innerHTML="asc"===n.direction?'':'',a.append(c)}t.append(a)}return e.append(t),e}addEvent(e,t,r){this.base.addEvent(e,t,r)}init(){this.createHtml(),this.base.render(this)}}class J extends HTMLElement{base;componentId;constructor(){super(),this.base=new $}connectedCallback(){var e=this.getAttribute("top"),t=this.getAttribute("left"),r=this.getAttribute("center"),n=this.getAttribute("zIndex");this.id||(this.id=this.base.generateId()),this.style.display="block",this.style.position="fixed","string"==typeof r?(this.style.top=e||"50%",this.style.left="50%",this.style.transform="translate(-50%, -50%)"):(this.style.top=e||this.clientTop+"px",this.style.left=t||this.clientLeft+"px"),n&&(this.style.zIndex=n),this.componentId=this.getAttribute("handle");const s=document.createElement("div");s.innerHTML=this.innerHTML,this.component=s;r="#"+(this.componentId||this.id);this.base.addEvent(r,"mousedown",this._dragElement),this.base.addEvent(r,"mouseup",this._reset),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this)}_dragElement(e){const r=F(e,"flk-draggable").target;let n,s;function t(e){n=e.clientX-r.offsetLeft,s=e.clientY-r.offsetTop}function i(e){var t=e.clientX-n,e=e.clientY-s;r.style.left=t+"px",r.style.top=e+"px"}function o(e){e.preventDefault()}function a(){r.removeAttribute("draggable"),r.removeEventListener("dragstart",t),r.removeEventListener("dragend",a),document.removeEventListener("dragover",o),document.removeEventListener("drop",i)}r.setAttribute("draggable",!0),r.addEventListener("dragstart",t),r.addEventListener("dragend",a),document.addEventListener("dragover",o),document.addEventListener("drop",i)}}class q extends HTMLElement{_id;base;_draggableId;constructor(){super(),this.base=new $}_emit(e,t,r){e=new CustomEvent(e,{detail:r,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}_closeModal(e){e.stopPropagation();const t=F(e,"flk-modal").target;t.classList.add("hidden")}closeModal(e){this.classList.add("hidden")}openModal(e=!0){const t=document.getElementById(this._draggableId);e&&(t.style.top="40%",t.style.left="50%"),this.classList.remove("hidden")}connectedCallback(){this.id||(this.id=this.base.generateId());const e=document.createElement("div");var t=this.base.generateId();const r=document.createElement("flk-draggable"),n=(this._draggableId=this.base.generateId(),r.id=this._draggableId,r.setAttribute("center",""),r.setAttribute("top","40%"),r.setAttribute("handle",t),r.setAttribute("zIndex","1080"),r.classList.add("border","shadow-lg","bg-white"),r.style.width="max-content",document.createElement("div"));var s=this.getAttribute("modal-title");if(s){const c=document.createElement("span");c.innerText=s,c.classList.add("ml-1","mr-auto"),n.append(c)}n.id=t;const i=this.getAttribute("header-class");let o=[];i?o=o.concat(i.split(" ")):o.push("bg-gray-light"),n.classList.add(...o,"border-bottom","row","justify-end","cursor-no-select");s=this.base.generateId();const a=document.createElement("button"),l=(a.classList.add("py-0","px-1","outline-hover","no-border","cursor-default",...o),a.innerText="X",a.id=s,n.append(a),r.append(n),document.createElement("div"));l.innerHTML=this.innerHTML,r.append(l),e.append(r),this.component=e,this.base.addEvent("#"+s,"click",this._closeModal),this.base.render(this),this.classList.add("hidden")}disconnectedCallback(){this.base.removeEvents(this)}}class K extends HTMLElement{base;_buttonId;_drawerId;_iconId;constructor(){super(),this.base=new $}connectedCallback(){this.style.position="relative",this.style.display="flex",this.style.width="fit-content",this._buttonId=this.base.generateId();const e=document.createElement("button"),t=(e.classList.add("row"),e.id=this._buttonId,document.createElement("span")),r=(t.innerText=this.getAttribute("text"),this._iconId=this.base.generateId(),document.createElement("span"));var n=V('');const s=V(''),i=(s.classList.add("hidden"),r.append(n,s),r.id=this._iconId,e.append(t,r),this._drawerId=this.base.generateId(),document.createElement("div"));i.id=this._drawerId,i.classList.add("shadow","inline-block","bg-white"),i.style.position="absolute",i.style.zIndex="1040";n=this.querySelector("template");n.innerHTML.length?i.innerHTML=n.innerHTML:i.append(n.firstChild),i.style.display="none",this.component=[e,i],this.base.addEvent("#"+this._buttonId,"click",this.toggleMenu);const o=document.querySelector("body");""!==o.getAttribute("flk-close-dropdown")&&(o.setAttribute("flk-close-dropdown",""),o.addEventListener("click",this.closeAllDropdownButtons)),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this);var e=document.querySelectorAll("flk-dropdown");if(!e||!e.length){const t=document.querySelector("body");t.removeAttribute("flk-close-dropdown"),t.removeEventListener("click",this.closeAllDropdownButtons)}}toggleMenu(e){const t=F(e).target;e=t._drawerId;const r=document.getElementById(e);var e="none"!==r.style.display,n=(r.style.display=e?"none":"block",t.getAttribute("drawer-width")),n=("string"==typeof t.getAttribute("right")&&(r.style.right="0px"),r.style.top=t.offsetHeight+"px",r.style.width=n||t.offsetWidth+"px",t._iconId);const s=document.getElementById(n);e?(s.childNodes[0].classList.remove("hidden"),s.childNodes[1].classList.add("hidden")):(s.childNodes[0].classList.add("hidden"),s.childNodes[1].classList.remove("hidden"))}_closeDropdown(){var e=this._drawerId;const t=document.getElementById(e);if("none"!==t.style.display){e=this._iconId;const r=document.getElementById(e);t.style.display="none",r.childNodes[0].classList.remove("hidden"),r.childNodes[1].classList.add("hidden")}}closeAllDropdownButtons(e){var t,r=F(e,"flk-dropdown").target,e=document.querySelectorAll("flk-dropdown");if(r)for(const n of e)r._buttonId!==n._buttonId&&(t=n._drawerId,"none"!==document.getElementById(t).style.display&&n._closeDropdown());else for(const s of e)s._closeDropdown()}}var t={exports:{}};let Z=e.default,Y=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||"win32"===process.platform||Z.isatty(1)&&"dumb"!==process.env.TERM||"CI"in process.env),r=(r,n,s=r)=>e=>{let t=""+e;e=t.indexOf(n,r.length);return~e?r+X(t,n,s,e)+n:r+t+n},X=(e,t,r,n)=>{var s=e.substring(0,n)+r;let i=e.substring(n+t.length);e=i.indexOf(t);return~e?s+X(i,t,r,e):s+i};e=(e=Y)=>({isColorSupported:e,reset:e?e=>`${e}`:String,bold:e?r("","",""):String,dim:e?r("","",""):String,italic:e?r("",""):String,underline:e?r("",""):String,inverse:e?r("",""):String,hidden:e?r("",""):String,strikethrough:e?r("",""):String,black:e?r("",""):String,red:e?r("",""):String,green:e?r("",""):String,yellow:e?r("",""):String,blue:e?r("",""):String,magenta:e?r("",""):String,cyan:e?r("",""):String,white:e?r("",""):String,gray:e?r("",""):String,bgBlack:e?r("",""):String,bgRed:e?r("",""):String,bgGreen:e?r("",""):String,bgYellow:e?r("",""):String,bgBlue:e?r("",""):String,bgMagenta:e?r("",""):String,bgCyan:e?r("",""):String,bgWhite:e?r("",""):String});t.exports=e(),t.exports.createColors=e;const Q="'".charCodeAt(0),ee='"'.charCodeAt(0),te="\\".charCodeAt(0),re="/".charCodeAt(0),ne="\n".charCodeAt(0),se=" ".charCodeAt(0),ie="\f".charCodeAt(0),oe="\t".charCodeAt(0),ae="\r".charCodeAt(0),le="[".charCodeAt(0),ce="]".charCodeAt(0),ue="(".charCodeAt(0),he=")".charCodeAt(0),pe="{".charCodeAt(0),de="}".charCodeAt(0),fe=";".charCodeAt(0),me="*".charCodeAt(0),ge=":".charCodeAt(0),ye="@".charCodeAt(0),ve=/[\t\n\f\r "#'()/;[\\\]{}]/g,we=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,be=/.[\r\n"'(/\\]/,_e=/[\da-f]/i;function Ce(t,e={}){let n=t.css.valueOf(),d=e.ignoreErrors,s,i,f,m,o,a,l,g,c,u,y=n.length,h=0,v=[],p=[];function w(e){throw t.error("Unclosed "+e,h)}return{back:function(e){p.push(e)},endOfFile:function(){return 0===p.length&&h>=y},nextToken:function(e){if(p.length)return p.pop();if(!(h>=y)){var t=!!e&&e.ignoreUnclosed;switch(s=n.charCodeAt(h),s){case ne:case se:case oe:case ae:case ie:for(i=h;i+=1,s=n.charCodeAt(i),s===se||s===ne||s===oe||s===ae||s===ie;);u=["space",n.slice(h,i)],h=i-1;break;case le:case ce:case pe:case de:case ge:case fe:case he:var r=String.fromCharCode(s);u=[r,r,h];break;case ue:if(g=v.length?v.pop()[1]:"",c=n.charCodeAt(h+1),"url"===g&&c!==Q&&c!==ee&&c!==se&&c!==ne&&c!==oe&&c!==ie&&c!==ae){i=h;do{if(a=!1,i=n.indexOf(")",i+1),-1===i){if(d||t){i=h;break}w("bracket")}for(l=i;n.charCodeAt(l-1)===te;)--l,a=!a}while(a);u=["brackets",n.slice(h,i+1),h,i],h=i}else i=n.indexOf(")",h+1),m=n.slice(h,i+1),-1===i||be.test(m)?u=["(","(",h]:(u=["brackets",m,h,i],h=i);break;case Q:case ee:f=s===Q?"'":'"',i=h;do{if(a=!1,i=n.indexOf(f,i+1),-1===i){if(d||t){i=h+1;break}w("string")}for(l=i;n.charCodeAt(l-1)===te;)--l,a=!a}while(a);u=["string",n.slice(h,i+1),h,i],h=i;break;case ye:ve.lastIndex=h+1,ve.test(n),i=0===ve.lastIndex?n.length-1:ve.lastIndex-2,u=["at-word",n.slice(h,i+1),h,i],h=i;break;case te:for(i=h,o=!0;n.charCodeAt(i+1)===te;)i+=1,o=!o;if(s=n.charCodeAt(i+1),o&&s!==re&&s!==se&&s!==ne&&s!==oe&&s!==ae&&s!==ie&&(i+=1,_e.test(n.charAt(i)))){for(;_e.test(n.charAt(i+1));)i+=1;n.charCodeAt(i+1)===se&&(i+=1)}u=["word",n.slice(h,i+1),h,i],h=i;break;default:h=(s===re&&n.charCodeAt(h+1)===me?(i=n.indexOf("*/",h+2)+1,0===i&&(d||t?i=n.length:w("comment")),u=["comment",n.slice(h,i+1),h,i]):(we.lastIndex=h+1,we.test(n),i=0===we.lastIndex?n.length-1:we.lastIndex-2,u=["word",n.slice(h,i+1),h,i],v.push(u)),i)}return h++,u}},position:function(){return h}}}e=t.exports;let Se=Ce,xe;const Ae={";":e.yellow,":":e.yellow,"(":e.cyan,")":e.cyan,"[":e.yellow,"]":e.yellow,"{":e.yellow,"}":e.yellow,"at-word":e.cyan,brackets:e.cyan,call:e.cyan,class:e.yellow,comment:e.gray,hash:e.magenta,string:e.green};function ke(e){let r=Se(new xe(e),{ignoreErrors:!0}),n="";for(;!r.endOfFile();){let e=r.nextToken(),t=Ae[function([e,t],r){if("word"===e){if("."===t[0])return"class";if("#"===t[0])return"hash"}if(!r.endOfFile()){t=r.nextToken();if(r.back(t),"brackets"===t[0]||"("===t[0])return"call"}return e}(e,r)];t?n+=e[1].split(/\r?\n/).map(e=>t(e)).join("\n"):n+=e[1]}return n}ke.registerInput=function(e){xe=e};e=ke;let Ee=t.exports,Le=e;class Oe extends Error{constructor(e,t,r,n,s,i){super(e),this.name="CssSyntaxError",this.reason=e,s&&(this.file=s),n&&(this.source=n),i&&(this.plugin=i),void 0!==t&&void 0!==r&&("number"==typeof t?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,Oe)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file||"",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source,r=(null==e&&(e=Ee.isColorSupported),Le&&e&&(t=Le(t)),t.split(/\r?\n/)),n=Math.max(this.line-3,0);var s=Math.min(this.line+2,r.length);let i=String(s).length,o,a;if(e){let{bold:t,gray:r,red:n}=Ee.createColors(!0);o=e=>t(n(e)),a=e=>r(e)}else o=a=e=>e;return r.slice(n,s).map((e,t)=>{var t=n+1+t;let r=" "+(" "+t).slice(-i)+" | ";return t===this.line?(t=a(r.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," "),o(">")+a(r)+e+"\n "+t+o("^")):" "+a(r)+e}).join("\n")}toString(){let e=this.showSourceCode();return e=e&&"\n\n"+e+"\n",this.name+": "+this.message+e}}var t=Oe,Me=(Oe.default=Oe,{});Me.isClean=Symbol("isClean"),Me.my=Symbol("my");const Pe={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class Re{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name;var n=e.params?this.rawValue(e,"params"):"";void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes?this.block(e,r+n):(t=(e.raws.between||"")+(t?";":""),this.builder(r+n+t,e))}beforeAfter(e,t){let r,n=(r="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose"),e.parent),s=0;for(;n&&"root"!==n.type;)s+=1,n=n.parent;if(r.includes("\n")){var i=this.raw(e,null,"indent");if(i.length)for(let e=0;e{if(n=e.raws[t],void 0!==n)return!1}),void 0===n&&(n=Pe[r]),i.rawCache[r]=n,n}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&0{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=void 0===r?this.raw(t,null,"beforeDecl"):r&&r.replace(/\S/g,""),r}rawBeforeDecl(e,t){let r;return e.walkDecls(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=void 0===r?this.raw(t,null,"beforeRule"):r&&r.replace(/\S/g,""),r}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(t){let r;return t.walk(e=>{if(e.nodes&&(e.parent!==t||t.first!==e)&&void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=r&&r.replace(/\S/g,""),r}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(r){if(r.raws.indent)return r.raws.indent;let n;return r.walk(e=>{var t=e.parent;if(t&&t!==r&&t.parent&&t.parent===r&&void 0!==e.raws.before)return t=e.raws.before.split("\n"),n=t[t.length-1],n=n.replace(/\S/g,""),!1}),n}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){var r=e[t],e=e.raws[t];return e&&e.value===r?e.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}}var Te=Re;Re.default=Re;let Ie=Te;function Be(e,t){let r=new Ie(t);r.stringify(e)}var Ne=Be;Be.default=Be;let{isClean:je,my:De}=Me,Ue=t,Fe=Te,ze=Ne;function $e(t,r){let n=new t.constructor;for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&"proxyCache"!==s){let e=t[s];var i=typeof e;"parent"===s&&"object"==i?r&&(n[s]=r):"source"===s?n[s]=e:Array.isArray(e)?n[s]=e.map(e=>$e(e,n)):("object"==i&&null!==e&&(e=$e(e)),n[s]=e)}return n}class Ge{constructor(e={}){for(var t in this.raws={},this[je]=!1,this[De]=!0,e)if("nodes"===t){this.nodes=[];for(var r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){var t;return e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)&&(t=this.source,e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)),e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(var t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=$e(this);for(var r in e)t[r]=e[r];return t}cloneAfter(e={}){e=this.clone(e);return this.parent.insertAfter(this,e),e}cloneBefore(e={}){e=this.clone(e);return this.parent.insertBefore(this,e),e}error(e,t={}){var r,n;return this.source?({end:r,start:n}=this.rangeBy(t),this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)):new Ue(e)}getProxyProcessor(){return{get(e,t){return"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t]},set(e,t,r){return e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0}}}markDirty(){if(this[je]){this[je]=!1;let e=this;for(;e=e.parent;)e[je]=!1}}next(){var e;if(this.parent)return e=this.parent.index(this),this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;return e.index?r=this.positionInside(e.index,t):!e.word||-1!==(e=(t=this.toString()).indexOf(e.word))&&(r=this.positionInside(e,t)),r}positionInside(t,e){var r=e||this.toString();let n=this.source.start.column,s=this.source.start.line;for(let e=0;e"object"==typeof e&&e.toJSON?e.toJSON(null,r):e);else if("object"==typeof t&&t.toJSON)n[s]=t.toJSON(null,r);else if("source"===s){let e=r.get(t.input);null==e&&(e=i,r.set(t.input,i),i++),n[s]={end:t.end,inputId:e,start:t.start}}else n[s]=t}return t&&(n.inputs=[...r.keys()].map(e=>e.toJSON())),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=ze){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(var s in r)n[s]=r[s];return e.warn(t,n)}get proxyOf(){return this}}var Te=Ge,He=(Ge.default=Ge,Te);class Ve extends He{constructor(e){super(e=e&&void 0!==e.value&&"string"!=typeof e.value?{...e,value:String(e.value)}:e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}}var He=Ve,We=(Ve.default=Ve,{}),Je={},qe={},Ke={},Ze="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),Ye=(Ke.encode=function(e){if(0<=e&&e>>=5)&&(t|=32),r+=Ye.encode(t),0>1,1==(1&a)?-i:i),r.rest=t};var Ke={},l=Ke,Xe=(l.getArg=function(e,t,r){if(t in e)return e[t];if(3===arguments.length)return r;throw new Error('"'+t+'" is a required argument.')},/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/),Qe=/^data:.+\,.+$/;function et(e){e=e.match(Xe);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}function tt(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}l.urlParse=et,l.urlGenerate=tt,rt=function(e){var t=e,r=et(e);if(r){if(!r.path)return e;t=r.path}for(var n,e=l.isAbsolute(t),s=[],i=0;;){if(n=i,-1===(i=t.indexOf("/",n))){s.push(t.slice(n));break}for(s.push(t.slice(n,i));in;e--){var o=r[e-1],a=r[e];if(Pt(o,a)<=0)break;r[e-1]=a,r[e]=o}else Ot(r,Pt,n)}function Tt(e,s){var t=e,e=("string"==typeof e&&(t=w.parseSourceMapInput(e)),w.getArg(t,"version")),t=w.getArg(t,"sections");if(e!=this._version)throw new Error("Unsupported version: "+e);this._sources=new Et,this._names=new Et;var i={line:-1,column:0};this._sections=t.map(function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var t=w.getArg(e,"offset"),r=w.getArg(t,"line"),n=w.getArg(t,"column");if(r=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))},p.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;var r=this._findSourceIndex(e);if(0<=r)return this.sourcesContent[r];var n,r=e;if(null!=this.sourceRoot&&(r=w.relative(this.sourceRoot,r)),null!=this.sourceRoot&&(n=w.urlParse(this.sourceRoot))){e=r.replace(/^file:\/\//,"");if("file"==n.scheme&&this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];if((!n.path||"/"==n.path)&&this._sources.has("/"+r))return this.sourcesContent[this._sources.indexOf("/"+r)]}if(t)return null;throw new Error('"'+r+'" is not in the SourceMap.')},p.prototype.generatedPositionFor=function(e){var t=w.getArg(e,"source");if((t=this._findSourceIndex(t))<0)return{line:null,column:null,lastColumn:null};t={source:t,originalLine:w.getArg(e,"line"),originalColumn:w.getArg(e,"column")},e=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",w.compareByOriginalPositions,w.getArg(e,"bias",f.GREATEST_LOWER_BOUND));if(0<=e){e=this._originalMappings[e];if(e.source===t.source)return{line:w.getArg(e,"generatedLine",null),column:w.getArg(e,"generatedColumn",null),lastColumn:w.getArg(e,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},ft.BasicSourceMapConsumer=p,(Tt.prototype=Object.create(f.prototype)).constructor=f,Tt.prototype._version=3,Object.defineProperty(Tt.prototype,"sources",{get:function(){for(var e=[],t=0;t{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(n,s=21)=>(e=s)=>{let t="",r=e;for(;r--;)t+=n[Math.random()*n.length|0];return t}};let{SourceMapConsumer:Ut,SourceMapGenerator:Ft}=We,{existsSync:zt,readFileSync:$t}=i.default,{dirname:Gt,join:Ht}=n.default;class Vt{constructor(e,t){!1!==t.map&&(this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:"),e=t.map?t.map.prev:void 0,e=this.loadMap(t.from,e),!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Gt(this.mapFile)),e&&(this.text=e))}consumer(){return this.consumerCache||(this.consumerCache=new Ut(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+t)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);var r,n;t&&(r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r),-1"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,i,o;t&&"object"==typeof t?(a=r,r="number"==typeof(l=t).offset?(t=(c=this.fromOffset(l.offset)).line,c.col):(t=l.line,l.column),o="number"==typeof a.offset?(c=this.fromOffset(a.offset),i=c.line,c.col):(i=a.line,a.column)):r||(t=(l=this.fromOffset(t)).line,r=l.col);var a,l,c=this.origin(t,r,i,o);return s=c?new Xt(e,void 0===c.endLine?c.line:{column:c.column,line:c.line},void 0===c.endLine?c.column:{column:c.endColumn,line:c.endLine},c.source,c.file,n.plugin):new Xt(e,void 0===i?t:{column:r,line:t},void 0===i?r:{column:o,line:i},this.css,this.file,n.plugin),s.input={column:r,endColumn:o,endLine:i,line:t,source:this.css},this.file&&(Jt&&(s.input.url=Jt(this.file).toString()),s.input.file=this.file),s}fromOffset(t){let n;if(this[er])n=this[er];else{var s=this.css.split("\n");n=new Array(s.length);let r=0;for(let e=0,t=s.length;e>1),t=n[i+1])){r=i;break}r=i+1}}return{col:t-n[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Kt(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let s=this.map.consumer();t=s.originalPositionFor({column:t,line:e});if(!t.source)return!1;let i;"number"==typeof r&&(i=s.originalPositionFor({column:n,line:r}));let o,a=(o=qt(t.source)?Jt(t.source):new URL(t.source,this.map.consumer().sourceRoot||Jt(this.map.mapFile)),{column:t.column,endColumn:i&&i.column,endLine:i&&i.line,line:t.line,url:o.toString()});if("file:"===o.protocol){if(!Wt)throw new Error("file: protocol is not available in this PostCSS build");a.file=Wt(o)}e=s.sourceContentFor(t.source);return e&&(a.source=e),a}toJSON(){let e={};for(var t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}}Je=nr;nr.default=nr,Yt&&Yt.registerInput&&Yt.registerInput(nr);let{SourceMapConsumer:sr,SourceMapGenerator:ir}=We,{dirname:or,relative:ar,resolve:lr,sep:cr}=n.default,ur=s.default["pathToFileURL"],hr=Je,pr=Boolean(sr&&ir),dr=Boolean(or&&lr&&ar&&cr);ft=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e,t=(e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map","\n");this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(var t of this.previous()){var r=this.toUrl(this.path(t.file)),n=t.root||or(t.file);let e;!1===this.mapOpts.sourcesContent?(e=new sr(t.text),e.sourcesContent&&(e.sourcesContent=null)):e=t.consumer(),this.map.applySourceMap(e,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let t;for(let e=this.root.nodes.length-1;0<=e;e--)t=this.root.nodes[e],"comment"===t.type&&0===t.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(e)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),dr&&pr&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,e=>{t+=e}),[t]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=ir.fromSourceMap(e)}else this.map=new ir({file:this.outputFile()}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):""});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&0",o={generated:{column:0,line:0},original:{column:0,line:0},source:""},a,l;this.stringify(this.root,(e,t,r)=>{this.css+=e,t&&"end"!==r&&(o.generated.line=n,o.generated.column=s-1,t.source&&t.source.start?(o.source=this.sourcePath(t),o.original.line=t.source.start.line,o.original.column=t.source.start.column-1):(o.source=i,o.original.line=1,o.original.column=0),this.map.addMapping(o)),a=e.match(/\n/g),a?(n+=a.length,l=e.lastIndexOf("\n"),s=e.length-l):s+=e.length,t&&"start"!==r&&(e=t.parent||{raws:{}},("decl"===t.type||"atrule"===t.type&&!t.nodes)&&t===e.last&&!e.raws.semicolon||(t.source&&t.source.end?(o.source=this.sourcePath(t),o.original.line=t.source.end.line,o.original.column=t.source.end.column-1,o.generated.line=n,o.generated.column=s-2):(o.source=i,o.original.line=1,o.original.column=0,o.generated.line=n,o.generated.column=s-1),this.map.addMapping(o)))})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;var e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:0e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;var t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?or(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=or(lr(r,this.mapOpts.annotation)));t=ar(r,e);return this.memoizedPaths.set(e,t),t}previous(){var e;return this.previousMaps||(this.previousMaps=[],this.root?this.root.walk(e=>{e.source&&e.source.input.map&&(e=e.source.input.map,this.previousMaps.includes(e)||this.previousMaps.push(e))}):(e=new hr(this.originalCSS,this.opts)).map&&this.previousMaps.push(e.map)),this.previousMaps}setSourcesContent(){let r={};var e;this.root?this.root.walk(e=>{var t;!e.source||(t=e.source.input.from)&&!r[t]&&(r[t]=!0,t=this.usesFileUrls?this.toFileUrl(t):this.toUrl(this.path(t)),this.map.setSourceContent(t,e.source.input.css))}):this.css&&(e=this.opts.from?this.toUrl(this.path(this.opts.from)):"",this.map.setSourceContent(e,this.css))}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){var t=this.memoizedFileURLs.get(e);if(t)return t;if(ur)return t=ur(e).toString(),this.memoizedFileURLs.set(e,t),t;throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){var t=this.memoizedURLs.get(e);if(t)return t;"\\"===cr&&(e=e.replace(/\\/g,"/"));t=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,t),t}};class fr extends Te{constructor(e){super(e),this.type="comment"}}Ct=fr;fr.default=fr;let{isClean:mr,my:gr}=Me,yr=He,vr=Ct,wr,br,_r,Cr;class Sr extends Te{append(...e){for(var t of e){var r;for(r of this.normalize(t,this.last))this.proxyOf.nodes.push(r)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(var t of this.nodes)t.cleanRaws(e)}each(r){if(this.proxyOf.nodes){var n=this.getIterator();let e,t;for(;this.indexes[n]t[n](...e.map(r=>"function"==typeof r?(e,t)=>r(e.toProxy(),t):r)):"every"===n||"some"===n?r=>t[n]((e,...t)=>r(e.toProxy(),...t)):"root"===n?()=>t.root().toProxy():"nodes"===n?t.nodes.map(e=>e.toProxy()):"first"===n||"last"===n?t[n].toProxy():t[n])},set(e,t,r){return e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0}}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){var r,n,s,i=this.index(e),o=this.normalize(t,this.proxyOf.nodes[i]).reverse(),i=this.index(e);for(r of o)this.proxyOf.nodes.splice(i+1,0,r);for(s in this.indexes)i<(n=this.indexes[s])&&(this.indexes[s]=n+o.length);return this.markDirty(),this}insertBefore(e,t){var r,n,s,i=this.index(e),o=this.normalize(t,this.proxyOf.nodes[i],0===i&&"prepend").reverse(),i=this.index(e);for(r of o)this.proxyOf.nodes.splice(i,0,r);for(s in this.indexes)i<=(n=this.indexes[s])&&(this.indexes[s]=n+o.length);return this.markDirty(),this}normalize(e,t){if("string"==typeof e)e=function t(e){return e.map(e=>(e.nodes&&(e.nodes=t(e.nodes)),delete e.source,e))}(wr(e).nodes);else if(void 0===e)e=[];else if(Array.isArray(e))for(var r of e=e.slice(0))r.parent&&r.parent.removeChild(r,"ignore");else if("root"===e.type&&"document"!==this.type)for(var n of e=e.nodes.slice(0))n.parent&&n.parent.removeChild(n,"ignore");else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new yr(e)]}else if(e.selector)e=[new br(e)];else if(e.name)e=[new _r(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new vr(e)]}return e.map(e=>(e[gr]||Sr.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[mr]&&function e(t){if(t[mr]=!1,t.proxyOf.nodes)for(var r of t.proxyOf.nodes)e(r)}(e),void 0===e.raws.before&&t&&void 0!==t.raws.before&&(e.raws.before=t.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}prepend(...e){for(var t of e=e.reverse()){var r,n,s=this.normalize(t,this.first,"prepend").reverse();for(r of s)this.proxyOf.nodes.unshift(r);for(n in this.indexes)this.indexes[n]=this.indexes[n]+s.length}return this.markDirty(),this}push(e){return(e.parent=this).proxyOf.nodes.push(e),this}removeAll(){for(var e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){var t,r;for(r in e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1),this.indexes)e<=(t=this.indexes[r])&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(t,r,n){return n||(n=r,r={}),this.walkDecls(e=>{r.props&&!r.props.includes(e.prop)||r.fast&&!e.value.includes(r.fast)||(e.value=e.value.replace(t,n))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(n){return this.each((t,e)=>{let r;try{r=n(t,e)}catch(e){throw t.addToError(e)}return!1!==r&&t.walk&&(r=t.walk(n)),r})}walkAtRules(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("atrule"===e.type&&r.test(e.name))return n(e,t)}):this.walk((e,t)=>{if("atrule"===e.type&&e.name===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("atrule"===e.type)return n(e,t)}))}walkComments(r){return this.walk((e,t)=>{if("comment"===e.type)return r(e,t)})}walkDecls(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("decl"===e.type&&r.test(e.prop))return n(e,t)}):this.walk((e,t)=>{if("decl"===e.type&&e.prop===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("decl"===e.type)return n(e,t)}))}walkRules(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("rule"===e.type&&r.test(e.selector))return n(e,t)}):this.walk((e,t)=>{if("rule"===e.type&&e.selector===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("rule"===e.type)return n(e,t)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}Sr.registerParse=e=>{wr=e},Sr.registerRule=e=>{br=e},Sr.registerAtRule=e=>{_r=e},Sr.registerRoot=e=>{Cr=e};i=Sr,Sr.default=Sr,Sr.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,_r.prototype):"rule"===e.type?Object.setPrototypeOf(e,br.prototype):"decl"===e.type?Object.setPrototypeOf(e,yr.prototype):"comment"===e.type?Object.setPrototypeOf(e,vr.prototype):"root"===e.type&&Object.setPrototypeOf(e,Cr.prototype),e[gr]=!0,e.nodes&&e.nodes.forEach(e=>{Sr.rebuild(e)})},ot=i;let xr,Ar;class kr extends ot{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){let t=new xr(new Ar,this,e);return t.stringify()}}kr.registerLazyResult=e=>{xr=e},kr.registerProcessor=e=>{Ar=e};e=kr;kr.default=kr;let Er={};function Lr(e){Er[e]||(Er[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))}class Or{constructor(e,t={}){for(var r in this.type="warning",this.text=e,t.node&&t.node.source&&(e=t.node.rangeBy(t),this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column),t)this[r]=t[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}St=Or;Or.default=Or;let Mr=St;class Pr{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);e=new Mr(e,t);return this.messages.push(e),e}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}}Ke=Pr;Pr.default=Pr;let Rr=i;class Tr extends Rr{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}We=Tr;Tr.default=Tr,Rr.registerAtRule(Tr);let Ir=i,Br,Nr;class jr extends Ir{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){e=super.normalize(e);if(t)if("prepend"===r)1{Br=e},jr.registerProcessor=e=>{Nr=e};n=jr;jr.default=jr,Ir.registerRoot(jr);let Dr={comma(e){return Dr.split(e,[","],!0)},space(e){return Dr.split(e,[" ","\n","\t"])},split(e,t,u){let r=[],n="",s=!1,i=0,o=!1,a="",l=!1;for(var c of e)l?l=!1:"\\"===c?l=!0:o?c===a&&(o=!1):'"'===c||"'"===c?(o=!0,a=c):"("===c?i+=1:")"===c?0"space"!==e[0]&&"comment"!==e[0])&&(s.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(s,"value",a.concat(e),t),s.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new Jr;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){var t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1;var r;let n=!1,s=null,i=[];var o=e[1].startsWith("--");let a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)s=s||l,i.push("("===r?")":"]");else if(o&&n&&"{"===r)s=s||l,i.push("}");else if(0===i.length){if(";"===r){if(n)return void this.decl(a,o);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===i[i.length-1]&&(i.pop(),0===i.length&&(s=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),0e+t[1],""),e.raws[t]={raw:o,value:l}),e[t]=l}rule(e){e.pop();let t=new Jr;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){var t;let r="";for(;e.length&&("space"===(t=e[e.length-1][0])||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){var t;let r="";for(;e.length&&("space"===(t=e[0][0])||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t="";for(;e.length&&"space"===e[e.length-1][0];)t=e.pop()[1]+t;return t}stringFrom(t,r){let n="";for(let e=r;evn(e)),e}let wn={};class bn{constructor(e,t,r){this.stringified=!1,this.processed=!1;let n;if("object"!=typeof t||null===t||"root"!==t.type&&"document"!==t.type)if(t instanceof bn||t instanceof ln)n=vn(t.root),t.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=t.map);else{let e=cn;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{n=e(t,r)}catch(e){this.processed=!0,this.error=e}n&&!n[tn]&&sn.rebuild(n)}else n=vn(t);this.result=new ln(e,n,r),this.helpers={...wn,postcss:wn,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){var r=this.result.lastPlugin;try{if(t&&t.addToError(e),"CssSyntaxError"!==(this.error=e).name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){var n=r.postcssPlugin;let e=r.postcssVersion,t=this.result.processor.version;var s=e.split("."),i=t.split(".");(s[0]!==i[0]||parseInt(s[1])>parseInt(i[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+t+", but "+n+" uses "+e+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};var e,t=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(e of this.plugins)if("object"==typeof e)for(var r in e){if(!pn[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${e.postcssPlugin}. `+`Try to update PostCSS (${this.processor.version} now).`);if(!dn[r])if("object"==typeof e[r])for(var n in e[r])"*"===n?t(e,r,e[r][n]):t(e,r+"-"+n.toLowerCase(),e[r][n]);else"function"==typeof e[r]&&t(e,r,e[r])}this.hasListener=0t(e,this.helpers)),await Promise.all(i)):await t(r,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{var e;if("object"==typeof t&&t.Once)return"document"===this.result.root.type?mn((e=this.result.root.nodes.map(e=>t.Once(e,this.helpers)))[0])?Promise.all(e):e:t.Once(this.result.root,this.helpers);if("function"==typeof t)return t(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();var e=this.result.opts;let t=nn,r=(e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify),new rn(t,this.result.root,this.result.opts));e=r.generate();return this.result.css=e[0],this.result.map=e[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(var e of this.plugins)if(mn(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[en];)e[en]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(var t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||an("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(var[r,n]of e){this.result.lastPlugin=r;let e;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(mn(e))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:s}=r;if("root"===n.type||"document"===n.type||n.parent){if(0{e[en]||this.walkSync(e)});else{var r=this.listeners[t];if(r&&this.visitSync(r,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}bn.registerPostcss=e=>{wn=e};Me=bn;bn.default=bn,un.registerLazyResult(bn),on.registerLazyResult(bn);let _n=ft,Cn=Ne,Sn=Lr,xn=Qr;const An=Ke;class kn{constructor(e,t,r){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;var e=Cn;this.result=new An(this._processor,void 0,this._opts),this.result.css=t;let n=this,s=(Object.defineProperty(this.result,"root",{get(){return n.root}}),new _n(e,void 0,this._opts,t));s.isMap()?([r,e]=s.generate(),r&&(this.result.css=r),e&&(this.result.map=e)):(s.clearAnnotation(),this.result.css=s.css)}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||Sn("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=xn;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}}ft=kn;kn.default=kn;let En=ft,Ln=Me,On=e,Mn=n;class Pn{constructor(e=[]){this.version="8.4.35",this.plugins=this.normalize(e)}normalize(e){let t=[];for(var r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return new(this.plugins.length||t.parser||t.stringifier||t.syntax?Ln:En)(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}ft=Pn;Pn.default=Pn,Mn.registerProcessor(Pn),On.registerProcessor(Pn);let Rn=He,Tn=qe,In=Ct,Bn=We,Nn=Je,jn=n,Dn=ot;function Un(e,r){if(Array.isArray(e))return e.map(e=>Un(e));let{inputs:t,...n}=e;if(t){r=[];for(var s of t){let e={...s,__proto__:Nn.prototype};e.map&&(e.map={...e.map,__proto__:Tn.prototype}),r.push(e)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>Un(e,r))),n.source){let{inputId:e,...t}=n.source;n.source=t,null!=e&&(n.source.input=r[e])}if("root"===n.type)return new jn(n);if("decl"===n.type)return new Rn(n);if("rule"===n.type)return new Dn(n);if("comment"===n.type)return new In(n);if("atrule"===n.type)return new Bn(n);throw new Error("Unknown node type: "+e.type)}qe=Un,Un.default=Un;let Fn=He,zn=Me;He=i;let $n=ft;Me=Ne,i=qe;let Gn=e;ft=St;let Hn=Ct,Vn=We;Ne=Ke,qe=Je,e=Qr,St=s;let Wn=ot,Jn=n;Ct=Te;function o(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new $n(e)}o.plugin=function(r,n){let s=!1;function i(...e){console&&console.warn&&!s&&(s=!0,console.warn(r+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(r+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let t=n(...e);return t.postcssPlugin=r,t.postcssVersion=(new $n).version,t}let e;return Object.defineProperty(i,"postcss",{get(){return e=e||i(),e}}),i.process=function(e,t,r){return o([i(r)]).process(e,t)},i},o.stringify=Me,o.parse=e,o.fromJSON=i,o.list=St,o.comment=e=>new Hn(e),o.atRule=e=>new Vn(e),o.decl=e=>new Fn(e),o.rule=e=>new Wn(e),o.root=e=>new Jn(e),o.document=e=>new Gn(e),o.CssSyntaxError=t,o.Declaration=Fn,o.Container=He,o.Processor=$n,o.Document=Gn,o.Comment=Hn,o.Warning=ft,o.AtRule=Vn,o.Result=Ne,o.Input=qe,o.Rule=Wn,o.Root=Jn,o.Node=Ct,zn.registerPostcss(o);o.default=o;class qn extends HTMLElement{base;contents;component;listType="ul";iconSet;filter={value:"",caseSensitive:!1};static get observedAttributes(){return["contents","icon-set","max-depth","filter"]}_jsonToValueArray(e){let t=JSON.stringify(e);t=t.replace(/[\[\]{}\"]/g,"");let r=[];for(const n of t.split(","))r=r.concat(n.split(":"));return[...new Set(r)]}_emit(e,t,r){e=new CustomEvent(e,{detail:r,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}constructor(){super(),this.base=new $,this.setContents(this.getAttribute("contents")),this.iconSet=this.getAttribute("icon-set")?this.getAttribute("icon-type"):"file",this.maxDepth=this.getAttribute("max-depth")?parseInt(this.getAttribute("max-depth")):-1,this.setFilter(this.getAttribute("filter")),this.style.display="block",this.style.maxWidth="fit-content",this.style.margin="0 1rem 0 0",this.base.addEvent(".flk-branch","click",this.emitNodeToggle)}emitNodeToggle(e){e.stopPropagation();const t=F(e,"flk-tree-nav").target,r=z(e,"branchKey");let n=t.contents;const s=r.split(".");for(const o of s)if(n[o])n=n[o];else if(null===n[o])n=null;else{let e=[];for(const a of n)a[o]&&e.push(a[o]);n=e}var e=r.substring(r.indexOf(".")+1),i=t.createLeafText(s.reverse()[0]);t._emit("tree-click",t,{path:e,data:n,key:(i.titleText+" "+i.commentText).trim(),branch:"object"==typeof n})}convertJsonKeyToTitle(e){if(!e)return"";const t=(e="string"!=typeof e?e.toString():e).replace(/([A-Z_])/g,e=>"_"===e?" ":" "+e).trim();return t.charAt(0).toUpperCase()+t.slice(1)}setContents(e){var t=e||this.contents||[];try{switch(typeof t){case"string":this.contents=JSON.parse(t);break;case"object":Array.isArray(t)?this.contents=t:this.contents=[t]}}catch(e){console.log(e)}}applyFilter(e){let t;var r="details"===e.tagName.toLowerCase();t=this.filter.caseSensitive?e.dataset.branchValues.includes(this.filter.value):e.dataset.branchValues.toLowerCase().includes(this.filter.value.toLowerCase()),t?e.parentElement.classList.remove("hidden"):e.parentElement.classList.add("hidden"),r&&t?e.setAttribute("open",""):e.removeAttribute("open")}resetTree(e){e.parentElement.classList.remove("hidden"),e.removeAttribute("open")}filterTree(){let t=setTimeout(()=>{for(const e of this.querySelectorAll("[data-branch-values]"))void 0===this.filter.value||0===this.filter.value.length?this.resetTree(e):this.applyFilter(e);clearTimeout(t)},10)}setFilter(e){const t=e||{};try{switch(typeof t){case"string":t.includes("{")?(this.filter=JSON.parse(t),!1===this.filter.caseSensitive&&(this.filter.value=this.filter.value.toLowerCase())):this.filter.value=e.toLowerCase();break;case"object":this.filter=t}}catch(e){console.log(e)}this.filterTree()}createLeafText(e){var t,r;let n="",s="";return"string"==typeof e&&(e.includes("(")||e.includes("["))?(r=e.indexOf("("),r=-1===(t=e.indexOf("["))?r:t,n=this.convertJsonKeyToTitle(e.substring(0,r)),s=e.substring(r)):n=this.convertJsonKeyToTitle(e),{titleText:n,commentText:s}}createTextTag(n,s){n=this.createLeafText(n);if(n.commentText){let e=document.createElement("div"),t=document.createElement("span"),r=(t.innerText=n.titleText,document.createElement("small"));r.innerText=n.commentText,r.style.marginLeft="1rem",e.append(t,r),e.style.display="inline-flex",e.style.alignItems="center",s.append(e)}else s.innerText=n.titleText}createLeaf(e,t,r,n=[]){let s=document.createElement("li");s.classList.add("cursor-no-select"),s.style.marginTop="0.4rem",s.dataset.branchKey=r;const i="file"===this.iconSet?'':'';s.style.listStyleImage=`url('data:image/svg+xml,${i}')`,s.style.position="relative",s.style.left="2px";let o=document.createElement("span");r=[e].concat(n);if(o.dataset.branchValues=[...new Set(r)].join(),n.length&&(o.dataset.leafKey=r[0]),this.createTextTag(e,o),o.style.position="relative",o.style.top="-3px",s.append(o),t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);const i="file"===this.iconSet?G:H;e.style.listStyleImage=`url('data:image/svg+xml,${i}')`,e.append(s),t.append(e)}else t.append(s)}createBranch(r,t,n,s){if(s===this.maxDepth&&"object"==typeof r)for(const o of Array.isArray(r)?r:Object.keys(r)){let e;r[o]&&(e=this._jsonToValueArray(r[o])),this.createLeaf(o,t,n+"."+o,e)}else if(Array.isArray(r))for(var e in r){var u=document.createElement(this.listType);t.append(this.createBranch(r[e],u,n+"."+e,s+1))}else if(null!==r&&"object"==typeof r){const a=[];for(const l of Object.keys(r)){let e=document.createElement("li"),t=(e.classList.add("cursor-no-select"),e.style.position="relative",e.style.left="2px",e.dataset.branchKey=n+"."+l,document.createElement("details"));t.classList.add("flk-branch"),t.dataset.branchValues=[l].concat(this._jsonToValueArray(r[l])),t.style.position="relative",t.style.top="-3px",t.classList.add("cursor-default");var i=document.createElement("summary");this.createTextTag(l,i),t.append(i),e.append(this.createBranch(r[l],t,n+"."+l,s+1)),a.push(e)}if(t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);var h="file"===this.iconSet?G:H;e.style.listStyleImage=`url('data:image/svg+xml,${h}')`;for(const c of a)e.append(c);t.append(e)}else for(const p of a)t.append(p)}else this.createLeaf(r,t,n);return t}createHtml(){let e=document.createElement(this.listType);var t="file"===this.iconSet?G:'';if(e.style.listStyleImage=`url('data:image/svg+xml,${t}')`,e.style.marginLeft="3rem",this.contents.length){for(const r in this.contents)e=this.createBranch(this.contents[r],e,r,0);this.component=e}else this.component=e}attributeChangedCallback(e,t,r){switch(e){case"contents":this.setContents(r);break;case"icon-set":this.iconSet=r;break;case"max-depth":this.maxDepth="string"==typeof r?parseInt(r):r;break;case"filter":this.setFilter(r)}this.init()}connectedCallback(){this.init()}disconnectedCallback(){this.base.removeEvents(this)}init(){this.createHtml(),this.base.render(this)}}customElements.define("flk-table",W),customElements.define("flk-draggable",J),customElements.define("flk-modal",q),customElements.define("flk-dropdown",K),customElements.define("flk-tree-nav",qn)}(require$$0,require$$2,require$$1$1,require$$1); \ No newline at end of file diff --git a/documentation/src/components/avian/utilities/shadows.vue b/documentation/src/components/avian/utilities/shadows.vue index 4f9162c..a5ab018 100644 --- a/documentation/src/components/avian/utilities/shadows.vue +++ b/documentation/src/components/avian/utilities/shadows.vue @@ -54,11 +54,11 @@ import Card from '../../shared/Card.vue'
Element with shadow-bottom-lg
- shadow-lg-left + shadow-left-lg
Element with shadow-left-lg
- shadow-lg-right + shadow-right-lg
Element with shadow-right-lg
diff --git a/flightkit/components/tree-navigation.js b/flightkit/components/tree-navigation.js index 9137219..521855b 100644 --- a/flightkit/components/tree-navigation.js +++ b/flightkit/components/tree-navigation.js @@ -68,10 +68,12 @@ export class FlightkitTreeNavigation extends HTMLElement { if (data[crumb]) { data = data[crumb]; } + else if (data[crumb] === null) { + data = null + } else { /** Dealing with an array of objects */ let extractedData = []; - for (const obj of data) { if (obj[crumb]) { extractedData.push(obj[crumb]) @@ -266,6 +268,10 @@ export class FlightkitTreeNavigation extends HTMLElement { let allBranchValues = [text].concat(branchValues); leafText.dataset.branchValues = [...new Set(allBranchValues)].join(); + /** This is the 'leaf' but if we have branch values we want to know where we click on */ + if (branchValues.length) { + leafText.dataset.leafKey = allBranchValues[0]; + } this.createTextTag(text, leafText); @@ -291,28 +297,12 @@ export class FlightkitTreeNavigation extends HTMLElement { if (depth === this.maxDepth && typeof node === 'object') { let leafNodes = Array.isArray(node) ? node : Object.keys(node); - /** check if array of objects */ - if (typeof leafNodes[0] === 'object') { - let allKeys = []; - - for (const obj of leafNodes) { - allKeys = allKeys.concat(Object.keys(obj)); - } - let uniqueKeys = [...new Set(allKeys)]; - - for (let nodeKey of uniqueKeys) { - let branch = document.createElement(this.listType); - element.append(this.createBranch(nodeKey, branch, `${key}.${nodeKey}`, depth + 1)); - } - } - else { - for (const leaf of leafNodes) { - let branchValues; - if (node[leaf]) { - branchValues = this._jsonToValueArray(node[leaf]); - } - this.createLeaf(leaf, element, key, branchValues); + for (const leaf of leafNodes) { + let branchValues; + if (node[leaf]) { + branchValues = this._jsonToValueArray(node[leaf]); } + this.createLeaf(leaf, element, `${key}.${leaf}`, branchValues); } } else if (Array.isArray(node)) { @@ -368,8 +358,6 @@ export class FlightkitTreeNavigation extends HTMLElement { } } else { - - console.trace({ node, element, key }) this.createLeaf(node, element, key); } return element; From 993c7b7a4af08210f74c690571e0f46e40ac2372 Mon Sep 17 00:00:00 2001 From: Jelmer Veen Date: Mon, 1 Jul 2024 14:30:34 +0200 Subject: [PATCH 3/3] chore: removed autocompleted import --- dist/flightkit-v0.0.4/flightkit.js | 7687 +---------------- dist/flightkit-v0.0.4/flightkit.min.js | 2 +- docs/cdn/ibiss-v0.0.4/flightkit.min.js | 2 +- docs/js/flightkit.min.js | 2 +- .../public/cdn/ibiss-v0.0.4/flightkit.min.js | 2 +- documentation/public/js/flightkit.min.js | 2 +- flightkit/components/tree-navigation.js | 1 - 7 files changed, 7 insertions(+), 7691 deletions(-) diff --git a/dist/flightkit-v0.0.4/flightkit.js b/dist/flightkit-v0.0.4/flightkit.js index a9d7903..b2e62a2 100644 --- a/dist/flightkit-v0.0.4/flightkit.js +++ b/dist/flightkit-v0.0.4/flightkit.js @@ -1,13 +1,6 @@ -(function (require$$0, require$$2, require$$1$1, require$$1) { +(function () { 'use strict'; - function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - - var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0); - var require$$2__default = /*#__PURE__*/_interopDefaultLegacy(require$$2); - var require$$1__default$1 = /*#__PURE__*/_interopDefaultLegacy(require$$1$1); - var require$$1__default = /*#__PURE__*/_interopDefaultLegacy(require$$1); - var DataType; (function (DataType) { DataType["Date"] = "date"; @@ -1916,7682 +1909,6 @@ } } - var picocolors = {exports: {}}; - - let tty = require$$0__default["default"]; - - let isColorSupported = - !("NO_COLOR" in process.env || process.argv.includes("--no-color")) && - ("FORCE_COLOR" in process.env || - process.argv.includes("--color") || - process.platform === "win32" || - (tty.isatty(1) && process.env.TERM !== "dumb") || - "CI" in process.env); - - let formatter = - (open, close, replace = open) => - input => { - let string = "" + input; - let index = string.indexOf(close, open.length); - return ~index - ? open + replaceClose(string, close, replace, index) + close - : open + string + close - }; - - let replaceClose = (string, close, replace, index) => { - let start = string.substring(0, index) + replace; - let end = string.substring(index + close.length); - let nextIndex = end.indexOf(close); - return ~nextIndex ? start + replaceClose(end, close, replace, nextIndex) : start + end - }; - - let createColors = (enabled = isColorSupported) => ({ - isColorSupported: enabled, - reset: enabled ? s => `\x1b[0m${s}\x1b[0m` : String, - bold: enabled ? formatter("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m") : String, - dim: enabled ? formatter("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m") : String, - italic: enabled ? formatter("\x1b[3m", "\x1b[23m") : String, - underline: enabled ? formatter("\x1b[4m", "\x1b[24m") : String, - inverse: enabled ? formatter("\x1b[7m", "\x1b[27m") : String, - hidden: enabled ? formatter("\x1b[8m", "\x1b[28m") : String, - strikethrough: enabled ? formatter("\x1b[9m", "\x1b[29m") : String, - black: enabled ? formatter("\x1b[30m", "\x1b[39m") : String, - red: enabled ? formatter("\x1b[31m", "\x1b[39m") : String, - green: enabled ? formatter("\x1b[32m", "\x1b[39m") : String, - yellow: enabled ? formatter("\x1b[33m", "\x1b[39m") : String, - blue: enabled ? formatter("\x1b[34m", "\x1b[39m") : String, - magenta: enabled ? formatter("\x1b[35m", "\x1b[39m") : String, - cyan: enabled ? formatter("\x1b[36m", "\x1b[39m") : String, - white: enabled ? formatter("\x1b[37m", "\x1b[39m") : String, - gray: enabled ? formatter("\x1b[90m", "\x1b[39m") : String, - bgBlack: enabled ? formatter("\x1b[40m", "\x1b[49m") : String, - bgRed: enabled ? formatter("\x1b[41m", "\x1b[49m") : String, - bgGreen: enabled ? formatter("\x1b[42m", "\x1b[49m") : String, - bgYellow: enabled ? formatter("\x1b[43m", "\x1b[49m") : String, - bgBlue: enabled ? formatter("\x1b[44m", "\x1b[49m") : String, - bgMagenta: enabled ? formatter("\x1b[45m", "\x1b[49m") : String, - bgCyan: enabled ? formatter("\x1b[46m", "\x1b[49m") : String, - bgWhite: enabled ? formatter("\x1b[47m", "\x1b[49m") : String, - }); - - picocolors.exports = createColors(); - picocolors.exports.createColors = createColors; - - const SINGLE_QUOTE = "'".charCodeAt(0); - const DOUBLE_QUOTE = '"'.charCodeAt(0); - const BACKSLASH = '\\'.charCodeAt(0); - const SLASH = '/'.charCodeAt(0); - const NEWLINE = '\n'.charCodeAt(0); - const SPACE = ' '.charCodeAt(0); - const FEED = '\f'.charCodeAt(0); - const TAB = '\t'.charCodeAt(0); - const CR = '\r'.charCodeAt(0); - const OPEN_SQUARE = '['.charCodeAt(0); - const CLOSE_SQUARE = ']'.charCodeAt(0); - const OPEN_PARENTHESES = '('.charCodeAt(0); - const CLOSE_PARENTHESES = ')'.charCodeAt(0); - const OPEN_CURLY = '{'.charCodeAt(0); - const CLOSE_CURLY = '}'.charCodeAt(0); - const SEMICOLON = ';'.charCodeAt(0); - const ASTERISK = '*'.charCodeAt(0); - const COLON = ':'.charCodeAt(0); - const AT = '@'.charCodeAt(0); - - const RE_AT_END = /[\t\n\f\r "#'()/;[\\\]{}]/g; - const RE_WORD_END = /[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g; - const RE_BAD_BRACKET = /.[\r\n"'(/\\]/; - const RE_HEX_ESCAPE = /[\da-f]/i; - - var tokenize = function tokenizer(input, options = {}) { - let css = input.css.valueOf(); - let ignore = options.ignoreErrors; - - let code, next, quote, content, escape; - let escaped, escapePos, prev, n, currentToken; - - let length = css.length; - let pos = 0; - let buffer = []; - let returned = []; - - function position() { - return pos - } - - function unclosed(what) { - throw input.error('Unclosed ' + what, pos) - } - - function endOfFile() { - return returned.length === 0 && pos >= length - } - - function nextToken(opts) { - if (returned.length) return returned.pop() - if (pos >= length) return - - let ignoreUnclosed = opts ? opts.ignoreUnclosed : false; - - code = css.charCodeAt(pos); - - switch (code) { - case NEWLINE: - case SPACE: - case TAB: - case CR: - case FEED: { - next = pos; - do { - next += 1; - code = css.charCodeAt(next); - } while ( - code === SPACE || - code === NEWLINE || - code === TAB || - code === CR || - code === FEED - ) - - currentToken = ['space', css.slice(pos, next)]; - pos = next - 1; - break - } - - case OPEN_SQUARE: - case CLOSE_SQUARE: - case OPEN_CURLY: - case CLOSE_CURLY: - case COLON: - case SEMICOLON: - case CLOSE_PARENTHESES: { - let controlChar = String.fromCharCode(code); - currentToken = [controlChar, controlChar, pos]; - break - } - - case OPEN_PARENTHESES: { - prev = buffer.length ? buffer.pop()[1] : ''; - n = css.charCodeAt(pos + 1); - if ( - prev === 'url' && - n !== SINGLE_QUOTE && - n !== DOUBLE_QUOTE && - n !== SPACE && - n !== NEWLINE && - n !== TAB && - n !== FEED && - n !== CR - ) { - next = pos; - do { - escaped = false; - next = css.indexOf(')', next + 1); - if (next === -1) { - if (ignore || ignoreUnclosed) { - next = pos; - break - } else { - unclosed('bracket'); - } - } - escapePos = next; - while (css.charCodeAt(escapePos - 1) === BACKSLASH) { - escapePos -= 1; - escaped = !escaped; - } - } while (escaped) - - currentToken = ['brackets', css.slice(pos, next + 1), pos, next]; - - pos = next; - } else { - next = css.indexOf(')', pos + 1); - content = css.slice(pos, next + 1); - - if (next === -1 || RE_BAD_BRACKET.test(content)) { - currentToken = ['(', '(', pos]; - } else { - currentToken = ['brackets', content, pos, next]; - pos = next; - } - } - - break - } - - case SINGLE_QUOTE: - case DOUBLE_QUOTE: { - quote = code === SINGLE_QUOTE ? "'" : '"'; - next = pos; - do { - escaped = false; - next = css.indexOf(quote, next + 1); - if (next === -1) { - if (ignore || ignoreUnclosed) { - next = pos + 1; - break - } else { - unclosed('string'); - } - } - escapePos = next; - while (css.charCodeAt(escapePos - 1) === BACKSLASH) { - escapePos -= 1; - escaped = !escaped; - } - } while (escaped) - - currentToken = ['string', css.slice(pos, next + 1), pos, next]; - pos = next; - break - } - - case AT: { - RE_AT_END.lastIndex = pos + 1; - RE_AT_END.test(css); - if (RE_AT_END.lastIndex === 0) { - next = css.length - 1; - } else { - next = RE_AT_END.lastIndex - 2; - } - - currentToken = ['at-word', css.slice(pos, next + 1), pos, next]; - - pos = next; - break - } - - case BACKSLASH: { - next = pos; - escape = true; - while (css.charCodeAt(next + 1) === BACKSLASH) { - next += 1; - escape = !escape; - } - code = css.charCodeAt(next + 1); - if ( - escape && - code !== SLASH && - code !== SPACE && - code !== NEWLINE && - code !== TAB && - code !== CR && - code !== FEED - ) { - next += 1; - if (RE_HEX_ESCAPE.test(css.charAt(next))) { - while (RE_HEX_ESCAPE.test(css.charAt(next + 1))) { - next += 1; - } - if (css.charCodeAt(next + 1) === SPACE) { - next += 1; - } - } - } - - currentToken = ['word', css.slice(pos, next + 1), pos, next]; - - pos = next; - break - } - - default: { - if (code === SLASH && css.charCodeAt(pos + 1) === ASTERISK) { - next = css.indexOf('*/', pos + 2) + 1; - if (next === 0) { - if (ignore || ignoreUnclosed) { - next = css.length; - } else { - unclosed('comment'); - } - } - - currentToken = ['comment', css.slice(pos, next + 1), pos, next]; - pos = next; - } else { - RE_WORD_END.lastIndex = pos + 1; - RE_WORD_END.test(css); - if (RE_WORD_END.lastIndex === 0) { - next = css.length - 1; - } else { - next = RE_WORD_END.lastIndex - 2; - } - - currentToken = ['word', css.slice(pos, next + 1), pos, next]; - buffer.push(currentToken); - pos = next; - } - - break - } - } - - pos++; - return currentToken - } - - function back(token) { - returned.push(token); - } - - return { - back, - endOfFile, - nextToken, - position - } - }; - - let pico$1 = picocolors.exports; - - let tokenizer$1 = tokenize; - - let Input$5; - - function registerInput(dependant) { - Input$5 = dependant; - } - - const HIGHLIGHT_THEME = { - ';': pico$1.yellow, - ':': pico$1.yellow, - '(': pico$1.cyan, - ')': pico$1.cyan, - '[': pico$1.yellow, - ']': pico$1.yellow, - '{': pico$1.yellow, - '}': pico$1.yellow, - 'at-word': pico$1.cyan, - 'brackets': pico$1.cyan, - 'call': pico$1.cyan, - 'class': pico$1.yellow, - 'comment': pico$1.gray, - 'hash': pico$1.magenta, - 'string': pico$1.green - }; - - function getTokenType([type, value], processor) { - if (type === 'word') { - if (value[0] === '.') { - return 'class' - } - if (value[0] === '#') { - return 'hash' - } - } - - if (!processor.endOfFile()) { - let next = processor.nextToken(); - processor.back(next); - if (next[0] === 'brackets' || next[0] === '(') return 'call' - } - - return type - } - - function terminalHighlight$2(css) { - let processor = tokenizer$1(new Input$5(css), { ignoreErrors: true }); - let result = ''; - while (!processor.endOfFile()) { - let token = processor.nextToken(); - let color = HIGHLIGHT_THEME[getTokenType(token, processor)]; - if (color) { - result += token[1] - .split(/\r?\n/) - .map(i => color(i)) - .join('\n'); - } else { - result += token[1]; - } - } - return result - } - - terminalHighlight$2.registerInput = registerInput; - - var terminalHighlight_1 = terminalHighlight$2; - - let pico = picocolors.exports; - - let terminalHighlight$1 = terminalHighlight_1; - - class CssSyntaxError$3 extends Error { - constructor(message, line, column, source, file, plugin) { - super(message); - this.name = 'CssSyntaxError'; - this.reason = message; - - if (file) { - this.file = file; - } - if (source) { - this.source = source; - } - if (plugin) { - this.plugin = plugin; - } - if (typeof line !== 'undefined' && typeof column !== 'undefined') { - if (typeof line === 'number') { - this.line = line; - this.column = column; - } else { - this.line = line.line; - this.column = line.column; - this.endLine = column.line; - this.endColumn = column.column; - } - } - - this.setMessage(); - - if (Error.captureStackTrace) { - Error.captureStackTrace(this, CssSyntaxError$3); - } - } - - setMessage() { - this.message = this.plugin ? this.plugin + ': ' : ''; - this.message += this.file ? this.file : ''; - if (typeof this.line !== 'undefined') { - this.message += ':' + this.line + ':' + this.column; - } - this.message += ': ' + this.reason; - } - - showSourceCode(color) { - if (!this.source) return '' - - let css = this.source; - if (color == null) color = pico.isColorSupported; - if (terminalHighlight$1) { - if (color) css = terminalHighlight$1(css); - } - - let lines = css.split(/\r?\n/); - let start = Math.max(this.line - 3, 0); - let end = Math.min(this.line + 2, lines.length); - - let maxWidth = String(end).length; - - let mark, aside; - if (color) { - let { bold, gray, red } = pico.createColors(true); - mark = text => bold(red(text)); - aside = text => gray(text); - } else { - mark = aside = str => str; - } - - return lines - .slice(start, end) - .map((line, index) => { - let number = start + 1 + index; - let gutter = ' ' + (' ' + number).slice(-maxWidth) + ' | '; - if (number === this.line) { - let spacing = - aside(gutter.replace(/\d/g, ' ')) + - line.slice(0, this.column - 1).replace(/[^\t]/g, ' '); - return mark('>') + aside(gutter) + line + '\n ' + spacing + mark('^') - } - return ' ' + aside(gutter) + line - }) - .join('\n') - } - - toString() { - let code = this.showSourceCode(); - if (code) { - code = '\n\n' + code + '\n'; - } - return this.name + ': ' + this.message + code - } - } - - var cssSyntaxError = CssSyntaxError$3; - CssSyntaxError$3.default = CssSyntaxError$3; - - var symbols = {}; - - symbols.isClean = Symbol('isClean'); - - symbols.my = Symbol('my'); - - const DEFAULT_RAW = { - after: '\n', - beforeClose: '\n', - beforeComment: '\n', - beforeDecl: '\n', - beforeOpen: ' ', - beforeRule: '\n', - colon: ': ', - commentLeft: ' ', - commentRight: ' ', - emptyBody: '', - indent: ' ', - semicolon: false - }; - - function capitalize(str) { - return str[0].toUpperCase() + str.slice(1) - } - - class Stringifier$2 { - constructor(builder) { - this.builder = builder; - } - - atrule(node, semicolon) { - let name = '@' + node.name; - let params = node.params ? this.rawValue(node, 'params') : ''; - - if (typeof node.raws.afterName !== 'undefined') { - name += node.raws.afterName; - } else if (params) { - name += ' '; - } - - if (node.nodes) { - this.block(node, name + params); - } else { - let end = (node.raws.between || '') + (semicolon ? ';' : ''); - this.builder(name + params + end, node); - } - } - - beforeAfter(node, detect) { - let value; - if (node.type === 'decl') { - value = this.raw(node, null, 'beforeDecl'); - } else if (node.type === 'comment') { - value = this.raw(node, null, 'beforeComment'); - } else if (detect === 'before') { - value = this.raw(node, null, 'beforeRule'); - } else { - value = this.raw(node, null, 'beforeClose'); - } - - let buf = node.parent; - let depth = 0; - while (buf && buf.type !== 'root') { - depth += 1; - buf = buf.parent; - } - - if (value.includes('\n')) { - let indent = this.raw(node, null, 'indent'); - if (indent.length) { - for (let step = 0; step < depth; step++) value += indent; - } - } - - return value - } - - block(node, start) { - let between = this.raw(node, 'between', 'beforeOpen'); - this.builder(start + between + '{', node, 'start'); - - let after; - if (node.nodes && node.nodes.length) { - this.body(node); - after = this.raw(node, 'after'); - } else { - after = this.raw(node, 'after', 'emptyBody'); - } - - if (after) this.builder(after); - this.builder('}', node, 'end'); - } - - body(node) { - let last = node.nodes.length - 1; - while (last > 0) { - if (node.nodes[last].type !== 'comment') break - last -= 1; - } - - let semicolon = this.raw(node, 'semicolon'); - for (let i = 0; i < node.nodes.length; i++) { - let child = node.nodes[i]; - let before = this.raw(child, 'before'); - if (before) this.builder(before); - this.stringify(child, last !== i || semicolon); - } - } - - comment(node) { - let left = this.raw(node, 'left', 'commentLeft'); - let right = this.raw(node, 'right', 'commentRight'); - this.builder('/*' + left + node.text + right + '*/', node); - } - - decl(node, semicolon) { - let between = this.raw(node, 'between', 'colon'); - let string = node.prop + between + this.rawValue(node, 'value'); - - if (node.important) { - string += node.raws.important || ' !important'; - } - - if (semicolon) string += ';'; - this.builder(string, node); - } - - document(node) { - this.body(node); - } - - raw(node, own, detect) { - let value; - if (!detect) detect = own; - - // Already had - if (own) { - value = node.raws[own]; - if (typeof value !== 'undefined') return value - } - - let parent = node.parent; - - if (detect === 'before') { - // Hack for first rule in CSS - if (!parent || (parent.type === 'root' && parent.first === node)) { - return '' - } - - // `root` nodes in `document` should use only their own raws - if (parent && parent.type === 'document') { - return '' - } - } - - // Floating child without parent - if (!parent) return DEFAULT_RAW[detect] - - // Detect style by other nodes - let root = node.root(); - if (!root.rawCache) root.rawCache = {}; - if (typeof root.rawCache[detect] !== 'undefined') { - return root.rawCache[detect] - } - - if (detect === 'before' || detect === 'after') { - return this.beforeAfter(node, detect) - } else { - let method = 'raw' + capitalize(detect); - if (this[method]) { - value = this[method](root, node); - } else { - root.walk(i => { - value = i.raws[own]; - if (typeof value !== 'undefined') return false - }); - } - } - - if (typeof value === 'undefined') value = DEFAULT_RAW[detect]; - - root.rawCache[detect] = value; - return value - } - - rawBeforeClose(root) { - let value; - root.walk(i => { - if (i.nodes && i.nodes.length > 0) { - if (typeof i.raws.after !== 'undefined') { - value = i.raws.after; - if (value.includes('\n')) { - value = value.replace(/[^\n]+$/, ''); - } - return false - } - } - }); - if (value) value = value.replace(/\S/g, ''); - return value - } - - rawBeforeComment(root, node) { - let value; - root.walkComments(i => { - if (typeof i.raws.before !== 'undefined') { - value = i.raws.before; - if (value.includes('\n')) { - value = value.replace(/[^\n]+$/, ''); - } - return false - } - }); - if (typeof value === 'undefined') { - value = this.raw(node, null, 'beforeDecl'); - } else if (value) { - value = value.replace(/\S/g, ''); - } - return value - } - - rawBeforeDecl(root, node) { - let value; - root.walkDecls(i => { - if (typeof i.raws.before !== 'undefined') { - value = i.raws.before; - if (value.includes('\n')) { - value = value.replace(/[^\n]+$/, ''); - } - return false - } - }); - if (typeof value === 'undefined') { - value = this.raw(node, null, 'beforeRule'); - } else if (value) { - value = value.replace(/\S/g, ''); - } - return value - } - - rawBeforeOpen(root) { - let value; - root.walk(i => { - if (i.type !== 'decl') { - value = i.raws.between; - if (typeof value !== 'undefined') return false - } - }); - return value - } - - rawBeforeRule(root) { - let value; - root.walk(i => { - if (i.nodes && (i.parent !== root || root.first !== i)) { - if (typeof i.raws.before !== 'undefined') { - value = i.raws.before; - if (value.includes('\n')) { - value = value.replace(/[^\n]+$/, ''); - } - return false - } - } - }); - if (value) value = value.replace(/\S/g, ''); - return value - } - - rawColon(root) { - let value; - root.walkDecls(i => { - if (typeof i.raws.between !== 'undefined') { - value = i.raws.between.replace(/[^\s:]/g, ''); - return false - } - }); - return value - } - - rawEmptyBody(root) { - let value; - root.walk(i => { - if (i.nodes && i.nodes.length === 0) { - value = i.raws.after; - if (typeof value !== 'undefined') return false - } - }); - return value - } - - rawIndent(root) { - if (root.raws.indent) return root.raws.indent - let value; - root.walk(i => { - let p = i.parent; - if (p && p !== root && p.parent && p.parent === root) { - if (typeof i.raws.before !== 'undefined') { - let parts = i.raws.before.split('\n'); - value = parts[parts.length - 1]; - value = value.replace(/\S/g, ''); - return false - } - } - }); - return value - } - - rawSemicolon(root) { - let value; - root.walk(i => { - if (i.nodes && i.nodes.length && i.last.type === 'decl') { - value = i.raws.semicolon; - if (typeof value !== 'undefined') return false - } - }); - return value - } - - rawValue(node, prop) { - let value = node[prop]; - let raw = node.raws[prop]; - if (raw && raw.value === value) { - return raw.raw - } - - return value - } - - root(node) { - this.body(node); - if (node.raws.after) this.builder(node.raws.after); - } - - rule(node) { - this.block(node, this.rawValue(node, 'selector')); - if (node.raws.ownSemicolon) { - this.builder(node.raws.ownSemicolon, node, 'end'); - } - } - - stringify(node, semicolon) { - /* c8 ignore start */ - if (!this[node.type]) { - throw new Error( - 'Unknown AST node type ' + - node.type + - '. ' + - 'Maybe you need to change PostCSS stringifier.' - ) - } - /* c8 ignore stop */ - this[node.type](node, semicolon); - } - } - - var stringifier = Stringifier$2; - Stringifier$2.default = Stringifier$2; - - let Stringifier$1 = stringifier; - - function stringify$4(node, builder) { - let str = new Stringifier$1(builder); - str.stringify(node); - } - - var stringify_1 = stringify$4; - stringify$4.default = stringify$4; - - let { isClean: isClean$2, my: my$2 } = symbols; - let CssSyntaxError$2 = cssSyntaxError; - let Stringifier = stringifier; - let stringify$3 = stringify_1; - - function cloneNode(obj, parent) { - let cloned = new obj.constructor(); - - for (let i in obj) { - if (!Object.prototype.hasOwnProperty.call(obj, i)) { - /* c8 ignore next 2 */ - continue - } - if (i === 'proxyCache') continue - let value = obj[i]; - let type = typeof value; - - if (i === 'parent' && type === 'object') { - if (parent) cloned[i] = parent; - } else if (i === 'source') { - cloned[i] = value; - } else if (Array.isArray(value)) { - cloned[i] = value.map(j => cloneNode(j, cloned)); - } else { - if (type === 'object' && value !== null) value = cloneNode(value); - cloned[i] = value; - } - } - - return cloned - } - - class Node$4 { - constructor(defaults = {}) { - this.raws = {}; - this[isClean$2] = false; - this[my$2] = true; - - for (let name in defaults) { - if (name === 'nodes') { - this.nodes = []; - for (let node of defaults[name]) { - if (typeof node.clone === 'function') { - this.append(node.clone()); - } else { - this.append(node); - } - } - } else { - this[name] = defaults[name]; - } - } - } - - addToError(error) { - error.postcssNode = this; - if (error.stack && this.source && /\n\s{4}at /.test(error.stack)) { - let s = this.source; - error.stack = error.stack.replace( - /\n\s{4}at /, - `$&${s.input.from}:${s.start.line}:${s.start.column}$&` - ); - } - return error - } - - after(add) { - this.parent.insertAfter(this, add); - return this - } - - assign(overrides = {}) { - for (let name in overrides) { - this[name] = overrides[name]; - } - return this - } - - before(add) { - this.parent.insertBefore(this, add); - return this - } - - cleanRaws(keepBetween) { - delete this.raws.before; - delete this.raws.after; - if (!keepBetween) delete this.raws.between; - } - - clone(overrides = {}) { - let cloned = cloneNode(this); - for (let name in overrides) { - cloned[name] = overrides[name]; - } - return cloned - } - - cloneAfter(overrides = {}) { - let cloned = this.clone(overrides); - this.parent.insertAfter(this, cloned); - return cloned - } - - cloneBefore(overrides = {}) { - let cloned = this.clone(overrides); - this.parent.insertBefore(this, cloned); - return cloned - } - - error(message, opts = {}) { - if (this.source) { - let { end, start } = this.rangeBy(opts); - return this.source.input.error( - message, - { column: start.column, line: start.line }, - { column: end.column, line: end.line }, - opts - ) - } - return new CssSyntaxError$2(message) - } - - getProxyProcessor() { - return { - get(node, prop) { - if (prop === 'proxyOf') { - return node - } else if (prop === 'root') { - return () => node.root().toProxy() - } else { - return node[prop] - } - }, - - set(node, prop, value) { - if (node[prop] === value) return true - node[prop] = value; - if ( - prop === 'prop' || - prop === 'value' || - prop === 'name' || - prop === 'params' || - prop === 'important' || - /* c8 ignore next */ - prop === 'text' - ) { - node.markDirty(); - } - return true - } - } - } - - markDirty() { - if (this[isClean$2]) { - this[isClean$2] = false; - let next = this; - while ((next = next.parent)) { - next[isClean$2] = false; - } - } - } - - next() { - if (!this.parent) return undefined - let index = this.parent.index(this); - return this.parent.nodes[index + 1] - } - - positionBy(opts, stringRepresentation) { - let pos = this.source.start; - if (opts.index) { - pos = this.positionInside(opts.index, stringRepresentation); - } else if (opts.word) { - stringRepresentation = this.toString(); - let index = stringRepresentation.indexOf(opts.word); - if (index !== -1) pos = this.positionInside(index, stringRepresentation); - } - return pos - } - - positionInside(index, stringRepresentation) { - let string = stringRepresentation || this.toString(); - let column = this.source.start.column; - let line = this.source.start.line; - - for (let i = 0; i < index; i++) { - if (string[i] === '\n') { - column = 1; - line += 1; - } else { - column += 1; - } - } - - return { column, line } - } - - prev() { - if (!this.parent) return undefined - let index = this.parent.index(this); - return this.parent.nodes[index - 1] - } - - rangeBy(opts) { - let start = { - column: this.source.start.column, - line: this.source.start.line - }; - let end = this.source.end - ? { - column: this.source.end.column + 1, - line: this.source.end.line - } - : { - column: start.column + 1, - line: start.line - }; - - if (opts.word) { - let stringRepresentation = this.toString(); - let index = stringRepresentation.indexOf(opts.word); - if (index !== -1) { - start = this.positionInside(index, stringRepresentation); - end = this.positionInside(index + opts.word.length, stringRepresentation); - } - } else { - if (opts.start) { - start = { - column: opts.start.column, - line: opts.start.line - }; - } else if (opts.index) { - start = this.positionInside(opts.index); - } - - if (opts.end) { - end = { - column: opts.end.column, - line: opts.end.line - }; - } else if (opts.endIndex) { - end = this.positionInside(opts.endIndex); - } else if (opts.index) { - end = this.positionInside(opts.index + 1); - } - } - - if ( - end.line < start.line || - (end.line === start.line && end.column <= start.column) - ) { - end = { column: start.column + 1, line: start.line }; - } - - return { end, start } - } - - raw(prop, defaultType) { - let str = new Stringifier(); - return str.raw(this, prop, defaultType) - } - - remove() { - if (this.parent) { - this.parent.removeChild(this); - } - this.parent = undefined; - return this - } - - replaceWith(...nodes) { - if (this.parent) { - let bookmark = this; - let foundSelf = false; - for (let node of nodes) { - if (node === this) { - foundSelf = true; - } else if (foundSelf) { - this.parent.insertAfter(bookmark, node); - bookmark = node; - } else { - this.parent.insertBefore(bookmark, node); - } - } - - if (!foundSelf) { - this.remove(); - } - } - - return this - } - - root() { - let result = this; - while (result.parent && result.parent.type !== 'document') { - result = result.parent; - } - return result - } - - toJSON(_, inputs) { - let fixed = {}; - let emitInputs = inputs == null; - inputs = inputs || new Map(); - let inputsNextIndex = 0; - - for (let name in this) { - if (!Object.prototype.hasOwnProperty.call(this, name)) { - /* c8 ignore next 2 */ - continue - } - if (name === 'parent' || name === 'proxyCache') continue - let value = this[name]; - - if (Array.isArray(value)) { - fixed[name] = value.map(i => { - if (typeof i === 'object' && i.toJSON) { - return i.toJSON(null, inputs) - } else { - return i - } - }); - } else if (typeof value === 'object' && value.toJSON) { - fixed[name] = value.toJSON(null, inputs); - } else if (name === 'source') { - let inputId = inputs.get(value.input); - if (inputId == null) { - inputId = inputsNextIndex; - inputs.set(value.input, inputsNextIndex); - inputsNextIndex++; - } - fixed[name] = { - end: value.end, - inputId, - start: value.start - }; - } else { - fixed[name] = value; - } - } - - if (emitInputs) { - fixed.inputs = [...inputs.keys()].map(input => input.toJSON()); - } - - return fixed - } - - toProxy() { - if (!this.proxyCache) { - this.proxyCache = new Proxy(this, this.getProxyProcessor()); - } - return this.proxyCache - } - - toString(stringifier = stringify$3) { - if (stringifier.stringify) stringifier = stringifier.stringify; - let result = ''; - stringifier(this, i => { - result += i; - }); - return result - } - - warn(result, text, opts) { - let data = { node: this }; - for (let i in opts) data[i] = opts[i]; - return result.warn(text, data) - } - - get proxyOf() { - return this - } - } - - var node_1 = Node$4; - Node$4.default = Node$4; - - let Node$3 = node_1; - - class Declaration$4 extends Node$3 { - constructor(defaults) { - if ( - defaults && - typeof defaults.value !== 'undefined' && - typeof defaults.value !== 'string' - ) { - defaults = { ...defaults, value: String(defaults.value) }; - } - super(defaults); - this.type = 'decl'; - } - - get variable() { - return this.prop.startsWith('--') || this.prop[0] === '$' - } - } - - var declaration = Declaration$4; - Declaration$4.default = Declaration$4; - - var sourceMap = {}; - - var sourceMapGenerator = {}; - - var base64Vlq = {}; - - var base64$1 = {}; - - /* -*- Mode: js; js-indent-level: 2; -*- */ - - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split(''); - - /** - * Encode an integer in the range of 0 to 63 to a single base 64 digit. - */ - base64$1.encode = function (number) { - if (0 <= number && number < intToCharMap.length) { - return intToCharMap[number]; - } - throw new TypeError("Must be between 0 and 63: " + number); - }; - - /** - * Decode a single base 64 character code digit to an integer. Returns -1 on - * failure. - */ - base64$1.decode = function (charCode) { - var bigA = 65; // 'A' - var bigZ = 90; // 'Z' - - var littleA = 97; // 'a' - var littleZ = 122; // 'z' - - var zero = 48; // '0' - var nine = 57; // '9' - - var plus = 43; // '+' - var slash = 47; // '/' - - var littleOffset = 26; - var numberOffset = 52; - - // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ - if (bigA <= charCode && charCode <= bigZ) { - return (charCode - bigA); - } - - // 26 - 51: abcdefghijklmnopqrstuvwxyz - if (littleA <= charCode && charCode <= littleZ) { - return (charCode - littleA + littleOffset); - } - - // 52 - 61: 0123456789 - if (zero <= charCode && charCode <= nine) { - return (charCode - zero + numberOffset); - } - - // 62: + - if (charCode == plus) { - return 62; - } - - // 63: / - if (charCode == slash) { - return 63; - } - - // Invalid base64 digit. - return -1; - }; - - /* -*- Mode: js; js-indent-level: 2; -*- */ - - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - * - * Based on the Base 64 VLQ implementation in Closure Compiler: - * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java - * - * Copyright 2011 The Closure Compiler Authors. All rights reserved. - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - var base64 = base64$1; - - // A single base 64 digit can contain 6 bits of data. For the base 64 variable - // length quantities we use in the source map spec, the first bit is the sign, - // the next four bits are the actual value, and the 6th bit is the - // continuation bit. The continuation bit tells us whether there are more - // digits in this value following this digit. - // - // Continuation - // | Sign - // | | - // V V - // 101011 - - var VLQ_BASE_SHIFT = 5; - - // binary: 100000 - var VLQ_BASE = 1 << VLQ_BASE_SHIFT; - - // binary: 011111 - var VLQ_BASE_MASK = VLQ_BASE - 1; - - // binary: 100000 - var VLQ_CONTINUATION_BIT = VLQ_BASE; - - /** - * Converts from a two-complement value to a value where the sign bit is - * placed in the least significant bit. For example, as decimals: - * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) - * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) - */ - function toVLQSigned(aValue) { - return aValue < 0 - ? ((-aValue) << 1) + 1 - : (aValue << 1) + 0; - } - - /** - * Converts to a two-complement value from a value where the sign bit is - * placed in the least significant bit. For example, as decimals: - * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 - * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 - */ - function fromVLQSigned(aValue) { - var isNegative = (aValue & 1) === 1; - var shifted = aValue >> 1; - return isNegative - ? -shifted - : shifted; - } - - /** - * Returns the base 64 VLQ encoded value. - */ - base64Vlq.encode = function base64VLQ_encode(aValue) { - var encoded = ""; - var digit; - - var vlq = toVLQSigned(aValue); - - do { - digit = vlq & VLQ_BASE_MASK; - vlq >>>= VLQ_BASE_SHIFT; - if (vlq > 0) { - // There are still more digits in this value, so we must make sure the - // continuation bit is marked. - digit |= VLQ_CONTINUATION_BIT; - } - encoded += base64.encode(digit); - } while (vlq > 0); - - return encoded; - }; - - /** - * Decodes the next base 64 VLQ value from the given string and returns the - * value and the rest of the string via the out parameter. - */ - base64Vlq.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) { - var strLen = aStr.length; - var result = 0; - var shift = 0; - var continuation, digit; - - do { - if (aIndex >= strLen) { - throw new Error("Expected more digits in base 64 VLQ value."); - } - - digit = base64.decode(aStr.charCodeAt(aIndex++)); - if (digit === -1) { - throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1)); - } - - continuation = !!(digit & VLQ_CONTINUATION_BIT); - digit &= VLQ_BASE_MASK; - result = result + (digit << shift); - shift += VLQ_BASE_SHIFT; - } while (continuation); - - aOutParam.value = fromVLQSigned(result); - aOutParam.rest = aIndex; - }; - - var util$5 = {}; - - /* -*- Mode: js; js-indent-level: 2; -*- */ - - (function (exports) { - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - /** - * This is a helper function for getting values from parameter/options - * objects. - * - * @param args The object we are extracting values from - * @param name The name of the property we are getting. - * @param defaultValue An optional value to return if the property is missing - * from the object. If this is not specified and the property is missing, an - * error will be thrown. - */ - function getArg(aArgs, aName, aDefaultValue) { - if (aName in aArgs) { - return aArgs[aName]; - } else if (arguments.length === 3) { - return aDefaultValue; - } else { - throw new Error('"' + aName + '" is a required argument.'); - } - } - exports.getArg = getArg; - - var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/; - var dataUrlRegexp = /^data:.+\,.+$/; - - function urlParse(aUrl) { - var match = aUrl.match(urlRegexp); - if (!match) { - return null; - } - return { - scheme: match[1], - auth: match[2], - host: match[3], - port: match[4], - path: match[5] - }; - } - exports.urlParse = urlParse; - - function urlGenerate(aParsedUrl) { - var url = ''; - if (aParsedUrl.scheme) { - url += aParsedUrl.scheme + ':'; - } - url += '//'; - if (aParsedUrl.auth) { - url += aParsedUrl.auth + '@'; - } - if (aParsedUrl.host) { - url += aParsedUrl.host; - } - if (aParsedUrl.port) { - url += ":" + aParsedUrl.port; - } - if (aParsedUrl.path) { - url += aParsedUrl.path; - } - return url; - } - exports.urlGenerate = urlGenerate; - - var MAX_CACHED_INPUTS = 32; - - /** - * Takes some function `f(input) -> result` and returns a memoized version of - * `f`. - * - * We keep at most `MAX_CACHED_INPUTS` memoized results of `f` alive. The - * memoization is a dumb-simple, linear least-recently-used cache. - */ - function lruMemoize(f) { - var cache = []; - - return function(input) { - for (var i = 0; i < cache.length; i++) { - if (cache[i].input === input) { - var temp = cache[0]; - cache[0] = cache[i]; - cache[i] = temp; - return cache[0].result; - } - } - - var result = f(input); - - cache.unshift({ - input, - result, - }); - - if (cache.length > MAX_CACHED_INPUTS) { - cache.pop(); - } - - return result; - }; - } - - /** - * Normalizes a path, or the path portion of a URL: - * - * - Replaces consecutive slashes with one slash. - * - Removes unnecessary '.' parts. - * - Removes unnecessary '/..' parts. - * - * Based on code in the Node.js 'path' core module. - * - * @param aPath The path or url to normalize. - */ - var normalize = lruMemoize(function normalize(aPath) { - var path = aPath; - var url = urlParse(aPath); - if (url) { - if (!url.path) { - return aPath; - } - path = url.path; - } - var isAbsolute = exports.isAbsolute(path); - // Split the path into parts between `/` characters. This is much faster than - // using `.split(/\/+/g)`. - var parts = []; - var start = 0; - var i = 0; - while (true) { - start = i; - i = path.indexOf("/", start); - if (i === -1) { - parts.push(path.slice(start)); - break; - } else { - parts.push(path.slice(start, i)); - while (i < path.length && path[i] === "/") { - i++; - } - } - } - - for (var part, up = 0, i = parts.length - 1; i >= 0; i--) { - part = parts[i]; - if (part === '.') { - parts.splice(i, 1); - } else if (part === '..') { - up++; - } else if (up > 0) { - if (part === '') { - // The first part is blank if the path is absolute. Trying to go - // above the root is a no-op. Therefore we can remove all '..' parts - // directly after the root. - parts.splice(i + 1, up); - up = 0; - } else { - parts.splice(i, 2); - up--; - } - } - } - path = parts.join('/'); - - if (path === '') { - path = isAbsolute ? '/' : '.'; - } - - if (url) { - url.path = path; - return urlGenerate(url); - } - return path; - }); - exports.normalize = normalize; - - /** - * Joins two paths/URLs. - * - * @param aRoot The root path or URL. - * @param aPath The path or URL to be joined with the root. - * - * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a - * scheme-relative URL: Then the scheme of aRoot, if any, is prepended - * first. - * - Otherwise aPath is a path. If aRoot is a URL, then its path portion - * is updated with the result and aRoot is returned. Otherwise the result - * is returned. - * - If aPath is absolute, the result is aPath. - * - Otherwise the two paths are joined with a slash. - * - Joining for example 'http://' and 'www.example.com' is also supported. - */ - function join(aRoot, aPath) { - if (aRoot === "") { - aRoot = "."; - } - if (aPath === "") { - aPath = "."; - } - var aPathUrl = urlParse(aPath); - var aRootUrl = urlParse(aRoot); - if (aRootUrl) { - aRoot = aRootUrl.path || '/'; - } - - // `join(foo, '//www.example.org')` - if (aPathUrl && !aPathUrl.scheme) { - if (aRootUrl) { - aPathUrl.scheme = aRootUrl.scheme; - } - return urlGenerate(aPathUrl); - } - - if (aPathUrl || aPath.match(dataUrlRegexp)) { - return aPath; - } - - // `join('http://', 'www.example.com')` - if (aRootUrl && !aRootUrl.host && !aRootUrl.path) { - aRootUrl.host = aPath; - return urlGenerate(aRootUrl); - } - - var joined = aPath.charAt(0) === '/' - ? aPath - : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath); - - if (aRootUrl) { - aRootUrl.path = joined; - return urlGenerate(aRootUrl); - } - return joined; - } - exports.join = join; - - exports.isAbsolute = function (aPath) { - return aPath.charAt(0) === '/' || urlRegexp.test(aPath); - }; - - /** - * Make a path relative to a URL or another path. - * - * @param aRoot The root path or URL. - * @param aPath The path or URL to be made relative to aRoot. - */ - function relative(aRoot, aPath) { - if (aRoot === "") { - aRoot = "."; - } - - aRoot = aRoot.replace(/\/$/, ''); - - // It is possible for the path to be above the root. In this case, simply - // checking whether the root is a prefix of the path won't work. Instead, we - // need to remove components from the root one by one, until either we find - // a prefix that fits, or we run out of components to remove. - var level = 0; - while (aPath.indexOf(aRoot + '/') !== 0) { - var index = aRoot.lastIndexOf("/"); - if (index < 0) { - return aPath; - } - - // If the only part of the root that is left is the scheme (i.e. http://, - // file:///, etc.), one or more slashes (/), or simply nothing at all, we - // have exhausted all components, so the path is not relative to the root. - aRoot = aRoot.slice(0, index); - if (aRoot.match(/^([^\/]+:\/)?\/*$/)) { - return aPath; - } - - ++level; - } - - // Make sure we add a "../" for each component we removed from the root. - return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1); - } - exports.relative = relative; - - var supportsNullProto = (function () { - var obj = Object.create(null); - return !('__proto__' in obj); - }()); - - function identity (s) { - return s; - } - - /** - * Because behavior goes wacky when you set `__proto__` on objects, we - * have to prefix all the strings in our set with an arbitrary character. - * - * See https://github.com/mozilla/source-map/pull/31 and - * https://github.com/mozilla/source-map/issues/30 - * - * @param String aStr - */ - function toSetString(aStr) { - if (isProtoString(aStr)) { - return '$' + aStr; - } - - return aStr; - } - exports.toSetString = supportsNullProto ? identity : toSetString; - - function fromSetString(aStr) { - if (isProtoString(aStr)) { - return aStr.slice(1); - } - - return aStr; - } - exports.fromSetString = supportsNullProto ? identity : fromSetString; - - function isProtoString(s) { - if (!s) { - return false; - } - - var length = s.length; - - if (length < 9 /* "__proto__".length */) { - return false; - } - - if (s.charCodeAt(length - 1) !== 95 /* '_' */ || - s.charCodeAt(length - 2) !== 95 /* '_' */ || - s.charCodeAt(length - 3) !== 111 /* 'o' */ || - s.charCodeAt(length - 4) !== 116 /* 't' */ || - s.charCodeAt(length - 5) !== 111 /* 'o' */ || - s.charCodeAt(length - 6) !== 114 /* 'r' */ || - s.charCodeAt(length - 7) !== 112 /* 'p' */ || - s.charCodeAt(length - 8) !== 95 /* '_' */ || - s.charCodeAt(length - 9) !== 95 /* '_' */) { - return false; - } - - for (var i = length - 10; i >= 0; i--) { - if (s.charCodeAt(i) !== 36 /* '$' */) { - return false; - } - } - - return true; - } - - /** - * Comparator between two mappings where the original positions are compared. - * - * Optionally pass in `true` as `onlyCompareGenerated` to consider two - * mappings with the same original source/line/column, but different generated - * line and column the same. Useful when searching for a mapping with a - * stubbed out mapping. - */ - function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) { - var cmp = strcmp(mappingA.source, mappingB.source); - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0 || onlyCompareOriginal) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); - } - exports.compareByOriginalPositions = compareByOriginalPositions; - - function compareByOriginalPositionsNoSource(mappingA, mappingB, onlyCompareOriginal) { - var cmp; - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0 || onlyCompareOriginal) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); - } - exports.compareByOriginalPositionsNoSource = compareByOriginalPositionsNoSource; - - /** - * Comparator between two mappings with deflated source and name indices where - * the generated positions are compared. - * - * Optionally pass in `true` as `onlyCompareGenerated` to consider two - * mappings with the same generated line and column, but different - * source/name/original line and column the same. Useful when searching for a - * mapping with a stubbed out mapping. - */ - function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) { - var cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0 || onlyCompareGenerated) { - return cmp; - } - - cmp = strcmp(mappingA.source, mappingB.source); - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); - } - exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated; - - function compareByGeneratedPositionsDeflatedNoLine(mappingA, mappingB, onlyCompareGenerated) { - var cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0 || onlyCompareGenerated) { - return cmp; - } - - cmp = strcmp(mappingA.source, mappingB.source); - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); - } - exports.compareByGeneratedPositionsDeflatedNoLine = compareByGeneratedPositionsDeflatedNoLine; - - function strcmp(aStr1, aStr2) { - if (aStr1 === aStr2) { - return 0; - } - - if (aStr1 === null) { - return 1; // aStr2 !== null - } - - if (aStr2 === null) { - return -1; // aStr1 !== null - } - - if (aStr1 > aStr2) { - return 1; - } - - return -1; - } - - /** - * Comparator between two mappings with inflated source and name strings where - * the generated positions are compared. - */ - function compareByGeneratedPositionsInflated(mappingA, mappingB) { - var cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0) { - return cmp; - } - - cmp = strcmp(mappingA.source, mappingB.source); - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); - } - exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated; - - /** - * Strip any JSON XSSI avoidance prefix from the string (as documented - * in the source maps specification), and then parse the string as - * JSON. - */ - function parseSourceMapInput(str) { - return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, '')); - } - exports.parseSourceMapInput = parseSourceMapInput; - - /** - * Compute the URL of a source given the the source root, the source's - * URL, and the source map's URL. - */ - function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) { - sourceURL = sourceURL || ''; - - if (sourceRoot) { - // This follows what Chrome does. - if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') { - sourceRoot += '/'; - } - // The spec says: - // Line 4: An optional source root, useful for relocating source - // files on a server or removing repeated values in the - // “sources” entry. This value is prepended to the individual - // entries in the “source” field. - sourceURL = sourceRoot + sourceURL; - } - - // Historically, SourceMapConsumer did not take the sourceMapURL as - // a parameter. This mode is still somewhat supported, which is why - // this code block is conditional. However, it's preferable to pass - // the source map URL to SourceMapConsumer, so that this function - // can implement the source URL resolution algorithm as outlined in - // the spec. This block is basically the equivalent of: - // new URL(sourceURL, sourceMapURL).toString() - // ... except it avoids using URL, which wasn't available in the - // older releases of node still supported by this library. - // - // The spec says: - // If the sources are not absolute URLs after prepending of the - // “sourceRoot”, the sources are resolved relative to the - // SourceMap (like resolving script src in a html document). - if (sourceMapURL) { - var parsed = urlParse(sourceMapURL); - if (!parsed) { - throw new Error("sourceMapURL could not be parsed"); - } - if (parsed.path) { - // Strip the last path component, but keep the "/". - var index = parsed.path.lastIndexOf('/'); - if (index >= 0) { - parsed.path = parsed.path.substring(0, index + 1); - } - } - sourceURL = join(urlGenerate(parsed), sourceURL); - } - - return normalize(sourceURL); - } - exports.computeSourceURL = computeSourceURL; - }(util$5)); - - var arraySet = {}; - - /* -*- Mode: js; js-indent-level: 2; -*- */ - - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - var util$4 = util$5; - var has = Object.prototype.hasOwnProperty; - var hasNativeMap = typeof Map !== "undefined"; - - /** - * A data structure which is a combination of an array and a set. Adding a new - * member is O(1), testing for membership is O(1), and finding the index of an - * element is O(1). Removing elements from the set is not supported. Only - * strings are supported for membership. - */ - function ArraySet$2() { - this._array = []; - this._set = hasNativeMap ? new Map() : Object.create(null); - } - - /** - * Static method for creating ArraySet instances from an existing array. - */ - ArraySet$2.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) { - var set = new ArraySet$2(); - for (var i = 0, len = aArray.length; i < len; i++) { - set.add(aArray[i], aAllowDuplicates); - } - return set; - }; - - /** - * Return how many unique items are in this ArraySet. If duplicates have been - * added, than those do not count towards the size. - * - * @returns Number - */ - ArraySet$2.prototype.size = function ArraySet_size() { - return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length; - }; - - /** - * Add the given string to this set. - * - * @param String aStr - */ - ArraySet$2.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { - var sStr = hasNativeMap ? aStr : util$4.toSetString(aStr); - var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr); - var idx = this._array.length; - if (!isDuplicate || aAllowDuplicates) { - this._array.push(aStr); - } - if (!isDuplicate) { - if (hasNativeMap) { - this._set.set(aStr, idx); - } else { - this._set[sStr] = idx; - } - } - }; - - /** - * Is the given string a member of this set? - * - * @param String aStr - */ - ArraySet$2.prototype.has = function ArraySet_has(aStr) { - if (hasNativeMap) { - return this._set.has(aStr); - } else { - var sStr = util$4.toSetString(aStr); - return has.call(this._set, sStr); - } - }; - - /** - * What is the index of the given string in the array? - * - * @param String aStr - */ - ArraySet$2.prototype.indexOf = function ArraySet_indexOf(aStr) { - if (hasNativeMap) { - var idx = this._set.get(aStr); - if (idx >= 0) { - return idx; - } - } else { - var sStr = util$4.toSetString(aStr); - if (has.call(this._set, sStr)) { - return this._set[sStr]; - } - } - - throw new Error('"' + aStr + '" is not in the set.'); - }; - - /** - * What is the element at the given index? - * - * @param Number aIdx - */ - ArraySet$2.prototype.at = function ArraySet_at(aIdx) { - if (aIdx >= 0 && aIdx < this._array.length) { - return this._array[aIdx]; - } - throw new Error('No element indexed by ' + aIdx); - }; - - /** - * Returns the array representation of this set (which has the proper indices - * indicated by indexOf). Note that this is a copy of the internal array used - * for storing the members so that no one can mess with internal state. - */ - ArraySet$2.prototype.toArray = function ArraySet_toArray() { - return this._array.slice(); - }; - - arraySet.ArraySet = ArraySet$2; - - var mappingList = {}; - - /* -*- Mode: js; js-indent-level: 2; -*- */ - - /* - * Copyright 2014 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - var util$3 = util$5; - - /** - * Determine whether mappingB is after mappingA with respect to generated - * position. - */ - function generatedPositionAfter(mappingA, mappingB) { - // Optimized for most common case - var lineA = mappingA.generatedLine; - var lineB = mappingB.generatedLine; - var columnA = mappingA.generatedColumn; - var columnB = mappingB.generatedColumn; - return lineB > lineA || lineB == lineA && columnB >= columnA || - util$3.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0; - } - - /** - * A data structure to provide a sorted view of accumulated mappings in a - * performance conscious manner. It trades a neglibable overhead in general - * case for a large speedup in case of mappings being added in order. - */ - function MappingList$1() { - this._array = []; - this._sorted = true; - // Serves as infimum - this._last = {generatedLine: -1, generatedColumn: 0}; - } - - /** - * Iterate through internal items. This method takes the same arguments that - * `Array.prototype.forEach` takes. - * - * NOTE: The order of the mappings is NOT guaranteed. - */ - MappingList$1.prototype.unsortedForEach = - function MappingList_forEach(aCallback, aThisArg) { - this._array.forEach(aCallback, aThisArg); - }; - - /** - * Add the given source mapping. - * - * @param Object aMapping - */ - MappingList$1.prototype.add = function MappingList_add(aMapping) { - if (generatedPositionAfter(this._last, aMapping)) { - this._last = aMapping; - this._array.push(aMapping); - } else { - this._sorted = false; - this._array.push(aMapping); - } - }; - - /** - * Returns the flat, sorted array of mappings. The mappings are sorted by - * generated position. - * - * WARNING: This method returns internal data without copying, for - * performance. The return value must NOT be mutated, and should be treated as - * an immutable borrow. If you want to take ownership, you must make your own - * copy. - */ - MappingList$1.prototype.toArray = function MappingList_toArray() { - if (!this._sorted) { - this._array.sort(util$3.compareByGeneratedPositionsInflated); - this._sorted = true; - } - return this._array; - }; - - mappingList.MappingList = MappingList$1; - - /* -*- Mode: js; js-indent-level: 2; -*- */ - - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - var base64VLQ$1 = base64Vlq; - var util$2 = util$5; - var ArraySet$1 = arraySet.ArraySet; - var MappingList = mappingList.MappingList; - - /** - * An instance of the SourceMapGenerator represents a source map which is - * being built incrementally. You may pass an object with the following - * properties: - * - * - file: The filename of the generated source. - * - sourceRoot: A root for all relative URLs in this source map. - */ - function SourceMapGenerator$4(aArgs) { - if (!aArgs) { - aArgs = {}; - } - this._file = util$2.getArg(aArgs, 'file', null); - this._sourceRoot = util$2.getArg(aArgs, 'sourceRoot', null); - this._skipValidation = util$2.getArg(aArgs, 'skipValidation', false); - this._sources = new ArraySet$1(); - this._names = new ArraySet$1(); - this._mappings = new MappingList(); - this._sourcesContents = null; - } - - SourceMapGenerator$4.prototype._version = 3; - - /** - * Creates a new SourceMapGenerator based on a SourceMapConsumer - * - * @param aSourceMapConsumer The SourceMap. - */ - SourceMapGenerator$4.fromSourceMap = - function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) { - var sourceRoot = aSourceMapConsumer.sourceRoot; - var generator = new SourceMapGenerator$4({ - file: aSourceMapConsumer.file, - sourceRoot: sourceRoot - }); - aSourceMapConsumer.eachMapping(function (mapping) { - var newMapping = { - generated: { - line: mapping.generatedLine, - column: mapping.generatedColumn - } - }; - - if (mapping.source != null) { - newMapping.source = mapping.source; - if (sourceRoot != null) { - newMapping.source = util$2.relative(sourceRoot, newMapping.source); - } - - newMapping.original = { - line: mapping.originalLine, - column: mapping.originalColumn - }; - - if (mapping.name != null) { - newMapping.name = mapping.name; - } - } - - generator.addMapping(newMapping); - }); - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var sourceRelative = sourceFile; - if (sourceRoot !== null) { - sourceRelative = util$2.relative(sourceRoot, sourceFile); - } - - if (!generator._sources.has(sourceRelative)) { - generator._sources.add(sourceRelative); - } - - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content != null) { - generator.setSourceContent(sourceFile, content); - } - }); - return generator; - }; - - /** - * Add a single mapping from original source line and column to the generated - * source's line and column for this source map being created. The mapping - * object should have the following properties: - * - * - generated: An object with the generated line and column positions. - * - original: An object with the original line and column positions. - * - source: The original source file (relative to the sourceRoot). - * - name: An optional original token name for this mapping. - */ - SourceMapGenerator$4.prototype.addMapping = - function SourceMapGenerator_addMapping(aArgs) { - var generated = util$2.getArg(aArgs, 'generated'); - var original = util$2.getArg(aArgs, 'original', null); - var source = util$2.getArg(aArgs, 'source', null); - var name = util$2.getArg(aArgs, 'name', null); - - if (!this._skipValidation) { - this._validateMapping(generated, original, source, name); - } - - if (source != null) { - source = String(source); - if (!this._sources.has(source)) { - this._sources.add(source); - } - } - - if (name != null) { - name = String(name); - if (!this._names.has(name)) { - this._names.add(name); - } - } - - this._mappings.add({ - generatedLine: generated.line, - generatedColumn: generated.column, - originalLine: original != null && original.line, - originalColumn: original != null && original.column, - source: source, - name: name - }); - }; - - /** - * Set the source content for a source file. - */ - SourceMapGenerator$4.prototype.setSourceContent = - function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) { - var source = aSourceFile; - if (this._sourceRoot != null) { - source = util$2.relative(this._sourceRoot, source); - } - - if (aSourceContent != null) { - // Add the source content to the _sourcesContents map. - // Create a new _sourcesContents map if the property is null. - if (!this._sourcesContents) { - this._sourcesContents = Object.create(null); - } - this._sourcesContents[util$2.toSetString(source)] = aSourceContent; - } else if (this._sourcesContents) { - // Remove the source file from the _sourcesContents map. - // If the _sourcesContents map is empty, set the property to null. - delete this._sourcesContents[util$2.toSetString(source)]; - if (Object.keys(this._sourcesContents).length === 0) { - this._sourcesContents = null; - } - } - }; - - /** - * Applies the mappings of a sub-source-map for a specific source file to the - * source map being generated. Each mapping to the supplied source file is - * rewritten using the supplied source map. Note: The resolution for the - * resulting mappings is the minimium of this map and the supplied map. - * - * @param aSourceMapConsumer The source map to be applied. - * @param aSourceFile Optional. The filename of the source file. - * If omitted, SourceMapConsumer's file property will be used. - * @param aSourceMapPath Optional. The dirname of the path to the source map - * to be applied. If relative, it is relative to the SourceMapConsumer. - * This parameter is needed when the two source maps aren't in the same - * directory, and the source map to be applied contains relative source - * paths. If so, those relative source paths need to be rewritten - * relative to the SourceMapGenerator. - */ - SourceMapGenerator$4.prototype.applySourceMap = - function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) { - var sourceFile = aSourceFile; - // If aSourceFile is omitted, we will use the file property of the SourceMap - if (aSourceFile == null) { - if (aSourceMapConsumer.file == null) { - throw new Error( - 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' + - 'or the source map\'s "file" property. Both were omitted.' - ); - } - sourceFile = aSourceMapConsumer.file; - } - var sourceRoot = this._sourceRoot; - // Make "sourceFile" relative if an absolute Url is passed. - if (sourceRoot != null) { - sourceFile = util$2.relative(sourceRoot, sourceFile); - } - // Applying the SourceMap can add and remove items from the sources and - // the names array. - var newSources = new ArraySet$1(); - var newNames = new ArraySet$1(); - - // Find mappings for the "sourceFile" - this._mappings.unsortedForEach(function (mapping) { - if (mapping.source === sourceFile && mapping.originalLine != null) { - // Check if it can be mapped by the source map, then update the mapping. - var original = aSourceMapConsumer.originalPositionFor({ - line: mapping.originalLine, - column: mapping.originalColumn - }); - if (original.source != null) { - // Copy mapping - mapping.source = original.source; - if (aSourceMapPath != null) { - mapping.source = util$2.join(aSourceMapPath, mapping.source); - } - if (sourceRoot != null) { - mapping.source = util$2.relative(sourceRoot, mapping.source); - } - mapping.originalLine = original.line; - mapping.originalColumn = original.column; - if (original.name != null) { - mapping.name = original.name; - } - } - } - - var source = mapping.source; - if (source != null && !newSources.has(source)) { - newSources.add(source); - } - - var name = mapping.name; - if (name != null && !newNames.has(name)) { - newNames.add(name); - } - - }, this); - this._sources = newSources; - this._names = newNames; - - // Copy sourcesContents of applied map. - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content != null) { - if (aSourceMapPath != null) { - sourceFile = util$2.join(aSourceMapPath, sourceFile); - } - if (sourceRoot != null) { - sourceFile = util$2.relative(sourceRoot, sourceFile); - } - this.setSourceContent(sourceFile, content); - } - }, this); - }; - - /** - * A mapping can have one of the three levels of data: - * - * 1. Just the generated position. - * 2. The Generated position, original position, and original source. - * 3. Generated and original position, original source, as well as a name - * token. - * - * To maintain consistency, we validate that any new mapping being added falls - * in to one of these categories. - */ - SourceMapGenerator$4.prototype._validateMapping = - function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, - aName) { - // When aOriginal is truthy but has empty values for .line and .column, - // it is most likely a programmer error. In this case we throw a very - // specific error message to try to guide them the right way. - // For example: https://github.com/Polymer/polymer-bundler/pull/519 - if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') { - throw new Error( - 'original.line and original.column are not numbers -- you probably meant to omit ' + - 'the original mapping entirely and only map the generated position. If so, pass ' + - 'null for the original mapping instead of an object with empty or null values.' - ); - } - - if (aGenerated && 'line' in aGenerated && 'column' in aGenerated - && aGenerated.line > 0 && aGenerated.column >= 0 - && !aOriginal && !aSource && !aName) { - // Case 1. - return; - } - else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated - && aOriginal && 'line' in aOriginal && 'column' in aOriginal - && aGenerated.line > 0 && aGenerated.column >= 0 - && aOriginal.line > 0 && aOriginal.column >= 0 - && aSource) { - // Cases 2 and 3. - return; - } - else { - throw new Error('Invalid mapping: ' + JSON.stringify({ - generated: aGenerated, - source: aSource, - original: aOriginal, - name: aName - })); - } - }; - - /** - * Serialize the accumulated mappings in to the stream of base 64 VLQs - * specified by the source map format. - */ - SourceMapGenerator$4.prototype._serializeMappings = - function SourceMapGenerator_serializeMappings() { - var previousGeneratedColumn = 0; - var previousGeneratedLine = 1; - var previousOriginalColumn = 0; - var previousOriginalLine = 0; - var previousName = 0; - var previousSource = 0; - var result = ''; - var next; - var mapping; - var nameIdx; - var sourceIdx; - - var mappings = this._mappings.toArray(); - for (var i = 0, len = mappings.length; i < len; i++) { - mapping = mappings[i]; - next = ''; - - if (mapping.generatedLine !== previousGeneratedLine) { - previousGeneratedColumn = 0; - while (mapping.generatedLine !== previousGeneratedLine) { - next += ';'; - previousGeneratedLine++; - } - } - else { - if (i > 0) { - if (!util$2.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) { - continue; - } - next += ','; - } - } - - next += base64VLQ$1.encode(mapping.generatedColumn - - previousGeneratedColumn); - previousGeneratedColumn = mapping.generatedColumn; - - if (mapping.source != null) { - sourceIdx = this._sources.indexOf(mapping.source); - next += base64VLQ$1.encode(sourceIdx - previousSource); - previousSource = sourceIdx; - - // lines are stored 0-based in SourceMap spec version 3 - next += base64VLQ$1.encode(mapping.originalLine - 1 - - previousOriginalLine); - previousOriginalLine = mapping.originalLine - 1; - - next += base64VLQ$1.encode(mapping.originalColumn - - previousOriginalColumn); - previousOriginalColumn = mapping.originalColumn; - - if (mapping.name != null) { - nameIdx = this._names.indexOf(mapping.name); - next += base64VLQ$1.encode(nameIdx - previousName); - previousName = nameIdx; - } - } - - result += next; - } - - return result; - }; - - SourceMapGenerator$4.prototype._generateSourcesContent = - function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) { - return aSources.map(function (source) { - if (!this._sourcesContents) { - return null; - } - if (aSourceRoot != null) { - source = util$2.relative(aSourceRoot, source); - } - var key = util$2.toSetString(source); - return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) - ? this._sourcesContents[key] - : null; - }, this); - }; - - /** - * Externalize the source map. - */ - SourceMapGenerator$4.prototype.toJSON = - function SourceMapGenerator_toJSON() { - var map = { - version: this._version, - sources: this._sources.toArray(), - names: this._names.toArray(), - mappings: this._serializeMappings() - }; - if (this._file != null) { - map.file = this._file; - } - if (this._sourceRoot != null) { - map.sourceRoot = this._sourceRoot; - } - if (this._sourcesContents) { - map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot); - } - - return map; - }; - - /** - * Render the source map being generated to a string. - */ - SourceMapGenerator$4.prototype.toString = - function SourceMapGenerator_toString() { - return JSON.stringify(this.toJSON()); - }; - - sourceMapGenerator.SourceMapGenerator = SourceMapGenerator$4; - - var sourceMapConsumer = {}; - - var binarySearch$1 = {}; - - /* -*- Mode: js; js-indent-level: 2; -*- */ - - (function (exports) { - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - exports.GREATEST_LOWER_BOUND = 1; - exports.LEAST_UPPER_BOUND = 2; - - /** - * Recursive implementation of binary search. - * - * @param aLow Indices here and lower do not contain the needle. - * @param aHigh Indices here and higher do not contain the needle. - * @param aNeedle The element being searched for. - * @param aHaystack The non-empty array being searched. - * @param aCompare Function which takes two elements and returns -1, 0, or 1. - * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or - * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - */ - function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) { - // This function terminates when one of the following is true: - // - // 1. We find the exact element we are looking for. - // - // 2. We did not find the exact element, but we can return the index of - // the next-closest element. - // - // 3. We did not find the exact element, and there is no next-closest - // element than the one we are searching for, so we return -1. - var mid = Math.floor((aHigh - aLow) / 2) + aLow; - var cmp = aCompare(aNeedle, aHaystack[mid], true); - if (cmp === 0) { - // Found the element we are looking for. - return mid; - } - else if (cmp > 0) { - // Our needle is greater than aHaystack[mid]. - if (aHigh - mid > 1) { - // The element is in the upper half. - return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias); - } - - // The exact needle element was not found in this haystack. Determine if - // we are in termination case (3) or (2) and return the appropriate thing. - if (aBias == exports.LEAST_UPPER_BOUND) { - return aHigh < aHaystack.length ? aHigh : -1; - } else { - return mid; - } - } - else { - // Our needle is less than aHaystack[mid]. - if (mid - aLow > 1) { - // The element is in the lower half. - return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias); - } - - // we are in termination case (3) or (2) and return the appropriate thing. - if (aBias == exports.LEAST_UPPER_BOUND) { - return mid; - } else { - return aLow < 0 ? -1 : aLow; - } - } - } - - /** - * This is an implementation of binary search which will always try and return - * the index of the closest element if there is no exact hit. This is because - * mappings between original and generated line/col pairs are single points, - * and there is an implicit region between each of them, so a miss just means - * that you aren't on the very start of a region. - * - * @param aNeedle The element you are looking for. - * @param aHaystack The array that is being searched. - * @param aCompare A function which takes the needle and an element in the - * array and returns -1, 0, or 1 depending on whether the needle is less - * than, equal to, or greater than the element, respectively. - * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or - * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'. - */ - exports.search = function search(aNeedle, aHaystack, aCompare, aBias) { - if (aHaystack.length === 0) { - return -1; - } - - var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, - aCompare, aBias || exports.GREATEST_LOWER_BOUND); - if (index < 0) { - return -1; - } - - // We have found either the exact element, or the next-closest element than - // the one we are searching for. However, there may be more than one such - // element. Make sure we always return the smallest of these. - while (index - 1 >= 0) { - if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) { - break; - } - --index; - } - - return index; - }; - }(binarySearch$1)); - - var quickSort$1 = {}; - - /* -*- Mode: js; js-indent-level: 2; -*- */ - - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - // It turns out that some (most?) JavaScript engines don't self-host - // `Array.prototype.sort`. This makes sense because C++ will likely remain - // faster than JS when doing raw CPU-intensive sorting. However, when using a - // custom comparator function, calling back and forth between the VM's C++ and - // JIT'd JS is rather slow *and* loses JIT type information, resulting in - // worse generated code for the comparator function than would be optimal. In - // fact, when sorting with a comparator, these costs outweigh the benefits of - // sorting in C++. By using our own JS-implemented Quick Sort (below), we get - // a ~3500ms mean speed-up in `bench/bench.html`. - - function SortTemplate(comparator) { - - /** - * Swap the elements indexed by `x` and `y` in the array `ary`. - * - * @param {Array} ary - * The array. - * @param {Number} x - * The index of the first item. - * @param {Number} y - * The index of the second item. - */ - function swap(ary, x, y) { - var temp = ary[x]; - ary[x] = ary[y]; - ary[y] = temp; - } - - /** - * Returns a random integer within the range `low .. high` inclusive. - * - * @param {Number} low - * The lower bound on the range. - * @param {Number} high - * The upper bound on the range. - */ - function randomIntInRange(low, high) { - return Math.round(low + (Math.random() * (high - low))); - } - - /** - * The Quick Sort algorithm. - * - * @param {Array} ary - * An array to sort. - * @param {function} comparator - * Function to use to compare two items. - * @param {Number} p - * Start index of the array - * @param {Number} r - * End index of the array - */ - function doQuickSort(ary, comparator, p, r) { - // If our lower bound is less than our upper bound, we (1) partition the - // array into two pieces and (2) recurse on each half. If it is not, this is - // the empty array and our base case. - - if (p < r) { - // (1) Partitioning. - // - // The partitioning chooses a pivot between `p` and `r` and moves all - // elements that are less than or equal to the pivot to the before it, and - // all the elements that are greater than it after it. The effect is that - // once partition is done, the pivot is in the exact place it will be when - // the array is put in sorted order, and it will not need to be moved - // again. This runs in O(n) time. - - // Always choose a random pivot so that an input array which is reverse - // sorted does not cause O(n^2) running time. - var pivotIndex = randomIntInRange(p, r); - var i = p - 1; - - swap(ary, pivotIndex, r); - var pivot = ary[r]; - - // Immediately after `j` is incremented in this loop, the following hold - // true: - // - // * Every element in `ary[p .. i]` is less than or equal to the pivot. - // - // * Every element in `ary[i+1 .. j-1]` is greater than the pivot. - for (var j = p; j < r; j++) { - if (comparator(ary[j], pivot, false) <= 0) { - i += 1; - swap(ary, i, j); - } - } - - swap(ary, i + 1, j); - var q = i + 1; - - // (2) Recurse on each half. - - doQuickSort(ary, comparator, p, q - 1); - doQuickSort(ary, comparator, q + 1, r); - } - } - - return doQuickSort; - } - - function cloneSort(comparator) { - let template = SortTemplate.toString(); - let templateFn = new Function(`return ${template}`)(); - return templateFn(comparator); - } - - /** - * Sort the given array in-place with the given comparator function. - * - * @param {Array} ary - * An array to sort. - * @param {function} comparator - * Function to use to compare two items. - */ - - let sortCache = new WeakMap(); - quickSort$1.quickSort = function (ary, comparator, start = 0) { - let doQuickSort = sortCache.get(comparator); - if (doQuickSort === void 0) { - doQuickSort = cloneSort(comparator); - sortCache.set(comparator, doQuickSort); - } - doQuickSort(ary, comparator, start, ary.length - 1); - }; - - /* -*- Mode: js; js-indent-level: 2; -*- */ - - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - var util$1 = util$5; - var binarySearch = binarySearch$1; - var ArraySet = arraySet.ArraySet; - var base64VLQ = base64Vlq; - var quickSort = quickSort$1.quickSort; - - function SourceMapConsumer$3(aSourceMap, aSourceMapURL) { - var sourceMap = aSourceMap; - if (typeof aSourceMap === 'string') { - sourceMap = util$1.parseSourceMapInput(aSourceMap); - } - - return sourceMap.sections != null - ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) - : new BasicSourceMapConsumer(sourceMap, aSourceMapURL); - } - - SourceMapConsumer$3.fromSourceMap = function(aSourceMap, aSourceMapURL) { - return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL); - }; - - /** - * The version of the source mapping spec that we are consuming. - */ - SourceMapConsumer$3.prototype._version = 3; - - // `__generatedMappings` and `__originalMappings` are arrays that hold the - // parsed mapping coordinates from the source map's "mappings" attribute. They - // are lazily instantiated, accessed via the `_generatedMappings` and - // `_originalMappings` getters respectively, and we only parse the mappings - // and create these arrays once queried for a source location. We jump through - // these hoops because there can be many thousands of mappings, and parsing - // them is expensive, so we only want to do it if we must. - // - // Each object in the arrays is of the form: - // - // { - // generatedLine: The line number in the generated code, - // generatedColumn: The column number in the generated code, - // source: The path to the original source file that generated this - // chunk of code, - // originalLine: The line number in the original source that - // corresponds to this chunk of generated code, - // originalColumn: The column number in the original source that - // corresponds to this chunk of generated code, - // name: The name of the original symbol which generated this chunk of - // code. - // } - // - // All properties except for `generatedLine` and `generatedColumn` can be - // `null`. - // - // `_generatedMappings` is ordered by the generated positions. - // - // `_originalMappings` is ordered by the original positions. - - SourceMapConsumer$3.prototype.__generatedMappings = null; - Object.defineProperty(SourceMapConsumer$3.prototype, '_generatedMappings', { - configurable: true, - enumerable: true, - get: function () { - if (!this.__generatedMappings) { - this._parseMappings(this._mappings, this.sourceRoot); - } - - return this.__generatedMappings; - } - }); - - SourceMapConsumer$3.prototype.__originalMappings = null; - Object.defineProperty(SourceMapConsumer$3.prototype, '_originalMappings', { - configurable: true, - enumerable: true, - get: function () { - if (!this.__originalMappings) { - this._parseMappings(this._mappings, this.sourceRoot); - } - - return this.__originalMappings; - } - }); - - SourceMapConsumer$3.prototype._charIsMappingSeparator = - function SourceMapConsumer_charIsMappingSeparator(aStr, index) { - var c = aStr.charAt(index); - return c === ";" || c === ","; - }; - - /** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ - SourceMapConsumer$3.prototype._parseMappings = - function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { - throw new Error("Subclasses must implement _parseMappings"); - }; - - SourceMapConsumer$3.GENERATED_ORDER = 1; - SourceMapConsumer$3.ORIGINAL_ORDER = 2; - - SourceMapConsumer$3.GREATEST_LOWER_BOUND = 1; - SourceMapConsumer$3.LEAST_UPPER_BOUND = 2; - - /** - * Iterate over each mapping between an original source/line/column and a - * generated line/column in this source map. - * - * @param Function aCallback - * The function that is called with each mapping. - * @param Object aContext - * Optional. If specified, this object will be the value of `this` every - * time that `aCallback` is called. - * @param aOrder - * Either `SourceMapConsumer.GENERATED_ORDER` or - * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to - * iterate over the mappings sorted by the generated file's line/column - * order or the original's source/line/column order, respectively. Defaults to - * `SourceMapConsumer.GENERATED_ORDER`. - */ - SourceMapConsumer$3.prototype.eachMapping = - function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) { - var context = aContext || null; - var order = aOrder || SourceMapConsumer$3.GENERATED_ORDER; - - var mappings; - switch (order) { - case SourceMapConsumer$3.GENERATED_ORDER: - mappings = this._generatedMappings; - break; - case SourceMapConsumer$3.ORIGINAL_ORDER: - mappings = this._originalMappings; - break; - default: - throw new Error("Unknown order of iteration."); - } - - var sourceRoot = this.sourceRoot; - var boundCallback = aCallback.bind(context); - var names = this._names; - var sources = this._sources; - var sourceMapURL = this._sourceMapURL; - - for (var i = 0, n = mappings.length; i < n; i++) { - var mapping = mappings[i]; - var source = mapping.source === null ? null : sources.at(mapping.source); - source = util$1.computeSourceURL(sourceRoot, source, sourceMapURL); - boundCallback({ - source: source, - generatedLine: mapping.generatedLine, - generatedColumn: mapping.generatedColumn, - originalLine: mapping.originalLine, - originalColumn: mapping.originalColumn, - name: mapping.name === null ? null : names.at(mapping.name) - }); - } - }; - - /** - * Returns all generated line and column information for the original source, - * line, and column provided. If no column is provided, returns all mappings - * corresponding to a either the line we are searching for or the next - * closest line that has any mappings. Otherwise, returns all mappings - * corresponding to the given line and either the column we are searching for - * or the next closest column that has any offsets. - * - * The only argument is an object with the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. The line number is 1-based. - * - column: Optional. the column number in the original source. - * The column number is 0-based. - * - * and an array of objects is returned, each with the following properties: - * - * - line: The line number in the generated source, or null. The - * line number is 1-based. - * - column: The column number in the generated source, or null. - * The column number is 0-based. - */ - SourceMapConsumer$3.prototype.allGeneratedPositionsFor = - function SourceMapConsumer_allGeneratedPositionsFor(aArgs) { - var line = util$1.getArg(aArgs, 'line'); - - // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping - // returns the index of the closest mapping less than the needle. By - // setting needle.originalColumn to 0, we thus find the last mapping for - // the given line, provided such a mapping exists. - var needle = { - source: util$1.getArg(aArgs, 'source'), - originalLine: line, - originalColumn: util$1.getArg(aArgs, 'column', 0) - }; - - needle.source = this._findSourceIndex(needle.source); - if (needle.source < 0) { - return []; - } - - var mappings = []; - - var index = this._findMapping(needle, - this._originalMappings, - "originalLine", - "originalColumn", - util$1.compareByOriginalPositions, - binarySearch.LEAST_UPPER_BOUND); - if (index >= 0) { - var mapping = this._originalMappings[index]; - - if (aArgs.column === undefined) { - var originalLine = mapping.originalLine; - - // Iterate until either we run out of mappings, or we run into - // a mapping for a different line than the one we found. Since - // mappings are sorted, this is guaranteed to find all mappings for - // the line we found. - while (mapping && mapping.originalLine === originalLine) { - mappings.push({ - line: util$1.getArg(mapping, 'generatedLine', null), - column: util$1.getArg(mapping, 'generatedColumn', null), - lastColumn: util$1.getArg(mapping, 'lastGeneratedColumn', null) - }); - - mapping = this._originalMappings[++index]; - } - } else { - var originalColumn = mapping.originalColumn; - - // Iterate until either we run out of mappings, or we run into - // a mapping for a different line than the one we were searching for. - // Since mappings are sorted, this is guaranteed to find all mappings for - // the line we are searching for. - while (mapping && - mapping.originalLine === line && - mapping.originalColumn == originalColumn) { - mappings.push({ - line: util$1.getArg(mapping, 'generatedLine', null), - column: util$1.getArg(mapping, 'generatedColumn', null), - lastColumn: util$1.getArg(mapping, 'lastGeneratedColumn', null) - }); - - mapping = this._originalMappings[++index]; - } - } - } - - return mappings; - }; - - sourceMapConsumer.SourceMapConsumer = SourceMapConsumer$3; - - /** - * A BasicSourceMapConsumer instance represents a parsed source map which we can - * query for information about the original file positions by giving it a file - * position in the generated source. - * - * The first parameter is the raw source map (either as a JSON string, or - * already parsed to an object). According to the spec, source maps have the - * following attributes: - * - * - version: Which version of the source map spec this map is following. - * - sources: An array of URLs to the original source files. - * - names: An array of identifiers which can be referrenced by individual mappings. - * - sourceRoot: Optional. The URL root from which all sources are relative. - * - sourcesContent: Optional. An array of contents of the original source files. - * - mappings: A string of base64 VLQs which contain the actual mappings. - * - file: Optional. The generated file this source map is associated with. - * - * Here is an example source map, taken from the source map spec[0]: - * - * { - * version : 3, - * file: "out.js", - * sourceRoot : "", - * sources: ["foo.js", "bar.js"], - * names: ["src", "maps", "are", "fun"], - * mappings: "AA,AB;;ABCDE;" - * } - * - * The second parameter, if given, is a string whose value is the URL - * at which the source map was found. This URL is used to compute the - * sources array. - * - * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1# - */ - function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) { - var sourceMap = aSourceMap; - if (typeof aSourceMap === 'string') { - sourceMap = util$1.parseSourceMapInput(aSourceMap); - } - - var version = util$1.getArg(sourceMap, 'version'); - var sources = util$1.getArg(sourceMap, 'sources'); - // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which - // requires the array) to play nice here. - var names = util$1.getArg(sourceMap, 'names', []); - var sourceRoot = util$1.getArg(sourceMap, 'sourceRoot', null); - var sourcesContent = util$1.getArg(sourceMap, 'sourcesContent', null); - var mappings = util$1.getArg(sourceMap, 'mappings'); - var file = util$1.getArg(sourceMap, 'file', null); - - // Once again, Sass deviates from the spec and supplies the version as a - // string rather than a number, so we use loose equality checking here. - if (version != this._version) { - throw new Error('Unsupported version: ' + version); - } - - if (sourceRoot) { - sourceRoot = util$1.normalize(sourceRoot); - } - - sources = sources - .map(String) - // Some source maps produce relative source paths like "./foo.js" instead of - // "foo.js". Normalize these first so that future comparisons will succeed. - // See bugzil.la/1090768. - .map(util$1.normalize) - // Always ensure that absolute sources are internally stored relative to - // the source root, if the source root is absolute. Not doing this would - // be particularly problematic when the source root is a prefix of the - // source (valid, but why??). See github issue #199 and bugzil.la/1188982. - .map(function (source) { - return sourceRoot && util$1.isAbsolute(sourceRoot) && util$1.isAbsolute(source) - ? util$1.relative(sourceRoot, source) - : source; - }); - - // Pass `true` below to allow duplicate names and sources. While source maps - // are intended to be compressed and deduplicated, the TypeScript compiler - // sometimes generates source maps with duplicates in them. See Github issue - // #72 and bugzil.la/889492. - this._names = ArraySet.fromArray(names.map(String), true); - this._sources = ArraySet.fromArray(sources, true); - - this._absoluteSources = this._sources.toArray().map(function (s) { - return util$1.computeSourceURL(sourceRoot, s, aSourceMapURL); - }); - - this.sourceRoot = sourceRoot; - this.sourcesContent = sourcesContent; - this._mappings = mappings; - this._sourceMapURL = aSourceMapURL; - this.file = file; - } - - BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer$3.prototype); - BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer$3; - - /** - * Utility function to find the index of a source. Returns -1 if not - * found. - */ - BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) { - var relativeSource = aSource; - if (this.sourceRoot != null) { - relativeSource = util$1.relative(this.sourceRoot, relativeSource); - } - - if (this._sources.has(relativeSource)) { - return this._sources.indexOf(relativeSource); - } - - // Maybe aSource is an absolute URL as returned by |sources|. In - // this case we can't simply undo the transform. - var i; - for (i = 0; i < this._absoluteSources.length; ++i) { - if (this._absoluteSources[i] == aSource) { - return i; - } - } - - return -1; - }; - - /** - * Create a BasicSourceMapConsumer from a SourceMapGenerator. - * - * @param SourceMapGenerator aSourceMap - * The source map that will be consumed. - * @param String aSourceMapURL - * The URL at which the source map can be found (optional) - * @returns BasicSourceMapConsumer - */ - BasicSourceMapConsumer.fromSourceMap = - function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) { - var smc = Object.create(BasicSourceMapConsumer.prototype); - - var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true); - var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true); - smc.sourceRoot = aSourceMap._sourceRoot; - smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), - smc.sourceRoot); - smc.file = aSourceMap._file; - smc._sourceMapURL = aSourceMapURL; - smc._absoluteSources = smc._sources.toArray().map(function (s) { - return util$1.computeSourceURL(smc.sourceRoot, s, aSourceMapURL); - }); - - // Because we are modifying the entries (by converting string sources and - // names to indices into the sources and names ArraySets), we have to make - // a copy of the entry or else bad things happen. Shared mutable state - // strikes again! See github issue #191. - - var generatedMappings = aSourceMap._mappings.toArray().slice(); - var destGeneratedMappings = smc.__generatedMappings = []; - var destOriginalMappings = smc.__originalMappings = []; - - for (var i = 0, length = generatedMappings.length; i < length; i++) { - var srcMapping = generatedMappings[i]; - var destMapping = new Mapping; - destMapping.generatedLine = srcMapping.generatedLine; - destMapping.generatedColumn = srcMapping.generatedColumn; - - if (srcMapping.source) { - destMapping.source = sources.indexOf(srcMapping.source); - destMapping.originalLine = srcMapping.originalLine; - destMapping.originalColumn = srcMapping.originalColumn; - - if (srcMapping.name) { - destMapping.name = names.indexOf(srcMapping.name); - } - - destOriginalMappings.push(destMapping); - } - - destGeneratedMappings.push(destMapping); - } - - quickSort(smc.__originalMappings, util$1.compareByOriginalPositions); - - return smc; - }; - - /** - * The version of the source mapping spec that we are consuming. - */ - BasicSourceMapConsumer.prototype._version = 3; - - /** - * The list of original sources. - */ - Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', { - get: function () { - return this._absoluteSources.slice(); - } - }); - - /** - * Provide the JIT with a nice shape / hidden class. - */ - function Mapping() { - this.generatedLine = 0; - this.generatedColumn = 0; - this.source = null; - this.originalLine = null; - this.originalColumn = null; - this.name = null; - } - - /** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ - - const compareGenerated = util$1.compareByGeneratedPositionsDeflatedNoLine; - function sortGenerated(array, start) { - let l = array.length; - let n = array.length - start; - if (n <= 1) { - return; - } else if (n == 2) { - let a = array[start]; - let b = array[start + 1]; - if (compareGenerated(a, b) > 0) { - array[start] = b; - array[start + 1] = a; - } - } else if (n < 20) { - for (let i = start; i < l; i++) { - for (let j = i; j > start; j--) { - let a = array[j - 1]; - let b = array[j]; - if (compareGenerated(a, b) <= 0) { - break; - } - array[j - 1] = b; - array[j] = a; - } - } - } else { - quickSort(array, compareGenerated, start); - } - } - BasicSourceMapConsumer.prototype._parseMappings = - function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { - var generatedLine = 1; - var previousGeneratedColumn = 0; - var previousOriginalLine = 0; - var previousOriginalColumn = 0; - var previousSource = 0; - var previousName = 0; - var length = aStr.length; - var index = 0; - var temp = {}; - var originalMappings = []; - var generatedMappings = []; - var mapping, segment, end, value; - - let subarrayStart = 0; - while (index < length) { - if (aStr.charAt(index) === ';') { - generatedLine++; - index++; - previousGeneratedColumn = 0; - - sortGenerated(generatedMappings, subarrayStart); - subarrayStart = generatedMappings.length; - } - else if (aStr.charAt(index) === ',') { - index++; - } - else { - mapping = new Mapping(); - mapping.generatedLine = generatedLine; - - for (end = index; end < length; end++) { - if (this._charIsMappingSeparator(aStr, end)) { - break; - } - } - aStr.slice(index, end); - - segment = []; - while (index < end) { - base64VLQ.decode(aStr, index, temp); - value = temp.value; - index = temp.rest; - segment.push(value); - } - - if (segment.length === 2) { - throw new Error('Found a source, but no line and column'); - } - - if (segment.length === 3) { - throw new Error('Found a source and line, but no column'); - } - - // Generated column. - mapping.generatedColumn = previousGeneratedColumn + segment[0]; - previousGeneratedColumn = mapping.generatedColumn; - - if (segment.length > 1) { - // Original source. - mapping.source = previousSource + segment[1]; - previousSource += segment[1]; - - // Original line. - mapping.originalLine = previousOriginalLine + segment[2]; - previousOriginalLine = mapping.originalLine; - // Lines are stored 0-based - mapping.originalLine += 1; - - // Original column. - mapping.originalColumn = previousOriginalColumn + segment[3]; - previousOriginalColumn = mapping.originalColumn; - - if (segment.length > 4) { - // Original name. - mapping.name = previousName + segment[4]; - previousName += segment[4]; - } - } - - generatedMappings.push(mapping); - if (typeof mapping.originalLine === 'number') { - let currentSource = mapping.source; - while (originalMappings.length <= currentSource) { - originalMappings.push(null); - } - if (originalMappings[currentSource] === null) { - originalMappings[currentSource] = []; - } - originalMappings[currentSource].push(mapping); - } - } - } - - sortGenerated(generatedMappings, subarrayStart); - this.__generatedMappings = generatedMappings; - - for (var i = 0; i < originalMappings.length; i++) { - if (originalMappings[i] != null) { - quickSort(originalMappings[i], util$1.compareByOriginalPositionsNoSource); - } - } - this.__originalMappings = [].concat(...originalMappings); - }; - - /** - * Find the mapping that best matches the hypothetical "needle" mapping that - * we are searching for in the given "haystack" of mappings. - */ - BasicSourceMapConsumer.prototype._findMapping = - function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, - aColumnName, aComparator, aBias) { - // To return the position we are searching for, we must first find the - // mapping for the given position and then return the opposite position it - // points to. Because the mappings are sorted, we can use binary search to - // find the best mapping. - - if (aNeedle[aLineName] <= 0) { - throw new TypeError('Line must be greater than or equal to 1, got ' - + aNeedle[aLineName]); - } - if (aNeedle[aColumnName] < 0) { - throw new TypeError('Column must be greater than or equal to 0, got ' - + aNeedle[aColumnName]); - } - - return binarySearch.search(aNeedle, aMappings, aComparator, aBias); - }; - - /** - * Compute the last column for each generated mapping. The last column is - * inclusive. - */ - BasicSourceMapConsumer.prototype.computeColumnSpans = - function SourceMapConsumer_computeColumnSpans() { - for (var index = 0; index < this._generatedMappings.length; ++index) { - var mapping = this._generatedMappings[index]; - - // Mappings do not contain a field for the last generated columnt. We - // can come up with an optimistic estimate, however, by assuming that - // mappings are contiguous (i.e. given two consecutive mappings, the - // first mapping ends where the second one starts). - if (index + 1 < this._generatedMappings.length) { - var nextMapping = this._generatedMappings[index + 1]; - - if (mapping.generatedLine === nextMapping.generatedLine) { - mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1; - continue; - } - } - - // The last mapping for each line spans the entire line. - mapping.lastGeneratedColumn = Infinity; - } - }; - - /** - * Returns the original source, line, and column information for the generated - * source's line and column positions provided. The only argument is an object - * with the following properties: - * - * - line: The line number in the generated source. The line number - * is 1-based. - * - column: The column number in the generated source. The column - * number is 0-based. - * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or - * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. - * - * and an object is returned with the following properties: - * - * - source: The original source file, or null. - * - line: The line number in the original source, or null. The - * line number is 1-based. - * - column: The column number in the original source, or null. The - * column number is 0-based. - * - name: The original identifier, or null. - */ - BasicSourceMapConsumer.prototype.originalPositionFor = - function SourceMapConsumer_originalPositionFor(aArgs) { - var needle = { - generatedLine: util$1.getArg(aArgs, 'line'), - generatedColumn: util$1.getArg(aArgs, 'column') - }; - - var index = this._findMapping( - needle, - this._generatedMappings, - "generatedLine", - "generatedColumn", - util$1.compareByGeneratedPositionsDeflated, - util$1.getArg(aArgs, 'bias', SourceMapConsumer$3.GREATEST_LOWER_BOUND) - ); - - if (index >= 0) { - var mapping = this._generatedMappings[index]; - - if (mapping.generatedLine === needle.generatedLine) { - var source = util$1.getArg(mapping, 'source', null); - if (source !== null) { - source = this._sources.at(source); - source = util$1.computeSourceURL(this.sourceRoot, source, this._sourceMapURL); - } - var name = util$1.getArg(mapping, 'name', null); - if (name !== null) { - name = this._names.at(name); - } - return { - source: source, - line: util$1.getArg(mapping, 'originalLine', null), - column: util$1.getArg(mapping, 'originalColumn', null), - name: name - }; - } - } - - return { - source: null, - line: null, - column: null, - name: null - }; - }; - - /** - * Return true if we have the source content for every source in the source - * map, false otherwise. - */ - BasicSourceMapConsumer.prototype.hasContentsOfAllSources = - function BasicSourceMapConsumer_hasContentsOfAllSources() { - if (!this.sourcesContent) { - return false; - } - return this.sourcesContent.length >= this._sources.size() && - !this.sourcesContent.some(function (sc) { return sc == null; }); - }; - - /** - * Returns the original source content. The only argument is the url of the - * original source file. Returns null if no original source content is - * available. - */ - BasicSourceMapConsumer.prototype.sourceContentFor = - function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { - if (!this.sourcesContent) { - return null; - } - - var index = this._findSourceIndex(aSource); - if (index >= 0) { - return this.sourcesContent[index]; - } - - var relativeSource = aSource; - if (this.sourceRoot != null) { - relativeSource = util$1.relative(this.sourceRoot, relativeSource); - } - - var url; - if (this.sourceRoot != null - && (url = util$1.urlParse(this.sourceRoot))) { - // XXX: file:// URIs and absolute paths lead to unexpected behavior for - // many users. We can help them out when they expect file:// URIs to - // behave like it would if they were running a local HTTP server. See - // https://bugzilla.mozilla.org/show_bug.cgi?id=885597. - var fileUriAbsPath = relativeSource.replace(/^file:\/\//, ""); - if (url.scheme == "file" - && this._sources.has(fileUriAbsPath)) { - return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)] - } - - if ((!url.path || url.path == "/") - && this._sources.has("/" + relativeSource)) { - return this.sourcesContent[this._sources.indexOf("/" + relativeSource)]; - } - } - - // This function is used recursively from - // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we - // don't want to throw if we can't find the source - we just want to - // return null, so we provide a flag to exit gracefully. - if (nullOnMissing) { - return null; - } - else { - throw new Error('"' + relativeSource + '" is not in the SourceMap.'); - } - }; - - /** - * Returns the generated line and column information for the original source, - * line, and column positions provided. The only argument is an object with - * the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. The line number - * is 1-based. - * - column: The column number in the original source. The column - * number is 0-based. - * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or - * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. - * - * and an object is returned with the following properties: - * - * - line: The line number in the generated source, or null. The - * line number is 1-based. - * - column: The column number in the generated source, or null. - * The column number is 0-based. - */ - BasicSourceMapConsumer.prototype.generatedPositionFor = - function SourceMapConsumer_generatedPositionFor(aArgs) { - var source = util$1.getArg(aArgs, 'source'); - source = this._findSourceIndex(source); - if (source < 0) { - return { - line: null, - column: null, - lastColumn: null - }; - } - - var needle = { - source: source, - originalLine: util$1.getArg(aArgs, 'line'), - originalColumn: util$1.getArg(aArgs, 'column') - }; - - var index = this._findMapping( - needle, - this._originalMappings, - "originalLine", - "originalColumn", - util$1.compareByOriginalPositions, - util$1.getArg(aArgs, 'bias', SourceMapConsumer$3.GREATEST_LOWER_BOUND) - ); - - if (index >= 0) { - var mapping = this._originalMappings[index]; - - if (mapping.source === needle.source) { - return { - line: util$1.getArg(mapping, 'generatedLine', null), - column: util$1.getArg(mapping, 'generatedColumn', null), - lastColumn: util$1.getArg(mapping, 'lastGeneratedColumn', null) - }; - } - } - - return { - line: null, - column: null, - lastColumn: null - }; - }; - - sourceMapConsumer.BasicSourceMapConsumer = BasicSourceMapConsumer; - - /** - * An IndexedSourceMapConsumer instance represents a parsed source map which - * we can query for information. It differs from BasicSourceMapConsumer in - * that it takes "indexed" source maps (i.e. ones with a "sections" field) as - * input. - * - * The first parameter is a raw source map (either as a JSON string, or already - * parsed to an object). According to the spec for indexed source maps, they - * have the following attributes: - * - * - version: Which version of the source map spec this map is following. - * - file: Optional. The generated file this source map is associated with. - * - sections: A list of section definitions. - * - * Each value under the "sections" field has two fields: - * - offset: The offset into the original specified at which this section - * begins to apply, defined as an object with a "line" and "column" - * field. - * - map: A source map definition. This source map could also be indexed, - * but doesn't have to be. - * - * Instead of the "map" field, it's also possible to have a "url" field - * specifying a URL to retrieve a source map from, but that's currently - * unsupported. - * - * Here's an example source map, taken from the source map spec[0], but - * modified to omit a section which uses the "url" field. - * - * { - * version : 3, - * file: "app.js", - * sections: [{ - * offset: {line:100, column:10}, - * map: { - * version : 3, - * file: "section.js", - * sources: ["foo.js", "bar.js"], - * names: ["src", "maps", "are", "fun"], - * mappings: "AAAA,E;;ABCDE;" - * } - * }], - * } - * - * The second parameter, if given, is a string whose value is the URL - * at which the source map was found. This URL is used to compute the - * sources array. - * - * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt - */ - function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) { - var sourceMap = aSourceMap; - if (typeof aSourceMap === 'string') { - sourceMap = util$1.parseSourceMapInput(aSourceMap); - } - - var version = util$1.getArg(sourceMap, 'version'); - var sections = util$1.getArg(sourceMap, 'sections'); - - if (version != this._version) { - throw new Error('Unsupported version: ' + version); - } - - this._sources = new ArraySet(); - this._names = new ArraySet(); - - var lastOffset = { - line: -1, - column: 0 - }; - this._sections = sections.map(function (s) { - if (s.url) { - // The url field will require support for asynchronicity. - // See https://github.com/mozilla/source-map/issues/16 - throw new Error('Support for url field in sections not implemented.'); - } - var offset = util$1.getArg(s, 'offset'); - var offsetLine = util$1.getArg(offset, 'line'); - var offsetColumn = util$1.getArg(offset, 'column'); - - if (offsetLine < lastOffset.line || - (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) { - throw new Error('Section offsets must be ordered and non-overlapping.'); - } - lastOffset = offset; - - return { - generatedOffset: { - // The offset fields are 0-based, but we use 1-based indices when - // encoding/decoding from VLQ. - generatedLine: offsetLine + 1, - generatedColumn: offsetColumn + 1 - }, - consumer: new SourceMapConsumer$3(util$1.getArg(s, 'map'), aSourceMapURL) - } - }); - } - - IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer$3.prototype); - IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer$3; - - /** - * The version of the source mapping spec that we are consuming. - */ - IndexedSourceMapConsumer.prototype._version = 3; - - /** - * The list of original sources. - */ - Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', { - get: function () { - var sources = []; - for (var i = 0; i < this._sections.length; i++) { - for (var j = 0; j < this._sections[i].consumer.sources.length; j++) { - sources.push(this._sections[i].consumer.sources[j]); - } - } - return sources; - } - }); - - /** - * Returns the original source, line, and column information for the generated - * source's line and column positions provided. The only argument is an object - * with the following properties: - * - * - line: The line number in the generated source. The line number - * is 1-based. - * - column: The column number in the generated source. The column - * number is 0-based. - * - * and an object is returned with the following properties: - * - * - source: The original source file, or null. - * - line: The line number in the original source, or null. The - * line number is 1-based. - * - column: The column number in the original source, or null. The - * column number is 0-based. - * - name: The original identifier, or null. - */ - IndexedSourceMapConsumer.prototype.originalPositionFor = - function IndexedSourceMapConsumer_originalPositionFor(aArgs) { - var needle = { - generatedLine: util$1.getArg(aArgs, 'line'), - generatedColumn: util$1.getArg(aArgs, 'column') - }; - - // Find the section containing the generated position we're trying to map - // to an original position. - var sectionIndex = binarySearch.search(needle, this._sections, - function(needle, section) { - var cmp = needle.generatedLine - section.generatedOffset.generatedLine; - if (cmp) { - return cmp; - } - - return (needle.generatedColumn - - section.generatedOffset.generatedColumn); - }); - var section = this._sections[sectionIndex]; - - if (!section) { - return { - source: null, - line: null, - column: null, - name: null - }; - } - - return section.consumer.originalPositionFor({ - line: needle.generatedLine - - (section.generatedOffset.generatedLine - 1), - column: needle.generatedColumn - - (section.generatedOffset.generatedLine === needle.generatedLine - ? section.generatedOffset.generatedColumn - 1 - : 0), - bias: aArgs.bias - }); - }; - - /** - * Return true if we have the source content for every source in the source - * map, false otherwise. - */ - IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = - function IndexedSourceMapConsumer_hasContentsOfAllSources() { - return this._sections.every(function (s) { - return s.consumer.hasContentsOfAllSources(); - }); - }; - - /** - * Returns the original source content. The only argument is the url of the - * original source file. Returns null if no original source content is - * available. - */ - IndexedSourceMapConsumer.prototype.sourceContentFor = - function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { - for (var i = 0; i < this._sections.length; i++) { - var section = this._sections[i]; - - var content = section.consumer.sourceContentFor(aSource, true); - if (content) { - return content; - } - } - if (nullOnMissing) { - return null; - } - else { - throw new Error('"' + aSource + '" is not in the SourceMap.'); - } - }; - - /** - * Returns the generated line and column information for the original source, - * line, and column positions provided. The only argument is an object with - * the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. The line number - * is 1-based. - * - column: The column number in the original source. The column - * number is 0-based. - * - * and an object is returned with the following properties: - * - * - line: The line number in the generated source, or null. The - * line number is 1-based. - * - column: The column number in the generated source, or null. - * The column number is 0-based. - */ - IndexedSourceMapConsumer.prototype.generatedPositionFor = - function IndexedSourceMapConsumer_generatedPositionFor(aArgs) { - for (var i = 0; i < this._sections.length; i++) { - var section = this._sections[i]; - - // Only consider this section if the requested source is in the list of - // sources of the consumer. - if (section.consumer._findSourceIndex(util$1.getArg(aArgs, 'source')) === -1) { - continue; - } - var generatedPosition = section.consumer.generatedPositionFor(aArgs); - if (generatedPosition) { - var ret = { - line: generatedPosition.line + - (section.generatedOffset.generatedLine - 1), - column: generatedPosition.column + - (section.generatedOffset.generatedLine === generatedPosition.line - ? section.generatedOffset.generatedColumn - 1 - : 0) - }; - return ret; - } - } - - return { - line: null, - column: null - }; - }; - - /** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ - IndexedSourceMapConsumer.prototype._parseMappings = - function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) { - this.__generatedMappings = []; - this.__originalMappings = []; - for (var i = 0; i < this._sections.length; i++) { - var section = this._sections[i]; - var sectionMappings = section.consumer._generatedMappings; - for (var j = 0; j < sectionMappings.length; j++) { - var mapping = sectionMappings[j]; - - var source = section.consumer._sources.at(mapping.source); - source = util$1.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL); - this._sources.add(source); - source = this._sources.indexOf(source); - - var name = null; - if (mapping.name) { - name = section.consumer._names.at(mapping.name); - this._names.add(name); - name = this._names.indexOf(name); - } - - // The mappings coming from the consumer for the section have - // generated positions relative to the start of the section, so we - // need to offset them to be relative to the start of the concatenated - // generated file. - var adjustedMapping = { - source: source, - generatedLine: mapping.generatedLine + - (section.generatedOffset.generatedLine - 1), - generatedColumn: mapping.generatedColumn + - (section.generatedOffset.generatedLine === mapping.generatedLine - ? section.generatedOffset.generatedColumn - 1 - : 0), - originalLine: mapping.originalLine, - originalColumn: mapping.originalColumn, - name: name - }; - - this.__generatedMappings.push(adjustedMapping); - if (typeof adjustedMapping.originalLine === 'number') { - this.__originalMappings.push(adjustedMapping); - } - } - } - - quickSort(this.__generatedMappings, util$1.compareByGeneratedPositionsDeflated); - quickSort(this.__originalMappings, util$1.compareByOriginalPositions); - }; - - sourceMapConsumer.IndexedSourceMapConsumer = IndexedSourceMapConsumer; - - var sourceNode = {}; - - /* -*- Mode: js; js-indent-level: 2; -*- */ - - /* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - var SourceMapGenerator$3 = sourceMapGenerator.SourceMapGenerator; - var util = util$5; - - // Matches a Windows-style `\r\n` newline or a `\n` newline used by all other - // operating systems these days (capturing the result). - var REGEX_NEWLINE = /(\r?\n)/; - - // Newline character code for charCodeAt() comparisons - var NEWLINE_CODE = 10; - - // Private symbol for identifying `SourceNode`s when multiple versions of - // the source-map library are loaded. This MUST NOT CHANGE across - // versions! - var isSourceNode = "$$$isSourceNode$$$"; - - /** - * SourceNodes provide a way to abstract over interpolating/concatenating - * snippets of generated JavaScript source code while maintaining the line and - * column information associated with the original source code. - * - * @param aLine The original line number. - * @param aColumn The original column number. - * @param aSource The original source's filename. - * @param aChunks Optional. An array of strings which are snippets of - * generated JS, or other SourceNodes. - * @param aName The original identifier. - */ - function SourceNode(aLine, aColumn, aSource, aChunks, aName) { - this.children = []; - this.sourceContents = {}; - this.line = aLine == null ? null : aLine; - this.column = aColumn == null ? null : aColumn; - this.source = aSource == null ? null : aSource; - this.name = aName == null ? null : aName; - this[isSourceNode] = true; - if (aChunks != null) this.add(aChunks); - } - - /** - * Creates a SourceNode from generated code and a SourceMapConsumer. - * - * @param aGeneratedCode The generated code - * @param aSourceMapConsumer The SourceMap for the generated code - * @param aRelativePath Optional. The path that relative sources in the - * SourceMapConsumer should be relative to. - */ - SourceNode.fromStringWithSourceMap = - function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) { - // The SourceNode we want to fill with the generated code - // and the SourceMap - var node = new SourceNode(); - - // All even indices of this array are one line of the generated code, - // while all odd indices are the newlines between two adjacent lines - // (since `REGEX_NEWLINE` captures its match). - // Processed fragments are accessed by calling `shiftNextLine`. - var remainingLines = aGeneratedCode.split(REGEX_NEWLINE); - var remainingLinesIndex = 0; - var shiftNextLine = function() { - var lineContents = getNextLine(); - // The last line of a file might not have a newline. - var newLine = getNextLine() || ""; - return lineContents + newLine; - - function getNextLine() { - return remainingLinesIndex < remainingLines.length ? - remainingLines[remainingLinesIndex++] : undefined; - } - }; - - // We need to remember the position of "remainingLines" - var lastGeneratedLine = 1, lastGeneratedColumn = 0; - - // The generate SourceNodes we need a code range. - // To extract it current and last mapping is used. - // Here we store the last mapping. - var lastMapping = null; - - aSourceMapConsumer.eachMapping(function (mapping) { - if (lastMapping !== null) { - // We add the code from "lastMapping" to "mapping": - // First check if there is a new line in between. - if (lastGeneratedLine < mapping.generatedLine) { - // Associate first line with "lastMapping" - addMappingWithCode(lastMapping, shiftNextLine()); - lastGeneratedLine++; - lastGeneratedColumn = 0; - // The remaining code is added without mapping - } else { - // There is no new line in between. - // Associate the code between "lastGeneratedColumn" and - // "mapping.generatedColumn" with "lastMapping" - var nextLine = remainingLines[remainingLinesIndex] || ''; - var code = nextLine.substr(0, mapping.generatedColumn - - lastGeneratedColumn); - remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - - lastGeneratedColumn); - lastGeneratedColumn = mapping.generatedColumn; - addMappingWithCode(lastMapping, code); - // No more remaining code, continue - lastMapping = mapping; - return; - } - } - // We add the generated code until the first mapping - // to the SourceNode without any mapping. - // Each line is added as separate string. - while (lastGeneratedLine < mapping.generatedLine) { - node.add(shiftNextLine()); - lastGeneratedLine++; - } - if (lastGeneratedColumn < mapping.generatedColumn) { - var nextLine = remainingLines[remainingLinesIndex] || ''; - node.add(nextLine.substr(0, mapping.generatedColumn)); - remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn); - lastGeneratedColumn = mapping.generatedColumn; - } - lastMapping = mapping; - }, this); - // We have processed all mappings. - if (remainingLinesIndex < remainingLines.length) { - if (lastMapping) { - // Associate the remaining code in the current line with "lastMapping" - addMappingWithCode(lastMapping, shiftNextLine()); - } - // and add the remaining lines without any mapping - node.add(remainingLines.splice(remainingLinesIndex).join("")); - } - - // Copy sourcesContent into SourceNode - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content != null) { - if (aRelativePath != null) { - sourceFile = util.join(aRelativePath, sourceFile); - } - node.setSourceContent(sourceFile, content); - } - }); - - return node; - - function addMappingWithCode(mapping, code) { - if (mapping === null || mapping.source === undefined) { - node.add(code); - } else { - var source = aRelativePath - ? util.join(aRelativePath, mapping.source) - : mapping.source; - node.add(new SourceNode(mapping.originalLine, - mapping.originalColumn, - source, - code, - mapping.name)); - } - } - }; - - /** - * Add a chunk of generated JS to this source node. - * - * @param aChunk A string snippet of generated JS code, another instance of - * SourceNode, or an array where each member is one of those things. - */ - SourceNode.prototype.add = function SourceNode_add(aChunk) { - if (Array.isArray(aChunk)) { - aChunk.forEach(function (chunk) { - this.add(chunk); - }, this); - } - else if (aChunk[isSourceNode] || typeof aChunk === "string") { - if (aChunk) { - this.children.push(aChunk); - } - } - else { - throw new TypeError( - "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk - ); - } - return this; - }; - - /** - * Add a chunk of generated JS to the beginning of this source node. - * - * @param aChunk A string snippet of generated JS code, another instance of - * SourceNode, or an array where each member is one of those things. - */ - SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) { - if (Array.isArray(aChunk)) { - for (var i = aChunk.length-1; i >= 0; i--) { - this.prepend(aChunk[i]); - } - } - else if (aChunk[isSourceNode] || typeof aChunk === "string") { - this.children.unshift(aChunk); - } - else { - throw new TypeError( - "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk - ); - } - return this; - }; - - /** - * Walk over the tree of JS snippets in this node and its children. The - * walking function is called once for each snippet of JS and is passed that - * snippet and the its original associated source's line/column location. - * - * @param aFn The traversal function. - */ - SourceNode.prototype.walk = function SourceNode_walk(aFn) { - var chunk; - for (var i = 0, len = this.children.length; i < len; i++) { - chunk = this.children[i]; - if (chunk[isSourceNode]) { - chunk.walk(aFn); - } - else { - if (chunk !== '') { - aFn(chunk, { source: this.source, - line: this.line, - column: this.column, - name: this.name }); - } - } - } - }; - - /** - * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between - * each of `this.children`. - * - * @param aSep The separator. - */ - SourceNode.prototype.join = function SourceNode_join(aSep) { - var newChildren; - var i; - var len = this.children.length; - if (len > 0) { - newChildren = []; - for (i = 0; i < len-1; i++) { - newChildren.push(this.children[i]); - newChildren.push(aSep); - } - newChildren.push(this.children[i]); - this.children = newChildren; - } - return this; - }; - - /** - * Call String.prototype.replace on the very right-most source snippet. Useful - * for trimming whitespace from the end of a source node, etc. - * - * @param aPattern The pattern to replace. - * @param aReplacement The thing to replace the pattern with. - */ - SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { - var lastChild = this.children[this.children.length - 1]; - if (lastChild[isSourceNode]) { - lastChild.replaceRight(aPattern, aReplacement); - } - else if (typeof lastChild === 'string') { - this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement); - } - else { - this.children.push(''.replace(aPattern, aReplacement)); - } - return this; - }; - - /** - * Set the source content for a source file. This will be added to the SourceMapGenerator - * in the sourcesContent field. - * - * @param aSourceFile The filename of the source file - * @param aSourceContent The content of the source file - */ - SourceNode.prototype.setSourceContent = - function SourceNode_setSourceContent(aSourceFile, aSourceContent) { - this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; - }; - - /** - * Walk over the tree of SourceNodes. The walking function is called for each - * source file content and is passed the filename and source content. - * - * @param aFn The traversal function. - */ - SourceNode.prototype.walkSourceContents = - function SourceNode_walkSourceContents(aFn) { - for (var i = 0, len = this.children.length; i < len; i++) { - if (this.children[i][isSourceNode]) { - this.children[i].walkSourceContents(aFn); - } - } - - var sources = Object.keys(this.sourceContents); - for (var i = 0, len = sources.length; i < len; i++) { - aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]); - } - }; - - /** - * Return the string representation of this source node. Walks over the tree - * and concatenates all the various snippets together to one string. - */ - SourceNode.prototype.toString = function SourceNode_toString() { - var str = ""; - this.walk(function (chunk) { - str += chunk; - }); - return str; - }; - - /** - * Returns the string representation of this source node along with a source - * map. - */ - SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) { - var generated = { - code: "", - line: 1, - column: 0 - }; - var map = new SourceMapGenerator$3(aArgs); - var sourceMappingActive = false; - var lastOriginalSource = null; - var lastOriginalLine = null; - var lastOriginalColumn = null; - var lastOriginalName = null; - this.walk(function (chunk, original) { - generated.code += chunk; - if (original.source !== null - && original.line !== null - && original.column !== null) { - if(lastOriginalSource !== original.source - || lastOriginalLine !== original.line - || lastOriginalColumn !== original.column - || lastOriginalName !== original.name) { - map.addMapping({ - source: original.source, - original: { - line: original.line, - column: original.column - }, - generated: { - line: generated.line, - column: generated.column - }, - name: original.name - }); - } - lastOriginalSource = original.source; - lastOriginalLine = original.line; - lastOriginalColumn = original.column; - lastOriginalName = original.name; - sourceMappingActive = true; - } else if (sourceMappingActive) { - map.addMapping({ - generated: { - line: generated.line, - column: generated.column - } - }); - lastOriginalSource = null; - sourceMappingActive = false; - } - for (var idx = 0, length = chunk.length; idx < length; idx++) { - if (chunk.charCodeAt(idx) === NEWLINE_CODE) { - generated.line++; - generated.column = 0; - // Mappings end at eol - if (idx + 1 === length) { - lastOriginalSource = null; - sourceMappingActive = false; - } else if (sourceMappingActive) { - map.addMapping({ - source: original.source, - original: { - line: original.line, - column: original.column - }, - generated: { - line: generated.line, - column: generated.column - }, - name: original.name - }); - } - } else { - generated.column++; - } - } - }); - this.walkSourceContents(function (sourceFile, sourceContent) { - map.setSourceContent(sourceFile, sourceContent); - }); - - return { code: generated.code, map: map }; - }; - - sourceNode.SourceNode = SourceNode; - - /* - * Copyright 2009-2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE.txt or: - * http://opensource.org/licenses/BSD-3-Clause - */ - - sourceMap.SourceMapGenerator = sourceMapGenerator.SourceMapGenerator; - sourceMap.SourceMapConsumer = sourceMapConsumer.SourceMapConsumer; - sourceMap.SourceNode = sourceNode.SourceNode; - - let urlAlphabet = - 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict'; - let customAlphabet = (alphabet, defaultSize = 21) => { - return (size = defaultSize) => { - let id = ''; - let i = size; - while (i--) { - id += alphabet[(Math.random() * alphabet.length) | 0]; - } - return id - } - }; - let nanoid$1 = (size = 21) => { - let id = ''; - let i = size; - while (i--) { - id += urlAlphabet[(Math.random() * 64) | 0]; - } - return id - }; - var nonSecure = { nanoid: nanoid$1, customAlphabet }; - - let { SourceMapConsumer: SourceMapConsumer$2, SourceMapGenerator: SourceMapGenerator$2 } = sourceMap; - let { existsSync, readFileSync } = require$$1__default["default"]; - let { dirname: dirname$1, join } = require$$2__default["default"]; - - function fromBase64(str) { - if (Buffer) { - return Buffer.from(str, 'base64').toString() - } else { - /* c8 ignore next 2 */ - return window.atob(str) - } - } - - class PreviousMap$2 { - constructor(css, opts) { - if (opts.map === false) return - this.loadAnnotation(css); - this.inline = this.startWith(this.annotation, 'data:'); - - let prev = opts.map ? opts.map.prev : undefined; - let text = this.loadMap(opts.from, prev); - if (!this.mapFile && opts.from) { - this.mapFile = opts.from; - } - if (this.mapFile) this.root = dirname$1(this.mapFile); - if (text) this.text = text; - } - - consumer() { - if (!this.consumerCache) { - this.consumerCache = new SourceMapConsumer$2(this.text); - } - return this.consumerCache - } - - decodeInline(text) { - let baseCharsetUri = /^data:application\/json;charset=utf-?8;base64,/; - let baseUri = /^data:application\/json;base64,/; - let charsetUri = /^data:application\/json;charset=utf-?8,/; - let uri = /^data:application\/json,/; - - if (charsetUri.test(text) || uri.test(text)) { - return decodeURIComponent(text.substr(RegExp.lastMatch.length)) - } - - if (baseCharsetUri.test(text) || baseUri.test(text)) { - return fromBase64(text.substr(RegExp.lastMatch.length)) - } - - let encoding = text.match(/data:application\/json;([^,]+),/)[1]; - throw new Error('Unsupported source map encoding ' + encoding) - } - - getAnnotationURL(sourceMapString) { - return sourceMapString.replace(/^\/\*\s*# sourceMappingURL=/, '').trim() - } - - isMap(map) { - if (typeof map !== 'object') return false - return ( - typeof map.mappings === 'string' || - typeof map._mappings === 'string' || - Array.isArray(map.sections) - ) - } - - loadAnnotation(css) { - let comments = css.match(/\/\*\s*# sourceMappingURL=/gm); - if (!comments) return - - // sourceMappingURLs from comments, strings, etc. - let start = css.lastIndexOf(comments.pop()); - let end = css.indexOf('*/', start); - - if (start > -1 && end > -1) { - // Locate the last sourceMappingURL to avoid pickin - this.annotation = this.getAnnotationURL(css.substring(start, end)); - } - } - - loadFile(path) { - this.root = dirname$1(path); - if (existsSync(path)) { - this.mapFile = path; - return readFileSync(path, 'utf-8').toString().trim() - } - } - - loadMap(file, prev) { - if (prev === false) return false - - if (prev) { - if (typeof prev === 'string') { - return prev - } else if (typeof prev === 'function') { - let prevPath = prev(file); - if (prevPath) { - let map = this.loadFile(prevPath); - if (!map) { - throw new Error( - 'Unable to load previous source map: ' + prevPath.toString() - ) - } - return map - } - } else if (prev instanceof SourceMapConsumer$2) { - return SourceMapGenerator$2.fromSourceMap(prev).toString() - } else if (prev instanceof SourceMapGenerator$2) { - return prev.toString() - } else if (this.isMap(prev)) { - return JSON.stringify(prev) - } else { - throw new Error( - 'Unsupported previous source map format: ' + prev.toString() - ) - } - } else if (this.inline) { - return this.decodeInline(this.annotation) - } else if (this.annotation) { - let map = this.annotation; - if (file) map = join(dirname$1(file), map); - return this.loadFile(map) - } - } - - startWith(string, start) { - if (!string) return false - return string.substr(0, start.length) === start - } - - withContent() { - return !!( - this.consumer().sourcesContent && - this.consumer().sourcesContent.length > 0 - ) - } - } - - var previousMap = PreviousMap$2; - PreviousMap$2.default = PreviousMap$2; - - let { SourceMapConsumer: SourceMapConsumer$1, SourceMapGenerator: SourceMapGenerator$1 } = sourceMap; - let { fileURLToPath, pathToFileURL: pathToFileURL$1 } = require$$1__default$1["default"]; - let { isAbsolute, resolve: resolve$1 } = require$$2__default["default"]; - let { nanoid } = nonSecure; - - let terminalHighlight = terminalHighlight_1; - let CssSyntaxError$1 = cssSyntaxError; - let PreviousMap$1 = previousMap; - - let fromOffsetCache = Symbol('fromOffsetCache'); - - let sourceMapAvailable$1 = Boolean(SourceMapConsumer$1 && SourceMapGenerator$1); - let pathAvailable$1 = Boolean(resolve$1 && isAbsolute); - - class Input$4 { - constructor(css, opts = {}) { - if ( - css === null || - typeof css === 'undefined' || - (typeof css === 'object' && !css.toString) - ) { - throw new Error(`PostCSS received ${css} instead of CSS string`) - } - - this.css = css.toString(); - - if (this.css[0] === '\uFEFF' || this.css[0] === '\uFFFE') { - this.hasBOM = true; - this.css = this.css.slice(1); - } else { - this.hasBOM = false; - } - - if (opts.from) { - if ( - !pathAvailable$1 || - /^\w+:\/\//.test(opts.from) || - isAbsolute(opts.from) - ) { - this.file = opts.from; - } else { - this.file = resolve$1(opts.from); - } - } - - if (pathAvailable$1 && sourceMapAvailable$1) { - let map = new PreviousMap$1(this.css, opts); - if (map.text) { - this.map = map; - let file = map.consumer().file; - if (!this.file && file) this.file = this.mapResolve(file); - } - } - - if (!this.file) { - this.id = ''; - } - if (this.map) this.map.file = this.from; - } - - error(message, line, column, opts = {}) { - let result, endLine, endColumn; - - if (line && typeof line === 'object') { - let start = line; - let end = column; - if (typeof start.offset === 'number') { - let pos = this.fromOffset(start.offset); - line = pos.line; - column = pos.col; - } else { - line = start.line; - column = start.column; - } - if (typeof end.offset === 'number') { - let pos = this.fromOffset(end.offset); - endLine = pos.line; - endColumn = pos.col; - } else { - endLine = end.line; - endColumn = end.column; - } - } else if (!column) { - let pos = this.fromOffset(line); - line = pos.line; - column = pos.col; - } - - let origin = this.origin(line, column, endLine, endColumn); - if (origin) { - result = new CssSyntaxError$1( - message, - origin.endLine === undefined - ? origin.line - : { column: origin.column, line: origin.line }, - origin.endLine === undefined - ? origin.column - : { column: origin.endColumn, line: origin.endLine }, - origin.source, - origin.file, - opts.plugin - ); - } else { - result = new CssSyntaxError$1( - message, - endLine === undefined ? line : { column, line }, - endLine === undefined ? column : { column: endColumn, line: endLine }, - this.css, - this.file, - opts.plugin - ); - } - - result.input = { column, endColumn, endLine, line, source: this.css }; - if (this.file) { - if (pathToFileURL$1) { - result.input.url = pathToFileURL$1(this.file).toString(); - } - result.input.file = this.file; - } - - return result - } - - fromOffset(offset) { - let lastLine, lineToIndex; - if (!this[fromOffsetCache]) { - let lines = this.css.split('\n'); - lineToIndex = new Array(lines.length); - let prevIndex = 0; - - for (let i = 0, l = lines.length; i < l; i++) { - lineToIndex[i] = prevIndex; - prevIndex += lines[i].length + 1; - } - - this[fromOffsetCache] = lineToIndex; - } else { - lineToIndex = this[fromOffsetCache]; - } - lastLine = lineToIndex[lineToIndex.length - 1]; - - let min = 0; - if (offset >= lastLine) { - min = lineToIndex.length - 1; - } else { - let max = lineToIndex.length - 2; - let mid; - while (min < max) { - mid = min + ((max - min) >> 1); - if (offset < lineToIndex[mid]) { - max = mid - 1; - } else if (offset >= lineToIndex[mid + 1]) { - min = mid + 1; - } else { - min = mid; - break - } - } - } - return { - col: offset - lineToIndex[min] + 1, - line: min + 1 - } - } - - mapResolve(file) { - if (/^\w+:\/\//.test(file)) { - return file - } - return resolve$1(this.map.consumer().sourceRoot || this.map.root || '.', file) - } - - origin(line, column, endLine, endColumn) { - if (!this.map) return false - let consumer = this.map.consumer(); - - let from = consumer.originalPositionFor({ column, line }); - if (!from.source) return false - - let to; - if (typeof endLine === 'number') { - to = consumer.originalPositionFor({ column: endColumn, line: endLine }); - } - - let fromUrl; - - if (isAbsolute(from.source)) { - fromUrl = pathToFileURL$1(from.source); - } else { - fromUrl = new URL( - from.source, - this.map.consumer().sourceRoot || pathToFileURL$1(this.map.mapFile) - ); - } - - let result = { - column: from.column, - endColumn: to && to.column, - endLine: to && to.line, - line: from.line, - url: fromUrl.toString() - }; - - if (fromUrl.protocol === 'file:') { - if (fileURLToPath) { - result.file = fileURLToPath(fromUrl); - } else { - /* c8 ignore next 2 */ - throw new Error(`file: protocol is not available in this PostCSS build`) - } - } - - let source = consumer.sourceContentFor(from.source); - if (source) result.source = source; - - return result - } - - toJSON() { - let json = {}; - for (let name of ['hasBOM', 'css', 'file', 'id']) { - if (this[name] != null) { - json[name] = this[name]; - } - } - if (this.map) { - json.map = { ...this.map }; - if (json.map.consumerCache) { - json.map.consumerCache = undefined; - } - } - return json - } - - get from() { - return this.file || this.id - } - } - - var input = Input$4; - Input$4.default = Input$4; - - if (terminalHighlight && terminalHighlight.registerInput) { - terminalHighlight.registerInput(Input$4); - } - - let { SourceMapConsumer, SourceMapGenerator } = sourceMap; - let { dirname, relative, resolve, sep } = require$$2__default["default"]; - let { pathToFileURL } = require$$1__default$1["default"]; - - let Input$3 = input; - - let sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator); - let pathAvailable = Boolean(dirname && resolve && relative && sep); - - class MapGenerator$2 { - constructor(stringify, root, opts, cssString) { - this.stringify = stringify; - this.mapOpts = opts.map || {}; - this.root = root; - this.opts = opts; - this.css = cssString; - this.originalCSS = cssString; - this.usesFileUrls = !this.mapOpts.from && this.mapOpts.absolute; - - this.memoizedFileURLs = new Map(); - this.memoizedPaths = new Map(); - this.memoizedURLs = new Map(); - } - - addAnnotation() { - let content; - - if (this.isInline()) { - content = - 'data:application/json;base64,' + this.toBase64(this.map.toString()); - } else if (typeof this.mapOpts.annotation === 'string') { - content = this.mapOpts.annotation; - } else if (typeof this.mapOpts.annotation === 'function') { - content = this.mapOpts.annotation(this.opts.to, this.root); - } else { - content = this.outputFile() + '.map'; - } - let eol = '\n'; - if (this.css.includes('\r\n')) eol = '\r\n'; - - this.css += eol + '/*# sourceMappingURL=' + content + ' */'; - } - - applyPrevMaps() { - for (let prev of this.previous()) { - let from = this.toUrl(this.path(prev.file)); - let root = prev.root || dirname(prev.file); - let map; - - if (this.mapOpts.sourcesContent === false) { - map = new SourceMapConsumer(prev.text); - if (map.sourcesContent) { - map.sourcesContent = null; - } - } else { - map = prev.consumer(); - } - - this.map.applySourceMap(map, from, this.toUrl(this.path(root))); - } - } - - clearAnnotation() { - if (this.mapOpts.annotation === false) return - - if (this.root) { - let node; - for (let i = this.root.nodes.length - 1; i >= 0; i--) { - node = this.root.nodes[i]; - if (node.type !== 'comment') continue - if (node.text.indexOf('# sourceMappingURL=') === 0) { - this.root.removeChild(i); - } - } - } else if (this.css) { - this.css = this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm, ''); - } - } - - generate() { - this.clearAnnotation(); - if (pathAvailable && sourceMapAvailable && this.isMap()) { - return this.generateMap() - } else { - let result = ''; - this.stringify(this.root, i => { - result += i; - }); - return [result] - } - } - - generateMap() { - if (this.root) { - this.generateString(); - } else if (this.previous().length === 1) { - let prev = this.previous()[0].consumer(); - prev.file = this.outputFile(); - this.map = SourceMapGenerator.fromSourceMap(prev); - } else { - this.map = new SourceMapGenerator({ file: this.outputFile() }); - this.map.addMapping({ - generated: { column: 0, line: 1 }, - original: { column: 0, line: 1 }, - source: this.opts.from - ? this.toUrl(this.path(this.opts.from)) - : '' - }); - } - - if (this.isSourcesContent()) this.setSourcesContent(); - if (this.root && this.previous().length > 0) this.applyPrevMaps(); - if (this.isAnnotation()) this.addAnnotation(); - - if (this.isInline()) { - return [this.css] - } else { - return [this.css, this.map] - } - } - - generateString() { - this.css = ''; - this.map = new SourceMapGenerator({ file: this.outputFile() }); - - let line = 1; - let column = 1; - - let noSource = ''; - let mapping = { - generated: { column: 0, line: 0 }, - original: { column: 0, line: 0 }, - source: '' - }; - - let lines, last; - this.stringify(this.root, (str, node, type) => { - this.css += str; - - if (node && type !== 'end') { - mapping.generated.line = line; - mapping.generated.column = column - 1; - if (node.source && node.source.start) { - mapping.source = this.sourcePath(node); - mapping.original.line = node.source.start.line; - mapping.original.column = node.source.start.column - 1; - this.map.addMapping(mapping); - } else { - mapping.source = noSource; - mapping.original.line = 1; - mapping.original.column = 0; - this.map.addMapping(mapping); - } - } - - lines = str.match(/\n/g); - if (lines) { - line += lines.length; - last = str.lastIndexOf('\n'); - column = str.length - last; - } else { - column += str.length; - } - - if (node && type !== 'start') { - let p = node.parent || { raws: {} }; - let childless = - node.type === 'decl' || (node.type === 'atrule' && !node.nodes); - if (!childless || node !== p.last || p.raws.semicolon) { - if (node.source && node.source.end) { - mapping.source = this.sourcePath(node); - mapping.original.line = node.source.end.line; - mapping.original.column = node.source.end.column - 1; - mapping.generated.line = line; - mapping.generated.column = column - 2; - this.map.addMapping(mapping); - } else { - mapping.source = noSource; - mapping.original.line = 1; - mapping.original.column = 0; - mapping.generated.line = line; - mapping.generated.column = column - 1; - this.map.addMapping(mapping); - } - } - } - }); - } - - isAnnotation() { - if (this.isInline()) { - return true - } - if (typeof this.mapOpts.annotation !== 'undefined') { - return this.mapOpts.annotation - } - if (this.previous().length) { - return this.previous().some(i => i.annotation) - } - return true - } - - isInline() { - if (typeof this.mapOpts.inline !== 'undefined') { - return this.mapOpts.inline - } - - let annotation = this.mapOpts.annotation; - if (typeof annotation !== 'undefined' && annotation !== true) { - return false - } - - if (this.previous().length) { - return this.previous().some(i => i.inline) - } - return true - } - - isMap() { - if (typeof this.opts.map !== 'undefined') { - return !!this.opts.map - } - return this.previous().length > 0 - } - - isSourcesContent() { - if (typeof this.mapOpts.sourcesContent !== 'undefined') { - return this.mapOpts.sourcesContent - } - if (this.previous().length) { - return this.previous().some(i => i.withContent()) - } - return true - } - - outputFile() { - if (this.opts.to) { - return this.path(this.opts.to) - } else if (this.opts.from) { - return this.path(this.opts.from) - } else { - return 'to.css' - } - } - - path(file) { - if (this.mapOpts.absolute) return file - if (file.charCodeAt(0) === 60 /* `<` */) return file - if (/^\w+:\/\//.test(file)) return file - let cached = this.memoizedPaths.get(file); - if (cached) return cached - - let from = this.opts.to ? dirname(this.opts.to) : '.'; - - if (typeof this.mapOpts.annotation === 'string') { - from = dirname(resolve(from, this.mapOpts.annotation)); - } - - let path = relative(from, file); - this.memoizedPaths.set(file, path); - - return path - } - - previous() { - if (!this.previousMaps) { - this.previousMaps = []; - if (this.root) { - this.root.walk(node => { - if (node.source && node.source.input.map) { - let map = node.source.input.map; - if (!this.previousMaps.includes(map)) { - this.previousMaps.push(map); - } - } - }); - } else { - let input = new Input$3(this.originalCSS, this.opts); - if (input.map) this.previousMaps.push(input.map); - } - } - - return this.previousMaps - } - - setSourcesContent() { - let already = {}; - if (this.root) { - this.root.walk(node => { - if (node.source) { - let from = node.source.input.from; - if (from && !already[from]) { - already[from] = true; - let fromUrl = this.usesFileUrls - ? this.toFileUrl(from) - : this.toUrl(this.path(from)); - this.map.setSourceContent(fromUrl, node.source.input.css); - } - } - }); - } else if (this.css) { - let from = this.opts.from - ? this.toUrl(this.path(this.opts.from)) - : ''; - this.map.setSourceContent(from, this.css); - } - } - - sourcePath(node) { - if (this.mapOpts.from) { - return this.toUrl(this.mapOpts.from) - } else if (this.usesFileUrls) { - return this.toFileUrl(node.source.input.from) - } else { - return this.toUrl(this.path(node.source.input.from)) - } - } - - toBase64(str) { - if (Buffer) { - return Buffer.from(str).toString('base64') - } else { - return window.btoa(unescape(encodeURIComponent(str))) - } - } - - toFileUrl(path) { - let cached = this.memoizedFileURLs.get(path); - if (cached) return cached - - if (pathToFileURL) { - let fileURL = pathToFileURL(path).toString(); - this.memoizedFileURLs.set(path, fileURL); - - return fileURL - } else { - throw new Error( - '`map.absolute` option is not available in this PostCSS build' - ) - } - } - - toUrl(path) { - let cached = this.memoizedURLs.get(path); - if (cached) return cached - - if (sep === '\\') { - path = path.replace(/\\/g, '/'); - } - - let url = encodeURI(path).replace(/[#?]/g, encodeURIComponent); - this.memoizedURLs.set(path, url); - - return url - } - } - - var mapGenerator = MapGenerator$2; - - let Node$2 = node_1; - - class Comment$4 extends Node$2 { - constructor(defaults) { - super(defaults); - this.type = 'comment'; - } - } - - var comment = Comment$4; - Comment$4.default = Comment$4; - - let { isClean: isClean$1, my: my$1 } = symbols; - let Declaration$3 = declaration; - let Comment$3 = comment; - let Node$1 = node_1; - - let parse$4, Rule$4, AtRule$4, Root$6; - - function cleanSource(nodes) { - return nodes.map(i => { - if (i.nodes) i.nodes = cleanSource(i.nodes); - delete i.source; - return i - }) - } - - function markDirtyUp(node) { - node[isClean$1] = false; - if (node.proxyOf.nodes) { - for (let i of node.proxyOf.nodes) { - markDirtyUp(i); - } - } - } - - class Container$7 extends Node$1 { - append(...children) { - for (let child of children) { - let nodes = this.normalize(child, this.last); - for (let node of nodes) this.proxyOf.nodes.push(node); - } - - this.markDirty(); - - return this - } - - cleanRaws(keepBetween) { - super.cleanRaws(keepBetween); - if (this.nodes) { - for (let node of this.nodes) node.cleanRaws(keepBetween); - } - } - - each(callback) { - if (!this.proxyOf.nodes) return undefined - let iterator = this.getIterator(); - - let index, result; - while (this.indexes[iterator] < this.proxyOf.nodes.length) { - index = this.indexes[iterator]; - result = callback(this.proxyOf.nodes[index], index); - if (result === false) break - - this.indexes[iterator] += 1; - } - - delete this.indexes[iterator]; - return result - } - - every(condition) { - return this.nodes.every(condition) - } - - getIterator() { - if (!this.lastEach) this.lastEach = 0; - if (!this.indexes) this.indexes = {}; - - this.lastEach += 1; - let iterator = this.lastEach; - this.indexes[iterator] = 0; - - return iterator - } - - getProxyProcessor() { - return { - get(node, prop) { - if (prop === 'proxyOf') { - return node - } else if (!node[prop]) { - return node[prop] - } else if ( - prop === 'each' || - (typeof prop === 'string' && prop.startsWith('walk')) - ) { - return (...args) => { - return node[prop]( - ...args.map(i => { - if (typeof i === 'function') { - return (child, index) => i(child.toProxy(), index) - } else { - return i - } - }) - ) - } - } else if (prop === 'every' || prop === 'some') { - return cb => { - return node[prop]((child, ...other) => - cb(child.toProxy(), ...other) - ) - } - } else if (prop === 'root') { - return () => node.root().toProxy() - } else if (prop === 'nodes') { - return node.nodes.map(i => i.toProxy()) - } else if (prop === 'first' || prop === 'last') { - return node[prop].toProxy() - } else { - return node[prop] - } - }, - - set(node, prop, value) { - if (node[prop] === value) return true - node[prop] = value; - if (prop === 'name' || prop === 'params' || prop === 'selector') { - node.markDirty(); - } - return true - } - } - } - - index(child) { - if (typeof child === 'number') return child - if (child.proxyOf) child = child.proxyOf; - return this.proxyOf.nodes.indexOf(child) - } - - insertAfter(exist, add) { - let existIndex = this.index(exist); - let nodes = this.normalize(add, this.proxyOf.nodes[existIndex]).reverse(); - existIndex = this.index(exist); - for (let node of nodes) this.proxyOf.nodes.splice(existIndex + 1, 0, node); - - let index; - for (let id in this.indexes) { - index = this.indexes[id]; - if (existIndex < index) { - this.indexes[id] = index + nodes.length; - } - } - - this.markDirty(); - - return this - } - - insertBefore(exist, add) { - let existIndex = this.index(exist); - let type = existIndex === 0 ? 'prepend' : false; - let nodes = this.normalize(add, this.proxyOf.nodes[existIndex], type).reverse(); - existIndex = this.index(exist); - for (let node of nodes) this.proxyOf.nodes.splice(existIndex, 0, node); - - let index; - for (let id in this.indexes) { - index = this.indexes[id]; - if (existIndex <= index) { - this.indexes[id] = index + nodes.length; - } - } - - this.markDirty(); - - return this - } - - normalize(nodes, sample) { - if (typeof nodes === 'string') { - nodes = cleanSource(parse$4(nodes).nodes); - } else if (typeof nodes === 'undefined') { - nodes = []; - } else if (Array.isArray(nodes)) { - nodes = nodes.slice(0); - for (let i of nodes) { - if (i.parent) i.parent.removeChild(i, 'ignore'); - } - } else if (nodes.type === 'root' && this.type !== 'document') { - nodes = nodes.nodes.slice(0); - for (let i of nodes) { - if (i.parent) i.parent.removeChild(i, 'ignore'); - } - } else if (nodes.type) { - nodes = [nodes]; - } else if (nodes.prop) { - if (typeof nodes.value === 'undefined') { - throw new Error('Value field is missed in node creation') - } else if (typeof nodes.value !== 'string') { - nodes.value = String(nodes.value); - } - nodes = [new Declaration$3(nodes)]; - } else if (nodes.selector) { - nodes = [new Rule$4(nodes)]; - } else if (nodes.name) { - nodes = [new AtRule$4(nodes)]; - } else if (nodes.text) { - nodes = [new Comment$3(nodes)]; - } else { - throw new Error('Unknown node type in node creation') - } - - let processed = nodes.map(i => { - /* c8 ignore next */ - if (!i[my$1]) Container$7.rebuild(i); - i = i.proxyOf; - if (i.parent) i.parent.removeChild(i); - if (i[isClean$1]) markDirtyUp(i); - if (typeof i.raws.before === 'undefined') { - if (sample && typeof sample.raws.before !== 'undefined') { - i.raws.before = sample.raws.before.replace(/\S/g, ''); - } - } - i.parent = this.proxyOf; - return i - }); - - return processed - } - - prepend(...children) { - children = children.reverse(); - for (let child of children) { - let nodes = this.normalize(child, this.first, 'prepend').reverse(); - for (let node of nodes) this.proxyOf.nodes.unshift(node); - for (let id in this.indexes) { - this.indexes[id] = this.indexes[id] + nodes.length; - } - } - - this.markDirty(); - - return this - } - - push(child) { - child.parent = this; - this.proxyOf.nodes.push(child); - return this - } - - removeAll() { - for (let node of this.proxyOf.nodes) node.parent = undefined; - this.proxyOf.nodes = []; - - this.markDirty(); - - return this - } - - removeChild(child) { - child = this.index(child); - this.proxyOf.nodes[child].parent = undefined; - this.proxyOf.nodes.splice(child, 1); - - let index; - for (let id in this.indexes) { - index = this.indexes[id]; - if (index >= child) { - this.indexes[id] = index - 1; - } - } - - this.markDirty(); - - return this - } - - replaceValues(pattern, opts, callback) { - if (!callback) { - callback = opts; - opts = {}; - } - - this.walkDecls(decl => { - if (opts.props && !opts.props.includes(decl.prop)) return - if (opts.fast && !decl.value.includes(opts.fast)) return - - decl.value = decl.value.replace(pattern, callback); - }); - - this.markDirty(); - - return this - } - - some(condition) { - return this.nodes.some(condition) - } - - walk(callback) { - return this.each((child, i) => { - let result; - try { - result = callback(child, i); - } catch (e) { - throw child.addToError(e) - } - if (result !== false && child.walk) { - result = child.walk(callback); - } - - return result - }) - } - - walkAtRules(name, callback) { - if (!callback) { - callback = name; - return this.walk((child, i) => { - if (child.type === 'atrule') { - return callback(child, i) - } - }) - } - if (name instanceof RegExp) { - return this.walk((child, i) => { - if (child.type === 'atrule' && name.test(child.name)) { - return callback(child, i) - } - }) - } - return this.walk((child, i) => { - if (child.type === 'atrule' && child.name === name) { - return callback(child, i) - } - }) - } - - walkComments(callback) { - return this.walk((child, i) => { - if (child.type === 'comment') { - return callback(child, i) - } - }) - } - - walkDecls(prop, callback) { - if (!callback) { - callback = prop; - return this.walk((child, i) => { - if (child.type === 'decl') { - return callback(child, i) - } - }) - } - if (prop instanceof RegExp) { - return this.walk((child, i) => { - if (child.type === 'decl' && prop.test(child.prop)) { - return callback(child, i) - } - }) - } - return this.walk((child, i) => { - if (child.type === 'decl' && child.prop === prop) { - return callback(child, i) - } - }) - } - - walkRules(selector, callback) { - if (!callback) { - callback = selector; - - return this.walk((child, i) => { - if (child.type === 'rule') { - return callback(child, i) - } - }) - } - if (selector instanceof RegExp) { - return this.walk((child, i) => { - if (child.type === 'rule' && selector.test(child.selector)) { - return callback(child, i) - } - }) - } - return this.walk((child, i) => { - if (child.type === 'rule' && child.selector === selector) { - return callback(child, i) - } - }) - } - - get first() { - if (!this.proxyOf.nodes) return undefined - return this.proxyOf.nodes[0] - } - - get last() { - if (!this.proxyOf.nodes) return undefined - return this.proxyOf.nodes[this.proxyOf.nodes.length - 1] - } - } - - Container$7.registerParse = dependant => { - parse$4 = dependant; - }; - - Container$7.registerRule = dependant => { - Rule$4 = dependant; - }; - - Container$7.registerAtRule = dependant => { - AtRule$4 = dependant; - }; - - Container$7.registerRoot = dependant => { - Root$6 = dependant; - }; - - var container = Container$7; - Container$7.default = Container$7; - - /* c8 ignore start */ - Container$7.rebuild = node => { - if (node.type === 'atrule') { - Object.setPrototypeOf(node, AtRule$4.prototype); - } else if (node.type === 'rule') { - Object.setPrototypeOf(node, Rule$4.prototype); - } else if (node.type === 'decl') { - Object.setPrototypeOf(node, Declaration$3.prototype); - } else if (node.type === 'comment') { - Object.setPrototypeOf(node, Comment$3.prototype); - } else if (node.type === 'root') { - Object.setPrototypeOf(node, Root$6.prototype); - } - - node[my$1] = true; - - if (node.nodes) { - node.nodes.forEach(child => { - Container$7.rebuild(child); - }); - } - }; - - let Container$6 = container; - - let LazyResult$4, Processor$3; - - class Document$3 extends Container$6 { - constructor(defaults) { - // type needs to be passed to super, otherwise child roots won't be normalized correctly - super({ type: 'document', ...defaults }); - - if (!this.nodes) { - this.nodes = []; - } - } - - toResult(opts = {}) { - let lazy = new LazyResult$4(new Processor$3(), this, opts); - - return lazy.stringify() - } - } - - Document$3.registerLazyResult = dependant => { - LazyResult$4 = dependant; - }; - - Document$3.registerProcessor = dependant => { - Processor$3 = dependant; - }; - - var document$1 = Document$3; - Document$3.default = Document$3; - - /* eslint-disable no-console */ - - let printed = {}; - - var warnOnce$2 = function warnOnce(message) { - if (printed[message]) return - printed[message] = true; - - if (typeof console !== 'undefined' && console.warn) { - console.warn(message); - } - }; - - class Warning$2 { - constructor(text, opts = {}) { - this.type = 'warning'; - this.text = text; - - if (opts.node && opts.node.source) { - let range = opts.node.rangeBy(opts); - this.line = range.start.line; - this.column = range.start.column; - this.endLine = range.end.line; - this.endColumn = range.end.column; - } - - for (let opt in opts) this[opt] = opts[opt]; - } - - toString() { - if (this.node) { - return this.node.error(this.text, { - index: this.index, - plugin: this.plugin, - word: this.word - }).message - } - - if (this.plugin) { - return this.plugin + ': ' + this.text - } - - return this.text - } - } - - var warning = Warning$2; - Warning$2.default = Warning$2; - - let Warning$1 = warning; - - class Result$3 { - constructor(processor, root, opts) { - this.processor = processor; - this.messages = []; - this.root = root; - this.opts = opts; - this.css = undefined; - this.map = undefined; - } - - toString() { - return this.css - } - - warn(text, opts = {}) { - if (!opts.plugin) { - if (this.lastPlugin && this.lastPlugin.postcssPlugin) { - opts.plugin = this.lastPlugin.postcssPlugin; - } - } - - let warning = new Warning$1(text, opts); - this.messages.push(warning); - - return warning - } - - warnings() { - return this.messages.filter(i => i.type === 'warning') - } - - get content() { - return this.css - } - } - - var result = Result$3; - Result$3.default = Result$3; - - let Container$5 = container; - - class AtRule$3 extends Container$5 { - constructor(defaults) { - super(defaults); - this.type = 'atrule'; - } - - append(...children) { - if (!this.proxyOf.nodes) this.nodes = []; - return super.append(...children) - } - - prepend(...children) { - if (!this.proxyOf.nodes) this.nodes = []; - return super.prepend(...children) - } - } - - var atRule = AtRule$3; - AtRule$3.default = AtRule$3; - - Container$5.registerAtRule(AtRule$3); - - let Container$4 = container; - - let LazyResult$3, Processor$2; - - class Root$5 extends Container$4 { - constructor(defaults) { - super(defaults); - this.type = 'root'; - if (!this.nodes) this.nodes = []; - } - - normalize(child, sample, type) { - let nodes = super.normalize(child); - - if (sample) { - if (type === 'prepend') { - if (this.nodes.length > 1) { - sample.raws.before = this.nodes[1].raws.before; - } else { - delete sample.raws.before; - } - } else if (this.first !== sample) { - for (let node of nodes) { - node.raws.before = sample.raws.before; - } - } - } - - return nodes - } - - removeChild(child, ignore) { - let index = this.index(child); - - if (!ignore && index === 0 && this.nodes.length > 1) { - this.nodes[1].raws.before = this.nodes[index].raws.before; - } - - return super.removeChild(child) - } - - toResult(opts = {}) { - let lazy = new LazyResult$3(new Processor$2(), this, opts); - return lazy.stringify() - } - } - - Root$5.registerLazyResult = dependant => { - LazyResult$3 = dependant; - }; - - Root$5.registerProcessor = dependant => { - Processor$2 = dependant; - }; - - var root = Root$5; - Root$5.default = Root$5; - - Container$4.registerRoot(Root$5); - - let list$2 = { - comma(string) { - return list$2.split(string, [','], true) - }, - - space(string) { - let spaces = [' ', '\n', '\t']; - return list$2.split(string, spaces) - }, - - split(string, separators, last) { - let array = []; - let current = ''; - let split = false; - - let func = 0; - let inQuote = false; - let prevQuote = ''; - let escape = false; - - for (let letter of string) { - if (escape) { - escape = false; - } else if (letter === '\\') { - escape = true; - } else if (inQuote) { - if (letter === prevQuote) { - inQuote = false; - } - } else if (letter === '"' || letter === "'") { - inQuote = true; - prevQuote = letter; - } else if (letter === '(') { - func += 1; - } else if (letter === ')') { - if (func > 0) func -= 1; - } else if (func === 0) { - if (separators.includes(letter)) split = true; - } - - if (split) { - if (current !== '') array.push(current.trim()); - current = ''; - split = false; - } else { - current += letter; - } - } - - if (last || current !== '') array.push(current.trim()); - return array - } - }; - - var list_1 = list$2; - list$2.default = list$2; - - let Container$3 = container; - let list$1 = list_1; - - class Rule$3 extends Container$3 { - constructor(defaults) { - super(defaults); - this.type = 'rule'; - if (!this.nodes) this.nodes = []; - } - - get selectors() { - return list$1.comma(this.selector) - } - - set selectors(values) { - let match = this.selector ? this.selector.match(/,\s*/) : null; - let sep = match ? match[0] : ',' + this.raw('between', 'beforeOpen'); - this.selector = values.join(sep); - } - } - - var rule = Rule$3; - Rule$3.default = Rule$3; - - Container$3.registerRule(Rule$3); - - let Declaration$2 = declaration; - let tokenizer = tokenize; - let Comment$2 = comment; - let AtRule$2 = atRule; - let Root$4 = root; - let Rule$2 = rule; - - const SAFE_COMMENT_NEIGHBOR = { - empty: true, - space: true - }; - - function findLastWithPosition(tokens) { - for (let i = tokens.length - 1; i >= 0; i--) { - let token = tokens[i]; - let pos = token[3] || token[2]; - if (pos) return pos - } - } - - class Parser$1 { - constructor(input) { - this.input = input; - - this.root = new Root$4(); - this.current = this.root; - this.spaces = ''; - this.semicolon = false; - - this.createTokenizer(); - this.root.source = { input, start: { column: 1, line: 1, offset: 0 } }; - } - - atrule(token) { - let node = new AtRule$2(); - node.name = token[1].slice(1); - if (node.name === '') { - this.unnamedAtrule(node, token); - } - this.init(node, token[2]); - - let type; - let prev; - let shift; - let last = false; - let open = false; - let params = []; - let brackets = []; - - while (!this.tokenizer.endOfFile()) { - token = this.tokenizer.nextToken(); - type = token[0]; - - if (type === '(' || type === '[') { - brackets.push(type === '(' ? ')' : ']'); - } else if (type === '{' && brackets.length > 0) { - brackets.push('}'); - } else if (type === brackets[brackets.length - 1]) { - brackets.pop(); - } - - if (brackets.length === 0) { - if (type === ';') { - node.source.end = this.getPosition(token[2]); - node.source.end.offset++; - this.semicolon = true; - break - } else if (type === '{') { - open = true; - break - } else if (type === '}') { - if (params.length > 0) { - shift = params.length - 1; - prev = params[shift]; - while (prev && prev[0] === 'space') { - prev = params[--shift]; - } - if (prev) { - node.source.end = this.getPosition(prev[3] || prev[2]); - node.source.end.offset++; - } - } - this.end(token); - break - } else { - params.push(token); - } - } else { - params.push(token); - } - - if (this.tokenizer.endOfFile()) { - last = true; - break - } - } - - node.raws.between = this.spacesAndCommentsFromEnd(params); - if (params.length) { - node.raws.afterName = this.spacesAndCommentsFromStart(params); - this.raw(node, 'params', params); - if (last) { - token = params[params.length - 1]; - node.source.end = this.getPosition(token[3] || token[2]); - node.source.end.offset++; - this.spaces = node.raws.between; - node.raws.between = ''; - } - } else { - node.raws.afterName = ''; - node.params = ''; - } - - if (open) { - node.nodes = []; - this.current = node; - } - } - - checkMissedSemicolon(tokens) { - let colon = this.colon(tokens); - if (colon === false) return - - let founded = 0; - let token; - for (let j = colon - 1; j >= 0; j--) { - token = tokens[j]; - if (token[0] !== 'space') { - founded += 1; - if (founded === 2) break - } - } - // If the token is a word, e.g. `!important`, `red` or any other valid property's value. - // Then we need to return the colon after that word token. [3] is the "end" colon of that word. - // And because we need it after that one we do +1 to get the next one. - throw this.input.error( - 'Missed semicolon', - token[0] === 'word' ? token[3] + 1 : token[2] - ) - } - - colon(tokens) { - let brackets = 0; - let token, type, prev; - for (let [i, element] of tokens.entries()) { - token = element; - type = token[0]; - - if (type === '(') { - brackets += 1; - } - if (type === ')') { - brackets -= 1; - } - if (brackets === 0 && type === ':') { - if (!prev) { - this.doubleColon(token); - } else if (prev[0] === 'word' && prev[1] === 'progid') { - continue - } else { - return i - } - } - - prev = token; - } - return false - } - - comment(token) { - let node = new Comment$2(); - this.init(node, token[2]); - node.source.end = this.getPosition(token[3] || token[2]); - node.source.end.offset++; - - let text = token[1].slice(2, -2); - if (/^\s*$/.test(text)) { - node.text = ''; - node.raws.left = text; - node.raws.right = ''; - } else { - let match = text.match(/^(\s*)([^]*\S)(\s*)$/); - node.text = match[2]; - node.raws.left = match[1]; - node.raws.right = match[3]; - } - } - - createTokenizer() { - this.tokenizer = tokenizer(this.input); - } - - decl(tokens, customProperty) { - let node = new Declaration$2(); - this.init(node, tokens[0][2]); - - let last = tokens[tokens.length - 1]; - if (last[0] === ';') { - this.semicolon = true; - tokens.pop(); - } - - node.source.end = this.getPosition( - last[3] || last[2] || findLastWithPosition(tokens) - ); - node.source.end.offset++; - - while (tokens[0][0] !== 'word') { - if (tokens.length === 1) this.unknownWord(tokens); - node.raws.before += tokens.shift()[1]; - } - node.source.start = this.getPosition(tokens[0][2]); - - node.prop = ''; - while (tokens.length) { - let type = tokens[0][0]; - if (type === ':' || type === 'space' || type === 'comment') { - break - } - node.prop += tokens.shift()[1]; - } - - node.raws.between = ''; - - let token; - while (tokens.length) { - token = tokens.shift(); - - if (token[0] === ':') { - node.raws.between += token[1]; - break - } else { - if (token[0] === 'word' && /\w/.test(token[1])) { - this.unknownWord([token]); - } - node.raws.between += token[1]; - } - } - - if (node.prop[0] === '_' || node.prop[0] === '*') { - node.raws.before += node.prop[0]; - node.prop = node.prop.slice(1); - } - - let firstSpaces = []; - let next; - while (tokens.length) { - next = tokens[0][0]; - if (next !== 'space' && next !== 'comment') break - firstSpaces.push(tokens.shift()); - } - - this.precheckMissedSemicolon(tokens); - - for (let i = tokens.length - 1; i >= 0; i--) { - token = tokens[i]; - if (token[1].toLowerCase() === '!important') { - node.important = true; - let string = this.stringFrom(tokens, i); - string = this.spacesFromEnd(tokens) + string; - if (string !== ' !important') node.raws.important = string; - break - } else if (token[1].toLowerCase() === 'important') { - let cache = tokens.slice(0); - let str = ''; - for (let j = i; j > 0; j--) { - let type = cache[j][0]; - if (str.trim().indexOf('!') === 0 && type !== 'space') { - break - } - str = cache.pop()[1] + str; - } - if (str.trim().indexOf('!') === 0) { - node.important = true; - node.raws.important = str; - tokens = cache; - } - } - - if (token[0] !== 'space' && token[0] !== 'comment') { - break - } - } - - let hasWord = tokens.some(i => i[0] !== 'space' && i[0] !== 'comment'); - - if (hasWord) { - node.raws.between += firstSpaces.map(i => i[1]).join(''); - firstSpaces = []; - } - this.raw(node, 'value', firstSpaces.concat(tokens), customProperty); - - if (node.value.includes(':') && !customProperty) { - this.checkMissedSemicolon(tokens); - } - } - - doubleColon(token) { - throw this.input.error( - 'Double colon', - { offset: token[2] }, - { offset: token[2] + token[1].length } - ) - } - - emptyRule(token) { - let node = new Rule$2(); - this.init(node, token[2]); - node.selector = ''; - node.raws.between = ''; - this.current = node; - } - - end(token) { - if (this.current.nodes && this.current.nodes.length) { - this.current.raws.semicolon = this.semicolon; - } - this.semicolon = false; - - this.current.raws.after = (this.current.raws.after || '') + this.spaces; - this.spaces = ''; - - if (this.current.parent) { - this.current.source.end = this.getPosition(token[2]); - this.current.source.end.offset++; - this.current = this.current.parent; - } else { - this.unexpectedClose(token); - } - } - - endFile() { - if (this.current.parent) this.unclosedBlock(); - if (this.current.nodes && this.current.nodes.length) { - this.current.raws.semicolon = this.semicolon; - } - this.current.raws.after = (this.current.raws.after || '') + this.spaces; - this.root.source.end = this.getPosition(this.tokenizer.position()); - } - - freeSemicolon(token) { - this.spaces += token[1]; - if (this.current.nodes) { - let prev = this.current.nodes[this.current.nodes.length - 1]; - if (prev && prev.type === 'rule' && !prev.raws.ownSemicolon) { - prev.raws.ownSemicolon = this.spaces; - this.spaces = ''; - } - } - } - - // Helpers - - getPosition(offset) { - let pos = this.input.fromOffset(offset); - return { - column: pos.col, - line: pos.line, - offset - } - } - - init(node, offset) { - this.current.push(node); - node.source = { - input: this.input, - start: this.getPosition(offset) - }; - node.raws.before = this.spaces; - this.spaces = ''; - if (node.type !== 'comment') this.semicolon = false; - } - - other(start) { - let end = false; - let type = null; - let colon = false; - let bracket = null; - let brackets = []; - let customProperty = start[1].startsWith('--'); - - let tokens = []; - let token = start; - while (token) { - type = token[0]; - tokens.push(token); - - if (type === '(' || type === '[') { - if (!bracket) bracket = token; - brackets.push(type === '(' ? ')' : ']'); - } else if (customProperty && colon && type === '{') { - if (!bracket) bracket = token; - brackets.push('}'); - } else if (brackets.length === 0) { - if (type === ';') { - if (colon) { - this.decl(tokens, customProperty); - return - } else { - break - } - } else if (type === '{') { - this.rule(tokens); - return - } else if (type === '}') { - this.tokenizer.back(tokens.pop()); - end = true; - break - } else if (type === ':') { - colon = true; - } - } else if (type === brackets[brackets.length - 1]) { - brackets.pop(); - if (brackets.length === 0) bracket = null; - } - - token = this.tokenizer.nextToken(); - } - - if (this.tokenizer.endOfFile()) end = true; - if (brackets.length > 0) this.unclosedBracket(bracket); - - if (end && colon) { - if (!customProperty) { - while (tokens.length) { - token = tokens[tokens.length - 1][0]; - if (token !== 'space' && token !== 'comment') break - this.tokenizer.back(tokens.pop()); - } - } - this.decl(tokens, customProperty); - } else { - this.unknownWord(tokens); - } - } - - parse() { - let token; - while (!this.tokenizer.endOfFile()) { - token = this.tokenizer.nextToken(); - - switch (token[0]) { - case 'space': - this.spaces += token[1]; - break - - case ';': - this.freeSemicolon(token); - break - - case '}': - this.end(token); - break - - case 'comment': - this.comment(token); - break - - case 'at-word': - this.atrule(token); - break - - case '{': - this.emptyRule(token); - break - - default: - this.other(token); - break - } - } - this.endFile(); - } - - precheckMissedSemicolon(/* tokens */) { - // Hook for Safe Parser - } - - raw(node, prop, tokens, customProperty) { - let token, type; - let length = tokens.length; - let value = ''; - let clean = true; - let next, prev; - - for (let i = 0; i < length; i += 1) { - token = tokens[i]; - type = token[0]; - if (type === 'space' && i === length - 1 && !customProperty) { - clean = false; - } else if (type === 'comment') { - prev = tokens[i - 1] ? tokens[i - 1][0] : 'empty'; - next = tokens[i + 1] ? tokens[i + 1][0] : 'empty'; - if (!SAFE_COMMENT_NEIGHBOR[prev] && !SAFE_COMMENT_NEIGHBOR[next]) { - if (value.slice(-1) === ',') { - clean = false; - } else { - value += token[1]; - } - } else { - clean = false; - } - } else { - value += token[1]; - } - } - if (!clean) { - let raw = tokens.reduce((all, i) => all + i[1], ''); - node.raws[prop] = { raw, value }; - } - node[prop] = value; - } - - rule(tokens) { - tokens.pop(); - - let node = new Rule$2(); - this.init(node, tokens[0][2]); - - node.raws.between = this.spacesAndCommentsFromEnd(tokens); - this.raw(node, 'selector', tokens); - this.current = node; - } - - spacesAndCommentsFromEnd(tokens) { - let lastTokenType; - let spaces = ''; - while (tokens.length) { - lastTokenType = tokens[tokens.length - 1][0]; - if (lastTokenType !== 'space' && lastTokenType !== 'comment') break - spaces = tokens.pop()[1] + spaces; - } - return spaces - } - - // Errors - - spacesAndCommentsFromStart(tokens) { - let next; - let spaces = ''; - while (tokens.length) { - next = tokens[0][0]; - if (next !== 'space' && next !== 'comment') break - spaces += tokens.shift()[1]; - } - return spaces - } - - spacesFromEnd(tokens) { - let lastTokenType; - let spaces = ''; - while (tokens.length) { - lastTokenType = tokens[tokens.length - 1][0]; - if (lastTokenType !== 'space') break - spaces = tokens.pop()[1] + spaces; - } - return spaces - } - - stringFrom(tokens, from) { - let result = ''; - for (let i = from; i < tokens.length; i++) { - result += tokens[i][1]; - } - tokens.splice(from, tokens.length - from); - return result - } - - unclosedBlock() { - let pos = this.current.source.start; - throw this.input.error('Unclosed block', pos.line, pos.column) - } - - unclosedBracket(bracket) { - throw this.input.error( - 'Unclosed bracket', - { offset: bracket[2] }, - { offset: bracket[2] + 1 } - ) - } - - unexpectedClose(token) { - throw this.input.error( - 'Unexpected }', - { offset: token[2] }, - { offset: token[2] + 1 } - ) - } - - unknownWord(tokens) { - throw this.input.error( - 'Unknown word', - { offset: tokens[0][2] }, - { offset: tokens[0][2] + tokens[0][1].length } - ) - } - - unnamedAtrule(node, token) { - throw this.input.error( - 'At-rule without name', - { offset: token[2] }, - { offset: token[2] + token[1].length } - ) - } - } - - var parser = Parser$1; - - let Container$2 = container; - let Parser = parser; - let Input$2 = input; - - function parse$3(css, opts) { - let input = new Input$2(css, opts); - let parser = new Parser(input); - try { - parser.parse(); - } catch (e) { - if (process.env.NODE_ENV !== 'production') { - if (e.name === 'CssSyntaxError' && opts && opts.from) { - if (/\.scss$/i.test(opts.from)) { - e.message += - '\nYou tried to parse SCSS with ' + - 'the standard CSS parser; ' + - 'try again with the postcss-scss parser'; - } else if (/\.sass/i.test(opts.from)) { - e.message += - '\nYou tried to parse Sass with ' + - 'the standard CSS parser; ' + - 'try again with the postcss-sass parser'; - } else if (/\.less$/i.test(opts.from)) { - e.message += - '\nYou tried to parse Less with ' + - 'the standard CSS parser; ' + - 'try again with the postcss-less parser'; - } - } - } - throw e - } - - return parser.root - } - - var parse_1 = parse$3; - parse$3.default = parse$3; - - Container$2.registerParse(parse$3); - - let { isClean, my } = symbols; - let MapGenerator$1 = mapGenerator; - let stringify$2 = stringify_1; - let Container$1 = container; - let Document$2 = document$1; - let warnOnce$1 = warnOnce$2; - let Result$2 = result; - let parse$2 = parse_1; - let Root$3 = root; - - const TYPE_TO_CLASS_NAME = { - atrule: 'AtRule', - comment: 'Comment', - decl: 'Declaration', - document: 'Document', - root: 'Root', - rule: 'Rule' - }; - - const PLUGIN_PROPS = { - AtRule: true, - AtRuleExit: true, - Comment: true, - CommentExit: true, - Declaration: true, - DeclarationExit: true, - Document: true, - DocumentExit: true, - Once: true, - OnceExit: true, - postcssPlugin: true, - prepare: true, - Root: true, - RootExit: true, - Rule: true, - RuleExit: true - }; - - const NOT_VISITORS = { - Once: true, - postcssPlugin: true, - prepare: true - }; - - const CHILDREN = 0; - - function isPromise(obj) { - return typeof obj === 'object' && typeof obj.then === 'function' - } - - function getEvents(node) { - let key = false; - let type = TYPE_TO_CLASS_NAME[node.type]; - if (node.type === 'decl') { - key = node.prop.toLowerCase(); - } else if (node.type === 'atrule') { - key = node.name.toLowerCase(); - } - - if (key && node.append) { - return [ - type, - type + '-' + key, - CHILDREN, - type + 'Exit', - type + 'Exit-' + key - ] - } else if (key) { - return [type, type + '-' + key, type + 'Exit', type + 'Exit-' + key] - } else if (node.append) { - return [type, CHILDREN, type + 'Exit'] - } else { - return [type, type + 'Exit'] - } - } - - function toStack(node) { - let events; - if (node.type === 'document') { - events = ['Document', CHILDREN, 'DocumentExit']; - } else if (node.type === 'root') { - events = ['Root', CHILDREN, 'RootExit']; - } else { - events = getEvents(node); - } - - return { - eventIndex: 0, - events, - iterator: 0, - node, - visitorIndex: 0, - visitors: [] - } - } - - function cleanMarks(node) { - node[isClean] = false; - if (node.nodes) node.nodes.forEach(i => cleanMarks(i)); - return node - } - - let postcss$1 = {}; - - class LazyResult$2 { - constructor(processor, css, opts) { - this.stringified = false; - this.processed = false; - - let root; - if ( - typeof css === 'object' && - css !== null && - (css.type === 'root' || css.type === 'document') - ) { - root = cleanMarks(css); - } else if (css instanceof LazyResult$2 || css instanceof Result$2) { - root = cleanMarks(css.root); - if (css.map) { - if (typeof opts.map === 'undefined') opts.map = {}; - if (!opts.map.inline) opts.map.inline = false; - opts.map.prev = css.map; - } - } else { - let parser = parse$2; - if (opts.syntax) parser = opts.syntax.parse; - if (opts.parser) parser = opts.parser; - if (parser.parse) parser = parser.parse; - - try { - root = parser(css, opts); - } catch (error) { - this.processed = true; - this.error = error; - } - - if (root && !root[my]) { - /* c8 ignore next 2 */ - Container$1.rebuild(root); - } - } - - this.result = new Result$2(processor, root, opts); - this.helpers = { ...postcss$1, postcss: postcss$1, result: this.result }; - this.plugins = this.processor.plugins.map(plugin => { - if (typeof plugin === 'object' && plugin.prepare) { - return { ...plugin, ...plugin.prepare(this.result) } - } else { - return plugin - } - }); - } - - async() { - if (this.error) return Promise.reject(this.error) - if (this.processed) return Promise.resolve(this.result) - if (!this.processing) { - this.processing = this.runAsync(); - } - return this.processing - } - - catch(onRejected) { - return this.async().catch(onRejected) - } - - finally(onFinally) { - return this.async().then(onFinally, onFinally) - } - - getAsyncError() { - throw new Error('Use process(css).then(cb) to work with async plugins') - } - - handleError(error, node) { - let plugin = this.result.lastPlugin; - try { - if (node) node.addToError(error); - this.error = error; - if (error.name === 'CssSyntaxError' && !error.plugin) { - error.plugin = plugin.postcssPlugin; - error.setMessage(); - } else if (plugin.postcssVersion) { - if (process.env.NODE_ENV !== 'production') { - let pluginName = plugin.postcssPlugin; - let pluginVer = plugin.postcssVersion; - let runtimeVer = this.result.processor.version; - let a = pluginVer.split('.'); - let b = runtimeVer.split('.'); - - if (a[0] !== b[0] || parseInt(a[1]) > parseInt(b[1])) { - // eslint-disable-next-line no-console - console.error( - 'Unknown error from PostCSS plugin. Your current PostCSS ' + - 'version is ' + - runtimeVer + - ', but ' + - pluginName + - ' uses ' + - pluginVer + - '. Perhaps this is the source of the error below.' - ); - } - } - } - } catch (err) { - /* c8 ignore next 3 */ - // eslint-disable-next-line no-console - if (console && console.error) console.error(err); - } - return error - } - - prepareVisitors() { - this.listeners = {}; - let add = (plugin, type, cb) => { - if (!this.listeners[type]) this.listeners[type] = []; - this.listeners[type].push([plugin, cb]); - }; - for (let plugin of this.plugins) { - if (typeof plugin === 'object') { - for (let event in plugin) { - if (!PLUGIN_PROPS[event] && /^[A-Z]/.test(event)) { - throw new Error( - `Unknown event ${event} in ${plugin.postcssPlugin}. ` + - `Try to update PostCSS (${this.processor.version} now).` - ) - } - if (!NOT_VISITORS[event]) { - if (typeof plugin[event] === 'object') { - for (let filter in plugin[event]) { - if (filter === '*') { - add(plugin, event, plugin[event][filter]); - } else { - add( - plugin, - event + '-' + filter.toLowerCase(), - plugin[event][filter] - ); - } - } - } else if (typeof plugin[event] === 'function') { - add(plugin, event, plugin[event]); - } - } - } - } - } - this.hasListener = Object.keys(this.listeners).length > 0; - } - - async runAsync() { - this.plugin = 0; - for (let i = 0; i < this.plugins.length; i++) { - let plugin = this.plugins[i]; - let promise = this.runOnRoot(plugin); - if (isPromise(promise)) { - try { - await promise; - } catch (error) { - throw this.handleError(error) - } - } - } - - this.prepareVisitors(); - if (this.hasListener) { - let root = this.result.root; - while (!root[isClean]) { - root[isClean] = true; - let stack = [toStack(root)]; - while (stack.length > 0) { - let promise = this.visitTick(stack); - if (isPromise(promise)) { - try { - await promise; - } catch (e) { - let node = stack[stack.length - 1].node; - throw this.handleError(e, node) - } - } - } - } - - if (this.listeners.OnceExit) { - for (let [plugin, visitor] of this.listeners.OnceExit) { - this.result.lastPlugin = plugin; - try { - if (root.type === 'document') { - let roots = root.nodes.map(subRoot => - visitor(subRoot, this.helpers) - ); - - await Promise.all(roots); - } else { - await visitor(root, this.helpers); - } - } catch (e) { - throw this.handleError(e) - } - } - } - } - - this.processed = true; - return this.stringify() - } - - runOnRoot(plugin) { - this.result.lastPlugin = plugin; - try { - if (typeof plugin === 'object' && plugin.Once) { - if (this.result.root.type === 'document') { - let roots = this.result.root.nodes.map(root => - plugin.Once(root, this.helpers) - ); - - if (isPromise(roots[0])) { - return Promise.all(roots) - } - - return roots - } - - return plugin.Once(this.result.root, this.helpers) - } else if (typeof plugin === 'function') { - return plugin(this.result.root, this.result) - } - } catch (error) { - throw this.handleError(error) - } - } - - stringify() { - if (this.error) throw this.error - if (this.stringified) return this.result - this.stringified = true; - - this.sync(); - - let opts = this.result.opts; - let str = stringify$2; - if (opts.syntax) str = opts.syntax.stringify; - if (opts.stringifier) str = opts.stringifier; - if (str.stringify) str = str.stringify; - - let map = new MapGenerator$1(str, this.result.root, this.result.opts); - let data = map.generate(); - this.result.css = data[0]; - this.result.map = data[1]; - - return this.result - } - - sync() { - if (this.error) throw this.error - if (this.processed) return this.result - this.processed = true; - - if (this.processing) { - throw this.getAsyncError() - } - - for (let plugin of this.plugins) { - let promise = this.runOnRoot(plugin); - if (isPromise(promise)) { - throw this.getAsyncError() - } - } - - this.prepareVisitors(); - if (this.hasListener) { - let root = this.result.root; - while (!root[isClean]) { - root[isClean] = true; - this.walkSync(root); - } - if (this.listeners.OnceExit) { - if (root.type === 'document') { - for (let subRoot of root.nodes) { - this.visitSync(this.listeners.OnceExit, subRoot); - } - } else { - this.visitSync(this.listeners.OnceExit, root); - } - } - } - - return this.result - } - - then(onFulfilled, onRejected) { - if (process.env.NODE_ENV !== 'production') { - if (!('from' in this.opts)) { - warnOnce$1( - 'Without `from` option PostCSS could generate wrong source map ' + - 'and will not find Browserslist config. Set it to CSS file path ' + - 'or to `undefined` to prevent this warning.' - ); - } - } - return this.async().then(onFulfilled, onRejected) - } - - toString() { - return this.css - } - - visitSync(visitors, node) { - for (let [plugin, visitor] of visitors) { - this.result.lastPlugin = plugin; - let promise; - try { - promise = visitor(node, this.helpers); - } catch (e) { - throw this.handleError(e, node.proxyOf) - } - if (node.type !== 'root' && node.type !== 'document' && !node.parent) { - return true - } - if (isPromise(promise)) { - throw this.getAsyncError() - } - } - } - - visitTick(stack) { - let visit = stack[stack.length - 1]; - let { node, visitors } = visit; - - if (node.type !== 'root' && node.type !== 'document' && !node.parent) { - stack.pop(); - return - } - - if (visitors.length > 0 && visit.visitorIndex < visitors.length) { - let [plugin, visitor] = visitors[visit.visitorIndex]; - visit.visitorIndex += 1; - if (visit.visitorIndex === visitors.length) { - visit.visitors = []; - visit.visitorIndex = 0; - } - this.result.lastPlugin = plugin; - try { - return visitor(node.toProxy(), this.helpers) - } catch (e) { - throw this.handleError(e, node) - } - } - - if (visit.iterator !== 0) { - let iterator = visit.iterator; - let child; - while ((child = node.nodes[node.indexes[iterator]])) { - node.indexes[iterator] += 1; - if (!child[isClean]) { - child[isClean] = true; - stack.push(toStack(child)); - return - } - } - visit.iterator = 0; - delete node.indexes[iterator]; - } - - let events = visit.events; - while (visit.eventIndex < events.length) { - let event = events[visit.eventIndex]; - visit.eventIndex += 1; - if (event === CHILDREN) { - if (node.nodes && node.nodes.length) { - node[isClean] = true; - visit.iterator = node.getIterator(); - } - return - } else if (this.listeners[event]) { - visit.visitors = this.listeners[event]; - return - } - } - stack.pop(); - } - - walkSync(node) { - node[isClean] = true; - let events = getEvents(node); - for (let event of events) { - if (event === CHILDREN) { - if (node.nodes) { - node.each(child => { - if (!child[isClean]) this.walkSync(child); - }); - } - } else { - let visitors = this.listeners[event]; - if (visitors) { - if (this.visitSync(visitors, node.toProxy())) return - } - } - } - } - - warnings() { - return this.sync().warnings() - } - - get content() { - return this.stringify().content - } - - get css() { - return this.stringify().css - } - - get map() { - return this.stringify().map - } - - get messages() { - return this.sync().messages - } - - get opts() { - return this.result.opts - } - - get processor() { - return this.result.processor - } - - get root() { - return this.sync().root - } - - get [Symbol.toStringTag]() { - return 'LazyResult' - } - } - - LazyResult$2.registerPostcss = dependant => { - postcss$1 = dependant; - }; - - var lazyResult = LazyResult$2; - LazyResult$2.default = LazyResult$2; - - Root$3.registerLazyResult(LazyResult$2); - Document$2.registerLazyResult(LazyResult$2); - - let MapGenerator = mapGenerator; - let stringify$1 = stringify_1; - let warnOnce = warnOnce$2; - let parse$1 = parse_1; - const Result$1 = result; - - class NoWorkResult$1 { - constructor(processor, css, opts) { - css = css.toString(); - this.stringified = false; - - this._processor = processor; - this._css = css; - this._opts = opts; - this._map = undefined; - let root; - - let str = stringify$1; - this.result = new Result$1(this._processor, root, this._opts); - this.result.css = css; - - let self = this; - Object.defineProperty(this.result, 'root', { - get() { - return self.root - } - }); - - let map = new MapGenerator(str, root, this._opts, css); - if (map.isMap()) { - let [generatedCSS, generatedMap] = map.generate(); - if (generatedCSS) { - this.result.css = generatedCSS; - } - if (generatedMap) { - this.result.map = generatedMap; - } - } else { - map.clearAnnotation(); - this.result.css = map.css; - } - } - - async() { - if (this.error) return Promise.reject(this.error) - return Promise.resolve(this.result) - } - - catch(onRejected) { - return this.async().catch(onRejected) - } - - finally(onFinally) { - return this.async().then(onFinally, onFinally) - } - - sync() { - if (this.error) throw this.error - return this.result - } - - then(onFulfilled, onRejected) { - if (process.env.NODE_ENV !== 'production') { - if (!('from' in this._opts)) { - warnOnce( - 'Without `from` option PostCSS could generate wrong source map ' + - 'and will not find Browserslist config. Set it to CSS file path ' + - 'or to `undefined` to prevent this warning.' - ); - } - } - - return this.async().then(onFulfilled, onRejected) - } - - toString() { - return this._css - } - - warnings() { - return [] - } - - get content() { - return this.result.css - } - - get css() { - return this.result.css - } - - get map() { - return this.result.map - } - - get messages() { - return [] - } - - get opts() { - return this.result.opts - } - - get processor() { - return this.result.processor - } - - get root() { - if (this._root) { - return this._root - } - - let root; - let parser = parse$1; - - try { - root = parser(this._css, this._opts); - } catch (error) { - this.error = error; - } - - if (this.error) { - throw this.error - } else { - this._root = root; - return root - } - } - - get [Symbol.toStringTag]() { - return 'NoWorkResult' - } - } - - var noWorkResult = NoWorkResult$1; - NoWorkResult$1.default = NoWorkResult$1; - - let NoWorkResult = noWorkResult; - let LazyResult$1 = lazyResult; - let Document$1 = document$1; - let Root$2 = root; - - class Processor$1 { - constructor(plugins = []) { - this.version = '8.4.35'; - this.plugins = this.normalize(plugins); - } - - normalize(plugins) { - let normalized = []; - for (let i of plugins) { - if (i.postcss === true) { - i = i(); - } else if (i.postcss) { - i = i.postcss; - } - - if (typeof i === 'object' && Array.isArray(i.plugins)) { - normalized = normalized.concat(i.plugins); - } else if (typeof i === 'object' && i.postcssPlugin) { - normalized.push(i); - } else if (typeof i === 'function') { - normalized.push(i); - } else if (typeof i === 'object' && (i.parse || i.stringify)) { - if (process.env.NODE_ENV !== 'production') { - throw new Error( - 'PostCSS syntaxes cannot be used as plugins. Instead, please use ' + - 'one of the syntax/parser/stringifier options as outlined ' + - 'in your PostCSS runner documentation.' - ) - } - } else { - throw new Error(i + ' is not a PostCSS plugin') - } - } - return normalized - } - - process(css, opts = {}) { - if ( - !this.plugins.length && - !opts.parser && - !opts.stringifier && - !opts.syntax - ) { - return new NoWorkResult(this, css, opts) - } else { - return new LazyResult$1(this, css, opts) - } - } - - use(plugin) { - this.plugins = this.plugins.concat(this.normalize([plugin])); - return this - } - } - - var processor = Processor$1; - Processor$1.default = Processor$1; - - Root$2.registerProcessor(Processor$1); - Document$1.registerProcessor(Processor$1); - - let Declaration$1 = declaration; - let PreviousMap = previousMap; - let Comment$1 = comment; - let AtRule$1 = atRule; - let Input$1 = input; - let Root$1 = root; - let Rule$1 = rule; - - function fromJSON$1(json, inputs) { - if (Array.isArray(json)) return json.map(n => fromJSON$1(n)) - - let { inputs: ownInputs, ...defaults } = json; - if (ownInputs) { - inputs = []; - for (let input of ownInputs) { - let inputHydrated = { ...input, __proto__: Input$1.prototype }; - if (inputHydrated.map) { - inputHydrated.map = { - ...inputHydrated.map, - __proto__: PreviousMap.prototype - }; - } - inputs.push(inputHydrated); - } - } - if (defaults.nodes) { - defaults.nodes = json.nodes.map(n => fromJSON$1(n, inputs)); - } - if (defaults.source) { - let { inputId, ...source } = defaults.source; - defaults.source = source; - if (inputId != null) { - defaults.source.input = inputs[inputId]; - } - } - if (defaults.type === 'root') { - return new Root$1(defaults) - } else if (defaults.type === 'decl') { - return new Declaration$1(defaults) - } else if (defaults.type === 'rule') { - return new Rule$1(defaults) - } else if (defaults.type === 'comment') { - return new Comment$1(defaults) - } else if (defaults.type === 'atrule') { - return new AtRule$1(defaults) - } else { - throw new Error('Unknown node type: ' + json.type) - } - } - - var fromJSON_1 = fromJSON$1; - fromJSON$1.default = fromJSON$1; - - let CssSyntaxError = cssSyntaxError; - let Declaration = declaration; - let LazyResult = lazyResult; - let Container = container; - let Processor = processor; - let stringify = stringify_1; - let fromJSON = fromJSON_1; - let Document = document$1; - let Warning = warning; - let Comment = comment; - let AtRule = atRule; - let Result = result; - let Input = input; - let parse = parse_1; - let list = list_1; - let Rule = rule; - let Root = root; - let Node = node_1; - - function postcss(...plugins) { - if (plugins.length === 1 && Array.isArray(plugins[0])) { - plugins = plugins[0]; - } - return new Processor(plugins) - } - - postcss.plugin = function plugin(name, initializer) { - let warningPrinted = false; - function creator(...args) { - // eslint-disable-next-line no-console - if (console && console.warn && !warningPrinted) { - warningPrinted = true; - // eslint-disable-next-line no-console - console.warn( - name + - ': postcss.plugin was deprecated. Migration guide:\n' + - 'https://evilmartians.com/chronicles/postcss-8-plugin-migration' - ); - if (process.env.LANG && process.env.LANG.startsWith('cn')) { - /* c8 ignore next 7 */ - // eslint-disable-next-line no-console - console.warn( - name + - ': 里面 postcss.plugin 被弃用. 迁移指南:\n' + - 'https://www.w3ctech.com/topic/2226' - ); - } - } - let transformer = initializer(...args); - transformer.postcssPlugin = name; - transformer.postcssVersion = new Processor().version; - return transformer - } - - let cache; - Object.defineProperty(creator, 'postcss', { - get() { - if (!cache) cache = creator(); - return cache - } - }); - - creator.process = function (css, processOpts, pluginOpts) { - return postcss([creator(pluginOpts)]).process(css, processOpts) - }; - - return creator - }; - - postcss.stringify = stringify; - postcss.parse = parse; - postcss.fromJSON = fromJSON; - postcss.list = list; - - postcss.comment = defaults => new Comment(defaults); - postcss.atRule = defaults => new AtRule(defaults); - postcss.decl = defaults => new Declaration(defaults); - postcss.rule = defaults => new Rule(defaults); - postcss.root = defaults => new Root(defaults); - postcss.document = defaults => new Document(defaults); - - postcss.CssSyntaxError = CssSyntaxError; - postcss.Declaration = Declaration; - postcss.Container = Container; - postcss.Processor = Processor; - postcss.Document = Document; - postcss.Comment = Comment; - postcss.Warning = Warning; - postcss.AtRule = AtRule; - postcss.Result = Result; - postcss.Input = Input; - postcss.Rule = Rule; - postcss.Root = Root; - postcss.Node = Node; - - LazyResult.registerPostcss(postcss); - - var postcss_1 = postcss; - postcss.default = postcss; - - postcss_1.stringify; - postcss_1.fromJSON; - postcss_1.plugin; - postcss_1.parse; - postcss_1.list; - - postcss_1.document; - postcss_1.comment; - postcss_1.atRule; - postcss_1.rule; - postcss_1.decl; - postcss_1.root; - - postcss_1.CssSyntaxError; - postcss_1.Declaration; - postcss_1.Container; - postcss_1.Processor; - postcss_1.Document; - postcss_1.Comment; - postcss_1.Warning; - postcss_1.AtRule; - postcss_1.Result; - postcss_1.Input; - postcss_1.Rule; - postcss_1.Root; - postcss_1.Node; - class FlightkitTreeNavigation extends HTMLElement { base; contents; @@ -10020,4 +2337,4 @@ customElements.define('flk-dropdown', FlightkitDropdown); customElements.define('flk-tree-nav', FlightkitTreeNavigation); -})(require$$0, require$$2, require$$1$1, require$$1); +})(); diff --git a/dist/flightkit-v0.0.4/flightkit.min.js b/dist/flightkit-v0.0.4/flightkit.min.js index 9a82b7a..930836a 100644 --- a/dist/flightkit-v0.0.4/flightkit.min.js +++ b/dist/flightkit-v0.0.4/flightkit.min.js @@ -1 +1 @@ -!function(e,n,s,i){"use strict";function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a,u,g,e=c(e),n=c(n),s=c(s),i=c(i);(t=a=a||{}).Date="date",t.String="string",t.Float="float",t.Number="number",t.Array="array",t.Object="object",t.Bool="bool",t.Currency="currency",t.Undefined="undefined",t.Null="null";const h={date:/^(\d{1,4}-\d{1,4}-\d{1,4}(T)?)/gim,currency:/^[$|€]\s?[0-9]*(\.|,)?\d*(\.|,)?\d*/gim,float:/\d+[,|.]\d+[,|.]?\d*/gim,currencySign:/\$|€/gim,array:/^\s?[[].[^,]+[\]],?/gi,precision:/[-+$€,.]/gm,string:/[a-zA-Z]/gim},m=e=>{return null===e||"null"===e?a.Null:e||0===e||!1===e?null===new RegExp(h.date).exec(e)||isNaN(Date.parse(e))?new RegExp(h.currency).exec(e)?a.Currency:!new RegExp(h.string).exec(e)&&new RegExp(h.float).exec(e.toString())?a.Float:isNaN(e)&&0!==e?Array.isArray(e)?a.Array:"object"==typeof e?a.Object:a.String:a.Number:a.Date:a.Undefined},y=(t,e)=>{const r={value:void 0,type:e=e||m(t),currencySign:""};switch(r.type){case a.String:r.value=t.toString();break;case a.Float:case a.Currency:var n=(t=t.toString()).match(new RegExp(/(,)/gim)),s=t.match(new RegExp(/(\.)/gim));if(n)for(let e=1;e<=n.length;e++)t=e!==n.length||s?t.replace(",",""):t.replace(",",".");if(r.type===a.Currency){const o=new RegExp(h.currencySign);var i=o.exec(t);r.currencySign=null!==i?i[0]:"",t=t.replace(o,"")}r.value=parseFloat(t).toPrecision(12);break;case a.Number:r.value=Number(t);break;case a.Date:r.value=Date.parse(t);break;case a.Array:t.length?"object"==typeof t[0]?r.value=t.map(e=>JSON.stringify(e)).join(", "):r.value=t.join(", "):r.value="";break;case a.Object:r.value=t;break;case a.Undefined:r.value="";break;case a.Null:r.value=null}return r};function v(e,t){var r;let n;for(r of e.split("."))r=r.trim(),n?"object"!=typeof n||Array.isArray(n)||(n=n[r]):n=t[r];return n}const b=(e,t)=>tet<=e,S=(e,t)=>e<=t,x=(e,t,r)=>r?e.toLowerCase()==t.toLowerCase():e==t,A=(e,t)=>e===t,k=(e,t)=>e!=t,E=(e,t)=>e!==t,L=(e,t)=>null!=t&&"string"==typeof e&&0<=e.toLowerCase().indexOf(t.toString().toLowerCase()),O=(e,t)=>null!=t&&0<=e.toString().toLowerCase().indexOf(t.toString().toLowerCase()),M=(e,t)=>null!=t&&"string"==typeof e&&e.toLowerCase().indexOf(t.toString().toLowerCase())<0;function P(r,n){if(0===n.length)return r;{var s=r;const o=[],a=[];let e=[];for(const l of n)l.type&&l.type!==u.And?(e.length&&a.push(e),e=[l]):e.push(l);a.push(e);let t=[];for(const e of a)t=t.concat(R(s,e));t=[...new Set(t)];var i=s.length;for(let e=0;e":return b;case"<":return _;case">=":return C;case"<=":return S;case"is":case"==":return x;case"!is":case"!=":return k;case"===":return A;case"!==":return E;case"like":case"~":case"contains":return L;case"!contains":case"!like":case"!~":return M;default:return O}}(a.operator);if(!l(i,o,a.ignoreCase)){e=!1;break}}e&&r.push(n)}return r};function T(e,t){if(!t||0===t.length)return e;if(1{if(0===r.length)r=r.concat(I(s,e));else{for(const t of r)n=n.concat(I(t,e));r=n,n=[]}}),r}return I(e,t[0])}function I(e,t){const r=[],n=[];do{if(!e||0===e.length)break;var s=e.shift();if(!s)break;const o=s[t];var i=n.indexOf(o.toString());0<=i?r[i].push(s):(n.push(o.toString()),void 0!==r[n.length-1]?r[n.length-1].push(s):r.push([s]))}while(0{if(t){var r=e;const n={};for(const s of t){let e=r.map(e=>e[s].toString());const i=e.map(e=>m(e));i.some(e=>e===a.Float)?(e=e.map(e=>parseFloat(e)),n[s]=parseFloat(e.reduce((e,t)=>e+t).toFixed(2))):(e=e.map(e=>parseInt(e)),n[s]=e.reduce((e,t)=>e+t))}return n}return{}};class D{model;sortDetails=[];filterDetails=[];selection=[];groupByProperties=[];distinctProperties=[];concatenationToken=", ";constructor(e){this.model=JSON.parse(JSON.stringify(e))}sort(e){return this.sortDetails=e,this}orderBy(e,t){return this.sortDetails.push({propertyName:e,direction:t}),this}thenOrderBy(e,t){return this.orderBy(e,t)}filter(e){return Array.isArray(e)?this.filterDetails=e:this.filterDetails.push(e),this}where(e,t,r,n,s){return this.filterDetails.push({propertyName:e,operator:t,value:r,type:n,ignoreCase:s}),this}andWhere(e,t,r,n){return this.where(e,t,r,u.And,n),this}orWhere(e,t,r,n){return this.where(e,t,r,u.Or,n),this}group(e){return this.groupByProperties=e,this}groupBy(e){return this.groupByProperties.push(e),this}thenGroupBy(e){return this.groupByProperties.push(e),this}select(e){return Array.isArray(e)?this.selection=e:"*"!==e&&(this.selection=[e]),this}distinct(e,t){return t&&(this.concatenationToken=t),Array.isArray(e)?this.distinctProperties=e:e&&(this.distinctProperties=[e]),this}execute(){return T(function(t,r){if(0===r.length)return t;{var n=r;let e=[];for(const s of t){const i={};for(const o of n)i[o]=s[o];e.push(i)}return e}}(function(r,n,u){if(!n||!n.length)return r;const s=[],h=[];for(const f of r){const o={};let t="";for(const e of n){var p=v(e,f);o[e]=p,t+=p}if(!h.includes(t)){let e=r;for(const a of Object.keys(o))e=e.filter(e=>e[a]===o[a]);h.push(t),s.push(e)}}const t=[];for(const m of s){let e={};for(const l of m){var i,d=Object.keys(e);if(d.length)for(const c of d)n.includes(c)||(i=e[c],Array.isArray(i)?(i=l[c],Array.isArray(i)?e[c]=[...new Set(...e[c].concat(l[c]))]:e[c].includes(l[c])||e[c].push(l[c])):isNaN(e[c])&&isNaN(l[c])?e[c]!==l[c]&&(e[c]=[e[c],l[c]]):e[c]=e[c]+l[c]);else e=l}t.push(e)}return t.forEach(e=>{for(const t in e)Array.isArray(e[t])&&(e[t]=e[t].join(u))}),t}(B(P(JSON.parse(JSON.stringify(this.model)),this.filterDetails),this.sortDetails),this.distinctProperties,this.concatenationToken),this.selection),this.groupByProperties)}sum(e,t){e=Array.isArray(e)?e:[e];return j(t||this.model,e)}}function U(e,t){t=t?t.toUpperCase():"FLK-";return e.toUpperCase().includes(t)}function F(e,t){var{timeStamp:r,type:n,x:s,y:i}=e;let o=e.target;do{if(!o||"HTML"===o.tagName||U(o.tagName,t)){"HTML"===o.tagName&&(o=null);break}}while(o=o.parentNode||o.parentElement,!U(o.tagName,t));return{target:o,timeStamp:r,type:n,x:s,y:i}}function z(e,t){let r=e.target,n="";for(;r.dataset[t]?n=r.dataset[t]:r=r.parentNode,!n;);return n}class ${constructor(){}_topLevelClasses=[];_events=[];generateId(){return"flk-"+function e(){const t=([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)),r=t.split("-")[0];return window.$flightkitUUIDStore||(window.$flightkitUUIDStore=[]),window.$flightkitUUIDStore.some(e=>e===r)?e():(window.$flightkitUUIDStore.push(r),r)}()}render(t){if(!t.component)throw new Error("Component is not assigned! Can't render");t.id=t.id||this.generateId();var e=this._getAllEventAttributes(t);if(e){var r="#"+t.id;for(const i of e){var n="e-"+i;this.addEvent(r,i,t.getAttribute(n))}}var s=Object.keys(t.classList).length;if(s){for(let e=0;e{this._assignToDom(t,t.component),clearTimeout(this._renderTimer)},10)}addEvent(e,t,r){this._events.push({selector:e,eventType:t,callback:r})}_getExternalCallback(e){let t=void 0;for(const r of e.split("."))t=(t||window)[r];return t}_getAllEventAttributes(e){e=e.attributes;const t=Array.from(e).filter(e=>e.name.startsWith("e-"));return t.map(e=>e.name.slice(2))}_isFlightkitElement(e){return e.toUpperCase().includes("FLK-")}_outerEventHandler(e){const t=F(e),r=(t.contents=e.detail,t.target.getAttribute("e-"+t.type));let n=void 0;for(const s of r.split("."))n=(n||window)[s];return e.preventDefault(),e.stopPropagation(),n(t)}_addEvents(e){if(e.isConnected)for(const r of this._events)if(r.selector.startsWith("."))for(const n of document.querySelectorAll(r.selector))this._addEventToElement(r,n);else{var t=document.querySelector(r.selector);this._addEventToElement(r,t)}}_addEventToElement(e,t){t&&("function"==typeof e.callback?(t.removeEventListener(e.eventType,e.callback),t.addEventListener(e.eventType,e.callback)):(t.removeEventListener(e.eventType,this._outerEventHandler),t.addEventListener(e.eventType,this._outerEventHandler)))}removeEvents(){for(const t of this._events)if(t.selector.startsWith("."))for(const r of document.querySelectorAll(t.selector))this._addEventToElement(t,r);else{var e=document.querySelector(t.selector);this._addEventToElement(t,e)}this._events=[]}_removeEventToElement(e,t){t&&("function"==typeof e.callback?t.removeEventListener(e.eventType,e.callback):t.removeEventListener(e.eventType,this._outerEventHandler))}_assignToDom(e,t){e.innerHTML="";for(const n of Array.isArray(t)?t:[t])e.append(n);const r=setTimeout(()=>{this._addEvents(e),clearTimeout(r)},10)}}const G='',H='';function V(e){const t=new DOMParser;return t.parseFromString(e,"image/svg+xml").documentElement}class W extends HTMLElement{base;component=null;_contents=[];_orderBy=[];properties=new Set;_columnOrder=[];_filter="";_selectionProperty="";_selectedIds=new Set;uniqueEntriesByProperties={};propertyLabelDictionary={};_templates={};_templateClasses={};static get observedAttributes(){return["contents","columns","order","filter","selection-property","templates"]}get columnOrder(){return this._columnOrder.length?this._columnOrder:this.properties}set columnOrder(e){let t;"string"==typeof e&&(t=e.split(",")),t=e,this._columnOrder=t}get contents(){return this._contents}set contents(e){this.analyzeData(e),this._contents=new D(e)}get orderBy(){return this._orderBy}set orderBy(e){if(Array.isArray(e))this._orderBy=e;else{const n=[];for(const s of e.split(",")){var t=s.split("|"),r=t[0],t=1e[r._selectionProperty])):new Set;e=t?r.contents.execute():[];r._emit("select",r,{selection:e}),r._updateCheckboxes(r)}emitSelect(e){var t=e.target.checked,r=e.target.dataset.objectId;const n=F(e).target,s=(t?n._selectedIds.add(r):n._selectedIds.delete(r),n._selectionProperty);e=n.contents.execute().filter(e=>n._selectedIds.has(e[s]));n._emit("select",n,{selection:e}),n._updateCheckboxes(n)}sortData(e){const t=F(e).target,r=z(e,"column");r&&(-1<(e=t._orderBy.findIndex(e=>e.propertyName===r))?"asc"===t._orderBy[e].direction?t._orderBy[e].direction="desc":t._orderBy.splice(e,1):t._orderBy.push({propertyName:r,direction:"asc"}),t.createHtml(),t.base.render(t))}setColumnOrder(e){this._columnOrder=e?Array.isArray(e)?e:e.split(","):[]}analyzeData(t){this.properties=new Set;var r=t.length;for(let e=0;e"_"===e?" ":" "+e.toLowerCase()).trim();var r=t.charAt(0).toUpperCase()+t.slice(1);return this.propertyLabelDictionary[e]=r}parseTemplate(e,n){return e.replace(/\{\{([\s\S]+?)\}\}/gim,(e,t)=>{let r="";t=t.trim();t=n[t];return t&&(r=t),Array.isArray(r)?r.join(", "):r.toString().trim()})}createSelectionCheckbox(e){const t=document.createElement("input");return t.setAttribute("type","checkbox"),t.classList.add("flk-selection-checkbox"),e&&(t.dataset.selected=e[this._selectionProperty]),t}createRow(e){const t=document.createElement("tr");if(this._selectionProperty.length){const s=document.createElement("td");var r=this.base.generateId();const i=this.createSelectionCheckbox(e);i.id=r,i.dataset.objectId=e[this._selectionProperty];var n=e[this._selectionProperty];this._selectedIds.has(n)?i.checked=!0:i.checked=!1,this.base.addEvent("#"+r,"change",this.emitSelect),s.append(i),t.append(s)}for(const o of this.columnOrder){const a=document.createElement("td");this._templates[o]?(a.innerHTML=this.parseTemplate(this._templates[o],e),this._templateClasses[o]&&a.classList.add(...this._templateClasses[o])):a.innerText=e[o],t.append(a)}return t}createBody(e){const t=document.createElement("tbody");for(const n of e){var r=this.createRow(n,null);t.append(r)}return t}createHead(){const e=document.createElement("thead"),t=document.createElement("tr");if(t.classList.add("cursor-pointer"),this._selectionProperty.length){const s=document.createElement("th");var r=this.base.generateId();const i=this.createSelectionCheckbox();i.id=r;var u=this.contents.execute().length;0e.propertyName===o);if(n){const c=document.createElement("span");c.innerHTML="asc"===n.direction?'':'',a.append(c)}t.append(a)}return e.append(t),e}addEvent(e,t,r){this.base.addEvent(e,t,r)}init(){this.createHtml(),this.base.render(this)}}class J extends HTMLElement{base;componentId;constructor(){super(),this.base=new $}connectedCallback(){var e=this.getAttribute("top"),t=this.getAttribute("left"),r=this.getAttribute("center"),n=this.getAttribute("zIndex");this.id||(this.id=this.base.generateId()),this.style.display="block",this.style.position="fixed","string"==typeof r?(this.style.top=e||"50%",this.style.left="50%",this.style.transform="translate(-50%, -50%)"):(this.style.top=e||this.clientTop+"px",this.style.left=t||this.clientLeft+"px"),n&&(this.style.zIndex=n),this.componentId=this.getAttribute("handle");const s=document.createElement("div");s.innerHTML=this.innerHTML,this.component=s;r="#"+(this.componentId||this.id);this.base.addEvent(r,"mousedown",this._dragElement),this.base.addEvent(r,"mouseup",this._reset),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this)}_dragElement(e){const r=F(e,"flk-draggable").target;let n,s;function t(e){n=e.clientX-r.offsetLeft,s=e.clientY-r.offsetTop}function i(e){var t=e.clientX-n,e=e.clientY-s;r.style.left=t+"px",r.style.top=e+"px"}function o(e){e.preventDefault()}function a(){r.removeAttribute("draggable"),r.removeEventListener("dragstart",t),r.removeEventListener("dragend",a),document.removeEventListener("dragover",o),document.removeEventListener("drop",i)}r.setAttribute("draggable",!0),r.addEventListener("dragstart",t),r.addEventListener("dragend",a),document.addEventListener("dragover",o),document.addEventListener("drop",i)}}class q extends HTMLElement{_id;base;_draggableId;constructor(){super(),this.base=new $}_emit(e,t,r){e=new CustomEvent(e,{detail:r,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}_closeModal(e){e.stopPropagation();const t=F(e,"flk-modal").target;t.classList.add("hidden")}closeModal(e){this.classList.add("hidden")}openModal(e=!0){const t=document.getElementById(this._draggableId);e&&(t.style.top="40%",t.style.left="50%"),this.classList.remove("hidden")}connectedCallback(){this.id||(this.id=this.base.generateId());const e=document.createElement("div");var t=this.base.generateId();const r=document.createElement("flk-draggable"),n=(this._draggableId=this.base.generateId(),r.id=this._draggableId,r.setAttribute("center",""),r.setAttribute("top","40%"),r.setAttribute("handle",t),r.setAttribute("zIndex","1080"),r.classList.add("border","shadow-lg","bg-white"),r.style.width="max-content",document.createElement("div"));var s=this.getAttribute("modal-title");if(s){const c=document.createElement("span");c.innerText=s,c.classList.add("ml-1","mr-auto"),n.append(c)}n.id=t;const i=this.getAttribute("header-class");let o=[];i?o=o.concat(i.split(" ")):o.push("bg-gray-light"),n.classList.add(...o,"border-bottom","row","justify-end","cursor-no-select");s=this.base.generateId();const a=document.createElement("button"),l=(a.classList.add("py-0","px-1","outline-hover","no-border","cursor-default",...o),a.innerText="X",a.id=s,n.append(a),r.append(n),document.createElement("div"));l.innerHTML=this.innerHTML,r.append(l),e.append(r),this.component=e,this.base.addEvent("#"+s,"click",this._closeModal),this.base.render(this),this.classList.add("hidden")}disconnectedCallback(){this.base.removeEvents(this)}}class K extends HTMLElement{base;_buttonId;_drawerId;_iconId;constructor(){super(),this.base=new $}connectedCallback(){this.style.position="relative",this.style.display="flex",this.style.width="fit-content",this._buttonId=this.base.generateId();const e=document.createElement("button"),t=(e.classList.add("row"),e.id=this._buttonId,document.createElement("span")),r=(t.innerText=this.getAttribute("text"),this._iconId=this.base.generateId(),document.createElement("span"));var n=V('');const s=V(''),i=(s.classList.add("hidden"),r.append(n,s),r.id=this._iconId,e.append(t,r),this._drawerId=this.base.generateId(),document.createElement("div"));i.id=this._drawerId,i.classList.add("shadow","inline-block","bg-white"),i.style.position="absolute",i.style.zIndex="1040";n=this.querySelector("template");n.innerHTML.length?i.innerHTML=n.innerHTML:i.append(n.firstChild),i.style.display="none",this.component=[e,i],this.base.addEvent("#"+this._buttonId,"click",this.toggleMenu);const o=document.querySelector("body");""!==o.getAttribute("flk-close-dropdown")&&(o.setAttribute("flk-close-dropdown",""),o.addEventListener("click",this.closeAllDropdownButtons)),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this);var e=document.querySelectorAll("flk-dropdown");if(!e||!e.length){const t=document.querySelector("body");t.removeAttribute("flk-close-dropdown"),t.removeEventListener("click",this.closeAllDropdownButtons)}}toggleMenu(e){const t=F(e).target;e=t._drawerId;const r=document.getElementById(e);var e="none"!==r.style.display,n=(r.style.display=e?"none":"block",t.getAttribute("drawer-width")),n=("string"==typeof t.getAttribute("right")&&(r.style.right="0px"),r.style.top=t.offsetHeight+"px",r.style.width=n||t.offsetWidth+"px",t._iconId);const s=document.getElementById(n);e?(s.childNodes[0].classList.remove("hidden"),s.childNodes[1].classList.add("hidden")):(s.childNodes[0].classList.add("hidden"),s.childNodes[1].classList.remove("hidden"))}_closeDropdown(){var e=this._drawerId;const t=document.getElementById(e);if("none"!==t.style.display){e=this._iconId;const r=document.getElementById(e);t.style.display="none",r.childNodes[0].classList.remove("hidden"),r.childNodes[1].classList.add("hidden")}}closeAllDropdownButtons(e){var t,r=F(e,"flk-dropdown").target,e=document.querySelectorAll("flk-dropdown");if(r)for(const n of e)r._buttonId!==n._buttonId&&(t=n._drawerId,"none"!==document.getElementById(t).style.display&&n._closeDropdown());else for(const s of e)s._closeDropdown()}}var t={exports:{}};let Z=e.default,Y=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||"win32"===process.platform||Z.isatty(1)&&"dumb"!==process.env.TERM||"CI"in process.env),r=(r,n,s=r)=>e=>{let t=""+e;e=t.indexOf(n,r.length);return~e?r+X(t,n,s,e)+n:r+t+n},X=(e,t,r,n)=>{var s=e.substring(0,n)+r;let i=e.substring(n+t.length);e=i.indexOf(t);return~e?s+X(i,t,r,e):s+i};e=(e=Y)=>({isColorSupported:e,reset:e?e=>`${e}`:String,bold:e?r("","",""):String,dim:e?r("","",""):String,italic:e?r("",""):String,underline:e?r("",""):String,inverse:e?r("",""):String,hidden:e?r("",""):String,strikethrough:e?r("",""):String,black:e?r("",""):String,red:e?r("",""):String,green:e?r("",""):String,yellow:e?r("",""):String,blue:e?r("",""):String,magenta:e?r("",""):String,cyan:e?r("",""):String,white:e?r("",""):String,gray:e?r("",""):String,bgBlack:e?r("",""):String,bgRed:e?r("",""):String,bgGreen:e?r("",""):String,bgYellow:e?r("",""):String,bgBlue:e?r("",""):String,bgMagenta:e?r("",""):String,bgCyan:e?r("",""):String,bgWhite:e?r("",""):String});t.exports=e(),t.exports.createColors=e;const Q="'".charCodeAt(0),ee='"'.charCodeAt(0),te="\\".charCodeAt(0),re="/".charCodeAt(0),ne="\n".charCodeAt(0),se=" ".charCodeAt(0),ie="\f".charCodeAt(0),oe="\t".charCodeAt(0),ae="\r".charCodeAt(0),le="[".charCodeAt(0),ce="]".charCodeAt(0),ue="(".charCodeAt(0),he=")".charCodeAt(0),pe="{".charCodeAt(0),de="}".charCodeAt(0),fe=";".charCodeAt(0),me="*".charCodeAt(0),ge=":".charCodeAt(0),ye="@".charCodeAt(0),ve=/[\t\n\f\r "#'()/;[\\\]{}]/g,we=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,be=/.[\r\n"'(/\\]/,_e=/[\da-f]/i;function Ce(t,e={}){let n=t.css.valueOf(),d=e.ignoreErrors,s,i,f,m,o,a,l,g,c,u,y=n.length,h=0,v=[],p=[];function w(e){throw t.error("Unclosed "+e,h)}return{back:function(e){p.push(e)},endOfFile:function(){return 0===p.length&&h>=y},nextToken:function(e){if(p.length)return p.pop();if(!(h>=y)){var t=!!e&&e.ignoreUnclosed;switch(s=n.charCodeAt(h),s){case ne:case se:case oe:case ae:case ie:for(i=h;i+=1,s=n.charCodeAt(i),s===se||s===ne||s===oe||s===ae||s===ie;);u=["space",n.slice(h,i)],h=i-1;break;case le:case ce:case pe:case de:case ge:case fe:case he:var r=String.fromCharCode(s);u=[r,r,h];break;case ue:if(g=v.length?v.pop()[1]:"",c=n.charCodeAt(h+1),"url"===g&&c!==Q&&c!==ee&&c!==se&&c!==ne&&c!==oe&&c!==ie&&c!==ae){i=h;do{if(a=!1,i=n.indexOf(")",i+1),-1===i){if(d||t){i=h;break}w("bracket")}for(l=i;n.charCodeAt(l-1)===te;)--l,a=!a}while(a);u=["brackets",n.slice(h,i+1),h,i],h=i}else i=n.indexOf(")",h+1),m=n.slice(h,i+1),-1===i||be.test(m)?u=["(","(",h]:(u=["brackets",m,h,i],h=i);break;case Q:case ee:f=s===Q?"'":'"',i=h;do{if(a=!1,i=n.indexOf(f,i+1),-1===i){if(d||t){i=h+1;break}w("string")}for(l=i;n.charCodeAt(l-1)===te;)--l,a=!a}while(a);u=["string",n.slice(h,i+1),h,i],h=i;break;case ye:ve.lastIndex=h+1,ve.test(n),i=0===ve.lastIndex?n.length-1:ve.lastIndex-2,u=["at-word",n.slice(h,i+1),h,i],h=i;break;case te:for(i=h,o=!0;n.charCodeAt(i+1)===te;)i+=1,o=!o;if(s=n.charCodeAt(i+1),o&&s!==re&&s!==se&&s!==ne&&s!==oe&&s!==ae&&s!==ie&&(i+=1,_e.test(n.charAt(i)))){for(;_e.test(n.charAt(i+1));)i+=1;n.charCodeAt(i+1)===se&&(i+=1)}u=["word",n.slice(h,i+1),h,i],h=i;break;default:h=(s===re&&n.charCodeAt(h+1)===me?(i=n.indexOf("*/",h+2)+1,0===i&&(d||t?i=n.length:w("comment")),u=["comment",n.slice(h,i+1),h,i]):(we.lastIndex=h+1,we.test(n),i=0===we.lastIndex?n.length-1:we.lastIndex-2,u=["word",n.slice(h,i+1),h,i],v.push(u)),i)}return h++,u}},position:function(){return h}}}e=t.exports;let Se=Ce,xe;const Ae={";":e.yellow,":":e.yellow,"(":e.cyan,")":e.cyan,"[":e.yellow,"]":e.yellow,"{":e.yellow,"}":e.yellow,"at-word":e.cyan,brackets:e.cyan,call:e.cyan,class:e.yellow,comment:e.gray,hash:e.magenta,string:e.green};function ke(e){let r=Se(new xe(e),{ignoreErrors:!0}),n="";for(;!r.endOfFile();){let e=r.nextToken(),t=Ae[function([e,t],r){if("word"===e){if("."===t[0])return"class";if("#"===t[0])return"hash"}if(!r.endOfFile()){t=r.nextToken();if(r.back(t),"brackets"===t[0]||"("===t[0])return"call"}return e}(e,r)];t?n+=e[1].split(/\r?\n/).map(e=>t(e)).join("\n"):n+=e[1]}return n}ke.registerInput=function(e){xe=e};e=ke;let Ee=t.exports,Le=e;class Oe extends Error{constructor(e,t,r,n,s,i){super(e),this.name="CssSyntaxError",this.reason=e,s&&(this.file=s),n&&(this.source=n),i&&(this.plugin=i),void 0!==t&&void 0!==r&&("number"==typeof t?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,Oe)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file||"",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source,r=(null==e&&(e=Ee.isColorSupported),Le&&e&&(t=Le(t)),t.split(/\r?\n/)),n=Math.max(this.line-3,0);var s=Math.min(this.line+2,r.length);let i=String(s).length,o,a;if(e){let{bold:t,gray:r,red:n}=Ee.createColors(!0);o=e=>t(n(e)),a=e=>r(e)}else o=a=e=>e;return r.slice(n,s).map((e,t)=>{var t=n+1+t;let r=" "+(" "+t).slice(-i)+" | ";return t===this.line?(t=a(r.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," "),o(">")+a(r)+e+"\n "+t+o("^")):" "+a(r)+e}).join("\n")}toString(){let e=this.showSourceCode();return e=e&&"\n\n"+e+"\n",this.name+": "+this.message+e}}var t=Oe,Me=(Oe.default=Oe,{});Me.isClean=Symbol("isClean"),Me.my=Symbol("my");const Pe={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class Re{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name;var n=e.params?this.rawValue(e,"params"):"";void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes?this.block(e,r+n):(t=(e.raws.between||"")+(t?";":""),this.builder(r+n+t,e))}beforeAfter(e,t){let r,n=(r="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose"),e.parent),s=0;for(;n&&"root"!==n.type;)s+=1,n=n.parent;if(r.includes("\n")){var i=this.raw(e,null,"indent");if(i.length)for(let e=0;e{if(n=e.raws[t],void 0!==n)return!1}),void 0===n&&(n=Pe[r]),i.rawCache[r]=n,n}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&0{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=void 0===r?this.raw(t,null,"beforeDecl"):r&&r.replace(/\S/g,""),r}rawBeforeDecl(e,t){let r;return e.walkDecls(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=void 0===r?this.raw(t,null,"beforeRule"):r&&r.replace(/\S/g,""),r}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(t){let r;return t.walk(e=>{if(e.nodes&&(e.parent!==t||t.first!==e)&&void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=r&&r.replace(/\S/g,""),r}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(r){if(r.raws.indent)return r.raws.indent;let n;return r.walk(e=>{var t=e.parent;if(t&&t!==r&&t.parent&&t.parent===r&&void 0!==e.raws.before)return t=e.raws.before.split("\n"),n=t[t.length-1],n=n.replace(/\S/g,""),!1}),n}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){var r=e[t],e=e.raws[t];return e&&e.value===r?e.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}}var Te=Re;Re.default=Re;let Ie=Te;function Be(e,t){let r=new Ie(t);r.stringify(e)}var Ne=Be;Be.default=Be;let{isClean:je,my:De}=Me,Ue=t,Fe=Te,ze=Ne;function $e(t,r){let n=new t.constructor;for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&"proxyCache"!==s){let e=t[s];var i=typeof e;"parent"===s&&"object"==i?r&&(n[s]=r):"source"===s?n[s]=e:Array.isArray(e)?n[s]=e.map(e=>$e(e,n)):("object"==i&&null!==e&&(e=$e(e)),n[s]=e)}return n}class Ge{constructor(e={}){for(var t in this.raws={},this[je]=!1,this[De]=!0,e)if("nodes"===t){this.nodes=[];for(var r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){var t;return e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)&&(t=this.source,e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)),e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(var t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=$e(this);for(var r in e)t[r]=e[r];return t}cloneAfter(e={}){e=this.clone(e);return this.parent.insertAfter(this,e),e}cloneBefore(e={}){e=this.clone(e);return this.parent.insertBefore(this,e),e}error(e,t={}){var r,n;return this.source?({end:r,start:n}=this.rangeBy(t),this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)):new Ue(e)}getProxyProcessor(){return{get(e,t){return"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t]},set(e,t,r){return e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0}}}markDirty(){if(this[je]){this[je]=!1;let e=this;for(;e=e.parent;)e[je]=!1}}next(){var e;if(this.parent)return e=this.parent.index(this),this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;return e.index?r=this.positionInside(e.index,t):!e.word||-1!==(e=(t=this.toString()).indexOf(e.word))&&(r=this.positionInside(e,t)),r}positionInside(t,e){var r=e||this.toString();let n=this.source.start.column,s=this.source.start.line;for(let e=0;e"object"==typeof e&&e.toJSON?e.toJSON(null,r):e);else if("object"==typeof t&&t.toJSON)n[s]=t.toJSON(null,r);else if("source"===s){let e=r.get(t.input);null==e&&(e=i,r.set(t.input,i),i++),n[s]={end:t.end,inputId:e,start:t.start}}else n[s]=t}return t&&(n.inputs=[...r.keys()].map(e=>e.toJSON())),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=ze){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(var s in r)n[s]=r[s];return e.warn(t,n)}get proxyOf(){return this}}var Te=Ge,He=(Ge.default=Ge,Te);class Ve extends He{constructor(e){super(e=e&&void 0!==e.value&&"string"!=typeof e.value?{...e,value:String(e.value)}:e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}}var He=Ve,We=(Ve.default=Ve,{}),Je={},qe={},Ke={},Ze="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),Ye=(Ke.encode=function(e){if(0<=e&&e>>=5)&&(t|=32),r+=Ye.encode(t),0>1,1==(1&a)?-i:i),r.rest=t};var Ke={},l=Ke,Xe=(l.getArg=function(e,t,r){if(t in e)return e[t];if(3===arguments.length)return r;throw new Error('"'+t+'" is a required argument.')},/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/),Qe=/^data:.+\,.+$/;function et(e){e=e.match(Xe);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}function tt(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}l.urlParse=et,l.urlGenerate=tt,rt=function(e){var t=e,r=et(e);if(r){if(!r.path)return e;t=r.path}for(var n,e=l.isAbsolute(t),s=[],i=0;;){if(n=i,-1===(i=t.indexOf("/",n))){s.push(t.slice(n));break}for(s.push(t.slice(n,i));in;e--){var o=r[e-1],a=r[e];if(Pt(o,a)<=0)break;r[e-1]=a,r[e]=o}else Ot(r,Pt,n)}function Tt(e,s){var t=e,e=("string"==typeof e&&(t=w.parseSourceMapInput(e)),w.getArg(t,"version")),t=w.getArg(t,"sections");if(e!=this._version)throw new Error("Unsupported version: "+e);this._sources=new Et,this._names=new Et;var i={line:-1,column:0};this._sections=t.map(function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var t=w.getArg(e,"offset"),r=w.getArg(t,"line"),n=w.getArg(t,"column");if(r=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))},p.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;var r=this._findSourceIndex(e);if(0<=r)return this.sourcesContent[r];var n,r=e;if(null!=this.sourceRoot&&(r=w.relative(this.sourceRoot,r)),null!=this.sourceRoot&&(n=w.urlParse(this.sourceRoot))){e=r.replace(/^file:\/\//,"");if("file"==n.scheme&&this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];if((!n.path||"/"==n.path)&&this._sources.has("/"+r))return this.sourcesContent[this._sources.indexOf("/"+r)]}if(t)return null;throw new Error('"'+r+'" is not in the SourceMap.')},p.prototype.generatedPositionFor=function(e){var t=w.getArg(e,"source");if((t=this._findSourceIndex(t))<0)return{line:null,column:null,lastColumn:null};t={source:t,originalLine:w.getArg(e,"line"),originalColumn:w.getArg(e,"column")},e=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",w.compareByOriginalPositions,w.getArg(e,"bias",f.GREATEST_LOWER_BOUND));if(0<=e){e=this._originalMappings[e];if(e.source===t.source)return{line:w.getArg(e,"generatedLine",null),column:w.getArg(e,"generatedColumn",null),lastColumn:w.getArg(e,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},ft.BasicSourceMapConsumer=p,(Tt.prototype=Object.create(f.prototype)).constructor=f,Tt.prototype._version=3,Object.defineProperty(Tt.prototype,"sources",{get:function(){for(var e=[],t=0;t{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(n,s=21)=>(e=s)=>{let t="",r=e;for(;r--;)t+=n[Math.random()*n.length|0];return t}};let{SourceMapConsumer:Ut,SourceMapGenerator:Ft}=We,{existsSync:zt,readFileSync:$t}=i.default,{dirname:Gt,join:Ht}=n.default;class Vt{constructor(e,t){!1!==t.map&&(this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:"),e=t.map?t.map.prev:void 0,e=this.loadMap(t.from,e),!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Gt(this.mapFile)),e&&(this.text=e))}consumer(){return this.consumerCache||(this.consumerCache=new Ut(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+t)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);var r,n;t&&(r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r),-1"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,i,o;t&&"object"==typeof t?(a=r,r="number"==typeof(l=t).offset?(t=(c=this.fromOffset(l.offset)).line,c.col):(t=l.line,l.column),o="number"==typeof a.offset?(c=this.fromOffset(a.offset),i=c.line,c.col):(i=a.line,a.column)):r||(t=(l=this.fromOffset(t)).line,r=l.col);var a,l,c=this.origin(t,r,i,o);return s=c?new Xt(e,void 0===c.endLine?c.line:{column:c.column,line:c.line},void 0===c.endLine?c.column:{column:c.endColumn,line:c.endLine},c.source,c.file,n.plugin):new Xt(e,void 0===i?t:{column:r,line:t},void 0===i?r:{column:o,line:i},this.css,this.file,n.plugin),s.input={column:r,endColumn:o,endLine:i,line:t,source:this.css},this.file&&(Jt&&(s.input.url=Jt(this.file).toString()),s.input.file=this.file),s}fromOffset(t){let n;if(this[er])n=this[er];else{var s=this.css.split("\n");n=new Array(s.length);let r=0;for(let e=0,t=s.length;e>1),t=n[i+1])){r=i;break}r=i+1}}return{col:t-n[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Kt(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let s=this.map.consumer();t=s.originalPositionFor({column:t,line:e});if(!t.source)return!1;let i;"number"==typeof r&&(i=s.originalPositionFor({column:n,line:r}));let o,a=(o=qt(t.source)?Jt(t.source):new URL(t.source,this.map.consumer().sourceRoot||Jt(this.map.mapFile)),{column:t.column,endColumn:i&&i.column,endLine:i&&i.line,line:t.line,url:o.toString()});if("file:"===o.protocol){if(!Wt)throw new Error("file: protocol is not available in this PostCSS build");a.file=Wt(o)}e=s.sourceContentFor(t.source);return e&&(a.source=e),a}toJSON(){let e={};for(var t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}}Je=nr;nr.default=nr,Yt&&Yt.registerInput&&Yt.registerInput(nr);let{SourceMapConsumer:sr,SourceMapGenerator:ir}=We,{dirname:or,relative:ar,resolve:lr,sep:cr}=n.default,ur=s.default["pathToFileURL"],hr=Je,pr=Boolean(sr&&ir),dr=Boolean(or&&lr&&ar&&cr);ft=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e,t=(e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map","\n");this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(var t of this.previous()){var r=this.toUrl(this.path(t.file)),n=t.root||or(t.file);let e;!1===this.mapOpts.sourcesContent?(e=new sr(t.text),e.sourcesContent&&(e.sourcesContent=null)):e=t.consumer(),this.map.applySourceMap(e,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let t;for(let e=this.root.nodes.length-1;0<=e;e--)t=this.root.nodes[e],"comment"===t.type&&0===t.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(e)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),dr&&pr&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,e=>{t+=e}),[t]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=ir.fromSourceMap(e)}else this.map=new ir({file:this.outputFile()}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):""});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&0",o={generated:{column:0,line:0},original:{column:0,line:0},source:""},a,l;this.stringify(this.root,(e,t,r)=>{this.css+=e,t&&"end"!==r&&(o.generated.line=n,o.generated.column=s-1,t.source&&t.source.start?(o.source=this.sourcePath(t),o.original.line=t.source.start.line,o.original.column=t.source.start.column-1):(o.source=i,o.original.line=1,o.original.column=0),this.map.addMapping(o)),a=e.match(/\n/g),a?(n+=a.length,l=e.lastIndexOf("\n"),s=e.length-l):s+=e.length,t&&"start"!==r&&(e=t.parent||{raws:{}},("decl"===t.type||"atrule"===t.type&&!t.nodes)&&t===e.last&&!e.raws.semicolon||(t.source&&t.source.end?(o.source=this.sourcePath(t),o.original.line=t.source.end.line,o.original.column=t.source.end.column-1,o.generated.line=n,o.generated.column=s-2):(o.source=i,o.original.line=1,o.original.column=0,o.generated.line=n,o.generated.column=s-1),this.map.addMapping(o)))})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;var e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:0e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;var t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?or(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=or(lr(r,this.mapOpts.annotation)));t=ar(r,e);return this.memoizedPaths.set(e,t),t}previous(){var e;return this.previousMaps||(this.previousMaps=[],this.root?this.root.walk(e=>{e.source&&e.source.input.map&&(e=e.source.input.map,this.previousMaps.includes(e)||this.previousMaps.push(e))}):(e=new hr(this.originalCSS,this.opts)).map&&this.previousMaps.push(e.map)),this.previousMaps}setSourcesContent(){let r={};var e;this.root?this.root.walk(e=>{var t;!e.source||(t=e.source.input.from)&&!r[t]&&(r[t]=!0,t=this.usesFileUrls?this.toFileUrl(t):this.toUrl(this.path(t)),this.map.setSourceContent(t,e.source.input.css))}):this.css&&(e=this.opts.from?this.toUrl(this.path(this.opts.from)):"",this.map.setSourceContent(e,this.css))}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){var t=this.memoizedFileURLs.get(e);if(t)return t;if(ur)return t=ur(e).toString(),this.memoizedFileURLs.set(e,t),t;throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){var t=this.memoizedURLs.get(e);if(t)return t;"\\"===cr&&(e=e.replace(/\\/g,"/"));t=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,t),t}};class fr extends Te{constructor(e){super(e),this.type="comment"}}Ct=fr;fr.default=fr;let{isClean:mr,my:gr}=Me,yr=He,vr=Ct,wr,br,_r,Cr;class Sr extends Te{append(...e){for(var t of e){var r;for(r of this.normalize(t,this.last))this.proxyOf.nodes.push(r)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(var t of this.nodes)t.cleanRaws(e)}each(r){if(this.proxyOf.nodes){var n=this.getIterator();let e,t;for(;this.indexes[n]t[n](...e.map(r=>"function"==typeof r?(e,t)=>r(e.toProxy(),t):r)):"every"===n||"some"===n?r=>t[n]((e,...t)=>r(e.toProxy(),...t)):"root"===n?()=>t.root().toProxy():"nodes"===n?t.nodes.map(e=>e.toProxy()):"first"===n||"last"===n?t[n].toProxy():t[n])},set(e,t,r){return e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0}}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){var r,n,s,i=this.index(e),o=this.normalize(t,this.proxyOf.nodes[i]).reverse(),i=this.index(e);for(r of o)this.proxyOf.nodes.splice(i+1,0,r);for(s in this.indexes)i<(n=this.indexes[s])&&(this.indexes[s]=n+o.length);return this.markDirty(),this}insertBefore(e,t){var r,n,s,i=this.index(e),o=this.normalize(t,this.proxyOf.nodes[i],0===i&&"prepend").reverse(),i=this.index(e);for(r of o)this.proxyOf.nodes.splice(i,0,r);for(s in this.indexes)i<=(n=this.indexes[s])&&(this.indexes[s]=n+o.length);return this.markDirty(),this}normalize(e,t){if("string"==typeof e)e=function t(e){return e.map(e=>(e.nodes&&(e.nodes=t(e.nodes)),delete e.source,e))}(wr(e).nodes);else if(void 0===e)e=[];else if(Array.isArray(e))for(var r of e=e.slice(0))r.parent&&r.parent.removeChild(r,"ignore");else if("root"===e.type&&"document"!==this.type)for(var n of e=e.nodes.slice(0))n.parent&&n.parent.removeChild(n,"ignore");else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new yr(e)]}else if(e.selector)e=[new br(e)];else if(e.name)e=[new _r(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new vr(e)]}return e.map(e=>(e[gr]||Sr.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[mr]&&function e(t){if(t[mr]=!1,t.proxyOf.nodes)for(var r of t.proxyOf.nodes)e(r)}(e),void 0===e.raws.before&&t&&void 0!==t.raws.before&&(e.raws.before=t.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}prepend(...e){for(var t of e=e.reverse()){var r,n,s=this.normalize(t,this.first,"prepend").reverse();for(r of s)this.proxyOf.nodes.unshift(r);for(n in this.indexes)this.indexes[n]=this.indexes[n]+s.length}return this.markDirty(),this}push(e){return(e.parent=this).proxyOf.nodes.push(e),this}removeAll(){for(var e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){var t,r;for(r in e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1),this.indexes)e<=(t=this.indexes[r])&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(t,r,n){return n||(n=r,r={}),this.walkDecls(e=>{r.props&&!r.props.includes(e.prop)||r.fast&&!e.value.includes(r.fast)||(e.value=e.value.replace(t,n))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(n){return this.each((t,e)=>{let r;try{r=n(t,e)}catch(e){throw t.addToError(e)}return!1!==r&&t.walk&&(r=t.walk(n)),r})}walkAtRules(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("atrule"===e.type&&r.test(e.name))return n(e,t)}):this.walk((e,t)=>{if("atrule"===e.type&&e.name===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("atrule"===e.type)return n(e,t)}))}walkComments(r){return this.walk((e,t)=>{if("comment"===e.type)return r(e,t)})}walkDecls(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("decl"===e.type&&r.test(e.prop))return n(e,t)}):this.walk((e,t)=>{if("decl"===e.type&&e.prop===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("decl"===e.type)return n(e,t)}))}walkRules(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("rule"===e.type&&r.test(e.selector))return n(e,t)}):this.walk((e,t)=>{if("rule"===e.type&&e.selector===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("rule"===e.type)return n(e,t)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}Sr.registerParse=e=>{wr=e},Sr.registerRule=e=>{br=e},Sr.registerAtRule=e=>{_r=e},Sr.registerRoot=e=>{Cr=e};i=Sr,Sr.default=Sr,Sr.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,_r.prototype):"rule"===e.type?Object.setPrototypeOf(e,br.prototype):"decl"===e.type?Object.setPrototypeOf(e,yr.prototype):"comment"===e.type?Object.setPrototypeOf(e,vr.prototype):"root"===e.type&&Object.setPrototypeOf(e,Cr.prototype),e[gr]=!0,e.nodes&&e.nodes.forEach(e=>{Sr.rebuild(e)})},ot=i;let xr,Ar;class kr extends ot{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){let t=new xr(new Ar,this,e);return t.stringify()}}kr.registerLazyResult=e=>{xr=e},kr.registerProcessor=e=>{Ar=e};e=kr;kr.default=kr;let Er={};function Lr(e){Er[e]||(Er[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))}class Or{constructor(e,t={}){for(var r in this.type="warning",this.text=e,t.node&&t.node.source&&(e=t.node.rangeBy(t),this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column),t)this[r]=t[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}St=Or;Or.default=Or;let Mr=St;class Pr{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);e=new Mr(e,t);return this.messages.push(e),e}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}}Ke=Pr;Pr.default=Pr;let Rr=i;class Tr extends Rr{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}We=Tr;Tr.default=Tr,Rr.registerAtRule(Tr);let Ir=i,Br,Nr;class jr extends Ir{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){e=super.normalize(e);if(t)if("prepend"===r)1{Br=e},jr.registerProcessor=e=>{Nr=e};n=jr;jr.default=jr,Ir.registerRoot(jr);let Dr={comma(e){return Dr.split(e,[","],!0)},space(e){return Dr.split(e,[" ","\n","\t"])},split(e,t,u){let r=[],n="",s=!1,i=0,o=!1,a="",l=!1;for(var c of e)l?l=!1:"\\"===c?l=!0:o?c===a&&(o=!1):'"'===c||"'"===c?(o=!0,a=c):"("===c?i+=1:")"===c?0"space"!==e[0]&&"comment"!==e[0])&&(s.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(s,"value",a.concat(e),t),s.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new Jr;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){var t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1;var r;let n=!1,s=null,i=[];var o=e[1].startsWith("--");let a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)s=s||l,i.push("("===r?")":"]");else if(o&&n&&"{"===r)s=s||l,i.push("}");else if(0===i.length){if(";"===r){if(n)return void this.decl(a,o);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===i[i.length-1]&&(i.pop(),0===i.length&&(s=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),0e+t[1],""),e.raws[t]={raw:o,value:l}),e[t]=l}rule(e){e.pop();let t=new Jr;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){var t;let r="";for(;e.length&&("space"===(t=e[e.length-1][0])||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){var t;let r="";for(;e.length&&("space"===(t=e[0][0])||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t="";for(;e.length&&"space"===e[e.length-1][0];)t=e.pop()[1]+t;return t}stringFrom(t,r){let n="";for(let e=r;evn(e)),e}let wn={};class bn{constructor(e,t,r){this.stringified=!1,this.processed=!1;let n;if("object"!=typeof t||null===t||"root"!==t.type&&"document"!==t.type)if(t instanceof bn||t instanceof ln)n=vn(t.root),t.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=t.map);else{let e=cn;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{n=e(t,r)}catch(e){this.processed=!0,this.error=e}n&&!n[tn]&&sn.rebuild(n)}else n=vn(t);this.result=new ln(e,n,r),this.helpers={...wn,postcss:wn,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){var r=this.result.lastPlugin;try{if(t&&t.addToError(e),"CssSyntaxError"!==(this.error=e).name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){var n=r.postcssPlugin;let e=r.postcssVersion,t=this.result.processor.version;var s=e.split("."),i=t.split(".");(s[0]!==i[0]||parseInt(s[1])>parseInt(i[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+t+", but "+n+" uses "+e+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};var e,t=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(e of this.plugins)if("object"==typeof e)for(var r in e){if(!pn[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${e.postcssPlugin}. `+`Try to update PostCSS (${this.processor.version} now).`);if(!dn[r])if("object"==typeof e[r])for(var n in e[r])"*"===n?t(e,r,e[r][n]):t(e,r+"-"+n.toLowerCase(),e[r][n]);else"function"==typeof e[r]&&t(e,r,e[r])}this.hasListener=0t(e,this.helpers)),await Promise.all(i)):await t(r,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{var e;if("object"==typeof t&&t.Once)return"document"===this.result.root.type?mn((e=this.result.root.nodes.map(e=>t.Once(e,this.helpers)))[0])?Promise.all(e):e:t.Once(this.result.root,this.helpers);if("function"==typeof t)return t(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();var e=this.result.opts;let t=nn,r=(e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify),new rn(t,this.result.root,this.result.opts));e=r.generate();return this.result.css=e[0],this.result.map=e[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(var e of this.plugins)if(mn(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[en];)e[en]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(var t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||an("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(var[r,n]of e){this.result.lastPlugin=r;let e;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(mn(e))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:s}=r;if("root"===n.type||"document"===n.type||n.parent){if(0{e[en]||this.walkSync(e)});else{var r=this.listeners[t];if(r&&this.visitSync(r,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}bn.registerPostcss=e=>{wn=e};Me=bn;bn.default=bn,un.registerLazyResult(bn),on.registerLazyResult(bn);let _n=ft,Cn=Ne,Sn=Lr,xn=Qr;const An=Ke;class kn{constructor(e,t,r){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;var e=Cn;this.result=new An(this._processor,void 0,this._opts),this.result.css=t;let n=this,s=(Object.defineProperty(this.result,"root",{get(){return n.root}}),new _n(e,void 0,this._opts,t));s.isMap()?([r,e]=s.generate(),r&&(this.result.css=r),e&&(this.result.map=e)):(s.clearAnnotation(),this.result.css=s.css)}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||Sn("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=xn;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}}ft=kn;kn.default=kn;let En=ft,Ln=Me,On=e,Mn=n;class Pn{constructor(e=[]){this.version="8.4.35",this.plugins=this.normalize(e)}normalize(e){let t=[];for(var r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return new(this.plugins.length||t.parser||t.stringifier||t.syntax?Ln:En)(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}ft=Pn;Pn.default=Pn,Mn.registerProcessor(Pn),On.registerProcessor(Pn);let Rn=He,Tn=qe,In=Ct,Bn=We,Nn=Je,jn=n,Dn=ot;function Un(e,r){if(Array.isArray(e))return e.map(e=>Un(e));let{inputs:t,...n}=e;if(t){r=[];for(var s of t){let e={...s,__proto__:Nn.prototype};e.map&&(e.map={...e.map,__proto__:Tn.prototype}),r.push(e)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>Un(e,r))),n.source){let{inputId:e,...t}=n.source;n.source=t,null!=e&&(n.source.input=r[e])}if("root"===n.type)return new jn(n);if("decl"===n.type)return new Rn(n);if("rule"===n.type)return new Dn(n);if("comment"===n.type)return new In(n);if("atrule"===n.type)return new Bn(n);throw new Error("Unknown node type: "+e.type)}qe=Un,Un.default=Un;let Fn=He,zn=Me;He=i;let $n=ft;Me=Ne,i=qe;let Gn=e;ft=St;let Hn=Ct,Vn=We;Ne=Ke,qe=Je,e=Qr,St=s;let Wn=ot,Jn=n;Ct=Te;function o(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new $n(e)}o.plugin=function(r,n){let s=!1;function i(...e){console&&console.warn&&!s&&(s=!0,console.warn(r+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(r+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let t=n(...e);return t.postcssPlugin=r,t.postcssVersion=(new $n).version,t}let e;return Object.defineProperty(i,"postcss",{get(){return e=e||i(),e}}),i.process=function(e,t,r){return o([i(r)]).process(e,t)},i},o.stringify=Me,o.parse=e,o.fromJSON=i,o.list=St,o.comment=e=>new Hn(e),o.atRule=e=>new Vn(e),o.decl=e=>new Fn(e),o.rule=e=>new Wn(e),o.root=e=>new Jn(e),o.document=e=>new Gn(e),o.CssSyntaxError=t,o.Declaration=Fn,o.Container=He,o.Processor=$n,o.Document=Gn,o.Comment=Hn,o.Warning=ft,o.AtRule=Vn,o.Result=Ne,o.Input=qe,o.Rule=Wn,o.Root=Jn,o.Node=Ct,zn.registerPostcss(o);o.default=o;class qn extends HTMLElement{base;contents;component;listType="ul";iconSet;filter={value:"",caseSensitive:!1};static get observedAttributes(){return["contents","icon-set","max-depth","filter"]}_jsonToValueArray(e){let t=JSON.stringify(e);t=t.replace(/[\[\]{}\"]/g,"");let r=[];for(const n of t.split(","))r=r.concat(n.split(":"));return[...new Set(r)]}_emit(e,t,r){e=new CustomEvent(e,{detail:r,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}constructor(){super(),this.base=new $,this.setContents(this.getAttribute("contents")),this.iconSet=this.getAttribute("icon-set")?this.getAttribute("icon-type"):"file",this.maxDepth=this.getAttribute("max-depth")?parseInt(this.getAttribute("max-depth")):-1,this.setFilter(this.getAttribute("filter")),this.style.display="block",this.style.maxWidth="fit-content",this.style.margin="0 1rem 0 0",this.base.addEvent(".flk-branch","click",this.emitNodeToggle)}emitNodeToggle(e){e.stopPropagation();const t=F(e,"flk-tree-nav").target,r=z(e,"branchKey");let n=t.contents;const s=r.split(".");for(const o of s)if(n[o])n=n[o];else if(null===n[o])n=null;else{let e=[];for(const a of n)a[o]&&e.push(a[o]);n=e}var e=r.substring(r.indexOf(".")+1),i=t.createLeafText(s.reverse()[0]);t._emit("tree-click",t,{path:e,data:n,key:(i.titleText+" "+i.commentText).trim(),branch:"object"==typeof n})}convertJsonKeyToTitle(e){if(!e)return"";const t=(e="string"!=typeof e?e.toString():e).replace(/([A-Z_])/g,e=>"_"===e?" ":" "+e).trim();return t.charAt(0).toUpperCase()+t.slice(1)}setContents(e){var t=e||this.contents||[];try{switch(typeof t){case"string":this.contents=JSON.parse(t);break;case"object":Array.isArray(t)?this.contents=t:this.contents=[t]}}catch(e){console.log(e)}}applyFilter(e){let t;var r="details"===e.tagName.toLowerCase();t=this.filter.caseSensitive?e.dataset.branchValues.includes(this.filter.value):e.dataset.branchValues.toLowerCase().includes(this.filter.value.toLowerCase()),t?e.parentElement.classList.remove("hidden"):e.parentElement.classList.add("hidden"),r&&t?e.setAttribute("open",""):e.removeAttribute("open")}resetTree(e){e.parentElement.classList.remove("hidden"),e.removeAttribute("open")}filterTree(){let t=setTimeout(()=>{for(const e of this.querySelectorAll("[data-branch-values]"))void 0===this.filter.value||0===this.filter.value.length?this.resetTree(e):this.applyFilter(e);clearTimeout(t)},10)}setFilter(e){const t=e||{};try{switch(typeof t){case"string":t.includes("{")?(this.filter=JSON.parse(t),!1===this.filter.caseSensitive&&(this.filter.value=this.filter.value.toLowerCase())):this.filter.value=e.toLowerCase();break;case"object":this.filter=t}}catch(e){console.log(e)}this.filterTree()}createLeafText(e){var t,r;let n="",s="";return"string"==typeof e&&(e.includes("(")||e.includes("["))?(r=e.indexOf("("),r=-1===(t=e.indexOf("["))?r:t,n=this.convertJsonKeyToTitle(e.substring(0,r)),s=e.substring(r)):n=this.convertJsonKeyToTitle(e),{titleText:n,commentText:s}}createTextTag(n,s){n=this.createLeafText(n);if(n.commentText){let e=document.createElement("div"),t=document.createElement("span"),r=(t.innerText=n.titleText,document.createElement("small"));r.innerText=n.commentText,r.style.marginLeft="1rem",e.append(t,r),e.style.display="inline-flex",e.style.alignItems="center",s.append(e)}else s.innerText=n.titleText}createLeaf(e,t,r,n=[]){let s=document.createElement("li");s.classList.add("cursor-no-select"),s.style.marginTop="0.4rem",s.dataset.branchKey=r;const i="file"===this.iconSet?'':'';s.style.listStyleImage=`url('data:image/svg+xml,${i}')`,s.style.position="relative",s.style.left="2px";let o=document.createElement("span");r=[e].concat(n);if(o.dataset.branchValues=[...new Set(r)].join(),n.length&&(o.dataset.leafKey=r[0]),this.createTextTag(e,o),o.style.position="relative",o.style.top="-3px",s.append(o),t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);const i="file"===this.iconSet?G:H;e.style.listStyleImage=`url('data:image/svg+xml,${i}')`,e.append(s),t.append(e)}else t.append(s)}createBranch(r,t,n,s){if(s===this.maxDepth&&"object"==typeof r)for(const o of Array.isArray(r)?r:Object.keys(r)){let e;r[o]&&(e=this._jsonToValueArray(r[o])),this.createLeaf(o,t,n+"."+o,e)}else if(Array.isArray(r))for(var e in r){var u=document.createElement(this.listType);t.append(this.createBranch(r[e],u,n+"."+e,s+1))}else if(null!==r&&"object"==typeof r){const a=[];for(const l of Object.keys(r)){let e=document.createElement("li"),t=(e.classList.add("cursor-no-select"),e.style.position="relative",e.style.left="2px",e.dataset.branchKey=n+"."+l,document.createElement("details"));t.classList.add("flk-branch"),t.dataset.branchValues=[l].concat(this._jsonToValueArray(r[l])),t.style.position="relative",t.style.top="-3px",t.classList.add("cursor-default");var i=document.createElement("summary");this.createTextTag(l,i),t.append(i),e.append(this.createBranch(r[l],t,n+"."+l,s+1)),a.push(e)}if(t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);var h="file"===this.iconSet?G:H;e.style.listStyleImage=`url('data:image/svg+xml,${h}')`;for(const c of a)e.append(c);t.append(e)}else for(const p of a)t.append(p)}else this.createLeaf(r,t,n);return t}createHtml(){let e=document.createElement(this.listType);var t="file"===this.iconSet?G:'';if(e.style.listStyleImage=`url('data:image/svg+xml,${t}')`,e.style.marginLeft="3rem",this.contents.length){for(const r in this.contents)e=this.createBranch(this.contents[r],e,r,0);this.component=e}else this.component=e}attributeChangedCallback(e,t,r){switch(e){case"contents":this.setContents(r);break;case"icon-set":this.iconSet=r;break;case"max-depth":this.maxDepth="string"==typeof r?parseInt(r):r;break;case"filter":this.setFilter(r)}this.init()}connectedCallback(){this.init()}disconnectedCallback(){this.base.removeEvents(this)}init(){this.createHtml(),this.base.render(this)}}customElements.define("flk-table",W),customElements.define("flk-draggable",J),customElements.define("flk-modal",q),customElements.define("flk-dropdown",K),customElements.define("flk-tree-nav",qn)}(require$$0,require$$2,require$$1$1,require$$1); \ No newline at end of file +!function(){"use strict";var a,c,g,e;(e=a=a||{}).Date="date",e.String="string",e.Float="float",e.Number="number",e.Array="array",e.Object="object",e.Bool="bool",e.Currency="currency",e.Undefined="undefined",e.Null="null";const l={date:/^(\d{1,4}-\d{1,4}-\d{1,4}(T)?)/gim,currency:/^[$|€]\s?[0-9]*(\.|,)?\d*(\.|,)?\d*/gim,float:/\d+[,|.]\d+[,|.]?\d*/gim,currencySign:/\$|€/gim,array:/^\s?[[].[^,]+[\]],?/gi,precision:/[-+$€,.]/gm,string:/[a-zA-Z]/gim},h=e=>{return null===e||"null"===e?a.Null:e||0===e||!1===e?null===new RegExp(l.date).exec(e)||isNaN(Date.parse(e))?new RegExp(l.currency).exec(e)?a.Currency:!new RegExp(l.string).exec(e)&&new RegExp(l.float).exec(e.toString())?a.Float:isNaN(e)&&0!==e?Array.isArray(e)?a.Array:"object"==typeof e?a.Object:a.String:a.Number:a.Date:a.Undefined},u=(t,e)=>{const s={value:void 0,type:e=e||h(t),currencySign:""};switch(s.type){case a.String:s.value=t.toString();break;case a.Float:case a.Currency:var r=(t=t.toString()).match(new RegExp(/(,)/gim)),n=t.match(new RegExp(/(\.)/gim));if(r)for(let e=1;e<=r.length;e++)t=e!==r.length||n?t.replace(",",""):t.replace(",",".");if(s.type===a.Currency){const o=new RegExp(l.currencySign);var i=o.exec(t);s.currencySign=null!==i?i[0]:"",t=t.replace(o,"")}s.value=parseFloat(t).toPrecision(12);break;case a.Number:s.value=Number(t);break;case a.Date:s.value=Date.parse(t);break;case a.Array:t.length?"object"==typeof t[0]?s.value=t.map(e=>JSON.stringify(e)).join(", "):s.value=t.join(", "):s.value="";break;case a.Object:s.value=t;break;case a.Undefined:s.value="";break;case a.Null:s.value=null}return s};function v(e,t){var s;let r;for(s of e.split("."))s=s.trim(),r?"object"!=typeof r||Array.isArray(r)||(r=r[s]):r=t[s];return r}const m=(e,t)=>tet<=e,w=(e,t)=>e<=t,k=(e,t,s)=>s?e.toLowerCase()==t.toLowerCase():e==t,E=(e,t)=>e===t,_=(e,t)=>e!=t,x=(e,t)=>e!==t,A=(e,t)=>null!=t&&"string"==typeof e&&0<=e.toLowerCase().indexOf(t.toString().toLowerCase()),L=(e,t)=>null!=t&&0<=e.toString().toLowerCase().indexOf(t.toString().toLowerCase()),T=(e,t)=>null!=t&&"string"==typeof e&&e.toLowerCase().indexOf(t.toString().toLowerCase())<0;function t(s,r){if(0===r.length)return s;{var n=s;const o=[],a=[];let e=[];for(const l of r)l.type&&l.type!==c.And?(e.length&&a.push(e),e=[l]):e.push(l);a.push(e);let t=[];for(const e of a)t=t.concat(C(n,e));t=[...new Set(t)];var i=n.length;for(let e=0;e":return m;case"<":return f;case">=":return b;case"<=":return w;case"is":case"==":return k;case"!is":case"!=":return _;case"===":return E;case"!==":return x;case"like":case"~":case"contains":return A;case"!contains":case"!like":case"!~":return T;default:return L}}(a.operator);if(!l(i,o,a.ignoreCase)){e=!1;break}}e&&s.push(r)}return s};function s(e,t){if(!t||0===t.length)return e;if(1{if(0===s.length)s=s.concat(o(n,e));else{for(const t of s)r=r.concat(o(t,e));s=r,r=[]}}),s}return o(e,t[0])}function o(e,t){const s=[],r=[];do{if(!e||0===e.length)break;var n=e.shift();if(!n)break;const o=n[t];var i=r.indexOf(o.toString());0<=i?s[i].push(n):(r.push(o.toString()),void 0!==s[r.length-1]?s[r.length-1].push(n):s.push([n]))}while(0{if(t){var s=e;const r={};for(const n of t){let e=s.map(e=>e[n].toString());const i=e.map(e=>h(e));i.some(e=>e===a.Float)?(e=e.map(e=>parseFloat(e)),r[n]=parseFloat(e.reduce((e,t)=>e+t).toFixed(2))):(e=e.map(e=>parseInt(e)),r[n]=e.reduce((e,t)=>e+t))}return r}return{}};class S{model;sortDetails=[];filterDetails=[];selection=[];groupByProperties=[];distinctProperties=[];concatenationToken=", ";constructor(e){this.model=JSON.parse(JSON.stringify(e))}sort(e){return this.sortDetails=e,this}orderBy(e,t){return this.sortDetails.push({propertyName:e,direction:t}),this}thenOrderBy(e,t){return this.orderBy(e,t)}filter(e){return Array.isArray(e)?this.filterDetails=e:this.filterDetails.push(e),this}where(e,t,s,r,n){return this.filterDetails.push({propertyName:e,operator:t,value:s,type:r,ignoreCase:n}),this}andWhere(e,t,s,r){return this.where(e,t,s,c.And,r),this}orWhere(e,t,s,r){return this.where(e,t,s,c.Or,r),this}group(e){return this.groupByProperties=e,this}groupBy(e){return this.groupByProperties.push(e),this}thenGroupBy(e){return this.groupByProperties.push(e),this}select(e){return Array.isArray(e)?this.selection=e:"*"!==e&&(this.selection=[e]),this}distinct(e,t){return t&&(this.concatenationToken=t),Array.isArray(e)?this.distinctProperties=e:e&&(this.distinctProperties=[e]),this}execute(){return s(function(t,s){if(0===s.length)return t;{var r=s;let e=[];for(const n of t){const i={};for(const o of r)i[o]=n[o];e.push(i)}return e}}(function(s,r,d){if(!r||!r.length)return s;const n=[],h=[];for(const m of s){const o={};let t="";for(const e of r){var u=v(e,m);o[e]=u,t+=u}if(!h.includes(t)){let e=s;for(const a of Object.keys(o))e=e.filter(e=>e[a]===o[a]);h.push(t),n.push(e)}}const t=[];for(const f of n){let e={};for(const l of f){var i,p=Object.keys(e);if(p.length)for(const c of p)r.includes(c)||(i=e[c],Array.isArray(i)?(i=l[c],Array.isArray(i)?e[c]=[...new Set(...e[c].concat(l[c]))]:e[c].includes(l[c])||e[c].push(l[c])):isNaN(e[c])&&isNaN(l[c])?e[c]!==l[c]&&(e[c]=[e[c],l[c]]):e[c]=e[c]+l[c]);else e=l}t.push(e)}return t.forEach(e=>{for(const t in e)Array.isArray(e[t])&&(e[t]=e[t].join(d))}),t}(r(t(JSON.parse(JSON.stringify(this.model)),this.filterDetails),this.sortDetails),this.distinctProperties,this.concatenationToken),this.selection),this.groupByProperties)}sum(e,t){e=Array.isArray(e)?e:[e];return i(t||this.model,e)}}function I(e,t){t=t?t.toUpperCase():"FLK-";return e.toUpperCase().includes(t)}function d(e,t){var{timeStamp:s,type:r,x:n,y:i}=e;let o=e.target;do{if(!o||"HTML"===o.tagName||I(o.tagName,t)){"HTML"===o.tagName&&(o=null);break}}while(o=o.parentNode||o.parentElement,!I(o.tagName,t));return{target:o,timeStamp:s,type:r,x:n,y:i}}function B(e,t){let s=e.target,r="";for(;s.dataset[t]?r=s.dataset[t]:s=s.parentNode,!r;);return r}class n{constructor(){}_topLevelClasses=[];_events=[];generateId(){return"flk-"+function e(){const t=([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)),s=t.split("-")[0];return window.$flightkitUUIDStore||(window.$flightkitUUIDStore=[]),window.$flightkitUUIDStore.some(e=>e===s)?e():(window.$flightkitUUIDStore.push(s),s)}()}render(t){if(!t.component)throw new Error("Component is not assigned! Can't render");t.id=t.id||this.generateId();var e=this._getAllEventAttributes(t);if(e){var s="#"+t.id;for(const i of e){var r="e-"+i;this.addEvent(s,i,t.getAttribute(r))}}var n=Object.keys(t.classList).length;if(n){for(let e=0;e{this._assignToDom(t,t.component),clearTimeout(this._renderTimer)},10)}addEvent(e,t,s){this._events.push({selector:e,eventType:t,callback:s})}_getExternalCallback(e){let t=void 0;for(const s of e.split("."))t=(t||window)[s];return t}_getAllEventAttributes(e){e=e.attributes;const t=Array.from(e).filter(e=>e.name.startsWith("e-"));return t.map(e=>e.name.slice(2))}_isFlightkitElement(e){return e.toUpperCase().includes("FLK-")}_outerEventHandler(e){const t=d(e),s=(t.contents=e.detail,t.target.getAttribute("e-"+t.type));let r=void 0;for(const n of s.split("."))r=(r||window)[n];return e.preventDefault(),e.stopPropagation(),r(t)}_addEvents(e){if(e.isConnected)for(const s of this._events)if(s.selector.startsWith("."))for(const r of document.querySelectorAll(s.selector))this._addEventToElement(s,r);else{var t=document.querySelector(s.selector);this._addEventToElement(s,t)}}_addEventToElement(e,t){t&&("function"==typeof e.callback?(t.removeEventListener(e.eventType,e.callback),t.addEventListener(e.eventType,e.callback)):(t.removeEventListener(e.eventType,this._outerEventHandler),t.addEventListener(e.eventType,this._outerEventHandler)))}removeEvents(){for(const t of this._events)if(t.selector.startsWith("."))for(const s of document.querySelectorAll(t.selector))this._addEventToElement(t,s);else{var e=document.querySelector(t.selector);this._addEventToElement(t,e)}this._events=[]}_removeEventToElement(e,t){t&&("function"==typeof e.callback?t.removeEventListener(e.eventType,e.callback):t.removeEventListener(e.eventType,this._outerEventHandler))}_assignToDom(e,t){e.innerHTML="";for(const r of Array.isArray(t)?t:[t])e.append(r);const s=setTimeout(()=>{this._addEvents(e),clearTimeout(s)},10)}}const p='',N='';function D(e){const t=new DOMParser;return t.parseFromString(e,"image/svg+xml").documentElement}class O extends HTMLElement{base;component=null;_contents=[];_orderBy=[];properties=new Set;_columnOrder=[];_filter="";_selectionProperty="";_selectedIds=new Set;uniqueEntriesByProperties={};propertyLabelDictionary={};_templates={};_templateClasses={};static get observedAttributes(){return["contents","columns","order","filter","selection-property","templates"]}get columnOrder(){return this._columnOrder.length?this._columnOrder:this.properties}set columnOrder(e){let t;"string"==typeof e&&(t=e.split(",")),t=e,this._columnOrder=t}get contents(){return this._contents}set contents(e){this.analyzeData(e),this._contents=new S(e)}get orderBy(){return this._orderBy}set orderBy(e){if(Array.isArray(e))this._orderBy=e;else{const r=[];for(const n of e.split(",")){var t=n.split("|"),s=t[0],t=1e[s._selectionProperty])):new Set;e=t?s.contents.execute():[];s._emit("select",s,{selection:e}),s._updateCheckboxes(s)}emitSelect(e){var t=e.target.checked,s=e.target.dataset.objectId;const r=d(e).target,n=(t?r._selectedIds.add(s):r._selectedIds.delete(s),r._selectionProperty);e=r.contents.execute().filter(e=>r._selectedIds.has(e[n]));r._emit("select",r,{selection:e}),r._updateCheckboxes(r)}sortData(e){const t=d(e).target,s=B(e,"column");s&&(-1<(e=t._orderBy.findIndex(e=>e.propertyName===s))?"asc"===t._orderBy[e].direction?t._orderBy[e].direction="desc":t._orderBy.splice(e,1):t._orderBy.push({propertyName:s,direction:"asc"}),t.createHtml(),t.base.render(t))}setColumnOrder(e){this._columnOrder=e?Array.isArray(e)?e:e.split(","):[]}analyzeData(t){this.properties=new Set;var s=t.length;for(let e=0;e"_"===e?" ":" "+e.toLowerCase()).trim();var s=t.charAt(0).toUpperCase()+t.slice(1);return this.propertyLabelDictionary[e]=s}parseTemplate(e,r){return e.replace(/\{\{([\s\S]+?)\}\}/gim,(e,t)=>{let s="";t=t.trim();t=r[t];return t&&(s=t),Array.isArray(s)?s.join(", "):s.toString().trim()})}createSelectionCheckbox(e){const t=document.createElement("input");return t.setAttribute("type","checkbox"),t.classList.add("flk-selection-checkbox"),e&&(t.dataset.selected=e[this._selectionProperty]),t}createRow(e){const t=document.createElement("tr");if(this._selectionProperty.length){const n=document.createElement("td");var s=this.base.generateId();const i=this.createSelectionCheckbox(e);i.id=s,i.dataset.objectId=e[this._selectionProperty];var r=e[this._selectionProperty];this._selectedIds.has(r)?i.checked=!0:i.checked=!1,this.base.addEvent("#"+s,"change",this.emitSelect),n.append(i),t.append(n)}for(const o of this.columnOrder){const a=document.createElement("td");this._templates[o]?(a.innerHTML=this.parseTemplate(this._templates[o],e),this._templateClasses[o]&&a.classList.add(...this._templateClasses[o])):a.innerText=e[o],t.append(a)}return t}createBody(e){const t=document.createElement("tbody");for(const r of e){var s=this.createRow(r,null);t.append(s)}return t}createHead(){const e=document.createElement("thead"),t=document.createElement("tr");if(t.classList.add("cursor-pointer"),this._selectionProperty.length){const n=document.createElement("th");var s=this.base.generateId();const i=this.createSelectionCheckbox();i.id=s;var d=this.contents.execute().length;0e.propertyName===o);if(r){const c=document.createElement("span");c.innerHTML="asc"===r.direction?'':'',a.append(c)}t.append(a)}return e.append(t),e}addEvent(e,t,s){this.base.addEvent(e,t,s)}init(){this.createHtml(),this.base.render(this)}}class j extends HTMLElement{base;componentId;constructor(){super(),this.base=new n}connectedCallback(){var e=this.getAttribute("top"),t=this.getAttribute("left"),s=this.getAttribute("center"),r=this.getAttribute("zIndex");this.id||(this.id=this.base.generateId()),this.style.display="block",this.style.position="fixed","string"==typeof s?(this.style.top=e||"50%",this.style.left="50%",this.style.transform="translate(-50%, -50%)"):(this.style.top=e||this.clientTop+"px",this.style.left=t||this.clientLeft+"px"),r&&(this.style.zIndex=r),this.componentId=this.getAttribute("handle");const n=document.createElement("div");n.innerHTML=this.innerHTML,this.component=n;s="#"+(this.componentId||this.id);this.base.addEvent(s,"mousedown",this._dragElement),this.base.addEvent(s,"mouseup",this._reset),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this)}_dragElement(e){const s=d(e,"flk-draggable").target;let r,n;function t(e){r=e.clientX-s.offsetLeft,n=e.clientY-s.offsetTop}function i(e){var t=e.clientX-r,e=e.clientY-n;s.style.left=t+"px",s.style.top=e+"px"}function o(e){e.preventDefault()}function a(){s.removeAttribute("draggable"),s.removeEventListener("dragstart",t),s.removeEventListener("dragend",a),document.removeEventListener("dragover",o),document.removeEventListener("drop",i)}s.setAttribute("draggable",!0),s.addEventListener("dragstart",t),s.addEventListener("dragend",a),document.addEventListener("dragover",o),document.addEventListener("drop",i)}}class M extends HTMLElement{_id;base;_draggableId;constructor(){super(),this.base=new n}_emit(e,t,s){e=new CustomEvent(e,{detail:s,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}_closeModal(e){e.stopPropagation();const t=d(e,"flk-modal").target;t.classList.add("hidden")}closeModal(e){this.classList.add("hidden")}openModal(e=!0){const t=document.getElementById(this._draggableId);e&&(t.style.top="40%",t.style.left="50%"),this.classList.remove("hidden")}connectedCallback(){this.id||(this.id=this.base.generateId());const e=document.createElement("div");var t=this.base.generateId();const s=document.createElement("flk-draggable"),r=(this._draggableId=this.base.generateId(),s.id=this._draggableId,s.setAttribute("center",""),s.setAttribute("top","40%"),s.setAttribute("handle",t),s.setAttribute("zIndex","1080"),s.classList.add("border","shadow-lg","bg-white"),s.style.width="max-content",document.createElement("div"));var n=this.getAttribute("modal-title");if(n){const c=document.createElement("span");c.innerText=n,c.classList.add("ml-1","mr-auto"),r.append(c)}r.id=t;const i=this.getAttribute("header-class");let o=[];i?o=o.concat(i.split(" ")):o.push("bg-gray-light"),r.classList.add(...o,"border-bottom","row","justify-end","cursor-no-select");n=this.base.generateId();const a=document.createElement("button"),l=(a.classList.add("py-0","px-1","outline-hover","no-border","cursor-default",...o),a.innerText="X",a.id=n,r.append(a),s.append(r),document.createElement("div"));l.innerHTML=this.innerHTML,s.append(l),e.append(s),this.component=e,this.base.addEvent("#"+n,"click",this._closeModal),this.base.render(this),this.classList.add("hidden")}disconnectedCallback(){this.base.removeEvents(this)}}class H extends HTMLElement{base;_buttonId;_drawerId;_iconId;constructor(){super(),this.base=new n}connectedCallback(){this.style.position="relative",this.style.display="flex",this.style.width="fit-content",this._buttonId=this.base.generateId();const e=document.createElement("button"),t=(e.classList.add("row"),e.id=this._buttonId,document.createElement("span")),s=(t.innerText=this.getAttribute("text"),this._iconId=this.base.generateId(),document.createElement("span"));var r=D('');const n=D(''),i=(n.classList.add("hidden"),s.append(r,n),s.id=this._iconId,e.append(t,s),this._drawerId=this.base.generateId(),document.createElement("div"));i.id=this._drawerId,i.classList.add("shadow","inline-block","bg-white"),i.style.position="absolute",i.style.zIndex="1040";r=this.querySelector("template");r.innerHTML.length?i.innerHTML=r.innerHTML:i.append(r.firstChild),i.style.display="none",this.component=[e,i],this.base.addEvent("#"+this._buttonId,"click",this.toggleMenu);const o=document.querySelector("body");""!==o.getAttribute("flk-close-dropdown")&&(o.setAttribute("flk-close-dropdown",""),o.addEventListener("click",this.closeAllDropdownButtons)),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this);var e=document.querySelectorAll("flk-dropdown");if(!e||!e.length){const t=document.querySelector("body");t.removeAttribute("flk-close-dropdown"),t.removeEventListener("click",this.closeAllDropdownButtons)}}toggleMenu(e){const t=d(e).target;e=t._drawerId;const s=document.getElementById(e);var e="none"!==s.style.display,r=(s.style.display=e?"none":"block",t.getAttribute("drawer-width")),r=("string"==typeof t.getAttribute("right")&&(s.style.right="0px"),s.style.top=t.offsetHeight+"px",s.style.width=r||t.offsetWidth+"px",t._iconId);const n=document.getElementById(r);e?(n.childNodes[0].classList.remove("hidden"),n.childNodes[1].classList.add("hidden")):(n.childNodes[0].classList.add("hidden"),n.childNodes[1].classList.remove("hidden"))}_closeDropdown(){var e=this._drawerId;const t=document.getElementById(e);if("none"!==t.style.display){e=this._iconId;const s=document.getElementById(e);t.style.display="none",s.childNodes[0].classList.remove("hidden"),s.childNodes[1].classList.add("hidden")}}closeAllDropdownButtons(e){var t,s=d(e,"flk-dropdown").target,e=document.querySelectorAll("flk-dropdown");if(s)for(const r of e)s._buttonId!==r._buttonId&&(t=r._drawerId,"none"!==document.getElementById(t).style.display&&r._closeDropdown());else for(const n of e)n._closeDropdown()}}class P extends HTMLElement{base;contents;component;listType="ul";iconSet;filter={value:"",caseSensitive:!1};static get observedAttributes(){return["contents","icon-set","max-depth","filter"]}_jsonToValueArray(e){let t=JSON.stringify(e);t=t.replace(/[\[\]{}\"]/g,"");let s=[];for(const r of t.split(","))s=s.concat(r.split(":"));return[...new Set(s)]}_emit(e,t,s){e=new CustomEvent(e,{detail:s,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}constructor(){super(),this.base=new n,this.setContents(this.getAttribute("contents")),this.iconSet=this.getAttribute("icon-set")?this.getAttribute("icon-type"):"file",this.maxDepth=this.getAttribute("max-depth")?parseInt(this.getAttribute("max-depth")):-1,this.setFilter(this.getAttribute("filter")),this.style.display="block",this.style.maxWidth="fit-content",this.style.margin="0 1rem 0 0",this.base.addEvent(".flk-branch","click",this.emitNodeToggle)}emitNodeToggle(e){e.stopPropagation();const t=d(e,"flk-tree-nav").target,s=B(e,"branchKey");let r=t.contents;const n=s.split(".");for(const o of n)if(r[o])r=r[o];else if(null===r[o])r=null;else{let e=[];for(const a of r)a[o]&&e.push(a[o]);r=e}var e=s.substring(s.indexOf(".")+1),i=t.createLeafText(n.reverse()[0]);t._emit("tree-click",t,{path:e,data:r,key:(i.titleText+" "+i.commentText).trim(),branch:"object"==typeof r})}convertJsonKeyToTitle(e){if(!e)return"";const t=(e="string"!=typeof e?e.toString():e).replace(/([A-Z_])/g,e=>"_"===e?" ":" "+e).trim();return t.charAt(0).toUpperCase()+t.slice(1)}setContents(e){var t=e||this.contents||[];try{switch(typeof t){case"string":this.contents=JSON.parse(t);break;case"object":Array.isArray(t)?this.contents=t:this.contents=[t]}}catch(e){console.log(e)}}applyFilter(e){let t;var s="details"===e.tagName.toLowerCase();t=this.filter.caseSensitive?e.dataset.branchValues.includes(this.filter.value):e.dataset.branchValues.toLowerCase().includes(this.filter.value.toLowerCase()),t?e.parentElement.classList.remove("hidden"):e.parentElement.classList.add("hidden"),s&&t?e.setAttribute("open",""):e.removeAttribute("open")}resetTree(e){e.parentElement.classList.remove("hidden"),e.removeAttribute("open")}filterTree(){let t=setTimeout(()=>{for(const e of this.querySelectorAll("[data-branch-values]"))void 0===this.filter.value||0===this.filter.value.length?this.resetTree(e):this.applyFilter(e);clearTimeout(t)},10)}setFilter(e){const t=e||{};try{switch(typeof t){case"string":t.includes("{")?(this.filter=JSON.parse(t),!1===this.filter.caseSensitive&&(this.filter.value=this.filter.value.toLowerCase())):this.filter.value=e.toLowerCase();break;case"object":this.filter=t}}catch(e){console.log(e)}this.filterTree()}createLeafText(e){var t,s;let r="",n="";return"string"==typeof e&&(e.includes("(")||e.includes("["))?(s=e.indexOf("("),s=-1===(t=e.indexOf("["))?s:t,r=this.convertJsonKeyToTitle(e.substring(0,s)),n=e.substring(s)):r=this.convertJsonKeyToTitle(e),{titleText:r,commentText:n}}createTextTag(r,n){r=this.createLeafText(r);if(r.commentText){let e=document.createElement("div"),t=document.createElement("span"),s=(t.innerText=r.titleText,document.createElement("small"));s.innerText=r.commentText,s.style.marginLeft="1rem",e.append(t,s),e.style.display="inline-flex",e.style.alignItems="center",n.append(e)}else n.innerText=r.titleText}createLeaf(e,t,s,r=[]){let n=document.createElement("li");n.classList.add("cursor-no-select"),n.style.marginTop="0.4rem",n.dataset.branchKey=s;const i="file"===this.iconSet?'':'';n.style.listStyleImage=`url('data:image/svg+xml,${i}')`,n.style.position="relative",n.style.left="2px";let o=document.createElement("span");s=[e].concat(r);if(o.dataset.branchValues=[...new Set(s)].join(),r.length&&(o.dataset.leafKey=s[0]),this.createTextTag(e,o),o.style.position="relative",o.style.top="-3px",n.append(o),t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);const i="file"===this.iconSet?p:N;e.style.listStyleImage=`url('data:image/svg+xml,${i}')`,e.append(n),t.append(e)}else t.append(n)}createBranch(s,t,r,n){if(n===this.maxDepth&&"object"==typeof s)for(const o of Array.isArray(s)?s:Object.keys(s)){let e;s[o]&&(e=this._jsonToValueArray(s[o])),this.createLeaf(o,t,r+"."+o,e)}else if(Array.isArray(s))for(var e in s){var d=document.createElement(this.listType);t.append(this.createBranch(s[e],d,r+"."+e,n+1))}else if(null!==s&&"object"==typeof s){const a=[];for(const l of Object.keys(s)){let e=document.createElement("li"),t=(e.classList.add("cursor-no-select"),e.style.position="relative",e.style.left="2px",e.dataset.branchKey=r+"."+l,document.createElement("details"));t.classList.add("flk-branch"),t.dataset.branchValues=[l].concat(this._jsonToValueArray(s[l])),t.style.position="relative",t.style.top="-3px",t.classList.add("cursor-default");var i=document.createElement("summary");this.createTextTag(l,i),t.append(i),e.append(this.createBranch(s[l],t,r+"."+l,n+1)),a.push(e)}if(t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);var h="file"===this.iconSet?p:N;e.style.listStyleImage=`url('data:image/svg+xml,${h}')`;for(const c of a)e.append(c);t.append(e)}else for(const u of a)t.append(u)}else this.createLeaf(s,t,r);return t}createHtml(){let e=document.createElement(this.listType);var t="file"===this.iconSet?p:'';if(e.style.listStyleImage=`url('data:image/svg+xml,${t}')`,e.style.marginLeft="3rem",this.contents.length){for(const s in this.contents)e=this.createBranch(this.contents[s],e,s,0);this.component=e}else this.component=e}attributeChangedCallback(e,t,s){switch(e){case"contents":this.setContents(s);break;case"icon-set":this.iconSet=s;break;case"max-depth":this.maxDepth="string"==typeof s?parseInt(s):s;break;case"filter":this.setFilter(s)}this.init()}connectedCallback(){this.init()}disconnectedCallback(){this.base.removeEvents(this)}init(){this.createHtml(),this.base.render(this)}}customElements.define("flk-table",O),customElements.define("flk-draggable",j),customElements.define("flk-modal",M),customElements.define("flk-dropdown",H),customElements.define("flk-tree-nav",P)}(); \ No newline at end of file diff --git a/docs/cdn/ibiss-v0.0.4/flightkit.min.js b/docs/cdn/ibiss-v0.0.4/flightkit.min.js index 9a82b7a..930836a 100644 --- a/docs/cdn/ibiss-v0.0.4/flightkit.min.js +++ b/docs/cdn/ibiss-v0.0.4/flightkit.min.js @@ -1 +1 @@ -!function(e,n,s,i){"use strict";function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a,u,g,e=c(e),n=c(n),s=c(s),i=c(i);(t=a=a||{}).Date="date",t.String="string",t.Float="float",t.Number="number",t.Array="array",t.Object="object",t.Bool="bool",t.Currency="currency",t.Undefined="undefined",t.Null="null";const h={date:/^(\d{1,4}-\d{1,4}-\d{1,4}(T)?)/gim,currency:/^[$|€]\s?[0-9]*(\.|,)?\d*(\.|,)?\d*/gim,float:/\d+[,|.]\d+[,|.]?\d*/gim,currencySign:/\$|€/gim,array:/^\s?[[].[^,]+[\]],?/gi,precision:/[-+$€,.]/gm,string:/[a-zA-Z]/gim},m=e=>{return null===e||"null"===e?a.Null:e||0===e||!1===e?null===new RegExp(h.date).exec(e)||isNaN(Date.parse(e))?new RegExp(h.currency).exec(e)?a.Currency:!new RegExp(h.string).exec(e)&&new RegExp(h.float).exec(e.toString())?a.Float:isNaN(e)&&0!==e?Array.isArray(e)?a.Array:"object"==typeof e?a.Object:a.String:a.Number:a.Date:a.Undefined},y=(t,e)=>{const r={value:void 0,type:e=e||m(t),currencySign:""};switch(r.type){case a.String:r.value=t.toString();break;case a.Float:case a.Currency:var n=(t=t.toString()).match(new RegExp(/(,)/gim)),s=t.match(new RegExp(/(\.)/gim));if(n)for(let e=1;e<=n.length;e++)t=e!==n.length||s?t.replace(",",""):t.replace(",",".");if(r.type===a.Currency){const o=new RegExp(h.currencySign);var i=o.exec(t);r.currencySign=null!==i?i[0]:"",t=t.replace(o,"")}r.value=parseFloat(t).toPrecision(12);break;case a.Number:r.value=Number(t);break;case a.Date:r.value=Date.parse(t);break;case a.Array:t.length?"object"==typeof t[0]?r.value=t.map(e=>JSON.stringify(e)).join(", "):r.value=t.join(", "):r.value="";break;case a.Object:r.value=t;break;case a.Undefined:r.value="";break;case a.Null:r.value=null}return r};function v(e,t){var r;let n;for(r of e.split("."))r=r.trim(),n?"object"!=typeof n||Array.isArray(n)||(n=n[r]):n=t[r];return n}const b=(e,t)=>tet<=e,S=(e,t)=>e<=t,x=(e,t,r)=>r?e.toLowerCase()==t.toLowerCase():e==t,A=(e,t)=>e===t,k=(e,t)=>e!=t,E=(e,t)=>e!==t,L=(e,t)=>null!=t&&"string"==typeof e&&0<=e.toLowerCase().indexOf(t.toString().toLowerCase()),O=(e,t)=>null!=t&&0<=e.toString().toLowerCase().indexOf(t.toString().toLowerCase()),M=(e,t)=>null!=t&&"string"==typeof e&&e.toLowerCase().indexOf(t.toString().toLowerCase())<0;function P(r,n){if(0===n.length)return r;{var s=r;const o=[],a=[];let e=[];for(const l of n)l.type&&l.type!==u.And?(e.length&&a.push(e),e=[l]):e.push(l);a.push(e);let t=[];for(const e of a)t=t.concat(R(s,e));t=[...new Set(t)];var i=s.length;for(let e=0;e":return b;case"<":return _;case">=":return C;case"<=":return S;case"is":case"==":return x;case"!is":case"!=":return k;case"===":return A;case"!==":return E;case"like":case"~":case"contains":return L;case"!contains":case"!like":case"!~":return M;default:return O}}(a.operator);if(!l(i,o,a.ignoreCase)){e=!1;break}}e&&r.push(n)}return r};function T(e,t){if(!t||0===t.length)return e;if(1{if(0===r.length)r=r.concat(I(s,e));else{for(const t of r)n=n.concat(I(t,e));r=n,n=[]}}),r}return I(e,t[0])}function I(e,t){const r=[],n=[];do{if(!e||0===e.length)break;var s=e.shift();if(!s)break;const o=s[t];var i=n.indexOf(o.toString());0<=i?r[i].push(s):(n.push(o.toString()),void 0!==r[n.length-1]?r[n.length-1].push(s):r.push([s]))}while(0{if(t){var r=e;const n={};for(const s of t){let e=r.map(e=>e[s].toString());const i=e.map(e=>m(e));i.some(e=>e===a.Float)?(e=e.map(e=>parseFloat(e)),n[s]=parseFloat(e.reduce((e,t)=>e+t).toFixed(2))):(e=e.map(e=>parseInt(e)),n[s]=e.reduce((e,t)=>e+t))}return n}return{}};class D{model;sortDetails=[];filterDetails=[];selection=[];groupByProperties=[];distinctProperties=[];concatenationToken=", ";constructor(e){this.model=JSON.parse(JSON.stringify(e))}sort(e){return this.sortDetails=e,this}orderBy(e,t){return this.sortDetails.push({propertyName:e,direction:t}),this}thenOrderBy(e,t){return this.orderBy(e,t)}filter(e){return Array.isArray(e)?this.filterDetails=e:this.filterDetails.push(e),this}where(e,t,r,n,s){return this.filterDetails.push({propertyName:e,operator:t,value:r,type:n,ignoreCase:s}),this}andWhere(e,t,r,n){return this.where(e,t,r,u.And,n),this}orWhere(e,t,r,n){return this.where(e,t,r,u.Or,n),this}group(e){return this.groupByProperties=e,this}groupBy(e){return this.groupByProperties.push(e),this}thenGroupBy(e){return this.groupByProperties.push(e),this}select(e){return Array.isArray(e)?this.selection=e:"*"!==e&&(this.selection=[e]),this}distinct(e,t){return t&&(this.concatenationToken=t),Array.isArray(e)?this.distinctProperties=e:e&&(this.distinctProperties=[e]),this}execute(){return T(function(t,r){if(0===r.length)return t;{var n=r;let e=[];for(const s of t){const i={};for(const o of n)i[o]=s[o];e.push(i)}return e}}(function(r,n,u){if(!n||!n.length)return r;const s=[],h=[];for(const f of r){const o={};let t="";for(const e of n){var p=v(e,f);o[e]=p,t+=p}if(!h.includes(t)){let e=r;for(const a of Object.keys(o))e=e.filter(e=>e[a]===o[a]);h.push(t),s.push(e)}}const t=[];for(const m of s){let e={};for(const l of m){var i,d=Object.keys(e);if(d.length)for(const c of d)n.includes(c)||(i=e[c],Array.isArray(i)?(i=l[c],Array.isArray(i)?e[c]=[...new Set(...e[c].concat(l[c]))]:e[c].includes(l[c])||e[c].push(l[c])):isNaN(e[c])&&isNaN(l[c])?e[c]!==l[c]&&(e[c]=[e[c],l[c]]):e[c]=e[c]+l[c]);else e=l}t.push(e)}return t.forEach(e=>{for(const t in e)Array.isArray(e[t])&&(e[t]=e[t].join(u))}),t}(B(P(JSON.parse(JSON.stringify(this.model)),this.filterDetails),this.sortDetails),this.distinctProperties,this.concatenationToken),this.selection),this.groupByProperties)}sum(e,t){e=Array.isArray(e)?e:[e];return j(t||this.model,e)}}function U(e,t){t=t?t.toUpperCase():"FLK-";return e.toUpperCase().includes(t)}function F(e,t){var{timeStamp:r,type:n,x:s,y:i}=e;let o=e.target;do{if(!o||"HTML"===o.tagName||U(o.tagName,t)){"HTML"===o.tagName&&(o=null);break}}while(o=o.parentNode||o.parentElement,!U(o.tagName,t));return{target:o,timeStamp:r,type:n,x:s,y:i}}function z(e,t){let r=e.target,n="";for(;r.dataset[t]?n=r.dataset[t]:r=r.parentNode,!n;);return n}class ${constructor(){}_topLevelClasses=[];_events=[];generateId(){return"flk-"+function e(){const t=([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)),r=t.split("-")[0];return window.$flightkitUUIDStore||(window.$flightkitUUIDStore=[]),window.$flightkitUUIDStore.some(e=>e===r)?e():(window.$flightkitUUIDStore.push(r),r)}()}render(t){if(!t.component)throw new Error("Component is not assigned! Can't render");t.id=t.id||this.generateId();var e=this._getAllEventAttributes(t);if(e){var r="#"+t.id;for(const i of e){var n="e-"+i;this.addEvent(r,i,t.getAttribute(n))}}var s=Object.keys(t.classList).length;if(s){for(let e=0;e{this._assignToDom(t,t.component),clearTimeout(this._renderTimer)},10)}addEvent(e,t,r){this._events.push({selector:e,eventType:t,callback:r})}_getExternalCallback(e){let t=void 0;for(const r of e.split("."))t=(t||window)[r];return t}_getAllEventAttributes(e){e=e.attributes;const t=Array.from(e).filter(e=>e.name.startsWith("e-"));return t.map(e=>e.name.slice(2))}_isFlightkitElement(e){return e.toUpperCase().includes("FLK-")}_outerEventHandler(e){const t=F(e),r=(t.contents=e.detail,t.target.getAttribute("e-"+t.type));let n=void 0;for(const s of r.split("."))n=(n||window)[s];return e.preventDefault(),e.stopPropagation(),n(t)}_addEvents(e){if(e.isConnected)for(const r of this._events)if(r.selector.startsWith("."))for(const n of document.querySelectorAll(r.selector))this._addEventToElement(r,n);else{var t=document.querySelector(r.selector);this._addEventToElement(r,t)}}_addEventToElement(e,t){t&&("function"==typeof e.callback?(t.removeEventListener(e.eventType,e.callback),t.addEventListener(e.eventType,e.callback)):(t.removeEventListener(e.eventType,this._outerEventHandler),t.addEventListener(e.eventType,this._outerEventHandler)))}removeEvents(){for(const t of this._events)if(t.selector.startsWith("."))for(const r of document.querySelectorAll(t.selector))this._addEventToElement(t,r);else{var e=document.querySelector(t.selector);this._addEventToElement(t,e)}this._events=[]}_removeEventToElement(e,t){t&&("function"==typeof e.callback?t.removeEventListener(e.eventType,e.callback):t.removeEventListener(e.eventType,this._outerEventHandler))}_assignToDom(e,t){e.innerHTML="";for(const n of Array.isArray(t)?t:[t])e.append(n);const r=setTimeout(()=>{this._addEvents(e),clearTimeout(r)},10)}}const G='',H='';function V(e){const t=new DOMParser;return t.parseFromString(e,"image/svg+xml").documentElement}class W extends HTMLElement{base;component=null;_contents=[];_orderBy=[];properties=new Set;_columnOrder=[];_filter="";_selectionProperty="";_selectedIds=new Set;uniqueEntriesByProperties={};propertyLabelDictionary={};_templates={};_templateClasses={};static get observedAttributes(){return["contents","columns","order","filter","selection-property","templates"]}get columnOrder(){return this._columnOrder.length?this._columnOrder:this.properties}set columnOrder(e){let t;"string"==typeof e&&(t=e.split(",")),t=e,this._columnOrder=t}get contents(){return this._contents}set contents(e){this.analyzeData(e),this._contents=new D(e)}get orderBy(){return this._orderBy}set orderBy(e){if(Array.isArray(e))this._orderBy=e;else{const n=[];for(const s of e.split(",")){var t=s.split("|"),r=t[0],t=1e[r._selectionProperty])):new Set;e=t?r.contents.execute():[];r._emit("select",r,{selection:e}),r._updateCheckboxes(r)}emitSelect(e){var t=e.target.checked,r=e.target.dataset.objectId;const n=F(e).target,s=(t?n._selectedIds.add(r):n._selectedIds.delete(r),n._selectionProperty);e=n.contents.execute().filter(e=>n._selectedIds.has(e[s]));n._emit("select",n,{selection:e}),n._updateCheckboxes(n)}sortData(e){const t=F(e).target,r=z(e,"column");r&&(-1<(e=t._orderBy.findIndex(e=>e.propertyName===r))?"asc"===t._orderBy[e].direction?t._orderBy[e].direction="desc":t._orderBy.splice(e,1):t._orderBy.push({propertyName:r,direction:"asc"}),t.createHtml(),t.base.render(t))}setColumnOrder(e){this._columnOrder=e?Array.isArray(e)?e:e.split(","):[]}analyzeData(t){this.properties=new Set;var r=t.length;for(let e=0;e"_"===e?" ":" "+e.toLowerCase()).trim();var r=t.charAt(0).toUpperCase()+t.slice(1);return this.propertyLabelDictionary[e]=r}parseTemplate(e,n){return e.replace(/\{\{([\s\S]+?)\}\}/gim,(e,t)=>{let r="";t=t.trim();t=n[t];return t&&(r=t),Array.isArray(r)?r.join(", "):r.toString().trim()})}createSelectionCheckbox(e){const t=document.createElement("input");return t.setAttribute("type","checkbox"),t.classList.add("flk-selection-checkbox"),e&&(t.dataset.selected=e[this._selectionProperty]),t}createRow(e){const t=document.createElement("tr");if(this._selectionProperty.length){const s=document.createElement("td");var r=this.base.generateId();const i=this.createSelectionCheckbox(e);i.id=r,i.dataset.objectId=e[this._selectionProperty];var n=e[this._selectionProperty];this._selectedIds.has(n)?i.checked=!0:i.checked=!1,this.base.addEvent("#"+r,"change",this.emitSelect),s.append(i),t.append(s)}for(const o of this.columnOrder){const a=document.createElement("td");this._templates[o]?(a.innerHTML=this.parseTemplate(this._templates[o],e),this._templateClasses[o]&&a.classList.add(...this._templateClasses[o])):a.innerText=e[o],t.append(a)}return t}createBody(e){const t=document.createElement("tbody");for(const n of e){var r=this.createRow(n,null);t.append(r)}return t}createHead(){const e=document.createElement("thead"),t=document.createElement("tr");if(t.classList.add("cursor-pointer"),this._selectionProperty.length){const s=document.createElement("th");var r=this.base.generateId();const i=this.createSelectionCheckbox();i.id=r;var u=this.contents.execute().length;0e.propertyName===o);if(n){const c=document.createElement("span");c.innerHTML="asc"===n.direction?'':'',a.append(c)}t.append(a)}return e.append(t),e}addEvent(e,t,r){this.base.addEvent(e,t,r)}init(){this.createHtml(),this.base.render(this)}}class J extends HTMLElement{base;componentId;constructor(){super(),this.base=new $}connectedCallback(){var e=this.getAttribute("top"),t=this.getAttribute("left"),r=this.getAttribute("center"),n=this.getAttribute("zIndex");this.id||(this.id=this.base.generateId()),this.style.display="block",this.style.position="fixed","string"==typeof r?(this.style.top=e||"50%",this.style.left="50%",this.style.transform="translate(-50%, -50%)"):(this.style.top=e||this.clientTop+"px",this.style.left=t||this.clientLeft+"px"),n&&(this.style.zIndex=n),this.componentId=this.getAttribute("handle");const s=document.createElement("div");s.innerHTML=this.innerHTML,this.component=s;r="#"+(this.componentId||this.id);this.base.addEvent(r,"mousedown",this._dragElement),this.base.addEvent(r,"mouseup",this._reset),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this)}_dragElement(e){const r=F(e,"flk-draggable").target;let n,s;function t(e){n=e.clientX-r.offsetLeft,s=e.clientY-r.offsetTop}function i(e){var t=e.clientX-n,e=e.clientY-s;r.style.left=t+"px",r.style.top=e+"px"}function o(e){e.preventDefault()}function a(){r.removeAttribute("draggable"),r.removeEventListener("dragstart",t),r.removeEventListener("dragend",a),document.removeEventListener("dragover",o),document.removeEventListener("drop",i)}r.setAttribute("draggable",!0),r.addEventListener("dragstart",t),r.addEventListener("dragend",a),document.addEventListener("dragover",o),document.addEventListener("drop",i)}}class q extends HTMLElement{_id;base;_draggableId;constructor(){super(),this.base=new $}_emit(e,t,r){e=new CustomEvent(e,{detail:r,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}_closeModal(e){e.stopPropagation();const t=F(e,"flk-modal").target;t.classList.add("hidden")}closeModal(e){this.classList.add("hidden")}openModal(e=!0){const t=document.getElementById(this._draggableId);e&&(t.style.top="40%",t.style.left="50%"),this.classList.remove("hidden")}connectedCallback(){this.id||(this.id=this.base.generateId());const e=document.createElement("div");var t=this.base.generateId();const r=document.createElement("flk-draggable"),n=(this._draggableId=this.base.generateId(),r.id=this._draggableId,r.setAttribute("center",""),r.setAttribute("top","40%"),r.setAttribute("handle",t),r.setAttribute("zIndex","1080"),r.classList.add("border","shadow-lg","bg-white"),r.style.width="max-content",document.createElement("div"));var s=this.getAttribute("modal-title");if(s){const c=document.createElement("span");c.innerText=s,c.classList.add("ml-1","mr-auto"),n.append(c)}n.id=t;const i=this.getAttribute("header-class");let o=[];i?o=o.concat(i.split(" ")):o.push("bg-gray-light"),n.classList.add(...o,"border-bottom","row","justify-end","cursor-no-select");s=this.base.generateId();const a=document.createElement("button"),l=(a.classList.add("py-0","px-1","outline-hover","no-border","cursor-default",...o),a.innerText="X",a.id=s,n.append(a),r.append(n),document.createElement("div"));l.innerHTML=this.innerHTML,r.append(l),e.append(r),this.component=e,this.base.addEvent("#"+s,"click",this._closeModal),this.base.render(this),this.classList.add("hidden")}disconnectedCallback(){this.base.removeEvents(this)}}class K extends HTMLElement{base;_buttonId;_drawerId;_iconId;constructor(){super(),this.base=new $}connectedCallback(){this.style.position="relative",this.style.display="flex",this.style.width="fit-content",this._buttonId=this.base.generateId();const e=document.createElement("button"),t=(e.classList.add("row"),e.id=this._buttonId,document.createElement("span")),r=(t.innerText=this.getAttribute("text"),this._iconId=this.base.generateId(),document.createElement("span"));var n=V('');const s=V(''),i=(s.classList.add("hidden"),r.append(n,s),r.id=this._iconId,e.append(t,r),this._drawerId=this.base.generateId(),document.createElement("div"));i.id=this._drawerId,i.classList.add("shadow","inline-block","bg-white"),i.style.position="absolute",i.style.zIndex="1040";n=this.querySelector("template");n.innerHTML.length?i.innerHTML=n.innerHTML:i.append(n.firstChild),i.style.display="none",this.component=[e,i],this.base.addEvent("#"+this._buttonId,"click",this.toggleMenu);const o=document.querySelector("body");""!==o.getAttribute("flk-close-dropdown")&&(o.setAttribute("flk-close-dropdown",""),o.addEventListener("click",this.closeAllDropdownButtons)),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this);var e=document.querySelectorAll("flk-dropdown");if(!e||!e.length){const t=document.querySelector("body");t.removeAttribute("flk-close-dropdown"),t.removeEventListener("click",this.closeAllDropdownButtons)}}toggleMenu(e){const t=F(e).target;e=t._drawerId;const r=document.getElementById(e);var e="none"!==r.style.display,n=(r.style.display=e?"none":"block",t.getAttribute("drawer-width")),n=("string"==typeof t.getAttribute("right")&&(r.style.right="0px"),r.style.top=t.offsetHeight+"px",r.style.width=n||t.offsetWidth+"px",t._iconId);const s=document.getElementById(n);e?(s.childNodes[0].classList.remove("hidden"),s.childNodes[1].classList.add("hidden")):(s.childNodes[0].classList.add("hidden"),s.childNodes[1].classList.remove("hidden"))}_closeDropdown(){var e=this._drawerId;const t=document.getElementById(e);if("none"!==t.style.display){e=this._iconId;const r=document.getElementById(e);t.style.display="none",r.childNodes[0].classList.remove("hidden"),r.childNodes[1].classList.add("hidden")}}closeAllDropdownButtons(e){var t,r=F(e,"flk-dropdown").target,e=document.querySelectorAll("flk-dropdown");if(r)for(const n of e)r._buttonId!==n._buttonId&&(t=n._drawerId,"none"!==document.getElementById(t).style.display&&n._closeDropdown());else for(const s of e)s._closeDropdown()}}var t={exports:{}};let Z=e.default,Y=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||"win32"===process.platform||Z.isatty(1)&&"dumb"!==process.env.TERM||"CI"in process.env),r=(r,n,s=r)=>e=>{let t=""+e;e=t.indexOf(n,r.length);return~e?r+X(t,n,s,e)+n:r+t+n},X=(e,t,r,n)=>{var s=e.substring(0,n)+r;let i=e.substring(n+t.length);e=i.indexOf(t);return~e?s+X(i,t,r,e):s+i};e=(e=Y)=>({isColorSupported:e,reset:e?e=>`${e}`:String,bold:e?r("","",""):String,dim:e?r("","",""):String,italic:e?r("",""):String,underline:e?r("",""):String,inverse:e?r("",""):String,hidden:e?r("",""):String,strikethrough:e?r("",""):String,black:e?r("",""):String,red:e?r("",""):String,green:e?r("",""):String,yellow:e?r("",""):String,blue:e?r("",""):String,magenta:e?r("",""):String,cyan:e?r("",""):String,white:e?r("",""):String,gray:e?r("",""):String,bgBlack:e?r("",""):String,bgRed:e?r("",""):String,bgGreen:e?r("",""):String,bgYellow:e?r("",""):String,bgBlue:e?r("",""):String,bgMagenta:e?r("",""):String,bgCyan:e?r("",""):String,bgWhite:e?r("",""):String});t.exports=e(),t.exports.createColors=e;const Q="'".charCodeAt(0),ee='"'.charCodeAt(0),te="\\".charCodeAt(0),re="/".charCodeAt(0),ne="\n".charCodeAt(0),se=" ".charCodeAt(0),ie="\f".charCodeAt(0),oe="\t".charCodeAt(0),ae="\r".charCodeAt(0),le="[".charCodeAt(0),ce="]".charCodeAt(0),ue="(".charCodeAt(0),he=")".charCodeAt(0),pe="{".charCodeAt(0),de="}".charCodeAt(0),fe=";".charCodeAt(0),me="*".charCodeAt(0),ge=":".charCodeAt(0),ye="@".charCodeAt(0),ve=/[\t\n\f\r "#'()/;[\\\]{}]/g,we=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,be=/.[\r\n"'(/\\]/,_e=/[\da-f]/i;function Ce(t,e={}){let n=t.css.valueOf(),d=e.ignoreErrors,s,i,f,m,o,a,l,g,c,u,y=n.length,h=0,v=[],p=[];function w(e){throw t.error("Unclosed "+e,h)}return{back:function(e){p.push(e)},endOfFile:function(){return 0===p.length&&h>=y},nextToken:function(e){if(p.length)return p.pop();if(!(h>=y)){var t=!!e&&e.ignoreUnclosed;switch(s=n.charCodeAt(h),s){case ne:case se:case oe:case ae:case ie:for(i=h;i+=1,s=n.charCodeAt(i),s===se||s===ne||s===oe||s===ae||s===ie;);u=["space",n.slice(h,i)],h=i-1;break;case le:case ce:case pe:case de:case ge:case fe:case he:var r=String.fromCharCode(s);u=[r,r,h];break;case ue:if(g=v.length?v.pop()[1]:"",c=n.charCodeAt(h+1),"url"===g&&c!==Q&&c!==ee&&c!==se&&c!==ne&&c!==oe&&c!==ie&&c!==ae){i=h;do{if(a=!1,i=n.indexOf(")",i+1),-1===i){if(d||t){i=h;break}w("bracket")}for(l=i;n.charCodeAt(l-1)===te;)--l,a=!a}while(a);u=["brackets",n.slice(h,i+1),h,i],h=i}else i=n.indexOf(")",h+1),m=n.slice(h,i+1),-1===i||be.test(m)?u=["(","(",h]:(u=["brackets",m,h,i],h=i);break;case Q:case ee:f=s===Q?"'":'"',i=h;do{if(a=!1,i=n.indexOf(f,i+1),-1===i){if(d||t){i=h+1;break}w("string")}for(l=i;n.charCodeAt(l-1)===te;)--l,a=!a}while(a);u=["string",n.slice(h,i+1),h,i],h=i;break;case ye:ve.lastIndex=h+1,ve.test(n),i=0===ve.lastIndex?n.length-1:ve.lastIndex-2,u=["at-word",n.slice(h,i+1),h,i],h=i;break;case te:for(i=h,o=!0;n.charCodeAt(i+1)===te;)i+=1,o=!o;if(s=n.charCodeAt(i+1),o&&s!==re&&s!==se&&s!==ne&&s!==oe&&s!==ae&&s!==ie&&(i+=1,_e.test(n.charAt(i)))){for(;_e.test(n.charAt(i+1));)i+=1;n.charCodeAt(i+1)===se&&(i+=1)}u=["word",n.slice(h,i+1),h,i],h=i;break;default:h=(s===re&&n.charCodeAt(h+1)===me?(i=n.indexOf("*/",h+2)+1,0===i&&(d||t?i=n.length:w("comment")),u=["comment",n.slice(h,i+1),h,i]):(we.lastIndex=h+1,we.test(n),i=0===we.lastIndex?n.length-1:we.lastIndex-2,u=["word",n.slice(h,i+1),h,i],v.push(u)),i)}return h++,u}},position:function(){return h}}}e=t.exports;let Se=Ce,xe;const Ae={";":e.yellow,":":e.yellow,"(":e.cyan,")":e.cyan,"[":e.yellow,"]":e.yellow,"{":e.yellow,"}":e.yellow,"at-word":e.cyan,brackets:e.cyan,call:e.cyan,class:e.yellow,comment:e.gray,hash:e.magenta,string:e.green};function ke(e){let r=Se(new xe(e),{ignoreErrors:!0}),n="";for(;!r.endOfFile();){let e=r.nextToken(),t=Ae[function([e,t],r){if("word"===e){if("."===t[0])return"class";if("#"===t[0])return"hash"}if(!r.endOfFile()){t=r.nextToken();if(r.back(t),"brackets"===t[0]||"("===t[0])return"call"}return e}(e,r)];t?n+=e[1].split(/\r?\n/).map(e=>t(e)).join("\n"):n+=e[1]}return n}ke.registerInput=function(e){xe=e};e=ke;let Ee=t.exports,Le=e;class Oe extends Error{constructor(e,t,r,n,s,i){super(e),this.name="CssSyntaxError",this.reason=e,s&&(this.file=s),n&&(this.source=n),i&&(this.plugin=i),void 0!==t&&void 0!==r&&("number"==typeof t?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,Oe)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file||"",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source,r=(null==e&&(e=Ee.isColorSupported),Le&&e&&(t=Le(t)),t.split(/\r?\n/)),n=Math.max(this.line-3,0);var s=Math.min(this.line+2,r.length);let i=String(s).length,o,a;if(e){let{bold:t,gray:r,red:n}=Ee.createColors(!0);o=e=>t(n(e)),a=e=>r(e)}else o=a=e=>e;return r.slice(n,s).map((e,t)=>{var t=n+1+t;let r=" "+(" "+t).slice(-i)+" | ";return t===this.line?(t=a(r.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," "),o(">")+a(r)+e+"\n "+t+o("^")):" "+a(r)+e}).join("\n")}toString(){let e=this.showSourceCode();return e=e&&"\n\n"+e+"\n",this.name+": "+this.message+e}}var t=Oe,Me=(Oe.default=Oe,{});Me.isClean=Symbol("isClean"),Me.my=Symbol("my");const Pe={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class Re{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name;var n=e.params?this.rawValue(e,"params"):"";void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes?this.block(e,r+n):(t=(e.raws.between||"")+(t?";":""),this.builder(r+n+t,e))}beforeAfter(e,t){let r,n=(r="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose"),e.parent),s=0;for(;n&&"root"!==n.type;)s+=1,n=n.parent;if(r.includes("\n")){var i=this.raw(e,null,"indent");if(i.length)for(let e=0;e{if(n=e.raws[t],void 0!==n)return!1}),void 0===n&&(n=Pe[r]),i.rawCache[r]=n,n}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&0{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=void 0===r?this.raw(t,null,"beforeDecl"):r&&r.replace(/\S/g,""),r}rawBeforeDecl(e,t){let r;return e.walkDecls(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=void 0===r?this.raw(t,null,"beforeRule"):r&&r.replace(/\S/g,""),r}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(t){let r;return t.walk(e=>{if(e.nodes&&(e.parent!==t||t.first!==e)&&void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=r&&r.replace(/\S/g,""),r}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(r){if(r.raws.indent)return r.raws.indent;let n;return r.walk(e=>{var t=e.parent;if(t&&t!==r&&t.parent&&t.parent===r&&void 0!==e.raws.before)return t=e.raws.before.split("\n"),n=t[t.length-1],n=n.replace(/\S/g,""),!1}),n}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){var r=e[t],e=e.raws[t];return e&&e.value===r?e.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}}var Te=Re;Re.default=Re;let Ie=Te;function Be(e,t){let r=new Ie(t);r.stringify(e)}var Ne=Be;Be.default=Be;let{isClean:je,my:De}=Me,Ue=t,Fe=Te,ze=Ne;function $e(t,r){let n=new t.constructor;for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&"proxyCache"!==s){let e=t[s];var i=typeof e;"parent"===s&&"object"==i?r&&(n[s]=r):"source"===s?n[s]=e:Array.isArray(e)?n[s]=e.map(e=>$e(e,n)):("object"==i&&null!==e&&(e=$e(e)),n[s]=e)}return n}class Ge{constructor(e={}){for(var t in this.raws={},this[je]=!1,this[De]=!0,e)if("nodes"===t){this.nodes=[];for(var r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){var t;return e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)&&(t=this.source,e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)),e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(var t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=$e(this);for(var r in e)t[r]=e[r];return t}cloneAfter(e={}){e=this.clone(e);return this.parent.insertAfter(this,e),e}cloneBefore(e={}){e=this.clone(e);return this.parent.insertBefore(this,e),e}error(e,t={}){var r,n;return this.source?({end:r,start:n}=this.rangeBy(t),this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)):new Ue(e)}getProxyProcessor(){return{get(e,t){return"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t]},set(e,t,r){return e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0}}}markDirty(){if(this[je]){this[je]=!1;let e=this;for(;e=e.parent;)e[je]=!1}}next(){var e;if(this.parent)return e=this.parent.index(this),this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;return e.index?r=this.positionInside(e.index,t):!e.word||-1!==(e=(t=this.toString()).indexOf(e.word))&&(r=this.positionInside(e,t)),r}positionInside(t,e){var r=e||this.toString();let n=this.source.start.column,s=this.source.start.line;for(let e=0;e"object"==typeof e&&e.toJSON?e.toJSON(null,r):e);else if("object"==typeof t&&t.toJSON)n[s]=t.toJSON(null,r);else if("source"===s){let e=r.get(t.input);null==e&&(e=i,r.set(t.input,i),i++),n[s]={end:t.end,inputId:e,start:t.start}}else n[s]=t}return t&&(n.inputs=[...r.keys()].map(e=>e.toJSON())),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=ze){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(var s in r)n[s]=r[s];return e.warn(t,n)}get proxyOf(){return this}}var Te=Ge,He=(Ge.default=Ge,Te);class Ve extends He{constructor(e){super(e=e&&void 0!==e.value&&"string"!=typeof e.value?{...e,value:String(e.value)}:e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}}var He=Ve,We=(Ve.default=Ve,{}),Je={},qe={},Ke={},Ze="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),Ye=(Ke.encode=function(e){if(0<=e&&e>>=5)&&(t|=32),r+=Ye.encode(t),0>1,1==(1&a)?-i:i),r.rest=t};var Ke={},l=Ke,Xe=(l.getArg=function(e,t,r){if(t in e)return e[t];if(3===arguments.length)return r;throw new Error('"'+t+'" is a required argument.')},/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/),Qe=/^data:.+\,.+$/;function et(e){e=e.match(Xe);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}function tt(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}l.urlParse=et,l.urlGenerate=tt,rt=function(e){var t=e,r=et(e);if(r){if(!r.path)return e;t=r.path}for(var n,e=l.isAbsolute(t),s=[],i=0;;){if(n=i,-1===(i=t.indexOf("/",n))){s.push(t.slice(n));break}for(s.push(t.slice(n,i));in;e--){var o=r[e-1],a=r[e];if(Pt(o,a)<=0)break;r[e-1]=a,r[e]=o}else Ot(r,Pt,n)}function Tt(e,s){var t=e,e=("string"==typeof e&&(t=w.parseSourceMapInput(e)),w.getArg(t,"version")),t=w.getArg(t,"sections");if(e!=this._version)throw new Error("Unsupported version: "+e);this._sources=new Et,this._names=new Et;var i={line:-1,column:0};this._sections=t.map(function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var t=w.getArg(e,"offset"),r=w.getArg(t,"line"),n=w.getArg(t,"column");if(r=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))},p.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;var r=this._findSourceIndex(e);if(0<=r)return this.sourcesContent[r];var n,r=e;if(null!=this.sourceRoot&&(r=w.relative(this.sourceRoot,r)),null!=this.sourceRoot&&(n=w.urlParse(this.sourceRoot))){e=r.replace(/^file:\/\//,"");if("file"==n.scheme&&this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];if((!n.path||"/"==n.path)&&this._sources.has("/"+r))return this.sourcesContent[this._sources.indexOf("/"+r)]}if(t)return null;throw new Error('"'+r+'" is not in the SourceMap.')},p.prototype.generatedPositionFor=function(e){var t=w.getArg(e,"source");if((t=this._findSourceIndex(t))<0)return{line:null,column:null,lastColumn:null};t={source:t,originalLine:w.getArg(e,"line"),originalColumn:w.getArg(e,"column")},e=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",w.compareByOriginalPositions,w.getArg(e,"bias",f.GREATEST_LOWER_BOUND));if(0<=e){e=this._originalMappings[e];if(e.source===t.source)return{line:w.getArg(e,"generatedLine",null),column:w.getArg(e,"generatedColumn",null),lastColumn:w.getArg(e,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},ft.BasicSourceMapConsumer=p,(Tt.prototype=Object.create(f.prototype)).constructor=f,Tt.prototype._version=3,Object.defineProperty(Tt.prototype,"sources",{get:function(){for(var e=[],t=0;t{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(n,s=21)=>(e=s)=>{let t="",r=e;for(;r--;)t+=n[Math.random()*n.length|0];return t}};let{SourceMapConsumer:Ut,SourceMapGenerator:Ft}=We,{existsSync:zt,readFileSync:$t}=i.default,{dirname:Gt,join:Ht}=n.default;class Vt{constructor(e,t){!1!==t.map&&(this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:"),e=t.map?t.map.prev:void 0,e=this.loadMap(t.from,e),!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Gt(this.mapFile)),e&&(this.text=e))}consumer(){return this.consumerCache||(this.consumerCache=new Ut(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+t)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);var r,n;t&&(r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r),-1"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,i,o;t&&"object"==typeof t?(a=r,r="number"==typeof(l=t).offset?(t=(c=this.fromOffset(l.offset)).line,c.col):(t=l.line,l.column),o="number"==typeof a.offset?(c=this.fromOffset(a.offset),i=c.line,c.col):(i=a.line,a.column)):r||(t=(l=this.fromOffset(t)).line,r=l.col);var a,l,c=this.origin(t,r,i,o);return s=c?new Xt(e,void 0===c.endLine?c.line:{column:c.column,line:c.line},void 0===c.endLine?c.column:{column:c.endColumn,line:c.endLine},c.source,c.file,n.plugin):new Xt(e,void 0===i?t:{column:r,line:t},void 0===i?r:{column:o,line:i},this.css,this.file,n.plugin),s.input={column:r,endColumn:o,endLine:i,line:t,source:this.css},this.file&&(Jt&&(s.input.url=Jt(this.file).toString()),s.input.file=this.file),s}fromOffset(t){let n;if(this[er])n=this[er];else{var s=this.css.split("\n");n=new Array(s.length);let r=0;for(let e=0,t=s.length;e>1),t=n[i+1])){r=i;break}r=i+1}}return{col:t-n[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Kt(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let s=this.map.consumer();t=s.originalPositionFor({column:t,line:e});if(!t.source)return!1;let i;"number"==typeof r&&(i=s.originalPositionFor({column:n,line:r}));let o,a=(o=qt(t.source)?Jt(t.source):new URL(t.source,this.map.consumer().sourceRoot||Jt(this.map.mapFile)),{column:t.column,endColumn:i&&i.column,endLine:i&&i.line,line:t.line,url:o.toString()});if("file:"===o.protocol){if(!Wt)throw new Error("file: protocol is not available in this PostCSS build");a.file=Wt(o)}e=s.sourceContentFor(t.source);return e&&(a.source=e),a}toJSON(){let e={};for(var t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}}Je=nr;nr.default=nr,Yt&&Yt.registerInput&&Yt.registerInput(nr);let{SourceMapConsumer:sr,SourceMapGenerator:ir}=We,{dirname:or,relative:ar,resolve:lr,sep:cr}=n.default,ur=s.default["pathToFileURL"],hr=Je,pr=Boolean(sr&&ir),dr=Boolean(or&&lr&&ar&&cr);ft=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e,t=(e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map","\n");this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(var t of this.previous()){var r=this.toUrl(this.path(t.file)),n=t.root||or(t.file);let e;!1===this.mapOpts.sourcesContent?(e=new sr(t.text),e.sourcesContent&&(e.sourcesContent=null)):e=t.consumer(),this.map.applySourceMap(e,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let t;for(let e=this.root.nodes.length-1;0<=e;e--)t=this.root.nodes[e],"comment"===t.type&&0===t.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(e)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),dr&&pr&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,e=>{t+=e}),[t]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=ir.fromSourceMap(e)}else this.map=new ir({file:this.outputFile()}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):""});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&0",o={generated:{column:0,line:0},original:{column:0,line:0},source:""},a,l;this.stringify(this.root,(e,t,r)=>{this.css+=e,t&&"end"!==r&&(o.generated.line=n,o.generated.column=s-1,t.source&&t.source.start?(o.source=this.sourcePath(t),o.original.line=t.source.start.line,o.original.column=t.source.start.column-1):(o.source=i,o.original.line=1,o.original.column=0),this.map.addMapping(o)),a=e.match(/\n/g),a?(n+=a.length,l=e.lastIndexOf("\n"),s=e.length-l):s+=e.length,t&&"start"!==r&&(e=t.parent||{raws:{}},("decl"===t.type||"atrule"===t.type&&!t.nodes)&&t===e.last&&!e.raws.semicolon||(t.source&&t.source.end?(o.source=this.sourcePath(t),o.original.line=t.source.end.line,o.original.column=t.source.end.column-1,o.generated.line=n,o.generated.column=s-2):(o.source=i,o.original.line=1,o.original.column=0,o.generated.line=n,o.generated.column=s-1),this.map.addMapping(o)))})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;var e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:0e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;var t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?or(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=or(lr(r,this.mapOpts.annotation)));t=ar(r,e);return this.memoizedPaths.set(e,t),t}previous(){var e;return this.previousMaps||(this.previousMaps=[],this.root?this.root.walk(e=>{e.source&&e.source.input.map&&(e=e.source.input.map,this.previousMaps.includes(e)||this.previousMaps.push(e))}):(e=new hr(this.originalCSS,this.opts)).map&&this.previousMaps.push(e.map)),this.previousMaps}setSourcesContent(){let r={};var e;this.root?this.root.walk(e=>{var t;!e.source||(t=e.source.input.from)&&!r[t]&&(r[t]=!0,t=this.usesFileUrls?this.toFileUrl(t):this.toUrl(this.path(t)),this.map.setSourceContent(t,e.source.input.css))}):this.css&&(e=this.opts.from?this.toUrl(this.path(this.opts.from)):"",this.map.setSourceContent(e,this.css))}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){var t=this.memoizedFileURLs.get(e);if(t)return t;if(ur)return t=ur(e).toString(),this.memoizedFileURLs.set(e,t),t;throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){var t=this.memoizedURLs.get(e);if(t)return t;"\\"===cr&&(e=e.replace(/\\/g,"/"));t=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,t),t}};class fr extends Te{constructor(e){super(e),this.type="comment"}}Ct=fr;fr.default=fr;let{isClean:mr,my:gr}=Me,yr=He,vr=Ct,wr,br,_r,Cr;class Sr extends Te{append(...e){for(var t of e){var r;for(r of this.normalize(t,this.last))this.proxyOf.nodes.push(r)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(var t of this.nodes)t.cleanRaws(e)}each(r){if(this.proxyOf.nodes){var n=this.getIterator();let e,t;for(;this.indexes[n]t[n](...e.map(r=>"function"==typeof r?(e,t)=>r(e.toProxy(),t):r)):"every"===n||"some"===n?r=>t[n]((e,...t)=>r(e.toProxy(),...t)):"root"===n?()=>t.root().toProxy():"nodes"===n?t.nodes.map(e=>e.toProxy()):"first"===n||"last"===n?t[n].toProxy():t[n])},set(e,t,r){return e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0}}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){var r,n,s,i=this.index(e),o=this.normalize(t,this.proxyOf.nodes[i]).reverse(),i=this.index(e);for(r of o)this.proxyOf.nodes.splice(i+1,0,r);for(s in this.indexes)i<(n=this.indexes[s])&&(this.indexes[s]=n+o.length);return this.markDirty(),this}insertBefore(e,t){var r,n,s,i=this.index(e),o=this.normalize(t,this.proxyOf.nodes[i],0===i&&"prepend").reverse(),i=this.index(e);for(r of o)this.proxyOf.nodes.splice(i,0,r);for(s in this.indexes)i<=(n=this.indexes[s])&&(this.indexes[s]=n+o.length);return this.markDirty(),this}normalize(e,t){if("string"==typeof e)e=function t(e){return e.map(e=>(e.nodes&&(e.nodes=t(e.nodes)),delete e.source,e))}(wr(e).nodes);else if(void 0===e)e=[];else if(Array.isArray(e))for(var r of e=e.slice(0))r.parent&&r.parent.removeChild(r,"ignore");else if("root"===e.type&&"document"!==this.type)for(var n of e=e.nodes.slice(0))n.parent&&n.parent.removeChild(n,"ignore");else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new yr(e)]}else if(e.selector)e=[new br(e)];else if(e.name)e=[new _r(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new vr(e)]}return e.map(e=>(e[gr]||Sr.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[mr]&&function e(t){if(t[mr]=!1,t.proxyOf.nodes)for(var r of t.proxyOf.nodes)e(r)}(e),void 0===e.raws.before&&t&&void 0!==t.raws.before&&(e.raws.before=t.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}prepend(...e){for(var t of e=e.reverse()){var r,n,s=this.normalize(t,this.first,"prepend").reverse();for(r of s)this.proxyOf.nodes.unshift(r);for(n in this.indexes)this.indexes[n]=this.indexes[n]+s.length}return this.markDirty(),this}push(e){return(e.parent=this).proxyOf.nodes.push(e),this}removeAll(){for(var e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){var t,r;for(r in e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1),this.indexes)e<=(t=this.indexes[r])&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(t,r,n){return n||(n=r,r={}),this.walkDecls(e=>{r.props&&!r.props.includes(e.prop)||r.fast&&!e.value.includes(r.fast)||(e.value=e.value.replace(t,n))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(n){return this.each((t,e)=>{let r;try{r=n(t,e)}catch(e){throw t.addToError(e)}return!1!==r&&t.walk&&(r=t.walk(n)),r})}walkAtRules(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("atrule"===e.type&&r.test(e.name))return n(e,t)}):this.walk((e,t)=>{if("atrule"===e.type&&e.name===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("atrule"===e.type)return n(e,t)}))}walkComments(r){return this.walk((e,t)=>{if("comment"===e.type)return r(e,t)})}walkDecls(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("decl"===e.type&&r.test(e.prop))return n(e,t)}):this.walk((e,t)=>{if("decl"===e.type&&e.prop===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("decl"===e.type)return n(e,t)}))}walkRules(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("rule"===e.type&&r.test(e.selector))return n(e,t)}):this.walk((e,t)=>{if("rule"===e.type&&e.selector===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("rule"===e.type)return n(e,t)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}Sr.registerParse=e=>{wr=e},Sr.registerRule=e=>{br=e},Sr.registerAtRule=e=>{_r=e},Sr.registerRoot=e=>{Cr=e};i=Sr,Sr.default=Sr,Sr.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,_r.prototype):"rule"===e.type?Object.setPrototypeOf(e,br.prototype):"decl"===e.type?Object.setPrototypeOf(e,yr.prototype):"comment"===e.type?Object.setPrototypeOf(e,vr.prototype):"root"===e.type&&Object.setPrototypeOf(e,Cr.prototype),e[gr]=!0,e.nodes&&e.nodes.forEach(e=>{Sr.rebuild(e)})},ot=i;let xr,Ar;class kr extends ot{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){let t=new xr(new Ar,this,e);return t.stringify()}}kr.registerLazyResult=e=>{xr=e},kr.registerProcessor=e=>{Ar=e};e=kr;kr.default=kr;let Er={};function Lr(e){Er[e]||(Er[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))}class Or{constructor(e,t={}){for(var r in this.type="warning",this.text=e,t.node&&t.node.source&&(e=t.node.rangeBy(t),this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column),t)this[r]=t[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}St=Or;Or.default=Or;let Mr=St;class Pr{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);e=new Mr(e,t);return this.messages.push(e),e}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}}Ke=Pr;Pr.default=Pr;let Rr=i;class Tr extends Rr{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}We=Tr;Tr.default=Tr,Rr.registerAtRule(Tr);let Ir=i,Br,Nr;class jr extends Ir{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){e=super.normalize(e);if(t)if("prepend"===r)1{Br=e},jr.registerProcessor=e=>{Nr=e};n=jr;jr.default=jr,Ir.registerRoot(jr);let Dr={comma(e){return Dr.split(e,[","],!0)},space(e){return Dr.split(e,[" ","\n","\t"])},split(e,t,u){let r=[],n="",s=!1,i=0,o=!1,a="",l=!1;for(var c of e)l?l=!1:"\\"===c?l=!0:o?c===a&&(o=!1):'"'===c||"'"===c?(o=!0,a=c):"("===c?i+=1:")"===c?0"space"!==e[0]&&"comment"!==e[0])&&(s.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(s,"value",a.concat(e),t),s.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new Jr;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){var t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1;var r;let n=!1,s=null,i=[];var o=e[1].startsWith("--");let a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)s=s||l,i.push("("===r?")":"]");else if(o&&n&&"{"===r)s=s||l,i.push("}");else if(0===i.length){if(";"===r){if(n)return void this.decl(a,o);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===i[i.length-1]&&(i.pop(),0===i.length&&(s=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),0e+t[1],""),e.raws[t]={raw:o,value:l}),e[t]=l}rule(e){e.pop();let t=new Jr;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){var t;let r="";for(;e.length&&("space"===(t=e[e.length-1][0])||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){var t;let r="";for(;e.length&&("space"===(t=e[0][0])||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t="";for(;e.length&&"space"===e[e.length-1][0];)t=e.pop()[1]+t;return t}stringFrom(t,r){let n="";for(let e=r;evn(e)),e}let wn={};class bn{constructor(e,t,r){this.stringified=!1,this.processed=!1;let n;if("object"!=typeof t||null===t||"root"!==t.type&&"document"!==t.type)if(t instanceof bn||t instanceof ln)n=vn(t.root),t.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=t.map);else{let e=cn;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{n=e(t,r)}catch(e){this.processed=!0,this.error=e}n&&!n[tn]&&sn.rebuild(n)}else n=vn(t);this.result=new ln(e,n,r),this.helpers={...wn,postcss:wn,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){var r=this.result.lastPlugin;try{if(t&&t.addToError(e),"CssSyntaxError"!==(this.error=e).name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){var n=r.postcssPlugin;let e=r.postcssVersion,t=this.result.processor.version;var s=e.split("."),i=t.split(".");(s[0]!==i[0]||parseInt(s[1])>parseInt(i[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+t+", but "+n+" uses "+e+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};var e,t=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(e of this.plugins)if("object"==typeof e)for(var r in e){if(!pn[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${e.postcssPlugin}. `+`Try to update PostCSS (${this.processor.version} now).`);if(!dn[r])if("object"==typeof e[r])for(var n in e[r])"*"===n?t(e,r,e[r][n]):t(e,r+"-"+n.toLowerCase(),e[r][n]);else"function"==typeof e[r]&&t(e,r,e[r])}this.hasListener=0t(e,this.helpers)),await Promise.all(i)):await t(r,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{var e;if("object"==typeof t&&t.Once)return"document"===this.result.root.type?mn((e=this.result.root.nodes.map(e=>t.Once(e,this.helpers)))[0])?Promise.all(e):e:t.Once(this.result.root,this.helpers);if("function"==typeof t)return t(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();var e=this.result.opts;let t=nn,r=(e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify),new rn(t,this.result.root,this.result.opts));e=r.generate();return this.result.css=e[0],this.result.map=e[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(var e of this.plugins)if(mn(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[en];)e[en]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(var t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||an("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(var[r,n]of e){this.result.lastPlugin=r;let e;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(mn(e))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:s}=r;if("root"===n.type||"document"===n.type||n.parent){if(0{e[en]||this.walkSync(e)});else{var r=this.listeners[t];if(r&&this.visitSync(r,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}bn.registerPostcss=e=>{wn=e};Me=bn;bn.default=bn,un.registerLazyResult(bn),on.registerLazyResult(bn);let _n=ft,Cn=Ne,Sn=Lr,xn=Qr;const An=Ke;class kn{constructor(e,t,r){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;var e=Cn;this.result=new An(this._processor,void 0,this._opts),this.result.css=t;let n=this,s=(Object.defineProperty(this.result,"root",{get(){return n.root}}),new _n(e,void 0,this._opts,t));s.isMap()?([r,e]=s.generate(),r&&(this.result.css=r),e&&(this.result.map=e)):(s.clearAnnotation(),this.result.css=s.css)}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||Sn("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=xn;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}}ft=kn;kn.default=kn;let En=ft,Ln=Me,On=e,Mn=n;class Pn{constructor(e=[]){this.version="8.4.35",this.plugins=this.normalize(e)}normalize(e){let t=[];for(var r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return new(this.plugins.length||t.parser||t.stringifier||t.syntax?Ln:En)(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}ft=Pn;Pn.default=Pn,Mn.registerProcessor(Pn),On.registerProcessor(Pn);let Rn=He,Tn=qe,In=Ct,Bn=We,Nn=Je,jn=n,Dn=ot;function Un(e,r){if(Array.isArray(e))return e.map(e=>Un(e));let{inputs:t,...n}=e;if(t){r=[];for(var s of t){let e={...s,__proto__:Nn.prototype};e.map&&(e.map={...e.map,__proto__:Tn.prototype}),r.push(e)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>Un(e,r))),n.source){let{inputId:e,...t}=n.source;n.source=t,null!=e&&(n.source.input=r[e])}if("root"===n.type)return new jn(n);if("decl"===n.type)return new Rn(n);if("rule"===n.type)return new Dn(n);if("comment"===n.type)return new In(n);if("atrule"===n.type)return new Bn(n);throw new Error("Unknown node type: "+e.type)}qe=Un,Un.default=Un;let Fn=He,zn=Me;He=i;let $n=ft;Me=Ne,i=qe;let Gn=e;ft=St;let Hn=Ct,Vn=We;Ne=Ke,qe=Je,e=Qr,St=s;let Wn=ot,Jn=n;Ct=Te;function o(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new $n(e)}o.plugin=function(r,n){let s=!1;function i(...e){console&&console.warn&&!s&&(s=!0,console.warn(r+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(r+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let t=n(...e);return t.postcssPlugin=r,t.postcssVersion=(new $n).version,t}let e;return Object.defineProperty(i,"postcss",{get(){return e=e||i(),e}}),i.process=function(e,t,r){return o([i(r)]).process(e,t)},i},o.stringify=Me,o.parse=e,o.fromJSON=i,o.list=St,o.comment=e=>new Hn(e),o.atRule=e=>new Vn(e),o.decl=e=>new Fn(e),o.rule=e=>new Wn(e),o.root=e=>new Jn(e),o.document=e=>new Gn(e),o.CssSyntaxError=t,o.Declaration=Fn,o.Container=He,o.Processor=$n,o.Document=Gn,o.Comment=Hn,o.Warning=ft,o.AtRule=Vn,o.Result=Ne,o.Input=qe,o.Rule=Wn,o.Root=Jn,o.Node=Ct,zn.registerPostcss(o);o.default=o;class qn extends HTMLElement{base;contents;component;listType="ul";iconSet;filter={value:"",caseSensitive:!1};static get observedAttributes(){return["contents","icon-set","max-depth","filter"]}_jsonToValueArray(e){let t=JSON.stringify(e);t=t.replace(/[\[\]{}\"]/g,"");let r=[];for(const n of t.split(","))r=r.concat(n.split(":"));return[...new Set(r)]}_emit(e,t,r){e=new CustomEvent(e,{detail:r,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}constructor(){super(),this.base=new $,this.setContents(this.getAttribute("contents")),this.iconSet=this.getAttribute("icon-set")?this.getAttribute("icon-type"):"file",this.maxDepth=this.getAttribute("max-depth")?parseInt(this.getAttribute("max-depth")):-1,this.setFilter(this.getAttribute("filter")),this.style.display="block",this.style.maxWidth="fit-content",this.style.margin="0 1rem 0 0",this.base.addEvent(".flk-branch","click",this.emitNodeToggle)}emitNodeToggle(e){e.stopPropagation();const t=F(e,"flk-tree-nav").target,r=z(e,"branchKey");let n=t.contents;const s=r.split(".");for(const o of s)if(n[o])n=n[o];else if(null===n[o])n=null;else{let e=[];for(const a of n)a[o]&&e.push(a[o]);n=e}var e=r.substring(r.indexOf(".")+1),i=t.createLeafText(s.reverse()[0]);t._emit("tree-click",t,{path:e,data:n,key:(i.titleText+" "+i.commentText).trim(),branch:"object"==typeof n})}convertJsonKeyToTitle(e){if(!e)return"";const t=(e="string"!=typeof e?e.toString():e).replace(/([A-Z_])/g,e=>"_"===e?" ":" "+e).trim();return t.charAt(0).toUpperCase()+t.slice(1)}setContents(e){var t=e||this.contents||[];try{switch(typeof t){case"string":this.contents=JSON.parse(t);break;case"object":Array.isArray(t)?this.contents=t:this.contents=[t]}}catch(e){console.log(e)}}applyFilter(e){let t;var r="details"===e.tagName.toLowerCase();t=this.filter.caseSensitive?e.dataset.branchValues.includes(this.filter.value):e.dataset.branchValues.toLowerCase().includes(this.filter.value.toLowerCase()),t?e.parentElement.classList.remove("hidden"):e.parentElement.classList.add("hidden"),r&&t?e.setAttribute("open",""):e.removeAttribute("open")}resetTree(e){e.parentElement.classList.remove("hidden"),e.removeAttribute("open")}filterTree(){let t=setTimeout(()=>{for(const e of this.querySelectorAll("[data-branch-values]"))void 0===this.filter.value||0===this.filter.value.length?this.resetTree(e):this.applyFilter(e);clearTimeout(t)},10)}setFilter(e){const t=e||{};try{switch(typeof t){case"string":t.includes("{")?(this.filter=JSON.parse(t),!1===this.filter.caseSensitive&&(this.filter.value=this.filter.value.toLowerCase())):this.filter.value=e.toLowerCase();break;case"object":this.filter=t}}catch(e){console.log(e)}this.filterTree()}createLeafText(e){var t,r;let n="",s="";return"string"==typeof e&&(e.includes("(")||e.includes("["))?(r=e.indexOf("("),r=-1===(t=e.indexOf("["))?r:t,n=this.convertJsonKeyToTitle(e.substring(0,r)),s=e.substring(r)):n=this.convertJsonKeyToTitle(e),{titleText:n,commentText:s}}createTextTag(n,s){n=this.createLeafText(n);if(n.commentText){let e=document.createElement("div"),t=document.createElement("span"),r=(t.innerText=n.titleText,document.createElement("small"));r.innerText=n.commentText,r.style.marginLeft="1rem",e.append(t,r),e.style.display="inline-flex",e.style.alignItems="center",s.append(e)}else s.innerText=n.titleText}createLeaf(e,t,r,n=[]){let s=document.createElement("li");s.classList.add("cursor-no-select"),s.style.marginTop="0.4rem",s.dataset.branchKey=r;const i="file"===this.iconSet?'':'';s.style.listStyleImage=`url('data:image/svg+xml,${i}')`,s.style.position="relative",s.style.left="2px";let o=document.createElement("span");r=[e].concat(n);if(o.dataset.branchValues=[...new Set(r)].join(),n.length&&(o.dataset.leafKey=r[0]),this.createTextTag(e,o),o.style.position="relative",o.style.top="-3px",s.append(o),t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);const i="file"===this.iconSet?G:H;e.style.listStyleImage=`url('data:image/svg+xml,${i}')`,e.append(s),t.append(e)}else t.append(s)}createBranch(r,t,n,s){if(s===this.maxDepth&&"object"==typeof r)for(const o of Array.isArray(r)?r:Object.keys(r)){let e;r[o]&&(e=this._jsonToValueArray(r[o])),this.createLeaf(o,t,n+"."+o,e)}else if(Array.isArray(r))for(var e in r){var u=document.createElement(this.listType);t.append(this.createBranch(r[e],u,n+"."+e,s+1))}else if(null!==r&&"object"==typeof r){const a=[];for(const l of Object.keys(r)){let e=document.createElement("li"),t=(e.classList.add("cursor-no-select"),e.style.position="relative",e.style.left="2px",e.dataset.branchKey=n+"."+l,document.createElement("details"));t.classList.add("flk-branch"),t.dataset.branchValues=[l].concat(this._jsonToValueArray(r[l])),t.style.position="relative",t.style.top="-3px",t.classList.add("cursor-default");var i=document.createElement("summary");this.createTextTag(l,i),t.append(i),e.append(this.createBranch(r[l],t,n+"."+l,s+1)),a.push(e)}if(t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);var h="file"===this.iconSet?G:H;e.style.listStyleImage=`url('data:image/svg+xml,${h}')`;for(const c of a)e.append(c);t.append(e)}else for(const p of a)t.append(p)}else this.createLeaf(r,t,n);return t}createHtml(){let e=document.createElement(this.listType);var t="file"===this.iconSet?G:'';if(e.style.listStyleImage=`url('data:image/svg+xml,${t}')`,e.style.marginLeft="3rem",this.contents.length){for(const r in this.contents)e=this.createBranch(this.contents[r],e,r,0);this.component=e}else this.component=e}attributeChangedCallback(e,t,r){switch(e){case"contents":this.setContents(r);break;case"icon-set":this.iconSet=r;break;case"max-depth":this.maxDepth="string"==typeof r?parseInt(r):r;break;case"filter":this.setFilter(r)}this.init()}connectedCallback(){this.init()}disconnectedCallback(){this.base.removeEvents(this)}init(){this.createHtml(),this.base.render(this)}}customElements.define("flk-table",W),customElements.define("flk-draggable",J),customElements.define("flk-modal",q),customElements.define("flk-dropdown",K),customElements.define("flk-tree-nav",qn)}(require$$0,require$$2,require$$1$1,require$$1); \ No newline at end of file +!function(){"use strict";var a,c,g,e;(e=a=a||{}).Date="date",e.String="string",e.Float="float",e.Number="number",e.Array="array",e.Object="object",e.Bool="bool",e.Currency="currency",e.Undefined="undefined",e.Null="null";const l={date:/^(\d{1,4}-\d{1,4}-\d{1,4}(T)?)/gim,currency:/^[$|€]\s?[0-9]*(\.|,)?\d*(\.|,)?\d*/gim,float:/\d+[,|.]\d+[,|.]?\d*/gim,currencySign:/\$|€/gim,array:/^\s?[[].[^,]+[\]],?/gi,precision:/[-+$€,.]/gm,string:/[a-zA-Z]/gim},h=e=>{return null===e||"null"===e?a.Null:e||0===e||!1===e?null===new RegExp(l.date).exec(e)||isNaN(Date.parse(e))?new RegExp(l.currency).exec(e)?a.Currency:!new RegExp(l.string).exec(e)&&new RegExp(l.float).exec(e.toString())?a.Float:isNaN(e)&&0!==e?Array.isArray(e)?a.Array:"object"==typeof e?a.Object:a.String:a.Number:a.Date:a.Undefined},u=(t,e)=>{const s={value:void 0,type:e=e||h(t),currencySign:""};switch(s.type){case a.String:s.value=t.toString();break;case a.Float:case a.Currency:var r=(t=t.toString()).match(new RegExp(/(,)/gim)),n=t.match(new RegExp(/(\.)/gim));if(r)for(let e=1;e<=r.length;e++)t=e!==r.length||n?t.replace(",",""):t.replace(",",".");if(s.type===a.Currency){const o=new RegExp(l.currencySign);var i=o.exec(t);s.currencySign=null!==i?i[0]:"",t=t.replace(o,"")}s.value=parseFloat(t).toPrecision(12);break;case a.Number:s.value=Number(t);break;case a.Date:s.value=Date.parse(t);break;case a.Array:t.length?"object"==typeof t[0]?s.value=t.map(e=>JSON.stringify(e)).join(", "):s.value=t.join(", "):s.value="";break;case a.Object:s.value=t;break;case a.Undefined:s.value="";break;case a.Null:s.value=null}return s};function v(e,t){var s;let r;for(s of e.split("."))s=s.trim(),r?"object"!=typeof r||Array.isArray(r)||(r=r[s]):r=t[s];return r}const m=(e,t)=>tet<=e,w=(e,t)=>e<=t,k=(e,t,s)=>s?e.toLowerCase()==t.toLowerCase():e==t,E=(e,t)=>e===t,_=(e,t)=>e!=t,x=(e,t)=>e!==t,A=(e,t)=>null!=t&&"string"==typeof e&&0<=e.toLowerCase().indexOf(t.toString().toLowerCase()),L=(e,t)=>null!=t&&0<=e.toString().toLowerCase().indexOf(t.toString().toLowerCase()),T=(e,t)=>null!=t&&"string"==typeof e&&e.toLowerCase().indexOf(t.toString().toLowerCase())<0;function t(s,r){if(0===r.length)return s;{var n=s;const o=[],a=[];let e=[];for(const l of r)l.type&&l.type!==c.And?(e.length&&a.push(e),e=[l]):e.push(l);a.push(e);let t=[];for(const e of a)t=t.concat(C(n,e));t=[...new Set(t)];var i=n.length;for(let e=0;e":return m;case"<":return f;case">=":return b;case"<=":return w;case"is":case"==":return k;case"!is":case"!=":return _;case"===":return E;case"!==":return x;case"like":case"~":case"contains":return A;case"!contains":case"!like":case"!~":return T;default:return L}}(a.operator);if(!l(i,o,a.ignoreCase)){e=!1;break}}e&&s.push(r)}return s};function s(e,t){if(!t||0===t.length)return e;if(1{if(0===s.length)s=s.concat(o(n,e));else{for(const t of s)r=r.concat(o(t,e));s=r,r=[]}}),s}return o(e,t[0])}function o(e,t){const s=[],r=[];do{if(!e||0===e.length)break;var n=e.shift();if(!n)break;const o=n[t];var i=r.indexOf(o.toString());0<=i?s[i].push(n):(r.push(o.toString()),void 0!==s[r.length-1]?s[r.length-1].push(n):s.push([n]))}while(0{if(t){var s=e;const r={};for(const n of t){let e=s.map(e=>e[n].toString());const i=e.map(e=>h(e));i.some(e=>e===a.Float)?(e=e.map(e=>parseFloat(e)),r[n]=parseFloat(e.reduce((e,t)=>e+t).toFixed(2))):(e=e.map(e=>parseInt(e)),r[n]=e.reduce((e,t)=>e+t))}return r}return{}};class S{model;sortDetails=[];filterDetails=[];selection=[];groupByProperties=[];distinctProperties=[];concatenationToken=", ";constructor(e){this.model=JSON.parse(JSON.stringify(e))}sort(e){return this.sortDetails=e,this}orderBy(e,t){return this.sortDetails.push({propertyName:e,direction:t}),this}thenOrderBy(e,t){return this.orderBy(e,t)}filter(e){return Array.isArray(e)?this.filterDetails=e:this.filterDetails.push(e),this}where(e,t,s,r,n){return this.filterDetails.push({propertyName:e,operator:t,value:s,type:r,ignoreCase:n}),this}andWhere(e,t,s,r){return this.where(e,t,s,c.And,r),this}orWhere(e,t,s,r){return this.where(e,t,s,c.Or,r),this}group(e){return this.groupByProperties=e,this}groupBy(e){return this.groupByProperties.push(e),this}thenGroupBy(e){return this.groupByProperties.push(e),this}select(e){return Array.isArray(e)?this.selection=e:"*"!==e&&(this.selection=[e]),this}distinct(e,t){return t&&(this.concatenationToken=t),Array.isArray(e)?this.distinctProperties=e:e&&(this.distinctProperties=[e]),this}execute(){return s(function(t,s){if(0===s.length)return t;{var r=s;let e=[];for(const n of t){const i={};for(const o of r)i[o]=n[o];e.push(i)}return e}}(function(s,r,d){if(!r||!r.length)return s;const n=[],h=[];for(const m of s){const o={};let t="";for(const e of r){var u=v(e,m);o[e]=u,t+=u}if(!h.includes(t)){let e=s;for(const a of Object.keys(o))e=e.filter(e=>e[a]===o[a]);h.push(t),n.push(e)}}const t=[];for(const f of n){let e={};for(const l of f){var i,p=Object.keys(e);if(p.length)for(const c of p)r.includes(c)||(i=e[c],Array.isArray(i)?(i=l[c],Array.isArray(i)?e[c]=[...new Set(...e[c].concat(l[c]))]:e[c].includes(l[c])||e[c].push(l[c])):isNaN(e[c])&&isNaN(l[c])?e[c]!==l[c]&&(e[c]=[e[c],l[c]]):e[c]=e[c]+l[c]);else e=l}t.push(e)}return t.forEach(e=>{for(const t in e)Array.isArray(e[t])&&(e[t]=e[t].join(d))}),t}(r(t(JSON.parse(JSON.stringify(this.model)),this.filterDetails),this.sortDetails),this.distinctProperties,this.concatenationToken),this.selection),this.groupByProperties)}sum(e,t){e=Array.isArray(e)?e:[e];return i(t||this.model,e)}}function I(e,t){t=t?t.toUpperCase():"FLK-";return e.toUpperCase().includes(t)}function d(e,t){var{timeStamp:s,type:r,x:n,y:i}=e;let o=e.target;do{if(!o||"HTML"===o.tagName||I(o.tagName,t)){"HTML"===o.tagName&&(o=null);break}}while(o=o.parentNode||o.parentElement,!I(o.tagName,t));return{target:o,timeStamp:s,type:r,x:n,y:i}}function B(e,t){let s=e.target,r="";for(;s.dataset[t]?r=s.dataset[t]:s=s.parentNode,!r;);return r}class n{constructor(){}_topLevelClasses=[];_events=[];generateId(){return"flk-"+function e(){const t=([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)),s=t.split("-")[0];return window.$flightkitUUIDStore||(window.$flightkitUUIDStore=[]),window.$flightkitUUIDStore.some(e=>e===s)?e():(window.$flightkitUUIDStore.push(s),s)}()}render(t){if(!t.component)throw new Error("Component is not assigned! Can't render");t.id=t.id||this.generateId();var e=this._getAllEventAttributes(t);if(e){var s="#"+t.id;for(const i of e){var r="e-"+i;this.addEvent(s,i,t.getAttribute(r))}}var n=Object.keys(t.classList).length;if(n){for(let e=0;e{this._assignToDom(t,t.component),clearTimeout(this._renderTimer)},10)}addEvent(e,t,s){this._events.push({selector:e,eventType:t,callback:s})}_getExternalCallback(e){let t=void 0;for(const s of e.split("."))t=(t||window)[s];return t}_getAllEventAttributes(e){e=e.attributes;const t=Array.from(e).filter(e=>e.name.startsWith("e-"));return t.map(e=>e.name.slice(2))}_isFlightkitElement(e){return e.toUpperCase().includes("FLK-")}_outerEventHandler(e){const t=d(e),s=(t.contents=e.detail,t.target.getAttribute("e-"+t.type));let r=void 0;for(const n of s.split("."))r=(r||window)[n];return e.preventDefault(),e.stopPropagation(),r(t)}_addEvents(e){if(e.isConnected)for(const s of this._events)if(s.selector.startsWith("."))for(const r of document.querySelectorAll(s.selector))this._addEventToElement(s,r);else{var t=document.querySelector(s.selector);this._addEventToElement(s,t)}}_addEventToElement(e,t){t&&("function"==typeof e.callback?(t.removeEventListener(e.eventType,e.callback),t.addEventListener(e.eventType,e.callback)):(t.removeEventListener(e.eventType,this._outerEventHandler),t.addEventListener(e.eventType,this._outerEventHandler)))}removeEvents(){for(const t of this._events)if(t.selector.startsWith("."))for(const s of document.querySelectorAll(t.selector))this._addEventToElement(t,s);else{var e=document.querySelector(t.selector);this._addEventToElement(t,e)}this._events=[]}_removeEventToElement(e,t){t&&("function"==typeof e.callback?t.removeEventListener(e.eventType,e.callback):t.removeEventListener(e.eventType,this._outerEventHandler))}_assignToDom(e,t){e.innerHTML="";for(const r of Array.isArray(t)?t:[t])e.append(r);const s=setTimeout(()=>{this._addEvents(e),clearTimeout(s)},10)}}const p='',N='';function D(e){const t=new DOMParser;return t.parseFromString(e,"image/svg+xml").documentElement}class O extends HTMLElement{base;component=null;_contents=[];_orderBy=[];properties=new Set;_columnOrder=[];_filter="";_selectionProperty="";_selectedIds=new Set;uniqueEntriesByProperties={};propertyLabelDictionary={};_templates={};_templateClasses={};static get observedAttributes(){return["contents","columns","order","filter","selection-property","templates"]}get columnOrder(){return this._columnOrder.length?this._columnOrder:this.properties}set columnOrder(e){let t;"string"==typeof e&&(t=e.split(",")),t=e,this._columnOrder=t}get contents(){return this._contents}set contents(e){this.analyzeData(e),this._contents=new S(e)}get orderBy(){return this._orderBy}set orderBy(e){if(Array.isArray(e))this._orderBy=e;else{const r=[];for(const n of e.split(",")){var t=n.split("|"),s=t[0],t=1e[s._selectionProperty])):new Set;e=t?s.contents.execute():[];s._emit("select",s,{selection:e}),s._updateCheckboxes(s)}emitSelect(e){var t=e.target.checked,s=e.target.dataset.objectId;const r=d(e).target,n=(t?r._selectedIds.add(s):r._selectedIds.delete(s),r._selectionProperty);e=r.contents.execute().filter(e=>r._selectedIds.has(e[n]));r._emit("select",r,{selection:e}),r._updateCheckboxes(r)}sortData(e){const t=d(e).target,s=B(e,"column");s&&(-1<(e=t._orderBy.findIndex(e=>e.propertyName===s))?"asc"===t._orderBy[e].direction?t._orderBy[e].direction="desc":t._orderBy.splice(e,1):t._orderBy.push({propertyName:s,direction:"asc"}),t.createHtml(),t.base.render(t))}setColumnOrder(e){this._columnOrder=e?Array.isArray(e)?e:e.split(","):[]}analyzeData(t){this.properties=new Set;var s=t.length;for(let e=0;e"_"===e?" ":" "+e.toLowerCase()).trim();var s=t.charAt(0).toUpperCase()+t.slice(1);return this.propertyLabelDictionary[e]=s}parseTemplate(e,r){return e.replace(/\{\{([\s\S]+?)\}\}/gim,(e,t)=>{let s="";t=t.trim();t=r[t];return t&&(s=t),Array.isArray(s)?s.join(", "):s.toString().trim()})}createSelectionCheckbox(e){const t=document.createElement("input");return t.setAttribute("type","checkbox"),t.classList.add("flk-selection-checkbox"),e&&(t.dataset.selected=e[this._selectionProperty]),t}createRow(e){const t=document.createElement("tr");if(this._selectionProperty.length){const n=document.createElement("td");var s=this.base.generateId();const i=this.createSelectionCheckbox(e);i.id=s,i.dataset.objectId=e[this._selectionProperty];var r=e[this._selectionProperty];this._selectedIds.has(r)?i.checked=!0:i.checked=!1,this.base.addEvent("#"+s,"change",this.emitSelect),n.append(i),t.append(n)}for(const o of this.columnOrder){const a=document.createElement("td");this._templates[o]?(a.innerHTML=this.parseTemplate(this._templates[o],e),this._templateClasses[o]&&a.classList.add(...this._templateClasses[o])):a.innerText=e[o],t.append(a)}return t}createBody(e){const t=document.createElement("tbody");for(const r of e){var s=this.createRow(r,null);t.append(s)}return t}createHead(){const e=document.createElement("thead"),t=document.createElement("tr");if(t.classList.add("cursor-pointer"),this._selectionProperty.length){const n=document.createElement("th");var s=this.base.generateId();const i=this.createSelectionCheckbox();i.id=s;var d=this.contents.execute().length;0e.propertyName===o);if(r){const c=document.createElement("span");c.innerHTML="asc"===r.direction?'':'',a.append(c)}t.append(a)}return e.append(t),e}addEvent(e,t,s){this.base.addEvent(e,t,s)}init(){this.createHtml(),this.base.render(this)}}class j extends HTMLElement{base;componentId;constructor(){super(),this.base=new n}connectedCallback(){var e=this.getAttribute("top"),t=this.getAttribute("left"),s=this.getAttribute("center"),r=this.getAttribute("zIndex");this.id||(this.id=this.base.generateId()),this.style.display="block",this.style.position="fixed","string"==typeof s?(this.style.top=e||"50%",this.style.left="50%",this.style.transform="translate(-50%, -50%)"):(this.style.top=e||this.clientTop+"px",this.style.left=t||this.clientLeft+"px"),r&&(this.style.zIndex=r),this.componentId=this.getAttribute("handle");const n=document.createElement("div");n.innerHTML=this.innerHTML,this.component=n;s="#"+(this.componentId||this.id);this.base.addEvent(s,"mousedown",this._dragElement),this.base.addEvent(s,"mouseup",this._reset),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this)}_dragElement(e){const s=d(e,"flk-draggable").target;let r,n;function t(e){r=e.clientX-s.offsetLeft,n=e.clientY-s.offsetTop}function i(e){var t=e.clientX-r,e=e.clientY-n;s.style.left=t+"px",s.style.top=e+"px"}function o(e){e.preventDefault()}function a(){s.removeAttribute("draggable"),s.removeEventListener("dragstart",t),s.removeEventListener("dragend",a),document.removeEventListener("dragover",o),document.removeEventListener("drop",i)}s.setAttribute("draggable",!0),s.addEventListener("dragstart",t),s.addEventListener("dragend",a),document.addEventListener("dragover",o),document.addEventListener("drop",i)}}class M extends HTMLElement{_id;base;_draggableId;constructor(){super(),this.base=new n}_emit(e,t,s){e=new CustomEvent(e,{detail:s,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}_closeModal(e){e.stopPropagation();const t=d(e,"flk-modal").target;t.classList.add("hidden")}closeModal(e){this.classList.add("hidden")}openModal(e=!0){const t=document.getElementById(this._draggableId);e&&(t.style.top="40%",t.style.left="50%"),this.classList.remove("hidden")}connectedCallback(){this.id||(this.id=this.base.generateId());const e=document.createElement("div");var t=this.base.generateId();const s=document.createElement("flk-draggable"),r=(this._draggableId=this.base.generateId(),s.id=this._draggableId,s.setAttribute("center",""),s.setAttribute("top","40%"),s.setAttribute("handle",t),s.setAttribute("zIndex","1080"),s.classList.add("border","shadow-lg","bg-white"),s.style.width="max-content",document.createElement("div"));var n=this.getAttribute("modal-title");if(n){const c=document.createElement("span");c.innerText=n,c.classList.add("ml-1","mr-auto"),r.append(c)}r.id=t;const i=this.getAttribute("header-class");let o=[];i?o=o.concat(i.split(" ")):o.push("bg-gray-light"),r.classList.add(...o,"border-bottom","row","justify-end","cursor-no-select");n=this.base.generateId();const a=document.createElement("button"),l=(a.classList.add("py-0","px-1","outline-hover","no-border","cursor-default",...o),a.innerText="X",a.id=n,r.append(a),s.append(r),document.createElement("div"));l.innerHTML=this.innerHTML,s.append(l),e.append(s),this.component=e,this.base.addEvent("#"+n,"click",this._closeModal),this.base.render(this),this.classList.add("hidden")}disconnectedCallback(){this.base.removeEvents(this)}}class H extends HTMLElement{base;_buttonId;_drawerId;_iconId;constructor(){super(),this.base=new n}connectedCallback(){this.style.position="relative",this.style.display="flex",this.style.width="fit-content",this._buttonId=this.base.generateId();const e=document.createElement("button"),t=(e.classList.add("row"),e.id=this._buttonId,document.createElement("span")),s=(t.innerText=this.getAttribute("text"),this._iconId=this.base.generateId(),document.createElement("span"));var r=D('');const n=D(''),i=(n.classList.add("hidden"),s.append(r,n),s.id=this._iconId,e.append(t,s),this._drawerId=this.base.generateId(),document.createElement("div"));i.id=this._drawerId,i.classList.add("shadow","inline-block","bg-white"),i.style.position="absolute",i.style.zIndex="1040";r=this.querySelector("template");r.innerHTML.length?i.innerHTML=r.innerHTML:i.append(r.firstChild),i.style.display="none",this.component=[e,i],this.base.addEvent("#"+this._buttonId,"click",this.toggleMenu);const o=document.querySelector("body");""!==o.getAttribute("flk-close-dropdown")&&(o.setAttribute("flk-close-dropdown",""),o.addEventListener("click",this.closeAllDropdownButtons)),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this);var e=document.querySelectorAll("flk-dropdown");if(!e||!e.length){const t=document.querySelector("body");t.removeAttribute("flk-close-dropdown"),t.removeEventListener("click",this.closeAllDropdownButtons)}}toggleMenu(e){const t=d(e).target;e=t._drawerId;const s=document.getElementById(e);var e="none"!==s.style.display,r=(s.style.display=e?"none":"block",t.getAttribute("drawer-width")),r=("string"==typeof t.getAttribute("right")&&(s.style.right="0px"),s.style.top=t.offsetHeight+"px",s.style.width=r||t.offsetWidth+"px",t._iconId);const n=document.getElementById(r);e?(n.childNodes[0].classList.remove("hidden"),n.childNodes[1].classList.add("hidden")):(n.childNodes[0].classList.add("hidden"),n.childNodes[1].classList.remove("hidden"))}_closeDropdown(){var e=this._drawerId;const t=document.getElementById(e);if("none"!==t.style.display){e=this._iconId;const s=document.getElementById(e);t.style.display="none",s.childNodes[0].classList.remove("hidden"),s.childNodes[1].classList.add("hidden")}}closeAllDropdownButtons(e){var t,s=d(e,"flk-dropdown").target,e=document.querySelectorAll("flk-dropdown");if(s)for(const r of e)s._buttonId!==r._buttonId&&(t=r._drawerId,"none"!==document.getElementById(t).style.display&&r._closeDropdown());else for(const n of e)n._closeDropdown()}}class P extends HTMLElement{base;contents;component;listType="ul";iconSet;filter={value:"",caseSensitive:!1};static get observedAttributes(){return["contents","icon-set","max-depth","filter"]}_jsonToValueArray(e){let t=JSON.stringify(e);t=t.replace(/[\[\]{}\"]/g,"");let s=[];for(const r of t.split(","))s=s.concat(r.split(":"));return[...new Set(s)]}_emit(e,t,s){e=new CustomEvent(e,{detail:s,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}constructor(){super(),this.base=new n,this.setContents(this.getAttribute("contents")),this.iconSet=this.getAttribute("icon-set")?this.getAttribute("icon-type"):"file",this.maxDepth=this.getAttribute("max-depth")?parseInt(this.getAttribute("max-depth")):-1,this.setFilter(this.getAttribute("filter")),this.style.display="block",this.style.maxWidth="fit-content",this.style.margin="0 1rem 0 0",this.base.addEvent(".flk-branch","click",this.emitNodeToggle)}emitNodeToggle(e){e.stopPropagation();const t=d(e,"flk-tree-nav").target,s=B(e,"branchKey");let r=t.contents;const n=s.split(".");for(const o of n)if(r[o])r=r[o];else if(null===r[o])r=null;else{let e=[];for(const a of r)a[o]&&e.push(a[o]);r=e}var e=s.substring(s.indexOf(".")+1),i=t.createLeafText(n.reverse()[0]);t._emit("tree-click",t,{path:e,data:r,key:(i.titleText+" "+i.commentText).trim(),branch:"object"==typeof r})}convertJsonKeyToTitle(e){if(!e)return"";const t=(e="string"!=typeof e?e.toString():e).replace(/([A-Z_])/g,e=>"_"===e?" ":" "+e).trim();return t.charAt(0).toUpperCase()+t.slice(1)}setContents(e){var t=e||this.contents||[];try{switch(typeof t){case"string":this.contents=JSON.parse(t);break;case"object":Array.isArray(t)?this.contents=t:this.contents=[t]}}catch(e){console.log(e)}}applyFilter(e){let t;var s="details"===e.tagName.toLowerCase();t=this.filter.caseSensitive?e.dataset.branchValues.includes(this.filter.value):e.dataset.branchValues.toLowerCase().includes(this.filter.value.toLowerCase()),t?e.parentElement.classList.remove("hidden"):e.parentElement.classList.add("hidden"),s&&t?e.setAttribute("open",""):e.removeAttribute("open")}resetTree(e){e.parentElement.classList.remove("hidden"),e.removeAttribute("open")}filterTree(){let t=setTimeout(()=>{for(const e of this.querySelectorAll("[data-branch-values]"))void 0===this.filter.value||0===this.filter.value.length?this.resetTree(e):this.applyFilter(e);clearTimeout(t)},10)}setFilter(e){const t=e||{};try{switch(typeof t){case"string":t.includes("{")?(this.filter=JSON.parse(t),!1===this.filter.caseSensitive&&(this.filter.value=this.filter.value.toLowerCase())):this.filter.value=e.toLowerCase();break;case"object":this.filter=t}}catch(e){console.log(e)}this.filterTree()}createLeafText(e){var t,s;let r="",n="";return"string"==typeof e&&(e.includes("(")||e.includes("["))?(s=e.indexOf("("),s=-1===(t=e.indexOf("["))?s:t,r=this.convertJsonKeyToTitle(e.substring(0,s)),n=e.substring(s)):r=this.convertJsonKeyToTitle(e),{titleText:r,commentText:n}}createTextTag(r,n){r=this.createLeafText(r);if(r.commentText){let e=document.createElement("div"),t=document.createElement("span"),s=(t.innerText=r.titleText,document.createElement("small"));s.innerText=r.commentText,s.style.marginLeft="1rem",e.append(t,s),e.style.display="inline-flex",e.style.alignItems="center",n.append(e)}else n.innerText=r.titleText}createLeaf(e,t,s,r=[]){let n=document.createElement("li");n.classList.add("cursor-no-select"),n.style.marginTop="0.4rem",n.dataset.branchKey=s;const i="file"===this.iconSet?'':'';n.style.listStyleImage=`url('data:image/svg+xml,${i}')`,n.style.position="relative",n.style.left="2px";let o=document.createElement("span");s=[e].concat(r);if(o.dataset.branchValues=[...new Set(s)].join(),r.length&&(o.dataset.leafKey=s[0]),this.createTextTag(e,o),o.style.position="relative",o.style.top="-3px",n.append(o),t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);const i="file"===this.iconSet?p:N;e.style.listStyleImage=`url('data:image/svg+xml,${i}')`,e.append(n),t.append(e)}else t.append(n)}createBranch(s,t,r,n){if(n===this.maxDepth&&"object"==typeof s)for(const o of Array.isArray(s)?s:Object.keys(s)){let e;s[o]&&(e=this._jsonToValueArray(s[o])),this.createLeaf(o,t,r+"."+o,e)}else if(Array.isArray(s))for(var e in s){var d=document.createElement(this.listType);t.append(this.createBranch(s[e],d,r+"."+e,n+1))}else if(null!==s&&"object"==typeof s){const a=[];for(const l of Object.keys(s)){let e=document.createElement("li"),t=(e.classList.add("cursor-no-select"),e.style.position="relative",e.style.left="2px",e.dataset.branchKey=r+"."+l,document.createElement("details"));t.classList.add("flk-branch"),t.dataset.branchValues=[l].concat(this._jsonToValueArray(s[l])),t.style.position="relative",t.style.top="-3px",t.classList.add("cursor-default");var i=document.createElement("summary");this.createTextTag(l,i),t.append(i),e.append(this.createBranch(s[l],t,r+"."+l,n+1)),a.push(e)}if(t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);var h="file"===this.iconSet?p:N;e.style.listStyleImage=`url('data:image/svg+xml,${h}')`;for(const c of a)e.append(c);t.append(e)}else for(const u of a)t.append(u)}else this.createLeaf(s,t,r);return t}createHtml(){let e=document.createElement(this.listType);var t="file"===this.iconSet?p:'';if(e.style.listStyleImage=`url('data:image/svg+xml,${t}')`,e.style.marginLeft="3rem",this.contents.length){for(const s in this.contents)e=this.createBranch(this.contents[s],e,s,0);this.component=e}else this.component=e}attributeChangedCallback(e,t,s){switch(e){case"contents":this.setContents(s);break;case"icon-set":this.iconSet=s;break;case"max-depth":this.maxDepth="string"==typeof s?parseInt(s):s;break;case"filter":this.setFilter(s)}this.init()}connectedCallback(){this.init()}disconnectedCallback(){this.base.removeEvents(this)}init(){this.createHtml(),this.base.render(this)}}customElements.define("flk-table",O),customElements.define("flk-draggable",j),customElements.define("flk-modal",M),customElements.define("flk-dropdown",H),customElements.define("flk-tree-nav",P)}(); \ No newline at end of file diff --git a/docs/js/flightkit.min.js b/docs/js/flightkit.min.js index 9a82b7a..930836a 100644 --- a/docs/js/flightkit.min.js +++ b/docs/js/flightkit.min.js @@ -1 +1 @@ -!function(e,n,s,i){"use strict";function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a,u,g,e=c(e),n=c(n),s=c(s),i=c(i);(t=a=a||{}).Date="date",t.String="string",t.Float="float",t.Number="number",t.Array="array",t.Object="object",t.Bool="bool",t.Currency="currency",t.Undefined="undefined",t.Null="null";const h={date:/^(\d{1,4}-\d{1,4}-\d{1,4}(T)?)/gim,currency:/^[$|€]\s?[0-9]*(\.|,)?\d*(\.|,)?\d*/gim,float:/\d+[,|.]\d+[,|.]?\d*/gim,currencySign:/\$|€/gim,array:/^\s?[[].[^,]+[\]],?/gi,precision:/[-+$€,.]/gm,string:/[a-zA-Z]/gim},m=e=>{return null===e||"null"===e?a.Null:e||0===e||!1===e?null===new RegExp(h.date).exec(e)||isNaN(Date.parse(e))?new RegExp(h.currency).exec(e)?a.Currency:!new RegExp(h.string).exec(e)&&new RegExp(h.float).exec(e.toString())?a.Float:isNaN(e)&&0!==e?Array.isArray(e)?a.Array:"object"==typeof e?a.Object:a.String:a.Number:a.Date:a.Undefined},y=(t,e)=>{const r={value:void 0,type:e=e||m(t),currencySign:""};switch(r.type){case a.String:r.value=t.toString();break;case a.Float:case a.Currency:var n=(t=t.toString()).match(new RegExp(/(,)/gim)),s=t.match(new RegExp(/(\.)/gim));if(n)for(let e=1;e<=n.length;e++)t=e!==n.length||s?t.replace(",",""):t.replace(",",".");if(r.type===a.Currency){const o=new RegExp(h.currencySign);var i=o.exec(t);r.currencySign=null!==i?i[0]:"",t=t.replace(o,"")}r.value=parseFloat(t).toPrecision(12);break;case a.Number:r.value=Number(t);break;case a.Date:r.value=Date.parse(t);break;case a.Array:t.length?"object"==typeof t[0]?r.value=t.map(e=>JSON.stringify(e)).join(", "):r.value=t.join(", "):r.value="";break;case a.Object:r.value=t;break;case a.Undefined:r.value="";break;case a.Null:r.value=null}return r};function v(e,t){var r;let n;for(r of e.split("."))r=r.trim(),n?"object"!=typeof n||Array.isArray(n)||(n=n[r]):n=t[r];return n}const b=(e,t)=>tet<=e,S=(e,t)=>e<=t,x=(e,t,r)=>r?e.toLowerCase()==t.toLowerCase():e==t,A=(e,t)=>e===t,k=(e,t)=>e!=t,E=(e,t)=>e!==t,L=(e,t)=>null!=t&&"string"==typeof e&&0<=e.toLowerCase().indexOf(t.toString().toLowerCase()),O=(e,t)=>null!=t&&0<=e.toString().toLowerCase().indexOf(t.toString().toLowerCase()),M=(e,t)=>null!=t&&"string"==typeof e&&e.toLowerCase().indexOf(t.toString().toLowerCase())<0;function P(r,n){if(0===n.length)return r;{var s=r;const o=[],a=[];let e=[];for(const l of n)l.type&&l.type!==u.And?(e.length&&a.push(e),e=[l]):e.push(l);a.push(e);let t=[];for(const e of a)t=t.concat(R(s,e));t=[...new Set(t)];var i=s.length;for(let e=0;e":return b;case"<":return _;case">=":return C;case"<=":return S;case"is":case"==":return x;case"!is":case"!=":return k;case"===":return A;case"!==":return E;case"like":case"~":case"contains":return L;case"!contains":case"!like":case"!~":return M;default:return O}}(a.operator);if(!l(i,o,a.ignoreCase)){e=!1;break}}e&&r.push(n)}return r};function T(e,t){if(!t||0===t.length)return e;if(1{if(0===r.length)r=r.concat(I(s,e));else{for(const t of r)n=n.concat(I(t,e));r=n,n=[]}}),r}return I(e,t[0])}function I(e,t){const r=[],n=[];do{if(!e||0===e.length)break;var s=e.shift();if(!s)break;const o=s[t];var i=n.indexOf(o.toString());0<=i?r[i].push(s):(n.push(o.toString()),void 0!==r[n.length-1]?r[n.length-1].push(s):r.push([s]))}while(0{if(t){var r=e;const n={};for(const s of t){let e=r.map(e=>e[s].toString());const i=e.map(e=>m(e));i.some(e=>e===a.Float)?(e=e.map(e=>parseFloat(e)),n[s]=parseFloat(e.reduce((e,t)=>e+t).toFixed(2))):(e=e.map(e=>parseInt(e)),n[s]=e.reduce((e,t)=>e+t))}return n}return{}};class D{model;sortDetails=[];filterDetails=[];selection=[];groupByProperties=[];distinctProperties=[];concatenationToken=", ";constructor(e){this.model=JSON.parse(JSON.stringify(e))}sort(e){return this.sortDetails=e,this}orderBy(e,t){return this.sortDetails.push({propertyName:e,direction:t}),this}thenOrderBy(e,t){return this.orderBy(e,t)}filter(e){return Array.isArray(e)?this.filterDetails=e:this.filterDetails.push(e),this}where(e,t,r,n,s){return this.filterDetails.push({propertyName:e,operator:t,value:r,type:n,ignoreCase:s}),this}andWhere(e,t,r,n){return this.where(e,t,r,u.And,n),this}orWhere(e,t,r,n){return this.where(e,t,r,u.Or,n),this}group(e){return this.groupByProperties=e,this}groupBy(e){return this.groupByProperties.push(e),this}thenGroupBy(e){return this.groupByProperties.push(e),this}select(e){return Array.isArray(e)?this.selection=e:"*"!==e&&(this.selection=[e]),this}distinct(e,t){return t&&(this.concatenationToken=t),Array.isArray(e)?this.distinctProperties=e:e&&(this.distinctProperties=[e]),this}execute(){return T(function(t,r){if(0===r.length)return t;{var n=r;let e=[];for(const s of t){const i={};for(const o of n)i[o]=s[o];e.push(i)}return e}}(function(r,n,u){if(!n||!n.length)return r;const s=[],h=[];for(const f of r){const o={};let t="";for(const e of n){var p=v(e,f);o[e]=p,t+=p}if(!h.includes(t)){let e=r;for(const a of Object.keys(o))e=e.filter(e=>e[a]===o[a]);h.push(t),s.push(e)}}const t=[];for(const m of s){let e={};for(const l of m){var i,d=Object.keys(e);if(d.length)for(const c of d)n.includes(c)||(i=e[c],Array.isArray(i)?(i=l[c],Array.isArray(i)?e[c]=[...new Set(...e[c].concat(l[c]))]:e[c].includes(l[c])||e[c].push(l[c])):isNaN(e[c])&&isNaN(l[c])?e[c]!==l[c]&&(e[c]=[e[c],l[c]]):e[c]=e[c]+l[c]);else e=l}t.push(e)}return t.forEach(e=>{for(const t in e)Array.isArray(e[t])&&(e[t]=e[t].join(u))}),t}(B(P(JSON.parse(JSON.stringify(this.model)),this.filterDetails),this.sortDetails),this.distinctProperties,this.concatenationToken),this.selection),this.groupByProperties)}sum(e,t){e=Array.isArray(e)?e:[e];return j(t||this.model,e)}}function U(e,t){t=t?t.toUpperCase():"FLK-";return e.toUpperCase().includes(t)}function F(e,t){var{timeStamp:r,type:n,x:s,y:i}=e;let o=e.target;do{if(!o||"HTML"===o.tagName||U(o.tagName,t)){"HTML"===o.tagName&&(o=null);break}}while(o=o.parentNode||o.parentElement,!U(o.tagName,t));return{target:o,timeStamp:r,type:n,x:s,y:i}}function z(e,t){let r=e.target,n="";for(;r.dataset[t]?n=r.dataset[t]:r=r.parentNode,!n;);return n}class ${constructor(){}_topLevelClasses=[];_events=[];generateId(){return"flk-"+function e(){const t=([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)),r=t.split("-")[0];return window.$flightkitUUIDStore||(window.$flightkitUUIDStore=[]),window.$flightkitUUIDStore.some(e=>e===r)?e():(window.$flightkitUUIDStore.push(r),r)}()}render(t){if(!t.component)throw new Error("Component is not assigned! Can't render");t.id=t.id||this.generateId();var e=this._getAllEventAttributes(t);if(e){var r="#"+t.id;for(const i of e){var n="e-"+i;this.addEvent(r,i,t.getAttribute(n))}}var s=Object.keys(t.classList).length;if(s){for(let e=0;e{this._assignToDom(t,t.component),clearTimeout(this._renderTimer)},10)}addEvent(e,t,r){this._events.push({selector:e,eventType:t,callback:r})}_getExternalCallback(e){let t=void 0;for(const r of e.split("."))t=(t||window)[r];return t}_getAllEventAttributes(e){e=e.attributes;const t=Array.from(e).filter(e=>e.name.startsWith("e-"));return t.map(e=>e.name.slice(2))}_isFlightkitElement(e){return e.toUpperCase().includes("FLK-")}_outerEventHandler(e){const t=F(e),r=(t.contents=e.detail,t.target.getAttribute("e-"+t.type));let n=void 0;for(const s of r.split("."))n=(n||window)[s];return e.preventDefault(),e.stopPropagation(),n(t)}_addEvents(e){if(e.isConnected)for(const r of this._events)if(r.selector.startsWith("."))for(const n of document.querySelectorAll(r.selector))this._addEventToElement(r,n);else{var t=document.querySelector(r.selector);this._addEventToElement(r,t)}}_addEventToElement(e,t){t&&("function"==typeof e.callback?(t.removeEventListener(e.eventType,e.callback),t.addEventListener(e.eventType,e.callback)):(t.removeEventListener(e.eventType,this._outerEventHandler),t.addEventListener(e.eventType,this._outerEventHandler)))}removeEvents(){for(const t of this._events)if(t.selector.startsWith("."))for(const r of document.querySelectorAll(t.selector))this._addEventToElement(t,r);else{var e=document.querySelector(t.selector);this._addEventToElement(t,e)}this._events=[]}_removeEventToElement(e,t){t&&("function"==typeof e.callback?t.removeEventListener(e.eventType,e.callback):t.removeEventListener(e.eventType,this._outerEventHandler))}_assignToDom(e,t){e.innerHTML="";for(const n of Array.isArray(t)?t:[t])e.append(n);const r=setTimeout(()=>{this._addEvents(e),clearTimeout(r)},10)}}const G='',H='';function V(e){const t=new DOMParser;return t.parseFromString(e,"image/svg+xml").documentElement}class W extends HTMLElement{base;component=null;_contents=[];_orderBy=[];properties=new Set;_columnOrder=[];_filter="";_selectionProperty="";_selectedIds=new Set;uniqueEntriesByProperties={};propertyLabelDictionary={};_templates={};_templateClasses={};static get observedAttributes(){return["contents","columns","order","filter","selection-property","templates"]}get columnOrder(){return this._columnOrder.length?this._columnOrder:this.properties}set columnOrder(e){let t;"string"==typeof e&&(t=e.split(",")),t=e,this._columnOrder=t}get contents(){return this._contents}set contents(e){this.analyzeData(e),this._contents=new D(e)}get orderBy(){return this._orderBy}set orderBy(e){if(Array.isArray(e))this._orderBy=e;else{const n=[];for(const s of e.split(",")){var t=s.split("|"),r=t[0],t=1e[r._selectionProperty])):new Set;e=t?r.contents.execute():[];r._emit("select",r,{selection:e}),r._updateCheckboxes(r)}emitSelect(e){var t=e.target.checked,r=e.target.dataset.objectId;const n=F(e).target,s=(t?n._selectedIds.add(r):n._selectedIds.delete(r),n._selectionProperty);e=n.contents.execute().filter(e=>n._selectedIds.has(e[s]));n._emit("select",n,{selection:e}),n._updateCheckboxes(n)}sortData(e){const t=F(e).target,r=z(e,"column");r&&(-1<(e=t._orderBy.findIndex(e=>e.propertyName===r))?"asc"===t._orderBy[e].direction?t._orderBy[e].direction="desc":t._orderBy.splice(e,1):t._orderBy.push({propertyName:r,direction:"asc"}),t.createHtml(),t.base.render(t))}setColumnOrder(e){this._columnOrder=e?Array.isArray(e)?e:e.split(","):[]}analyzeData(t){this.properties=new Set;var r=t.length;for(let e=0;e"_"===e?" ":" "+e.toLowerCase()).trim();var r=t.charAt(0).toUpperCase()+t.slice(1);return this.propertyLabelDictionary[e]=r}parseTemplate(e,n){return e.replace(/\{\{([\s\S]+?)\}\}/gim,(e,t)=>{let r="";t=t.trim();t=n[t];return t&&(r=t),Array.isArray(r)?r.join(", "):r.toString().trim()})}createSelectionCheckbox(e){const t=document.createElement("input");return t.setAttribute("type","checkbox"),t.classList.add("flk-selection-checkbox"),e&&(t.dataset.selected=e[this._selectionProperty]),t}createRow(e){const t=document.createElement("tr");if(this._selectionProperty.length){const s=document.createElement("td");var r=this.base.generateId();const i=this.createSelectionCheckbox(e);i.id=r,i.dataset.objectId=e[this._selectionProperty];var n=e[this._selectionProperty];this._selectedIds.has(n)?i.checked=!0:i.checked=!1,this.base.addEvent("#"+r,"change",this.emitSelect),s.append(i),t.append(s)}for(const o of this.columnOrder){const a=document.createElement("td");this._templates[o]?(a.innerHTML=this.parseTemplate(this._templates[o],e),this._templateClasses[o]&&a.classList.add(...this._templateClasses[o])):a.innerText=e[o],t.append(a)}return t}createBody(e){const t=document.createElement("tbody");for(const n of e){var r=this.createRow(n,null);t.append(r)}return t}createHead(){const e=document.createElement("thead"),t=document.createElement("tr");if(t.classList.add("cursor-pointer"),this._selectionProperty.length){const s=document.createElement("th");var r=this.base.generateId();const i=this.createSelectionCheckbox();i.id=r;var u=this.contents.execute().length;0e.propertyName===o);if(n){const c=document.createElement("span");c.innerHTML="asc"===n.direction?'':'',a.append(c)}t.append(a)}return e.append(t),e}addEvent(e,t,r){this.base.addEvent(e,t,r)}init(){this.createHtml(),this.base.render(this)}}class J extends HTMLElement{base;componentId;constructor(){super(),this.base=new $}connectedCallback(){var e=this.getAttribute("top"),t=this.getAttribute("left"),r=this.getAttribute("center"),n=this.getAttribute("zIndex");this.id||(this.id=this.base.generateId()),this.style.display="block",this.style.position="fixed","string"==typeof r?(this.style.top=e||"50%",this.style.left="50%",this.style.transform="translate(-50%, -50%)"):(this.style.top=e||this.clientTop+"px",this.style.left=t||this.clientLeft+"px"),n&&(this.style.zIndex=n),this.componentId=this.getAttribute("handle");const s=document.createElement("div");s.innerHTML=this.innerHTML,this.component=s;r="#"+(this.componentId||this.id);this.base.addEvent(r,"mousedown",this._dragElement),this.base.addEvent(r,"mouseup",this._reset),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this)}_dragElement(e){const r=F(e,"flk-draggable").target;let n,s;function t(e){n=e.clientX-r.offsetLeft,s=e.clientY-r.offsetTop}function i(e){var t=e.clientX-n,e=e.clientY-s;r.style.left=t+"px",r.style.top=e+"px"}function o(e){e.preventDefault()}function a(){r.removeAttribute("draggable"),r.removeEventListener("dragstart",t),r.removeEventListener("dragend",a),document.removeEventListener("dragover",o),document.removeEventListener("drop",i)}r.setAttribute("draggable",!0),r.addEventListener("dragstart",t),r.addEventListener("dragend",a),document.addEventListener("dragover",o),document.addEventListener("drop",i)}}class q extends HTMLElement{_id;base;_draggableId;constructor(){super(),this.base=new $}_emit(e,t,r){e=new CustomEvent(e,{detail:r,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}_closeModal(e){e.stopPropagation();const t=F(e,"flk-modal").target;t.classList.add("hidden")}closeModal(e){this.classList.add("hidden")}openModal(e=!0){const t=document.getElementById(this._draggableId);e&&(t.style.top="40%",t.style.left="50%"),this.classList.remove("hidden")}connectedCallback(){this.id||(this.id=this.base.generateId());const e=document.createElement("div");var t=this.base.generateId();const r=document.createElement("flk-draggable"),n=(this._draggableId=this.base.generateId(),r.id=this._draggableId,r.setAttribute("center",""),r.setAttribute("top","40%"),r.setAttribute("handle",t),r.setAttribute("zIndex","1080"),r.classList.add("border","shadow-lg","bg-white"),r.style.width="max-content",document.createElement("div"));var s=this.getAttribute("modal-title");if(s){const c=document.createElement("span");c.innerText=s,c.classList.add("ml-1","mr-auto"),n.append(c)}n.id=t;const i=this.getAttribute("header-class");let o=[];i?o=o.concat(i.split(" ")):o.push("bg-gray-light"),n.classList.add(...o,"border-bottom","row","justify-end","cursor-no-select");s=this.base.generateId();const a=document.createElement("button"),l=(a.classList.add("py-0","px-1","outline-hover","no-border","cursor-default",...o),a.innerText="X",a.id=s,n.append(a),r.append(n),document.createElement("div"));l.innerHTML=this.innerHTML,r.append(l),e.append(r),this.component=e,this.base.addEvent("#"+s,"click",this._closeModal),this.base.render(this),this.classList.add("hidden")}disconnectedCallback(){this.base.removeEvents(this)}}class K extends HTMLElement{base;_buttonId;_drawerId;_iconId;constructor(){super(),this.base=new $}connectedCallback(){this.style.position="relative",this.style.display="flex",this.style.width="fit-content",this._buttonId=this.base.generateId();const e=document.createElement("button"),t=(e.classList.add("row"),e.id=this._buttonId,document.createElement("span")),r=(t.innerText=this.getAttribute("text"),this._iconId=this.base.generateId(),document.createElement("span"));var n=V('');const s=V(''),i=(s.classList.add("hidden"),r.append(n,s),r.id=this._iconId,e.append(t,r),this._drawerId=this.base.generateId(),document.createElement("div"));i.id=this._drawerId,i.classList.add("shadow","inline-block","bg-white"),i.style.position="absolute",i.style.zIndex="1040";n=this.querySelector("template");n.innerHTML.length?i.innerHTML=n.innerHTML:i.append(n.firstChild),i.style.display="none",this.component=[e,i],this.base.addEvent("#"+this._buttonId,"click",this.toggleMenu);const o=document.querySelector("body");""!==o.getAttribute("flk-close-dropdown")&&(o.setAttribute("flk-close-dropdown",""),o.addEventListener("click",this.closeAllDropdownButtons)),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this);var e=document.querySelectorAll("flk-dropdown");if(!e||!e.length){const t=document.querySelector("body");t.removeAttribute("flk-close-dropdown"),t.removeEventListener("click",this.closeAllDropdownButtons)}}toggleMenu(e){const t=F(e).target;e=t._drawerId;const r=document.getElementById(e);var e="none"!==r.style.display,n=(r.style.display=e?"none":"block",t.getAttribute("drawer-width")),n=("string"==typeof t.getAttribute("right")&&(r.style.right="0px"),r.style.top=t.offsetHeight+"px",r.style.width=n||t.offsetWidth+"px",t._iconId);const s=document.getElementById(n);e?(s.childNodes[0].classList.remove("hidden"),s.childNodes[1].classList.add("hidden")):(s.childNodes[0].classList.add("hidden"),s.childNodes[1].classList.remove("hidden"))}_closeDropdown(){var e=this._drawerId;const t=document.getElementById(e);if("none"!==t.style.display){e=this._iconId;const r=document.getElementById(e);t.style.display="none",r.childNodes[0].classList.remove("hidden"),r.childNodes[1].classList.add("hidden")}}closeAllDropdownButtons(e){var t,r=F(e,"flk-dropdown").target,e=document.querySelectorAll("flk-dropdown");if(r)for(const n of e)r._buttonId!==n._buttonId&&(t=n._drawerId,"none"!==document.getElementById(t).style.display&&n._closeDropdown());else for(const s of e)s._closeDropdown()}}var t={exports:{}};let Z=e.default,Y=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||"win32"===process.platform||Z.isatty(1)&&"dumb"!==process.env.TERM||"CI"in process.env),r=(r,n,s=r)=>e=>{let t=""+e;e=t.indexOf(n,r.length);return~e?r+X(t,n,s,e)+n:r+t+n},X=(e,t,r,n)=>{var s=e.substring(0,n)+r;let i=e.substring(n+t.length);e=i.indexOf(t);return~e?s+X(i,t,r,e):s+i};e=(e=Y)=>({isColorSupported:e,reset:e?e=>`${e}`:String,bold:e?r("","",""):String,dim:e?r("","",""):String,italic:e?r("",""):String,underline:e?r("",""):String,inverse:e?r("",""):String,hidden:e?r("",""):String,strikethrough:e?r("",""):String,black:e?r("",""):String,red:e?r("",""):String,green:e?r("",""):String,yellow:e?r("",""):String,blue:e?r("",""):String,magenta:e?r("",""):String,cyan:e?r("",""):String,white:e?r("",""):String,gray:e?r("",""):String,bgBlack:e?r("",""):String,bgRed:e?r("",""):String,bgGreen:e?r("",""):String,bgYellow:e?r("",""):String,bgBlue:e?r("",""):String,bgMagenta:e?r("",""):String,bgCyan:e?r("",""):String,bgWhite:e?r("",""):String});t.exports=e(),t.exports.createColors=e;const Q="'".charCodeAt(0),ee='"'.charCodeAt(0),te="\\".charCodeAt(0),re="/".charCodeAt(0),ne="\n".charCodeAt(0),se=" ".charCodeAt(0),ie="\f".charCodeAt(0),oe="\t".charCodeAt(0),ae="\r".charCodeAt(0),le="[".charCodeAt(0),ce="]".charCodeAt(0),ue="(".charCodeAt(0),he=")".charCodeAt(0),pe="{".charCodeAt(0),de="}".charCodeAt(0),fe=";".charCodeAt(0),me="*".charCodeAt(0),ge=":".charCodeAt(0),ye="@".charCodeAt(0),ve=/[\t\n\f\r "#'()/;[\\\]{}]/g,we=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,be=/.[\r\n"'(/\\]/,_e=/[\da-f]/i;function Ce(t,e={}){let n=t.css.valueOf(),d=e.ignoreErrors,s,i,f,m,o,a,l,g,c,u,y=n.length,h=0,v=[],p=[];function w(e){throw t.error("Unclosed "+e,h)}return{back:function(e){p.push(e)},endOfFile:function(){return 0===p.length&&h>=y},nextToken:function(e){if(p.length)return p.pop();if(!(h>=y)){var t=!!e&&e.ignoreUnclosed;switch(s=n.charCodeAt(h),s){case ne:case se:case oe:case ae:case ie:for(i=h;i+=1,s=n.charCodeAt(i),s===se||s===ne||s===oe||s===ae||s===ie;);u=["space",n.slice(h,i)],h=i-1;break;case le:case ce:case pe:case de:case ge:case fe:case he:var r=String.fromCharCode(s);u=[r,r,h];break;case ue:if(g=v.length?v.pop()[1]:"",c=n.charCodeAt(h+1),"url"===g&&c!==Q&&c!==ee&&c!==se&&c!==ne&&c!==oe&&c!==ie&&c!==ae){i=h;do{if(a=!1,i=n.indexOf(")",i+1),-1===i){if(d||t){i=h;break}w("bracket")}for(l=i;n.charCodeAt(l-1)===te;)--l,a=!a}while(a);u=["brackets",n.slice(h,i+1),h,i],h=i}else i=n.indexOf(")",h+1),m=n.slice(h,i+1),-1===i||be.test(m)?u=["(","(",h]:(u=["brackets",m,h,i],h=i);break;case Q:case ee:f=s===Q?"'":'"',i=h;do{if(a=!1,i=n.indexOf(f,i+1),-1===i){if(d||t){i=h+1;break}w("string")}for(l=i;n.charCodeAt(l-1)===te;)--l,a=!a}while(a);u=["string",n.slice(h,i+1),h,i],h=i;break;case ye:ve.lastIndex=h+1,ve.test(n),i=0===ve.lastIndex?n.length-1:ve.lastIndex-2,u=["at-word",n.slice(h,i+1),h,i],h=i;break;case te:for(i=h,o=!0;n.charCodeAt(i+1)===te;)i+=1,o=!o;if(s=n.charCodeAt(i+1),o&&s!==re&&s!==se&&s!==ne&&s!==oe&&s!==ae&&s!==ie&&(i+=1,_e.test(n.charAt(i)))){for(;_e.test(n.charAt(i+1));)i+=1;n.charCodeAt(i+1)===se&&(i+=1)}u=["word",n.slice(h,i+1),h,i],h=i;break;default:h=(s===re&&n.charCodeAt(h+1)===me?(i=n.indexOf("*/",h+2)+1,0===i&&(d||t?i=n.length:w("comment")),u=["comment",n.slice(h,i+1),h,i]):(we.lastIndex=h+1,we.test(n),i=0===we.lastIndex?n.length-1:we.lastIndex-2,u=["word",n.slice(h,i+1),h,i],v.push(u)),i)}return h++,u}},position:function(){return h}}}e=t.exports;let Se=Ce,xe;const Ae={";":e.yellow,":":e.yellow,"(":e.cyan,")":e.cyan,"[":e.yellow,"]":e.yellow,"{":e.yellow,"}":e.yellow,"at-word":e.cyan,brackets:e.cyan,call:e.cyan,class:e.yellow,comment:e.gray,hash:e.magenta,string:e.green};function ke(e){let r=Se(new xe(e),{ignoreErrors:!0}),n="";for(;!r.endOfFile();){let e=r.nextToken(),t=Ae[function([e,t],r){if("word"===e){if("."===t[0])return"class";if("#"===t[0])return"hash"}if(!r.endOfFile()){t=r.nextToken();if(r.back(t),"brackets"===t[0]||"("===t[0])return"call"}return e}(e,r)];t?n+=e[1].split(/\r?\n/).map(e=>t(e)).join("\n"):n+=e[1]}return n}ke.registerInput=function(e){xe=e};e=ke;let Ee=t.exports,Le=e;class Oe extends Error{constructor(e,t,r,n,s,i){super(e),this.name="CssSyntaxError",this.reason=e,s&&(this.file=s),n&&(this.source=n),i&&(this.plugin=i),void 0!==t&&void 0!==r&&("number"==typeof t?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,Oe)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file||"",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source,r=(null==e&&(e=Ee.isColorSupported),Le&&e&&(t=Le(t)),t.split(/\r?\n/)),n=Math.max(this.line-3,0);var s=Math.min(this.line+2,r.length);let i=String(s).length,o,a;if(e){let{bold:t,gray:r,red:n}=Ee.createColors(!0);o=e=>t(n(e)),a=e=>r(e)}else o=a=e=>e;return r.slice(n,s).map((e,t)=>{var t=n+1+t;let r=" "+(" "+t).slice(-i)+" | ";return t===this.line?(t=a(r.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," "),o(">")+a(r)+e+"\n "+t+o("^")):" "+a(r)+e}).join("\n")}toString(){let e=this.showSourceCode();return e=e&&"\n\n"+e+"\n",this.name+": "+this.message+e}}var t=Oe,Me=(Oe.default=Oe,{});Me.isClean=Symbol("isClean"),Me.my=Symbol("my");const Pe={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class Re{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name;var n=e.params?this.rawValue(e,"params"):"";void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes?this.block(e,r+n):(t=(e.raws.between||"")+(t?";":""),this.builder(r+n+t,e))}beforeAfter(e,t){let r,n=(r="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose"),e.parent),s=0;for(;n&&"root"!==n.type;)s+=1,n=n.parent;if(r.includes("\n")){var i=this.raw(e,null,"indent");if(i.length)for(let e=0;e{if(n=e.raws[t],void 0!==n)return!1}),void 0===n&&(n=Pe[r]),i.rawCache[r]=n,n}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&0{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=void 0===r?this.raw(t,null,"beforeDecl"):r&&r.replace(/\S/g,""),r}rawBeforeDecl(e,t){let r;return e.walkDecls(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=void 0===r?this.raw(t,null,"beforeRule"):r&&r.replace(/\S/g,""),r}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(t){let r;return t.walk(e=>{if(e.nodes&&(e.parent!==t||t.first!==e)&&void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=r&&r.replace(/\S/g,""),r}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(r){if(r.raws.indent)return r.raws.indent;let n;return r.walk(e=>{var t=e.parent;if(t&&t!==r&&t.parent&&t.parent===r&&void 0!==e.raws.before)return t=e.raws.before.split("\n"),n=t[t.length-1],n=n.replace(/\S/g,""),!1}),n}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){var r=e[t],e=e.raws[t];return e&&e.value===r?e.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}}var Te=Re;Re.default=Re;let Ie=Te;function Be(e,t){let r=new Ie(t);r.stringify(e)}var Ne=Be;Be.default=Be;let{isClean:je,my:De}=Me,Ue=t,Fe=Te,ze=Ne;function $e(t,r){let n=new t.constructor;for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&"proxyCache"!==s){let e=t[s];var i=typeof e;"parent"===s&&"object"==i?r&&(n[s]=r):"source"===s?n[s]=e:Array.isArray(e)?n[s]=e.map(e=>$e(e,n)):("object"==i&&null!==e&&(e=$e(e)),n[s]=e)}return n}class Ge{constructor(e={}){for(var t in this.raws={},this[je]=!1,this[De]=!0,e)if("nodes"===t){this.nodes=[];for(var r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){var t;return e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)&&(t=this.source,e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)),e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(var t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=$e(this);for(var r in e)t[r]=e[r];return t}cloneAfter(e={}){e=this.clone(e);return this.parent.insertAfter(this,e),e}cloneBefore(e={}){e=this.clone(e);return this.parent.insertBefore(this,e),e}error(e,t={}){var r,n;return this.source?({end:r,start:n}=this.rangeBy(t),this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)):new Ue(e)}getProxyProcessor(){return{get(e,t){return"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t]},set(e,t,r){return e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0}}}markDirty(){if(this[je]){this[je]=!1;let e=this;for(;e=e.parent;)e[je]=!1}}next(){var e;if(this.parent)return e=this.parent.index(this),this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;return e.index?r=this.positionInside(e.index,t):!e.word||-1!==(e=(t=this.toString()).indexOf(e.word))&&(r=this.positionInside(e,t)),r}positionInside(t,e){var r=e||this.toString();let n=this.source.start.column,s=this.source.start.line;for(let e=0;e"object"==typeof e&&e.toJSON?e.toJSON(null,r):e);else if("object"==typeof t&&t.toJSON)n[s]=t.toJSON(null,r);else if("source"===s){let e=r.get(t.input);null==e&&(e=i,r.set(t.input,i),i++),n[s]={end:t.end,inputId:e,start:t.start}}else n[s]=t}return t&&(n.inputs=[...r.keys()].map(e=>e.toJSON())),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=ze){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(var s in r)n[s]=r[s];return e.warn(t,n)}get proxyOf(){return this}}var Te=Ge,He=(Ge.default=Ge,Te);class Ve extends He{constructor(e){super(e=e&&void 0!==e.value&&"string"!=typeof e.value?{...e,value:String(e.value)}:e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}}var He=Ve,We=(Ve.default=Ve,{}),Je={},qe={},Ke={},Ze="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),Ye=(Ke.encode=function(e){if(0<=e&&e>>=5)&&(t|=32),r+=Ye.encode(t),0>1,1==(1&a)?-i:i),r.rest=t};var Ke={},l=Ke,Xe=(l.getArg=function(e,t,r){if(t in e)return e[t];if(3===arguments.length)return r;throw new Error('"'+t+'" is a required argument.')},/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/),Qe=/^data:.+\,.+$/;function et(e){e=e.match(Xe);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}function tt(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}l.urlParse=et,l.urlGenerate=tt,rt=function(e){var t=e,r=et(e);if(r){if(!r.path)return e;t=r.path}for(var n,e=l.isAbsolute(t),s=[],i=0;;){if(n=i,-1===(i=t.indexOf("/",n))){s.push(t.slice(n));break}for(s.push(t.slice(n,i));in;e--){var o=r[e-1],a=r[e];if(Pt(o,a)<=0)break;r[e-1]=a,r[e]=o}else Ot(r,Pt,n)}function Tt(e,s){var t=e,e=("string"==typeof e&&(t=w.parseSourceMapInput(e)),w.getArg(t,"version")),t=w.getArg(t,"sections");if(e!=this._version)throw new Error("Unsupported version: "+e);this._sources=new Et,this._names=new Et;var i={line:-1,column:0};this._sections=t.map(function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var t=w.getArg(e,"offset"),r=w.getArg(t,"line"),n=w.getArg(t,"column");if(r=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))},p.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;var r=this._findSourceIndex(e);if(0<=r)return this.sourcesContent[r];var n,r=e;if(null!=this.sourceRoot&&(r=w.relative(this.sourceRoot,r)),null!=this.sourceRoot&&(n=w.urlParse(this.sourceRoot))){e=r.replace(/^file:\/\//,"");if("file"==n.scheme&&this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];if((!n.path||"/"==n.path)&&this._sources.has("/"+r))return this.sourcesContent[this._sources.indexOf("/"+r)]}if(t)return null;throw new Error('"'+r+'" is not in the SourceMap.')},p.prototype.generatedPositionFor=function(e){var t=w.getArg(e,"source");if((t=this._findSourceIndex(t))<0)return{line:null,column:null,lastColumn:null};t={source:t,originalLine:w.getArg(e,"line"),originalColumn:w.getArg(e,"column")},e=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",w.compareByOriginalPositions,w.getArg(e,"bias",f.GREATEST_LOWER_BOUND));if(0<=e){e=this._originalMappings[e];if(e.source===t.source)return{line:w.getArg(e,"generatedLine",null),column:w.getArg(e,"generatedColumn",null),lastColumn:w.getArg(e,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},ft.BasicSourceMapConsumer=p,(Tt.prototype=Object.create(f.prototype)).constructor=f,Tt.prototype._version=3,Object.defineProperty(Tt.prototype,"sources",{get:function(){for(var e=[],t=0;t{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(n,s=21)=>(e=s)=>{let t="",r=e;for(;r--;)t+=n[Math.random()*n.length|0];return t}};let{SourceMapConsumer:Ut,SourceMapGenerator:Ft}=We,{existsSync:zt,readFileSync:$t}=i.default,{dirname:Gt,join:Ht}=n.default;class Vt{constructor(e,t){!1!==t.map&&(this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:"),e=t.map?t.map.prev:void 0,e=this.loadMap(t.from,e),!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Gt(this.mapFile)),e&&(this.text=e))}consumer(){return this.consumerCache||(this.consumerCache=new Ut(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+t)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);var r,n;t&&(r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r),-1"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,i,o;t&&"object"==typeof t?(a=r,r="number"==typeof(l=t).offset?(t=(c=this.fromOffset(l.offset)).line,c.col):(t=l.line,l.column),o="number"==typeof a.offset?(c=this.fromOffset(a.offset),i=c.line,c.col):(i=a.line,a.column)):r||(t=(l=this.fromOffset(t)).line,r=l.col);var a,l,c=this.origin(t,r,i,o);return s=c?new Xt(e,void 0===c.endLine?c.line:{column:c.column,line:c.line},void 0===c.endLine?c.column:{column:c.endColumn,line:c.endLine},c.source,c.file,n.plugin):new Xt(e,void 0===i?t:{column:r,line:t},void 0===i?r:{column:o,line:i},this.css,this.file,n.plugin),s.input={column:r,endColumn:o,endLine:i,line:t,source:this.css},this.file&&(Jt&&(s.input.url=Jt(this.file).toString()),s.input.file=this.file),s}fromOffset(t){let n;if(this[er])n=this[er];else{var s=this.css.split("\n");n=new Array(s.length);let r=0;for(let e=0,t=s.length;e>1),t=n[i+1])){r=i;break}r=i+1}}return{col:t-n[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Kt(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let s=this.map.consumer();t=s.originalPositionFor({column:t,line:e});if(!t.source)return!1;let i;"number"==typeof r&&(i=s.originalPositionFor({column:n,line:r}));let o,a=(o=qt(t.source)?Jt(t.source):new URL(t.source,this.map.consumer().sourceRoot||Jt(this.map.mapFile)),{column:t.column,endColumn:i&&i.column,endLine:i&&i.line,line:t.line,url:o.toString()});if("file:"===o.protocol){if(!Wt)throw new Error("file: protocol is not available in this PostCSS build");a.file=Wt(o)}e=s.sourceContentFor(t.source);return e&&(a.source=e),a}toJSON(){let e={};for(var t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}}Je=nr;nr.default=nr,Yt&&Yt.registerInput&&Yt.registerInput(nr);let{SourceMapConsumer:sr,SourceMapGenerator:ir}=We,{dirname:or,relative:ar,resolve:lr,sep:cr}=n.default,ur=s.default["pathToFileURL"],hr=Je,pr=Boolean(sr&&ir),dr=Boolean(or&&lr&&ar&&cr);ft=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e,t=(e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map","\n");this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(var t of this.previous()){var r=this.toUrl(this.path(t.file)),n=t.root||or(t.file);let e;!1===this.mapOpts.sourcesContent?(e=new sr(t.text),e.sourcesContent&&(e.sourcesContent=null)):e=t.consumer(),this.map.applySourceMap(e,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let t;for(let e=this.root.nodes.length-1;0<=e;e--)t=this.root.nodes[e],"comment"===t.type&&0===t.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(e)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),dr&&pr&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,e=>{t+=e}),[t]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=ir.fromSourceMap(e)}else this.map=new ir({file:this.outputFile()}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):""});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&0",o={generated:{column:0,line:0},original:{column:0,line:0},source:""},a,l;this.stringify(this.root,(e,t,r)=>{this.css+=e,t&&"end"!==r&&(o.generated.line=n,o.generated.column=s-1,t.source&&t.source.start?(o.source=this.sourcePath(t),o.original.line=t.source.start.line,o.original.column=t.source.start.column-1):(o.source=i,o.original.line=1,o.original.column=0),this.map.addMapping(o)),a=e.match(/\n/g),a?(n+=a.length,l=e.lastIndexOf("\n"),s=e.length-l):s+=e.length,t&&"start"!==r&&(e=t.parent||{raws:{}},("decl"===t.type||"atrule"===t.type&&!t.nodes)&&t===e.last&&!e.raws.semicolon||(t.source&&t.source.end?(o.source=this.sourcePath(t),o.original.line=t.source.end.line,o.original.column=t.source.end.column-1,o.generated.line=n,o.generated.column=s-2):(o.source=i,o.original.line=1,o.original.column=0,o.generated.line=n,o.generated.column=s-1),this.map.addMapping(o)))})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;var e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:0e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;var t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?or(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=or(lr(r,this.mapOpts.annotation)));t=ar(r,e);return this.memoizedPaths.set(e,t),t}previous(){var e;return this.previousMaps||(this.previousMaps=[],this.root?this.root.walk(e=>{e.source&&e.source.input.map&&(e=e.source.input.map,this.previousMaps.includes(e)||this.previousMaps.push(e))}):(e=new hr(this.originalCSS,this.opts)).map&&this.previousMaps.push(e.map)),this.previousMaps}setSourcesContent(){let r={};var e;this.root?this.root.walk(e=>{var t;!e.source||(t=e.source.input.from)&&!r[t]&&(r[t]=!0,t=this.usesFileUrls?this.toFileUrl(t):this.toUrl(this.path(t)),this.map.setSourceContent(t,e.source.input.css))}):this.css&&(e=this.opts.from?this.toUrl(this.path(this.opts.from)):"",this.map.setSourceContent(e,this.css))}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){var t=this.memoizedFileURLs.get(e);if(t)return t;if(ur)return t=ur(e).toString(),this.memoizedFileURLs.set(e,t),t;throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){var t=this.memoizedURLs.get(e);if(t)return t;"\\"===cr&&(e=e.replace(/\\/g,"/"));t=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,t),t}};class fr extends Te{constructor(e){super(e),this.type="comment"}}Ct=fr;fr.default=fr;let{isClean:mr,my:gr}=Me,yr=He,vr=Ct,wr,br,_r,Cr;class Sr extends Te{append(...e){for(var t of e){var r;for(r of this.normalize(t,this.last))this.proxyOf.nodes.push(r)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(var t of this.nodes)t.cleanRaws(e)}each(r){if(this.proxyOf.nodes){var n=this.getIterator();let e,t;for(;this.indexes[n]t[n](...e.map(r=>"function"==typeof r?(e,t)=>r(e.toProxy(),t):r)):"every"===n||"some"===n?r=>t[n]((e,...t)=>r(e.toProxy(),...t)):"root"===n?()=>t.root().toProxy():"nodes"===n?t.nodes.map(e=>e.toProxy()):"first"===n||"last"===n?t[n].toProxy():t[n])},set(e,t,r){return e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0}}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){var r,n,s,i=this.index(e),o=this.normalize(t,this.proxyOf.nodes[i]).reverse(),i=this.index(e);for(r of o)this.proxyOf.nodes.splice(i+1,0,r);for(s in this.indexes)i<(n=this.indexes[s])&&(this.indexes[s]=n+o.length);return this.markDirty(),this}insertBefore(e,t){var r,n,s,i=this.index(e),o=this.normalize(t,this.proxyOf.nodes[i],0===i&&"prepend").reverse(),i=this.index(e);for(r of o)this.proxyOf.nodes.splice(i,0,r);for(s in this.indexes)i<=(n=this.indexes[s])&&(this.indexes[s]=n+o.length);return this.markDirty(),this}normalize(e,t){if("string"==typeof e)e=function t(e){return e.map(e=>(e.nodes&&(e.nodes=t(e.nodes)),delete e.source,e))}(wr(e).nodes);else if(void 0===e)e=[];else if(Array.isArray(e))for(var r of e=e.slice(0))r.parent&&r.parent.removeChild(r,"ignore");else if("root"===e.type&&"document"!==this.type)for(var n of e=e.nodes.slice(0))n.parent&&n.parent.removeChild(n,"ignore");else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new yr(e)]}else if(e.selector)e=[new br(e)];else if(e.name)e=[new _r(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new vr(e)]}return e.map(e=>(e[gr]||Sr.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[mr]&&function e(t){if(t[mr]=!1,t.proxyOf.nodes)for(var r of t.proxyOf.nodes)e(r)}(e),void 0===e.raws.before&&t&&void 0!==t.raws.before&&(e.raws.before=t.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}prepend(...e){for(var t of e=e.reverse()){var r,n,s=this.normalize(t,this.first,"prepend").reverse();for(r of s)this.proxyOf.nodes.unshift(r);for(n in this.indexes)this.indexes[n]=this.indexes[n]+s.length}return this.markDirty(),this}push(e){return(e.parent=this).proxyOf.nodes.push(e),this}removeAll(){for(var e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){var t,r;for(r in e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1),this.indexes)e<=(t=this.indexes[r])&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(t,r,n){return n||(n=r,r={}),this.walkDecls(e=>{r.props&&!r.props.includes(e.prop)||r.fast&&!e.value.includes(r.fast)||(e.value=e.value.replace(t,n))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(n){return this.each((t,e)=>{let r;try{r=n(t,e)}catch(e){throw t.addToError(e)}return!1!==r&&t.walk&&(r=t.walk(n)),r})}walkAtRules(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("atrule"===e.type&&r.test(e.name))return n(e,t)}):this.walk((e,t)=>{if("atrule"===e.type&&e.name===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("atrule"===e.type)return n(e,t)}))}walkComments(r){return this.walk((e,t)=>{if("comment"===e.type)return r(e,t)})}walkDecls(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("decl"===e.type&&r.test(e.prop))return n(e,t)}):this.walk((e,t)=>{if("decl"===e.type&&e.prop===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("decl"===e.type)return n(e,t)}))}walkRules(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("rule"===e.type&&r.test(e.selector))return n(e,t)}):this.walk((e,t)=>{if("rule"===e.type&&e.selector===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("rule"===e.type)return n(e,t)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}Sr.registerParse=e=>{wr=e},Sr.registerRule=e=>{br=e},Sr.registerAtRule=e=>{_r=e},Sr.registerRoot=e=>{Cr=e};i=Sr,Sr.default=Sr,Sr.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,_r.prototype):"rule"===e.type?Object.setPrototypeOf(e,br.prototype):"decl"===e.type?Object.setPrototypeOf(e,yr.prototype):"comment"===e.type?Object.setPrototypeOf(e,vr.prototype):"root"===e.type&&Object.setPrototypeOf(e,Cr.prototype),e[gr]=!0,e.nodes&&e.nodes.forEach(e=>{Sr.rebuild(e)})},ot=i;let xr,Ar;class kr extends ot{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){let t=new xr(new Ar,this,e);return t.stringify()}}kr.registerLazyResult=e=>{xr=e},kr.registerProcessor=e=>{Ar=e};e=kr;kr.default=kr;let Er={};function Lr(e){Er[e]||(Er[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))}class Or{constructor(e,t={}){for(var r in this.type="warning",this.text=e,t.node&&t.node.source&&(e=t.node.rangeBy(t),this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column),t)this[r]=t[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}St=Or;Or.default=Or;let Mr=St;class Pr{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);e=new Mr(e,t);return this.messages.push(e),e}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}}Ke=Pr;Pr.default=Pr;let Rr=i;class Tr extends Rr{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}We=Tr;Tr.default=Tr,Rr.registerAtRule(Tr);let Ir=i,Br,Nr;class jr extends Ir{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){e=super.normalize(e);if(t)if("prepend"===r)1{Br=e},jr.registerProcessor=e=>{Nr=e};n=jr;jr.default=jr,Ir.registerRoot(jr);let Dr={comma(e){return Dr.split(e,[","],!0)},space(e){return Dr.split(e,[" ","\n","\t"])},split(e,t,u){let r=[],n="",s=!1,i=0,o=!1,a="",l=!1;for(var c of e)l?l=!1:"\\"===c?l=!0:o?c===a&&(o=!1):'"'===c||"'"===c?(o=!0,a=c):"("===c?i+=1:")"===c?0"space"!==e[0]&&"comment"!==e[0])&&(s.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(s,"value",a.concat(e),t),s.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new Jr;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){var t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1;var r;let n=!1,s=null,i=[];var o=e[1].startsWith("--");let a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)s=s||l,i.push("("===r?")":"]");else if(o&&n&&"{"===r)s=s||l,i.push("}");else if(0===i.length){if(";"===r){if(n)return void this.decl(a,o);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===i[i.length-1]&&(i.pop(),0===i.length&&(s=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),0e+t[1],""),e.raws[t]={raw:o,value:l}),e[t]=l}rule(e){e.pop();let t=new Jr;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){var t;let r="";for(;e.length&&("space"===(t=e[e.length-1][0])||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){var t;let r="";for(;e.length&&("space"===(t=e[0][0])||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t="";for(;e.length&&"space"===e[e.length-1][0];)t=e.pop()[1]+t;return t}stringFrom(t,r){let n="";for(let e=r;evn(e)),e}let wn={};class bn{constructor(e,t,r){this.stringified=!1,this.processed=!1;let n;if("object"!=typeof t||null===t||"root"!==t.type&&"document"!==t.type)if(t instanceof bn||t instanceof ln)n=vn(t.root),t.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=t.map);else{let e=cn;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{n=e(t,r)}catch(e){this.processed=!0,this.error=e}n&&!n[tn]&&sn.rebuild(n)}else n=vn(t);this.result=new ln(e,n,r),this.helpers={...wn,postcss:wn,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){var r=this.result.lastPlugin;try{if(t&&t.addToError(e),"CssSyntaxError"!==(this.error=e).name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){var n=r.postcssPlugin;let e=r.postcssVersion,t=this.result.processor.version;var s=e.split("."),i=t.split(".");(s[0]!==i[0]||parseInt(s[1])>parseInt(i[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+t+", but "+n+" uses "+e+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};var e,t=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(e of this.plugins)if("object"==typeof e)for(var r in e){if(!pn[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${e.postcssPlugin}. `+`Try to update PostCSS (${this.processor.version} now).`);if(!dn[r])if("object"==typeof e[r])for(var n in e[r])"*"===n?t(e,r,e[r][n]):t(e,r+"-"+n.toLowerCase(),e[r][n]);else"function"==typeof e[r]&&t(e,r,e[r])}this.hasListener=0t(e,this.helpers)),await Promise.all(i)):await t(r,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{var e;if("object"==typeof t&&t.Once)return"document"===this.result.root.type?mn((e=this.result.root.nodes.map(e=>t.Once(e,this.helpers)))[0])?Promise.all(e):e:t.Once(this.result.root,this.helpers);if("function"==typeof t)return t(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();var e=this.result.opts;let t=nn,r=(e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify),new rn(t,this.result.root,this.result.opts));e=r.generate();return this.result.css=e[0],this.result.map=e[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(var e of this.plugins)if(mn(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[en];)e[en]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(var t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||an("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(var[r,n]of e){this.result.lastPlugin=r;let e;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(mn(e))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:s}=r;if("root"===n.type||"document"===n.type||n.parent){if(0{e[en]||this.walkSync(e)});else{var r=this.listeners[t];if(r&&this.visitSync(r,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}bn.registerPostcss=e=>{wn=e};Me=bn;bn.default=bn,un.registerLazyResult(bn),on.registerLazyResult(bn);let _n=ft,Cn=Ne,Sn=Lr,xn=Qr;const An=Ke;class kn{constructor(e,t,r){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;var e=Cn;this.result=new An(this._processor,void 0,this._opts),this.result.css=t;let n=this,s=(Object.defineProperty(this.result,"root",{get(){return n.root}}),new _n(e,void 0,this._opts,t));s.isMap()?([r,e]=s.generate(),r&&(this.result.css=r),e&&(this.result.map=e)):(s.clearAnnotation(),this.result.css=s.css)}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||Sn("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=xn;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}}ft=kn;kn.default=kn;let En=ft,Ln=Me,On=e,Mn=n;class Pn{constructor(e=[]){this.version="8.4.35",this.plugins=this.normalize(e)}normalize(e){let t=[];for(var r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return new(this.plugins.length||t.parser||t.stringifier||t.syntax?Ln:En)(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}ft=Pn;Pn.default=Pn,Mn.registerProcessor(Pn),On.registerProcessor(Pn);let Rn=He,Tn=qe,In=Ct,Bn=We,Nn=Je,jn=n,Dn=ot;function Un(e,r){if(Array.isArray(e))return e.map(e=>Un(e));let{inputs:t,...n}=e;if(t){r=[];for(var s of t){let e={...s,__proto__:Nn.prototype};e.map&&(e.map={...e.map,__proto__:Tn.prototype}),r.push(e)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>Un(e,r))),n.source){let{inputId:e,...t}=n.source;n.source=t,null!=e&&(n.source.input=r[e])}if("root"===n.type)return new jn(n);if("decl"===n.type)return new Rn(n);if("rule"===n.type)return new Dn(n);if("comment"===n.type)return new In(n);if("atrule"===n.type)return new Bn(n);throw new Error("Unknown node type: "+e.type)}qe=Un,Un.default=Un;let Fn=He,zn=Me;He=i;let $n=ft;Me=Ne,i=qe;let Gn=e;ft=St;let Hn=Ct,Vn=We;Ne=Ke,qe=Je,e=Qr,St=s;let Wn=ot,Jn=n;Ct=Te;function o(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new $n(e)}o.plugin=function(r,n){let s=!1;function i(...e){console&&console.warn&&!s&&(s=!0,console.warn(r+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(r+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let t=n(...e);return t.postcssPlugin=r,t.postcssVersion=(new $n).version,t}let e;return Object.defineProperty(i,"postcss",{get(){return e=e||i(),e}}),i.process=function(e,t,r){return o([i(r)]).process(e,t)},i},o.stringify=Me,o.parse=e,o.fromJSON=i,o.list=St,o.comment=e=>new Hn(e),o.atRule=e=>new Vn(e),o.decl=e=>new Fn(e),o.rule=e=>new Wn(e),o.root=e=>new Jn(e),o.document=e=>new Gn(e),o.CssSyntaxError=t,o.Declaration=Fn,o.Container=He,o.Processor=$n,o.Document=Gn,o.Comment=Hn,o.Warning=ft,o.AtRule=Vn,o.Result=Ne,o.Input=qe,o.Rule=Wn,o.Root=Jn,o.Node=Ct,zn.registerPostcss(o);o.default=o;class qn extends HTMLElement{base;contents;component;listType="ul";iconSet;filter={value:"",caseSensitive:!1};static get observedAttributes(){return["contents","icon-set","max-depth","filter"]}_jsonToValueArray(e){let t=JSON.stringify(e);t=t.replace(/[\[\]{}\"]/g,"");let r=[];for(const n of t.split(","))r=r.concat(n.split(":"));return[...new Set(r)]}_emit(e,t,r){e=new CustomEvent(e,{detail:r,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}constructor(){super(),this.base=new $,this.setContents(this.getAttribute("contents")),this.iconSet=this.getAttribute("icon-set")?this.getAttribute("icon-type"):"file",this.maxDepth=this.getAttribute("max-depth")?parseInt(this.getAttribute("max-depth")):-1,this.setFilter(this.getAttribute("filter")),this.style.display="block",this.style.maxWidth="fit-content",this.style.margin="0 1rem 0 0",this.base.addEvent(".flk-branch","click",this.emitNodeToggle)}emitNodeToggle(e){e.stopPropagation();const t=F(e,"flk-tree-nav").target,r=z(e,"branchKey");let n=t.contents;const s=r.split(".");for(const o of s)if(n[o])n=n[o];else if(null===n[o])n=null;else{let e=[];for(const a of n)a[o]&&e.push(a[o]);n=e}var e=r.substring(r.indexOf(".")+1),i=t.createLeafText(s.reverse()[0]);t._emit("tree-click",t,{path:e,data:n,key:(i.titleText+" "+i.commentText).trim(),branch:"object"==typeof n})}convertJsonKeyToTitle(e){if(!e)return"";const t=(e="string"!=typeof e?e.toString():e).replace(/([A-Z_])/g,e=>"_"===e?" ":" "+e).trim();return t.charAt(0).toUpperCase()+t.slice(1)}setContents(e){var t=e||this.contents||[];try{switch(typeof t){case"string":this.contents=JSON.parse(t);break;case"object":Array.isArray(t)?this.contents=t:this.contents=[t]}}catch(e){console.log(e)}}applyFilter(e){let t;var r="details"===e.tagName.toLowerCase();t=this.filter.caseSensitive?e.dataset.branchValues.includes(this.filter.value):e.dataset.branchValues.toLowerCase().includes(this.filter.value.toLowerCase()),t?e.parentElement.classList.remove("hidden"):e.parentElement.classList.add("hidden"),r&&t?e.setAttribute("open",""):e.removeAttribute("open")}resetTree(e){e.parentElement.classList.remove("hidden"),e.removeAttribute("open")}filterTree(){let t=setTimeout(()=>{for(const e of this.querySelectorAll("[data-branch-values]"))void 0===this.filter.value||0===this.filter.value.length?this.resetTree(e):this.applyFilter(e);clearTimeout(t)},10)}setFilter(e){const t=e||{};try{switch(typeof t){case"string":t.includes("{")?(this.filter=JSON.parse(t),!1===this.filter.caseSensitive&&(this.filter.value=this.filter.value.toLowerCase())):this.filter.value=e.toLowerCase();break;case"object":this.filter=t}}catch(e){console.log(e)}this.filterTree()}createLeafText(e){var t,r;let n="",s="";return"string"==typeof e&&(e.includes("(")||e.includes("["))?(r=e.indexOf("("),r=-1===(t=e.indexOf("["))?r:t,n=this.convertJsonKeyToTitle(e.substring(0,r)),s=e.substring(r)):n=this.convertJsonKeyToTitle(e),{titleText:n,commentText:s}}createTextTag(n,s){n=this.createLeafText(n);if(n.commentText){let e=document.createElement("div"),t=document.createElement("span"),r=(t.innerText=n.titleText,document.createElement("small"));r.innerText=n.commentText,r.style.marginLeft="1rem",e.append(t,r),e.style.display="inline-flex",e.style.alignItems="center",s.append(e)}else s.innerText=n.titleText}createLeaf(e,t,r,n=[]){let s=document.createElement("li");s.classList.add("cursor-no-select"),s.style.marginTop="0.4rem",s.dataset.branchKey=r;const i="file"===this.iconSet?'':'';s.style.listStyleImage=`url('data:image/svg+xml,${i}')`,s.style.position="relative",s.style.left="2px";let o=document.createElement("span");r=[e].concat(n);if(o.dataset.branchValues=[...new Set(r)].join(),n.length&&(o.dataset.leafKey=r[0]),this.createTextTag(e,o),o.style.position="relative",o.style.top="-3px",s.append(o),t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);const i="file"===this.iconSet?G:H;e.style.listStyleImage=`url('data:image/svg+xml,${i}')`,e.append(s),t.append(e)}else t.append(s)}createBranch(r,t,n,s){if(s===this.maxDepth&&"object"==typeof r)for(const o of Array.isArray(r)?r:Object.keys(r)){let e;r[o]&&(e=this._jsonToValueArray(r[o])),this.createLeaf(o,t,n+"."+o,e)}else if(Array.isArray(r))for(var e in r){var u=document.createElement(this.listType);t.append(this.createBranch(r[e],u,n+"."+e,s+1))}else if(null!==r&&"object"==typeof r){const a=[];for(const l of Object.keys(r)){let e=document.createElement("li"),t=(e.classList.add("cursor-no-select"),e.style.position="relative",e.style.left="2px",e.dataset.branchKey=n+"."+l,document.createElement("details"));t.classList.add("flk-branch"),t.dataset.branchValues=[l].concat(this._jsonToValueArray(r[l])),t.style.position="relative",t.style.top="-3px",t.classList.add("cursor-default");var i=document.createElement("summary");this.createTextTag(l,i),t.append(i),e.append(this.createBranch(r[l],t,n+"."+l,s+1)),a.push(e)}if(t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);var h="file"===this.iconSet?G:H;e.style.listStyleImage=`url('data:image/svg+xml,${h}')`;for(const c of a)e.append(c);t.append(e)}else for(const p of a)t.append(p)}else this.createLeaf(r,t,n);return t}createHtml(){let e=document.createElement(this.listType);var t="file"===this.iconSet?G:'';if(e.style.listStyleImage=`url('data:image/svg+xml,${t}')`,e.style.marginLeft="3rem",this.contents.length){for(const r in this.contents)e=this.createBranch(this.contents[r],e,r,0);this.component=e}else this.component=e}attributeChangedCallback(e,t,r){switch(e){case"contents":this.setContents(r);break;case"icon-set":this.iconSet=r;break;case"max-depth":this.maxDepth="string"==typeof r?parseInt(r):r;break;case"filter":this.setFilter(r)}this.init()}connectedCallback(){this.init()}disconnectedCallback(){this.base.removeEvents(this)}init(){this.createHtml(),this.base.render(this)}}customElements.define("flk-table",W),customElements.define("flk-draggable",J),customElements.define("flk-modal",q),customElements.define("flk-dropdown",K),customElements.define("flk-tree-nav",qn)}(require$$0,require$$2,require$$1$1,require$$1); \ No newline at end of file +!function(){"use strict";var a,c,g,e;(e=a=a||{}).Date="date",e.String="string",e.Float="float",e.Number="number",e.Array="array",e.Object="object",e.Bool="bool",e.Currency="currency",e.Undefined="undefined",e.Null="null";const l={date:/^(\d{1,4}-\d{1,4}-\d{1,4}(T)?)/gim,currency:/^[$|€]\s?[0-9]*(\.|,)?\d*(\.|,)?\d*/gim,float:/\d+[,|.]\d+[,|.]?\d*/gim,currencySign:/\$|€/gim,array:/^\s?[[].[^,]+[\]],?/gi,precision:/[-+$€,.]/gm,string:/[a-zA-Z]/gim},h=e=>{return null===e||"null"===e?a.Null:e||0===e||!1===e?null===new RegExp(l.date).exec(e)||isNaN(Date.parse(e))?new RegExp(l.currency).exec(e)?a.Currency:!new RegExp(l.string).exec(e)&&new RegExp(l.float).exec(e.toString())?a.Float:isNaN(e)&&0!==e?Array.isArray(e)?a.Array:"object"==typeof e?a.Object:a.String:a.Number:a.Date:a.Undefined},u=(t,e)=>{const s={value:void 0,type:e=e||h(t),currencySign:""};switch(s.type){case a.String:s.value=t.toString();break;case a.Float:case a.Currency:var r=(t=t.toString()).match(new RegExp(/(,)/gim)),n=t.match(new RegExp(/(\.)/gim));if(r)for(let e=1;e<=r.length;e++)t=e!==r.length||n?t.replace(",",""):t.replace(",",".");if(s.type===a.Currency){const o=new RegExp(l.currencySign);var i=o.exec(t);s.currencySign=null!==i?i[0]:"",t=t.replace(o,"")}s.value=parseFloat(t).toPrecision(12);break;case a.Number:s.value=Number(t);break;case a.Date:s.value=Date.parse(t);break;case a.Array:t.length?"object"==typeof t[0]?s.value=t.map(e=>JSON.stringify(e)).join(", "):s.value=t.join(", "):s.value="";break;case a.Object:s.value=t;break;case a.Undefined:s.value="";break;case a.Null:s.value=null}return s};function v(e,t){var s;let r;for(s of e.split("."))s=s.trim(),r?"object"!=typeof r||Array.isArray(r)||(r=r[s]):r=t[s];return r}const m=(e,t)=>tet<=e,w=(e,t)=>e<=t,k=(e,t,s)=>s?e.toLowerCase()==t.toLowerCase():e==t,E=(e,t)=>e===t,_=(e,t)=>e!=t,x=(e,t)=>e!==t,A=(e,t)=>null!=t&&"string"==typeof e&&0<=e.toLowerCase().indexOf(t.toString().toLowerCase()),L=(e,t)=>null!=t&&0<=e.toString().toLowerCase().indexOf(t.toString().toLowerCase()),T=(e,t)=>null!=t&&"string"==typeof e&&e.toLowerCase().indexOf(t.toString().toLowerCase())<0;function t(s,r){if(0===r.length)return s;{var n=s;const o=[],a=[];let e=[];for(const l of r)l.type&&l.type!==c.And?(e.length&&a.push(e),e=[l]):e.push(l);a.push(e);let t=[];for(const e of a)t=t.concat(C(n,e));t=[...new Set(t)];var i=n.length;for(let e=0;e":return m;case"<":return f;case">=":return b;case"<=":return w;case"is":case"==":return k;case"!is":case"!=":return _;case"===":return E;case"!==":return x;case"like":case"~":case"contains":return A;case"!contains":case"!like":case"!~":return T;default:return L}}(a.operator);if(!l(i,o,a.ignoreCase)){e=!1;break}}e&&s.push(r)}return s};function s(e,t){if(!t||0===t.length)return e;if(1{if(0===s.length)s=s.concat(o(n,e));else{for(const t of s)r=r.concat(o(t,e));s=r,r=[]}}),s}return o(e,t[0])}function o(e,t){const s=[],r=[];do{if(!e||0===e.length)break;var n=e.shift();if(!n)break;const o=n[t];var i=r.indexOf(o.toString());0<=i?s[i].push(n):(r.push(o.toString()),void 0!==s[r.length-1]?s[r.length-1].push(n):s.push([n]))}while(0{if(t){var s=e;const r={};for(const n of t){let e=s.map(e=>e[n].toString());const i=e.map(e=>h(e));i.some(e=>e===a.Float)?(e=e.map(e=>parseFloat(e)),r[n]=parseFloat(e.reduce((e,t)=>e+t).toFixed(2))):(e=e.map(e=>parseInt(e)),r[n]=e.reduce((e,t)=>e+t))}return r}return{}};class S{model;sortDetails=[];filterDetails=[];selection=[];groupByProperties=[];distinctProperties=[];concatenationToken=", ";constructor(e){this.model=JSON.parse(JSON.stringify(e))}sort(e){return this.sortDetails=e,this}orderBy(e,t){return this.sortDetails.push({propertyName:e,direction:t}),this}thenOrderBy(e,t){return this.orderBy(e,t)}filter(e){return Array.isArray(e)?this.filterDetails=e:this.filterDetails.push(e),this}where(e,t,s,r,n){return this.filterDetails.push({propertyName:e,operator:t,value:s,type:r,ignoreCase:n}),this}andWhere(e,t,s,r){return this.where(e,t,s,c.And,r),this}orWhere(e,t,s,r){return this.where(e,t,s,c.Or,r),this}group(e){return this.groupByProperties=e,this}groupBy(e){return this.groupByProperties.push(e),this}thenGroupBy(e){return this.groupByProperties.push(e),this}select(e){return Array.isArray(e)?this.selection=e:"*"!==e&&(this.selection=[e]),this}distinct(e,t){return t&&(this.concatenationToken=t),Array.isArray(e)?this.distinctProperties=e:e&&(this.distinctProperties=[e]),this}execute(){return s(function(t,s){if(0===s.length)return t;{var r=s;let e=[];for(const n of t){const i={};for(const o of r)i[o]=n[o];e.push(i)}return e}}(function(s,r,d){if(!r||!r.length)return s;const n=[],h=[];for(const m of s){const o={};let t="";for(const e of r){var u=v(e,m);o[e]=u,t+=u}if(!h.includes(t)){let e=s;for(const a of Object.keys(o))e=e.filter(e=>e[a]===o[a]);h.push(t),n.push(e)}}const t=[];for(const f of n){let e={};for(const l of f){var i,p=Object.keys(e);if(p.length)for(const c of p)r.includes(c)||(i=e[c],Array.isArray(i)?(i=l[c],Array.isArray(i)?e[c]=[...new Set(...e[c].concat(l[c]))]:e[c].includes(l[c])||e[c].push(l[c])):isNaN(e[c])&&isNaN(l[c])?e[c]!==l[c]&&(e[c]=[e[c],l[c]]):e[c]=e[c]+l[c]);else e=l}t.push(e)}return t.forEach(e=>{for(const t in e)Array.isArray(e[t])&&(e[t]=e[t].join(d))}),t}(r(t(JSON.parse(JSON.stringify(this.model)),this.filterDetails),this.sortDetails),this.distinctProperties,this.concatenationToken),this.selection),this.groupByProperties)}sum(e,t){e=Array.isArray(e)?e:[e];return i(t||this.model,e)}}function I(e,t){t=t?t.toUpperCase():"FLK-";return e.toUpperCase().includes(t)}function d(e,t){var{timeStamp:s,type:r,x:n,y:i}=e;let o=e.target;do{if(!o||"HTML"===o.tagName||I(o.tagName,t)){"HTML"===o.tagName&&(o=null);break}}while(o=o.parentNode||o.parentElement,!I(o.tagName,t));return{target:o,timeStamp:s,type:r,x:n,y:i}}function B(e,t){let s=e.target,r="";for(;s.dataset[t]?r=s.dataset[t]:s=s.parentNode,!r;);return r}class n{constructor(){}_topLevelClasses=[];_events=[];generateId(){return"flk-"+function e(){const t=([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)),s=t.split("-")[0];return window.$flightkitUUIDStore||(window.$flightkitUUIDStore=[]),window.$flightkitUUIDStore.some(e=>e===s)?e():(window.$flightkitUUIDStore.push(s),s)}()}render(t){if(!t.component)throw new Error("Component is not assigned! Can't render");t.id=t.id||this.generateId();var e=this._getAllEventAttributes(t);if(e){var s="#"+t.id;for(const i of e){var r="e-"+i;this.addEvent(s,i,t.getAttribute(r))}}var n=Object.keys(t.classList).length;if(n){for(let e=0;e{this._assignToDom(t,t.component),clearTimeout(this._renderTimer)},10)}addEvent(e,t,s){this._events.push({selector:e,eventType:t,callback:s})}_getExternalCallback(e){let t=void 0;for(const s of e.split("."))t=(t||window)[s];return t}_getAllEventAttributes(e){e=e.attributes;const t=Array.from(e).filter(e=>e.name.startsWith("e-"));return t.map(e=>e.name.slice(2))}_isFlightkitElement(e){return e.toUpperCase().includes("FLK-")}_outerEventHandler(e){const t=d(e),s=(t.contents=e.detail,t.target.getAttribute("e-"+t.type));let r=void 0;for(const n of s.split("."))r=(r||window)[n];return e.preventDefault(),e.stopPropagation(),r(t)}_addEvents(e){if(e.isConnected)for(const s of this._events)if(s.selector.startsWith("."))for(const r of document.querySelectorAll(s.selector))this._addEventToElement(s,r);else{var t=document.querySelector(s.selector);this._addEventToElement(s,t)}}_addEventToElement(e,t){t&&("function"==typeof e.callback?(t.removeEventListener(e.eventType,e.callback),t.addEventListener(e.eventType,e.callback)):(t.removeEventListener(e.eventType,this._outerEventHandler),t.addEventListener(e.eventType,this._outerEventHandler)))}removeEvents(){for(const t of this._events)if(t.selector.startsWith("."))for(const s of document.querySelectorAll(t.selector))this._addEventToElement(t,s);else{var e=document.querySelector(t.selector);this._addEventToElement(t,e)}this._events=[]}_removeEventToElement(e,t){t&&("function"==typeof e.callback?t.removeEventListener(e.eventType,e.callback):t.removeEventListener(e.eventType,this._outerEventHandler))}_assignToDom(e,t){e.innerHTML="";for(const r of Array.isArray(t)?t:[t])e.append(r);const s=setTimeout(()=>{this._addEvents(e),clearTimeout(s)},10)}}const p='',N='';function D(e){const t=new DOMParser;return t.parseFromString(e,"image/svg+xml").documentElement}class O extends HTMLElement{base;component=null;_contents=[];_orderBy=[];properties=new Set;_columnOrder=[];_filter="";_selectionProperty="";_selectedIds=new Set;uniqueEntriesByProperties={};propertyLabelDictionary={};_templates={};_templateClasses={};static get observedAttributes(){return["contents","columns","order","filter","selection-property","templates"]}get columnOrder(){return this._columnOrder.length?this._columnOrder:this.properties}set columnOrder(e){let t;"string"==typeof e&&(t=e.split(",")),t=e,this._columnOrder=t}get contents(){return this._contents}set contents(e){this.analyzeData(e),this._contents=new S(e)}get orderBy(){return this._orderBy}set orderBy(e){if(Array.isArray(e))this._orderBy=e;else{const r=[];for(const n of e.split(",")){var t=n.split("|"),s=t[0],t=1e[s._selectionProperty])):new Set;e=t?s.contents.execute():[];s._emit("select",s,{selection:e}),s._updateCheckboxes(s)}emitSelect(e){var t=e.target.checked,s=e.target.dataset.objectId;const r=d(e).target,n=(t?r._selectedIds.add(s):r._selectedIds.delete(s),r._selectionProperty);e=r.contents.execute().filter(e=>r._selectedIds.has(e[n]));r._emit("select",r,{selection:e}),r._updateCheckboxes(r)}sortData(e){const t=d(e).target,s=B(e,"column");s&&(-1<(e=t._orderBy.findIndex(e=>e.propertyName===s))?"asc"===t._orderBy[e].direction?t._orderBy[e].direction="desc":t._orderBy.splice(e,1):t._orderBy.push({propertyName:s,direction:"asc"}),t.createHtml(),t.base.render(t))}setColumnOrder(e){this._columnOrder=e?Array.isArray(e)?e:e.split(","):[]}analyzeData(t){this.properties=new Set;var s=t.length;for(let e=0;e"_"===e?" ":" "+e.toLowerCase()).trim();var s=t.charAt(0).toUpperCase()+t.slice(1);return this.propertyLabelDictionary[e]=s}parseTemplate(e,r){return e.replace(/\{\{([\s\S]+?)\}\}/gim,(e,t)=>{let s="";t=t.trim();t=r[t];return t&&(s=t),Array.isArray(s)?s.join(", "):s.toString().trim()})}createSelectionCheckbox(e){const t=document.createElement("input");return t.setAttribute("type","checkbox"),t.classList.add("flk-selection-checkbox"),e&&(t.dataset.selected=e[this._selectionProperty]),t}createRow(e){const t=document.createElement("tr");if(this._selectionProperty.length){const n=document.createElement("td");var s=this.base.generateId();const i=this.createSelectionCheckbox(e);i.id=s,i.dataset.objectId=e[this._selectionProperty];var r=e[this._selectionProperty];this._selectedIds.has(r)?i.checked=!0:i.checked=!1,this.base.addEvent("#"+s,"change",this.emitSelect),n.append(i),t.append(n)}for(const o of this.columnOrder){const a=document.createElement("td");this._templates[o]?(a.innerHTML=this.parseTemplate(this._templates[o],e),this._templateClasses[o]&&a.classList.add(...this._templateClasses[o])):a.innerText=e[o],t.append(a)}return t}createBody(e){const t=document.createElement("tbody");for(const r of e){var s=this.createRow(r,null);t.append(s)}return t}createHead(){const e=document.createElement("thead"),t=document.createElement("tr");if(t.classList.add("cursor-pointer"),this._selectionProperty.length){const n=document.createElement("th");var s=this.base.generateId();const i=this.createSelectionCheckbox();i.id=s;var d=this.contents.execute().length;0e.propertyName===o);if(r){const c=document.createElement("span");c.innerHTML="asc"===r.direction?'':'',a.append(c)}t.append(a)}return e.append(t),e}addEvent(e,t,s){this.base.addEvent(e,t,s)}init(){this.createHtml(),this.base.render(this)}}class j extends HTMLElement{base;componentId;constructor(){super(),this.base=new n}connectedCallback(){var e=this.getAttribute("top"),t=this.getAttribute("left"),s=this.getAttribute("center"),r=this.getAttribute("zIndex");this.id||(this.id=this.base.generateId()),this.style.display="block",this.style.position="fixed","string"==typeof s?(this.style.top=e||"50%",this.style.left="50%",this.style.transform="translate(-50%, -50%)"):(this.style.top=e||this.clientTop+"px",this.style.left=t||this.clientLeft+"px"),r&&(this.style.zIndex=r),this.componentId=this.getAttribute("handle");const n=document.createElement("div");n.innerHTML=this.innerHTML,this.component=n;s="#"+(this.componentId||this.id);this.base.addEvent(s,"mousedown",this._dragElement),this.base.addEvent(s,"mouseup",this._reset),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this)}_dragElement(e){const s=d(e,"flk-draggable").target;let r,n;function t(e){r=e.clientX-s.offsetLeft,n=e.clientY-s.offsetTop}function i(e){var t=e.clientX-r,e=e.clientY-n;s.style.left=t+"px",s.style.top=e+"px"}function o(e){e.preventDefault()}function a(){s.removeAttribute("draggable"),s.removeEventListener("dragstart",t),s.removeEventListener("dragend",a),document.removeEventListener("dragover",o),document.removeEventListener("drop",i)}s.setAttribute("draggable",!0),s.addEventListener("dragstart",t),s.addEventListener("dragend",a),document.addEventListener("dragover",o),document.addEventListener("drop",i)}}class M extends HTMLElement{_id;base;_draggableId;constructor(){super(),this.base=new n}_emit(e,t,s){e=new CustomEvent(e,{detail:s,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}_closeModal(e){e.stopPropagation();const t=d(e,"flk-modal").target;t.classList.add("hidden")}closeModal(e){this.classList.add("hidden")}openModal(e=!0){const t=document.getElementById(this._draggableId);e&&(t.style.top="40%",t.style.left="50%"),this.classList.remove("hidden")}connectedCallback(){this.id||(this.id=this.base.generateId());const e=document.createElement("div");var t=this.base.generateId();const s=document.createElement("flk-draggable"),r=(this._draggableId=this.base.generateId(),s.id=this._draggableId,s.setAttribute("center",""),s.setAttribute("top","40%"),s.setAttribute("handle",t),s.setAttribute("zIndex","1080"),s.classList.add("border","shadow-lg","bg-white"),s.style.width="max-content",document.createElement("div"));var n=this.getAttribute("modal-title");if(n){const c=document.createElement("span");c.innerText=n,c.classList.add("ml-1","mr-auto"),r.append(c)}r.id=t;const i=this.getAttribute("header-class");let o=[];i?o=o.concat(i.split(" ")):o.push("bg-gray-light"),r.classList.add(...o,"border-bottom","row","justify-end","cursor-no-select");n=this.base.generateId();const a=document.createElement("button"),l=(a.classList.add("py-0","px-1","outline-hover","no-border","cursor-default",...o),a.innerText="X",a.id=n,r.append(a),s.append(r),document.createElement("div"));l.innerHTML=this.innerHTML,s.append(l),e.append(s),this.component=e,this.base.addEvent("#"+n,"click",this._closeModal),this.base.render(this),this.classList.add("hidden")}disconnectedCallback(){this.base.removeEvents(this)}}class H extends HTMLElement{base;_buttonId;_drawerId;_iconId;constructor(){super(),this.base=new n}connectedCallback(){this.style.position="relative",this.style.display="flex",this.style.width="fit-content",this._buttonId=this.base.generateId();const e=document.createElement("button"),t=(e.classList.add("row"),e.id=this._buttonId,document.createElement("span")),s=(t.innerText=this.getAttribute("text"),this._iconId=this.base.generateId(),document.createElement("span"));var r=D('');const n=D(''),i=(n.classList.add("hidden"),s.append(r,n),s.id=this._iconId,e.append(t,s),this._drawerId=this.base.generateId(),document.createElement("div"));i.id=this._drawerId,i.classList.add("shadow","inline-block","bg-white"),i.style.position="absolute",i.style.zIndex="1040";r=this.querySelector("template");r.innerHTML.length?i.innerHTML=r.innerHTML:i.append(r.firstChild),i.style.display="none",this.component=[e,i],this.base.addEvent("#"+this._buttonId,"click",this.toggleMenu);const o=document.querySelector("body");""!==o.getAttribute("flk-close-dropdown")&&(o.setAttribute("flk-close-dropdown",""),o.addEventListener("click",this.closeAllDropdownButtons)),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this);var e=document.querySelectorAll("flk-dropdown");if(!e||!e.length){const t=document.querySelector("body");t.removeAttribute("flk-close-dropdown"),t.removeEventListener("click",this.closeAllDropdownButtons)}}toggleMenu(e){const t=d(e).target;e=t._drawerId;const s=document.getElementById(e);var e="none"!==s.style.display,r=(s.style.display=e?"none":"block",t.getAttribute("drawer-width")),r=("string"==typeof t.getAttribute("right")&&(s.style.right="0px"),s.style.top=t.offsetHeight+"px",s.style.width=r||t.offsetWidth+"px",t._iconId);const n=document.getElementById(r);e?(n.childNodes[0].classList.remove("hidden"),n.childNodes[1].classList.add("hidden")):(n.childNodes[0].classList.add("hidden"),n.childNodes[1].classList.remove("hidden"))}_closeDropdown(){var e=this._drawerId;const t=document.getElementById(e);if("none"!==t.style.display){e=this._iconId;const s=document.getElementById(e);t.style.display="none",s.childNodes[0].classList.remove("hidden"),s.childNodes[1].classList.add("hidden")}}closeAllDropdownButtons(e){var t,s=d(e,"flk-dropdown").target,e=document.querySelectorAll("flk-dropdown");if(s)for(const r of e)s._buttonId!==r._buttonId&&(t=r._drawerId,"none"!==document.getElementById(t).style.display&&r._closeDropdown());else for(const n of e)n._closeDropdown()}}class P extends HTMLElement{base;contents;component;listType="ul";iconSet;filter={value:"",caseSensitive:!1};static get observedAttributes(){return["contents","icon-set","max-depth","filter"]}_jsonToValueArray(e){let t=JSON.stringify(e);t=t.replace(/[\[\]{}\"]/g,"");let s=[];for(const r of t.split(","))s=s.concat(r.split(":"));return[...new Set(s)]}_emit(e,t,s){e=new CustomEvent(e,{detail:s,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}constructor(){super(),this.base=new n,this.setContents(this.getAttribute("contents")),this.iconSet=this.getAttribute("icon-set")?this.getAttribute("icon-type"):"file",this.maxDepth=this.getAttribute("max-depth")?parseInt(this.getAttribute("max-depth")):-1,this.setFilter(this.getAttribute("filter")),this.style.display="block",this.style.maxWidth="fit-content",this.style.margin="0 1rem 0 0",this.base.addEvent(".flk-branch","click",this.emitNodeToggle)}emitNodeToggle(e){e.stopPropagation();const t=d(e,"flk-tree-nav").target,s=B(e,"branchKey");let r=t.contents;const n=s.split(".");for(const o of n)if(r[o])r=r[o];else if(null===r[o])r=null;else{let e=[];for(const a of r)a[o]&&e.push(a[o]);r=e}var e=s.substring(s.indexOf(".")+1),i=t.createLeafText(n.reverse()[0]);t._emit("tree-click",t,{path:e,data:r,key:(i.titleText+" "+i.commentText).trim(),branch:"object"==typeof r})}convertJsonKeyToTitle(e){if(!e)return"";const t=(e="string"!=typeof e?e.toString():e).replace(/([A-Z_])/g,e=>"_"===e?" ":" "+e).trim();return t.charAt(0).toUpperCase()+t.slice(1)}setContents(e){var t=e||this.contents||[];try{switch(typeof t){case"string":this.contents=JSON.parse(t);break;case"object":Array.isArray(t)?this.contents=t:this.contents=[t]}}catch(e){console.log(e)}}applyFilter(e){let t;var s="details"===e.tagName.toLowerCase();t=this.filter.caseSensitive?e.dataset.branchValues.includes(this.filter.value):e.dataset.branchValues.toLowerCase().includes(this.filter.value.toLowerCase()),t?e.parentElement.classList.remove("hidden"):e.parentElement.classList.add("hidden"),s&&t?e.setAttribute("open",""):e.removeAttribute("open")}resetTree(e){e.parentElement.classList.remove("hidden"),e.removeAttribute("open")}filterTree(){let t=setTimeout(()=>{for(const e of this.querySelectorAll("[data-branch-values]"))void 0===this.filter.value||0===this.filter.value.length?this.resetTree(e):this.applyFilter(e);clearTimeout(t)},10)}setFilter(e){const t=e||{};try{switch(typeof t){case"string":t.includes("{")?(this.filter=JSON.parse(t),!1===this.filter.caseSensitive&&(this.filter.value=this.filter.value.toLowerCase())):this.filter.value=e.toLowerCase();break;case"object":this.filter=t}}catch(e){console.log(e)}this.filterTree()}createLeafText(e){var t,s;let r="",n="";return"string"==typeof e&&(e.includes("(")||e.includes("["))?(s=e.indexOf("("),s=-1===(t=e.indexOf("["))?s:t,r=this.convertJsonKeyToTitle(e.substring(0,s)),n=e.substring(s)):r=this.convertJsonKeyToTitle(e),{titleText:r,commentText:n}}createTextTag(r,n){r=this.createLeafText(r);if(r.commentText){let e=document.createElement("div"),t=document.createElement("span"),s=(t.innerText=r.titleText,document.createElement("small"));s.innerText=r.commentText,s.style.marginLeft="1rem",e.append(t,s),e.style.display="inline-flex",e.style.alignItems="center",n.append(e)}else n.innerText=r.titleText}createLeaf(e,t,s,r=[]){let n=document.createElement("li");n.classList.add("cursor-no-select"),n.style.marginTop="0.4rem",n.dataset.branchKey=s;const i="file"===this.iconSet?'':'';n.style.listStyleImage=`url('data:image/svg+xml,${i}')`,n.style.position="relative",n.style.left="2px";let o=document.createElement("span");s=[e].concat(r);if(o.dataset.branchValues=[...new Set(s)].join(),r.length&&(o.dataset.leafKey=s[0]),this.createTextTag(e,o),o.style.position="relative",o.style.top="-3px",n.append(o),t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);const i="file"===this.iconSet?p:N;e.style.listStyleImage=`url('data:image/svg+xml,${i}')`,e.append(n),t.append(e)}else t.append(n)}createBranch(s,t,r,n){if(n===this.maxDepth&&"object"==typeof s)for(const o of Array.isArray(s)?s:Object.keys(s)){let e;s[o]&&(e=this._jsonToValueArray(s[o])),this.createLeaf(o,t,r+"."+o,e)}else if(Array.isArray(s))for(var e in s){var d=document.createElement(this.listType);t.append(this.createBranch(s[e],d,r+"."+e,n+1))}else if(null!==s&&"object"==typeof s){const a=[];for(const l of Object.keys(s)){let e=document.createElement("li"),t=(e.classList.add("cursor-no-select"),e.style.position="relative",e.style.left="2px",e.dataset.branchKey=r+"."+l,document.createElement("details"));t.classList.add("flk-branch"),t.dataset.branchValues=[l].concat(this._jsonToValueArray(s[l])),t.style.position="relative",t.style.top="-3px",t.classList.add("cursor-default");var i=document.createElement("summary");this.createTextTag(l,i),t.append(i),e.append(this.createBranch(s[l],t,r+"."+l,n+1)),a.push(e)}if(t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);var h="file"===this.iconSet?p:N;e.style.listStyleImage=`url('data:image/svg+xml,${h}')`;for(const c of a)e.append(c);t.append(e)}else for(const u of a)t.append(u)}else this.createLeaf(s,t,r);return t}createHtml(){let e=document.createElement(this.listType);var t="file"===this.iconSet?p:'';if(e.style.listStyleImage=`url('data:image/svg+xml,${t}')`,e.style.marginLeft="3rem",this.contents.length){for(const s in this.contents)e=this.createBranch(this.contents[s],e,s,0);this.component=e}else this.component=e}attributeChangedCallback(e,t,s){switch(e){case"contents":this.setContents(s);break;case"icon-set":this.iconSet=s;break;case"max-depth":this.maxDepth="string"==typeof s?parseInt(s):s;break;case"filter":this.setFilter(s)}this.init()}connectedCallback(){this.init()}disconnectedCallback(){this.base.removeEvents(this)}init(){this.createHtml(),this.base.render(this)}}customElements.define("flk-table",O),customElements.define("flk-draggable",j),customElements.define("flk-modal",M),customElements.define("flk-dropdown",H),customElements.define("flk-tree-nav",P)}(); \ No newline at end of file diff --git a/documentation/public/cdn/ibiss-v0.0.4/flightkit.min.js b/documentation/public/cdn/ibiss-v0.0.4/flightkit.min.js index 9a82b7a..930836a 100644 --- a/documentation/public/cdn/ibiss-v0.0.4/flightkit.min.js +++ b/documentation/public/cdn/ibiss-v0.0.4/flightkit.min.js @@ -1 +1 @@ -!function(e,n,s,i){"use strict";function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a,u,g,e=c(e),n=c(n),s=c(s),i=c(i);(t=a=a||{}).Date="date",t.String="string",t.Float="float",t.Number="number",t.Array="array",t.Object="object",t.Bool="bool",t.Currency="currency",t.Undefined="undefined",t.Null="null";const h={date:/^(\d{1,4}-\d{1,4}-\d{1,4}(T)?)/gim,currency:/^[$|€]\s?[0-9]*(\.|,)?\d*(\.|,)?\d*/gim,float:/\d+[,|.]\d+[,|.]?\d*/gim,currencySign:/\$|€/gim,array:/^\s?[[].[^,]+[\]],?/gi,precision:/[-+$€,.]/gm,string:/[a-zA-Z]/gim},m=e=>{return null===e||"null"===e?a.Null:e||0===e||!1===e?null===new RegExp(h.date).exec(e)||isNaN(Date.parse(e))?new RegExp(h.currency).exec(e)?a.Currency:!new RegExp(h.string).exec(e)&&new RegExp(h.float).exec(e.toString())?a.Float:isNaN(e)&&0!==e?Array.isArray(e)?a.Array:"object"==typeof e?a.Object:a.String:a.Number:a.Date:a.Undefined},y=(t,e)=>{const r={value:void 0,type:e=e||m(t),currencySign:""};switch(r.type){case a.String:r.value=t.toString();break;case a.Float:case a.Currency:var n=(t=t.toString()).match(new RegExp(/(,)/gim)),s=t.match(new RegExp(/(\.)/gim));if(n)for(let e=1;e<=n.length;e++)t=e!==n.length||s?t.replace(",",""):t.replace(",",".");if(r.type===a.Currency){const o=new RegExp(h.currencySign);var i=o.exec(t);r.currencySign=null!==i?i[0]:"",t=t.replace(o,"")}r.value=parseFloat(t).toPrecision(12);break;case a.Number:r.value=Number(t);break;case a.Date:r.value=Date.parse(t);break;case a.Array:t.length?"object"==typeof t[0]?r.value=t.map(e=>JSON.stringify(e)).join(", "):r.value=t.join(", "):r.value="";break;case a.Object:r.value=t;break;case a.Undefined:r.value="";break;case a.Null:r.value=null}return r};function v(e,t){var r;let n;for(r of e.split("."))r=r.trim(),n?"object"!=typeof n||Array.isArray(n)||(n=n[r]):n=t[r];return n}const b=(e,t)=>tet<=e,S=(e,t)=>e<=t,x=(e,t,r)=>r?e.toLowerCase()==t.toLowerCase():e==t,A=(e,t)=>e===t,k=(e,t)=>e!=t,E=(e,t)=>e!==t,L=(e,t)=>null!=t&&"string"==typeof e&&0<=e.toLowerCase().indexOf(t.toString().toLowerCase()),O=(e,t)=>null!=t&&0<=e.toString().toLowerCase().indexOf(t.toString().toLowerCase()),M=(e,t)=>null!=t&&"string"==typeof e&&e.toLowerCase().indexOf(t.toString().toLowerCase())<0;function P(r,n){if(0===n.length)return r;{var s=r;const o=[],a=[];let e=[];for(const l of n)l.type&&l.type!==u.And?(e.length&&a.push(e),e=[l]):e.push(l);a.push(e);let t=[];for(const e of a)t=t.concat(R(s,e));t=[...new Set(t)];var i=s.length;for(let e=0;e":return b;case"<":return _;case">=":return C;case"<=":return S;case"is":case"==":return x;case"!is":case"!=":return k;case"===":return A;case"!==":return E;case"like":case"~":case"contains":return L;case"!contains":case"!like":case"!~":return M;default:return O}}(a.operator);if(!l(i,o,a.ignoreCase)){e=!1;break}}e&&r.push(n)}return r};function T(e,t){if(!t||0===t.length)return e;if(1{if(0===r.length)r=r.concat(I(s,e));else{for(const t of r)n=n.concat(I(t,e));r=n,n=[]}}),r}return I(e,t[0])}function I(e,t){const r=[],n=[];do{if(!e||0===e.length)break;var s=e.shift();if(!s)break;const o=s[t];var i=n.indexOf(o.toString());0<=i?r[i].push(s):(n.push(o.toString()),void 0!==r[n.length-1]?r[n.length-1].push(s):r.push([s]))}while(0{if(t){var r=e;const n={};for(const s of t){let e=r.map(e=>e[s].toString());const i=e.map(e=>m(e));i.some(e=>e===a.Float)?(e=e.map(e=>parseFloat(e)),n[s]=parseFloat(e.reduce((e,t)=>e+t).toFixed(2))):(e=e.map(e=>parseInt(e)),n[s]=e.reduce((e,t)=>e+t))}return n}return{}};class D{model;sortDetails=[];filterDetails=[];selection=[];groupByProperties=[];distinctProperties=[];concatenationToken=", ";constructor(e){this.model=JSON.parse(JSON.stringify(e))}sort(e){return this.sortDetails=e,this}orderBy(e,t){return this.sortDetails.push({propertyName:e,direction:t}),this}thenOrderBy(e,t){return this.orderBy(e,t)}filter(e){return Array.isArray(e)?this.filterDetails=e:this.filterDetails.push(e),this}where(e,t,r,n,s){return this.filterDetails.push({propertyName:e,operator:t,value:r,type:n,ignoreCase:s}),this}andWhere(e,t,r,n){return this.where(e,t,r,u.And,n),this}orWhere(e,t,r,n){return this.where(e,t,r,u.Or,n),this}group(e){return this.groupByProperties=e,this}groupBy(e){return this.groupByProperties.push(e),this}thenGroupBy(e){return this.groupByProperties.push(e),this}select(e){return Array.isArray(e)?this.selection=e:"*"!==e&&(this.selection=[e]),this}distinct(e,t){return t&&(this.concatenationToken=t),Array.isArray(e)?this.distinctProperties=e:e&&(this.distinctProperties=[e]),this}execute(){return T(function(t,r){if(0===r.length)return t;{var n=r;let e=[];for(const s of t){const i={};for(const o of n)i[o]=s[o];e.push(i)}return e}}(function(r,n,u){if(!n||!n.length)return r;const s=[],h=[];for(const f of r){const o={};let t="";for(const e of n){var p=v(e,f);o[e]=p,t+=p}if(!h.includes(t)){let e=r;for(const a of Object.keys(o))e=e.filter(e=>e[a]===o[a]);h.push(t),s.push(e)}}const t=[];for(const m of s){let e={};for(const l of m){var i,d=Object.keys(e);if(d.length)for(const c of d)n.includes(c)||(i=e[c],Array.isArray(i)?(i=l[c],Array.isArray(i)?e[c]=[...new Set(...e[c].concat(l[c]))]:e[c].includes(l[c])||e[c].push(l[c])):isNaN(e[c])&&isNaN(l[c])?e[c]!==l[c]&&(e[c]=[e[c],l[c]]):e[c]=e[c]+l[c]);else e=l}t.push(e)}return t.forEach(e=>{for(const t in e)Array.isArray(e[t])&&(e[t]=e[t].join(u))}),t}(B(P(JSON.parse(JSON.stringify(this.model)),this.filterDetails),this.sortDetails),this.distinctProperties,this.concatenationToken),this.selection),this.groupByProperties)}sum(e,t){e=Array.isArray(e)?e:[e];return j(t||this.model,e)}}function U(e,t){t=t?t.toUpperCase():"FLK-";return e.toUpperCase().includes(t)}function F(e,t){var{timeStamp:r,type:n,x:s,y:i}=e;let o=e.target;do{if(!o||"HTML"===o.tagName||U(o.tagName,t)){"HTML"===o.tagName&&(o=null);break}}while(o=o.parentNode||o.parentElement,!U(o.tagName,t));return{target:o,timeStamp:r,type:n,x:s,y:i}}function z(e,t){let r=e.target,n="";for(;r.dataset[t]?n=r.dataset[t]:r=r.parentNode,!n;);return n}class ${constructor(){}_topLevelClasses=[];_events=[];generateId(){return"flk-"+function e(){const t=([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)),r=t.split("-")[0];return window.$flightkitUUIDStore||(window.$flightkitUUIDStore=[]),window.$flightkitUUIDStore.some(e=>e===r)?e():(window.$flightkitUUIDStore.push(r),r)}()}render(t){if(!t.component)throw new Error("Component is not assigned! Can't render");t.id=t.id||this.generateId();var e=this._getAllEventAttributes(t);if(e){var r="#"+t.id;for(const i of e){var n="e-"+i;this.addEvent(r,i,t.getAttribute(n))}}var s=Object.keys(t.classList).length;if(s){for(let e=0;e{this._assignToDom(t,t.component),clearTimeout(this._renderTimer)},10)}addEvent(e,t,r){this._events.push({selector:e,eventType:t,callback:r})}_getExternalCallback(e){let t=void 0;for(const r of e.split("."))t=(t||window)[r];return t}_getAllEventAttributes(e){e=e.attributes;const t=Array.from(e).filter(e=>e.name.startsWith("e-"));return t.map(e=>e.name.slice(2))}_isFlightkitElement(e){return e.toUpperCase().includes("FLK-")}_outerEventHandler(e){const t=F(e),r=(t.contents=e.detail,t.target.getAttribute("e-"+t.type));let n=void 0;for(const s of r.split("."))n=(n||window)[s];return e.preventDefault(),e.stopPropagation(),n(t)}_addEvents(e){if(e.isConnected)for(const r of this._events)if(r.selector.startsWith("."))for(const n of document.querySelectorAll(r.selector))this._addEventToElement(r,n);else{var t=document.querySelector(r.selector);this._addEventToElement(r,t)}}_addEventToElement(e,t){t&&("function"==typeof e.callback?(t.removeEventListener(e.eventType,e.callback),t.addEventListener(e.eventType,e.callback)):(t.removeEventListener(e.eventType,this._outerEventHandler),t.addEventListener(e.eventType,this._outerEventHandler)))}removeEvents(){for(const t of this._events)if(t.selector.startsWith("."))for(const r of document.querySelectorAll(t.selector))this._addEventToElement(t,r);else{var e=document.querySelector(t.selector);this._addEventToElement(t,e)}this._events=[]}_removeEventToElement(e,t){t&&("function"==typeof e.callback?t.removeEventListener(e.eventType,e.callback):t.removeEventListener(e.eventType,this._outerEventHandler))}_assignToDom(e,t){e.innerHTML="";for(const n of Array.isArray(t)?t:[t])e.append(n);const r=setTimeout(()=>{this._addEvents(e),clearTimeout(r)},10)}}const G='',H='';function V(e){const t=new DOMParser;return t.parseFromString(e,"image/svg+xml").documentElement}class W extends HTMLElement{base;component=null;_contents=[];_orderBy=[];properties=new Set;_columnOrder=[];_filter="";_selectionProperty="";_selectedIds=new Set;uniqueEntriesByProperties={};propertyLabelDictionary={};_templates={};_templateClasses={};static get observedAttributes(){return["contents","columns","order","filter","selection-property","templates"]}get columnOrder(){return this._columnOrder.length?this._columnOrder:this.properties}set columnOrder(e){let t;"string"==typeof e&&(t=e.split(",")),t=e,this._columnOrder=t}get contents(){return this._contents}set contents(e){this.analyzeData(e),this._contents=new D(e)}get orderBy(){return this._orderBy}set orderBy(e){if(Array.isArray(e))this._orderBy=e;else{const n=[];for(const s of e.split(",")){var t=s.split("|"),r=t[0],t=1e[r._selectionProperty])):new Set;e=t?r.contents.execute():[];r._emit("select",r,{selection:e}),r._updateCheckboxes(r)}emitSelect(e){var t=e.target.checked,r=e.target.dataset.objectId;const n=F(e).target,s=(t?n._selectedIds.add(r):n._selectedIds.delete(r),n._selectionProperty);e=n.contents.execute().filter(e=>n._selectedIds.has(e[s]));n._emit("select",n,{selection:e}),n._updateCheckboxes(n)}sortData(e){const t=F(e).target,r=z(e,"column");r&&(-1<(e=t._orderBy.findIndex(e=>e.propertyName===r))?"asc"===t._orderBy[e].direction?t._orderBy[e].direction="desc":t._orderBy.splice(e,1):t._orderBy.push({propertyName:r,direction:"asc"}),t.createHtml(),t.base.render(t))}setColumnOrder(e){this._columnOrder=e?Array.isArray(e)?e:e.split(","):[]}analyzeData(t){this.properties=new Set;var r=t.length;for(let e=0;e"_"===e?" ":" "+e.toLowerCase()).trim();var r=t.charAt(0).toUpperCase()+t.slice(1);return this.propertyLabelDictionary[e]=r}parseTemplate(e,n){return e.replace(/\{\{([\s\S]+?)\}\}/gim,(e,t)=>{let r="";t=t.trim();t=n[t];return t&&(r=t),Array.isArray(r)?r.join(", "):r.toString().trim()})}createSelectionCheckbox(e){const t=document.createElement("input");return t.setAttribute("type","checkbox"),t.classList.add("flk-selection-checkbox"),e&&(t.dataset.selected=e[this._selectionProperty]),t}createRow(e){const t=document.createElement("tr");if(this._selectionProperty.length){const s=document.createElement("td");var r=this.base.generateId();const i=this.createSelectionCheckbox(e);i.id=r,i.dataset.objectId=e[this._selectionProperty];var n=e[this._selectionProperty];this._selectedIds.has(n)?i.checked=!0:i.checked=!1,this.base.addEvent("#"+r,"change",this.emitSelect),s.append(i),t.append(s)}for(const o of this.columnOrder){const a=document.createElement("td");this._templates[o]?(a.innerHTML=this.parseTemplate(this._templates[o],e),this._templateClasses[o]&&a.classList.add(...this._templateClasses[o])):a.innerText=e[o],t.append(a)}return t}createBody(e){const t=document.createElement("tbody");for(const n of e){var r=this.createRow(n,null);t.append(r)}return t}createHead(){const e=document.createElement("thead"),t=document.createElement("tr");if(t.classList.add("cursor-pointer"),this._selectionProperty.length){const s=document.createElement("th");var r=this.base.generateId();const i=this.createSelectionCheckbox();i.id=r;var u=this.contents.execute().length;0e.propertyName===o);if(n){const c=document.createElement("span");c.innerHTML="asc"===n.direction?'':'',a.append(c)}t.append(a)}return e.append(t),e}addEvent(e,t,r){this.base.addEvent(e,t,r)}init(){this.createHtml(),this.base.render(this)}}class J extends HTMLElement{base;componentId;constructor(){super(),this.base=new $}connectedCallback(){var e=this.getAttribute("top"),t=this.getAttribute("left"),r=this.getAttribute("center"),n=this.getAttribute("zIndex");this.id||(this.id=this.base.generateId()),this.style.display="block",this.style.position="fixed","string"==typeof r?(this.style.top=e||"50%",this.style.left="50%",this.style.transform="translate(-50%, -50%)"):(this.style.top=e||this.clientTop+"px",this.style.left=t||this.clientLeft+"px"),n&&(this.style.zIndex=n),this.componentId=this.getAttribute("handle");const s=document.createElement("div");s.innerHTML=this.innerHTML,this.component=s;r="#"+(this.componentId||this.id);this.base.addEvent(r,"mousedown",this._dragElement),this.base.addEvent(r,"mouseup",this._reset),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this)}_dragElement(e){const r=F(e,"flk-draggable").target;let n,s;function t(e){n=e.clientX-r.offsetLeft,s=e.clientY-r.offsetTop}function i(e){var t=e.clientX-n,e=e.clientY-s;r.style.left=t+"px",r.style.top=e+"px"}function o(e){e.preventDefault()}function a(){r.removeAttribute("draggable"),r.removeEventListener("dragstart",t),r.removeEventListener("dragend",a),document.removeEventListener("dragover",o),document.removeEventListener("drop",i)}r.setAttribute("draggable",!0),r.addEventListener("dragstart",t),r.addEventListener("dragend",a),document.addEventListener("dragover",o),document.addEventListener("drop",i)}}class q extends HTMLElement{_id;base;_draggableId;constructor(){super(),this.base=new $}_emit(e,t,r){e=new CustomEvent(e,{detail:r,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}_closeModal(e){e.stopPropagation();const t=F(e,"flk-modal").target;t.classList.add("hidden")}closeModal(e){this.classList.add("hidden")}openModal(e=!0){const t=document.getElementById(this._draggableId);e&&(t.style.top="40%",t.style.left="50%"),this.classList.remove("hidden")}connectedCallback(){this.id||(this.id=this.base.generateId());const e=document.createElement("div");var t=this.base.generateId();const r=document.createElement("flk-draggable"),n=(this._draggableId=this.base.generateId(),r.id=this._draggableId,r.setAttribute("center",""),r.setAttribute("top","40%"),r.setAttribute("handle",t),r.setAttribute("zIndex","1080"),r.classList.add("border","shadow-lg","bg-white"),r.style.width="max-content",document.createElement("div"));var s=this.getAttribute("modal-title");if(s){const c=document.createElement("span");c.innerText=s,c.classList.add("ml-1","mr-auto"),n.append(c)}n.id=t;const i=this.getAttribute("header-class");let o=[];i?o=o.concat(i.split(" ")):o.push("bg-gray-light"),n.classList.add(...o,"border-bottom","row","justify-end","cursor-no-select");s=this.base.generateId();const a=document.createElement("button"),l=(a.classList.add("py-0","px-1","outline-hover","no-border","cursor-default",...o),a.innerText="X",a.id=s,n.append(a),r.append(n),document.createElement("div"));l.innerHTML=this.innerHTML,r.append(l),e.append(r),this.component=e,this.base.addEvent("#"+s,"click",this._closeModal),this.base.render(this),this.classList.add("hidden")}disconnectedCallback(){this.base.removeEvents(this)}}class K extends HTMLElement{base;_buttonId;_drawerId;_iconId;constructor(){super(),this.base=new $}connectedCallback(){this.style.position="relative",this.style.display="flex",this.style.width="fit-content",this._buttonId=this.base.generateId();const e=document.createElement("button"),t=(e.classList.add("row"),e.id=this._buttonId,document.createElement("span")),r=(t.innerText=this.getAttribute("text"),this._iconId=this.base.generateId(),document.createElement("span"));var n=V('');const s=V(''),i=(s.classList.add("hidden"),r.append(n,s),r.id=this._iconId,e.append(t,r),this._drawerId=this.base.generateId(),document.createElement("div"));i.id=this._drawerId,i.classList.add("shadow","inline-block","bg-white"),i.style.position="absolute",i.style.zIndex="1040";n=this.querySelector("template");n.innerHTML.length?i.innerHTML=n.innerHTML:i.append(n.firstChild),i.style.display="none",this.component=[e,i],this.base.addEvent("#"+this._buttonId,"click",this.toggleMenu);const o=document.querySelector("body");""!==o.getAttribute("flk-close-dropdown")&&(o.setAttribute("flk-close-dropdown",""),o.addEventListener("click",this.closeAllDropdownButtons)),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this);var e=document.querySelectorAll("flk-dropdown");if(!e||!e.length){const t=document.querySelector("body");t.removeAttribute("flk-close-dropdown"),t.removeEventListener("click",this.closeAllDropdownButtons)}}toggleMenu(e){const t=F(e).target;e=t._drawerId;const r=document.getElementById(e);var e="none"!==r.style.display,n=(r.style.display=e?"none":"block",t.getAttribute("drawer-width")),n=("string"==typeof t.getAttribute("right")&&(r.style.right="0px"),r.style.top=t.offsetHeight+"px",r.style.width=n||t.offsetWidth+"px",t._iconId);const s=document.getElementById(n);e?(s.childNodes[0].classList.remove("hidden"),s.childNodes[1].classList.add("hidden")):(s.childNodes[0].classList.add("hidden"),s.childNodes[1].classList.remove("hidden"))}_closeDropdown(){var e=this._drawerId;const t=document.getElementById(e);if("none"!==t.style.display){e=this._iconId;const r=document.getElementById(e);t.style.display="none",r.childNodes[0].classList.remove("hidden"),r.childNodes[1].classList.add("hidden")}}closeAllDropdownButtons(e){var t,r=F(e,"flk-dropdown").target,e=document.querySelectorAll("flk-dropdown");if(r)for(const n of e)r._buttonId!==n._buttonId&&(t=n._drawerId,"none"!==document.getElementById(t).style.display&&n._closeDropdown());else for(const s of e)s._closeDropdown()}}var t={exports:{}};let Z=e.default,Y=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||"win32"===process.platform||Z.isatty(1)&&"dumb"!==process.env.TERM||"CI"in process.env),r=(r,n,s=r)=>e=>{let t=""+e;e=t.indexOf(n,r.length);return~e?r+X(t,n,s,e)+n:r+t+n},X=(e,t,r,n)=>{var s=e.substring(0,n)+r;let i=e.substring(n+t.length);e=i.indexOf(t);return~e?s+X(i,t,r,e):s+i};e=(e=Y)=>({isColorSupported:e,reset:e?e=>`${e}`:String,bold:e?r("","",""):String,dim:e?r("","",""):String,italic:e?r("",""):String,underline:e?r("",""):String,inverse:e?r("",""):String,hidden:e?r("",""):String,strikethrough:e?r("",""):String,black:e?r("",""):String,red:e?r("",""):String,green:e?r("",""):String,yellow:e?r("",""):String,blue:e?r("",""):String,magenta:e?r("",""):String,cyan:e?r("",""):String,white:e?r("",""):String,gray:e?r("",""):String,bgBlack:e?r("",""):String,bgRed:e?r("",""):String,bgGreen:e?r("",""):String,bgYellow:e?r("",""):String,bgBlue:e?r("",""):String,bgMagenta:e?r("",""):String,bgCyan:e?r("",""):String,bgWhite:e?r("",""):String});t.exports=e(),t.exports.createColors=e;const Q="'".charCodeAt(0),ee='"'.charCodeAt(0),te="\\".charCodeAt(0),re="/".charCodeAt(0),ne="\n".charCodeAt(0),se=" ".charCodeAt(0),ie="\f".charCodeAt(0),oe="\t".charCodeAt(0),ae="\r".charCodeAt(0),le="[".charCodeAt(0),ce="]".charCodeAt(0),ue="(".charCodeAt(0),he=")".charCodeAt(0),pe="{".charCodeAt(0),de="}".charCodeAt(0),fe=";".charCodeAt(0),me="*".charCodeAt(0),ge=":".charCodeAt(0),ye="@".charCodeAt(0),ve=/[\t\n\f\r "#'()/;[\\\]{}]/g,we=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,be=/.[\r\n"'(/\\]/,_e=/[\da-f]/i;function Ce(t,e={}){let n=t.css.valueOf(),d=e.ignoreErrors,s,i,f,m,o,a,l,g,c,u,y=n.length,h=0,v=[],p=[];function w(e){throw t.error("Unclosed "+e,h)}return{back:function(e){p.push(e)},endOfFile:function(){return 0===p.length&&h>=y},nextToken:function(e){if(p.length)return p.pop();if(!(h>=y)){var t=!!e&&e.ignoreUnclosed;switch(s=n.charCodeAt(h),s){case ne:case se:case oe:case ae:case ie:for(i=h;i+=1,s=n.charCodeAt(i),s===se||s===ne||s===oe||s===ae||s===ie;);u=["space",n.slice(h,i)],h=i-1;break;case le:case ce:case pe:case de:case ge:case fe:case he:var r=String.fromCharCode(s);u=[r,r,h];break;case ue:if(g=v.length?v.pop()[1]:"",c=n.charCodeAt(h+1),"url"===g&&c!==Q&&c!==ee&&c!==se&&c!==ne&&c!==oe&&c!==ie&&c!==ae){i=h;do{if(a=!1,i=n.indexOf(")",i+1),-1===i){if(d||t){i=h;break}w("bracket")}for(l=i;n.charCodeAt(l-1)===te;)--l,a=!a}while(a);u=["brackets",n.slice(h,i+1),h,i],h=i}else i=n.indexOf(")",h+1),m=n.slice(h,i+1),-1===i||be.test(m)?u=["(","(",h]:(u=["brackets",m,h,i],h=i);break;case Q:case ee:f=s===Q?"'":'"',i=h;do{if(a=!1,i=n.indexOf(f,i+1),-1===i){if(d||t){i=h+1;break}w("string")}for(l=i;n.charCodeAt(l-1)===te;)--l,a=!a}while(a);u=["string",n.slice(h,i+1),h,i],h=i;break;case ye:ve.lastIndex=h+1,ve.test(n),i=0===ve.lastIndex?n.length-1:ve.lastIndex-2,u=["at-word",n.slice(h,i+1),h,i],h=i;break;case te:for(i=h,o=!0;n.charCodeAt(i+1)===te;)i+=1,o=!o;if(s=n.charCodeAt(i+1),o&&s!==re&&s!==se&&s!==ne&&s!==oe&&s!==ae&&s!==ie&&(i+=1,_e.test(n.charAt(i)))){for(;_e.test(n.charAt(i+1));)i+=1;n.charCodeAt(i+1)===se&&(i+=1)}u=["word",n.slice(h,i+1),h,i],h=i;break;default:h=(s===re&&n.charCodeAt(h+1)===me?(i=n.indexOf("*/",h+2)+1,0===i&&(d||t?i=n.length:w("comment")),u=["comment",n.slice(h,i+1),h,i]):(we.lastIndex=h+1,we.test(n),i=0===we.lastIndex?n.length-1:we.lastIndex-2,u=["word",n.slice(h,i+1),h,i],v.push(u)),i)}return h++,u}},position:function(){return h}}}e=t.exports;let Se=Ce,xe;const Ae={";":e.yellow,":":e.yellow,"(":e.cyan,")":e.cyan,"[":e.yellow,"]":e.yellow,"{":e.yellow,"}":e.yellow,"at-word":e.cyan,brackets:e.cyan,call:e.cyan,class:e.yellow,comment:e.gray,hash:e.magenta,string:e.green};function ke(e){let r=Se(new xe(e),{ignoreErrors:!0}),n="";for(;!r.endOfFile();){let e=r.nextToken(),t=Ae[function([e,t],r){if("word"===e){if("."===t[0])return"class";if("#"===t[0])return"hash"}if(!r.endOfFile()){t=r.nextToken();if(r.back(t),"brackets"===t[0]||"("===t[0])return"call"}return e}(e,r)];t?n+=e[1].split(/\r?\n/).map(e=>t(e)).join("\n"):n+=e[1]}return n}ke.registerInput=function(e){xe=e};e=ke;let Ee=t.exports,Le=e;class Oe extends Error{constructor(e,t,r,n,s,i){super(e),this.name="CssSyntaxError",this.reason=e,s&&(this.file=s),n&&(this.source=n),i&&(this.plugin=i),void 0!==t&&void 0!==r&&("number"==typeof t?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,Oe)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file||"",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source,r=(null==e&&(e=Ee.isColorSupported),Le&&e&&(t=Le(t)),t.split(/\r?\n/)),n=Math.max(this.line-3,0);var s=Math.min(this.line+2,r.length);let i=String(s).length,o,a;if(e){let{bold:t,gray:r,red:n}=Ee.createColors(!0);o=e=>t(n(e)),a=e=>r(e)}else o=a=e=>e;return r.slice(n,s).map((e,t)=>{var t=n+1+t;let r=" "+(" "+t).slice(-i)+" | ";return t===this.line?(t=a(r.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," "),o(">")+a(r)+e+"\n "+t+o("^")):" "+a(r)+e}).join("\n")}toString(){let e=this.showSourceCode();return e=e&&"\n\n"+e+"\n",this.name+": "+this.message+e}}var t=Oe,Me=(Oe.default=Oe,{});Me.isClean=Symbol("isClean"),Me.my=Symbol("my");const Pe={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class Re{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name;var n=e.params?this.rawValue(e,"params"):"";void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes?this.block(e,r+n):(t=(e.raws.between||"")+(t?";":""),this.builder(r+n+t,e))}beforeAfter(e,t){let r,n=(r="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose"),e.parent),s=0;for(;n&&"root"!==n.type;)s+=1,n=n.parent;if(r.includes("\n")){var i=this.raw(e,null,"indent");if(i.length)for(let e=0;e{if(n=e.raws[t],void 0!==n)return!1}),void 0===n&&(n=Pe[r]),i.rawCache[r]=n,n}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&0{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=void 0===r?this.raw(t,null,"beforeDecl"):r&&r.replace(/\S/g,""),r}rawBeforeDecl(e,t){let r;return e.walkDecls(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=void 0===r?this.raw(t,null,"beforeRule"):r&&r.replace(/\S/g,""),r}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(t){let r;return t.walk(e=>{if(e.nodes&&(e.parent!==t||t.first!==e)&&void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=r&&r.replace(/\S/g,""),r}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(r){if(r.raws.indent)return r.raws.indent;let n;return r.walk(e=>{var t=e.parent;if(t&&t!==r&&t.parent&&t.parent===r&&void 0!==e.raws.before)return t=e.raws.before.split("\n"),n=t[t.length-1],n=n.replace(/\S/g,""),!1}),n}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){var r=e[t],e=e.raws[t];return e&&e.value===r?e.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}}var Te=Re;Re.default=Re;let Ie=Te;function Be(e,t){let r=new Ie(t);r.stringify(e)}var Ne=Be;Be.default=Be;let{isClean:je,my:De}=Me,Ue=t,Fe=Te,ze=Ne;function $e(t,r){let n=new t.constructor;for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&"proxyCache"!==s){let e=t[s];var i=typeof e;"parent"===s&&"object"==i?r&&(n[s]=r):"source"===s?n[s]=e:Array.isArray(e)?n[s]=e.map(e=>$e(e,n)):("object"==i&&null!==e&&(e=$e(e)),n[s]=e)}return n}class Ge{constructor(e={}){for(var t in this.raws={},this[je]=!1,this[De]=!0,e)if("nodes"===t){this.nodes=[];for(var r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){var t;return e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)&&(t=this.source,e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)),e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(var t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=$e(this);for(var r in e)t[r]=e[r];return t}cloneAfter(e={}){e=this.clone(e);return this.parent.insertAfter(this,e),e}cloneBefore(e={}){e=this.clone(e);return this.parent.insertBefore(this,e),e}error(e,t={}){var r,n;return this.source?({end:r,start:n}=this.rangeBy(t),this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)):new Ue(e)}getProxyProcessor(){return{get(e,t){return"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t]},set(e,t,r){return e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0}}}markDirty(){if(this[je]){this[je]=!1;let e=this;for(;e=e.parent;)e[je]=!1}}next(){var e;if(this.parent)return e=this.parent.index(this),this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;return e.index?r=this.positionInside(e.index,t):!e.word||-1!==(e=(t=this.toString()).indexOf(e.word))&&(r=this.positionInside(e,t)),r}positionInside(t,e){var r=e||this.toString();let n=this.source.start.column,s=this.source.start.line;for(let e=0;e"object"==typeof e&&e.toJSON?e.toJSON(null,r):e);else if("object"==typeof t&&t.toJSON)n[s]=t.toJSON(null,r);else if("source"===s){let e=r.get(t.input);null==e&&(e=i,r.set(t.input,i),i++),n[s]={end:t.end,inputId:e,start:t.start}}else n[s]=t}return t&&(n.inputs=[...r.keys()].map(e=>e.toJSON())),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=ze){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(var s in r)n[s]=r[s];return e.warn(t,n)}get proxyOf(){return this}}var Te=Ge,He=(Ge.default=Ge,Te);class Ve extends He{constructor(e){super(e=e&&void 0!==e.value&&"string"!=typeof e.value?{...e,value:String(e.value)}:e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}}var He=Ve,We=(Ve.default=Ve,{}),Je={},qe={},Ke={},Ze="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),Ye=(Ke.encode=function(e){if(0<=e&&e>>=5)&&(t|=32),r+=Ye.encode(t),0>1,1==(1&a)?-i:i),r.rest=t};var Ke={},l=Ke,Xe=(l.getArg=function(e,t,r){if(t in e)return e[t];if(3===arguments.length)return r;throw new Error('"'+t+'" is a required argument.')},/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/),Qe=/^data:.+\,.+$/;function et(e){e=e.match(Xe);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}function tt(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}l.urlParse=et,l.urlGenerate=tt,rt=function(e){var t=e,r=et(e);if(r){if(!r.path)return e;t=r.path}for(var n,e=l.isAbsolute(t),s=[],i=0;;){if(n=i,-1===(i=t.indexOf("/",n))){s.push(t.slice(n));break}for(s.push(t.slice(n,i));in;e--){var o=r[e-1],a=r[e];if(Pt(o,a)<=0)break;r[e-1]=a,r[e]=o}else Ot(r,Pt,n)}function Tt(e,s){var t=e,e=("string"==typeof e&&(t=w.parseSourceMapInput(e)),w.getArg(t,"version")),t=w.getArg(t,"sections");if(e!=this._version)throw new Error("Unsupported version: "+e);this._sources=new Et,this._names=new Et;var i={line:-1,column:0};this._sections=t.map(function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var t=w.getArg(e,"offset"),r=w.getArg(t,"line"),n=w.getArg(t,"column");if(r=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))},p.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;var r=this._findSourceIndex(e);if(0<=r)return this.sourcesContent[r];var n,r=e;if(null!=this.sourceRoot&&(r=w.relative(this.sourceRoot,r)),null!=this.sourceRoot&&(n=w.urlParse(this.sourceRoot))){e=r.replace(/^file:\/\//,"");if("file"==n.scheme&&this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];if((!n.path||"/"==n.path)&&this._sources.has("/"+r))return this.sourcesContent[this._sources.indexOf("/"+r)]}if(t)return null;throw new Error('"'+r+'" is not in the SourceMap.')},p.prototype.generatedPositionFor=function(e){var t=w.getArg(e,"source");if((t=this._findSourceIndex(t))<0)return{line:null,column:null,lastColumn:null};t={source:t,originalLine:w.getArg(e,"line"),originalColumn:w.getArg(e,"column")},e=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",w.compareByOriginalPositions,w.getArg(e,"bias",f.GREATEST_LOWER_BOUND));if(0<=e){e=this._originalMappings[e];if(e.source===t.source)return{line:w.getArg(e,"generatedLine",null),column:w.getArg(e,"generatedColumn",null),lastColumn:w.getArg(e,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},ft.BasicSourceMapConsumer=p,(Tt.prototype=Object.create(f.prototype)).constructor=f,Tt.prototype._version=3,Object.defineProperty(Tt.prototype,"sources",{get:function(){for(var e=[],t=0;t{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(n,s=21)=>(e=s)=>{let t="",r=e;for(;r--;)t+=n[Math.random()*n.length|0];return t}};let{SourceMapConsumer:Ut,SourceMapGenerator:Ft}=We,{existsSync:zt,readFileSync:$t}=i.default,{dirname:Gt,join:Ht}=n.default;class Vt{constructor(e,t){!1!==t.map&&(this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:"),e=t.map?t.map.prev:void 0,e=this.loadMap(t.from,e),!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Gt(this.mapFile)),e&&(this.text=e))}consumer(){return this.consumerCache||(this.consumerCache=new Ut(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+t)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);var r,n;t&&(r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r),-1"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,i,o;t&&"object"==typeof t?(a=r,r="number"==typeof(l=t).offset?(t=(c=this.fromOffset(l.offset)).line,c.col):(t=l.line,l.column),o="number"==typeof a.offset?(c=this.fromOffset(a.offset),i=c.line,c.col):(i=a.line,a.column)):r||(t=(l=this.fromOffset(t)).line,r=l.col);var a,l,c=this.origin(t,r,i,o);return s=c?new Xt(e,void 0===c.endLine?c.line:{column:c.column,line:c.line},void 0===c.endLine?c.column:{column:c.endColumn,line:c.endLine},c.source,c.file,n.plugin):new Xt(e,void 0===i?t:{column:r,line:t},void 0===i?r:{column:o,line:i},this.css,this.file,n.plugin),s.input={column:r,endColumn:o,endLine:i,line:t,source:this.css},this.file&&(Jt&&(s.input.url=Jt(this.file).toString()),s.input.file=this.file),s}fromOffset(t){let n;if(this[er])n=this[er];else{var s=this.css.split("\n");n=new Array(s.length);let r=0;for(let e=0,t=s.length;e>1),t=n[i+1])){r=i;break}r=i+1}}return{col:t-n[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Kt(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let s=this.map.consumer();t=s.originalPositionFor({column:t,line:e});if(!t.source)return!1;let i;"number"==typeof r&&(i=s.originalPositionFor({column:n,line:r}));let o,a=(o=qt(t.source)?Jt(t.source):new URL(t.source,this.map.consumer().sourceRoot||Jt(this.map.mapFile)),{column:t.column,endColumn:i&&i.column,endLine:i&&i.line,line:t.line,url:o.toString()});if("file:"===o.protocol){if(!Wt)throw new Error("file: protocol is not available in this PostCSS build");a.file=Wt(o)}e=s.sourceContentFor(t.source);return e&&(a.source=e),a}toJSON(){let e={};for(var t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}}Je=nr;nr.default=nr,Yt&&Yt.registerInput&&Yt.registerInput(nr);let{SourceMapConsumer:sr,SourceMapGenerator:ir}=We,{dirname:or,relative:ar,resolve:lr,sep:cr}=n.default,ur=s.default["pathToFileURL"],hr=Je,pr=Boolean(sr&&ir),dr=Boolean(or&&lr&&ar&&cr);ft=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e,t=(e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map","\n");this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(var t of this.previous()){var r=this.toUrl(this.path(t.file)),n=t.root||or(t.file);let e;!1===this.mapOpts.sourcesContent?(e=new sr(t.text),e.sourcesContent&&(e.sourcesContent=null)):e=t.consumer(),this.map.applySourceMap(e,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let t;for(let e=this.root.nodes.length-1;0<=e;e--)t=this.root.nodes[e],"comment"===t.type&&0===t.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(e)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),dr&&pr&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,e=>{t+=e}),[t]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=ir.fromSourceMap(e)}else this.map=new ir({file:this.outputFile()}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):""});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&0",o={generated:{column:0,line:0},original:{column:0,line:0},source:""},a,l;this.stringify(this.root,(e,t,r)=>{this.css+=e,t&&"end"!==r&&(o.generated.line=n,o.generated.column=s-1,t.source&&t.source.start?(o.source=this.sourcePath(t),o.original.line=t.source.start.line,o.original.column=t.source.start.column-1):(o.source=i,o.original.line=1,o.original.column=0),this.map.addMapping(o)),a=e.match(/\n/g),a?(n+=a.length,l=e.lastIndexOf("\n"),s=e.length-l):s+=e.length,t&&"start"!==r&&(e=t.parent||{raws:{}},("decl"===t.type||"atrule"===t.type&&!t.nodes)&&t===e.last&&!e.raws.semicolon||(t.source&&t.source.end?(o.source=this.sourcePath(t),o.original.line=t.source.end.line,o.original.column=t.source.end.column-1,o.generated.line=n,o.generated.column=s-2):(o.source=i,o.original.line=1,o.original.column=0,o.generated.line=n,o.generated.column=s-1),this.map.addMapping(o)))})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;var e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:0e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;var t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?or(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=or(lr(r,this.mapOpts.annotation)));t=ar(r,e);return this.memoizedPaths.set(e,t),t}previous(){var e;return this.previousMaps||(this.previousMaps=[],this.root?this.root.walk(e=>{e.source&&e.source.input.map&&(e=e.source.input.map,this.previousMaps.includes(e)||this.previousMaps.push(e))}):(e=new hr(this.originalCSS,this.opts)).map&&this.previousMaps.push(e.map)),this.previousMaps}setSourcesContent(){let r={};var e;this.root?this.root.walk(e=>{var t;!e.source||(t=e.source.input.from)&&!r[t]&&(r[t]=!0,t=this.usesFileUrls?this.toFileUrl(t):this.toUrl(this.path(t)),this.map.setSourceContent(t,e.source.input.css))}):this.css&&(e=this.opts.from?this.toUrl(this.path(this.opts.from)):"",this.map.setSourceContent(e,this.css))}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){var t=this.memoizedFileURLs.get(e);if(t)return t;if(ur)return t=ur(e).toString(),this.memoizedFileURLs.set(e,t),t;throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){var t=this.memoizedURLs.get(e);if(t)return t;"\\"===cr&&(e=e.replace(/\\/g,"/"));t=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,t),t}};class fr extends Te{constructor(e){super(e),this.type="comment"}}Ct=fr;fr.default=fr;let{isClean:mr,my:gr}=Me,yr=He,vr=Ct,wr,br,_r,Cr;class Sr extends Te{append(...e){for(var t of e){var r;for(r of this.normalize(t,this.last))this.proxyOf.nodes.push(r)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(var t of this.nodes)t.cleanRaws(e)}each(r){if(this.proxyOf.nodes){var n=this.getIterator();let e,t;for(;this.indexes[n]t[n](...e.map(r=>"function"==typeof r?(e,t)=>r(e.toProxy(),t):r)):"every"===n||"some"===n?r=>t[n]((e,...t)=>r(e.toProxy(),...t)):"root"===n?()=>t.root().toProxy():"nodes"===n?t.nodes.map(e=>e.toProxy()):"first"===n||"last"===n?t[n].toProxy():t[n])},set(e,t,r){return e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0}}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){var r,n,s,i=this.index(e),o=this.normalize(t,this.proxyOf.nodes[i]).reverse(),i=this.index(e);for(r of o)this.proxyOf.nodes.splice(i+1,0,r);for(s in this.indexes)i<(n=this.indexes[s])&&(this.indexes[s]=n+o.length);return this.markDirty(),this}insertBefore(e,t){var r,n,s,i=this.index(e),o=this.normalize(t,this.proxyOf.nodes[i],0===i&&"prepend").reverse(),i=this.index(e);for(r of o)this.proxyOf.nodes.splice(i,0,r);for(s in this.indexes)i<=(n=this.indexes[s])&&(this.indexes[s]=n+o.length);return this.markDirty(),this}normalize(e,t){if("string"==typeof e)e=function t(e){return e.map(e=>(e.nodes&&(e.nodes=t(e.nodes)),delete e.source,e))}(wr(e).nodes);else if(void 0===e)e=[];else if(Array.isArray(e))for(var r of e=e.slice(0))r.parent&&r.parent.removeChild(r,"ignore");else if("root"===e.type&&"document"!==this.type)for(var n of e=e.nodes.slice(0))n.parent&&n.parent.removeChild(n,"ignore");else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new yr(e)]}else if(e.selector)e=[new br(e)];else if(e.name)e=[new _r(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new vr(e)]}return e.map(e=>(e[gr]||Sr.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[mr]&&function e(t){if(t[mr]=!1,t.proxyOf.nodes)for(var r of t.proxyOf.nodes)e(r)}(e),void 0===e.raws.before&&t&&void 0!==t.raws.before&&(e.raws.before=t.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}prepend(...e){for(var t of e=e.reverse()){var r,n,s=this.normalize(t,this.first,"prepend").reverse();for(r of s)this.proxyOf.nodes.unshift(r);for(n in this.indexes)this.indexes[n]=this.indexes[n]+s.length}return this.markDirty(),this}push(e){return(e.parent=this).proxyOf.nodes.push(e),this}removeAll(){for(var e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){var t,r;for(r in e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1),this.indexes)e<=(t=this.indexes[r])&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(t,r,n){return n||(n=r,r={}),this.walkDecls(e=>{r.props&&!r.props.includes(e.prop)||r.fast&&!e.value.includes(r.fast)||(e.value=e.value.replace(t,n))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(n){return this.each((t,e)=>{let r;try{r=n(t,e)}catch(e){throw t.addToError(e)}return!1!==r&&t.walk&&(r=t.walk(n)),r})}walkAtRules(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("atrule"===e.type&&r.test(e.name))return n(e,t)}):this.walk((e,t)=>{if("atrule"===e.type&&e.name===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("atrule"===e.type)return n(e,t)}))}walkComments(r){return this.walk((e,t)=>{if("comment"===e.type)return r(e,t)})}walkDecls(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("decl"===e.type&&r.test(e.prop))return n(e,t)}):this.walk((e,t)=>{if("decl"===e.type&&e.prop===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("decl"===e.type)return n(e,t)}))}walkRules(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("rule"===e.type&&r.test(e.selector))return n(e,t)}):this.walk((e,t)=>{if("rule"===e.type&&e.selector===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("rule"===e.type)return n(e,t)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}Sr.registerParse=e=>{wr=e},Sr.registerRule=e=>{br=e},Sr.registerAtRule=e=>{_r=e},Sr.registerRoot=e=>{Cr=e};i=Sr,Sr.default=Sr,Sr.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,_r.prototype):"rule"===e.type?Object.setPrototypeOf(e,br.prototype):"decl"===e.type?Object.setPrototypeOf(e,yr.prototype):"comment"===e.type?Object.setPrototypeOf(e,vr.prototype):"root"===e.type&&Object.setPrototypeOf(e,Cr.prototype),e[gr]=!0,e.nodes&&e.nodes.forEach(e=>{Sr.rebuild(e)})},ot=i;let xr,Ar;class kr extends ot{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){let t=new xr(new Ar,this,e);return t.stringify()}}kr.registerLazyResult=e=>{xr=e},kr.registerProcessor=e=>{Ar=e};e=kr;kr.default=kr;let Er={};function Lr(e){Er[e]||(Er[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))}class Or{constructor(e,t={}){for(var r in this.type="warning",this.text=e,t.node&&t.node.source&&(e=t.node.rangeBy(t),this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column),t)this[r]=t[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}St=Or;Or.default=Or;let Mr=St;class Pr{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);e=new Mr(e,t);return this.messages.push(e),e}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}}Ke=Pr;Pr.default=Pr;let Rr=i;class Tr extends Rr{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}We=Tr;Tr.default=Tr,Rr.registerAtRule(Tr);let Ir=i,Br,Nr;class jr extends Ir{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){e=super.normalize(e);if(t)if("prepend"===r)1{Br=e},jr.registerProcessor=e=>{Nr=e};n=jr;jr.default=jr,Ir.registerRoot(jr);let Dr={comma(e){return Dr.split(e,[","],!0)},space(e){return Dr.split(e,[" ","\n","\t"])},split(e,t,u){let r=[],n="",s=!1,i=0,o=!1,a="",l=!1;for(var c of e)l?l=!1:"\\"===c?l=!0:o?c===a&&(o=!1):'"'===c||"'"===c?(o=!0,a=c):"("===c?i+=1:")"===c?0"space"!==e[0]&&"comment"!==e[0])&&(s.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(s,"value",a.concat(e),t),s.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new Jr;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){var t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1;var r;let n=!1,s=null,i=[];var o=e[1].startsWith("--");let a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)s=s||l,i.push("("===r?")":"]");else if(o&&n&&"{"===r)s=s||l,i.push("}");else if(0===i.length){if(";"===r){if(n)return void this.decl(a,o);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===i[i.length-1]&&(i.pop(),0===i.length&&(s=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),0e+t[1],""),e.raws[t]={raw:o,value:l}),e[t]=l}rule(e){e.pop();let t=new Jr;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){var t;let r="";for(;e.length&&("space"===(t=e[e.length-1][0])||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){var t;let r="";for(;e.length&&("space"===(t=e[0][0])||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t="";for(;e.length&&"space"===e[e.length-1][0];)t=e.pop()[1]+t;return t}stringFrom(t,r){let n="";for(let e=r;evn(e)),e}let wn={};class bn{constructor(e,t,r){this.stringified=!1,this.processed=!1;let n;if("object"!=typeof t||null===t||"root"!==t.type&&"document"!==t.type)if(t instanceof bn||t instanceof ln)n=vn(t.root),t.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=t.map);else{let e=cn;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{n=e(t,r)}catch(e){this.processed=!0,this.error=e}n&&!n[tn]&&sn.rebuild(n)}else n=vn(t);this.result=new ln(e,n,r),this.helpers={...wn,postcss:wn,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){var r=this.result.lastPlugin;try{if(t&&t.addToError(e),"CssSyntaxError"!==(this.error=e).name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){var n=r.postcssPlugin;let e=r.postcssVersion,t=this.result.processor.version;var s=e.split("."),i=t.split(".");(s[0]!==i[0]||parseInt(s[1])>parseInt(i[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+t+", but "+n+" uses "+e+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};var e,t=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(e of this.plugins)if("object"==typeof e)for(var r in e){if(!pn[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${e.postcssPlugin}. `+`Try to update PostCSS (${this.processor.version} now).`);if(!dn[r])if("object"==typeof e[r])for(var n in e[r])"*"===n?t(e,r,e[r][n]):t(e,r+"-"+n.toLowerCase(),e[r][n]);else"function"==typeof e[r]&&t(e,r,e[r])}this.hasListener=0t(e,this.helpers)),await Promise.all(i)):await t(r,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{var e;if("object"==typeof t&&t.Once)return"document"===this.result.root.type?mn((e=this.result.root.nodes.map(e=>t.Once(e,this.helpers)))[0])?Promise.all(e):e:t.Once(this.result.root,this.helpers);if("function"==typeof t)return t(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();var e=this.result.opts;let t=nn,r=(e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify),new rn(t,this.result.root,this.result.opts));e=r.generate();return this.result.css=e[0],this.result.map=e[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(var e of this.plugins)if(mn(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[en];)e[en]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(var t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||an("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(var[r,n]of e){this.result.lastPlugin=r;let e;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(mn(e))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:s}=r;if("root"===n.type||"document"===n.type||n.parent){if(0{e[en]||this.walkSync(e)});else{var r=this.listeners[t];if(r&&this.visitSync(r,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}bn.registerPostcss=e=>{wn=e};Me=bn;bn.default=bn,un.registerLazyResult(bn),on.registerLazyResult(bn);let _n=ft,Cn=Ne,Sn=Lr,xn=Qr;const An=Ke;class kn{constructor(e,t,r){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;var e=Cn;this.result=new An(this._processor,void 0,this._opts),this.result.css=t;let n=this,s=(Object.defineProperty(this.result,"root",{get(){return n.root}}),new _n(e,void 0,this._opts,t));s.isMap()?([r,e]=s.generate(),r&&(this.result.css=r),e&&(this.result.map=e)):(s.clearAnnotation(),this.result.css=s.css)}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||Sn("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=xn;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}}ft=kn;kn.default=kn;let En=ft,Ln=Me,On=e,Mn=n;class Pn{constructor(e=[]){this.version="8.4.35",this.plugins=this.normalize(e)}normalize(e){let t=[];for(var r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return new(this.plugins.length||t.parser||t.stringifier||t.syntax?Ln:En)(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}ft=Pn;Pn.default=Pn,Mn.registerProcessor(Pn),On.registerProcessor(Pn);let Rn=He,Tn=qe,In=Ct,Bn=We,Nn=Je,jn=n,Dn=ot;function Un(e,r){if(Array.isArray(e))return e.map(e=>Un(e));let{inputs:t,...n}=e;if(t){r=[];for(var s of t){let e={...s,__proto__:Nn.prototype};e.map&&(e.map={...e.map,__proto__:Tn.prototype}),r.push(e)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>Un(e,r))),n.source){let{inputId:e,...t}=n.source;n.source=t,null!=e&&(n.source.input=r[e])}if("root"===n.type)return new jn(n);if("decl"===n.type)return new Rn(n);if("rule"===n.type)return new Dn(n);if("comment"===n.type)return new In(n);if("atrule"===n.type)return new Bn(n);throw new Error("Unknown node type: "+e.type)}qe=Un,Un.default=Un;let Fn=He,zn=Me;He=i;let $n=ft;Me=Ne,i=qe;let Gn=e;ft=St;let Hn=Ct,Vn=We;Ne=Ke,qe=Je,e=Qr,St=s;let Wn=ot,Jn=n;Ct=Te;function o(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new $n(e)}o.plugin=function(r,n){let s=!1;function i(...e){console&&console.warn&&!s&&(s=!0,console.warn(r+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(r+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let t=n(...e);return t.postcssPlugin=r,t.postcssVersion=(new $n).version,t}let e;return Object.defineProperty(i,"postcss",{get(){return e=e||i(),e}}),i.process=function(e,t,r){return o([i(r)]).process(e,t)},i},o.stringify=Me,o.parse=e,o.fromJSON=i,o.list=St,o.comment=e=>new Hn(e),o.atRule=e=>new Vn(e),o.decl=e=>new Fn(e),o.rule=e=>new Wn(e),o.root=e=>new Jn(e),o.document=e=>new Gn(e),o.CssSyntaxError=t,o.Declaration=Fn,o.Container=He,o.Processor=$n,o.Document=Gn,o.Comment=Hn,o.Warning=ft,o.AtRule=Vn,o.Result=Ne,o.Input=qe,o.Rule=Wn,o.Root=Jn,o.Node=Ct,zn.registerPostcss(o);o.default=o;class qn extends HTMLElement{base;contents;component;listType="ul";iconSet;filter={value:"",caseSensitive:!1};static get observedAttributes(){return["contents","icon-set","max-depth","filter"]}_jsonToValueArray(e){let t=JSON.stringify(e);t=t.replace(/[\[\]{}\"]/g,"");let r=[];for(const n of t.split(","))r=r.concat(n.split(":"));return[...new Set(r)]}_emit(e,t,r){e=new CustomEvent(e,{detail:r,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}constructor(){super(),this.base=new $,this.setContents(this.getAttribute("contents")),this.iconSet=this.getAttribute("icon-set")?this.getAttribute("icon-type"):"file",this.maxDepth=this.getAttribute("max-depth")?parseInt(this.getAttribute("max-depth")):-1,this.setFilter(this.getAttribute("filter")),this.style.display="block",this.style.maxWidth="fit-content",this.style.margin="0 1rem 0 0",this.base.addEvent(".flk-branch","click",this.emitNodeToggle)}emitNodeToggle(e){e.stopPropagation();const t=F(e,"flk-tree-nav").target,r=z(e,"branchKey");let n=t.contents;const s=r.split(".");for(const o of s)if(n[o])n=n[o];else if(null===n[o])n=null;else{let e=[];for(const a of n)a[o]&&e.push(a[o]);n=e}var e=r.substring(r.indexOf(".")+1),i=t.createLeafText(s.reverse()[0]);t._emit("tree-click",t,{path:e,data:n,key:(i.titleText+" "+i.commentText).trim(),branch:"object"==typeof n})}convertJsonKeyToTitle(e){if(!e)return"";const t=(e="string"!=typeof e?e.toString():e).replace(/([A-Z_])/g,e=>"_"===e?" ":" "+e).trim();return t.charAt(0).toUpperCase()+t.slice(1)}setContents(e){var t=e||this.contents||[];try{switch(typeof t){case"string":this.contents=JSON.parse(t);break;case"object":Array.isArray(t)?this.contents=t:this.contents=[t]}}catch(e){console.log(e)}}applyFilter(e){let t;var r="details"===e.tagName.toLowerCase();t=this.filter.caseSensitive?e.dataset.branchValues.includes(this.filter.value):e.dataset.branchValues.toLowerCase().includes(this.filter.value.toLowerCase()),t?e.parentElement.classList.remove("hidden"):e.parentElement.classList.add("hidden"),r&&t?e.setAttribute("open",""):e.removeAttribute("open")}resetTree(e){e.parentElement.classList.remove("hidden"),e.removeAttribute("open")}filterTree(){let t=setTimeout(()=>{for(const e of this.querySelectorAll("[data-branch-values]"))void 0===this.filter.value||0===this.filter.value.length?this.resetTree(e):this.applyFilter(e);clearTimeout(t)},10)}setFilter(e){const t=e||{};try{switch(typeof t){case"string":t.includes("{")?(this.filter=JSON.parse(t),!1===this.filter.caseSensitive&&(this.filter.value=this.filter.value.toLowerCase())):this.filter.value=e.toLowerCase();break;case"object":this.filter=t}}catch(e){console.log(e)}this.filterTree()}createLeafText(e){var t,r;let n="",s="";return"string"==typeof e&&(e.includes("(")||e.includes("["))?(r=e.indexOf("("),r=-1===(t=e.indexOf("["))?r:t,n=this.convertJsonKeyToTitle(e.substring(0,r)),s=e.substring(r)):n=this.convertJsonKeyToTitle(e),{titleText:n,commentText:s}}createTextTag(n,s){n=this.createLeafText(n);if(n.commentText){let e=document.createElement("div"),t=document.createElement("span"),r=(t.innerText=n.titleText,document.createElement("small"));r.innerText=n.commentText,r.style.marginLeft="1rem",e.append(t,r),e.style.display="inline-flex",e.style.alignItems="center",s.append(e)}else s.innerText=n.titleText}createLeaf(e,t,r,n=[]){let s=document.createElement("li");s.classList.add("cursor-no-select"),s.style.marginTop="0.4rem",s.dataset.branchKey=r;const i="file"===this.iconSet?'':'';s.style.listStyleImage=`url('data:image/svg+xml,${i}')`,s.style.position="relative",s.style.left="2px";let o=document.createElement("span");r=[e].concat(n);if(o.dataset.branchValues=[...new Set(r)].join(),n.length&&(o.dataset.leafKey=r[0]),this.createTextTag(e,o),o.style.position="relative",o.style.top="-3px",s.append(o),t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);const i="file"===this.iconSet?G:H;e.style.listStyleImage=`url('data:image/svg+xml,${i}')`,e.append(s),t.append(e)}else t.append(s)}createBranch(r,t,n,s){if(s===this.maxDepth&&"object"==typeof r)for(const o of Array.isArray(r)?r:Object.keys(r)){let e;r[o]&&(e=this._jsonToValueArray(r[o])),this.createLeaf(o,t,n+"."+o,e)}else if(Array.isArray(r))for(var e in r){var u=document.createElement(this.listType);t.append(this.createBranch(r[e],u,n+"."+e,s+1))}else if(null!==r&&"object"==typeof r){const a=[];for(const l of Object.keys(r)){let e=document.createElement("li"),t=(e.classList.add("cursor-no-select"),e.style.position="relative",e.style.left="2px",e.dataset.branchKey=n+"."+l,document.createElement("details"));t.classList.add("flk-branch"),t.dataset.branchValues=[l].concat(this._jsonToValueArray(r[l])),t.style.position="relative",t.style.top="-3px",t.classList.add("cursor-default");var i=document.createElement("summary");this.createTextTag(l,i),t.append(i),e.append(this.createBranch(r[l],t,n+"."+l,s+1)),a.push(e)}if(t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);var h="file"===this.iconSet?G:H;e.style.listStyleImage=`url('data:image/svg+xml,${h}')`;for(const c of a)e.append(c);t.append(e)}else for(const p of a)t.append(p)}else this.createLeaf(r,t,n);return t}createHtml(){let e=document.createElement(this.listType);var t="file"===this.iconSet?G:'';if(e.style.listStyleImage=`url('data:image/svg+xml,${t}')`,e.style.marginLeft="3rem",this.contents.length){for(const r in this.contents)e=this.createBranch(this.contents[r],e,r,0);this.component=e}else this.component=e}attributeChangedCallback(e,t,r){switch(e){case"contents":this.setContents(r);break;case"icon-set":this.iconSet=r;break;case"max-depth":this.maxDepth="string"==typeof r?parseInt(r):r;break;case"filter":this.setFilter(r)}this.init()}connectedCallback(){this.init()}disconnectedCallback(){this.base.removeEvents(this)}init(){this.createHtml(),this.base.render(this)}}customElements.define("flk-table",W),customElements.define("flk-draggable",J),customElements.define("flk-modal",q),customElements.define("flk-dropdown",K),customElements.define("flk-tree-nav",qn)}(require$$0,require$$2,require$$1$1,require$$1); \ No newline at end of file +!function(){"use strict";var a,c,g,e;(e=a=a||{}).Date="date",e.String="string",e.Float="float",e.Number="number",e.Array="array",e.Object="object",e.Bool="bool",e.Currency="currency",e.Undefined="undefined",e.Null="null";const l={date:/^(\d{1,4}-\d{1,4}-\d{1,4}(T)?)/gim,currency:/^[$|€]\s?[0-9]*(\.|,)?\d*(\.|,)?\d*/gim,float:/\d+[,|.]\d+[,|.]?\d*/gim,currencySign:/\$|€/gim,array:/^\s?[[].[^,]+[\]],?/gi,precision:/[-+$€,.]/gm,string:/[a-zA-Z]/gim},h=e=>{return null===e||"null"===e?a.Null:e||0===e||!1===e?null===new RegExp(l.date).exec(e)||isNaN(Date.parse(e))?new RegExp(l.currency).exec(e)?a.Currency:!new RegExp(l.string).exec(e)&&new RegExp(l.float).exec(e.toString())?a.Float:isNaN(e)&&0!==e?Array.isArray(e)?a.Array:"object"==typeof e?a.Object:a.String:a.Number:a.Date:a.Undefined},u=(t,e)=>{const s={value:void 0,type:e=e||h(t),currencySign:""};switch(s.type){case a.String:s.value=t.toString();break;case a.Float:case a.Currency:var r=(t=t.toString()).match(new RegExp(/(,)/gim)),n=t.match(new RegExp(/(\.)/gim));if(r)for(let e=1;e<=r.length;e++)t=e!==r.length||n?t.replace(",",""):t.replace(",",".");if(s.type===a.Currency){const o=new RegExp(l.currencySign);var i=o.exec(t);s.currencySign=null!==i?i[0]:"",t=t.replace(o,"")}s.value=parseFloat(t).toPrecision(12);break;case a.Number:s.value=Number(t);break;case a.Date:s.value=Date.parse(t);break;case a.Array:t.length?"object"==typeof t[0]?s.value=t.map(e=>JSON.stringify(e)).join(", "):s.value=t.join(", "):s.value="";break;case a.Object:s.value=t;break;case a.Undefined:s.value="";break;case a.Null:s.value=null}return s};function v(e,t){var s;let r;for(s of e.split("."))s=s.trim(),r?"object"!=typeof r||Array.isArray(r)||(r=r[s]):r=t[s];return r}const m=(e,t)=>tet<=e,w=(e,t)=>e<=t,k=(e,t,s)=>s?e.toLowerCase()==t.toLowerCase():e==t,E=(e,t)=>e===t,_=(e,t)=>e!=t,x=(e,t)=>e!==t,A=(e,t)=>null!=t&&"string"==typeof e&&0<=e.toLowerCase().indexOf(t.toString().toLowerCase()),L=(e,t)=>null!=t&&0<=e.toString().toLowerCase().indexOf(t.toString().toLowerCase()),T=(e,t)=>null!=t&&"string"==typeof e&&e.toLowerCase().indexOf(t.toString().toLowerCase())<0;function t(s,r){if(0===r.length)return s;{var n=s;const o=[],a=[];let e=[];for(const l of r)l.type&&l.type!==c.And?(e.length&&a.push(e),e=[l]):e.push(l);a.push(e);let t=[];for(const e of a)t=t.concat(C(n,e));t=[...new Set(t)];var i=n.length;for(let e=0;e":return m;case"<":return f;case">=":return b;case"<=":return w;case"is":case"==":return k;case"!is":case"!=":return _;case"===":return E;case"!==":return x;case"like":case"~":case"contains":return A;case"!contains":case"!like":case"!~":return T;default:return L}}(a.operator);if(!l(i,o,a.ignoreCase)){e=!1;break}}e&&s.push(r)}return s};function s(e,t){if(!t||0===t.length)return e;if(1{if(0===s.length)s=s.concat(o(n,e));else{for(const t of s)r=r.concat(o(t,e));s=r,r=[]}}),s}return o(e,t[0])}function o(e,t){const s=[],r=[];do{if(!e||0===e.length)break;var n=e.shift();if(!n)break;const o=n[t];var i=r.indexOf(o.toString());0<=i?s[i].push(n):(r.push(o.toString()),void 0!==s[r.length-1]?s[r.length-1].push(n):s.push([n]))}while(0{if(t){var s=e;const r={};for(const n of t){let e=s.map(e=>e[n].toString());const i=e.map(e=>h(e));i.some(e=>e===a.Float)?(e=e.map(e=>parseFloat(e)),r[n]=parseFloat(e.reduce((e,t)=>e+t).toFixed(2))):(e=e.map(e=>parseInt(e)),r[n]=e.reduce((e,t)=>e+t))}return r}return{}};class S{model;sortDetails=[];filterDetails=[];selection=[];groupByProperties=[];distinctProperties=[];concatenationToken=", ";constructor(e){this.model=JSON.parse(JSON.stringify(e))}sort(e){return this.sortDetails=e,this}orderBy(e,t){return this.sortDetails.push({propertyName:e,direction:t}),this}thenOrderBy(e,t){return this.orderBy(e,t)}filter(e){return Array.isArray(e)?this.filterDetails=e:this.filterDetails.push(e),this}where(e,t,s,r,n){return this.filterDetails.push({propertyName:e,operator:t,value:s,type:r,ignoreCase:n}),this}andWhere(e,t,s,r){return this.where(e,t,s,c.And,r),this}orWhere(e,t,s,r){return this.where(e,t,s,c.Or,r),this}group(e){return this.groupByProperties=e,this}groupBy(e){return this.groupByProperties.push(e),this}thenGroupBy(e){return this.groupByProperties.push(e),this}select(e){return Array.isArray(e)?this.selection=e:"*"!==e&&(this.selection=[e]),this}distinct(e,t){return t&&(this.concatenationToken=t),Array.isArray(e)?this.distinctProperties=e:e&&(this.distinctProperties=[e]),this}execute(){return s(function(t,s){if(0===s.length)return t;{var r=s;let e=[];for(const n of t){const i={};for(const o of r)i[o]=n[o];e.push(i)}return e}}(function(s,r,d){if(!r||!r.length)return s;const n=[],h=[];for(const m of s){const o={};let t="";for(const e of r){var u=v(e,m);o[e]=u,t+=u}if(!h.includes(t)){let e=s;for(const a of Object.keys(o))e=e.filter(e=>e[a]===o[a]);h.push(t),n.push(e)}}const t=[];for(const f of n){let e={};for(const l of f){var i,p=Object.keys(e);if(p.length)for(const c of p)r.includes(c)||(i=e[c],Array.isArray(i)?(i=l[c],Array.isArray(i)?e[c]=[...new Set(...e[c].concat(l[c]))]:e[c].includes(l[c])||e[c].push(l[c])):isNaN(e[c])&&isNaN(l[c])?e[c]!==l[c]&&(e[c]=[e[c],l[c]]):e[c]=e[c]+l[c]);else e=l}t.push(e)}return t.forEach(e=>{for(const t in e)Array.isArray(e[t])&&(e[t]=e[t].join(d))}),t}(r(t(JSON.parse(JSON.stringify(this.model)),this.filterDetails),this.sortDetails),this.distinctProperties,this.concatenationToken),this.selection),this.groupByProperties)}sum(e,t){e=Array.isArray(e)?e:[e];return i(t||this.model,e)}}function I(e,t){t=t?t.toUpperCase():"FLK-";return e.toUpperCase().includes(t)}function d(e,t){var{timeStamp:s,type:r,x:n,y:i}=e;let o=e.target;do{if(!o||"HTML"===o.tagName||I(o.tagName,t)){"HTML"===o.tagName&&(o=null);break}}while(o=o.parentNode||o.parentElement,!I(o.tagName,t));return{target:o,timeStamp:s,type:r,x:n,y:i}}function B(e,t){let s=e.target,r="";for(;s.dataset[t]?r=s.dataset[t]:s=s.parentNode,!r;);return r}class n{constructor(){}_topLevelClasses=[];_events=[];generateId(){return"flk-"+function e(){const t=([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)),s=t.split("-")[0];return window.$flightkitUUIDStore||(window.$flightkitUUIDStore=[]),window.$flightkitUUIDStore.some(e=>e===s)?e():(window.$flightkitUUIDStore.push(s),s)}()}render(t){if(!t.component)throw new Error("Component is not assigned! Can't render");t.id=t.id||this.generateId();var e=this._getAllEventAttributes(t);if(e){var s="#"+t.id;for(const i of e){var r="e-"+i;this.addEvent(s,i,t.getAttribute(r))}}var n=Object.keys(t.classList).length;if(n){for(let e=0;e{this._assignToDom(t,t.component),clearTimeout(this._renderTimer)},10)}addEvent(e,t,s){this._events.push({selector:e,eventType:t,callback:s})}_getExternalCallback(e){let t=void 0;for(const s of e.split("."))t=(t||window)[s];return t}_getAllEventAttributes(e){e=e.attributes;const t=Array.from(e).filter(e=>e.name.startsWith("e-"));return t.map(e=>e.name.slice(2))}_isFlightkitElement(e){return e.toUpperCase().includes("FLK-")}_outerEventHandler(e){const t=d(e),s=(t.contents=e.detail,t.target.getAttribute("e-"+t.type));let r=void 0;for(const n of s.split("."))r=(r||window)[n];return e.preventDefault(),e.stopPropagation(),r(t)}_addEvents(e){if(e.isConnected)for(const s of this._events)if(s.selector.startsWith("."))for(const r of document.querySelectorAll(s.selector))this._addEventToElement(s,r);else{var t=document.querySelector(s.selector);this._addEventToElement(s,t)}}_addEventToElement(e,t){t&&("function"==typeof e.callback?(t.removeEventListener(e.eventType,e.callback),t.addEventListener(e.eventType,e.callback)):(t.removeEventListener(e.eventType,this._outerEventHandler),t.addEventListener(e.eventType,this._outerEventHandler)))}removeEvents(){for(const t of this._events)if(t.selector.startsWith("."))for(const s of document.querySelectorAll(t.selector))this._addEventToElement(t,s);else{var e=document.querySelector(t.selector);this._addEventToElement(t,e)}this._events=[]}_removeEventToElement(e,t){t&&("function"==typeof e.callback?t.removeEventListener(e.eventType,e.callback):t.removeEventListener(e.eventType,this._outerEventHandler))}_assignToDom(e,t){e.innerHTML="";for(const r of Array.isArray(t)?t:[t])e.append(r);const s=setTimeout(()=>{this._addEvents(e),clearTimeout(s)},10)}}const p='',N='';function D(e){const t=new DOMParser;return t.parseFromString(e,"image/svg+xml").documentElement}class O extends HTMLElement{base;component=null;_contents=[];_orderBy=[];properties=new Set;_columnOrder=[];_filter="";_selectionProperty="";_selectedIds=new Set;uniqueEntriesByProperties={};propertyLabelDictionary={};_templates={};_templateClasses={};static get observedAttributes(){return["contents","columns","order","filter","selection-property","templates"]}get columnOrder(){return this._columnOrder.length?this._columnOrder:this.properties}set columnOrder(e){let t;"string"==typeof e&&(t=e.split(",")),t=e,this._columnOrder=t}get contents(){return this._contents}set contents(e){this.analyzeData(e),this._contents=new S(e)}get orderBy(){return this._orderBy}set orderBy(e){if(Array.isArray(e))this._orderBy=e;else{const r=[];for(const n of e.split(",")){var t=n.split("|"),s=t[0],t=1e[s._selectionProperty])):new Set;e=t?s.contents.execute():[];s._emit("select",s,{selection:e}),s._updateCheckboxes(s)}emitSelect(e){var t=e.target.checked,s=e.target.dataset.objectId;const r=d(e).target,n=(t?r._selectedIds.add(s):r._selectedIds.delete(s),r._selectionProperty);e=r.contents.execute().filter(e=>r._selectedIds.has(e[n]));r._emit("select",r,{selection:e}),r._updateCheckboxes(r)}sortData(e){const t=d(e).target,s=B(e,"column");s&&(-1<(e=t._orderBy.findIndex(e=>e.propertyName===s))?"asc"===t._orderBy[e].direction?t._orderBy[e].direction="desc":t._orderBy.splice(e,1):t._orderBy.push({propertyName:s,direction:"asc"}),t.createHtml(),t.base.render(t))}setColumnOrder(e){this._columnOrder=e?Array.isArray(e)?e:e.split(","):[]}analyzeData(t){this.properties=new Set;var s=t.length;for(let e=0;e"_"===e?" ":" "+e.toLowerCase()).trim();var s=t.charAt(0).toUpperCase()+t.slice(1);return this.propertyLabelDictionary[e]=s}parseTemplate(e,r){return e.replace(/\{\{([\s\S]+?)\}\}/gim,(e,t)=>{let s="";t=t.trim();t=r[t];return t&&(s=t),Array.isArray(s)?s.join(", "):s.toString().trim()})}createSelectionCheckbox(e){const t=document.createElement("input");return t.setAttribute("type","checkbox"),t.classList.add("flk-selection-checkbox"),e&&(t.dataset.selected=e[this._selectionProperty]),t}createRow(e){const t=document.createElement("tr");if(this._selectionProperty.length){const n=document.createElement("td");var s=this.base.generateId();const i=this.createSelectionCheckbox(e);i.id=s,i.dataset.objectId=e[this._selectionProperty];var r=e[this._selectionProperty];this._selectedIds.has(r)?i.checked=!0:i.checked=!1,this.base.addEvent("#"+s,"change",this.emitSelect),n.append(i),t.append(n)}for(const o of this.columnOrder){const a=document.createElement("td");this._templates[o]?(a.innerHTML=this.parseTemplate(this._templates[o],e),this._templateClasses[o]&&a.classList.add(...this._templateClasses[o])):a.innerText=e[o],t.append(a)}return t}createBody(e){const t=document.createElement("tbody");for(const r of e){var s=this.createRow(r,null);t.append(s)}return t}createHead(){const e=document.createElement("thead"),t=document.createElement("tr");if(t.classList.add("cursor-pointer"),this._selectionProperty.length){const n=document.createElement("th");var s=this.base.generateId();const i=this.createSelectionCheckbox();i.id=s;var d=this.contents.execute().length;0e.propertyName===o);if(r){const c=document.createElement("span");c.innerHTML="asc"===r.direction?'':'',a.append(c)}t.append(a)}return e.append(t),e}addEvent(e,t,s){this.base.addEvent(e,t,s)}init(){this.createHtml(),this.base.render(this)}}class j extends HTMLElement{base;componentId;constructor(){super(),this.base=new n}connectedCallback(){var e=this.getAttribute("top"),t=this.getAttribute("left"),s=this.getAttribute("center"),r=this.getAttribute("zIndex");this.id||(this.id=this.base.generateId()),this.style.display="block",this.style.position="fixed","string"==typeof s?(this.style.top=e||"50%",this.style.left="50%",this.style.transform="translate(-50%, -50%)"):(this.style.top=e||this.clientTop+"px",this.style.left=t||this.clientLeft+"px"),r&&(this.style.zIndex=r),this.componentId=this.getAttribute("handle");const n=document.createElement("div");n.innerHTML=this.innerHTML,this.component=n;s="#"+(this.componentId||this.id);this.base.addEvent(s,"mousedown",this._dragElement),this.base.addEvent(s,"mouseup",this._reset),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this)}_dragElement(e){const s=d(e,"flk-draggable").target;let r,n;function t(e){r=e.clientX-s.offsetLeft,n=e.clientY-s.offsetTop}function i(e){var t=e.clientX-r,e=e.clientY-n;s.style.left=t+"px",s.style.top=e+"px"}function o(e){e.preventDefault()}function a(){s.removeAttribute("draggable"),s.removeEventListener("dragstart",t),s.removeEventListener("dragend",a),document.removeEventListener("dragover",o),document.removeEventListener("drop",i)}s.setAttribute("draggable",!0),s.addEventListener("dragstart",t),s.addEventListener("dragend",a),document.addEventListener("dragover",o),document.addEventListener("drop",i)}}class M extends HTMLElement{_id;base;_draggableId;constructor(){super(),this.base=new n}_emit(e,t,s){e=new CustomEvent(e,{detail:s,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}_closeModal(e){e.stopPropagation();const t=d(e,"flk-modal").target;t.classList.add("hidden")}closeModal(e){this.classList.add("hidden")}openModal(e=!0){const t=document.getElementById(this._draggableId);e&&(t.style.top="40%",t.style.left="50%"),this.classList.remove("hidden")}connectedCallback(){this.id||(this.id=this.base.generateId());const e=document.createElement("div");var t=this.base.generateId();const s=document.createElement("flk-draggable"),r=(this._draggableId=this.base.generateId(),s.id=this._draggableId,s.setAttribute("center",""),s.setAttribute("top","40%"),s.setAttribute("handle",t),s.setAttribute("zIndex","1080"),s.classList.add("border","shadow-lg","bg-white"),s.style.width="max-content",document.createElement("div"));var n=this.getAttribute("modal-title");if(n){const c=document.createElement("span");c.innerText=n,c.classList.add("ml-1","mr-auto"),r.append(c)}r.id=t;const i=this.getAttribute("header-class");let o=[];i?o=o.concat(i.split(" ")):o.push("bg-gray-light"),r.classList.add(...o,"border-bottom","row","justify-end","cursor-no-select");n=this.base.generateId();const a=document.createElement("button"),l=(a.classList.add("py-0","px-1","outline-hover","no-border","cursor-default",...o),a.innerText="X",a.id=n,r.append(a),s.append(r),document.createElement("div"));l.innerHTML=this.innerHTML,s.append(l),e.append(s),this.component=e,this.base.addEvent("#"+n,"click",this._closeModal),this.base.render(this),this.classList.add("hidden")}disconnectedCallback(){this.base.removeEvents(this)}}class H extends HTMLElement{base;_buttonId;_drawerId;_iconId;constructor(){super(),this.base=new n}connectedCallback(){this.style.position="relative",this.style.display="flex",this.style.width="fit-content",this._buttonId=this.base.generateId();const e=document.createElement("button"),t=(e.classList.add("row"),e.id=this._buttonId,document.createElement("span")),s=(t.innerText=this.getAttribute("text"),this._iconId=this.base.generateId(),document.createElement("span"));var r=D('');const n=D(''),i=(n.classList.add("hidden"),s.append(r,n),s.id=this._iconId,e.append(t,s),this._drawerId=this.base.generateId(),document.createElement("div"));i.id=this._drawerId,i.classList.add("shadow","inline-block","bg-white"),i.style.position="absolute",i.style.zIndex="1040";r=this.querySelector("template");r.innerHTML.length?i.innerHTML=r.innerHTML:i.append(r.firstChild),i.style.display="none",this.component=[e,i],this.base.addEvent("#"+this._buttonId,"click",this.toggleMenu);const o=document.querySelector("body");""!==o.getAttribute("flk-close-dropdown")&&(o.setAttribute("flk-close-dropdown",""),o.addEventListener("click",this.closeAllDropdownButtons)),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this);var e=document.querySelectorAll("flk-dropdown");if(!e||!e.length){const t=document.querySelector("body");t.removeAttribute("flk-close-dropdown"),t.removeEventListener("click",this.closeAllDropdownButtons)}}toggleMenu(e){const t=d(e).target;e=t._drawerId;const s=document.getElementById(e);var e="none"!==s.style.display,r=(s.style.display=e?"none":"block",t.getAttribute("drawer-width")),r=("string"==typeof t.getAttribute("right")&&(s.style.right="0px"),s.style.top=t.offsetHeight+"px",s.style.width=r||t.offsetWidth+"px",t._iconId);const n=document.getElementById(r);e?(n.childNodes[0].classList.remove("hidden"),n.childNodes[1].classList.add("hidden")):(n.childNodes[0].classList.add("hidden"),n.childNodes[1].classList.remove("hidden"))}_closeDropdown(){var e=this._drawerId;const t=document.getElementById(e);if("none"!==t.style.display){e=this._iconId;const s=document.getElementById(e);t.style.display="none",s.childNodes[0].classList.remove("hidden"),s.childNodes[1].classList.add("hidden")}}closeAllDropdownButtons(e){var t,s=d(e,"flk-dropdown").target,e=document.querySelectorAll("flk-dropdown");if(s)for(const r of e)s._buttonId!==r._buttonId&&(t=r._drawerId,"none"!==document.getElementById(t).style.display&&r._closeDropdown());else for(const n of e)n._closeDropdown()}}class P extends HTMLElement{base;contents;component;listType="ul";iconSet;filter={value:"",caseSensitive:!1};static get observedAttributes(){return["contents","icon-set","max-depth","filter"]}_jsonToValueArray(e){let t=JSON.stringify(e);t=t.replace(/[\[\]{}\"]/g,"");let s=[];for(const r of t.split(","))s=s.concat(r.split(":"));return[...new Set(s)]}_emit(e,t,s){e=new CustomEvent(e,{detail:s,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}constructor(){super(),this.base=new n,this.setContents(this.getAttribute("contents")),this.iconSet=this.getAttribute("icon-set")?this.getAttribute("icon-type"):"file",this.maxDepth=this.getAttribute("max-depth")?parseInt(this.getAttribute("max-depth")):-1,this.setFilter(this.getAttribute("filter")),this.style.display="block",this.style.maxWidth="fit-content",this.style.margin="0 1rem 0 0",this.base.addEvent(".flk-branch","click",this.emitNodeToggle)}emitNodeToggle(e){e.stopPropagation();const t=d(e,"flk-tree-nav").target,s=B(e,"branchKey");let r=t.contents;const n=s.split(".");for(const o of n)if(r[o])r=r[o];else if(null===r[o])r=null;else{let e=[];for(const a of r)a[o]&&e.push(a[o]);r=e}var e=s.substring(s.indexOf(".")+1),i=t.createLeafText(n.reverse()[0]);t._emit("tree-click",t,{path:e,data:r,key:(i.titleText+" "+i.commentText).trim(),branch:"object"==typeof r})}convertJsonKeyToTitle(e){if(!e)return"";const t=(e="string"!=typeof e?e.toString():e).replace(/([A-Z_])/g,e=>"_"===e?" ":" "+e).trim();return t.charAt(0).toUpperCase()+t.slice(1)}setContents(e){var t=e||this.contents||[];try{switch(typeof t){case"string":this.contents=JSON.parse(t);break;case"object":Array.isArray(t)?this.contents=t:this.contents=[t]}}catch(e){console.log(e)}}applyFilter(e){let t;var s="details"===e.tagName.toLowerCase();t=this.filter.caseSensitive?e.dataset.branchValues.includes(this.filter.value):e.dataset.branchValues.toLowerCase().includes(this.filter.value.toLowerCase()),t?e.parentElement.classList.remove("hidden"):e.parentElement.classList.add("hidden"),s&&t?e.setAttribute("open",""):e.removeAttribute("open")}resetTree(e){e.parentElement.classList.remove("hidden"),e.removeAttribute("open")}filterTree(){let t=setTimeout(()=>{for(const e of this.querySelectorAll("[data-branch-values]"))void 0===this.filter.value||0===this.filter.value.length?this.resetTree(e):this.applyFilter(e);clearTimeout(t)},10)}setFilter(e){const t=e||{};try{switch(typeof t){case"string":t.includes("{")?(this.filter=JSON.parse(t),!1===this.filter.caseSensitive&&(this.filter.value=this.filter.value.toLowerCase())):this.filter.value=e.toLowerCase();break;case"object":this.filter=t}}catch(e){console.log(e)}this.filterTree()}createLeafText(e){var t,s;let r="",n="";return"string"==typeof e&&(e.includes("(")||e.includes("["))?(s=e.indexOf("("),s=-1===(t=e.indexOf("["))?s:t,r=this.convertJsonKeyToTitle(e.substring(0,s)),n=e.substring(s)):r=this.convertJsonKeyToTitle(e),{titleText:r,commentText:n}}createTextTag(r,n){r=this.createLeafText(r);if(r.commentText){let e=document.createElement("div"),t=document.createElement("span"),s=(t.innerText=r.titleText,document.createElement("small"));s.innerText=r.commentText,s.style.marginLeft="1rem",e.append(t,s),e.style.display="inline-flex",e.style.alignItems="center",n.append(e)}else n.innerText=r.titleText}createLeaf(e,t,s,r=[]){let n=document.createElement("li");n.classList.add("cursor-no-select"),n.style.marginTop="0.4rem",n.dataset.branchKey=s;const i="file"===this.iconSet?'':'';n.style.listStyleImage=`url('data:image/svg+xml,${i}')`,n.style.position="relative",n.style.left="2px";let o=document.createElement("span");s=[e].concat(r);if(o.dataset.branchValues=[...new Set(s)].join(),r.length&&(o.dataset.leafKey=s[0]),this.createTextTag(e,o),o.style.position="relative",o.style.top="-3px",n.append(o),t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);const i="file"===this.iconSet?p:N;e.style.listStyleImage=`url('data:image/svg+xml,${i}')`,e.append(n),t.append(e)}else t.append(n)}createBranch(s,t,r,n){if(n===this.maxDepth&&"object"==typeof s)for(const o of Array.isArray(s)?s:Object.keys(s)){let e;s[o]&&(e=this._jsonToValueArray(s[o])),this.createLeaf(o,t,r+"."+o,e)}else if(Array.isArray(s))for(var e in s){var d=document.createElement(this.listType);t.append(this.createBranch(s[e],d,r+"."+e,n+1))}else if(null!==s&&"object"==typeof s){const a=[];for(const l of Object.keys(s)){let e=document.createElement("li"),t=(e.classList.add("cursor-no-select"),e.style.position="relative",e.style.left="2px",e.dataset.branchKey=r+"."+l,document.createElement("details"));t.classList.add("flk-branch"),t.dataset.branchValues=[l].concat(this._jsonToValueArray(s[l])),t.style.position="relative",t.style.top="-3px",t.classList.add("cursor-default");var i=document.createElement("summary");this.createTextTag(l,i),t.append(i),e.append(this.createBranch(s[l],t,r+"."+l,n+1)),a.push(e)}if(t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);var h="file"===this.iconSet?p:N;e.style.listStyleImage=`url('data:image/svg+xml,${h}')`;for(const c of a)e.append(c);t.append(e)}else for(const u of a)t.append(u)}else this.createLeaf(s,t,r);return t}createHtml(){let e=document.createElement(this.listType);var t="file"===this.iconSet?p:'';if(e.style.listStyleImage=`url('data:image/svg+xml,${t}')`,e.style.marginLeft="3rem",this.contents.length){for(const s in this.contents)e=this.createBranch(this.contents[s],e,s,0);this.component=e}else this.component=e}attributeChangedCallback(e,t,s){switch(e){case"contents":this.setContents(s);break;case"icon-set":this.iconSet=s;break;case"max-depth":this.maxDepth="string"==typeof s?parseInt(s):s;break;case"filter":this.setFilter(s)}this.init()}connectedCallback(){this.init()}disconnectedCallback(){this.base.removeEvents(this)}init(){this.createHtml(),this.base.render(this)}}customElements.define("flk-table",O),customElements.define("flk-draggable",j),customElements.define("flk-modal",M),customElements.define("flk-dropdown",H),customElements.define("flk-tree-nav",P)}(); \ No newline at end of file diff --git a/documentation/public/js/flightkit.min.js b/documentation/public/js/flightkit.min.js index 9a82b7a..930836a 100644 --- a/documentation/public/js/flightkit.min.js +++ b/documentation/public/js/flightkit.min.js @@ -1 +1 @@ -!function(e,n,s,i){"use strict";function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a,u,g,e=c(e),n=c(n),s=c(s),i=c(i);(t=a=a||{}).Date="date",t.String="string",t.Float="float",t.Number="number",t.Array="array",t.Object="object",t.Bool="bool",t.Currency="currency",t.Undefined="undefined",t.Null="null";const h={date:/^(\d{1,4}-\d{1,4}-\d{1,4}(T)?)/gim,currency:/^[$|€]\s?[0-9]*(\.|,)?\d*(\.|,)?\d*/gim,float:/\d+[,|.]\d+[,|.]?\d*/gim,currencySign:/\$|€/gim,array:/^\s?[[].[^,]+[\]],?/gi,precision:/[-+$€,.]/gm,string:/[a-zA-Z]/gim},m=e=>{return null===e||"null"===e?a.Null:e||0===e||!1===e?null===new RegExp(h.date).exec(e)||isNaN(Date.parse(e))?new RegExp(h.currency).exec(e)?a.Currency:!new RegExp(h.string).exec(e)&&new RegExp(h.float).exec(e.toString())?a.Float:isNaN(e)&&0!==e?Array.isArray(e)?a.Array:"object"==typeof e?a.Object:a.String:a.Number:a.Date:a.Undefined},y=(t,e)=>{const r={value:void 0,type:e=e||m(t),currencySign:""};switch(r.type){case a.String:r.value=t.toString();break;case a.Float:case a.Currency:var n=(t=t.toString()).match(new RegExp(/(,)/gim)),s=t.match(new RegExp(/(\.)/gim));if(n)for(let e=1;e<=n.length;e++)t=e!==n.length||s?t.replace(",",""):t.replace(",",".");if(r.type===a.Currency){const o=new RegExp(h.currencySign);var i=o.exec(t);r.currencySign=null!==i?i[0]:"",t=t.replace(o,"")}r.value=parseFloat(t).toPrecision(12);break;case a.Number:r.value=Number(t);break;case a.Date:r.value=Date.parse(t);break;case a.Array:t.length?"object"==typeof t[0]?r.value=t.map(e=>JSON.stringify(e)).join(", "):r.value=t.join(", "):r.value="";break;case a.Object:r.value=t;break;case a.Undefined:r.value="";break;case a.Null:r.value=null}return r};function v(e,t){var r;let n;for(r of e.split("."))r=r.trim(),n?"object"!=typeof n||Array.isArray(n)||(n=n[r]):n=t[r];return n}const b=(e,t)=>tet<=e,S=(e,t)=>e<=t,x=(e,t,r)=>r?e.toLowerCase()==t.toLowerCase():e==t,A=(e,t)=>e===t,k=(e,t)=>e!=t,E=(e,t)=>e!==t,L=(e,t)=>null!=t&&"string"==typeof e&&0<=e.toLowerCase().indexOf(t.toString().toLowerCase()),O=(e,t)=>null!=t&&0<=e.toString().toLowerCase().indexOf(t.toString().toLowerCase()),M=(e,t)=>null!=t&&"string"==typeof e&&e.toLowerCase().indexOf(t.toString().toLowerCase())<0;function P(r,n){if(0===n.length)return r;{var s=r;const o=[],a=[];let e=[];for(const l of n)l.type&&l.type!==u.And?(e.length&&a.push(e),e=[l]):e.push(l);a.push(e);let t=[];for(const e of a)t=t.concat(R(s,e));t=[...new Set(t)];var i=s.length;for(let e=0;e":return b;case"<":return _;case">=":return C;case"<=":return S;case"is":case"==":return x;case"!is":case"!=":return k;case"===":return A;case"!==":return E;case"like":case"~":case"contains":return L;case"!contains":case"!like":case"!~":return M;default:return O}}(a.operator);if(!l(i,o,a.ignoreCase)){e=!1;break}}e&&r.push(n)}return r};function T(e,t){if(!t||0===t.length)return e;if(1{if(0===r.length)r=r.concat(I(s,e));else{for(const t of r)n=n.concat(I(t,e));r=n,n=[]}}),r}return I(e,t[0])}function I(e,t){const r=[],n=[];do{if(!e||0===e.length)break;var s=e.shift();if(!s)break;const o=s[t];var i=n.indexOf(o.toString());0<=i?r[i].push(s):(n.push(o.toString()),void 0!==r[n.length-1]?r[n.length-1].push(s):r.push([s]))}while(0{if(t){var r=e;const n={};for(const s of t){let e=r.map(e=>e[s].toString());const i=e.map(e=>m(e));i.some(e=>e===a.Float)?(e=e.map(e=>parseFloat(e)),n[s]=parseFloat(e.reduce((e,t)=>e+t).toFixed(2))):(e=e.map(e=>parseInt(e)),n[s]=e.reduce((e,t)=>e+t))}return n}return{}};class D{model;sortDetails=[];filterDetails=[];selection=[];groupByProperties=[];distinctProperties=[];concatenationToken=", ";constructor(e){this.model=JSON.parse(JSON.stringify(e))}sort(e){return this.sortDetails=e,this}orderBy(e,t){return this.sortDetails.push({propertyName:e,direction:t}),this}thenOrderBy(e,t){return this.orderBy(e,t)}filter(e){return Array.isArray(e)?this.filterDetails=e:this.filterDetails.push(e),this}where(e,t,r,n,s){return this.filterDetails.push({propertyName:e,operator:t,value:r,type:n,ignoreCase:s}),this}andWhere(e,t,r,n){return this.where(e,t,r,u.And,n),this}orWhere(e,t,r,n){return this.where(e,t,r,u.Or,n),this}group(e){return this.groupByProperties=e,this}groupBy(e){return this.groupByProperties.push(e),this}thenGroupBy(e){return this.groupByProperties.push(e),this}select(e){return Array.isArray(e)?this.selection=e:"*"!==e&&(this.selection=[e]),this}distinct(e,t){return t&&(this.concatenationToken=t),Array.isArray(e)?this.distinctProperties=e:e&&(this.distinctProperties=[e]),this}execute(){return T(function(t,r){if(0===r.length)return t;{var n=r;let e=[];for(const s of t){const i={};for(const o of n)i[o]=s[o];e.push(i)}return e}}(function(r,n,u){if(!n||!n.length)return r;const s=[],h=[];for(const f of r){const o={};let t="";for(const e of n){var p=v(e,f);o[e]=p,t+=p}if(!h.includes(t)){let e=r;for(const a of Object.keys(o))e=e.filter(e=>e[a]===o[a]);h.push(t),s.push(e)}}const t=[];for(const m of s){let e={};for(const l of m){var i,d=Object.keys(e);if(d.length)for(const c of d)n.includes(c)||(i=e[c],Array.isArray(i)?(i=l[c],Array.isArray(i)?e[c]=[...new Set(...e[c].concat(l[c]))]:e[c].includes(l[c])||e[c].push(l[c])):isNaN(e[c])&&isNaN(l[c])?e[c]!==l[c]&&(e[c]=[e[c],l[c]]):e[c]=e[c]+l[c]);else e=l}t.push(e)}return t.forEach(e=>{for(const t in e)Array.isArray(e[t])&&(e[t]=e[t].join(u))}),t}(B(P(JSON.parse(JSON.stringify(this.model)),this.filterDetails),this.sortDetails),this.distinctProperties,this.concatenationToken),this.selection),this.groupByProperties)}sum(e,t){e=Array.isArray(e)?e:[e];return j(t||this.model,e)}}function U(e,t){t=t?t.toUpperCase():"FLK-";return e.toUpperCase().includes(t)}function F(e,t){var{timeStamp:r,type:n,x:s,y:i}=e;let o=e.target;do{if(!o||"HTML"===o.tagName||U(o.tagName,t)){"HTML"===o.tagName&&(o=null);break}}while(o=o.parentNode||o.parentElement,!U(o.tagName,t));return{target:o,timeStamp:r,type:n,x:s,y:i}}function z(e,t){let r=e.target,n="";for(;r.dataset[t]?n=r.dataset[t]:r=r.parentNode,!n;);return n}class ${constructor(){}_topLevelClasses=[];_events=[];generateId(){return"flk-"+function e(){const t=([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)),r=t.split("-")[0];return window.$flightkitUUIDStore||(window.$flightkitUUIDStore=[]),window.$flightkitUUIDStore.some(e=>e===r)?e():(window.$flightkitUUIDStore.push(r),r)}()}render(t){if(!t.component)throw new Error("Component is not assigned! Can't render");t.id=t.id||this.generateId();var e=this._getAllEventAttributes(t);if(e){var r="#"+t.id;for(const i of e){var n="e-"+i;this.addEvent(r,i,t.getAttribute(n))}}var s=Object.keys(t.classList).length;if(s){for(let e=0;e{this._assignToDom(t,t.component),clearTimeout(this._renderTimer)},10)}addEvent(e,t,r){this._events.push({selector:e,eventType:t,callback:r})}_getExternalCallback(e){let t=void 0;for(const r of e.split("."))t=(t||window)[r];return t}_getAllEventAttributes(e){e=e.attributes;const t=Array.from(e).filter(e=>e.name.startsWith("e-"));return t.map(e=>e.name.slice(2))}_isFlightkitElement(e){return e.toUpperCase().includes("FLK-")}_outerEventHandler(e){const t=F(e),r=(t.contents=e.detail,t.target.getAttribute("e-"+t.type));let n=void 0;for(const s of r.split("."))n=(n||window)[s];return e.preventDefault(),e.stopPropagation(),n(t)}_addEvents(e){if(e.isConnected)for(const r of this._events)if(r.selector.startsWith("."))for(const n of document.querySelectorAll(r.selector))this._addEventToElement(r,n);else{var t=document.querySelector(r.selector);this._addEventToElement(r,t)}}_addEventToElement(e,t){t&&("function"==typeof e.callback?(t.removeEventListener(e.eventType,e.callback),t.addEventListener(e.eventType,e.callback)):(t.removeEventListener(e.eventType,this._outerEventHandler),t.addEventListener(e.eventType,this._outerEventHandler)))}removeEvents(){for(const t of this._events)if(t.selector.startsWith("."))for(const r of document.querySelectorAll(t.selector))this._addEventToElement(t,r);else{var e=document.querySelector(t.selector);this._addEventToElement(t,e)}this._events=[]}_removeEventToElement(e,t){t&&("function"==typeof e.callback?t.removeEventListener(e.eventType,e.callback):t.removeEventListener(e.eventType,this._outerEventHandler))}_assignToDom(e,t){e.innerHTML="";for(const n of Array.isArray(t)?t:[t])e.append(n);const r=setTimeout(()=>{this._addEvents(e),clearTimeout(r)},10)}}const G='',H='';function V(e){const t=new DOMParser;return t.parseFromString(e,"image/svg+xml").documentElement}class W extends HTMLElement{base;component=null;_contents=[];_orderBy=[];properties=new Set;_columnOrder=[];_filter="";_selectionProperty="";_selectedIds=new Set;uniqueEntriesByProperties={};propertyLabelDictionary={};_templates={};_templateClasses={};static get observedAttributes(){return["contents","columns","order","filter","selection-property","templates"]}get columnOrder(){return this._columnOrder.length?this._columnOrder:this.properties}set columnOrder(e){let t;"string"==typeof e&&(t=e.split(",")),t=e,this._columnOrder=t}get contents(){return this._contents}set contents(e){this.analyzeData(e),this._contents=new D(e)}get orderBy(){return this._orderBy}set orderBy(e){if(Array.isArray(e))this._orderBy=e;else{const n=[];for(const s of e.split(",")){var t=s.split("|"),r=t[0],t=1e[r._selectionProperty])):new Set;e=t?r.contents.execute():[];r._emit("select",r,{selection:e}),r._updateCheckboxes(r)}emitSelect(e){var t=e.target.checked,r=e.target.dataset.objectId;const n=F(e).target,s=(t?n._selectedIds.add(r):n._selectedIds.delete(r),n._selectionProperty);e=n.contents.execute().filter(e=>n._selectedIds.has(e[s]));n._emit("select",n,{selection:e}),n._updateCheckboxes(n)}sortData(e){const t=F(e).target,r=z(e,"column");r&&(-1<(e=t._orderBy.findIndex(e=>e.propertyName===r))?"asc"===t._orderBy[e].direction?t._orderBy[e].direction="desc":t._orderBy.splice(e,1):t._orderBy.push({propertyName:r,direction:"asc"}),t.createHtml(),t.base.render(t))}setColumnOrder(e){this._columnOrder=e?Array.isArray(e)?e:e.split(","):[]}analyzeData(t){this.properties=new Set;var r=t.length;for(let e=0;e"_"===e?" ":" "+e.toLowerCase()).trim();var r=t.charAt(0).toUpperCase()+t.slice(1);return this.propertyLabelDictionary[e]=r}parseTemplate(e,n){return e.replace(/\{\{([\s\S]+?)\}\}/gim,(e,t)=>{let r="";t=t.trim();t=n[t];return t&&(r=t),Array.isArray(r)?r.join(", "):r.toString().trim()})}createSelectionCheckbox(e){const t=document.createElement("input");return t.setAttribute("type","checkbox"),t.classList.add("flk-selection-checkbox"),e&&(t.dataset.selected=e[this._selectionProperty]),t}createRow(e){const t=document.createElement("tr");if(this._selectionProperty.length){const s=document.createElement("td");var r=this.base.generateId();const i=this.createSelectionCheckbox(e);i.id=r,i.dataset.objectId=e[this._selectionProperty];var n=e[this._selectionProperty];this._selectedIds.has(n)?i.checked=!0:i.checked=!1,this.base.addEvent("#"+r,"change",this.emitSelect),s.append(i),t.append(s)}for(const o of this.columnOrder){const a=document.createElement("td");this._templates[o]?(a.innerHTML=this.parseTemplate(this._templates[o],e),this._templateClasses[o]&&a.classList.add(...this._templateClasses[o])):a.innerText=e[o],t.append(a)}return t}createBody(e){const t=document.createElement("tbody");for(const n of e){var r=this.createRow(n,null);t.append(r)}return t}createHead(){const e=document.createElement("thead"),t=document.createElement("tr");if(t.classList.add("cursor-pointer"),this._selectionProperty.length){const s=document.createElement("th");var r=this.base.generateId();const i=this.createSelectionCheckbox();i.id=r;var u=this.contents.execute().length;0e.propertyName===o);if(n){const c=document.createElement("span");c.innerHTML="asc"===n.direction?'':'',a.append(c)}t.append(a)}return e.append(t),e}addEvent(e,t,r){this.base.addEvent(e,t,r)}init(){this.createHtml(),this.base.render(this)}}class J extends HTMLElement{base;componentId;constructor(){super(),this.base=new $}connectedCallback(){var e=this.getAttribute("top"),t=this.getAttribute("left"),r=this.getAttribute("center"),n=this.getAttribute("zIndex");this.id||(this.id=this.base.generateId()),this.style.display="block",this.style.position="fixed","string"==typeof r?(this.style.top=e||"50%",this.style.left="50%",this.style.transform="translate(-50%, -50%)"):(this.style.top=e||this.clientTop+"px",this.style.left=t||this.clientLeft+"px"),n&&(this.style.zIndex=n),this.componentId=this.getAttribute("handle");const s=document.createElement("div");s.innerHTML=this.innerHTML,this.component=s;r="#"+(this.componentId||this.id);this.base.addEvent(r,"mousedown",this._dragElement),this.base.addEvent(r,"mouseup",this._reset),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this)}_dragElement(e){const r=F(e,"flk-draggable").target;let n,s;function t(e){n=e.clientX-r.offsetLeft,s=e.clientY-r.offsetTop}function i(e){var t=e.clientX-n,e=e.clientY-s;r.style.left=t+"px",r.style.top=e+"px"}function o(e){e.preventDefault()}function a(){r.removeAttribute("draggable"),r.removeEventListener("dragstart",t),r.removeEventListener("dragend",a),document.removeEventListener("dragover",o),document.removeEventListener("drop",i)}r.setAttribute("draggable",!0),r.addEventListener("dragstart",t),r.addEventListener("dragend",a),document.addEventListener("dragover",o),document.addEventListener("drop",i)}}class q extends HTMLElement{_id;base;_draggableId;constructor(){super(),this.base=new $}_emit(e,t,r){e=new CustomEvent(e,{detail:r,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}_closeModal(e){e.stopPropagation();const t=F(e,"flk-modal").target;t.classList.add("hidden")}closeModal(e){this.classList.add("hidden")}openModal(e=!0){const t=document.getElementById(this._draggableId);e&&(t.style.top="40%",t.style.left="50%"),this.classList.remove("hidden")}connectedCallback(){this.id||(this.id=this.base.generateId());const e=document.createElement("div");var t=this.base.generateId();const r=document.createElement("flk-draggable"),n=(this._draggableId=this.base.generateId(),r.id=this._draggableId,r.setAttribute("center",""),r.setAttribute("top","40%"),r.setAttribute("handle",t),r.setAttribute("zIndex","1080"),r.classList.add("border","shadow-lg","bg-white"),r.style.width="max-content",document.createElement("div"));var s=this.getAttribute("modal-title");if(s){const c=document.createElement("span");c.innerText=s,c.classList.add("ml-1","mr-auto"),n.append(c)}n.id=t;const i=this.getAttribute("header-class");let o=[];i?o=o.concat(i.split(" ")):o.push("bg-gray-light"),n.classList.add(...o,"border-bottom","row","justify-end","cursor-no-select");s=this.base.generateId();const a=document.createElement("button"),l=(a.classList.add("py-0","px-1","outline-hover","no-border","cursor-default",...o),a.innerText="X",a.id=s,n.append(a),r.append(n),document.createElement("div"));l.innerHTML=this.innerHTML,r.append(l),e.append(r),this.component=e,this.base.addEvent("#"+s,"click",this._closeModal),this.base.render(this),this.classList.add("hidden")}disconnectedCallback(){this.base.removeEvents(this)}}class K extends HTMLElement{base;_buttonId;_drawerId;_iconId;constructor(){super(),this.base=new $}connectedCallback(){this.style.position="relative",this.style.display="flex",this.style.width="fit-content",this._buttonId=this.base.generateId();const e=document.createElement("button"),t=(e.classList.add("row"),e.id=this._buttonId,document.createElement("span")),r=(t.innerText=this.getAttribute("text"),this._iconId=this.base.generateId(),document.createElement("span"));var n=V('');const s=V(''),i=(s.classList.add("hidden"),r.append(n,s),r.id=this._iconId,e.append(t,r),this._drawerId=this.base.generateId(),document.createElement("div"));i.id=this._drawerId,i.classList.add("shadow","inline-block","bg-white"),i.style.position="absolute",i.style.zIndex="1040";n=this.querySelector("template");n.innerHTML.length?i.innerHTML=n.innerHTML:i.append(n.firstChild),i.style.display="none",this.component=[e,i],this.base.addEvent("#"+this._buttonId,"click",this.toggleMenu);const o=document.querySelector("body");""!==o.getAttribute("flk-close-dropdown")&&(o.setAttribute("flk-close-dropdown",""),o.addEventListener("click",this.closeAllDropdownButtons)),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this);var e=document.querySelectorAll("flk-dropdown");if(!e||!e.length){const t=document.querySelector("body");t.removeAttribute("flk-close-dropdown"),t.removeEventListener("click",this.closeAllDropdownButtons)}}toggleMenu(e){const t=F(e).target;e=t._drawerId;const r=document.getElementById(e);var e="none"!==r.style.display,n=(r.style.display=e?"none":"block",t.getAttribute("drawer-width")),n=("string"==typeof t.getAttribute("right")&&(r.style.right="0px"),r.style.top=t.offsetHeight+"px",r.style.width=n||t.offsetWidth+"px",t._iconId);const s=document.getElementById(n);e?(s.childNodes[0].classList.remove("hidden"),s.childNodes[1].classList.add("hidden")):(s.childNodes[0].classList.add("hidden"),s.childNodes[1].classList.remove("hidden"))}_closeDropdown(){var e=this._drawerId;const t=document.getElementById(e);if("none"!==t.style.display){e=this._iconId;const r=document.getElementById(e);t.style.display="none",r.childNodes[0].classList.remove("hidden"),r.childNodes[1].classList.add("hidden")}}closeAllDropdownButtons(e){var t,r=F(e,"flk-dropdown").target,e=document.querySelectorAll("flk-dropdown");if(r)for(const n of e)r._buttonId!==n._buttonId&&(t=n._drawerId,"none"!==document.getElementById(t).style.display&&n._closeDropdown());else for(const s of e)s._closeDropdown()}}var t={exports:{}};let Z=e.default,Y=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||"win32"===process.platform||Z.isatty(1)&&"dumb"!==process.env.TERM||"CI"in process.env),r=(r,n,s=r)=>e=>{let t=""+e;e=t.indexOf(n,r.length);return~e?r+X(t,n,s,e)+n:r+t+n},X=(e,t,r,n)=>{var s=e.substring(0,n)+r;let i=e.substring(n+t.length);e=i.indexOf(t);return~e?s+X(i,t,r,e):s+i};e=(e=Y)=>({isColorSupported:e,reset:e?e=>`${e}`:String,bold:e?r("","",""):String,dim:e?r("","",""):String,italic:e?r("",""):String,underline:e?r("",""):String,inverse:e?r("",""):String,hidden:e?r("",""):String,strikethrough:e?r("",""):String,black:e?r("",""):String,red:e?r("",""):String,green:e?r("",""):String,yellow:e?r("",""):String,blue:e?r("",""):String,magenta:e?r("",""):String,cyan:e?r("",""):String,white:e?r("",""):String,gray:e?r("",""):String,bgBlack:e?r("",""):String,bgRed:e?r("",""):String,bgGreen:e?r("",""):String,bgYellow:e?r("",""):String,bgBlue:e?r("",""):String,bgMagenta:e?r("",""):String,bgCyan:e?r("",""):String,bgWhite:e?r("",""):String});t.exports=e(),t.exports.createColors=e;const Q="'".charCodeAt(0),ee='"'.charCodeAt(0),te="\\".charCodeAt(0),re="/".charCodeAt(0),ne="\n".charCodeAt(0),se=" ".charCodeAt(0),ie="\f".charCodeAt(0),oe="\t".charCodeAt(0),ae="\r".charCodeAt(0),le="[".charCodeAt(0),ce="]".charCodeAt(0),ue="(".charCodeAt(0),he=")".charCodeAt(0),pe="{".charCodeAt(0),de="}".charCodeAt(0),fe=";".charCodeAt(0),me="*".charCodeAt(0),ge=":".charCodeAt(0),ye="@".charCodeAt(0),ve=/[\t\n\f\r "#'()/;[\\\]{}]/g,we=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,be=/.[\r\n"'(/\\]/,_e=/[\da-f]/i;function Ce(t,e={}){let n=t.css.valueOf(),d=e.ignoreErrors,s,i,f,m,o,a,l,g,c,u,y=n.length,h=0,v=[],p=[];function w(e){throw t.error("Unclosed "+e,h)}return{back:function(e){p.push(e)},endOfFile:function(){return 0===p.length&&h>=y},nextToken:function(e){if(p.length)return p.pop();if(!(h>=y)){var t=!!e&&e.ignoreUnclosed;switch(s=n.charCodeAt(h),s){case ne:case se:case oe:case ae:case ie:for(i=h;i+=1,s=n.charCodeAt(i),s===se||s===ne||s===oe||s===ae||s===ie;);u=["space",n.slice(h,i)],h=i-1;break;case le:case ce:case pe:case de:case ge:case fe:case he:var r=String.fromCharCode(s);u=[r,r,h];break;case ue:if(g=v.length?v.pop()[1]:"",c=n.charCodeAt(h+1),"url"===g&&c!==Q&&c!==ee&&c!==se&&c!==ne&&c!==oe&&c!==ie&&c!==ae){i=h;do{if(a=!1,i=n.indexOf(")",i+1),-1===i){if(d||t){i=h;break}w("bracket")}for(l=i;n.charCodeAt(l-1)===te;)--l,a=!a}while(a);u=["brackets",n.slice(h,i+1),h,i],h=i}else i=n.indexOf(")",h+1),m=n.slice(h,i+1),-1===i||be.test(m)?u=["(","(",h]:(u=["brackets",m,h,i],h=i);break;case Q:case ee:f=s===Q?"'":'"',i=h;do{if(a=!1,i=n.indexOf(f,i+1),-1===i){if(d||t){i=h+1;break}w("string")}for(l=i;n.charCodeAt(l-1)===te;)--l,a=!a}while(a);u=["string",n.slice(h,i+1),h,i],h=i;break;case ye:ve.lastIndex=h+1,ve.test(n),i=0===ve.lastIndex?n.length-1:ve.lastIndex-2,u=["at-word",n.slice(h,i+1),h,i],h=i;break;case te:for(i=h,o=!0;n.charCodeAt(i+1)===te;)i+=1,o=!o;if(s=n.charCodeAt(i+1),o&&s!==re&&s!==se&&s!==ne&&s!==oe&&s!==ae&&s!==ie&&(i+=1,_e.test(n.charAt(i)))){for(;_e.test(n.charAt(i+1));)i+=1;n.charCodeAt(i+1)===se&&(i+=1)}u=["word",n.slice(h,i+1),h,i],h=i;break;default:h=(s===re&&n.charCodeAt(h+1)===me?(i=n.indexOf("*/",h+2)+1,0===i&&(d||t?i=n.length:w("comment")),u=["comment",n.slice(h,i+1),h,i]):(we.lastIndex=h+1,we.test(n),i=0===we.lastIndex?n.length-1:we.lastIndex-2,u=["word",n.slice(h,i+1),h,i],v.push(u)),i)}return h++,u}},position:function(){return h}}}e=t.exports;let Se=Ce,xe;const Ae={";":e.yellow,":":e.yellow,"(":e.cyan,")":e.cyan,"[":e.yellow,"]":e.yellow,"{":e.yellow,"}":e.yellow,"at-word":e.cyan,brackets:e.cyan,call:e.cyan,class:e.yellow,comment:e.gray,hash:e.magenta,string:e.green};function ke(e){let r=Se(new xe(e),{ignoreErrors:!0}),n="";for(;!r.endOfFile();){let e=r.nextToken(),t=Ae[function([e,t],r){if("word"===e){if("."===t[0])return"class";if("#"===t[0])return"hash"}if(!r.endOfFile()){t=r.nextToken();if(r.back(t),"brackets"===t[0]||"("===t[0])return"call"}return e}(e,r)];t?n+=e[1].split(/\r?\n/).map(e=>t(e)).join("\n"):n+=e[1]}return n}ke.registerInput=function(e){xe=e};e=ke;let Ee=t.exports,Le=e;class Oe extends Error{constructor(e,t,r,n,s,i){super(e),this.name="CssSyntaxError",this.reason=e,s&&(this.file=s),n&&(this.source=n),i&&(this.plugin=i),void 0!==t&&void 0!==r&&("number"==typeof t?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,Oe)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file||"",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source,r=(null==e&&(e=Ee.isColorSupported),Le&&e&&(t=Le(t)),t.split(/\r?\n/)),n=Math.max(this.line-3,0);var s=Math.min(this.line+2,r.length);let i=String(s).length,o,a;if(e){let{bold:t,gray:r,red:n}=Ee.createColors(!0);o=e=>t(n(e)),a=e=>r(e)}else o=a=e=>e;return r.slice(n,s).map((e,t)=>{var t=n+1+t;let r=" "+(" "+t).slice(-i)+" | ";return t===this.line?(t=a(r.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," "),o(">")+a(r)+e+"\n "+t+o("^")):" "+a(r)+e}).join("\n")}toString(){let e=this.showSourceCode();return e=e&&"\n\n"+e+"\n",this.name+": "+this.message+e}}var t=Oe,Me=(Oe.default=Oe,{});Me.isClean=Symbol("isClean"),Me.my=Symbol("my");const Pe={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class Re{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name;var n=e.params?this.rawValue(e,"params"):"";void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes?this.block(e,r+n):(t=(e.raws.between||"")+(t?";":""),this.builder(r+n+t,e))}beforeAfter(e,t){let r,n=(r="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose"),e.parent),s=0;for(;n&&"root"!==n.type;)s+=1,n=n.parent;if(r.includes("\n")){var i=this.raw(e,null,"indent");if(i.length)for(let e=0;e{if(n=e.raws[t],void 0!==n)return!1}),void 0===n&&(n=Pe[r]),i.rawCache[r]=n,n}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&0{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=void 0===r?this.raw(t,null,"beforeDecl"):r&&r.replace(/\S/g,""),r}rawBeforeDecl(e,t){let r;return e.walkDecls(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=void 0===r?this.raw(t,null,"beforeRule"):r&&r.replace(/\S/g,""),r}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(t){let r;return t.walk(e=>{if(e.nodes&&(e.parent!==t||t.first!==e)&&void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=r&&r.replace(/\S/g,""),r}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(r){if(r.raws.indent)return r.raws.indent;let n;return r.walk(e=>{var t=e.parent;if(t&&t!==r&&t.parent&&t.parent===r&&void 0!==e.raws.before)return t=e.raws.before.split("\n"),n=t[t.length-1],n=n.replace(/\S/g,""),!1}),n}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){var r=e[t],e=e.raws[t];return e&&e.value===r?e.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}}var Te=Re;Re.default=Re;let Ie=Te;function Be(e,t){let r=new Ie(t);r.stringify(e)}var Ne=Be;Be.default=Be;let{isClean:je,my:De}=Me,Ue=t,Fe=Te,ze=Ne;function $e(t,r){let n=new t.constructor;for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&"proxyCache"!==s){let e=t[s];var i=typeof e;"parent"===s&&"object"==i?r&&(n[s]=r):"source"===s?n[s]=e:Array.isArray(e)?n[s]=e.map(e=>$e(e,n)):("object"==i&&null!==e&&(e=$e(e)),n[s]=e)}return n}class Ge{constructor(e={}){for(var t in this.raws={},this[je]=!1,this[De]=!0,e)if("nodes"===t){this.nodes=[];for(var r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){var t;return e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)&&(t=this.source,e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)),e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(var t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=$e(this);for(var r in e)t[r]=e[r];return t}cloneAfter(e={}){e=this.clone(e);return this.parent.insertAfter(this,e),e}cloneBefore(e={}){e=this.clone(e);return this.parent.insertBefore(this,e),e}error(e,t={}){var r,n;return this.source?({end:r,start:n}=this.rangeBy(t),this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)):new Ue(e)}getProxyProcessor(){return{get(e,t){return"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t]},set(e,t,r){return e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0}}}markDirty(){if(this[je]){this[je]=!1;let e=this;for(;e=e.parent;)e[je]=!1}}next(){var e;if(this.parent)return e=this.parent.index(this),this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;return e.index?r=this.positionInside(e.index,t):!e.word||-1!==(e=(t=this.toString()).indexOf(e.word))&&(r=this.positionInside(e,t)),r}positionInside(t,e){var r=e||this.toString();let n=this.source.start.column,s=this.source.start.line;for(let e=0;e"object"==typeof e&&e.toJSON?e.toJSON(null,r):e);else if("object"==typeof t&&t.toJSON)n[s]=t.toJSON(null,r);else if("source"===s){let e=r.get(t.input);null==e&&(e=i,r.set(t.input,i),i++),n[s]={end:t.end,inputId:e,start:t.start}}else n[s]=t}return t&&(n.inputs=[...r.keys()].map(e=>e.toJSON())),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=ze){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(var s in r)n[s]=r[s];return e.warn(t,n)}get proxyOf(){return this}}var Te=Ge,He=(Ge.default=Ge,Te);class Ve extends He{constructor(e){super(e=e&&void 0!==e.value&&"string"!=typeof e.value?{...e,value:String(e.value)}:e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}}var He=Ve,We=(Ve.default=Ve,{}),Je={},qe={},Ke={},Ze="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),Ye=(Ke.encode=function(e){if(0<=e&&e>>=5)&&(t|=32),r+=Ye.encode(t),0>1,1==(1&a)?-i:i),r.rest=t};var Ke={},l=Ke,Xe=(l.getArg=function(e,t,r){if(t in e)return e[t];if(3===arguments.length)return r;throw new Error('"'+t+'" is a required argument.')},/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/),Qe=/^data:.+\,.+$/;function et(e){e=e.match(Xe);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}function tt(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}l.urlParse=et,l.urlGenerate=tt,rt=function(e){var t=e,r=et(e);if(r){if(!r.path)return e;t=r.path}for(var n,e=l.isAbsolute(t),s=[],i=0;;){if(n=i,-1===(i=t.indexOf("/",n))){s.push(t.slice(n));break}for(s.push(t.slice(n,i));in;e--){var o=r[e-1],a=r[e];if(Pt(o,a)<=0)break;r[e-1]=a,r[e]=o}else Ot(r,Pt,n)}function Tt(e,s){var t=e,e=("string"==typeof e&&(t=w.parseSourceMapInput(e)),w.getArg(t,"version")),t=w.getArg(t,"sections");if(e!=this._version)throw new Error("Unsupported version: "+e);this._sources=new Et,this._names=new Et;var i={line:-1,column:0};this._sections=t.map(function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var t=w.getArg(e,"offset"),r=w.getArg(t,"line"),n=w.getArg(t,"column");if(r=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))},p.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;var r=this._findSourceIndex(e);if(0<=r)return this.sourcesContent[r];var n,r=e;if(null!=this.sourceRoot&&(r=w.relative(this.sourceRoot,r)),null!=this.sourceRoot&&(n=w.urlParse(this.sourceRoot))){e=r.replace(/^file:\/\//,"");if("file"==n.scheme&&this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];if((!n.path||"/"==n.path)&&this._sources.has("/"+r))return this.sourcesContent[this._sources.indexOf("/"+r)]}if(t)return null;throw new Error('"'+r+'" is not in the SourceMap.')},p.prototype.generatedPositionFor=function(e){var t=w.getArg(e,"source");if((t=this._findSourceIndex(t))<0)return{line:null,column:null,lastColumn:null};t={source:t,originalLine:w.getArg(e,"line"),originalColumn:w.getArg(e,"column")},e=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",w.compareByOriginalPositions,w.getArg(e,"bias",f.GREATEST_LOWER_BOUND));if(0<=e){e=this._originalMappings[e];if(e.source===t.source)return{line:w.getArg(e,"generatedLine",null),column:w.getArg(e,"generatedColumn",null),lastColumn:w.getArg(e,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},ft.BasicSourceMapConsumer=p,(Tt.prototype=Object.create(f.prototype)).constructor=f,Tt.prototype._version=3,Object.defineProperty(Tt.prototype,"sources",{get:function(){for(var e=[],t=0;t{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(n,s=21)=>(e=s)=>{let t="",r=e;for(;r--;)t+=n[Math.random()*n.length|0];return t}};let{SourceMapConsumer:Ut,SourceMapGenerator:Ft}=We,{existsSync:zt,readFileSync:$t}=i.default,{dirname:Gt,join:Ht}=n.default;class Vt{constructor(e,t){!1!==t.map&&(this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:"),e=t.map?t.map.prev:void 0,e=this.loadMap(t.from,e),!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Gt(this.mapFile)),e&&(this.text=e))}consumer(){return this.consumerCache||(this.consumerCache=new Ut(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+t)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);var r,n;t&&(r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r),-1"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,i,o;t&&"object"==typeof t?(a=r,r="number"==typeof(l=t).offset?(t=(c=this.fromOffset(l.offset)).line,c.col):(t=l.line,l.column),o="number"==typeof a.offset?(c=this.fromOffset(a.offset),i=c.line,c.col):(i=a.line,a.column)):r||(t=(l=this.fromOffset(t)).line,r=l.col);var a,l,c=this.origin(t,r,i,o);return s=c?new Xt(e,void 0===c.endLine?c.line:{column:c.column,line:c.line},void 0===c.endLine?c.column:{column:c.endColumn,line:c.endLine},c.source,c.file,n.plugin):new Xt(e,void 0===i?t:{column:r,line:t},void 0===i?r:{column:o,line:i},this.css,this.file,n.plugin),s.input={column:r,endColumn:o,endLine:i,line:t,source:this.css},this.file&&(Jt&&(s.input.url=Jt(this.file).toString()),s.input.file=this.file),s}fromOffset(t){let n;if(this[er])n=this[er];else{var s=this.css.split("\n");n=new Array(s.length);let r=0;for(let e=0,t=s.length;e>1),t=n[i+1])){r=i;break}r=i+1}}return{col:t-n[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Kt(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let s=this.map.consumer();t=s.originalPositionFor({column:t,line:e});if(!t.source)return!1;let i;"number"==typeof r&&(i=s.originalPositionFor({column:n,line:r}));let o,a=(o=qt(t.source)?Jt(t.source):new URL(t.source,this.map.consumer().sourceRoot||Jt(this.map.mapFile)),{column:t.column,endColumn:i&&i.column,endLine:i&&i.line,line:t.line,url:o.toString()});if("file:"===o.protocol){if(!Wt)throw new Error("file: protocol is not available in this PostCSS build");a.file=Wt(o)}e=s.sourceContentFor(t.source);return e&&(a.source=e),a}toJSON(){let e={};for(var t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}}Je=nr;nr.default=nr,Yt&&Yt.registerInput&&Yt.registerInput(nr);let{SourceMapConsumer:sr,SourceMapGenerator:ir}=We,{dirname:or,relative:ar,resolve:lr,sep:cr}=n.default,ur=s.default["pathToFileURL"],hr=Je,pr=Boolean(sr&&ir),dr=Boolean(or&&lr&&ar&&cr);ft=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e,t=(e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map","\n");this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(var t of this.previous()){var r=this.toUrl(this.path(t.file)),n=t.root||or(t.file);let e;!1===this.mapOpts.sourcesContent?(e=new sr(t.text),e.sourcesContent&&(e.sourcesContent=null)):e=t.consumer(),this.map.applySourceMap(e,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let t;for(let e=this.root.nodes.length-1;0<=e;e--)t=this.root.nodes[e],"comment"===t.type&&0===t.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(e)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),dr&&pr&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,e=>{t+=e}),[t]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=ir.fromSourceMap(e)}else this.map=new ir({file:this.outputFile()}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):""});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&0",o={generated:{column:0,line:0},original:{column:0,line:0},source:""},a,l;this.stringify(this.root,(e,t,r)=>{this.css+=e,t&&"end"!==r&&(o.generated.line=n,o.generated.column=s-1,t.source&&t.source.start?(o.source=this.sourcePath(t),o.original.line=t.source.start.line,o.original.column=t.source.start.column-1):(o.source=i,o.original.line=1,o.original.column=0),this.map.addMapping(o)),a=e.match(/\n/g),a?(n+=a.length,l=e.lastIndexOf("\n"),s=e.length-l):s+=e.length,t&&"start"!==r&&(e=t.parent||{raws:{}},("decl"===t.type||"atrule"===t.type&&!t.nodes)&&t===e.last&&!e.raws.semicolon||(t.source&&t.source.end?(o.source=this.sourcePath(t),o.original.line=t.source.end.line,o.original.column=t.source.end.column-1,o.generated.line=n,o.generated.column=s-2):(o.source=i,o.original.line=1,o.original.column=0,o.generated.line=n,o.generated.column=s-1),this.map.addMapping(o)))})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;var e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:0e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;var t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?or(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=or(lr(r,this.mapOpts.annotation)));t=ar(r,e);return this.memoizedPaths.set(e,t),t}previous(){var e;return this.previousMaps||(this.previousMaps=[],this.root?this.root.walk(e=>{e.source&&e.source.input.map&&(e=e.source.input.map,this.previousMaps.includes(e)||this.previousMaps.push(e))}):(e=new hr(this.originalCSS,this.opts)).map&&this.previousMaps.push(e.map)),this.previousMaps}setSourcesContent(){let r={};var e;this.root?this.root.walk(e=>{var t;!e.source||(t=e.source.input.from)&&!r[t]&&(r[t]=!0,t=this.usesFileUrls?this.toFileUrl(t):this.toUrl(this.path(t)),this.map.setSourceContent(t,e.source.input.css))}):this.css&&(e=this.opts.from?this.toUrl(this.path(this.opts.from)):"",this.map.setSourceContent(e,this.css))}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){var t=this.memoizedFileURLs.get(e);if(t)return t;if(ur)return t=ur(e).toString(),this.memoizedFileURLs.set(e,t),t;throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){var t=this.memoizedURLs.get(e);if(t)return t;"\\"===cr&&(e=e.replace(/\\/g,"/"));t=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,t),t}};class fr extends Te{constructor(e){super(e),this.type="comment"}}Ct=fr;fr.default=fr;let{isClean:mr,my:gr}=Me,yr=He,vr=Ct,wr,br,_r,Cr;class Sr extends Te{append(...e){for(var t of e){var r;for(r of this.normalize(t,this.last))this.proxyOf.nodes.push(r)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(var t of this.nodes)t.cleanRaws(e)}each(r){if(this.proxyOf.nodes){var n=this.getIterator();let e,t;for(;this.indexes[n]t[n](...e.map(r=>"function"==typeof r?(e,t)=>r(e.toProxy(),t):r)):"every"===n||"some"===n?r=>t[n]((e,...t)=>r(e.toProxy(),...t)):"root"===n?()=>t.root().toProxy():"nodes"===n?t.nodes.map(e=>e.toProxy()):"first"===n||"last"===n?t[n].toProxy():t[n])},set(e,t,r){return e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0}}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){var r,n,s,i=this.index(e),o=this.normalize(t,this.proxyOf.nodes[i]).reverse(),i=this.index(e);for(r of o)this.proxyOf.nodes.splice(i+1,0,r);for(s in this.indexes)i<(n=this.indexes[s])&&(this.indexes[s]=n+o.length);return this.markDirty(),this}insertBefore(e,t){var r,n,s,i=this.index(e),o=this.normalize(t,this.proxyOf.nodes[i],0===i&&"prepend").reverse(),i=this.index(e);for(r of o)this.proxyOf.nodes.splice(i,0,r);for(s in this.indexes)i<=(n=this.indexes[s])&&(this.indexes[s]=n+o.length);return this.markDirty(),this}normalize(e,t){if("string"==typeof e)e=function t(e){return e.map(e=>(e.nodes&&(e.nodes=t(e.nodes)),delete e.source,e))}(wr(e).nodes);else if(void 0===e)e=[];else if(Array.isArray(e))for(var r of e=e.slice(0))r.parent&&r.parent.removeChild(r,"ignore");else if("root"===e.type&&"document"!==this.type)for(var n of e=e.nodes.slice(0))n.parent&&n.parent.removeChild(n,"ignore");else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new yr(e)]}else if(e.selector)e=[new br(e)];else if(e.name)e=[new _r(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new vr(e)]}return e.map(e=>(e[gr]||Sr.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[mr]&&function e(t){if(t[mr]=!1,t.proxyOf.nodes)for(var r of t.proxyOf.nodes)e(r)}(e),void 0===e.raws.before&&t&&void 0!==t.raws.before&&(e.raws.before=t.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}prepend(...e){for(var t of e=e.reverse()){var r,n,s=this.normalize(t,this.first,"prepend").reverse();for(r of s)this.proxyOf.nodes.unshift(r);for(n in this.indexes)this.indexes[n]=this.indexes[n]+s.length}return this.markDirty(),this}push(e){return(e.parent=this).proxyOf.nodes.push(e),this}removeAll(){for(var e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){var t,r;for(r in e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1),this.indexes)e<=(t=this.indexes[r])&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(t,r,n){return n||(n=r,r={}),this.walkDecls(e=>{r.props&&!r.props.includes(e.prop)||r.fast&&!e.value.includes(r.fast)||(e.value=e.value.replace(t,n))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(n){return this.each((t,e)=>{let r;try{r=n(t,e)}catch(e){throw t.addToError(e)}return!1!==r&&t.walk&&(r=t.walk(n)),r})}walkAtRules(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("atrule"===e.type&&r.test(e.name))return n(e,t)}):this.walk((e,t)=>{if("atrule"===e.type&&e.name===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("atrule"===e.type)return n(e,t)}))}walkComments(r){return this.walk((e,t)=>{if("comment"===e.type)return r(e,t)})}walkDecls(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("decl"===e.type&&r.test(e.prop))return n(e,t)}):this.walk((e,t)=>{if("decl"===e.type&&e.prop===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("decl"===e.type)return n(e,t)}))}walkRules(r,n){return n?r instanceof RegExp?this.walk((e,t)=>{if("rule"===e.type&&r.test(e.selector))return n(e,t)}):this.walk((e,t)=>{if("rule"===e.type&&e.selector===r)return n(e,t)}):(n=r,this.walk((e,t)=>{if("rule"===e.type)return n(e,t)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}Sr.registerParse=e=>{wr=e},Sr.registerRule=e=>{br=e},Sr.registerAtRule=e=>{_r=e},Sr.registerRoot=e=>{Cr=e};i=Sr,Sr.default=Sr,Sr.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,_r.prototype):"rule"===e.type?Object.setPrototypeOf(e,br.prototype):"decl"===e.type?Object.setPrototypeOf(e,yr.prototype):"comment"===e.type?Object.setPrototypeOf(e,vr.prototype):"root"===e.type&&Object.setPrototypeOf(e,Cr.prototype),e[gr]=!0,e.nodes&&e.nodes.forEach(e=>{Sr.rebuild(e)})},ot=i;let xr,Ar;class kr extends ot{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){let t=new xr(new Ar,this,e);return t.stringify()}}kr.registerLazyResult=e=>{xr=e},kr.registerProcessor=e=>{Ar=e};e=kr;kr.default=kr;let Er={};function Lr(e){Er[e]||(Er[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))}class Or{constructor(e,t={}){for(var r in this.type="warning",this.text=e,t.node&&t.node.source&&(e=t.node.rangeBy(t),this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column),t)this[r]=t[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}St=Or;Or.default=Or;let Mr=St;class Pr{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);e=new Mr(e,t);return this.messages.push(e),e}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}}Ke=Pr;Pr.default=Pr;let Rr=i;class Tr extends Rr{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}We=Tr;Tr.default=Tr,Rr.registerAtRule(Tr);let Ir=i,Br,Nr;class jr extends Ir{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){e=super.normalize(e);if(t)if("prepend"===r)1{Br=e},jr.registerProcessor=e=>{Nr=e};n=jr;jr.default=jr,Ir.registerRoot(jr);let Dr={comma(e){return Dr.split(e,[","],!0)},space(e){return Dr.split(e,[" ","\n","\t"])},split(e,t,u){let r=[],n="",s=!1,i=0,o=!1,a="",l=!1;for(var c of e)l?l=!1:"\\"===c?l=!0:o?c===a&&(o=!1):'"'===c||"'"===c?(o=!0,a=c):"("===c?i+=1:")"===c?0"space"!==e[0]&&"comment"!==e[0])&&(s.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(s,"value",a.concat(e),t),s.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new Jr;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){var t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1;var r;let n=!1,s=null,i=[];var o=e[1].startsWith("--");let a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)s=s||l,i.push("("===r?")":"]");else if(o&&n&&"{"===r)s=s||l,i.push("}");else if(0===i.length){if(";"===r){if(n)return void this.decl(a,o);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===i[i.length-1]&&(i.pop(),0===i.length&&(s=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),0e+t[1],""),e.raws[t]={raw:o,value:l}),e[t]=l}rule(e){e.pop();let t=new Jr;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){var t;let r="";for(;e.length&&("space"===(t=e[e.length-1][0])||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){var t;let r="";for(;e.length&&("space"===(t=e[0][0])||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t="";for(;e.length&&"space"===e[e.length-1][0];)t=e.pop()[1]+t;return t}stringFrom(t,r){let n="";for(let e=r;evn(e)),e}let wn={};class bn{constructor(e,t,r){this.stringified=!1,this.processed=!1;let n;if("object"!=typeof t||null===t||"root"!==t.type&&"document"!==t.type)if(t instanceof bn||t instanceof ln)n=vn(t.root),t.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=t.map);else{let e=cn;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{n=e(t,r)}catch(e){this.processed=!0,this.error=e}n&&!n[tn]&&sn.rebuild(n)}else n=vn(t);this.result=new ln(e,n,r),this.helpers={...wn,postcss:wn,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){var r=this.result.lastPlugin;try{if(t&&t.addToError(e),"CssSyntaxError"!==(this.error=e).name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){var n=r.postcssPlugin;let e=r.postcssVersion,t=this.result.processor.version;var s=e.split("."),i=t.split(".");(s[0]!==i[0]||parseInt(s[1])>parseInt(i[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+t+", but "+n+" uses "+e+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};var e,t=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(e of this.plugins)if("object"==typeof e)for(var r in e){if(!pn[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${e.postcssPlugin}. `+`Try to update PostCSS (${this.processor.version} now).`);if(!dn[r])if("object"==typeof e[r])for(var n in e[r])"*"===n?t(e,r,e[r][n]):t(e,r+"-"+n.toLowerCase(),e[r][n]);else"function"==typeof e[r]&&t(e,r,e[r])}this.hasListener=0t(e,this.helpers)),await Promise.all(i)):await t(r,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{var e;if("object"==typeof t&&t.Once)return"document"===this.result.root.type?mn((e=this.result.root.nodes.map(e=>t.Once(e,this.helpers)))[0])?Promise.all(e):e:t.Once(this.result.root,this.helpers);if("function"==typeof t)return t(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();var e=this.result.opts;let t=nn,r=(e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify),new rn(t,this.result.root,this.result.opts));e=r.generate();return this.result.css=e[0],this.result.map=e[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(var e of this.plugins)if(mn(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[en];)e[en]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(var t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||an("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(var[r,n]of e){this.result.lastPlugin=r;let e;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(mn(e))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:s}=r;if("root"===n.type||"document"===n.type||n.parent){if(0{e[en]||this.walkSync(e)});else{var r=this.listeners[t];if(r&&this.visitSync(r,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}bn.registerPostcss=e=>{wn=e};Me=bn;bn.default=bn,un.registerLazyResult(bn),on.registerLazyResult(bn);let _n=ft,Cn=Ne,Sn=Lr,xn=Qr;const An=Ke;class kn{constructor(e,t,r){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;var e=Cn;this.result=new An(this._processor,void 0,this._opts),this.result.css=t;let n=this,s=(Object.defineProperty(this.result,"root",{get(){return n.root}}),new _n(e,void 0,this._opts,t));s.isMap()?([r,e]=s.generate(),r&&(this.result.css=r),e&&(this.result.map=e)):(s.clearAnnotation(),this.result.css=s.css)}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||Sn("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=xn;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}}ft=kn;kn.default=kn;let En=ft,Ln=Me,On=e,Mn=n;class Pn{constructor(e=[]){this.version="8.4.35",this.plugins=this.normalize(e)}normalize(e){let t=[];for(var r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return new(this.plugins.length||t.parser||t.stringifier||t.syntax?Ln:En)(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}ft=Pn;Pn.default=Pn,Mn.registerProcessor(Pn),On.registerProcessor(Pn);let Rn=He,Tn=qe,In=Ct,Bn=We,Nn=Je,jn=n,Dn=ot;function Un(e,r){if(Array.isArray(e))return e.map(e=>Un(e));let{inputs:t,...n}=e;if(t){r=[];for(var s of t){let e={...s,__proto__:Nn.prototype};e.map&&(e.map={...e.map,__proto__:Tn.prototype}),r.push(e)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>Un(e,r))),n.source){let{inputId:e,...t}=n.source;n.source=t,null!=e&&(n.source.input=r[e])}if("root"===n.type)return new jn(n);if("decl"===n.type)return new Rn(n);if("rule"===n.type)return new Dn(n);if("comment"===n.type)return new In(n);if("atrule"===n.type)return new Bn(n);throw new Error("Unknown node type: "+e.type)}qe=Un,Un.default=Un;let Fn=He,zn=Me;He=i;let $n=ft;Me=Ne,i=qe;let Gn=e;ft=St;let Hn=Ct,Vn=We;Ne=Ke,qe=Je,e=Qr,St=s;let Wn=ot,Jn=n;Ct=Te;function o(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new $n(e)}o.plugin=function(r,n){let s=!1;function i(...e){console&&console.warn&&!s&&(s=!0,console.warn(r+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(r+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let t=n(...e);return t.postcssPlugin=r,t.postcssVersion=(new $n).version,t}let e;return Object.defineProperty(i,"postcss",{get(){return e=e||i(),e}}),i.process=function(e,t,r){return o([i(r)]).process(e,t)},i},o.stringify=Me,o.parse=e,o.fromJSON=i,o.list=St,o.comment=e=>new Hn(e),o.atRule=e=>new Vn(e),o.decl=e=>new Fn(e),o.rule=e=>new Wn(e),o.root=e=>new Jn(e),o.document=e=>new Gn(e),o.CssSyntaxError=t,o.Declaration=Fn,o.Container=He,o.Processor=$n,o.Document=Gn,o.Comment=Hn,o.Warning=ft,o.AtRule=Vn,o.Result=Ne,o.Input=qe,o.Rule=Wn,o.Root=Jn,o.Node=Ct,zn.registerPostcss(o);o.default=o;class qn extends HTMLElement{base;contents;component;listType="ul";iconSet;filter={value:"",caseSensitive:!1};static get observedAttributes(){return["contents","icon-set","max-depth","filter"]}_jsonToValueArray(e){let t=JSON.stringify(e);t=t.replace(/[\[\]{}\"]/g,"");let r=[];for(const n of t.split(","))r=r.concat(n.split(":"));return[...new Set(r)]}_emit(e,t,r){e=new CustomEvent(e,{detail:r,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}constructor(){super(),this.base=new $,this.setContents(this.getAttribute("contents")),this.iconSet=this.getAttribute("icon-set")?this.getAttribute("icon-type"):"file",this.maxDepth=this.getAttribute("max-depth")?parseInt(this.getAttribute("max-depth")):-1,this.setFilter(this.getAttribute("filter")),this.style.display="block",this.style.maxWidth="fit-content",this.style.margin="0 1rem 0 0",this.base.addEvent(".flk-branch","click",this.emitNodeToggle)}emitNodeToggle(e){e.stopPropagation();const t=F(e,"flk-tree-nav").target,r=z(e,"branchKey");let n=t.contents;const s=r.split(".");for(const o of s)if(n[o])n=n[o];else if(null===n[o])n=null;else{let e=[];for(const a of n)a[o]&&e.push(a[o]);n=e}var e=r.substring(r.indexOf(".")+1),i=t.createLeafText(s.reverse()[0]);t._emit("tree-click",t,{path:e,data:n,key:(i.titleText+" "+i.commentText).trim(),branch:"object"==typeof n})}convertJsonKeyToTitle(e){if(!e)return"";const t=(e="string"!=typeof e?e.toString():e).replace(/([A-Z_])/g,e=>"_"===e?" ":" "+e).trim();return t.charAt(0).toUpperCase()+t.slice(1)}setContents(e){var t=e||this.contents||[];try{switch(typeof t){case"string":this.contents=JSON.parse(t);break;case"object":Array.isArray(t)?this.contents=t:this.contents=[t]}}catch(e){console.log(e)}}applyFilter(e){let t;var r="details"===e.tagName.toLowerCase();t=this.filter.caseSensitive?e.dataset.branchValues.includes(this.filter.value):e.dataset.branchValues.toLowerCase().includes(this.filter.value.toLowerCase()),t?e.parentElement.classList.remove("hidden"):e.parentElement.classList.add("hidden"),r&&t?e.setAttribute("open",""):e.removeAttribute("open")}resetTree(e){e.parentElement.classList.remove("hidden"),e.removeAttribute("open")}filterTree(){let t=setTimeout(()=>{for(const e of this.querySelectorAll("[data-branch-values]"))void 0===this.filter.value||0===this.filter.value.length?this.resetTree(e):this.applyFilter(e);clearTimeout(t)},10)}setFilter(e){const t=e||{};try{switch(typeof t){case"string":t.includes("{")?(this.filter=JSON.parse(t),!1===this.filter.caseSensitive&&(this.filter.value=this.filter.value.toLowerCase())):this.filter.value=e.toLowerCase();break;case"object":this.filter=t}}catch(e){console.log(e)}this.filterTree()}createLeafText(e){var t,r;let n="",s="";return"string"==typeof e&&(e.includes("(")||e.includes("["))?(r=e.indexOf("("),r=-1===(t=e.indexOf("["))?r:t,n=this.convertJsonKeyToTitle(e.substring(0,r)),s=e.substring(r)):n=this.convertJsonKeyToTitle(e),{titleText:n,commentText:s}}createTextTag(n,s){n=this.createLeafText(n);if(n.commentText){let e=document.createElement("div"),t=document.createElement("span"),r=(t.innerText=n.titleText,document.createElement("small"));r.innerText=n.commentText,r.style.marginLeft="1rem",e.append(t,r),e.style.display="inline-flex",e.style.alignItems="center",s.append(e)}else s.innerText=n.titleText}createLeaf(e,t,r,n=[]){let s=document.createElement("li");s.classList.add("cursor-no-select"),s.style.marginTop="0.4rem",s.dataset.branchKey=r;const i="file"===this.iconSet?'':'';s.style.listStyleImage=`url('data:image/svg+xml,${i}')`,s.style.position="relative",s.style.left="2px";let o=document.createElement("span");r=[e].concat(n);if(o.dataset.branchValues=[...new Set(r)].join(),n.length&&(o.dataset.leafKey=r[0]),this.createTextTag(e,o),o.style.position="relative",o.style.top="-3px",s.append(o),t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);const i="file"===this.iconSet?G:H;e.style.listStyleImage=`url('data:image/svg+xml,${i}')`,e.append(s),t.append(e)}else t.append(s)}createBranch(r,t,n,s){if(s===this.maxDepth&&"object"==typeof r)for(const o of Array.isArray(r)?r:Object.keys(r)){let e;r[o]&&(e=this._jsonToValueArray(r[o])),this.createLeaf(o,t,n+"."+o,e)}else if(Array.isArray(r))for(var e in r){var u=document.createElement(this.listType);t.append(this.createBranch(r[e],u,n+"."+e,s+1))}else if(null!==r&&"object"==typeof r){const a=[];for(const l of Object.keys(r)){let e=document.createElement("li"),t=(e.classList.add("cursor-no-select"),e.style.position="relative",e.style.left="2px",e.dataset.branchKey=n+"."+l,document.createElement("details"));t.classList.add("flk-branch"),t.dataset.branchValues=[l].concat(this._jsonToValueArray(r[l])),t.style.position="relative",t.style.top="-3px",t.classList.add("cursor-default");var i=document.createElement("summary");this.createTextTag(l,i),t.append(i),e.append(this.createBranch(r[l],t,n+"."+l,s+1)),a.push(e)}if(t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);var h="file"===this.iconSet?G:H;e.style.listStyleImage=`url('data:image/svg+xml,${h}')`;for(const c of a)e.append(c);t.append(e)}else for(const p of a)t.append(p)}else this.createLeaf(r,t,n);return t}createHtml(){let e=document.createElement(this.listType);var t="file"===this.iconSet?G:'';if(e.style.listStyleImage=`url('data:image/svg+xml,${t}')`,e.style.marginLeft="3rem",this.contents.length){for(const r in this.contents)e=this.createBranch(this.contents[r],e,r,0);this.component=e}else this.component=e}attributeChangedCallback(e,t,r){switch(e){case"contents":this.setContents(r);break;case"icon-set":this.iconSet=r;break;case"max-depth":this.maxDepth="string"==typeof r?parseInt(r):r;break;case"filter":this.setFilter(r)}this.init()}connectedCallback(){this.init()}disconnectedCallback(){this.base.removeEvents(this)}init(){this.createHtml(),this.base.render(this)}}customElements.define("flk-table",W),customElements.define("flk-draggable",J),customElements.define("flk-modal",q),customElements.define("flk-dropdown",K),customElements.define("flk-tree-nav",qn)}(require$$0,require$$2,require$$1$1,require$$1); \ No newline at end of file +!function(){"use strict";var a,c,g,e;(e=a=a||{}).Date="date",e.String="string",e.Float="float",e.Number="number",e.Array="array",e.Object="object",e.Bool="bool",e.Currency="currency",e.Undefined="undefined",e.Null="null";const l={date:/^(\d{1,4}-\d{1,4}-\d{1,4}(T)?)/gim,currency:/^[$|€]\s?[0-9]*(\.|,)?\d*(\.|,)?\d*/gim,float:/\d+[,|.]\d+[,|.]?\d*/gim,currencySign:/\$|€/gim,array:/^\s?[[].[^,]+[\]],?/gi,precision:/[-+$€,.]/gm,string:/[a-zA-Z]/gim},h=e=>{return null===e||"null"===e?a.Null:e||0===e||!1===e?null===new RegExp(l.date).exec(e)||isNaN(Date.parse(e))?new RegExp(l.currency).exec(e)?a.Currency:!new RegExp(l.string).exec(e)&&new RegExp(l.float).exec(e.toString())?a.Float:isNaN(e)&&0!==e?Array.isArray(e)?a.Array:"object"==typeof e?a.Object:a.String:a.Number:a.Date:a.Undefined},u=(t,e)=>{const s={value:void 0,type:e=e||h(t),currencySign:""};switch(s.type){case a.String:s.value=t.toString();break;case a.Float:case a.Currency:var r=(t=t.toString()).match(new RegExp(/(,)/gim)),n=t.match(new RegExp(/(\.)/gim));if(r)for(let e=1;e<=r.length;e++)t=e!==r.length||n?t.replace(",",""):t.replace(",",".");if(s.type===a.Currency){const o=new RegExp(l.currencySign);var i=o.exec(t);s.currencySign=null!==i?i[0]:"",t=t.replace(o,"")}s.value=parseFloat(t).toPrecision(12);break;case a.Number:s.value=Number(t);break;case a.Date:s.value=Date.parse(t);break;case a.Array:t.length?"object"==typeof t[0]?s.value=t.map(e=>JSON.stringify(e)).join(", "):s.value=t.join(", "):s.value="";break;case a.Object:s.value=t;break;case a.Undefined:s.value="";break;case a.Null:s.value=null}return s};function v(e,t){var s;let r;for(s of e.split("."))s=s.trim(),r?"object"!=typeof r||Array.isArray(r)||(r=r[s]):r=t[s];return r}const m=(e,t)=>tet<=e,w=(e,t)=>e<=t,k=(e,t,s)=>s?e.toLowerCase()==t.toLowerCase():e==t,E=(e,t)=>e===t,_=(e,t)=>e!=t,x=(e,t)=>e!==t,A=(e,t)=>null!=t&&"string"==typeof e&&0<=e.toLowerCase().indexOf(t.toString().toLowerCase()),L=(e,t)=>null!=t&&0<=e.toString().toLowerCase().indexOf(t.toString().toLowerCase()),T=(e,t)=>null!=t&&"string"==typeof e&&e.toLowerCase().indexOf(t.toString().toLowerCase())<0;function t(s,r){if(0===r.length)return s;{var n=s;const o=[],a=[];let e=[];for(const l of r)l.type&&l.type!==c.And?(e.length&&a.push(e),e=[l]):e.push(l);a.push(e);let t=[];for(const e of a)t=t.concat(C(n,e));t=[...new Set(t)];var i=n.length;for(let e=0;e":return m;case"<":return f;case">=":return b;case"<=":return w;case"is":case"==":return k;case"!is":case"!=":return _;case"===":return E;case"!==":return x;case"like":case"~":case"contains":return A;case"!contains":case"!like":case"!~":return T;default:return L}}(a.operator);if(!l(i,o,a.ignoreCase)){e=!1;break}}e&&s.push(r)}return s};function s(e,t){if(!t||0===t.length)return e;if(1{if(0===s.length)s=s.concat(o(n,e));else{for(const t of s)r=r.concat(o(t,e));s=r,r=[]}}),s}return o(e,t[0])}function o(e,t){const s=[],r=[];do{if(!e||0===e.length)break;var n=e.shift();if(!n)break;const o=n[t];var i=r.indexOf(o.toString());0<=i?s[i].push(n):(r.push(o.toString()),void 0!==s[r.length-1]?s[r.length-1].push(n):s.push([n]))}while(0{if(t){var s=e;const r={};for(const n of t){let e=s.map(e=>e[n].toString());const i=e.map(e=>h(e));i.some(e=>e===a.Float)?(e=e.map(e=>parseFloat(e)),r[n]=parseFloat(e.reduce((e,t)=>e+t).toFixed(2))):(e=e.map(e=>parseInt(e)),r[n]=e.reduce((e,t)=>e+t))}return r}return{}};class S{model;sortDetails=[];filterDetails=[];selection=[];groupByProperties=[];distinctProperties=[];concatenationToken=", ";constructor(e){this.model=JSON.parse(JSON.stringify(e))}sort(e){return this.sortDetails=e,this}orderBy(e,t){return this.sortDetails.push({propertyName:e,direction:t}),this}thenOrderBy(e,t){return this.orderBy(e,t)}filter(e){return Array.isArray(e)?this.filterDetails=e:this.filterDetails.push(e),this}where(e,t,s,r,n){return this.filterDetails.push({propertyName:e,operator:t,value:s,type:r,ignoreCase:n}),this}andWhere(e,t,s,r){return this.where(e,t,s,c.And,r),this}orWhere(e,t,s,r){return this.where(e,t,s,c.Or,r),this}group(e){return this.groupByProperties=e,this}groupBy(e){return this.groupByProperties.push(e),this}thenGroupBy(e){return this.groupByProperties.push(e),this}select(e){return Array.isArray(e)?this.selection=e:"*"!==e&&(this.selection=[e]),this}distinct(e,t){return t&&(this.concatenationToken=t),Array.isArray(e)?this.distinctProperties=e:e&&(this.distinctProperties=[e]),this}execute(){return s(function(t,s){if(0===s.length)return t;{var r=s;let e=[];for(const n of t){const i={};for(const o of r)i[o]=n[o];e.push(i)}return e}}(function(s,r,d){if(!r||!r.length)return s;const n=[],h=[];for(const m of s){const o={};let t="";for(const e of r){var u=v(e,m);o[e]=u,t+=u}if(!h.includes(t)){let e=s;for(const a of Object.keys(o))e=e.filter(e=>e[a]===o[a]);h.push(t),n.push(e)}}const t=[];for(const f of n){let e={};for(const l of f){var i,p=Object.keys(e);if(p.length)for(const c of p)r.includes(c)||(i=e[c],Array.isArray(i)?(i=l[c],Array.isArray(i)?e[c]=[...new Set(...e[c].concat(l[c]))]:e[c].includes(l[c])||e[c].push(l[c])):isNaN(e[c])&&isNaN(l[c])?e[c]!==l[c]&&(e[c]=[e[c],l[c]]):e[c]=e[c]+l[c]);else e=l}t.push(e)}return t.forEach(e=>{for(const t in e)Array.isArray(e[t])&&(e[t]=e[t].join(d))}),t}(r(t(JSON.parse(JSON.stringify(this.model)),this.filterDetails),this.sortDetails),this.distinctProperties,this.concatenationToken),this.selection),this.groupByProperties)}sum(e,t){e=Array.isArray(e)?e:[e];return i(t||this.model,e)}}function I(e,t){t=t?t.toUpperCase():"FLK-";return e.toUpperCase().includes(t)}function d(e,t){var{timeStamp:s,type:r,x:n,y:i}=e;let o=e.target;do{if(!o||"HTML"===o.tagName||I(o.tagName,t)){"HTML"===o.tagName&&(o=null);break}}while(o=o.parentNode||o.parentElement,!I(o.tagName,t));return{target:o,timeStamp:s,type:r,x:n,y:i}}function B(e,t){let s=e.target,r="";for(;s.dataset[t]?r=s.dataset[t]:s=s.parentNode,!r;);return r}class n{constructor(){}_topLevelClasses=[];_events=[];generateId(){return"flk-"+function e(){const t=([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)),s=t.split("-")[0];return window.$flightkitUUIDStore||(window.$flightkitUUIDStore=[]),window.$flightkitUUIDStore.some(e=>e===s)?e():(window.$flightkitUUIDStore.push(s),s)}()}render(t){if(!t.component)throw new Error("Component is not assigned! Can't render");t.id=t.id||this.generateId();var e=this._getAllEventAttributes(t);if(e){var s="#"+t.id;for(const i of e){var r="e-"+i;this.addEvent(s,i,t.getAttribute(r))}}var n=Object.keys(t.classList).length;if(n){for(let e=0;e{this._assignToDom(t,t.component),clearTimeout(this._renderTimer)},10)}addEvent(e,t,s){this._events.push({selector:e,eventType:t,callback:s})}_getExternalCallback(e){let t=void 0;for(const s of e.split("."))t=(t||window)[s];return t}_getAllEventAttributes(e){e=e.attributes;const t=Array.from(e).filter(e=>e.name.startsWith("e-"));return t.map(e=>e.name.slice(2))}_isFlightkitElement(e){return e.toUpperCase().includes("FLK-")}_outerEventHandler(e){const t=d(e),s=(t.contents=e.detail,t.target.getAttribute("e-"+t.type));let r=void 0;for(const n of s.split("."))r=(r||window)[n];return e.preventDefault(),e.stopPropagation(),r(t)}_addEvents(e){if(e.isConnected)for(const s of this._events)if(s.selector.startsWith("."))for(const r of document.querySelectorAll(s.selector))this._addEventToElement(s,r);else{var t=document.querySelector(s.selector);this._addEventToElement(s,t)}}_addEventToElement(e,t){t&&("function"==typeof e.callback?(t.removeEventListener(e.eventType,e.callback),t.addEventListener(e.eventType,e.callback)):(t.removeEventListener(e.eventType,this._outerEventHandler),t.addEventListener(e.eventType,this._outerEventHandler)))}removeEvents(){for(const t of this._events)if(t.selector.startsWith("."))for(const s of document.querySelectorAll(t.selector))this._addEventToElement(t,s);else{var e=document.querySelector(t.selector);this._addEventToElement(t,e)}this._events=[]}_removeEventToElement(e,t){t&&("function"==typeof e.callback?t.removeEventListener(e.eventType,e.callback):t.removeEventListener(e.eventType,this._outerEventHandler))}_assignToDom(e,t){e.innerHTML="";for(const r of Array.isArray(t)?t:[t])e.append(r);const s=setTimeout(()=>{this._addEvents(e),clearTimeout(s)},10)}}const p='',N='';function D(e){const t=new DOMParser;return t.parseFromString(e,"image/svg+xml").documentElement}class O extends HTMLElement{base;component=null;_contents=[];_orderBy=[];properties=new Set;_columnOrder=[];_filter="";_selectionProperty="";_selectedIds=new Set;uniqueEntriesByProperties={};propertyLabelDictionary={};_templates={};_templateClasses={};static get observedAttributes(){return["contents","columns","order","filter","selection-property","templates"]}get columnOrder(){return this._columnOrder.length?this._columnOrder:this.properties}set columnOrder(e){let t;"string"==typeof e&&(t=e.split(",")),t=e,this._columnOrder=t}get contents(){return this._contents}set contents(e){this.analyzeData(e),this._contents=new S(e)}get orderBy(){return this._orderBy}set orderBy(e){if(Array.isArray(e))this._orderBy=e;else{const r=[];for(const n of e.split(",")){var t=n.split("|"),s=t[0],t=1e[s._selectionProperty])):new Set;e=t?s.contents.execute():[];s._emit("select",s,{selection:e}),s._updateCheckboxes(s)}emitSelect(e){var t=e.target.checked,s=e.target.dataset.objectId;const r=d(e).target,n=(t?r._selectedIds.add(s):r._selectedIds.delete(s),r._selectionProperty);e=r.contents.execute().filter(e=>r._selectedIds.has(e[n]));r._emit("select",r,{selection:e}),r._updateCheckboxes(r)}sortData(e){const t=d(e).target,s=B(e,"column");s&&(-1<(e=t._orderBy.findIndex(e=>e.propertyName===s))?"asc"===t._orderBy[e].direction?t._orderBy[e].direction="desc":t._orderBy.splice(e,1):t._orderBy.push({propertyName:s,direction:"asc"}),t.createHtml(),t.base.render(t))}setColumnOrder(e){this._columnOrder=e?Array.isArray(e)?e:e.split(","):[]}analyzeData(t){this.properties=new Set;var s=t.length;for(let e=0;e"_"===e?" ":" "+e.toLowerCase()).trim();var s=t.charAt(0).toUpperCase()+t.slice(1);return this.propertyLabelDictionary[e]=s}parseTemplate(e,r){return e.replace(/\{\{([\s\S]+?)\}\}/gim,(e,t)=>{let s="";t=t.trim();t=r[t];return t&&(s=t),Array.isArray(s)?s.join(", "):s.toString().trim()})}createSelectionCheckbox(e){const t=document.createElement("input");return t.setAttribute("type","checkbox"),t.classList.add("flk-selection-checkbox"),e&&(t.dataset.selected=e[this._selectionProperty]),t}createRow(e){const t=document.createElement("tr");if(this._selectionProperty.length){const n=document.createElement("td");var s=this.base.generateId();const i=this.createSelectionCheckbox(e);i.id=s,i.dataset.objectId=e[this._selectionProperty];var r=e[this._selectionProperty];this._selectedIds.has(r)?i.checked=!0:i.checked=!1,this.base.addEvent("#"+s,"change",this.emitSelect),n.append(i),t.append(n)}for(const o of this.columnOrder){const a=document.createElement("td");this._templates[o]?(a.innerHTML=this.parseTemplate(this._templates[o],e),this._templateClasses[o]&&a.classList.add(...this._templateClasses[o])):a.innerText=e[o],t.append(a)}return t}createBody(e){const t=document.createElement("tbody");for(const r of e){var s=this.createRow(r,null);t.append(s)}return t}createHead(){const e=document.createElement("thead"),t=document.createElement("tr");if(t.classList.add("cursor-pointer"),this._selectionProperty.length){const n=document.createElement("th");var s=this.base.generateId();const i=this.createSelectionCheckbox();i.id=s;var d=this.contents.execute().length;0e.propertyName===o);if(r){const c=document.createElement("span");c.innerHTML="asc"===r.direction?'':'',a.append(c)}t.append(a)}return e.append(t),e}addEvent(e,t,s){this.base.addEvent(e,t,s)}init(){this.createHtml(),this.base.render(this)}}class j extends HTMLElement{base;componentId;constructor(){super(),this.base=new n}connectedCallback(){var e=this.getAttribute("top"),t=this.getAttribute("left"),s=this.getAttribute("center"),r=this.getAttribute("zIndex");this.id||(this.id=this.base.generateId()),this.style.display="block",this.style.position="fixed","string"==typeof s?(this.style.top=e||"50%",this.style.left="50%",this.style.transform="translate(-50%, -50%)"):(this.style.top=e||this.clientTop+"px",this.style.left=t||this.clientLeft+"px"),r&&(this.style.zIndex=r),this.componentId=this.getAttribute("handle");const n=document.createElement("div");n.innerHTML=this.innerHTML,this.component=n;s="#"+(this.componentId||this.id);this.base.addEvent(s,"mousedown",this._dragElement),this.base.addEvent(s,"mouseup",this._reset),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this)}_dragElement(e){const s=d(e,"flk-draggable").target;let r,n;function t(e){r=e.clientX-s.offsetLeft,n=e.clientY-s.offsetTop}function i(e){var t=e.clientX-r,e=e.clientY-n;s.style.left=t+"px",s.style.top=e+"px"}function o(e){e.preventDefault()}function a(){s.removeAttribute("draggable"),s.removeEventListener("dragstart",t),s.removeEventListener("dragend",a),document.removeEventListener("dragover",o),document.removeEventListener("drop",i)}s.setAttribute("draggable",!0),s.addEventListener("dragstart",t),s.addEventListener("dragend",a),document.addEventListener("dragover",o),document.addEventListener("drop",i)}}class M extends HTMLElement{_id;base;_draggableId;constructor(){super(),this.base=new n}_emit(e,t,s){e=new CustomEvent(e,{detail:s,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}_closeModal(e){e.stopPropagation();const t=d(e,"flk-modal").target;t.classList.add("hidden")}closeModal(e){this.classList.add("hidden")}openModal(e=!0){const t=document.getElementById(this._draggableId);e&&(t.style.top="40%",t.style.left="50%"),this.classList.remove("hidden")}connectedCallback(){this.id||(this.id=this.base.generateId());const e=document.createElement("div");var t=this.base.generateId();const s=document.createElement("flk-draggable"),r=(this._draggableId=this.base.generateId(),s.id=this._draggableId,s.setAttribute("center",""),s.setAttribute("top","40%"),s.setAttribute("handle",t),s.setAttribute("zIndex","1080"),s.classList.add("border","shadow-lg","bg-white"),s.style.width="max-content",document.createElement("div"));var n=this.getAttribute("modal-title");if(n){const c=document.createElement("span");c.innerText=n,c.classList.add("ml-1","mr-auto"),r.append(c)}r.id=t;const i=this.getAttribute("header-class");let o=[];i?o=o.concat(i.split(" ")):o.push("bg-gray-light"),r.classList.add(...o,"border-bottom","row","justify-end","cursor-no-select");n=this.base.generateId();const a=document.createElement("button"),l=(a.classList.add("py-0","px-1","outline-hover","no-border","cursor-default",...o),a.innerText="X",a.id=n,r.append(a),s.append(r),document.createElement("div"));l.innerHTML=this.innerHTML,s.append(l),e.append(s),this.component=e,this.base.addEvent("#"+n,"click",this._closeModal),this.base.render(this),this.classList.add("hidden")}disconnectedCallback(){this.base.removeEvents(this)}}class H extends HTMLElement{base;_buttonId;_drawerId;_iconId;constructor(){super(),this.base=new n}connectedCallback(){this.style.position="relative",this.style.display="flex",this.style.width="fit-content",this._buttonId=this.base.generateId();const e=document.createElement("button"),t=(e.classList.add("row"),e.id=this._buttonId,document.createElement("span")),s=(t.innerText=this.getAttribute("text"),this._iconId=this.base.generateId(),document.createElement("span"));var r=D('');const n=D(''),i=(n.classList.add("hidden"),s.append(r,n),s.id=this._iconId,e.append(t,s),this._drawerId=this.base.generateId(),document.createElement("div"));i.id=this._drawerId,i.classList.add("shadow","inline-block","bg-white"),i.style.position="absolute",i.style.zIndex="1040";r=this.querySelector("template");r.innerHTML.length?i.innerHTML=r.innerHTML:i.append(r.firstChild),i.style.display="none",this.component=[e,i],this.base.addEvent("#"+this._buttonId,"click",this.toggleMenu);const o=document.querySelector("body");""!==o.getAttribute("flk-close-dropdown")&&(o.setAttribute("flk-close-dropdown",""),o.addEventListener("click",this.closeAllDropdownButtons)),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this);var e=document.querySelectorAll("flk-dropdown");if(!e||!e.length){const t=document.querySelector("body");t.removeAttribute("flk-close-dropdown"),t.removeEventListener("click",this.closeAllDropdownButtons)}}toggleMenu(e){const t=d(e).target;e=t._drawerId;const s=document.getElementById(e);var e="none"!==s.style.display,r=(s.style.display=e?"none":"block",t.getAttribute("drawer-width")),r=("string"==typeof t.getAttribute("right")&&(s.style.right="0px"),s.style.top=t.offsetHeight+"px",s.style.width=r||t.offsetWidth+"px",t._iconId);const n=document.getElementById(r);e?(n.childNodes[0].classList.remove("hidden"),n.childNodes[1].classList.add("hidden")):(n.childNodes[0].classList.add("hidden"),n.childNodes[1].classList.remove("hidden"))}_closeDropdown(){var e=this._drawerId;const t=document.getElementById(e);if("none"!==t.style.display){e=this._iconId;const s=document.getElementById(e);t.style.display="none",s.childNodes[0].classList.remove("hidden"),s.childNodes[1].classList.add("hidden")}}closeAllDropdownButtons(e){var t,s=d(e,"flk-dropdown").target,e=document.querySelectorAll("flk-dropdown");if(s)for(const r of e)s._buttonId!==r._buttonId&&(t=r._drawerId,"none"!==document.getElementById(t).style.display&&r._closeDropdown());else for(const n of e)n._closeDropdown()}}class P extends HTMLElement{base;contents;component;listType="ul";iconSet;filter={value:"",caseSensitive:!1};static get observedAttributes(){return["contents","icon-set","max-depth","filter"]}_jsonToValueArray(e){let t=JSON.stringify(e);t=t.replace(/[\[\]{}\"]/g,"");let s=[];for(const r of t.split(","))s=s.concat(r.split(":"));return[...new Set(s)]}_emit(e,t,s){e=new CustomEvent(e,{detail:s,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}constructor(){super(),this.base=new n,this.setContents(this.getAttribute("contents")),this.iconSet=this.getAttribute("icon-set")?this.getAttribute("icon-type"):"file",this.maxDepth=this.getAttribute("max-depth")?parseInt(this.getAttribute("max-depth")):-1,this.setFilter(this.getAttribute("filter")),this.style.display="block",this.style.maxWidth="fit-content",this.style.margin="0 1rem 0 0",this.base.addEvent(".flk-branch","click",this.emitNodeToggle)}emitNodeToggle(e){e.stopPropagation();const t=d(e,"flk-tree-nav").target,s=B(e,"branchKey");let r=t.contents;const n=s.split(".");for(const o of n)if(r[o])r=r[o];else if(null===r[o])r=null;else{let e=[];for(const a of r)a[o]&&e.push(a[o]);r=e}var e=s.substring(s.indexOf(".")+1),i=t.createLeafText(n.reverse()[0]);t._emit("tree-click",t,{path:e,data:r,key:(i.titleText+" "+i.commentText).trim(),branch:"object"==typeof r})}convertJsonKeyToTitle(e){if(!e)return"";const t=(e="string"!=typeof e?e.toString():e).replace(/([A-Z_])/g,e=>"_"===e?" ":" "+e).trim();return t.charAt(0).toUpperCase()+t.slice(1)}setContents(e){var t=e||this.contents||[];try{switch(typeof t){case"string":this.contents=JSON.parse(t);break;case"object":Array.isArray(t)?this.contents=t:this.contents=[t]}}catch(e){console.log(e)}}applyFilter(e){let t;var s="details"===e.tagName.toLowerCase();t=this.filter.caseSensitive?e.dataset.branchValues.includes(this.filter.value):e.dataset.branchValues.toLowerCase().includes(this.filter.value.toLowerCase()),t?e.parentElement.classList.remove("hidden"):e.parentElement.classList.add("hidden"),s&&t?e.setAttribute("open",""):e.removeAttribute("open")}resetTree(e){e.parentElement.classList.remove("hidden"),e.removeAttribute("open")}filterTree(){let t=setTimeout(()=>{for(const e of this.querySelectorAll("[data-branch-values]"))void 0===this.filter.value||0===this.filter.value.length?this.resetTree(e):this.applyFilter(e);clearTimeout(t)},10)}setFilter(e){const t=e||{};try{switch(typeof t){case"string":t.includes("{")?(this.filter=JSON.parse(t),!1===this.filter.caseSensitive&&(this.filter.value=this.filter.value.toLowerCase())):this.filter.value=e.toLowerCase();break;case"object":this.filter=t}}catch(e){console.log(e)}this.filterTree()}createLeafText(e){var t,s;let r="",n="";return"string"==typeof e&&(e.includes("(")||e.includes("["))?(s=e.indexOf("("),s=-1===(t=e.indexOf("["))?s:t,r=this.convertJsonKeyToTitle(e.substring(0,s)),n=e.substring(s)):r=this.convertJsonKeyToTitle(e),{titleText:r,commentText:n}}createTextTag(r,n){r=this.createLeafText(r);if(r.commentText){let e=document.createElement("div"),t=document.createElement("span"),s=(t.innerText=r.titleText,document.createElement("small"));s.innerText=r.commentText,s.style.marginLeft="1rem",e.append(t,s),e.style.display="inline-flex",e.style.alignItems="center",n.append(e)}else n.innerText=r.titleText}createLeaf(e,t,s,r=[]){let n=document.createElement("li");n.classList.add("cursor-no-select"),n.style.marginTop="0.4rem",n.dataset.branchKey=s;const i="file"===this.iconSet?'':'';n.style.listStyleImage=`url('data:image/svg+xml,${i}')`,n.style.position="relative",n.style.left="2px";let o=document.createElement("span");s=[e].concat(r);if(o.dataset.branchValues=[...new Set(s)].join(),r.length&&(o.dataset.leafKey=s[0]),this.createTextTag(e,o),o.style.position="relative",o.style.top="-3px",n.append(o),t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);const i="file"===this.iconSet?p:N;e.style.listStyleImage=`url('data:image/svg+xml,${i}')`,e.append(n),t.append(e)}else t.append(n)}createBranch(s,t,r,n){if(n===this.maxDepth&&"object"==typeof s)for(const o of Array.isArray(s)?s:Object.keys(s)){let e;s[o]&&(e=this._jsonToValueArray(s[o])),this.createLeaf(o,t,r+"."+o,e)}else if(Array.isArray(s))for(var e in s){var d=document.createElement(this.listType);t.append(this.createBranch(s[e],d,r+"."+e,n+1))}else if(null!==s&&"object"==typeof s){const a=[];for(const l of Object.keys(s)){let e=document.createElement("li"),t=(e.classList.add("cursor-no-select"),e.style.position="relative",e.style.left="2px",e.dataset.branchKey=r+"."+l,document.createElement("details"));t.classList.add("flk-branch"),t.dataset.branchValues=[l].concat(this._jsonToValueArray(s[l])),t.style.position="relative",t.style.top="-3px",t.classList.add("cursor-default");var i=document.createElement("summary");this.createTextTag(l,i),t.append(i),e.append(this.createBranch(s[l],t,r+"."+l,n+1)),a.push(e)}if(t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);var h="file"===this.iconSet?p:N;e.style.listStyleImage=`url('data:image/svg+xml,${h}')`;for(const c of a)e.append(c);t.append(e)}else for(const u of a)t.append(u)}else this.createLeaf(s,t,r);return t}createHtml(){let e=document.createElement(this.listType);var t="file"===this.iconSet?p:'';if(e.style.listStyleImage=`url('data:image/svg+xml,${t}')`,e.style.marginLeft="3rem",this.contents.length){for(const s in this.contents)e=this.createBranch(this.contents[s],e,s,0);this.component=e}else this.component=e}attributeChangedCallback(e,t,s){switch(e){case"contents":this.setContents(s);break;case"icon-set":this.iconSet=s;break;case"max-depth":this.maxDepth="string"==typeof s?parseInt(s):s;break;case"filter":this.setFilter(s)}this.init()}connectedCallback(){this.init()}disconnectedCallback(){this.base.removeEvents(this)}init(){this.createHtml(),this.base.render(this)}}customElements.define("flk-table",O),customElements.define("flk-draggable",j),customElements.define("flk-modal",M),customElements.define("flk-dropdown",H),customElements.define("flk-tree-nav",P)}(); \ No newline at end of file diff --git a/flightkit/components/tree-navigation.js b/flightkit/components/tree-navigation.js index 521855b..60d5f70 100644 --- a/flightkit/components/tree-navigation.js +++ b/flightkit/components/tree-navigation.js @@ -1,7 +1,6 @@ import { folderListIcon, fileListIcon, databaseListIcon, tableListIcon, columnListIcon } from '../htmlbuilder/icons'; import { returnDataSetValue, returnEventWithTopLevelElement } from '../htmlbuilder/domTraversal'; import { BaseComponent } from './extensions/base_component'; -import { comment } from 'postcss'; export class FlightkitTreeNavigation extends HTMLElement { base;