// functions to urlencode the svg string
@function str-replace($string, $search, $replace: '') {
  $index: str-index($string, $search);
  @if $index {
    @return str-slice($string, 1, $index - 1) + $replace + str-replace(str-slice($string, $index + str-length($search)), $search, $replace);
  }
  @return $string;
}

@function url-encode($string) {
  $map: (
    "%": "%25",
    "<": "%3C",
    ">": "%3E",
    " ": "%20",
    "!": "%21",
    "*": "%2A",
    "'": "%27",
    '"': "%22",
    "(": "%28",
    ")": "%29",
    ";": "%3B",
    ":": "%3A",
    "@": "%40",
    "&": "%26",
    "=": "%3D",
    "+": "%2B",
    "$": "%24",
    ",": "%2C",
    "/": "%2F",
    "?": "%3F",
    "#": "%23",
    "[": "%5B",
    "]": "%5D"
  );
  $new: $string;
  @each $search, $replace in $map {
    $new: str-replace($new, $search, $replace);
  }
  @return $new;
}

@function inline-svg($string) {
  @return url('data:image/svg+xml;charset=US-ASCII,#{url-encode($string)}');
}

@function sai-input-select-svg($color) {
  @return inline-svg(
    '<svg width="7px" height="15px" viewBox="0 0 7 15" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
        <g id="Kerrn---Dashboard-(white)" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
            <g id="button-selector-gray" transform="translate(-103.000000, -38.000000)" fill="' + $color + '">
                <g id="Group" transform="translate(15.000000, 32.000000)">
                    <g id="Group-2" transform="translate(88.000000, 6.000000)">
                        <polygon id="Triangle" points="3.3778626 0.303030303 6.18320611 5.81818182 0.572519084 5.81818182"></polygon>
                        <polygon id="Triangle" transform="translate(3.377863, 11.727273) scale(-1, -1) translate(-3.377863, -11.727273) " points="3.3778626 8.96969697 6.18320611 14.4848485 0.572519084 14.4848485"></polygon>
                    </g>
                </g>
            </g>
        </g>
    </svg>'
    );
}

@function sai-hexagon-svg(
    $width: '178px',
    $height: '206px',
    $border-color: '#179AEE',
    $background-color: '#FF0000'
) {
    @return inline-svg(
        '<svg width="' + $width + '" height="' + $height + '" viewBox="0 0 178 206" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
            <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
                <g transform="translate(-734.000000, -391.000000)" stroke="' + $border-color + '" stroke-width="2" fill="' + $background-color + '">
                    <path d="M910.261086,451.713014 C909.993898,450.516811 909.645336,449.312836 909.223731,448.119871 C908.802125,446.926258 908.308116,445.743655 907.750674,444.587606 C907.193232,443.431557 906.571716,442.302061 905.897019,441.217253 C904.209955,438.50491 902.185864,436.067816 899.969551,434.170859 C899.08341,433.411817 898.166514,432.73956 897.227832,432.170926 L836.588381,395.413097 C836.129613,395.134609 835.603567,394.926715 835.110839,394.682552 C833.589727,393.928044 831.967378,393.282988 830.211115,392.852951 C827.886517,392.284317 825.412628,392 822.938738,392 C817.990958,392 813.042538,393.137267 809.289095,395.413097 L748.649643,432.170926 C741.142115,436.721939 735,447.891899 735,456.993924 L735,530.508934 C735,539.610311 741.142115,550.780271 748.649643,555.331284 L809.289095,592.089113 C810.227776,592.657746 811.240783,593.155787 812.309534,593.582586 C813.378926,594.008737 814.504062,594.364295 815.666361,594.648612 C817.990958,595.217893 820.464848,595.50221 822.938738,595.50221 C825.412628,595.50221 827.886517,595.217893 830.211115,594.648612 C832.536353,594.079978 834.711659,593.227028 836.588381,592.089113 L897.227832,555.331284 C898.166514,554.76265 899.08341,554.089745 899.969551,553.331351 C902.185864,551.434395 904.209955,548.9973 905.897019,546.284957 C906.571716,545.199501 907.193232,544.070653 907.750674,542.914604 C908.308116,541.758555 908.802125,540.575304 909.223731,539.382339 C909.645336,538.188727 909.993898,536.9854 910.261086,535.789196 C910.661547,533.994568 910.877476,532.215483 910.877476,530.508934 L910.877476,528.969478 L910.877476,518.047566 L910.877476,508.229244 L910.877476,503.79416 L910.877476,493.22133 L910.877476,491.291343 L910.877476,485.159426 L910.877476,466.502023 L910.877476,456.993924 C910.877476,455.286728 910.661547,453.507642 910.261086,451.713014"></path>
                </g>
            </g>
        </svg>'
    );
}

