import {createElement as $el} from "../utils_dom.js"; // Some svg repo : https://www.svgrepo.com/svg/326731/open-outline export let logoRgthree: string = ""; export async function logoRgthreeAsync(): Promise { if (logoRgthree) return logoRgthree; let baseUrl = null; if (window.location.pathname.includes("/rgthree/")) { // Try to find how many relatives paths we need to go back to hit ./rgthree/api const parts = window.location.pathname.split("/rgthree/")[1]?.split("/"); if (parts && parts.length) { baseUrl = parts.map(() => "../").join("") + "rgthree"; } } baseUrl = baseUrl || "./rgthree"; return fetch(`${baseUrl}/logo_markup.svg?fg=currentColor&cssClass=rgthree-logo&w=auto&h=auto`) .then((r) => r.text()) .then((t) => { if (t.length < 100) { t = ``; } logoRgthree = t; return t; }); } // Kick it off to cache upfront. logoRgthreeAsync(); export const github = ``; export const iconStarFilled = ` `; export const iconReplace = ` `; export const iconNode = ` `; export const iconGear = ` `; export const checkmark = ` `; export const logoCivitai = ` `; export const iconOutLink = ` `; export const link = ` `; export const pencil = ` `; export const dotdotdot = ` `; export const models = ` `; /** https://www.svgrepo.com/svg/402308/pencil */ export const pencilColored = ` `; /** https://www.svgrepo.com/svg/395640/save */ export const diskColored = ` `; /** https://www.svgrepo.com/svg/229838/folder */ export const folderColored = ` `; export const modelsColored = ` `; export const legoBlocksColored = ` `; export const legoBlockColored = ` `; export const gearColored = ` `; export function $svg(markup: string, attrs: {[key: string]: string}) { if (!markup.match(/^\s*