UNPKG

ngx-angora-css

Version:

Angora CSS is a library that provides a set of CSS classes to help you build modern web applications. It is based on the [Boostrap Expanded Features Library](https://github.com/LynxPardelle/bootstrap-expanded-features) and the [Bootstrap](https://getboots

3,215 lines 116 kB
import * as i0 from '@angular/core';
import { Injectable, Directive } from '@angular/core';

const allColors = {
    /* colorsDefault */
    primary: '#0d6efd',
    secondary: '#6c757d',
    success: '#198754',
    info: '#0dcaf0',
    warning: '#ffc107',
    danger: '#dc3545',
    light: '#f8f9fa',
    dark: '#212529',
    /* colorsBS */
    indigoBS: '#6610f2',
    purpleBS: '#6f42c1',
    pinkBS: '#d63384',
    orangeBS: '#fd7e14',
    tealBS: '#20c997',
    white: '#fff',
    grayBS: '#6c757d',
    /* colorsLP */
    mystic: '#210020',
    lavenderLP: '#D6BCFF',
    fairy: '#D680FF',
    summer: '#FF9A2E',
    old: '#EEEDA0',
    friend: '#3BBBB2',
    tree: '#5A311D',
    blood: '#8A0707',
    beast: '#F5785D',
    abyss: '#000',
    /* Angora Colors */
    ankcent: '#D01033', // Primary
    secora: '#2D2824', // Secondary
    succank: '#5D4339', // Success
    bangrank: '#161B17', // Info
    secbank: '#F0B566', // Warning
    dank: '#000000', // Danger When combined to ankcent, it will be dark red
    dankcent: 'linear-gradient(220deg, #D01033 35%,#000000 55%)',
    revdankcent: 'linear-gradient(220deg, #000 35%,#D01033 55%)',
    ligthora: '#F4EBEC', // Light
    dagora: '#100809', // Dark
    /* basicColorsCSS */ /* (\s)(#[0-9A-Fa-f]+)\s([0-9]*,?)*\n*\s*\n*\s* */ /* :$1'$2', */
    black: '#000000',
    silver: '#C0C0C0',
    gray: '#808080',
    maroon: '#800000',
    red: '#FF0000',
    purple: '#800080',
    fuchsia: '#FF00FF',
    green: '#008000',
    lime: '#00FF00',
    olive: '#808000',
    yellow: '#FFFF00',
    navy: '#000080',
    blue: '#0000FF',
    teal: '#008080',
    aqua: '#00FFFF',
    /* extendedColorsCSS */
    aliceblue: '#f0f8ff',
    antiquewhite: '#faebd7',
    aquamarine: '#7fffd4',
    azure: '#f0ffff',
    beige: '#f5f5dc',
    bisque: '#ffe4c4',
    blanchedalmond: '#ffebcd',
    blueviolet: '#8a2be2',
    brown: '#a52a2a',
    burlywood: '#deb887',
    cadetblue: '#5f9ea0',
    chartreuse: '#7fff00',
    chocolate: '#d2691e',
    coral: '#ff7f50',
    cornflowerblue: '#6495ed',
    cornsilk: '#fff8dc',
    crimson: '#dc143c',
    cyan: '#00ffff',
    darkblue: '#00008b',
    darkcyan: '#008b8b',
    darkgoldenrod: '#b8860b',
    darkgray: '#a9a9a9',
    darkgreen: '#006400',
    darkgrey: '#a9a9a9',
    darkkhaki: '#bdb76b',
    darkmagenta: '#8b008b',
    darkolivegreen: '#556b2f',
    darkorange: '#ff8c00',
    darkorchid: '#9932cc',
    darkred: '#8b0000',
    darksalmon: '#e9967a',
    darkseagreen: '#8fbc8f',
    darkslateblue: '#483d8b',
    darkslategray: '#2f4f4f',
    darkslategrey: '#2f4f4f',
    darkturquoise: '#00ced1',
    darkviolet: '#9400d3',
    deeppink: '#ff1493',
    deepskyblue: '#00bfff',
    dimgray: '#696969',
    dimgrey: '#696969',
    dodgerblue: '#1e90ff',
    firebrick: '#b22222',
    floralwhite: '#fffaf0',
    forestgreen: '#228b22',
    gainsboro: '#dcdcdc',
    ghostwhite: '#f8f8ff',
    gold: '#ffd700',
    goldenrod: '#daa520',
    greenyellow: '#adff2f',
    grey: '#808080',
    honeydew: '#f0fff0',
    hotpink: '#ff69b4',
    indianred: '#cd5c5c',
    indigo: '#4b0082',
    ivory: '#fffff0',
    khaki: '#f0e68c',
    lavender: '#e6e6fa',
    lavenderblush: '#fff0f5',
    lawngreen: '#7cfc00',
    lemonchiffon: '#fffacd',
    lightblue: '#add8e6',
    lightcoral: '#f08080',
    lightcyan: '#e0ffff',
    lightgoldenrodyellow: '#fafad2',
    lightgray: '#d3d3d3',
    lightgreen: '#90ee90',
    lightgrey: '#d3d3d3',
    lightpink: '#ffb6c1',
    lightsalmon: '#ffa07a',
    lightseagreen: '#20b2aa',
    lightskyblue: '#87cefa',
    lightslategray: '#778899',
    lightslategrey: '#778899',
    lightsteelblue: '#b0c4de',
    lightyellow: '#ffffe0',
    limegreen: '#32cd32',
    linen: '#faf0e6',
    magenta: '#ff00ff',
    mediumaquamarine: '#66cdaa',
    mediumblue: '#0000cd',
    mediumorchid: '#ba55d3',
    mediumpurple: '#9370db',
    mediumseagreen: '#3cb371',
    mediumslateblue: '#7b68ee',
    mediumspringgreen: '#00fa9a',
    mediumturquoise: '#48d1cc',
    mediumvioletred: '#c71585',
    midnightblue: '#191970',
    mintcream: '#f5fffa',
    mistyrose: '#ffe4e1',
    moccasin: '#ffe4b5',
    navajowhite: '#ffdead',
    oldlace: '#fdf5e6',
    olivedrab: '#6b8e23',
    orange: '#ffa500',
    orangered: '#ff4500',
    orchid: '#da70d6',
    palegoldenrod: '#eee8aa',
    palegreen: '#98fb98',
    paleturquoise: '#afeeee',
    palevioletred: '#db7093',
    papayawhip: '#ffefd5',
    peachpuff: '#ffdab9',
    peru: '#cd853f',
    pink: '#ffc0cb',
    plum: '#dda0dd',
    powderblue: '#b0e0e6',
    rosybrown: '#bc8f8f',
    royalblue: '#4169e1',
    saddlebrown: '#8b4513',
    salmon: '#fa8072',
    sandybrown: '#f4a460',
    seagreen: '#2e8b57',
    seashell: '#fff5ee',
    sienna: '#a0522d',
    skyblue: '#87ceeb',
    slateblue: '#6a5acd',
    slategray: '#708090',
    slategrey: '#708090',
    snow: '#fffafa',
    springgreen: '#00ff7f',
    steelblue: '#4682b4',
    tan: '#d2b48c',
    thistle: '#d8bfd8',
    tomato: '#ff6347',
    turquoise: '#40e0d0',
    violet: '#ee82ee',
    wheat: '#f5deb3',
    whitesmoke: '#f5f5f5',
    yellowgreen: '#9acd32',
};

const cssNamesParsed = {
    // Display and Layout
    d: "display",
    pos: "position",
    t: "top",
    bot: "bottom",
    b: "bottom",
    start: "left",
    s: "left",
    end: "right",
    e: "right",
    z: "z-index",
    zi: "z-index",
    // Flexbox
    fb: "flex-basis",
    fd: "flex-direction",
    fwr: "flex-wrap",
    fg: "flex-grow",
    fsh: "flex-shrink",
    flex: "flex",
    jc: "justify-content",
    ai: "align-items",
    as: "align-self",
    ac: "align-content",
    // Grid
    gtc: "grid-template-columns",
    gtr: "grid-template-rows",
    gta: "grid-template-areas",
    gt: "grid-template",
    gg: "grid-gap",
    gc: "grid-column",
    gr: "grid-row",
    gcs: "grid-column-start",
    gce: "grid-column-end",
    grs: "grid-row-start",
    gre: "grid-row-end",
    ga: "grid-area",
    gac: "grid-auto-columns",
    gar: "grid-auto-rows",
    gaf: "grid-auto-flow",
    // Dimensions
    w: "width",
    h: "height",
    wmn: "min-width",
    hmn: "min-height",
    wmx: "max-width",
    hmx: "max-height",
    minw: "min-width",
    minh: "min-height",
    maxw: "max-width",
    maxh: "max-height",
    // Box Model
    p: "padding",
    pt: "padding-top",
    pb: "padding-bottom",
    ps: "padding-left",
    pe: "padding-right",
    py: ["padding-top", "padding-bottom"],
    px: ["padding-left", "padding-right"],
    m: "margin",
    mt: "margin-top",
    mb: "margin-bottom",
    ms: "margin-left",
    me: "margin-right",
    my: ["margin-top", "margin-bottom"],
    mx: ["margin-left", "margin-right"],
    // Border
    bw: "border-width",
    bwt: "border-top-width",
    bwb: "border-bottom-width",
    bws: "border-left-width",
    bwe: "border-right-width",
    bwy: ["border-top-width", "border-bottom-width"],
    bwx: ["border-left-width", "border-right-width"],
    bst: "border-style",
    bstt: "border-top-style",
    bstb: "border-bottom-style",
    bsts: "border-left-style",
    bste: "border-right-style",
    bsty: ["border-top-style", "border-bottom-style"],
    bstx: ["border-left-style", "border-right-style"],
    borderStylet: "border-top-style",
    borderStyleb: "border-bottom-style",
    borderStyles: "border-left-style",
    borderStylee: "border-right-style",
    borderStyley: ["border-top-style", "border-bottom-style"],
    borderStylex: ["border-left-style", "border-right-style"],
    bco: "border-color",
    bcot: "border-top-color",
    bcob: "border-bottom-color",
    bcos: "border-left-color",
    bcoe: "border-right-color",
    bcoy: ["border-top-color", "border-bottom-color"],
    bcox: ["border-left-color", "border-right-color"],
    borderColort: "border-top-color",
    borderColorb: "border-bottom-color",
    borderColors: "border-left-color",
    borderColore: "border-right-color",
    borderColory: ["border-top-color", "border-bottom-color"],
    borderColorx: ["border-left-color", "border-right-color"],
    bo: "border",
    bort: "border-top",
    borb: "border-bottom",
    bors: "border-left",
    bore: "border-right",
    // Border Radius
    rounded: "border-radius",
    r: "border-radius",
    rs: ["border-top-left-radius", "border-bottom-left-radius"],
    re: ["border-top-right-radius", "border-bottom-right-radius"],
    rt: ["border-top-left-radius", "border-top-right-radius"],
    rb: ["border-bottom-left-radius", "border-bottom-right-radius"],
    rst: "border-top-left-radius",
    ret: "border-top-right-radius",
    rsb: "border-bottom-left-radius",
    reb: "border-bottom-right-radius",
    // Typography
    fs: "font-size",
    fwg: "font-weight",
    ff: "font-family",
    fst: "font-style",
    fv: "font-variant",
    f: "font",
    lh: "line-height",
    lst: "letter-spacing",
    ws: "word-spacing",
    ta: "text-align",
    tde: "text-decoration",
    tt: "text-transform",
    ti: "text-indent",
    tsh: "text-shadow",
    to: "text-overflow",
    ww: "word-wrap",
    wb: "word-break",
    whs: "white-space",
    // Colors
    text: "color",
    c: "color",
    bg: "background-color",
    bgc: "background-color",
    // Background
    BG: "background",
    bgi: "background-image",
    bgr: "background-repeat",
    bga: "background-attachment",
    bgp: "background-position",
    bgs: "background-size",
    bgo: "background-origin",
    bgcl: "background-clip",
    // Visibility and Opacity
    v: "visibility",
    o: "opacity",
    // Overflow
    ov: "overflow",
    ovx: "overflow-x",
    ovy: "overflow-y",
    // Cursor
    cur: "cursor",
    // Transform
    tr: "transform",
    tro: "transform-origin",
    trs: "transform-style",
    // Transition
    transition: "transition",
    td: "transition-duration",
    tf: "transition-timing-function",
    tp: "transition-property",
    tdy: "transition-delay",
    // Animation
    an: "animation",
    and: "animation-duration",
    anf: "animation-fill-mode",
    andc: "animation-direction",
    anic: "animation-iteration-count",
    ann: "animation-name",
    anps: "animation-play-state",
    antf: "animation-timing-function",
    andy: "animation-delay",
    // Shadow
    bsh: "box-shadow",
    // Outline
    ol: "outline",
    olc: "outline-color",
    ols: "outline-style",
    olw: "outline-width",
    olo: "outline-offset",
    // List
    lsty: "list-style-type",
    lsp: "list-style-position",
    lsi: "list-style-image",
    lsst: "list-style",
    // Table
    tl: "table-layout",
    bc: "border-collapse",
    bs: "border-spacing",
    cs: "caption-side",
    ec: "empty-cells",
    // Content
    cnt: "content",
    q: "quotes",
    // Counter
    cr: "counter-reset",
    ci: "counter-increment",
    // Page
    pbb: "page-break-before",
    pba: "page-break-after",
    pbi: "page-break-inside",
    // Column
    coc: "column-count",
    cog: "column-gap",
    cow: "column-width",
    cor: "column-rule",
    corc: "column-rule-color",
    cors: "column-rule-style",
    corw: "column-rule-width",
    cosp: "column-span",
    cof: "column-fill",
    // Filter
    ft: "filter",
    // Resize
    rz: "resize",
    // User Select
    us: "user-select",
    // Pointer Events
    pev: "pointer-events",
    // Box Sizing
    bxs: "box-sizing",
    // Vertical Align
    va: "vertical-align",
    // Float
    fl: "float",
    cl: "clear",
    // Gap
    g: "gap",
    rg: "row-gap",
    cg: "column-gap",
    // Clip
    clip: "clip",
    cp: "clip-path",
    // Text Decoration
    tdl: "text-decoration-line",
    tdc: "text-decoration-color",
    tds: "text-decoration-style",
    tdt: "text-decoration-thickness",
    // Object
    of: "object-fit",
    op: "object-position",
    // Scroll
    sb: "scroll-behavior",
    ss: "scroll-snap-type",
    ssa: "scroll-snap-align",
    // Writing Mode
    wm: "writing-mode",
    tdir: "text-direction",
    // Mix Blend Mode
    mbm: "mix-blend-mode",
    // Isolation
    iso: "isolation",
    // Mask
    mk: "mask",
    mki: "mask-image",
    mkp: "mask-position",
    mks: "mask-size",
    mkr: "mask-repeat",
    mko: "mask-origin",
    mkc: "mask-clip",
    mkm: "mask-mode",
    // Aspect Ratio
    ar: "aspect-ratio",
    // Contain
    con: "contain",
    // Will Change
    wc: "will-change",
    // Touch Action
    tac: "touch-action",
    // Appearance
    app: "appearance",
    // Orphans and Widows
    or: "orphans",
    wd: "widows",
    // Hyphens
    hy: "hyphens",
    // Tab Size
    ts: "tab-size",
    // Scroll Margin
    sm: "scroll-margin",
    smt: "scroll-margin-top",
    smr: "scroll-margin-right",
    smb: "scroll-margin-bottom",
    sml: "scroll-margin-left",
    // Scroll Padding
    sp: "scroll-padding",
    spt: "scroll-padding-top",
    spr: "scroll-padding-right",
    spb: "scroll-padding-bottom",
    spl: "scroll-padding-left",
    // Place Items
    pli: "place-items",
    plc: "place-content",
    pls: "place-self",
    // Overscroll Behavior
    osb: "overscroll-behavior",
    osbx: "overscroll-behavior-x",
    osby: "overscroll-behavior-y",
    // Text Emphasis
    te: "text-emphasis",
    tec: "text-emphasis-color",
    tes: "text-emphasis-style",
    tep: "text-emphasis-position",
    // Text Combine
    tcu: "text-combine-upright",
    // Text Orientation
    tor: "text-orientation",
    // Text Underline
    tup: "text-underline-position",
    tuo: "text-underline-offset",
    // Text Justify
    tj: "text-justify",
    // Text Align Last
    tal: "text-align-last",
    // Text Size Adjust
    tsa: "text-size-adjust",
    // Image Rendering
    ir: "image-rendering",
    // Image Orientation
    io: "image-orientation",
    // Backdrop Filter
    bdf: "backdrop-filter",
    // Caret Color
    cc: "caret-color",
    // Accent Color
    acc: "accent-color",
    // CSS Logical Properties
    bis: "block-size",
    is: "inline-size",
    mbs: "margin-block-start",
    mbe: "margin-block-end",
    mis: "margin-inline-start",
    mie: "margin-inline-end",
    pbs: "padding-block-start",
    pbe: "padding-block-end",
    pis: "padding-inline-start",
    pie: "padding-inline-end",
    // Container Queries
    ct: "container-type",
    cn: "container-name",
    // Subgrid
    sg: "subgrid",
    // Scroll Timeline
    st: "scroll-timeline",
    stn: "scroll-timeline-name",
    sta: "scroll-timeline-axis",
    // View Timeline
    vt: "view-timeline",
    vtn: "view-timeline-name",
    vta: "view-timeline-axis",
    vts: "view-timeline-inset",
    // Animation Timeline
    at: "animation-timeline",
};

const css_camel = {
    cssValidToCamel(st) {
        return st.replace(/([-_][a-z])/gi, ($1) => {
            return $1.toUpperCase().replace("-", "").replace("_", "");
        });
    },
    camelToCSSValid(st) {
        return st
            .replace(/[\w]([A-Z])/g, (m) => {
            return m[0] + "-" + m[1];
        })
            .toLowerCase();
    },
};

const commonPropertiesValuesAbreviations = {
    // Position values
    "ABS": "absolute",
    "REL": "relative",
    "FIX": "fixed",
    "STA": "static",
    "STI": "sticky",
    // Display values
    "BLO": "block",
    "INL": "inline",
    "IBL": "inline-block",
    "FLX": "flex",
    "GRI": "grid",
    "NON": "none",
    "TAB": "table",
    "TAC": "table-cell",
    "TAR": "table-row",
    "CNT": "contents",
    "LST": "list-item",
    "IFL": "inline-flex",
    "IGR": "inline-grid",
    "ITB": "inline-table",
    // Flex/Grid values
    "FST": "flex-start",
    "FEN": "flex-end",
    "CEN": "center",
    "SBE": "space-between",
    "SAR": "space-around",
    "SEV": "space-evenly",
    "STR": "stretch",
    "BAS": "baseline",
    "COL": "column",
    "ROW": "row",
    "CRE": "column-reverse",
    "RRE": "row-reverse",
    "WRA": "wrap",
    "NOW": "nowrap",
    "WRE": "wrap-reverse",
    // Alignment values
    "JUS": "justify",
    "SRT": "start",
    "END": "end",
    "LEF": "left",
    "RIG": "right",
    "TOP": "top",
    "BOT": "bottom",
    // Font values
    "BOL": "bold",
    "BOR": "bolder",
    "LIG": "lighter",
    "NOR": "normal",
    "ITA": "italic",
    "OBL": "oblique",
    "SMC": "small-caps",
    "CAP": "capitalize",
    "UPP": "uppercase",
    "LOW": "lowercase",
    "THI": "thin",
    "MED": "medium",
    "THK": "thick", "SER": "serif",
    "SAN": "sans-serif",
    "MON": "monospace",
    "CUR": "cursive",
    "FAN": "fantasy",
    // Text decoration values
    "UND": "underline",
    "OVE": "overline",
    "LTH": "line-through",
    "STK": "strikethrough",
    // Border style values
    "SOL": "solid",
    "DAS": "dashed",
    "DOT": "dotted",
    "DOU": "double",
    "GRO": "groove",
    "RID": "ridge",
    "INS": "inset",
    "OUT": "outset",
    "HID": "hidden",
    // List style values
    "DIS": "disc",
    "CIR": "circle",
    "SQU": "square",
    "DEC": "decimal",
    "LRO": "lower-roman",
    "URO": "upper-roman",
    "LAL": "lower-alpha",
    "UAL": "upper-alpha",
    "LAT": "lower-latin",
    "ULA": "upper-latin",
    "ARM": "armenian",
    "GEO": "georgian",
    "CJK": "cjk-ideographic",
    "HEB": "hebrew",
    "HIR": "hiragana",
    "KAT": "katakana",
    // Background values
    "NRP": "no-repeat",
    "REP": "repeat",
    "REX": "repeat-x",
    "REY": "repeat-y",
    "ROU": "round",
    "SPA": "space",
    "COV": "cover",
    "COT": "contain",
    "SCR": "scroll",
    "BFX": "fixed",
    // Cursor values
    "POI": "pointer",
    "DEF": "default",
    "TEX": "text",
    "MOV": "move",
    "WAI": "wait",
    "HEL": "help",
    "CRO": "crosshair",
    "PRO": "progress",
    "NAL": "not-allowed",
    "ZIN": "zoom-in",
    "ZOU": "zoom-out",
    "GRA": "grab",
    "GRB": "grabbing",
    "ERS": "e-resize",
    "WRS": "w-resize",
    "NRS": "n-resize",
    "SRS": "s-resize",
    "NER": "ne-resize",
    "NWR": "nw-resize",
    "SRZ": "se-resize",
    "SWR": "sw-resize",
    "EWR": "ew-resize",
    "NSR": "ns-resize",
    "NES": "nesw-resize",
    "NWS": "nwse-resize",
    "CLR": "col-resize",
    "RWR": "row-resize",
    "ALL": "all-scroll",
    "VTE": "vertical-text",
    "CEL": "cell",
    "CME": "context-menu",
    "COP": "copy",
    "AUT": "auto",
    // Animation/Transition values
    "EAS": "ease",
    "EAI": "ease-in",
    "EAO": "ease-out",
    "EIO": "ease-in-out",
    "LIN": "linear",
    "INF": "infinite",
    "ALT": "alternate",
    "ALR": "alternate-reverse",
    "REV": "reverse",
    "FOR": "forwards",
    "BAC": "backwards",
    "BTH": "both",
    "RUN": "running",
    "PAU": "paused",
    // Overflow values
    "VIS": "visible",
    "HDD": "hidden",
    "SCL": "scroll",
    "ATU": "auto",
    "CLP": "clip",
    // White space values
    "NWP": "nowrap",
    "PRE": "pre",
    "PWR": "pre-wrap",
    "PLI": "pre-line",
    "BSP": "break-spaces",
    // Word break values
    "KEE": "keep-all",
    "BRA": "break-all",
    "BRW": "break-word",
    // Transform values
    "PR3": "preserve-3d",
    "FLA": "flat",
    // Box sizing values
    "CBX": "content-box",
    "BBX": "border-box",
    // Clear/Float values
    "CLB": "both",
    "CLL": "left",
    "CLT": "right",
    "CLN": "none",
    // Table values
    "TBC": "collapse",
    "TBS": "separate",
    // Resize values
    "RSB": "both",
    "RSH": "horizontal",
    "RSV": "vertical",
    "RSN": "none",
    // User select values
    "USN": "none",
    "UST": "text",
    "USA": "all",
    "USU": "auto",
    // Appearance values
    "APN": "none",
    "APA": "auto",
    "APB": "button",
    "APC": "checkbox",
    "APR": "radio",
    "APT": "textfield",
    "APM": "menulist",
    // Miscellaneous values
    "ALV": "all",
    "AUV": "auto",
    "INI": "initial",
    "INH": "inherit",
    "UNS": "unset",
    "RVT": "revert",
    "TRA": "transparent",
    "CCL": "currentColor",
    // Filter values
    "BLU": "blur",
    "BRI": "brightness",
    "CON": "contrast",
    "DRO": "drop-shadow",
    "GRY": "grayscale",
    "HUR": "hue-rotate",
    "INV": "invert",
    "OPA": "opacity",
    "SAT": "saturate",
    "SEP": "sepia",
    // Mix blend mode values
    "MBN": "normal",
    "MBM": "multiply",
    "MBS": "screen",
    "MBO": "overlay",
    "MBD": "darken",
    "MBL": "lighten",
    "MCD": "color-dodge",
    "MCB": "color-burn",
    "MHL": "hard-light",
    "MSL": "soft-light",
    "MDF": "difference",
    "MEX": "exclusion",
    "MHU": "hue",
    "MSA": "saturation",
    "MCO": "color",
    "MLU": "luminosity",
    // Object fit values
    "OFI": "fill",
    "OCN": "contain",
    "OCV": "cover",
    "ONO": "none",
    "OSD": "scale-down"
};

/* Colors */
class ValuesSingleton {
    constructor() {
        this.indicatorClass = 'ank';
        this.colors = allColors;
        this.abreviationsClasses = {};
        this.abreviationsValues = {};
        this.combos = {};
        this.combosCreated = {};
        this.encryptCombo = true;
        this.encryptComboCharacters = '■■■';
        this.encryptComboCreatedCharacters = '🜔🜔🜔';
        this.cssNamesParsed = cssNamesParsed;
        this.alreadyCreatedClasses = [];
        this.isDebug = false;
        this.bps = [
            {
                bp: 'sm',
                value: '576px',
                class2Create: '',
            },
            {
                bp: 'md',
                value: '768px',
                class2Create: '',
            },
            {
                bp: 'lg',
                value: '992px',
                class2Create: '',
            },
            {
                bp: 'xl',
                value: '1200px',
                class2Create: '',
            },
            {
                bp: 'xxl',
                value: '1400px',
                class2Create: '',
            },
        ];
        this.bpsSpecifyOptions = [
            '',
            'html',
            'html body',
            'html body #' + this.indicatorClass + '-bp',
            '#' + this.indicatorClass + '-bp',
        ];
        this.limitBPS = false;
        this.styleSheetToManage = 'angora-styles';
        this.separator = 'þµÞ';
        this.specify = '🜏🜏🜏';
        /* Console */
        this.styleConsole = `padding: 1rem; background-color: ${this.colors['abyss']}; color: ${this.colors['lavenderLP']};`;
        /* Pseudos */
        this.pseudoClasses = [
            'Active',
            'AnyLink',
            'Autofill',
            'Blank',
            'Checked',
            'Current',
            'Default',
            'Defined',
            'Dir',
            'Disabled',
            'Empty',
            'Enabled',
            'First',
            'FirstChild',
            'FirstOfType',
            'Focus',
            'FocusVisible',
            'FocusWithin',
            'Fullscreen',
            'Future',
            'Has',
            'Host',
            'Hover',
            'InRange',
            'Indeterminate',
            'Invalid',
            'Is',
            'Lang',
            'LastChild',
            'LastOfType',
            'Left',
            'Link',
            'LocalLink',
            'Modal',
            'Muted',
            'Not',
            'NthChild',
            'NthLastChild',
            'NthLastOfType',
            'NthOfType',
            'OnlyChild',
            'OnlyOfType',
            'Optional',
            'OutOfRange',
            'Past',
            'Paused',
            'PictureInPicture',
            'PlaceHolderShown',
            'Playing',
            'PopoverOpen',
            'ReadOnly',
            'ReadWrite',
            'Required',
            'Right',
            'Root',
            'Scope',
            'Seeking',
            'Stalled',
            'Target',
            'TargetWithin',
            'UserInvalid',
            'UserValid',
            'Valid',
            'Visited',
            'VolumeLocked',
            'Where',
        ];
        this.pseudosHasSDED = [
            'Dir',
            'Not',
            'Lang',
            'Has',
            'Host',
            'Is',
            'NthChild',
            'NthLastChild',
            'NthLastOfType',
            'NthOfType',
            'Part',
            'Slotted',
            'Where',
        ];
        this.pseudoElements = [
            'After',
            'Backdrop',
            'Before',
            'Cue',
            'CueRegion',
            'FileSelectorButton',
            'FirstLetter',
            'FirstLine',
            'GrammarError',
            'Highlight',
            'Marker',
            'Part',
            'Placeholder',
            'Selection',
            'Slotted',
            'SpellingError',
            'TargetText',
            'ViewTransition',
            'ViewTransitionGroup',
            'ViewTransitionImagePair',
            'ViewTransitionNew',
            'ViewTransitionOld',
        ];
        this.pseudos = this.pseudoClasses
            .sort((e1, e2) => {
            e1 = e1.toString().length;
            e2 = e2.toString().length;
            return e1 > e2 ? 1 : e1 < e2 ? -1 : 0;
        })
            .map((pse) => {
            return {
                mask: pse,
                real: `${this.separator}:${css_camel.camelToCSSValid(pse)}`,
            };
        })
            .concat(this.pseudoElements
            .sort((e1, e2) => {
            e1 = e1.toString().length;
            e2 = e2.toString().length;
            return e1 > e2 ? 1 : e1 < e2 ? -1 : 0;
        })
            .map((pse) => {
            return {
                mask: pse,
                real: `${this.separator}::${css_camel.camelToCSSValid(pse)}`,
            };
        }));
        this.importantActive = false;
        this.abreviationTraductors = [
            {
                abreviation: 'per',
                traduction: '$1%',
                abreviationRegExp: /(\d+)\s*per/g,
                traductionRegExp: /%/g,
            },
            {
                abreviation: 'COM',
                traduction: ' , ',
                abreviationRegExp: /COM/g,
                traductionRegExp: /\s*,\s*/g,
            },
            {
                abreviation: 'CSP',
                traduction: `'`,
                abreviationRegExp: /CSP/g,
                traductionRegExp: /'/g,
            },
            {
                abreviation: 'CDB',
                traduction: `"`,
                abreviationRegExp: /CDB/g,
                traductionRegExp: /"/g,
            },
            {
                abreviation: 'MIN',
                traduction: '-',
                abreviationRegExp: /MIN/g,
                traductionRegExp: /-/g,
            },
            {
                abreviation: 'PLUS',
                traduction: '+',
                abreviationRegExp: /PLUS/g,
                traductionRegExp: /\+/g,
            },
            {
                abreviation: 'SD',
                traduction: '(',
                abreviationRegExp: /SD/g,
                traductionRegExp: /\(/g,
            },
            {
                abreviation: 'ED',
                traduction: ')',
                abreviationRegExp: /ED/g,
                traductionRegExp: /\)/g,
            },
            {
                abreviation: 'SE',
                traduction: '[',
                abreviationRegExp: /SE/g,
                traductionRegExp: /\[/g,
            },
            {
                abreviation: 'EE',
                traduction: ']',
                abreviationRegExp: /EE/g,
                traductionRegExp: /\]/g,
            },
            {
                abreviation: 'HASH',
                traduction: '#',
                abreviationRegExp: /HASH/g,
                traductionRegExp: /#/g,
            },
            {
                abreviation: 'SLASH',
                traduction: '/',
                abreviationRegExp: /SLASH/g,
                traductionRegExp: /\//g,
            },
            {
                abreviation: 'UND',
                traduction: '_',
                abreviationRegExp: /UND/g,
                traductionRegExp: /_/g,
            },
            {
                abreviation: '__',
                traduction: ' ',
                abreviationRegExp: /__/g,
                traductionRegExp: /\s+/g,
            },
            {
                abreviation: '_',
                traduction: '.',
                abreviationRegExp: /_/g,
                traductionRegExp: /\./g,
            },
            {
                abreviation: 'CHILD',
                traduction: ' > ',
                abreviationRegExp: /CHILD/g,
                traductionRegExp: /\s*>\s*/g,
            },
            {
                abreviation: 'ADJ',
                traduction: ' + ',
                abreviationRegExp: /ADJ/g,
                traductionRegExp: /\s*\+\s*/g,
            },
            {
                abreviation: 'SIBL',
                traduction: ' ~ ',
                abreviationRegExp: /SIBL/g,
                traductionRegExp: /\s*~\s*/g,
            },
            {
                abreviation: 'ALL',
                traduction: '*',
                abreviationRegExp: /ALL/g,
                traductionRegExp: /\*/g,
            },
            {
                abreviation: 'EQ',
                traduction: '=',
                abreviationRegExp: /EQ/g,
                traductionRegExp: /=/g,
            },
            {
                abreviation: 'ST',
                traduction: '^',
                abreviationRegExp: /ST/g,
                traductionRegExp: /\^/g,
            },
            {
                abreviation: 'INC',
                traduction: '$',
                abreviationRegExp: /INC/g,
                traductionRegExp: /\$/g,
            },
            {
                abreviation: 'DPS',
                traduction: ':',
                abreviationRegExp: /DPS/g,
                traductionRegExp: /:/g,
            },
            {
                abreviation: 'PNC',
                traduction: ';',
                abreviationRegExp: /PNC/g,
                traductionRegExp: /;/g,
            },
        ];
        /* Time Management*/
        this.lastCSSCreate = Date.now();
        this.lastTimeAsked2Create = new Date().getTime();
        this.timesCSSCreated = 0;
        this.timeBetweenReCreate = 300;
        this.useTimer = true;
        /* Recurrent Strategy */
        this.useRecurrentStrategy = true;
        this.lastTimeCssCreateEnded = Date.now();
        this.cssCreateIsActive = false;
        /* Common Properties Values Abreviations */
        this.commonPropertiesValuesAbreviations = commonPropertiesValuesAbreviations;
        this.commonPropertiesValuesAbreviationsValues = Object.values(this.commonPropertiesValuesAbreviations);
    }
    static getInstance() {
        if (!ValuesSingleton.instance) {
            ValuesSingleton.instance = new ValuesSingleton();
        }
        return ValuesSingleton.instance;
    }
}

function getStackTrace() {
    let stack;
    try {
        throw new Error("");
    }
    catch (error) {
        stack = error.stack || "";
    }
    stack = stack.split("\n").map((line) => {
        return line.trim();
    });
    return stack.splice(stack[0] == "Error" ? 2 : 1);
}
const values$u = ValuesSingleton.getInstance();
const console_log = {
    consoleLog(type = "log", thing, style = values$u.styleConsole, line = null, stoper = !values$u.isDebug) {
        this.consoleParser({
            type: type,
            thing: thing,
            style: style,
            line: line,
            stoper: stoper,
        });
    },
    consoleParser(config) {
        config.type = config.type ? config.type : "log";
        config.style = config.style ? config.style : values$u.styleConsole;
        config.stoper =
            config.stoper !== undefined ? config.stoper : !values$u.isDebug;
        if (config.stoper === false || config.type === "error") {
            if (config.line) {
                console.info("%cline: " + config.line + " = ", config.style);
            }
            console.info("%c" + getStackTrace()[2], config.style);
            console.groupCollapsed("Trace");
            console.trace();
            console.groupEnd();
            {
                switch (config.type) {
                    case "log":
                        console.log("%c" +
                            (typeof config.thing === "object"
                                ? JSON.stringify(config.thing)
                                : config.thing), config.style);
                        break;
                    case "info":
                        console.info("%c" +
                            (typeof config.thing === "object"
                                ? JSON.stringify(config.thing)
                                : config.thing), config.style);
                        break;
                    case "error":
                        console.error("%c" +
                            (typeof config.thing === "object"
                                ? JSON.stringify(config.thing)
                                : config.thing), config.style);
                        break;
                    default:
                        break;
                }
            }
            if (typeof config.thing === "object") {
                console.dir(config.thing);
            }
        }
    },
};

/* Singletons */
const values$t = ValuesSingleton.getInstance();
const abreviation_traductors = {
    abreviationTraductor(value, type = "traduce") {
        if (value !== undefined) {
            console_log.consoleLog("info", {
                value_beforeAbreviationTraductor: value,
            });
            for (const abr of values$t.abreviationTraductors) {
                let traduction = abr.traduction;
                let abreviation = abr.abreviation;
                let traductionRegExp = abr.traductionRegExp;
                let abreviationRegExp = abr.abreviationRegExp;
                if (type === "traduce") {
                    value = value.replace(abreviationRegExp, traduction);
                }
                else if (type === "convert") {
                    value = value.replace(traductionRegExp, abreviation);
                }
            }
            console_log.consoleLog("info", {
                value_afterAbreviationTraductor: value,
            });
        }
        return value;
    },
    unbefysize(value) {
        return this.abreviationTraductor(value);
    },
    befysize(value) {
        return this.abreviationTraductor(value, "convert");
    },
};

/* Singletons */
const values$s = ValuesSingleton.getInstance();
const color_transform = {
    colorToRGB(color) {
        try {
            let rgb = [255, 0, 0];
            color = color.toLowerCase();
            switch (true) {
                case !!values$s.colors[color]:
                    rgb = this.colorToRGB(values$s.colors[color]);
                    break;
                case color.includes('rgb') || color.includes('rgba'):
                    rgb = this.parseRGB(color);
                    break;
                case color.includes('#'):
                    rgb = this.parseRGB(this.HexToRGB(color));
                    break;
                case color.includes('hsl'):
                    rgb = this.parseRGB(this.HSLToRGB(color));
                    break;
                case color.includes('hwb'):
                    rgb = this.parseRGB(this.HWBToRGB(color));
                    break;
                default:
                    break;
            }
            return rgb;
        }
        catch (error) {
            console_log.consoleLog('error', { error: error });
            return [255, 0, 0];
        }
    },
    RGBToRGBA(rgb, alpha) {
        return `rgba(${rgb[0]},${rgb[1]},${rgb[2]},${alpha})`;
    },
    parseRGB(rgba) {
        let rgb = [];
        if (rgba.includes('rgb') || rgba.includes('rgba')) {
            rgb = rgba.split('(')[1].split(',')[4]
                ? [
                    parseInt(rgba.split('(')[1].split(',')[0]),
                    parseInt(rgba.split('(')[1].split(',')[1]),
                    parseInt(rgba.split('(')[1].split(',')[2]),
                    parseInt(rgba.split('(')[1].split(',')[3]),
                ]
                : [
                    parseInt(rgba.split('(')[1].split(',')[0]),
                    parseInt(rgba.split('(')[1].split(',')[1]),
                    parseInt(rgba.split('(')[1].split(',')[2]),
                ];
        }
        return rgb;
    },
    HexToRGB(Hex) {
        let rgb = [];
        const hexCode = Hex.replace('#', '');
        const hexCodeLength = hexCode.length;
        if (hexCodeLength === 3) {
            rgb.push(parseInt(hexCode.charAt(0) + hexCode.charAt(0), 16), parseInt(hexCode.charAt(1) + hexCode.charAt(1), 16), parseInt(hexCode.charAt(2) + hexCode.charAt(2), 16));
        }
        else if (hexCodeLength === 4) {
            rgb.push(parseInt(hexCode.charAt(0) + hexCode.charAt(0), 16), parseInt(hexCode.charAt(1) + hexCode.charAt(1), 16), parseInt(hexCode.charAt(2) + hexCode.charAt(2), 16), parseInt(hexCode.charAt(3) + hexCode.charAt(3), 16));
        }
        else if (hexCodeLength === 6) {
            rgb.push(parseInt(hexCode.charAt(0) + hexCode.charAt(1), 16), parseInt(hexCode.charAt(2) + hexCode.charAt(3), 16), parseInt(hexCode.charAt(4) + hexCode.charAt(5), 16));
        }
        else if (hexCodeLength === 8) {
            rgb.push(parseInt(hexCode.charAt(0) + hexCode.charAt(1), 16), parseInt(hexCode.charAt(2) + hexCode.charAt(3), 16), parseInt(hexCode.charAt(4) + hexCode.charAt(5), 16), parseInt(hexCode.charAt(6) + hexCode.charAt(7), 16));
        }
        else {
            console_log.consoleLog('error', { hexToRGBError: 'Invalid hex code' });
        }
        return `rgb${![3, 6].includes(hexCodeLength) ? 'a' : ''}(${rgb.join(',')})`;
    },
    HSLToRGB(HSL) {
        /* Convert hsl to rgb please */
        if (!['hsl', 'hsla'].includes(HSL)) {
            return 'rgb(255,0,0,1)';
        }
        /* Separate string by comas and eliminate rgb or rgba */
        const rgbSplited = HSL.split('(')[1]
            .split(')')[0]
            .split(',')
            .filter((r) => r !== 'hsl' && r !== 'hsla');
        const hDecimal = parseInt(rgbSplited[0]) / 100;
        const sDecimal = parseInt(rgbSplited[1]) / 100;
        const lDecimal = parseInt(rgbSplited[2]) / 100;
        if (parseInt(rgbSplited[1]) === 0) {
            return `rgb(${lDecimal},${lDecimal},${lDecimal})`;
        }
        let q = lDecimal < 0.5
            ? lDecimal * (1 + sDecimal)
            : lDecimal + sDecimal - lDecimal * sDecimal;
        let p = 2 * lDecimal - q;
        const r = this.HueToRGB(p, q, hDecimal + 1 / 3);
        const g = this.HueToRGB(p, q, hDecimal);
        const b = this.HueToRGB(p, q, hDecimal - 1 / 3);
        return `rgb${rgbSplited[3] && rgbSplited[3] !== '' ? 'a' : ''}(${r},${g},${b}${rgbSplited[3] && rgbSplited[3] !== '' ? `,${rgbSplited[3]}` : ''})`;
    },
    HueToRGB(p, q, t) {
        if (t < 0)
            t += 1;
        if (t > 1)
            t -= 1;
        if (t < 1 / 6)
            return p + (q - p) * 6 * t;
        if (t < 1 / 2)
            return q;
        if (t < 2 / 3)
            return p + (q - p) * (2 / 3 - t) * 6;
        return p;
    },
    HWBToRGB(HWB) {
        const rgbSplited = HWB.split('(')[1]
            .split(')')[0]
            .split(',')
            .filter((r) => r !== 'hsl' && r !== 'hsla');
        let h = parseInt(rgbSplited[0]) / 360;
        let wh = parseInt(rgbSplited[1]) / 100;
        let bl = parseInt(rgbSplited[2]) / 100;
        let ratio = wh + bl;
        let i;
        let v;
        let f;
        let n;
        // wh + bl cant be > 1
        if (ratio > 1) {
            wh /= ratio;
            bl /= ratio;
        }
        i = Math.floor(6 * h);
        v = 1 - bl;
        f = 6 * h - i;
        if ((i & 0x01) !== 0) {
            f = 1 - f;
        }
        n = wh + f * (v - wh); // linear interpolation
        let r;
        let g;
        let b;
        switch (i) {
            default:
            case 6:
            case 0:
                r = v;
                g = n;
                b = wh;
                break;
            case 1:
                r = n;
                g = v;
                b = wh;
                break;
            case 2:
                r = wh;
                g = v;
                b = n;
                break;
            case 3:
                r = wh;
                g = n;
                b = v;
                break;
            case 4:
                r = n;
                g = wh;
                b = v;
                break;
            case 5:
                r = v;
                g = wh;
                b = n;
                break;
        }
        return `rgb${rgbSplited[3] && rgbSplited[3] !== '' ? 'a' : ''}(${Math.round(r * 255)},${Math.round(g * 255)},${Math.round(b * 255)}${rgbSplited[3] && rgbSplited[3] !== '' ? `,${rgbSplited[3]}` : ''})`;
    },
    shadeTintColor(rgb, percent) {
        let R = rgb[0] === 0 && percent > 0
            ? 16
            : rgb[0] === 255 && percent < 0
                ? 239
                : rgb[0];
        let G = rgb[1] === 0 && percent > 0
            ? 16
            : rgb[1] === 255 && percent < 0
                ? 239
                : rgb[1];
        let B = rgb[2] === 0 && percent > 0
            ? 16
            : rgb[2] === 255 && percent < 0
                ? 239
                : rgb[2];
        R = parseInt(((R * (100 + percent)) / 100).toString());
        G = parseInt(((G * (100 + percent)) / 100).toString());
        B = parseInt(((B * (100 + percent)) / 100).toString());
        R = R > 255 ? 255 : R < 0 ? 0 : R;
        G = G > 255 ? 255 : G < 0 ? 0 : G;
        B = B > 255 ? 255 : B < 0 ? 0 : B;
        /* let RR = R.toString(16).length == 1 ? '0' + R.toString(16) : R.toString(16);
        let GG = G.toString(16).length == 1 ? '0' + G.toString(16) : G.toString(16);
        let BB = B.toString(16).length == 1 ? '0' + B.toString(16) : B.toString(16); */
        if (rgb[3]) {
            let A = rgb[3] ? (rgb[3] * 255).toString(16) : 'FF';
            /* let AA =
              A.toString(16).length == 1 ? '0' + A.toString(16) : A.toString(16); */
            return [R, G, B, A];
        }
        else {
            return [R, G, B];
        }
    },
    opacityCreator(value, opacity) {
        if (value.includes('gradient')) {
            const colorMatches = this.separateColor4Transform(value);
            console_log.consoleLog('info', { colorMatches: colorMatches });
            if (!!colorMatches) {
                for (let colorMatch of colorMatches) {
                    console_log.consoleLog('info', {
                        valuePreSeparateColor4TransformPreCB: value,
                    });
                    value = value.replace(colorMatch, this.opacityCreator(colorMatch, opacity));
                    console_log.consoleLog('info', {
                        valuePostSeparateColor4TransformPostCB: value,
                    });
                }
                console_log.consoleLog('info', {
                    valuePostSeparateColor4Transform: value,
                });
                return value;
            }
            else {
                return value;
            }
        }
        else {
            let shade3Split = this.colorToRGB(value);
            console_log.consoleLog('info', { shade3Split: shade3Split });
            console_log.consoleLog('info', { shade3SplitLength: shade3Split.length });
            if (shade3Split.length === 4) {
                shade3Split[3] = opacity;
            }
            else {
                shade3Split.push(opacity);
            }
            return `rgba(${shade3Split.join(',')})`;
        }
    },
    getShadeTintColorOrGradient(tintValue, value) {
        if (value.includes('gradient')) {
            const colorMatches = this.separateColor4Transform(value);
            console_log.consoleLog('info', { colorMatches: colorMatches });
            if (!!colorMatches) {
                for (let colorMatch of colorMatches) {
                    console_log.consoleLog('info', {
                        valuePreSeparateColor4TransformPreCB: value,
                    });
                    value = value.replace(colorMatch, this.getShadeTintColorOrGradient(tintValue, colorMatch));
                    console_log.consoleLog('info', {
                        valuePostSeparateColor4TransformPostCB: value,
                    });
                }
                console_log.consoleLog('info', {
                    valuePostSeparateColor4Transform: value,
                });
                return value;
            }
            else {
                return value;
            }
        }
        else {
            return `rgba(${color_transform
                .shadeTintColor(color_transform.colorToRGB(value), tintValue)
                .join(',')})`;
        }
    },
    separateColor4Transform(value) {
        console_log.consoleLog('info', { valuePreSeparateColor4Transform: value });
        const colorReg = new RegExp(/(?:(#[A-Fa-f0-9]{3,8})|(?:(rgb)|(hsl)|(hwb))a?\([0-9\.\,\s%]*\))/gi);
        return value.match(colorReg);
    },
};

/* Singletons */
const values$r = ValuesSingleton.getInstance();
const manage_sheet = {
    checkSheet() {
        let sheets = [...document.styleSheets];
        for (let nsheet of sheets) {
            if (nsheet.href?.includes(values$r.styleSheetToManage)) {
                values$r.sheet = nsheet;
                values$r.alreadyCreatedClasses = [];
                values$r.combosCreated = {};
            }
        }
    },
    getSheet() {
        if (values$r.sheet) {
            console_log.consoleLog('info', { sheet: values$r.sheet });
            return values$r.sheet;
        }
        else {
            return undefined;
        }
    },
};

const valueComboReplacer = async (c, vals) => {
    let reg = new RegExp(/VAL[0-9]+(DEF.*DEF)?/, "g");
    if (reg.test(c)) {
        let matches = c.match(reg);
        console_log.consoleLog("info", { matches: matches });
        if (!!matches) {
            for (let match of matches) {
                console_log.consoleLog("info", { match: match });
                let val = parseInt(match.split("VAL")[1].split("DEF")[0]);
                console_log.consoleLog("info", { val: val });
                let valueToMatch = `VAL${val}(DEF.*DEF)?`;
                let valueReg = new RegExp(valueToMatch, "g");
                console_log.consoleLog("info", {
                    valueToMatch: valueToMatch,
                });
                let def = match.split("DEF")[1];
                console_log.consoleLog("info", { def: def });
                console_log.consoleLog("info", { vals: vals });
                console_log.consoleLog("info", { vals_val: vals[val] });
                if (!!vals[val] &&
                    vals[val] !== "" &&
                    vals[val] !== "undefined" &&
                    vals[val] !== "DEF" &&
                    vals[val] !== "null") {
                    if (/VAL[0-9]+/.test(vals[val])) {
                        /* When you want to use another defined value */
                        let valval = vals[val].replace(/VAL/g, "");
                        console_log.consoleLog("info", { valval: valval });
                        c = c.replace(valueReg, vals[parseInt(valval)] &&
                            vals[parseInt(valval)] !== "VAL" + valval
                            ? vals[parseInt(valval)]
                            : def
                                ? def
                                : "");
                        console_log.consoleLog("info", { c: c });
                    }
                    else {
                        /* When you defined a custom value */
                        c = c.replace(valueReg, vals[val]);
                        console_log.consoleLog("info", { c: c });
                    }
                }
                else {
                    /* When you dont define a value its defined the default value */
                    c = c.replace(valueReg, def ? def : "");
                    console_log.consoleLog("info", { c: c });
                }
            }
            return c;
        }
        else {
            return c;
        }
    }
    else {
        return c;
    }
};

const values4ComboGetter = async (class2Create) => {
    if (!!class2Create.includes('VALS')) {
        let valsSource = class2Create.split('VALS')[1];
        console_log.consoleLog('info', { valsSource: valsSource });
        let valueReg = new RegExp(/VAL([0-9_]+)N[A-z0-9]+VAL\1N/, 'g');
        if (valueReg.test(valsSource)) {
            let valsToSortSource = valsSource.match(valueReg);
            console_log.consoleLog('info', { valsToSortSource: valsToSortSource });
            if (!!valsToSortSource) {
                let valsToSortExtras = [];
                let valsToSort = valsToSortSource.map((v) => {
                    let index = v.split('VAL')[1].split('N')[0];
                    let valReplace = new RegExp(`VAL${index}N`, 'g');
                    let firstIndex = parseInt(index);
                    if (index.includes('_')) {
                        let indexes = index.split('_');
                        firstIndex = parseInt(indexes[0]);
                        indexes.forEach((i, it) => {
                            if (it > 0) {
                                valsToSortExtras.push({
                                    index: parseInt(i),
                                    val: v.replace(valReplace, ''),
                                });
                            }
                        });
                    }
                    return {
                        index: firstIndex,
                        val: v.replace(valReplace, ''),
                    };
                });
                valsToSort = valsToSort.concat(valsToSortExtras);
                console_log.consoleLog('info', { valsToSort: valsToSort });
                let valsNotSorted = valsSource.split('VL');
                console_log.consoleLog('info', { valsNotSorted: valsNotSorted });
                let noValsNotSorted = false;
                if (valsNotSorted.length >= 1) {
                    valsNotSorted.shift();
                }
                if (valsNotSorted.length <= 0) {
                    noValsNotSorted = true;
                }
                console_log.consoleLog('info', { noValsNotSorted: noValsNotSorted });
                let ocupedIndexes = valsToSort.map((v) => v.index);
                console_log.consoleLog('info', { ocupedIndexes: ocupedIndexes });
                if (!noValsNotSorted) {
                    // Sort the valsNotSorted with indexes not used
                    let valsNotSortedSorted = valsNotSorted.map((v) => {
                        let index = 1;
                        while (ocupedIndexes.includes(index)) {
                            index++;
                        }
                        ocupedIndexes.push(index);
                        return {
                            index: index,
                            val: v,
                        };
                    });
                    console_log.consoleLog('info', {
                        valsNotSortedSorted: valsNotSortedSorted,
                    });
                    valsNotSortedSorted.sort((v1, v2) => {
                        return v1.index - v2.index;
                    });
                    console_log.consoleLog('info', {
                        valsNotSortedSortedSorted: valsNotSortedSorted,
                    });
                    valsToSort = valsToSort.concat(valsNotSortedSorted);
                    valsToSort.sort((v1, v2) => {
                        return v1.index - v2.index;
                    });
                    console_log.consoleLog('info', { valsToSort: valsToSort });
                }
                let emptyValsToFillValsSorted = [];
                let lastValIndex = valsToSort.sort((v1, v2) => {
                    return v1.index - v2.index;
                })[valsToSort.length - 1].index;
                console_log.consoleLog('info', { lastValIndex: lastValIndex });
                for (let i = 0; i < lastValIndex; i++) {
                    if (!ocupedIndexes.includes(i)) {
                        emptyValsToFillValsSorted.push({
                            index: i,
                            val: '',
                        });
                    }
                }
                console_log.consoleLog('info', {
                    emptyValsToFillValsSorted: emptyValsToFillValsSorted,
                });
                let valsSorted = valsToSort
                    .concat(emptyValsToFillValsSorted)
                    .sort((v1, v2) => {
                    return v1.index - v2.index;
                });
                console_log.consoleLog('info', { valsSorted: valsSorted });
                return valsSorted.map((v) => v.val);
            }
            else {
                return valsSource.split('VL');
            }
        }
        else {
            return valsSource.split('VL');
        }
    }
    else {
        return [];
    }
};

const values$q = ValuesSingleton.getInstance();
const comboParser = async (class2Create, comb, class2CreateElement, classes2Create) => {
    let combIndex = comb ? Object.keys(values$q.combos).indexOf(comb) : -1;
    console_log.consoleLog("info", { combIndex: combIndex });
    console_log.consoleLog("info", { class2Create: class2Create });
    let vals = await values4ComboGetter(class2Create);
    console_log.consoleLog("info", { vals: vals });
    await Promise.all(values$q.combos[comb].map(async (c) => {
        console_log.consoleLog("info", { combo: c });
        c = await valueComboReplacer(c, vals);
        console_log.consoleLog("info", { cAfterValueComboReplacer: c });
        if (c.startsWith(values$q.indicatorClass)) {
            let combosCreatedABBR = Object.keys(values$q.combosCreated);
            console_log.consoleLog("info", {
                combosCreatedABBR: combosCreatedABBR,
            });
            let alreadyABBRCombo = combosCreatedABBR.find((cs) => {
                return values$q.combosCreated[cs] === class2Create;
            });
            console_log.consoleLog("info", {
                alreadyABBRCombo: alreadyABBRCombo,
            });
            let combosCreatedKeys = Object.keys(values$q.combosCreated);
            let combCreatedKey = combosCreatedKeys.find((cs) => {
                return values$q.combosCreated[cs] === class2Create;
            }) || values$q.encryptComboCharacters + combosCreatedKeys.length;
            if (!alreadyABBRCombo) {
                values$q.combosCreated[values$q.encryptCombo ? combCreatedKey : class2Create] = class2Create;
                console_log.consoleLog("info", {
                    cStartsWithClass2Create: values$q.combosCreated[values$q.encryptCombo ? combCreatedKey : class2Create],
                });
            }
            console_log.consoleLog("info", {
                combosCreatedABBR: combosCreatedABBR,
            });
            let comboABBR = values$q.encryptCombo
                ? combCreatedKey
                : class2Create;
            console_log.consoleLog("info", { comboABBR: comboABBR });
            console_log.consoleLog("info", { c: c });
            let pseudos = values$q.pseudos.filter((p) => c.split("-")[1].includes(p.mask));
            let firstPseudo = pseudos.sort((p1, p2) => {
                return c.indexOf(p1.mask) - c.indexOf(p2.mask);
            })[0] || -1;
            switch (true) {
                case pseudos.length > 0 &&
                    !!(!c.includes("SEL") ||
                        c.indexOf("SEL") > c.indexOf(firstPseudo.mask)):
                    console_log.consoleLog("info", { firstPseudo: firstPseudo });
                    c = c
                        .replace("SEL", "")
                        .replace(firstPseudo.mask, "SEL__COM_" + comboABBR + firstPseudo.mask);
                    console_log.consoleLog("info", { cIncludesPseudoAfter: c });
                    break;
                case !!c.includes("SEL"):
                    c = c.replace("SEL", "SEL__COM_" + comboABBR + "__");
                    console_log.consoleLog("info", { cIncludesSELAfter: c });
                    break;
                default:
                    console_log.consoleLog("info", { cDoesntIncludesSEL: c });
                    c = c.replace(c.split("-")[1], c.split("-")[1] + "SEL__COM_" + comboABBR);
                    console_log.consoleLog("info", {
                        cDoesntIncludesSELAfter: c,
                    });
                    break;
            }
        }
        else {
            console_log.consoleLog("info", {
                cDoesntStartsWithClass2Create: c,
            });
            class2CreateElement.classList.add(c);
        }
        if (!classes2Create.includes(c)) {
            classes2Create.push(c);
        }
        return c;
    }));
    return classes2Create;
};

const values$p = ValuesSingleton.getInstance();
const getNewClasses2Create = async (classes2Create) => {
    // Get all HTMLElements in page
    Array.from(document.querySelectorAll("*")).forEach((value) => {
        value.classList.forEach(async (item) => {
            let comb = Object.keys(values$p.combos).find((cs) => {
                return item.includes(cs);
            });
            if (!!comb && values$p.combos[comb]) {
                classes2Create = await comboParser(item, comb, value, classes2Create);
            }
            else if (!comb &&
                !classes2Create.includes(item) &&
                item !== values$p.indicatorClass &&
                (item.includes(values$p.indicatorClass) ||
                    Object.keys(values$p.abreviationsClasses).find((aC) => item.includes(aC)))) {
                classes2Create.push(item);
            }
        });
    });
    return classes2Create;
};

const values$o = ValuesSingleton.getInstance();
const convertPseudos = (thing, remove = false) => {
    console_log.consoleLog("info", { thing_beforeconvertPseudos: thing });
    let pseudoFiltereds = values$o.pseudos.filter((pseudo) => {
        return thing.includes(pseudo.mask);
    });
    pseudoFiltereds.forEach((pse) => {
        let regMask = new RegExp(":*" + pse.mask, "gi");
        switch (true) {
            case values$o.pseudosHasSDED.includes(pse.mask):
                regMask = new RegExp(":*" + pse.mask + "\\" + "(", "gi");
                break;
            case ["Right", "Left"].includes(pse.mask):
                regMask = new RegExp("page" + pse.mask, "gi");
                break;
            default:
                break;
        }
        thing = thing
            .replace("SD", "(")
            .replace("ED", ")")
            .replace(regMask, !remove
            ? values$o.pseudosHasSDED.includes(pse.mask)
                ? pse.real + "("
                : ["Right", "Left"].includes(pse.mask)
                    ? "page" + pse.real
                    : pse.real
            : "");
    });
    console_log.consoleLog("info", { thing_afterconvertPseudos: thing });
    return thing;
};

const values$n = ValuesSingleton.getInstance();
const look4BPNVals = async (class2CreateSplited) => {
    if (values$n.bps.find((b) => class2CreateSplited[2] === b.bp)) {
        return {
            hasBP: true,
            values: class2CreateSplited.slice(3),
        };
    }
    else {
        return {
            hasBP: false,
            values: class2CreateSplited.slice(2),
        };
    }
};

const values$m = ValuesSingleton.getInstance();
const valueTraductor = async (value, property) => {
    value = abreviation_traductors.abreviationTraductor(!!values$m.abreviationsValues[value]
        ? values$m.abreviationsValues[value]
        : value);
    if (!property.includes('content')) {
        value = await opaParser(value);
        // MatchForColors and ReplaceForColors
        let colors = Object.keys(values$m.colors)
            .sort((c1, c2) => {
            return c2.length - c1.length;
        })
            .map((c) => `(${c})`)
            .join('|');
        let colorsRegString = `(?<![a-zA-Z0-9])(${colors})(?![a-zA-Z0-9])`;
        let colorsReg = new RegExp(colorsRegString, 'gi');
        let matches = value.match(colorsReg);
        console_log.consoleLog('info', { matches: matches });
        if (!!matches) {
            for (let match of matches) {
                console_log.consoleLog('info', { match: match });
                let realColor = values$m.colors[match.replace(/\s/g, '')];
                console_log.consoleLog('info', { realColor: realColor });
                let realColorValue = realColor;
                switch (true) {
                    case !!realColor &&
                        realColor.startsWith('rgb') &&
                        !realColor.includes('rgba'):
                        realColorValue = `rgba(${realColor}, 1)`;
                        break;
                    case !!realColor && realColor.startsWith('#'):
                        realColorValue = `rgba(${color_transform.colorToRGB(realColor)}, 1)`;
                        break;
                    default:
                        realColorValue = realColorValue;
                }
                console_log.consoleLog('info', { realColorValue: realColorValue });
                if (!!realColorValue) {
                    value = value.replace(match, realColorValue);
                    console_log.consoleLog('info', { value: value });
                }
            }
        }
    }
    return value;
};
const opaParser = async (value) => {
    let hasOPA = value.includes('OPA');
    console_log.consoleLog('info', { hasOPA: hasOPA, value: value });
    if (!!hasOPA) {
        const reg = new RegExp(/(?:([A-z0-9#]*)|(?:(rgb)|(hsl)|(hwb))a?\([0-9\.\,\s%]*\))\s?OPA\s?0\.[0-9]*/gi);
        const OPAS = value.match(reg);
        if (!!OPAS) {
            await Promise.all(OPAS.map(async (OPA) => {
                const color = OPA.split('OPA')[0];
                const OPAValue = OPA.split('OPA')[1];
                const realColor = `${color_transform
                    .colorToRGB(!!values$m.colors[color.toString().replace(/\s/g, '')]
                    ? values$m.colors[color.toString().replace(/\s/g, '')]
                    : color)
                    .toString()}`;
                value = !!OPAValue
                    ? value
                        .replace(color, `rgba(${realColor},${OPAValue})`)
                        .replace('OPA' + OPAValue, '')
                    : value;
                return value;
            }));
        }
    }
    return value;
};

const values$l = ValuesSingleton.getInstance();
const decryptCombo = async (specify, class2Create, class2CreateStringed) => {
    let alreadyABBRCombo = Object.keys(values$l.combosCreated).find((cs) => {
        console_log.consoleLog("info", { cs: cs });
        return specify.includes(cs);
    });
    return !!alreadyABBRCombo
        ? await (async () => {
            console_log.consoleLog("info", { alreadyABBRCombo: alreadyABBRCombo });
            return await Promise.all([specify, class2Create, class2CreateStringed].map(async (val, index) => {
                return alreadyABBRCombo
                    ? val.replace(new RegExp(alreadyABBRCombo, "g"), values$l.combosCreated[alreadyABBRCombo])
                    : val;
            }));
        })()
        : [specify, class2Create, class2CreateStringed];
};

const combinators = {
    combineArrays(a, b) {
        return a.array.reduce((acc, val) => [
            ...acc,
            ...b.array.map((v) => ({ [a.name]: val, [b.name]: v })),
        ], []);
    },
    combineIntoObject(array) {
        return array.reduce((acc, val) => {
            return { ...acc, [val.name]: val.val };
        }, {});
    },
};

const shadowGradientCreator = async (shadow, onlyGradient = false) => {
    let hOffset = `0`;
    let vOffset = `0`;
    let blur = `5`;
    let spread = `5`;
    let color = `black`;
    let inset = false;
    if (!onlyGradient) {
        let numericalValuesRegex = /(?<![\(#]+)^(inset)?(\s?-?[0-9\.]+(?:(px)|(cm)|(mm)|(pt)|(in)|(pc)|(r?em)|(vmin)|(vh)|(vm(ax)?)|(%)|(vw))?\s?){2,4}/g;
        const numericalValuesMatches = shadow.match(numericalValuesRegex);
        console_log.consoleLog('info', {
            numericalValuesMatches: numericalValuesMatches,
        });
        if (!!numericalValuesMatches) {
            color = shadow.replace(numericalValuesRegex, '');
            console_log.consoleLog('info', {
                shadowColor: color,
            });
            let numericalValuesSplit = shadow.replace(color, '').split(' ');
            if (numericalValuesSplit[0] === 'inset') {
                inset = true;
                numericalValuesSplit.shift();
            }
            if (numericalValuesSplit[0] === '') {
                numericalValuesSplit.shift();
            }
            hOffset = numericalValuesSplit[0] || '0';
            vOffset = numericalValuesSplit[1] || '0';
            blur = numericalValuesSplit[3] || '0';
            spread = numericalValuesSplit[2] || '5';
        }
    }
    else {
        color = shadow;
    }
    return `content:" ";border-radius:inherit;position:absolute;inset:-${spread};transform:translate3d(${hOffset},${vOffset},-1);background:${color};filter:blur(${blur});clip-path: polygon(-100vmax -100vmax,100vmax -100vmax,100vmax 100vmax,-100vmax 100vmax,-100vmax -100vmax,calc(0px  + ${spread} - ${hOffset}) calc(0px  + ${spread} - ${vOffset}),calc(0px  + ${spread} - ${hOffset}) calc(100% - ${spread} - ${vOffset}),calc(100% - ${spread} - ${hOffset}) calc(100% - ${spread} - ${vOffset}),calc(100% - ${spread} - ${hOffset}) calc(0px  + ${spread} - ${vOffset}),calc(0px  + ${spread} - ${hOffset}) calc(0px  + ${spread} - ${vOffset})`;
};

const values$k = ValuesSingleton.getInstance();
const propertyNValueCorrector = async (property2Use, value) => {
    console_log.consoleLog('info', {
        property2Use: property2Use,
        value: value,
    });
    let newRule = '';
    if (['box-shadow'].includes(property2Use) && value.includes('gradient')) {
        let shadowRegex = /(inset)?(\s?-?[0-9\.]+(?:(px)|(cm)|(mm)|(pt)|(in)|(pc)|(r?em)|(vmin)|(vh)|(vm(ax)?)|(%)|(vw))?\s?){2,4}(([A-z]+\-[A-z]+\([0-9\.]+(?:%|(deg)),\s*)?(((((?:(rgb)|(hsl))a?)\((([0-9]*)(%)?(deg)?,?\s?){1,4}(\/?\s?([0-9\.]*)(%)?\s?)\))|(#[0-9A-Fa-f]{3,8}))(\s*[0-9]*%,?\)?)?)*)(inset)?/g;
        let onlyGradientRegex = /(([A-z]+\-[A-z]+\([0-9\.]+(?:%|(deg)),\s*)?(((((?:(rgb)|(hsl))a?)\((([0-9]*)(%)?(deg)?,?\s?){1,4}(\/?\s?([0-9\.]*)(%)?\s?)\))|(#[0-9A-Fa-f]{3,8}))(\s*[0-9]*%,?\)?)?)*)/g;
        console_log.consoleLog('info', { value4RShadowRegex: value });
        let shadows2Use = [''];
        const shadowMatches = value.match(shadowRegex);
        console_log.consoleLog('info', { shadowMatches: shadowMatches });
        const gradientMatches = value.match(onlyGradientRegex);
        console_log.consoleLog('info', { gradientMatches: gradientMatches });
        let onlyGradient = false;
        if (!!shadowMatches && shadowMatches.every((a) => a.includes('gradient'))) {
            shadows2Use = shadowMatches.filter((a) => a !== '' && a.length > 2);
        }
        else if (!!gradientMatches &&
            gradientMatches.every((a) => a.includes('gradient'))) {
            shadows2Use = gradientMatches.filter((a) => a !== '' && a.length > 2);
            onlyGradient = true;
        }
        console_log.consoleLog('info', { shadows2Use: shadows2Use });
        let correctedShadows = await Promise.all(shadows2Use.map(async (a) => {
            return await shadowGradientCreator(a, onlyGradient);
        }));
        console_log.consoleLog('info', { correctedShadows: correctedShadows });
        let add2NewRule = correctedShadows
            .map((a, i) => {
            if (i <= 1) {
                return `${values$k.separator}${values$k.specify}${i === 0 ? '::before' : '::after'}{${a}`;
            }
            else {
                return '';
            }
        })
            .join('');
        console_log.consoleLog('info', { add2NewRule: add2NewRule });
        newRule = `transform-style:preserve-3d;}${add2NewRule}`;
        console_log.consoleLog('info', { newRuleWithShadow: newRule });
    }
    else {
        newRule = `${['background-color', 'color'].includes(property2Use) &&
            value.includes('gradient')
            ? 'background-image'
            : property2Use === 'border-color' && value.includes('gradient')
                ? `border-image-source`
                : property2Use}:${value};${property2Use === 'color' && value.includes('gradient')
            ? `background-clip: text;background-size: 100%;-webkit-background-clip: text;-moz-background-clip: text;-webkit-text-fill-color: transparent;-moz-text-fill-color: transparent;`
            : property2Use === 'border-color' && value.includes('gradient')
                ? `border-image-slice:2;border-image-width:2px;`
                : ''}`;
    }
    console_log.consoleLog('info', { newRule: newRule });
    return newRule;
};

/* Singletons */
const values$j = ValuesSingleton.getInstance();
const btnCreator = async (class2Create, specify, value, secondValue = 'transparent', outline = false) => {
    const combinatorsValuesNumbers = combinators.combineArrays({
        name: 'val',
        array: [
            { name: 'value', val: value },
            { name: 'secondValue', val: secondValue },
        ],
    }, { name: 'number', array: [-15, -20, -25, 3] });
    console_log.consoleLog('info', {
        combinatorsValuesNumbers: combinatorsValuesNumbers,
    });
    const shadesArray = await Promise.all(combinatorsValuesNumbers.map(async (a) => {
        return {
            name: `${a.val.name},${a.number}`,
            val: color_transform.getShadeTintColorOrGradient(a.number, a.val.val),
        };
    }));
    console_log.consoleLog('info', { shadesArray: shadesArray });
    const shades = combinators.combineIntoObject(shadesArray);
    console_log.consoleLog('info', { shades: shades });
    console_log.consoleLog('info', { "shades['value,3']": shades['value,3'] });
    let shadowColorValue = color_transform.opacityCreator(shades['value,3'], 0.5);
    let shadowColorSecondValue = color_transform.opacityCreator(shades['secondValue,3'], 0.5);
    console_log.consoleLog('info', { shadowColorValue: shadowColorValue });
    const shadowNumericalValues = '0 0 0 0.25rem ';
    const correctVals = combinators.combineIntoObject(await Promise.all(combinators
        .combineArrays({
        name: 'val',
        array: [
            { name: 'value', val: value },
            { name: 'secondValue', val: secondValue },
        ].concat(shadesArray),
    }, { name: 'prop', array: ['background-color', 'color', 'border-color'] })
        .map(async (a) => {
        return {
            name: `${a.val.name},${a.prop}`,
            val: await propertyNValueCorrector(a.prop, a.val.val),
        };
    })));
    const correctValsShadows = combinators.combineIntoObject(await Promise.all(combinators
        .combineArrays({
        name: 'val',
        array: [
            {
                name: 'shadowColorValue',
                val: shadowNumericalValues + shadowColorValue,
            },
            {
                name: 'shadowColorSecondValue',
                val: shadowNumericalValues + shadowColorSecondValue,
            },
        ].concat(shadesArray),
    }, {
        name: 'prop',
        array: ['box-shadow'],
    })
        .map(async (a) => {
        return {
            name: `${a.val.name}Corrected`,
            val: await propertyNValueCorrector(a.prop, a.val.val),
        };
    })));
    console_log.consoleLog('info', { correctVals: correctVals });
    console_log.consoleLog('info', { correctValsShadows: correctValsShadows });
    let SpecifyRegex = new RegExp(values$j.specify, 'g');
    let newRuleArray = [];
    /* Basic Button */
    newRuleArray.push(`${specify}{${!!outline
        ? correctVals['value,color'] +
            correctVals['secondValue,background-color'] +
            correctVals['value,border-color']
        : correctVals['value,background-color'] +
            correctVals['value,border-color']}}`.replace(SpecifyRegex, specify));
    /* Hover Button */
    newRuleArray.push(`${values$j.specify}{${!!outline
        ? correctVals['secondValue,color'] +
            correctVals['value,-15,background-color'] +
            correctVals['secondValue,border-color']
        : correctVals['value,-20,border-color'] +
            correctVals['value,background-color']}}`.replace(SpecifyRegex, `.${class2Create}${specify}:hover`));
    /* FocusButton */
    if (!!outline) {
        newRuleArray.push(`${values$j.specify}{${!!outline
            ? correctVals['secondValue,-15,background-color'] +
                correctVals['secondValue,-15,border-color']
            : correctVals['value,-15,background-color'] +
                correctVals['value,-15,border-color']}}`.replace(SpecifyRegex, `.btn-check:focus + .${class2Create}${specify}, .${class2Create}${specify}:focus`));
    }
    /* Checked Button */
    newRuleArray.push(`${values$j.specify}{${!!outline
        ? correctVals['value,-25,border-color']
        : correctVals['value,-20,background-color'] +
            correctVals['value,-25,border-color']}${!!outline
        ? correctValsShadows['shadowColorValueCorrected']
        : correctValsShadows['shadowColorValueCorrected']}
  }`.replace(SpecifyRegex, `.btn-check:checked + .${class2Create}${specify}, .btn-check:active + .${class2Create}${specify}, .${class2Create}${specify}.active, .show > .${class2Create}${specify} .dropdown-toggle, .${class2Create}${specify}:active`));
    newRuleArray.push(`${values$j.specify}{${!!outline
        ? correctValsShadows['shadowColorValueCorrected']
        : correctValsShadows['shadowColorValueCorrected']}}`.replace(SpecifyRegex, `.show > .${class2Create}${specify} .dropdown-toggle:focus, .btn-check:checked + .btn-check:focus, .btn-check:active + .${class2Create}${specify}:focus, .${class2Create}${specify}.active:focus, .${class2Create}${specify}:active:focus`));
    console_log.consoleLog('info', { newRuleArray: newRuleArray });
    return newRuleArray.filter((c) => c !== '').join(values$j.separator);
};

/* Singletons */
const values$i = ValuesSingleton.getInstance();
const property2ValueJoiner = async (property, class2CreateSplited, class2Create, propertyValues = [''], specify = '') => {
    switch (true) {
        case !!values$i.cssNamesParsed[property.toString()]:
            let cssNameParsed = values$i.cssNamesParsed[property.toString()];
            if (typeof cssNameParsed === 'string') {
                return `${specify}{${values$i.cssNamesParsed[property.toString()]}:${propertyValues[0]};}`;
            }
            else {
                return `${specify}{${cssNameParsed
                    .map((c, i) => {
                    return `${c}:${propertyValues[i] || propertyValues[0] || ''};`;
                })
                    .join('')}}`;
            }
            break;
        case class2CreateSplited[1].startsWith('link'):
            return ` a${specify}{color:${propertyValues[0]};}`;
            break;
        case class2CreateSplited[1].startsWith('btnOutline'):
            return await btnCreator(class2Create, specify, propertyValues[0], propertyValues[1] || '', true);
            break;
        case class2CreateSplited[1].startsWith('btn'):
            return await btnCreator(class2Create, specify, propertyValues[0]);
            break;
        default:
            return `${specify}{${css_camel.camelToCSSValid(property)}:${propertyValues[0]};}`;
            break;
    }
};

/* Singletons */
const values$h = ValuesSingleton.getInstance();
const parseClass = async (class2Create, bpsStringed, classes2CreateStringed, updateClasses2Create = null) => {
    // Check if already created CssClass and return if it is
    if (!updateClasses2Create) {
        if (values$h.alreadyCreatedClasses.find((aC) => {
            return aC === class2Create;
        }) ||
            [...values$h.sheet.cssRules].find((i) => i.cssText.split(' ').find((aC) => {
                return aC.replace('.', '') === class2Create;
            }))) {
            return {
                class2Create: class2Create,
                bpsStringed: bpsStringed,
                classes2CreateStringed: classes2CreateStringed,
            };
        }
    }
    else {
        values$h.alreadyCreatedClasses.push(class2Create);
    }
    // Get the class for the final string from the original class2Create after the conversion of the abreviations
    let class2CreateStringed = '.' + class2Create;
    console_log.consoleLog('info', {
        class2CreateStringed: class2CreateStringed,
    });
    // De-abreviate the class if it has abreviations
    if (!class2Create.includes(values$h.indicatorClass)) {
        let abbrClss = Object.keys(values$h.abreviationsClasses).find((aC) => class2Create.includes(aC));
        if (!!abbrClss) {
            class2Create = class2Create.replace(abbrClss, values$h.abreviationsClasses[abbrClss]);
        }
    }
    // Split to decompose and interpret the class to create
    /*
      [0] => indicatorClass
      [1] => css property
      [2] => bp or the first|unique value
     */
    let class2CreateSplited = class2Create.split('-');
    console_log.consoleLog('info', {
        class2CreateSplited: class2CreateSplited,
    });
    // Convert the pseudos from camel case into valid pseudo and separate pseudos and combinators from the property
    let comboCreatedKey = Object.keys(values$h.combosCreated).find((cC) => {
        return class2Create.includes(cC);
    });
    if (!!comboCreatedKey) {
        let comboKeyReg = new RegExp(comboCreatedKey, 'g');
        class2CreateSplited[1] = class2CreateSplited[1].replace(comboKeyReg, values$h.encryptComboCreatedCharacters);
    }
    let classWithPseudosConvertedAndSELSplited = convertPseudos(class2CreateSplited[1])
        .replace(/SEL/g, values$h.separator)
        .split(`${values$h.separator}`);
    console_log.consoleLog('info', {
        classWithPseudosConvertedAndSELSplited: classWithPseudosConvertedAndSELSplited,
    });
    // Declaring the property to create the combinations and use Pseudos
    let property = classWithPseudosConvertedAndSELSplited[0];
    console_log.consoleLog('info', { property: property });
    // Getting the specify to traduce the library abreviations to utilizable css notation
    let specify = abreviation_traductors.abreviationTraductor(classWithPseudosConvertedAndSELSplited
        .map((bs, i) => {
        if (i !== 0) {
            return bs;
        }
        else {
            return '';
        }
    })
        .join(''));
    if (!!comboCreatedKey) {
        let comboKeyCypherReg = new RegExp(values$h.encryptComboCreatedCharacters, 'g');
        class2CreateSplited[1] = class2CreateSplited[1].replace(comboKeyCypherReg, comboCreatedKey);
        specify = specify.replace(comboKeyCypherReg, comboCreatedKey);
        class2Create = class2Create.replace(comboKeyCypherReg, comboCreatedKey);
        class2CreateStringed = class2CreateStringed.replace(comboKeyCypherReg, comboCreatedKey);
    }
    console_log.consoleLog('info', { specify: specify });
    // Decrypt the combo of the class if it has been encrypted with the encryptCombo flag
    if (!!specify && values$h.encryptCombo) {
        console_log.consoleLog('info', {
            specifyPreDecryptCombo: specify,
            class2CreatePreDecryptCombo: class2Create,
            class2CreateStringedPreDecryptCombo: class2CreateStringed,
        });
        [specify, class2Create, class2CreateStringed] = await decryptCombo(specify, class2Create, class2CreateStringed);
        console_log.consoleLog('info', {
            specifyPostDecryptCombo: specify,
            class2CreatePostDecryptCombo: class2Create,
            class2CreateStringedPostDecryptCombo: class2CreateStringed,
        });
    }
    // Getting if the class has breakPoints, the value and the second value if it has
    let [hasBP, propertyValues] = Object.values(await look4BPNVals(class2CreateSplited));
    console_log.consoleLog('info', {
        hasBP: hasBP,
        propertyValues: propertyValues,
    });
    // Traducing the values to the css notation
    propertyValues = await Promise.all(propertyValues.map(async (pv) => {
        return await valueTraductor(pv, property);
    }));
    console_log.consoleLog('info', {
        propertyValues: propertyValues,
    });
    if (!propertyValues[0]) {
        propertyValues[0] = 'default';
    }
    console_log.consoleLog('info', {
        class2CreateStringedBeforeProperty2ValueJoiner: class2CreateStringed,
    });
    // Joining the property and the values
    class2CreateStringed += await property2ValueJoiner(property, class2CreateSplited, class2Create, propertyValues, specify);
    console_log.consoleLog('info', {
        class2CreateStringedAfterProperty2ValueJoiner: class2CreateStringed,
    });
    // Put the important flag if it is active
    if (!!values$h.importantActive) {
        for (let cssProperty of class2CreateStringed.split(';')) {
            if (!cssProperty.includes('!important') && cssProperty.length > 5) {
                class2CreateStringed = class2CreateStringed
                    .replace(cssProperty, cssProperty + ' !important')
                    .replace(/(\s?\!important\s?)+/g, ' !important');
            }
        }
    }
    console_log.consoleLog('info', {
        class2CreateStringedAfterImportant: class2CreateStringed,
    });
    if (class2CreateStringed.includes('{') &&
        class2CreateStringed.includes('}')) {
        if (hasBP === true) {
            class2CreateStringed = class2CreateStringed.replace(new RegExp(values$h.separator, 'g'), '');
            bpsStringed = bpsStringed.map((b) => {
                if (class2CreateSplited[2] === b.bp) {
                    b.class2Create += class2CreateStringed;
                }
                return b;
            });
        }
        else {
            classes2CreateStringed += class2CreateStringed + values$h.separator;
        }
    }
    console_log.consoleLog('info', {
        classes2CreateStringedAfterSeparators: classes2CreateStringed,
    });
    return {
        class2Create: class2Create,
        bpsStringed: bpsStringed,
        classes2CreateStringed: classes2CreateStringed,
    };
};

/* Singletons */
const values$g = ValuesSingleton.getInstance();
const createSimpleRule = (rule) => {
    let originalMediaRules = false;
    let rulesParsed = rule
        .replace(/{/g, values$g.separator)
        .replace(/}/g, values$g.separator)
        .split(values$g.separator)
        .filter((r) => r !== "")
        .map((r) => {
        return r.replace(/\n/g, "").replace(/\s{2}/g, "");
    });
    let mediaRule = rulesParsed[0].includes("media")
        ? rulesParsed[0]
        : "";
    if (mediaRule !== "") {
        if (mediaRule.endsWith(" ")) {
            mediaRule = mediaRule.slice(0, -1);
        }
        rulesParsed.shift();
        [...values$g.sheet.cssRules].forEach((css) => {
            if (css.cssText.includes(mediaRule) && css.cssRules) {
                originalMediaRules = true;
                let i = 0;
                while (i <= rulesParsed.length) {
                    let index = 0;
                    let posibleRule = [...css.cssRules].some((cssRule, ix) => {
                        if (cssRule.cssText.includes(rulesParsed[i])) {
                            index = ix;
                            return true;
                        }
                        else {
                            return false;
                        }
                    })
                        ? [...css.cssRules].find((i) => i.cssText.split(" ").find((aC) => {
                            return aC.replace(".", "") === rulesParsed[i];
                        }))
                        : /* .includes(rulesParsed[i])) */
                            /*
                          i.cssText.split(' ').find((aC: string) => {
                              return aC.replace('.', '') === class2Create;
                            })
                          */
                            undefined;
                    if (!!posibleRule) {
                        css.deleteRule(index);
                    }
                    let newRule = `${rulesParsed[i]}{${rulesParsed[i + 1]}}`;
                    console_log.consoleLog("info", { newRule: newRule });
                    css.insertRule(newRule, css.cssRules.length);
                    i = i + 2;
                }
            }
        });
    }
    if (originalMediaRules === false) {
        console_log.consoleLog("info", { rule: rule });
        values$g.sheet.insertRule(rule, values$g.sheet.cssRules.length);
    }
};

/* Singletons */
const values$f = ValuesSingleton.getInstance();
const createMediaRule = (rule) => {
    let index;
    let originalRule = [...values$f.sheet.cssRules].some((cssRule, i) => {
        if (cssRule.cssText.includes(rule.split("{")[0].replace("\n", "").replace(/\s+/g, " "))) {
            index = i;
            return true;
        }
        else {
            return false;
        }
    })
        ? [...values$f.sheet.cssRules].find((i) => i.cssText
            /* .includes(
                    rule.split('{')[0].replace('\n', '').replace(/\s+/g, ' ')
                  ) */
            .split(" ")
            .find((aC) => {
            return (aC.replace(".", "") ===
                rule.split("{")[0].replace("\n", "").replace(/\s+/g, " "));
        })
        /*
            i.cssText.split(' ').find((aC: string) => {
                return aC.replace('.', '') === class2Create;
              })
            */
        )
        : undefined;
    if (originalRule) {
        values$f.sheet.deleteRule(index);
    }
    console_log.consoleLog("info", { rule: rule });
    values$f.sheet.insertRule(rule, values$f.sheet.cssRules.length);
};

/* Singletons */
const values$e = ValuesSingleton.getInstance();
const manage_CSSRules = {
    createCSSRules(rules, dontSplitted = false) {
        try {
            if (!!dontSplitted && !Array.isArray(rules)) {
                for (let rule of rules.split(values$e.separator)) {
                    if (rule !== "") {
                        manage_CSSRules.createCSSRule(rule);
                    }
                }
            }
            else if (Array.isArray(rules)) {
                rules.forEach((rule) => {
                    manage_CSSRules.createCSSRule(rule);
                });
            }
            else {
                manage_CSSRules.createCSSRule(rules);
            }
        }
        catch (err) {
            console_log.consoleLog("error", { err: err });
        }
    },
    createCSSRule(rule) {
        try {
            console_log.consoleLog("info", { rule: rule });
            if (rule && !rule.split("{")[0].includes("@media")) {
                createMediaRule(rule);
            }
            else {
                createSimpleRule(rule);
            }
            console_log.consoleLog("info", { sheet: values$e.sheet });
        }
        catch (err) {
            console_log.consoleLog("error", { err: err });
        }
    },
};

const values$d = ValuesSingleton.getInstance();
const send2CreateRules = async (classes2CreateStringed, bpsStringed) => {
    bpsStringed = bpsStringed
        .sort((b1, b2) => {
        return (parseInt(b1.value.replace("px", "")) -
            parseInt(b2.value.replace("px", "")));
    })
        .reverse();
    for (const [i, b] of bpsStringed.entries()) {
        if (b.class2Create !== "") {
            await console_log.consoleLog("info", {
                bp: b.bp,
                value: b.value,
                class2Create: b.class2Create,
            });
            for (const specifyOption of values$d.bpsSpecifyOptions) {
                classes2CreateStringed += `@media only screen and (min-width: ${b.value})${values$d.limitBPS
                    ? bpsStringed.length > 1 && i !== 0
                        ? `and (max-width: ${bpsStringed[i - 1].value})`
                        : ""
                    : ""} { ${specifyOption} ${b.class2Create}}${values$d.separator}`;
            }
            b.class2Create = "";
        }
    }
    if (classes2CreateStringed !== "") {
        await console_log.consoleLog("info", {
            classes2CreateStringed: classes2CreateStringed,
        });
        for (const class2Create of classes2CreateStringed.split(values$d.separator)) {
            if (class2Create !== "") {
                await manage_CSSRules.createCSSRules(class2Create);
            }
        }
    }
};

/* Singletons */
const values$c = ValuesSingleton.getInstance();
const doCssCreate = {
    async start(updateClasses2Create = null) {
        try {
            if (!values$c.sheet) {
                manage_sheet.checkSheet();
                if (!values$c.sheet) {
                    throw new Error(`There is no ${values$c.styleSheetToManage} style sheet!`);
                }
            }
            const startTimeCSSCreate = performance.now();
            let classes2Create = [];
            if (!updateClasses2Create) {
                classes2Create = await getNewClasses2Create(classes2Create);
            }
            else {
                classes2Create = updateClasses2Create;
            }
            console_log.consoleLog("info", { classes2Create: classes2Create });
            let classes2CreateStringed = "";
            let bpsStringed = values$c.bps.map((b) => b);
            for (let class2Create of classes2Create) {
                [class2Create, bpsStringed, classes2CreateStringed] = Object.values(await parseClass(class2Create, bpsStringed, classes2CreateStringed, updateClasses2Create));
            }
            console_log.consoleLog("info", {
                classes2CreateStringed: classes2CreateStringed,
                bpsStringed: bpsStringed,
            });
            send2CreateRules(classes2CreateStringed, bpsStringed);
            const endTimeCSSCreate = await performance.now();
            console_log.consoleLog("info", `Call to cssCreate() took ${endTimeCSSCreate - startTimeCSSCreate} milliseconds`);
            let class2CreateTimer = document.getElementById(values$c.indicatorClass + "Timer");
            if (class2CreateTimer) {
                class2CreateTimer.innerHTML = `
            <p>
            Call to cssCreate() took ${endTimeCSSCreate - startTimeCSSCreate} milliseconds
            </p>
            `;
            }
            return Date.now();
        }
        catch (err) {
            console_log.consoleLog("error", { err: err });
            return Date.now();
        }
    },
};

/* Singletons */
const values$b = ValuesSingleton.getInstance();
const timeManagerCssCreate = {
    delayedCssCreate(updateClasses2Create = null, primordial = false) {
        if (Date.now() - values$b.lastCSSCreate >= values$b.timeBetweenReCreate ||
            primordial === true ||
            values$b.timesCSSCreated === 0) {
            values$b.timesCSSCreated++;
            doCssCreate.start(updateClasses2Create);
            values$b.lastCSSCreate = Date.now();
            console_log.consoleParser({
                thing: { timesCSSCreated: values$b.timesCSSCreated },
            });
        }
        else {
            if (Date.now() - values$b.timeBetweenReCreate <
                values$b.lastTimeAsked2Create) {
                this.handleDelayedCssCreate(updateClasses2Create, primordial);
            }
        }
    },
    handleDelayedCssCreate(updateClasses2Create = null, primordial = false) {
        setTimeout(() => {
            this.delayedCssCreate(updateClasses2Create, primordial);
        }, values$b.timeBetweenReCreate);
    },
};

/* Singletons */
const values$a = ValuesSingleton.getInstance();
const doUseTimer = (updateClasses2Create = null, primordial = false) => {
    values$a.lastTimeAsked2Create = Date.now();
    timeManagerCssCreate.delayedCssCreate(updateClasses2Create, primordial);
};

/* Singletons */
const values$9 = ValuesSingleton.getInstance();
const doUseRecurrentStrategy = async (updateClasses2Create = null, primordial = false, recurrent = false) => {
    if (!recurrent) {
        values$9.lastTimeAsked2Create = Date.now();
    }
    console_log.consoleLog("info", { useRecurrentStrategy: values$9.useRecurrentStrategy });
    // Crea una condición que pase si values.lastTimeCssCreateEnded más values.timeBetweenReCreate es menor que lastTimeAsked2Create
    if ((values$9.lastTimeCssCreateEnded + values$9.timeBetweenReCreate < values$9.lastTimeAsked2Create ||
        primordial === true ||
        values$9.timesCSSCreated === 0) && !values$9.cssCreateIsActive) {
        console_log.consoleLog("info", { recurrent: recurrent });
        console_log.consoleLog("info", { lastTimeAsked2Create: values$9.lastTimeAsked2Create });
        console_log.consoleLog("info", { creationPostponed: false });
        console_log.consoleLog("info", { lastTimeCssCreateEnded: values$9.lastTimeCssCreateEnded });
        console_log.consoleLog("info", { timeBetweenReCreate: values$9.timeBetweenReCreate });
        console_log.consoleLog("info", { cssCreateIsActive: values$9.cssCreateIsActive });
        console_log.consoleLog("info", { timesCSSCreated: values$9.timesCSSCreated });
        console_log.consoleLog("info", { updateClasses2Create: updateClasses2Create });
        console_log.consoleLog("info", { primordial: primordial });
        values$9.timesCSSCreated++;
        values$9.cssCreateIsActive = true;
        const lastTimeCssCreateEnded = await doCssCreate.start(updateClasses2Create);
        values$9.lastTimeCssCreateEnded = lastTimeCssCreateEnded;
        console_log.consoleLog("info", { lastTimeCssCreateEnded: values$9.lastTimeCssCreateEnded });
        values$9.cssCreateIsActive = false;
        doUseRecurrentStrategy(updateClasses2Create, false, true);
    }
    else if (!recurrent) {
        console_log.consoleLog("info", { creationPostponed: true });
    }
};

/* Singletons */
const values$8 = ValuesSingleton.getInstance();
const cssCreate = {
    cssCreate(updateClasses2Create = null, primordial = false) {
        try {
            if (!values$8.sheet) {
                manage_sheet.checkSheet();
                if (!values$8.sheet) {
                    throw new Error(`There is no ${values$8.styleSheetToManage} style sheet!`);
                }
            }
            if (!!values$8.useTimer) {
                doUseTimer(updateClasses2Create, primordial);
            }
            else if (!!values$8.useRecurrentStrategy) {
                doUseRecurrentStrategy(updateClasses2Create, primordial);
            }
            else {
                doCssCreate.start(updateClasses2Create);
            }
        }
        catch (err) {
            console_log.consoleLog("error", { err: err });
        }
    },
};

const values$7 = ValuesSingleton.getInstance();
const debugg_options = {
    changeDebugOption(option) {
        values$7.isDebug = option || !values$7.isDebug;
    },
    changeUseTimerOption(option) {
        values$7.useTimer = option || !values$7.useTimer;
    },
    setTimeBetweenReCreate(time) {
        values$7.timeBetweenReCreate = time;
    },
};

/* Singletons */
const values$6 = ValuesSingleton.getInstance();
const manage_abreviations = {
    pushAbreviationsValues(abreviationsValues) {
        try {
            let prevIgnoredAbreviationsValues = [];
            Object.keys(abreviationsValues).forEach((key) => {
                values$6.abreviationsValues[key] = abreviationsValues[key];
                prevIgnoredAbreviationsValues = values$6.alreadyCreatedClasses.filter((aC) => {
                    return aC.includes(key);
                });
            });
            if (prevIgnoredAbreviationsValues.length > 0) {
                cssCreate.cssCreate(prevIgnoredAbreviationsValues);
            }
        }
        catch (err) {
            console_log.consoleLog("error", { err: err });
        }
    },
    pushAbreviationsClasses(abreviationsClasses) {
        let prevIgnoredAbreviationsValues = [];
        try {
            Object.keys(abreviationsClasses).forEach((key) => {
                values$6.abreviationsClasses[key] = abreviationsClasses[key];
                prevIgnoredAbreviationsValues = values$6.alreadyCreatedClasses.filter((aC) => {
                    return aC.includes(key);
                });
            });
            if (prevIgnoredAbreviationsValues.length > 0) {
                cssCreate.cssCreate(prevIgnoredAbreviationsValues);
            }
            else {
                cssCreate.cssCreate();
            }
        }
        catch (err) {
            console_log.consoleLog("error", { err: err });
        }
    },
    getAbreviationsClasses() {
        console_log.consoleLog("info", {
            abreviationsClasses: values$6.abreviationsClasses,
        });
        return values$6.abreviationsClasses;
    },
    getAbreviationsValues() {
        console_log.consoleLog("info", {
            abreviationsValues: values$6.abreviationsValues,
        });
        return values$6.abreviationsValues;
    },
    updateAbreviationsClass(abreviationsClass, value) {
        try {
            if (values$6.abreviationsClasses[abreviationsClass.toString()]) {
                values$6.abreviationsClasses[abreviationsClass] = value;
                let classesToUpdate = [];
                for (let createdClass of values$6.alreadyCreatedClasses) {
                    if (createdClass.includes(abreviationsClass)) {
                        classesToUpdate.push(createdClass);
                    }
                }
                if (classesToUpdate.length > 0) {
                    cssCreate.cssCreate(classesToUpdate);
                }
            }
            else {
                throw new Error(`There is no abreviationsClass named ${abreviationsClass}.`);
            }
        }
        catch (err) {
            console_log.consoleLog("error", { err: err });
        }
    },
    updateAbreviationsValue(abreviationsValue, value) {
        try {
            if (values$6.abreviationsValues[abreviationsValue.toString()]) {
                values$6.abreviationsValues[abreviationsValue] = value;
                let classesToUpdate = [];
                for (let createdClass of values$6.alreadyCreatedClasses) {
                    if (createdClass.includes(abreviationsValue)) {
                        classesToUpdate.push(createdClass);
                    }
                }
                if (classesToUpdate.length > 0) {
                    cssCreate.cssCreate(classesToUpdate);
                }
            }
            else {
                throw new Error(`There is no abreviationsValue named ${abreviationsValue}.`);
            }
        }
        catch (err) {
            console_log.consoleLog("error", { err: err });
        }
    },
};

/* Singletons */
const values$5 = ValuesSingleton.getInstance();
const manage_bps = {
    pushBPS(bps) {
        try {
            for (let nb of bps) {
                let bp = values$5.bps.find((b) => b.bp === nb.bp);
                if (bp) {
                    bp.value = nb.value;
                    bp.class2Create = "";
                }
                else {
                    values$5.bps.push({
                        bp: nb.bp,
                        value: nb.value,
                    });
                }
            }
            cssCreate.cssCreate();
        }
        catch (err) {
            console_log.consoleLog("error", { err: err });
        }
    },
    getBPS() {
        console_log.consoleLog("info", { bps: values$5.bps });
        return values$5.bps;
    },
};

/* Singletons */
const values$4 = ValuesSingleton.getInstance();
const manage_classes = {
    getAlreadyCreatedClasses() {
        console_log.consoleLog("info", {
            alreadyCreatedClasses: values$4.alreadyCreatedClasses,
        });
        return values$4.alreadyCreatedClasses;
    },
    updateClasses(classesToUpdate) {
        cssCreate.cssCreate(classesToUpdate);
    },
};

/* Singletons */
const values$3 = ValuesSingleton.getInstance();
const manage_colors = {
    pushColors(newColors) {
        const errors = [];
        try {
            Object.keys(newColors).forEach((key) => {
                const cleanedValue = newColors[key].replace(/!important|!default|(\s{2,})/g, "");
                if (!!values$3.commonPropertiesValuesAbreviationsValues.find((abbreviation) => abbreviation === cleanedValue)) {
                    errors.push(`The color name "${key}" is a reserved abbreviation and cannot be used.`);
                    delete newColors[key];
                }
                values$3.colors[key] = cleanedValue;
            });
            for (let color in newColors) {
                let classesToUpdate = [];
                for (let createdClass of values$3.alreadyCreatedClasses) {
                    if (createdClass.includes(color)) {
                        classesToUpdate.push(createdClass);
                    }
                }
                if (classesToUpdate.length > 0) {
                    cssCreate.cssCreate(classesToUpdate);
                }
            }
        }
        catch (err) {
            console_log.consoleLog("error", { err: err });
            if (err instanceof Error) {
                errors.push(`Error while pushing colors: ${err.message}`);
            }
        }
        if (errors.length > 0) {
            return { errors };
        }
        else {
            console_log.consoleLog("info", { colors: values$3.colors });
            return {
                success: true,
                message: "Colors added successfully.",
            };
        }
    },
    getColors() {
        console_log.consoleLog("info", { colors: values$3.colors });
        return values$3.colors;
    },
    getColorsNames() {
        return Object.keys(values$3.colors);
    },
    getColorValue(color) {
        console_log.consoleLog("info", {
            color: color,
            colorValue: values$3.colors[color],
        });
        return values$3.colors[color];
    },
    updateColor(color, value) {
        try {
            if (values$3.colors[color.toString()]) {
                values$3.colors[color] = value.replace(/!important|!default|(\s{2,})/g, "");
                let classesToUpdate = [];
                for (let createdClass of values$3.alreadyCreatedClasses) {
                    if (createdClass.includes(color)) {
                        classesToUpdate.push(createdClass);
                    }
                }
                if (classesToUpdate.length > 0) {
                    cssCreate.cssCreate(classesToUpdate);
                }
            }
            else {
                throw new Error(`There is no color named ${color}.`);
            }
        }
        catch (err) {
            console_log.consoleLog("error", { err: err });
        }
    },
    deleteColor(color) {
        try {
            if (!!values$3.colors[color.toString()]) {
                delete values$3.colors[color];
            }
            else {
                throw new Error(`There is no color named ${color}.`);
            }
        }
        catch (err) {
            console_log.consoleLog("error", { err: err });
        }
    },
    clearAllColors() {
        values$3.colors = {};
        console_log.consoleLog("info", { colors: values$3.colors });
    },
};

/* Singletons */
const values$2 = ValuesSingleton.getInstance();
const manage_combos = {
    pushCombos(combos) {
        try {
            let prevIgnoredCombosValues = [];
            Object.keys(combos).forEach((key) => {
                values$2.combos[key] =
                    typeof combos[key] === "string"
                        ? combos[key].split(" ")
                        : combos[key]
                            .map((c) => {
                            return c.split(" ").flat();
                        })
                            .flat();
                prevIgnoredCombosValues = values$2.alreadyCreatedClasses.filter((aC) => {
                    return aC.includes(key);
                });
            });
            if (prevIgnoredCombosValues.length > 0) {
                cssCreate.cssCreate(prevIgnoredCombosValues);
            }
            else {
                cssCreate.cssCreate();
            }
        }
        catch (err) {
            console_log.consoleLog("error", { err: err });
        }
    },
    getCombos() {
        console_log.consoleLog("info", { combos: values$2.combos });
        return values$2.combos;
    },
    updateCombo(combo, newValues) {
        try {
            if (values$2.combos[combo.toString()]) {
                values$2.combos[combo] = newValues;
                let classes2Delete = [];
                for (let createdClass of values$2.alreadyCreatedClasses) {
                    if (createdClass.includes(combo)) {
                        classes2Delete.push(createdClass);
                    }
                }
                if (classes2Delete.length > 0) {
                    for (let class2Delete of classes2Delete) {
                        values$2.sheet.deleteRule([...values$2.sheet.cssRules].findIndex((cssRule) => {
                            return cssRule.cssText.includes(class2Delete);
                        }));
                        values$2.alreadyCreatedClasses = values$2.alreadyCreatedClasses.filter((aC) => {
                            return aC !== class2Delete;
                        });
                    }
                    cssCreate.cssCreate();
                }
            }
            else {
                throw new Error(`There is no combo named ${combo}.`);
            }
        }
        catch (err) {
            console_log.consoleLog("error", { err: err });
        }
    },
};

/* Singletons */
const values$1 = ValuesSingleton.getInstance();
const manage_CSSNamesParsed = {
    pushCssNamesParsed(cssNamesParsed) {
        try {
            Object.keys(cssNamesParsed).forEach((key) => {
                values$1.cssNamesParsed[key] = cssNamesParsed[key];
            });
            cssCreate.cssCreate();
        }
        catch (err) {
            console_log.consoleLog("error", { err: err });
        }
    },
    getCssNamesParsed() {
        console_log.consoleLog("info", { cssNamesParsed: values$1.cssNamesParsed });
        return values$1.cssNamesParsed;
    },
    updateCssNamesParsed(cssNameParsed, value) {
        try {
            if (values$1.cssNamesParsed[cssNameParsed.toString()]) {
                values$1.cssNamesParsed[cssNameParsed] = value;
                let classesToUpdate = [];
                for (let createdClass of values$1.alreadyCreatedClasses) {
                    if (createdClass.includes(cssNameParsed)) {
                        classesToUpdate.push(createdClass);
                    }
                }
                if (classesToUpdate.length > 0) {
                    cssCreate.cssCreate(classesToUpdate);
                }
            }
            else {
                throw new Error(`There is no cssNameParsed named ${cssNameParsed}.`);
            }
        }
        catch (err) {
            console_log.consoleLog("error", { err: err });
        }
    },
};

const values = ValuesSingleton.getInstance();
const utility_configurations = {
    changeImportantActive(option) {
        values.importantActive = option || !values.importantActive;
        cssCreate.cssCreate();
    },
};

class NgxAngoraService {
    constructor() {
        this.values = ValuesSingleton.getInstance();
        this.indicatorClass = this.values.indicatorClass;
        this.colors = this.values.colors;
        this.abreviationsClasses = this.values.abreviationsClasses;
        this.abreviationsValues = this.values.abreviationsValues;
        this.combos = this.values.combos;
        this.combosCreated = this.values.combosCreated;
        this.encryptCombo = this.values.encryptCombo;
        this.encryptComboCharacters = this.values.encryptComboCharacters;
        this.encryptComboCreatedCharacters = this.values.encryptComboCreatedCharacters;
        this.cssNamesParsed = this.values.cssNamesParsed;
        this.alreadyCreatedClasses = this.values.alreadyCreatedClasses;
        this.sheet = this.values.sheet;
        this.isDebug = this.values.isDebug;
        this.bps = this.values.bps;
        this.bpsSpecifyOptions = this.values.bpsSpecifyOptions;
        this.limitBPS = this.values.limitBPS;
        this.styleSheetToManage = this.values.styleSheetToManage;
        this.separator = this.values.separator;
        this.styleConsole = this.values.styleConsole;
        this.pseudoClasses = this.values.pseudoClasses;
        this.pseudosHasSDED = this.values.pseudosHasSDED;
        this.pseudoElements = this.values.pseudoElements;
        this.pseudos = this.values.pseudos;
        this.importantActive = this.values.importantActive;
        this.abreviationTraductors = this.values.abreviationTraductors;
        this.lastCSSCreate = this.values.lastCSSCreate;
        this.lastTimeAsked2Create = this.values.lastTimeAsked2Create;
        this.timesCSSCreated = this.values.timesCSSCreated;
        this.timeBetweenReCreate = this.values.timeBetweenReCreate;
        this.useTimer = this.values.useTimer;
        this.checkSheet = () => manage_sheet.checkSheet();
        this.cssCreate = (updateBefs = null, primordial = false) => cssCreate.cssCreate(updateBefs, primordial);
        this.createCSSRules = (rule) => manage_CSSRules.createCSSRules(rule);
        this.colorToRGB = (color) => color_transform.colorToRGB(color);
        this.RGBToRGBA = (rgb, alpha) => color_transform.RGBToRGBA(rgb, alpha);
        this.parseRGB = (rgba) => color_transform.parseRGB(rgba);
        this.HexToRGB = (Hex) => color_transform.HexToRGB(Hex);
        this.HSLToRGB = (HSL) => color_transform.HSLToRGB(HSL);
        this.HWBToRGB = (HWB) => color_transform.HWBToRGB(HWB);
        this.shadeTintColor = (rgb, percent) => color_transform.shadeTintColor(rgb, percent);
        this.cssValidToCamel = (st) => css_camel.cssValidToCamel(st);
        this.camelToCSSValid = (st) => css_camel.camelToCSSValid(st);
        /* CRUD */
        this.pushCssNamesParsed = (cssNamesParsed) => manage_CSSNamesParsed.pushCssNamesParsed(cssNamesParsed);
        this.pushBPS = (bps) => manage_bps.pushBPS(bps);
        this.pushColors = (newColors) => manage_colors.pushColors(newColors);
        this.pushAbreviationsValues = (abreviationsValues) => manage_abreviations.pushAbreviationsValues(abreviationsValues);
        this.pushAbreviationsClasses = (abreviationsClasses) => manage_abreviations.pushAbreviationsClasses(abreviationsClasses);
        this.pushCombos = (combos) => manage_combos.pushCombos(combos);
        /* Getters */
        this.getColors = () => manage_colors.getColors();
        this.getBPS = () => manage_bps.getBPS();
        this.getAbreviationsValues = () => manage_abreviations.getAbreviationsValues();
        this.getAbreviationsClasses = () => manage_abreviations.getAbreviationsClasses();
        this.getCombos = () => manage_combos.getCombos();
        this.getCssNamesParsed = () => manage_CSSNamesParsed.getCssNamesParsed();
        this.getColorsNames = () => manage_colors.getColorsNames();
        this.getColorValue = (color) => manage_colors.getColorValue(color);
        this.getAlreadyCreatedClasses = () => manage_classes.getAlreadyCreatedClasses();
        this.getSheet = () => manage_sheet.getSheet();
        /* Update */
        this.updateColor = (color, value) => manage_colors.updateColor(color, value);
        this.updateAbreviationsClass = (abreviationsClass, value) => manage_abreviations.updateAbreviationsClass(abreviationsClass, value);
        this.updateAbreviationsValue = (abreviationsValue, value) => manage_abreviations.updateAbreviationsValue(abreviationsValue, value);
        this.updateCombo = (combo, values) => manage_combos.updateCombo(combo, values);
        this.updateCssNamesParsed = (cssNameParsed, value) => manage_CSSNamesParsed.updateCssNamesParsed(cssNameParsed, value);
        this.updateClasses = (classesToUpdate) => manage_classes.updateClasses(classesToUpdate);
        /* Delete */
        this.deleteColor = (color) => manage_colors.deleteColor(color);
        this.clearAllColors = () => manage_colors.clearAllColors();
        /* Utility */
        this.changeImportantActive = (active) => utility_configurations.changeImportantActive((active = !this.importantActive));
        this.changeDebugOption = (active = !this.isDebug) => debugg_options.changeDebugOption(active);
        this.changeUseTimerOption = (active = !this.useTimer) => debugg_options.changeUseTimerOption(active);
        this.setTimeBetweenReCreate = (time) => debugg_options.setTimeBetweenReCreate(time);
        this.unbefysize = (value) => abreviation_traductors.unbefysize(value);
        this.befysize = (value) => abreviation_traductors.befysize(value);
        this.consoleLog = (type = 'log', thing, style = this.values.styleConsole, line = null, stoper = !this.values.isDebug) => console_log.consoleLog(type, thing, style, line, stoper);
        this.consoleParser = (config) => console_log.consoleParser(config);
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NgxAngoraService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
    static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NgxAngoraService, providedIn: 'root' }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NgxAngoraService, decorators: [{
            type: Injectable,
            args: [{
                    providedIn: 'root',
                }]
        }], ctorParameters: () => [] });

class ItExistsDirective {
    constructor() { }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ItExistsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
    static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.14", type: ItExistsDirective, isStandalone: true, selector: "[libItExists]", ngImport: i0 }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ItExistsDirective, decorators: [{
            type: Directive,
            args: [{
                    selector: '[libItExists]',
                    standalone: true
                }]
        }], ctorParameters: () => [] });

const LOG_TYPES = {
    log: "log",
    info: "info",
    trace: "trace",
    error: "error",
};

/*
 * Public API Surface of ngx-angora-css-library
 */

/**
 * Generated bundle index. Do not edit.
 */

export { ItExistsDirective, NgxAngoraService };
//# sourceMappingURL=ngx-angora-css.mjs.map