createOrReplace
/// Proposé par Benjamin Ejzenberg - https://www.linkedin.com/in/benjaminejzenberg/
/// Construit un badge SVG Lucide et retourne une data URI exploitable dans Power BI.
/// iconName : nom de l'icone Lucide a afficher.
/// iconColorHex : couleur de trait appliquee a l'icone, au format hexadécimal ; si vide, currentColor est conserve.
/// badgeColorHex : couleur de fond du badge circulaire, au format hexadécimal ; si vide, aucun badge n'est dessine.
/// badgeSize : taille de rendu cible du badge en pixels ; les valeurs elevees agrandissent le SVG final et la composition interne reste plafonnee a 30 unites Lucide.
/// badgePadding : marge interieure entre le badge et l'icone, sur une echelle de 0 a 30.
/// strokeWidth : epaisseur de trait prise parmi 1, 1.5, 2 ou 2.5 ; si absente ou invalide, 2 est utilise.
function imgBadgeEmbeddedAllIcons =
(iconName : Scalar String, iconColorHex : Scalar String, badgeColorHex : Scalar String, badgeSize : Scalar Int64, badgePadding : Scalar Int64, strokeWidth : Scalar Numeric) =>
VAR normalizedIconName =
LOWER(TRIM(COALESCE(iconName, "")))
VAR rawSvg =
SWITCH(
normalizedIconName,
"a-arrow-down", "",
"a-arrow-up", "",
"a-large-small", "",
"accessibility", "",
"activity-square", "",
"activity", "",
"air-vent", "",
"airplay", "",
"alarm-check", "",
"alarm-clock-check", "",
"alarm-clock-minus", "",
"alarm-clock-off", "",
"alarm-clock-plus", "",
"alarm-clock", "",
"alarm-minus", "",
"alarm-plus", "",
"alarm-smoke", "",
"album", "",
"alert-circle", "",
"alert-octagon", "",
"alert-triangle", "",
"align-center-horizontal", "",
"align-center-vertical", "",
"align-center", "",
"align-end-horizontal", "",
"align-end-vertical", "",
"align-horizontal-distribute-center", "",
"align-horizontal-distribute-end", "",
"align-horizontal-distribute-start", "",
"align-horizontal-justify-center", "",
"align-horizontal-justify-end", "",
"align-horizontal-justify-start", "",
"align-horizontal-space-around", "",
"align-horizontal-space-between", "",
"align-justify", "",
"align-left", "",
"align-right", "",
"align-start-horizontal", "",
"align-start-vertical", "",
"align-vertical-distribute-center", "",
"align-vertical-distribute-end", "",
"align-vertical-distribute-start", "",
"align-vertical-justify-center", "",
"align-vertical-justify-end", "",
"align-vertical-justify-start", "",
"align-vertical-space-around", "",
"align-vertical-space-between", "",
"ambulance", "",
"ampersand", "",
"ampersands", "",
"amphora", "",
"anchor", "",
"angry", "",
"annoyed", "",
"antenna", "",
"anvil", "",
"aperture", "",
"app-window-mac", "",
"app-window", "",
"apple", "",
"archive-restore", "",
"archive-x", "",
"archive", "",
"area-chart", "",
"armchair", "",
"arrow-big-down-dash", "",
"arrow-big-down", "",
"arrow-big-left-dash", "",
"arrow-big-left", "",
"arrow-big-right-dash", "",
"arrow-big-right", "",
"arrow-big-up-dash", "",
"arrow-big-up", "",
"arrow-down-0-1", "",
"arrow-down-01", "",
"arrow-down-1-0", "",
"arrow-down-10", "",
"arrow-down-a-z", "",
"arrow-down-az", "",
"arrow-down-circle", "",
"arrow-down-from-line", "",
"arrow-down-left-from-circle", "",
"arrow-down-left-from-square", "",
"arrow-down-left-square", "",
"arrow-down-left", "",
"arrow-down-narrow-wide", "",
"arrow-down-right-from-circle", "",
"arrow-down-right-from-square", "",
"arrow-down-right-square", "",
"arrow-down-right", "",
"arrow-down-square", "",
"arrow-down-to-dot", "",
"arrow-down-to-line", "",
"arrow-down-up", "",
"arrow-down-wide-narrow", "",
"arrow-down-z-a", "",
"arrow-down-za", "",
"arrow-down", "",
"arrow-left-circle", "",
"arrow-left-from-line", "",
"arrow-left-right", "",
"arrow-left-square", "",
"arrow-left-to-line", "",
"arrow-left", "",
"arrow-right-circle", "",
"arrow-right-from-line", "",
"arrow-right-left", "",
"arrow-right-square", "",
"arrow-right-to-line", "",
"arrow-right", "",
"arrow-up-0-1", "",
"arrow-up-01", "",
"arrow-up-1-0", "",
"arrow-up-10", "",
"arrow-up-a-z", "",
"arrow-up-az", "",
"arrow-up-circle", "",
"arrow-up-down", "",
"arrow-up-from-dot", "",
"arrow-up-from-line", "",
"arrow-up-left-from-circle", "",
"arrow-up-left-from-square", "",
"arrow-up-left-square", "",
"arrow-up-left", "",
"arrow-up-narrow-wide", "",
"arrow-up-right-from-circle", "",
"arrow-up-right-from-square", "",
"arrow-up-right-square", "",
"arrow-up-right", "",
"arrow-up-square", "",
"arrow-up-to-line", "",
"arrow-up-wide-narrow", "",
"arrow-up-z-a", "",
"arrow-up-za", "",
"arrow-up", "",
"arrows-up-from-line", "",
"asterisk-square", "",
"asterisk", "",
"at-sign", "",
"atom", "",
"audio-lines", "",
"audio-waveform", "",
"award", "",
"axe", "",
"axis-3-d", "",
"axis-3d", "",
"baby", "",
"backpack", "",
"badge-alert", "",
"badge-cent", "",
"badge-check", "",
"badge-dollar-sign", "",
"badge-euro", "",
"badge-help", "",
"badge-indian-rupee", "",
"badge-info", "",
"badge-japanese-yen", "",
"badge-minus", "",
"badge-percent", "",
"badge-plus", "",
"badge-pound-sterling", "",
"badge-question-mark", "",
"badge-russian-ruble", "",
"badge-swiss-franc", "",
"badge-turkish-lira", "",
"badge-x", "",
"badge", "",
"baggage-claim", "",
"balloon", "",
"ban", "",
"banana", "",
"bandage", "",
"banknote-arrow-down", "",
"banknote-arrow-up", "",
"banknote-x", "",
"banknote", "",
"bar-chart-2", "",
"bar-chart-3", "",
"bar-chart-4", "",
"bar-chart-big", "",
"bar-chart-horizontal-big", "",
"bar-chart-horizontal", "",
"bar-chart", "",
"barcode", "",
"barrel", "",
"baseline", "",
"bath", "",
"battery-charging", "",
"battery-full", "",
"battery-low", "",
"battery-medium", "",
"battery-plus", "",
"battery-warning", "",
"battery", "",
"beaker", "",
"bean-off", "",
"bean", "",
"bed-double", "",
"bed-single", "",
"bed", "",
"beef", "",
"beer-off", "",
"beer", "",
"bell-dot", "",
"bell-electric", "",
"bell-minus", "",
"bell-off", "",
"bell-plus", "",
"bell-ring", "",
"bell", "",
"between-horizonal-end", "",
"between-horizonal-start", "",
"between-horizontal-end", "",
"between-horizontal-start", "",
"between-vertical-end", "",
"between-vertical-start", "",
"biceps-flexed", "",
"bike", "",
"binary", "",
"binoculars", "",
"biohazard", "",
"bird", "",
"birdhouse", "",
"bitcoin", "",
"blend", "",
"blinds", "",
"blocks", "",
"bluetooth-connected", "",
"bluetooth-off", "",
"bluetooth-searching", "",
"bluetooth", "",
"bold", "",
"bolt", "",
"bomb", "",
"bone", "",
"book-a", "",
"book-alert", "",
"book-audio", "",
"book-check", "",
"book-copy", "",
"book-dashed", "",
"book-down", "",
"book-headphones", "",
"book-heart", "",
"book-image", "",
"book-key", "",
"book-lock", "",
"book-marked", "",
"book-minus", "",
"book-open-check", "",
"book-open-text", "",
"book-open", "",
"book-plus", "",
"book-search", "",
"book-template", "",
"book-text", "",
"book-type", "",
"book-up-2", "",
"book-up", "",
"book-user", "",
"book-x", "",
"book", "",
"bookmark-check", "",
"bookmark-minus", "",
"bookmark-plus", "",
"bookmark-x", "",
"bookmark", "",
"boom-box", "",
"bot-message-square", "",
"bot-off", "",
"bot", "",
"bottle-wine", "",
"bow-arrow", "",
"box-select", "",
"box", "",
"boxes", "",
"braces", "",
"brackets", "",
"brain-circuit", "",
"brain-cog", "",
"brain", "",
"brick-wall-fire", "",
"brick-wall-shield", "",
"brick-wall", "",
"briefcase-business", "",
"briefcase-conveyor-belt", "",
"briefcase-medical", "",
"briefcase", "",
"bring-to-front", "",
"brush-cleaning", "",
"brush", "",
"bubbles", "",
"bug-off", "",
"bug-play", "",
"bug", "",
"building-2", "",
"building", "",
"bus-front", "",
"bus", "",
"cable-car", "",
"cable", "",
"cake-slice", "",
"cake", "",
"calculator", "",
"calendar-1", "",
"calendar-arrow-down", "",
"calendar-arrow-up", "",
"calendar-check-2", "",
"calendar-check", "",
"calendar-clock", "",
"calendar-cog", "",
"calendar-days", "",
"calendar-fold", "",
"calendar-heart", "",
"calendar-minus-2", "",
"calendar-minus", "",
"calendar-off", "",
"calendar-plus-2", "",
"calendar-plus", "",
"calendar-range", "",
"calendar-search", "",
"calendar-sync", "",
"calendar-x-2", "",
"calendar-x", "",
"calendar", "",
"calendars", "",
"camera-off", "",
"camera", "",
"candlestick-chart", "",
"candy-cane", "",
"candy-off", "",
"candy", "",
"cannabis-off", "",
"cannabis", "",
"captions-off", "",
"captions", "",
"car-front", "",
"car-taxi-front", "",
"car", "",
"caravan", "",
"card-sim", "",
"carrot", "",
"case-lower", "",
"case-sensitive", "",
"case-upper", "",
"cassette-tape", "",
"cast", "",
"castle", "",
"cat", "",
"cctv", "",
"chart-area", "",
"chart-bar-big", "",
"chart-bar-decreasing", "",
"chart-bar-increasing", "",
"chart-bar-stacked", "",
"chart-bar", "",
"chart-candlestick", "",
"chart-column-big", "",
"chart-column-decreasing", "",
"chart-column-increasing", "",
"chart-column-stacked", "",
"chart-column", "",
"chart-gantt", "",
"chart-line", "",
"chart-network", "",
"chart-no-axes-column-decreasing", "",
"chart-no-axes-column-increasing", "",
"chart-no-axes-column", "",
"chart-no-axes-combined", "",
"chart-no-axes-gantt", "",
"chart-pie", "",
"chart-scatter", "",
"chart-spline", "",
"check-check", "",
"check-circle-2", "",
"check-circle", "",
"check-line", "",
"check-square-2", "",
"check-square", "",
"check", "",
"chef-hat", "",
"cherry", "",
"chess-bishop", "",
"chess-king", "",
"chess-knight", "",
"chess-pawn", "",
"chess-queen", "",
"chess-rook", "",
"chevron-down-circle", "",
"chevron-down-square", "",
"chevron-down", "",
"chevron-first", "",
"chevron-last", "",
"chevron-left-circle", "",
"chevron-left-square", "",
"chevron-left", "",
"chevron-right-circle", "",
"chevron-right-square", "",
"chevron-right", "",
"chevron-up-circle", "",
"chevron-up-square", "",
"chevron-up", "",
"chevrons-down-up", "",
"chevrons-down", "",
"chevrons-left-right-ellipsis", "",
"chevrons-left-right", "",
"chevrons-left", "",
"chevrons-right-left", "",
"chevrons-right", "",
"chevrons-up-down", "",
"chevrons-up", "",
"chrome", "",
"chromium", "",
"church", "",
"cigarette-off", "",
"cigarette", "",
"circle-alert", "",
"circle-arrow-down", "",
"circle-arrow-left", "",
"circle-arrow-out-down-left", "",
"circle-arrow-out-down-right", "",
"circle-arrow-out-up-left", "",
"circle-arrow-out-up-right", "",
"circle-arrow-right", "",
"circle-arrow-up", "",
"circle-check-big", "",
"circle-check", "",
"circle-chevron-down", "",
"circle-chevron-left", "",
"circle-chevron-right", "",
"circle-chevron-up", "",
"circle-dashed", "",
"circle-divide", "",
"circle-dollar-sign", "",
"circle-dot-dashed", "",
"circle-dot", "",
"circle-ellipsis", "",
"circle-equal", "",
"circle-fading-arrow-up", "",
"circle-fading-plus", "",
"circle-gauge", "",
"circle-help", "",
"circle-minus", "",
"circle-off", "",
"circle-parking-off", "",
"circle-parking", "",
"circle-pause", "",
"circle-percent", "",
"circle-pile", "",
"circle-play", "",
"circle-plus", "",
"circle-pound-sterling", "",
"circle-power", "",
"circle-question-mark", "",
"circle-slash-2", "",
"circle-slash", "",
"circle-slashed", "",
"circle-small", "",
"circle-star", "",
"circle-stop", "",
"circle-user-round", "",
"circle-user", "",
"circle-x", "",
"circle", "",
"circuit-board", "",
"citrus", "",
"clapperboard", "",
"clipboard-check", "",
"clipboard-clock", "",
"clipboard-copy", "",
"clipboard-edit", "",
"clipboard-list", "",
"clipboard-minus", "",
"clipboard-paste", "",
"clipboard-pen-line", "",
"clipboard-pen", "",
"clipboard-plus", "",
"clipboard-signature", "",
"clipboard-type", "",
"clipboard-x", "",
"clipboard", "",
"clock-1", "",
"clock-10", "",
"clock-11", "",
"clock-12", "",
"clock-2", "",
"clock-3", "",
"clock-4", "",
"clock-5", "",
"clock-6", "",
"clock-7", "",
"clock-8", "",
"clock-9", "",
"clock-alert", "",
"clock-arrow-down", "",
"clock-arrow-up", "",
"clock-check", "",
"clock-fading", "",
"clock-plus", "",
"clock", "",
"closed-caption", "",
"cloud-alert", "",
"cloud-backup", "",
"cloud-check", "",
"cloud-cog", "",
"cloud-download", "",
"cloud-drizzle", "",
"cloud-fog", "",
"cloud-hail", "",
"cloud-lightning", "",
"cloud-moon-rain", "",
"cloud-moon", "",
"cloud-off", "",
"cloud-rain-wind", "",
"cloud-rain", "",
"cloud-snow", "",
"cloud-sun-rain", "",
"cloud-sun", "",
"cloud-sync", "",
"cloud-upload", "",
"cloud", "",
"cloudy", "",
"clover", "",
"club", "",
"code-2", "",
"code-square", "",
"code-xml", "",
"code", "",
"codepen", "",
"codesandbox", "",
"coffee", "",
"cog", "",
"coins", "",
"columns-2", "",
"columns-3-cog", "",
"columns-3", "",
"columns-4", "",
"columns-settings", "",
"columns", "",
"combine", "",
"command", "",
"compass", "",
"component", "",
"computer", "",
"concierge-bell", "",
"cone", "",
"construction", "",
"contact-2", "",
"contact-round", "",
"contact", "",
"container", "",
"contrast", "",
"cookie", "",
"cooking-pot", "",
"copy-check", "",
"copy-minus", "",
"copy-plus", "",
"copy-slash", "",
"copy-x", "",
"copy", "",
"copyleft", "",
"copyright", "",
"corner-down-left", "",
"corner-down-right", "",
"corner-left-down", "",
"corner-left-up", "",
"corner-right-down", "",
"corner-right-up", "",
"corner-up-left", "",
"corner-up-right", "",
"cpu", "",
"creative-commons", "",
"credit-card", "",
"croissant", "",
"crop", "",
"cross", "",
"crosshair", "",
"crown", "",
"cuboid", "",
"cup-soda", "",
"curly-braces", "",
"currency", "",
"cylinder", "",
"dam", "",
"database-backup", "",
"database-search", "",
"database-zap", "",
"database", "",
"decimals-arrow-left", "",
"decimals-arrow-right", "",
"delete", "",
"dessert", "",
"diameter", "",
"diamond-minus", "",
"diamond-percent", "",
"diamond-plus", "",
"diamond", "",
"dice-1", "",
"dice-2", "",
"dice-3", "",
"dice-4", "",
"dice-5", "",
"dice-6", "",
"dices", "",
"diff", "",
"disc-2", "",
"disc-3", "",
"disc-album", "",
"disc", "",
"divide-circle", "",
"divide-square", "",
"divide", "",
"dna-off", "",
"dna", "",
"dock", "",
"dog", "",
"dollar-sign", "",
"donut", "",
"door-closed-locked", "",
"door-closed", "",
"door-open", "",
"dot-square", "",
"dot", "",
"download-cloud", "",
"download", "",
"drafting-compass", "",
"drama", "",
"dribbble", "",
"drill", "",
"drone", "",
"droplet-off", "",
"droplet", "",
"droplets", "",
"drum", "",
"drumstick", "",
"dumbbell", "",
"ear-off", "",
"ear", "",
"earth-lock", "",
"earth", "",
"eclipse", "",
"edit-2", "",
"edit-3", "",
"edit", "",
"egg-fried", "",
"egg-off", "",
"egg", "",
"ellipse", "",
"ellipsis-vertical", "",
"ellipsis", "",
"equal-approximately", "",
"equal-not", "",
"equal-square", "",
"equal", "",
"eraser", "",
"ethernet-port", "",
"euro", "",
"ev-charger", "",
"expand", "",
"external-link", "",
"eye-closed", "",
"eye-off", "",
"eye", "",
"facebook", "",
"factory", "",
"fan", "",
"fast-forward", "",
"feather", "",
"fence", "",
"ferris-wheel", "",
"figma", "",
"file-archive", "",
"file-audio-2", "",
"file-audio", "",
"file-axis-3-d", "",
"file-axis-3d", "",
"file-badge-2", "",
"file-badge", "",
"file-bar-chart-2", "",
"file-bar-chart", "",
"file-box", "",
"file-braces-corner", "",
"file-braces", "",
"file-chart-column-increasing", "",
"file-chart-column", "",
"file-chart-line", "",
"file-chart-pie", "",
"file-check-2", "",
"file-check-corner", "",
"file-check", "",
"file-clock", "",
"file-code-2", "",
"file-code-corner", "",
"file-code", "",
"file-cog-2", "",
"file-cog", "",
"file-diff", "",
"file-digit", "",
"file-down", "",
"file-edit", "",
"file-exclamation-point", "",
"file-headphone", "",
"file-heart", "",
"file-image", "",
"file-input", "",
"file-json-2", "",
"file-json", "",
"file-key-2", "",
"file-key", "",
"file-line-chart", "",
"file-lock-2", "",
"file-lock", "",
"file-minus-2", "",
"file-minus-corner", "",
"file-minus", "",
"file-music", "",
"file-output", "",
"file-pen-line", "",
"file-pen", "",
"file-pie-chart", "",
"file-play", "",
"file-plus-2", "",
"file-plus-corner", "",
"file-plus", "",
"file-question-mark", "",
"file-question", "",
"file-scan", "",
"file-search-2", "",
"file-search-corner", "",
"file-search", "",
"file-signal", "",
"file-signature", "",
"file-sliders", "",
"file-spreadsheet", "",
"file-stack", "",
"file-symlink", "",
"file-terminal", "",
"file-text", "",
"file-type-2", "",
"file-type-corner", "",
"file-type", "",
"file-up", "",
"file-user", "",
"file-video-2", "",
"file-video-camera", "",
"file-video", "",
"file-volume-2", "",
"file-volume", "",
"file-warning", "",
"file-x-2", "",
"file-x-corner", "",
"file-x", "",
"file", "",
"files", "",
"film", "",
"filter-x", "",
"filter", "",
"fingerprint-pattern", "",
"fingerprint", "",
"fire-extinguisher", "",
"fish-off", "",
"fish-symbol", "",
"fish", "",
"fishing-hook", "",
"fishing-rod", "",
"flag-off", "",
"flag-triangle-left", "",
"flag-triangle-right", "",
"flag", "",
"flame-kindling", "",
"flame", "",
"flashlight-off", "",
"flashlight", "",
"flask-conical-off", "",
"flask-conical", "",
"flask-round", "",
"flip-horizontal-2", "",
"flip-horizontal", "",
"flip-vertical-2", "",
"flip-vertical", "",
"flower-2", "",
"flower", "",
"focus", "",
"fold-horizontal", "",
"fold-vertical", "",
"folder-archive", "",
"folder-check", "",
"folder-clock", "",
"folder-closed", "",
"folder-code", "",
"folder-cog-2", "",
"folder-cog", "",
"folder-dot", "",
"folder-down", "",
"folder-edit", "",
"folder-git-2", "",
"folder-git", "",
"folder-heart", "",
"folder-input", "",
"folder-kanban", "",
"folder-key", "",
"folder-lock", "",
"folder-minus", "",
"folder-open-dot", "",
"folder-open", "",
"folder-output", "",
"folder-pen", "",
"folder-plus", "",
"folder-root", "",
"folder-search-2", "",
"folder-search", "",
"folder-symlink", "",
"folder-sync", "",
"folder-tree", "",
"folder-up", "",
"folder-x", "",
"folder", "",
"folders", "",
"footprints", "",
"fork-knife-crossed", "",
"fork-knife", "",
"forklift", "",
"form-input", "",
"form", "",
"forward", "",
"frame", "",
"framer", "",
"frown", "",
"fuel", "",
"fullscreen", "",
"function-square", "",
"funnel-plus", "",
"funnel-x", "",
"funnel", "",
"gallery-horizontal-end", "",
"gallery-horizontal", "",
"gallery-thumbnails", "",
"gallery-vertical-end", "",
"gallery-vertical", "",
"gamepad-2", "",
"gamepad-directional", "",
"gamepad", "",
"gantt-chart-square", "",
"gantt-chart", "",
"gauge-circle", "",
"gauge", "",
"gavel", "",
"gem", "",
"georgian-lari", "",
"ghost", "",
"gift", "",
"git-branch-minus", "",
"git-branch-plus", "",
"git-branch", "",
"git-commit-horizontal", "",
"git-commit-vertical", "",
"git-commit", "",
"git-compare-arrows", "",
"git-compare", "",
"git-fork", "",
"git-graph", "",
"git-merge-conflict", "",
"git-merge", "",
"git-pull-request-arrow", "",
"git-pull-request-closed", "",
"git-pull-request-create-arrow", "",
"git-pull-request-create", "",
"git-pull-request-draft", "",
"git-pull-request", "",
"github", "",
"gitlab", "",
"glass-water", "",
"glasses", "",
"globe-2", "",
"globe-lock", "",
"globe-off", "",
"globe-x", "",
"globe", "",
"goal", "",
"gpu", "",
"grab", "",
"graduation-cap", "",
"grape", "",
"grid-2-x-2-check", "",
"grid-2-x-2-plus", "",
"grid-2-x-2-x", "",
"grid-2-x-2", "",
"grid-2x2-check", "",
"grid-2x2-plus", "",
"grid-2x2-x", "",
"grid-2x2", "",
"grid-3-x-3", "",
"grid-3x2", "",
"grid-3x3", "",
"grid", "",
"grip-horizontal", "",
"grip-vertical", "",
"grip", "",
"group", "",
"guitar", "",
"ham", "",
"hamburger", "",
"hammer", "",
"hand-coins", "",
"hand-fist", "",
"hand-grab", "",
"hand-heart", "",
"hand-helping", "",
"hand-metal", "",
"hand-platter", "",
"hand", "",
"handbag", "",
"handshake", "",
"hard-drive-download", "",
"hard-drive-upload", "",
"hard-drive", "",
"hard-hat", "",
"hash", "",
"hat-glasses", "",
"haze", "",
"hd", "",
"hdmi-port", "",
"heading-1", "",
"heading-2", "",
"heading-3", "",
"heading-4", "",
"heading-5", "",
"heading-6", "",
"heading", "",
"headphone-off", "",
"headphones", "",
"headset", "",
"heart-crack", "",
"heart-handshake", "",
"heart-minus", "",
"heart-off", "",
"heart-plus", "",
"heart-pulse", "",
"heart", "",
"heater", "",
"helicopter", "",
"help-circle", "",
"helping-hand", "",
"hexagon", "",
"highlighter", "",
"history", "",
"home", "",
"hop-off", "",
"hop", "",
"hospital", "",
"hotel", "",
"hourglass", "",
"house-heart", "",
"house-plug", "",
"house-plus", "",
"house-wifi", "",
"house", "",
"ice-cream-2", "",
"ice-cream-bowl", "",
"ice-cream-cone", "",
"ice-cream", "",
"id-card-lanyard", "",
"id-card", "",
"image-down", "",
"image-minus", "",
"image-off", "",
"image-play", "",
"image-plus", "",
"image-up", "",
"image-upscale", "",
"image", "",
"images", "",
"import", "",
"inbox", "",
"indent-decrease", "",
"indent-increase", "",
"indent", "",
"indian-rupee", "",
"infinity", "",
"info", "",
"inspect", "",
"inspection-panel", "",
"instagram", "",
"italic", "",
"iteration-ccw", "",
"iteration-cw", "",
"japanese-yen", "",
"joystick", "",
"kanban-square-dashed", "",
"kanban-square", "",
"kanban", "",
"kayak", "",
"key-round", "",
"key-square", "",
"key", "",
"keyboard-music", "",
"keyboard-off", "",
"keyboard", "",
"lamp-ceiling", "",
"lamp-desk", "",
"lamp-floor", "",
"lamp-wall-down", "",
"lamp-wall-up", "",
"lamp", "",
"land-plot", "",
"landmark", "",
"languages", "",
"laptop-2", "",
"laptop-minimal-check", "",
"laptop-minimal", "",
"laptop", "",
"lasso-select", "",
"lasso", "",
"laugh", "",
"layers-2", "",
"layers-3", "",
"layers-plus", "",
"layers", "",
"layout-dashboard", "",
"layout-grid", "",
"layout-list", "",
"layout-panel-left", "",
"layout-panel-top", "",
"layout-template", "",
"layout", "",
"leaf", "",
"leafy-green", "",
"lectern", "",
"lens-concave", "",
"lens-convex", "",
"letter-text", "",
"library-big", "",
"library-square", "",
"library", "",
"life-buoy", "",
"ligature", "",
"lightbulb-off", "",
"lightbulb", "",
"line-chart", "",
"line-dot-right-horizontal", "",
"line-squiggle", "",
"link-2-off", "",
"link-2", "",
"link", "",
"linkedin", "",
"list-check", "",
"list-checks", "",
"list-chevrons-down-up", "",
"list-chevrons-up-down", "",
"list-collapse", "",
"list-end", "",
"list-filter-plus", "",
"list-filter", "",
"list-indent-decrease", "",
"list-indent-increase", "",
"list-minus", "",
"list-music", "",
"list-ordered", "",
"list-plus", "",
"list-restart", "",
"list-start", "",
"list-todo", "",
"list-tree", "",
"list-video", "",
"list-x", "",
"list", "",
"loader-2", "",
"loader-circle", "",
"loader-pinwheel", "",
"loader", "",
"locate-fixed", "",
"locate-off", "",
"locate", "",
"location-edit", "",
"lock-keyhole-open", "",
"lock-keyhole", "",
"lock-open", "",
"lock", "",
"log-in", "",
"log-out", "",
"logs", "",
"lollipop", "",
"luggage", "",
"m-square", "",
"magnet", "",
"mail-check", "",
"mail-minus", "",
"mail-open", "",
"mail-plus", "",
"mail-question-mark", "",
"mail-question", "",
"mail-search", "",
"mail-warning", "",
"mail-x", "",
"mail", "",
"mailbox", "",
"mails", "",
"map-minus", "",
"map-pin-check-inside", "",
"map-pin-check", "",
"map-pin-house", "",
"map-pin-minus-inside", "",
"map-pin-minus", "",
"map-pin-off", "",
"map-pin-pen", "",
"map-pin-plus-inside", "",
"map-pin-plus", "",
"map-pin-x-inside", "",
"map-pin-x", "",
"map-pin", "",
"map-pinned", "",
"map-plus", "",
"map", "",
"mars-stroke", "",
"mars", "",
"martini", "",
"maximize-2", "",
"maximize", "",
"medal", "",
"megaphone-off", "",
"megaphone", "",
"meh", "",
"memory-stick", "",
"menu-square", "",
"menu", "",
"merge", "",
"message-circle-check", "",
"message-circle-code", "",
"message-circle-dashed", "",
"message-circle-heart", "",
"message-circle-more", "",
"message-circle-off", "",
"message-circle-plus", "",
"message-circle-question-mark", "",
"message-circle-question", "",
"message-circle-reply", "",
"message-circle-warning", "",
"message-circle-x", "",
"message-circle", "",
"message-square-check", "",
"message-square-code", "",
"message-square-dashed", "",
"message-square-diff", "",
"message-square-dot", "",
"message-square-heart", "",
"message-square-lock", "",
"message-square-more", "",
"message-square-off", "",
"message-square-plus", "",
"message-square-quote", "",
"message-square-reply", "",
"message-square-share", "",
"message-square-text", "",
"message-square-warning", "",
"message-square-x", "",
"message-square", "",
"messages-square", "",
"metronome", "",
"mic-2", "",
"mic-off", "",
"mic-vocal", "",
"mic", "",
"microchip", "",
"microscope", "",
"microwave", "",
"milestone", "",
"milk-off", "",
"milk", "",
"minimize-2", "",
"minimize", "",
"minus-circle", "",
"minus-square", "",
"minus", "",
"mirror-rectangular", "",
"mirror-round", "",
"monitor-check", "",
"monitor-cloud", "",
"monitor-cog", "",
"monitor-dot", "",
"monitor-down", "",
"monitor-off", "",
"monitor-pause", "",
"monitor-play", "",
"monitor-smartphone", "",
"monitor-speaker", "",
"monitor-stop", "",
"monitor-up", "",
"monitor-x", "",
"monitor", "",
"moon-star", "",
"moon", "",
"more-horizontal", "",
"more-vertical", "",
"motorbike", "",
"mountain-snow", "",
"mountain", "",
"mouse-left", "",
"mouse-off", "",
"mouse-pointer-2-off", "",
"mouse-pointer-2", "",
"mouse-pointer-ban", "",
"mouse-pointer-click", "",
"mouse-pointer-square-dashed", "",
"mouse-pointer", "",
"mouse-right", "",
"mouse", "",
"move-3-d", "",
"move-3d", "",
"move-diagonal-2", "",
"move-diagonal", "",
"move-down-left", "",
"move-down-right", "",
"move-down", "",
"move-horizontal", "",
"move-left", "",
"move-right", "",
"move-up-left", "",
"move-up-right", "",
"move-up", "",
"move-vertical", "",
"move", "",
"music-2", "",
"music-3", "",
"music-4", "",
"music", "",
"navigation-2-off", "",
"navigation-2", "",
"navigation-off", "",
"navigation", "",
"network", "",
"newspaper", "",
"nfc", "",
"non-binary", "",
"notebook-pen", "",
"notebook-tabs", "",
"notebook-text", "",
"notebook", "",
"notepad-text-dashed", "",
"notepad-text", "",
"nut-off", "",
"nut", "",
"octagon-alert", "",
"octagon-minus", "",
"octagon-pause", "",
"octagon-x", "",
"octagon", "",
"omega", "",
"option", "",
"orbit", "",
"origami", "",
"outdent", "",
"package-2", "",
"package-check", "",
"package-minus", "",
"package-open", "",
"package-plus", "",
"package-search", "",
"package-x", "",
"package", "",
"paint-bucket", "",
"paint-roller", "",
"paintbrush-2", "",
"paintbrush-vertical", "",
"paintbrush", "",
"palette", "",
"palmtree", "",
"panda", "",
"panel-bottom-close", "",
"panel-bottom-dashed", "",
"panel-bottom-inactive", "",
"panel-bottom-open", "",
"panel-bottom", "",
"panel-left-close", "",
"panel-left-dashed", "",
"panel-left-inactive", "",
"panel-left-open", "",
"panel-left-right-dashed", "",
"panel-left", "",
"panel-right-close", "",
"panel-right-dashed", "",
"panel-right-inactive", "",
"panel-right-open", "",
"panel-right", "",
"panel-top-bottom-dashed", "",
"panel-top-close", "",
"panel-top-dashed", "",
"panel-top-inactive", "",
"panel-top-open", "",
"panel-top", "",
"panels-left-bottom", "",
"panels-left-right", "",
"panels-right-bottom", "",
"panels-top-bottom", "",
"panels-top-left", "",
"paperclip", "",
"parentheses", "",
"parking-circle-off", "",
"parking-circle", "",
"parking-meter", "",
"parking-square-off", "",
"parking-square", "",
"party-popper", "",
"pause-circle", "",
"pause-octagon", "",
"pause", "",
"paw-print", "",
"pc-case", "",
"pen-box", "",
"pen-line", "",
"pen-off", "",
"pen-square", "",
"pen-tool", "",
"pen", "",
"pencil-line", "",
"pencil-off", "",
"pencil-ruler", "",
"pencil", "",
"pentagon", "",
"percent-circle", "",
"percent-diamond", "",
"percent-square", "",
"percent", "",
"person-standing", "",
"philippine-peso", "",
"phone-call", "",
"phone-forwarded", "",
"phone-incoming", "",
"phone-missed", "",
"phone-off", "",
"phone-outgoing", "",
"phone", "",
"pi-square", "",
"pi", "",
"piano", "",
"pickaxe", "",
"picture-in-picture-2", "",
"picture-in-picture", "",
"pie-chart", "",
"piggy-bank", "",
"pilcrow-left", "",
"pilcrow-right", "",
"pilcrow-square", "",
"pilcrow", "",
"pill-bottle", "",
"pill", "",
"pin-off", "",
"pin", "",
"pipette", "",
"pizza", "",
"plane-landing", "",
"plane-takeoff", "",
"plane", "",
"play-circle", "",
"play-square", "",
"play", "",
"plug-2", "",
"plug-zap-2", "",
"plug-zap", "",
"plug", "",
"plus-circle", "",
"plus-square", "",
"plus", "",
"pocket-knife", "",
"pocket", "",
"podcast", "",
"pointer-off", "",
"pointer", "",
"popcorn", "",
"popsicle", "",
"pound-sterling", "",
"power-circle", "",
"power-off", "",
"power-square", "",
"power", "",
"presentation", "",
"printer-check", "",
"printer-x", "",
"printer", "",
"projector", "",
"proportions", "",
"puzzle", "",
"pyramid", "",
"qr-code", "",
"quote", "",
"rabbit", "",
"radar", "",
"radiation", "",
"radical", "",
"radio-receiver", "",
"radio-tower", "",
"radio", "",
"radius", "",
"rail-symbol", "",
"rainbow", "",
"rat", "",
"ratio", "",
"receipt-cent", "",
"receipt-euro", "",
"receipt-indian-rupee", "",
"receipt-japanese-yen", "",
"receipt-pound-sterling", "",
"receipt-russian-ruble", "",
"receipt-swiss-franc", "",
"receipt-text", "",
"receipt-turkish-lira", "",
"receipt", "",
"rectangle-circle", "",
"rectangle-ellipsis", "",
"rectangle-goggles", "",
"rectangle-horizontal", "",
"rectangle-vertical", "",
"recycle", "",
"redo-2", "",
"redo-dot", "",
"redo", "",
"refresh-ccw-dot", "",
"refresh-ccw", "",
"refresh-cw-off", "",
"refresh-cw", "",
"refrigerator", "",
"regex", "",
"remove-formatting", "",
"repeat-1", "",
"repeat-2", "",
"repeat", "",
"replace-all", "",
"replace", "",
"reply-all", "",
"reply", "",
"rewind", "",
"ribbon", "",
"rocket", "",
"rocking-chair", "",
"roller-coaster", "",
"rose", "",
"rotate-3-d", "",
"rotate-3d", "",
"rotate-ccw-key", "",
"rotate-ccw-square", "",
"rotate-ccw", "",
"rotate-cw-square", "",
"rotate-cw", "",
"route-off", "",
"route", "",
"router", "",
"rows-2", "",
"rows-3", "",
"rows-4", "",
"rows", "",
"rss", "",
"ruler-dimension-line", "",
"ruler", "",
"russian-ruble", "",
"sailboat", "",
"salad", "",
"sandwich", "",
"satellite-dish", "",
"satellite", "",
"saudi-riyal", "",
"save-all", "",
"save-off", "",
"save", "",
"scale-3-d", "",
"scale-3d", "",
"scale", "",
"scaling", "",
"scan-barcode", "",
"scan-eye", "",
"scan-face", "",
"scan-heart", "",
"scan-line", "",
"scan-qr-code", "",
"scan-search", "",
"scan-text", "",
"scan", "",
"scatter-chart", "",
"school-2", "",
"school", "",
"scissors-line-dashed", "",
"scissors-square-dashed-bottom", "",
"scissors-square", "",
"scissors", "",
"scooter", "",
"screen-share-off", "",
"screen-share", "",
"scroll-text", "",
"scroll", "",
"search-alert", "",
"search-check", "",
"search-code", "",
"search-slash", "",
"search-x", "",
"search", "",
"section", "",
"send-horizonal", "",
"send-horizontal", "",
"send-to-back", "",
"send", "",
"separator-horizontal", "",
"separator-vertical", "",
"server-cog", "",
"server-crash", "",
"server-off", "",
"server", "",
"settings-2", "",
"settings", "",
"shapes", "",
"share-2", "",
"share", "",
"sheet", "",
"shell", "",
"shelving-unit", "",
"shield-alert", "",
"shield-ban", "",
"shield-check", "",
"shield-close", "",
"shield-ellipsis", "",
"shield-half", "",
"shield-minus", "",
"shield-off", "",
"shield-plus", "",
"shield-question-mark", "",
"shield-question", "",
"shield-user", "",
"shield-x", "",
"shield", "",
"ship-wheel", "",
"ship", "",
"shirt", "",
"shopping-bag", "",
"shopping-basket", "",
"shopping-cart", "",
"shovel", "",
"shower-head", "",
"shredder", "",
"shrimp", "",
"shrink", "",
"shrub", "",
"shuffle", "",
"sidebar-close", "",
"sidebar-open", "",
"sidebar", "",
"sigma-square", "",
"sigma", "",
"signal-high", "",
"signal-low", "",
"signal-medium", "",
"signal-zero", "",
"signal", "",
"signature", "",
"signpost-big", "",
"signpost", "",
"siren", "",
"skip-back", "",
"skip-forward", "",
"skull", "",
"slack", "",
"slash-square", "",
"slash", "",
"slice", "",
"sliders-horizontal", "",
"sliders-vertical", "",
"sliders", "",
"smartphone-charging", "",
"smartphone-nfc", "",
"smartphone", "",
"smile-plus", "",
"smile", "",
"snail", "",
"snowflake", "",
"soap-dispenser-droplet", "",
"sofa", "",
"solar-panel", "",
"sort-asc", "",
"sort-desc", "",
"soup", "",
"space", "",
"spade", "",
"sparkle", "",
"sparkles", "",
"speaker", "",
"speech", "",
"spell-check-2", "",
"spell-check", "",
"spline-pointer", "",
"spline", "",
"split-square-horizontal", "",
"split-square-vertical", "",
"split", "",
"spool", "",
"spotlight", "",
"spray-can", "",
"sprout", "",
"square-activity", "",
"square-arrow-down-left", "",
"square-arrow-down-right", "",
"square-arrow-down", "",
"square-arrow-left", "",
"square-arrow-out-down-left", "",
"square-arrow-out-down-right", "",
"square-arrow-out-up-left", "",
"square-arrow-out-up-right", "",
"square-arrow-right-enter", "",
"square-arrow-right-exit", "",
"square-arrow-right", "",
"square-arrow-up-left", "",
"square-arrow-up-right", "",
"square-arrow-up", "",
"square-asterisk", "",
"square-bottom-dashed-scissors", "",
"square-centerline-dashed-horizontal", "",
"square-centerline-dashed-vertical", "",
"square-chart-gantt", "",
"square-check-big", "",
"square-check", "",
"square-chevron-down", "",
"square-chevron-left", "",
"square-chevron-right", "",
"square-chevron-up", "",
"square-code", "",
"square-dashed-bottom-code", "",
"square-dashed-bottom", "",
"square-dashed-kanban", "",
"square-dashed-mouse-pointer", "",
"square-dashed-top-solid", "",
"square-dashed", "",
"square-divide", "",
"square-dot", "",
"square-equal", "",
"square-function", "",
"square-gantt-chart", "",
"square-kanban", "",
"square-library", "",
"square-m", "",
"square-menu", "",
"square-minus", "",
"square-mouse-pointer", "",
"square-parking-off", "",
"square-parking", "",
"square-pause", "",
"square-pen", "",
"square-percent", "",
"square-pi", "",
"square-pilcrow", "",
"square-play", "",
"square-plus", "",
"square-power", "",
"square-radical", "",
"square-round-corner", "",
"square-scissors", "",
"square-sigma", "",
"square-slash", "",
"square-split-horizontal", "",
"square-split-vertical", "",
"square-square", "",
"square-stack", "",
"square-star", "",
"square-stop", "",
"square-terminal", "",
"square-user-round", "",
"square-user", "",
"square-x", "",
"square", "",
"squares-exclude", "",
"squares-intersect", "",
"squares-subtract", "",
"squares-unite", "",
"squircle-dashed", "",
"squircle", "",
"squirrel", "",
"stamp", "",
"star-half", "",
"star-off", "",
"star", "",
"stars", "",
"step-back", "",
"step-forward", "",
"stethoscope", "",
"sticker", "",
"sticky-note", "",
"stone", "",
"stop-circle", "",
"store", "",
"stretch-horizontal", "",
"stretch-vertical", "",
"strikethrough", "",
"subscript", "",
"subtitles", "",
"sun-dim", "",
"sun-medium", "",
"sun-moon", "",
"sun-snow", "",
"sun", "",
"sunrise", "",
"sunset", "",
"superscript", "",
"swatch-book", "",
"swiss-franc", "",
"switch-camera", "",
"sword", "",
"swords", "",
"syringe", "",
"table-2", "",
"table-cells-merge", "",
"table-cells-split", "",
"table-columns-split", "",
"table-config", "",
"table-of-contents", "",
"table-properties", "",
"table-rows-split", "",
"table", "",
"tablet-smartphone", "",
"tablet", "",
"tablets", "",
"tag", "",
"tags", "",
"tally-1", "",
"tally-2", "",
"tally-3", "",
"tally-4", "",
"tally-5", "",
"tangent", "",
"target", "",
"telescope", "",
"tent-tree", "",
"tent", "",
"terminal-square", "",
"terminal", "",
"test-tube-2", "",
"test-tube-diagonal", "",
"test-tube", "",
"test-tubes", "",
"text-align-center", "",
"text-align-end", "",
"text-align-justify", "",
"text-align-start", "",
"text-cursor-input", "",
"text-cursor", "",
"text-initial", "",
"text-quote", "",
"text-search", "",
"text-select", "",
"text-selection", "",
"text-wrap", "",
"text", "",
"theater", "",
"thermometer-snowflake", "",
"thermometer-sun", "",
"thermometer", "",
"thumbs-down", "",
"thumbs-up", "",
"ticket-check", "",
"ticket-minus", "",
"ticket-percent", "",
"ticket-plus", "",
"ticket-slash", "",
"ticket-x", "",
"ticket", "",
"tickets-plane", "",
"tickets", "",
"timer-off", "",
"timer-reset", "",
"timer", "",
"toggle-left", "",
"toggle-right", "",
"toilet", "",
"tool-case", "",
"toolbox", "",
"tornado", "",
"torus", "",
"touchpad-off", "",
"touchpad", "",
"towel-rack", "",
"tower-control", "",
"toy-brick", "",
"tractor", "",
"traffic-cone", "",
"train-front-tunnel", "",
"train-front", "",
"train-track", "",
"train", "",
"tram-front", "",
"transgender", "",
"trash-2", "",
"trash", "",
"tree-deciduous", "",
"tree-palm", "",
"tree-pine", "",
"trees", "",
"trello", "",
"trending-down", "",
"trending-up-down", "",
"trending-up", "",
"triangle-alert", "",
"triangle-dashed", "",
"triangle-right", "",
"triangle", "",
"trophy", "",
"truck-electric", "",
"truck", "",
"turkish-lira", "",
"turntable", "",
"turtle", "",
"tv-2", "",
"tv-minimal-play", "",
"tv-minimal", "",
"tv", "",
"twitch", "",
"twitter", "",
"type-outline", "",
"type", "",
"umbrella-off", "",
"umbrella", "",
"underline", "",
"undo-2", "",
"undo-dot", "",
"undo", "",
"unfold-horizontal", "",
"unfold-vertical", "",
"ungroup", "",
"university", "",
"unlink-2", "",
"unlink", "",
"unlock-keyhole", "",
"unlock", "",
"unplug", "",
"upload-cloud", "",
"upload", "",
"usb", "",
"user-2", "",
"user-check-2", "",
"user-check", "",
"user-circle-2", "",
"user-circle", "",
"user-cog-2", "",
"user-cog", "",
"user-key", "",
"user-lock", "",
"user-minus-2", "",
"user-minus", "",
"user-pen", "",
"user-plus-2", "",
"user-plus", "",
"user-round-check", "",
"user-round-cog", "",
"user-round-key", "",
"user-round-minus", "",
"user-round-pen", "",
"user-round-plus", "",
"user-round-search", "",
"user-round-x", "",
"user-round", "",
"user-search", "",
"user-square-2", "",
"user-square", "",
"user-star", "",
"user-x-2", "",
"user-x", "",
"user", "",
"users-2", "",
"users-round", "",
"users", "",
"utensils-crossed", "",
"utensils", "",
"utility-pole", "",
"van", "",
"variable", "",
"vault", "",
"vector-square", "",
"vegan", "",
"venetian-mask", "",
"venus-and-mars", "",
"venus", "",
"verified", "",
"vibrate-off", "",
"vibrate", "",
"video-off", "",
"video", "",
"videotape", "",
"view", "",
"voicemail", "",
"volleyball", "",
"volume-1", "",
"volume-2", "",
"volume-off", "",
"volume-x", "",
"volume", "",
"vote", "",
"wallet-2", "",
"wallet-cards", "",
"wallet-minimal", "",
"wallet", "",
"wallpaper", "",
"wand-2", "",
"wand-sparkles", "",
"wand", "",
"warehouse", "",
"washing-machine", "",
"watch", "",
"waves-arrow-down", "",
"waves-arrow-up", "",
"waves-ladder", "",
"waves", "",
"waypoints", "",
"webcam", "",
"webhook-off", "",
"webhook", "",
"weight-tilde", "",
"weight", "",
"wheat-off", "",
"wheat", "",
"whole-word", "",
"wifi-cog", "",
"wifi-high", "",
"wifi-low", "",
"wifi-off", "",
"wifi-pen", "",
"wifi-sync", "",
"wifi-zero", "",
"wifi", "",
"wind-arrow-down", "",
"wind", "",
"wine-off", "",
"wine", "",
"workflow", "",
"worm", "",
"wrap-text", "",
"wrench", "",
"x-circle", "",
"x-line-top", "",
"x-octagon", "",
"x-square", "",
"x", "",
"youtube", "",
"zap-off", "",
"zap", "",
"zodiac-aquarius", "",
"zodiac-aries", "",
"zodiac-cancer", "",
"zodiac-capricorn", "",
"zodiac-gemini", "",
"zodiac-leo", "",
"zodiac-libra", "",
"zodiac-ophiuchus", "",
"zodiac-pisces", "",
"zodiac-sagittarius", "",
"zodiac-scorpio", "",
"zodiac-taurus", "",
"zodiac-virgo", "",
"zoom-in", "",
"zoom-out", "",
BLANK()
)
VAR requestedStrokeWidth =
COALESCE(strokeWidth, 2)
VAR safeStrokeWidth =
SWITCH(
TRUE(),
ABS(requestedStrokeWidth - 1) < 0.001, 1,
ABS(requestedStrokeWidth - 1.5) < 0.001, 1.5,
ABS(requestedStrokeWidth - 2) < 0.001, 2,
ABS(requestedStrokeWidth - 2.5) < 0.001, 2.5,
2
)
VAR strokeWidthText =
SUBSTITUTE(FORMAT(safeStrokeWidth, "0.########"), ",", ".")
VAR rawSvgWithStroke =
IF(
ISBLANK(rawSvg),
BLANK(),
SWITCH(
safeStrokeWidth,
1, SUBSTITUTE(rawSvg, "stroke-width='2'", "stroke-width='1'"),
1.5, SUBSTITUTE(rawSvg, "stroke-width='2'", "stroke-width='1.5'"),
2.5, SUBSTITUTE(rawSvg, "stroke-width='2'", "stroke-width='2.5'"),
rawSvg
)
)
VAR tintedSvg =
IF(
ISBLANK(iconColorHex),
rawSvgWithStroke,
SUBSTITUTE(rawSvgWithStroke, "currentColor", iconColorHex)
)
VAR svgOpenEnd =
SEARCH(">", tintedSvg, 1, 0)
VAR svgOpenTag =
LEFT(tintedSvg, svgOpenEnd)
VAR safeRenderSize =
MAX(1, COALESCE(badgeSize, 24))
VAR renderSizeText =
FORMAT(INT(safeRenderSize), "0")
VAR resizedSvgOpenTag =
SUBSTITUTE(
SUBSTITUTE(
SUBSTITUTE(svgOpenTag, "width='24'", "width='" & renderSizeText & "'"),
"height='24'", "height='" & renderSizeText & "'"
),
">", " preserveAspectRatio='xMidYMid meet'>"
)
VAR svgInner =
MID(tintedSvg, svgOpenEnd + 1, LEN(tintedSvg) - svgOpenEnd - 6)
VAR safeBadgeLevel =
MIN(30, MAX(0, COALESCE(badgeSize, 18)))
VAR safePaddingLevel =
MIN(30, MAX(0, COALESCE(badgePadding, 4)))
VAR badgeRatio =
DIVIDE(safeBadgeLevel, 30, 0)
VAR safeBadgeSize =
24 * SQRT(badgeRatio)
VAR badgeOrigin =
DIVIDE(24 - safeBadgeSize, 2, 0)
VAR safePadding =
DIVIDE(safeBadgeSize * safePaddingLevel, 100, 0)
VAR fittedIconSize =
MAX(1, safeBadgeSize - (2 * safePadding))
VAR scaleFactor =
DIVIDE(fittedIconSize, 24, 1)
VAR scaleText =
SUBSTITUTE(FORMAT(scaleFactor, "0.########"), ",", ".")
VAR iconTranslate =
badgeOrigin + safePadding
VAR translateXText =
SUBSTITUTE(FORMAT(iconTranslate, "0.########"), ",", ".")
VAR translateYText =
SUBSTITUTE(FORMAT(iconTranslate, "0.########"), ",", ".")
VAR badgeScaleFactor =
DIVIDE(safeBadgeSize, 24, 1)
VAR badgeScaleText =
SUBSTITUTE(FORMAT(badgeScaleFactor, "0.########"), ",", ".")
VAR badgeTranslate =
badgeOrigin
VAR badgeTranslateText =
SUBSTITUTE(FORMAT(badgeTranslate, "0.########"), ",", ".")
VAR badgeMarkup =
IF(
ISBLANK(badgeColorHex) || safeBadgeSize = 0,
"",
""
)
VAR iconMarkup =
IF(
scaleFactor = 1,
svgInner,
"" & svgInner & ""
)
VAR finalSvg =
resizedSvgOpenTag & badgeMarkup & iconMarkup & ""
VAR encodedSvg =
SUBSTITUTE(finalSvg, "#", "%23")
RETURN
IF(
NOT ISBLANK(encodedSvg),
IF(
LEFT(encodedSvg, 18) = "data:image/svg+xml",
encodedSvg,
"data:image/svg+xml;utf8," & encodedSvg
)
)