@function sai-arrow-small-up-svg(
    $width: '30px',
    $height: '30px',
    $color: $primary-color
) {
    @return inline-svg(
        '<svg width="' + $width + '" height="' + $height + '" viewBox="0 0 25 25" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
            <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
                <g transform="translate(-13.000000, -12.000000)">
                    <g transform="translate(25.500000, 24.500000) scale(-1, -1) translate(-25.500000, -24.500000) translate(13.000000, 12.000000)">
                        <g>
                            <g>
                                <circle fill="#FFFFFF" cx="12.5" cy="12.5" r="12.5"></circle>
                                <polygon fill="' + $color + '" transform="translate(12.362069, 13.224138) scale(-1, -1) translate(-12.362069, -13.224138) " points="12.362069 9.34482759 16.2413793 17.1034483 8.48275862 17.1034483"></polygon>
                            </g>
                        </g>
                    </g>
                </g>
            </g>
        </svg>'
    );
}

@function sai-arrow-small-down-svg(
    $width: '30px',
    $height: '30px',
    $color: $primary-color
) {
    @return inline-svg(
        '<svg width="' + $width + '" height="' + $height + '" viewBox="0 0 25 25" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
            <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
                <g transform="translate(-13.000000, -12.000000)">
                    <g transform="translate(13.000000, 12.000000)">
                        <g>
                            <g>
                                <circle fill="#FFFFFF" cx="12.5" cy="12.5" r="12.5"></circle>
                                <polygon fill="' + $color + '" transform="translate(12.362069, 13.224138) scale(-1, -1) translate(-12.362069, -13.224138) " points="12.362069 9.34482759 16.2413793 17.1034483 8.48275862 17.1034483"></polygon>
                            </g>
                        </g>
                    </g>
                </g>
            </g>
        </svg>'
    );
}

@function sai-arrow-left-svg(
    $width: '30px',
    $height: '30px',
    $color: $primary-color
) {
    @return inline-svg(
        '<svg width="' + $width + '" height="' + $height + '" viewBox="0 0 36 36" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
            <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
                <g transform="translate(-8.000000, -6.000000)">
                    <g transform="translate(26.399998, 23.999999) scale(-1, 1) translate(-26.399998, -23.999999) translate(8.799999, 6.400000)">
                        <circle fill="#FFFFFF" cx="17.599999" cy="17.599999" r="17.599999"></circle>
                        <polygon fill="' + $color + '" fill-rule="nonzero" transform="translate(17.726485, 16.881282) scale(-1, 1) rotate(45.000000) translate(-17.726485, -16.881282) " points="23.623528 11.7933811 22.7476108 10.9058431 13.0682949 20.7138294 13.0682949 12.640759 11.8294411 12.640759 11.8294411 22.8567208 21.9115795 22.8567208 21.9115795 21.6013674 13.9442121 21.6013674"></polygon>
                    </g>
                </g>
            </g>
        </svg>'
    );
}

@function sai-arrow-right-svg(
    $width: '30px',
    $height: '30px',
    $color: $primary-color
) {
    @return inline-svg(
        '<svg width="' + $width + '" height="' + $height + '" viewBox="0 0 36 36" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
            <defs></defs>
            <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
                <g transform="translate(-8.000000, -6.000000)">
                    <g transform="translate(8.799999, 6.400000)">
                        <circle fill="#FFFFFF" cx="17.599999" cy="17.599999" r="17.599999"></circle>
                        <polygon fill="' + $color + '" fill-rule="nonzero" transform="translate(17.726485, 16.881282) scale(-1, 1) rotate(45.000000) translate(-17.726485, -16.881282) " points="23.623528 11.7933811 22.7476108 10.9058431 13.0682949 20.7138294 13.0682949 12.640759 11.8294411 12.640759 11.8294411 22.8567208 21.9115795 22.8567208 21.9115795 21.6013674 13.9442121 21.6013674"></polygon>
                    </g>
                </g>
            </g>
        </svg>'
    );
}

@function sai-arrow-gray-right-svg(
    $width: '11px',
    $height: '19px',
    $color: $primary-color
) {
    @return inline-svg(
        '<svg width="' + $width + '" height="' + $height + '" viewBox="0 0 11 19" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
            <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" fill-opacity="0.251868207">
                <g transform="translate(-227.000000, -166.000000)" stroke="#FFFFFF" stroke-width="0.5" fill="' + $color + '">
                    <g transform="translate(-1.000000, 0.000000)">
                        <path d="M229.823903,167.141615 C229.634664,166.952795 229.331168,166.952795 229.141929,167.141615 C228.95269,167.330434 228.95269,167.633258 229.141929,167.822078 L236.836447,175.499555 L229.141929,183.177031 C228.95269,183.365851 228.95269,183.668675 229.141929,183.857495 C229.234763,183.950123 229.359732,184 229.481131,184 C229.602529,184 229.727498,183.953686 229.820332,183.857495 L237.857621,175.838005 C238.04686,175.652748 238.04686,175.346361 237.861192,175.161104 L229.823903,167.141615 Z"></path>
                    </g>
                </g>
            </g>
        </svg>'
    );
}

@function sai-arrow-gray-down-svg(
    $width: '19px',
    $height: '11px',
    $color: $primary-color
) {
    @return inline-svg(
        '<svg width="' + $width + '" height="' + $height + '" viewBox="0 0 19 11" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
            <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" fill-opacity="0.251868207">
                <g transform="translate(-223.000000, -170.000000)" stroke="#FFFFFF" stroke-width="0.5" fill="' + $color + '">
                    <g transform="translate(-1.000000, 0.000000)">
                        <path d="M229.823903,167.141615 C229.634664,166.952795 229.331168,166.952795 229.141929,167.141615 C228.95269,167.330434 228.95269,167.633258 229.141929,167.822078 L236.836447,175.499555 L229.141929,183.177031 C228.95269,183.365851 228.95269,183.668675 229.141929,183.857495 C229.234763,183.950123 229.359732,184 229.481131,184 C229.602529,184 229.727498,183.953686 229.820332,183.857495 L237.857621,175.838005 C238.04686,175.652748 238.04686,175.346361 237.861192,175.161104 L229.823903,167.141615 Z" transform="translate(233.500000, 175.500000) rotate(90.000000) translate(-233.500000, -175.500000) "></path>
                    </g>
                </g>
            </g>
        </svg>'
    );
}




@function sai-icon-close-svg(
    $width: '30px',
    $height: '30px',
    $color: $primary-color
) {
    @return inline-svg(
        '<svg width="' + $width + '" height="' + $height + '" viewBox="0 0 25 25" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
            <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
                <g transform="translate(-1037.000000, -225.000000)">
                    <g transform="translate(1037.000000, 225.000000)">
                        <circle fill="#FFFFFF" cx="12.5" cy="12.5" r="12.5"></circle>
                        <path d="M8.87276786,8.87276786 L16.1272321,16.1272321" stroke="' + $color + '" stroke-width="1.14047983" stroke-linecap="square"></path>
                        <path d="M16.1272321,8.87276786 L8.87276786,16.1272321" stroke="' + $color + '" stroke-width="1.14047983" stroke-linecap="square"></path>
                    </g>
                </g>
            </g>
        </svg>'
    );
}

@function sai-icon-plus-svg(
    $width: '30px',
    $height: '30px',
    $color: $primary-color
) {
    @return inline-svg(
        '<svg width="' + $width + '" height="' + $height + '" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
            <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
                <g transform="translate(-1393.000000, -92.000000)">
                    <g transform="translate(1409.000000, 108.000000) rotate(45.000000) translate(-1409.000000, -108.000000) translate(1393.000000, 92.000000)">
                        <circle fill="#FFFFFF" cx="16" cy="16" r="16"></circle>
                        <path d="M11.3571429,11.3571429 L20.6428571,20.6428571" stroke="' + $color + '" stroke-width="1.47806188" stroke-linecap="square"></path>
                        <path d="M20.6428571,11.3571429 L11.3571429,20.6428571" stroke="' + $color + '" stroke-width="1.47806188" stroke-linecap="square"></path>
                    </g>
                </g>
            </g>
        </svg>'
    );
}

@function sai-icon-move-svg(
    $width: '30px',
    $height: '30px',
    $color: $primary-color
) {
    @return inline-svg(
        '<svg width="' + $width + '" height="' + $height + '" viewBox="0 0 25 25" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
            <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
                <g transform="translate(-1000.000000, -225.000000)">
                    <g transform="translate(1000.000000, 225.000000)">
                        <g>
                            <g>
                                <circle fill="#FFFFFF" cx="12.5" cy="12.5" r="12.5"></circle>
                                <path d="M18.9540816,12.0958227 L13.7244898,12.0958227 C13.5076531,12.0958227 13.3322704,12.2712054 13.3322704,12.4880421 C13.3322704,12.7048788 13.5076531,12.8770727 13.7244898,12.8770727 L18.9540816,12.8770727 L17.6243622,14.2067921 C17.471301,14.3598533 17.471301,14.605389 17.6243622,14.7584503 C17.7008929,14.8349809 17.7997449,14.8732462 17.9017857,14.8732462 C18.0038265,14.8732462 18.1026786,14.8349809 18.1792092,14.7584503 L20.1753827,12.7622768 C20.3284439,12.6092156 20.3284439,12.3636798 20.1753827,12.2106186 L18.1792092,10.2144452 C18.026148,10.0613839 17.7806122,10.0613839 17.627551,10.2144452 C17.4744898,10.3675064 17.4744898,10.6130421 17.627551,10.7661033 L18.9540816,12.0958227 Z" fill="' + $color + '" fill-rule="nonzero"></path>
                                <path d="M6.79846939,14.7584503 C6.875,14.8349809 6.97385204,14.8732462 7.07589286,14.8732462 C7.17793367,14.8732462 7.27678571,14.8349809 7.35331633,14.7584503 C7.50637755,14.605389 7.50637755,14.3598533 7.35331633,14.2067921 L6.02359694,12.8770727 L11.2531888,12.8770727 C11.4700255,12.8770727 11.6454082,12.7016901 11.6454082,12.4880421 C11.6454082,12.2743941 11.4700255,12.0958227 11.2531888,12.0958227 L6.02359694,12.0958227 L7.35012755,10.7661033 C7.50318878,10.6130421 7.50318878,10.3675064 7.35012755,10.2144452 C7.19706633,10.0613839 6.95153061,10.0613839 6.79846939,10.2144452 L4.80229592,12.2106186 C4.64923469,12.3636798 4.64923469,12.6092156 4.80229592,12.7622768 L6.79846939,14.7584503 Z" fill="' + $color + '" fill-rule="nonzero"></path>
                                <path d="M10.7653061,7.35092474 L12.0950255,6.02120536 L12.0950255,11.2507972 C12.0950255,11.4676339 12.2704082,11.6430166 12.4872449,11.6430166 C12.7040816,11.6430166 12.8794643,11.4676339 12.8794643,11.2507972 L12.8794643,6.02120536 L14.2091837,7.35092474 C14.2857143,7.42745536 14.3845663,7.46572066 14.4866071,7.46572066 C14.588648,7.46572066 14.6875,7.42745536 14.7640306,7.35092474 C14.9170918,7.19786352 14.9170918,6.95232781 14.7640306,6.79926658 L12.7678571,4.80309311 C12.6211735,4.65640944 12.3628827,4.65640944 12.216199,4.80309311 L10.2200255,6.79926658 C10.0669643,6.95232781 10.0669643,7.19786352 10.2200255,7.35092474 C10.3667092,7.50398597 10.6154337,7.50398597 10.7653061,7.35092474 Z" fill="' + $color + '" fill-rule="nonzero"></path>
                                <path d="M12.4872449,13.3298788 C12.2704082,13.3298788 12.0950255,13.5052615 12.0950255,13.7220982 L12.0950255,18.9516901 L10.7653061,17.6219707 C10.6122449,17.4689094 10.3667092,17.4689094 10.213648,17.6219707 C10.0605867,17.7750319 10.0605867,18.0205676 10.213648,18.1736288 L12.2098214,20.1698023 C12.2831633,20.2431441 12.3820153,20.2845982 12.4872449,20.2845982 C12.5892857,20.2845982 12.6913265,20.2431441 12.7646684,20.1698023 L14.7608418,18.1736288 C14.9139031,18.0205676 14.9139031,17.7750319 14.7608418,17.6219707 C14.6077806,17.4689094 14.3622449,17.4689094 14.2091837,17.6219707 L12.8794643,18.9516901 L12.8794643,13.7220982 C12.8762755,13.5052615 12.7040816,13.3298788 12.4872449,13.3298788 Z" fill="' + $color + '" fill-rule="nonzero"></path>
                            </g>
                        </g>
                    </g>
                </g>
            </g>
        </svg>'
    );
}




