var __defProp = Object.defineProperty;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
const DATA$w = window.copyspell_ai_admin || {};
function log(...args) {
  if (!DATA$w.mode || DATA$w.mode !== "DEV") return;
  const stack = new Error().stack;
  const stackLines = stack.split("\n");
  let callerName = "";
  let funcName = "";
  let callerLines = [];
  for (let i = 2; i < Math.min(12, stackLines.length); i++) {
    const callerLine = stackLines[i] || "";
    const anonymousMatch = callerLine.match(/at\s+(.+?)\s+\(<anonymous>\)/);
    if (anonymousMatch) {
      const functionName = anonymousMatch[1].trim();
      callerLines.push([`%c${functionName}%c%c%c`, ""]);
      continue;
    }
    const match = callerLine.match(/at\s+(?:(.+?)\s+\()?(.+?):(\d+):(\d+)\)?/) || [];
    let callerFunction = match[1] || "";
    const callerFilePath = match[2] || "unknown";
    let callerFile = callerFilePath.split("/").pop().split("\\").pop();
    const callerLineNum = match[3] || "?";
    const callerColNum = match[4] || "?";
    const callerLink = `${callerFilePath}:${callerLineNum}:${callerColNum}`;
    if (callerFile.includes("load-scripts.php")) continue;
    let caller = `%c${callerFile}:${callerLineNum}%c`;
    if (i == 2) {
      callerName = `${callerFile.padEnd(30, " ")}${callerLineNum.padStart(5, " ")}`;
      funcName = callerFunction;
    }
    callerFunction = callerFunction || "";
    callerFunction = callerFunction.replace(".<anonymous>", "");
    if (i == 2) {
      callerName = `${callerFile.padEnd(30, " ")}${callerLineNum.padStart(5, " ")}`;
      funcName = callerFunction.padEnd(30, " ");
    }
    caller = `${caller}%c%c`;
    callerLines.push([caller, callerLink, callerFunction]);
  }
  console.groupCollapsed(
    "%c" + callerName,
    "background: #d7e5ffff; color:#444; padding: 3px 6px 2px; border-radius: 3px;",
    //'color:#888888; padding: 3px 6px 2px;',
    //'background: darkorange; color:white; padding: 3px 6px; margin-left: 4px; border-radius: 3px;',
    //'background: #4488FF; color:white; padding: 2px 4px; border-radius: 3px;',
    args[0]
  );
  console.log("%c" + funcName, "color:#888888; padding: 3px 6px 2px;");
  console.log(...args.slice(1));
  console.log("──────────────────────────────────────────────────────────────────");
  callerLines.forEach((line) => {
    if (line[1]) {
      console.log(
        line[0] + ` • %c` + line[1],
        "background: #4488FF; color:white; padding: 2px 4px; border-radius: 3px;",
        "background: transparent; color:#444444;",
        "background: darkorange; color:white; padding: 2px 4px; border-radius: 3px;",
        "background: transparent; color:#444444;",
        "font-size:8px; padding:4px 0; color:#4488FF;"
      );
    } else {
      console.log(
        line[0],
        "background: darkorange; color:white; padding: 2px 4px; border-radius: 3px;",
        "background: transparent; color:#444444;",
        "",
        ""
      );
    }
  });
  console.groupEnd();
}
const DATA$v = window.copyspell_ai_admin || {};
const { __: __$r, _x: _x$q, _n: _n$q, sprintf: sprintf$q } = wp.i18n;
async function noCreditsModal() {
  const modalOverlay = document.createElement("div");
  modalOverlay.className = "aai-modal-overlay";
  const modal = document.createElement("div");
  modal.className = "aai-modal";
  const modalContent = document.createElement("div");
  modalContent.className = "aai-modal-content";
  const logoDiv = document.createElement("div");
  logoDiv.className = "aai-modal-logo";
  logoDiv.textContent = "CopySpell AI";
  const modalLogo = document.createElement("img");
  modalLogo.src = DATA$v.logo;
  logoDiv.appendChild(modalLogo);
  const modalTitle = document.createElement("h2");
  modalTitle.className = "aai-modal-title";
  modalTitle.textContent = __$r(`You don't have enough credits.`, "copyspell-ai");
  const modalText = document.createElement("p");
  modalText.className = "aai-modal-text";
  modalText.textContent = __$r("Your credits are not enough for this action. Upgrade to the Premium License to get unlimited generations, priority support and lifetime updates.", "copyspell-ai");
  const offerDiv = document.createElement("div");
  offerDiv.style.cssText = "text-align: center; margin-top: 15px; padding: 20px; border-radius: 16px; background: #DDD;";
  const modalLabel = document.createElement("label");
  modalLabel.className = "aai-modal-label";
  modalLabel.textContent = __$r("LIMITED TIME", "copyspell-ai");
  const priceDiv = document.createElement("div");
  priceDiv.className = "aai-modal-price";
  const priceOld = document.createElement("div");
  priceOld.className = "aai-modal-price-old";
  priceOld.textContent = "€600";
  const priceNew = document.createElement("div");
  priceNew.className = "aai-modal-price-new";
  priceNew.textContent = "€400";
  const modalNote = document.createElement("div");
  modalNote.className = "aai-modal-note aai-modal-offer-note";
  modalNote.textContent = __$r("Early Bird Offer", "copyspell-ai");
  const buttonsDiv = document.createElement("div");
  buttonsDiv.className = "aai-modal-buttons aai-modal-buttons-upgrade";
  buttonsDiv.style.cssText = "margin-top: 15px; display: flex; gap: 10px; justify-content: flex-end;";
  const applyBtn = document.createElement("button");
  applyBtn.textContent = __$r("Upgrade to Premium", "copyspell-ai");
  applyBtn.className = "aai-btn aai-btn-primary medium";
  const cancelBtn = document.createElement("button");
  cancelBtn.textContent = __$r("Maybe later", "copyspell-ai");
  cancelBtn.className = "aai-btn aai-btn-secondary medium";
  const modalNote2 = document.createElement("div");
  modalNote2.className = "aai-modal-note";
  modalNote2.textContent = __$r("One-time payment • No AI subscription • No monthly fees", "copyspell-ai");
  buttonsDiv.appendChild(applyBtn);
  buttonsDiv.appendChild(cancelBtn);
  modalContent.appendChild(logoDiv);
  modalContent.appendChild(modalTitle);
  modalContent.appendChild(modalText);
  priceDiv.appendChild(priceOld);
  priceDiv.appendChild(priceNew);
  modalContent.appendChild(buttonsDiv);
  modalContent.appendChild(modalNote2);
  modal.appendChild(modalContent);
  modalOverlay.appendChild(modal);
  document.body.appendChild(modalOverlay);
  setTimeout(() => {
    modalOverlay.classList.add("active");
  }, 10);
  cancelBtn.onclick = () => {
    document.body.removeChild(modalOverlay);
    reject("cancelled");
  };
  applyBtn.onclick = () => {
    document.body.removeChild(modalOverlay);
    window.open("https://copyspell.ai/#home-pricing", "_blank");
    return true;
  };
  modalOverlay.onclick = (e) => {
    if (e.target === modalOverlay) {
      document.body.removeChild(modalOverlay);
      return false;
    }
  };
  document.addEventListener("keydown", function escapeHandler(e) {
    if (e.key === "Escape") {
      document.removeEventListener("keydown", escapeHandler);
      if (document.body.contains(modalOverlay)) {
        document.body.removeChild(modalOverlay);
      }
      return false;
    }
  });
}
let $$c = jQuery;
const DATA$u = window.copyspell_ai_admin || {};
const { __: __$q, _x: _x$p, _n: _n$p, sprintf: sprintf$p } = wp.i18n;
const TOOLS = {};
TOOLS.loadCSS = (href, id = null) => {
  const cssId = id || `aai-${href.split("/").pop().replace(/\W/g, "-")}`;
  if (document.getElementById(cssId)) {
    return;
  }
  href = window.copyspell_ai_admin ? window.copyspell_ai_admin.plugin_url + "/css/" + href : href;
  const link = document.createElement("link");
  link.id = cssId;
  link.rel = "stylesheet";
  link.type = "text/css";
  link.href = href;
  document.head.appendChild(link);
};
TOOLS.getCredits = async () => {
  let savedLicense = await TOOLS.loadOption("copyspell-ai-license");
  let request = {
    id: `REQ-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`,
    action: "get-credits",
    domain: DATA$u.domain,
    service: "copyspell-ai",
    version: DATA$u.version,
    signature: DATA$u.signature || ""
  };
  const response = await fetch("https://copyspell.actusanima.com/v1/credits", {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({
      request,
      user: {
        license: (savedLicense == null ? void 0 : savedLicense.key) || "",
        domain: window.location.hostname
      }
    })
  });
  const data = await response.json();
  if (data.error) {
    log("❌ Error fetching credits:", data.error || "Unknown error");
    TOOLS.showNotification(data.error || "Error fetching credits. Please check your license.", "error");
  } else {
    TOOLS.showNotification(`License valid. Credits remaining: ${data.totalCredits}`, "success");
    data.type = (savedLicense == null ? void 0 : savedLicense.type) || "free";
  }
  return data;
};
TOOLS.renderCredits = async (target) => {
  const creditsData = await TOOLS.getCredits();
  if (creditsData && creditsData.status === "success") {
    return TOOLS.displayCredits(creditsData, target);
  } else {
    let html = `
			<div class="aai-credits-error">
				<svg viewBox="0 0 24 24" width="16" height="16">
					<path fill="currentColor" d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"/>
				</svg>
				<span>${(creditsData == null ? void 0 : creditsData.error) || __$q("Error loading credits", "copyspell-ai")}</span>
			</div>
		`;
    if (!target) return `<div class="aai-credits-display">${html}</div>`;
    $$c(target).html(html);
  }
};
TOOLS.displayCredits = (data, target) => {
  const totalCredits = data.totalCredits || 0;
  const credits = data.credits || [];
  if (data.type == "lifetime" || data.type == "subscription") {
    let html = `
			<div class="aai-credit-badge aai-credit-badge-premium">
				Unlimeted Credits
			</div>
		`;
    if (!target) return `<div class="aai-credits-display aai-credits-premium">${html}</div>`;
    $$c(target).html(html).addClass("aai-credits-premium");
    return;
  }
  const typeLabels = {
    "free": "FREE",
    "add": "ADD",
    "bonus": "BONUS",
    "promo": "PROMO"
  };
  const typeColors = {
    "free": "#6b7280",
    "add": "#8b5cf6",
    "bonus": "#f59e0b",
    "promo": "#3b82f6"
  };
  let creditsHTML = `
		<a href="https://copyspell.ai/#home-pricing" target="_blank" class="aai-btn aai-btn-secondary aai-credits-refresh">
			${__$q("Buy Premium", "copyspell-ai")}
		</a>
		<div class="aai-credits-container">
			<div class="aai-credits-details">`;
  credits.forEach((credit) => {
    let typeLabel = typeLabels[credit.type] || credit.type.toUpperCase();
    const typeColor = typeColors[credit.type] || "#6b7280";
    if (typeLabel == "ADD") typeLabel = "ADDED";
    creditsHTML += `
				<div class="aai-credit-badge" style="background: ${typeColor}">
					${typeLabel}: ${credit.credits}`;
    if (credit.expire) {
      const expireDate = new Date(credit.expire);
      const daysUntilExpire = Math.ceil((expireDate - /* @__PURE__ */ new Date()) / (1e3 * 60 * 60 * 24));
      creditsHTML += `
					<span class="aai-badge-expiry">
						<svg viewBox="0 0 24 24" width="12" height="12">
							<path fill="currentColor" d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67z"/>
						</svg>
						${daysUntilExpire}d
					</span>`;
    }
    creditsHTML += `
				</div>`;
  });
  creditsHTML += `
			</div>
			<div class="aai-credits-main">
				<div class="aai-credits-info">
					<div class="aai-credits-total">${totalCredits.toLocaleString()}</div>
					<div class="aai-credits-label">${__$q("Credits", "copyspell-ai")}</div>
				</div>
			</div>
		</div>`;
  if (!target) return `<div class="aai-credits-display">${creditsHTML}</div>`;
  $$c(target).html(creditsHTML);
};
TOOLS.enoughCredits = (action) => {
  let creditsNeeded = 1;
  if (!TOOLS.totalCredits) return false;
  if (action.includes("-refine") || action.includes("-change")) creditsNeeded = 1;
  if (action.includes("keywords")) creditsNeeded = 1;
  if (action.includes("-suggest")) creditsNeeded = 2;
  if (action.includes("-suggest-descr")) creditsNeeded = 3;
  if (action.includes("search")) creditsNeeded = 3;
  if (action.includes("-content")) creditsNeeded = 4;
  if (action.includes("bulk")) creditsNeeded = 6;
  if (TOOLS.totalCredits < creditsNeeded) return false;
  return TOOLS.totalCredits;
};
TOOLS.isAllowed = async (action) => {
  TOOLS.totalCredits = await TOOLS.getCredits();
  TOOLS.totalCredits = TOOLS.totalCredits.totalCredits;
  let hasCredits = false;
  const license = await TOOLS.loadOption("copyspell-ai-license");
  if (action) hasCredits = TOOLS.enoughCredits(action);
  if (license.type == "lifetime" || license.type == "subscription" || hasCredits) return true;
  noCreditsModal();
  return false;
};
TOOLS.showNotification = (message, type = "info") => {
  const alertClass = type === "error" ? "notice-error" : "notice-success";
  const $notice = $$c(`<div class="notice ${alertClass} is-dismissible"><p>${message}</p></div>`);
  $$c(".aai-admin-stores").prepend($notice);
  setTimeout(() => {
    $notice.fadeOut(300, function() {
      $$c(this).remove();
    });
  }, 3e3);
};
TOOLS.loadOption = (optionName) => {
  var _a;
  if (!((_a = window.copyspell_ai_admin) == null ? void 0 : _a.ajax_url)) {
    log("❌ No AJAX URL provided for loading option.");
    return false;
  }
  return new Promise((resolve, reject2) => {
    $$c.ajax({
      url: window.copyspell_ai_admin.ajax_url,
      type: "POST",
      data: {
        action: "copyspell_ai_load_option",
        nonce: window.copyspell_ai_admin.nonce,
        name: optionName
      },
      success: function(response) {
        var _a2;
        if (response.success) {
          return resolve(response.data.options);
        } else {
          log("❌ " + (((_a2 = response.data) == null ? void 0 : _a2.message) || "Error loading option"), "error");
          return resolve(false);
        }
      },
      error: function(error) {
        log("❌ Error loading option:", error.status, error.responseText, optionName);
        return resolve(false);
      }
    });
  });
};
TOOLS.saveOptions = (options, val) => {
  var _a, _b, _c, _d;
  let name = "";
  let dataToSave;
  if (!options) {
    log("❌ No options provided for saving.");
  }
  if (typeof options === "string") {
    name = options;
    dataToSave = val;
  } else {
    dataToSave = JSON.parse(JSON.stringify(options));
    (_a = dataToSave.sequences) == null ? true : delete _a.mainDefault;
    (_b = dataToSave.sequences) == null ? true : delete _b.keywordsDefault;
    (_c = dataToSave.sequences) == null ? true : delete _c.searchDefault;
  }
  if (Array.isArray(dataToSave)) {
    dataToSave = JSON.stringify(dataToSave);
  }
  if (!((_d = window.copyspell_ai_admin) == null ? void 0 : _d.ajax_url)) {
    log("❌ No AJAX URL provided for saving options.");
    return false;
  }
  return new Promise((resolve, reject2) => {
    $$c.ajax({
      url: window.copyspell_ai_admin.ajax_url,
      type: "POST",
      data: {
        action: "copyspell_ai_save_settings",
        nonce: window.copyspell_ai_admin.nonce,
        options: dataToSave,
        name
      },
      success: function(response) {
        var _a2, _b2;
        if (response.success) {
          if (response.data && response.data.options) {
            return resolve(response.data.options);
          }
          return resolve(options);
        } else {
          log("❌ " + (((_a2 = response.data) == null ? void 0 : _a2.message) || "Error saving settings"), "error");
          TOOLS.showNotification(((_b2 = response.data) == null ? void 0 : _b2.message) || "Error saving settings", "error");
          return resolve(false);
        }
      },
      error: function(error) {
        log("❌ Error saving settings:", error.status, error.responseText);
        TOOLS.showNotification("Error saving settings. Please try again.", "error");
        return resolve(false);
      }
    });
  });
};
TOOLS.deepMerge = (target, source) => {
  if (!target || typeof target !== "object" || Array.isArray(target)) {
    return source;
  }
  if (!source || typeof source !== "object") {
    return target;
  }
  if (Array.isArray(source)) {
    return [...source];
  }
  const result = { ...target };
  for (const key in source) {
    if (source.hasOwnProperty(key)) {
      const sourceValue = source[key];
      const targetValue = result[key];
      if (sourceValue && typeof sourceValue === "object" && !Array.isArray(sourceValue) && targetValue && typeof targetValue === "object" && !Array.isArray(targetValue)) {
        result[key] = TOOLS.deepMerge(targetValue, sourceValue);
      } else {
        if (Array.isArray(sourceValue)) {
          result[key] = [...sourceValue];
        } else if (sourceValue && typeof sourceValue === "object") {
          result[key] = { ...sourceValue };
        } else {
          result[key] = sourceValue;
        }
      }
    }
  }
  return result;
};
TOOLS.estimateTokens = (text, language) => {
  const charPerToken = {
    en: 4,
    es: 3.8,
    fr: 3.7,
    de: 3.5,
    el: 3.2,
    zh: 1.5,
    ja: 1.6,
    ko: 2,
    ar: 2.5,
    ru: 2.5,
    he: 2.8,
    hi: 2.5,
    th: 2.2,
    ka: 2.8,
    hr: 3.5,
    no: 3.5,
    pt: 3.8,
    default: 4
  };
  language = language || TOOLS.detectLanguage(text);
  const avg = charPerToken[language] || charPerToken.default;
  return Math.ceil(text.length / avg);
};
TOOLS.createElementFromHTML = (htmlString) => {
  const div = document.createElement("div");
  div.innerHTML = htmlString.trim();
  return div.firstChild;
};
TOOLS.detectLanguage = (text) => {
  const scripts = {
    el: /[Α-ωά-ώ]/g,
    // Greek
    zh: /[一-龯]/g,
    // Chinese
    ja: /[ぁ-んァ-ン]/g,
    // Japanese
    ko: /[가-힣]/g,
    // Korean
    ar: /[ء-ي]/g,
    // Arabic
    ru: /[а-яё]/gi,
    // Russian
    he: /[א-ת]/g,
    // Hebrew
    hi: /[अ-ह]/g,
    // Hindi
    th: /[ก-๙]/g,
    // Thai
    ka: /[ა-ჰ]/g,
    // Georgian
    hr: /[čšžćđ]/gi,
    // Croatian/Serbian Latin
    no: /[øæå]/gi,
    // Norwegian
    de: /[ßüöä]/g,
    // German
    fr: /[éèêëàâä]/g,
    // French
    es: /[áéíóúüñ]/g,
    // Spanish
    pt: /[ãõç]/g
    // Portuguese
  };
  const counts = {};
  for (const [lang, regex] of Object.entries(scripts)) {
    const matches = text.match(regex);
    counts[lang] = matches ? matches.length : 0;
  }
  let topLang = "en";
  let maxCount = 0;
  for (const [lang, count] of Object.entries(counts)) {
    if (count > maxCount) {
      maxCount = count;
      topLang = lang;
    }
  }
  const totalChars = text.length;
  const threshold = 0.3;
  if (maxCount / totalChars >= threshold) {
    return topLang;
  }
  return "en";
};
TOOLS.models = (models, action = "id", action2) => {
  return getModelById(action, action2);
  function getModelById(property, property2) {
    if (property2) {
      return models.map((model) => {
        return {
          [property]: model[property],
          [property2]: model[property2]
        };
      });
    }
    return models.map((model) => model[property]);
  }
};
if (document.readyState === "loading") {
  document.addEventListener("DOMContentLoaded", async () => {
    if (!TOOLS.totalCredits && TOOLS.totalCredits !== 0) ;
  });
} else {
  (async () => {
    if (!TOOLS.totalCredits && TOOLS.totalCredits !== 0) ;
  })();
}
const DATA$t = window.copyspell_ai_admin || {};
class wpAPI {
  // MARK: Constructor
  // ────────────────────────────────────
  constructor() {
  }
  // MARK: Get Post
  // ────────────────────────────────────
  // Fetches a post by ID
  // ────────────────────────────────────
  async getPost(id, type = "post") {
    if (type == "product") {
      return await this.getProduct(id);
    }
    try {
      let result = await wp.apiFetch({ path: `/wp/v2/posts/${id}` });
      return result;
    } catch (error) {
      return this.error(error);
    }
  }
  // MARK: Get Product
  // ────────────────────────────────────
  // Fetches a product by ID
  // ────────────────────────────────────
  async getProduct(id) {
    try {
      let result = await wp.apiFetch({ path: `/wc/v3/products/${id}` });
      return result;
    } catch (error) {
      return this.error(error);
    }
  }
  // MARK: Create Product
  // ────────────────────────────────────
  // Creates a new WooCommerce product
  // ────────────────────────────────────
  async createProduct(data) {
    try {
      let result = await wp.apiFetch({
        path: `/wc/v3/products`,
        method: "POST",
        data
      });
      return result;
    } catch (error) {
      return this.error(error);
    }
  }
  // MARK: Update Product
  // ────────────────────────────────────
  // Updates an existing WooCommerce product
  // ────────────────────────────────────
  async updateProduct(id, data) {
    try {
      let result = await wp.apiFetch({
        path: `/wc/v3/products/${id}`,
        method: "PUT",
        data
      });
      return result;
    } catch (error) {
      return this.error(error);
    }
  }
  // MARK: Batch Update Products
  // ────────────────────────────────────
  // Updates multiple WooCommerce products in a single request
  // ────────────────────────────────────
  async batchUpdateProducts(updates) {
    try {
      let result = await wp.apiFetch({
        path: `/wc/v3/products/batch`,
        method: "POST",
        data: {
          update: updates
          // Array of {id, ...fields}
        }
      });
      return result;
    } catch (error) {
      return this.error(error);
    }
  }
  // MARK: Get Meta
  // ────────────────────────────────────
  async getMeta(id, name, type = "post") {
    if (!id) return null;
    if (type == "product") {
      let product = await this.getProduct(id);
      if (product.error) return product;
      let meta2 = product.meta_data.find((meta3) => meta3.key === name);
      return meta2 ? meta2.value : null;
    }
    let post = await this.getPost(id, type);
    if (post.error) return post;
    let meta = post.meta.find((meta2) => meta2.key === name);
    return meta ? meta.value : null;
  }
  // MARK: Add Meta to Post
  // ────────────────────────────────────
  async addMeta(id, name, value) {
    let post = await this.getPost(id);
    if (post.error) return post;
    let existingMeta = post.meta.find((meta) => meta.key === name);
    if (existingMeta) {
      existingMeta.value = value;
    } else {
      post.meta.push({ key: name, value });
    }
    let updatedPost = await this.updatePost(id, post);
    return updatedPost;
  }
  // MARK: Add Meta to Product
  // ────────────────────────────────────
  async addProductMeta(id, name, value) {
    if (!id) return;
    if (Array.isArray(value) || typeof value === "object" && value !== null) {
      value = JSON.stringify(value);
    }
    let product = await this.getProduct(id);
    if (product.error) return product;
    let existingMeta = product.meta_data.find((meta) => meta.key === name);
    if (existingMeta) {
      existingMeta.value = value;
    } else {
      product.meta_data.push({ key: name, value });
    }
    let updatedProduct = await this.updateProduct(id, product);
    return updatedProduct;
  }
  // MARK: Get Option
  // ────────────────────────────────────
  // Gets a WordPress option value
  // ────────────────────────────────────
  async getOption(optionName) {
    var _a;
    try {
      let formData = new FormData();
      formData.append("action", "copyspell_ai_load_option");
      formData.append("name", optionName);
      formData.append("nonce", DATA$t.nonce);
      let response = await fetch(DATA$t.ajax_url || "/wp-admin/admin-ajax.php", {
        method: "POST",
        body: formData
      });
      let result = await response.json();
      if (result.success) {
        return result.data.options;
      } else {
        return this.error(((_a = result.data) == null ? void 0 : _a.message) || "Failed to get option");
      }
    } catch (error) {
      return this.error(error);
    }
  }
  // MARK: Save Option
  // ────────────────────────────────────
  // Saves a WordPress option value
  // ────────────────────────────────────
  async saveOption(optionName, value) {
    var _a;
    try {
      let formData = new FormData();
      formData.append("action", "copyspell_ai_save_settings");
      formData.append("name", optionName);
      formData.append("options", typeof value === "object" ? JSON.stringify(value) : value);
      formData.append("nonce", DATA$t.nonce);
      let response = await fetch(DATA$t.ajax_url || "/wp-admin/admin-ajax.php", {
        method: "POST",
        body: formData
      });
      let result = await response.json();
      if (result.success) {
        return result.data.options;
      } else {
        return this.error(((_a = result.data) == null ? void 0 : _a.message) || "Failed to save option");
      }
    } catch (error) {
      return this.error(error);
    }
  }
  // MARK: Error Message
  // ────────────────────────────────────
  error(error) {
    let message = (error == null ? void 0 : error.message) || "API error";
    console.groupCollapsed("%c" + message, "padding:2px 8px; background:#fff2ac;");
    console.log((new Error().stack || "").split("\n")[2]);
    console.groupEnd();
    return { error: (error == null ? void 0 : error.message) || error || "API error" };
  }
}
const wpAPI$1 = new wpAPI();
const DATA$s = window.copyspell_ai_admin || {};
const { __: __$p, _x: _x$o, _n: _n$o, sprintf: sprintf$o } = wp.i18n;
async function getProductData(id = ((_a) => (_a = DATA$s.post) == null ? void 0 : _a.id)(), mode = "full") {
  var _a2, _b;
  if (!id) {
    return {};
  }
  let product = DATA$s.product;
  if (!DATA$s.product || DATA$s.product.id !== id) {
    product = await wpAPI$1.getPost(id, "product");
  }
  DATA$s.product = product;
  let data = {
    id: product.id,
    slug: product.slug,
    title: product.name,
    excerpt: product.short_description,
    content: product.description,
    categories: product.categories.map((cat) => cat.name) || null,
    tags: product.tags || null,
    brands: product.brands || null,
    meta_data: product.meta_data || null,
    regular_price: product.regular_price || null,
    sale_price: product.sale_price || null,
    images: product.images || null,
    imageUrls: ((_a2 = product.images) == null ? void 0 : _a2.map((img) => img.src || img.url || img.source_url || "")) || null,
    attributes: ((_b = product.attributes) == null ? void 0 : _b.map((attr) => {
      var _a3;
      return {
        name: decodeURIComponent(attr.name || ""),
        options: ((_a3 = attr.options) == null ? void 0 : _a3.map((opt) => decodeURIComponent(opt))) || null
      };
    })) || null,
    modified: product.date_modified || null,
    url: decodeURIComponent(product.permalink || "")
    //stock_quantity: product.stock_quantity || 0,
    //stock_status: product.stock_status || null,
    //date_on_sale_from: product.date_on_sale_from || null,
    //date_on_sale_to: product.date_on_sale_to || null,
  };
  if (data.regular_price) data.regular_price += " " + DATA$s.woocommerce.currency;
  if (data.sale_price) data.sale_price += " " + DATA$s.woocommerce.currency;
  if (mode == "clean") {
    data = await cleanupProductData(data);
  }
  return data;
}
async function cleanupProductData(data) {
  let productData = JSON.parse(JSON.stringify(data || DATA$s.post));
  delete productData.slug;
  delete productData.images;
  delete productData.imageUrls;
  delete productData.meta_data;
  delete productData.postType;
  delete productData.author;
  delete productData.status;
  Object.keys(productData).forEach((key) => {
    if (productData[key] === null || Array.isArray(productData[key]) && productData[key].length === 0) {
      delete productData[key];
    }
  });
  return productData;
}
function markdownToHTML(markdown) {
  if (!markdown || typeof markdown !== "string") return "";
  let html = markdown;
  html = html.replace(/^\*\*\*$/gim, "<hr>");
  html = html.replace(/^---$/gim, "<hr>");
  html = html.replace(/^___$/gim, "<hr>");
  html = html.replace(/^#### (.*$)/gim, "<h4>$1</h4>");
  html = html.replace(/^### (.*$)/gim, "<h3>$1</h3>");
  html = html.replace(/^## (.*$)/gim, "<h2>$1</h2>");
  html = html.replace(/^# (.*$)/gim, "<h1>$1</h1>");
  html = html.replace(/^\*   (.+)$/gim, "<li>$1</li>");
  html = html.replace(/^- (.+)$/gim, "<li>$1</li>");
  html = html.replace(/^\+ (.+)$/gim, "<li>$1</li>");
  html = html.replace(/(<li>.*<\/li>\n?)+/gim, function(match) {
    return "<ul>" + match + "</ul>";
  });
  html = html.replace(/^\d+\.\s+(.+)$/gim, "<li>$1</li>");
  html = html.replace(/(<li>.*<\/li>(?:\n|$))+/gim, function(match) {
    if (!match.includes("<ul>")) {
      return "<ol>" + match + "</ol>";
    }
    return match;
  });
  html = html.replace(/\*\*\*(.+?)\*\*\*/gim, "<strong><em>$1</em></strong>");
  html = html.replace(/\*\*(.+?)\*\*/gim, "<strong>$1</strong>");
  html = html.replace(/\*(.+?)\*/gim, "<em>$1</em>");
  html = html.replace(/___(.+?)___/gim, "<strong><em>$1</em></strong>");
  html = html.replace(/__(.+?)__/gim, "<strong>$1</strong>");
  html = html.replace(/_(.+?)_/gim, "<em>$1</em>");
  html = html.replace(/\[([^\]]+)\]\(([^)]+)\)/gim, '<a href="$2" target="_blank" rel="noopener">$1</a>');
  html = html.replace(/`([^`]+)`/gim, "<code>$1</code>");
  html = html.replace(/^> (.+)$/gim, "<blockquote>$1</blockquote>");
  html = html.replace(/\n\n/gim, "</p><p>");
  html = "<p>" + html + "</p>";
  html = html.replace(/<p><\/p>/gim, "");
  html = html.replace(/<p>(\s*<(h[1-6]|hr|ul|ol|blockquote))/gim, "<$2");
  html = html.replace(/(<\/(h[1-6]|hr|ul|ol|blockquote)>)\s*<\/p>/gim, "$1");
  html = html.replace(/\n/gim, "<br>");
  html = html.replace(/<br>\s*<br>/gim, "<br>");
  return html.trim();
}
async function customRefinement() {
  return new Promise((resolve, reject2) => {
    const modalOverlay = document.createElement("div");
    modalOverlay.className = "aai-modal-overlay aai-custom-prompt-modal";
    const modal = document.createElement("div");
    modal.className = "aai-modal";
    const modalContent = document.createElement("div");
    modalContent.className = "aai-modal-content";
    const textarea = document.createElement("textarea");
    textarea.className = "aai-custom-refinement-textarea aai-textarea";
    textarea.placeholder = __$p("How would you like me to change this content?", "copyspell-ai") || "Enter your custom refinement prompt...";
    const buttonsDiv = document.createElement("div");
    buttonsDiv.style.cssText = "margin-top: 15px; display: flex; gap: 10px; justify-content: flex-end;";
    const cancelBtn = document.createElement("button");
    cancelBtn.textContent = "Cancel";
    cancelBtn.className = "aai-btn aai-btn-secondary medium";
    const applyBtn = document.createElement("button");
    applyBtn.textContent = "Apply";
    applyBtn.className = "aai-btn aai-btn-primary medium";
    buttonsDiv.appendChild(cancelBtn);
    buttonsDiv.appendChild(applyBtn);
    modalContent.appendChild(textarea);
    modalContent.appendChild(buttonsDiv);
    modal.appendChild(modalContent);
    modalOverlay.appendChild(modal);
    document.body.appendChild(modalOverlay);
    textarea.focus();
    cancelBtn.onclick = () => {
      document.body.removeChild(modalOverlay);
      reject2("cancelled");
    };
    applyBtn.onclick = () => {
      const customPrompt = textarea.value.trim();
      if (customPrompt) {
        document.body.removeChild(modalOverlay);
        resolve(customPrompt);
      }
    };
    modalOverlay.onclick = (e) => {
      if (e.target === modalOverlay) {
        document.body.removeChild(modalOverlay);
        resolve(false);
      }
    };
    document.addEventListener("keydown", function escapeHandler(e) {
      if (e.key === "Escape") {
        document.removeEventListener("keydown", escapeHandler);
        if (document.body.contains(modalOverlay)) {
          document.body.removeChild(modalOverlay);
        }
        resolve(false);
      }
    });
  });
}
const scriptRel = "modulepreload";
const assetsURL = function(dep) {
  return "/" + dep;
};
const seen = {};
const __vitePreload = function preload(baseModule, deps, importerUrl) {
  let promise = Promise.resolve();
  if (deps && deps.length > 0) {
    let allSettled2 = function(promises) {
      return Promise.all(
        promises.map(
          (p) => Promise.resolve(p).then(
            (value) => ({ status: "fulfilled", value }),
            (reason) => ({ status: "rejected", reason })
          )
        )
      );
    };
    document.getElementsByTagName("link");
    const cspNonceMeta = document.querySelector(
      "meta[property=csp-nonce]"
    );
    const cspNonce = (cspNonceMeta == null ? void 0 : cspNonceMeta.nonce) || (cspNonceMeta == null ? void 0 : cspNonceMeta.getAttribute("nonce"));
    promise = allSettled2(
      deps.map((dep) => {
        dep = assetsURL(dep);
        if (dep in seen) return;
        seen[dep] = true;
        const isCss = dep.endsWith(".css");
        const cssSelector = isCss ? '[rel="stylesheet"]' : "";
        if (document.querySelector(`link[href="${dep}"]${cssSelector}`)) {
          return;
        }
        const link = document.createElement("link");
        link.rel = isCss ? "stylesheet" : scriptRel;
        if (!isCss) {
          link.as = "script";
        }
        link.crossOrigin = "";
        link.href = dep;
        if (cspNonce) {
          link.setAttribute("nonce", cspNonce);
        }
        document.head.appendChild(link);
        if (isCss) {
          return new Promise((res, rej) => {
            link.addEventListener("load", res);
            link.addEventListener(
              "error",
              () => rej(new Error(`Unable to preload CSS for ${dep}`))
            );
          });
        }
      })
    );
  }
  function handlePreloadError(err) {
    const e = new Event("vite:preloadError", {
      cancelable: true
    });
    e.payload = err;
    window.dispatchEvent(e);
    if (!e.defaultPrevented) {
      throw err;
    }
  }
  return promise.then((res) => {
    for (const item of res || []) {
      if (item.status !== "rejected") continue;
      handlePreloadError(item.reason);
    }
    return baseModule().catch(handlePreloadError);
  });
};
const DATA$r = window.copyspell_ai_admin || {};
let OPT$6 = DATA$r.options || {};
const CACHE_DURATION = 12 * 60 * 60 * 1e3;
const CACHE_KEY_PREFIX = "copyspell_ai_models_";
const AIapi = {};
AIapi.models = {};
AIapi.getModels = async (provider = "google", forceRefresh = false) => {
  if (!forceRefresh) {
    let cached = AIapi.getCachedModels(provider);
    if (cached) {
      log(`📦 Using cached models for ${provider}`);
      return cached;
    }
  }
  const { request, user } = await AIapi.prepare(provider, `ai-${provider}-models`);
  let response = {};
  try {
    response = await fetch(`https://copyspell.actusanima.com/v1/ai/${provider}/models`, {
      method: "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify({ request, user })
      //signal: controller.signal
    });
  } catch (err) {
    const error = err.name === "AbortError" ? "Request timed out" : err.message;
    log(`❌ Server error (${response.status}):`, error);
    return;
  }
  if (!response.ok) {
    const errorData = await response.json().catch(() => ({ error: `Server error (${response.status})` }));
    log(`❌ Server error (${response.status}):`, errorData);
    return;
  }
  response = await response.json();
  AIapi.cacheModels(provider, response);
  return response;
};
AIapi.getCachedModels = (provider) => {
  try {
    const cacheKey = CACHE_KEY_PREFIX + provider;
    const cached = localStorage.getItem(cacheKey);
    if (!cached) return null;
    const { data, timestamp } = JSON.parse(cached);
    const now = Date.now();
    if (now - timestamp < CACHE_DURATION) {
      return data;
    }
    localStorage.removeItem(cacheKey);
    return null;
  } catch (err) {
    log(`⚠️ Error reading models cache for ${provider}:`, err.message);
    return null;
  }
};
AIapi.cacheModels = (provider, data) => {
  try {
    const cacheKey = CACHE_KEY_PREFIX + provider;
    const cacheData = {
      data,
      timestamp: Date.now()
    };
    localStorage.setItem(cacheKey, JSON.stringify(cacheData));
    log(`💾 Cached models for ${provider}`);
  } catch (err) {
    log(`⚠️ Error caching models for ${provider}:`, err.message);
  }
};
AIapi.clearModelsCache = (provider = null) => {
  try {
    if (provider) {
      localStorage.removeItem(CACHE_KEY_PREFIX + provider);
      log(`🗑️ Cleared models cache for ${provider}`);
    } else {
      const keys = Object.keys(localStorage).filter((k) => k.startsWith(CACHE_KEY_PREFIX));
      keys.forEach((k) => localStorage.removeItem(k));
      log(`🗑️ Cleared all models cache (${keys.length} providers)`);
    }
  } catch (err) {
    log(`⚠️ Error clearing models cache:`, err.message);
  }
};
AIapi.listModels = async (provider = "google") => {
  const { request, user } = await AIapi.prepare(provider, `ai-${provider}-list`);
  let response = {};
  try {
    response = await fetch(`https://copyspell.actusanima.com/v1/ai/${provider}/list`, {
      method: "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify({ request, user })
      //signal: controller.signal
    });
  } catch (err) {
    const error = err.name === "AbortError" ? "Request timed out" : err.message;
    log(`❌ Server error (${response.status}):`, error);
    return;
  }
  if (!response.ok) {
    const errorData = await response.json().catch(() => ({ error: `Server error (${response.status})` }));
    log(`❌ Server error (${response.status}):`, errorData);
    return;
  }
  response = await response.json();
  return response;
};
AIapi.prepare = async (provider, action) => {
  let license = await TOOLS.loadOption("copyspell-ai-license");
  let apiKeys = {};
  let providers = Object.keys(OPT$6.api);
  providers.forEach((provider2) => {
    var _a;
    if (((_a = OPT$6.api[provider2]) == null ? void 0 : _a.status) == "valid") {
      apiKeys[provider2] = OPT$6.api[provider2].key || "";
    }
  });
  let request = {
    id: `REQ-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`,
    app: "copyspell",
    action
  };
  let user = {
    wordpress: DATA$r.wordpress_version,
    woocommerce: DATA$r.woocommerce.version,
    license: license.key || "",
    keys: apiKeys
  };
  return { request, user };
};
AIapi.google = {};
AIapi.google.checkAPIKey = async (apiKey) => {
  try {
    let models = await fetch(`https://generativelanguage.googleapis.com/v1beta/models?key=${apiKey}&pageSize=1000`);
    if (models.ok) {
      models = await models.json();
      if (!models.models) {
      }
      models = models.models || [];
      console.log("GOOGLE MODELS", models);
      log("GOOGLE MODELS", models);
    } else {
      return { valid: false, error: `API key validation failed` };
    }
    AIapi.models = await AIapi.getModels("all", true);
    return { valid: true, models };
  } catch (error) {
    if (error.status === 401 || error.status === 403) {
      return { valid: false, error: "Invalid API key or insufficient permissions" };
    } else if (error.status === 429) {
      return { valid: true, error: "API key is valid but rate limited" };
    } else {
      return { valid: false, error: error.message || "API key validation failed" };
    }
  }
};
AIapi.groq = {};
AIapi.groq.checkAPIKey = async (apiKey) => {
  try {
    const response = await fetch("https://api.groq.com/openai/v1/models", {
      method: "GET",
      headers: {
        "Authorization": `Bearer ${apiKey}`,
        "Content-Type": "application/json"
      }
    });
    if (!response.ok) {
      const status = response.status;
      if (status === 401 || status === 403) {
        return { valid: false, error: "Invalid API key or insufficient permissions" };
      } else if (status === 429) {
        return { valid: true, error: "API key is valid but rate limited" };
      } else {
        return { valid: false, error: `API request failed with status ${status}` };
      }
    }
    const data = await response.json();
    const models = data.data || [];
    AIapi.models = await AIapi.getModels("all", true);
    return { valid: true, models };
  } catch (error) {
    return { valid: false, error: error.message || "API key validation failed" };
  }
};
AIapi.openai = {};
AIapi.openai.checkAPIKey = async (apiKey) => {
  try {
    const { default: OpenAI } = await __vitePreload(async () => {
      const { default: OpenAI2 } = await import("https://cdn.skypack.dev/openai@4.67.1");
      return { default: OpenAI2 };
    }, true ? [] : void 0);
    const tempClient = new OpenAI({
      apiKey,
      dangerouslyAllowBrowser: true
    });
    let tst = await tempClient.models.list();
    AIapi.models = await AIapi.getModels("all", true);
    return { valid: true };
  } catch (error) {
    log("❌ AI --- openAI --- checkAPIKey ---", error);
    if (error.status === 401) {
      return { valid: false, error: "Invalid API key" };
    } else if (error.status === 403) {
      return { valid: false, error: "API key does not have required permissions" };
    } else if (error.status === 429) {
      return { valid: false, error: "Rate limit exceeded" };
    } else {
      return { valid: false, error: error.message || "Unknown error occurred" };
    }
  }
};
AIapi.github = {};
AIapi.github.checkAPIKey = async (apiKey) => {
  var _a;
  try {
    const aiInference = await __vitePreload(() => import("https://cdn.skypack.dev/@azure-rest/ai-inference"), true ? [] : void 0);
    const coreAuth = await __vitePreload(() => import("https://cdn.skypack.dev/@azure/core-auth"), true ? [] : void 0);
    const endpoint = "https://models.github.ai/inference";
    const ModelClient = aiInference.default;
    const isUnexpected = aiInference.isUnexpected;
    const AzureKeyCredential = coreAuth.AzureKeyCredential;
    const tempClient = ModelClient(
      endpoint,
      new AzureKeyCredential(apiKey)
    );
    const response = await tempClient.path("/chat/completions").post({
      body: {
        messages: [
          { role: "user", content: "test" }
        ],
        model: "openai/gpt-4o-mini",
        // Use a lightweight model
        max_tokens: 1
      }
    });
    if (isUnexpected(response)) {
      let body = response.body;
      try {
        body = JSON.parse(response.body);
      } catch (e) {
      }
      if (response.status === 401) {
        return { valid: false, error: "Invalid API key" };
      } else if (response.status === 403) {
        return { valid: false, error: "API key does not have required permissions" };
      } else if (response.status === 429) {
        return { valid: false, error: "Rate limit exceeded" };
      } else {
        return { valid: false, error: ((_a = body.error) == null ? void 0 : _a.message) || body || "Unknown error occurred" };
      }
    }
    AIapi.models = await AIapi.getModels("all", true);
    return { valid: true };
  } catch (error) {
    return { valid: false, error: error.message || "Unknown error occurred" };
  }
};
AIapi.naga = {};
AIapi.naga.checkAPIKey = async (apiKey) => {
  try {
    const { default: OpenAI } = await __vitePreload(async () => {
      const { default: OpenAI2 } = await import("https://cdn.skypack.dev/openai@4.67.1");
      return { default: OpenAI2 };
    }, true ? [] : void 0);
    const tempClient = new OpenAI({
      baseURL: "https://api.naga.ac/v1",
      apiKey,
      dangerouslyAllowBrowser: true
    });
    let tst = await tempClient.models.list();
    log("tst", tst);
    AIapi.models = await AIapi.getModels("all", true);
    return { valid: true };
  } catch (error) {
    log("❌ AI --- openAI --- checkAPIKey ---", error);
    if (error.status === 401) {
      return { valid: false, error: "Invalid API key" };
    } else if (error.status === 403) {
      return { valid: false, error: "API key does not have required permissions" };
    } else if (error.status === 429) {
      return { valid: false, error: "Rate limit exceeded" };
    } else {
      return { valid: false, error: error.message || "Unknown error occurred" };
    }
  }
};
AIapi.openrouter = {};
AIapi.openrouter.checkAPIKey = async (apiKey) => {
  try {
    const { default: OpenAI } = await __vitePreload(async () => {
      const { default: OpenAI2 } = await import("https://cdn.skypack.dev/openai@4.67.1");
      return { default: OpenAI2 };
    }, true ? [] : void 0);
    const tempClient = new OpenAI({
      baseURL: "https://openrouter.ai/api/v1",
      apiKey,
      dangerouslyAllowBrowser: true
    });
    let tst = await tempClient.models.list();
    log("tst", tst);
    AIapi.models = await AIapi.getModels("all", true);
    return { valid: true };
  } catch (error) {
    log("❌ AI --- openAI --- checkAPIKey ---", error);
    if (error.status === 401) {
      return { valid: false, error: "Invalid API key" };
    } else if (error.status === 403) {
      return { valid: false, error: "API key does not have required permissions" };
    } else if (error.status === 429) {
      return { valid: false, error: "Rate limit exceeded" };
    } else {
      return { valid: false, error: error.message || "Unknown error occurred" };
    }
  }
};
if (document.readyState === "loading") {
  document.addEventListener("DOMContentLoaded", async () => {
    var _a;
    AIapi.models = await AIapi.getModels("all");
    AIapi.models = ((_a = AIapi.models) == null ? void 0 : _a.models) || {};
  });
} else {
  (async () => {
    var _a;
    AIapi.models = await AIapi.getModels("all");
    AIapi.models = ((_a = AIapi.models) == null ? void 0 : _a.models) || {};
  })();
}
const DATA$q = window.copyspell_ai_admin || {};
let OPT$5 = DATA$q.options || {};
async function prepareRequest(args) {
  let {
    action,
    form = {},
    extraData = {},
    files = [],
    getProduct
  } = args;
  if (getProduct === void 0) getProduct = true;
  let license = await TOOLS.loadOption("copyspell-ai-license");
  let apiKeys = {};
  let providers = Object.keys(OPT$5.api);
  providers.forEach((provider) => {
    var _a;
    if (((_a = OPT$5.api[provider]) == null ? void 0 : _a.status) == "valid") {
      apiKeys[provider] = OPT$5.api[provider].key || "";
    }
  });
  let addons = window.CopyspellAI.getExtensions() || [];
  addons = addons.map((ext) => ext.id);
  let request = {
    id: `REQ-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`,
    action,
    domain: DATA$q.domain,
    service: "copyspell-ai",
    version: DATA$q.version,
    signature: DATA$q.signature || ""
  };
  let user = {
    domain: DATA$q.domain,
    wordpress: DATA$q.wordpress_version,
    woocommerce: DATA$q.woocommerce.version,
    addons,
    license: license.key || "",
    keys: apiKeys
  };
  DATA$q.extra_prompt = form["extra-prompt"] || DATA$q.extra_prompt;
  delete form["extra-prompt"];
  let options = {
    form: JSON.parse(JSON.stringify(form)),
    siteData: {
      siteUrl: DATA$q.siteUrl || "",
      siteName: DATA$q.siteName || ""
      //brandTone: form['brand-tone'] || await wpApi.getOption('copyspell_ai_brand') || ''
    },
    sequence: args.sequence || await prepareSequence(action, form),
    prompt: extraData.prompt || DATA$q.extra_prompt || "",
    content: extraData.content || ""
  };
  if (extraData) options.extraData = JSON.parse(JSON.stringify(extraData));
  DATA$q.extra_prompt = "";
  let product = {};
  if (!action.startsWith("ai-") && getProduct !== false) {
    let productMode = "clean";
    if (action === "seo-report") productMode = "full";
    product = await getProductData(DATA$q.post.id, productMode);
    if (extraData == null ? void 0 : extraData.productInfo) {
      product = { ...product, ...extraData.productInfo };
      if (product.search) {
        product.infoFromWeb = product.search;
        delete product.search;
      }
      if (product.usp) {
        product.uniqueSellingPoint = product.usp;
        delete product.usp;
      }
      if (product["extra-info"]) {
        product.moreProductInfo = product["extra-info"];
        delete product["extra-info"];
      }
      delete options.extraData.productInfo;
    }
  }
  if (files && files.length > 0 && typeof files[0] == "string") {
    for (let i = 0; i < files.length; i++) {
      files[i] = {
        url: files[i]
        //mime: getMimeType( files[i] ),
      };
    }
  }
  let data = { products: [product], options, files };
  if (form.page_html) data.page_html = form.page_html || "";
  return { request, user, data };
}
async function prepareSequence(action, form = {}) {
  let serverModels = await AIapi.getModels("all", true);
  let serverSequences = serverModels.models.sequences || {};
  let sequences = { ...serverSequences, ...OPT$5.sequences };
  let _model = document.querySelector("select.aai-select-model");
  _model = (_model == null ? void 0 : _model.value) || (form._model || "sequence");
  let providers = Object.keys(OPT$5.api);
  providers.forEach((provider) => {
    var _a, _b, _c, _d, _e;
    if (((_a = OPT$5.api[provider]) == null ? void 0 : _a.status) != "valid") {
      sequences.main = ((_b = sequences.main) == null ? void 0 : _b.filter((item) => item[1] != provider)) || [];
      sequences.keywords = ((_c = sequences.keywords) == null ? void 0 : _c.filter((item) => item[1] != provider)) || [];
      sequences.search = ((_d = sequences.search) == null ? void 0 : _d.filter((item) => item[1] != provider)) || [];
      sequences.images = ((_e = sequences.images) == null ? void 0 : _e.filter((item) => item[1] != provider)) || [];
    }
  });
  let sequence = sequences.main;
  if (typeof sequence == "string") sequence = sequences[sequence] || sequences.main || [];
  if (Array.isArray(sequence) && typeof sequence[0] == "string") {
    sequence = [sequence];
  }
  if (!sequence || !sequence.length) ;
  if (action == "product-keywords") sequence = sequences.keywords;
  if (action == "product-search") sequence = sequences.search;
  if (_model && _model !== "sequence") {
    let model, api;
    model = _model.split(":::")[0] || "gemini-2.5-flash";
    api = _model.split(":::")[1] || "google";
    sequence = [[model, api]];
  }
  return sequence;
}
const DATA$p = window.copyspell_ai_admin || {};
let OPT$4 = DATA$p.options;
const AIH = {};
AIH.LOCAL = {
  get: (key) => {
    return JSON.parse(localStorage.getItem(key));
  },
  set: (key, value) => {
    if (!Array.isArray(value) && typeof value !== "object") {
      value = [value];
    }
    localStorage.setItem(key, JSON.stringify(value));
  }
};
AIH.validProviders = (providers = OPT$4.api) => {
  let validProviders = [];
  let keys = Object.keys(providers || {});
  keys.forEach((provider) => {
    var _a;
    if (((_a = providers[provider]) == null ? void 0 : _a.status) == "valid") {
      validProviders.push(provider);
    }
  });
  return validProviders;
};
AIH.fileFromUrl = async (url) => {
  let mime = getMimeType(url);
  let fname = url.split("/").pop();
  const buff = await AIH.arrayBufferFromUrl(url);
  const uint8 = new Uint8Array(buff);
  const blobFile = new window.File([uint8], fname, { type: mime });
  return blobFile;
};
AIH.arrayBufferFromUrl = async (url) => {
  let arrayBuff = await $.ajax({
    //url: VAL.SERVER_URL + 'media/fetch-url',
    xhrFields: {
      withCredentials: true
    },
    type: "GET",
    data: { url },
    processData: true,
    contentType: false,
    dataType: "binary",
    success: (res) => {
    },
    error: (xhr, status, error) => {
      log("❌ error:", status, error);
      return { error: status, message: error };
    },
    xhr: function() {
      let xhr = new XMLHttpRequest();
      xhr.responseType = "arraybuffer";
      return xhr;
    }
  });
  return arrayBuff;
};
AIH.arrayBufferToBase64 = (buffer) => {
  const bytes = new Uint8Array(buffer);
  const binary = bytes.reduce((str, byte) => str + String.fromCharCode(byte), "");
  return btoa(binary);
};
AIH.addRecord = async (jobId, productId, calldata, content, context = "product") => {
  var _a;
  const formData = new FormData();
  formData.append("action", "csai_add_bulk_record");
  formData.append("nonce", DATA$p.nonce);
  formData.append("job_id", jobId);
  formData.append("product_id", productId);
  formData.append("context", context);
  if (typeof calldata === "object" && calldata !== null) {
    formData.append("calldata", JSON.stringify(calldata));
  } else {
    formData.append("calldata", calldata || "");
  }
  if (typeof content === "object" && content !== null) {
    formData.append("content", JSON.stringify(content));
  } else {
    formData.append("content", content || "");
  }
  try {
    const response = await fetch(DATA$p.ajax_url, {
      method: "POST",
      body: formData,
      credentials: "same-origin"
    });
    const result = await response.json();
    if (!result.success) {
      throw new Error(((_a = result.data) == null ? void 0 : _a.message) || "Failed to add record");
    }
    return result.data;
  } catch (error) {
    log("❌ AIH.addRecord error:", error);
    throw error;
  }
};
AIH.updateRecord = async (recordId, data) => {
  var _a;
  const formData = new FormData();
  formData.append("action", "csai_update_bulk_record");
  formData.append("nonce", DATA$p.nonce);
  formData.append("id", recordId);
  if (data.context !== void 0) {
    data.context;
  }
  if (data.job_id !== void 0) {
    data.job_id;
  }
  if (data.product_id !== void 0) {
    data.product_id;
  }
  if (data.calldata !== void 0) {
    if (typeof data.calldata === "object" && data.calldata !== null) {
      formData.append("data[calldata]", JSON.stringify(data.calldata));
    } else {
      formData.append("data[calldata]", data.calldata);
    }
  }
  if (data.content !== void 0) {
    if (typeof data.content === "object" && data.content !== null) {
      formData.append("data[content]", JSON.stringify(data.content));
    } else {
      formData.append("data[content]", data.content);
    }
  }
  try {
    const response = await fetch(DATA$p.ajax_url, {
      method: "POST",
      body: formData,
      credentials: "same-origin"
    });
    const result = await response.json();
    if (!result.success) {
      throw new Error(((_a = result.data) == null ? void 0 : _a.message) || "Failed to update record");
    }
    return result.data;
  } catch (error) {
    log("❌ AIH.updateRecord error:", error);
    throw error;
  }
};
AIH.recordExists = async (content, productId, jobId = 0, type) => {
  var _a;
  let exists = false;
  try {
    const existingRecords = await AIH.getRecords(productId, jobId);
    const normalizeWhitespace = (str) => {
      if (!str) return "";
      return str.replace(/\s+/g, " ").trim();
    };
    exists = (_a = existingRecords.records) == null ? void 0 : _a.some((record) => {
      var _a2;
      if (type && ((_a2 = record.calldata) == null ? void 0 : _a2._type) !== type) return false;
      const recordContent = record.content || {};
      return normalizeWhitespace(recordContent.title) === normalizeWhitespace(content.title) && normalizeWhitespace(recordContent.excerpt) === normalizeWhitespace(content.excerpt) && normalizeWhitespace(recordContent.content) === normalizeWhitespace(content.content);
    });
  } catch (error) {
    return true;
  }
  return exists;
};
AIH.getRecords = async (productId, jobId = 0, page = null, perPage = null) => {
  var _a;
  const formData = new FormData();
  formData.append("nonce", DATA$p.nonce);
  formData.append("product_id", productId);
  if (page !== null) {
    formData.append("page", page);
  }
  if (perPage !== null) {
    formData.append("perPage", perPage);
  }
  formData.append("action", "csai_get_bulk_records_by_product");
  try {
    const response = await fetch(DATA$p.ajax_url, {
      method: "POST",
      body: formData,
      credentials: "same-origin"
    });
    const result = await response.json();
    if (!result.success) {
      throw new Error(((_a = result.data) == null ? void 0 : _a.message) || "Failed to get records");
    }
    if (result.data.records && Array.isArray(result.data.records)) {
      result.data.records = result.data.records.map((record) => {
        if (typeof record.calldata === "string" && record.calldata) {
          try {
            record.calldata = JSON.parse(record.calldata);
          } catch (e) {
            log("⚠️ Failed to parse calldata:", e);
          }
        }
        if (typeof record.content === "string" && record.content) {
          try {
            record.content = JSON.parse(record.content);
          } catch (e) {
            log("⚠️ Failed to parse content:", e);
          }
        }
        return record;
      });
    }
    if (jobId !== 0 && result.data.records) {
      const filteredRecords = result.data.records.filter((record) => record.job_id == jobId);
      return {
        records: filteredRecords,
        count: filteredRecords.length
      };
    }
    return {
      records: result.data.records,
      count: result.data.count,
      total: result.data.total ?? result.data.count
    };
  } catch (error) {
    log("❌ AIH.getRecords error:", error);
    throw error;
  }
};
AIH.getRecordsByContext = async (context, productId, page = null, perPage = null) => {
  var _a;
  const formData = new FormData();
  formData.append("action", "csai_get_bulk_records_by_context_and_product");
  formData.append("nonce", DATA$p.nonce);
  formData.append("context", context);
  formData.append("product_id", productId);
  if (page !== null) {
    formData.append("page", page);
  }
  if (perPage !== null) {
    formData.append("perPage", perPage);
  }
  try {
    const response = await fetch(DATA$p.ajax_url, {
      method: "POST",
      body: formData,
      credentials: "same-origin"
    });
    const result = await response.json();
    if (!result.success) {
      throw new Error(((_a = result.data) == null ? void 0 : _a.message) || "Failed to get records");
    }
    if (result.data.records && Array.isArray(result.data.records)) {
      result.data.records = result.data.records.map((record) => {
        if (typeof record.calldata === "string" && record.calldata) {
          try {
            record.calldata = JSON.parse(record.calldata);
          } catch (e) {
            log("⚠️ Failed to parse calldata:", e);
          }
        }
        if (typeof record.content === "string" && record.content) {
          try {
            record.content = JSON.parse(record.content);
          } catch (e) {
            log("⚠️ Failed to parse content:", e);
          }
        }
        return record;
      });
    }
    return {
      records: result.data.records,
      count: result.data.count,
      total: result.data.total ?? result.data.count
    };
  } catch (error) {
    log("❌ AIH.getRecordsByContext error:", error);
    throw error;
  }
};
AIH.deleteRecord = async (recordId) => {
  var _a;
  const formData = new FormData();
  formData.append("action", "csai_delete_bulk_record");
  formData.append("nonce", DATA$p.nonce);
  formData.append("id", recordId);
  try {
    const response = await fetch(DATA$p.ajax_url, {
      method: "POST",
      body: formData,
      credentials: "same-origin"
    });
    const result = await response.json();
    if (!result.success) {
      throw new Error(((_a = result.data) == null ? void 0 : _a.message) || "Failed to delete record");
    }
    return result.data;
  } catch (error) {
    log("❌ AIH.deleteRecord error:", error);
    throw error;
  }
};
const DATA$o = window.copyspell_ai_admin || {};
const { __: __$o, _x: _x$n, _n: _n$n, sprintf: sprintf$n } = wp.i18n;
DATA$o.options || {};
const _CopySpellCall = class _CopySpellCall {
  // ────────────────────────────────────
  constructor(args) {
    const {
      action,
      form,
      extraData,
      onProgress,
      onResult,
      getProduct = true
    } = args;
    this.action = action || "product-content";
    this.form = form || {};
    this.meta = null;
    this.usage = null;
    this.onResult = onResult || function() {
    };
    this.onProgress = onProgress || function() {
    };
    this.extraData = extraData || {};
    this.getProduct = getProduct;
    this.call(args).catch((err) => {
      log(`❌ Unexpected error in call():`, err);
      this.onResult({
        error: err.message || "Unexpected error occurred",
        status: "error",
        products: []
      });
    });
  }
  // MARK: RUN
  // ────────────────────────────────────
  static async run(args) {
    const {
      action,
      form,
      extraData,
      onProgress,
      onResult,
      getProduct
    } = args;
    if (_CopySpellCall.activeRequests.get(action)) {
      log(`⚠️ Blocked duplicate call for action: ${action}`);
      return { error: "Request already in progress", status: "blocked" };
    }
    _CopySpellCall.activeRequests.set(action, true);
    return new Promise((resolve) => {
      new _CopySpellCall({
        ...args,
        onResult: (result) => {
          _CopySpellCall.activeRequests.delete(action);
          resolve(result);
        }
      });
    });
  }
  // MARK: CALL
  // ────────────────────────────────────
  async call(args = {}) {
    const { request, user, data } = await prepareRequest(args);
    if (!Object.keys(user.keys).length) {
      args.onResult({
        status: "error",
        error: __$o("No API keys configured. Please set up your AI provider API keys in the settings.", "copyspell-ai"),
        products: data.products || []
      });
      return;
    }
    await this.storeOriginalContent(data, args.action);
    log("➡️ Request:", { request, user, data });
    let response;
    const controller = new AbortController();
    const timeout = setTimeout(() => controller.abort(), 18e4);
    try {
      response = await fetch("https://copyspell.actusanima.com/v1/content", {
        method: "POST",
        headers: { "Content-Type": "application/json" },
        body: JSON.stringify({ request, user, data }),
        signal: controller.signal
      });
    } catch (err) {
      clearTimeout(timeout);
      const error = err.name === "AbortError" ? "Request timed out" : err.message;
      log(`❌ Fetch error:`, error);
      this.callProgress({ error, status: "error" });
      args.onResult({ error, status: "error", products: data.products || [] });
      return;
    }
    clearTimeout(timeout);
    if (!response.ok) {
      const errorData = await response.json().catch(() => ({ error: `Server error (${response.status})` }));
      log(`❌ Server error (${response.status}):`, errorData);
      this.callProgress({ ...errorData, status: "error" });
      this.onResult({ ...errorData, status: "error", products: data.products || [] });
      return;
    }
    await this.readNDJSONStream(response, data.products);
  }
  // MARK: STORE ORIGINAL CONTENT
  // ────────────────────────────────────
  async storeOriginalContent(data, action) {
    if (action === "product-content" || action === "marketing-content") {
      let product = data.products[0] || DATA$o.post || {};
      let content = {
        title: product.title || "",
        excerpt: product.excerpt || "",
        content: product.content || "",
        url: product.url || ""
      };
      if (!await AIH.recordExists(content, product.id)) {
        await AIH.addRecord(
          0,
          product.id || 0,
          { _type: "original", _action: action },
          content
        );
      }
    }
  }
  // MARK: Read NDJSON Stream
  // ────────────────────────────────────
  async readNDJSONStream(response, products = []) {
    const reader = response.body.getReader();
    const decoder = new TextDecoder();
    let buffer = "";
    let receivedFinal = false;
    while (true) {
      const { done, value } = await reader.read();
      if (done) {
        if (!receivedFinal) {
          console.log("DONE", done);
          console.log("VALUE", value);
          log("⚠️ Connection closed without final status");
          this.callProgress({ error: "Connection lost", status: "error" });
          this.onResult({ error: "Connection lost", status: "error", products });
        }
        break;
      }
      buffer += decoder.decode(value, { stream: true });
      const lines = buffer.split("\n\n");
      buffer = lines.pop() || "";
      for (const line of lines) {
        const json = line.trim();
        if (!json) continue;
        try {
          const result = JSON.parse(json);
          if (result.heartbeat) continue;
          this.callProgress(result);
          if (["success", "error", "server error"].includes(result.status)) {
            receivedFinal = true;
            if (result.status === "error" || result.status === "server error") {
              log(`❌ Error response:`, result.error);
              this.onResult({ ...result, products });
            } else if (result.content !== void 0 || result.json !== void 0) {
              const responseSizeInKB = new Blob([JSON.stringify(result)]).size / 1024;
              const finalResult = { ...result, products };
              log(`✅ Response: ${responseSizeInKB.toFixed(2)} KB`, finalResult);
              this.onResult(finalResult);
            }
          }
        } catch (e) {
          log("⚠️ Parse error:", e.message);
        }
      }
    }
  }
  // MARK: Call Progress
  // ────────────────────────────────────
  callProgress(progress) {
    this.onProgress(progress);
  }
};
// Static flag to prevent duplicate concurrent calls per action type
__publicField(_CopySpellCall, "activeRequests", /* @__PURE__ */ new Map());
let CopySpellCall = _CopySpellCall;
const SVG = {};
SVG.license = `
<svg class="svg-license" viewBox="0 0 465 465" xmlns:xlink="http://www.w3.org/1999/xlink" enable-background="new 0 0 465 465">
    <path d="m457.5,59.295h-450c-4.143,0-7.5,3.357-7.5,7.5v331.41c0,4.143 3.357,7.5 7.5,7.5h450c4.143,0 7.5-3.357 7.5-7.5v-331.41c0-4.143-3.357-7.5-7.5-7.5zm-7.5,331.41h-435v-316.41h435v316.41z"/>
    <path d="m37.5,338.463c16.399,0 29.742,13.343 29.742,29.742 0,4.143 3.357,7.5 7.5,7.5h255.517c4.143,0 7.5-3.357 7.5-7.5 0-4.143-3.357-7.5-7.5-7.5h-248.646c-3.165-18.673-17.94-33.448-36.613-36.613v-183.185c18.673-3.165 33.448-17.939 36.613-36.612h301.774c3.165,18.673 17.939,33.447 36.612,36.612v183.185c-18.673,3.165-33.447,17.94-36.612,36.613h-23.129c-4.143,0-7.5,3.357-7.5,7.5 0,4.143 3.357,7.5 7.5,7.5h30c4.143,0 7.5-3.357 7.5-7.5 0-16.399 13.342-29.742 29.741-29.742 4.143,0 7.5-3.357 7.5-7.5v-196.927c0-4.143-3.357-7.5-7.5-7.5-16.399,0-29.741-13.342-29.741-29.741 0-4.143-3.357-7.5-7.5-7.5h-315.516c-4.143,0-7.5,3.357-7.5,7.5 0,16.399-13.343,29.741-29.742,29.741-4.143,0-7.5,3.357-7.5,7.5v196.927c0,4.142 3.357,7.5 7.5,7.5z"/>
    <path d="m180.609,192.255c1.415,1.912 3.652,3.04 6.03,3.04s4.615-1.128 6.03-3.04l16.897-22.848 16.898,22.848c1.415,1.912 3.652,3.04 6.03,3.04s4.615-1.128 6.03-3.04l16.899-22.849 16.902,22.849c1.414,1.912 3.651,3.04 6.029,3.04s4.615-1.128 6.029-3.04l22.932-31c2.464-3.33 1.761-8.026-1.569-10.489-3.33-2.466-8.026-1.761-10.489,1.569l-16.902,22.849-16.903-22.849c-1.414-1.912-3.651-3.04-6.029-3.04-2.379,0-4.615,1.128-6.03,3.04l-16.898,22.848-16.898-22.848c-1.415-1.912-3.652-3.04-6.03-3.04s-4.616,1.128-6.03,3.04l-16.897,22.848-16.898-22.848c-2.465-3.332-7.159-4.03-10.49-1.57-3.33,2.464-4.033,7.16-1.57,10.49l22.927,31z"/>
    <path d="m375.098,257.795c0-4.143-3.357-7.5-7.5-7.5h-270.195c-4.143,0-7.5,3.357-7.5,7.5s3.357,7.5 7.5,7.5h270.194c4.143,0 7.501-3.357 7.501-7.5z"/>
    <path d="m280.021,300.705h-95.04c-4.143,0-7.5,3.357-7.5,7.5s3.357,7.5 7.5,7.5h95.04c4.143,0 7.5-3.357 7.5-7.5s-3.358-7.5-7.5-7.5z"/>
    <path d="m97.403,235.295h270.194c4.143,0 7.5-3.357 7.5-7.5s-3.357-7.5-7.5-7.5h-270.194c-4.143,0-7.5,3.357-7.5,7.5s3.358,7.5 7.5,7.5z"/>
</svg>
`;
SVG.add = `
<svg class="svg-add svg-stroke" viewBox="0 0 24 24">
<line fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" x1="12" x2="12" y1="19" y2="5"/>
<line fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" x1="5" x2="19" y1="12" y2="12"/>
</svg>
`;
SVG.edit = `
<svg class="svg-edit" viewBox="0 0 24 24">
<path fill-rule="evenodd" clip-rule="evenodd" d="M20.8477 1.87868C19.6761 0.707109 17.7766 0.707105 16.605 1.87868L2.44744 16.0363C2.02864 16.4551 1.74317 16.9885 1.62702 17.5692L1.03995 20.5046C0.760062 21.904 1.9939 23.1379 3.39334 22.858L6.32868 22.2709C6.90945 22.1548 7.44285 21.8693 7.86165 21.4505L22.0192 7.29289C23.1908 6.12132 23.1908 4.22183 22.0192 3.05025L20.8477 1.87868ZM18.0192 3.29289C18.4098 2.90237 19.0429 2.90237 19.4335 3.29289L20.605 4.46447C20.9956 4.85499 20.9956 5.48815 20.605 5.87868L17.9334 8.55027L15.3477 5.96448L18.0192 3.29289ZM13.9334 7.3787L3.86165 17.4505C3.72205 17.5901 3.6269 17.7679 3.58818 17.9615L3.00111 20.8968L5.93645 20.3097C6.13004 20.271 6.30784 20.1759 6.44744 20.0363L16.5192 9.96448L13.9334 7.3787Z"/>
</svg>
`;
SVG.edit2 = `
<svg class="svg-edit" viewBox="0 0 24 24">
<path fill-rule="evenodd" clip-rule="evenodd" d="m3.99 16.854-1.314 3.504a.75.75 0 0 0 .966.965l3.503-1.314a3 3 0 0 0 1.068-.687L18.36 9.175s-.354-1.061-1.414-2.122c-1.06-1.06-2.122-1.414-2.122-1.414L4.677 15.786a3 3 0 0 0-.687 1.068zm12.249-12.63 1.383-1.383c.248-.248.579-.406.925-.348.487.08 1.232.322 1.934 1.025.703.703.945 1.447 1.025 1.934.058.346-.1.677-.348.925L19.774 7.76s-.353-1.06-1.414-2.12c-1.06-1.062-2.121-1.415-2.121-1.415z"/></svg>
`;
SVG.save = `
<svg class="svg-save svg-stroke" viewBox="0 0 24 24">
<path d="M15 20V15H9V20M18 20H6C4.89543 20 4 19.1046 4 18V6C4 4.89543 4.89543 4 6 4H14.1716C14.702 4 15.2107 4.21071 15.5858 4.58579L19.4142 8.41421C19.7893 8.78929 20 9.29799 20 9.82843V18C20 19.1046 19.1046 20 18 20Z" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>`;
SVG.trash = `
<svg class="svg-trash svg-stroke" viewBox="0 0 24 24">
<path d="M18 6L17.1991 18.0129C17.129 19.065 17.0939 19.5911 16.8667 19.99C16.6666 20.3412 16.3648 20.6235 16.0011 20.7998C15.588 21 15.0607 21 14.0062 21H9.99377C8.93927 21 8.41202 21 7.99889 20.7998C7.63517 20.6235 7.33339 20.3412 7.13332 19.99C6.90607 19.5911 6.871 19.065 6.80086 18.0129L6 6M4 6H20M16 6L15.7294 5.18807C15.4671 4.40125 15.3359 4.00784 15.0927 3.71698C14.8779 3.46013 14.6021 3.26132 14.2905 3.13878C13.9376 3 13.523 3 12.6936 3H11.3064C10.477 3 10.0624 3 9.70951 3.13878C9.39792 3.26132 9.12208 3.46013 8.90729 3.71698C8.66405 4.00784 8.53292 4.40125 8.27064 5.18807L8 6M14 10V17M10 10V17" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>`;
SVG.link = `
<svg class="svg-link" viewBox="0 0 24 24">
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.975 14.51a1.05 1.05 0 0 0 0-1.485 2.95 2.95 0 0 1 0-4.172l3.536-3.535a2.95 2.95 0 1 1 4.172 4.172l-1.093 1.092a1.05 1.05 0 0 0 1.485 1.485l1.093-1.092a5.05 5.05 0 0 0-7.142-7.142L9.49 7.368a5.05 5.05 0 0 0 0 7.142c.41.41 1.075.41 1.485 0zm2.05-5.02a1.05 1.05 0 0 0 0 1.485 2.95 2.95 0 0 1 0 4.172l-3.5 3.5a2.95 2.95 0 1 1-4.171-4.172l1.025-1.025a1.05 1.05 0 0 0-1.485-1.485L3.87 12.99a5.05 5.05 0 0 0 7.142 7.142l3.5-3.5a5.05 5.05 0 0 0 0-7.142 1.05 1.05 0 0 0-1.485 0z"/></svg>`;
SVG.link2 = `<svg class="svg-link" viewBox="0 0 24 24">
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.63605 5.63605C7.19815 4.07395 9.73081 4.07395 11.2929 5.63605L14.1213 8.46448C15.6834 10.0266 15.6834 12.5592 14.1213 14.1213C13.7308 14.5119 13.0976 14.5119 12.7071 14.1213C12.3166 13.7308 12.3166 13.0976 12.7071 12.7071C13.4882 11.9261 13.4882 10.6597 12.7071 9.87869L9.87869 7.05026C9.09764 6.26922 7.83131 6.26922 7.05026 7.05026C6.26922 7.83131 6.26922 9.09764 7.05026 9.87869L7.75737 10.5858C8.1479 10.9763 8.14789 11.6095 7.75737 12C7.36685 12.3905 6.73368 12.3905 6.34316 12L5.63605 11.2929C4.07395 9.73081 4.07395 7.19815 5.63605 5.63605ZM11.2929 9.8787C11.6834 10.2692 11.6834 10.9024 11.2929 11.2929C10.5119 12.074 10.5119 13.3403 11.2929 14.1213L14.1213 16.9498C14.9024 17.7308 16.1687 17.7308 16.9498 16.9498C17.7308 16.1687 17.7308 14.9024 16.9498 14.1213L16.2427 13.4142C15.8521 13.0237 15.8521 12.3905 16.2427 12C16.6332 11.6095 17.2663 11.6095 17.6569 12L18.364 12.7071C19.9261 14.2692 19.9261 16.8019 18.364 18.364C16.8019 19.9261 14.2692 19.9261 12.7071 18.364L9.8787 15.5356C8.3166 13.9735 8.3166 11.4408 9.8787 9.8787C10.2692 9.48817 10.9024 9.48817 11.2929 9.8787Z"/>
</svg> `;
SVG.map = `
<svg class="svg-map" viewBox="0 0 20 20">
<path d="M16.2188621,1.94336139 C16.8719625,2.45473339 17.3224525,3.28195096 17.5058442,4.14846 C17.5277356,4.15487837 17.5495085,4.1635955 17.5710179,4.17354667 L19.6159544,5.11962334 C19.850284,5.2280344 20,5.46075582 20,5.71659107 L20,18.0838211 C20,18.5215589 19.5764334,18.8376696 19.1507575,18.7176166 L13.4812801,17.1186587 L6.74047268,18.9758209 C6.61895637,19.0092999 6.49032728,19.0079875 6.36953532,18.9720364 L0.474387945,17.2174711 C0.192770539,17.1336537 0,16.877201 0,16.5863682 L0,3.99949446 C0,3.55938972 0.427852876,3.24293409 0.854762077,3.36728116 L6.5568261,5.02813783 L9.45531671,4.14091868 C9.49560616,4.1285862 9.53617992,4.12022217 9.5766076,4.11560217 C9.68851619,3.45991529 10.0021813,2.82953836 10.5271993,2.21529897 C11.1500745,1.48657256 12.2425855,1.05841547 13.3081598,1.0071619 C14.4132601,0.95400714 15.2566187,1.18993304 16.2188621,1.94336139 Z M1.332921,4.88067678 L1.332921,16.0964567 L6.203,17.545 L6.203,6.298 L1.332921,4.88067678 Z M9.54155068,5.49511149 L7.536,6.108 L7.536,17.387 L12.601,15.993 L12.6013187,12.6982315 C12.6013187,12.3342391 12.8997032,12.0391649 13.2677792,12.0391649 C13.6358551,12.0391649 13.9342397,12.3342391 13.9342397,12.6982315 L13.934,15.876 L18.667079,17.2105145 L18.667079,6.13588259 L17.547277,5.61659848 C17.528312,5.72640456 17.5039187,5.83409766 17.473943,5.93901738 C17.2532957,6.71131967 16.8963495,7.414258 16.3999122,8.04997641 L13.9227269,11.1433946 C13.6437575,11.4917614 13.1032312,11.4728536 12.8498498,11.105865 L10.5349807,7.75291653 C10.1527973,7.21939641 9.88530334,6.74384381 9.73385649,6.31710846 C9.6374954,6.04558953 9.5749832,5.7770584 9.54155068,5.49511149 Z M13.3729153,2.32373861 C12.6463921,2.358684 11.8998709,2.65124703 11.5451804,3.06621358 C11.1177976,3.56622563 10.9078128,4.03405231 10.8664857,4.50800323 C10.8166808,5.07918058 10.849988,5.48166535 10.9915686,5.8806001 C11.0965456,6.17639634 11.3064518,6.5495691 11.6292157,7.00031076 L13.4400083,9.62299842 L15.3499293,7.23802066 C15.7369434,6.74236225 16.0167645,6.19130722 16.1912346,5.58063296 C16.4310136,4.74136651 16.0687876,3.5071375 15.3914441,2.97678337 C14.6961976,2.43241127 14.1705779,2.28537145 13.3729153,2.32373861 Z M13.5098299,3.02068789 C14.6140579,3.02068789 15.5092114,3.90591036 15.5092114,4.99788761 C15.5092114,6.08986486 14.6140579,6.97508733 13.5098299,6.97508733 C12.405602,6.97508733 11.5104484,6.08986486 11.5104484,4.99788761 C11.5104484,3.90591036 12.405602,3.02068789 13.5098299,3.02068789 Z M13.5098299,4.33882104 C13.141754,4.33882104 12.8433694,4.63389519 12.8433694,4.99788761 C12.8433694,5.36188003 13.141754,5.65695418 13.5098299,5.65695418 C13.8779059,5.65695418 14.1762904,5.36188003 14.1762904,4.99788761 C14.1762904,4.63389519 13.8779059,4.33882104 13.5098299,4.33882104 Z"/>
</svg>
`;
SVG.key = `
<svg class="svg-key svg-stroke" viewBox="0 0 24 24">
<path d="M15.6807 14.5869C19.1708 14.5869 22 11.7692 22 8.29344C22 4.81767 19.1708 2 15.6807 2C12.1907 2 9.3615 4.81767 9.3615 8.29344C9.3615 9.90338 10.0963 11.0743 10.0963 11.0743L2.45441 18.6849C2.1115 19.0264 1.63143 19.9143 2.45441 20.7339L3.33616 21.6121C3.67905 21.9048 4.54119 22.3146 5.2466 21.6121L6.27531 20.5876C7.30403 21.6121 8.4797 21.0267 8.92058 20.4412C9.65538 19.4167 8.77362 18.3922 8.77362 18.3922L9.06754 18.0995C10.4783 19.5045 11.7128 18.6849 12.1537 18.0995C12.8885 17.075 12.1537 16.0505 12.1537 16.0505C11.8598 15.465 11.272 15.465 12.0067 14.7333L12.8885 13.8551C13.5939 14.4405 15.0439 14.5869 15.6807 14.5869Z" stroke="#1C274C" stroke-width="1.5" stroke-linejoin="round"/>
<path opacity="0.5" d="M17.8851 8.29353C17.8851 9.50601 16.8982 10.4889 15.6807 10.4889C14.4633 10.4889 13.4763 9.50601 13.4763 8.29353C13.4763 7.08105 14.4633 6.09814 15.6807 6.09814C16.8982 6.09814 17.8851 7.08105 17.8851 8.29353Z" stroke="#1C274C" stroke-width="1.5"/>
</svg>
`;
SVG.eye = `
<svg class="svg-eye svg-stroke" viewBox="0 0 24 24">
<path d="M3.27489 15.2957C2.42496 14.1915 2 13.6394 2 12C2 10.3606 2.42496 9.80853 3.27489 8.70433C4.97196 6.49956 7.81811 4 12 4C16.1819 4 19.028 6.49956 20.7251 8.70433C21.575 9.80853 22 10.3606 22 12C22 13.6394 21.575 14.1915 20.7251 15.2957C19.028 17.5004 16.1819 20 12 20C7.81811 20 4.97196 17.5004 3.27489 15.2957Z" stroke-width="1.5"/>
<path d="M15 12C15 13.6569 13.6569 15 12 15C10.3431 15 9 13.6569 9 12C9 10.3431 10.3431 9 12 9C13.6569 9 15 10.3431 15 12Z" stroke-width="1.5"/>
</svg>
`;
SVG.logo = `
<svg viewBox="0 0 32 32">
<path d="M29.9,28.6l-4-8C25.7,20.2,25.4,20,25,20H14v4c0,0.6-0.4,1-1,1s-1-0.4-1-1v-4v-6.2c2.1-1,3.6-0.2,5.5,0.8
	c1.4,0.7,2.9,1.4,4.6,1.4c1,0,2.2-0.3,3.4-1c0.3-0.2,0.5-0.5,0.5-0.9V4.8c0-0.4-0.2-0.7-0.5-0.9c-0.3-0.2-0.7-0.2-1,0
	c-2.3,1.4-4,0.5-6-0.5c-2.2-1.1-4.7-2.4-8-0.5C10.2,3.2,10,3.5,10,3.8v9.3c0,0.1,0,0.1,0,0.2c0,0,0,0.1,0,0.1V20H7
	c-0.4,0-0.7,0.2-0.9,0.6l-4,8c-0.2,0.3-0.1,0.7,0,1S2.7,30,3,30h26c0.3,0,0.7-0.2,0.9-0.5S30,28.9,29.9,28.6z"/>
</svg>
`;
SVG.pin = `<svg class="svg-pin" viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
<path d="M150,34.94c-27.5-27.5-72-27.5-100,0a70.49,70.49,0,0,0-8,90l33.5,48a30.4,30.4,0,0,0,49.5,0l33.5-48A71.18,71.18,0,0,0,150,34.94Zm-8.5,78.5-33.5,48a10.31,10.31,0,0,1-16.5,0l-33.5-48a50.14,50.14,0,0,1,6-64.5c20-20,52-20,71.5,0a50.19,50.19,0,0,1,6,64.5Zm-41.5-67a35,35,0,1,0,35,35A34.78,34.78,0,0,0,100,46.44Zm0,50a15,15,0,1,1,15-15A14.73,14.73,0,0,1,100,96.44Z"/>
</svg>`;
SVG.pin2 = `<svg class="svg-pin" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path d="M12 2C8.13 2 5 5.13 5 9C5 14.25 12 22 12 22S19 14.25 19 9C19 5.13 15.87 2 12 2ZM12 11.5C10.62 11.5 9.5 10.38 9.5 9S10.62 6.5 12 6.5S14.5 7.62 14.5 9S13.38 11.5 12 11.5Z" fill="currentColor"/>
</svg>`;
SVG.mobile = `
<svg class="svg-mobile svg-stroke" viewBox="0 0 24 24">
<path d="M8 18H10M15 15V17.8C15 18.9201 15 19.4802 14.782 19.908C14.5903 20.2843 14.2843 20.5903 13.908 20.782C13.4802 21 12.9201 21 11.8 21H6.2C5.0799 21 4.51984 21 4.09202 20.782C3.71569 20.5903 3.40973 20.2843 3.21799 19.908C3 19.4802 3 18.9201 3 17.8V6.2C3 5.0799 3 4.51984 3.21799 4.09202C3.40973 3.71569 3.71569 3.40973 4.09202 3.21799C4.51984 3 5.0799 3 6.2 3H9M13 7.05029C13.9609 7.24626 14.8429 7.72047 15.5364 8.41391C16.2298 9.10735 16.704 9.9894 16.9 10.9503M13 10.9502H13.01M13 3C15.0308 3.22586 16.9243 4.13605 18.3691 5.58088C19.814 7.02572 20.7241 8.91921 20.95 10.95" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
`;
SVG.search = `
<svg class="svg-search svg-stroke" viewBox="0 0 24 24">
<path d="M11 6C13.7614 6 16 8.23858 16 11M16.6588 16.6549L21 21M19 11C19 15.4183 15.4183 19 11 19C6.58172 19 3 15.4183 3 11C3 6.58172 6.58172 3 11 3C15.4183 3 19 6.58172 19 11Z" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
`;
SVG.import = `
<svg class="svg-import svg-stroke" viewBox="0 0 24 24">
<polyline id="primary" points="13 7 13 13 7 13" style="fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.5;"></polyline><line id="primary-2" data-name="primary" x1="13" y1="13" x2="3" y2="3" style="fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.5;"></line><path id="primary-3" data-name="primary" d="M13,3h7a1,1,0,0,1,1,1V20a1,1,0,0,1-1,1H4a1,1,0,0,1-1-1V13" style="fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.5;"></path>
</svg>
`;
SVG.custom = `
<svg class="svg-custom svg-stroke" viewBox="0 0 24 24">
<path d="M14 17h6M17 20v-6" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round"/><path d="M8.4 4H5.6A1.6 1.6 0 0 0 4 5.6v2.8A1.6 1.6 0 0 0 5.6 10h2.8A1.6 1.6 0 0 0 10 8.4V5.6A1.6 1.6 0 0 0 8.4 4Z" fill="#ffffff" stroke-width="1.5" stroke-miterlimit="10"/><path d="M8.4 14H5.6A1.6 1.6 0 0 0 4 15.6v2.8A1.6 1.6 0 0 0 5.6 20h2.8a1.6 1.6 0 0 0 1.6-1.6v-2.8A1.6 1.6 0 0 0 8.4 14ZM18.4 4h-2.8A1.6 1.6 0 0 0 14 5.6v2.8a1.6 1.6 0 0 0 1.6 1.6h2.8A1.6 1.6 0 0 0 20 8.4V5.6A1.6 1.6 0 0 0 18.4 4Z" fill-opacity=".16" stroke-width="1.5" stroke-miterlimit="10"/>
</svg>
`;
SVG.design = `
<svg class="svg-design" viewBox="0 0 32 32">
<path d="M20,20.854c0-1.136,0.642-2.175,1.658-2.683L24,17L17,3h-2L8,17l2.342,1.171
	C11.358,18.679,12,19.718,12,20.854V21h-2v8h12v-8h-2V20.854z M11.236,16.382l-0.553-0.276L15,7.472V15h2V7.472l4.317,8.633
	l-0.553,0.276C19.059,17.234,18,18.948,18,20.854V21h-4v-0.146C14,18.948,12.941,17.234,11.236,16.382z M20,27h-8v-4h8V27z"/>
</svg>`;
SVG.searchText = `
<svg class="svg-search" viewBox="0 -0.5 25 25">
<path class="svg-stroke" fill-rule="evenodd" clip-rule="evenodd" d="M11.132 9.71395C10.139 11.2496 10.3328 13.2665 11.6 14.585C12.8468 15.885 14.8527 16.0883 16.335 15.065C16.6466 14.8505 16.9244 14.5906 17.159 14.294C17.3897 14.0023 17.5773 13.679 17.716 13.334C18.0006 12.6253 18.0742 11.8495 17.928 11.1C17.7841 10.3573 17.4268 9.67277 16.9 9.12995C16.3811 8.59347 15.7128 8.22552 14.982 8.07395C14.2541 7.92522 13.4982 8.00197 12.815 8.29395C12.1254 8.58951 11.5394 9.08388 11.132 9.71395Z" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M17.5986 13.6868C17.2639 13.4428 16.7947 13.5165 16.5508 13.8513C16.3069 14.1861 16.3806 14.6552 16.7154 14.8991L17.5986 13.6868ZM19.0584 16.6061C19.3931 16.85 19.8623 16.7764 20.1062 16.4416C20.3501 16.1068 20.2764 15.6377 19.9416 15.3938L19.0584 16.6061ZM7.5 12.7499C7.91421 12.7499 8.25 12.4142 8.25 11.9999C8.25 11.5857 7.91421 11.2499 7.5 11.2499V12.7499ZM5.5 11.2499C5.08579 11.2499 4.75 11.5857 4.75 11.9999C4.75 12.4142 5.08579 12.7499 5.5 12.7499V11.2499ZM7.5 15.7499C7.91421 15.7499 8.25 15.4142 8.25 14.9999C8.25 14.5857 7.91421 14.2499 7.5 14.2499V15.7499ZM5.5 14.2499C5.08579 14.2499 4.75 14.5857 4.75 14.9999C4.75 15.4142 5.08579 15.7499 5.5 15.7499V14.2499ZM8.5 9.74994C8.91421 9.74994 9.25 9.41415 9.25 8.99994C9.25 8.58573 8.91421 8.24994 8.5 8.24994V9.74994ZM5.5 8.24994C5.08579 8.24994 4.75 8.58573 4.75 8.99994C4.75 9.41415 5.08579 9.74994 5.5 9.74994V8.24994ZM16.7154 14.8991L19.0584 16.6061L19.9416 15.3938L17.5986 13.6868L16.7154 14.8991ZM7.5 11.2499H5.5V12.7499H7.5V11.2499ZM7.5 14.2499H5.5V15.7499H7.5V14.2499ZM8.5 8.24994H5.5V9.74994H8.5V8.24994Z"/>
</svg>
`;
SVG.id = `
<svg class="svg-id" viewBox="0 0 24 24">
<path d="M22 14V12C22 11.161 22 10.4153 21.9871 9.75H2.0129C2 10.4153 2 11.161 2 12V14C2 17.7712 2 19.6569 3.17157 20.8284C4.34315 22 6.22876 22 10 22H14C17.7712 22 19.6569 22 20.8284 20.8284C22 19.6569 22 17.7712 22 14Z"/>
<path d="M7.75 2.5C7.75 2.08579 7.41421 1.75 7 1.75C6.58579 1.75 6.25 2.08579 6.25 2.5V4.07926C4.81067 4.19451 3.86577 4.47737 3.17157 5.17157C2.47737 5.86577 2.19451 6.81067 2.07926 8.25H21.9207C21.8055 6.81067 21.5226 5.86577 20.8284 5.17157C20.1342 4.47737 19.1893 4.19451 17.75 4.07926V2.5C17.75 2.08579 17.4142 1.75 17 1.75C16.5858 1.75 16.25 2.08579 16.25 2.5V4.0129C15.5847 4 14.839 4 14 4H10C9.16097 4 8.41527 4 7.75 4.0129V2.5Z"/>
</svg>`;
SVG.id2 = `
<svg class="svg-id" viewBox="0 0 24 24">
<path d="M5.66953 9.91436L8.73167 5.77133C10.711 3.09327 11.7007 1.75425 12.6241 2.03721C13.5474 2.32018 13.5474 3.96249 13.5474 7.24712V7.55682C13.5474 8.74151 13.5474 9.33386 13.926 9.70541L13.946 9.72466C14.3327 10.0884 14.9492 10.0884 16.1822 10.0884C18.4011 10.0884 19.5106 10.0884 19.8855 10.7613C19.8917 10.7724 19.8977 10.7837 19.9036 10.795C20.2576 11.4784 19.6152 12.3475 18.3304 14.0857L15.2683 18.2287C13.2889 20.9067 12.2992 22.2458 11.3758 21.9628C10.4525 21.6798 10.4525 20.0375 10.4525 16.7528L10.4526 16.4433C10.4526 15.2585 10.4526 14.6662 10.074 14.2946L10.054 14.2754C9.6673 13.9117 9.05079 13.9117 7.81775 13.9117C5.59888 13.9117 4.48945 13.9117 4.1145 13.2387C4.10829 13.2276 4.10225 13.2164 4.09639 13.205C3.74244 12.5217 4.3848 11.6526 5.66953 9.91436Z"/>
</svg>`;
SVG.clock = `
<svg class="svg-clock" viewBox="0 0 24 24">
<path fill-rule="evenodd" d="M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12zm11-5a1 1 0 1 0-2 0v3.764a3 3 0 0 0 1.658 2.683l2.895 1.447a1 1 0 1 0 .894-1.788l-2.894-1.448a1 1 0 0 1-.553-.894V7z" clip-rule="evenodd"/></svg>`;
SVG.title = `
<svg class="svg-title" viewBox="0 0 24 24">
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.46447 3.46447C2 4.92893 2 7.28595 2 12C2 16.714 2 19.0711 3.46447 20.5355C4.92893 22 7.28595 22 12 22C16.714 22 19.0711 22 20.5355 20.5355C22 19.0711 22 16.714 22 12C22 7.28595 22 4.92893 20.5355 3.46447C19.0711 2 16.714 2 12 2C7.28595 2 4.92893 2 3.46447 3.46447ZM9.95197 6.25C9.52211 6.24993 9.12024 6.24986 8.79192 6.29891C8.42102 6.35432 8.04 6.4853 7.73542 6.82371C7.44103 7.15082 7.3371 7.54061 7.29204 7.91294C7.24993 8.26096 7.24996 8.69238 7.25 9.17954L7.25 9.75C7.25 10.1642 7.58579 10.5 8 10.5C8.41421 10.5 8.75 10.1642 8.75 9.75V9.22222C8.75 8.67931 8.75129 8.34011 8.78118 8.09313C8.7952 7.97725 8.81273 7.91048 8.8269 7.87221C8.83885 7.83993 8.84739 7.83046 8.85023 7.82731L8.85104 7.82637C8.8524 7.82473 8.8534 7.82353 8.86242 7.8194C8.87904 7.8118 8.92168 7.79617 9.01354 7.78245C9.21765 7.75196 9.50511 7.75 10 7.75H11.25V16.25H9.5C9.08579 16.25 8.75 16.5858 8.75 17C8.75 17.4142 9.08579 17.75 9.5 17.75H15C15.4142 17.75 15.75 17.4142 15.75 17C15.75 16.5858 15.4142 16.25 15 16.25H12.75V7.75H14C14.4949 7.75 14.7824 7.75196 14.9865 7.78245C15.0783 7.79617 15.121 7.8118 15.1376 7.8194C15.1466 7.82353 15.1476 7.82473 15.149 7.82637L15.1496 7.82716C15.1525 7.83031 15.1611 7.83993 15.1731 7.87221C15.1873 7.91048 15.2048 7.97725 15.2188 8.09313C15.2487 8.34011 15.25 8.67931 15.25 9.22222V9.75C15.25 10.1642 15.5858 10.5 16 10.5C16.4142 10.5 16.75 10.1642 16.75 9.75L16.75 9.17953C16.75 8.69238 16.7501 8.26096 16.708 7.91294C16.6629 7.54061 16.559 7.15082 16.2646 6.82371C15.96 6.4853 15.579 6.35432 15.2081 6.29891C14.8798 6.24986 14.4779 6.24993 14.048 6.25H9.95197Z"/>
</svg>`;
SVG.shortText = `
<svg class="svg-short-text" viewBox="0 0 24 24">
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.17157 3.17157C3 4.34315 3 6.22876 3 10V14C3 17.7712 3 19.6569 4.17157 20.8284C5.34315 22 7.22876 22 11 22H13C16.7712 22 18.6569 22 19.8284 20.8284C21 19.6569 21 17.7712 21 14V10C21 6.22876 21 4.34315 19.8284 3.17157C18.6569 2 16.7712 2 13 2H11C7.22876 2 5.34315 2 4.17157 3.17157ZM7.25 8C7.25 7.58579 7.58579 7.25 8 7.25H16C16.4142 7.25 16.75 7.58579 16.75 8C16.75 8.41421 16.4142 8.75 16 8.75H8C7.58579 8.75 7.25 8.41421 7.25 8ZM7.25 12C7.25 11.5858 7.58579 11.25 8 11.25H16C16.4142 11.25 16.75 11.5858 16.75 12C16.75 12.4142 16.4142 12.75 16 12.75H8C7.58579 12.75 7.25 12.4142 7.25 12ZM8 15.25C7.58579 15.25 7.25 15.5858 7.25 16C7.25 16.4142 7.58579 16.75 8 16.75H13C13.4142 16.75 13.75 16.4142 13.75 16C13.75 15.5858 13.4142 15.25 13 15.25H8Z"/>
</svg>`;
SVG.shorterText = `
<svg class="svg-shorter-text" viewBox="0 0 24 24">
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.17157 3.17157C3 4.34315 3 6.22876 3 10V14C3 17.7712 3 19.6569 4.17157 20.8284C5.34315 22 7.22876 22 11 22H13C16.7712 22 18.6569 22 19.8284 20.8284C21 19.6569 21 17.7712 21 14V10C21 6.22876 21 4.34315 19.8284 3.17157C18.6569 2 16.7712 2 13 2H11C7.22876 2 5.34315 2 4.17157 3.17157ZM8 9.25C7.58579 9.25 7.25 9.58579 7.25 10C7.25 10.4142 7.58579 10.75 8 10.75H16C16.4142 10.75 16.75 10.4142 16.75 10C16.75 9.58579 16.4142 9.25 16 9.25H8ZM8 13.25C7.58579 13.25 7.25 13.5858 7.25 14C7.25 14.4142 7.58579 14.75 8 14.75H13C13.4142 14.75 13.75 14.4142 13.75 14C13.75 13.5858 13.4142 13.25 13 13.25H8Z"/>
</svg>`;
SVG.text = `
<svg class="svg-text" viewBox="0 0 24 24">
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.46447 20.5355C4.92893 22 7.28595 22 12 22C16.714 22 19.0711 22 20.5355 20.5355C22 19.0711 22 16.714 22 12C22 7.28595 22 4.92893 20.5355 3.46447C19.0711 2 16.714 2 12 2C7.28595 2 4.92893 2 3.46447 3.46447C2 4.92893 2 7.28595 2 12C2 16.714 2 19.0711 3.46447 20.5355ZM18.75 16C18.75 16.4142 18.4142 16.75 18 16.75H6C5.58579 16.75 5.25 16.4142 5.25 16C5.25 15.5858 5.58579 15.25 6 15.25H18C18.4142 15.25 18.75 15.5858 18.75 16ZM18 12.75C18.4142 12.75 18.75 12.4142 18.75 12C18.75 11.5858 18.4142 11.25 18 11.25H6C5.58579 11.25 5.25 11.5858 5.25 12C5.25 12.4142 5.58579 12.75 6 12.75H18ZM18.75 8C18.75 8.41421 18.4142 8.75 18 8.75H6C5.58579 8.75 5.25 8.41421 5.25 8C5.25 7.58579 5.58579 7.25 6 7.25H18C18.4142 7.25 18.75 7.58579 18.75 8Z"/>
</svg>`;
SVG.textLines = `
<svg class="svg-text-lines svg-stroke" viewBox="0 0 24 24">
	<line x1="5" y1="7" x2="19" y2="7" id="Path" stroke-width="2" stroke-linecap="round"></line>
	<line x1="5" y1="17" x2="19" y2="17" id="Path" stroke-width="2" stroke-linecap="round"></line>
	<line x1="5" y1="12" x2="19" y2="12" id="Path" stroke-width="2" stroke-linecap="round"></line>
</svg>`;
SVG.language = `
<svg class="svg-language svg-stroke" viewBox="0 0 24 24" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none"><circle cx="12" cy="12" r="10"/> <path stroke-linecap="round" d="M12,22 C14.6666667,19.5757576 16,16.2424242 16,12 C16,7.75757576 14.6666667,4.42424242 12,2 C9.33333333,4.42424242 8,7.75757576 8,12 C8,16.2424242 9.33333333,19.5757576 12,22 Z"/> <path stroke-linecap="round" d="M2.5 9L21.5 9M2.5 15L21.5 15"/> </svg>`;
SVG.search2 = `
<svg class="svg-search" viewBox="0 0 20 20">
  <path fill-rule="evenodd" d="M4 9a5 5 0 1110 0A5 5 0 014 9zm5-7a7 7 0 104.2 12.6.999.999 0 00.093.107l3 3a1 1 0 001.414-1.414l-3-3a.999.999 0 00-.107-.093A7 7 0 009 2z"/>
</svg>`;
SVG.square = `
<svg class="svg-square svg-stroke" viewBox="0 0 24 24">
<path d="M2 12C2 7.28595 2 4.92893 3.46447 3.46447C4.92893 2 7.28595 2 12 2C16.714 2 19.0711 2 20.5355 3.46447C22 4.92893 22 7.28595 22 12C22 16.714 22 19.0711 20.5355 20.5355C19.0711 22 16.714 22 12 22C7.28595 22 4.92893 22 3.46447 20.5355C2 19.0711 2 16.714 2 12Z" stroke-width="1.5"/>
</svg>`;
SVG.squareCheck = `
<svg class="svg-square-check" viewBox="0 0 24 24">
<path fill-rule="evenodd" clip-rule="evenodd" d="M12 22C7.28595 22 4.92893 22 3.46447 20.5355C2 19.0711 2 16.714 2 12C2 7.28595 2 4.92893 3.46447 3.46447C4.92893 2 7.28595 2 12 2C16.714 2 19.0711 2 20.5355 3.46447C22 4.92893 22 7.28595 22 12C22 16.714 22 19.0711 20.5355 20.5355C19.0711 22 16.714 22 12 22ZM16.0303 8.96967C16.3232 9.26256 16.3232 9.73744 16.0303 10.0303L11.0303 15.0303C10.7374 15.3232 10.2626 15.3232 9.96967 15.0303L7.96967 13.0303C7.67678 12.7374 7.67678 12.2626 7.96967 11.9697C8.26256 11.6768 8.73744 11.6768 9.03033 11.9697L10.5 13.4393L14.9697 8.96967C15.2626 8.67678 15.7374 8.67678 16.0303 8.96967Z"/>
</svg>`;
SVG.help = `<svg class="svg-help" viewBox="0 0 24 24">
<path fill-rule="evenodd" clip-rule="evenodd" d="M2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12ZM12 9C11.7015 9 11.4344 9.12956 11.2497 9.33882C10.8843 9.75289 10.2523 9.79229 9.83827 9.42683C9.4242 9.06136 9.3848 8.42942 9.75026 8.01535C10.2985 7.3942 11.1038 7 12 7C13.6569 7 15 8.34315 15 10C15 11.3072 14.1647 12.4171 13 12.829V13C13 13.5523 12.5523 14 12 14C11.4477 14 11 13.5523 11 13V12.5C11 11.6284 11.6873 11.112 12.2482 10.9692C12.681 10.859 13 10.4655 13 10C13 9.44772 12.5523 9 12 9ZM12 15C11.4477 15 11 15.4477 11 16C11 16.5523 11.4477 17 12 17H12.01C12.5623 17 13.01 16.5523 13.01 16C13.01 15.4477 12.5623 15 12.01 15H12Z"/>
</svg>`;
SVG.internet = `
<svg class="svg-internet" viewBox="0 0 488 488" xml:space="preserve">
<g>
	<g>
		<circle cx="245.379" cy="456.8" r="31.2"/>
		<path d="M412.779,113.3c-28.8-68.7-94.7-113.3-169-113.3c-24.1,0-47.3,4.6-69.6,13.9c-92.8,39-137.4,145.8-99.3,239.5
			c25.7,63.5,84.8,106.3,152.3,112.4v32.4c5.8-1.8,11.9-2.8,18.3-2.8s12.5,1,18.3,2.8v-32.6c17.1-1.9,33.7-6.1,49.8-12.8
			c45.5-18.6,80.8-53.8,99.3-99.3C431.379,208,431.379,158.8,412.779,113.3z M163.079,62.2c-6.5,12.1-12.1,26-16.7,39.9h-23.2
			C133.379,86.3,146.379,72.4,163.079,62.2z M104.579,227.5c-9.3-29.7-9.3-60.3,0-88.2h32.5c-2.8,14.9-3.7,29.7-3.7,43.6
			s1.9,28.8,4.6,44.6H104.579z M122.179,264.6h25.1c4.6,14.9,11.1,29.7,18.6,42.7C149.079,296.2,134.279,282.2,122.179,264.6z
			 M227.079,290.4L227.079,290.4v30.9c-14.9-10.2-28.8-30.6-39.9-56.6h39.9V290.4z M227.079,227.5h-51.1
			c-3.7-14.9-5.6-29.7-5.6-44.6c0-14.9,1.9-29.7,4.6-43.6h52v88.2H227.079z M227.079,102.1h-41.8c10.2-26.9,25.1-48.3,41.8-58.5
			V102.1z M364.479,102.1h-19.5c-3.7-13-9.3-25.1-14.9-36.2C344.079,76.1,355.279,88.2,364.479,102.1z M264.279,43.6
			c16.7,9.3,31.6,30.6,41.8,58.5h-41.8V43.6z M264.279,321.2v-56.6h39.9C292.979,290.6,279.079,311,264.279,321.2z M315.279,227.5
			h-51.1v-88.2h52c2.8,13.9,4.6,28.8,4.6,43.6C320.879,197.8,318.079,212.6,315.279,227.5z M326.479,303.6
			c6.5-12.1,12.1-25.1,16.7-39h21.4C354.279,280.4,341.279,293.4,326.479,303.6z M382.179,227.5h-29.7c2.8-15.8,4.6-30.6,4.6-44.6
			c0-14.9-0.9-29.7-3.7-43.6h28.8C391.479,168,391.479,198.7,382.179,227.5z"/>
		<path d="M82.679,438.5c-10.1,0-18.3,8.2-18.3,18.3c0,10.1,8.2,18.3,18.3,18.3h104.1c-1.8-5.8-2.8-11.9-2.8-18.3s1-12.5,2.8-18.3
			H82.679z"/>
		<path d="M408.079,475.1c10.1,0,18.3-8.2,18.3-18.3c0-10.1-8.2-18.3-18.3-18.3h-104.1c1.8,5.8,2.8,11.9,2.8,18.3s-1,12.5-2.8,18.3
			H408.079z"/>
	</g>
</g>
</svg>`;
SVG.cube = `
<svg class="svg-cube" viewBox="0 0 24 24"><path d="M2.594,18.914l9,4H11.6a.974.974,0,0,0,.8,0h.008l9-4A1,1,0,0,0,22,18V6a1.04,1.04,0,0,0-.594-.914l-9-4a1,1,0,0,0-.812,0l-9,4A1.041,1.041,0,0,0,2,6V18A1,1,0,0,0,2.594,18.914ZM4,7.539l7,3.111v9.811L4,17.35ZM20,17.35l-7,3.111V10.65l7-3.111ZM12,3.094,18.538,6,12,8.906,5.462,6Z"/></svg>`;
SVG.cube2 = `
<svg class="svg-cube" viewBox="0 0 256 256">
  <path d="M229.92236,70.81226c-.0249-.04541-.04345-.09229-.06933-.13746-.01123-.01953-.02442-.03662-.03565-.0559a15.989,15.989,0,0,0-5.97314-5.8855l-88-49.5a16.09272,16.09272,0,0,0-15.68848,0l-88,49.5A15.99092,15.99092,0,0,0,26.168,70.64575c-.01563.0271-.03369.05127-.04883.07862-.02441.0437-.042.08886-.06543.13256A15.98294,15.98294,0,0,0,24,78.67871v98.64258a16.02048,16.02048,0,0,0,8.15576,13.94531l88.00049,49.5a15.97122,15.97122,0,0,0,7.24463,2.02222c.17871.01343.35693.03052.53906.032.02393.00049.04785.00049.07178.00049.25146,0,.499-.01465.74463-.03735a15.97135,15.97135,0,0,0,7.08789-2.01734l88-49.5A16.02048,16.02048,0,0,0,232,177.32129V78.67871A15.98584,15.98584,0,0,0,229.92236,70.81226ZM128.91016,118.821,48.37891,73.96558,128,29.17871l79.74365,44.856ZM216,177.32129l-79.87891,44.93188.78711-89.57421L216,87.74561Z"/>
</svg>`;
SVG.card = `
<svg class="svg-card" viewBox="0 0 24 24">
<path d="M14 4H10C6.22876 4 4.34315 4 3.17157 5.17157C2.32803 6.01511 2.09185 7.22882 2.02572 9.25H21.9743C21.9082 7.22882 21.672 6.01511 20.8284 5.17157C19.6569 4 17.7712 4 14 4Z"/>
<path d="M10 20H14C17.7712 20 19.6569 20 20.8284 18.8284C22 17.6569 22 15.7712 22 12C22 11.5581 22 11.142 21.9981 10.75H2.00189C2 11.142 2 11.5581 2 12C2 15.7712 2 17.6569 3.17157 18.8284C4.34315 20 6.22876 20 10 20Z"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.25 16C5.25 15.5858 5.58579 15.25 6 15.25H10C10.4142 15.25 10.75 15.5858 10.75 16C10.75 16.4142 10.4142 16.75 10 16.75H6C5.58579 16.75 5.25 16.4142 5.25 16Z" fill="white"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.75 16C11.75 15.5858 12.0858 15.25 12.5 15.25H14C14.4142 15.25 14.75 15.5858 14.75 16C14.75 16.4142 14.4142 16.75 14 16.75H12.5C12.0858 16.75 11.75 16.4142 11.75 16Z" fill="white"/>
</svg>`;
SVG.audience = `
<svg class="svg-audience" viewBox="924 578 200 200" enable-background="new 924 578 200 200" xml:space="preserve">
	<path d="M984.585,638.942c0,13.999-9.609,25.348-21.462,25.348c-11.852,0-21.459-11.349-21.459-25.348
		c0-13.998,9.607-25.346,21.459-25.346C974.976,613.596,984.585,624.944,984.585,638.942z"/>
	<path d="M987.585,683.641c1.55-0.945,3.265-1.561,5.041-1.855c-3.606-5.088-6.161-10.546-7.637-17.078
		c-0.404-2.387-3.672-2.667-6.102-0.687c-4.546,3.706-9.849,6.186-15.765,6.186c-6.03,0-11.577-2.399-16.024-6.414
		c-1.419-1.282-3.51-1.476-5.143-0.479c-8.443,5.158-14.834,13.344-17.622,23.067c-0.749,2.605-0.223,5.42,1.411,7.588
		c1.636,2.166,4.192,3.443,6.906,3.443h38.668C975.947,692.072,981.41,687.41,987.585,683.641z"/>
	<path d="M1063.416,638.942c0,13.999,9.608,25.348,21.461,25.348c11.854,0,21.46-11.349,21.46-25.348
		c0-13.998-9.606-25.346-21.46-25.346C1073.024,613.596,1063.416,624.944,1063.416,638.942z"/>
	<path d="M1060.415,683.641c-1.55-0.945-3.266-1.561-5.041-1.855c3.606-5.088,6.161-10.546,7.637-17.078
		c0.405-2.387,3.673-2.667,6.103-0.687c4.546,3.706,9.848,6.186,15.764,6.186c6.029,0,11.577-2.399,16.025-6.414
		c1.419-1.282,3.509-1.476,5.142-0.479c8.444,5.158,14.836,13.344,17.622,23.067c0.748,2.605,0.223,5.42-1.41,7.588
		c-1.637,2.166-4.192,3.443-6.905,3.443h-38.67C1072.053,692.072,1066.591,687.41,1060.415,683.641z"/>
	<path d="M1082.475,725.451c-4.198-14.654-13.72-27.045-26.326-34.992c-2.487-1.566-5.715-1.313-7.921,0.631
		c-6.766,5.959-15.138,9.506-24.228,9.506c-9.269,0-17.791-3.686-24.626-9.855c-2.182-1.971-5.393-2.268-7.902-0.734
		c-12.977,7.924-22.799,20.504-27.082,35.445c-1.151,4.008-0.344,8.328,2.166,11.662c2.516,3.33,6.443,5.291,10.615,5.291h92.523
		c4.173,0,8.103-1.955,10.618-5.291C1082.823,733.779,1083.626,729.463,1082.475,725.451z"/>
	<path d="M1056.981,652.547c0,21.513-14.766,38.955-32.981,38.955c-18.214,0-32.979-17.442-32.979-38.955
		c0-21.515,14.765-38.951,32.979-38.951C1042.216,613.596,1056.981,631.033,1056.981,652.547z"/>
</svg>
`;
SVG.tone = `
<svg class="svg-tone" viewBox="0 0 24 24">
<path d="M16.19 2H7.81C4.17 2 2 4.17 2 7.81V16.18C2 19.83 4.17 22 7.81 22H16.18C19.82 22 21.99 19.83 21.99 16.19V7.81C22 4.17 19.83 2 16.19 2ZM6.75 14.14C6.75 14.55 6.41 14.89 6 14.89C5.59 14.89 5.25 14.55 5.25 14.14V9.86C5.25 9.45 5.59 9.11 6 9.11C6.41 9.11 6.75 9.45 6.75 9.86V14.14ZM9.75 15.57C9.75 15.98 9.41 16.32 9 16.32C8.59 16.32 8.25 15.98 8.25 15.57V8.43C8.25 8.02 8.59 7.68 9 7.68C9.41 7.68 9.75 8.02 9.75 8.43V15.57ZM12.75 17C12.75 17.41 12.41 17.75 12 17.75C11.59 17.75 11.25 17.41 11.25 17V7C11.25 6.59 11.59 6.25 12 6.25C12.41 6.25 12.75 6.59 12.75 7V17ZM15.75 15.57C15.75 15.98 15.41 16.32 15 16.32C14.59 16.32 14.25 15.98 14.25 15.57V8.43C14.25 8.02 14.59 7.68 15 7.68C15.41 7.68 15.75 8.02 15.75 8.43V15.57ZM18.75 14.14C18.75 14.55 18.41 14.89 18 14.89C17.59 14.89 17.25 14.55 17.25 14.14V9.86C17.25 9.45 17.59 9.11 18 9.11C18.41 9.11 18.75 9.45 18.75 9.86V14.14Z"/>
</svg>
`;
SVG.image = `
<svg class="svg-image svg-stroke" viewBox="0 0 24 24">
<path d="M3 8.976C3 4.05476 4.05476 3 8.976 3H15.024C19.9452 3 21 4.05476 21 8.976V15.024C21 19.9452 19.9452 21 15.024 21H8.976C4.05476 21 3 19.9452 3 15.024V8.976Z" stroke-width="2"/>
<path d="M17.0045 16.5022L12.7279 12.2256C9.24808 8.74578 7.75642 8.74578 4.27658 12.2256L3 13.5022" stroke-width="2" stroke-linecap="round"/>
<path d="M21 13.6702C18.9068 12.0667 17.4778 12.2919 15.198 14.3459" stroke-width="2" stroke-linecap="round"/>
<path d="M17 8C17 8.55228 16.5523 9 16 9C15.4477 9 15 8.55228 15 8C15 7.44772 15.4477 7 16 7C16.5523 7 17 7.44772 17 8Z" stroke-width="2"/>
</svg>
`;
SVG.globe = `
<svg class="svg-globe" viewBox="0 -0.5 17 17">
<g transform="translate(3.000000, 0.000000)">
<path d="M5.031,13.225 L5.031,14.659 C2.877,14.742 1.095,15.272 1.095,15.919 C1.095,15.927 1.099,15.936 1.099,15.936 L9.905,15.945 C9.905,15.945 9.91,15.927 9.91,15.92 C9.91,15.274 8.092,14.743 5.937,14.66 L5.937,13.18" class="si-glyph-fill"></path>
<ellipse cx="5.012" cy="7.031" rx="5.012" ry="5.031" class="si-glyph-fill"></ellipse>
<path d="M5.04,13.971 C3.464,13.971 1.922,13.421 0.699,12.422 C0.489,12.25 0.457,11.938 0.628,11.725 C0.801,11.514 1.108,11.482 1.318,11.653 C2.38,12.523 3.668,12.983 5.04,12.983 C8.303,12.983 10.956,10.305 10.956,7.016 C10.956,4.098 8.805,1.563 5.951,1.12 C5.65,1.073 5.344,1.05 5.04,1.05 C4.769,1.05 4.549,0.829 4.549,0.556 C4.549,0.283 4.769,0.061 5.04,0.061 C5.392,0.061 5.748,0.088 6.101,0.142 C9.429,0.66 11.938,3.617 11.938,7.017 C11.938,10.851 8.844,13.971 5.04,13.971 L5.04,13.971 Z" class="si-glyph-fill"></path>
</g>
</svg>
`;
SVG.information = `
<svg class="svg-information" viewBox="0 0 32 32">
<path class="cls-2" d="M23.88,30.31H7a3,3,0,0,1-3-3V4.06a3,3,0,0,1,3-3H18.61a3.56,3.56,0,0,1,2.76,1.31l4.47,5.42a4.58,4.58,0,0,1,1,2.9V27.31A3,3,0,0,1,23.88,30.31ZM7,3.06a1,1,0,0,0-1,1V27.31a1,1,0,0,0,1,1H23.88a1,1,0,0,0,1-1V10.69a2.57,2.57,0,0,0-.59-1.63L19.83,3.64a1.57,1.57,0,0,0-1.22-.58Z"/>
<path class="cls-2" d="M14.66,12.54h-4.1a2,2,0,0,1-2-2v-3a2,2,0,0,1,2-2h4.1a2,2,0,0,1,2,2v3A2,2,0,0,1,14.66,12.54Zm-4.1-5v3h4.1v-3Z"/>
<path class="cls-2" d="M21.31,17.88H9.56a1,1,0,1,1,0-2H21.31a1,1,0,1,1,0,2Z"/>
<path class="cls-2" d="M21.31,21.21H9.56a1,1,0,0,1,0-2H21.31a1,1,0,0,1,0,2Z"/>
<path class="cls-2" d="M16,24.54H9.56a1,1,0,0,1,0-2H16a1,1,0,0,1,0,2Z"/>
</svg>`;
SVG.fullAddress = `
<svg class="svg-full-address svg-stroke" viewBox="0 0 24 24">
<path d="M13.6318 8.22382L13.2654 7.85744C11.7353 6.32736 10.9703 5.56232 10.1409 5.56299C9.86995 5.56321 9.60189 5.61847 9.35297 5.72542C8.59095 6.05283 8.19087 7.05807 7.39072 9.06855L7.33281 9.21406C7.10596 9.78403 6.99254 10.069 6.8104 10.2989C6.67221 10.4733 6.50589 10.6235 6.31829 10.7431C6.071 10.9009 5.77593 10.9846 5.18578 11.1521C4.27067 11.4118 3.81311 11.5417 3.61005 11.8186C3.45915 12.0244 3.39264 12.2802 3.42416 12.5334C3.46657 12.8742 3.80289 13.2105 4.47554 13.8832L7.60603 17.0137C8.27867 17.6863 8.61499 18.0226 8.95577 18.065C9.20903 18.0966 9.46475 18.03 9.67057 17.8791C9.94751 17.6761 10.0774 17.2185 10.3371 16.3034C10.5046 15.7133 10.5883 15.4182 10.7461 15.1709C10.8657 14.9833 11.0159 14.817 11.1903 14.6788C11.4202 14.4967 11.7052 14.3832 12.2751 14.1564L12.4206 14.0985C14.4311 13.2983 15.4364 12.8982 15.7638 12.1362C15.8707 11.8873 15.926 11.6192 15.9262 11.3483C15.9269 10.5189 15.1618 9.7539 13.6318 8.22382Z" stroke-width="1.5"/>
<path d="M3.34679 18.142L6.04053 15.4482" stroke-width="1.5" stroke-linecap="round"/>
<path d="M22 8H17" stroke-width="1.5" stroke-linecap="round"/>
<path d="M22 12.5H18" stroke-width="1.5" stroke-linecap="round"/>
<path d="M22 17H13" stroke-width="1.5" stroke-linecap="round"/>
</svg>`;
SVG.api = `<svg class="svg-api" viewBox="0 0 1024 1024">
<path d="M725.3 259.7H312.2c-16.5 0-30 13.5-30 30v413.1c0 16.5 13.5 30 30 30h413.1c16.5 0 30-13.5 30-30V289.7c0-16.6-13.5-30-30-30z m-98.8 164.5h25.4V550h-25.4V424.2z m-116.5 0h40.8c15.5 0 25.5 0.6 30.2 1.9 7.2 1.9 13.2 6 18.1 12.3 4.9 6.3 7.3 14.5 7.3 24.5 0 7.7-1.4 14.2-4.2 19.5s-6.4 9.4-10.7 12.4c-4.3 3-8.7 5-13.2 6-6.1 1.2-14.8 1.8-26.4 1.8h-16.6V550H510V424.2z m-90.7 0h26.9L496.5 550h-27.6l-11-28.6h-50.3L397.2 550h-27l49.1-125.8z m229.1 273.3H352.6c-19.4 0-35.1-15.7-35.1-35.1v-295c0-5.5 4.5-10 10-10s10 4.5 10 10v295c0 8.3 6.8 15.1 15.1 15.1h295.8c5.5 0 10 4.5 10 10s-4.4 10-10 10z" fill="#FFFFFF" />
<path d="M569.4 479.2c3.4-1.3 6-3.4 7.9-6.2 1.9-2.8 2.9-6.1 2.9-9.8 0-4.6-1.3-8.4-4-11.3-2.7-3-6.1-4.8-10.2-5.6-3-0.6-9.1-0.9-18.3-0.9h-12.3v35.7h13.9c10 0.1 16.7-0.6 20.1-1.9z" fill="#FFFFFF" />
<path d="M648.4 677.5H352.6c-8.3 0-15.1-6.8-15.1-15.1v-295c0-5.5-4.5-10-10-10s-10 4.5-10 10v295c0 19.4 15.7 35.1 35.1 35.1h295.8c5.5 0 10-4.5 10-10s-4.4-10-10-10z" fill="#06F3FF" />
<path d="M865 386.5c11 0 20-9 20-20s-9-20-20-20h-69.7v-56.8c0-38.6-31.4-70-70-70h-27.8v-67.3c0-11-9-20-20-20s-20 9-20 20v67.3H611v-67.3c0-11-9-20-20-20s-20 9-20 20v67.3h-46.5v-67.3c0-11-9-20-20-20s-20 9-20 20v67.3H438v-67.3c0-11-9-20-20-20s-20 9-20 20v67.3h-85.8c-38.6 0-70 31.4-70 70v56.8h-69.7c-11 0-20 9-20 20s9 20 20 20h69.7V433h-69.7c-11 0-20 9-20 20s9 20 20 20h69.7v46.5h-69.7c-11 0-20 9-20 20s9 20 20 20h69.7V606h-69.7c-11 0-20 9-20 20s9 20 20 20h69.7v56.8c0 38.6 31.4 70 70 70H343v72.5c0 11 9 20 20 20s20-9 20-20v-72.5h46.5v72.5c0 11 9 20 20 20s20-9 20-20v-72.5H516v72.5c0 11 9 20 20 20s20-9 20-20v-72.5h46.5v72.5c0 11 9 20 20 20s20-9 20-20v-72.5h82.8c38.6 0 70-31.4 70-70V646H865c11 0 20-9 20-20s-9-20-20-20h-69.7v-46.5H865c11 0 20-9 20-20s-9-20-20-20h-69.7V473H865c11 0 20-9 20-20s-9-20-20-20h-69.7v-46.5H865zM755.3 702.7c0 16.5-13.5 30-30 30H312.2c-16.5 0-30-13.5-30-30v-413c0-16.5 13.5-30 30-30h413.1c16.5 0 30 13.5 30 30v413z" />
<path d="M407.6 521.4h50.3l11 28.6h27.6l-50.4-125.8h-26.9l-49 125.8h27l10.4-28.6z m24.8-67.9l17.3 46.7h-34.3l17-46.7zM535.4 502.6H552c11.5 0 20.3-0.6 26.4-1.8 4.5-1 8.9-3 13.2-6 4.3-3 7.9-7.1 10.7-12.4s4.2-11.8 4.2-19.5c0-10-2.4-18.2-7.3-24.5-4.9-6.3-10.9-10.4-18.1-12.3-4.7-1.3-14.8-1.9-30.2-1.9H510V550h25.4v-47.4z m0-57.1h12.3c9.2 0 15.2 0.3 18.3 0.9 4.1 0.7 7.5 2.6 10.2 5.6 2.7 3 4 6.8 4 11.3 0 3.7-1 7-2.9 9.8-1.9 2.8-4.6 4.9-7.9 6.2-3.4 1.3-10.1 2-20.1 2h-13.9v-35.8zM626.5 424.2h25.4V550h-25.4z" />
</svg>
`;
SVG.chart = `<svg class="svg-chart svg-stroke" viewBox="0 0 24 24" id="chart-line-alt-1" data-name="Flat Line" xmlns="http://www.w3.org/2000/svg" class="icon flat-line"><polyline id="primary" points="7 16 12 11 16 14 19.55 6.89" style="fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2;"></polyline><polyline id="primary-2" data-name="primary" points="3 3 3 21 21 21" style="fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2;"></polyline><line id="primary-upstroke" x1="19.95" y1="6" x2="20.05" y2="6" style="fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.5;"></line></svg>`;
SVG.chart2 = `<svg class="svg-chart" viewBox="0 0 24 24">
<path fill-rule="evenodd" clip-rule="evenodd" d="M2.87868 2.87868C2 3.75736 2 5.17157 2 8V16C2 18.8284 2 20.2426 2.87868 21.1213C3.75736 22 5.17157 22 8 22H16C18.8284 22 20.2426 22 21.1213 21.1213C22 20.2426 22 18.8284 22 16V8C22 5.17157 22 3.75736 21.1213 2.87868C20.2426 2 18.8284 2 16 2H8C5.17157 2 3.75736 2 2.87868 2.87868ZM17.8321 9.5547C18.1384 9.09517 18.0142 8.4743 17.5547 8.16795C17.0952 7.8616 16.4743 7.98577 16.1679 8.4453L13.1238 13.0115L12.6651 12.094C11.9783 10.7205 10.0639 10.6013 9.2121 11.8791L6.16795 16.4453C5.8616 16.9048 5.98577 17.5257 6.4453 17.8321C6.90483 18.1384 7.5257 18.0142 7.83205 17.5547L10.8762 12.9885L11.3349 13.906C12.0217 15.2795 13.9361 15.3987 14.7879 14.1209L17.8321 9.5547Z"/>
</svg>`;
SVG.caret = `<svg class="svg-caret" viewBox="0 0 24 24">
<path fill-rule="evenodd" clip-rule="evenodd" d="M6.29289 8.79289C6.68342 8.40237 7.31658 8.40237 7.70711 8.79289L12 13.0858L16.2929 8.79289C16.6834 8.40237 17.3166 8.40237 17.7071 8.79289C18.0976 9.18342 18.0976 9.81658 17.7071 10.2071L12.7071 15.2071C12.3166 15.5976 11.6834 15.5976 11.2929 15.2071L6.29289 10.2071C5.90237 9.81658 5.90237 9.18342 6.29289 8.79289Z" />
</svg>`;
SVG.prompt = `<svg class="svg-prompt svg-stroke" viewBox="0 0 24 24">
<path d="M9.49997 12.4L5 17.7999" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M9.49997 12.4L5 7" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<line x1="18" y1="18" x2="10" y2="18" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>`;
SVG.prompt2 = `<svg class="svg-prompt" viewBox="0 0 24 24">
<path fill-rule="evenodd" clip-rule="evenodd" d="M2 6C2 4.34315 3.34315 3 5 3H19C20.6569 3 22 4.34315 22 6V18C22 19.6569 20.6569 21 19 21H5C3.34315 21 2 19.6569 2 18V6ZM5 5C4.44772 5 4 5.44772 4 6V7H20V6C20 5.44772 19.5523 5 19 5H5ZM4 18V9H20V18C20 18.5523 19.5523 19 19 19H5C4.44772 19 4 18.5523 4 18ZM7.70711 11.2929C7.31658 10.9024 6.68342 10.9024 6.29289 11.2929C5.90237 11.6834 5.90237 12.3166 6.29289 12.7071L7.58579 14L6.29289 15.2929C5.90237 15.6834 5.90237 16.3166 6.29289 16.7071C6.68342 17.0976 7.31658 17.0976 7.70711 16.7071L9.70711 14.7071C10.0976 14.3166 10.0976 13.6834 9.70711 13.2929L7.70711 11.2929Z"/>
</svg>`;
SVG.star2 = `<svg class="svg-star svg-stroke" viewBox="0 0 24 24">
<path d="M11.0748 3.25583C11.4141 2.42845 12.5859 2.42845 12.9252 3.25583L14.6493 7.45955C14.793 7.80979 15.1221 8.04889 15.4995 8.07727L20.0303 8.41798C20.922 8.48504 21.2841 9.59942 20.6021 10.1778L17.1369 13.1166C16.8482 13.3614 16.7225 13.7483 16.8122 14.1161L17.8882 18.5304C18.1 19.3992 17.152 20.0879 16.3912 19.618L12.5255 17.2305C12.2034 17.0316 11.7966 17.0316 11.4745 17.2305L7.60881 19.618C6.84796 20.0879 5.90001 19.3992 6.1118 18.5304L7.18785 14.1161C7.2775 13.7483 7.1518 13.3614 6.86309 13.1166L3.3979 10.1778C2.71588 9.59942 3.07796 8.48504 3.96971 8.41798L8.50046 8.07727C8.87794 8.04889 9.20704 7.80979 9.35068 7.45955L11.0748 3.25583Z" stroke-width="2"/>
</svg>`;
SVG.star = `<svg class="svg-star" viewBox="0 0 64 64" enable-background="new 0 0 64 64" xml:space="preserve">
<path d="M62.799,23.737c-0.47-1.399-1.681-2.419-3.139-2.642l-16.969-2.593L35.069,2.265
	C34.419,0.881,33.03,0,31.504,0c-1.527,0-2.915,0.881-3.565,2.265l-7.623,16.238L3.347,21.096c-1.458,0.223-2.669,1.242-3.138,2.642
	c-0.469,1.4-0.115,2.942,0.916,4l12.392,12.707l-2.935,17.977c-0.242,1.488,0.389,2.984,1.62,3.854
	c1.23,0.87,2.854,0.958,4.177,0.228l15.126-8.365l15.126,8.365c0.597,0.33,1.254,0.492,1.908,0.492c0.796,0,1.592-0.242,2.269-0.72
	c1.231-0.869,1.861-2.365,1.619-3.854l-2.935-17.977l12.393-12.707C62.914,26.68,63.268,25.138,62.799,23.737z"/>
</svg>
`;
SVG.error = `
<svg class="svg-error" viewBox="0 0 512 512">
<g transform="translate(42.666667, 42.666667)">
<path d="M213.333333,3.55271368e-14 C331.136,3.55271368e-14 426.666667,95.5306667 426.666667,213.333333 C426.666667,331.136 331.136,426.666667 213.333333,426.666667 C95.5306667,426.666667 3.55271368e-14,331.136 3.55271368e-14,213.333333 C3.55271368e-14,95.5306667 95.5306667,3.55271368e-14 213.333333,3.55271368e-14 Z M213.333333,42.6666667 C119.232,42.6666667 42.6666667,119.232 42.6666667,213.333333 C42.6666667,307.434667 119.232,384 213.333333,384 C307.434667,384 384,307.434667 384,213.333333 C384,119.232 307.434667,42.6666667 213.333333,42.6666667 Z M262.250667,134.250667 L292.416,164.416 L243.498667,213.333333 L292.416,262.250667 L262.250667,292.416 L213.333333,243.498667 L164.416,292.416 L134.250667,262.250667 L183.168,213.333333 L134.250667,164.416 L164.416,134.250667 L213.333333,183.168 L262.250667,134.250667 Z"></path>
</g>
</svg>
`;
SVG.bulb = `
<svg class="svg-bulb svg-stroke" viewBox="0 0 24 24" id="idea" data-name="Line Color" xmlns="http://www.w3.org/2000/svg" class="icon line-color"><path id="secondary" d="M12,3V4m7.07,1.93-.71.71M4.93,5.93l.71.71" style="fill: none; stroke: rgb(44, 169, 188); stroke-linecap: round; stroke-linejoin: round; stroke-width: 2;"></path><path id="primary" d="M17,13a5,5,0,0,0-9.91-.93,4.89,4.89,0,0,0,1,4A4,4,0,0,1,9,18.62V20a1,1,0,0,0,1,1h4a1,1,0,0,0,1-1V18.62a3.94,3.94,0,0,1,.89-2.5A4.93,4.93,0,0,0,17,13Z" style="fill: none;  stroke-linecap: round; stroke-linejoin: round; stroke-width: 2;"></path></svg>`;
SVG.check = `
<svg class="svg-check svg-stroke" viewBox="0 0 24 24">

<path d="M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z" stroke-width="2"/>
<path d="M9 12L10.6828 13.6828V13.6828C10.858 13.858 11.142 13.858 11.3172 13.6828V13.6828L15 10" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>
`;
SVG.google = `<svg class="svg-google" viewBox="-0.5 0 48 48">
	<path d="M9.82727273,24 C9.82727273,22.4757333 10.0804318,21.0144 10.5322727,19.6437333 L2.62345455,13.6042667 C1.08206818,16.7338667 0.213636364,20.2602667 0.213636364,24 C0.213636364,27.7365333 1.081,31.2608 2.62025,34.3882667 L10.5247955,28.3370667 C10.0772273,26.9728 9.82727273,25.5168 9.82727273,24" id="Fill-1" fill="#FBBC05"></path>
	<path d="M23.7136364,10.1333333 C27.025,10.1333333 30.0159091,11.3066667 32.3659091,13.2266667 L39.2022727,6.4 C35.0363636,2.77333333 29.6954545,0.533333333 23.7136364,0.533333333 C14.4268636,0.533333333 6.44540909,5.84426667 2.62345455,13.6042667 L10.5322727,19.6437333 C12.3545909,14.112 17.5491591,10.1333333 23.7136364,10.1333333" id="Fill-2" fill="#EB4335"></path>
	<path d="M23.7136364,37.8666667 C17.5491591,37.8666667 12.3545909,33.888 10.5322727,28.3562667 L2.62345455,34.3946667 C6.44540909,42.1557333 14.4268636,47.4666667 23.7136364,47.4666667 C29.4455,47.4666667 34.9177955,45.4314667 39.0249545,41.6181333 L31.5177727,35.8144 C29.3995682,37.1488 26.7323182,37.8666667 23.7136364,37.8666667" id="Fill-3" fill="#34A853"></path>
	<path d="M46.1454545,24 C46.1454545,22.6133333 45.9318182,21.12 45.6113636,19.7333333 L23.7136364,19.7333333 L23.7136364,28.8 L36.3181818,28.8 C35.6879545,31.8912 33.9724545,34.2677333 31.5177727,35.8144 L39.0249545,41.6181333 C43.3393409,37.6138667 46.1454545,31.6490667 46.1454545,24" id="Fill-4" fill="#4285F4"></path>
</svg>`;
SVG.github = `<svg class="svg-github" viewBox="0 0 20 20">
    <g id="Page-1" stroke="none" stroke-width="1" fill-rule="evenodd">
        <g id="Dribbble-Light-Preview" transform="translate(-140.000000, -7559.000000)">
            <g id="icons" transform="translate(56.000000, 160.000000)">
                <path d="M94,7399 C99.523,7399 104,7403.59 104,7409.253 C104,7413.782 101.138,7417.624 97.167,7418.981 C96.66,7419.082 96.48,7418.762 96.48,7418.489 C96.48,7418.151 96.492,7417.047 96.492,7415.675 C96.492,7414.719 96.172,7414.095 95.813,7413.777 C98.04,7413.523 100.38,7412.656 100.38,7408.718 C100.38,7407.598 99.992,7406.684 99.35,7405.966 C99.454,7405.707 99.797,7404.664 99.252,7403.252 C99.252,7403.252 98.414,7402.977 96.505,7404.303 C95.706,7404.076 94.85,7403.962 94,7403.958 C93.15,7403.962 92.295,7404.076 91.497,7404.303 C89.586,7402.977 88.746,7403.252 88.746,7403.252 C88.203,7404.664 88.546,7405.707 88.649,7405.966 C88.01,7406.684 87.619,7407.598 87.619,7408.718 C87.619,7412.646 89.954,7413.526 92.175,7413.785 C91.889,7414.041 91.63,7414.493 91.54,7415.156 C90.97,7415.418 89.522,7415.871 88.63,7414.304 C88.63,7414.304 88.101,7413.319 87.097,7413.247 C87.097,7413.247 86.122,7413.234 87.029,7413.87 C87.029,7413.87 87.684,7414.185 88.139,7415.37 C88.139,7415.37 88.726,7417.2 91.508,7416.58 C91.513,7417.437 91.522,7418.245 91.522,7418.489 C91.522,7418.76 91.338,7419.077 90.839,7418.982 C86.865,7417.627 84,7413.783 84,7409.253 C84,7403.59 88.478,7399 94,7399" id="github-[#142]"></path>
            </g>
        </g>
    </g>
</svg>`;
SVG.openai = `<svg class="svg-openai" viewBox="0 0 24 24"><path d="M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z"/></svg>`;
SVG.groq = `<svg class="svg-groq" viewBox="0 0 24 24"><path d="M12.036 2c-3.853-.035-7 3-7.036 6.781-.035 3.782 3.055 6.872 6.908 6.907h2.42v-2.566h-2.292c-2.407.028-4.38-1.866-4.408-4.23-.029-2.362 1.901-4.298 4.308-4.326h.1c2.407 0 4.358 1.915 4.365 4.278v6.305c0 2.342-1.944 4.25-4.323 4.279a4.375 4.375 0 01-3.033-1.252l-1.851 1.818A7 7 0 0012.029 22h.092c3.803-.056 6.858-3.083 6.879-6.816v-6.5C18.907 4.963 15.817 2 12.036 2z" fill="#f55036"></path></svg>`;
SVG.openrouter = `<svg class="svg-openrouter" fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><g clip-path="url(#prefix__clip0_8_13)"><path fill-rule="evenodd" clip-rule="evenodd" d="M358.485 41.75l154.027 87.573v1.856l-155.605 86.634.362-45.162-17.514-.64c-22.592-.598-34.368.042-48.384 2.346-22.699 3.734-43.478 12.31-67.136 28.843l-46.208 32.107c-6.059 4.16-10.56 7.168-14.507 9.706l-10.987 6.87-8.469 4.992 8.213 4.906 11.307 7.211c10.155 6.699 24.96 16.981 57.621 39.808 23.68 16.533 44.438 25.109 67.136 28.843l6.4.96c14.806 1.941 29.334 2.005 60.267.704l.469-46.059 154.027 87.573v1.856l-155.605 86.656.298-39.722-13.546.469c-29.568.896-45.59.043-66.944-3.456-36.139-5.973-69.547-19.755-104.128-43.925l-46.038-32a467.072 467.072 0 00-16.106-10.624l-9.963-5.974c-5.38-3.1-10.785-6.157-16.213-9.173C62.037 314.24 12.01 301.141 0 301.141v-90.197l2.987.085c12.032-.149 62.08-13.269 81.258-23.978l21.675-12.374 9.344-5.845c9.131-5.973 22.869-15.488 57.301-39.531 34.582-24.17 67.968-37.973 104.128-43.925 24.576-4.053 42.112-4.544 81.366-2.944l.426-40.683z" fill="#000"/></g><defs><clipPath id="prefix__clip0_8_13"><path fill="#fff" d="M0 0h512v512H0z"/></clipPath></defs></svg>`;
SVG.key = `
<svg class="svg-key svg-stroke" viewBox="0 0 24 24">
<path d="M15.6807 14.5869C19.1708 14.5869 22 11.7692 22 8.29344C22 4.81767 19.1708 2 15.6807 2C12.1907 2 9.3615 4.81767 9.3615 8.29344C9.3615 9.90338 10.0963 11.0743 10.0963 11.0743L2.45441 18.6849C2.1115 19.0264 1.63143 19.9143 2.45441 20.7339L3.33616 21.6121C3.67905 21.9048 4.54119 22.3146 5.2466 21.6121L6.27531 20.5876C7.30403 21.6121 8.4797 21.0267 8.92058 20.4412C9.65538 19.4167 8.77362 18.3922 8.77362 18.3922L9.06754 18.0995C10.4783 19.5045 11.7128 18.6849 12.1537 18.0995C12.8885 17.075 12.1537 16.0505 12.1537 16.0505C11.8598 15.465 11.272 15.465 12.0067 14.7333L12.8885 13.8551C13.5939 14.4405 15.0439 14.5869 15.6807 14.5869Z" stroke="#1C274C" stroke-width="1.5" stroke-linejoin="round"/>
<path opacity="0.5" d="M17.8851 8.29353C17.8851 9.50601 16.8982 10.4889 15.6807 10.4889C14.4633 10.4889 13.4763 9.50601 13.4763 8.29353C13.4763 7.08105 14.4633 6.09814 15.6807 6.09814C16.8982 6.09814 17.8851 7.08105 17.8851 8.29353Z" stroke-width="1.5"/>
</svg>`;
SVG.key2 = `
<svg class="svg-key svg-stroke" viewBox="0 0 24 24">
<path fill-rule="evenodd" clip-rule="evenodd" d="M22 8.29344C22 11.7692 19.1708 14.5869 15.6807 14.5869C15.0439 14.5869 13.5939 14.4405 12.8885 13.8551L12.0067 14.7333C11.4883 15.2496 11.6283 15.4016 11.8589 15.652C11.9551 15.7565 12.0672 15.8781 12.1537 16.0505C12.1537 16.0505 12.8885 17.075 12.1537 18.0995C11.7128 18.6849 10.4783 19.5045 9.06754 18.0995L8.77362 18.3922C8.77362 18.3922 9.65538 19.4167 8.92058 20.4412C8.4797 21.0267 7.30403 21.6121 6.27531 20.5876L5.2466 21.6121C4.54119 22.3146 3.67905 21.9048 3.33616 21.6121L2.45441 20.7339C1.63143 19.9143 2.1115 19.0264 2.45441 18.6849L10.0963 11.0743C10.0963 11.0743 9.3615 9.90338 9.3615 8.29344C9.3615 4.81767 12.1907 2 15.6807 2C19.1708 2 22 4.81767 22 8.29344ZM15.681 10.4889C16.8984 10.4889 17.8853 9.50601 17.8853 8.29353C17.8853 7.08105 16.8984 6.09814 15.681 6.09814C14.4635 6.09814 13.4766 7.08105 13.4766 8.29353C13.4766 9.50601 14.4635 10.4889 15.681 10.4889Z"/>
</svg>`;
SVG.shield = `
<svg class="svg-key svg-shield" viewBox="0 0 24 24">
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.37752 5.08241C3 5.62028 3 7.21907 3 10.4167V11.9914C3 17.6294 7.23896 20.3655 9.89856 21.5273C10.62 21.8424 10.9807 22 12 22C13.0193 22 13.38 21.8424 14.1014 21.5273C16.761 20.3655 21 17.6294 21 11.9914V10.4167C21 7.21907 21 5.62028 20.6225 5.08241C20.245 4.54454 18.7417 4.02996 15.7351 3.00079L15.1623 2.80472C13.595 2.26824 12.8114 2 12 2C11.1886 2 10.405 2.26824 8.83772 2.80472L8.26491 3.00079C5.25832 4.02996 3.75503 4.54454 3.37752 5.08241ZM10.8613 8.36335L10.7302 8.59849C10.5862 8.85677 10.5142 8.98591 10.402 9.07112C10.2897 9.15633 10.1499 9.18796 9.87035 9.25122L9.61581 9.30881C8.63194 9.53142 8.14001 9.64273 8.02297 10.0191C7.90593 10.3955 8.2413 10.7876 8.91204 11.572L9.08557 11.7749C9.27617 11.9978 9.37147 12.1092 9.41435 12.2471C9.45722 12.385 9.44281 12.5336 9.41399 12.831L9.38776 13.1018C9.28635 14.1482 9.23565 14.6715 9.54206 14.9041C9.84847 15.1367 10.3091 14.9246 11.2303 14.5005L11.4686 14.3907C11.7304 14.2702 11.8613 14.2099 12 14.2099C12.1387 14.2099 12.2696 14.2702 12.5314 14.3907L12.7697 14.5005C13.6909 14.9246 14.1515 15.1367 14.4579 14.9041C14.7644 14.6715 14.7136 14.1482 14.6122 13.1018L14.586 12.831C14.5572 12.5337 14.5428 12.385 14.5857 12.2471C14.6285 12.1092 14.7238 11.9978 14.9144 11.7749L15.088 11.572C15.7587 10.7876 16.0941 10.3955 15.977 10.0191C15.86 9.64273 15.3681 9.53142 14.3842 9.30881L14.1296 9.25122C13.8501 9.18796 13.7103 9.15633 13.598 9.07112C13.4858 8.98592 13.4138 8.85678 13.2698 8.5985L13.1387 8.36335C12.6321 7.45445 12.3787 7 12 7C11.6213 7 11.3679 7.45445 10.8613 8.36335Z"/>
</svg>`;
SVG.rocket = `
<svg class="svg-rocket" viewBox="0 0 24 24">
    <g stroke="none" stroke-width="1" fill-rule="evenodd">
        <g id="Transport" transform="translate(0.000000, -96.000000)">
            <g id="rocket_2_line" transform="translate(0.000000, 96.000000)">
                <path d="M17.6682,11.9886 L18.2876,11.3693 C18.9284,10.7285 19.3829,9.92556 19.6027,9.0464 L20.7078,4.62609 C20.9092,3.82047 20.1795,3.09074 19.3739,3.29215 L14.9536,4.39722 C14.0744,4.61701 13.2715,5.07161 12.6307,5.7124 L8.05017,10.2929 L5.84306,10.2929 C5.44524,10.2929 5.06371,10.451 4.7824,10.7323 L3.05279,12.4619 C2.45409,13.0606 2.61069,14.0638 3.35319,14.4569 C3.83529,14.7122 4.74119,15.2147 5.60207,15.7987 C5.35699,15.8963 5.12731,16.0443 4.92893,16.2426 C4.14788,17.0237 3.33794,20.3085 3.51472,20.4853 C3.69149,20.6621 6.97631,19.8521 7.75736,19.0711 C7.95573,18.8727 8.10372,18.643 8.20132,18.3979 C8.78527,19.2588 9.28776,20.1647 9.54301,20.6468 C9.93614,21.3893 10.9394,21.5459 11.5381,20.9472 L13.2677,19.2176 C13.549,18.9362 13.707,18.5547 13.707,18.1569 L13.707,15.9498 L17.6452,12.0116 C17.653,12.004 17.6607,11.9964 17.6682,11.9886 Z M18.4037,5.59623 L15.4386,6.33751 C15.1846,6.40101 14.9412,6.49718 14.7142,6.62276 C15.197,6.87533 15.7231,7.23803 16.2426,7.75753 C16.762,8.27693 17.1247,8.80293 17.3772,9.28569 C17.5028,9.05868 17.599,8.8153 17.6624,8.56133 L18.4037,5.59623 Z M15.8875,10.9409 C15.787,10.5428 15.5276,9.87093 14.8284,9.17174 C14.129,8.47238 13.457,8.21306 13.0589,8.1126 L9.31794,11.8536 C9.03663,12.1349 8.6551,12.2929 8.25728,12.2929 L6.05017,12.2929 L5.16816,13.1749 C6.15238,13.7409 7.55143,14.6226 8.46438,15.5356 C9.37734,16.4485 10.2591,17.8476 10.825,18.8318 L11.707,17.9498 L11.707,15.7427 C11.707,15.3449 11.8651,14.9633 12.1464,14.682 L15.8875,10.9409 Z"></path>
            </g>
        </g>
    </g>
</svg>`;
SVG.woo = `
<svg class="svg-woo" viewBox="0 -51.5 256 256">
    <g fill-rule="evenodd">
        <path d="M232.137523,0 L23.7592719,0 C10.5720702,0 -0.103257595,10.7799647 0.000639559736,23.862498 L0.000639559736,103.404247 C0.000639559736,116.591115 10.6767385,127.266612 23.8639402,127.266612 L122.558181,127.266612 L167.667206,152.384995 L157.410382,127.266612 L232.137523,127.266612 C245.325059,127.266612 255.999888,116.591115 255.999888,103.404247 L255.999888,23.862498 C255.999888,10.6752964 245.325059,0 232.137523,0 Z M19.3640061,18.4201481 C16.4334946,18.6294847 14.2355942,19.6761007 12.7703719,21.6645976 C11.3051496,23.5484931 10.781875,25.9556632 11.095813,28.6768382 C17.2707741,67.9247058 23.027062,94.4034429 28.3647436,108.113986 C30.4579757,113.137395 32.8651458,115.5451 35.690989,115.335764 C40.086656,115.021425 45.3196694,108.951332 51.4946305,97.1248185 C54.73908,90.4260478 59.7628237,80.3792294 66.5657276,66.9823567 C72.2170797,86.762992 79.9618646,101.625221 89.6956814,111.567705 C92.417057,114.393415 95.2427665,115.649434 97.9634733,115.440098 C100.371178,115.230761 102.254539,113.974742 103.510558,111.672039 C104.557241,109.683676 104.975914,107.380974 104.766578,104.764601 C104.138568,95.2407893 105.080917,81.9489193 107.69729,64.8892584 C110.417997,47.3063898 113.767382,34.6424627 117.849111,27.1069476 C118.686458,25.5370569 119.000128,23.9670994 118.895794,22.0832708 C118.686458,19.6760338 117.639775,17.6875369 115.651411,16.1176463 C113.663048,14.5477557 111.46468,13.8151445 109.057643,14.0244142 C106.022597,14.2337508 103.719895,15.6989731 102.150205,18.6294847 C95.6614396,30.4560654 91.0560348,49.6088916 88.335328,76.1924977 C84.3579328,66.145211 81.0085475,54.3185634 78.3921746,40.3987506 C77.2411578,34.2238564 74.4154483,31.2933449 69.8100434,31.6073497 C66.670329,31.8166194 64.0538892,33.9098515 61.9606572,37.8869122 L39.0401069,81.5302462 C35.2723159,66.3544807 31.7138615,47.8296643 28.4694119,25.9556632 C27.7368007,20.5133802 24.7016209,18.0014749 19.3640061,18.4201481 Z M221.044022,25.9559976 C228.475136,27.5259551 234.022221,31.5030159 237.789611,38.0965832 C241.138996,43.7482697 242.81302,50.5511737 242.81302,58.7146317 C242.81302,69.4943957 240.092314,79.3325464 234.649562,88.3333508 C228.370134,98.7995112 220.206676,104.032257 210.054854,104.032257 C208.275828,104.032257 206.391799,103.82292 204.402767,103.404247 C196.972321,101.834557 191.425236,97.857831 187.657177,91.264063 C184.308461,85.5076413 182.633768,78.6002028 182.633768,70.5410787 C182.633768,59.7612478 185.355144,49.923164 190.797226,41.0270948 C197.181658,30.5610681 205.345116,25.3280548 215.392603,25.3280548 C217.171629,25.3280548 219.055659,25.5373913 221.044022,25.9559976 Z M216.648622,82.5769291 C220.521015,79.1232099 223.137388,73.9947979 224.602744,67.0873594 C225.021417,64.6802562 225.335087,62.0637496 225.335087,59.3425746 C225.335087,56.3074616 224.707078,53.0630121 223.451058,49.8184957 C221.881368,45.7367667 219.788002,43.5389332 217.275963,43.0155917 C213.508574,42.2829805 209.845518,44.3762126 206.391799,49.5045577 C203.566089,53.4816184 201.786394,57.6680157 200.844713,61.9590813 C200.321038,64.3663182 200.111701,66.9830255 200.111701,69.5993984 C200.111701,72.6344445 200.739711,75.8788272 201.99573,79.1232099 C203.566089,83.2049389 205.658786,85.4026386 208.170825,85.9263145 C210.787198,86.4493215 213.612908,85.2983047 216.648622,82.5769291 Z M172.167608,38.0965832 C168.399549,31.5030159 162.74813,27.5259551 155.422019,25.9559976 C153.432987,25.5373913 151.549626,25.3280548 149.769931,25.3280548 C139.723112,25.3280548 131.559654,30.5610681 125.175223,41.0270948 C119.732472,49.923164 117.011765,59.7612478 117.011765,70.5410787 C117.011765,78.6002028 118.686458,85.5076413 122.035174,91.264063 C125.803233,97.857831 131.350318,101.834557 138.780763,103.404247 C140.769126,103.82292 142.653156,104.032257 144.432851,104.032257 C154.584672,104.032257 162.74813,98.7995112 169.027559,88.3333508 C174.47031,79.3325464 177.191017,69.4943957 177.191017,58.7146317 C177.191017,50.5511737 175.516324,43.7482697 172.167608,38.0965832 Z M158.980072,67.0873594 C157.515384,73.9947979 154.898343,79.1232099 151.02595,82.5769291 C147.990904,85.2983047 145.165195,86.4493215 142.548822,85.9263145 C140.036783,85.4026386 137.943417,83.2049389 136.373727,79.1232099 C135.117707,75.8788272 134.489698,72.6344445 134.489698,69.5993984 C134.489698,66.9830255 134.699034,64.3663182 135.22271,61.9590813 C136.16439,57.6680157 137.943417,53.4816184 140.769126,49.5045577 C144.223514,44.3762126 147.88657,42.2829805 151.65396,43.0155917 C154.165999,43.5389332 156.259365,45.7367667 157.829055,49.8184957 C159.085074,53.0630121 159.713084,56.3074616 159.713084,59.3425746 C159.713084,62.0637496 159.503748,64.6802562 158.980072,67.0873594 Z" fill="#7F54B3"></path>
    </g>
</svg>`;
SVG.puzzle = `
<svg class="svg-puzzle" viewBox="0 0 512 512">
<g>
	<path class="st0" d="M432.531,229.906c-9.906,0-19.125,2.594-27.313,6.375v-51.656c0-42.938-34.922-77.875-77.859-77.875h-51.641
		c3.781-8.156,6.375-17.375,6.375-27.281C282.094,35.656,246.438,0,202.625,0c-43.828,0-79.484,35.656-79.484,79.469
		c0,9.906,2.594,19.125,6.359,27.281H77.875C34.938,106.75,0,141.688,0,184.625l0.047,23.828H0l0.078,33.781
		c0,23.031,8.578,36.828,12.641,42.063c12.219,15.797,27.094,18.172,34.891,18.172c11.953,0,23.141-4.953,33.203-14.703l0.906-0.422
		l1.516-2.141c1.391-1.359,6.328-5.484,14.016-5.5c16.344,0,29.656,13.297,29.656,29.672c0,16.344-13.313,29.656-29.672,29.656
		c-7.672,0-12.609-4.125-14-5.5l-1.516-2.141l-0.906-0.422c-10.063-9.75-21.25-14.703-33.203-14.703
		c-7.797,0.016-22.672,2.375-34.891,18.172c-4.063,5.25-12.641,19.031-12.641,42.063L0,410.281h0.047L0,434.063
		C0,477.063,34.938,512,77.875,512h54.563v-0.063l3.047-0.016c23.016,0,36.828-8.563,42.063-12.641
		c15.797-12.219,18.172-27.094,18.172-34.891c0-11.953-4.953-23.141-14.688-33.203l-0.438-0.906l-2.125-1.516
		c-1.375-1.391-5.516-6.328-5.516-14.016c0-16.344,13.313-29.656,29.672-29.656c16.344,0,29.656,13.313,29.656,29.656
		c0,7.688-4.141,12.625-5.5,14.016l-2.125,1.516l-0.438,0.906c-9.75,10.063-14.703,21.25-14.703,33.203
		c0,7.797,2.359,22.672,18.172,34.891c5.25,4.078,19.031,12.641,42.063,12.641l17,0.047V512h40.609
		c42.938,0,77.859-34.938,77.859-77.875v-51.641c8.188,3.766,17.406,6.375,27.313,6.375c43.813,0,79.469-35.656,79.469-79.484
		C512,265.563,476.344,229.906,432.531,229.906z M432.531,356.375c-19.031,0-37.469-22.063-37.469-22.063
		c-3.344-3.203-6.391-4.813-9.25-4.813c-2.844,0-5.469,1.609-7.938,4.813c0,0-5.125,5.891-5.125,19.313v80.5
		c0,25.063-20.313,45.391-45.391,45.391h-23.813l-33.797-0.078c-15.438,0-22.188-5.875-22.188-5.875
		c-3.703-2.859-5.563-5.875-5.563-9.172c0-3.266,1.859-6.797,5.563-10.594c0,0,17.219-13.891,17.219-39.047
		c0-34.313-27.844-62.156-62.156-62.156c-34.344,0-62.156,27.844-62.156,62.156c0,25.156,17.219,39.047,17.219,39.047
		c3.688,3.797,5.531,7.328,5.531,10.594c0,3.297-1.844,6.313-5.531,9.172c0,0-6.766,5.875-22.203,5.875l-33.797,0.078H77.875
		c-25.063,0-45.375-20.328-45.375-45.391l0.094-48.203h-0.047l0.016-9.422c0-15.422,5.875-22.203,5.875-22.203
		c2.859-3.703,5.875-5.531,9.156-5.531s6.813,1.828,10.609,5.531c0,0,13.891,17.234,39.047,17.234
		c34.313-0.016,62.156-27.844,62.156-62.156c-0.016-34.344-27.844-62.156-62.156-62.156c-25.156,0-39.047,17.219-39.047,17.219
		c-3.797,3.688-7.328,5.531-10.609,5.531s-6.297-1.828-9.156-5.531c0,0-5.875-6.781-5.875-22.203v-1.156h0.031L32.5,184.625
		c0-25.063,20.313-45.375,45.375-45.375h80.5c13.422,0,19.313-5.125,19.313-5.125c6.422-4.938,6.422-10.531,0-17.188
		c0,0-22.063-18.438-22.063-37.469c0-25.953,21.047-46.984,47-46.984c25.938,0,46.984,21.031,46.984,46.984
		c0,19.031-22.047,37.469-22.047,37.469c-6.438,6.656-6.438,12.25,0,17.188c0,0,5.875,5.125,19.281,5.125h80.516
		c25.078,0,45.391,20.313,45.391,45.375v80.516c0,13.422,5.125,19.297,5.125,19.297c2.469,3.219,5.094,4.813,7.938,4.813
		c2.859,0,5.906-1.594,9.25-4.813c0,0,18.438-22.047,37.469-22.047c25.938,0,46.969,21.047,46.969,46.984
		C479.5,335.344,458.469,356.375,432.531,356.375z"/>
</g>
</svg>`;
SVG.cloudCheck = `
<svg class="svg-cloud-check svg-stroke" viewBox="0 0 24 24">
<g clip-path="url(#clip0_429_11265)">
<path d="M2 14.5C2 16.9853 4.01472 19 6.5 19H18.5C20.433 19 22 17.433 22 15.5C22 13.7367 20.6961 12.278 18.9999 12.0354C19.009 10.2322 18.3256 8.4261 16.9497 7.05025C14.2161 4.31658 9.78392 4.31658 7.05025 7.05025C6.15091 7.9496 5.54744 9.03278 5.23984 10.1788C3.36791 10.7238 2 12.4522 2 14.5Z" stroke-width="2.5" stroke-linejoin="round"/>
<path d="M15.0002 11L11.0002 15L9.00018 13" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"/>
</g>
<defs>
<clipPath id="clip0_429_11265">
<rect width="24" height="24" fill="white"/>
</clipPath>
</defs>
</svg>`;
SVG.sliders = `
<svg class="svg-sliders svg-stroke" viewBox="0 0 24 24">
<path d="M19.5 12C18.1193 12 17 10.8807 17 9.5C17 8.11929 18.1193 7 19.5 7M19.5 12C20.8807 12 22 10.8807 22 9.5C22 8.11929 20.8807 7 19.5 7M19.5 12V21M19.5 7V3M12 18.9998C10.6193 18.9998 9.5 17.8805 9.5 16.4998C9.5 15.1191 10.6193 13.9998 12 13.9998M12 18.9998C13.3807 18.9998 14.5 17.8805 14.5 16.4998C14.5 15.1191 13.3807 13.9998 12 13.9998M12 18.9998V20.9996M12 13.9998V3.00012M4.5 10C3.11929 10 2 8.88071 2 7.5C2 6.11929 3.11929 5 4.5 5M4.5 10C5.88071 10 7 8.88071 7 7.5C7 6.11929 5.88071 5 4.5 5M4.5 10V21M4.5 5V3" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>`;
SVG.settings = `
<svg class="svg-settings svg-stroke" viewBox="0 0 24 24">
<circle cx="12" cy="12" r="3" stroke="#1C274C" stroke-width="1.5"/>
<path opacity="0.5" d="M13.7654 2.15224C13.3978 2 12.9319 2 12 2C11.0681 2 10.6022 2 10.2346 2.15224C9.74457 2.35523 9.35522 2.74458 9.15223 3.23463C9.05957 3.45834 9.0233 3.7185 9.00911 4.09799C8.98826 4.65568 8.70226 5.17189 8.21894 5.45093C7.73564 5.72996 7.14559 5.71954 6.65219 5.45876C6.31645 5.2813 6.07301 5.18262 5.83294 5.15102C5.30704 5.08178 4.77518 5.22429 4.35436 5.5472C4.03874 5.78938 3.80577 6.1929 3.33983 6.99993C2.87389 7.80697 2.64092 8.21048 2.58899 8.60491C2.51976 9.1308 2.66227 9.66266 2.98518 10.0835C3.13256 10.2756 3.3397 10.437 3.66119 10.639C4.1338 10.936 4.43789 11.4419 4.43786 12C4.43783 12.5581 4.13375 13.0639 3.66118 13.3608C3.33965 13.5629 3.13248 13.7244 2.98508 13.9165C2.66217 14.3373 2.51966 14.8691 2.5889 15.395C2.64082 15.7894 2.87379 16.193 3.33973 17C3.80568 17.807 4.03865 18.2106 4.35426 18.4527C4.77508 18.7756 5.30694 18.9181 5.83284 18.8489C6.07289 18.8173 6.31632 18.7186 6.65204 18.5412C7.14547 18.2804 7.73556 18.27 8.2189 18.549C8.70224 18.8281 8.98826 19.3443 9.00911 19.9021C9.02331 20.2815 9.05957 20.5417 9.15223 20.7654C9.35522 21.2554 9.74457 21.6448 10.2346 21.8478C10.6022 22 11.0681 22 12 22C12.9319 22 13.3978 22 13.7654 21.8478C14.2554 21.6448 14.6448 21.2554 14.8477 20.7654C14.9404 20.5417 14.9767 20.2815 14.9909 19.902C15.0117 19.3443 15.2977 18.8281 15.781 18.549C16.2643 18.2699 16.8544 18.2804 17.3479 18.5412C17.6836 18.7186 17.927 18.8172 18.167 18.8488C18.6929 18.9181 19.2248 18.7756 19.6456 18.4527C19.9612 18.2105 20.1942 17.807 20.6601 16.9999C21.1261 16.1929 21.3591 15.7894 21.411 15.395C21.4802 14.8691 21.3377 14.3372 21.0148 13.9164C20.8674 13.7243 20.6602 13.5628 20.3387 13.3608C19.8662 13.0639 19.5621 12.558 19.5621 11.9999C19.5621 11.4418 19.8662 10.9361 20.3387 10.6392C20.6603 10.4371 20.8675 10.2757 21.0149 10.0835C21.3378 9.66273 21.4803 9.13087 21.4111 8.60497C21.3592 8.21055 21.1262 7.80703 20.6602 7C20.1943 6.19297 19.9613 5.78945 19.6457 5.54727C19.2249 5.22436 18.693 5.08185 18.1671 5.15109C17.9271 5.18269 17.6837 5.28136 17.3479 5.4588C16.8545 5.71959 16.2644 5.73002 15.7811 5.45096C15.2977 5.17191 15.0117 4.65566 14.9909 4.09794C14.9767 3.71848 14.9404 3.45833 14.8477 3.23463C14.6448 2.74458 14.2554 2.35523 13.7654 2.15224C13.3978 2 12.9319 2 12 2C11.0681 2 10.6022 2 10.2346  2.15224C9.74457 2.35523 9.35522 2.74458 9.15223 3.23463C9.05957 3.45834 9.0233 3.7185 9.00911 4.09799C8.98826 4.65568 8.70226 5.17189 8.21894 5.45093C7.73564 5.72996 7.14559 5.71954 6.65219 5.45876C6.31645 5.2813 6.07301 5.18262 5.83294 5.15102C5.30704 5.08178 4.77518 5.22429 4.35436 5.5472C4.03874 5.78938 3.80577 6.1929 3.33983 6.99993C2.87389 7.80697 2.64092 8.21048 2.58899 8.60491C2.51976 9.1308 2.66227 9.66266 2.98518 10.0835C3.13256 10.2756 3.3397 10.437 3.66119 10.639C4.1338 10.936 4.43789 11.4419 4.43786 12C4.43783 12.5581 4.13375 13.0639 3.66118 13.3608C3.33965 13.5629 3.13248 13.7244 2.98508 13.9165C2.66217 14.3373 2.51966 14.8691 2.5889 15.395C2.64082 15.7894 2.87379 16.193 3.33973 17C3.80568 17.807 4.03865 18.2106 4.35426 18.4527C4.77508 18.7756 5.30694 18.9181 5.83284 18.8489C6.07289 18.8173 6.31632 18.7186 6.65204 18.5412C7.14547 18.2804 7.73556 18.27 8.2189 18.549C8.70224 18.8281 8.98826 19.3443 9.00911 19.9021C9.02331 20.2815 9.05957 20.5417 9.15223 20.7654C9.35522 21.2554 9.74457 21.6448 10.2346 21.8478C10.6022 22 11.0681 22 12 22C12.9319 22 13.3978 22 13.7654 21.8478C14.2554 21.6448 14.6448 21.2554 14.8477 20.7654C14.9404 20.5417 14.9767 20.2815 14.9909 19.902C15.0117 19.3443 15.2977 18.8281 15.781 18.549C16.2643 18.2699 16.8544 18.2804 17.3479 18.5412C17.6836 18.7186 17.927 18.8172 18.167 18.8488C18.6929 18.9181 19.2248 18.7756 19.6456 18.4527C19.9612 18.2105 20.1942 17.807 20.6601 16.9999C21.1261 16.1929 21.3591 15.7894 21.411 15.395C21.4802 14.8691 21.3377 14.3372 21.0148 13.9164C20.8674 13.7243 20.6602 13.5628 20.3387 13.3608C19.8662 13.0639 19.5621 12.558 19.5621 11.9999C19.5621 11.4418 19.8662 10.9361 20.3387 10.6392C20.6603 10.4371 20.8675 10.2757 21.0149 10.0835C21.3378 9.66273 21.4803 9.13087 21.4111 8.60497C21.3592 8.21055 21.1262 7.80703 20.6602 7C20.1943 6.19297 19.9613 5.78945 19.6457 5.54727C19.2249 5.22436 18.693 5.08185 18.1671 5.15109C17.9271 5.18269 17.6837 5.28136 17.3479 5.4588C16.8545 5.71959 16.2644 5.73002 15.7811 5.45096C15.2977 5.17191 15.0117 4.65566 14.9909 4.09794C14.9767 3.71848 14.9404 3.45833 14.8477 3.23463C14.6448 2.74458 14.2554 2.35523 13.7654 2.15224C13.3978 2 12.9319 2 12 2C11.0681 2 10.6022 2 10.2346 2.15224C9.74457 2.35523 9.35522 2.74458 9.15223 3.23463C9.05957 3.45834 9.0233 3.7185 9.00911 4.09799C8.98826 4.65568 8.70226 5.17189 8.21894 5.45093C7.73564 5.72996 7.14559 5.71954 6.65219 5.45876C6.31645 5.2813 6.07301 5.18262 5.83294 5.15102C5.30704 5.08178 4.77518 5.22429 4.35436 5.5472C4.03874 5.78938 3.80577 6.1929 3.33983 6.99993C2.87389 7.80697 2.64092 8.21048 2.58899 8.60491C2.51976 9.1308 2.66227 9.66266 2.98518 10.0835C3.13256 10.2756 3.3397 10.437 3.66119 10.639C4.1338 10.936 4.43789 11.4419 4.43786 12C4.43783 12.5581 4.13375 13.0639 3.66118 13.3608C3.33965 13.5629 3.13248 13.7244 2.98508 13.9165C2.66217 14.3373 2.51966 14.8691 2.5889 15.395C2.64082 15.7894 2.87379 16.193 3.33973 17C3.80568 17.807 4.03865 18.2106 4.35426 18.4527C4.77508 18.7756 5.30694 18.9181 5.83284 18.8489C6.07289 18.8173 6.31632 18.7186 6.65204 18.5412C7.14547 18.2804 7.73556 18.27 8.2189 18.549C8.70224 18.8281 8.98826 19.3443 9.00911 19.9021C9.02331 20.2815 9.05957 20.5417 9.15223 20.7654C9.35522 21.2554 9.74457 21.6448 10.2346 21.8478C10.6022 22 11.0681 22 12 22C12.9319 22 13.3978 22 13.7654 21.8478C14.2554 21.6448 14.6448 21.2554 14.8477 20.7654C14.9404 20.5417 14.9767 20.2815 14.9909 19.902C15.0117 19.3443 15.2977 18.8281 15.781 18.549C16.2643 18.2699 16.8544 18.2804 17.3479 18.5412C17.6836 18.7186 17.927 18.8172 18.167 18.8488C18.6929 18.9181 19.2248 18.7756 19.6456 18.4527C19.9612 18.2105 20.1942 17.807 20.6601 16.9999C21.1261 16.1929 21.3591 15.7894 21.411 15.395C21.4802 14.8691 21.3377 14.3372 21.0148 13.9164C20.8674 13.7243 20.6602 13.5628 20.3387 13.3608C19.8662 13.0639 19.5621 12.558 19.5621 11.9999C19.5621 11.4418 19.8662 10.9361 20.3387 10.6392C20.6603 10.4371 20.8675 10.2757 21.0149 10.0835C21.3378 9.66273 21.4803 9.13087 21.4111 8.60497C21.3592 8.21055 21.1262 7.80703 20.6602 7C20.1943 6.19297 19.9613 5.78945 19.6457 5.54727C19.2249 5.22436 18.693 5.08185 18.1671 5.15109C17.9271 5.18269 17.6837 5.28136 17.3479 5.4588C16.8545 5.71959 16.2644 5.73002 15.7811 5.45096C15.2977 5.17191 15.0117 4.65566 14.9909 4.09794C14.9767 3.71848 14.9404 3.45833 14.8477 3.23463C14.6448 2.74458 14.2554 2.35523 13.7654 2.15224C13.3978 2 12.9319 2 12 2Z" stroke="#1C274C" stroke-width="1.5"/>
</svg>
`;
SVG.ai = `
<svg class="svg-ai" viewBox="0 0 24 24">
        <g transform="translate(2.000000, 4.000000)">
            <polygon id="Fill-1" points="12.114144 0 11.139744 0.9744 18.228504 8.04552 12.114144 14.15988 6.000624 8.04552 8.920464 5.124 7.955304 4.15968 4.069464 8.04552 12.114144 16.09104 20.160504 8.04552"></polygon>
            <polygon id="Fill-2" points="10.122672 9.813216 8.355312 8.045856 10.122672 6.277656 11.890032 8.045856"></polygon>
            <polygon id="Fill-3" points="8.045352 0 -0.000168 8.04552 8.045352 16.09104 9.008832 15.12672 1.930992 8.04552 8.045352 1.93116 14.158872 8.04552 11.239032 10.9662 12.205032 11.9322 16.090872 8.04552"></polygon>
        </g>
  </svg>`;
SVG.robot = `
<svg class="svg-robot" viewBox="0 0 24 24">
<path d="M16,13H8a3,3,0,0,1-3-3V6A3,3,0,0,1,8,3h8a3,3,0,0,1,3,3v4A3,3,0,0,1,16,13ZM8,5A1,1,0,0,0,7,6v4a1,1,0,0,0,1,1h8a1,1,0,0,0,1-1V6a1,1,0,0,0-1-1Z"/><path class="cls-1" d="M10,9a1.05,1.05,0,0,1-.71-.29A1,1,0,0,1,10.19,7a.6.6,0,0,1,.19.06.56.56,0,0,1,.17.09l.16.12A1,1,0,0,1,10,9Z"/><path class="cls-1" d="M14,9a1,1,0,0,1-.71-1.71,1,1,0,0,1,1.42,1.42,1,1,0,0,1-.16.12.56.56,0,0,1-.17.09.6.6,0,0,1-.19.06Z"/><path class="cls-1" d="M12,4a1,1,0,0,1-1-1V2a1,1,0,0,1,2,0V3A1,1,0,0,1,12,4Z"/><path class="cls-1" d="M9,22a1,1,0,0,1-1-1V18a1,1,0,0,1,2,0v3A1,1,0,0,1,9,22Z"/><path class="cls-1" d="M15,22a1,1,0,0,1-1-1V18a1,1,0,0,1,2,0v3A1,1,0,0,1,15,22Z"/><path class="cls-1" d="M15,19H9a1,1,0,0,1-1-1V12a1,1,0,0,1,1-1h6a1,1,0,0,1,1,1v6A1,1,0,0,1,15,19Zm-5-2h4V13H10Z"/><path class="cls-1" d="M5,17a1,1,0,0,1-.89-.55,1,1,0,0,1,.44-1.34l4-2a1,1,0,1,1,.9,1.78l-4,2A.93.93,0,0,1,5,17Z"/><path class="cls-1" d="M19,17a.93.93,0,0,1-.45-.11l-4-2a1,1,0,1,1,.9-1.78l4,2a1,1,0,0,1,.44,1.34A1,1,0,0,1,19,17Z"/></svg>`;
SVG.email = `
<svg class="svg-email" viewBox="0 0 24 24">
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.88534 5.2371C3.20538 5.86848 2.75 6.89295 2.75 8.5V15.5C2.75 17.107 3.20538 18.1315 3.88534 18.7629C4.57535 19.4036 5.61497 19.75 7 19.75H17C18.385 19.75 19.4246 19.4036 20.1147 18.7629C20.7946 18.1315 21.25 17.107 21.25 15.5V8.5C21.25 6.89295 20.7946 5.86848 20.1147 5.2371C19.4246 4.59637 18.385 4.25 17 4.25H7C5.61497 4.25 4.57535 4.59637 3.88534 5.2371ZM2.86466 4.1379C3.92465 3.15363 5.38503 2.75 7 2.75H17C18.615 2.75 20.0754 3.15363 21.1353 4.1379C22.2054 5.13152 22.75 6.60705 22.75 8.5V15.5C22.75 17.393 22.2054 18.8685 21.1353 19.8621C20.0754 20.8464 18.615 21.25 17 21.25H7C5.38503 21.25 3.92465 20.8464 2.86466 19.8621C1.79462 18.8685 1.25 17.393 1.25 15.5V8.5C1.25 6.60705 1.79462 5.13152 2.86466 4.1379Z"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M19.3633 7.31026C19.6166 7.63802 19.5562 8.10904 19.2285 8.3623L13.6814 12.6486C12.691 13.4138 11.3089 13.4138 10.3185 12.6486L4.77144 8.3623C4.44367 8.10904 4.38328 7.63802 4.63655 7.31026C4.88982 6.98249 5.36083 6.9221 5.6886 7.17537L11.2356 11.4616C11.6858 11.8095 12.3141 11.8095 12.7642 11.4616L18.3113 7.17537C18.6391 6.9221 19.1101 6.98249 19.3633 7.31026Z"/>
</svg>`;
SVG.history = `
<svg class="svg-history" viewBox="0 0 24 24">
<path d="M3,21V11a1,1,0,0,1,1-1h8a1,1,0,0,1,1,1V21a1,1,0,0,1-1,1H4A1,1,0,0,1,3,21ZM20,2H10A1,1,0,0,0,9,3V4h9.5a.5.5,0,0,1,.5.5V15h1a1,1,0,0,0,1-1V3A1,1,0,0,0,20,2ZM16,19a1,1,0,0,0,1-1V7a1,1,0,0,0-1-1H6A1,1,0,0,0,5,7V8h9.5a.5.5,0,0,1,.5.5V19Z"/></svg>`;
SVG.conversion = `
<svg class="svg-conversion" viewBox="0 0 32 32">
<path d="M16,9c-3.859,0-7,3.141-7,7s3.141,7,7,7s7-3.141,7-7S19.859,9,16,9z M16,19c-1.654,0-3-1.346-3-3
	s1.346-3,3-3s3,1.346,3,3S17.654,19,16,19z M16,2C8.28,2,2,8.28,2,16s6.28,14,14,14s14-6.28,14-14S23.72,2,16,2z M16,26
	c-5.514,0-10-4.486-10-10S10.486,6,16,6s10,4.486,10,10S21.514,26,16,26z"/>
</svg>`;
SVG.gear = `
<svg class="svg-gear" viewBox="0 0 32 32">
<path d="M27.526,18.036L27,17.732c-0.626-0.361-1-1.009-1-1.732s0.374-1.371,1-1.732l0.526-0.304  c1.436-0.83,1.927-2.662,1.098-4.098l-1-1.732c-0.827-1.433-2.666-1.925-4.098-1.098L23,7.339c-0.626,0.362-1.375,0.362-2,0  c-0.626-0.362-1-1.009-1-1.732V5c0-1.654-1.346-3-3-3h-2c-1.654,0-3,1.346-3,3v0.608c0,0.723-0.374,1.37-1,1.732  c-0.626,0.361-1.374,0.362-2,0L8.474,7.036C7.042,6.209,5.203,6.701,4.375,8.134l-1,1.732c-0.829,1.436-0.338,3.269,1.098,4.098  L5,14.268C5.626,14.629,6,15.277,6,16s-0.374,1.371-1,1.732l-0.526,0.304c-1.436,0.829-1.927,2.662-1.098,4.098l1,1.732  c0.828,1.433,2.667,1.925,4.098,1.098L9,24.661c0.626-0.363,1.374-0.361,2,0c0.626,0.362,1,1.009,1,1.732V27c0,1.654,1.346,3,3,3h2  c1.654,0,3-1.346,3-3v-0.608c0-0.723,0.374-1.37,1-1.732c0.625-0.361,1.374-0.362,2,0l0.526,0.304  c1.432,0.826,3.271,0.334,4.098-1.098l1-1.732C29.453,20.698,28.962,18.865,27.526,18.036z M16,21c-2.757,0-5-2.243-5-5s2.243-5,5-5  s5,2.243,5,5S18.757,21,16,21z"/></svg>`;
SVG.settings = `
<svg class="svg-settings svg-stroke" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M3 8L15 8M15 8C15 9.65686 16.3431 11 18 11C19.6569 11 21 9.65685 21 8C21 6.34315 19.6569 5 18 5C16.3431 5 15 6.34315 15 8ZM9 16L21 16M9 16C9 17.6569 7.65685 19 6 19C4.34315 19 3 17.6569 3 16C3 14.3431 4.34315 13 6 13C7.65685 13 9 14.3431 9 16Z" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>`;
SVG.user = `
<svg class="svg-user" viewBox="0 0 24 24"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path fill-rule="evenodd" clip-rule="evenodd" d="M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12ZM15 9C15 10.6569 13.6569 12 12 12C10.3431 12 9 10.6569 9 9C9 7.34315 10.3431 6 12 6C13.6569 6 15 7.34315 15 9ZM12 20.5C13.784 20.5 15.4397 19.9504 16.8069 19.0112C17.4108 18.5964 17.6688 17.8062 17.3178 17.1632C16.59 15.8303 15.0902 15 11.9999 15C8.90969 15 7.40997 15.8302 6.68214 17.1632C6.33105 17.8062 6.5891 18.5963 7.19296 19.0111C8.56018 19.9503 10.2159 20.5 12 20.5Z"></path> </g></svg>
`;
SVG.refresh = `
<svg class="svg-refresh svg-stroke" viewBox="0 0 24 24">
<path d="M4.06189 13C4.02104 12.6724 4 12.3387 4 12C4 7.58172 7.58172 4 12 4C14.5006 4 16.7332 5.14727 18.2002 6.94416M19.9381 11C19.979 11.3276 20 11.6613 20 12C20 16.4183 16.4183 20 12 20C9.61061 20 7.46589 18.9525 6 17.2916M9 17H6V17.2916M18.2002 4V6.94416M18.2002 6.94416V6.99993L15.2002 7M6 20V17.2916" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>`;
SVG.play = `
<svg class="svg-play" viewBox="-0.5 0 7 7">
    <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="Dribbble-Light-Preview" transform="translate(-347.000000, -3766.000000)">
            <g id="icons" transform="translate(56.000000, 160.000000)">
                <path d="M296.494737,3608.57322 L292.500752,3606.14219 C291.83208,3605.73542 291,3606.25002 291,3607.06891 L291,3611.93095 C291,3612.7509 291.83208,3613.26444 292.500752,3612.85767 L296.494737,3610.42771 C297.168421,3610.01774 297.168421,3608.98319 296.494737,3608.57322"></path>
            </g>
        </g>
    </g>
</svg>`;
SVG.words = `
<svg class="svg-words" viewBox="0 0 24 24">
<path opacity="0.5" class="svg-stroke" d="M13 7L3 7" stroke-width="1.5" stroke-linecap="round"/>
<path opacity="0.5" class="svg-stroke" d="M10 12H3" stroke-width="1.5" stroke-linecap="round"/>
<path opacity="0.5" class="svg-stroke" d="M8 17H3" stroke-width="1.5" stroke-linecap="round"/>
<path d="M11.3161 16.6922C11.1461 17.07 11.3145 17.514 11.6922 17.6839C12.07 17.8539 12.514 17.6855 12.6839 17.3078L11.3161 16.6922ZM16.5 7L17.1839 6.69223C17.0628 6.42309 16.7951 6.25 16.5 6.25C16.2049 6.25 15.9372 6.42309 15.8161 6.69223L16.5 7ZM20.3161 17.3078C20.486 17.6855 20.93 17.8539 21.3078 17.6839C21.6855 17.514 21.8539 17.07 21.6839 16.6922L20.3161 17.3078ZM19.3636 13.3636L20.0476 13.0559L19.3636 13.3636ZM13.6364 12.6136C13.2222 12.6136 12.8864 12.9494 12.8864 13.3636C12.8864 13.7779 13.2222 14.1136 13.6364 14.1136V12.6136ZM12.6839 17.3078L17.1839 7.30777L15.8161 6.69223L11.3161 16.6922L12.6839 17.3078ZM21.6839 16.6922L20.0476 13.0559L18.6797 13.6714L20.3161 17.3078L21.6839 16.6922ZM20.0476 13.0559L17.1839 6.69223L15.8161 7.30777L18.6797 13.6714L20.0476 13.0559ZM19.3636 12.6136H13.6364V14.1136H19.3636V12.6136Z"/>
</svg>`;
SVG.preview = `
<svg class="svg-preview" viewBox="0 0 24 24">
<path class="svg-stroke" d="M17 4H17.2C18.9913 4 19.887 4 20.4435 4.5565C21 5.11299 21 6.00866 21 7.8V8M17 20H17.2C18.9913 20 19.887 20 20.4435 19.4435C21 18.887 21 17.9913 21 16.2V16M7 4H6.8C5.00866 4 4.11299 4 3.5565 4.5565C3 5.11299 3 6.00866 3 7.8V8M7 20H6.8C5.00866 20 4.11299 20 3.5565 19.4435C3 18.887 3 17.9913 3 16.2V16" stroke-width="2" stroke-linecap="round"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M18.8149 12C18.8149 11.4637 18.6892 11.2462 18.4379 10.8112C17.5834 9.33247 15.6561 7 12 7C8.34395 7 6.41664 9.33247 5.56212 10.8112C5.31077 11.2462 5.18509 11.4637 5.18509 12C5.18509 12.5363 5.31077 12.7538 5.56212 13.1888C6.41664 14.6675 8.34395 17 12 17C15.6561 17 17.5834 14.6675 18.4379 13.1888C18.6892 12.7538 18.8149 12.5363 18.8149 12ZM12 15C13.6569 15 15 13.6569 15 12C15 10.3431 13.6569 9 12 9C10.3432 9 9.00001 10.3431 9.00001 12C9.00001 13.6569 10.3432 15 12 15Z"/>
</svg>`;
SVG.engagement = `
<svg class="svg-engagement" viewBox="0 0 256 256">
  <path d="M213.65723,181.65723l-32,32A8.00038,8.00038,0,0,1,168,208V184H48a8,8,0,0,1,0-16H168V144a8.00038,8.00038,0,0,1,13.65723-5.65723l32,32A8.00122,8.00122,0,0,1,213.65723,181.65723Zm-139.31446-64A8.00038,8.00038,0,0,0,88,112V88H208a8,8,0,0,0,0-16H88V48a8.00038,8.00038,0,0,0-13.65723-5.65723l-32,32a8.00122,8.00122,0,0,0,0,11.31446Z"/>
</svg>`;
SVG.apply = `
<svg class="svg-apply" viewBox="0 0 92 92" enable-background="new 0 0 92 92" xml:space="preserve">
<path id="XMLID_1532_" d="M89,13v66c0,2.2-1.8,4-4,4H32.9c-2.2,0-3.9-1.8-3.9-4V60.7c0-2.2,1.8-4,4-4s4,1.8,4,4V75h44V17H37v14.3
	c0,2.2-1.8,4-4,4s-4-1.8-4-4V13c0-2.2,1.7-4,3.9-4H85C87.2,9,89,10.8,89,13z M46.5,58.9c-1.6,1.6-1.5,4.1,0,5.7
	c0.8,0.8,1.8,1.2,2.8,1.2c1,0,2.1-0.4,2.8-1.2l15.7-15.8c1.5-1.6,1.5-4.1,0-5.6L52.2,27.2c-1.6-1.6-4.1-1.6-5.7,0
	c-1.6,1.6-1.6,4.1,0,5.7l8.9,9L7,42c-2.2,0-4,1.8-4,4c0,2.2,1.8,4,4,4c0,0,0,0,0,0l48.4-0.1L46.5,58.9z"/>
</svg>`;
SVG.back = `
<svg class="svg-back" viewBox="0 0 512 512">
	<path d="M490.667,234.667H158.17l112.915-112.915c8.331-8.331,8.331-21.839,0-30.17s-21.839-8.331-30.17,0L91.582,240.915
		c-0.497,0.497-0.967,1.02-1.413,1.563c-0.202,0.246-0.378,0.506-0.568,0.759c-0.228,0.304-0.463,0.601-0.674,0.917
		c-0.203,0.303-0.379,0.618-0.564,0.929c-0.171,0.286-0.351,0.566-0.509,0.861c-0.169,0.317-0.313,0.643-0.465,0.966
		c-0.145,0.308-0.299,0.611-0.43,0.926c-0.13,0.314-0.235,0.635-0.349,0.953c-0.122,0.338-0.251,0.672-0.356,1.018
		c-0.096,0.318-0.167,0.642-0.248,0.963c-0.089,0.353-0.188,0.702-0.259,1.061c-0.074,0.372-0.117,0.747-0.171,1.122
		c-0.045,0.314-0.105,0.623-0.136,0.941c-0.068,0.693-0.105,1.388-0.105,2.083c0,0.007-0.001,0.015-0.001,0.022
		s0.001,0.015,0.001,0.022c0.001,0.695,0.037,1.39,0.105,2.083c0.031,0.318,0.091,0.627,0.136,0.941
		c0.054,0.375,0.097,0.75,0.171,1.122c0.071,0.36,0.17,0.708,0.259,1.061c0.081,0.322,0.151,0.645,0.248,0.963
		c0.105,0.346,0.234,0.68,0.356,1.018c0.114,0.318,0.219,0.639,0.349,0.953c0.131,0.316,0.284,0.618,0.43,0.926
		c0.152,0.323,0.296,0.649,0.465,0.966c0.158,0.295,0.338,0.575,0.509,0.861c0.186,0.311,0.361,0.626,0.564,0.929
		c0.211,0.316,0.447,0.613,0.674,0.917c0.19,0.253,0.365,0.513,0.568,0.759c0.446,0.544,0.916,1.067,1.413,1.563l149.333,149.333
		c8.331,8.331,21.839,8.331,30.17,0s8.331-21.839,0-30.17L158.17,277.333h332.497c11.782,0,21.333-9.551,21.333-21.333
		S502.449,234.667,490.667,234.667z"/>
	<path d="M21.333,85.333C9.551,85.333,0,94.885,0,106.667v298.667c0,11.782,9.551,21.333,21.333,21.333
		c11.782,0,21.333-9.551,21.333-21.333V106.667C42.667,94.885,33.115,85.333,21.333,85.333z"/>
</svg>`;
SVG.loader = `
<svg class="svg-loader" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<style>
.spinner_P7sC{transform-origin:center;animation:spinner_svv2 .75s infinite linear}
@keyframes spinner_svv2{100%{transform:rotate(360deg)}}
</style>
<path d="M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z" class="spinner_P7sC"/>
</svg>
`;
SVG.models = `
<svg class="svg-models" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">

<defs>

<style>.cls-1{fill:#557;}.cls-1,.cls-2,.cls-4{fill-rule:evenodd;}.cls-2{fill:#667;}.cls-3,.cls-4{fill:#AAA;}.cls-5{fill:#888;}</style>

</defs>


<g data-name="Product Icons">

<polygon class="cls-1" points="20.69 12.43 12 16.78 12 22 20.69 17.65 20.69 12.43"/>

<path class="cls-2" d="M6.78,4.61,3.31,6.35Z"/>

<polygon class="cls-1" points="17.22 8.09 17.22 8.09 17.22 12.43 20.69 10.7 20.69 6.35 17.22 8.09"/>

<polygon class="cls-1" points="12 15.04 15.48 13.31 15.48 8.96 15.48 8.96 12 10.7 12 15.04"/>

<polygon class="cls-3" points="6.78 4.61 3.31 6.35 6.78 8.09 10.26 6.35 6.78 4.61"/>

<polygon class="cls-4" points="12 2 8.52 3.74 12 5.48 17.22 8.09 20.69 6.35 12 2"/>

<polygon class="cls-3" points="12 7.22 8.52 8.96 12 10.7 15.48 8.96 12 7.22"/>

<path class="cls-5" d="M8.52,15v5.22L12,22V16.78Zm2.61,5.22-1.74-.87V16.78l1.74.87Z"/>

<path class="cls-5" d="M3.31,6.35v11.3l3.47,1.74V8.09Zm2.61,11.3-1.75-.87v-10l1.75.87Z"/>

<path class="cls-5" d="M8.52,9,12,10.7V15L8.52,13.31Zm2.61,4.35v-3L9.39,9.45v3Z"/>
</g>
</svg>`;
SVG.models2 = `
<svg class="svg-models" viewBox="0 0 496 496" xml:space="preserve">
<g>
	<g>
		<g>
			<path d="M40,449.472V364.28L58.424,352H88v-16H53.576L24,355.72v93.752C14.704,452.784,8,461.584,8,472c0,13.232,10.768,24,24,24
				s24-10.768,24-24C56,461.584,49.288,452.784,40,449.472z M32,480c-4.416,0-8-3.584-8-8c0-4.416,3.584-8,8-8s8,3.584,8,8
				C40,476.416,36.416,480,32,480z"/>
			<path d="M46.528,320H88v-16H46.528c-3.312-9.288-12.112-16-22.528-16c-13.232,0-24,10.768-24,24s10.768,24,24,24
				C34.416,336,43.216,329.288,46.528,320z M16,312c0-4.416,3.584-8,8-8s8,3.584,8,8c0,4.416-3.584,8-8,8S16,316.416,16,312z"/>
			<path d="M24,272c10.416,0,19.216-6.712,22.528-16H88v-16H46.528c-3.312-9.296-12.112-16-22.528-16c-13.232,0-24,10.768-24,24
				S10.768,272,24,272z M24,240c4.416,0,8,3.584,8,8s-3.584,8-8,8s-8-3.584-8-8C16,243.584,19.584,240,24,240z"/>
			<rect x="56" y="272" width="32" height="16"/>
			<rect x="56" y="208" width="32" height="16"/>
			<rect y="176" width="88" height="16"/>
			<path d="M60.688,160H88v-16H67.312L48,124.688v-14.16C57.288,107.216,64,98.416,64,88c0-13.232-10.768-24-24-24S16,74.768,16,88
				c0,10.416,6.704,19.216,16,22.528v20.784L60.688,160z M40,80c4.416,0,8,3.584,8,8s-3.584,8-8,8s-8-3.584-8-8S35.584,80,40,80z"/>
			<polygon points="144,67.312 144,88 160,88 160,60.688 131.312,32 0,32 0,48 124.688,48 			"/>
			<polygon points="176,35.312 176,88 192,88 192,28.688 163.312,0 0,0 0,16 156.688,16 			"/>
			<rect x="208" y="56" width="16" height="32"/>
			<rect x="304" width="16" height="88"/>
			<path d="M240,46.528V88h16V59.312l16,16V88h16V68.688L262.392,43.08C268.192,38.696,272,31.816,272,24c0-13.232-10.768-24-24-24
				s-24,10.768-24,24C224,34.416,230.704,43.216,240,46.528z M248,16c4.416,0,8,3.584,8,8s-3.584,8-8,8s-8-3.584-8-8
				S243.584,16,248,16z"/>
			<path d="M352,51.312L371.312,32h78.16c2.416,6.776,7.752,12.112,14.528,14.528v110.16L444.688,176H408v16h43.312L480,163.312
				V46.528c9.288-3.312,16-12.112,16-22.528c0-13.232-10.768-24-24-24c-10.416,0-19.216,6.712-22.528,16h-84.784L336,44.688V88h16
				V51.312z M472,16c4.416,0,8,3.584,8,8s-3.584,8-8,8c-4.416,0-8-3.584-8-8S467.584,16,472,16z"/>
			<path d="M414.08,97.392l17.92,17.92v9.376L412.688,144H408v16h11.312L448,131.312v-22.624L419.312,80h-4.784
				c-3.312-9.288-12.112-16-22.528-16c-13.232,0-24,10.768-24,24s10.768,24,24,24C401.904,112,410.416,105.968,414.08,97.392z
				 M392,96c-4.416,0-8-3.584-8-8s3.584-8,8-8c4.416,0,8,3.584,8,8S396.416,96,392,96z"/>
			<rect x="408" y="208" width="88" height="16"/>
			<path d="M480,449.472V268.688L451.312,240H408v16h36.688L464,275.312v41.376L451.312,304H408v16h36.688L464,339.312v110.16
				c-9.296,3.312-16,12.112-16,22.528c0,13.232,10.768,24,24,24s24-10.768,24-24C496,461.584,489.288,452.784,480,449.472z M472,480
				c-4.416,0-8-3.584-8-8c0-4.416,3.584-8,8-8c4.416,0,8,3.584,8,8C480,476.416,476.416,480,472,480z"/>
			<rect x="408" y="272" width="32" height="16"/>
			<path d="M448,364.688L419.312,336H408v16h4.688L432,371.312V416h-80v-8h-16v24h96v12.688L412.688,464h-14.16
				c-3.312-9.288-12.112-16-22.528-16c-13.232,0-24,10.768-24,24s10.768,24,24,24c10.416,0,19.216-6.712,22.528-16h20.784
				L448,451.312V364.688z M376,480c-4.416,0-8-3.584-8-8c0-4.416,3.584-8,8-8c4.416,0,8,3.584,8,8C384,476.416,380.416,480,376,480z
				"/>
			<path d="M160,408h-16v8h-41.472c-3.312-9.288-12.112-16-22.528-16c-13.232,0-24,10.768-24,24s10.768,24,24,24
				c10.416,0,19.216-6.712,22.528-16H160V408z M80,432c-4.416,0-8-3.584-8-8c0-4.416,3.584-8,8-8s8,3.584,8,8
				C88,428.416,84.416,432,80,432z"/>
			<rect x="304" y="408" width="16" height="88"/>
			<rect x="272" y="408" width="16" height="88"/>
			<path d="M240,420.688l-16,16V408h-16v41.472c-9.296,3.312-16,12.112-16,22.528c0,13.232,10.768,24,24,24s24-10.768,24-24
				c0-7.816-3.808-14.696-9.608-19.08L256,427.312V408h-16V420.688z M216,480c-4.416,0-8-3.584-8-8c0-4.416,3.584-8,8-8s8,3.584,8,8
				C224,476.416,220.416,480,216,480z"/>
			<polygon points="192,408 176,408 176,428.688 152,452.688 152,496 168,496 168,459.312 192,435.312 			"/>
			<path d="M336,392h16v-16h24v-24h16v-16h-16v-16h16v-16h-16v-16h16v-16h-16v-16h16v-16h-16v-16h16v-16h-16v-16h16v-16h-16v-16h16
				v-16h-16v-24h-24v-16h-16v16h-16v-16h-16v16h-16v-16h-16v16h-16v-16h-16v16h-16v-16h-16v16h-16v-16h-16v16h-16v-16h-16v16h-3.312
				L120,140.688V144h-16v16h16v16h-16v16h16v16h-16v16h16v16h-16v16h16v16h-16v16h16v16h-16v16h16v16h-16v16h16v24h24v16h16v-16h16
				v16h16v-16h16v16h16v-16h16v16h16v-16h16v16h16v-16h16v16h16v-16h16V392z M136,360V147.312L147.312,136H360v224H136z"/>
			<path d="M318.888,211.048l13.96-13.96l-33.936-33.936l-13.96,13.96c-4.16-2.184-8.488-3.976-12.952-5.384V152h-48v19.728
				c-4.472,1.408-8.8,3.2-12.952,5.384l-13.96-13.96l-33.936,33.936l13.96,13.96c-2.176,4.16-3.976,8.488-5.384,12.952H152v48
				h19.728c1.408,4.472,3.2,8.8,5.384,12.952l-13.96,13.96l33.936,33.936l13.96-13.96c4.16,2.176,8.48,3.976,12.952,5.384V344h48
				v-19.728c4.472-1.408,8.8-3.2,12.952-5.384l13.96,13.96l33.936-33.936l-13.96-13.96c2.176-4.152,3.976-8.48,5.384-12.952H344v-48
				h-19.728C322.864,219.528,321.072,215.2,318.888,211.048z M328,256h-16.224l-1.416,6.224c-1.6,7.016-4.368,13.672-8.216,19.792
				l-3.408,5.408l11.496,11.496l-11.312,11.312l-11.496-11.496l-5.408,3.408c-6.12,3.848-12.776,6.616-19.792,8.216L256,311.776V328
				h-16v-16.224l-6.224-1.416c-7.016-1.6-13.672-4.368-19.792-8.216l-5.408-3.408l-11.496,11.496l-11.312-11.312l11.496-11.496
				l-3.408-5.408c-3.848-6.12-6.616-12.776-8.216-19.792L184.224,256H168v-16h16.224l1.416-6.224
				c1.6-7.016,4.368-13.672,8.216-19.792l3.408-5.408l-11.496-11.496l11.312-11.312l11.496,11.488l5.408-3.408
				c6.12-3.848,12.776-6.616,19.792-8.216l6.224-1.408V168h16v16.224l6.224,1.416c7.016,1.6,13.672,4.368,19.792,8.216l5.408,3.408
				l11.496-11.488l11.312,11.312l-11.496,11.496l3.408,5.408c3.848,6.12,6.616,12.776,8.216,19.792l1.416,6.216H328V256z"/>
			<path d="M248,208c-22.056,0-40,17.944-40,40c0,22.056,17.944,40,40,40c22.056,0,40-17.944,40-40C288,225.944,270.056,208,248,208
				z M248,272c-13.232,0-24-10.768-24-24s10.768-24,24-24s24,10.768,24,24S261.232,272,248,272z"/>
		</g>
	</g>
</g>
</svg>`;
SVG.loader21 = `<svg class="svg-loader svg-stroke" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" style="background: none;"><defs><mask id="lds-flat-gear-94ec7473823b6"><circle cx="50" cy="50" r="45" fill="#fff"></circle></mask></defs>
<circle cx="50" cy="50" r="45" fill="#fdc823"></circle>
<path d="M28.786796564403573 71.21320343559643 L39.39339828220179 60.60660171779821 A15 15 0 0 1 60.60660171779821 39.39339828220179 L71.21320343559643 28.786796564403577 L171.21320343559643 128.78679656440357 L128.78679656440357 171.21320343559643 Z" fill="rgb(204, 161, 28)" mask="url(#lds-flat-gear-94ec7473823b6)"></path>
<g transform="translate(50 50)">
<g transform="rotate(96.9231)">
<animateTransform attributeName="transform" type="rotate" values="0;360" keyTimes="0;1" dur="2.6s" repeatCount="indefinite"></animateTransform><path d="M37.43995192304605 -6.5 L47.43995192304605 -6.5 L47.43995192304605 6.5 L37.43995192304605 6.5 A38 38 0 0 1 35.67394948182593 13.090810836924174 L35.67394948182593 13.090810836924174 L44.33420351967032 18.090810836924174 L37.83420351967032 29.34914108612188 L29.17394948182593 24.34914108612188 A38 38 0 0 1 24.34914108612188 29.17394948182593 L24.34914108612188 29.17394948182593 L29.34914108612188 37.83420351967032 L18.090810836924184 44.33420351967032 L13.090810836924183 35.67394948182593 A38 38 0 0 1 6.5 37.43995192304605 L6.5 37.43995192304605 L6.500000000000001 47.43995192304605 L-6.499999999999995 47.43995192304606 L-6.499999999999996 37.43995192304606 A38 38 0 0 1 -13.09081083692417 35.67394948182593 L-13.09081083692417 35.67394948182593 L-18.09081083692417 44.33420351967032 L-29.34914108612187 37.834203519670325 L-24.349141086121872 29.173949481825936 A38 38 0 0 1 -29.17394948182592 24.34914108612189 L-29.17394948182592 24.34914108612189 L-37.83420351967031 29.349141086121893 L-44.33420351967031 18.0908108369242 L-35.67394948182592 13.090810836924193 A38 38 0 0 1 -37.43995192304605 6.5000000000000036 L-37.43995192304605 6.5000000000000036 L-47.43995192304605 6.500000000000004 L-47.43995192304606 -6.499999999999993 L-37.43995192304606 -6.499999999999994 A38 38 0 0 1 -35.67394948182593 -13.090810836924167 L-35.67394948182593 -13.090810836924167 L-44.33420351967032 -18.090810836924163 L-37.834203519670325 -29.34914108612187 L-29.173949481825936 -24.34914108612187 A38 38 0 0 1 -24.349141086121893 -29.17394948182592 L-24.349141086121893 -29.17394948182592 L-29.349141086121897 -37.834203519670304 L-18.0908108369242 -44.334203519670304 L-13.090810836924195 -35.67394948182592 A38 38 0 0 1 -6.500000000000005 -37.43995192304605 L-6.500000000000005 -37.43995192304605 L-6.500000000000007 -47.43995192304605 L6.49999999999999 -47.43995192304606 L6.499999999999992 -37.43995192304606 A38 38 0 0 1 13.090810836924149 -35.67394948182594 L13.090810836924149 -35.67394948182594 L18.090810836924142 -44.33420351967033 L29.349141086121847 -37.83420351967034 L24.349141086121854 -29.17394948182595 A38 38 0 0 1 29.17394948182592 -24.349141086121893 L29.17394948182592 -24.349141086121893 L37.834203519670304 -29.349141086121897 L44.334203519670304 -18.0908108369242 L35.67394948182592 -13.090810836924197 A38 38 0 0 1 37.43995192304605 -6.500000000000007 M0 -20A20 20 0 1 0 0 20 A20 20 0 1 0 0 -20" fill="#ffffe3" transform="scale(0.65)"></path>
</g></g></svg>`;
SVG.loader11 = `<svg class="svg-loader" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><style>.spinner_ZCsl{animation:spinner_qV4G 1.2s cubic-bezier(0.52,.6,.25,.99) infinite}.spinner_gaIW{animation-delay:.6s}@keyframes spinner_qV4G{0%{r:0;opacity:1}100%{r:11px;opacity:0}}</style><circle class="spinner_ZCsl" cx="12" cy="12" r="0"/><circle class="spinner_ZCsl spinner_gaIW" cx="12" cy="12" r="0"/></svg>`;
SVG.loader12 = `<svg class="svg-loader" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><style>.spinner_ajPY{transform-origin:center;animation:spinner_AtaB .75s infinite linear}@keyframes spinner_AtaB{100%{transform:rotate(360deg)}}</style><path d="M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z" opacity=".25"/><path d="M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z" class="spinner_ajPY"/></svg>`;
SVG.loader14 = `<svg class="svg-loader svg-stroke" viewBox="0 0 300 150"><path fill="none" stroke-width="15" stroke-linecap="round" stroke-dasharray="300 385" stroke-dashoffset="0" d="M275 75c0 31-27 50-50 50-58 0-92-100-150-100-28 0-50 22-50 50s23 50 50 50c58 0 92-100 150-100 24 0 50 19 50 50Z"><animate attributeName="stroke-dashoffset" calcMode="spline" dur="2" values="685;-685" keySplines="0 0 1 1" repeatCount="indefinite"></animate></path></svg>`;
SVG.loader7 = `
<svg class="svg-loader" viewBox="0 0 135 140">
    <rect y="10" width="15" height="120" rx="6">
        <animate attributeName="height"
             begin="0.5s" dur="1s"
             values="120;110;100;90;80;70;60;50;40;140;120" calcMode="linear"
             repeatCount="indefinite" />
        <animate attributeName="y"
             begin="0.5s" dur="1s"
             values="10;15;20;25;30;35;40;45;50;0;10" calcMode="linear"
             repeatCount="indefinite" />
    </rect>
    <rect x="30" y="10" width="15" height="120" rx="6">
        <animate attributeName="height"
             begin="0.25s" dur="1s"
             values="120;110;100;90;80;70;60;50;40;140;120" calcMode="linear"
             repeatCount="indefinite" />
        <animate attributeName="y"
             begin="0.25s" dur="1s"
             values="10;15;20;25;30;35;40;45;50;0;10" calcMode="linear"
             repeatCount="indefinite" />
    </rect>
    <rect x="60" width="15" height="140" rx="6">
        <animate attributeName="height"
             begin="0s" dur="1s"
             values="120;110;100;90;80;70;60;50;40;140;120" calcMode="linear"
             repeatCount="indefinite" />
        <animate attributeName="y"
             begin="0s" dur="1s"
             values="10;15;20;25;30;35;40;45;50;0;10" calcMode="linear"
             repeatCount="indefinite" />
    </rect>
    <rect x="90" y="10" width="15" height="120" rx="6">
        <animate attributeName="height"
             begin="0.25s" dur="1s"
             values="120;110;100;90;80;70;60;50;40;140;120" calcMode="linear"
             repeatCount="indefinite" />
        <animate attributeName="y"
             begin="0.25s" dur="1s"
             values="10;15;20;25;30;35;40;45;50;0;10" calcMode="linear"
             repeatCount="indefinite" />
    </rect>
    <rect x="120" y="10" width="15" height="120" rx="6">
        <animate attributeName="height"
             begin="0.5s" dur="1s"
             values="120;110;100;90;80;70;60;50;40;140;120" calcMode="linear"
             repeatCount="indefinite" />
        <animate attributeName="y"
             begin="0.5s" dur="1s"
             values="10;15;20;25;30;35;40;45;50;0;10" calcMode="linear"
             repeatCount="indefinite" />
    </rect>
</svg>
	`;
SVG.loader8 = `<svg class="svg-loader" viewBox="0 0 120 30">
    <circle cx="15" cy="15" r="15">
        <animate attributeName="r" from="15" to="15"
                 begin="0s" dur="0.8s"
                 values="15;9;15" calcMode="linear"
                 repeatCount="indefinite" />
        <animate attributeName="fill-opacity" from="1" to="1"
                 begin="0s" dur="0.8s"
                 values="1;.5;1" calcMode="linear"
                 repeatCount="indefinite" />
    </circle>
    <circle cx="60" cy="15" r="9" fill-opacity="0.3">
        <animate attributeName="r" from="9" to="9"
                 begin="0s" dur="0.8s"
                 values="9;15;9" calcMode="linear"
                 repeatCount="indefinite" />
        <animate attributeName="fill-opacity" from="0.5" to="0.5"
                 begin="0s" dur="0.8s"
                 values=".5;1;.5" calcMode="linear"
                 repeatCount="indefinite" />
    </circle>
    <circle cx="105" cy="15" r="15">
        <animate attributeName="r" from="15" to="15"
                 begin="0s" dur="0.8s"
                 values="15;9;15" calcMode="linear"
                 repeatCount="indefinite" />
        <animate attributeName="fill-opacity" from="1" to="1"
                 begin="0s" dur="0.8s"
                 values="1;.5;1" calcMode="linear"
                 repeatCount="indefinite" />
    </circle>
</svg>`;
SVG.loader2 = `<svg class="svg-loader" viewBox="-20 0 100 100" enable-background="new 0 0 0 0">
  <circle cx="6" cy="50" r="6">
    <animateTransform 
       attributeName="transform" 
       dur="1s" 
       type="translate" 
       values="0 15 ; 0 -15; 0 15" 
       repeatCount="indefinite" 
       begin="0.1"/>
  </circle>
  <circle cx="30" cy="50" r="6">
    <animateTransform 
       attributeName="transform" 
       dur="1s" 
       type="translate" 
       values="0 10 ; 0 -10; 0 10" 
       repeatCount="indefinite" 
       begin="0.2"/>
  </circle>
  <circle cx="54" cy="50" r="6">
    <animateTransform 
       attributeName="transform" 
       dur="1s" 
       type="translate" 
       values="0 5 ; 0 -5; 0 5" 
       repeatCount="indefinite" 
       begin="0.3"/>
  </circle>
</svg>`;
SVG.loader = `<svg class="svg-loader svg-stroke" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid">
<circle cx="6.451612903225806" cy="60.6229" r="3.41988" fill="rgba(233, 12, 89, 0.5125806451612902)">
  <animate attributeName="r" times="0;0.5;1" values="2.4000000000000004;3.5999999999999996;2.4000000000000004" dur="2s" repeatCount="indefinite" begin="-0.5s"></animate>
  <animate attributeName="cy" keyTimes="0;0.5;1" values="30.5;69.5;30.5" dur="2s" repeatCount="indefinite" begin="0s" keySplines="0.5 0 0.5 1;0.5 0 0.5 1" calcMode="spline"></animate>
  <animate attributeName="fill" keyTimes="0;0.5;1" values="rgba(233, 12, 89, 0.5125806451612902);#ff0033;rgba(233, 12, 89, 0.5125806451612902)" dur="2s" repeatCount="indefinite" begin="-0.5s"></animate>
</circle><circle cx="6.451612903225806" cy="39.3771" r="2.58012" fill="#46dff0">
  <animate attributeName="r" times="0;0.5;1" values="2.4000000000000004;3.5999999999999996;2.4000000000000004" dur="2s" repeatCount="indefinite" begin="-1.5s"></animate>
  <animate attributeName="cy" keyTimes="0;0.5;1" values="30.5;69.5;30.5" dur="2s" repeatCount="indefinite" begin="-1s" keySplines="0.5 0 0.5 1;0.5 0 0.5 1" calcMode="spline"></animate>
  <animate attributeName="fill" keyTimes="0;0.5;1" values="#46dff0;rgba(53, 58, 57, 0.1435483870967742);#46dff0" dur="2s" repeatCount="indefinite" begin="-0.5s"></animate>
</circle><circle cx="16.129032258064512" cy="68.1552" r="3.17988" fill="rgba(233, 12, 89, 0.5125806451612902)">
  <animate attributeName="r" times="0;0.5;1" values="2.4000000000000004;3.5999999999999996;2.4000000000000004" dur="2s" repeatCount="indefinite" begin="-0.7s"></animate>
  <animate attributeName="cy" keyTimes="0;0.5;1" values="30.5;69.5;30.5" dur="2s" repeatCount="indefinite" begin="-0.2s" keySplines="0.5 0 0.5 1;0.5 0 0.5 1" calcMode="spline"></animate>
  <animate attributeName="fill" keyTimes="0;0.5;1" values="rgba(233, 12, 89, 0.5125806451612902);#ff0033;rgba(233, 12, 89, 0.5125806451612902)" dur="2s" repeatCount="indefinite" begin="-0.7s"></animate>
</circle><circle cx="16.129032258064512" cy="31.8448" r="2.82012" fill="#46dff0">
  <animate attributeName="r" times="0;0.5;1" values="2.4000000000000004;3.5999999999999996;2.4000000000000004" dur="2s" repeatCount="indefinite" begin="-1.7s"></animate>
  <animate attributeName="cy" keyTimes="0;0.5;1" values="30.5;69.5;30.5" dur="2s" repeatCount="indefinite" begin="-1.2s" keySplines="0.5 0 0.5 1;0.5 0 0.5 1" calcMode="spline"></animate>
  <animate attributeName="fill" keyTimes="0;0.5;1" values="#46dff0;rgba(53, 58, 57, 0.1435483870967742);#46dff0" dur="2s" repeatCount="indefinite" begin="-0.7s"></animate>
</circle><circle cx="25.806451612903224" cy="69.3634" r="2.93988" fill="rgba(233, 12, 89, 0.5125806451612902)">
  <animate attributeName="r" times="0;0.5;1" values="2.4000000000000004;3.5999999999999996;2.4000000000000004" dur="2s" repeatCount="indefinite" begin="-0.9s"></animate>
  <animate attributeName="cy" keyTimes="0;0.5;1" values="30.5;69.5;30.5" dur="2s" repeatCount="indefinite" begin="-0.4s" keySplines="0.5 0 0.5 1;0.5 0 0.5 1" calcMode="spline"></animate>
  <animate attributeName="fill" keyTimes="0;0.5;1" values="rgba(233, 12, 89, 0.5125806451612902);#ff0033;rgba(233, 12, 89, 0.5125806451612902)" dur="2s" repeatCount="indefinite" begin="-0.9s"></animate>
</circle><circle cx="25.806451612903224" cy="30.6366" r="3.06012" fill="#46dff0">
  <animate attributeName="r" times="0;0.5;1" values="2.4000000000000004;3.5999999999999996;2.4000000000000004" dur="2s" repeatCount="indefinite" begin="-1.9s"></animate>
  <animate attributeName="cy" keyTimes="0;0.5;1" values="30.5;69.5;30.5" dur="2s" repeatCount="indefinite" begin="-1.4s" keySplines="0.5 0 0.5 1;0.5 0 0.5 1" calcMode="spline"></animate>
  <animate attributeName="fill" keyTimes="0;0.5;1" values="#46dff0;rgba(53, 58, 57, 0.1435483870967742);#46dff0" dur="2s" repeatCount="indefinite" begin="-0.9s"></animate>
</circle><circle cx="35.48387096774193" cy="65.3666" r="2.69988" fill="rgba(233, 12, 89, 0.5125806451612902)">
  <animate attributeName="r" times="0;0.5;1" values="2.4000000000000004;3.5999999999999996;2.4000000000000004" dur="2s" repeatCount="indefinite" begin="-1.1s"></animate>
  <animate attributeName="cy" keyTimes="0;0.5;1" values="30.5;69.5;30.5" dur="2s" repeatCount="indefinite" begin="-0.6s" keySplines="0.5 0 0.5 1;0.5 0 0.5 1" calcMode="spline"></animate>
  <animate attributeName="fill" keyTimes="0;0.5;1" values="rgba(233, 12, 89, 0.5125806451612902);#ff0033;rgba(233, 12, 89, 0.5125806451612902)" dur="2s" repeatCount="indefinite" begin="-1.1s"></animate>
</circle><circle cx="35.48387096774193" cy="34.6334" r="3.30012" fill="#46dff0">
  <animate attributeName="r" times="0;0.5;1" values="2.4000000000000004;3.5999999999999996;2.4000000000000004" dur="2s" repeatCount="indefinite" begin="-2.1s"></animate>
  <animate attributeName="cy" keyTimes="0;0.5;1" values="30.5;69.5;30.5" dur="2s" repeatCount="indefinite" begin="-1.6s" keySplines="0.5 0 0.5 1;0.5 0 0.5 1" calcMode="spline"></animate>
  <animate attributeName="fill" keyTimes="0;0.5;1" values="#46dff0;rgba(53, 58, 57, 0.1435483870967742);#46dff0" dur="2s" repeatCount="indefinite" begin="-1.1s"></animate>
</circle><circle cx="45.16129032258064" cy="53.8474" r="2.45988" fill="rgba(233, 12, 89, 0.5125806451612902)">
  <animate attributeName="r" times="0;0.5;1" values="2.4000000000000004;3.5999999999999996;2.4000000000000004" dur="2s" repeatCount="indefinite" begin="-1.3s"></animate>
  <animate attributeName="cy" keyTimes="0;0.5;1" values="30.5;69.5;30.5" dur="2s" repeatCount="indefinite" begin="-0.8s" keySplines="0.5 0 0.5 1;0.5 0 0.5 1" calcMode="spline"></animate>
  <animate attributeName="fill" keyTimes="0;0.5;1" values="rgba(233, 12, 89, 0.5125806451612902);#ff0033;rgba(233, 12, 89, 0.5125806451612902)" dur="2s" repeatCount="indefinite" begin="-1.3s"></animate>
</circle><circle cx="45.16129032258064" cy="46.1526" r="3.54012" fill="#46dff0">
  <animate attributeName="r" times="0;0.5;1" values="2.4000000000000004;3.5999999999999996;2.4000000000000004" dur="2s" repeatCount="indefinite" begin="-2.3s"></animate>
  <animate attributeName="cy" keyTimes="0;0.5;1" values="30.5;69.5;30.5" dur="2s" repeatCount="indefinite" begin="-1.8s" keySplines="0.5 0 0.5 1;0.5 0 0.5 1" calcMode="spline"></animate>
  <animate attributeName="fill" keyTimes="0;0.5;1" values="#46dff0;rgba(53, 58, 57, 0.1435483870967742);#46dff0" dur="2s" repeatCount="indefinite" begin="-1.3s"></animate>
</circle><circle cx="54.838709677419345" cy="39.3771" r="2.58012" fill="rgba(233, 12, 89, 0.5125806451612902)">
  <animate attributeName="r" times="0;0.5;1" values="2.4000000000000004;3.5999999999999996;2.4000000000000004" dur="2s" repeatCount="indefinite" begin="-1.5s"></animate>
  <animate attributeName="cy" keyTimes="0;0.5;1" values="30.5;69.5;30.5" dur="2s" repeatCount="indefinite" begin="-1s" keySplines="0.5 0 0.5 1;0.5 0 0.5 1" calcMode="spline"></animate>
  <animate attributeName="fill" keyTimes="0;0.5;1" values="rgba(233, 12, 89, 0.5125806451612902);#ff0033;rgba(233, 12, 89, 0.5125806451612902)" dur="2s" repeatCount="indefinite" begin="-1.5s"></animate>
</circle><circle cx="54.838709677419345" cy="60.6229" r="3.41988" fill="#46dff0">
  <animate attributeName="r" times="0;0.5;1" values="2.4000000000000004;3.5999999999999996;2.4000000000000004" dur="2s" repeatCount="indefinite" begin="-2.5s"></animate>
  <animate attributeName="cy" keyTimes="0;0.5;1" values="30.5;69.5;30.5" dur="2s" repeatCount="indefinite" begin="-2s" keySplines="0.5 0 0.5 1;0.5 0 0.5 1" calcMode="spline"></animate>
  <animate attributeName="fill" keyTimes="0;0.5;1" values="#46dff0;rgba(53, 58, 57, 0.1435483870967742);#46dff0" dur="2s" repeatCount="indefinite" begin="-1.5s"></animate>
</circle><circle cx="64.51612903225805" cy="31.8448" r="2.82012" fill="rgba(233, 12, 89, 0.5125806451612902)">
  <animate attributeName="r" times="0;0.5;1" values="2.4000000000000004;3.5999999999999996;2.4000000000000004" dur="2s" repeatCount="indefinite" begin="-1.7s"></animate>
  <animate attributeName="cy" keyTimes="0;0.5;1" values="30.5;69.5;30.5" dur="2s" repeatCount="indefinite" begin="-1.2s" keySplines="0.5 0 0.5 1;0.5 0 0.5 1" calcMode="spline"></animate>
  <animate attributeName="fill" keyTimes="0;0.5;1" values="rgba(233, 12, 89, 0.5125806451612902);#ff0033;rgba(233, 12, 89, 0.5125806451612902)" dur="2s" repeatCount="indefinite" begin="-1.7s"></animate>
</circle><circle cx="64.51612903225805" cy="68.1552" r="3.17988" fill="#46dff0">
  <animate attributeName="r" times="0;0.5;1" values="2.4000000000000004;3.5999999999999996;2.4000000000000004" dur="2s" repeatCount="indefinite" begin="-2.7s"></animate>
  <animate attributeName="cy" keyTimes="0;0.5;1" values="30.5;69.5;30.5" dur="2s" repeatCount="indefinite" begin="-2.2s" keySplines="0.5 0 0.5 1;0.5 0 0.5 1" calcMode="spline"></animate>
  <animate attributeName="fill" keyTimes="0;0.5;1" values="#46dff0;rgba(53, 58, 57, 0.1435483870967742);#46dff0" dur="2s" repeatCount="indefinite" begin="-1.7s"></animate>
</circle><circle cx="74.19354838709677" cy="30.6366" r="3.06012" fill="rgba(233, 12, 89, 0.5125806451612902)">
  <animate attributeName="r" times="0;0.5;1" values="2.4000000000000004;3.5999999999999996;2.4000000000000004" dur="2s" repeatCount="indefinite" begin="-1.9s"></animate>
  <animate attributeName="cy" keyTimes="0;0.5;1" values="30.5;69.5;30.5" dur="2s" repeatCount="indefinite" begin="-1.4s" keySplines="0.5 0 0.5 1;0.5 0 0.5 1" calcMode="spline"></animate>
  <animate attributeName="fill" keyTimes="0;0.5;1" values="rgba(233, 12, 89, 0.5125806451612902);#ff0033;rgba(233, 12, 89, 0.5125806451612902)" dur="2s" repeatCount="indefinite" begin="-1.9s"></animate>
</circle><circle cx="74.19354838709677" cy="69.3634" r="2.93988" fill="#46dff0">
  <animate attributeName="r" times="0;0.5;1" values="2.4000000000000004;3.5999999999999996;2.4000000000000004" dur="2s" repeatCount="indefinite" begin="-2.9s"></animate>
  <animate attributeName="cy" keyTimes="0;0.5;1" values="30.5;69.5;30.5" dur="2s" repeatCount="indefinite" begin="-2.4s" keySplines="0.5 0 0.5 1;0.5 0 0.5 1" calcMode="spline"></animate>
  <animate attributeName="fill" keyTimes="0;0.5;1" values="#46dff0;rgba(53, 58, 57, 0.1435483870967742);#46dff0" dur="2s" repeatCount="indefinite" begin="-1.9s"></animate>
</circle><circle cx="83.87096774193547" cy="34.6334" r="3.30012" fill="rgba(233, 12, 89, 0.5125806451612902)">
  <animate attributeName="r" times="0;0.5;1" values="2.4000000000000004;3.5999999999999996;2.4000000000000004" dur="2s" repeatCount="indefinite" begin="-2.1s"></animate>
  <animate attributeName="cy" keyTimes="0;0.5;1" values="30.5;69.5;30.5" dur="2s" repeatCount="indefinite" begin="-1.6s" keySplines="0.5 0 0.5 1;0.5 0 0.5 1" calcMode="spline"></animate>
  <animate attributeName="fill" keyTimes="0;0.5;1" values="rgba(233, 12, 89, 0.5125806451612902);#ff0033;rgba(233, 12, 89, 0.5125806451612902)" dur="2s" repeatCount="indefinite" begin="-2.1s"></animate>
</circle><circle cx="83.87096774193547" cy="65.3666" r="2.69988" fill="#46dff0">
  <animate attributeName="r" times="0;0.5;1" values="2.4000000000000004;3.5999999999999996;2.4000000000000004" dur="2s" repeatCount="indefinite" begin="-3.1s"></animate>
  <animate attributeName="cy" keyTimes="0;0.5;1" values="30.5;69.5;30.5" dur="2s" repeatCount="indefinite" begin="-2.6s" keySplines="0.5 0 0.5 1;0.5 0 0.5 1" calcMode="spline"></animate>
  <animate attributeName="fill" keyTimes="0;0.5;1" values="#46dff0;rgba(53, 58, 57, 0.1435483870967742);#46dff0" dur="2s" repeatCount="indefinite" begin="-2.1s"></animate>
</circle><circle cx="93.54838709677418" cy="46.1526" r="3.54012" fill="rgba(233, 12, 89, 0.5125806451612902)">
  <animate attributeName="r" times="0;0.5;1" values="2.4000000000000004;3.5999999999999996;2.4000000000000004" dur="2s" repeatCount="indefinite" begin="-2.3s"></animate>
  <animate attributeName="cy" keyTimes="0;0.5;1" values="30.5;69.5;30.5" dur="2s" repeatCount="indefinite" begin="-1.8s" keySplines="0.5 0 0.5 1;0.5 0 0.5 1" calcMode="spline"></animate>
  <animate attributeName="fill" keyTimes="0;0.5;1" values="rgba(233, 12, 89, 0.5125806451612902);#ff0033;rgba(233, 12, 89, 0.5125806451612902)" dur="2s" repeatCount="indefinite" begin="-2.3s"></animate>
</circle><circle cx="93.54838709677418" cy="53.8474" r="2.45988" fill="#46dff0">
  <animate attributeName="r" times="0;0.5;1" values="2.4000000000000004;3.5999999999999996;2.4000000000000004" dur="2s" repeatCount="indefinite" begin="-3.3s"></animate>
  <animate attributeName="cy" keyTimes="0;0.5;1" values="30.5;69.5;30.5" dur="2s" repeatCount="indefinite" begin="-2.8s" keySplines="0.5 0 0.5 1;0.5 0 0.5 1" calcMode="spline"></animate>
  <animate attributeName="fill" keyTimes="0;0.5;1" values="#46dff0;rgba(53, 58, 57, 0.1435483870967742);#46dff0" dur="2s" repeatCount="indefinite" begin="-2.3s"></animate>
</circle>
<!-- [ldio] generated by https://loading.io/ --></svg>`;
SVG.naga = `<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_1_2)">
<path d="M19.0779 1H21.0661C21.348 1.0775 21.9114 1.08789 22.2241 1.12485C23.6863 1.29761 25.0854 1.58805 26.4665 2.10765C26.7133 2.20052 27.2273 2.43708 27.4608 2.47779L27.4838 2.48007C27.9663 2.5242 28.9295 2.50223 29.4413 2.50263L33.0435 2.50196C33.1651 2.50192 34.1721 2.48147 34.2272 2.49805C34.2192 2.62634 33.9037 2.87608 33.8018 2.98022C33.6836 3.10108 33.5364 3.26585 33.4162 3.37895C33.1347 3.64391 32.4284 3.55732 32.0489 3.55529L30.2558 3.55402C30.1658 3.55361 29.6234 3.54387 29.5694 3.55491C29.6994 3.64978 30.3329 4.07052 30.4591 4.11665C30.674 4.15898 31.1138 4.12013 31.3646 4.13089C31.4424 4.02732 31.5128 3.92331 31.6526 3.90367C31.9129 3.86707 32.0503 4.22768 31.8979 4.4115C31.7868 4.54548 31.6546 4.51487 31.5122 4.47247C31.4691 4.41883 31.3892 4.31324 31.3417 4.27072C31.1975 4.2694 30.8205 4.2569 30.6939 4.27946C30.8637 4.39324 31.4442 4.87512 31.5687 4.91299C31.7822 4.95058 32.2108 4.93636 32.4464 4.93549L33.8962 4.93157L35.8258 4.93244C36.1107 4.93233 36.6247 4.94649 36.8865 4.91246C36.8868 5.08435 36.9044 5.60606 36.8507 5.73224C36.7489 5.77382 36.0347 5.75165 35.8755 5.75102L33.6657 5.75272C33.4162 5.75363 32.8113 5.74042 32.5834 5.76694C32.7755 5.95092 32.9659 6.13654 33.1548 6.32379C33.2419 6.41125 33.4733 6.66327 33.5656 6.71895C33.7098 6.7679 34.0139 6.75121 34.1767 6.74768C34.0766 6.86287 33.987 6.95174 33.8779 7.059C34.0475 7.27572 34.2628 7.44537 34.3983 7.68866C34.4051 7.70099 34.4401 7.75726 34.4469 7.76606C34.5824 7.63836 34.7084 7.51363 34.9097 7.52904C35.3951 7.5662 35.5989 8.17196 35.1881 8.46514C35.1516 8.49075 35.1132 8.51354 35.0734 8.53343C35.4731 8.94415 35.7925 9.44647 36.0969 9.92963C37.5508 12.2369 38.5145 14.8943 38.85 17.6021C38.888 17.9092 38.9088 18.4967 39 18.7654V21.294C38.9529 21.44 38.9413 21.6587 38.9244 21.8161C38.8971 22.0864 38.8653 22.3561 38.8289 22.6253C38.7114 23.4656 38.539 24.2973 38.3128 25.115C36.9729 29.9765 33.7386 34.0972 29.3347 36.5538C27.4852 37.592 25.4764 38.3164 23.3899 38.6976C23.0018 38.7658 22.6708 38.8211 22.2839 38.866C22.0614 38.8919 21.3226 38.9473 21.1589 39H18.8596C18.7019 38.9545 18.4063 38.9358 18.2372 38.9175C17.928 38.8841 17.6158 38.8571 17.3077 38.8116C16.2076 38.6509 15.1231 38.397 14.066 38.0524C8.15607 36.115 3.56732 31.4095 1.77891 25.4528C1.50665 24.4814 1.29564 23.4939 1.14714 22.4961C1.12048 22.3176 1.05056 21.4495 1 21.369V18.665C1.05148 18.5791 1.08419 17.9984 1.10461 17.8334C1.1761 17.2558 1.26606 16.6571 1.38873 16.0896C2.19854 12.3376 4.12201 8.91729 6.90749 6.27634C7.32974 5.87523 8.20294 5.1014 8.69181 4.78566L8.71393 4.83299C8.68142 4.89956 8.66257 4.90762 8.68335 4.98271C8.95336 4.79442 9.23182 4.58411 9.49998 4.39003C9.59594 4.33458 9.73043 4.2399 9.82617 4.17676L10.1433 3.97593L10.4397 3.79569C10.4345 3.71583 10.4357 3.71996 10.396 3.65054C10.4324 3.63684 10.6603 3.50335 10.7081 3.47624C10.7387 3.55064 10.6944 3.52099 10.7535 3.58441L10.7862 3.5763C10.8007 3.51103 10.8026 3.5419 10.7834 3.48013L10.7248 3.46503C12.6622 2.38601 14.7672 1.6402 16.9518 1.25877C17.3684 1.18786 17.7875 1.13257 18.2082 1.09301C18.4612 1.06923 18.8403 1.05677 19.0779 1ZM3.14645 27.1747C3.31816 27.75 3.75827 28.612 4.04118 29.1404C5.76394 32.3444 8.38805 34.9733 11.589 36.7017C11.7633 36.7959 12.024 36.9483 12.2139 37.0063L12.2319 36.9891C11.418 36.5674 10.72 36.1745 9.95924 35.6573C7.61613 34.0531 5.67033 31.935 4.27021 29.4645C3.93375 28.8719 3.38201 27.8598 3.19833 27.2028L3.14645 27.1747ZM28.4049 36.8228C28.0938 36.978 27.7801 37.128 27.464 37.2727L27.239 37.3653C27.1043 37.4157 26.9452 37.4708 26.817 37.5314C26.7398 37.6164 26.5684 37.6505 26.4545 37.7301C26.5592 37.728 26.8403 37.5971 26.975 37.5609L26.9952 37.5396C27.0548 37.5229 27.4525 37.3587 27.474 37.3346C27.7771 37.2154 28.4238 36.937 28.6525 36.7395C28.6041 36.7401 28.4969 36.7973 28.4206 36.8186L28.4049 36.8228ZM25.6652 37.9445C25.611 38.0061 25.5392 38.0172 25.4621 38.0415C25.4734 38.0569 25.4815 38.0769 25.4982 38.0746C25.6515 38.0539 26.0637 37.9175 26.1772 37.847L26.1584 37.8282C25.9823 37.8396 25.8618 37.9664 25.6743 37.9436L25.6652 37.9445ZM31.7004 4.36901C31.8561 4.23356 31.8489 4.05183 31.6195 4.04246C31.4606 4.19528 31.5105 4.30285 31.7004 4.36901Z" fill="#080805"/>
<path d="M3.14645 27.1747L3.19833 27.2028C3.38201 27.8598 3.93375 28.8719 4.27021 29.4645C5.67033 31.935 7.61613 34.0531 9.95924 35.6573C10.72 36.1745 11.418 36.5674 12.2319 36.9891L12.2139 37.0063C12.024 36.9483 11.7633 36.7959 11.589 36.7017C8.38805 34.9733 5.76394 32.3444 4.04118 29.1404C3.75827 28.612 3.31816 27.75 3.14645 27.1747Z" fill="#000101" fill-opacity="0.772549"/>
<path d="M28.4049 36.8228L28.4206 36.8186C28.4969 36.7973 28.6041 36.7401 28.6525 36.7395C28.4238 36.937 27.7771 37.2154 27.474 37.3346L27.4071 37.3402C27.4265 37.3143 27.4426 37.2969 27.464 37.2727C27.7801 37.128 28.0938 36.978 28.4049 36.8228Z" fill="#000101" fill-opacity="0.219608"/>
<path d="M27.239 37.3653C27.1332 37.479 27.0731 37.4261 26.9952 37.5396L26.975 37.5609C26.8403 37.5971 26.5592 37.728 26.4545 37.7301C26.5684 37.6505 26.7398 37.6164 26.817 37.5314C26.9452 37.4708 27.1043 37.4157 27.239 37.3653Z" fill="#000101" fill-opacity="0.858824"/>
<path d="M25.6743 37.9436C25.8618 37.9664 25.9823 37.8396 26.1584 37.8282L26.1772 37.847C26.0637 37.9175 25.6515 38.0539 25.4982 38.0746C25.4815 38.0769 25.4734 38.0569 25.4621 38.0415C25.5392 38.0172 25.611 38.0061 25.6652 37.9445L25.6743 37.9436Z" fill="#000101" fill-opacity="0.890196"/>
<path d="M27.464 37.2727C27.4426 37.2969 27.4266 37.3143 27.4071 37.3402L27.474 37.3346C27.4525 37.3587 27.0548 37.5229 26.9952 37.5396C27.0731 37.4261 27.1332 37.479 27.239 37.3653L27.464 37.2727Z" fill="#000101" fill-opacity="0.678431"/>
<path d="M19.0779 1H21.0661C21.348 1.0775 21.9114 1.08789 22.2241 1.12485C23.6863 1.29761 25.0854 1.58805 26.4665 2.10765C26.7133 2.20052 27.2273 2.43708 27.4608 2.47779L27.4838 2.48007C27.9663 2.5242 28.9295 2.50223 29.4413 2.50263L33.0435 2.50196C33.1651 2.50192 34.1721 2.48147 34.2272 2.49805C34.2192 2.62634 33.9037 2.87608 33.8018 2.98022C33.6836 3.10108 33.5364 3.26585 33.4162 3.37895C33.1347 3.64391 32.4284 3.55732 32.0489 3.55529L30.2558 3.55402C30.1658 3.55361 29.6234 3.54387 29.5694 3.55491C29.2179 3.56864 28.8256 3.56343 28.4711 3.55523C27.6102 3.53532 26.7242 3.58479 25.8665 3.5601C24.8314 4.57984 23.8046 5.60789 22.786 6.64416C22.4042 7.03568 21.8541 7.5538 21.5184 7.94779C21.0835 8.03862 20.8442 8.25697 20.481 8.51294C20.5032 8.21283 20.4995 7.84591 20.4967 7.54131C21.1678 6.89632 21.8082 6.20889 22.4632 5.54755C22.6871 5.32146 23.0256 5.2407 23.0331 4.85912C23.0358 4.72295 22.9903 4.60878 22.8975 4.50926C22.7903 4.39363 22.6403 4.32707 22.4825 4.32513C22.0212 4.32239 21.8839 4.70847 22.015 5.1022C21.2776 5.83422 20.4083 6.70132 19.7096 7.4613C19.726 7.81117 19.6989 8.34347 19.7385 8.66279L19.165 9.00872L19.1623 7.09555C19.5236 6.71086 19.8756 6.29876 20.284 5.95949C20.4079 5.85658 20.3595 5.54791 20.2081 5.42428C20.1204 5.35225 20.0071 5.31896 19.8942 5.33204C19.6617 5.36055 19.5672 5.57139 19.5761 5.78411C19.2638 6.08401 18.7278 6.59407 18.4566 6.91385C18.4485 7.29291 18.4244 8.15237 18.461 8.50671C18.0995 8.87928 17.7087 9.57575 17.3307 9.99561C17.3281 9.68211 17.3161 9.31421 17.3309 9.00494C17.2275 9.18254 17.066 9.41915 16.9407 9.58666C16.8407 10.0664 16.4494 10.4887 16.0941 10.8047C15.9847 10.902 15.8688 11.0203 15.7462 11.0981C15.5484 11.5728 15.7237 12.0232 15.3201 12.473C15.2306 12.5728 15.1863 12.6672 15.0625 12.7686C14.9985 12.8873 14.9475 12.9636 14.8712 13.0753C14.8568 12.837 14.7834 12.618 14.7579 12.3761C14.6577 13.1111 14.3296 13.498 13.8545 14.0417C13.4924 14.4561 13.4827 14.6272 13.5264 15.1682C13.5931 15.4287 13.6603 15.6934 13.7235 15.9548C13.7494 16.0619 13.8413 16.3441 13.8557 16.4319C13.8537 16.4828 13.8591 16.5557 13.8365 16.593C13.6482 16.604 13.3735 16.6284 13.1986 16.6935C13.1217 16.7221 13.0746 16.7434 12.9947 16.7392L12.9695 16.7224L12.9715 16.6848L12.9597 16.6672C12.7735 16.9497 12.5957 17.1978 12.4001 17.4722C12.2358 17.6908 12.0749 17.912 11.9177 18.1358L11.9321 18.1541C12.3021 18.6301 12.5962 19.2372 12.99 19.6984C13.0556 19.7751 13.3939 19.9648 13.497 20.0058L13.5179 19.9941C13.5096 19.9541 13.5004 19.9143 13.4903 19.8746L13.5172 19.8748C13.5763 19.9383 13.6992 20.101 13.7405 20.1364C13.9419 20.309 14.2021 20.461 14.4174 20.6136C14.622 20.4425 15.1656 20.1257 15.4366 19.9219C15.7847 19.9211 16.5594 19.9059 16.8778 19.9388C17.2228 19.6403 17.5707 19.2825 17.9073 18.9995C18.171 18.9995 20.2738 18.9674 20.3681 18.8961L20.3704 18.8434C20.3053 18.7897 18.0722 18.7674 17.8212 18.7884C17.5639 18.9825 17.0215 19.414 16.7912 19.6284C16.5067 19.6216 16.076 19.5995 15.8085 19.6337C16.2575 19.3521 16.7091 19.0748 17.1634 18.8017C17.406 18.6538 17.7906 18.4236 18.0203 18.2573C18.7839 18.2557 19.6938 18.2328 20.4443 18.2589C20.752 18.0184 21.1006 17.7525 21.4168 17.5241C21.9435 17.5381 22.4972 17.5312 23.026 17.532C23.2602 17.8543 23.6616 18.091 24.0293 17.8142C24.1732 17.7069 24.2659 17.5443 24.2847 17.3657C24.3025 17.1931 24.2487 17.0207 24.136 16.8888C23.8604 16.5669 23.3717 16.5517 23.0985 16.8782C22.5056 16.8842 21.9127 16.8856 21.3198 16.8824C21.6477 16.5486 22.0118 16.1616 22.3487 15.844L23.9759 15.8446C24.2242 15.8442 24.4785 15.8369 24.7254 15.8567C24.7522 15.8589 24.8607 16.0625 24.8928 16.0994C25.1489 16.3937 25.4857 16.7679 25.682 17.1003C25.7208 17.0161 25.7654 16.9244 25.8008 16.8398C26.0129 17.2315 26.1492 17.5984 26.2657 18.0272C26.2842 18.0957 26.368 18.4352 26.3939 18.4732C26.4754 18.4431 26.5236 18.335 26.5698 18.2555C26.6085 18.5609 26.6155 18.7357 26.5836 19.0441C26.5684 19.1906 26.4283 19.6045 26.4771 19.691C26.5268 19.7065 26.5301 19.7027 26.5832 19.6996C26.6355 19.7965 26.4527 20.3689 26.3704 20.4885C26.2962 20.5963 26.115 20.7586 26.1802 20.9165C26.2229 20.9393 26.222 20.938 26.2699 20.9471C26.2627 21.0584 25.9266 21.5769 25.8308 21.6842C25.7849 21.7357 25.6866 21.7717 25.6241 21.8685C25.6217 21.9258 25.6299 21.9311 25.6549 21.9822C25.6254 22.0904 25.1727 22.5195 25.0656 22.6155C24.9675 22.6967 24.8633 22.769 24.7611 22.8447C24.723 22.8728 24.8028 22.9411 24.7816 22.969C24.6482 23.1443 24.3015 23.3641 24.1041 23.4455C23.9305 23.5977 23.1919 23.8214 23.1539 23.9098C23.2514 23.951 23.3313 24.0134 23.4173 24.0746C23.5048 24.1221 23.5566 24.165 23.6349 24.225C23.7001 24.2585 23.7011 24.2665 23.7417 24.3311C23.4947 24.4613 23.1107 24.597 22.8395 24.7214C22.8035 24.6842 22.7163 24.6125 22.6739 24.5753C22.5861 24.5255 22.5682 24.5149 22.4961 24.4451L22.169 24.2599C22.0108 24.253 21.1081 24.3759 21.016 24.4637C21.1318 24.508 21.3179 24.6366 21.4285 24.7076C21.4993 24.7394 21.6074 24.8244 21.6659 24.8772C21.7481 24.9476 21.7818 24.9698 21.8161 25.0742C21.6638 25.1109 20.7208 25.316 20.6314 25.3697L20.453 25.2377C20.3524 25.1748 20.2529 25.1183 20.1665 25.0372C19.9161 24.8771 19.6693 24.8382 19.53 24.7487C19.4212 24.6874 18.15 24.9319 18.0508 25.0616C17.6593 25.1206 16.1529 25.8179 15.8364 26.074L15.8261 26.1106C15.7377 26.1411 15.3153 26.5603 15.2195 26.6559L15.2111 26.7014C14.6523 27.2365 14.1523 27.9996 13.8055 28.684C13.7638 28.7663 13.6559 28.9152 13.6438 28.9877L13.6642 29.0173C13.5384 29.1498 13.3739 29.6665 13.3239 29.8595C13.3059 29.9112 13.2929 29.9564 13.2678 30.005C13.4793 30.1949 13.6136 30.3274 13.804 30.5441C13.766 30.7055 13.7658 30.8811 13.7556 31.0466C13.7073 31.8299 13.8243 32.5381 14.014 33.2968C14.081 33.5644 14.2382 33.9689 14.2791 34.226C14.9273 34.8069 15.7686 35.4827 16.5303 35.9019C20.3777 38.0196 25.4836 37.9277 29.4333 36.1814C29.111 36.4741 28.7135 36.6054 28.4049 36.8228C28.0938 36.978 27.7801 37.128 27.464 37.2727L27.239 37.3653C27.1043 37.4157 26.9452 37.4708 26.817 37.5314C26.5725 37.611 25.8898 37.8437 25.6743 37.9436L25.6652 37.9445C25.4735 37.9897 25.1991 38.0862 24.9974 38.1435C24.6088 38.2547 24.2156 38.3492 23.8188 38.4268C21.4584 38.8986 19.378 38.9646 17.0049 38.4776C15.9037 38.2516 15.2023 38.1043 14.1105 37.7147C14.0997 37.6455 14.0144 37.6954 13.9785 37.6203L14.0142 37.6107C14.1256 37.6556 14.1619 37.6553 14.2778 37.6652C15.6463 38.0251 16.5859 38.1412 17.989 38.2303C18.8589 38.2914 19.7317 38.3004 20.6027 38.2571C20.8904 38.2412 21.3336 38.2304 21.6048 38.1875C20.5422 38.0875 19.3462 37.8185 18.3166 37.5197C17.9004 37.399 17.4547 37.1919 17.053 37.0245C16.7923 36.878 16.503 36.7653 16.2378 36.613C15.2642 36.054 14.317 35.3842 13.5525 34.5572C13.4806 34.4793 13.1789 34.0403 13.1391 34.0187C12.1103 33.4579 11.1095 32.9076 10.2022 32.1531C7.92759 30.3981 6.55393 28.3113 5.76431 25.5613C5.68205 25.1546 5.58915 24.717 5.55125 24.3039C5.35897 22.2087 5.59731 20.1623 6.78186 18.3755C7.21592 17.7164 7.78235 17.1548 8.44518 16.7264C8.71957 16.5485 9.02208 16.3915 9.31985 16.2503C9.76108 16.0411 10.272 15.8671 10.589 15.4744C10.8179 15.1907 10.9049 14.8779 10.8308 14.5211C10.6649 13.7419 9.97409 13.349 9.20956 13.5396C8.7183 13.662 8.34658 13.8922 7.92276 14.1521C6.72618 14.8858 5.69753 15.8558 4.85218 16.9734C4.70602 17.1666 4.5732 17.3698 4.44627 17.5742C4.15219 18.0477 3.91072 18.5439 3.70745 19.0625C3.04308 20.6127 2.83141 22.0338 2.81204 23.7092C2.7953 24.8506 2.91664 25.9898 3.17342 27.1021C3.18146 27.1358 3.18976 27.1693 3.19833 27.2028L3.14645 27.1747C1.98331 24.3015 1.65552 21.0816 1.78271 18.0024C1.79132 17.7939 1.8089 17.582 1.82789 17.3742C2.20694 13.2724 4.01421 9.43385 6.93435 6.52835C7.54223 5.91587 8.02644 5.52959 8.68335 4.98271C8.95336 4.79442 9.23182 4.58411 9.49998 4.39003C9.59594 4.33458 9.73043 4.2399 9.82617 4.17676L10.1433 3.97593L10.4397 3.79569C10.4345 3.71583 10.4357 3.71996 10.396 3.65054C10.4324 3.63684 10.6603 3.50335 10.7081 3.47624C10.7387 3.55064 10.6944 3.52099 10.7535 3.58441L10.7862 3.5763C10.8007 3.51103 10.8026 3.5419 10.7834 3.48013L10.7248 3.46503C12.6622 2.38601 14.7672 1.6402 16.9518 1.25877C17.3684 1.18786 17.7875 1.13257 18.2082 1.09301C18.4612 1.06923 18.8403 1.05677 19.0779 1Z" fill="#F7F8F9"/>
<path d="M8.72202 29.595C8.63993 29.5454 8.24032 29.0132 8.15931 28.9013C6.92197 27.1842 6.25248 25.1232 6.24456 23.0068C6.24432 22.6796 6.24481 22.2468 6.29641 21.9259C6.34576 21.9857 6.29146 22.1227 6.28855 22.2076C6.25493 23.1909 6.26316 24.1653 6.4967 25.1276C6.51594 25.207 6.51738 25.3178 6.60104 25.3596C7.04626 25.3268 7.49459 25.3918 7.93992 25.4348C8.19537 25.4595 8.47843 25.5303 8.73909 25.5367C9.77088 25.5623 10.7737 25.4482 11.8035 25.6034C12.2811 25.6755 12.7135 25.7985 13.1768 25.8895C13.4477 25.9427 13.8312 25.9917 14.1099 26.0335C14.4184 26.0799 14.7868 26.0881 15.1018 26.135C15.1993 26.1495 15.5228 26.2688 15.5407 26.2612C15.6792 26.2025 15.8862 25.9446 16.0572 25.8913C16.2215 25.8402 16.4406 25.667 16.5918 25.6037C16.9269 25.4634 17.2492 25.308 17.5881 25.1809C17.7076 25.1362 17.8416 25.0997 17.9638 25.0608C18.1292 25.008 17.9556 24.9971 18.1259 24.9496C18.5875 24.8207 18.9834 24.7577 19.454 24.6954C19.744 24.657 20.1225 24.5526 20.4253 24.5081C20.4914 24.4984 20.8646 24.4475 20.8767 24.4436C21.2384 24.3268 21.6105 24.2766 21.9871 24.2391C22.0177 24.236 22.2793 24.1479 22.3272 24.1309C22.5063 24.0673 22.7154 24.0243 22.8897 23.9579C23.0663 23.8905 23.2503 23.7927 23.4396 23.7187C23.6303 23.6441 23.8703 23.5206 24.0617 23.4324C24.0758 23.4368 24.09 23.4412 24.1041 23.4455C23.9305 23.5977 23.1919 23.8214 23.1539 23.9098C23.2514 23.951 23.3313 24.0134 23.4173 24.0746C23.5048 24.1221 23.5566 24.165 23.6349 24.225C23.7001 24.2585 23.7011 24.2665 23.7417 24.3311C23.4947 24.4613 23.1107 24.597 22.8395 24.7214C22.8035 24.6842 22.7163 24.6125 22.6739 24.5753C22.5861 24.5255 22.5682 24.5149 22.4961 24.4451L22.169 24.2599C22.0108 24.253 21.1081 24.3759 21.016 24.4637C21.1318 24.508 21.3179 24.6366 21.4285 24.7076C21.4993 24.7394 21.6074 24.8244 21.6659 24.8772C21.7481 24.9476 21.7818 24.9698 21.8161 25.0742C21.6638 25.1109 20.7208 25.316 20.6314 25.3697L20.453 25.2377C20.3524 25.1748 20.2529 25.1183 20.1665 25.0372C19.9161 24.8771 19.6693 24.8382 19.53 24.7487C19.4212 24.6874 18.15 24.9319 18.0508 25.0616C17.6593 25.1206 16.1529 25.8179 15.8364 26.074L15.8261 26.1106C15.7377 26.1411 15.3153 26.5603 15.2195 26.6559L15.2111 26.7014C14.6523 27.2365 14.1523 27.9996 13.8055 28.684C13.7638 28.7663 13.6559 28.9152 13.6438 28.9877L13.6642 29.0173C13.5384 29.1498 13.3739 29.6665 13.3239 29.8595C13.2908 29.8634 13.2777 29.8652 13.2436 29.8599C12.7778 29.7878 11.9994 29.8768 11.5685 29.7106L11.6338 29.5991L11.6154 29.6106C11.3472 29.7815 11.1206 29.7441 10.9253 29.4977C10.9233 29.5156 10.9199 29.6057 10.9026 29.6088C10.3546 29.7076 9.75848 29.5232 9.19753 29.5905C8.96709 29.6182 8.9495 29.7302 8.72202 29.595Z" fill="url(#paint0_linear_1_2)"/>
<path d="M21.4285 24.7076C21.4993 24.7394 21.6074 24.8244 21.6659 24.8772C21.7481 24.9476 21.7818 24.9698 21.8161 25.0742C21.6638 25.1109 20.7208 25.316 20.6314 25.3697L20.453 25.2377C20.3524 25.1748 20.2529 25.1183 20.1665 25.0372C20.3898 24.9016 21.3388 24.7959 21.4285 24.7076Z" fill="#828FA9"/>
<path d="M21.6659 24.8772C21.7481 24.9476 21.7818 24.9698 21.8161 25.0742C21.6638 25.1109 20.7208 25.316 20.6314 25.3697L20.453 25.2377C20.6906 25.0631 21.5612 24.9816 21.6659 24.8772Z" fill="#58617D"/>
<path d="M19.53 24.7487C19.6503 24.6548 20.86 24.4386 21.016 24.4637C21.1318 24.508 21.3179 24.6366 21.4285 24.7076C21.3388 24.7959 20.3898 24.9016 20.1665 25.0372C19.9161 24.8771 19.6693 24.8382 19.53 24.7487Z" fill="#F7F8F9"/>
<path d="M10.9253 29.4977C10.8235 28.7917 11.6802 28.7856 11.7221 29.3558C11.7297 29.4584 11.6548 29.5223 11.6338 29.5991L11.6154 29.6106C11.3472 29.7815 11.1206 29.7441 10.9253 29.4977Z" fill="#000101"/>
<path d="M23.4173 24.0746C23.5048 24.1221 23.5566 24.165 23.6349 24.225C23.7001 24.2585 23.7011 24.2665 23.7417 24.3311C23.4947 24.4613 23.1107 24.597 22.8395 24.7214C22.8035 24.6842 22.7163 24.6125 22.6739 24.5753C22.5861 24.5255 22.5682 24.5149 22.4961 24.4451C22.6882 24.3507 23.2926 24.2057 23.4173 24.0746Z" fill="url(#paint1_linear_1_2)"/>
<path d="M23.6349 24.225C23.7001 24.2585 23.7011 24.2665 23.7417 24.3311C23.4947 24.4613 23.1107 24.597 22.8395 24.7214C22.8035 24.6842 22.7163 24.6125 22.6739 24.5753C22.83 24.5073 23.565 24.3137 23.6349 24.225Z" fill="#58617D"/>
<path d="M22.169 24.2599C22.2132 24.181 23.0749 23.9015 23.1539 23.9098C23.2514 23.951 23.3313 24.0134 23.4173 24.0746C23.2926 24.2057 22.6882 24.3507 22.4961 24.4451L22.169 24.2599Z" fill="#F7F8F9"/>
<path d="M10.9253 29.4977C11.1206 29.7441 11.3472 29.7815 11.6154 29.6106L11.6338 29.5991L11.5685 29.7106C11.9994 29.8768 12.7778 29.7878 13.2436 29.8599C13.2777 29.8652 13.2908 29.8634 13.3239 29.8595C13.3059 29.9112 13.2929 29.9564 13.2678 30.005C13.2589 30.0143 13.2454 30.0268 13.2421 30.0393C12.9863 30.9974 12.9895 32.1892 13.2571 33.1292C11.9548 32.5947 10.231 31.26 9.2768 30.227C9.11938 30.0566 8.85472 29.7798 8.72202 29.595C8.9495 29.7302 8.96709 29.6182 9.19753 29.5905C9.75848 29.5232 10.3546 29.7076 10.9026 29.6088C10.9199 29.6057 10.9233 29.5156 10.9253 29.4977Z" fill="url(#paint2_linear_1_2)"/>
<path d="M19.0779 1H21.0661C21.348 1.0775 21.9114 1.08789 22.2241 1.12485C23.6863 1.29761 25.0854 1.58805 26.4665 2.10765C26.7133 2.20052 27.2273 2.43708 27.4608 2.47779C27.0961 2.4838 26.6235 2.50648 26.2661 2.46021C26.0041 2.40724 25.7404 2.30521 25.4884 2.21702C25.3057 2.1531 25.086 2.10774 24.9127 2.03561C24.3637 1.80711 23.8404 1.6372 23.2586 1.50252C22.6633 1.36469 22.0582 1.26214 21.4473 1.21693C21.1174 1.1938 20.6991 1.20377 20.3623 1.19888C17.6806 1.13339 15.0164 1.64917 12.553 2.71079C11.9048 2.98399 11.2849 3.30538 10.6795 3.66092C10.6046 3.70486 10.5171 3.75848 10.4397 3.79569C10.4345 3.71583 10.4357 3.71996 10.396 3.65054C10.4324 3.63684 10.6603 3.50335 10.7081 3.47624C10.7387 3.55064 10.6944 3.52099 10.7535 3.58441L10.7862 3.5763C10.8007 3.51103 10.8026 3.5419 10.7834 3.48013L10.7248 3.46503C12.6622 2.38601 14.7672 1.6402 16.9518 1.25877C17.3684 1.18786 17.7875 1.13257 18.2082 1.09301C18.4612 1.06923 18.8403 1.05677 19.0779 1Z" fill="#000101"/>
<path d="M16.9407 9.58666C16.8407 10.0664 16.4494 10.4887 16.0941 10.8047C15.9847 10.902 15.8688 11.0203 15.7462 11.0981C15.5484 11.5728 15.7237 12.0232 15.3201 12.473C15.2306 12.5728 15.1863 12.6672 15.0625 12.7686C15.0649 12.5105 15.1461 12.2238 15.1963 11.9698C15.2459 11.7195 15.2671 11.3929 15.3726 11.1624C15.4255 11.0468 16.716 9.81548 16.9407 9.58666Z" fill="#64768C"/>
<path d="M13.5264 15.1682C13.5931 15.4287 13.6603 15.6934 13.7235 15.9548C13.7494 16.0619 13.8413 16.3441 13.8557 16.4319C13.8537 16.4828 13.8591 16.5557 13.8365 16.593C13.6482 16.604 13.3735 16.6284 13.1986 16.6935C13.1217 16.7221 13.0746 16.7434 12.9947 16.7392L12.9695 16.7224L12.9715 16.6848L12.9597 16.6672C13.2033 16.1643 13.5243 15.7585 13.5264 15.1682Z" fill="url(#paint3_linear_1_2)"/>
<path d="M8.82763 7.77933C9.08502 7.79582 9.56855 7.77359 9.84034 7.76588C9.91894 8.07204 10.2255 8.77367 10.3496 9.10157C10.7061 10.0427 11.1002 10.9791 11.4464 11.9254C11.0784 11.9216 10.7103 11.9204 10.3422 11.9221C10.286 11.7288 10.1865 11.4704 10.1169 11.2777L9.72998 11.2749C9.29899 11.2707 8.868 11.2715 8.43709 11.2773C8.38852 11.4614 8.28451 11.7403 8.2217 11.9312C7.84416 11.9178 7.51422 11.9209 7.13791 11.9283L8.22088 9.23613C8.37293 8.85999 8.65062 8.11915 8.82763 7.77933Z" fill="#000101"/>
<path d="M9.30411 9.19509C9.38642 9.26255 9.72931 10.2278 9.77859 10.3644C9.6447 10.3585 9.48981 10.3617 9.35421 10.361C9.18633 10.3623 9.01214 10.3582 8.84366 10.3565C8.98 9.9801 9.1579 9.57583 9.30411 9.19509Z" fill="#F7F8F9"/>
<path d="M12.086 7.77142L13.0826 7.77351C13.0922 8.8021 13.0711 9.83314 13.0798 10.862C13.0829 11.2155 13.083 11.571 13.0748 11.9244L12.0906 11.9275C12.0642 10.5699 12.0754 9.13304 12.086 7.77142Z" fill="#000101"/>
<path d="M22.6492 19.6998C23.1538 19.6066 23.6383 19.9404 23.731 20.4451C23.8238 20.9498 23.4898 21.4341 22.985 21.5265C22.4808 21.6188 21.9971 21.2851 21.9044 20.7809C21.8117 20.2768 22.1451 19.7929 22.6492 19.6998Z" fill="#000101"/>
<path d="M9.17705 19.535C9.49129 19.4699 9.79893 19.6717 9.86417 19.986C9.92941 20.3002 9.72761 20.6079 9.41336 20.6732C9.09905 20.7386 8.79126 20.5367 8.72595 20.2224C8.66071 19.908 8.86266 19.6002 9.17705 19.535Z" fill="#000101"/>
<path d="M14.4778 5.73186C14.6639 5.68118 14.8628 5.73463 14.9984 5.87174C15.1341 6.00885 15.1853 6.20837 15.1326 6.39386C15.0798 6.57936 14.9313 6.72207 14.7438 6.76735C14.4598 6.83596 14.1732 6.66375 14.1005 6.3807C14.0278 6.09765 14.1959 5.80866 14.4778 5.73186Z" fill="#000101"/>
<path d="M18.3949 22.1263C18.5985 22.056 18.8206 22.1634 18.8918 22.3666C18.9632 22.5698 18.8568 22.7924 18.654 22.8647C18.4497 22.9374 18.2252 22.8303 18.1534 22.6256C18.0817 22.421 18.19 22.1971 18.3949 22.1263Z" fill="#000101"/>
<path d="M10.8836 22.5069C10.9868 22.4782 11.0975 22.5074 11.1729 22.5834C11.2485 22.6593 11.2771 22.7702 11.2477 22.8732C11.2183 22.9762 11.1356 23.0553 11.0314 23.0801C10.8744 23.1173 10.7166 23.0221 10.6763 22.866C10.636 22.7098 10.7282 22.5501 10.8836 22.5069Z" fill="#000101"/>
<path d="M12.6788 24.1256C12.7787 24.0972 12.8861 24.1248 12.9601 24.1977C13.034 24.2706 13.0629 24.3777 13.0359 24.478C13.0089 24.5783 12.93 24.6563 12.8294 24.6822C12.6766 24.7216 12.5205 24.6307 12.4792 24.4783C12.4379 24.3259 12.5269 24.1687 12.6788 24.1256Z" fill="#000101"/>
<path d="M5.76431 25.5613C6.55393 28.3113 7.92759 30.3981 10.2022 32.1531C11.1095 32.9076 12.1103 33.4579 13.1391 34.0187C13.1789 34.0403 13.4806 34.4793 13.5525 34.5572C14.317 35.3842 15.2642 36.054 16.2378 36.613C16.503 36.7653 16.7923 36.878 17.053 37.0245C17.0437 37.025 17.0097 37.0275 17.0032 37.0247C15.7142 36.474 14.5167 35.5988 13.5321 34.6029C13.4212 34.4908 13.2016 34.1064 13.1535 34.0742C12.8608 33.8781 12.5064 33.713 12.1969 33.542C11.949 33.407 11.7062 33.2629 11.469 33.1099C11.3729 33.0483 10.6621 32.5451 10.6261 32.5451L10.6382 32.5976C10.6036 32.6511 10.5524 32.6613 10.4864 32.6925C10.4403 32.6868 10.3766 32.6792 10.3347 32.7002C10.0908 32.8224 9.83604 32.9428 9.58392 33.0468C9.51586 33.0749 9.46532 33.0716 9.4029 33.092C9.32014 33.119 9.21357 33.2336 9.12406 33.2243C9.0508 33.2167 8.96582 33.2481 8.8997 33.2786C8.91335 33.4873 9.50228 33.7795 9.49916 33.8923C9.29476 33.7847 8.3684 32.8683 8.16158 32.6622C6.66681 31.1724 5.60248 29.3697 4.9519 27.3675C4.85687 27.0751 4.63034 26.2834 4.63198 26.0066L4.67856 26.244C4.82614 26.3006 5.14467 26.2084 5.31746 26.3112C5.4648 26.3988 5.74794 26.441 5.87342 26.5483C5.91834 26.5415 5.94215 26.5332 5.98548 26.5448L6.00749 26.5901C6.08292 26.5223 5.69161 25.7225 5.76431 25.5613Z" fill="url(#paint4_linear_1_2)"/>
<path d="M26.8499 4.90736C27.0574 4.92268 27.2976 4.92073 27.5061 4.91815C28.8544 4.90148 30.2223 4.96781 31.5687 4.91299C31.7822 4.95058 32.2108 4.93636 32.4464 4.93549L33.8962 4.93157L35.8258 4.93244C36.1107 4.93233 36.6247 4.94649 36.8865 4.91246C36.8868 5.08435 36.9044 5.60606 36.8507 5.73224C36.7489 5.77382 36.0347 5.75165 35.8755 5.75102L33.6657 5.75272C33.4162 5.75363 32.8113 5.74042 32.5834 5.76694C32.3625 5.73591 32.0116 5.74446 31.7835 5.74494L30.5606 5.74748C29.3404 5.74752 28.0651 5.72606 26.8476 5.75151C26.4529 6.09925 25.963 6.64999 25.5922 6.95399C25.6039 6.32698 25.4647 6.61553 25.2524 6.44949C25.7916 5.89953 26.2774 5.42241 26.8499 4.90736Z" fill="#F7F8F9"/>
<path d="M29.6177 6.30703L30.4536 6.3049C30.609 6.44483 30.7616 6.58778 30.9114 6.73368L32.6274 6.73411C32.8854 6.73424 33.3246 6.74629 33.5656 6.71895C33.7098 6.76789 34.0139 6.75121 34.1767 6.74768C34.0766 6.86287 33.987 6.95174 33.8779 7.059C33.7379 7.1662 33.6058 7.29785 33.4774 7.41981C32.5726 7.40537 31.6532 7.42426 30.7448 7.41631C30.3951 7.13431 29.9388 6.63875 29.6177 6.30703Z" fill="#F7F8F9"/>
<path d="M18.0508 25.0616C18.2614 25.0709 18.6525 25.2419 18.8129 25.3583L18.9686 25.475C19.0884 25.5282 19.2606 25.5877 19.3472 25.6728C19.0415 25.7685 17.4222 26.3893 17.2735 26.5361C17.148 26.4472 17.0047 26.3994 16.8691 26.3162C16.7832 26.2744 16.7617 26.2885 16.6553 26.2198C16.6253 26.232 16.397 26.3455 16.3944 26.3443C16.2023 26.2563 16.0283 26.1751 15.8261 26.1106L15.8364 26.074C16.1529 25.8179 17.6593 25.1206 18.0508 25.0616Z" fill="#F7F8F9"/>
<path d="M18.9686 25.475C19.0884 25.5282 19.2606 25.5877 19.3472 25.6728C19.0415 25.7685 17.4222 26.3893 17.2735 26.5361C17.148 26.4472 17.0047 26.3994 16.8691 26.3162C17.1624 26.1791 17.4763 26.0589 17.7686 25.9107C17.892 25.8481 18.0328 25.8174 18.142 25.7304C18.3856 25.684 18.8225 25.6768 18.9686 25.475Z" fill="url(#paint5_linear_1_2)"/>
<path d="M17.5649 25.8165C17.7554 25.7829 17.9513 25.7166 18.142 25.7304C18.0328 25.8174 17.892 25.8481 17.7686 25.9107C17.4763 26.0589 17.1624 26.1791 16.8691 26.3162C16.7832 26.2744 16.7617 26.2885 16.6553 26.2198C16.8638 26.0989 17.3268 25.9148 17.5649 25.8165Z" fill="#64768C"/>
<path d="M18.8129 25.3583L18.9686 25.475C18.8225 25.6768 18.3856 25.684 18.142 25.7304C17.9513 25.7166 17.7554 25.7829 17.5649 25.8165C17.8109 25.6636 18.7297 25.4261 18.8129 25.3583Z" fill="#828FA9"/>
<path d="M19.3472 25.6728C19.4476 25.6457 19.5476 25.6172 19.6471 25.5875C19.7663 25.6519 19.8724 25.7092 19.9869 25.7816C20.0325 25.8104 20.0871 25.8422 20.1288 25.8752C20.3152 25.9945 20.5169 26.0964 20.7176 26.1901C20.2232 26.4017 19.6683 26.5171 19.16 26.693C18.9419 26.7685 18.483 26.7968 18.3489 26.9832L18.3493 27.0233L18.3819 27.0435L18.365 27.0512C18.1956 27.0268 17.7463 26.7844 17.5825 26.693C17.5354 26.6694 17.4888 26.6429 17.4427 26.6174C17.3962 26.5898 17.3243 26.5595 17.2735 26.5361C17.4222 26.3893 19.0415 25.7685 19.3472 25.6728Z" fill="url(#paint6_linear_1_2)"/>
<path d="M19.3472 25.6728C19.4476 25.6457 19.5476 25.6172 19.6471 25.5875C19.7663 25.6519 19.8724 25.7092 19.9869 25.7816C19.9037 25.861 19.2899 26.0214 19.1366 26.0586C18.5481 26.201 18.0106 26.4241 17.4427 26.6174C17.3962 26.5898 17.3243 26.5595 17.2735 26.5361C17.4222 26.3893 19.0415 25.7685 19.3472 25.6728Z" fill="#F7F8F9"/>
<path d="M19.9869 25.7816C20.0325 25.8104 20.0871 25.8422 20.1288 25.8752C20.0502 25.9602 19.715 26.0864 19.601 26.108C19.0236 26.2172 18.4691 26.3795 17.9112 26.5624C17.8252 26.5906 17.6505 26.6814 17.5825 26.693C17.5354 26.6694 17.4888 26.6429 17.4427 26.6174C18.0106 26.4241 18.5481 26.201 19.1366 26.0586C19.2899 26.0214 19.9037 25.861 19.9869 25.7816Z" fill="#828FA9"/>
<path d="M15.2111 26.7014C15.3937 26.7937 15.6151 26.8994 15.7908 27.0002C15.6583 27.1101 15.4682 27.2415 15.3548 27.3535C14.9462 27.7573 14.6411 28.2575 14.3364 28.7381C14.2169 28.9267 14.0403 29.2461 13.9188 29.4112C13.8351 29.2761 13.7563 29.1475 13.6642 29.0173L13.6438 28.9877C13.6559 28.9152 13.7638 28.7663 13.8055 28.684C14.1523 27.9996 14.6523 27.2365 15.2111 26.7014Z" fill="#F7F8F9"/>
<path d="M23.4807 8.14504C23.5671 8.30825 23.5537 8.61484 23.6792 8.74695L23.7149 8.75074C23.5517 8.96382 22.6294 9.8301 22.411 9.97884C22.1591 10.0024 21.8403 9.99776 21.5803 10.0038C21.8256 9.81043 22.0547 9.51809 22.2794 9.30975C22.6947 8.92471 23.0811 8.54597 23.4807 8.14504Z" fill="url(#paint7_linear_1_2)"/>
<path d="M25.2524 6.44949C25.4647 6.61553 25.6039 6.32698 25.5922 6.95399C25.4263 7.04868 24.4705 8.00485 24.2565 8.2028C24.1386 8.09994 24.0762 7.78549 24.088 7.62825C24.0895 7.60969 24.1769 7.55603 24.21 7.46177C24.2405 7.42279 24.525 7.15382 24.5781 7.10521C24.7927 6.90871 25.0362 6.62773 25.2524 6.44949Z" fill="url(#paint8_linear_1_2)"/>
<path d="M23.7417 24.3311C23.8034 24.3037 23.8598 24.2806 23.9182 24.2462L24.1586 24.4436C24.2926 24.527 24.4734 24.7212 24.5863 24.8384C24.5122 24.8836 24.1784 25.0888 24.1206 25.1094C23.9381 25.2271 23.7514 25.3114 23.5618 25.4428C23.4235 25.298 23.2839 25.1557 23.155 25.0023C23.1195 24.9679 23.1065 24.9502 23.0763 24.9119C22.9967 24.8492 22.9178 24.7857 22.8395 24.7214C23.1107 24.597 23.4947 24.4613 23.7417 24.3311Z" fill="url(#paint9_linear_1_2)"/>
<path d="M23.7417 24.3311C23.8034 24.3037 23.8598 24.2806 23.9182 24.2462L24.1586 24.4436C23.9413 24.5483 23.6953 24.6553 23.4716 24.7432C23.4063 24.7688 23.1181 24.9027 23.0763 24.9119C22.9967 24.8492 22.9178 24.7857 22.8395 24.7214C23.1107 24.597 23.4947 24.4613 23.7417 24.3311Z" fill="#F7F8F9"/>
<path d="M23.155 25.0023C23.3059 24.9598 23.3444 24.9767 23.4705 24.9543C23.538 24.9422 23.7606 24.8632 23.8344 24.8394C23.7643 24.8754 23.7251 24.8944 23.6519 24.9222C23.8332 25.0197 23.8274 25.0027 23.9171 25.1846C24.0097 25.1713 23.9994 25.11 24.1206 25.1094C23.9381 25.2271 23.7514 25.3114 23.5618 25.4428C23.4235 25.298 23.2839 25.1557 23.155 25.0023Z" fill="#404C5E"/>
<path d="M13.8557 16.4319L13.9218 16.6338C13.5695 17.0772 13.1124 17.6709 12.7398 18.0812C12.6524 17.9235 12.4935 17.6133 12.4001 17.4722C12.5957 17.1978 12.7735 16.9497 12.9597 16.6672L12.9715 16.6848L12.9695 16.7224L12.9947 16.7392C13.0746 16.7434 13.1217 16.7221 13.1986 16.6935C13.3735 16.6284 13.6482 16.604 13.8365 16.593C13.8591 16.5557 13.8537 16.4828 13.8557 16.4319Z" fill="url(#paint10_linear_1_2)"/>
<path d="M31.3646 4.13089C31.4424 4.02732 31.5128 3.92331 31.6526 3.90367C31.9129 3.86707 32.0503 4.22768 31.8979 4.4115C31.7868 4.54548 31.6546 4.51487 31.5122 4.47247C31.4691 4.41883 31.3892 4.31324 31.3417 4.27072C31.1975 4.2694 30.8205 4.2569 30.6939 4.27946C30.5385 4.30863 29.9842 4.28155 29.8076 4.28085C28.977 4.28103 28.1463 4.27519 27.3157 4.26333C27.1887 4.2392 27.0512 4.25997 26.9434 4.22663L26.9552 4.20483L27.0609 4.17355C28.1133 4.08614 29.3717 4.17082 30.4591 4.11665C30.674 4.15898 31.1138 4.12013 31.3646 4.13089ZM31.7004 4.36901C31.8561 4.23356 31.8489 4.05183 31.6195 4.04246C31.4606 4.19528 31.5105 4.30285 31.7004 4.36901Z" fill="url(#paint11_linear_1_2)"/>
<path d="M34.4469 7.76606C34.5824 7.63836 34.7084 7.51363 34.9097 7.52904C35.3951 7.5662 35.5989 8.17196 35.1881 8.46514C35.1516 8.49075 35.1132 8.51353 35.0734 8.53343C34.8277 8.56334 34.5659 8.53654 34.4329 8.28545C34.3382 8.10642 34.3893 7.94631 34.4469 7.76606Z" fill="#F7F8F9"/>
<path d="M21.8161 25.0742L22.1233 25.003C22.2423 25.0812 22.2875 25.1251 22.3917 25.2238L22.281 25.2898L22.3939 25.3728C22.2865 25.4911 21.3369 25.6681 21.1504 25.7415C21.0542 25.6704 20.9887 25.6191 20.8989 25.5399C20.7981 25.4835 20.7265 25.4347 20.6314 25.3697C20.7208 25.316 21.6638 25.1109 21.8161 25.0742Z" fill="#F7F8F9"/>
<path d="M20.8989 25.5399C21.0279 25.4759 22.122 25.2462 22.281 25.2898L22.3939 25.3728C22.2865 25.4911 21.3369 25.6681 21.1504 25.7415C21.0542 25.6704 20.9887 25.6191 20.8989 25.5399Z" fill="url(#paint12_linear_1_2)"/>
<path d="M15.7908 27.0002L15.9417 27.0563C15.5181 27.3413 15.0967 27.9302 14.8144 28.3645C14.6095 28.6463 14.3705 29.056 14.206 29.3726C14.1602 29.4515 14.0915 29.5626 14.0528 29.6414C14.0018 29.56 13.9642 29.497 13.9188 29.4112C14.0403 29.2461 14.2169 28.9267 14.3364 28.7381C14.6411 28.2575 14.9462 27.7573 15.3548 27.3535C15.4682 27.2415 15.6583 27.1101 15.7908 27.0002Z" fill="url(#paint13_linear_1_2)"/>
<path d="M22.3939 25.3728C22.5166 25.4755 22.6677 25.6367 22.8146 25.6428C22.3825 25.8308 21.9797 25.9307 21.5571 26.0904C21.4427 25.9853 21.2429 25.8336 21.1504 25.7415C21.3369 25.6681 22.2865 25.4911 22.3939 25.3728Z" fill="#404C5E"/>
<path d="M24.21 7.46177C24.1769 7.55603 24.0895 7.60969 24.088 7.62825C24.0762 7.78549 24.1386 8.09994 24.2565 8.2028C24.0773 8.38669 23.8967 8.56935 23.7149 8.75074L23.6792 8.74695C23.5537 8.61484 23.5671 8.30825 23.4807 8.14504C23.7077 7.92474 23.9698 7.66294 24.21 7.46177Z" fill="url(#paint14_linear_1_2)"/>
<path d="M15.9417 27.0563C16.0131 27.0966 15.9931 27.0696 16.0261 27.128C16.0182 27.2521 15.5136 27.9047 15.402 28.0017C15.1846 28.1906 15.0443 28.1433 14.856 28.4615L14.8144 28.3645C15.0967 27.9302 15.5181 27.3413 15.9417 27.0563Z" fill="#1C1D1D"/>
<path d="M20.7176 26.1901C20.7734 26.2123 20.8323 26.2252 20.8611 26.273C20.7555 26.3699 18.6546 26.9765 18.3819 27.0435L18.3493 27.0233L18.3489 26.9832C18.483 26.7968 18.9419 26.7685 19.16 26.693C19.6683 26.5171 20.2232 26.4017 20.7176 26.1901Z" fill="url(#paint15_linear_1_2)"/>
<path d="M14.206 29.3726C14.3705 29.056 14.6095 28.6463 14.8144 28.3645L14.856 28.4615C14.8366 28.5287 14.8081 28.6244 14.7987 28.6934C14.6983 28.7736 14.5646 28.971 14.5115 29.0881C14.4762 29.1403 14.4313 29.2112 14.3922 29.2586C14.4475 29.1006 14.5581 28.9388 14.6528 28.7997L14.6453 28.7847C14.4556 28.8331 14.3877 29.2805 14.206 29.3726Z" fill="#232933"/>
<path d="M22.3917 25.2238C22.4712 25.2918 22.8054 25.5594 22.8146 25.6428C22.6677 25.6367 22.5166 25.4755 22.3939 25.3728L22.281 25.2898L22.3917 25.2238Z" fill="#F7F8F9"/>
<path d="M13.4359 37.3935C13.7022 37.4854 14.0322 37.5725 14.2778 37.6652C14.1619 37.6553 14.1256 37.6556 14.0142 37.6107L13.9785 37.6204C14.0144 37.6954 14.0997 37.6455 14.1105 37.7147C13.9889 37.6962 13.5573 37.509 13.4148 37.4557L13.4359 37.3935Z" fill="#C1C0C1"/>
<path d="M14.7987 28.6934C14.8717 28.982 14.6709 28.9261 14.5115 29.0881C14.5646 28.971 14.6983 28.7736 14.7987 28.6934Z" fill="#000101"/>
<path d="M26.6507 4.19304C26.7921 4.18328 26.9194 4.17589 27.0609 4.17355L26.9552 4.20483L26.9434 4.22663C27.0512 4.25997 27.1887 4.2392 27.3157 4.26333C27.0275 4.27458 26.7138 4.25592 26.4239 4.24322C26.4707 4.21596 26.5912 4.20305 26.6507 4.19304Z" fill="#ADBBD7"/>
<path d="M13.4148 37.4557C13.3233 37.4249 13.0145 37.2904 12.946 37.2354C13.0443 37.2126 13.3498 37.3427 13.4359 37.3935L13.4148 37.4557Z" fill="#312F2E"/>
<path d="M26.4239 4.24322C26.3704 4.24944 26.2362 4.24838 26.1844 4.23184C26.3583 4.19014 26.4737 4.19271 26.6507 4.19304C26.5912 4.20305 26.4707 4.21596 26.4239 4.24322Z" fill="#404C5E"/>
<path d="M32.6996 11.9052C33.0709 11.928 33.5244 11.9251 33.901 11.9313C34.267 12.285 34.6261 12.6457 34.9782 13.0134C35.2926 13.3378 36.1248 14.258 36.4814 14.4162C36.5292 14.8547 36.6585 15.3984 36.7212 15.8674C36.8438 16.8221 36.8964 17.7846 36.8787 18.7471C36.8476 21.2953 36.2876 23.8092 35.2343 26.1297C34.6086 27.469 33.8028 28.7165 32.8391 29.8375C32.7915 29.8922 32.5444 30.1842 32.5027 30.2069C32.2968 30.4695 32.0534 30.6927 31.8193 30.9284C31.1011 31.6512 30.2561 32.2433 29.3928 32.7795C29.1803 32.9115 28.9402 33.0737 28.7183 33.1848L28.7616 33.2179C28.8431 33.1718 29.1211 33.083 29.2249 33.0471C29.5246 32.9436 29.8225 32.8488 30.1184 32.731C31.0435 32.3628 31.8581 31.7853 32.6274 31.1625C32.8141 31.0113 33.1296 30.7343 33.2534 30.548L33.2943 30.5664C33.195 30.6589 33.1204 30.7738 33.0276 30.8738C31.882 32.1084 30.1009 33.5236 28.475 34.0366C28.0041 34.1834 27.5132 34.2553 27.0201 34.2496C26.0011 34.234 25.517 33.9708 24.7945 33.3261C24.5816 33.3547 23.9206 33.4448 23.7378 33.4C23.4918 33.3814 23.2279 33.402 22.9793 33.379C21.4785 33.2403 19.8954 32.7201 19.0989 31.3561C19.1986 31.2941 19.355 31.1432 19.4494 31.059C19.6827 30.8512 19.8923 30.7032 20.1775 30.5719C20.3704 30.4849 20.5699 30.4134 20.7742 30.3582C20.958 30.3065 21.6302 30.1862 21.7271 30.1048L21.7132 30.085C21.3712 30.0239 21.2078 29.9539 20.9116 29.7621C21.4972 29.5783 22.159 29.4074 22.7682 29.3263C22.67 29.778 22.6211 29.8109 22.2699 30.1044C23.375 29.984 24.7098 29.7452 25.6571 29.1501C25.2794 29.1429 25.1744 29.1222 24.8609 28.8942C25.4474 28.5758 26.0394 28.2677 26.6368 27.9701C26.5593 28.5216 26.4452 28.7116 26.1043 29.1215C27.2828 28.4681 28.0455 28.1569 28.8816 26.9957C28.6959 27.0193 28.5506 27.0014 28.3665 26.9864L28.3938 26.7253C28.5483 26.5654 28.7286 26.4076 28.8887 26.2442C29.17 25.9523 29.4419 25.6512 29.7038 25.3417C29.7733 26.0721 29.7304 26.4197 29.361 27.0347C29.6937 26.7736 30.3635 25.9518 30.5659 25.5847C30.752 25.2471 31.0924 24.468 31.0716 24.0733C31.0612 23.8767 30.964 23.5623 30.9122 23.3634C31.0179 23.1397 31.1503 22.6502 31.1837 22.3953C31.7271 22.9287 31.8317 23.4933 31.7085 24.2195C32.0548 23.5894 32.2243 22.7843 32.2996 22.0685C32.3429 21.6577 32.3544 20.9434 32.1878 20.5664C32.1121 20.3954 31.9597 20.2062 31.8406 20.0632C31.8005 19.693 31.8442 19.3052 31.7965 18.9442C32.4338 19.3647 32.6902 19.788 32.8686 20.5002C32.9066 19.8092 32.9139 19.2404 32.7542 18.5535C32.6364 18.0466 32.4138 17.4033 32.0481 17.0151C31.9248 16.8844 31.7589 16.7823 31.6084 16.6858C31.539 16.3515 31.463 16.0366 31.3227 15.7236C32.0017 15.8801 32.39 16.243 32.7727 16.8057C32.7175 16.588 32.6506 16.3734 32.5724 16.163C32.3003 15.4281 31.9257 14.6968 31.2861 14.2011C31.1603 14.1036 30.9306 14.0033 30.7827 13.9354C30.5932 13.6207 30.3194 13.2951 30.0501 13.0467C30.9003 13.0059 31.3722 13.31 32.0782 13.7132C32.2906 13.8344 32.5416 13.9524 32.7632 14.0749C32.6962 13.9743 32.43 13.6938 32.3329 13.5811C31.6981 12.8444 31.2818 12.3614 30.3875 11.9127C30.7693 11.9447 31.2879 11.9306 31.6797 11.9311C32.4385 12.6351 33.1942 13.4141 33.9176 14.1533C33.9224 14.6542 33.9161 15.2393 33.9428 15.7321C33.6352 16.0576 33.4924 16.6059 33.897 16.9356C34.2447 17.1896 34.7305 17.0559 34.9508 16.708C35.2199 16.2831 35.0028 15.8973 34.6214 15.6529L34.6302 14.5689C34.6306 14.3947 34.6189 14.068 34.6509 13.917C34.1995 13.4075 33.6811 12.9325 33.2195 12.4301C33.0615 12.2581 32.8745 12.057 32.6996 11.9052Z" fill="#F7F8F9"/>
<path d="M24.7799 30.4631C24.8772 30.4642 24.95 30.5047 25.0468 30.5307C25.0872 30.5054 25.1101 30.4922 25.1529 30.4712C25.1745 30.4838 25.2372 30.5228 25.2603 30.5208C25.6211 30.4953 25.9767 30.4634 26.3354 30.4179C26.941 30.341 27.5817 30.3577 28.194 30.3484L31.4464 30.3226C31.6701 30.3221 31.9445 30.2544 32.1155 30.278L32.151 30.2831C32.432 30.3219 32.2998 30.2984 32.5027 30.2069C32.2968 30.4695 32.0534 30.6927 31.8193 30.9284C31.1011 31.6512 30.2561 32.2433 29.3928 32.7795C29.1803 32.9115 28.9402 33.0737 28.7183 33.1848L28.7616 33.2179C28.8431 33.1718 29.1211 33.083 29.2249 33.0471C29.5246 32.9436 29.8225 32.8488 30.1184 32.731C31.0435 32.3628 31.8581 31.7853 32.6274 31.1625C32.8141 31.0113 33.1296 30.7343 33.2534 30.548L33.2943 30.5664C33.195 30.6589 33.1204 30.7738 33.0276 30.8738C31.882 32.1084 30.1009 33.5236 28.475 34.0366C28.0041 34.1834 27.5132 34.2553 27.0201 34.2496C26.0011 34.234 25.517 33.9708 24.7945 33.3261C24.5816 33.3547 23.9206 33.4448 23.7378 33.4C23.8143 33.3999 23.836 33.3988 23.9111 33.386C23.8812 33.3197 23.4463 32.8223 23.3764 32.7349C22.4279 32.6144 21.531 32.4312 20.706 31.9192C20.5607 31.829 20.1754 31.6322 20.179 31.4531C20.5156 31.0682 22.5785 30.9112 23.1752 30.8107C23.7155 30.7216 24.2511 30.6056 24.7799 30.4631Z" fill="url(#paint16_linear_1_2)"/>
<path d="M28.7616 33.2179C28.6655 33.2575 28.5538 33.3115 28.4523 33.32C28.5208 33.266 28.6356 33.2218 28.7183 33.1848L28.7616 33.2179Z" fill="#000101"/>
<path d="M35.2311 19.12C35.4425 19.0966 35.503 19.4362 35.5614 19.5704C35.6315 19.5525 35.672 19.374 35.7307 19.2995C35.7701 19.3196 35.7681 19.3205 35.7975 19.3527C35.8705 19.3288 35.9306 19.2739 35.9909 19.2262C36.1797 19.0767 36.3793 18.9637 36.6231 18.9409C36.6378 18.8989 36.6364 18.9004 36.6636 18.8656C36.7282 18.8641 36.7325 18.8695 36.7921 18.8905C36.7962 18.9371 36.7938 18.9375 36.8134 18.9791L36.8313 18.9478C36.8246 18.8524 36.8079 18.8135 36.8787 18.7471C36.8476 21.2953 36.2876 23.8092 35.2343 26.1297C35.0564 26.1608 34.8795 26.1004 34.7015 26.0914C34.1107 26.0614 33.5157 25.9573 32.9238 25.9687C32.9355 25.9685 32.4042 25.9977 32.4351 25.9886L32.2408 26.0078C32.1437 26.0035 32.108 26.0743 32.0594 26.0709C31.9143 26.0607 31.362 26.1757 31.2726 26.0491C31.2886 26.0072 31.287 26.0024 31.2905 25.9575C31.36 25.7652 31.5169 25.607 31.622 25.2706C31.7073 25.3455 31.7849 25.4305 31.8633 25.5128C32.7359 24.0207 33.0733 23.1285 33.1387 21.4029L33.4837 21.458C33.5403 21.0306 33.6046 20.6752 33.6305 20.2416C33.6542 19.8433 33.6229 19.4829 33.6306 19.1019L33.6485 19.107C33.6698 19.2666 33.6581 19.5902 33.6569 19.7666C33.8311 19.7733 34.1756 19.7931 34.3337 19.7103C34.3354 19.6482 34.3382 19.5862 34.3424 19.5243C34.3543 19.3798 34.4246 19.2463 34.5372 19.1549C34.6575 19.0573 34.7571 19.0367 34.904 19.0537C35.0415 19.0623 35.0982 19.0731 35.2311 19.12Z" fill="url(#paint17_linear_1_2)"/>
<path d="M34.904 19.0537C35.0415 19.0623 35.0982 19.0731 35.2311 19.12C35.273 19.1926 35.4582 19.2787 35.4928 19.4345C35.7362 20.5309 33.9803 20.3191 34.4562 19.3168C34.5274 19.1667 34.7473 19.0885 34.904 19.0537Z" fill="#000101"/>
<path d="M32.4351 25.9886C32.4042 25.9977 32.9355 25.9685 32.9238 25.9687C33.5157 25.9573 34.1107 26.0614 34.7015 26.0914C34.8795 26.1004 35.0564 26.1608 35.2343 26.1297C34.6086 27.469 33.8028 28.7165 32.8391 29.8375C32.7915 29.8922 32.5444 30.1842 32.5027 30.2069C32.2998 30.2984 32.432 30.3219 32.151 30.2831L32.1155 30.278C31.9445 30.2544 31.6701 30.3221 31.4464 30.3226L28.194 30.3484C27.5817 30.3577 26.941 30.341 26.3354 30.4179C25.9767 30.4634 25.6211 30.4953 25.2603 30.5208C25.2372 30.5228 25.1745 30.4838 25.1529 30.4712C25.1101 30.4922 25.0872 30.5054 25.0468 30.5307C24.95 30.5047 24.8772 30.4642 24.7799 30.4631C27.4036 29.6639 29.7109 28.2448 31.2905 25.9575C31.287 26.0024 31.2886 26.0072 31.2726 26.0491C31.362 26.1757 31.9143 26.0607 32.0594 26.0709C32.108 26.0743 32.1437 26.0035 32.2408 26.0078L32.4351 25.9886Z" fill="url(#paint18_linear_1_2)"/>
<path d="M32.4351 25.9886C32.7152 26.1946 32.7432 26.5527 32.3668 26.5644C32.2782 26.5673 32.1919 26.5352 32.1267 26.4749C31.9517 26.3103 32.084 26.1202 32.2407 26.0078L32.4351 25.9886Z" fill="#000101"/>
<path d="M28.71 9.20488C29.4207 9.18989 30.1354 9.23227 30.8533 9.22047C30.7888 9.27094 30.6793 9.36223 30.6138 9.40342C30.5049 9.48372 30.232 9.87998 30.0445 10.0351C29.5339 10.0721 28.8264 10.0516 28.2974 10.0532C27.197 10.0492 26.0965 10.0569 24.9962 10.0763C24.8397 10.2802 24.4623 10.6165 24.2652 10.8166C23.9608 11.1258 23.6502 11.4363 23.3542 11.7557C23.2552 11.8625 23.0593 12.0406 22.9794 12.1475C22.4955 12.1393 22.0115 12.1416 21.5276 12.1545C20.9585 12.7053 20.4746 13.3082 19.9125 13.8637C19.7691 14.0054 19.6516 14.1528 19.4975 14.292C19.2606 14.2927 18.9125 14.3059 18.6857 14.3443C18.6383 14.4176 18.3319 14.8105 18.2782 14.8817C18.0702 15.1572 17.4073 16.2364 17.1743 16.4055C17.1313 16.3778 17.0895 16.3543 17.0454 16.3288C17.0496 16.2572 18.6295 14.0249 18.8032 13.8113C18.8997 13.693 19.004 13.5813 19.1153 13.477C19.2 13.3986 19.3161 13.3617 19.2932 13.2455C19.2456 13.2585 19.2682 13.2614 19.2243 13.2462C19.2871 13.0689 20.912 11.4024 21.1599 11.2284C21.5585 11.1707 22.1699 11.2265 22.6221 11.1862C22.8083 11.0475 22.9834 10.84 23.155 10.6822C23.6402 10.2362 24.1476 9.62748 24.6373 9.2057C25.971 9.18395 27.3734 9.19754 28.71 9.20488Z" fill="url(#paint19_linear_1_2)"/>
<path d="M28.71 9.20488C29.4207 9.18989 30.1354 9.23227 30.8533 9.22047C30.7888 9.27094 30.6793 9.36223 30.6138 9.40342C29.7044 9.3813 28.7327 9.45173 27.82 9.41878L25.9175 9.41663C25.5337 9.41641 25.0952 9.40765 24.7153 9.4288C24.5634 9.52506 24.5206 9.61041 24.3967 9.7328C23.885 10.2385 23.2135 11.0391 22.6356 11.4028C22.5666 11.4462 21.4109 11.4199 21.2272 11.4286C20.7621 11.8104 20.2186 12.4809 19.7526 12.8953C19.6129 13.0195 19.4441 13.1334 19.2932 13.2455C19.2456 13.2585 19.2682 13.2614 19.2243 13.2462C19.2871 13.0689 20.912 11.4024 21.1599 11.2284C21.5585 11.1707 22.1699 11.2265 22.6221 11.1862C22.8083 11.0475 22.9834 10.84 23.155 10.6822C23.6402 10.2362 24.1476 9.62748 24.6373 9.2057C25.971 9.18395 27.3734 9.19754 28.71 9.20488Z" fill="#F7F8F9"/>
<path d="M28.71 9.20488C29.4207 9.18989 30.1354 9.23227 30.8533 9.22047C30.7888 9.27094 30.6793 9.36223 30.6138 9.40342C29.7044 9.3813 28.7327 9.45173 27.82 9.41878C28.1298 9.36475 29.8078 9.44201 29.9319 9.34939C29.9023 9.32668 29.9003 9.32081 29.8827 9.2889L29.8664 9.25884C29.7604 9.20704 28.9195 9.25327 28.71 9.20488Z" fill="#BEC7D9"/>
<path d="M27.8938 7.21406C28.267 7.21763 28.6653 7.21632 29.0367 7.23656C29.234 7.36109 29.6557 7.77334 29.8268 7.95059C30.7933 7.98842 31.9355 7.95638 32.9163 7.95869C33.3419 8.35593 33.7259 8.78399 34.1442 9.18789C34.2228 9.26389 34.3062 9.33952 34.3795 9.42027L34.8549 9.42249L34.8594 9.44914C34.9088 9.73043 35.0162 10.0338 35.1038 10.3055C35.3148 10.96 35.569 11.5996 35.8142 12.2417C35.8793 12.4122 35.9505 12.5804 36.0019 12.7556C35.9276 12.8471 35.8362 12.8487 35.7543 12.766C35.2877 12.295 34.8401 11.7898 34.3469 11.3465C33.9032 11.3308 33.4121 11.3428 32.9644 11.3451L30.8939 11.3501C30.6327 11.3504 29.7828 11.3707 29.5744 11.3136C29.4334 11.2751 28.7619 10.8184 28.5521 10.6985C29.0246 10.75 29.7846 10.7276 30.2775 10.7266L33.1924 10.7181C33.5792 10.7169 34.2736 10.6976 34.632 10.7387C33.9784 10.1034 33.202 9.35703 32.5724 8.69767C32.0011 8.70487 31.4297 8.70739 30.8584 8.70532C30.4658 8.70569 30.0426 8.71467 29.6533 8.70101C29.3732 8.4549 29.0654 8.12942 28.7999 7.85961C28.6026 7.85932 28.4042 7.85637 28.2074 7.86833C28.0404 7.9707 27.8477 8.1656 27.7092 8.31068C27.0428 8.30621 26.3764 8.30537 25.7099 8.3082C25.8167 8.19647 26.1466 7.86433 26.2219 7.75849C26.3607 7.73431 26.6619 7.74152 26.8164 7.73943C26.9562 7.74018 27.1546 7.73526 27.2898 7.74612C27.4887 7.56596 27.69 7.38859 27.8938 7.21406Z" fill="#F7F8F9"/>
<path d="M29.8944 21.4288C29.7481 22.1273 29.374 22.8485 28.9839 23.4445C27.5095 25.697 24.9157 27.1337 22.3959 27.9292C22.541 28.0455 22.6912 28.1646 22.8123 28.3066C22.5619 28.3742 22.2222 28.4738 21.9686 28.5134C21.8667 28.3557 21.6249 27.9286 21.5319 27.8139C21.4981 27.7629 21.4623 27.6972 21.4308 27.6433C21.9459 27.4968 22.4375 27.3688 22.944 27.1891C23.4985 26.9921 23.9883 26.7591 24.5205 26.5219C24.5552 26.4869 24.9575 26.2798 25.0272 26.2431C25.2844 26.0864 25.5519 25.9117 25.8121 25.7634C25.8729 25.7029 26.157 25.5112 26.2388 25.453C26.454 25.3 26.6639 25.1397 26.8682 24.9724C27.3768 24.5542 28.0097 23.8484 28.4212 23.326C28.5642 23.1446 28.725 22.8645 28.8598 22.666C29.1017 22.2229 29.2433 21.9374 29.4141 21.4637L29.5324 21.4652C29.6129 21.4638 29.7091 21.4647 29.788 21.4594C29.8382 21.4511 29.8455 21.4459 29.8944 21.4288Z" fill="url(#paint20_linear_1_2)"/>
<path d="M21.4308 27.6433C21.9459 27.4968 22.4375 27.3688 22.944 27.1891C23.4985 26.9921 23.9883 26.7591 24.5205 26.5219C24.479 26.6317 24.1485 26.7027 24.1159 26.7594C24.3124 26.8264 24.2533 26.7152 24.3851 26.7146L24.4021 26.7302C24.2803 26.8102 23.9608 26.9565 23.8183 27.0205C23.3745 27.2197 22.9214 27.4024 22.4584 27.5519C22.1582 27.649 21.8172 27.7185 21.5319 27.8139C21.4981 27.7629 21.4623 27.6972 21.4308 27.6433Z" fill="url(#paint21_linear_1_2)"/>
<path d="M29.4141 21.4637L29.5324 21.4652C29.6129 21.4638 29.7091 21.4647 29.788 21.4594C29.7851 21.5383 29.4601 22.2963 29.3763 22.4049L29.3562 22.4094C29.3457 22.3306 29.541 22.0579 29.5128 21.9407C29.4488 21.9814 29.3902 22.0202 29.3228 22.0555C29.272 22.1588 29.1811 22.3751 29.0971 22.4344C28.9995 22.6052 29.0367 22.5841 28.8598 22.666C29.1017 22.2229 29.2433 21.9374 29.4141 21.4637Z" fill="url(#paint22_linear_1_2)"/>
<path d="M29.4141 21.4637L29.5324 21.4652C29.3766 21.7856 29.2591 22.1081 29.0971 22.4344C28.9995 22.6052 29.0367 22.5841 28.8598 22.666C29.1017 22.2229 29.2433 21.9374 29.4141 21.4637Z" fill="url(#paint23_linear_1_2)"/>
<path d="M25.0272 26.2431L25.0643 26.2448C25.119 26.2465 25.1299 26.2421 25.1822 26.2282L25.199 26.2354C25.1402 26.2853 25.0997 26.3116 25.0605 26.3764C24.8903 26.4773 24.5818 26.6618 24.4021 26.7302L24.3851 26.7146C24.2533 26.7152 24.3124 26.8264 24.1159 26.7594C24.1485 26.7027 24.479 26.6317 24.5205 26.5219C24.5552 26.4869 24.9575 26.2798 25.0272 26.2431Z" fill="#828FA9"/>
<path d="M25.8121 25.7634L25.842 25.7725C25.737 25.8461 25.5 25.9785 25.4367 26.0419L25.4501 26.0761L25.4336 26.049C25.5071 26.1213 25.5466 26.0912 25.6214 26.0293C25.7004 25.9639 25.7808 25.9504 25.8579 25.8769L25.9086 25.8674C25.8461 25.9523 25.1917 26.3145 25.0605 26.3764C25.0997 26.3116 25.1402 26.2853 25.199 26.2354L25.1822 26.2282C25.1299 26.2421 25.119 26.2465 25.0643 26.2448L25.0272 26.2431C25.2844 26.0864 25.5519 25.9117 25.8121 25.7634Z" fill="#58617D"/>
<path d="M28.0481 11.677C28.2707 11.6554 28.5809 11.8054 28.7476 11.9517C28.9615 12.1404 29.0908 12.4069 29.1068 12.6917C29.1605 13.667 28.0271 14.1821 27.2657 13.4614C27.1731 13.5606 27.0912 13.6331 26.9763 13.7053C26.0654 13.7292 25.0319 13.703 24.1125 13.6996L22.9441 13.6942L22.7783 13.5315C22.9073 13.5457 23.1042 13.5271 23.2416 13.5231C23.4783 13.5182 23.7151 13.5165 23.9519 13.5181C24.924 13.5186 25.9277 13.5327 26.8972 13.5149C26.9527 13.4406 27.0589 13.3421 27.104 13.2932C27.1272 13.2061 27.0169 13.013 27.0074 12.9192C26.9383 12.23 27.3748 11.7446 28.0481 11.677Z" fill="#F7F8F9"/>
<path d="M27.8937 11.913C28.3596 11.8279 28.8066 12.1353 28.8941 12.6008C28.9814 13.0663 28.6762 13.5148 28.2112 13.6045C27.7429 13.6947 27.2905 13.387 27.2026 12.9183C27.1145 12.4496 27.4245 11.9987 27.8937 11.913Z" fill="#000101"/>
<path d="M27.9839 12.5875C28.0572 12.5657 28.1365 12.5849 28.1915 12.6379C28.2466 12.6909 28.2688 12.7694 28.2498 12.8433C28.2307 12.9173 28.1733 12.9753 28.0995 12.9952C27.9876 13.0251 27.8724 12.9598 27.8408 12.8483C27.8091 12.7368 27.873 12.6207 27.9839 12.5875Z" fill="#F7F8F9"/>
<path d="M17.0454 16.3288C17.0895 16.3543 17.1313 16.3778 17.1743 16.4055C17.1173 16.4725 17.0706 16.5359 16.9992 16.5866C16.9432 16.6939 16.397 17.027 16.2682 17.1165L14.5855 18.2783C14.2607 18.5017 13.7791 18.8149 13.492 19.0692C13.4528 18.972 13.1786 18.4319 13.1204 18.363C13.0647 18.3135 13.0761 18.3421 13.0689 18.2821C13.2237 18.0555 14.6016 16.6642 14.802 16.5326C15.0276 16.5112 15.3169 16.5085 15.549 16.4984C15.9485 16.4818 16.348 16.4609 16.7471 16.4357C16.881 16.4161 16.9451 16.4183 17.0454 16.3288Z" fill="url(#paint24_linear_1_2)"/>
<path d="M17.0454 16.3288C17.0895 16.3543 17.1313 16.3778 17.1743 16.4055C17.1173 16.4725 17.0706 16.5359 16.9992 16.5866L16.7803 16.5856C16.2712 16.6618 15.3715 16.6922 14.8642 16.7015C14.3724 17.0866 13.9184 17.7097 13.4279 18.1171C13.3349 18.1945 13.2282 18.312 13.1204 18.363C13.0647 18.3135 13.0761 18.3421 13.0689 18.2821C13.2237 18.0555 14.6016 16.6642 14.802 16.5326C15.0276 16.5112 15.3169 16.5085 15.549 16.4984C15.9485 16.4818 16.348 16.4609 16.7471 16.4357C16.881 16.4161 16.9451 16.4183 17.0454 16.3288Z" fill="#F7F8F9"/>
<path d="M17.0454 16.3288C17.0895 16.3543 17.1313 16.3778 17.1743 16.4055C17.1173 16.4725 17.0706 16.5359 16.9992 16.5866L16.7803 16.5856C16.8361 16.5321 16.8539 16.566 16.9226 16.4869L16.8944 16.464C16.8297 16.4578 16.8081 16.4519 16.7471 16.4357C16.881 16.4161 16.9451 16.4183 17.0454 16.3288Z" fill="#F7F8F9"/>
<path d="M17.527 11.9382C17.5991 11.8886 17.631 11.869 17.7096 11.8309C17.3501 12.3296 17.038 12.9028 16.6344 13.3602C16.6084 13.3897 15.9324 13.7044 15.8429 13.7408C15.6552 13.8766 15.4692 13.9715 15.3084 14.1397C14.892 14.5751 14.6915 15.1193 14.4283 15.6499C14.282 15.9448 14.0886 16.3021 13.9685 16.6026C14.0292 16.0385 14.0558 15.3132 14.0536 14.7434C14.0731 14.6777 14.195 14.5292 14.2417 14.4646C14.3603 14.3012 14.4762 14.1357 14.5892 13.9683C15.475 12.6731 15.6685 12.6054 17.143 12.0797C17.2704 12.0357 17.4003 11.9854 17.527 11.9382Z" fill="#BEC7D9"/>
<path d="M14.0536 14.7434C14.0731 14.6777 14.195 14.5292 14.2417 14.4646C14.3603 14.3012 14.4762 14.1357 14.5892 13.9683C15.475 12.6731 15.6685 12.6054 17.143 12.0797C17.1596 12.1226 17.1759 12.1522 17.1725 12.1977C17.0664 12.2882 16.8734 12.4592 16.7647 12.5343C16.2065 12.9207 15.6898 13.2195 15.2214 13.7259C14.9537 14.0154 14.8154 14.2754 14.5852 14.5802C14.3307 14.9168 14.3641 14.7378 14.0536 14.7434Z" fill="#F7F8F9"/>
<path d="M14.5852 14.5803C14.6522 14.5752 14.7907 14.514 14.8293 14.4674C15.2024 14.016 15.5222 13.5935 16.0356 13.2816C16.1106 13.2359 16.3041 13.0657 16.3785 13.0548C16.4174 13.2234 15.7953 13.5265 15.7249 13.7609C15.7839 13.7414 15.7816 13.7397 15.8429 13.7408C15.6552 13.8766 15.4692 13.9715 15.3084 14.1397C14.892 14.5751 14.6915 15.1193 14.4283 15.6499C14.282 15.9448 14.0886 16.3021 13.9685 16.6026C14.0292 16.0385 14.0558 15.3132 14.0536 14.7434C14.3641 14.7378 14.3307 14.9168 14.5852 14.5803Z" fill="url(#paint25_linear_1_2)"/>
<path d="M17.143 12.0797C17.2704 12.0357 17.4003 11.9854 17.527 11.9382L17.5097 11.9853C17.3612 12.0501 17.3057 12.1108 17.1725 12.1977C17.1759 12.1522 17.1596 12.1226 17.143 12.0797Z" fill="#F7F8F9"/>
<path d="M19.6772 9.72337C20.0152 9.4625 20.6708 8.87416 21.0341 8.7782C21.2982 8.70843 21.5654 8.79445 21.9065 8.61321C21.9053 8.75861 21.8679 8.76343 21.7649 8.85487C21.8017 8.86296 21.8607 8.87862 21.8961 8.87966L21.8798 8.89784C21.4775 9.33952 20.9347 9.70823 20.5477 10.1503C20.3118 10.4196 20.1707 11.0337 19.9895 11.3571C19.8865 11.5518 19.0839 12.4099 18.9192 12.5511C18.8206 12.6357 18.7107 12.7062 18.5928 12.7605C18.4498 12.8369 18.3319 12.8908 18.183 12.9563C17.9966 13.0378 17.8315 13.1151 17.6363 13.1733C17.6476 13.127 17.683 13.0748 17.7063 13.0295L17.685 12.9955C17.8114 12.8288 17.9116 12.6971 18.0624 12.5515L18.4192 12.4711C18.4724 12.4597 18.5549 12.4314 18.6093 12.4147C18.7421 12.3843 18.886 12.3037 18.9798 12.2038C19.0055 12.1692 19.0305 12.1341 19.0549 12.0986C19.2848 11.7616 19.2122 11.3544 19.1431 10.9817C19.1662 10.9162 19.1681 10.9041 19.2108 10.8464C19.4148 10.4941 19.5716 10.1165 19.6772 9.72337Z" fill="url(#paint26_linear_1_2)"/>
<path d="M19.6772 9.72337C20.0152 9.4625 20.6708 8.87416 21.0341 8.7782C21.2982 8.70843 21.5654 8.79445 21.9065 8.61321C21.9053 8.75861 21.8679 8.76343 21.7649 8.85487C21.5871 8.94653 21.3271 8.963 21.1328 9.01392C20.546 9.62095 19.919 10.1979 19.32 10.7935C19.2828 10.8305 19.2603 10.842 19.2108 10.8464C19.4148 10.4941 19.5716 10.1165 19.6772 9.72337Z" fill="#F7F8F9"/>
<path d="M18.0624 12.5515L18.4192 12.4711C18.4724 12.4954 18.5203 12.5163 18.5746 12.538C18.0956 12.6979 18.1037 12.7199 17.7063 13.0295L17.685 12.9955C17.8114 12.8288 17.9116 12.6971 18.0624 12.5515Z" fill="url(#paint27_linear_1_2)"/>
<path d="M18.9798 12.2038L19.0164 12.2343C18.9627 12.3385 18.8716 12.4186 18.7613 12.4586C18.6604 12.3509 18.756 12.4684 18.6093 12.4147C18.7421 12.3843 18.886 12.3037 18.9798 12.2038Z" fill="#828FA9"/>
<path d="M18.183 12.9563C18.245 12.775 18.426 12.7438 18.5928 12.7605C18.4498 12.8369 18.3319 12.8908 18.183 12.9563Z" fill="#232933"/>
<path d="M18.6093 12.4147C18.756 12.4684 18.6604 12.3509 18.7613 12.4586C18.7012 12.4867 18.6375 12.5192 18.5746 12.538C18.5203 12.5163 18.4724 12.4954 18.4192 12.4711C18.4724 12.4597 18.5549 12.4314 18.6093 12.4147Z" fill="#BEC7D9"/>
<path d="M28.9222 15.9733C28.9377 16.0078 28.9548 16.05 28.9733 16.0821C29.0925 16.1006 29.1682 16.1086 29.2418 16.0047C29.2961 16.0723 29.3493 16.1234 29.3693 16.2056C29.3478 16.2577 29.3639 16.2373 29.3217 16.271C29.0929 16.616 29.7296 17.4014 29.6969 17.8035C29.6913 17.8719 29.6576 17.9588 29.6306 18.0189C29.581 18.2889 29.8107 18.4622 30.0278 18.5666C30.0389 18.9124 30.1084 20.1943 29.9836 20.4669L29.9584 20.4879C29.7353 20.4848 29.1563 20.5012 28.9639 20.4719C28.9376 20.4202 28.9477 20.3361 28.9494 20.2739C28.9609 19.8231 28.9641 19.3721 28.9593 18.9212C28.9776 18.9722 28.9839 19.0027 29.0202 19.0435L29.0647 19.0419C29.1336 18.9603 29.1239 18.7242 29.1297 18.6043C29.1199 18.152 29.068 17.1826 28.9235 16.7883C28.8907 16.7615 28.7535 16.556 28.7225 16.5109L28.76 16.4757C28.725 16.3144 28.6922 16.0761 28.8648 15.9795L28.9222 15.9733Z" fill="url(#paint28_linear_1_2)"/>
<path d="M28.9222 15.9733C28.9377 16.0078 28.9548 16.05 28.9733 16.0821C29.0925 16.1006 29.1682 16.1086 29.2418 16.0047C29.2961 16.0723 29.3493 16.1234 29.3693 16.2056C29.3478 16.2577 29.3639 16.2373 29.3217 16.271C29.0929 16.616 29.7296 17.4014 29.6969 17.8035C29.6913 17.8719 29.6576 17.9588 29.6306 18.0189C29.5896 17.9627 29.5851 17.9633 29.5704 17.8929C29.4803 17.6226 29.4458 17.5637 29.2943 17.3145C29.2361 17.1878 29.0619 16.8004 28.9752 16.7189L28.9603 16.7316C28.9238 16.6625 28.9167 16.6337 28.9173 16.5539L28.8818 16.5806C28.873 16.6607 28.8991 16.7008 28.9342 16.7719L28.9235 16.7883C28.8907 16.7615 28.7535 16.556 28.7225 16.5109L28.76 16.4757C28.725 16.3144 28.6922 16.0761 28.8648 15.9795L28.9222 15.9733Z" fill="#828FA9"/>
<path d="M28.9222 15.9733C28.9377 16.0078 28.9548 16.05 28.9733 16.0821L29.003 16.1037C28.8894 16.3409 28.9185 16.4581 28.9752 16.7189L28.9603 16.7316C28.9238 16.6625 28.9167 16.6337 28.9173 16.5539L28.8818 16.5806C28.873 16.6607 28.8991 16.7008 28.9342 16.7719L28.9235 16.7883C28.8907 16.7615 28.7535 16.556 28.7225 16.5109L28.76 16.4757C28.725 16.3144 28.6922 16.0761 28.8648 15.9795L28.9222 15.9733Z" fill="#232933"/>
<path d="M28.76 16.4757C28.725 16.3144 28.6922 16.0761 28.8648 15.9795C28.8752 16.0024 28.8855 16.0252 28.8959 16.0481C28.8763 16.1712 28.877 16.4106 28.8244 16.5189C28.7763 16.5093 28.7994 16.5185 28.76 16.4757Z" fill="#58617D"/>
<path d="M29.2418 16.0047C29.2961 16.0723 29.3493 16.1234 29.3693 16.2056C29.3478 16.2577 29.3639 16.2373 29.3217 16.271C29.1573 16.1656 29.139 16.2888 29.003 16.1037L28.9733 16.0821C29.0925 16.1006 29.1682 16.1086 29.2418 16.0047Z" fill="#C1C0C1"/>
<path d="M29.1297 18.6043C29.154 18.7495 29.1661 20.1357 29.1282 20.2349C29.104 20.3151 29.1023 20.3243 29.1292 20.4033C29.1032 20.4544 29.1216 20.4334 29.0678 20.4642C29.0105 20.4305 29.0021 20.3695 28.9864 20.304L28.9494 20.2739C28.9609 19.8231 28.9641 19.3721 28.9593 18.9212C28.9776 18.9722 28.9839 19.0027 29.0202 19.0435L29.0647 19.0419C29.1336 18.9603 29.1239 18.7242 29.1297 18.6043Z" fill="#ADBBD7"/>
<path d="M28.9494 20.2739L28.9864 20.304C29.0021 20.3695 29.0105 20.4305 29.0678 20.4642C29.1216 20.4334 29.1032 20.4544 29.1292 20.4033C29.1023 20.3243 29.104 20.3151 29.1282 20.2349C29.1442 20.3243 29.1273 20.3107 29.181 20.3597C29.4323 20.4349 29.8943 20.3158 29.9836 20.4669L29.9585 20.4879C29.7353 20.4848 29.1563 20.5012 28.9639 20.4719C28.9376 20.4202 28.9477 20.3361 28.9494 20.2739Z" fill="url(#paint29_linear_1_2)"/>
<path d="M29.2943 17.3145C29.4458 17.5637 29.4803 17.6226 29.5704 17.8929C29.3789 17.7407 29.2917 17.5611 29.2943 17.3145Z" fill="#58617D"/>
<path d="M19.9746 15.5017C20.3573 15.5711 21.0681 15.2263 21.4053 15.0506C21.3689 15.3134 20.1357 16.5194 19.9164 16.8264C19.8634 16.9005 19.5462 17.2546 19.4666 17.3211C19.2763 17.354 17.9462 17.4154 17.854 17.344C17.8482 17.3395 17.844 17.3327 17.8375 17.3293C17.8294 17.3253 17.82 17.3247 17.8114 17.3223C17.7693 17.3331 17.7584 17.3329 17.7147 17.3357L17.7036 17.3159C17.8414 17.1412 18.8103 16.6366 19.0266 16.5223C19.4374 16.2246 19.6593 15.8826 19.9746 15.5017Z" fill="url(#paint30_linear_1_2)"/>
<path d="M19.0266 16.5223C18.9895 16.7583 17.8993 17.1838 17.8114 17.3223C17.7693 17.3331 17.7584 17.333 17.7147 17.3357L17.7036 17.3159C17.8414 17.1412 18.8103 16.6366 19.0266 16.5223Z" fill="#828FA9"/>
<path d="M16.7059 14.5773C17.0558 14.3363 17.4332 14.0384 17.8203 13.863C17.9272 13.8145 18.1681 13.753 18.291 13.7166C18.4975 13.6561 18.7017 13.5878 18.9031 13.5119C18.7041 13.7438 18.4616 13.9167 18.2748 14.1393C18.2088 14.21 18.1451 14.2788 18.0764 14.3471C17.7833 14.6492 17.437 14.9296 17.1785 15.238C17.047 15.3948 16.8991 15.8294 16.7551 15.9911C16.3513 16.0501 15.9464 16.1017 15.5406 16.1457C15.3852 16.1614 15.1777 16.1645 15.0354 16.1851C15.0705 16.1486 15.1458 16.0657 15.1806 16.0361C15.4887 15.7074 15.6225 15.7945 15.9617 15.674C16.3395 15.5399 16.5659 14.9261 16.7059 14.5773Z" fill="#F7F8F9"/>
<path d="M17.8282 14.3516C17.9634 14.3694 17.8871 14.2832 18.0764 14.3471C17.7833 14.6492 17.437 14.9296 17.1785 15.238C17.047 15.3948 16.8991 15.8294 16.7551 15.9911C16.6916 15.8869 16.5189 15.758 16.3959 15.739C16.5521 15.7312 16.5671 15.5845 16.6561 15.443C16.7166 15.3467 16.8657 14.9935 16.9424 14.9209C17.111 14.7613 17.624 14.4569 17.8282 14.3516Z" fill="#828FA9"/>
<path d="M16.3959 15.739C16.5189 15.758 16.6916 15.8869 16.7551 15.9911C16.3513 16.0501 15.9464 16.1017 15.5406 16.1457C15.3852 16.1614 15.1777 16.1645 15.0354 16.1851C15.0705 16.1486 15.1458 16.0657 15.1806 16.0361C15.2738 16.0535 16.2738 15.7927 16.3959 15.739Z" fill="#64768C"/>
<path d="M17.8282 14.3516C17.9042 14.2823 18.0623 14.1706 18.1575 14.1231C18.2137 14.0952 18.2271 14.1151 18.2748 14.1393C18.2088 14.21 18.1451 14.2788 18.0764 14.3471C17.8871 14.2832 17.9634 14.3694 17.8282 14.3516Z" fill="#ADBBD7"/>
<path d="M19.666 33.7267C19.7351 33.7202 20.3803 34.0468 20.5194 34.099C21.0307 34.2863 21.5554 34.435 22.0889 34.5441C22.2922 34.587 22.9578 34.6543 23.0783 34.7598C23.0244 34.829 22.827 34.8515 22.74 34.8454C22.963 34.8888 23.0781 34.9905 23.2421 35.137C23.334 35.1942 23.347 35.2064 23.4197 35.287C23.2169 35.3247 22.0924 35.1928 21.8512 35.1317C21.3379 35.0017 20.1373 34.7472 19.7161 34.4702L19.734 34.4111C19.7301 34.3949 19.7263 34.3388 19.7245 34.3191C19.7999 34.1825 19.7256 34.0962 19.7574 33.9792L19.6889 33.9621C19.6544 33.899 19.6679 33.8019 19.666 33.7267Z" fill="url(#paint31_linear_1_2)"/>
<path d="M19.666 33.7267C19.7351 33.7202 20.3803 34.0468 20.5194 34.099C21.0307 34.2863 21.5554 34.435 22.0889 34.5441C22.2922 34.587 22.9578 34.6543 23.0783 34.7598C23.0244 34.829 22.827 34.8515 22.74 34.8454C21.9127 34.7964 20.4985 34.3708 19.7574 33.9792L19.6889 33.9621C19.6544 33.899 19.6679 33.8019 19.666 33.7267Z" fill="url(#paint32_linear_1_2)"/>
<path d="M19.734 34.4111C19.9502 34.3961 20.7481 34.6892 21.0089 34.7814C21.3405 34.8986 22.999 35.2475 23.2421 35.137C23.334 35.1942 23.347 35.2064 23.4197 35.287C23.2169 35.3247 22.0924 35.1928 21.8512 35.1317C21.3379 35.0017 20.1373 34.7472 19.7161 34.4702L19.734 34.4111Z" fill="#404C5E"/>
<path d="M28.7352 21.2596C28.9137 21.2625 29.1005 21.2619 29.2778 21.2775C29.384 21.2766 29.8368 21.2639 29.9016 21.2991C29.9124 21.3623 29.9074 21.3675 29.8944 21.4288C29.8455 21.4459 29.8382 21.4511 29.788 21.4594C29.7091 21.4647 29.6129 21.4638 29.5324 21.4652L29.4141 21.4637L28.9669 21.4503C28.1413 23.2514 26.758 24.7389 25.0216 25.6932C24.337 26.0757 23.7833 26.2956 23.0628 26.5798L22.9317 26.3614C23.7049 26.1306 24.4346 25.7766 25.1148 25.3644C26.4478 24.5566 27.6056 23.543 28.328 22.1417C28.4402 21.924 28.6784 21.4928 28.7352 21.2596Z" fill="url(#paint33_linear_1_2)"/>
<path d="M29.2778 21.2775C29.384 21.2766 29.8368 21.2639 29.9016 21.2991C29.9124 21.3623 29.9074 21.3675 29.8944 21.4288C29.8455 21.4459 29.8382 21.4511 29.788 21.4594C29.7091 21.4647 29.6129 21.4638 29.5324 21.4652L29.4141 21.4637L28.9669 21.4503L28.7042 21.3201C28.9118 21.2861 29.0722 21.2942 29.2778 21.2775Z" fill="#F7F8F9"/>
<path d="M26.6848 10.8361C26.7074 10.6907 26.7932 10.5675 26.9598 10.6026C27.0291 10.6168 27.0889 10.6603 27.1238 10.7219C27.1583 10.7839 27.1647 10.8576 27.1413 10.9245C27.122 10.9783 27.0886 11.0277 27.0543 11.0727C26.9609 11.1857 26.8558 11.2784 26.7613 11.3938C26.3459 11.9015 25.9165 12.3689 25.4706 12.8484C25.1258 12.8421 24.5696 12.8207 24.2429 12.8421C24.4913 12.6506 24.7389 12.2795 24.8774 12.1977C24.981 12.1268 25.1966 12.0932 25.3305 11.9826C25.6466 11.7217 25.8579 11.426 26.1881 11.1746C26.3035 11.0894 26.4734 10.9624 26.6035 10.9115C26.6726 10.8726 26.6485 10.899 26.6848 10.8361Z" fill="url(#paint34_linear_1_2)"/>
<path d="M26.1881 11.1746C26.2225 11.2078 26.2819 11.2604 26.3022 11.2995C26.0257 11.5604 25.7198 11.9257 25.4005 12.1336C25.3043 12.1962 24.9843 12.2283 24.8774 12.1977C24.981 12.1268 25.1966 12.0932 25.3305 11.9826C25.6466 11.7217 25.8579 11.426 26.1881 11.1746Z" fill="#F7F8F9"/>
<path d="M26.6848 10.8361C26.7074 10.6907 26.7932 10.5675 26.9598 10.6026C27.0291 10.6168 27.0889 10.6603 27.1238 10.7219C27.1583 10.7839 27.1647 10.8576 27.1413 10.9245C27.122 10.9783 27.0886 11.0277 27.0543 11.0727C26.8353 11.033 26.7904 11.0431 26.6848 10.8361Z" fill="#F7F8F9"/>
<path d="M26.1881 11.1746C26.3035 11.0894 26.4734 10.9624 26.6035 10.9115C26.5971 11.0443 26.4868 11.1334 26.3894 11.2216C26.3605 11.2478 26.3315 11.2737 26.3022 11.2995C26.2819 11.2604 26.2225 11.2078 26.1881 11.1746Z" fill="#ADBBD7"/>
<path d="M14.3745 19.4438L14.3691 19.3952C14.4604 19.2531 14.7885 19.0308 14.9378 18.9304C15.5419 18.5242 16.1218 18.0866 16.7197 17.6721C16.7709 17.6365 16.8129 17.6126 16.874 17.5989C16.9448 17.6084 16.9564 17.6258 17.011 17.6712C17.0266 17.6887 17.3555 17.954 17.3799 17.97C17.2323 18.0398 17.0427 18.168 16.8993 18.2581L15.959 18.8548C15.5512 19.1083 15.0196 19.3789 14.6453 19.6729C14.5629 19.5686 14.51 19.45 14.3745 19.4438Z" fill="#232933"/>
<path d="M14.3745 19.4438L14.3691 19.3952C14.4604 19.2531 14.7885 19.0308 14.9378 18.9304C15.5419 18.5242 16.1218 18.0866 16.7197 17.6721C16.7709 17.6365 16.8129 17.6126 16.874 17.5989C16.9448 17.6084 16.9564 17.6258 17.011 17.6712C16.7491 17.9021 14.6381 19.4031 14.3745 19.4438Z" fill="#F7F8F9"/>
<path d="M17.5323 28.1826C17.931 28.172 18.3319 28.1873 18.7327 28.1718C19.0073 28.523 19.3196 28.9357 19.6197 29.2589C19.6266 29.2693 19.6279 29.2827 19.6313 29.2949C19.4612 29.3306 19.094 29.5345 19.0085 29.5411C19.1294 29.4409 19.4825 29.3585 19.5041 29.2731C19.4516 29.212 19.3386 29.1904 19.276 29.1446C19.1163 29.0278 19.1149 28.817 18.9049 28.8981C18.7934 28.9411 18.5341 28.8117 18.4277 28.7606C18.2435 28.672 18.2533 28.6881 18.1155 28.8195L18.0855 28.8053L18.0627 28.7689C18.0063 28.7455 17.9501 28.7617 17.8871 28.7704C17.9689 28.6003 18.1059 28.5654 18.161 28.3653L17.6038 28.3644C17.1821 28.8855 16.5812 29.4592 16.1969 29.959C16.1976 30.1922 16.1958 30.4253 16.1918 30.6584C16.1652 30.7828 16.1846 31.0539 16.1248 31.1413L16.0974 31.1321C16.0667 31.0637 16.0631 31.0343 16.0475 30.9598C16.0484 30.5849 16.0398 30.21 16.0216 29.8355C16.1299 29.6844 16.4638 29.336 16.6002 29.1905C16.9089 28.8614 17.22 28.5049 17.5323 28.1826Z" fill="url(#paint35_linear_1_2)"/>
<path d="M18.161 28.3653C18.3393 28.3554 18.4643 28.3616 18.6409 28.3708C18.9721 28.642 19.2173 29.2038 19.6197 29.2589C19.6266 29.2693 19.6279 29.2827 19.6313 29.2949C19.4612 29.3306 19.094 29.5345 19.0085 29.5411C19.1294 29.4409 19.4825 29.3585 19.5041 29.2731C19.4516 29.212 19.3386 29.1904 19.276 29.1446C19.1163 29.0278 19.1149 28.817 18.9049 28.8981C18.7934 28.9411 18.5341 28.8117 18.4277 28.7606C18.2435 28.672 18.2533 28.6881 18.1155 28.8195L18.0855 28.8053L18.0627 28.7689C18.0063 28.7455 17.9501 28.7617 17.8871 28.7704C17.9689 28.6003 18.1059 28.5654 18.161 28.3653Z" fill="url(#paint36_linear_1_2)"/>
<path d="M26.3914 15.0295C26.7492 15.0267 27.1962 15.0334 27.5492 15.009C27.9254 15.4865 28.3808 16.0173 28.7225 16.5109C28.7535 16.556 28.8907 16.7615 28.9235 16.7883C29.068 17.1826 29.1199 18.152 29.1297 18.6043C29.1239 18.7242 29.1336 18.9603 29.0647 19.0419L29.0202 19.0435C28.9839 19.0027 28.9776 18.9722 28.9593 18.9212C28.9408 18.4937 28.8801 17.3776 28.7851 16.9915C28.7407 16.8111 27.5169 15.2291 27.368 15.1997C27.0894 15.2262 26.4455 15.2133 26.1323 15.2088C25.605 15.2014 24.8676 15.2232 24.3529 15.1744L24.3028 15.1395C24.2206 15.134 24.2003 15.1372 24.1269 15.1053C24.2308 15.089 24.2826 15.1119 24.3668 15.0432C24.5472 14.9934 26.1109 15.0262 26.3914 15.0295Z" fill="#F7F8F9"/>
<path d="M24.3668 15.0432C24.5472 14.9934 26.1109 15.0262 26.3914 15.0295C26.1383 15.0703 25.8686 15.0506 25.6131 15.081C25.6251 15.0796 25.5172 15.1626 25.4869 15.1753C25.8718 15.1823 26.241 15.1938 26.627 15.188C26.7544 15.1862 27.2656 15.1802 27.368 15.1997C27.0894 15.2262 26.4455 15.2133 26.1323 15.2088C25.605 15.2014 24.8676 15.2232 24.3529 15.1744L24.3028 15.1395C24.2206 15.134 24.2003 15.1372 24.1269 15.1053C24.2308 15.089 24.2826 15.1119 24.3668 15.0432Z" fill="#ADBBD7"/>
<path d="M16.6271 10.9892C16.7206 10.9305 16.8315 10.8508 16.9218 10.7851C17.4972 10.3667 18.0639 10.0344 18.6978 9.71499C18.5523 9.8986 18.4083 10.0834 18.2658 10.2694C18.1476 10.581 17.979 10.7163 17.7222 10.9231C17.4381 11.1748 16.8336 11.7475 16.5168 11.9024L16.5139 11.8785C16.4768 11.8814 16.4966 11.883 16.4551 11.8702L16.4513 11.804C16.3926 11.8232 16.4235 11.8178 16.3507 11.8005C16.4477 11.5812 16.5891 11.2163 16.6271 10.9892Z" fill="#F7F8F9"/>
<path d="M17.7754 10.6757C17.8405 10.6672 17.8858 10.6486 17.9309 10.6757C17.8468 10.7922 17.8053 10.7612 17.7222 10.9231C17.4381 11.1748 16.8336 11.7475 16.5168 11.9024L16.5139 11.8785C16.4768 11.8814 16.4966 11.883 16.4551 11.8702L16.4513 11.804C16.667 11.567 17.4933 10.784 17.7754 10.6757Z" fill="#ADBBD7"/>
<path d="M18.2658 10.2694C18.1476 10.581 17.979 10.7163 17.7222 10.9231C17.8053 10.7612 17.8468 10.7922 17.9309 10.6757C17.8858 10.6486 17.8405 10.6672 17.7754 10.6757C17.9303 10.5783 18.1052 10.3948 18.2658 10.2694Z" fill="#8A8E91"/>
<path d="M27.3154 17.9595C27.4502 17.9205 27.6361 17.8712 27.7622 17.8189C28.2577 17.6133 28.2511 17.736 28.2948 18.2126C28.3319 18.5459 28.3368 18.8255 28.3645 19.1466C28.0555 19.1593 27.7463 19.1662 27.437 19.1672C27.431 19.1001 27.4234 19.0301 27.4202 18.963C27.4027 18.8736 27.4056 18.6733 27.4029 18.5728C27.3966 18.3402 27.3753 18.1829 27.3154 17.9595Z" fill="url(#paint37_linear_1_2)"/>
<path d="M27.3154 17.9595C27.4502 17.9205 27.6361 17.8712 27.7622 17.8189C28.2577 17.6133 28.2511 17.736 28.2948 18.2126C27.9845 18.258 27.7132 18.3255 27.4247 18.4463C27.4243 18.5978 27.4304 18.817 27.4202 18.963C27.4027 18.8736 27.4056 18.6733 27.4029 18.5728C27.3966 18.3402 27.3753 18.1829 27.3154 17.9595Z" fill="#232933"/>
<path d="M18.3508 33.6577C18.3426 33.4864 18.3227 32.6026 18.3922 32.5166C18.4658 32.5521 18.5245 32.7221 18.5593 32.8036C18.6578 32.9667 18.8868 33.2099 19.0475 33.3153C19.2468 33.461 19.5456 33.6399 19.5807 33.9047C19.5873 33.9554 19.5799 33.9413 19.6101 33.9839L19.63 33.964C19.6178 33.942 19.6117 33.9306 19.5974 33.9098C19.6166 33.8868 19.638 33.8653 19.6487 33.837L19.666 33.7267C19.6679 33.8019 19.6544 33.899 19.6889 33.9621L19.7574 33.9792C19.7256 34.0962 19.7999 34.1825 19.7245 34.3191C19.7263 34.3388 19.7301 34.395 19.734 34.4111L19.7161 34.4702C19.1771 34.2262 18.8284 33.9958 18.3508 33.6577Z" fill="#BEC7D9"/>
<path d="M19.0475 33.3153C19.2468 33.461 19.5456 33.6399 19.5807 33.9047C19.5873 33.9553 19.5799 33.9413 19.6101 33.9839L19.63 33.964C19.6178 33.942 19.6117 33.9306 19.5974 33.9098C19.6166 33.8868 19.638 33.8652 19.6487 33.837L19.666 33.7267C19.6679 33.8019 19.6544 33.899 19.6889 33.9621L19.7574 33.9792C19.7256 34.0962 19.7999 34.1825 19.7245 34.3191C19.6938 34.2938 19.6821 34.289 19.6476 34.2687C19.4253 34.1503 19.2081 34.0222 18.9968 33.8849C19.0818 33.7617 19.0509 33.4738 19.0475 33.3153Z" fill="#232933"/>
<path d="M19.6487 33.837L19.666 33.7267C19.6679 33.8019 19.6544 33.899 19.6889 33.9621L19.7574 33.9792C19.7256 34.0962 19.7999 34.1825 19.7245 34.3191C19.6938 34.2938 19.6821 34.289 19.6476 34.2687C19.6521 34.1234 19.6502 33.9824 19.6487 33.837Z" fill="#BEC7D9"/>
<path d="M18.5593 32.8036C18.6578 32.9667 18.8868 33.2099 19.0475 33.3153C19.0509 33.4738 19.0818 33.7617 18.9968 33.8849C18.8424 33.7815 18.7173 33.699 18.5731 33.5803C18.5709 33.3213 18.5663 33.0624 18.5593 32.8036Z" fill="#2F384C"/>
<path d="M21.6112 14.6175C21.6146 14.346 21.657 14.0677 21.944 13.9519C22.076 13.8998 22.2239 13.9058 22.3513 13.9682C22.8054 14.1853 22.7343 14.7647 22.2637 14.9027C22.0387 14.9688 21.9863 14.8694 21.8086 14.8054C21.6713 14.8141 21.5213 14.9596 21.4053 15.0506C21.0681 15.2263 20.3573 15.5711 19.9746 15.5018C20.1214 15.3663 20.2645 15.3311 20.4412 15.2643C20.7516 15.1468 21.6338 14.7988 21.7571 14.4953C21.7032 14.5114 21.6531 14.5742 21.6112 14.6175Z" fill="#F7F8F9"/>
<path d="M22.0819 14.1018C22.5078 14.1113 22.6026 14.5474 22.1716 14.7253C21.7338 14.7015 21.6833 14.2322 22.0819 14.1018Z" fill="#000101"/>
<path d="M22.0906 14.2714C22.1837 14.2437 22.2819 14.2942 22.3138 14.3859C22.3456 14.4775 22.2997 14.578 22.2096 14.614C22.1475 14.6389 22.0769 14.6275 22.0256 14.5846C21.9744 14.5417 21.9509 14.474 21.9645 14.4086C21.9781 14.3431 22.0265 14.2904 22.0906 14.2714Z" fill="#F7F8F9"/>
<path d="M24.3732 14.322C24.8387 14.301 25.3262 14.296 25.793 14.3019C26.4628 14.3105 27.1354 14.2823 27.8036 14.2847C28.1308 14.6453 28.4474 15.0155 28.7527 15.3949C28.9037 15.5792 29.1079 15.8162 29.2418 16.0047C29.1682 16.1086 29.0925 16.1006 28.9733 16.0821C28.9548 16.05 28.9377 16.0078 28.9222 15.9733C28.8035 15.772 28.6049 15.5363 28.454 15.35C28.2202 15.0609 27.9835 14.7743 27.7437 14.4901C26.73 14.4473 25.6357 14.5183 24.6087 14.4697C24.4843 14.447 24.4104 14.4544 24.3732 14.322Z" fill="#F7F8F9"/>
<path d="M25.7274 22.9388L25.6975 22.9299L25.6953 22.9045C25.7776 22.8024 26.315 22.2334 26.3955 22.1811C26.4596 22.181 26.5011 22.2172 26.5575 22.2522C26.6288 22.2901 26.6796 22.3195 26.7474 22.3633L27.1803 22.6253C27.0757 22.7364 26.9802 22.8585 26.8841 22.9773C26.7313 23.1516 26.575 23.3227 26.4151 23.4904C26.1558 23.3022 25.967 23.1581 25.7274 22.9388Z" fill="url(#paint38_linear_1_2)"/>
<path d="M25.7274 22.9388L25.6975 22.9299L25.6953 22.9045C25.7776 22.8024 26.315 22.2334 26.3955 22.1811C26.4596 22.181 26.5011 22.2172 26.5575 22.2522C26.6288 22.2901 26.6796 22.3195 26.7474 22.3633C26.6772 22.502 26.5401 22.6788 26.4164 22.7716C26.301 22.81 26.1144 22.8803 25.9964 22.879C25.902 22.9637 25.9207 22.9682 25.7947 22.9215L25.7274 22.9388Z" fill="#F7F8F9"/>
<path d="M26.5575 22.2522C26.6288 22.2901 26.6796 22.3195 26.7474 22.3633C26.6772 22.502 26.5401 22.6788 26.4164 22.7716C26.301 22.81 26.1144 22.8803 25.9964 22.879C26.1771 22.6929 26.4094 22.4603 26.5575 22.2522Z" fill="#828FA9"/>
<path d="M26.7474 22.3633L27.1803 22.6253C27.0757 22.7364 26.9802 22.8585 26.8841 22.9773C26.8242 22.95 26.7077 22.9329 26.6388 22.9198C26.6225 22.9268 26.6063 22.9336 26.59 22.9403C26.5177 22.9699 26.4857 22.9917 26.4217 22.9648C26.3922 22.899 26.4078 22.8451 26.4164 22.7715C26.5401 22.6788 26.6772 22.502 26.7474 22.3633Z" fill="url(#paint39_linear_1_2)"/>
<path d="M25.2448 23.3009C25.3379 23.3516 25.4215 23.4014 25.5119 23.4561C25.571 23.4992 25.6387 23.5459 25.6932 23.5934C25.8046 23.674 25.8971 23.7436 26.0029 23.8308C25.8876 23.9115 25.1523 24.4871 25.0704 24.5722C24.9608 24.4427 24.8584 24.3457 24.7372 24.2288L24.6534 24.1486C24.5835 24.0983 24.4664 23.9904 24.3974 23.9303C24.7591 23.7079 24.9254 23.5754 25.2448 23.3009Z" fill="url(#paint40_linear_1_2)"/>
<path d="M25.2448 23.3009C25.3379 23.3516 25.4215 23.4014 25.5119 23.4561C25.2811 23.6483 24.8495 23.9519 24.6534 24.1486C24.5835 24.0983 24.4664 23.9904 24.3974 23.9303C24.7591 23.7079 24.9254 23.5754 25.2448 23.3009Z" fill="#F7F8F9"/>
<path d="M25.5119 23.4561C25.571 23.4992 25.6387 23.5459 25.6932 23.5934C25.6256 23.6562 25.5528 23.6767 25.4885 23.7264C25.3238 23.8535 24.8679 24.1093 24.7372 24.2288L24.6534 24.1486C24.8495 23.9519 25.2811 23.6483 25.5119 23.4561Z" fill="url(#paint41_linear_1_2)"/>
<path d="M30.6007 18.8488C30.7636 18.8667 30.9192 18.88 31.0789 18.9191L31.0799 19.1502C31.0817 19.7192 31.0317 20.5159 30.8817 21.0613C30.7616 20.9944 30.5974 20.8932 30.4798 20.8364C30.5201 20.2984 30.5868 19.8185 30.611 19.2688C30.6129 19.1155 30.6142 19.0006 30.6007 18.8488Z" fill="url(#paint42_linear_1_2)"/>
<path d="M30.6007 18.8488C30.7636 18.8667 30.9192 18.88 31.0789 18.9191L31.0799 19.1502C30.9012 19.1711 30.8345 19.2625 30.611 19.2688C30.6129 19.1155 30.6142 19.0006 30.6007 18.8488Z" fill="#404C5E"/>
<path d="M27.6145 6.31547C27.8169 6.30491 28.0608 6.3098 28.2665 6.30928C28.0576 6.49502 26.9087 7.57082 26.8164 7.73943C26.662 7.74152 26.3607 7.73431 26.2219 7.75849C26.2226 7.74855 26.2229 7.73857 26.2241 7.72867C26.2555 7.46972 27.3436 6.52874 27.6145 6.31547Z" fill="url(#paint43_linear_1_2)"/>
<path d="M17.0943 27.2872C17.1873 27.3162 17.2626 27.3958 17.3527 27.435C17.5791 27.5336 19.4021 27.4926 19.7194 27.4486C19.9277 27.4196 20.1124 27.3574 20.3041 27.2731C20.3395 27.365 20.407 27.4939 20.4522 27.5861C20.2445 27.5801 19.9623 27.6166 19.75 27.6302C19.5358 27.6439 19.3368 27.6506 19.1218 27.656C18.7403 27.6647 18.3561 27.6609 17.975 27.6685C17.62 27.6756 17.4611 27.6689 17.1346 27.5257C16.9544 27.6567 16.5821 28.0443 16.4167 28.2107C16.3426 28.2038 16.2914 28.209 16.2416 28.1691C16.2749 27.9844 16.9149 27.4156 17.0943 27.2872Z" fill="#ADBBD7"/>
<path d="M17.7067 33.809L17.7545 33.7904C17.8181 33.8275 17.8612 33.8888 17.9091 33.9459C18.2583 34.2666 18.6459 34.5427 19.0631 34.7679C19.2203 34.8534 19.5086 34.9816 19.6354 35.0822C19.8461 35.2493 20.1791 35.6987 20.3084 35.9346C19.8679 35.583 19.7796 35.2232 19.226 35.0168C19.0023 35.0435 18.2974 34.489 18.088 34.3977C18.0364 34.4008 17.9939 34.449 17.9473 34.4599C17.8093 34.4922 17.6171 34.4606 17.4873 34.4812C17.6174 34.6559 17.8347 34.6886 17.9916 34.8348C18.0152 34.8568 18.0417 34.8753 18.0676 34.8947C17.8887 34.7948 17.3793 34.4989 17.2696 34.3446C17.2279 34.3178 17.1928 34.2918 17.1531 34.2625L17.1494 34.2358C17.3124 34.0778 17.5371 33.9651 17.7067 33.809Z" fill="#2F384C"/>
<path d="M17.9091 33.9459C18.2583 34.2665 18.6459 34.5427 19.0631 34.7679C19.2203 34.8534 19.5086 34.9816 19.6354 35.0822C19.8461 35.2493 20.1791 35.6987 20.3084 35.9346C19.8679 35.583 19.7796 35.2232 19.226 35.0168C18.7039 34.7559 18.3251 34.5399 17.8825 34.1512C17.8739 34.0853 17.895 34.0126 17.9091 33.9459Z" fill="url(#paint44_linear_1_2)"/>
<path d="M17.7067 33.809L17.7545 33.7904C17.8181 33.8275 17.8612 33.8888 17.9091 33.9459C17.895 34.0126 17.8739 34.0853 17.8825 34.1512C17.8235 34.1099 17.7803 34.0828 17.7179 34.0469C17.5693 34.1474 17.4199 34.2467 17.2696 34.3446C17.2279 34.3178 17.1928 34.2918 17.1531 34.2625L17.1494 34.2358C17.3124 34.0778 17.5371 33.9651 17.7067 33.809Z" fill="#BEC7D9"/>
<path d="M17.7067 33.809L17.7545 33.7904C17.8181 33.8275 17.8612 33.8888 17.9091 33.9459C17.895 34.0126 17.8739 34.0853 17.8825 34.1512C17.8235 34.1099 17.7803 34.0828 17.7179 34.0469C17.8686 33.9825 17.7663 33.8765 17.7067 33.809Z" fill="#ADBBD7"/>
<path d="M27.1136 20.9225L27.331 21.015C27.4499 21.0512 27.9099 21.1646 27.9651 21.2375L27.948 21.2611L27.9428 21.2751C27.8935 21.3995 27.7397 21.7508 27.6724 21.863C27.6627 21.9388 27.5984 22.0288 27.5532 22.0923C27.4538 22.0409 27.356 21.9892 27.2541 21.943C27.1538 21.9001 27.0679 21.8633 26.9646 21.8274C26.905 21.8057 26.9068 21.8062 26.8434 21.8023C26.77 21.7807 26.7758 21.7951 26.7378 21.7462C26.8007 21.5582 27.0212 21.1409 27.1136 20.9225Z" fill="#828FA9"/>
<path d="M26.9646 21.8274C27.3928 21.6989 27.2505 21.4744 27.5273 21.2576C27.66 21.2692 27.8124 21.261 27.948 21.2611L27.9428 21.2751C27.8935 21.3995 27.7397 21.7508 27.6724 21.863C27.6627 21.9388 27.5984 22.0288 27.5532 22.0923C27.4538 22.0409 27.356 21.9892 27.2541 21.943C27.1538 21.9001 27.0679 21.8633 26.9646 21.8274Z" fill="#58617D"/>
<path d="M27.5123 21.9053C27.6174 21.7002 27.6891 21.3012 27.9428 21.2751C27.8935 21.3995 27.7397 21.7508 27.6724 21.863C27.6287 21.8788 27.6396 21.8741 27.6105 21.9033C27.5686 21.9073 27.5388 21.9007 27.5123 21.9053Z" fill="#404C5E"/>
<path d="M27.5123 21.9053C27.5388 21.9007 27.5686 21.9073 27.6105 21.9033C27.6396 21.8741 27.6287 21.8788 27.6724 21.863C27.6627 21.9388 27.5984 22.0288 27.5532 22.0923C27.4538 22.0409 27.356 21.9892 27.2541 21.943C27.3789 21.8987 27.4481 21.9379 27.5123 21.9053Z" fill="#232933"/>
<path d="M27.1136 20.9225L27.331 21.015C27.2576 21.1475 26.9403 21.7418 26.8434 21.8023C26.77 21.7807 26.7758 21.7951 26.7378 21.7462C26.8007 21.5582 27.0212 21.1409 27.1136 20.9225Z" fill="#F7F8F9"/>
<path d="M18.2807 11.0602C18.4306 11.0236 18.589 11.0595 18.7084 11.1572C18.8279 11.2549 18.8946 11.4029 18.8885 11.5571C18.8799 11.7775 18.7255 11.9651 18.5109 12.0161C18.2473 12.0787 17.9828 11.9162 17.9194 11.6528C17.8559 11.3895 18.0175 11.1244 18.2807 11.0602Z" fill="#F7F8F9"/>
<path d="M18.3413 11.2248C18.7332 11.204 18.8124 11.6558 18.4562 11.8447C18.0455 11.867 17.9715 11.427 18.3413 11.2248Z" fill="#000101"/>
<path d="M18.3837 11.3802C18.4752 11.3756 18.5538 11.4442 18.5616 11.5354C18.5696 11.6266 18.504 11.7077 18.4132 11.719C18.3514 11.7268 18.2902 11.7 18.2539 11.6494C18.2175 11.5988 18.2118 11.5324 18.2388 11.4762C18.2659 11.4201 18.3215 11.3832 18.3837 11.3802Z" fill="#F7F8F9"/>
<path d="M26.8158 16.4902C26.751 16.4925 26.7221 16.4998 26.6648 16.4693C26.6169 16.4074 26.6238 16.4397 26.6305 16.3725C26.7464 16.2436 27.2271 16.1927 27.4044 16.1942C27.4429 16.1945 27.4538 16.2234 27.4711 16.2502C27.4832 16.2868 27.4802 16.2957 27.503 16.3211C27.5734 16.3792 27.5829 16.4003 27.6353 16.4778L27.9033 16.8884C27.6784 16.9355 27.4715 17.0138 27.2569 17.095C27.1181 17.1562 27.0265 17.2379 26.9348 17.0934C26.9335 17.058 26.9009 16.9742 26.8876 16.9355L26.8467 16.8281L26.8091 16.7368L26.7871 16.6903L26.7656 16.6259C26.8053 16.5872 26.844 16.5607 26.8537 16.5088L26.8158 16.4902Z" fill="url(#paint45_linear_1_2)"/>
<path d="M26.8158 16.4902C26.751 16.4925 26.7221 16.4998 26.6648 16.4693C26.6169 16.4074 26.6238 16.4397 26.6305 16.3725C26.7464 16.2436 27.2271 16.1927 27.4044 16.1942C27.4429 16.1945 27.4538 16.2234 27.4711 16.2502C27.4832 16.2868 27.4802 16.2957 27.503 16.3211C27.5734 16.3792 27.5829 16.4003 27.6353 16.4778C27.4336 16.5595 26.8836 16.6381 26.7871 16.6903L26.7656 16.6259C26.8053 16.5872 26.844 16.5607 26.8537 16.5088L26.8158 16.4902Z" fill="#232933"/>
<path d="M26.8158 16.4902C26.751 16.4925 26.7221 16.4998 26.6648 16.4693C26.6169 16.4074 26.6238 16.4397 26.6305 16.3725C26.7464 16.2436 27.2271 16.1927 27.4044 16.1942C27.4429 16.1945 27.4538 16.2234 27.4711 16.2502C27.176 16.4385 26.991 16.3997 26.8158 16.4902Z" fill="#1C1D1D"/>
<path d="M26.8158 16.4902C26.991 16.3997 27.176 16.4385 27.4711 16.2502C27.4832 16.2868 27.4802 16.2957 27.503 16.3211C27.295 16.4503 26.9951 16.5283 26.7656 16.6259C26.8053 16.5872 26.844 16.5607 26.8537 16.5088L26.8158 16.4902Z" fill="#000101"/>
<path d="M26.8876 16.9355C26.951 16.8132 27.235 16.8766 27.3085 16.9601C27.2642 16.9773 27.2823 16.9722 27.2294 16.9648C27.2367 16.997 27.2296 16.9815 27.2529 17.0102L27.215 17.0336L27.2569 17.095C27.1181 17.1562 27.0265 17.2379 26.9349 17.0934C26.9335 17.058 26.9009 16.9742 26.8876 16.9355Z" fill="#58617D"/>
<path d="M26.9349 17.0934C26.9448 17.0783 26.9622 17.0597 26.9744 17.0454C27.0697 17.0163 27.1162 17.0266 27.215 17.0336L27.2569 17.095C27.1181 17.1562 27.0265 17.2379 26.9349 17.0934Z" fill="#828FA9"/>
<path d="M26.8091 16.7368C26.8963 16.7045 26.9879 16.7082 27.0743 16.742L27.0802 16.7679C27.0144 16.8103 26.9266 16.8159 26.8467 16.8281L26.8091 16.7368Z" fill="#404C5E"/>
<path d="M27.4102 19.6918C27.6848 19.6968 28.0017 19.6877 28.2683 19.7029C28.2376 19.9623 28.2219 20.3077 28.1972 20.5787L27.6018 20.4952L27.2697 20.4638C27.2973 20.344 27.323 20.2238 27.3468 20.1032C27.3667 19.9784 27.3976 19.8142 27.4102 19.6918Z" fill="url(#paint46_linear_1_2)"/>
<path d="M27.2697 20.4638C27.2973 20.344 27.323 20.2238 27.3468 20.1032C27.3529 20.1907 27.3439 20.2364 27.4174 20.2946C27.5015 20.361 27.5559 20.4127 27.6658 20.3482C27.683 20.299 27.6805 20.2734 27.7147 20.2544L27.729 20.279C27.7057 20.3588 27.6543 20.4304 27.6018 20.4952L27.2697 20.4638Z" fill="#64768C"/>
<path d="M30.0698 16.2401C30.2553 16.2361 30.6031 16.1823 30.7709 16.2386C30.7946 16.2465 30.8044 16.3068 30.8141 16.339C30.8436 16.4777 30.8742 16.6161 30.906 16.7543C30.9344 16.8927 30.9718 17.1482 31.0398 17.2599C30.77 17.2501 30.5002 17.2375 30.2306 17.2221C30.2158 17.0727 30.1597 16.8607 30.207 16.7242C30.2065 16.665 30.1656 16.4577 30.153 16.3874C30.1349 16.3386 30.0978 16.2852 30.0698 16.2401Z" fill="#232933"/>
<path d="M30.0698 16.2401C30.2553 16.2361 30.6031 16.1823 30.7709 16.2386C30.7946 16.2465 30.8044 16.3068 30.8141 16.339C30.8436 16.4777 30.8742 16.6161 30.906 16.7543C30.681 16.733 30.4364 16.7371 30.207 16.7242C30.2065 16.665 30.1656 16.4577 30.153 16.3874C30.1349 16.3386 30.0978 16.2852 30.0698 16.2401Z" fill="#BEC7D9"/>
<path d="M30.0698 16.2401C30.2553 16.2361 30.6031 16.1823 30.7709 16.2386C30.7946 16.2465 30.8044 16.3068 30.8141 16.339C30.6965 16.4328 30.431 16.4014 30.2786 16.4075C30.2555 16.4084 30.1807 16.3926 30.153 16.3874C30.1349 16.3386 30.0978 16.2852 30.0698 16.2401Z" fill="#F7F8F9"/>
<path d="M36.5873 12.7289C36.6819 12.7243 36.7638 12.7145 36.8578 12.7465C37.1228 12.8365 37.2698 13.1472 37.1652 13.4085C37.1038 13.5619 37.0016 13.6237 36.8515 13.6845C36.2389 13.7738 36.0138 12.9995 36.5873 12.7289Z" fill="#F7F8F9"/>
<path d="M20.6865 28.2686C20.8062 28.1936 20.8891 28.1142 21.0208 28.1391C21.0861 28.1736 21.1105 28.2411 21.1424 28.3101C21.2106 28.417 21.3048 28.5634 21.3512 28.678L21.3423 28.7102L21.3116 28.7063C21.0117 28.8023 20.483 28.8861 20.1753 28.8876C20.0367 28.7522 19.9359 28.62 19.8159 28.4692C19.9038 28.4443 20.166 28.3611 20.2359 28.3734C20.3853 28.3357 20.5348 28.2959 20.6865 28.2686Z" fill="#232933"/>
<path d="M20.6865 28.2686C20.8062 28.1936 20.8891 28.1142 21.0208 28.1391C21.0861 28.1736 21.1105 28.2411 21.1424 28.3101L21.055 28.347C21.0344 28.3003 21.0365 28.3033 20.9952 28.2733C20.8929 28.2594 20.8272 28.2887 20.7265 28.3182L20.6865 28.2686Z" fill="#BEC7D9"/>
<path d="M21.1424 28.3101C21.2106 28.417 21.3048 28.5634 21.3512 28.678L21.3423 28.7102L21.3116 28.7063C21.2054 28.6023 21.1326 28.4732 21.055 28.347L21.1424 28.3101Z" fill="#828FA9"/>
<path d="M20.2359 28.3734C20.3853 28.3357 20.5348 28.2959 20.6865 28.2686L20.7265 28.3182C20.5955 28.3653 20.3647 28.4352 20.2359 28.3734Z" fill="#64768C"/>
<path d="M28.6351 14.0885C28.8585 14.0075 29.1743 13.8566 29.3942 13.7583C29.5624 13.8634 29.6667 13.9436 29.7718 14.1146C29.8372 14.1954 29.9012 14.2771 29.964 14.36L29.9875 14.4045C29.932 14.4727 29.3962 14.6076 29.299 14.6198C29.0674 14.6789 29.0491 14.6229 28.909 14.4553L28.6351 14.0885Z" fill="#2F384C"/>
<path d="M28.909 14.4553C28.9915 14.3931 29.5581 14.2374 29.7718 14.1146C29.8372 14.1954 29.9012 14.2771 29.964 14.36L29.9875 14.4045C29.932 14.4727 29.3962 14.6076 29.299 14.6198C29.0674 14.6789 29.0491 14.6229 28.909 14.4553Z" fill="url(#paint47_linear_1_2)"/>
<path d="M29.299 14.6198C29.2237 14.6174 29.1272 14.6218 29.0724 14.5687L29.0894 14.5377C29.2144 14.4673 29.6646 14.3472 29.8263 14.342C29.8111 14.3425 29.9633 14.3599 29.964 14.36L29.9875 14.4045C29.932 14.4727 29.3962 14.6076 29.299 14.6198Z" fill="#BEC7D9"/>
<path d="M16.1113 14.2093C16.2534 14.2394 16.1767 14.8581 16.0802 14.983C15.8463 15.2857 15.5534 15.2991 15.2173 15.3668L15.1926 15.3733L15.169 15.3562C15.4451 14.4365 15.3557 14.7316 16.1113 14.2093Z" fill="#F7F8F9"/>
<path d="M15.5648 34.0276L15.5569 33.9882C15.6218 33.9144 15.958 33.763 16.0508 33.8202C16.1685 34.0817 16.8147 34.7405 16.8314 34.8772C16.7777 34.9778 16.6544 35.048 16.5583 35.1117C16.3501 34.9133 15.7041 34.2527 15.5648 34.0276Z" fill="#000101"/>
<path d="M15.5648 34.0276L15.5569 33.9882C15.6218 33.9144 15.958 33.763 16.0508 33.8202C16.0014 33.9263 15.6778 34.0138 15.5648 34.0276Z" fill="#58617D"/>
<path d="M27.24 25.9123C27.3146 25.9063 27.3509 25.8738 27.406 25.8251L27.419 25.8134C27.4847 25.8196 27.4665 25.822 27.5259 25.8893C26.4962 26.6907 25.302 27.4101 24.0703 27.842C23.8494 27.9194 23.5641 28.045 23.3334 28.0561L23.3218 28.0384C23.4805 27.8912 23.9304 27.772 24.1542 27.6879C24.365 27.6101 24.5725 27.5237 24.7763 27.4289C25.8084 26.9443 26.3322 26.5562 27.24 25.9123Z" fill="url(#paint48_linear_1_2)"/>
<path d="M31.2358 9.29476C31.4606 9.28274 31.652 9.45619 31.6621 9.681C31.6723 9.9058 31.4973 10.0958 31.2724 10.1041C31.0501 10.1123 30.8629 9.93972 30.8528 9.71751C30.8428 9.49537 31.0138 9.30664 31.2358 9.29476Z" fill="#F7F8F9"/>
<path d="M30.0344 22.8836C29.9527 23.1922 28.6124 25.133 28.3785 25.0745L28.3624 25.0245C28.3987 24.9067 28.5432 24.7465 28.627 24.6486C29.2144 23.9627 29.5689 23.4001 29.9874 22.6128C29.9675 22.7441 29.9772 22.7631 30.0344 22.8836Z" fill="url(#paint49_linear_1_2)"/>
<path d="M22.7138 7.75402C22.8464 7.69569 24.4519 6.16215 24.6261 5.97476C24.6845 6.014 24.7543 6.05803 24.809 6.10058C24.6195 6.25263 24.4067 6.4618 24.2266 6.62849L23.4311 7.35121C23.2539 7.51146 23.008 7.78129 22.7845 7.84116L22.7568 7.82401L22.7665 7.78944L22.7138 7.75402Z" fill="#BEC7D9"/>
<path d="M18.9778 15.028C19.4626 15.0118 19.5603 15.6336 19.1276 15.7456C18.7784 15.7506 18.6917 15.5891 18.6912 15.2668C18.7729 15.1195 18.8154 15.0728 18.9778 15.028Z" fill="#F7F8F9"/>
<path d="M18.9733 15.1345C19.0946 15.0924 19.2273 15.1552 19.2718 15.2758C19.3162 15.3963 19.256 15.5302 19.1364 15.5769C19.0569 15.608 18.9669 15.5937 18.9009 15.5396C18.8349 15.4854 18.8034 15.3998 18.8184 15.3158C18.8334 15.2318 18.8927 15.1625 18.9733 15.1345Z" fill="#312F2E"/>
<path d="M18.982 15.2114C19.0355 15.1859 19.0984 15.1912 19.1469 15.2252C19.1952 15.2591 19.2217 15.3166 19.2159 15.3754C19.2102 15.4343 19.1732 15.4855 19.1191 15.5095C19.0371 15.5458 18.941 15.5095 18.9036 15.4281C18.8661 15.3466 18.901 15.25 18.982 15.2114Z" fill="#C1C0C1"/>
<path d="M30.4344 17.7002L30.4591 17.7075C30.7045 17.778 31.0063 17.7158 31.0523 18.0003C31.0509 18.1302 31.0732 18.3727 31.0771 18.5178C30.9223 18.4744 30.736 18.4476 30.5757 18.4336C30.5754 18.2503 30.5724 18.1532 30.5496 17.9703C30.5102 17.8647 30.4864 17.8008 30.4344 17.7002Z" fill="#828FA9"/>
<path d="M30.4344 17.7002L30.4591 17.7075C30.7045 17.778 31.0063 17.7158 31.0523 18.0003C31.0086 18.0211 30.6528 17.9749 30.5496 17.9703C30.5102 17.8647 30.4864 17.8008 30.4344 17.7002Z" fill="#F7F8F9"/>
<path d="M16.8433 29.9512L16.8591 29.9836C16.8391 30.0177 16.8372 30.0206 16.8211 30.0578C16.8643 30.1 16.839 30.0878 16.9 30.0943C16.9351 30.054 16.9521 30.0272 16.9822 29.9837L17.0034 29.9807C17.023 29.9455 17.0185 29.9535 17.0459 29.9234L17.0804 29.9329C16.7815 30.337 16.8578 30.619 16.8476 31.0957C16.8383 31.5269 16.8565 31.9633 16.8458 32.3941L16.8194 32.387C16.7823 32.3009 16.8335 32.2558 16.8031 32.1619L16.7601 32.2072C16.7554 32.2452 16.7511 32.2741 16.7438 32.3117L16.7164 32.1507C16.7136 31.4789 16.7151 30.8071 16.7209 30.1353C16.7571 30.0718 16.8015 30.0113 16.8433 29.9512Z" fill="url(#paint50_linear_1_2)"/>
<path d="M20.54 14.2734C20.5558 13.8557 20.7485 13.7401 21.0391 13.4491C21.4156 13.0721 21.8277 13.0742 22.3257 13.0974C22.4382 13.1026 22.5395 13.1125 22.6337 13.1825L22.6523 13.2195C22.6018 13.2464 22.4771 13.2197 22.417 13.2161C21.836 13.1818 21.4107 13.2099 20.9955 13.6609C20.7205 13.9596 20.6806 13.9767 20.6219 14.3972L20.6001 14.3951C20.5509 14.3605 20.5619 14.3474 20.54 14.2734Z" fill="#828FA9"/>
<path d="M17.8871 28.7704C17.9501 28.7617 18.0063 28.7455 18.0627 28.7689L18.0855 28.8053C17.8292 29.0689 17.5856 29.3856 17.3341 29.6573C17.2764 29.7198 17.1337 29.8954 17.0804 29.9329L17.0459 29.9234C17.0185 29.9535 17.023 29.9455 17.0034 29.9807L16.9822 29.9837C16.9521 30.0273 16.9351 30.054 16.9 30.0943C16.839 30.0878 16.8643 30.1 16.8211 30.0578C16.8372 30.0206 16.8391 30.0177 16.8591 29.9836L16.8433 29.9512C16.937 29.773 17.7173 28.9356 17.8871 28.7704Z" fill="#828FA9"/>
<path d="M29.7415 15.5947C29.7189 15.56 29.7106 15.5435 29.6916 15.5069L29.7057 15.4814C29.8523 15.4309 30.2349 15.3673 30.4045 15.3356C30.4258 15.4028 30.4506 15.4571 30.4786 15.5219C30.5172 15.6134 30.5589 15.7086 30.5955 15.8006C30.3761 15.7917 30.1041 15.8052 29.8799 15.8114L29.7415 15.5947Z" fill="#828FA9"/>
<path d="M29.7415 15.5947C29.7189 15.56 29.7106 15.5435 29.6916 15.5069L29.7057 15.4814C29.8523 15.4309 30.2349 15.3673 30.4045 15.3356C30.4258 15.4028 30.4506 15.4571 30.4786 15.5219C30.4693 15.5547 30.4683 15.5885 30.4451 15.5943C30.2506 15.6425 29.9406 15.5888 29.7415 15.5947Z" fill="#ADBBD7"/>
<path d="M17.3944 30.6511C17.3908 30.5986 17.3957 30.5449 17.4311 30.5031C17.7843 30.0871 18.1177 29.6506 18.4871 29.249C18.5331 29.1988 18.5572 29.18 18.6211 29.1684L18.6559 29.1927L18.6615 29.2328C18.4934 29.5627 17.7744 30.2705 17.5287 30.6021L17.5072 30.6315L17.3944 30.6511Z" fill="#58617D"/>
<path d="M17.3944 30.6511L17.5072 30.6315C17.5528 30.7659 17.5381 32.2077 17.5166 32.4225C17.5177 32.5521 17.5338 32.864 17.4681 32.9654C17.4105 32.9201 17.4196 32.6372 17.4183 32.5494C17.3903 32.3867 17.4073 32.1636 17.402 31.9962C17.3889 31.5907 17.4316 31.0463 17.3944 30.6511Z" fill="url(#paint51_linear_1_2)"/>
<path d="M17.4183 32.5494C17.421 32.4842 17.4196 32.328 17.4625 32.2853C17.502 32.3191 17.5045 32.3686 17.5166 32.4225C17.5177 32.5521 17.5338 32.864 17.4681 32.9654C17.4105 32.9201 17.4196 32.6372 17.4183 32.5494Z" fill="#232933"/>
<path d="M24.5288 11.587C24.6059 11.5984 24.6618 11.6506 24.7275 11.6978C24.4332 12.052 24.405 11.9098 24.0803 12.1468C23.8902 12.2858 23.6983 12.6177 23.5124 12.7805C23.4205 12.7827 23.3431 12.8064 23.3072 12.7136C23.3988 12.567 23.773 12.3144 23.9173 12.1759C24.1197 11.9818 24.3267 11.7812 24.5288 11.587Z" fill="url(#paint52_linear_1_2)"/>
<path d="M15.3408 29.9185C15.3454 29.8292 15.3413 29.7842 15.3777 29.7012L15.4111 29.6766C15.4875 29.727 15.4689 29.8301 15.4682 29.9161C15.483 30.3888 15.4542 30.9548 15.4547 31.444L15.4468 31.4695C15.3917 31.6514 15.428 31.7672 15.3967 31.8781C15.3857 31.8006 15.3666 31.5832 15.3431 31.5317C15.3327 31.2124 15.3002 30.2068 15.3408 29.9185Z" fill="#828FA9"/>
<path d="M15.3408 29.9185C15.3454 29.8292 15.3413 29.7842 15.3777 29.7012L15.4111 29.6766C15.4875 29.727 15.4689 29.8301 15.4682 29.9161C15.4478 29.9863 15.4422 30.2571 15.4387 30.3414C15.4386 30.2719 15.4479 30.039 15.4183 29.995L15.3978 30.0036C15.3648 30.1426 15.3671 30.2461 15.3634 30.3886C15.3451 30.2585 15.3474 30.0593 15.3408 29.9185Z" fill="#ADBBD7"/>
<path d="M9.41848 14.5146C9.56826 14.4757 9.72145 14.565 9.76123 14.7146C9.80101 14.8642 9.71246 15.0178 9.56314 15.0584C9.41262 15.0993 9.25758 15.0099 9.2175 14.8592C9.17742 14.7085 9.2676 14.554 9.41848 14.5146Z" fill="#F7F8F9"/>
<path d="M23.0783 34.7598C23.4562 35.0754 23.8238 35.3985 24.2069 35.716L24.2374 35.7762L24.2086 35.8219C23.9297 35.6532 23.7225 35.4594 23.4197 35.287C23.347 35.2064 23.334 35.1942 23.2421 35.137C23.0781 34.9905 22.963 34.8888 22.74 34.8454C22.827 34.8515 23.0244 34.829 23.0783 34.7598Z" fill="#828FA9"/>
<path d="M16.7164 32.1507L16.7438 32.3117C16.7511 32.2741 16.7554 32.2452 16.7601 32.2072L16.8031 32.1619C16.8335 32.2558 16.7823 32.3009 16.8194 32.387L16.8458 32.3941C16.8673 32.558 16.9086 33.6283 16.7771 33.6982C16.6778 33.5794 16.713 32.3819 16.7164 32.1507Z" fill="#58617D"/>
<path d="M21.7188 35.7201C21.7815 35.7172 21.9856 35.7228 22.0393 35.7332C22.3102 35.7856 23.1704 35.7394 23.3416 35.9372C23.0114 35.9522 22.0792 35.9066 21.7485 35.791C21.7233 35.7822 21.7262 35.7549 21.7188 35.7201Z" fill="#232933"/>
<path d="M22.5165 8.09949C22.5671 8.06858 22.6174 8.04559 22.6705 8.01979C22.6875 8.30154 22.0948 8.66694 21.8961 8.87966C21.8607 8.87862 21.8017 8.86296 21.7649 8.85487C21.8679 8.76343 21.9053 8.75861 21.9065 8.61321C22.1061 8.46722 22.3368 8.26757 22.5165 8.09949Z" fill="#BEC7D9"/>
<path d="M29.8558 17.8359C29.9803 17.7975 30.1122 17.8675 30.1504 17.992C30.1885 18.1166 30.1182 18.2484 29.9936 18.2863C29.8693 18.3241 29.7379 18.2542 29.6999 18.1299C29.6619 18.0057 29.7316 17.8741 29.8558 17.8359Z" fill="#F7F8F9"/>
<path d="M16.0475 30.9598C16.0631 31.0343 16.0667 31.0637 16.0974 31.1321L16.1248 31.1413C16.1846 31.0539 16.1652 30.7828 16.1918 30.6584C16.1933 31.0041 16.2027 32.1395 16.1126 32.4152C16.0273 32.05 16.0336 31.3543 16.0475 30.9598Z" fill="#828FA9"/>
<path d="M29.565 16.3109C29.6792 16.2929 29.7869 16.3697 29.807 16.4836C29.8272 16.5975 29.7526 16.7066 29.6391 16.729C29.5637 16.7439 29.4861 16.7169 29.4363 16.6584C29.3864 16.5999 29.3721 16.519 29.3988 16.4469C29.4256 16.3749 29.4891 16.3228 29.565 16.3109Z" fill="#F7F8F9"/>
<path d="M21.0794 35.4266C21.1522 35.4023 21.2325 35.4198 21.2886 35.4721C21.3447 35.5245 21.3677 35.6033 21.3485 35.6776C21.3293 35.752 21.271 35.8098 21.1966 35.8284C21.0874 35.8557 20.9762 35.7919 20.9447 35.6839C20.9132 35.5758 20.9727 35.4623 21.0794 35.4266Z" fill="#F7F8F9"/>
<path d="M21.1698 26.8286C21.2803 26.8167 21.3807 26.8934 21.3982 27.0031C21.4157 27.1128 21.3442 27.217 21.2355 27.24C21.1602 27.2559 21.0822 27.2291 21.0326 27.1701C20.9831 27.1111 20.9701 27.0297 20.9988 26.9582C21.0275 26.8868 21.0932 26.837 21.1698 26.8286Z" fill="#F7F8F9"/>
<path d="M27.24 25.9123C27.4362 25.7594 28.0791 25.2003 28.2508 25.1531L28.261 25.1745C28.1941 25.2971 27.6578 25.7729 27.5259 25.8893C27.4665 25.822 27.4847 25.8196 27.419 25.8134L27.406 25.8251C27.3509 25.8738 27.3146 25.9063 27.24 25.9123Z" fill="#232933"/>
<path d="M24.6261 5.97476C24.7171 5.82074 24.8179 5.6258 25.0291 5.66012C25.2519 5.81216 24.9476 6.0279 24.809 6.10058C24.7543 6.05803 24.6845 6.014 24.6261 5.97476Z" fill="#F7F8F9"/>
<path d="M24.6087 14.4697C24.3911 14.4664 23.9222 14.5325 23.7068 14.4568C23.687 14.4499 23.6907 14.4317 23.6873 14.4078C23.736 14.2654 23.8914 14.2999 24.0118 14.2997C24.129 14.2996 24.2582 14.3014 24.3732 14.322C24.4104 14.4544 24.4843 14.447 24.6087 14.4697Z" fill="#404C5E"/>
<path d="M29.9874 22.6128C30.0422 22.4796 30.151 22.152 30.2607 22.0989C30.3227 22.108 30.2934 22.0973 30.3478 22.1408C30.3793 22.2499 30.1011 22.7514 30.0344 22.8836C29.9772 22.7631 29.9675 22.7441 29.9874 22.6128Z" fill="url(#paint53_linear_1_2)"/>
<path d="M15.4206 28.3465C15.6961 28.4045 15.6941 28.625 15.4557 28.745C15.1559 28.73 15.1789 28.4753 15.4206 28.3465Z" fill="#F7F8F9"/>
<path d="M15.4547 31.444C15.4686 31.7954 15.4679 32.5836 15.4082 32.9348C15.3631 32.6235 15.3171 31.8455 15.3431 31.5317C15.3666 31.5832 15.3857 31.8006 15.3967 31.8781C15.428 31.7672 15.3917 31.6514 15.4468 31.4695L15.4547 31.444Z" fill="#404C5E"/>
<path d="M14.8994 29.2769C14.9629 29.286 15.0208 29.2879 15.0753 29.3196C15.0816 29.4316 14.8436 29.7123 14.762 29.7979L14.7161 29.8366L14.693 29.832C14.6823 29.7304 14.8571 29.4151 14.8994 29.2769Z" fill="#404C5E"/>
<path d="M23.5589 15.0659C23.8269 15.0623 24.0952 15.0464 24.3668 15.0432C24.2826 15.1119 24.2308 15.089 24.1269 15.1053C24.2003 15.1372 24.2206 15.134 24.3028 15.1395L24.3529 15.1744C24.0748 15.1769 23.6958 15.1494 23.4124 15.1361L23.5354 15.1061L23.5589 15.0659Z" fill="url(#paint54_linear_1_2)"/>
<path d="M22.5165 8.09949C22.4972 7.97603 22.4413 7.80214 22.5645 7.7289C22.6443 7.72599 22.6406 7.72424 22.7138 7.75402L22.7665 7.78944L22.7568 7.82401L22.7845 7.84116C22.7229 7.87674 22.6696 7.89348 22.6396 7.94812C22.6507 7.99794 22.6412 7.98183 22.6705 8.01979C22.6174 8.04559 22.5671 8.06858 22.5165 8.09949Z" fill="#ADBBD7"/>
<path d="M16.3507 11.8005C16.4235 11.8178 16.3926 11.8232 16.4513 11.804L16.4551 11.8702C16.4966 11.883 16.4768 11.8814 16.5139 11.8785L16.5168 11.9024C16.5171 11.9021 16.2171 12.1209 16.1826 12.1477C16.2399 12.0394 16.2973 11.9123 16.3507 11.8005Z" fill="#BEC7D9"/>
<path d="M22.9489 15.0894C23.0735 15.0604 23.416 15.0645 23.5589 15.0659L23.5354 15.1061L23.4124 15.1361C23.2871 15.1421 23.0805 15.1079 22.9489 15.0894Z" fill="#58617D"/>
<path d="M24.2069 35.716C24.3293 35.8168 24.4674 35.9279 24.5843 36.0341C24.5166 36.003 24.2466 35.8754 24.2086 35.8219L24.2374 35.7762L24.2069 35.716Z" fill="#404C5E"/>
<path d="M17.3659 13.3013C17.5 13.1769 17.5572 13.1324 17.685 12.9955L17.7063 13.0295C17.683 13.0748 17.6476 13.127 17.6363 13.1733C17.5497 13.2249 17.4585 13.2611 17.3659 13.3013Z" fill="#2F384C"/>
<path d="M33.2534 30.548C33.2832 30.4635 33.4331 30.343 33.5049 30.2904C33.4471 30.3949 33.3972 30.4999 33.2943 30.5664L33.2534 30.548Z" fill="#1C1D1D"/>
<path d="M20.54 14.2734C20.5619 14.3474 20.5509 14.3605 20.6001 14.3951L20.6219 14.3972C20.6128 14.5014 20.6022 14.6055 20.5904 14.7095C20.5509 14.5533 20.5408 14.4323 20.54 14.2734Z" fill="#58617D"/>
<path d="M35.113 1.58928C35.5038 1.53 35.869 1.79764 35.9302 2.18814C35.9914 2.57863 35.7255 2.94515 35.3353 3.00822C34.9425 3.07172 34.5728 2.80361 34.5112 2.41044C34.4496 2.01726 34.7195 1.64897 35.113 1.58928Z" fill="#F7F8F9"/>
<path d="M9.48565 4.22364C9.47036 4.29142 9.46569 4.32245 9.49998 4.39003C9.23182 4.58411 8.95336 4.79442 8.68335 4.98271C8.66257 4.90762 8.68142 4.89956 8.71393 4.83299L8.69181 4.78566C8.81427 4.66494 9.31621 4.33739 9.48565 4.22364Z" fill="#000101" fill-opacity="0.976471"/>
<path d="M9.95768 3.92102C10.0601 3.84556 10.2799 3.72113 10.396 3.65054C10.4357 3.71996 10.4345 3.71583 10.4397 3.79569L10.1433 3.97593C10.0237 3.96344 10.0398 3.98304 9.95768 3.92102Z" fill="#000101" fill-opacity="0.964706"/>
<path d="M9.48565 4.22364C9.56922 4.16253 9.69977 4.0855 9.79032 4.02839C9.82505 4.09918 9.82238 4.09659 9.82617 4.17676C9.73043 4.2399 9.59594 4.33458 9.49998 4.39003C9.46569 4.32245 9.47036 4.29142 9.48565 4.22364Z" fill="url(#paint55_linear_1_2)"/>
<path d="M9.79032 4.02838C9.79938 4.0194 9.93712 3.93401 9.95768 3.92102C10.0398 3.98304 10.0237 3.96344 10.1433 3.97593L9.82617 4.17676C9.82238 4.09659 9.82505 4.09917 9.79032 4.02838Z" fill="#000101" fill-opacity="0.980392"/>
<path d="M10.7248 3.46503L10.7834 3.48013C10.8026 3.5419 10.8007 3.51103 10.7862 3.5763L10.7535 3.58441C10.6944 3.52099 10.7387 3.55064 10.7081 3.47624L10.7248 3.46503Z" fill="#000101" fill-opacity="0.945098"/>
</g>
<defs>
<linearGradient id="paint0_linear_1_2" x1="10.7023" y1="29.8212" x2="11.0635" y2="25.5233" gradientUnits="userSpaceOnUse">
<stop stop-color="#596A80"/>
<stop offset="1" stop-color="#B1B9C5"/>
</linearGradient>
<linearGradient id="paint1_linear_1_2" x1="23.0415" y1="24.4535" x2="23.0039" y2="24.2078" gradientUnits="userSpaceOnUse">
<stop stop-color="#7C88A2"/>
<stop offset="1" stop-color="#93A2B5"/>
</linearGradient>
<linearGradient id="paint2_linear_1_2" x1="10.9933" y1="32.9897" x2="11.0506" y2="29.5763" gradientUnits="userSpaceOnUse">
<stop stop-color="#1F2836"/>
<stop offset="1" stop-color="#5C6C83"/>
</linearGradient>
<linearGradient id="paint3_linear_1_2" x1="13.5006" y1="16.6968" x2="13.0558" y2="15.5951" gradientUnits="userSpaceOnUse">
<stop stop-color="#49556C"/>
<stop offset="1" stop-color="#7A99B2"/>
</linearGradient>
<linearGradient id="paint4_linear_1_2" x1="8.70513" y1="28.8794" x2="6.22682" y2="30.1754" gradientUnits="userSpaceOnUse">
<stop stop-color="#242D39"/>
<stop offset="1" stop-color="#3B4759"/>
</linearGradient>
<linearGradient id="paint5_linear_1_2" x1="18.1055" y1="26.4605" x2="18.1093" y2="25.5258" gradientUnits="userSpaceOnUse">
<stop stop-color="#3C4962"/>
<stop offset="1" stop-color="#656E88"/>
</linearGradient>
<linearGradient id="paint6_linear_1_2" x1="19.1694" y1="26.8745" x2="19.0732" y2="26.0654" gradientUnits="userSpaceOnUse">
<stop stop-color="#29323E"/>
<stop offset="1" stop-color="#66748A"/>
</linearGradient>
<linearGradient id="paint7_linear_1_2" x1="21.5139" y1="9.47906" x2="23.6965" y2="8.83279" gradientUnits="userSpaceOnUse">
<stop stop-color="#1E2532"/>
<stop offset="1" stop-color="#576275"/>
</linearGradient>
<linearGradient id="paint8_linear_1_2" x1="23.9673" y1="7.69413" x2="25.6479" y2="6.88782" gradientUnits="userSpaceOnUse">
<stop stop-color="#718698"/>
<stop offset="1" stop-color="#9EBAD6"/>
</linearGradient>
<linearGradient id="paint9_linear_1_2" x1="23.91" y1="25.1772" x2="23.8496" y2="24.5305" gradientUnits="userSpaceOnUse">
<stop stop-color="#384B5E"/>
<stop offset="1" stop-color="#74889D"/>
</linearGradient>
<linearGradient id="paint10_linear_1_2" x1="13.303" y1="17.9069" x2="13.1058" y2="16.6736" gradientUnits="userSpaceOnUse">
<stop stop-color="#1D202F"/>
<stop offset="1" stop-color="#465568"/>
</linearGradient>
<linearGradient id="paint11_linear_1_2" x1="29.5421" y1="4.8259" x2="29.3562" y2="3.76713" gradientUnits="userSpaceOnUse">
<stop stop-color="#DFE6EA"/>
<stop offset="1" stop-color="#D8DCFB"/>
</linearGradient>
<linearGradient id="paint12_linear_1_2" x1="21.7401" y1="25.6617" x2="21.5331" y2="25.2631" gradientUnits="userSpaceOnUse">
<stop stop-color="#5C647E"/>
<stop offset="1" stop-color="#6D7A8D"/>
</linearGradient>
<linearGradient id="paint13_linear_1_2" x1="15.0914" y1="28.5981" x2="14.6039" y2="28.0542" gradientUnits="userSpaceOnUse">
<stop stop-color="#8498B9"/>
<stop offset="1" stop-color="#A2B5CA"/>
</linearGradient>
<linearGradient id="paint14_linear_1_2" x1="23.5085" y1="8.28205" x2="24.1814" y2="8.08763" gradientUnits="userSpaceOnUse">
<stop stop-color="#596578"/>
<stop offset="1" stop-color="#718199"/>
</linearGradient>
<linearGradient id="paint15_linear_1_2" x1="19.6095" y1="26.9097" x2="19.5749" y2="26.3143" gradientUnits="userSpaceOnUse">
<stop stop-color="#7D8EA1"/>
<stop offset="1" stop-color="#ABBCC6"/>
</linearGradient>
<linearGradient id="paint16_linear_1_2" x1="26.6771" y1="34.1943" x2="26.7624" y2="30.162" gradientUnits="userSpaceOnUse">
<stop stop-color="#141A24"/>
<stop offset="1" stop-color="#3C4A5C"/>
</linearGradient>
<linearGradient id="paint17_linear_1_2" x1="34.029" y1="26.1393" x2="34.0454" y2="18.8437" gradientUnits="userSpaceOnUse">
<stop stop-color="#8998A9"/>
<stop offset="1" stop-color="#FCFAFD"/>
</linearGradient>
<linearGradient id="paint18_linear_1_2" x1="30.0372" y1="30.5224" x2="30.039" y2="25.9548" gradientUnits="userSpaceOnUse">
<stop stop-color="#384559"/>
<stop offset="1" stop-color="#8393A7"/>
</linearGradient>
<linearGradient id="paint19_linear_1_2" x1="24.0157" y1="13.3991" x2="22.6958" y2="10.3277" gradientUnits="userSpaceOnUse">
<stop stop-color="#212D40"/>
<stop offset="1" stop-color="#68758C"/>
</linearGradient>
<linearGradient id="paint20_linear_1_2" x1="26.5335" y1="26.1657" x2="25.3167" y2="23.9896" gradientUnits="userSpaceOnUse">
<stop stop-color="#15181B"/>
<stop offset="1" stop-color="#4A5366"/>
</linearGradient>
<linearGradient id="paint21_linear_1_2" x1="22.7989" y1="26.8581" x2="22.862" y2="27.636" gradientUnits="userSpaceOnUse">
<stop stop-color="#97B1D0"/>
<stop offset="1" stop-color="#E3DFF6"/>
</linearGradient>
<linearGradient id="paint22_linear_1_2" x1="29.5755" y1="21.8628" x2="29.4008" y2="21.6374" gradientUnits="userSpaceOnUse">
<stop stop-color="#586074"/>
<stop offset="1" stop-color="#717C8F"/>
</linearGradient>
<linearGradient id="paint23_linear_1_2" x1="29.3025" y1="22.4743" x2="29.0806" y2="21.6461" gradientUnits="userSpaceOnUse">
<stop stop-color="#5E6C75"/>
<stop offset="1" stop-color="#9192A4"/>
</linearGradient>
<linearGradient id="paint24_linear_1_2" x1="15.3169" y1="18.1001" x2="14.6967" y2="16.8229" gradientUnits="userSpaceOnUse">
<stop stop-color="#171D27"/>
<stop offset="1" stop-color="#58667D"/>
</linearGradient>
<linearGradient id="paint25_linear_1_2" x1="15.5776" y1="15.172" x2="14.8411" y2="14.1563" gradientUnits="userSpaceOnUse">
<stop stop-color="#6F869B"/>
<stop offset="1" stop-color="#A9B8CF"/>
</linearGradient>
<linearGradient id="paint26_linear_1_2" x1="20.1418" y1="11.6226" x2="19.2612" y2="10.3974" gradientUnits="userSpaceOnUse">
<stop stop-color="#2E3441"/>
<stop offset="1" stop-color="#576879"/>
</linearGradient>
<linearGradient id="paint27_linear_1_2" x1="18.1267" y1="12.7749" x2="18.0411" y2="12.6015" gradientUnits="userSpaceOnUse">
<stop stop-color="#BFC1D3"/>
<stop offset="1" stop-color="#F7F4F8"/>
</linearGradient>
<linearGradient id="paint28_linear_1_2" x1="29.7839" y1="20.4098" x2="28.9521" y2="16.539" gradientUnits="userSpaceOnUse">
<stop stop-color="#1D252D"/>
<stop offset="1" stop-color="#54617D"/>
</linearGradient>
<linearGradient id="paint29_linear_1_2" x1="29.5303" y1="20.5381" x2="29.4709" y2="20.3201" gradientUnits="userSpaceOnUse">
<stop stop-color="#68768A"/>
<stop offset="1" stop-color="#888EB0"/>
</linearGradient>
<linearGradient id="paint30_linear_1_2" x1="19.2789" y1="17.6426" x2="19.9232" y2="14.8242" gradientUnits="userSpaceOnUse">
<stop stop-color="#171C26"/>
<stop offset="1" stop-color="#3A4859"/>
</linearGradient>
<linearGradient id="paint31_linear_1_2" x1="21.4231" y1="34.9621" x2="21.4963" y2="34.2096" gradientUnits="userSpaceOnUse">
<stop stop-color="#1D222E"/>
<stop offset="1" stop-color="#464E60"/>
</linearGradient>
<linearGradient id="paint32_linear_1_2" x1="21.5288" y1="33.8855" x2="21.0354" y2="34.7212" gradientUnits="userSpaceOnUse">
<stop stop-color="#D1DCF8"/>
<stop offset="1" stop-color="#FFFFFE"/>
</linearGradient>
<linearGradient id="paint33_linear_1_2" x1="26.4671" y1="24.6332" x2="25.7289" y2="23.6449" gradientUnits="userSpaceOnUse">
<stop stop-color="#A1BCE1"/>
<stop offset="1" stop-color="#D3DBE7"/>
</linearGradient>
<linearGradient id="paint34_linear_1_2" x1="25.8796" y1="12.6348" x2="25.4284" y2="11.4303" gradientUnits="userSpaceOnUse">
<stop stop-color="#242F3E"/>
<stop offset="1" stop-color="#49586E"/>
</linearGradient>
<linearGradient id="paint35_linear_1_2" x1="17.8498" y1="30.2493" x2="16.8115" y2="28.7041" gradientUnits="userSpaceOnUse">
<stop stop-color="#C4CDE1"/>
<stop offset="1" stop-color="white"/>
</linearGradient>
<linearGradient id="paint36_linear_1_2" x1="19.0212" y1="28.6823" x2="17.9972" y2="28.5411" gradientUnits="userSpaceOnUse">
<stop stop-color="#242835"/>
<stop offset="1" stop-color="#3B4052"/>
</linearGradient>
<linearGradient id="paint37_linear_1_2" x1="28.3255" y1="18.6607" x2="27.4098" y2="18.8092" gradientUnits="userSpaceOnUse">
<stop stop-color="#36445D"/>
<stop offset="1" stop-color="#5F6D84"/>
</linearGradient>
<linearGradient id="paint38_linear_1_2" x1="26.4847" y1="23.4014" x2="26.2789" y2="22.8524" gradientUnits="userSpaceOnUse">
<stop stop-color="#3A424B"/>
<stop offset="1" stop-color="#5F7087"/>
</linearGradient>
<linearGradient id="paint39_linear_1_2" x1="26.7858" y1="22.9146" x2="26.8213" y2="22.4329" gradientUnits="userSpaceOnUse">
<stop stop-color="#5B6982"/>
<stop offset="1" stop-color="#7791AA"/>
</linearGradient>
<linearGradient id="paint40_linear_1_2" x1="25.4804" y1="24.3275" x2="25.2686" y2="23.8113" gradientUnits="userSpaceOnUse">
<stop stop-color="#485769"/>
<stop offset="1" stop-color="#657185"/>
</linearGradient>
<linearGradient id="paint41_linear_1_2" x1="25.222" y1="24.027" x2="25.1268" y2="23.6157" gradientUnits="userSpaceOnUse">
<stop stop-color="#6F7B95"/>
<stop offset="1" stop-color="#9599A9"/>
</linearGradient>
<linearGradient id="paint42_linear_1_2" x1="31.0567" y1="20.9226" x2="30.5625" y2="19.2787" gradientUnits="userSpaceOnUse">
<stop stop-color="#131B26"/>
<stop offset="1" stop-color="#3C475C"/>
</linearGradient>
<linearGradient id="paint43_linear_1_2" x1="27.2712" y1="7.65964" x2="27.1642" y2="6.38082" gradientUnits="userSpaceOnUse">
<stop stop-color="#202533"/>
<stop offset="1" stop-color="#3C4957"/>
</linearGradient>
<linearGradient id="paint44_linear_1_2" x1="18.8973" y1="35.2531" x2="19.1881" y2="34.5656" gradientUnits="userSpaceOnUse">
<stop stop-color="#6A7887"/>
<stop offset="1" stop-color="#A9BBD5"/>
</linearGradient>
<linearGradient id="paint45_linear_1_2" x1="27.426" y1="16.6273" x2="27.4612" y2="17.002" gradientUnits="userSpaceOnUse">
<stop stop-color="#3F4C62"/>
<stop offset="1" stop-color="#5E7189"/>
</linearGradient>
<linearGradient id="paint46_linear_1_2" x1="28.2517" y1="20.2032" x2="27.3829" y2="19.9114" gradientUnits="userSpaceOnUse">
<stop stop-color="#455063"/>
<stop offset="1" stop-color="#8191A9"/>
</linearGradient>
<linearGradient id="paint47_linear_1_2" x1="29.415" y1="14.1946" x2="29.4173" y2="14.4496" gradientUnits="userSpaceOnUse">
<stop stop-color="#8A97A1"/>
<stop offset="1" stop-color="#A5A7B5"/>
</linearGradient>
<linearGradient id="paint48_linear_1_2" x1="25.2832" y1="26.5644" x2="25.5371" y2="27.2709" gradientUnits="userSpaceOnUse">
<stop stop-color="#282222"/>
<stop offset="1" stop-color="#45516B"/>
</linearGradient>
<linearGradient id="paint49_linear_1_2" x1="29.4188" y1="24.192" x2="28.9352" y2="23.6166" gradientUnits="userSpaceOnUse">
<stop stop-color="#21323C"/>
<stop offset="1" stop-color="#717282"/>
</linearGradient>
<linearGradient id="paint50_linear_1_2" x1="16.5541" y1="31.0727" x2="16.9842" y2="31.1653" gradientUnits="userSpaceOnUse">
<stop stop-color="#B5ACDA"/>
<stop offset="1" stop-color="#6D88A1"/>
</linearGradient>
<linearGradient id="paint51_linear_1_2" x1="17.0821" y1="31.9992" x2="17.834" y2="30.9344" gradientUnits="userSpaceOnUse">
<stop stop-color="#20242E"/>
<stop offset="1" stop-color="#4D5B6E"/>
</linearGradient>
<linearGradient id="paint52_linear_1_2" x1="23.507" y1="12.0637" x2="24.4849" y2="12.3174" gradientUnits="userSpaceOnUse">
<stop stop-color="#3A3E42"/>
<stop offset="1" stop-color="#48485C"/>
</linearGradient>
<linearGradient id="paint53_linear_1_2" x1="29.9677" y1="22.5659" x2="30.37" y2="22.242" gradientUnits="userSpaceOnUse">
<stop stop-color="#9093A6"/>
<stop offset="1" stop-color="#AFAFB7"/>
</linearGradient>
<linearGradient id="paint54_linear_1_2" x1="23.5454" y1="15.0766" x2="24.1002" y2="15.108" gradientUnits="userSpaceOnUse">
<stop stop-color="#768097"/>
<stop offset="1" stop-color="#9DACCC"/>
</linearGradient>
<linearGradient id="paint55_linear_1_2" x1="9.67891" y1="4.23347" x2="9.61367" y2="4.15315" gradientUnits="userSpaceOnUse">
<stop stop-color="#010001" stop-opacity="0.921569"/>
<stop offset="1"/>
</linearGradient>
<clipPath id="clip0_1_2">
<rect width="38" height="38" fill="white" transform="translate(1 1)"/>
</clipPath>
</defs>
</svg>`;
if (typeof window !== "undefined") {
  window.SVG = SVG;
}
const DATA$n = window.copyspell_ai_admin || {};
const { __: __$n, _x: _x$m, _n: _n$m, sprintf: sprintf$m } = wp.i18n;
TOOLS.loadCSS(`multi-select.css?v=${DATA$n.version}`);
class MultiSelect {
  // ────────────────────────────────────
  constructor(args) {
    this.values = args.values || [];
    this.titles = args.titles || args.values.map((v) => v);
    if (!this.values.length) return;
    this.element = null;
    this.value = Array.isArray(args.value) ? args.value : args.value ? args.value.split(",").map((v) => v.trim()) : [];
    this.name = args.name || "multi-select-" + Math.random().toString(36).substr(2, 4);
    this.var = args.var || args.name;
    this.label = args.label || "";
    this.icon = args.icon || "";
    this.placeholder = args.placeholder || "Select...";
    this.searchPlaceholder = args.searchPlaceholder || "Search or add...";
    this.onChange = args.onChange || (() => {
    });
    this.onNewItem = args.onNewItem || (() => {
    });
    this.allowCreate = args.allowCreate || false;
    this.createLabel = args.createLabel || "Add";
    this.create();
  }
  // MARK: Get Value
  // ────────────────────────────────────
  getValue() {
    return this.value || [];
  }
  // MARK: Get Title from Value
  // ────────────────────────────────────
  getTitle(value) {
    const valueIndex = this.values.indexOf(String(value));
    if (valueIndex > -1 && this.titles[valueIndex]) {
      return this.titles[valueIndex];
    }
    return this.capitalizeWords(String(value));
  }
  // MARK: On Change Value
  // ────────────────────────────────────
  changeValue(changed, action) {
    document.querySelector(`input[name="${this.var}"]`).value = this.value.join(", ");
    this.onChange(this.value, changed, action);
  }
  // MARK: Create HTML
  // ────────────────────────────────────
  create() {
    this.element = document.createElement("div");
    this.element.className = `aai-group aai-${this.name}`;
    let HTML = ``;
    if (this.label)
      HTML += `<label class="aai-label" for="multi-select-${this.var}">${this.icon}${this.label}</label>`;
    HTML += `
			<div class="aai-multi-select" id="multi-select-${this.name}">
				<button type="button" class="aai-multi-select-btn">
					<span class="aai-multi-select-placeholder">${this.placeholder}</span>
					<div class="aai-multi-select-arrow">
						<svg viewBox="0 0 24 24" fill="currentColor">
							<path d="M7 10l5 5 5-5z"/>
						</svg>
					</div>
				</button>
				<div class="aai-multi-select-dropdown">
					<input type="text" class="aai-multi-select-search" placeholder="${this.searchPlaceholder}">
					<div class="aai-multi-select-options">
						${this.generateOptions()}
					</div>
				</div>
			</div>
			<div class="aai-multi-select-chips"></div>
			<input hidden id="${this.var}" name="${this.var}" type="text">
		`;
    this.element.innerHTML = HTML;
    this.html = `<div class="aai-group aai-${this.name}">${HTML}</div>`;
    requestAnimationFrame(() => {
      this.events();
    });
  }
  // MARK: Event Handling
  // ────────────────────────────────────
  events() {
    const group = document.querySelector(`.aai-group.aai-${this.name}`);
    if (!group) return;
    const btn = group.querySelector(".aai-multi-select-btn");
    const dropdown = group.querySelector(".aai-multi-select-dropdown");
    const search = group.querySelector(".aai-multi-select-search");
    const optionsContainer = group.querySelector(".aai-multi-select-options");
    const chipsContainer = group.querySelector(".aai-multi-select-chips");
    let isOpen = false;
    let self = this;
    btn.addEventListener("click", (e) => {
      e.preventDefault();
      e.stopPropagation();
      toggleDropdown();
    });
    search.addEventListener("input", (e) => {
      filterOptions(e.target.value);
    });
    optionsContainer.addEventListener("click", (e) => {
      const option = e.target.closest(".aai-multi-select-option:not(.separator)");
      if (option) {
        if (option.classList.contains("create-new")) {
          createNewItem();
        } else {
          toggleOption(option);
        }
      }
    });
    optionsContainer.addEventListener("keydown", (e) => {
      if (e.key === "Enter" || e.key === " ") {
        e.preventDefault();
        e.stopPropagation();
        const option = e.target.closest(".aai-multi-select-option:not(.separator)");
        if (option) {
          if (option.classList.contains("create-new")) {
            createNewItem();
          } else {
            toggleOption(option);
          }
        }
      }
    });
    search.addEventListener("keydown", (e) => {
      if (e.key === "Enter" && self.allowCreate) {
        e.preventDefault();
        e.stopPropagation();
        const searchTerm = e.target.value.trim();
        if (searchTerm && !self.values.map((v) => String(v).toLowerCase()).includes(searchTerm.toLowerCase())) {
          createNewItemWithValue(searchTerm);
        }
      }
    });
    document.addEventListener("click", (e) => {
      if (!btn.contains(e.target) && !dropdown.contains(e.target)) {
        closeDropdown();
      }
    });
    document.addEventListener("keydown", (e) => {
      if (e.key === "Escape" && isOpen) {
        closeDropdown();
        btn.focus();
      }
    });
    function createNewItem() {
      const searchTerm = search.value.trim();
      if (searchTerm) {
        createNewItemWithValue(searchTerm);
      }
    }
    function createNewItemWithValue(value) {
      if (self.values.map((v) => String(v).toLowerCase()).includes(value.toLowerCase())) {
        return;
      }
      self.values.push(value);
      self.titles.push(value);
      self.value.push(value);
      self.changeValue(value, "add");
      self.onNewItem(value);
      addChip(value);
      updateButtonText();
      search.value = "";
      regenerateOptions();
      filterOptions("");
      closeDropdown();
    }
    function regenerateOptions() {
      optionsContainer.innerHTML = self.generateOptions();
    }
    function toggleDropdown() {
      if (isOpen) {
        closeDropdown();
      } else {
        openDropdown();
      }
    }
    function openDropdown() {
      isOpen = true;
      btn.classList.add("active");
      dropdown.classList.add("show");
      setTimeout(() => {
        search.focus();
      }, 50);
    }
    function closeDropdown() {
      isOpen = false;
      btn.classList.remove("active");
      dropdown.classList.remove("show");
      search.value = "";
      filterOptions("");
    }
    function toggleOption(option) {
      const value = option.dataset.value;
      const isSelected = option.classList.contains("selected");
      if (isSelected) {
        option.classList.remove("selected");
        self.value = self.value.filter((a) => String(a) !== String(value));
        self.changeValue(value, "remove");
        removeChip(value);
      } else {
        option.classList.add("selected");
        self.value.push(value);
        self.changeValue(value, "add");
        addChip(value);
      }
      updateButtonText();
    }
    function addChip(value) {
      const title = self.getTitle(value);
      const chip = document.createElement("div");
      chip.className = "aai-multi-select-chip";
      chip.dataset.value = value;
      chip.innerHTML = `
				<span>${title}</span>
				<button type="button" class="aai-multi-select-chip-remove" data-value="${value}" title="Remove ${title}">
					×
				</button>
			`;
      chip.querySelector(".aai-multi-select-chip-remove").addEventListener("click", (e) => {
        e.stopPropagation();
        const valueToRemove = e.target.dataset.value;
        removeChip(valueToRemove);
        const option = optionsContainer.querySelector(`[data-value="${valueToRemove}"]`);
        if (option) {
          option.classList.remove("selected");
        }
        self.value = self.value.filter((a) => String(a) !== String(valueToRemove));
        self.changeValue(valueToRemove, "remove");
        updateButtonText();
      });
      chipsContainer.appendChild(chip);
    }
    function removeChip(value) {
      const chip = chipsContainer.querySelector(`[data-value="${value}"]`);
      if (chip) {
        chip.style.animation = "chipSlideOut 0.2s ease forwards";
        setTimeout(() => {
          if (chip.parentNode) {
            chip.parentNode.removeChild(chip);
          }
        }, 200);
      }
    }
    function updateButtonText() {
      const btnText = btn.querySelector(".aai-multi-select-placeholder, .aai-multi-select-text");
      const count = self.value.length;
      if (count === 0) {
        btnText.textContent = self.placeholder;
        btnText.className = "aai-multi-select-placeholder";
      } else if (count === 1) {
        btnText.textContent = self.getTitle(self.value[0]);
        btnText.className = "aai-multi-select-text";
      } else {
        const labelText = self.label || "Items";
        btnText.innerHTML = `
					<span class="aai-multi-select-text"><span class="aai-multi-select-label">${labelText}</span> <span class="aai-multi-select-count">${count}</span> ${count === 1 ? __$n("selection", "copyspell-ai") : __$n("selections", "copyspell-ai")}</span>
					
				`;
        btnText.className = "aai-multi-select-text";
      }
    }
    function filterOptions(searchTerm) {
      const options = optionsContainer.querySelectorAll(".aai-multi-select-option");
      const term = searchTerm.toLowerCase();
      let hasVisibleOptions = false;
      options.forEach((option) => {
        if (option.classList.contains("separator")) {
          option.style.display = "block";
          return;
        }
        if (option.classList.contains("create-new")) {
          const shouldShowCreate = self.allowCreate && searchTerm.trim() && !self.values.map((v) => String(v).toLowerCase()).includes(term);
          option.style.display = shouldShowCreate ? "flex" : "none";
          if (shouldShowCreate) {
            option.querySelector("span").textContent = `${self.createLabel} "${searchTerm}"`;
            hasVisibleOptions = true;
          }
          return;
        }
        const text = option.textContent.toLowerCase();
        const matches = text.includes(term);
        option.style.display = matches ? "flex" : "none";
        if (matches) {
          hasVisibleOptions = true;
        }
      });
      let noResults = optionsContainer.querySelector(".aai-multi-select-no-results");
      if (!hasVisibleOptions && searchTerm) {
        if (!noResults) {
          noResults = document.createElement("div");
          noResults.className = "aai-multi-select-no-results";
          noResults.textContent = "No items found";
          optionsContainer.appendChild(noResults);
        }
        noResults.style.display = "block";
      } else if (noResults) {
        noResults.style.display = "none";
      }
    }
    const initializeUI = () => {
      if (self.value && self.value.length > 0) {
        self.value.forEach((value) => addChip(value));
        updateButtonText();
        document.querySelector(`input[name="${self.var}"]`).value = self.value.join(", ");
      }
    };
    initializeUI();
    const style = document.createElement("style");
    style.textContent = `
			@keyframes chipSlideOut {
				to {
					opacity: 0;
					transform: scale(0.8) translateX(20px);
				}
			}
		`;
    document.head.appendChild(style);
  }
  // MARK: Generate Options
  // ────────────────────────────────────
  generateOptions() {
    let options = this.values.map((val, index) => {
      if (val === "-") {
        return `<div class="aai-multi-select-option separator">──────────────</div>`;
      }
      const isSelected = this.value.map(String).includes(String(val));
      const selectedClass = isSelected ? "selected" : "";
      const title = this.titles[index] || this.capitalizeWords(String(val));
      return `
				<div class="aai-multi-select-option ${selectedClass}" data-value="${val}" tabindex="0">
					<div class="aai-multi-select-checkbox"></div>
					<span>${title}</span>
				</div>
			`;
    }).join("");
    if (this.allowCreate) {
      options += `
				<div class="aai-multi-select-option create-new" tabindex="0" style="display: none;">
					<div class="aai-multi-select-checkbox"></div>
					<span>${this.createLabel} ""</span>
				</div>
			`;
    }
    return options;
  }
  // Capitalize Words
  // ────────────────────────────────────
  capitalizeWords(str) {
    if (typeof str !== "string") return "";
    return str.replace(/\b\w/g, (l) => l.toUpperCase());
  }
}
const DATA$m = window.copyspell_ai_admin || {};
let OPT$3 = DATA$m.options || {};
const { __: __$m, _x: _x$l, _n: _n$l, sprintf: sprintf$l } = wp.i18n;
function headerHTML$1(superTitle = __$m("AI Suggestions for", "copyspell-ai")) {
  var _a, _b, _c;
  let code = ((_b = (_a = DATA$m.woocommerce) == null ? void 0 : _a.product) == null ? void 0 : _b.sku) || "";
  if (code) code = `SKU: ${code}`;
  else code = `ID #${DATA$m.post.id}`;
  let imageSrc = ((_c = this.productData.imageUrls) == null ? void 0 : _c[0]) || DATA$m.plugin_url + "img/placeholder.jpg";
  let HTML = ``;
  HTML += `<div class="aai-card aai-no-header aai-suggestions-header">`;
  HTML += `<img src="${imageSrc}"/>`;
  HTML += `<div class="aai-text">`;
  HTML += `<h4>${superTitle}</h4>`;
  HTML += `<h2>${this.productData.title}</h2>`;
  HTML += `<div class="aai-header-bottom-line">`;
  HTML += `<div>${SVG.cube2} <span>${__$m("Woocomerce Product", "copyspell-ai")}</span></div>`;
  HTML += `<div>${SVG.id2} <span>${code}</span></div>`;
  HTML += `<div>${SVG.clock} <span>${__$m("Last updated", "copyspell-ai")} ${formatDate(this.productData.modified)}</span></div>`;
  HTML += `</div>`;
  HTML += `</div>`;
  HTML += `</div>`;
  return HTML;
}
function historyButtonHTML() {
  let HTML = ``;
  HTML += `<div class="aai-history-button-container">`;
  HTML += `<button class="aai-btn aai-history-button" type="button">`;
  HTML += SVG.history;
  HTML += `${__$m("History", "copyspell-ai")}`;
  HTML += `</button>`;
  HTML += `</div>`;
  return HTML;
}
function modelSelectionDropdown(form) {
  var _a, _b, _c;
  form = form || this.form || {};
  let allModels2 = AIapi.models;
  let model = form._model || "sequence";
  let modelName = "sequence";
  let provider = "";
  if (model != "sequence") {
    let modelParts = model.split(":::");
    model = [modelParts[0], modelParts[1] || ""];
    modelName = model[0] || "";
    provider = model[1] || "";
  }
  let providers = form.providers || OPT$3.api || {};
  let validProviders = AIH.validProviders(providers);
  let selected = modelName === "sequence" ? "selected" : "";
  let info = "";
  if (selected) {
    info = `${__$m("First model in the sequence:", "copyspell-ai")} <span>${((_a = OPT$3 == null ? void 0 : OPT$3.sequences) == null ? void 0 : _a.main[0][0].replace(/-/g, " ")) || ""}</span>`;
  }
  let res = '<div class="aai-select-model-options">';
  res += '<select class="aai-select aai-select-model" id="_model" name="_model" data-value="' + modelName + '" data-provider="' + provider + '">';
  if (validProviders.length) {
    res += `<option value="sequence" ${selected}>${__$m("Automatic Model Sequence", "copyspell-ai")}</option>`;
    for (const provider2 of Object.keys(providers)) {
      let models = ((_b = form.models) == null ? void 0 : _b[provider2]) || allModels2[provider2] || [];
      if (!models.length) continue;
      if (((_c = providers[provider2]) == null ? void 0 : _c.status) != "valid") {
        res += `<option value="" disabled>Enter an API key to see available ${provider2} models.</option>`;
        continue;
      }
      res += `<optgroup label="${provider2}">`;
      for (const m of models) {
        selected = m === modelName ? "selected" : "";
        res += `<option value="${m}:::${provider2}" ${selected}>${m.replace(/-/g, " ")}</option>`;
      }
      res += `</optgroup>`;
    }
  } else {
    res += `<option value="" disabled selected>${__$m("No valid AI providers found.", "copyspell-ai")}</option>`;
    info = __$m("Please configure your AI providers.", "copyspell-ai");
  }
  res += "</select>";
  res += `<div class="aai-info">${info}</div>`;
  res += "</div>";
  return res;
}
function keywordsHTML() {
  let disabledState = "";
  let validProviders = AIH.validProviders();
  if (!validProviders.length === 0) disabledState = " disabled";
  let HTML = `
	<section class="aai-section aai-keywords-section">
		<h3 class="aai-section-title">
			${SVG.key2}
			<span class="aai-text">${__$m("Target Keywords", "copyspell-ai")}</span>
			<span class="aai-optional">${__$m("optional", "copyspell-ai")}</span>
			${SVG.caret}
		</h3>

		<div class="aai-groups">
			<div class="aai-group">
				<label class="aai-label" for="primary-keywords">${__$m("Primary Keywords", "copyspell-ai")}</label>
				<div class="aai-keywords-row">
					<input class="aai-input" id="primary-keywords" name="primary-keywords" type="text" placeholder="${__$m("e.g. running shoes, home decor, phone case", "copyspell-ai")}">
					<button class="aai-btn-big aai-keywords-button" type="button" ${disabledState}>${__$m("Get Keywords with AI", "copyspell-ai")}</button>
				</div>
			</div>

			<div class="aai-group">
				<label class="aai-label" for="secondary-keywords">${__$m("Secondary Keywords", "copyspell-ai")}</label>
				<textarea class="aai-textarea" id="secondary-keywords" name="secondary-keywords" type="text" placeholder="${__$m("e.g. casual sneakers, stylish pet collars and leashes, eco-friendly office supplies", "copyspell-ai")}"></textarea>
			</div>
		</div>

	</section>
	`;
  return HTML;
}
function featuresHTML() {
  let HTML = `
	<section class="aai-section aai-features-section">
		<h3 class="aai-section-title">
			${SVG.cube2}
			<span class="aai-text">${__$m("Product Info", "copyspell-ai")}</span>
			<span class="aai-optional">${__$m("optional", "copyspell-ai")}</span>
			${SVG.caret}
		</h3>


		<div class="aai-groups">
			<div class="aai-group">
				<label class="aai-label" for="usp">${__$m("Unique Selling Proposition", "copyspell-ai")}</label>
				<textarea class="aai-textarea" id="usp" name="usp" placeholder="${__$m("What makes this product stand out from the competition? What's the one thing this product does better than anyone else?", "copyspell-ai")}"></textarea>
			</div>
			<div class="aai-group">
				<label class="aai-label" for="extra-info">${__$m("Extra Product Info", "copyspell-ai")}</label>
				<textarea class="aai-textarea" id="extra-info" name="extra-info" placeholder="${__$m("Extra information about the product that might be useful for the AI to generate content.", "copyspell-ai")}"></textarea>
			</div>
		</div>

	</section>
	`;
  return HTML;
}
function brandToneHTML() {
  let HTML = `
	<section class="aai-section aai-brand-section">
		<h3 class="aai-section-title">
			${SVG.shield}
			<span class="aai-text">${__$m("Brand Tone", "copyspell-ai")}</span>
			<span class="aai-optional">${__$m("optional", "copyspell-ai")}</span>
			${SVG.caret}
		</h3>

		<div class="aai-groups">
		
			<div class="aai-group">
				<textarea class="aai-textarea" id="brand-tone" name="brand-tone" placeholder="${__$m("Describe your brand’s tone and style...", "copyspell-ai")}"></textarea>
			</div>

		</div>
		
	</section>
	`;
  return HTML;
}
function multiSelectsHTML() {
  const $grid = this.panel.$body.querySelector(".aai-multi-select-grid");
  let audiencesControl = new MultiSelect({
    label: __$m("Target Audience", "copyspell-ai"),
    icon: SVG.audience,
    name: "audiences",
    values: this.promptOptions.audiences.map((a, i) => this.promptOptionsEn.audiences[i]),
    titles: this.promptOptions.audiences.map((a, i) => a),
    value: this.form.audiences || [],
    allowCreate: true
  });
  audiencesControl.onChange = (value, selected, action) => {
    this.form.audiences = value;
    this.prefs.audiences = value;
    AIH.LOCAL.set(this.prefsName, this.prefs);
    this.setFormData();
  };
  $grid.appendChild(audiencesControl.element);
  let tonesControl = new MultiSelect({
    label: __$m("Tone of Voice", "copyspell-ai"),
    icon: SVG.tone,
    name: "tones",
    values: this.promptOptions.tones.map((a, i) => this.promptOptionsEn.tones[i]),
    titles: this.promptOptions.tones.map((a, i) => a),
    value: this.form.tone || [],
    allowCreate: true
  });
  tonesControl.onChange = (value, selected, action) => {
    this.form.tone = value;
    this.prefs.tone = value;
    AIH.LOCAL.set(this.prefsName, this.prefs);
    this.setFormData();
  };
  $grid.appendChild(tonesControl.element);
  let prioritiesControl = new MultiSelect({
    label: __$m("Content Priorities", "copyspell-ai"),
    name: "priorities",
    icon: SVG.star,
    values: this.promptOptions.priorities.map((a, i) => this.promptOptionsEn.priorities[i]),
    titles: this.promptOptions.priorities.map((a, i) => a),
    value: this.form.priorities || [],
    allowCreate: true
  });
  prioritiesControl.onChange = (value, selected, action) => {
    this.form.priorities = value;
    this.prefs.priorities = value;
    AIH.LOCAL.set(this.prefsName, this.prefs);
    this.setFormData();
  };
  $grid.appendChild(prioritiesControl.element);
  let languageOptions = this.promptOptions.languages.map((l, i) => `<option value="${this.promptOptionsEn.languages[i][0]}">${l[1]}</option>`).join("");
  let HTML = `
		<div class="aai-group">
			<label class="aai-label" for="language">${SVG.language}${__$m("Response Language", "copyspell-ai")}</label>
			<select class="aai-select" id="language" name="language">
				${languageOptions}
			</select>
		</div>`;
  $grid.insertAdjacentHTML("beforeend", HTML);
}
function strategyHTML() {
  let contentSizeOptions = this.promptOptions.sizes.map((s, i) => `<option value="${this.promptOptionsEn.sizes[i][0]}" title="${s[2]}
${s[0]}">${s[1]}</option>`).join("");
  let excerptSizeOptions = this.promptOptions.excerptSizes.map((s, i) => `<option value="${this.promptOptionsEn.excerptSizes[i][0]}" title="${s[2]}
${s[0]}">${s[1]}</option>`).join("");
  let frameworkOptions = this.promptOptions.frameworks.map((f, i) => `<option value="${this.promptOptionsEn.frameworks[i][0]}" title="${f[1]}">${f[0]}</option>`).join("");
  let HTML = `
	<section class="aai-section aai-strategy-section">



		<div class="aai-multi-select-grid"></div>


		<div class="aai-dropdowns-grid aai-grid-sizes">

			<div class="aai-group">
				<label class="aai-label" for="content-size">${SVG.text}${__$m("Content Length", "copyspell-ai")}</label>
				<select class="aai-select" id="content-size" name="content-size">
					${contentSizeOptions}
				</select>
				<div class="aai-info"></div>
			</div>


			<div class="aai-group">
				<label class="aai-label" for="excerpt-size">${SVG.text}${__$m("Short Description Length", "copyspell-ai")}</label>
				<select class="aai-select" id="excerpt-size" name="excerpt-size">
					${excerptSizeOptions}
				</select>
				<div class="aai-info"></div>
			</div>

		</div>





		<div class="aai-dropdowns-grid aai-grid-framework">

			<div class="aai-group aai-group-1">
				<label class="aai-label" for="framework">${SVG.chart2}${__$m("Marketing Framework", "copyspell-ai")}</label>
				<select class="aai-select" id="framework" name="framework">
					${frameworkOptions}
				</select>
				<div class="aai-info"></div>
			</div>

			
			<div class="aai-group aai-group-2"></div>


		</div>






		<div class="aai-group aai-extra-prompt-group">
			<label class="aai-label" for="extra-prompt">${SVG.prompt}${__$m("Extra Prompt", "copyspell-ai")} <span class="aai-optional">${__$m("optional", "copyspell-ai")}</span></label>
			<textarea class="aai-textarea" id="extra-prompt" name="extra-prompt" placeholder="${__$m("Provide any additional instructions or context for the AI...", "copyspell-ai")}"></textarea>
		</div>


	</section>
	`;
  return HTML;
}
async function submitButtonHTML(label, license) {
  label = label || __$m("Generate AI Content", "copyspell-ai");
  let HTML = ``;
  let disabledState = "";
  let validProviders = AIH.validProviders();
  if (!validProviders.length === 0) disabledState = " disabled";
  OPT$3.api = OPT$3.api || {};
  if (!validProviders.length) {
    disabledState = " disabled";
    label = __$m("Configure AI Providers", "copyspell-ai");
  }
  HTML += `
	<div class="aai-submit-section aai-${disabledState ? "disabled" : "enabled"}">
		<button class="aai-submit-btn" type="submit" ${disabledState}>${label}</button>
	`;
  if (license && license.status == "trial") {
    HTML += `
			<div class="aai-note">
				<a href="https://copyspell.ai/#home-pricing" target="_blank" class="aai-btn aai-btn-secondary medium">${__$m("Upgrade to Pro for unlimited requests", "copyspell-ai")}</a>
				<p>${__$m("TRIAL.", "copyspell-ai")} ${__$m("Remaining requests:", "copyspell-ai")} <b>${license.trialleft}</b></p>
			</div>
			`;
  }
  HTML += `</div>`;
  if (!validProviders.length === 0) {
    HTML += `
		<div class="aai-warning">
			<h3>Let's Connect Your AI!</h3>
			<p>You're almost there. To unlock the AI features, just configure a provider on the settings page.</p>
		</div>
		`;
  }
  return HTML;
}
function rateButtonHTML(label) {
  label = label || __$m("Rate CopySpell AI", "copyspell-ai");
  let HTML = `
	<div class="aai-rate-section">
		<a href="https://copyspell.ai/review-copyspell-ai/" target="_blank" class="aai-rate-btn">${label}</a>
	</div>
	`;
  return HTML;
}
function loadingState() {
  if (!this.panel || !this.panel.$body) return;
  this.panel.$body.innerHTML = `
	<div class="aai-call-progress loading">
		<div class="aai-grid"></div>
		<div class="copyspell-ai-loading">${SVG.loader}<label>${__$m("AI analysis", "copyspell-ai")}</label></div>
		<div class="aai-processing">
			<div class="status-pulse"></div>
			<span class="status-label">thinking</span>
		</div>
		<div class="aai-output"></div>
	</div>
	`;
}
function showError(message) {
  if (!this.panel || !this.panel.$body) return;
  this.panel.$body.innerHTML = `
	<div class="aai-call-progress error">
		<div class="aai-grid"></div>
		<div class="copyspell-ai-error">${SVG.error}<label>${message}</label></div>
		<div class="aai-output"></div>
	</div>
	`;
}
function formatDate(dateString) {
  if (!dateString) return "";
  const date = new Date(dateString);
  const now = /* @__PURE__ */ new Date();
  const diffInMilliseconds = now - date;
  const diffInSeconds = Math.floor(diffInMilliseconds / 1e3);
  const diffInMinutes = Math.floor(diffInSeconds / 60);
  const diffInHours = Math.floor(diffInMinutes / 60);
  const diffInDays = Math.floor(diffInHours / 24);
  const diffInWeeks = Math.floor(diffInDays / 7);
  const diffInMonths = Math.floor(diffInDays / 30);
  const diffInYears = Math.floor(diffInDays / 365);
  if (diffInSeconds < 60) {
    return __$m("Just now", "copyspell-ai");
  } else if (diffInMinutes === 1) {
    return __$m("1 minute ago", "copyspell-ai");
  } else if (diffInMinutes < 60) {
    return `${__$m(": ", "copyspell-ai")}${diffInMinutes} ${__$m("minutes ago", "copyspell-ai")}`;
  } else if (diffInHours === 1) {
    return __$m("1 hour ago", "copyspell-ai");
  } else if (diffInHours < 24) {
    return `${__$m(": ", "copyspell-ai")}${diffInHours} ${__$m("hours ago", "copyspell-ai")}`;
  } else if (diffInDays === 1) {
    return __$m("1 day ago", "copyspell-ai");
  } else if (diffInDays < 7) {
    return `${__$m(": ", "copyspell-ai")}${diffInDays} ${__$m("days ago", "copyspell-ai")}`;
  } else if (diffInWeeks === 1) {
    return __$m("1 week ago", "copyspell-ai");
  } else if (diffInWeeks < 4) {
    return `${__$m(": ", "copyspell-ai")}${diffInWeeks} ${__$m("weeks ago", "copyspell-ai")}`;
  } else if (diffInMonths === 1) {
    return __$m("1 month ago", "copyspell-ai");
  } else if (diffInMonths < 12) {
    return `${__$m(": ", "copyspell-ai")}${diffInMonths} ${__$m("months ago", "copyspell-ai")}`;
  } else if (diffInYears === 1) {
    return __$m("1 year ago", "copyspell-ai");
  } else {
    return `${__$m(": ", "copyspell-ai")}${diffInYears} ${__$m("years ago", "copyspell-ai")}`;
  }
}
window.CopyspellAI = window.CopyspellAI || {};
(function(api) {
  api.CopySpellCall = CopySpellCall;
  api.AIH = AIH;
  api.AIapi = AIapi;
  api.modelSelectionDropdown = modelSelectionDropdown;
  api.SVG = SVG;
  const extensionRegistry = [];
  api.registerExtension = function(ext) {
    extensionRegistry.push(ext);
  };
  api.initExtensions = function(app) {
    extensionRegistry.forEach((ext) => {
      console.log("Initializing CopyspellAI Extensions...", ext);
      if (typeof ext.init === "function") {
        ext.init(app);
      }
    });
  };
  api.getExtensions = function() {
    return extensionRegistry;
  };
  api.ui = {
    slots: {
      metabox: [],
      toolbar: [],
      sidebar: [],
      modals: []
    },
    registerSlot(slotName, component) {
      if (!api.ui.slots[slotName]) return;
      api.ui.slots[slotName].push(component);
    },
    renderSlots() {
      console.log("slots", api.ui.slots);
      Object.entries(api.ui.slots).forEach(([slotName, components]) => {
        const container = document.querySelector(`[data-copyspell-slot="${slotName}"]`);
        if (container && components.length) {
          container.innerHTML = "";
          components.forEach((fn) => container.appendChild(fn()));
        }
      });
    }
  };
  api.data = /* @__PURE__ */ function() {
    const store = /* @__PURE__ */ new Map();
    const listeners = /* @__PURE__ */ new Map();
    function notify(key, value) {
      if (listeners.has(key)) {
        listeners.get(key).forEach((cb) => cb(value));
      }
    }
    return {
      set(key, value) {
        store.set(key, value);
        notify(key, value);
      },
      get(key) {
        return store.get(key);
      },
      subscribe(key, callback) {
        if (!listeners.has(key)) listeners.set(key, []);
        listeners.get(key).push(callback);
      }
    };
  }();
  api.events = {
    emit(eventName, data) {
      const event = new CustomEvent(eventName, { detail: data });
      document.dispatchEvent(event);
    },
    on(eventName, callback) {
      document.addEventListener(eventName, (e) => callback(e.detail));
    }
  };
  api.filters = /* @__PURE__ */ function() {
    const filters = /* @__PURE__ */ new Map();
    return {
      /**
       * Add a filter callback
       * @param {string} filterName - Name of the filter hook
       * @param {function} callback - Function that receives and returns modified data
       * @param {number} priority - Lower runs first (default: 10)
       */
      add(filterName, callback, priority = 10) {
        if (!filters.has(filterName)) {
          filters.set(filterName, []);
        }
        filters.get(filterName).push({ callback, priority });
        filters.get(filterName).sort((a, b) => a.priority - b.priority);
      },
      /**
       * Remove a filter callback
       * @param {string} filterName - Name of the filter hook
       * @param {function} callback - The callback to remove
       */
      remove(filterName, callback) {
        if (!filters.has(filterName)) return;
        const list = filters.get(filterName);
        const index = list.findIndex((f) => f.callback === callback);
        if (index > -1) list.splice(index, 1);
      },
      /**
       * Apply all registered filters to the data
       * @param {string} filterName - Name of the filter hook
       * @param {*} data - Data to be filtered
       * @param {...*} args - Additional arguments passed to callbacks
       * @returns {*} - The filtered data
       */
      apply(filterName, data, ...args) {
        if (!filters.has(filterName)) return data;
        return filters.get(filterName).reduce((result, { callback }) => {
          return callback(result, ...args);
        }, data);
      },
      /**
       * Async version - Apply all registered filters to the data
       * @param {string} filterName - Name of the filter hook
       * @param {*} data - Data to be filtered
       * @param {...*} args - Additional arguments passed to callbacks
       * @returns {Promise<*>} - The filtered data
       */
      async applyAsync(filterName, data, ...args) {
        if (!filters.has(filterName)) return data;
        let result = data;
        for (const { callback } of filters.get(filterName)) {
          result = await callback(result, ...args);
        }
        return result;
      },
      /**
       * Check if a filter has any callbacks registered
       * @param {string} filterName - Name of the filter hook
       * @returns {boolean}
       */
      has(filterName) {
        return filters.has(filterName) && filters.get(filterName).length > 0;
      }
    };
  }();
})(window.CopyspellAI);
let $$b = jQuery;
const DATA$l = window.copyspell_ai_admin || {};
const { __: __$l, _x: _x$k, _n: _n$k, sprintf: sprintf$k } = wp.i18n;
async function AdminHome() {
  const adminContainer = $$b(".copyspell-ai-tab-content");
  if (adminContainer.length) {
    adminContainer.html(await adminHomeHTML());
    adminHomeEvents();
  }
}
function adminHomeEvents() {
  $$b(".aai-action-btn").on("click", function(e) {
    e.preventDefault();
    const action = $$b(this).attr("data-action");
    handleActionClick(action, e);
  });
}
function handleActionClick(action, e) {
  switch (action) {
    case "add-item":
      break;
    case "settings":
      $$b('.copyspell-ai-nav-tab[alt="settings"]').trigger("click");
      break;
    case "license":
      $$b('.copyspell-ai-nav-tab[alt="license"]').trigger("click");
      break;
    case "copy-shortcode":
      navigator.clipboard.writeText("[copyspell_ai]").then(() => {
        const button = $$b(e.target);
        const originalText = button.text();
        button.text("Copied!").addClass("copied");
        setTimeout(() => {
          button.text(originalText).removeClass("copied");
        }, 8e3);
      });
      break;
    case "shop-page":
      window.open(DATA$l.woocommerce.store_url, "_blank");
      break;
    case "learn-more":
      window.open("https://copyspell.ai/custom-control", "_blank");
      break;
    case "documentation":
      window.open("https://copyspell.ai/user-guide", "_blank");
      break;
    case "support":
      window.open("https://support.copyspell.ai", "_blank");
      break;
  }
}
async function adminHomeHTML() {
  `<button class="aai-action-btn aai-btn-2-primary" data-action="license">${__$l("License", "copyspell-ai")}</button>`;
  return `
        <div class="aai-admin-home">

		
            <!-- Header Section -->
            ${headerHTML()}


			
			${!DATA$l.revisions_enabled ? '<div class="aai-warning">' + __$l("Enable <a href='https://wordpress.org/documentation/article/revisions/#revision-options' target='_blank'>revisions</a> to prevent losing your existing content.", "copyspell-ai") + "</div>" : ""}

		
            <!-- Action Steps -->
            ${actionStepsHTML()}



            <!-- Features Section -->
            ${featureSectionHTML()}


            <!-- Feature Suggestions -->
            ${suggestHTML()}


            <!-- Help Section -->
            ${helpSectionHTML()}


            <!-- Footer -->
            ${IFC.footerHTML()}


        </div>
    `;
}
function headerHTML() {
  return `
		<div class="aai-home-header">
			<div class="aai-header-icon">
				<img src="${DATA$l.logo}">
			</div>
			<div class="aai-header-content">
				<h1 class="aai-home-title">${__$l("Getting Started", "copyspell-ai")}</h1>
				<p class="aai-home-subtitle">${__$l("Welcome to Copyspell AI!", "copyspell-ai")}</p>
				<p class="aai-home-description">${__$l(`Welcome aboard! You've just equipped your store with a powerful content assistant. Configure your AI settings and start generating high-impact product content in minutes.`, "copyspell-ai")}</p>
			</div>
		</div>
	`;
}
function actionStepsHTML() {
  let $el = $$b("<div>");
  let $steps = $$b('<div class="aai-action-steps">').appendTo($el);
  let cards = [
    {
      number: 1,
      title: __$l("Configure AI Settings", "copyspell-ai"),
      description: __$l("Go to the settings page and add your AI provider API keys. You can start for free with a Google AI Studio or a Groq key to unlock powerful content generation.", "copyspell-ai"),
      //extra: successMessageHTML(),
      buttonText: __$l("GO TO SETTINGS", "copyspell-ai"),
      buttonAction: "settings"
    },
    {
      number: 2,
      title: __$l("Generate Your First Content", "copyspell-ai"),
      description: __$l("Navigate to any WooCommerce product page. You'll find the new CopySpell AI panel ready to transform your product details into compelling copy.", "copyspell-ai"),
      buttonText: __$l("GO TO PRODUCTS", "copyspell-ai"),
      buttonAction: "shop-page"
    },
    {
      number: 3,
      title: __$l("Customize & Apply", "copyspell-ai"),
      description: __$l("Fine-tune the results by selecting a tone, audience, and strategy. Preview the suggestions and apply them to your product with a single click.", "copyspell-ai"),
      extraX: `<div class="aai-shortcode-display">
				<code>[copyspell_ai]</code>
			</div>`,
      buttonText: __$l("LEARN MORE", "copyspell-ai"),
      buttonAction: "learn-more"
    }
  ];
  cards.forEach((card) => {
    let $card = $$b(`
			<div class="aai-step-card">
				<div class="aai-step-number">${card.number}</div>
				<div class="aai-step-content">
					<h3>${card.title}</h3>
					<p>${card.description}</p>
					${card.extra ? card.extra : ""}
					<button class="aai-action-btn aai-btn-2-primary" data-action="${card.buttonAction}">${card.buttonText}</button>
				</div>
			</div>
		`);
    $steps.append($card);
  });
  $$b(successMessageHTML()).appendTo($el);
  return $el.html();
}
function successMessageHTML() {
  let validProviders = AIH.validProviders();
  let providers = __$l("You have no providers enabled", "copyspell-ai");
  if (validProviders.length == 1) providers = __$l("You have", "copyspell-ai") + " " + validProviders.length + " " + __$l("providers enabled", "copyspell-ai") + " (" + validProviders[0] + ")";
  if (validProviders.length > 1) providers = __$l("You have", "copyspell-ai") + " " + validProviders.length + " " + __$l("providers enabled", "copyspell-ai") + " (" + validProviders.join(", ") + ")";
  if (!validProviders.length) {
    return `
			<div class="aai-warning">
				${__$l("You have not configured any AI providers yet. To get started:", "copyspell-ai")}
				<ol>
					<li>${__$l("Go to", "copyspell-ai")} <b>${__$l("Settings", "copyspell-ai")} -> ${__$l("API Settings", "copyspell-ai")}</b></li>
					<li>${__$l("Enter your API keys", "copyspell-ai")}</li>
					<ul>
						<li>${__$l("Get free API keys from", "copyspell-ai")} <b>Google</b> ${__$l("or", "copyspell-ai")} <b>Groq</b></li>
						<li>${__$l("Use your own", "copyspell-ai")} <b>OpenAI</b> ${__$l("or", "copyspell-ai")} <b>GitHub</b> ${__$l("keys", "copyspell-ai")}</li>
					</ul>
					<li>${__$l("Click", "copyspell-ai")} <b>Connect</b> ${__$l("to verify each API key", "copyspell-ai")}.</li>
				</ol>
			</div>`;
  }
  return `
	<div class="aai-success-message">
		<div class="aai-success-icon">✓</div>
		<span>${providers}</span>
	</div>`;
}
function featureSectionHTML() {
  return `
	<div class="aai-features-section">
		<h2 class="aai-section-title">${__$l("Plugin Features", "copyspell-ai")}</h2>
		<div class="aai-features-grid">
			${featureCardHTML(
    SVG.bulb,
    "red",
    __$l("Intelligent Content Generation", "copyspell-ai"),
    __$l("Instantly create SEO-optimized titles, compelling short descriptions, and rich, formatted long descriptions from basic product info.", "copyspell-ai")
  )}
			${featureCardHTML(
    SVG.sliders,
    "blue",
    __$l("Advanced Customization", "copyspell-ai"),
    __$l("Tailor every output with 24+ tones, 30+ audiences, and 22+ content strategies to perfectly match your brand voice.", "copyspell-ai")
  )}
			${featureCardHTML(
    SVG.cloudCheck,
    "green",
    __$l("Multi-Provider Reliability", "copyspell-ai"),
    __$l("Our smart failover system uses multiple AI providers like Google Gemini to ensure 99.9% uptime and avoid service interruptions.", "copyspell-ai")
  )}
			${featureCardHTML(
    SVG.woo,
    "orange",
    __$l("Seamless WooCommerce Integration", "copyspell-ai"),
    __$l("Built specifically for WooCommerce. Intuitive interface and zero learning curve.", "copyspell-ai")
  )}
			${featureCardHTML(
    SVG.key,
    "purple",
    __$l("Smart Keyword Generation", "copyspell-ai"),
    __$l("Let AI analyze your product title and details to automatically generate a list of relevant SEO keywords. Use them to fine-tune your content and attract more organic traffic.", "copyspell-ai")
  )}
			${featureCardHTML(
    SVG.rocket,
    "teal",
    __$l("Built-in SEO Optimization", "copyspell-ai"),
    __$l("Generate content designed to rank. Our AI focuses on creating titles and descriptions that improve your organic search performance.", "copyspell-ai")
  )}
		</div>
	</div>`;
}
function featureCardHTML(icon, iconColor, title, description) {
  return `
		<div class="aai-feature-card">
			<div class="aai-feature-icon aai-icon-${iconColor}">${icon}</div>
			<div class="aai-feature-content">
				<h3>${title}</h3>
				<p>${description}</p>
			</div>
		</div>`;
}
function suggestHTML() {
  return `
		<div class="aai-home-header aai-suggest-feature">
			<div class="aai-header-content">
				<h1 class="aai-home-title">${__$l("Feature Suggestions", "copyspell-ai")}</h1>
				<p class="aai-home-subtitle">${__$l("Have an idea that could make CopySpell AI even better?", "copyspell-ai")}</p>
				<p class="aai-home-description">${__$l(`We would love to hear it. Send us your suggestion and it may be included in a future update.`, "copyspell-ai")}</p>
			</div>
			<button class="aai-btn aai-btn-big aai-btn-primary" data-action="support">${__$l("Submit a Suggestion", "copyspell-ai")}</button>
		</div>
	`;
}
function helpSectionHTML() {
  return `
	<div class="aai-help-section">
		<h2 class="aai-section-title">${__$l("Need Help?", "copyspell-ai")}</h2>
		<div class="aai-help-grid">
			<div class="aai-help-card">
				<h3>${__$l("Documentation", "copyspell-ai")}</h3>
				<p>${__$l("Read our comprehensive documentation for detailed setup instructions and guides on advanced features.", "copyspell-ai")}</p>
				<button class="aai-action-btn aai-btn-outline" data-action="documentation">${__$l("View Documentation", "copyspell-ai")}</button>
			</div>
			<div class="aai-help-card">
				<h3>${__$l("Support", "copyspell-ai")}</h3>
				<p>${__$l("Need assistance? Our support team is here to help you get the most out of CopySpell AI.", "copyspell-ai")}</p>
				<button class="aai-action-btn aai-btn-outline" data-action="support">${__$l("Get Support", "copyspell-ai")}</button>
			</div>
		</div>
	</div>`;
}
const $$a = jQuery;
const SDK$6 = window.CopyspellAI || {};
const DATA$k = window.copyspell_ai_admin || {};
let OPT$2 = DATA$k.options || {};
const { __: __$k, _x: _x$j, _n: _n$j, sprintf: sprintf$j } = wp.i18n;
const Providers = {};
Providers.all = [
  {
    id: "google",
    name: "Google AI",
    icon: "svg.google",
    active: false,
    url: "https://aistudio.google.com/apikey"
  },
  {
    id: "groq",
    name: "Groq",
    icon: "svg.groq",
    active: false,
    url: "https://platform.groq.com/account/api-keys"
  },
  {
    id: "openrouter",
    name: "Open Router",
    icon: "svg.openrouter",
    active: false,
    url: "https://openrouter.ai/settings/keys"
  },
  {
    id: "naga",
    name: "NAGA AI",
    icon: "svg.naga",
    active: false,
    url: "https://app.naga.ai/settings/api-keys"
  },
  {
    id: "openai",
    name: "OpenAI",
    icon: "svg.openai",
    active: false,
    url: "https://platform.openai.com/account/api-keys"
  },
  {
    id: "github",
    name: "GitHub",
    icon: "svg.github",
    active: false,
    url: "https://github.com/settings/tokens"
  }
];
Providers.init = (currentSettings2) => {
  Providers.currentSettings = currentSettings2 || {};
  Providers.all = SDK$6.filters.apply("providers_array", Providers.all, { ...Providers });
  SDK$6.events.on("admin-settings-rendered", () => {
    Providers.events();
  });
  return Providers.render();
};
Providers.render = () => {
  let html = `<div class="aai-settings-tab-content aai-provider-keys active" data-tab="api">`;
  Providers.all.forEach((provider) => {
    var _a;
    let providerData = ((_a = OPT$2.api) == null ? void 0 : _a[provider.id]) || {};
    let status = providerData.status || "invalid";
    let iconSVG = provider.icon;
    if (provider.icon.split(".")[0] === "svg") {
      iconSVG = SVG[provider.icon.split(".")[1]] || "";
    }
    html += `<div class="aai-section ${status === "valid" ? "aai-valid" : ""}" alt="${provider.id}">
					<h2 class="aai-section-title-3">
						<span class="aai-section-icon">${iconSVG}</span>
						${provider.name}
					</h2>
					<div class="aai-group-button">
						<button class="aai-btn aai-btn-secondary aai-keys-btn" data-provider="${provider.id}">
							${status === "valid" ? __$k("Active", "copyspell-ai") : `${providerData.key ? __$k("Invalid Key", "copyspell-ai") : __$k("Enter API Key", "copyspell-ai")}`}
						</button>
					</div>
					<div class="aai-form-group">
						<label class="aai-label" for="${provider.id}_key">API key</label>
						<div class="actus-flex">
							<input type="text"
									class="aai-input"
									id="${provider.id}_key"
									name="${provider.id}_key" 
									placeholder="Enter ${provider.name} API key">
							<button class="aai-btn-big aai-test-button">Connect</button>
						</div>
						<small class="aai-form-help">${__$k("To use", "copyspell-ai")} ${provider.name} ${__$k("features, you need an API key from.", "copyspell-ai")} <a href="${provider.url}" target="_blank" rel="noopener" class="aai-link">${provider.name}</a>.</small>
						<a href="${provider.url}" target="_blank" rel="noopener" class="aai-btn-2 aai-btn-outline aai-info-btn">${status === "valid" ? "" : "Get API Key from"} ${provider.name}</a>
					</div>
				</div>
				`;
  });
  html += `</div>`;
  return html;
};
Providers.events = () => {
  const adminContainer = $$a(".copyspell-ai-tab-content");
  adminContainer.find(".aai-keys-btn").off("click");
  adminContainer.find(".aai-keys-btn").on("click", async function(e) {
    e.preventDefault();
    e.stopPropagation();
    $$a(this).closest(".aai-section").siblings().removeClass("aai-open");
    $$a(this).closest(".aai-section").toggleClass("aai-open");
    $$a(this).find("input").focus();
    $$a(this).closest(".aai-section")[0].scrollIntoView({ behavior: "smooth", block: "center" });
  });
  $$a("body").off("change", '[data-tab="api"] input');
  $$a("body").on("change", '[data-tab="api"] input', function(e) {
    $$a(this).siblings(".aai-test-button").removeClass("success error").html("Connect").prop("disabled", false);
  });
  $$a("body").off("click", ".aai-test-button");
  $$a("body").on("click", ".aai-test-button", Providers.testConnection);
};
Providers.testConnection = async (e) => {
  var _a;
  e.preventDefault();
  const $button = $$a(e.target);
  $button.addClass("loading").removeClass("success error").prop("disabled", true);
  const apiType = $button.closest(".aai-section").attr("alt");
  const apiKey = $button.siblings("input").val().trim();
  if (!apiType || !apiKey) {
    $button.removeClass("loading").prop("disabled", false);
    TOOLS.showNotification("Please enter a valid API key", "error");
    return;
  }
  let res = await ((_a = AIapi[apiType]) == null ? void 0 : _a.checkAPIKey(apiKey));
  $button.removeClass("loading");
  Providers.currentSettings.api[apiType] = Providers.currentSettings.api[apiType] || {};
  Providers.currentSettings.api[apiType].key = apiKey;
  delete Providers.currentSettings.api[apiType].status;
  if (res && res.valid) {
    Providers.currentSettings.api[apiType].status = "valid";
    $button.addClass("success").html("connected");
  } else {
    Providers.currentSettings.api[apiType].status = "failed";
    $button.addClass("error").html("failed");
  }
  await Providers.saveOptions(Providers.currentSettings);
};
Providers.saveOptions = async (options, $button) => {
  options = options || Providers.currentSettings || {};
  if ($button) $button.addClass("loading").removeClass("success error").prop("disabled", true);
  let savedOptions = await TOOLS.saveOptions(options);
  if (savedOptions) {
    Providers.currentSettings = TOOLS.deepMerge(Providers.currentSettings, savedOptions);
    TOOLS.showNotification("Settings saved successfully!", "success");
  } else {
    TOOLS.showNotification("Error saving settings", "error");
  }
  if ($button) $button.removeClass("loading").prop("disabled", false);
};
const SDK$5 = window.CopyspellAI || {};
const DATA$j = JSON.parse(JSON.stringify(window.copyspell_ai_admin || {}));
const { __: __$j, _x: _x$i, _n: _n$i, sprintf: sprintf$i } = wp.i18n;
let $$9 = jQuery;
TOOLS.loadCSS(`settings.css?v=${DATA$j.version}`);
let currentSettings = {
  api: {
    google: {},
    groq: {},
    openai: {},
    github: {},
    naga: {}
  },
  sequences: {
    mainDefault: [],
    keywordsDefault: [],
    searchDefault: []
  }
};
let allModels = {};
function AdminSettings() {
  loadCurrentSettings().then(async () => {
    allModels = await AIapi.getModels("all");
    allModels = allModels.models || {};
    currentSettings.sequences.main = currentSettings.sequences.main || JSON.parse(JSON.stringify(allModels.sequences.main));
    currentSettings.sequences.keywords = currentSettings.sequences.keywords || JSON.parse(JSON.stringify(allModels.sequences.keywords));
    currentSettings.sequences.search = currentSettings.sequences.search || JSON.parse(JSON.stringify(allModels.sequences.search));
    const adminContainer = $$9(".copyspell-ai-tab-content");
    if (adminContainer.length) {
      adminContainer.html(await adminSettingsHTML());
      SDK$5.events.emit("admin-settings-rendered", currentSettings);
      adminSettingsEvents();
      populateSettings();
    }
  });
}
function loadCurrentSettings() {
  return new Promise((resolve) => {
    if (DATA$j && DATA$j.options) {
      currentSettings = TOOLS.deepMerge(DATA$j.options, currentSettings);
    }
    resolve();
  });
}
function adminSettingsEvents() {
  $$9("body").off("click", ".aai-settings-tab");
  $$9("body").on("click", ".aai-settings-tab", function(e) {
    e.preventDefault();
    const tab = $$9(this).attr("data-tab");
    switchSettingsTab(tab);
  });
  $$9("body").off("change", '[data-tab="models"] select');
  $$9("body").on("change", '[data-tab="models"] select', function(e) {
    let value = $$9(this).val().trim();
    const provider = value.split(":::")[1] || "google";
    value = value.split(":::")[0] || "";
    $$9(this).attr("data-value", value);
    $$9(this).attr("data-provider", provider);
  });
  $$9("body").off("submit", "#aai-settings-form");
  $$9("body").on("submit", "#aai-settings-form", handleSettingsSubmit);
  $$9("body").off("click", ".aai-default-sequence");
  $$9("body").on("click", ".aai-default-sequence", function(e) {
    const sequenceType = $$9(this).attr("alt");
    if (sequenceType) {
      currentSettings.sequences[sequenceType] = JSON.parse(JSON.stringify(allModels.sequences[sequenceType] || []));
      tabAIModels();
    }
  });
}
function switchSettingsTab(tab) {
  $$9(".aai-settings-tab").removeClass("active");
  $$9(`.aai-settings-tab[data-tab="${tab}"]`).addClass("active");
  $$9(".aai-settings-tab-content").removeClass("active");
  $$9(`.aai-settings-tab-content[data-tab="${tab}"]`).addClass("active");
  if (tab == "models") tabAIModels();
}
async function handleSettingsSubmit(e) {
  console.log("SUBMIT");
  e.preventDefault();
  if (!e.originalEvent.submitter.classList.contains("aai-save-settings")) return;
  const $submitBtn = $$9(".aai-save-settings");
  const formData = getFormData();
  console.log("Form Data:", formData);
  saveOptions(formData, $submitBtn);
}
async function saveOptions(options, $button) {
  options = options || currentSettings || {};
  if ($button) $button.addClass("loading").removeClass("success error").prop("disabled", true);
  let savedOptions = await TOOLS.saveOptions(options);
  if (savedOptions) {
    currentSettings = TOOLS.deepMerge(currentSettings, savedOptions);
    TOOLS.showNotification("Settings saved successfully!", "success");
  } else {
    TOOLS.showNotification("Error saving settings", "error");
  }
  if ($button) $button.removeClass("loading").prop("disabled", false);
}
function getFormData() {
  let mainSeq = [];
  let keywordsSeq = [];
  let searchSeq = [];
  $$9('.aai-group[alt="main-sequence"] select').each(function() {
    var _a;
    let value = (_a = $$9(this).attr("data-value")) == null ? void 0 : _a.trim();
    let provider = $$9(this).attr("data-provider");
    if (value) mainSeq.push([value, provider]);
  });
  $$9('.aai-group[alt="keywords-sequence"] select').each(function() {
    var _a;
    let value = (_a = $$9(this).attr("data-value")) == null ? void 0 : _a.trim();
    let provider = $$9(this).attr("data-provider");
    if (value) keywordsSeq.push([value, provider]);
  });
  $$9('.aai-group[alt="search-sequence"] select').each(function() {
    var _a;
    let value = (_a = $$9(this).attr("data-value")) == null ? void 0 : _a.trim();
    let provider = $$9(this).attr("data-provider");
    if (value) searchSeq.push([value, provider]);
  });
  let newData = {
    api: {},
    sequences: {
      main: mainSeq,
      keywords: keywordsSeq,
      search: searchSeq
    }
  };
  let apiContainer = $$9('.aai-settings-tab-content[data-tab="api"]');
  apiContainer.find(".aai-section").each(function() {
    var _a;
    const provider = $$9(this).attr("alt");
    const key = $$9(this).find("input").val().trim();
    newData.api[provider] = newData.api[provider] || {};
    newData.api[provider].key = key;
    newData.api[provider].status = ((_a = currentSettings.api[provider]) == null ? void 0 : _a.status) || "";
  });
  return newData;
}
function populateSettings() {
  $$9(".aai-test-button").removeClass("success error").html("Connect");
  let apiContainer = $$9('.aai-settings-tab-content[data-tab="api"]');
  apiContainer.find(".aai-section").each(function() {
    var _a, _b, _c, _d;
    const provider = $$9(this).attr("alt");
    $$9(this).find("input").val(((_a = currentSettings.api[provider]) == null ? void 0 : _a.key) || "");
    if (((_b = currentSettings.api[provider]) == null ? void 0 : _b.status) === "valid")
      $$9('.aai-section[alt="' + provider + '"] .aai-test-button').addClass("success").html("connected");
    else if (((_c = currentSettings.api[provider]) == null ? void 0 : _c.status) === "failed" && ((_d = currentSettings.api[provider]) == null ? void 0 : _d.key))
      $$9('.aai-section[alt="' + provider + '"] .aai-test-button').addClass("error").html("invalid key");
  });
}
async function adminSettingsHTML() {
  return `
        <div class="aai-admin-settings">
            
            <!-- Settings Header -->
            <div class="aai-settings-header">
                <h1 class="aai-settings-title">
                    <span class="aai-title-icon">${SVG.settings}</span>
                    ${__$j("Plugin Settings", "copyspell-ai")}
                </h1>
                <p class="aai-settings-subtitle">${__$j("Configure your plugin settings and API keys", "copyspell-ai")}</p>
            </div>



            <!-- Settings Tabs -->
            <div class="aai-settings-tabs">
			<!--
                <button class="aai-settings-tab active" data-tab="general">
                    ${SVG.settings} ${__$j("General Settings", "copyspell-ai")}
                </button>
			-->
                <button class="aai-settings-tab active" data-tab="api">
                    ${SVG.api} ${__$j("API Settings", "copyspell-ai")}
                </button>
                <button class="aai-settings-tab" data-tab="models">
                    ${SVG.models} ${__$j("AI models", "copyspell-ai")}
                </button>
            </div>





            <!-- Settings Form -->
            <form id="aai-settings-form" class="aai-settings-form">
                
               

				${tabGeneralSettings()}

				${await tabAIModels()}

				${Providers.init(currentSettings)}


                <!-- Form Actions -->
                <div class="aai-settings-actions">
                    <button type="submit" class="aai-btn-2 aai-save-settings aai-btn-2-primary">
                        ${SVG.save} ${__$j("Save Settings", "copyspell-ai")}
                    </button>
                </div>

                
            </form>
        </div>
    `;
}
function tabGeneralSettings() {
  return ` 
	<!-- General Settings Tab -->
	<div class="aai-settings-tab-content" data-tab="general">
		<div class="aai-settings-section">
        
			<h2 class="aai-section-title">
				<span class="aai-section-icon">${SVG.settings}</span>
				General Configuration
			</h2>

        </div>
    </div>`;
}
async function tabAIModels() {
  const providers = ["google", "groq", "openai", "github", "naga"];
  let seqMain = JSON.parse(JSON.stringify(currentSettings.sequences.main));
  let seqKeywords = JSON.parse(JSON.stringify(currentSettings.sequences.keywords));
  let seqSearch = JSON.parse(JSON.stringify(currentSettings.sequences.search));
  let validProviders = [];
  providers.forEach((provider) => {
    var _a;
    if (((_a = currentSettings.api[provider]) == null ? void 0 : _a.status) != "valid") {
      seqMain = seqMain.filter((item) => item[1] != provider);
      seqKeywords = seqKeywords.filter((item) => item[1] != provider);
      seqSearch = seqSearch.filter((item) => item[1] != provider);
    } else {
      validProviders.push(provider);
    }
  });
  let mainLength = seqMain.length;
  if (mainLength < 10) mainLength = 10;
  let keywordsLength = seqKeywords.length;
  if (keywordsLength < 10) keywordsLength = 10;
  let searchLength = seqSearch.length;
  if (searchLength < 4) searchLength = 4;
  let tabContent = document.querySelector('.aai-settings-tab-content[data-tab="models"]');
  let HTML = ``;
  if (!validProviders.length)
    HTML += `<div class="aai-warning">
					${__$j("You have not configured any AI providers yet. To get started:", "copyspell-ai")}
					<ol>
						<li>${__$j("Enter your API keys", "copyspell-ai")}</li>
						<ul>
							<li>${__$j("Get free API keys from", "copyspell-ai")} <b>Google</b> ${__$j("or", "copyspell-ai")} <b>Groq</b></li>
							<li>${__$j("Use your own", "copyspell-ai")} <b>OpenAI</b> ${__$j("or", "copyspell-ai")} <b>GitHub</b> ${__$j("keys", "copyspell-ai")}</li>
						</ul>
						<li>${__$j("Click", "copyspell-ai")} <b>Connect</b> ${__$j("to verify each API key", "copyspell-ai")}.</li>
					</ol>
				</div>`;
  HTML += `
	<div class="aai-section-header">
		<h2 class="aai-section-title actus-flex-1">
			<span class="aai-section-icon">${SVG.models}</span>
			${__$j("Model Sequences", "copyspell-ai")}
		</h2>
		<button type="submit" class="aai-btn-2 aai-save-settings aai-btn-2-primary">
			${SVG.save} ${__$j("Save Settings", "copyspell-ai")}
		</button>
	</div>

	<div class="aai-section">
		
			<div class="aai-info">
				${__$j("During an AI request, the plugin starts with the first model in the defined sequence. If that model fails—for example, due to rate limits—it automatically tries the next one, continuing until it either finds a working model or exhausts the entire sequence.", "copyspell-ai")}
				<br>
				<br>
				${__$j("You can configure separate model sequences for main AI calls and for keyword extraction.", "copyspell-ai")}
			</div>

		<div class="aai-dropdowns-grid">

			<div class="aai-group" alt="main-sequence">
				<h3>${__$j("Main Sequence", "copyspell-ai")}</h3>
				${[...Array(mainLength)].map((_, index) => {
    let model = seqMain[index] || [];
    let modelName = model[0] || "";
    let provider = model[1] || "";
    let res = '<select class="aai-select aai-select-model" id="main-sequence-' + index + '" alt="' + index + '" data-value="' + modelName + '" data-provider="' + provider + '">';
    res += `<option value="" disabled selected>Select Model</option>`;
    res += providers.map((provider2) => {
      var _a;
      let models = allModels[provider2] || [];
      let options = `<optgroup label="${provider2}">`;
      options += models.map((m) => {
        let selected = m === modelName ? "selected" : "";
        return `<option value="${m}:::${provider2}" ${selected}>${m.replace(/-/g, " ")}</option>`;
      }).join("");
      options += `</optgroup>`;
      if (!models.length || ((_a = currentSettings.api[provider2]) == null ? void 0 : _a.status) != "valid") options = `<option value="" disabled>Enter an API key to see available ${provider2} models.</option>`;
      return options;
    }).join("");
    res += "</select>";
    return res;
  }).join("")}
				<div class="aai-info"></div>
				<button class="aai-btn aai-btn-primary aai-default-sequence" alt="main">${__$j("Restore Default Sequence", "copyspell-ai")}</button>
			</div>

			<div class="aai-group" alt="keywords-sequence">
				<h3>${__$j("Keywords Sequence", "copyspell-ai")}</h3>
				${[...Array(keywordsLength)].map((_, index) => {
    let model = seqKeywords[index] || [];
    let modelName = model[0] || "";
    let provider = model[1] || "google";
    let res = '<select class="aai-select aai-select-model" id="main-sequence-' + index + '" alt="' + index + '" data-value="' + modelName + '" data-provider="' + provider + '">';
    res += `<option value="" disabled selected>Select Model</option>`;
    res += Object.keys(currentSettings.api).map((provider2) => {
      var _a;
      let models = allModels[provider2] || [];
      let options = `<optgroup label="${provider2}">`;
      options += models.map((m) => {
        let selected = m === modelName ? "selected" : "";
        return `<option value="${m}:::${provider2}" ${selected}>${m.replace(/-/g, " ")}</option>`;
      }).join("");
      options += `</optgroup>`;
      if (!models.length || ((_a = currentSettings.api[provider2]) == null ? void 0 : _a.status) != "valid") options = `<option value="" disabled>Enter an API key to see available ${provider2} models.</option>`;
      return options;
    }).join("");
    res += "</select>";
    return res;
  }).join("")}
				<div class="aai-info"></div>
				<button class="aai-btn aai-btn-primary aai-default-sequence" alt="keywords">${__$j("Restore Default Sequence", "copyspell-ai")}</button>
			</div>

			<div class="aai-group" alt="search-sequence">
				<h3>${__$j("Search Sequence", "copyspell-ai")}</h3>
				${[...Array(searchLength)].map((_, index) => {
    let model = seqSearch[index] || [];
    let modelName = model[0] || "";
    let provider = model[1] || "google";
    let res = '<select class="aai-select aai-select-model" id="main-sequence-' + index + '" alt="' + index + '" data-value="' + modelName + '" data-provider="' + provider + '">';
    res += `<option value="" disabled selected>Select Model</option>`;
    res += Object.keys(currentSettings.api).map((provider2) => {
      var _a;
      let models = allModels[provider2] || [];
      let options = `<optgroup label="${provider2}">`;
      options += models.map((m) => {
        let selected = m === modelName ? "selected" : "";
        return `<option value="${m}:::${provider2}" ${selected}>${m.replace(/-/g, " ")}</option>`;
      }).join("");
      options += `</optgroup>`;
      if (!models.length || ((_a = currentSettings.api[provider2]) == null ? void 0 : _a.status) != "valid") options = `<option value="" disabled>Enter an API key to see available ${provider2} models.</option>`;
      return options;
    }).join("");
    res += "</select>";
    return res;
  }).join("")}
				<div class="aai-info"></div>
				<button class="aai-btn aai-btn-primary aai-default-sequence" alt="search">${__$j("Restore Default Sequence", "copyspell-ai")}</button>
			</div>

		</div>



	</div>`;
  let fullHTML = `
		<!-- AI Models Tab -->
		<div class="aai-settings-tab-content" data-tab="models">
			${HTML}
		</div>
	`;
  if (tabContent) tabContent.innerHTML = HTML;
  return fullHTML;
}
const DATA$i = JSON.parse(JSON.stringify(window.copyspell_ai_admin || {}));
const { __: __$i, _x: _x$h, _n: _n$h, sprintf: sprintf$h } = wp.i18n;
let $$8 = jQuery;
TOOLS.loadCSS(`settings.css?v=${DATA$i.version}`);
let settings = {
  key: "",
  status: "no key",
  email: "",
  expires: "",
  activations: "",
  trialleft: 0,
  end: null,
  plan: ""
};
let licenseAPI = DATA$i.license_api_url || "";
async function AdminLicense() {
  let savedLicense = await TOOLS.loadOption("copyspell-ai-license");
  if (savedLicense) settings = savedLicense;
  const adminContainer = $$8(".copyspell-ai-tab-content");
  if (adminContainer.length) {
    adminContainer.html(licenseHTML());
    licenseEvents();
    if (settings.key) {
      await validateLicenseKey(settings.key);
    }
    showLicenseStatus();
  }
}
function licenseEvents() {
  const tab = document.querySelector('[data-tab="license"]');
  const testButton = tab.querySelector(".aai-test-button");
  const deactivateButton = tab.querySelector(".aai-deactivate-button");
  const licenseInput = tab.querySelector("#license_key");
  const statusElement = tab.querySelector(".aai-license-status");
  licenseInput.addEventListener("input", () => {
    document.querySelector('[data-tab="license"] .aai-deactivate-button').style.display = "none";
    const licenseKey = licenseInput.value.trim();
    if (licenseKey) {
      testButton.style.display = "inline-block";
      statusElement.style.display = "none";
      testButton.textContent = __$i("Activate", "copyspell-ai");
    } else {
      testButton.style.display = "none";
      testButton.style.display = "inline-block";
      testButton.textContent = __$i("Save", "copyspell-ai");
      statusElement.style.display = "inline-flex";
      settings.status = "no key";
      showLicenseStatus();
    }
    settings.key = licenseKey;
  });
  testButton.addEventListener("click", async (e) => {
    e.preventDefault();
    testButton.disabled = true;
    testButton.innerHTML = SVG.loader8;
    const licenseKey = licenseInput.value.trim();
    await validateLicenseKey(licenseKey);
    statusElement.style.display = "inline-flex";
    testButton.textContent = __$i("Activate", "copyspell-ai");
    testButton.disabled = false;
    testButton.style.display = "none";
    showLicenseStatus();
  });
  deactivateButton.addEventListener("click", async (e) => {
    e.preventDefault();
    let r = confirm(__$i("Are you sure you want to deactivate your license key? The key will be cleared. Make sure you have a copy available.", "copyspell-ai"));
    if (!r) return;
    deactivateButton.disabled = true;
    deactivateButton.innerHTML = SVG.loader8;
    const licenseKey = licenseInput.value.trim();
    licenseInput.value = "";
    settings.key = "";
    if (licenseKey) {
      await deactivateLicenseKey(licenseKey);
      statusElement.style.display = "inline-flex";
      deactivateButton.textContent = __$i("Deactivate", "copyspell-ai");
      deactivateButton.disabled = false;
      deactivateButton.style.display = "none";
    }
    showLicenseStatus();
  });
}
const CACHE_KEY = "copyspell_ai_license_check";
async function deactivateLicenseKey(key) {
  key = key || settings.key;
  if (!key) return false;
  let data = {};
  try {
    const response = await fetch(licenseAPI + "/license/deactivate", {
      method: "POST",
      headers: {
        "Content-Type": "application/json"
      },
      body: JSON.stringify({
        licenseKey: key,
        domain: DATA$i.siteUrl.replace(/^https?:\/\//, ""),
        pluginId: "copyspell-ai"
      })
    });
    data = await response.json();
    settings.key = "";
    settings.status = "no key";
    settings.activations = data.activationsCount + " / " + data.maxActivations;
    showLicenseStatus();
    await TOOLS.saveOptions("copyspell-ai-license", settings);
    await TOOLS.saveOptions("copyspell_ai_license_status", {
      status: "no key",
      expires: data.expires || "",
      activationsCount: data.activationsCount,
      maxActivations: data.maxActivations
    });
  } catch (error) {
    log("❌ Network or API error:", error);
  }
  return data;
}
async function validateLicenseKey(key) {
  key = key || settings.key;
  settings.key = key;
  let data = {};
  try {
    const response = await fetch(licenseAPI + "/license/validate", {
      method: "POST",
      headers: {
        "Content-Type": "application/json"
      },
      body: JSON.stringify({
        licenseKey: key,
        domain: DATA$i.siteUrl.replace(/^https?:\/\//, ""),
        pluginId: "copyspell-ai"
      })
    });
    data = await response.json();
    settings.email = data.email || "";
    settings.expires = data.expires || "";
    settings.activations = "";
    settings.isSiteActivated = data.isSiteActivated || false;
    settings.plan = data.plan || "";
    settings.end = data.end || null;
    settings.type = data.type || null;
    if (response.ok && data.success) {
      settings.status = data.status;
      if (data.maxActivations && data.maxActivations > 1) {
        settings.activations = data.activationsCount + " / " + data.maxActivations;
      }
      if (data.status == "trial") settings.trialleft = data.maxActivations;
    } else {
      settings.status = "inactive";
      if (data.code == "NOT_FOUND") settings.status = "invalid";
      if (data.code == "EXPIRED") settings.status = "expired";
      if (data.code == "DEACTIVATED") settings.status = "deactivated";
      if (data.code == "REVOKED") settings.status = "inactive";
      if (data.code == "MAX_ACTIVATIONS") settings.status = "max activations reached";
      if (data.code == "EXPIRED_TRIAL") settings.status = "expired trial";
    }
  } catch (error) {
    log("❌ Network or API error:", error);
    settings.status = "inactive";
  } finally {
    showLicenseStatus();
    await TOOLS.saveOptions("copyspell-ai-license", settings);
    await TOOLS.saveOptions("copyspell_ai_license_status", {
      status: settings.status,
      expires: settings.expires,
      activationsCount: data.activationsCount,
      maxActivations: data.maxActivations
    });
  }
  let check = false;
  if (settings.status == "active") check = true;
  if (settings.status == "trial" && data.maxActivations > 0) check = true;
  localStorage.setItem(CACHE_KEY, JSON.stringify({
    timestamp: Date.now(),
    data: check
  }));
  return check;
}
function showLicenseStatus(status) {
  let tab = document.querySelector('[data-tab="license"]');
  if (!tab) return;
  const statusElement = tab.querySelector(".aai-license-status");
  const helpElement = tab.querySelector(".aai-form-help");
  const testButton = tab.querySelector(".aai-test-button");
  status = status || settings.status || "no key";
  let statusText = status;
  let clss = "";
  if (settings.expires) {
    const date = new Date(settings.expires);
    if (!isNaN(date)) {
      String(date.getDate()).padStart(2, "0");
      String(date.getMonth() + 1).padStart(2, "0");
      date.getFullYear();
    } else {
      settings.expires;
    }
  }
  document.querySelector('[data-tab="license"] .aai-info-btn').style.display = "none";
  document.querySelector('[data-tab="license"] .aai-deactivate-button').style.display = "none";
  switch (status) {
    case "no key":
      statusText = __$i("You have not entered a license key yet.", "copyspell-ai");
      clss = "aai-chip-purple";
      break;
    case "active":
      clss = "aai-chip-green";
      statusText = __$i("Licensed to:", "copyspell-ai") + " <b>" + settings.email + "</b><br>";
      if (settings.end) {
        const endDate = new Date(settings.end * 1e3);
        if (!isNaN(endDate)) {
          const day = String(endDate.getDate()).padStart(2, "0");
          const month = String(endDate.getMonth() + 1).padStart(2, "0");
          const year = endDate.getFullYear();
          statusText += __$i("Expires at:", "copyspell-ai") + ` <b>${day}/${month}/${year}</b><br>`;
        } else {
          statusText += __$i("Expires at:", "copyspell-ai") + " <b>" + settings.end + "</b><br>";
        }
        statusText += `<br><a href="https://billing.stripe.com/p/login/7sY14mfvofQ86Gbgtf2go00?prefilled_email=${settings.email}" target="_blank" rel="noopener" class="aai-btn-2 aai-btn-2-primary">${__$i("Manage Your Subscription", "copyspell-ai")}</a>`;
      }
      if (settings.activations) {
        statusText += __$i("Activations:", "copyspell-ai") + " <b>" + settings.activations + "</b>";
      }
      break;
    case "trial":
      clss = "aai-chip-purple";
      statusText = __$i("Trial License:", "copyspell-ai") + " <b>" + settings.email + "</b><br>";
      if (settings.trialleft) {
        statusText += __$i("Remaining requests:", "copyspell-ai") + " <b>" + settings.trialleft + "</b>";
      }
      break;
    case "expired":
      statusText = __$i("Your license key has expired.", "copyspell-ai");
      statusText += `<br><br><a href="https://billing.stripe.com/p/login/7sY14mfvofQ86Gbgtf2go00?prefilled_email=${settings.email}" target="_blank" rel="noopener" class="aai-btn-2 aai-btn-2-primary">${__$i("Renew Your Subscription", "copyspell-ai")}</a>`;
      clss = "aai-chip-red";
      break;
    case "expired_trial":
      statusText = __$i("Your trial has expired.", "copyspell-ai");
      clss = "aai-chip-red";
      break;
    case "invalid":
      statusText = __$i("Your license key is invalid.", "copyspell-ai");
      clss = "aai-chip-red";
      break;
    case "inactive":
      statusText = __$i("Your license key is inactive.", "copyspell-ai");
      clss = "aai-chip-red";
      break;
    case "deactivated":
      statusText = __$i("Your license key has been deactivated.", "copyspell-ai");
      clss = "aai-chip-orange";
      break;
    case "revoked":
      statusText = __$i("Your license key has been revoked.", "copyspell-ai");
      clss = "aai-chip-red";
      break;
    default:
      statusText = __$i("You have not entered a license key yet.", "copyspell-ai");
      clss = "aai-chip-purple";
      break;
  }
  if (status != "active" && status != "trial" && status != "expired") document.querySelector('[data-tab="license"] .aai-info-btn').style.display = "inline-block";
  else if (status == "active") document.querySelector('[data-tab="license"] .aai-deactivate-button').style.display = "inline-block";
  if (status == "deactivated" && settings.key) {
    testButton.style.display = "inline-block";
  }
  helpElement.innerHTML = statusText;
  statusElement.classList = "aai-chip aai-license-status " + clss;
  statusElement.innerHTML = __$i(status, "copyspell-ai") || status;
  const existingWarnings = helpElement.parentNode.querySelectorAll(".aai-warning");
  existingWarnings.forEach((warning) => warning.remove());
  if (status == "active" || status == "trial") {
    let validProviders = AIH.validProviders();
    if (!validProviders.length) {
      let apiButton = `<button class="aai-action-btn aai-btn-2-primary" data-action="apiKey">${__$i("Settings", "copyspell-ai")}</button>`;
      let html = `
				<div class="aai-warning aai-big aai-api-warning">
					${__$i("Now you need an AI API key.", "copyspell-ai")}<br>
					<strong>${__$i("Get a free API key from Google", "copyspell-ai")}</strong> ${__$i("and add it in the Settings tab.", "copyspell-ai")}<br><br>
					${apiButton}
				</div>`;
      helpElement.innerHTML += "<br><br>";
      helpElement.insertAdjacentHTML("afterend", html);
      document.querySelector(".aai-api-warning").addEventListener("click", (e) => {
        e.preventDefault();
        $$8('.copyspell-ai-nav-tab[alt="settings"]').trigger("click");
      });
    }
  }
}
function licenseHTML() {
  return `
		<div class="aai-admin-settings">
			
			<!-- Settings Header -->
			<div class="aai-settings-header">
				<h1 class="aai-settings-title">
					<span class="aai-title-icon">${SVG.license}</span>
					${__$i("License", "copyspell-ai")}
				</h1>
			</div>



			<!-- License Tabs -->
			<div class="aai-settings-tabs">
	
			</div>





			<!-- Settings Form -->
			<form id="aai-settings-form" class="aai-settings-form">
				
			   

				${tabLicense()}

				${tabAddons()}


				<!-- Form Actions -->
				<div class="aai-settings-actions">
				</div>

				
			</form>
		</div>
	`;
}
function tabAddons() {
  var _a;
  let extensions = ((_a = window.CopyspellAI) == null ? void 0 : _a.getExtensions()) || [];
  let csi_installed = extensions.find((ext) => ext.id === "copyspell-images");
  const addons = [
    {
      id: "copyspell-images",
      title: "CopySpell Images",
      description: __$i("AI-powered product image generation and editing.", "copyspell-ai"),
      icon: SVG.image,
      buyUrl: "https://copyspell.ai/addons/copyspell-images",
      installed: !!csi_installed,
      available: true,
      active: false
    },
    {
      id: "copyspell-seo",
      title: "CopySpell SEO",
      description: __$i("Advanced SEO optimization for your product content.", "copyspell-ai"),
      icon: SVG.seo || SVG.search || `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.35-4.35"/></svg>`,
      buyUrl: "https://copyspell.ai/addons/copyspell-seo",
      installed: false,
      available: false,
      active: false
    }
  ];
  let addonCards = addons.map((addon) => `
        <div class="aai-addon-card${addon.installed ? " aai-addon-installed" : ""}" data-addon-id="${addon.id}">
            <div class="aai-addon-icon">${addon.icon}</div>
            <h3 class="aai-addon-title">${addon.title}</h3>
            <p class="aai-addon-description">${addon.description}</p>
            ${addon.available ? addon.installed ? `<div class="aai-addon-status aai-chip aai-chip-green">${__$i("Installed", "copyspell-ai")}</div>` : `<a href="${addon.buyUrl}" target="_blank" rel="noopener" class="aai-btn-2 aai-btn-2-primary aai-addon-buy-btn">${__$i("Get Add-on", "copyspell-ai")}</a>` : `<div class="aai-addon-status aai-chip aai-chip-gray">${__$i("Coming Soon", "copyspell-ai")}</div>`}
        </div>
    `).join("");
  let html = `
    <!-- Addons -->
    <div class="aai-settings-tab-content active" data-tab="addons">

        <div class="aai-section">
            <h2 class="aai-section-title">${__$i("CopySpell Add-ons", "copyspell-ai")}</h2>
            <div class="aai-addons-grid">
                ${addonCards}
            </div>
        </div>


    </div>
    `;
  return html;
}
function tabLicense() {
  return `
	<!-- License Tab -->
	<div class="aai-settings-tab-content active" data-tab="license">
		<div class="aai-section">
			<div class="aai-form-group">
				<label class="aai-label" for="license_key">${__$i("License key", "copyspell-ai")}</label>
				<div class="actus-flex">
					<input type="text"
							class="aai-input"
							id="license_key"
							name="license_key"
							value="${settings.key || ""}"
							autocomplete="off"
							placeholder="${__$i("Enter your license key", "copyspell-ai")}">
					<div class="aai-chip aai-license-status"></div>
					<button class="aai-btn-big aai-test-button">${__$i("Activate", "copyspell-ai")}</button>
					<button class="aai-btn-big aai-deactivate-button">${__$i("Deactivate", "copyspell-ai")}</button>
				</div>
				
				<small class="aai-form-help"></small>
				<br>
				<a href="https://copyspell.ai/#home-pricing" target="_blank" rel="noopener" class="aai-btn-2 aai-btn-outline aai-info-btn">${__$i("Get a License Key from Actus Works", "copyspell-ai")}</a>
			</div>
		</div>
	</div>
	`;
}
let DATA$h = window.copyspell_ai_admin || {};
class copyspellAIPanel {
  // ────────────────────────────────────
  constructor(args = {}) {
    if (typeof args == "string") args = { clss: args };
    this.panel = null;
    this.clss = args.clss || "";
    this.action = null;
    this.onAction = args.onAction || (() => {
    });
    this.target = args.target || document.body;
    this.create();
    this.events();
  }
  // MARK: Open
  // ────────────────────────────────────
  // Creates and Opens the panel
  // ────────────────────────────────────
  open() {
    setTimeout(() => {
      this.panel.classList.add("open");
    }, 0);
    return this;
  }
  // MARK: Close
  // ────────────────────────────────────
  close() {
    this.panel.classList.remove("open");
    setTimeout(() => {
      const overlay = document.querySelector(".aai-panel-overlay");
      if (overlay) overlay.remove();
      this.panel.remove();
      this.panel = null;
    }, 500);
  }
  // MARK: Create
  // ────────────────────────────────────
  // Creates the panel and appends it to the body.
  // ────────────────────────────────────
  create() {
    if (this.panel) return this.panel;
    this.panel = document.createElement("div");
    this.panel.className = "aai-panel";
    if (this.clss) this.panel.classList.add(this.clss);
    this.panel.innerHTML = this.panelHeader() + this.panelContent() + this.panelFooter();
    this.target.appendChild(this.panel);
    this.$el = this.panel;
    this.$header = this.panel.querySelector(".aai-panel-header");
    this.$body = this.panel.querySelector(".aai-panel-body");
    this.$footer = this.panel.querySelector(".aai-panel-footer");
    this.$close = this.panel.querySelector(".aai-panel-close");
    return this.panel;
  }
  // MARK: Events
  // ────────────────────────────────────
  events() {
    this.panel.querySelector(".aai-panel-close").onclick = this.close.bind(this);
    this.panel.querySelectorAll(".aai-panel-body .aai-btn").forEach((btn) => {
      btn.onclick = () => {
        this.action = btn.getAttribute("alt");
        this.onAction(this.action);
      };
    });
  }
  // MARK: HTML header
  // ────────────────────────────────────
  panelHeader() {
    return `
			<div class="aai-panel-header">
				<img src="${DATA$h.logo}" alt="CopySpell AI Logo" class="aai-panel-logo">
				<span>CopySpell AI</span>
				<button class="aai-panel-close" title="Close">&times;</button>
			</div>
		`;
  }
  // MARK: HTML content
  // ────────────────────────────────────
  panelContent(content = "") {
    return `
			<div class="aai-panel-body">${content}</div>
		`;
  }
  // MARK: HTML buttons
  // ────────────────────────────────────
  panelFooter() {
    return `
			<div class="aai-panel-footer"></div>
		`;
  }
}
const promptOptions = {};
promptOptions.el = {
  "audiences": [
    "γενικό κοινό",
    "διαδικτυακοί αγοραστές",
    "αγοραστές για πρώτη φορά",
    "επαναλαμβανόμενοι πελάτες",
    "αγοραστές πολυτελείας",
    "καταναλωτές με περιορισμένο προϋπολογισμό",
    "κυνηγοί προσφορών",
    "αγοραστές που συγκρίνουν",
    "πιστοί σε μάρκες",
    "παρορμητικοί αγοραστές",
    "αγοραστές που αναζητούν την ευκολία",
    "αγοραστές μέσω κινητού",
    "αγοραστές μέσω κοινωνικών μέσων",
    "-",
    "γονείς",
    "φοιτητές",
    "εκπαιδευτικοί",
    "Gen Alpha (2013+)",
    "Gen Z (1997–2012)",
    "Millennials (1981–1996)",
    "Generation X (1965–1980)",
    "Baby Boomers (1946–1964)",
    "ηλικιωμένοι",
    "-",
    "λάτρεις της μόδας/ομορφιάς",
    "λάτρεις της υγείας και ευεξίας",
    "λάτρεις της φυσικής κατάστασης",
    "γαστρονόμοι & μάγειρες στο σπίτι",
    "gamers",
    "ταξιδιώτες",
    "ιδιοκτήτες κατοικιδίων",
    "τεχνολογικά καταρτισμένοι χρήστες",
    "βιβλιόφιλοι/αναγνώστες",
    "λάτρεις DIY",
    "λάτρεις της μουσικής",
    "λάτρεις ταινιών/σειρών",
    "λάτρεις τέχνης & design",
    "λάτρεις αυτοκινήτων",
    "οπαδοί αθλημάτων",
    "κηπουροί",
    "καταναλωτές lifestyle",
    "οικολογικά ευαισθητοποιημένοι αγοραστές",
    "-",
    "freelancers",
    "ιδιοκτήτες μικρών επιχειρήσεων",
    "δημιουργικοί επαγγελματίες",
    "νέοι επαγγελματίες",
    "επιχειρηματίες",
    "στελέχη μεγάλων επιχειρήσεων",
    "επενδυτές"
  ],
  "tones": [
    "εμπορικό",
    "ενημερωτικό",
    "ουδέτερο",
    "αξιόπιστο",
    "πειστικό",
    "παρακινητικό",
    "φιλικό",
    "ανεπίσημο",
    "επαγγελματικό",
    "αντικειμενικό",
    "-",
    "πολυτελές",
    "αποκλειστικό",
    "κομψό",
    "εκλεπτυσμένο",
    "-",
    "ευδιάθετο",
    "παιχνιδιάρικο",
    "χιουμοριστικό",
    "τολμηρό",
    "εκκεντρικό",
    "αιχμηρό",
    "κουλ",
    "-",
    "συμπονετικό",
    "καθησυχαστικό",
    "συνομιλιακό",
    "ειλικρινές",
    "αυθεντικό",
    "συναισθηματικό",
    "αισιόδοξο",
    "-",
    "εκπαιδευτικό",
    "τεχνικό",
    "μινιμαλιστικό",
    "λεπτομερές",
    "περιγραφικό",
    "-",
    "χαλαρό",
    "ενθουσιώδες",
    "δυναμικό",
    "καινοτόμο",
    "έξυπνο",
    "επείγον"
  ],
  "priorities": [
    "λέξεις-κλειδιά SEO",
    "συνέπεια με το brand",
    "προβολή πλεονεκτημάτων προϊόντος",
    "αφηγηματικότητα",
    "λίστες",
    "τεχνική ακρίβεια",
    "συναισθηματισμός",
    "πειθώ",
    "αναγνωσιμότητα",
    "οπτική μορφοποίηση",
    "συντομία",
    "αλληλεπίδραση",
    "χτίσιμο εμπιστοσύνης",
    "στοιχεία βασισμένα σε δεδομένα",
    "εστίαση σε κάλεσμα για δράση",
    "βάθος πληροφορίας",
    "σύγκριση χαρακτηριστικών",
    "προσέγγιση προβλήματος-λύσης",
    "συμμόρφωση με κανονισμούς",
    "απλότητα",
    "βελτιστοποίηση εμπειρίας χρήστη",
    "διαφοροποίηση στην αγορά"
  ],
  "sizes": [
    ["50-100 words", "Πολύ Σύντομο/Teaser", "Σύντομα αποσπάσματα για highlights, αναρτήσεις στα social media ή σύντομες περιγραφές προϊόντων."],
    ["100-200 words", "Σύντομη Περιγραφή", "Συνοπτικές περιγραφές προϊόντων, διαφημιστικά κείμενα ή περιλήψεις."],
    ["150-300 words", "Τυπικό Περιεχόμενο Προϊόντος", "Ισορροπημένη λεπτομέρεια, συνηθισμένο σε σελίδες προϊόντων ηλεκτρονικού εμπορίου."],
    ["300-500 words", "Μεσαίου Μήκους Άρθρο", "Αρκετός χώρος για μέτριο βάθος, βελτιστοποίηση SEO και αφήγηση ιστοριών."],
    ["500-800 words", "Αναλυτικό Περιεχόμενο", "Για αναρτήσεις σε blog, λεπτομερείς κριτικές προϊόντων ή οδηγούς με πολλαπλές ενότητες."],
    ["800-1200 words", "Εκτενής Επισκόπηση", "Ιδανικό για pillar pages, αυθεντικές αναρτήσεις ή περιεχόμενο με στόχο το SEO."],
    ["1200-2000 words", "Πλήρης Οδηγός", "Πολύ λεπτομερές περιεχόμενο για ηγεσία σκέψης, tutorials ή εκτενείς συγκρίσεις."],
    ["2000+ words", "Εις Βάθος Ανάλυση / Απόλυτος Οδηγός", "Εξαιρετικά λεπτομερές περιεχόμενο που σχεδιάζεται για μέγιστη αυθεντία και SEO αξία."]
  ],
  "excerptSizes": [
    ["≤ 160 characters", "Σύντομο", "Φιλικό προς SEO"],
    ["30-100 words", "Μεσαίο", "Συνοπτικό αλλά ενημερωτικό"],
    ["80-200 words", "Μακροσκελές", "Λεπτομερές και περιεκτικό"]
  ],
  "frameworks": [
    ["Με έμφαση στα οφέλη για τον πελάτη", "Επικεντρώνεται σε αυτό που κερδίζει ο πελάτης και όχι απλώς στο τι κάνει το προϊόν. Ιδανικό για ξεκάθαρες, πελατοκεντρικές περιγραφές προϊόντων."],
    ["AIDA (Προσοχή, Ενδιαφέρον, Επιθυμία, Δράση)", "Τραβά την προσοχή, χτίζει περιέργεια, δημιουργεί επιθυμία και ωθεί στη δράση. Τέλειο για πειστικό marketing και διαφημιστικά κείμενα."],
    ["PAS (Πρόβλημα, Εντάσεις, Λύση)", "Αναδεικνύει ένα πρόβλημα, εντείνει το συναίσθημα και παρουσιάζει το προϊόν ως τη λύση. Ισχυρό εργαλείο για συναισθηματική απήχηση."]
  ],
  "languages": [
    ["Same as the content", "Ίδια με το περιεχόμενο"],
    ["en", "Αγγλικά"],
    ["el", "Ελληνικά"],
    ["es", "Ισπανικά"],
    ["fr", "Γαλλικά"],
    ["de", "Γερμανικά"],
    ["it", "Ιταλικά"],
    ["pt", "Πορτογαλικά"],
    ["ru", "Ρωσικά"],
    ["zh", "Κινέζικα"],
    ["ja", "Ιαπωνικά"],
    ["ko", "Κορεατικά"],
    ["ar", "Αραβικά"],
    ["tr", "Τουρκικά"],
    ["nl", "Ολλανδικά"],
    ["pl", "Πολωνικά"],
    ["sv", "Σουηδικά"],
    ["no", "Νορβηγικά"],
    ["da", "Δανέζικα"],
    ["fi", "Φινλανδικά"],
    ["he", "Εβραϊκά"],
    ["uk", "Ουκρανικά"],
    ["cs", "Τσέχικα"],
    ["hu", "Ουγγρικά"],
    ["ro", "Ρουμανικά"],
    ["bg", "Βουλγαρικά"],
    ["sr", "Σερβικά"],
    ["hr", "Κροατικά"],
    ["sk", "Σλοβακικά"],
    ["sl", "Σλοβενικά"],
    ["th", "Ταϊλανδικά"],
    ["vi", "Βιετναμικά"],
    ["id", "Ινδονησιακά"],
    ["ms", "Μαλαισιανά"],
    ["hi", "Χίντι"],
    ["bn", "Μπενγκάλι"]
  ]
};
promptOptions.en = {
  "audiences": [
    "general public",
    "online shoppers",
    "first-time buyers",
    "repeat customers",
    "luxury buyers",
    "budget-conscious customers",
    "deal seekers",
    "comparison shoppers",
    "brand loyalists",
    "impulse buyers",
    "convenience-driven shoppers",
    "mobile shoppers",
    "social media shoppers",
    "-",
    "parents",
    "students",
    "educators",
    "Gen Alpha (2013+)",
    "Gen Z (1997–2012)",
    "Millennials (1981–1996)",
    "Generation X (1965–1980)",
    "Baby Boomers (1946–1964)",
    "senior citizens",
    "-",
    "fashion/beauty enthusiasts",
    "health & wellness enthusiasts",
    "fitness enthusiasts",
    "foodies & home cooks",
    "gamers",
    "travelers",
    "pet owners",
    "tech-savvy users",
    "bookworms/readers",
    "DIY hobbyists",
    "music lovers",
    "movie/TV series fans",
    "art & design lovers",
    "car enthusiasts",
    "sports fans",
    "gardeners",
    "lifestyle consumers",
    "eco-conscious shoppers",
    "-",
    "freelancers",
    "small business owners",
    "creative professionals",
    "young professionals",
    "entrepreneurs",
    "enterprise decision-makers",
    "investors"
  ],
  "tones": [
    "sales-oriented",
    "informative",
    "neutral",
    "trustworthy",
    "persuasive",
    "motivational",
    "friendly",
    "casual",
    "professional",
    "objective",
    "-",
    "luxury",
    "exclusive",
    "elegant",
    "sophisticated",
    "-",
    "upbeat",
    "playful",
    "witty",
    "bold",
    "quirky",
    "edgy",
    "cool",
    "-",
    "empathetic",
    "reassuring",
    "conversational",
    "honest",
    "authentic",
    "sentimental",
    "optimistic",
    "-",
    "educational",
    "technical",
    "minimalist",
    "detailed",
    "descriptive",
    "-",
    "relaxed",
    "excited",
    "dynamic",
    "innovative",
    "clever",
    "urgent"
  ],
  "priorities": [
    "SEO keywords",
    "brand consistency",
    "product benefits highlighting",
    "storytelling",
    "bullet-point clarity",
    "technical accuracy",
    "emotional appeal",
    "persuasion",
    "readability",
    "visual formatting",
    "conciseness",
    "engagement",
    "trust-building",
    "data-driven details",
    "call-to-action focus",
    "informational depth",
    "feature comparison",
    "problem-solution framing",
    "compliance with regulations",
    "simplicity",
    "user experience optimization",
    "market differentiation"
  ],
  "sizes": [
    ["50-100 words", "Ultra-Short/Teaser", "Quick snippets for highlights, social posts, or short product blurbs."],
    ["100-200 words", "Short Description", "Concise product descriptions, ad copy, or summaries."],
    ["150-300 words", "Standard Product Content", "Balanced detail, common for ecommerce product pages."],
    ["300-500 words", "Medium-Length Article", "Enough space for moderate depth, SEO optimization, and storytelling."],
    ["500-800 words", "Detailed Content", "For blog posts, in-depth product reviews, or guides with multiple sections."],
    ["800-1200 words", "Long-Form Overview", "Great for pillar pages, authoritative posts, or SEO-focused content."],
    ["1200-2000 words", "Comprehensive Guide", "Highly detailed content for thought leadership, tutorials, or thorough comparisons."],
    ["2000+ words", "Deep Dive / Ultimate Guide", "Extremely in-depth resources designed for maximum authority and SEO value."]
  ],
  "excerptSizes": [
    ["≤ 160 characters", "Short", "SEO-friendly"],
    ["30-100 words", "Medium", "Concise yet informative"],
    ["80-200 words", "Long", "Detailed and comprehensive"]
  ],
  "frameworks": [
    ["Benefit-driven", "Focuses on what the customer gains, not just what the product does. Great for clear, customer-centric product descriptions."],
    ["AIDA (Attention, Interest, Desire, Action)", "Grabs attention, builds curiosity, sparks desire, then pushes for action. Perfect for persuasive marketing and ad copy."],
    ["PAS (Problem, Agitate, Solve)", "Highlights a pain point, amplifies the discomfort, then presents your product as the solution. Powerful for emotional hooks."]
  ],
  "languages": [
    ["Same as the content", "Same as the content"],
    ["en", "English"],
    ["el", "Greek"],
    ["es", "Spanish"],
    ["fr", "French"],
    ["de", "German"],
    ["it", "Italian"],
    ["pt", "Portuguese"],
    ["ru", "Russian"],
    ["zh", "Chinese"],
    ["ja", "Japanese"],
    ["ko", "Korean"],
    ["ar", "Arabic"],
    ["tr", "Turkish"],
    ["nl", "Dutch"],
    ["pl", "Polish"],
    ["sv", "Swedish"],
    ["no", "Norwegian"],
    ["da", "Danish"],
    ["fi", "Finnish"],
    ["he", "Hebrew"],
    ["uk", "Ukrainian"],
    ["cs", "Czech"],
    ["hu", "Hungarian"],
    ["ro", "Romanian"],
    ["bg", "Bulgarian"],
    ["sr", "Serbian"],
    ["hr", "Croatian"],
    ["sk", "Slovak"],
    ["sl", "Slovenian"],
    ["th", "Thai"],
    ["vi", "Vietnamese"],
    ["id", "Indonesian"],
    ["ms", "Malay"],
    ["hi", "Hindi"],
    ["bn", "Bengali"]
  ]
};
const Marketing = {};
Marketing.groups = {
  social: "Social Media Post",
  adv: "Advertisement",
  email: "Email Newsletter",
  blog: "Blog Post"
  //testimonial: 'Customer Testimonial',
};
Marketing.groupsShort = {
  social: "social post",
  adv: "advertisement",
  email: "email",
  blog: "blog post"
  //testimonial: 'customer testimonial',
};
Marketing.media = {
  social: ["Facebook Post", "Instagram Post", "LinkedIn Post", "Tweet"],
  adv: ["Facebook Ad", "Instagram Ad", "Google Search Ad", "Google Display Ad", "YouTube Ad", "TikTok Ad", "LinkedIn Ad", "Pinterest Ad"]
};
Marketing.types = {
  social: [
    "🛒 Product Showcase",
    "🎥 Demo / Tutorial",
    "🌟 Lifestyle / Storytelling",
    "💰 Promotion / Offer",
    "🧠 Educational / Value",
    "📝 Customer Review",
    "🆚 Comparison / Feature Highlight",
    "🆕 New Arrival / Back in Stock",
    "🎁 Seasonal / Themed",
    "🎬 Behind the Scenes / Brand Story",
    "🎯 Tips & Tricks",
    "💬 Poll / Question to Audience"
  ],
  adv: [
    "📢 Product Promotion",
    "💸 Discount / Offer",
    "🚀 Launch / New Arrival",
    "🏷️ Brand Awareness",
    "🎯 Retargeting",
    "🎄 Seasonal / Holiday",
    "🌟 Testimonial / Social Proof",
    "🆚 Comparison",
    "🎬 Video / Visual Showcase",
    "⏰ Limited-Time / Urgency",
    "🧩 Problem-Solution Ad",
    "💡 Value Proposition Ad",
    "🤝 Partnership / Collaboration Ad"
  ],
  email: [
    "💌 Promotional",
    "👋 Welcome",
    "🚀 Product Launch",
    "🛍️ Product Highlight",
    "💰 Offer / Discount",
    "🆕 New Collection",
    "🛒 Abandoned Cart",
    "🙏 Thank You",
    "💤 Re-engagement",
    "📦 Post-Purchase",
    "📰 Newsletter",
    "🎄 Seasonal",
    "🧠 Educational / Tips",
    "📖 Storytelling",
    "🎉 Milestone / Loyalty",
    "🗣️ Feedback Request",
    "👑 VIP / Exclusive Access"
    //'🎯 Personalized Recommendation'
  ],
  blog: [
    "🛍️ Product Blog",
    "🧭 How-To Guide",
    "🧩 Problem-Solution",
    "📊 Industry Insights",
    "🆚 Comparison",
    "📚 Case Study",
    "🧾 Listicle",
    "📣 Announcement",
    "💭 Opinion / Thought Leadership",
    "📖 Storytelling",
    "📈 Data-Driven Insights",
    "🗞️ News / Trend Analysis"
  ],
  testimonial: [
    "🛒 Product Experience",
    "🔁 Before and After",
    "🧩 Problem-Solution",
    "💎 Brand Loyalty",
    "🧭 Customer Journey",
    "💖 Emotional",
    "👨‍⚕️ Professional Endorsement",
    "✨ Feature-specific Praise",
    "🛠️ Customer Service Testimonial",
    "📈 Impact / ROI Testimonial",
    "🎬 Video Testimonial",
    "🌟 Influencer Endorsement"
  ]
};
Marketing.descriptions = {
  social: [
    "Highlights a specific product’s key features and benefits.",
    "Shows how to use the product or demonstrates it in action.",
    "Connects the product to a real-life story or lifestyle moment.",
    "Announces sales, discounts, or limited-time deals.",
    "Shares knowledge or tips that relate to the product’s niche.",
    "Features a real user’s feedback or testimonial post.",
    "Compares your product with alternatives or emphasizes unique features.",
    "Announces new product drops or restocks.",
    "Aligns the product with holidays, seasons, or special events.",
    "Shares your brand’s personality or creative process.",
    "Reposts or highlights content made by real customers.",
    "Offers helpful product-related advice or creative uses.",
    "Encourages engagement through questions or opinions."
  ],
  adv: [
    "A direct ad showcasing a product’s key value or offer.",
    "Focuses on price drops, sales, or limited-time discounts.",
    "Introduces a new product or upcoming release.",
    "Strengthens brand recognition with an emotional or visual message.",
    "Targets users who interacted before, reminding them to complete a purchase.",
    "Tailored ad for specific holidays, seasons, or events.",
    "Features customer reviews or endorsements to build trust.",
    "Shows how your product outperforms competitors or alternatives.",
    "Focuses on visuals or short-form video storytelling.",
    "Creates urgency by emphasizing limited-time availability or deadlines.",
    "Addresses a common pain point and positions your product as the solution.",
    "Highlights your main unique selling proposition or value.",
    "Announces collaborations or co-branded campaigns."
  ],
  email: [
    "Sends general promotions or special offers to subscribers.",
    "Welcomes new subscribers and introduces your brand.",
    "Announces a new product or collection release.",
    "Spotlights specific products or categories.",
    "Encourages purchases with discounts or coupons.",
    "Highlights new arrivals or seasonal collections.",
    "Reminds customers to complete their cart purchase.",
    "Thanks customers for their purchase or support.",
    "Re-engages inactive subscribers or past customers.",
    "Follows up after purchase to encourage repeat orders or feedback.",
    "Shares regular news, articles, or updates from your brand.",
    "Celebrates holidays or seasonal occasions with themed messages.",
    "Provides educational tips or valuable information.",
    "Tells a story to build emotional connection with your audience.",
    "Rewards loyal customers or celebrates milestones.",
    "Requests feedback, reviews, or testimonials from customers.",
    "Offers exclusive content or deals to VIP customers."
    //'Sends product suggestions based on user behavior or preferences.'
  ],
  blog: [
    "Explains and promotes a specific product or collection.",
    "Provides a step-by-step tutorial or guide.",
    "Starts with a relatable problem and offers your product as the solution.",
    "Shares expert insights or analysis about your industry.",
    "Compares your product to alternatives in an objective way.",
    "Details a real customer success story or internal brand case study.",
    "Presents information in a list format for easier reading.",
    "Announces company or product updates and releases.",
    "Expresses professional opinions or thought leadership ideas.",
    "Tells a story to connect emotionally with readers.",
    "Uses data or research to strengthen credibility.",
    "Analyzes recent trends or news relevant to your audience."
  ],
  testimonial: [
    "Shows how a customer experienced and benefited from your product.",
    "Presents before-and-after results that demonstrate transformation.",
    "Describes how your product solved a specific customer problem.",
    "Highlights repeat purchases or long-term trust from loyal users.",
    "Tells the customer’s full journey from discovery to satisfaction.",
    "Focuses on emotional relief or satisfaction after using your product.",
    "Features an expert or professional endorsement.",
    "Praises a specific feature or function customers loved most.",
    "Commends your brand’s customer support or after-sales service.",
    "Quantifies the positive impact or return on investment.",
    "Shares an authentic video testimonial from a real customer.",
    "Highlights content or endorsements from influencers or partners."
  ]
};
const CFG = {};
CFG.marketing = Marketing;
let $$7 = jQuery;
const SDK$4 = window.CopyspellAI || {};
const DATA$g = window.copyspell_ai_admin || {};
const { __: __$h, _x: _x$g, _n: _n$g, sprintf: sprintf$g } = wp.i18n;
class MarketingResultRenderer {
  constructor() {
    this.suggestions = [];
    this.refinements = [];
    this.visualSuggestions = [];
    this.hashtags = [];
    this.prefs = {};
    this.cur = { suggestion: 0 };
    this.$container = null;
    this.$card = null;
  }
  // MARK: Render
  // ────────────────────────────────────
  async render(response, prefs, $container) {
    this.$container = $container || this.$container;
    this.prefs = prefs || this.prefs || {};
    let content = response || {};
    if (response.json)
      content = response.json || {};
    this.suggestions = (content == null ? void 0 : content.suggestions) || [];
    this.visualSuggestions = (content == null ? void 0 : content.visualSuggestions) || [];
    this.refinements = (content == null ? void 0 : content.refinementPrompts) || [];
    this.hashtags = (content == null ? void 0 : content.hashtags) || [];
    this.prefs = prefs || {};
    this.$container = $container;
    this.cur.suggestion = 0;
    if (!this.suggestions.length) {
      $container.html('<div class="aai-no-content">' + __$h("No marketing content found", "copyspell-ai") + "</div>");
      return;
    }
    let html = await this.renderResultCard();
    let extras = this.renderExtras();
    $container.html(`
			<div class="aai-marketing-result-output aai-marketing-preview">
				<div class="aai-flex">
					<div class="aai-marketing-cards">
						<div class="aai-marketing-cards-buttons">
							${this.suggestions.map((s, i) => `
								<button class="aai-btn medium ${this.cur.suggestion === i ? "aai-active" : ""}">${__$h("version", "copyspell-ai")} ${i + 1}</button>
							`).join("")}
						</div>
						<div class="aai-marketing-card">
							${html}
						</div>
					</div>
					<div class="aai-marketing-extras">${extras}</div>
				</div>
			</div>
		`);
    this.$card = $container.find(".aai-marketing-card");
    this.$extras = $container.find(".aai-marketing-extras");
    this.bindEvents($container);
    SDK$4.events.emit("marketing-rendered", { ...this });
  }
  // MARK: Bind Events
  // ────────────────────────────────────
  bindEvents($container) {
    $container.off("click", ".aai-marketing-cards-buttons button");
    $container.on("click", ".aai-marketing-cards-buttons button", async (e) => {
      e.stopPropagation();
      e.preventDefault();
      const $btn = $$7(e.target).closest("button.aai-btn");
      $container.find(".aai-marketing-cards-buttons button").removeClass("aai-active");
      $btn.addClass("aai-active");
      this.cur.suggestion = parseInt($btn.index());
      let html = await this.renderResultCard();
      let extras = this.renderExtras();
      this.$card.html(html);
      this.$extras.html(extras);
      SDK$4.events.emit("marketing-rendered", { ...this });
    });
    SDK$4.events.emit("marketing-events", { ...this });
  }
  // MARK: Render Result Card
  // ────────────────────────────────────
  async renderResultCard(postBody = "", postImage = "") {
    var _a;
    postBody = postBody || this.suggestions[this.cur.suggestion] || "";
    postImage = postImage || this.image || "";
    if (!postImage) {
      let productData = await getProductData(DATA$g.post.id);
      this.image = ((_a = productData.imageUrls) == null ? void 0 : _a[0]) || "";
      postImage = this.image;
    }
    let bodyHtml = postBody;
    if (this.prefs.group === "social" || this.prefs.group === "adv") {
      bodyHtml = markdownToHTML(postBody);
    }
    let html = `
		<div class="aai-card aai-card-result" data-group="${this.prefs.group || "social"}" data-medium="${(this.prefs.mediumName || "facebook-post").toLowerCase().replace(/ /g, "-")}">
			
			<div class="aai-card-result-header">
			
				${this.prefs.group === "blog" && postImage ? `<div class="aai-card-result-image"><img class="aai-post-image" src="${postImage}" alt="Post Image"></div>` : ""}

				${this.prefs.group === "email" ? `${SVG.email}` : ""}

				${this.prefs.group === "social" ? `${SVG.user}
					<div class="aai-card-result-user-info">
						${DATA$g.siteName || "CopySpell AI"}<br>
						
						${this.prefs.medium < 2 ? `<span>Just now</span>` : ""}

						${this.prefs.medium == 2 ? `<span>7642 followers</span><br><span>16m • 🌎</span>` : ""}

						${this.prefs.medium == 3 ? `<span>@${(DATA$g.siteName || "copyspellai").toLowerCase().replace(/ /g, "")} • 1h</span>` : ""}

					</div>` : ""}
				
			</div>

			${this.prefs.group === "social" && this.prefs.medium == 1 ? (postImage ? `<div class="aai-card-result-image"><img class="aai-post-image" src="${postImage}" alt="Post Image"></div>` : "") + `<img class="aai-insta-icons" src="/wp-content/plugins/copyspell-ai/img/insta-icons.jpg" alt="Instagram Icons">` : ""}
			

			<div class="aai-card-result-body">
				${bodyHtml}
			</div>

			<div class="aai-card-result-image">
				${this.prefs.group === "social" && postImage && (this.prefs.medium == 0 || this.prefs.medium == 2 || this.prefs.medium == 3) ? `<img class="aai-post-image" src="${postImage}" alt="Post Image">` : ""}
			</div>

			<div class="aai-card-result-footer">
				${this.prefs.group === "social" && this.prefs.medium == 0 ? `<img src="/wp-content/plugins/copyspell-ai/img/facebook-footer.jpg" alt="Facebook Footer Image">` : ""}
				${this.prefs.group === "social" && this.prefs.medium == 2 ? `<img src="/wp-content/plugins/copyspell-ai/img/linkedin-footer.jpg" alt="LinkedIn Footer Image">` : ""}
				${this.prefs.group === "social" && this.prefs.medium == 3 ? `<img src="/wp-content/plugins/copyspell-ai/img/tweet-icons.jpg" alt="LinkedIn Footer Image">` : ""}
			</div>
		</div>
		`;
    return html;
  }
  // MARK: Render Extras (Visual Suggestions & Hashtags)
  // ────────────────────────────────────
  renderExtras() {
    let HTML = "";
    if (this.refinements && this.refinements.length) {
      HTML += `
				<div class="aai-marketing-refine">
					<h4>✍️ ${__$h("Refinement Suggestions", "copyspell-ai")}</h4>
					${this.renderRefinement()}
				</div>
			`;
    }
    if (this.hashtags && this.hashtags.length) {
      HTML += `
				<div class="aai-marketing-hashtags">
					<h4># ${__$h("Hashtags", "copyspell-ai")}</h4>
					<div class="aai-hashtags-list">
						${this.hashtags.map((tag) => `<span class="aai-chip">${tag}</span>`).join("")}
					</div>
				</div>
			`;
    }
    HTML += '<div data-copyspell-slot="marketing-render-extras"></div>';
    if (this.visualSuggestions && this.visualSuggestions.length) {
      HTML += `
				<div class="aai-image-prompts">
					<h4>🎨 ${__$h("Visual Suggestions", "copyspell-ai")}</h4>
					<div class="aai-marketing-visual-controls"></div>
					<ul>
						${this.visualSuggestions.map((vs) => `<li>${vs}</li>`).join("")}
					</ul>
				</div>
			`;
    }
    return HTML;
  }
  // MARK: Refinement
  // ────────────────────────────────────
  renderRefinement(prompts) {
    prompts = prompts || this.refinements[this.cur.suggestion] || [];
    let HTML = `
			<div class="aai-refinement-prompts">
				<div class="aai-refinement-custom">
					<textarea class="aai-textarea" placeholder="${__$h("refine the content—what would you like different?...", "copyspell-ai")}"></textarea>
					<button class="aai-btn aai-btn-primary aai-refinement-custom-submit">${SVG.play}</button>
				</div>`;
    if (prompts) {
      prompts.forEach((prompt2) => {
        HTML += `<span class="aai-chip">${prompt2}</span>`;
      });
      HTML += `<span class="aai-chip aai-custom" alt="longer">${__$h("Make it longer", "copyspell-ai")}</span>`;
      HTML += `<span class="aai-chip aai-custom" alt="shorter">${__$h("Make it shorter", "copyspell-ai")}</span>`;
    }
    HTML += `
			</div>`;
    return HTML;
  }
}
const MarketingResult = new MarketingResultRenderer();
let $$6 = jQuery;
const { __: __$g, _x: _x$f, _n: _n$f, sprintf: sprintf$f } = wp.i18n;
class AIHistory {
  // ────────────────────────────────────
  constructor(id, target, context) {
    this.id = id || 0;
    this.$target = target || null;
    this.context = context || "product";
    if (this.context == "content") this.context = "product";
    this.$container = null;
    this.$list = null;
    this.jobId = 0;
    this.records = null;
    this.allIds = [];
    this.ids = [];
    this._eventsAttached = false;
    this.totalPages = 0;
    this.currentPage = 1;
    this.itemsPerPage = 20;
    this.totalItems = 0;
    this.init();
  }
  // MARK: Init
  // ────────────────────────────────────
  async init() {
    this.$container = document.createElement("div");
    this.$container.className = "aai-product-records-list";
    this.$target.appendChild(this.$container);
    this.$container.innerHTML = `
			<div class="aai-initial-loader">
				<div class="aai-loader-container">
					${SVG.loader7}
					<p>Loading records...</p>
				</div>
			</div>
		`;
    await this.fetchRecords();
    log("HISTORY records", this.records);
    this.render();
    this.events();
  }
  // MARK: Fetch Records
  // ────────────────────────────────────
  async fetchRecords() {
    this.fetching = true;
    try {
      let result;
      console.log("this.context", this.context);
      if (this.context == "product") {
        result = await AIH.getRecordsByContext(this.context, this.id, this.currentPage, this.itemsPerPage);
      } else {
        result = await AIH.getRecordsByContext(this.context, this.id, this.currentPage, this.itemsPerPage);
      }
      this.records = result.records || [];
      this.totalItems = result.total || result.count || this.records.length;
      this.totalPages = Math.ceil(this.totalItems / this.itemsPerPage);
      if (this.currentPage === 1) {
        this.allIds = this.records.map((r) => Number(r.id));
      }
    } catch (error) {
      log("❌ Failed to fetch records:", error);
      this.records = [];
    }
    this.fetching = false;
    if (!this.records) {
      this.records = [];
    }
    this.setCount();
  }
  // MARK: Render
  // ────────────────────────────────────
  render() {
    if (this.fetching) {
      this.$container.innerHTML = `
				<div class="aai-initial-loader">
					<div class="aai-loader-container">
						${SVG.loader7}
						<p>Loading products...</p>
					</div>
				</div>
			`;
      if (!this._renderInterval) {
        this._renderInterval = setInterval(() => {
          if (!this.fetching) {
            clearInterval(this._renderInterval);
            this._renderInterval = null;
            if (this.context == "product") {
              this.renderProducts();
            } else {
              this.renderMarketing();
            }
          }
        }, 100);
      }
      return;
    }
    if (this.context == "product") {
      this.renderProducts();
    } else {
      this.renderMarketing();
    }
  }
  // MARK: Render Marketing
  // ────────────────────────────────────
  renderMarketing() {
    if (!this.records.length) {
      this.$container.innerHTML = '<div class="aai-no-records">No records found</div>';
      return;
    }
    let dsbl = this.records.length === 0 ? " disabled" : "";
    let html = "";
    html += `
			<div class="aai-select-all-container">
				<button class="aai-btn aai-btn-secondary aai-select-all-btn">Select All</button>
				<button class="aai-btn aai-btn-secondary aai-deselect-all-btn">Deselect All</button>
				<div class="actus-flex-1"></div>
				<button class="aai-btn aai-btn-secondary aai-retry-btn"${dsbl}>Retry Failed</button>
				<button class="aai-btn aai-btn-secondary aai-regenerate-btn"${dsbl}>Regenerate Selected</button>
			</div>
			<div class="aai-products-grid aai-job-products-grid">
		`;
    html += `
			<div class="aai-product-header">
				<div class="aai-product-checkbox"><input type="checkbox" class="aai-product-select-all"></div>
				<div class="aai-product-date">Date</div>
				<div class="aai-product-status">Type</div>
				<div class="aai-product-medium">Medium</div>
				<div class="aai-product-content">Content</div>
				<div class="aai-product-url">Actions</div>
			</div>
		`;
    this.records.forEach((row) => {
      var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n2, _o, _p, _q, _r, _s, _t, _u;
      row.id = Number(row.id);
      row.content = row.content || {};
      ((_b = (_a = row.content) == null ? void 0 : _a.model) == null ? void 0 : _b.replace(/-/g, " ")) || "";
      let clss = "";
      let status = "";
      let final = [];
      if ((_d = (_c = row.content) == null ? void 0 : _c.errors) == null ? void 0 : _d.length) {
        clss = " aai-error-product";
        status += '<span class="aai-error-box">error</span>';
      }
      let date = row.created;
      let humanReadableDate = new Date(date).toLocaleString("el", {
        hour12: false
      });
      humanReadableDate = humanReadableDate.slice(0, -3);
      humanReadableDate = humanReadableDate.replace(",", "<br>");
      if (((_e = row.calldata) == null ? void 0 : _e._type) == "published")
        status += `<span class="aai-success-box">${__$g("published", "copyspell-ai")}</span>`;
      else if (((_f = row.calldata) == null ? void 0 : _f._type) == "original")
        status += `<span class="aai-info-box">${((_g = row.calldata) == null ? void 0 : _g._type) || ""}</span>`;
      else
        status += `<span class="aai-gray-box">${((_h = row.calldata) == null ? void 0 : _h._type) || ""}</span>`;
      status += ((_i = row.calldata) == null ? void 0 : _i._action) ? `<span class="aai-action-box">${((_j = row.calldata) == null ? void 0 : _j._action) || ""}</span>` : "";
      let mediumName = ((_l = (_k = row.calldata) == null ? void 0 : _k.prefs) == null ? void 0 : _l.mediumName) || "";
      if (mediumName) mediumName += "<br>";
      mediumName += ((_r = (_o = CFG.marketing.types) == null ? void 0 : _o[(_n2 = (_m = row.calldata) == null ? void 0 : _m.prefs) == null ? void 0 : _n2.group]) == null ? void 0 : _r[(_q = (_p = row.calldata) == null ? void 0 : _p.prefs) == null ? void 0 : _q.type]) || mediumName;
      html += `
				<div class="aai-product-item${clss}" data-id="${row.id}" data-context="${row.context || "marketing"}">
					<div class="aai-product-checkbox"><input type="checkbox" class="aai-product-select" data-id="${row.id}"></div>
					<div class="aai-product-date">${humanReadableDate}</div>
					<div class="aai-product-status">${status}</div>
					<div class="aai-product-medium">${mediumName}</div>
					<div class="aai-product-content aai-marketing-content">
						${final.length ? `<div class="aai-product-error">${row.content.errors.map((e) => !e.final ? e.error : "").join("<br>")}</div>` : `${((_u = (_t = (_s = row.content) == null ? void 0 : _s.suggestions) == null ? void 0 : _t[0]) == null ? void 0 : _u.substring(0, 200)) || ""}...`}
					</div>
					<div class="aai-product-actions">
						<div class="aai-product-url"><button class="aai-record-delete aai-btn aai-btn-secondary">${SVG.trash}</button></div>
						${row.content.url ? `<div class="aai-product-url"><button class="aai-product-view aai-btn aai-btn-secondary"><a href="${row.content.url}" target="_blank" rel="noopener noreferrer">${SVG.link}</a></button></div>` : ""}
					</div>
				</div>
			`;
    });
    html += "</div>";
    html += this.pagination();
    this.$container.innerHTML = html;
    this.$close = document.createElement("div");
    this.$close.className = "aai-panel-close";
    this.$close.innerHTML = "×";
    this.$container.appendChild(this.$close);
    this.$close.addEventListener("click", () => {
      this.$container.remove();
    });
  }
  // MARK: Render Products
  // ────────────────────────────────────
  renderProducts() {
    if (!this.records.length) {
      this.$container.innerHTML = '<div class="aai-no-records">No records found</div>';
      return;
    }
    let dsbl = this.records.length === 0 ? " disabled" : "";
    let html = "";
    html += `
			<div class="aai-select-all-container">
				<button class="aai-btn aai-btn-secondary aai-select-all-btn">Select All</button>
				<button class="aai-btn aai-btn-secondary aai-deselect-all-btn">Deselect All</button>
				<div class="actus-flex-1"></div>
				<button class="aai-btn aai-btn-secondary aai-retry-btn"${dsbl}>Retry Failed</button>
				<button class="aai-btn aai-btn-secondary aai-regenerate-btn"${dsbl}>Regenerate Selected</button>
			</div>
			<div class="aai-products-grid aai-job-products-grid">
		`;
    html += `
			<div class="aai-product-header">
				<div class="aai-product-checkbox"><input type="checkbox" class="aai-product-select-all"></div>
				<div class="aai-product-date">Date</div>
				<div class="aai-product-status">Type</div>
				<div class="aai-product-title">Title</div>
				<div class="aai-product-content">Excerpt</div>
				<div class="aai-product-url">Actions</div>
			</div>
		`;
    this.records.forEach((row) => {
      var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
      row.id = Number(row.id);
      row.content = row.content || {};
      let modelName = ((_b = (_a = row.content) == null ? void 0 : _a.model) == null ? void 0 : _b.replace(/-/g, " ")) || "";
      let clss = "";
      let status = "";
      let final = [];
      if ((_d = (_c = row.content) == null ? void 0 : _c.errors) == null ? void 0 : _d.length) {
        clss = " aai-error-product";
        status += '<span class="aai-error-box">error</span>';
      }
      let date = row.created;
      let humanReadableDate = new Date(date).toLocaleString("el", {
        hour12: false
      });
      humanReadableDate = humanReadableDate.slice(0, -3);
      humanReadableDate = humanReadableDate.replace(",", "<br>");
      if (((_e = row.calldata) == null ? void 0 : _e._type) == "published")
        status += `<span class="aai-success-box">${__$g("published", "copyspell-ai")}</span>`;
      else if (((_f = row.calldata) == null ? void 0 : _f._type) == "original")
        status += `<span class="aai-info-box">${((_g = row.calldata) == null ? void 0 : _g._type) || ""}</span>`;
      else
        status += `<span class="aai-gray-box">${((_h = row.calldata) == null ? void 0 : _h._type) || ""}</span>`;
      status += ((_i = row.calldata) == null ? void 0 : _i._action) ? `<span class="aai-action-box">${((_j = row.calldata) == null ? void 0 : _j._action) || ""}</span>` : "";
      html += `
				<div class="aai-product-item${clss}" data-id="${row.id}" data-context="${row.context || "product"}" data-type="${((_k = row.calldata) == null ? void 0 : _k._type) || ""}">
					<div class="aai-product-checkbox"><input type="checkbox" class="aai-product-select" data-id="${row.id}"></div>
					<div class="aai-product-date">${humanReadableDate}</div>
					<div class="aai-product-status">${status}</div>
					<div class="aai-product-title">
						${row.content.title || ""}
						<div class="aai-model-name">${modelName ? modelName : ""}</div>
						${((_m = (_l = row.content) == null ? void 0 : _l.errors) == null ? void 0 : _m.length) ? `<div class="aai-product-error-summary">${row.content.errors.map((e) => `<div class="aai-error-message">${e.error}</div>`).join("")}</div>` : ""}
					</div>
					<div class="aai-product-content">
						${final.length ? `<div class="aai-product-error">${row.content.errors.map((e) => !e.final ? e.error : "").join("<br>")}</div>` : `${row.content.excerpt || ""}`}
					</div>
					<div class="aai-product-actions">
						<div class="aai-product-url"><button class="aai-record-delete aai-btn aai-btn-secondary">${SVG.trash}</button></div>
						${row.content.url ? `<div class="aai-product-url"><button class="aai-product-view aai-btn aai-btn-secondary"><a href="${row.content.url}" target="_blank" rel="noopener noreferrer">${SVG.link}</a></button></div>` : ""}
					</div>
				</div>
			`;
    });
    html += "</div>";
    html += this.pagination();
    this.$container.innerHTML = html;
    this.$close = document.createElement("div");
    this.$close.className = "aai-panel-close";
    this.$close.innerHTML = "×";
    this.$container.appendChild(this.$close);
    this.$close.addEventListener("click", () => {
      this.$container.remove();
    });
  }
  // MARK: Events
  // ────────────────────────────────────
  events() {
    if (this._eventsAttached) return;
    this._eventsAttached = true;
    this.$container.addEventListener("click", (e) => {
      if (e.target.classList.contains("aai-pagination-btn") && !e.target.disabled) {
        const page = parseInt(e.target.dataset.page);
        if (page && page !== this.currentPage) {
          this.handlePagination(page);
        }
        return;
      }
      if (e.target.closest(".aai-record-delete")) {
        e.stopPropagation();
        const $btn = e.target.closest(".aai-record-delete");
        const $item = $btn.closest(".aai-product-item");
        const recordId = $item.dataset.id;
        this.deleteRecord(recordId, $item);
        return;
      }
      if (e.target.closest("button") || e.target.closest("a") || e.target.closest("input")) {
        return;
      }
      if (e.target.closest(".aai-product-item")) {
        const $item = e.target.closest(".aai-product-item");
        const recordId = $item.dataset.id;
        const record = this.records.find((p) => p.id == recordId);
        if (record && record.content) {
          if (record.context === "marketing" || record.content.suggestions) {
            this.previewMarketing(record);
          } else {
            this.previewProduct(record);
          }
        }
      }
    });
    this.$container.addEventListener("change", (e) => {
      if (e.target.classList.contains("aai-product-select")) {
        const productId = parseInt(e.target.dataset.id);
        const isChecked = e.target.checked;
        if (!isChecked) {
          const index = this.ids.indexOf(productId);
          if (index > -1) this.ids.splice(index, 1);
        } else {
          if (!this.ids.includes(productId)) this.ids.push(productId);
        }
        this.setCount();
      }
      if (e.target.classList.contains("aai-product-select-all")) {
        const isChecked = e.target.checked;
        const checkboxes = this.$container.querySelectorAll(".aai-product-select");
        checkboxes.forEach((checkbox) => {
          const productId = parseInt(checkbox.dataset.id);
          checkbox.checked = isChecked;
          if (!isChecked) {
            const index = this.ids.indexOf(productId);
            if (index > -1) this.ids.splice(index, 1);
          } else {
            if (!this.ids.includes(productId)) this.ids.push(productId);
          }
        });
        this.setCount();
      }
    });
  }
  // MARK: Preview Product
  // ────────────────────────────────────
  previewProduct(product) {
    const originalRecord = this.records.find(
      (r) => {
        var _a;
        return r.product_id == product.product_id && ((_a = r.calldata) == null ? void 0 : _a._type) === "original";
      }
    );
    product.original = (originalRecord == null ? void 0 : originalRecord.content) || {};
    log("PREVIEW PRODUCT ==>>", product);
    const $overlay = document.createElement("div");
    $overlay.className = "aai-bulk-preview-modal aai-modal-overlay active";
    const $modal = document.createElement("div");
    $modal.className = "aai-modal";
    $modal.innerHTML = `
			<div class="aai-modal-header">
				<h3 class="aai-modal-title">Product #${product.product_id || ""}</h3>
				<button class="aai-modal-close">&times;</button>
			</div>
			<div class="aai-modal-body">
				<div class="aai-preview-product-flex">
					<div class="aai-preview-product aai-preview-response">
						<div class="aai-preview-title">${product.content.title || ""}</div>
						<div class="aai-preview-excerpt"><span>short description</span>${product.content.excerpt || ""}</div>
						<div class="aai-preview-content">${product.content.content || ""}</div>
						${product.content.errors && product.content.errors.length ? `<div class="aai-preview-errors">${product.content.errors.map((e) => !e.final ? `<div class="aai-preview-error">${e.error}</div>` : "").join("")}</div>` : ""}

					</div>
				</div>
			</div>
			<div class="aai-modal-footer">
				<button class="aai-btn aai-btn-primary aai-modal-update" data-id="${product.id}">${__$g("Publish", "copyspell-ai")}</button>
			</div>
		`;
    $overlay.appendChild($modal);
    document.body.appendChild($overlay);
    const closeModal = () => {
      $overlay.classList.remove("active");
      setTimeout(() => $overlay.remove(), 300);
    };
    $overlay.querySelector(".aai-modal-update").addEventListener("click", this.publishProduct.bind(this));
    $overlay.querySelector(".aai-modal-close").addEventListener("click", closeModal);
    $overlay.addEventListener("click", (e) => {
      if (e.target === $overlay) closeModal();
    });
  }
  // MARK: Preview Marketing
  // ────────────────────────────────────
  previewMarketing(record) {
    var _a, _b, _c, _d;
    log("PREVIEW MARKETING ==>>", record);
    const prefs = ((_a = record.calldata) == null ? void 0 : _a.prefs) || {};
    const content = record.content || {};
    const mediumName = prefs.mediumName || "";
    const typeName = ((_c = (_b = CFG.marketing.types) == null ? void 0 : _b[prefs.group]) == null ? void 0 : _c[prefs.type]) || "";
    const $overlay = document.createElement("div");
    $overlay.className = "aai-bulk-preview-modal aai-modal-overlay aai-marketing-modal active";
    const $modal = document.createElement("div");
    $modal.className = "aai-modal aai-modal-large";
    $modal.innerHTML = `
			<div class="aai-modal-header">
				<h3 class="aai-modal-title">${((_d = CFG.marketing.groups) == null ? void 0 : _d[prefs.group]) || __$g("Marketing Content", "copyspell-ai")}</h3>
				<div class="aai-modal-subtitle">${mediumName}${typeName ? " • " + typeName : ""}</div>
				<button class="aai-modal-close">&times;</button>
			</div>
			<div class="aai-modal-body">
				<div class="aai-marketing-preview-container"></div>
			</div>
		`;
    $overlay.appendChild($modal);
    document.body.appendChild($overlay);
    const $container = $$6($modal.querySelector(".aai-marketing-preview-container"));
    MarketingResult.render(content, prefs, $container);
    const closeModal = () => {
      $overlay.classList.remove("active");
      setTimeout(() => $overlay.remove(), 300);
    };
    $overlay.querySelector(".aai-modal-close").addEventListener("click", closeModal);
    $overlay.addEventListener("click", (e) => {
      if (e.target === $overlay) closeModal();
    });
  }
  // MARK: Publish Selected
  // ────────────────────────────────────
  async PublishSelected() {
    log("PUBLISH SELECTED IDS ==>>", this.ids);
    if (!this.ids.length) return;
    await this.showLoader();
    let publishedCount = 0;
    try {
      let selectedRecords = this.records.filter((r) => this.ids.includes(Number(r.id)));
      if (selectedRecords.length > 0) {
        let productUpdates = selectedRecords.map((record) => {
          var _a;
          return {
            id: record.product_id,
            name: record.content.title || ((_a = record.original) == null ? void 0 : _a.title),
            description: record.content.content,
            short_description: record.content.excerpt
          };
        });
        await wpAPI$1.batchUpdateProducts(productUpdates);
        let recordUpdates = selectedRecords.map((record) => {
          if (!record.original) record.original = {};
          record.original.published = true;
          return {
            id: record.id,
            calldata: record.calldata,
            content: {
              ...record.content,
              published: true
            }
          };
        });
        for (const update of recordUpdates) {
        }
        publishedCount += selectedRecords.length;
      }
      this.hideLoader();
      alert(`Successfully published ${publishedCount} products.`);
      await this.fetchRecords();
      this.render();
    } catch (error) {
      log("❌ error", error);
      this.hideLoader();
      alert("An error occurred while updating products.");
    }
  }
  // MARK: Publish Product
  // ────────────────────────────────────
  async publishProduct(e) {
    var _a;
    let $container = document.querySelector(".aai-preview-response");
    $container.innerHTML = `
			<div class="aai-loader-container">
				${SVG.loader7}
				<div>Updating product...</div>
			</div>
		`;
    const $item = e.target.closest(".aai-btn");
    const recordId = $item.dataset.id;
    const record = this.records.find((p) => p.id == recordId);
    $item.disabled = true;
    let data = {
      id: record.product_id,
      name: (_a = record.original) == null ? void 0 : _a.title,
      description: record.content.content,
      short_description: record.content.excerpt
    };
    let response = await wpAPI$1.batchUpdateProducts([data]);
    if (!record.calldata) record.calldata = {};
    record.calldata._type = "published";
    await AIH.updateRecord(record.id, {
      calldata: { ...record.calldata, _type: "published" }
    });
    $container.innerHTML = `<div class="aai-loader-container">
			<div class="aai-success">${__$g("Product published successfully!", "copyspell-ai")}</div>
			<button class="aai-btn aai-btn-primary aai-modal-close">${__$g("Close", "copyspell-ai")}</button>
		</div>`;
    $container.querySelector(".aai-modal-close").addEventListener("click", () => {
      const modal = $container.closest(".aai-modal-overlay");
      if (modal) modal.remove();
    });
    log("BATCH UPDATE RESPONSE ==>>", response);
  }
  // MARK: Pagination
  // ────────────────────────────────────
  pagination() {
    this.totalPages = Math.ceil(this.totalItems / this.itemsPerPage);
    if (this.totalPages <= 1) return "";
    let html = '<div class="aai-pagination">';
    const prevDisabled = this.currentPage === 1 ? "disabled" : "";
    html += `<button class="aai-pagination-btn aai-pagination-prev" data-page="${this.currentPage - 1}" ${prevDisabled}>Previous</button>`;
    html += '<div class="aai-pagination-numbers">';
    const maxVisiblePages = 7;
    let startPage = Math.max(1, this.currentPage - Math.floor(maxVisiblePages / 2));
    let endPage = Math.min(this.totalPages, startPage + maxVisiblePages - 1);
    if (endPage - startPage < maxVisiblePages - 1) {
      startPage = Math.max(1, endPage - maxVisiblePages + 1);
    }
    if (startPage > 1) {
      html += `<button class="aai-pagination-btn" data-page="1">1</button>`;
      if (startPage > 2) {
        html += '<span class="aai-pagination-ellipsis">...</span>';
      }
    }
    for (let i = startPage; i <= endPage; i++) {
      const active = i === this.currentPage ? "active" : "";
      html += `<button class="aai-pagination-btn ${active}" data-page="${i}">${i}</button>`;
    }
    if (endPage < this.totalPages) {
      if (endPage < this.totalPages - 1) {
        html += '<span class="aai-pagination-ellipsis">...</span>';
      }
      html += `<button class="aai-pagination-btn" data-page="${this.totalPages}">${this.totalPages}</button>`;
    }
    html += "</div>";
    const nextDisabled = this.currentPage === this.totalPages ? "disabled" : "";
    html += `<button class="aai-pagination-btn aai-pagination-next" data-page="${this.currentPage + 1}" ${nextDisabled}>Next</button>`;
    html += `<div class="aai-pagination-info">Page ${this.currentPage} of ${this.totalPages} (${this.totalItems} items)</div>`;
    html += "</div>";
    return html;
  }
  // MARK: Status UI
  // ────────────────────────────────────
  statusUI() {
    let html = `
			<h4>Selected products: <span class="aai-count">0</span></h4>
			<div class="aai-bulk-pagination"></div>
			<button class="aai-btn aai-btn-primary aai-button-generate">Update Selected Products</button>
		`;
    this.$status = document.createElement("div");
    this.$status.classList.add("aai-bulk-status");
    this.$status.innerHTML = html;
    this.$status.setAttribute("count", "0");
    this.$container.appendChild(this.$status);
    this.$count = this.$status.querySelector(".aai-count");
    this.$pagination = this.$status.querySelector(".aai-bulk-pagination");
    this.$status.querySelector(".aai-button-generate");
  }
  // MARK: Show Loader
  // ────────────────────────────────────
  async showLoader() {
    this.$grid = this.$container.querySelector(".aai-products-grid");
    const items = this.$container.querySelectorAll(".aai-products-grid > *");
    items.forEach((item) => item.style.opacity = "0.3");
    if (!this.$loaderOverlay) {
      this.$loaderOverlay = document.createElement("div");
      this.$loaderOverlay.className = "aai-loader-overlay";
      this.$loaderOverlay.innerHTML = `
				<div class="aai-loader-container">
					${SVG.loader7}
					<p>Loading records...</p>
				</div>
			`;
    }
    this.$grid.appendChild(this.$loaderOverlay);
    await new Promise((resolve) => setTimeout(resolve, 100));
  }
  // MARK: Hide Loader
  // ────────────────────────────────────
  hideLoader() {
    if (this.$loaderOverlay && this.$loaderOverlay.parentNode) {
      this.$loaderOverlay.remove();
    }
    const items = this.$container.querySelectorAll(".aai-products-grid > *");
    items.forEach((item) => item.style.opacity = "1");
  }
  // MARK: Handle Pagination
  // ────────────────────────────────────
  async handlePagination(page) {
    this.currentPage = page;
    await this.showLoader();
    await this.fetchRecords();
    this.render();
    this.hideLoader();
    this.$container.scrollIntoView({ behavior: "smooth", block: "start" });
  }
  // MARK: Set Count
  // ────────────────────────────────────
  setCount(count) {
    return;
  }
  // MARK: Delete Record
  // ────────────────────────────────────
  async deleteRecord(recordId, $item) {
    if (!confirm(__$g("Are you sure you want to delete this record?", "copyspell-ai"))) {
      return;
    }
    $item.style.opacity = "0.5";
    $item.style.pointerEvents = "none";
    try {
      await AIH.deleteRecord(recordId);
      this.records = this.records.filter((r) => r.id != recordId);
      this.totalItems--;
      $item.style.transition = "all 0.3s ease";
      $item.style.transform = "translateX(20px)";
      $item.style.opacity = "0";
      setTimeout(() => {
        $item.remove();
        if (this.records.length === 0) {
          if (this.currentPage > 1) {
            this.handlePagination(this.currentPage - 1);
          } else {
            this.render();
          }
        } else {
          const $paginationInfo = this.$container.querySelector(".aai-pagination-info");
          if ($paginationInfo) {
            this.totalPages = Math.ceil(this.totalItems / this.itemsPerPage);
            $paginationInfo.textContent = `Page ${this.currentPage} of ${this.totalPages} (${this.totalItems} items)`;
          }
        }
      }, 300);
      log("✓ Record deleted:", recordId);
    } catch (error) {
      log("❌ Failed to delete record:", error);
      $item.style.opacity = "1";
      $item.style.pointerEvents = "";
      alert(__$g("Failed to delete record. Please try again.", "copyspell-ai"));
    }
  }
}
const DATA$f = window.copyspell_ai_admin || {};
DATA$f.options || {};
const { __: __$f, _x: _x$e, _n: _n$e, sprintf: sprintf$e } = wp.i18n;
TOOLS.loadCSS(`source-preview.css?v=${DATA$f.version}`);
class ProductSearch {
  // ────────────────────────────────────
  constructor(product) {
    this.product = product;
    this.sources = null;
    this.userSources = [];
    this.response = null;
    this.searchResult = "";
    this.searchResults = [];
    this.selectedSources = [];
    this.selectedLength = 0;
    this.abortController = null;
    this.count = 0;
  }
  // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  // MARK: HTML
  // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  HTML(value = "") {
    this.searchResult = value || this.searchResult;
    let HTML = `
		<section class="aai-section aai-sources">
			<h3 class="aai-section-title">
				${SVG.internet}
				<span class="aai-text">${__$f("Search", "copyspell-ai")} <span class="aai-selection"></span></span>
				<span class="aai-optional">${__$f("optional", "copyspell-ai")}</span>
				${SVG.caret}
			</h3>
		
			<div class="aai-groups">
				<div class="aai-search-flex">
					<button class="aai-btn aai-btn-primary aai-search-ai">${SVG.search}${__$f("Search the internet for", "copyspell-ai")} <span>${this.product.title}</span></button>
					<button class="aai-btn aai-btn-secondary aai-search-result-button">${this.searchResult ? __$f("View Results", "copyspell-ai") : ""}</button>
					<button class="aai-btn aai-btn-secondary aai-search-clear" style="display: ${this.searchResult ? "inline-block" : "none"}">×</button>
				</div>
			</div>
			

			
		</section>
		`;
    return HTML;
  }
  // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  // MARK: Loader HTML
  // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  loaderHTML(alt = "") {
    return `
		<div class="aai-source-item aai-loader" alt="${alt}">
			${SVG.loader14}<br>
		</div>`;
  }
  // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  // MARK: EVENTS
  // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  /** * Initializes the sources section and sets up event listeners.
   * This function is called to handle the display of sources in the AI analysis section.
   * It sets up an event listener on the caret icon to fetch sources when clicked.
   */
  events() {
    var _a;
    this.section = document.querySelector(".aai-section.aai-sources");
    this.caret = this.section.querySelector(".aai-section-title svg:last-child");
    this.list = this.section.querySelector(".aai-sources-list");
    if (!this.section) return;
    this.caret.addEventListener("click", async () => {
      if (!this.sources) {
        this.sources = [];
      }
    });
    this.section.querySelector(".aai-search-ai").addEventListener("click", async (e) => {
      var _a2;
      e.preventDefault();
      this.section.querySelector(".aai-search-result-button").innerHTML = "";
      this.section.querySelector(".aai-search-clear").style.display = "none";
      (_a2 = this.section.querySelector(".aai-error")) == null ? void 0 : _a2.remove();
      this.section.querySelector(".aai-search-ai").classList.add("aai-disabled");
      this.section.querySelector(".aai-search-ai .svg-search").replaceWith(TOOLS.createElementFromHTML(SVG.loader7));
      this.searchCall();
    });
    this.section.querySelector(".aai-search-result-button").addEventListener("click", async (e) => {
      e.preventDefault();
      this.previewContent({ product_overview: this.searchResult });
    });
    (_a = this.section.querySelector(".aai-search-clear")) == null ? void 0 : _a.addEventListener("click", async (e) => {
      e.preventDefault();
      this.searchResult = "";
      this.section.querySelector(".aai-search-clear").style.display = "none";
      this.section.querySelector(".aai-search-result-button").innerHTML = "";
    });
  }
  // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  // MARK: Search Call
  // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  async searchCall() {
    const response = await CopySpellCall.run({ action: "product-search" });
    this.response = response;
    this.listSources();
  }
  // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  // MARK: Add URL
  // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  async addURL() {
    let URL = prompt(__$f("Add a URL to your own source", "copyspell-ai"), "");
    if (!URL) return;
    this.list.insertAdjacentHTML("beforeend", this.loaderHTML("custom"));
    return this.showMessage(URL + "<br>" + __$f("Cannot parse this URL", "copyspell-ai"), "error");
  }
  // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  // MARK: List Sources
  // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  /**
   * Fetches sources based on a query and displays them.
   * @param {string} query - The search query.
   * @param {object} self - The context object, typically the AI instance.
   * @param {number} limit - The maximum number of sources to display.
   * @returns {Promise<Array>} - A promise that resolves to an array of source objects.
   */
  async listSources(limit = 4) {
    console.log("--- this.response ---", this.response);
    if (this.response.error || !this.response.json || !this.response.json.product_overview) {
      this.section.querySelector(".aai-search-ai").classList.remove("aai-disabled");
      this.section.querySelector(".aai-search-ai .svg-loader").replaceWith(TOOLS.createElementFromHTML(SVG.search));
      this.section.querySelector(".aai-search-ai").insertAdjacentHTML("afterend", `<div class="aai-error">${this.response.error || __$f("No results found.", "copyspell-ai")}</div>`);
      return {
        status: "error",
        error: this.response.error || __$f("No results found.", "copyspell-ai")
      };
    }
    this.section.querySelector(".aai-search-clear").style.display = "inline-block";
    this.section.querySelector(".aai-search-result-button").innerHTML = __$f("View Results", "copyspell-ai");
    this.previewContent(this.response.json);
    return this.response.json;
  }
  // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  // MARK: Preview
  // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  previewContent(json) {
    if (!json.product_overview) {
      console.warn("No content available for preview");
      return;
    }
    this.searchResult = json.product_overview;
    const modal = document.createElement("div");
    modal.className = "source-preview-modal";
    modal.innerHTML = `
			<div class="source-preview-backdrop"></div>
			<div class="source-preview-container">
				<div class="source-preview-header">
					<div class="source-preview-title">
						<span>Search results</span>
					</div>
					<button class="source-preview-close">&times;</button>
				</div>
				<div class="source-preview-content" contenteditable="false">
					${this.searchResult}
				</div>
				<div class="source-preview-footer">
					${json.citations ? `<div class="source-preview-citations">${json.citations.map((cite) => `<a href="${cite.url}" target="_blank" rel="noopener noreferrer">${cite.source}</a>`).join("")}</div>` : ""}
					<button class="aai-btn aai-btn-secondary aai-cancel">${__$f("Cancel", "copyspell-ai")}</button>
					<button class="aai-btn aai-btn-primary aai-save-changes">${__$f("Save", "copyspell-ai")}</button>
				</div>
			</div>
		`;
    document.body.appendChild(modal);
    this.showMessage(__$f("You can edit the text and remove the parts that are not relevant.", "copyspell-ai"), "", 5e3);
    const closeBtn = modal.querySelector(".source-preview-close");
    const backdrop = modal.querySelector(".source-preview-backdrop");
    const closeModal = () => {
      modal.remove();
    };
    closeBtn.addEventListener("click", closeModal);
    backdrop.addEventListener("click", closeModal);
    const handleKeydown = (e) => {
      if (e.key === "Escape") {
        closeModal();
        document.removeEventListener("keydown", handleKeydown);
      }
    };
    document.addEventListener("keydown", handleKeydown);
    const contentDiv = modal.querySelector(".source-preview-content");
    const saveChangesBtn = modal.querySelector(".aai-save-changes");
    const cancelBtn = modal.querySelector(".aai-cancel");
    contentDiv.addEventListener("input", () => {
      saveChangesBtn.style.display = "inline-block";
    });
    json.product_overview = contentDiv.innerText;
    saveChangesBtn.addEventListener("click", (e) => {
      var _a;
      e.preventDefault();
      json.product_overview = contentDiv.innerText;
      this.searchResult = json.product_overview;
      closeModal();
      this.showMessage(__$f("Saved", "copyspell-ai"), "success");
      this.section.querySelector(".aai-search-ai").classList.remove("aai-disabled");
      (_a = this.section.querySelector(".aai-search-ai .svg-loader")) == null ? void 0 : _a.replaceWith(TOOLS.createElementFromHTML(SVG.search));
    });
    cancelBtn.addEventListener("click", (e) => {
      var _a;
      e.preventDefault();
      this.section.querySelector(".aai-search-ai").classList.remove("aai-disabled");
      (_a = this.section.querySelector(".aai-search-ai .svg-loader")) == null ? void 0 : _a.replaceWith(TOOLS.createElementFromHTML(SVG.search));
      closeModal();
    });
    setTimeout(() => {
      modal.classList.add("active");
    }, 10);
  }
  // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  // MARK: Show Message
  // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  showMessage(message, clss = "", time = 4e3) {
    const existing = document.querySelector(".aai-modal-message");
    if (existing) existing.remove();
    const feedback = document.createElement("div");
    feedback.className = "aai-modal-message " + clss;
    feedback.textContent = message;
    feedback.addEventListener("click", () => feedback.remove());
    document.body.appendChild(feedback);
    setTimeout(() => {
      feedback.remove();
    }, time);
  }
  // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  // MARK: Get Sources Text
  // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  getResult() {
    return this.searchResult || "";
  }
}
const SDK$3 = window.CopyspellAI || {};
const DATA$e = window.copyspell_ai_admin || {};
const { __: __$e, _x: _x$d, _n: _n$d, sprintf: sprintf$d } = wp.i18n;
let OPT$1 = DATA$e.options || {};
const defaultOptions = {
  preferedModel: "sequence",
  audiences: "general public",
  tone: "informative, sales-oriented",
  priorities: "visual formatting, SEO keywords",
  language: "Same as the content",
  "content-size": "150-300 words",
  "excerpt-size": "30-100 words",
  framework: "Benefit-driven"
};
class AISettings {
  // ────────────────────────────────────
  constructor(action, title) {
    this.id = DATA$e.post.id || null;
    this.title = title || "";
    this.action = action || "content";
    this.context = this.action;
    if (this.action == "settings") this.context = "content";
    if (this.action.includes("product")) this.context = "content";
    if (this.action.includes("marketing")) this.context = "marketing";
    if (this.action.includes("bulk")) this.context = "bulk";
    this.promptOptions = promptOptions[DATA$e.locale.substring(0, 2) || "en"] || promptOptions.en;
    this.promptOptionsEn = promptOptions.en;
    this.onSubmit = function() {
    };
    this.ProductSearch = null;
    if (this.context != "bulk")
      this.ProductSearch = new ProductSearch(DATA$e.post);
  }
  // MARK: START
  // ────────────────────────────────────
  static async start(action, context = "content", onSubmit) {
    const c = new AISettings(action);
    c.onSubmit = onSubmit || function() {
    };
    c.context = context;
    await c.init(false);
    let result = {
      onSubmit: c.onSubmit.bind(c),
      loadingState: c.loadingState.bind(c),
      showError: c.showError.bind(c),
      getForm: c.getForm.bind(c),
      getFormData: c.getFormData.bind(c)
    };
    return result;
  }
  // MARK: RUN
  // ────────────────────────────────────
  static async run(action, title = "", onSubmit) {
    const c = new AISettings(action, title);
    c.onSubmit = onSubmit || function() {
    };
    if (action != "product-content") c.clss = "aai-settings-panel";
    if (action.includes("marketing")) c.clss = "aai-marketing-panel";
    await c.init();
    if (action != "product-content" && action != "marketing-content") {
      const overlay = document.createElement("div");
      overlay.className = "aai-panel-overlay";
      c.panel.$el.parentNode.insertBefore(overlay, c.panel.$el);
    }
    let result = {
      onSubmit: c.onSubmit.bind(c),
      loadingState: c.loadingState.bind(c),
      showError: c.showError.bind(c),
      getForm: c.getForm.bind(c),
      getFormData: c.getFormData.bind(c)
    };
    result.panel = await c.render();
    return result;
  }
  // MARK: GET
  // ────────────────────────────────────
  static async get(action) {
    const c = new AISettings(action);
    await c.init(false);
    return c.getFormData();
  }
  // MARK: Get Form
  // ────────────────────────────────────
  getForm() {
    return this.form || {};
  }
  // MARK: INIT
  // ────────────────────────────────────
  async init(render = true) {
    var _a, _b;
    this.productData = await getProductData(this.id);
    this.saved = {};
    this.productInfo = {};
    if (this.context != "bulk") {
      this.saved = ((_b = (_a = this.productData.meta_data) == null ? void 0 : _a.find((meta) => meta.key === "copyspell_ai")) == null ? void 0 : _b.value) || "{}";
      this.saved = await wpAPI$1.getMeta(this.id, "copyspell_ai", "product") || this.saved;
      this.saved = JSON.parse(this.saved) || {};
      this.productInfo = JSON.parse(JSON.stringify(this.saved.productInfo || {}));
    }
    this.prefsName = "copyspell-ai-" + this.context;
    this.prefs = { ...defaultOptions, ...AIH.LOCAL.get(this.prefsName) };
    this.form = {
      ...this.prefs || {},
      ...this.saved[this.context] || {}
      //...this.saved.productInfo || {},
    };
    this.license = null;
    if (!render) return;
    this.panelClass = "aai-settings";
    if (this.action == "marketing") this.panelClass = "aai-marketing-panel";
    if (this.action == "settings") this.panelClass = "aai-settings-panel";
    if (this.clss) this.panelClass = this.clss;
    this.panel = new copyspellAIPanel(this.panelClass);
  }
  // MARK: Render
  // ────────────────────────────────────
  async render() {
    var _a;
    this.license = await TOOLS.loadOption("copyspell-ai-license");
    log("Setting action: " + this.action);
    this.panel.open();
    this.panel.$el.classList.add("analysis-options");
    this.panel.$el.classList.remove("aai-suggestions");
    this.panel.$body.innerHTML = await this.panelHtml();
    this.multiSelectsHTML();
    this.setFormData();
    this.events();
    (_a = this.ProductSearch) == null ? void 0 : _a.events();
    const brandCaret = document.querySelector(".aai-brand-section .svg-caret");
    if (brandCaret) {
      brandCaret.dispatchEvent(new MouseEvent("click", {
        bubbles: true,
        cancelable: true,
        view: window
      }));
    }
    this.settingsButtons();
    SDK$3.events.emit("panel-rendered", { ...this });
    return this.panel;
  }
  // MARK: Settings Buttons
  // ────────────────────────────────────
  settingsButtons() {
    if (this.action == "product-content" || this.action == "marketing-content") return;
    let $buttons = this.panel.$footer;
    $buttons.innerHTML = `
			<button class="aai-btn-big" alt="cancel">${__$e("Cancel", "copyspell-ai")}</button>
			<button class="aai-btn-big" alt="keep">${__$e("Keep Settings", "copyspell-ai")}</button>
		`;
    $buttons.style.display = "flex";
    $buttons.querySelector('.aai-btn-big[alt="cancel"]').style.display = "block";
    $buttons.querySelector('.aai-btn-big[alt="keep"]').style.display = "block";
    this.panel.$el.querySelector('.aai-panel-footer button[alt="cancel"]').onclick = (e) => {
      e.preventDefault();
      this.panel.close();
    };
    this.panel.$el.querySelector('.aai-panel-footer button[alt="keep"]').onclick = async (e) => {
      e.preventDefault();
      const form = this.getFormData();
      this.form = JSON.parse(JSON.stringify(form));
      this.setFormData();
      this.panel.close();
      if (this.context == "bulk") return;
      this.saved[this.context] = JSON.parse(JSON.stringify(this.form));
      this.saved.productInfo = JSON.parse(JSON.stringify(this.productInfo));
      await wpAPI$1.addProductMeta(this.id, "copyspell_ai", this.saved);
    };
  }
  // MARK: Panel HTML
  // ────────────────────────────────────
  async panelHtml() {
    var _a;
    let HTML = ``;
    HTML += `<form class="aai-form" id="aai-settings-form">`;
    if (this.action == "product-content") {
      HTML += this.headerHTML(this.title);
      HTML += await this.submitButtonHTML(null, this.license);
      HTML += '<div class="aai-settings-header-buttons">';
      HTML += this.historyButtonHTML(this.title);
      HTML += await TOOLS.renderCredits();
      HTML += '<div class="aai-flex-1"></div>';
      HTML += this.modelSelectionDropdown();
      HTML += "</div>";
    }
    HTML += this.strategyHTML();
    if (this.action == "product-content") {
      HTML += await this.submitButtonHTML();
    }
    HTML += this.rateButtonHTML();
    if (!this.action.includes("bulk")) {
      HTML += (_a = this.ProductSearch) == null ? void 0 : _a.HTML(this.productInfo.search || "");
      HTML += this.keywordsHTML();
      HTML += this.featuresHTML();
    }
    HTML += this.brandToneHTML();
    if (this.action == "product-content") {
      HTML += await this.submitButtonHTML();
    }
    HTML += `</form>`;
    return HTML;
  }
  // MARK: EVENTS
  // ────────────────────────────────────
  events() {
    var _a;
    this.panel.$body.addEventListener("submit", this.onSubmitHandler.bind(this));
    this.panel.$body.addEventListener("click", (e) => {
      if (e.target.matches(".aai-output .aai-submit-btn")) {
        e.preventDefault();
        e.stopPropagation();
        if (e.target.disabled) return;
        e.target.disabled = true;
        Promise.resolve(this.onSubmit(this.form)).finally(() => {
          if (e.target) e.target.disabled = false;
        });
      }
      if (e.target.matches(".aai-history-button")) {
        new AIHistory(this.id, this.panel.$body, this.context);
      }
    });
    this.panel.$body.addEventListener("change", (e) => {
      if (e.target.matches(".aai-select-model")) {
        this.form._model = e.target.value;
        this.prefs._model = e.target.value;
        AIH.LOCAL.set(this.prefsName, this.prefs);
      }
    });
    (_a = this.panel.$body.querySelector(".aai-keywords-button")) == null ? void 0 : _a.addEventListener("click", this.getAIkeywords.bind(this));
    const form = this.panel.$body.querySelector("#aai-settings-form");
    if (form) {
      form.querySelectorAll("select").forEach((select) => {
        select.addEventListener("change", (e) => {
          this.form[e.target.name] = e.target.value;
          this.prefs[e.target.name] = e.target.value;
          AIH.LOCAL.set(this.prefsName, this.prefs);
          this.setFormData();
        });
      });
      form.querySelectorAll("input").forEach((input) => {
        input.addEventListener("input", (e) => {
          this.productInfo[e.target.name] = e.target.value;
        });
      });
      form.querySelectorAll("textarea").forEach((textarea) => {
        textarea.addEventListener("change", (e) => {
          if (e.target.name == "brand-tone") {
            DATA$e.brand_tone = e.target.value;
            OPT$1.generic["brand-tone"] = e.target.value;
            OPT$1.generic = JSON.parse(JSON.stringify(OPT$1.generic));
            TOOLS.saveOptions(OPT$1);
          } else if (e.target.name == "extra-prompt") {
            DATA$e.extra_prompt = e.target.value;
          } else {
            this.productInfo[e.target.name] = e.target.value;
          }
        });
      });
    }
    form.querySelectorAll(".aai-section-title").forEach((select) => {
      select.addEventListener("click", (e) => {
        select.closest(".aai-section").classList.toggle("aai-unfolded");
        select.closest(".aai-section").classList.toggle("aai-folded");
        const groups = select.closest(".aai-section").querySelector(".aai-groups");
        if (groups) {
          const duration = 250;
          const isHidden = groups.style.display === "none" || getComputedStyle(groups).display === "none";
          if (isHidden) {
            groups.style.removeProperty("display");
            let display = getComputedStyle(groups).display;
            if (display === "none") display = "block";
            groups.style.display = display;
            const height = groups.scrollHeight + "px";
            groups.style.height = "0px";
            groups.style.overflow = "hidden";
            groups.offsetHeight;
            groups.style.transition = `height ${duration}ms`;
            groups.style.height = height;
            setTimeout(() => {
              groups.style.removeProperty("height");
              groups.style.removeProperty("overflow");
              groups.style.removeProperty("transition");
            }, duration);
          } else {
            const height = groups.scrollHeight + "px";
            groups.style.height = height;
            groups.style.overflow = "hidden";
            groups.offsetHeight;
            groups.style.transition = `height ${duration}ms`;
            groups.style.height = "0px";
            setTimeout(() => {
              groups.style.display = "none";
              groups.style.removeProperty("height");
              groups.style.removeProperty("overflow");
              groups.style.removeProperty("transition");
            }, duration);
          }
        }
      });
    });
  }
  // MARK: On Submit
  // ────────────────────────────────────
  async onSubmitHandler(e) {
    if (e.target.matches("#aai-settings-form") && e.submitter && e.submitter.classList.contains("aai-submit-btn")) {
      e.preventDefault();
      e.stopPropagation();
      if (e.submitter.disabled) return;
      e.submitter.disabled = true;
      if (!await TOOLS.isAllowed("product-content")) {
        e.submitter.disabled = false;
        return;
      }
      this.form = this.getFormData();
      if (this.context != "bulk") {
        this.saved[this.context] = JSON.parse(JSON.stringify(this.form));
        this.saved.productInfo = JSON.parse(JSON.stringify(this.productInfo));
        await wpAPI$1.addProductMeta(this.id, "copyspell_ai", this.saved);
      }
      try {
        await this.onSubmit({
          form: this.form,
          generic: OPT$1.generic,
          productInfo: this.productInfo
        });
      } finally {
        if (e.submitter) e.submitter.disabled = false;
      }
    }
  }
  // MARK: Get Form Data
  // ────────────────────────────────────
  getFormData() {
    var _a, _b, _c;
    const form = (_b = (_a = this.panel) == null ? void 0 : _a.$body) == null ? void 0 : _b.querySelector("#aai-settings-form");
    if (form) {
      let formData = new FormData(form);
      let entries = Object.fromEntries(formData.entries());
      this.form = {
        ...this.form,
        preferedModel: entries["sequence"] || this.form.preferedModel,
        audiences: entries["audiences"] || this.form.audiences,
        tone: entries["tone"] || this.form.tone,
        priorities: entries["priorities"] || this.form.priorities,
        language: entries["language"] || this.form.language,
        "content-size": entries["content-size"] || this.form["content-size"],
        "excerpt-size": entries["excerpt-size"] || this.form["excerpt-size"],
        framework: entries["framework"] || this.form.framework
      };
    }
    this.productInfo.search = ((_c = this.ProductSearch) == null ? void 0 : _c.getResult()) || "";
    if (!this.productInfo.search) delete this.productInfo.search;
    return this.form;
  }
  // MARK: Set Form Data
  // ────────────────────────────────────
  setFormData() {
    var _a, _b, _c, _d, _e, _f;
    this.form = this.form || {};
    for (const key in this.form) {
      if (!key) continue;
      if (key == "search") continue;
      const input = this.panel.$body.querySelector(`#${key}`);
      if (input) {
        if (input.type === "checkbox" || input.type === "radio") {
          input.checked = this.form[key];
        } else {
          input.value = this.form[key];
        }
      }
    }
    let contentSizeInfo = "";
    let index = this.promptOptionsEn.sizes.findIndex((size) => size[0] === this.form["content-size"]);
    if (index !== -1) {
      contentSizeInfo = this.promptOptions.sizes[index][2] + "<br>" + this.promptOptions.sizes[index][0];
    }
    if (this.panel.$body.querySelector("#content-size"))
      this.panel.$body.querySelector("#content-size").nextElementSibling.innerHTML = contentSizeInfo || "";
    let excerptSizeInfo = "";
    index = this.promptOptionsEn.excerptSizes.findIndex((size) => size[0] === this.form["excerpt-size"]);
    if (index !== -1) {
      excerptSizeInfo = this.promptOptions.excerptSizes[index][2] + "<br>" + this.promptOptions.excerptSizes[index][0];
    }
    if (this.panel.$body.querySelector("#excerpt-size"))
      this.panel.$body.querySelector("#excerpt-size").nextElementSibling.innerHTML = excerptSizeInfo || "";
    let frameworkInfo = "";
    index = this.promptOptionsEn.frameworks.findIndex((f) => f[0] === this.form.framework);
    if (index !== -1) {
      frameworkInfo = this.promptOptions.frameworks[index][1];
    }
    this.panel.$body.querySelector("#framework").nextElementSibling.innerHTML = frameworkInfo || "";
    this.panel.$body.querySelector("#brand-tone").value = DATA$e.brand_tone || "";
    if (this.context != "bulk") {
      if (Array.isArray((_a = this.productInfo) == null ? void 0 : _a["primary-keywords"]))
        this.panel.$body.querySelector("#primary-keywords").value = this.productInfo["primary-keywords"].join(", ");
      else
        this.panel.$body.querySelector("#primary-keywords").value = ((_b = this.productInfo) == null ? void 0 : _b["primary-keywords"]) || "";
      if (Array.isArray((_c = this.productInfo) == null ? void 0 : _c["secondary-keywords"]))
        this.panel.$body.querySelector("#secondary-keywords").value = this.productInfo["secondary-keywords"].join(", ");
      else
        this.panel.$body.querySelector("#secondary-keywords").value = ((_d = this.productInfo) == null ? void 0 : _d["secondary-keywords"]) || "";
      this.panel.$body.querySelector("#usp").value = ((_e = this.productInfo) == null ? void 0 : _e.usp) || "";
      this.panel.$body.querySelector("#extra-info").value = ((_f = this.productInfo) == null ? void 0 : _f["extra-info"]) || "";
    }
  }
  // MARK: Get AI Keywords
  // ────────────────────────────────────
  async getAIkeywords() {
    var _a;
    (_a = this.panel.$body.querySelector(".aai-error")) == null ? void 0 : _a.remove();
    this.panel.$body.querySelector(".aai-keywords-button").innerHTML = SVG.loader7;
    this.panel.$body.querySelector(".aai-keywords-button").classList.add("aai-disabled");
    const response = await CopySpellCall.run({ action: "product-keywords" });
    this.panel.$body.querySelector(".aai-keywords-button").innerHTML = __$e("Get Keywords with AI", "copyspell-ai");
    this.panel.$body.querySelector(".aai-keywords-button").classList.remove("aai-disabled");
    if (response.error) {
      const errorDiv = document.createElement("div");
      errorDiv.className = "aai-error";
      errorDiv.textContent = response.error;
      const keywordsButton = this.panel.$body.querySelector(".aai-keywords-button");
      keywordsButton.parentNode.insertBefore(errorDiv, keywordsButton);
      return;
    }
    this.panel.$body.querySelector("#primary-keywords").value = response.json.primary.join(", ") || "";
    this.panel.$body.querySelector("#secondary-keywords").value = response.json.secondary.join(", ") || "";
    this.productInfo["primary-keywords"] = response.json.primary || "";
    this.productInfo["secondary-keywords"] = response.json.secondary || "";
  }
}
AISettings.prototype.headerHTML = headerHTML$1;
AISettings.prototype.historyButtonHTML = historyButtonHTML;
AISettings.prototype.modelSelectionDropdown = modelSelectionDropdown;
AISettings.prototype.keywordsHTML = keywordsHTML;
AISettings.prototype.featuresHTML = featuresHTML;
AISettings.prototype.brandToneHTML = brandToneHTML;
AISettings.prototype.multiSelectsHTML = multiSelectsHTML;
AISettings.prototype.strategyHTML = strategyHTML;
AISettings.prototype.submitButtonHTML = submitButtonHTML;
AISettings.prototype.rateButtonHTML = rateButtonHTML;
AISettings.prototype.loadingState = loadingState;
AISettings.prototype.showError = showError;
const DATA$d = window.copyspell_ai_admin || {};
TOOLS.loadCSS(`product-select.css?v=${DATA$d.version}`);
class ProductSelect {
  constructor(options = {}) {
    this.container = options.container || document.body;
    this.label = options.label || "";
    this.placeholder = options.placeholder || "search products by title or SKU...";
    this.multiple = options.multiple !== void 0 ? options.multiple : true;
    this.onChange = options.onChange || (() => {
    });
    this.minSearchLength = options.minSearchLength || 2;
    this.debounceDelay = options.debounceDelay || 300;
    this.initialIds = options.initialIds || [];
    this.selectedProducts = [];
    this.searchResults = [];
    this.searchTimeout = null;
    this.isLoading = false;
    this.init();
  }
  // MARK: Initialize
  // ────────────────────────────────────
  init() {
    this.render();
    this.attachEvents();
    if (this.initialIds && this.initialIds.length > 0) {
      this.setSelectedIds(this.initialIds);
    }
  }
  // MARK: Render
  // ────────────────────────────────────
  render() {
    const html = `
            <div class="aai-product-select">
				${this.multiple ? '<div class="aai-product-select-chips"></div>' : ""}
                <div class="aai-product-select-input-wrapper">
                    <input 
                        type="text" 
                        class="aai-product-select-input" 
                        placeholder="${this.placeholder}"
                        autocomplete="off"
                    />
                    <div class="aai-product-select-loader"></div>
                </div>
                <div class="aai-product-select-dropdown">
                    <div class="aai-product-select-options"></div>
                </div>
                ${this.label ? `<label class="aai-product-select-label">${this.escapeHtml(this.label)}</label>` : ""}
            </div>
        `;
    this.container.innerHTML = html;
    this.wrapper = this.container.querySelector(".aai-product-select");
    this.input = this.container.querySelector(".aai-product-select-input");
    this.loader = this.container.querySelector(".aai-product-select-loader");
    this.dropdown = this.container.querySelector(".aai-product-select-dropdown");
    this.optionsContainer = this.container.querySelector(".aai-product-select-options");
    this.chipsContainer = this.container.querySelector(".aai-product-select-chips");
  }
  // MARK: Attach Events
  // ────────────────────────────────────
  attachEvents() {
    this.input.addEventListener("input", (e) => {
      this.handleSearch(e.target.value);
    });
    this.input.addEventListener("focus", () => {
      if (this.searchResults.length > 0) {
        this.showDropdown();
      }
    });
    document.addEventListener("click", (e) => {
      if (!this.wrapper.contains(e.target)) {
        this.hideDropdown();
      }
    });
    this.input.addEventListener("keydown", (e) => {
      this.handleKeyboard(e);
    });
  }
  // MARK: Handle Search
  // ────────────────────────────────────
  handleSearch(query) {
    if (this.searchTimeout) {
      clearTimeout(this.searchTimeout);
    }
    if (query.length < this.minSearchLength) {
      this.hideDropdown();
      return;
    }
    this.searchTimeout = setTimeout(async () => {
      await this.searchProducts(query);
    }, this.debounceDelay);
  }
  // MARK: Search Products
  // ────────────────────────────────────
  async searchProducts(query) {
    this.showLoader();
    try {
      const response = await wp.apiFetch({
        path: `/wc/v3/products?search=${encodeURIComponent(query)}&per_page=20`
      });
      let skuResults = [];
      try {
        skuResults = await wp.apiFetch({
          path: `/wc/v3/products?sku=${encodeURIComponent(query)}&per_page=20`
        });
      } catch (e) {
      }
      const combined = [...response, ...skuResults];
      const uniqueMap = /* @__PURE__ */ new Map();
      combined.forEach((product) => {
        uniqueMap.set(product.id, product);
      });
      this.searchResults = Array.from(uniqueMap.values()).map((product) => ({
        id: product.id,
        title: this.decodeHtmlEntities(product.name),
        sku: product.sku || ""
      }));
      this.renderResults();
      this.showDropdown();
    } catch (error) {
      log("❌ Error searching products:", error);
      this.optionsContainer.innerHTML = `
                <div class="aai-product-select-no-results">
                    Error searching products. Please try again.
                </div>
            `;
      this.showDropdown();
    } finally {
      this.hideLoader();
    }
  }
  // MARK: Render Results
  // ────────────────────────────────────
  renderResults() {
    if (this.searchResults.length === 0) {
      this.optionsContainer.innerHTML = `
                <div class="aai-product-select-no-results">
                    No products found
                </div>
            `;
      return;
    }
    const html = this.searchResults.map((product) => {
      const isSelected = this.selectedProducts.some((p) => p.id === product.id);
      return `
                <div class="aai-product-select-option ${isSelected ? "selected" : ""}" data-id="${product.id}">
                    <div class="aai-product-select-option-id">#${product.id}</div>
                    <div class="aai-product-select-option-title">${this.escapeHtml(product.title)}</div>
                    ${product.sku ? `<div class="aai-product-select-option-sku">${this.escapeHtml(product.sku)}</div>` : '<div class="aai-product-select-option-sku"></div>'}
                </div>
            `;
    }).join("");
    this.optionsContainer.innerHTML = html;
    this.optionsContainer.querySelectorAll(".aai-product-select-option").forEach((option) => {
      option.addEventListener("click", () => {
        const productId = parseInt(option.dataset.id);
        this.toggleProduct(productId);
      });
    });
  }
  // MARK: Toggle Product
  // ────────────────────────────────────
  toggleProduct(productId) {
    const index = this.selectedProducts.findIndex((p) => p.id === productId);
    if (index >= 0) {
      this.selectedProducts.splice(index, 1);
    } else {
      const product = this.searchResults.find((p) => p.id === productId);
      if (!product) return;
      if (this.multiple) {
        this.selectedProducts.push(product);
      } else {
        this.selectedProducts = [product];
        this.hideDropdown();
        this.input.value = product.title;
      }
    }
    this.renderResults();
    this.renderChips();
    this.notifyChange();
  }
  // MARK: Render Chips
  // ────────────────────────────────────
  renderChips() {
    if (!this.multiple || !this.chipsContainer) return;
    if (this.selectedProducts.length === 0) {
      this.chipsContainer.innerHTML = "";
      return;
    }
    const html = this.selectedProducts.map((product) => `
            <div class="aai-product-select-chip" data-id="${product.id}">
                <span class="aai-product-select-chip-text">
                    #${product.id} - ${this.escapeHtml(product.title)}
                </span>
                <button class="aai-product-select-chip-remove" type="button">×</button>
            </div>
        `).join("");
    this.chipsContainer.innerHTML = html;
    this.chipsContainer.querySelectorAll(".aai-product-select-chip-remove").forEach((btn) => {
      btn.addEventListener("click", (e) => {
        e.stopPropagation();
        const chip = btn.closest(".aai-product-select-chip");
        const productId = parseInt(chip.dataset.id);
        this.toggleProduct(productId);
      });
    });
  }
  // MARK: Show/Hide Dropdown
  // ────────────────────────────────────
  showDropdown() {
    this.dropdown.classList.add("show");
  }
  hideDropdown() {
    this.dropdown.classList.remove("show");
  }
  // MARK: Show/Hide Loader
  // ────────────────────────────────────
  showLoader() {
    this.isLoading = true;
    this.loader.style.display = "block";
  }
  hideLoader() {
    this.isLoading = false;
    this.loader.style.display = "none";
  }
  // MARK: Notify Change
  // ────────────────────────────────────
  notifyChange() {
    const selectedIds = this.selectedProducts.map((p) => p.id);
    this.onChange(selectedIds);
  }
  // MARK: Keyboard Navigation
  // ────────────────────────────────────
  handleKeyboard(e) {
    const options = this.optionsContainer.querySelectorAll(".aai-product-select-option");
    if (options.length === 0) return;
    let currentIndex = -1;
    options.forEach((opt, idx) => {
      if (opt.classList.contains("focused")) {
        currentIndex = idx;
      }
    });
    switch (e.key) {
      case "ArrowDown":
        e.preventDefault();
        if (currentIndex < options.length - 1) {
          options.forEach((opt) => opt.classList.remove("focused"));
          options[currentIndex + 1].classList.add("focused");
          options[currentIndex + 1].scrollIntoView({ block: "nearest" });
        }
        break;
      case "ArrowUp":
        e.preventDefault();
        if (currentIndex > 0) {
          options.forEach((opt) => opt.classList.remove("focused"));
          options[currentIndex - 1].classList.add("focused");
          options[currentIndex - 1].scrollIntoView({ block: "nearest" });
        }
        break;
      case "Enter":
        e.preventDefault();
        if (currentIndex >= 0) {
          const productId = parseInt(options[currentIndex].dataset.id);
          this.toggleProduct(productId);
        }
        break;
      case "Escape":
        this.hideDropdown();
        break;
    }
  }
  // MARK: Get Selected IDs
  // ────────────────────────────────────
  getSelectedIds() {
    return this.selectedProducts.map((p) => p.id);
  }
  // MARK: Set Selected IDs
  // ────────────────────────────────────
  async setSelectedIds(ids) {
    if (!Array.isArray(ids)) return;
    this.selectedProducts = [];
    for (const id of ids) {
      if (!id) continue;
      try {
        const product = await wp.apiFetch({
          path: `/wc/v3/products/${id}`
        });
        this.selectedProducts.push({
          id: product.id,
          title: this.decodeHtmlEntities(product.name),
          sku: product.sku || ""
        });
      } catch (error) {
        log(`❌ Error fetching product ${id}:`, error);
      }
    }
    this.renderChips();
    this.notifyChange();
  }
  // MARK: Clear Selection
  // ────────────────────────────────────
  clear() {
    this.selectedProducts = [];
    this.input.value = "";
    this.renderChips();
    this.notifyChange();
  }
  // MARK: Escape HTML
  // ────────────────────────────────────
  escapeHtml(text) {
    const div = document.createElement("div");
    div.textContent = text;
    return div.innerHTML;
  }
  // MARK: Decode HTML Entities
  // ────────────────────────────────────
  decodeHtmlEntities(text) {
    const textarea = document.createElement("textarea");
    textarea.innerHTML = text;
    return textarea.value;
  }
  // MARK: Destroy
  // ────────────────────────────────────
  destroy() {
    if (this.searchTimeout) {
      clearTimeout(this.searchTimeout);
    }
    this.container.innerHTML = "";
  }
}
const DATA$c = window.copyspell_ai_admin || {};
const { __: __$d, _x: _x$c, _n: _n$c, sprintf: sprintf$c } = wp.i18n;
class BulkJobs {
  // MARK: Constructor
  // ────────────────────────────────────
  constructor() {
    this.ajaxUrl = DATA$c.ajax_url || "/wp-admin/admin-ajax.php";
    this.nonce = DATA$c.nonce;
  }
  // MARK: Add Job
  // ────────────────────────────────────
  /**
   * Add a new bulk job to the database
   * 
   * @param {Object} params - Job parameters
   * @param {string} params.batch_id - Batch identifier
   * @param {string} params.status - Job status (e.g., 'pending', 'processing', 'completed', 'failed')
   * @param {Object|string} params.meta - Job metadata (will be JSON encoded if object)
   * @returns {Promise<number|null>} Job ID on success, null on failure
   * 
   * @example
   * const jobId = await jobs.add({
   *     batch_id: 'batch_123',
   *     status: 'pending',
   *     meta: { 
   *         total_products: 50, 
   *         processed: 0,
   *         settings: { model: 'gpt-4', temperature: 0.7 }
   *     }
   * });
   */
  async add({ status = "pending", meta = {} }) {
    var _a;
    try {
      const formData = new FormData();
      formData.append("action", "csai_add_bulk_job");
      formData.append("nonce", this.nonce);
      formData.append("status", status);
      if (typeof meta === "object") {
        formData.append("meta", JSON.stringify(meta));
      } else {
        formData.append("meta", meta);
      }
      const result = await this._fetch(formData);
      if (result.success) {
        return result.data.job_id;
      } else {
        return this._error(((_a = result.data) == null ? void 0 : _a.message) || "Failed to add job");
      }
    } catch (error) {
      return this._error(error);
    }
  }
  // MARK: Update Job
  // ────────────────────────────────────
  /**
   * Update an existing job
   * 
   * @param {number} id - Job ID
   * @param {Object} data - Data to update
   * @param {string} [data.batch_id] - New batch ID
   * @param {string} [data.status] - New status
   * @param {Object|string} [data.meta] - Updated metadata
   * @returns {Promise<boolean>} True on success, false on failure
   * 
   * @example
   * await jobs.update(123, {
   *     status: 'processing',
   *     meta: { processed: 25, total_products: 50 }
   * });
   */
  async update(id, data) {
    var _a;
    try {
      const formData = new FormData();
      formData.append("action", "csai_update_bulk_job");
      formData.append("nonce", this.nonce);
      formData.append("id", id);
      const updateData = {};
      if (data.batch_id !== void 0) updateData.batch_id = data.batch_id;
      if (data.status !== void 0) updateData.status = data.status;
      if (data.meta !== void 0) {
        updateData.meta = typeof data.meta === "object" ? JSON.stringify(data.meta) : data.meta;
      }
      formData.append("data", JSON.stringify(updateData));
      const result = await this._fetch(formData);
      if (result.success) {
        log("Job updated");
        return true;
      } else {
        return this._error(((_a = result.data) == null ? void 0 : _a.message) || "Failed to update job");
      }
    } catch (error) {
      return this._error(error);
    }
  }
  // MARK: Update Job by Batch
  // ────────────────────────────────────
  /**
   * Update a job by batch ID
   * 
   * @param {string} batch_id - Batch identifier
   * @param {Object} data - Data to update
   * @param {string} [data.status] - New status
   * @param {Object|string} [data.meta] - Updated metadata
   * @returns {Promise<boolean>} True on success, false on failure
   * 
   * @example
   * await jobs.updateByBatch('batch_123', {
   *     status: 'completed',
   *     meta: { processed: 50, total_products: 50, success: true }
   * });
   */
  async updateByBatch(batch_id, data) {
    var _a;
    try {
      const formData = new FormData();
      formData.append("action", "csai_update_bulk_job_by_batch");
      formData.append("nonce", this.nonce);
      formData.append("batch_id", batch_id);
      const updateData = {};
      if (data.status !== void 0) updateData.status = data.status;
      if (data.meta !== void 0) {
        updateData.meta = typeof data.meta === "object" ? JSON.stringify(data.meta) : data.meta;
      }
      formData.append("data", JSON.stringify(updateData));
      const result = await this._fetch(formData);
      if (result.success) {
        log("Job updated by batch");
        return true;
      } else {
        return this._error(((_a = result.data) == null ? void 0 : _a.message) || "Failed to update job");
      }
    } catch (error) {
      return this._error(error);
    }
  }
  // MARK: Delete Job
  // ────────────────────────────────────
  /**
   * Delete a job by ID
   * 
   * @param {number} id - Job ID
   * @returns {Promise<boolean>} True on success, false on failure
   * 
   * @example
   * await jobs.delete(123);
   */
  async delete(id) {
    var _a;
    try {
      const formData = new FormData();
      formData.append("action", "csai_delete_bulk_job");
      formData.append("nonce", this.nonce);
      formData.append("id", id);
      const result = await this._fetch(formData);
      if (result.success) {
        log("Job deleted");
        return true;
      } else {
        return this._error(((_a = result.data) == null ? void 0 : _a.message) || "Failed to delete job");
      }
    } catch (error) {
      return this._error(error);
    }
  }
  // MARK: Get Job
  // ────────────────────────────────────
  /**
   * Get a job by ID
   * 
   * @param {number} id - Job ID
   * @returns {Promise<Object|null>} Job object or null on failure
   * 
   * @example
   * const job = await jobs.get(123);
   * if (job) {
   *     console.log(job.status, job.meta.processed);
   * }
   */
  async get(id) {
    var _a;
    try {
      const formData = new FormData();
      formData.append("action", "csai_get_bulk_job");
      formData.append("nonce", this.nonce);
      formData.append("id", id);
      const result = await this._fetch(formData);
      if (result.success) {
        log(`Retrieved job ${id}`);
        return result.data.job;
      } else {
        return this._error(((_a = result.data) == null ? void 0 : _a.message) || "Failed to get job");
      }
    } catch (error) {
      return this._error(error);
    }
  }
  // MARK: Get Job by Batch
  // ────────────────────────────────────
  /**
   * Get job for a specific batch
   * 
   * @param {string} batch_id - Batch identifier
   * @returns {Promise<Object|null>} Job object or null on failure
   * 
   * @example
   * const job = await jobs.getByBatch('batch_123');
   * if (job) {
   *     console.log(job.status, job.meta);
   * }
   */
  async getByBatch(batch_id) {
    var _a;
    try {
      const formData = new FormData();
      formData.append("action", "csai_get_bulk_job_by_batch");
      formData.append("nonce", this.nonce);
      formData.append("batch_id", batch_id);
      const result = await this._fetch(formData);
      if (result.success) {
        log(`Retrieved job for batch ${batch_id}`);
        return result.data.job;
      } else {
        return this._error(((_a = result.data) == null ? void 0 : _a.message) || "Failed to get job");
      }
    } catch (error) {
      return this._error(error);
    }
  }
  // MARK: Get All Jobs
  // ────────────────────────────────────
  /**
   * Get all jobs with optional filtering
   * 
   * @param {Object} [options] - Query options
   * @param {string} [options.status] - Filter by status
   * @param {number} [options.limit=100] - Maximum number of jobs to return
   * @param {number} [options.offset=0] - Number of jobs to skip
   * @param {string} [options.order='DESC'] - Order direction (ASC|DESC)
   * @param {string} [options.order_by='created'] - Column to order by
   * @returns {Promise<Array|null>} Array of job objects or null on failure
   * 
   * @example
   * // Get all pending jobs
   * const pendingJobs = await jobs.getAll({ status: 'pending' });
   * 
   * // Get recent jobs
   * const recentJobs = await jobs.getAll({ 
   *     limit: 20, 
   *     order_by: 'updated', 
   *     order: 'DESC' 
   * });
   */
  async getAll(options = {}) {
    var _a;
    try {
      const formData = new FormData();
      formData.append("action", "csai_get_all_bulk_jobs");
      formData.append("nonce", this.nonce);
      if (options.status) formData.append("status", options.status || "");
      formData.append("limit", options.limit !== void 0 ? options.limit : 1e3);
      if (options.offset !== void 0) formData.append("offset", options.offset || 0);
      if (options.order) formData.append("order", options.order || "DESC");
      if (options.order_by) formData.append("order_by", options.order_by || "updated");
      const result = await this._fetch(formData);
      if (result.success) {
        return result.data.jobs;
      } else {
        return this._error(((_a = result.data) == null ? void 0 : _a.message) || "Failed to get jobs");
      }
    } catch (error) {
      return this._error(error);
    }
  }
  // MARK: Get Jobs by Status
  // ────────────────────────────────────
  /**
   * Get all jobs with a specific status
   * 
   * @param {string} status - Job status
   * @returns {Promise<Array|null>} Array of job objects or null on failure
   * 
   * @example
   * const processingJobs = await jobs.getByStatus('processing');
   * processingJobs.forEach(job => {
   *     console.log(job.batch_id, job.meta.processed);
   * });
   */
  async getByStatus(status) {
    var _a;
    try {
      const formData = new FormData();
      formData.append("action", "csai_get_bulk_jobs_by_status");
      formData.append("nonce", this.nonce);
      formData.append("status", status);
      const result = await this._fetch(formData);
      if (result.success) {
        log(`Retrieved ${result.data.count} jobs with status: ${status}`);
        return result.data.jobs;
      } else {
        return this._error(((_a = result.data) == null ? void 0 : _a.message) || "Failed to get jobs");
      }
    } catch (error) {
      return this._error(error);
    }
  }
  // MARK: Delete Job by Batch
  // ────────────────────────────────────
  /**
   * Delete job for a specific batch
   * 
   * @param {string} batch_id - Batch identifier
   * @returns {Promise<boolean>} True on success, false on failure
   * 
   * @example
   * await jobs.deleteByBatch('batch_123');
   */
  async deleteByBatch(batch_id) {
    var _a;
    try {
      const formData = new FormData();
      formData.append("action", "csai_delete_bulk_job_by_batch");
      formData.append("nonce", this.nonce);
      formData.append("batch_id", batch_id);
      const result = await this._fetch(formData);
      if (result.success) {
        log(`Job for batch ${batch_id} deleted`);
        return true;
      } else {
        return this._error(((_a = result.data) == null ? void 0 : _a.message) || "Failed to delete job");
      }
    } catch (error) {
      return this._error(error);
    }
  }
  // MARK: Fetch Helper
  // ────────────────────────────────────
  /**
   * Internal fetch helper
   * @private
   */
  async _fetch(formData) {
    const response = await fetch(this.ajaxUrl, {
      method: "POST",
      body: formData
    });
    return await response.json();
  }
  // MARK: Error Handler
  // ────────────────────────────────────
  /**
   * Internal error handler
   * @private
   */
  _error(error) {
    const message = (error == null ? void 0 : error.message) || error || "Database operation failed";
    log("BulkJobs Error: " + message);
    return null;
  }
}
const DATA$b = window.copyspell_ai_admin || {};
const { __: __$c, _x: _x$b, _n: _n$b, sprintf: sprintf$b } = wp.i18n;
class BulkRecords {
  // MARK: Constructor
  // ────────────────────────────────────
  constructor() {
    this.ajaxUrl = DATA$b.ajax_url || "/wp-admin/admin-ajax.php";
    this.nonce = DATA$b.nonce;
  }
  // MARK: Add Record
  // ────────────────────────────────────
  /**
   * Add a new bulk record to the database
   * 
   * @param {Object} params - Record parameters
   * @param {number} params.job_id - Job ID
   * @param {number} params.product_id - Product ID
   * @param {Object|string} params.calldata - Call data (will be JSON encoded if object)
   * @param {Object|string} params.response - Response data (will be JSON encoded if object)
   * @param {Object|string} [params.original=''] - Original data (will be JSON encoded if object)
   * @param {string} [params.context=''] - Context identifier (e.g., 'bulk_generation', 'single_product')
   * @returns {Promise<number|null>} Record ID on success, null on failure
   * 
   * @example
   * const recordId = await records.add({
   *     job_id: 123,
   *     product_id: 456,
   *     calldata: { prompt: 'Generate content', model: 'gpt-4' },
   *     response: { content: 'Generated text', tokens: 150 },
   *     original: { title: 'Original title', description: 'Original desc' },
   *     context: 'bulk_generation'
   * });
   */
  async add({ job_id, product_id, calldata, response, original = "", context = "product" }) {
    var _a;
    try {
      const formData = new FormData();
      formData.append("action", "csai_add_bulk_record");
      formData.append("nonce", this.nonce);
      formData.append("job_id", job_id);
      formData.append("product_id", product_id);
      formData.append("context", context);
      if (typeof calldata === "object") {
        formData.append("calldata", JSON.stringify(calldata));
      } else {
        formData.append("calldata", calldata);
      }
      if (typeof response === "object") {
        formData.append("response", JSON.stringify(response));
      } else {
        formData.append("response", response);
      }
      if (typeof original === "object") {
        formData.append("original", JSON.stringify(original));
      } else {
        formData.append("original", original);
      }
      const result = await this._fetch(formData);
      if (result.success) {
        log(`Record added: ID ${result.data.record_id}`);
        return result.data.record_id;
      } else {
        return this._error(((_a = result.data) == null ? void 0 : _a.message) || "Failed to add record");
      }
    } catch (error) {
      return this._error(error);
    }
  }
  // MARK: Update Record
  // ────────────────────────────────────
  /**
   * Update an existing record
   * 
   * @param {number} id - Record ID
   * @param {Object} data - Data to update
   * @param {string} [data.context] - Updated context identifier
   * @param {number} [data.job_id] - New job ID
   * @param {number} [data.product_id] - New product ID
   * @param {Object|string} [data.calldata] - Updated call data
   * @param {Object|string} [data.response] - Updated response data
   * @param {Object|string} [data.original] - Updated original data
   * @returns {Promise<boolean>} True on success, false on failure
   * 
   * @example
   * await records.update(123, {
   *     response: { content: 'Updated content', tokens: 200 },
   *     context: 'updated_context'
   * });
   */
  async update(id, data) {
    var _a;
    try {
      const formData = new FormData();
      formData.append("action", "csai_update_bulk_record");
      formData.append("nonce", this.nonce);
      formData.append("id", id);
      const updateData = {};
      if (data.context !== void 0) updateData.context = data.context;
      if (data.job_id !== void 0) updateData.job_id = data.job_id;
      if (data.product_id !== void 0) updateData.product_id = data.product_id;
      if (data.calldata !== void 0) {
        updateData.calldata = typeof data.calldata === "object" ? JSON.stringify(data.calldata) : data.calldata;
      }
      if (data.response !== void 0) {
        updateData.response = typeof data.response === "object" ? JSON.stringify(data.response) : data.response;
      }
      if (data.original !== void 0) {
        updateData.original = typeof data.original === "object" ? JSON.stringify(data.original) : data.original;
      }
      formData.append("data", JSON.stringify(updateData));
      const result = await this._fetch(formData);
      if (result.success) {
        log("Record updated");
        return true;
      } else {
        return this._error(((_a = result.data) == null ? void 0 : _a.message) || "Failed to update record");
      }
    } catch (error) {
      return this._error(error);
    }
  }
  // MARK: Batch Update Records
  // ────────────────────────────────────
  /**
   * Update multiple records at once
   * 
   * @param {Array} updates - Array of update objects {id, ...data}
   * @returns {Promise<boolean>} True on success, false on failure
   */
  async batchUpdate(updates) {
    var _a;
    try {
      const formData = new FormData();
      formData.append("action", "csai_update_bulk_records_batch");
      formData.append("nonce", this.nonce);
      const preparedUpdates = updates.map((update) => {
        const data = { ...update };
        if (data.calldata && typeof data.calldata === "object") data.calldata = JSON.stringify(data.calldata);
        if (data.response && typeof data.response === "object") data.response = JSON.stringify(data.response);
        if (data.original && typeof data.original === "object") data.original = JSON.stringify(data.original);
        if (data.context !== void 0) data.context = data.context;
        return data;
      });
      formData.append("updates", JSON.stringify(preparedUpdates));
      const result = await this._fetch(formData);
      if (result.success) {
        log("Records batch updated");
        return true;
      } else {
        return this._error(((_a = result.data) == null ? void 0 : _a.message) || "Failed to batch update records");
      }
    } catch (error) {
      return this._error(error);
    }
  }
  // MARK: Delete Record
  // ────────────────────────────────────
  /**
   * Delete a record by ID
   * 
   * @param {number} id - Record ID
   * @returns {Promise<boolean>} True on success, false on failure
   * 
   * @example
   * await records.delete(123);
   */
  async delete(id) {
    var _a;
    try {
      const formData = new FormData();
      formData.append("action", "csai_delete_bulk_record");
      formData.append("nonce", this.nonce);
      formData.append("id", id);
      const result = await this._fetch(formData);
      if (result.success) {
        log("Record deleted");
        return true;
      } else {
        return this._error(((_a = result.data) == null ? void 0 : _a.message) || "Failed to delete record");
      }
    } catch (error) {
      return this._error(error);
    }
  }
  // MARK: Get Records by Job
  // ────────────────────────────────────
  /**
   * Get all records for a specific job
   * 
   * @param {number} job_id - Job ID
   * @param {number} [page] - Optional page number (1-indexed). If provided, pagination is enabled.
   * @param {number} [perPage=20] - Optional records per page
   * @returns {Promise<Array|null>} Array of record objects or null on failure
   * 
   * @example
   * const records = await bulkRecords.getByJob(123);
   * const page2 = await bulkRecords.getByJob(123, 2, 50); // Page 2, 50 per page
   * records.forEach(record => {
   *     console.log(record.product_id, record.response.content);
   * });
   */
  async getByJob(job_id, page = null, perPage) {
    var _a;
    try {
      const formData = new FormData();
      formData.append("action", "csai_get_bulk_records_by_job");
      formData.append("nonce", this.nonce);
      formData.append("job_id", job_id);
      if (page !== null && page > 0) {
        formData.append("page", page);
        formData.append("perPage", perPage);
      }
      const result = await this._fetch(formData);
      if (result.success) {
        return result.data.records;
      } else {
        return this._error(((_a = result.data) == null ? void 0 : _a.message) || "Failed to get records");
      }
    } catch (error) {
      return this._error(error);
    }
  }
  // MARK: Get Records by Product
  // ────────────────────────────────────
  /**
   * Get all records for a specific product
   * 
   * @param {number} product_id - Product ID
   * @param {number} [page] - Optional page number (1-indexed). If provided, pagination is enabled.
   * @param {number} [perPage=20] - Optional records per page
   * @returns {Promise<Array|null>} Array of record objects or null on failure
   * 
   * @example
   * const records = await bulkRecords.getByProduct(456);
   * const page1 = await bulkRecords.getByProduct(456, 1, 50); // Page 1, 50 per page
   * records.forEach(record => {
   *     console.log(record.job_id, record.created);
   * });
   */
  async getByProduct(product_id, page = null, perPage) {
    var _a;
    try {
      const formData = new FormData();
      formData.append("action", "csai_get_bulk_records_by_product");
      formData.append("nonce", this.nonce);
      formData.append("product_id", product_id);
      if (page !== null && page > 0) {
        formData.append("page", page);
        formData.append("perPage", perPage);
      }
      const result = await this._fetch(formData);
      if (result.success) {
        return result.data.records;
      } else {
        return this._error(((_a = result.data) == null ? void 0 : _a.message) || "Failed to get records");
      }
    } catch (error) {
      return this._error(error);
    }
  }
  // MARK: Get Records by Context and Product
  // ────────────────────────────────────
  /**
   * Get all records for a specific context and product
   * 
   * @param {string} context - Context identifier
   * @param {number} product_id - Product ID
   * @param {number} [page] - Optional page number (1-indexed). If provided, pagination is enabled.
   * @param {number} [perPage=20] - Optional records per page
   * @returns {Promise<Array|null>} Array of record objects or null on failure
   * 
   * @example
   * const records = await bulkRecords.getByContextAndProduct('bulk_generation', 456);
   * const page1 = await bulkRecords.getByContextAndProduct('single_product', 456, 1, 50);
   * records.forEach(record => {
   *     console.log(record.context, record.created);
   * });
   */
  async getByContextAndProduct(context, product_id, page = null, perPage) {
    var _a;
    try {
      const formData = new FormData();
      formData.append("action", "csai_get_bulk_records_by_context_and_product");
      formData.append("nonce", this.nonce);
      formData.append("context", context);
      formData.append("product_id", product_id);
      if (page !== null && page > 0) {
        formData.append("page", page);
        formData.append("perPage", perPage);
      }
      const result = await this._fetch(formData);
      if (result.success) {
        return result.data.records;
      } else {
        return this._error(((_a = result.data) == null ? void 0 : _a.message) || "Failed to get records");
      }
    } catch (error) {
      return this._error(error);
    }
  }
  // MARK: Get Record IDs by Job
  // ────────────────────────────────────
  /**
   * Get all record IDs for a specific job
   *
   * @param {number} jobId - Job ID
   * @returns {Promise<Array<number>|null>} Array of record IDs or null on failure
   * 
   * @example
   * const recordIds = await bulkRecords.getRecordIdsByJob(123);
   * console.log(`Job has ${recordIds.length} records`);
   * // [1, 5, 8, 12, 15, ...]
   */
  async getRecordIdsByJob(jobId) {
    var _a;
    try {
      const formData = new FormData();
      formData.append("action", "csai_get_bulk_record_ids_by_job");
      formData.append("nonce", this.nonce);
      formData.append("job_id", jobId);
      const result = await this._fetch(formData);
      if (result.success) {
        return result.data.ids;
      } else {
        return this._error(((_a = result.data) == null ? void 0 : _a.message) || "Failed to get record IDs");
      }
    } catch (error) {
      return this._error(error);
    }
  }
  // MARK: Delete Records by Job
  // ────────────────────────────────────
  /**
   * Delete all records for a specific job
   * 
   * @param {number} job_id - Job ID
   * @returns {Promise<boolean>} True on success, false on failure
   * 
   * @example
   * await records.deleteByJob(123);
   */
  async deleteByJob(job_id) {
    var _a;
    try {
      const formData = new FormData();
      formData.append("action", "csai_delete_bulk_records_by_job");
      formData.append("nonce", this.nonce);
      formData.append("job_id", job_id);
      const result = await this._fetch(formData);
      if (result.success) {
        log(`Job ${job_id} records deleted`);
        return true;
      } else {
        return this._error(((_a = result.data) == null ? void 0 : _a.message) || "Failed to delete job records");
      }
    } catch (error) {
      return this._error(error);
    }
  }
  // MARK: Fetch Helper
  // ────────────────────────────────────
  /**
   * Internal fetch helper
   * @private
   */
  async _fetch(formData) {
    const response = await fetch(this.ajaxUrl, {
      method: "POST",
      body: formData
    });
    return await response.json();
  }
  // MARK: Error Handler
  // ────────────────────────────────────
  /**
   * Internal error handler
   * @private
   */
  _error(error) {
    const message = (error == null ? void 0 : error.message) || error || "Database operation failed";
    log("BulkRecords: " + message);
    return null;
  }
}
jQuery;
const { __: __$b, _x: _x$a, _n: _n$a, sprintf: sprintf$a } = wp.i18n;
class BulkJobEdit {
  // ────────────────────────────────────
  constructor(jobId) {
    this.$admin = document.querySelector(".copyspell-ai-tab-content");
    this.$container = null;
    this.$list = null;
    this.jobId = jobId || null;
    this.records = null;
    this.allIds = [];
    this.ids = [];
    this.totalPages = 0;
    this.currentPage = 1;
    this.itemsPerPage = 20;
    this.totalItems = 0;
    this.init();
  }
  // MARK: Init
  // ────────────────────────────────────
  async init() {
    this.$admin.innerHTML = "";
    this.statusUI();
    this.$container = document.createElement("div");
    this.$container.className = "aai-bulk-records-list";
    this.$admin.appendChild(this.$container);
    this.$container.innerHTML = `
			<div class="aai-initial-loader">
				<div class="aai-loader-container">
					${SVG.loader7}
					<p>Loading products...</p>
				</div>
			</div>
		`;
    await this.fetchRecords();
    this.render();
    this.events();
  }
  // MARK: Fetch Records
  // ────────────────────────────────────
  async fetchRecords() {
    this.fetching = true;
    if (!this.REC) {
      this.REC = new BulkRecords();
      this.allIds = await this.REC.getRecordIdsByJob(this.jobId);
      this.allIds = this.allIds ? this.allIds.map((id) => Number(id)) : [];
      this.ids = [];
      this.totalItems = this.allIds ? this.allIds.length : 0;
      this.totalPages = Math.ceil(this.totalItems / this.itemsPerPage);
    }
    this.records = await this.REC.getByJob(this.jobId, this.currentPage, this.itemsPerPage);
    this.fetching = false;
    if (!this.records) {
      this.records = [];
    }
    this.setCount();
  }
  // MARK: Render
  // ────────────────────────────────────
  render() {
    if (this.fetching) {
      this.$container.innerHTML = `
				<div class="aai-initial-loader">
					<div class="aai-loader-container">
						${SVG.loader7}
						<p>Loading products...</p>
					</div>
				</div>
			`;
      if (!this._renderInterval) {
        this._renderInterval = setInterval(() => {
          if (!this.fetching) {
            clearInterval(this._renderInterval);
            this._renderInterval = null;
            this.render();
          }
        }, 100);
      }
      return;
    }
    if (!this.records.length) {
      this.$container.innerHTML = '<div class="aai-no-records">No products found</div>';
      return;
    }
    let dsbl = this.ids.length === 0 ? " disabled" : "";
    let html = "";
    html += `
			<div class="aai-select-all-container">
				<button class="aai-btn aai-btn-secondary aai-select-all-btn">Select All</button>
				<button class="aai-btn aai-btn-secondary aai-deselect-all-btn">Deselect All</button>
				<div class="actus-flex-1"></div>
				<button class="aai-btn aai-btn-secondary aai-retry-btn"${dsbl}>Retry Failed</button>
				<button class="aai-btn aai-btn-secondary aai-regenerate-btn"${dsbl}>Regenerate Selected</button>
			</div>
			<div class="aai-products-grid aai-job-products-grid">
		`;
    html += `
			<div class="aai-product-header">
				<div class="aai-product-checkbox"><input type="checkbox" class="aai-product-select-all"></div>
				<div class="aai-product-sku">ID</div>
				<div class="aai-product-status">Status</div>
				<div class="aai-product-title">Title</div>
				<div class="aai-product-content">Excerpt</div>
				<div class="aai-product-url">Actions</div>
			</div>
		`;
    log("this.records", this.records);
    let originals = {};
    this.records.forEach((product) => {
      var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
      product.id = Number(product.id);
      product.original = this.records.find(
        (r) => {
          var _a2;
          return r.product_id === product.product_id && ((_a2 = r.calldata) == null ? void 0 : _a2._type) === "original";
        }
      );
      product.original = ((_a = product.original) == null ? void 0 : _a.content) || {};
      if (((_b = product.calldata) == null ? void 0 : _b._type) == "original") {
        originals[product.id] = product;
        return;
      }
      product.content = product.content || {};
      const isExcluded = !this.ids.includes(product.id);
      const checkedAttr = isExcluded ? "" : "checked";
      let modelName = ((_d = (_c = product.content) == null ? void 0 : _c.model) == null ? void 0 : _d.replace(/-/g, " ")) || "";
      let clss = "";
      let status = "";
      let final = [];
      if ((_f = (_e = product.content) == null ? void 0 : _e.errors) == null ? void 0 : _f.length) {
        clss = " aai-error-product";
        status += '<span class="aai-error-box">error</span>';
      }
      if (((_g = product.calldata) == null ? void 0 : _g._type) == "published")
        status += `<span class="aai-success-box">${__$b("published", "copyspell-ai")}</span>`;
      else if (((_h = product.calldata) == null ? void 0 : _h._type) == "original")
        status += `<span class="aai-info-box">${((_i = product.calldata) == null ? void 0 : _i._type) || ""}</span>`;
      else
        status += `<span class="aai-gray-box">${((_j = product.calldata) == null ? void 0 : _j._type) || ""}</span>`;
      html += `
				<div class="aai-product-item${clss}" data-id="${product.id}">
					<div class="aai-product-checkbox"><input type="checkbox" class="aai-product-select" data-id="${product.id}" ${checkedAttr}></div>
					<div class="aai-product-sku">${product.product_id}</div>
					<div class="aai-product-status">${status}</div>
					<div class="aai-product-title">
						<span>${product.original.title || ""}</span><br>
						${product.content.title || ""}
						<div class="aai-model-name">${modelName ? modelName : ""}</div>
						${((_l = (_k = product.content) == null ? void 0 : _k.errors) == null ? void 0 : _l.length) ? `<div class="aai-product-error-summary">${product.content.errors.map((e) => `<div class="aai-error-message">${e.error}</div>`).join("")}</div>` : ""}
					</div>
					<div class="aai-product-content">
						${final.length ? `<div class="aai-product-error">${product.content.errors.map((e) => !e.final ? e.error : "").join("<br>")}</div>` : `${product.content.excerpt || product.original.excerpt || ""}`}
					</div>
					<div class="aai-product-actions">
						${product.original.url ? `<div class="aai-product-url"><button class="aai-product-view aai-btn aai-btn-secondary"><a href="${product.original.url}" target="_blank" rel="noopener noreferrer">${SVG.link}</a></button></div>` : ""}
						<div class="aai-product-url"><button class="aai-product-refresh aai-btn aai-btn-secondary">${SVG.refresh}</button></div>
					</div>
				</div>
			`;
    });
    html += "</div>";
    html += this.pagination();
    this.$container.innerHTML = html;
  }
  // MARK: Events
  // ────────────────────────────────────
  events() {
    this.$container.addEventListener("click", (e) => {
      if (e.target.classList.contains("aai-select-all-btn")) {
        this.ids = [...this.allIds];
        this.setCount();
        this.render();
      }
      if (e.target.classList.contains("aai-deselect-all-btn")) {
        this.ids = [];
        this.setCount();
        this.render();
      }
      if (e.target.classList.contains("aai-pagination-btn") && !e.target.disabled) {
        const page = parseInt(e.target.dataset.page);
        if (page && page !== this.currentPage) {
          this.handlePagination(page);
        }
      }
      if (e.target.closest(".aai-product-content")) {
        const $item = e.target.closest(".aai-product-item");
        const recordId = $item.dataset.id;
        const record = this.records.find((p) => p.id == recordId);
        if (record && record.content) {
          this.previewProduct(record);
        }
      }
    });
    this.$container.addEventListener("change", (e) => {
      if (e.target.classList.contains("aai-product-select")) {
        const productId = parseInt(e.target.dataset.id);
        const isChecked = e.target.checked;
        if (!isChecked) {
          const index = this.ids.indexOf(productId);
          if (index > -1) this.ids.splice(index, 1);
        } else {
          if (!this.ids.includes(productId)) this.ids.push(productId);
        }
        this.setCount();
      }
      if (e.target.classList.contains("aai-product-select-all")) {
        const isChecked = e.target.checked;
        const checkboxes = this.$container.querySelectorAll(".aai-product-select");
        checkboxes.forEach((checkbox) => {
          const productId = parseInt(checkbox.dataset.id);
          checkbox.checked = isChecked;
          if (!isChecked) {
            const index = this.ids.indexOf(productId);
            if (index > -1) this.ids.splice(index, 1);
          } else {
            if (!this.ids.includes(productId)) this.ids.push(productId);
          }
        });
        this.setCount();
      }
    });
  }
  // MARK: Preview Product
  // ────────────────────────────────────
  previewProduct(product) {
    var _a, _b, _c;
    const originalRecord = this.records.find(
      (r) => {
        var _a2;
        return r.product_id === product.product_id && ((_a2 = r.calldata) == null ? void 0 : _a2._type) === "original";
      }
    );
    product.original = originalRecord.content || {};
    log("PREVIEW PRODUCT ==>>", product);
    const $overlay = document.createElement("div");
    $overlay.className = "aai-bulk-preview-modal aai-modal-overlay active";
    const $modal = document.createElement("div");
    $modal.className = "aai-modal";
    const isSelected = this.ids.includes(Number(product.id));
    $modal.innerHTML = `
			<div class="aai-modal-header">
				<h3 class="aai-modal-title">Product #${product.product_id || ""}</h3>
				<button class="aai-modal-close">&times;</button>
			</div>
			<div class="aai-modal-body">
				<div class="aai-preview-product-flex">
					<div class="aai-preview-product aai-preview-original">
						<div class="aai-preview-title">${product.original.title || ""}</div>
						<div class="aai-preview-excerpt"><span>short description</span>${product.original.excerpt || ""}</div>
						<div class="aai-preview-content">${product.original.content || ""}</div>
					</div>
					<div class="aai-preview-product aai-preview-response">
						<div class="aai-preview-title">${product.content.title || ""}</div>
						<div class="aai-preview-excerpt"><span>short description</span>${product.content.excerpt || ""}</div>
						<div class="aai-preview-content">${product.content.content || ""}</div>
						${product.content.errors && product.content.errors.length ? `<div class="aai-preview-errors">${product.content.errors.map((e) => !e.final ? `<div class="aai-preview-error">${e.error}</div>` : "").join("")}</div>` : ""}

					</div>
				</div>
			</div>
			<div class="aai-modal-footer">
				${!isSelected ? `<button class="aai-btn aai-btn-secondary aai-modal-mark">${__$b("Mark as Selected", "copyspell-ai")}</button>` : ""}
				<button class="aai-btn aai-btn-primary aai-modal-update" data-id="${product.id}">${__$b("Publish Product", "copyspell-ai")}</button>
			</div>
		`;
    $overlay.appendChild($modal);
    document.body.appendChild($overlay);
    const closeModal = () => {
      $overlay.classList.remove("active");
      setTimeout(() => $overlay.remove(), 300);
    };
    (_a = $overlay.querySelector(".aai-modal-update")) == null ? void 0 : _a.addEventListener("click", this.updateProduct.bind(this));
    (_b = $overlay.querySelector(".aai-modal-close")) == null ? void 0 : _b.addEventListener("click", closeModal);
    $overlay.addEventListener("click", (e) => {
      if (e.target === $overlay) closeModal();
    });
    (_c = $overlay.querySelector(".aai-modal-mark")) == null ? void 0 : _c.addEventListener("click", (e) => {
      const productId = parseInt(product.id);
      if (!this.ids.includes(productId)) this.ids.push(productId);
      const checkbox = this.$container.querySelector(`.aai-product-select[data-id="${productId}"]`);
      if (checkbox) checkbox.checked = true;
      this.setCount();
      closeModal();
    });
  }
  // MARK: Update Selected
  // ────────────────────────────────────
  async UpdateSelected() {
    log("UPDATE SELECTED IDS ==>>", this.ids);
    if (!this.ids.length) return;
    await this.showLoader();
    const batchSize = 50;
    const totalPages = Math.ceil(this.totalItems / batchSize);
    let publishedCount = 0;
    try {
      for (let page = 1; page <= totalPages; page++) {
        let records = await this.REC.getByJob(this.jobId, page, batchSize);
        if (!records || !records.length) break;
        let batchToUpdate = records.filter((r) => this.ids.includes(Number(r.id)));
        if (batchToUpdate.length > 0) {
          let productUpdates = batchToUpdate.map((record) => ({
            id: record.product_id,
            name: record.content.title || record.original.title,
            description: record.content.content,
            short_description: record.content.excerpt
          }));
          await wpAPI$1.batchUpdateProducts(productUpdates);
          let recordUpdates = batchToUpdate.map((record) => {
            if (!record.calldata) record.calldata = {};
            record.calldata._type = "published";
            return {
              id: record.id,
              calldata: record.calldata
            };
          });
          await this.REC.batchUpdate(recordUpdates);
          publishedCount += batchToUpdate.length;
        }
      }
      this.hideLoader();
      alert(`${__$b("Successfully published", "copyspell-ai")} ${publishedCount} ${__$b("products", "copyspell-ai")}.`);
      await this.fetchRecords();
      this.render();
    } catch (error) {
      log("❌ error", error);
      this.hideLoader();
      alert(__$b("An error occurred while updating products.", "copyspell-ai"));
    }
  }
  // MARK: Update Product
  // ────────────────────────────────────
  async updateProduct(e) {
    let $container = document.querySelector(".aai-preview-original");
    $container.innerHTML = `
			<div class="aai-loader-container">
				${SVG.loader7}
				<div>${__$b("Publishing...", "copyspell-ai")}</div>
			</div>
		`;
    const $item = e.target.closest(".aai-btn");
    const recordId = $item.dataset.id;
    const record = this.records.find((p) => p.id == recordId);
    $item.disabled = true;
    let data = {
      id: record.product_id,
      name: record.original.title,
      description: record.content.content,
      short_description: record.content.excerpt
    };
    let response = await wpAPI$1.batchUpdateProducts([data]);
    record.calldata._type = "published";
    this.REC.update(record.id, { calldata: record.calldata });
    $container.innerHTML = `<div class="aai-loader-container">
			<div class="aai-success">${__$b("Product published successfully!", "copyspell-ai")}</div>
			<button class="aai-btn aai-btn-primary aai-modal-close">${__$b("Close", "copyspell-ai")}</button>
		</div>`;
    $container.querySelector(".aai-modal-close").addEventListener("click", () => {
      const modal = $container.closest(".aai-modal-overlay");
      if (modal) modal.remove();
    });
    log("BATCH UPDATE RESPONSE ==>>", response);
  }
  // MARK: Pagination
  // ────────────────────────────────────
  pagination() {
    this.totalPages = Math.ceil(this.totalItems / this.itemsPerPage);
    if (this.totalPages <= 1) return "";
    let html = '<div class="aai-pagination">';
    const prevDisabled = this.currentPage === 1 ? "disabled" : "";
    html += `<button class="aai-pagination-btn aai-pagination-prev" data-page="${this.currentPage - 1}" ${prevDisabled}>Previous</button>`;
    html += '<div class="aai-pagination-numbers">';
    const maxVisiblePages = 7;
    let startPage = Math.max(1, this.currentPage - Math.floor(maxVisiblePages / 2));
    let endPage = Math.min(this.totalPages, startPage + maxVisiblePages - 1);
    if (endPage - startPage < maxVisiblePages - 1) {
      startPage = Math.max(1, endPage - maxVisiblePages + 1);
    }
    if (startPage > 1) {
      html += `<button class="aai-pagination-btn" data-page="1">1</button>`;
      if (startPage > 2) {
        html += '<span class="aai-pagination-ellipsis">...</span>';
      }
    }
    for (let i = startPage; i <= endPage; i++) {
      const active = i === this.currentPage ? "active" : "";
      html += `<button class="aai-pagination-btn ${active}" data-page="${i}">${i}</button>`;
    }
    if (endPage < this.totalPages) {
      if (endPage < this.totalPages - 1) {
        html += '<span class="aai-pagination-ellipsis">...</span>';
      }
      html += `<button class="aai-pagination-btn" data-page="${this.totalPages}">${this.totalPages}</button>`;
    }
    html += "</div>";
    const nextDisabled = this.currentPage === this.totalPages ? "disabled" : "";
    html += `<button class="aai-pagination-btn aai-pagination-next" data-page="${this.currentPage + 1}" ${nextDisabled}>Next</button>`;
    html += `<div class="aai-pagination-info">Page ${this.currentPage} of ${this.totalPages} (${this.totalItems} items)</div>`;
    html += "</div>";
    return html;
  }
  // MARK: Status UI
  // ────────────────────────────────────
  statusUI() {
    let html = `
			<h4>Selected products: <span class="aai-count">0</span></h4>
			<div class="aai-bulk-pagination"></div>
			<button class="aai-btn aai-btn-primary aai-button-generate">${__$b("Publish Selected Products", "copyspell-ai")}</button>
		`;
    this.$status = document.createElement("div");
    this.$status.classList.add("aai-bulk-status");
    this.$status.innerHTML = html;
    this.$status.setAttribute("count", "0");
    this.$admin.appendChild(this.$status);
    this.$count = this.$status.querySelector(".aai-count");
    this.$pagination = this.$status.querySelector(".aai-bulk-pagination");
    let $button = this.$status.querySelector(".aai-button-generate");
    $button.addEventListener("click", this.UpdateSelected.bind(this));
  }
  // MARK: Show Loader
  // ────────────────────────────────────
  async showLoader() {
    this.$grid = this.$container.querySelector(".aai-products-grid");
    const items = this.$container.querySelectorAll(".aai-products-grid > *");
    items.forEach((item) => item.style.opacity = "0.3");
    if (!this.$loaderOverlay) {
      this.$loaderOverlay = document.createElement("div");
      this.$loaderOverlay.className = "aai-loader-overlay";
      this.$loaderOverlay.innerHTML = `
				<div class="aai-loader-container">
					${SVG.loader7}
					<p>Loading products...</p>
				</div>
			`;
    }
    this.$container.style.position = "relative";
    this.$grid.appendChild(this.$loaderOverlay);
    await new Promise((resolve) => setTimeout(resolve, 100));
  }
  // MARK: Hide Loader
  // ────────────────────────────────────
  hideLoader() {
    if (this.$loaderOverlay && this.$loaderOverlay.parentNode) {
      this.$loaderOverlay.remove();
    }
    const items = this.$container.querySelectorAll(".aai-products-grid > *");
    items.forEach((item) => item.style.opacity = "1");
  }
  // MARK: Handle Pagination
  // ────────────────────────────────────
  async handlePagination(page) {
    this.currentPage = page;
    await this.showLoader();
    await this.fetchRecords();
    this.render();
    this.hideLoader();
    this.$container.scrollIntoView({ behavior: "smooth", block: "start" });
  }
  // MARK: Set Count
  // ────────────────────────────────────
  setCount(count) {
    count = count !== void 0 ? count : this.ids.length;
    if (count < 0) count = 0;
    this.$count.innerText = count;
    this.$status.setAttribute("count", count);
    let $regenerateButton = document.querySelector(".aai-regenerate-btn");
    if ($regenerateButton) $regenerateButton.disabled = count === 0;
    if (this.totalPages > 1) {
      this.$pagination.innerHTML = `
				<button class="aai-pagination-btn aai-pagination-prev aai-pagination-compact" ${this.currentPage === 1 ? "disabled" : ""} data-page="${this.currentPage - 1}">Previous</button>
				<span class="aai-pagination-info">Page ${this.currentPage} of ${this.totalPages}</span>
				<button class="aai-pagination-btn aai-pagination-next aai-pagination-compact" ${this.currentPage === this.totalPages ? "disabled" : ""} data-page="${this.currentPage + 1}">Next</button>
			`;
    }
  }
}
jQuery;
const DATA$a = window.copyspell_ai_admin || {};
const { __: __$a, _x: _x$9, _n: _n$9, sprintf: sprintf$9 } = wp.i18n;
class BulkMonitor {
  // ────────────────────────────────────
  constructor() {
    this.$admin = document.querySelector(".copyspell-ai-tab-content");
    this.$container = null;
    this.$list = null;
    this.$pagination = null;
    this.jobs = { all: [] };
    this.job = null;
    this.interval = null;
    this.intervalTime = 5e3;
    this.currentPage = 1;
    this.perPage = 20;
    this.totalJobs = 0;
    this.init();
  }
  // MARK: Init
  // ────────────────────────────────────
  async init() {
    this.renderUI();
    await this.loadJobs("all");
    this.renderJobs();
    this.startMonitor();
  }
  // MARK: Render UI
  // ────────────────────────────────────
  renderUI() {
    this.$admin.innerHTML = "";
    this.$container = document.createElement("div");
    this.$container.classList.add("aai-bulk-monitor");
    this.$admin.appendChild(this.$container);
    this.$container.innerHTML = `
			<h2 class="aai-bulk-title">${__$a("Bulk Jobs", "copyspell-ai")}</h2>
			<div class="aai-bulk-jobs-list"></div>
			<div class="aai-bulk-pagination"></div>
		`;
    this.$list = this.$container.querySelector(".aai-bulk-jobs-list");
    this.$pagination = this.$container.querySelector(".aai-bulk-pagination");
  }
  // MARK: Render Jobs
  // ────────────────────────────────────
  renderJobs() {
    this.$list.innerHTML = "";
    this.jobs.all.forEach((job) => {
      var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
      if (Array.isArray(job.meta.ai_settings)) {
        job.meta.ai_settings = {};
      }
      let total = (job.meta.processed || 0) + " / " + (job.meta.total || 0);
      if (job.meta.processed == job.meta.total) {
        total = job.meta.total || 0;
      }
      let jobTime = job.meta.started_at ? new Date(job.meta.started_at) : null;
      let completedAt = job.meta.completed_at ? new Date(job.meta.completed_at) : null;
      if (jobTime && completedAt) {
        completedAt = completedAt.getTime();
        let diffMs = completedAt - jobTime;
        let diffMins = Math.floor(diffMs / 6e4);
        let diffSecs = Math.floor(diffMs % 6e4 / 1e3);
        jobTime = `${diffMins}m ${diffSecs}s`;
      } else {
        jobTime = "";
      }
      let errors = [];
      try {
        errors = JSON.parse(job.meta.errors || "[]");
      } catch (e) {
        errors = [];
      }
      const jobEl = document.createElement("div");
      jobEl.classList.add("aai-bulk-job");
      jobEl.classList.add("aai-bulk-job-" + job.status);
      if (typeof ((_a = job.meta.ai_settings) == null ? void 0 : _a.audiences) === "string") {
        job.meta.ai_settings.audiences = job.meta.ai_settings.audiences.split(",").map((s) => s.trim());
      }
      if (typeof ((_b = job.meta.ai_settings) == null ? void 0 : _b.tone) === "string") {
        job.meta.ai_settings.tone = job.meta.ai_settings.tone.split(",").map((s) => s.trim());
      }
      if (typeof ((_c = job.meta.ai_settings) == null ? void 0 : _c.priorities) === "string") {
        job.meta.ai_settings.priorities = job.meta.ai_settings.priorities.split(",").map((s) => s.trim());
      }
      jobEl.innerHTML = `
				<div class="aai-bulk-job-title">
					<h3>Job #${job.id}</h3>
					<div class="aai-bulk-job-status status-${job.status}">${job.status}</div><span class="aai-job-time">${jobTime}</span>
				</div>
				<div class="aai-bulk-job-actions">
					${job.meta.processed > 0 ? `<button class="aai-btn aai-btn-secondary aai-bulk-monitor-edit-btn" data-job-id="${job.id}">View Products</button>` : ""}
					${job.status === "running" ? `<button class="aai-btn aai-btn-secondary aai-bulk-monitor-cancel-btn" data-job-id="${job.id}">Cancel Job</button>` : ""}
				</div>
				<div class="aai-bulk-counts">
					${job.status == "running" ? `<div class="aai-spinner">${SVG.refresh}</div>` : ""}
					<p><strong>Processed</strong> <span>${total}</span></p>
					<p class="aai-success"><strong>Success</strong> <span>${job.meta.success || 0}</span></p>
					<p class="aai-failed"><strong>Failed</strong> <span>${job.meta.failed || 0}</span></p>
				</div>
				<div class="aai-bulk-meta">
					${Object.keys(job.meta.query).map((q) => `<span class="aai-bulk-query"><strong>${q}:</strong> ${job.meta.query[q]}</span>`).join(" ")}
				</div>
				<div class="aai-bulk-job-settings">
					${((_e = (_d = job.meta.ai_settings) == null ? void 0 : _d.audiences) == null ? void 0 : _e.map((a) => `<span class="aai-chip aai-bulk-audience">${a}</span>`).join(" ")) || ""}
					${((_g = (_f = job.meta.ai_settings) == null ? void 0 : _f.tone) == null ? void 0 : _g.map((t) => `<span class="aai-chip aai-bulk-tone">${t}</span>`).join(" ")) || ""}
					${((_i = (_h = job.meta.ai_settings) == null ? void 0 : _h.priorities) == null ? void 0 : _i.map((p) => `<span class="aai-chip aai-bulk-priority">${p}</span>`).join(" ")) || ""}
					<span class="aai-chip aai-bulk-size">${((_j = job.meta.ai_settings) == null ? void 0 : _j["content-size"]) || ""}</span>
					<span class="aai-chip aai-bulk-framework">${((_k = job.meta.ai_settings) == null ? void 0 : _k.framework) || ""}</span>
					<span class="aai-chip aai-bulk-language">${((_l = job.meta.ai_settings) == null ? void 0 : _l.language) || ""}</span>
				</div>
				${job.status === "running" ? `<div class="aai-bulk-current-model">
						<div>${job.meta.current_model ? `<strong>Current Model:</strong> ${job.meta.current_model || ""}` : ""}</div>
						${job.meta.batch_ids ? `<div><strong>Current Products:</strong> ${job.meta.batch_ids || ""}</div>` : ""}
						</div>${job.meta.current_error ? `<div class="aai-bulk-current-error">${job.meta.current_error}</div>` : ""}` : ""}
				<div class="aai-bulk-meta">
					${errors.length > 0 ? `<ul class="aai-bulk-error-list">${errors.map((e) => `<li class="aai-error-message">${e.error}</li>`).join("")}</ul>` : ""}
				</div>
						`;
      this.$list.appendChild(jobEl);
    });
    const runningJobs = Array.from(this.$list.querySelectorAll(".aai-bulk-job-running"));
    runningJobs.reverse().forEach((jobEl) => {
      this.$list.prepend(jobEl);
    });
    this.$list.querySelectorAll(".aai-bulk-monitor-cancel-btn").forEach((btn) => {
      btn.addEventListener("click", async (e) => {
        const jobId = e.target.getAttribute("data-job-id");
        await this.cancelJob(jobId);
        await this.loadJobs();
        this.renderJobs();
      });
    });
    this.$list.querySelectorAll(".aai-bulk-monitor-edit-btn").forEach((btn) => {
      btn.addEventListener("click", async (e) => {
        const jobId = e.target.getAttribute("data-job-id");
        await this.editJob(jobId);
      });
    });
    this.renderPagination();
  }
  // MARK: Render Pagination
  // ────────────────────────────────────
  renderPagination() {
    const totalPages = Math.ceil(this.totalJobs / this.perPage);
    if (totalPages <= 1) {
      this.$pagination.innerHTML = "";
      return;
    }
    const maxVisible = 5;
    let startPage = Math.max(1, this.currentPage - Math.floor(maxVisible / 2));
    let endPage = Math.min(totalPages, startPage + maxVisible - 1);
    if (endPage - startPage < maxVisible - 1) {
      startPage = Math.max(1, endPage - maxVisible + 1);
    }
    let paginationHTML = '<div class="aai-pagination-controls">';
    if (this.currentPage > 1) {
      paginationHTML += `<button class="aai-btn aai-btn-pagination" data-page="${this.currentPage - 1}">← Previous</button>`;
    }
    if (startPage > 1) {
      paginationHTML += `<button class="aai-btn aai-btn-pagination" data-page="1">1</button>`;
      if (startPage > 2) {
        paginationHTML += `<span class="aai-pagination-ellipsis">...</span>`;
      }
    }
    for (let i = startPage; i <= endPage; i++) {
      const activeClass = i === this.currentPage ? "aai-btn-active" : "";
      paginationHTML += `<button class="aai-btn aai-btn-pagination ${activeClass}" data-page="${i}">${i}</button>`;
    }
    if (endPage < totalPages) {
      if (endPage < totalPages - 1) {
        paginationHTML += `<span class="aai-pagination-ellipsis">...</span>`;
      }
      paginationHTML += `<button class="aai-btn aai-btn-pagination" data-page="${totalPages}">${totalPages}</button>`;
    }
    if (this.currentPage < totalPages) {
      paginationHTML += `<button class="aai-btn aai-btn-pagination" data-page="${this.currentPage + 1}">Next →</button>`;
    }
    paginationHTML += `</div>`;
    paginationHTML += `<div class="aai-pagination-info">Showing page ${this.currentPage} of ${totalPages} (${this.totalJobs} total jobs)</div>`;
    this.$pagination.innerHTML = paginationHTML;
    this.$pagination.querySelectorAll(".aai-btn-pagination").forEach((btn) => {
      btn.addEventListener("click", async (e) => {
        const page = parseInt(e.target.getAttribute("data-page"));
        await this.changePage(page);
      });
    });
  }
  // MARK: Change Page
  // ────────────────────────────────────
  async changePage(page) {
    this.currentPage = page;
    await this.loadJobs("all");
    this.renderJobs();
    this.$container.scrollIntoView({ behavior: "smooth", block: "start" });
  }
  // MARK: Edit Job
  // ────────────────────────────────────
  async editJob(id) {
    new BulkJobEdit(id);
  }
  // MARK: Start Monitor
  // ────────────────────────────────────
  startMonitor(force = false) {
    let runningJobs = this.jobs.all.filter((job) => job.status === "running");
    if (runningJobs.length === 0 && !force) return;
    this.interval = setInterval(async () => {
      await this.loadJobs("all");
      this.renderJobs();
      runningJobs = this.jobs.all.filter((job) => job.status === "running");
      if (runningJobs.length === 0) {
        clearInterval(this.interval);
      }
    }, this.intervalTime);
  }
  // MARK: Load Jobs
  // ────────────────────────────────────
  async loadJobs(status = "running") {
    if (!this.JOBS) this.JOBS = new BulkJobs();
    if (status === "all") {
      const allJobs = await this.JOBS.getAll({
        limit: -1,
        order_by: "updated",
        order: "DESC"
      });
      this.totalJobs = allJobs.length;
      this.jobs.all = await this.JOBS.getAll({
        page: this.currentPage,
        perPage: this.perPage,
        order_by: "updated",
        order: "DESC"
      });
      return;
    }
    this.jobs[status] = await this.JOBS.getByStatus(status);
  }
  // MARK: Cancel Job
  // ────────────────────────────────────
  async cancelJob(id) {
    let res = await fetch(DATA$a.ajax_url, {
      method: "POST",
      body: new URLSearchParams({
        action: "csai_bulk_cancel",
        job_id: id || this.job.id,
        nonce: DATA$a.nonce
      })
    });
    res = await res.json();
    return res;
  }
}
let $$5 = jQuery;
const DATA$9 = window.copyspell_ai_admin || {};
const { __: __$9, _x: _x$8, _n: _n$8, sprintf: sprintf$8 } = wp.i18n;
class BulkGenerate {
  // ────────────────────────────────────
  constructor() {
    this.$admin = document.querySelector(".copyspell-ai-tab-content");
    this.$container = null;
    this.$bulkStatus = null;
    this.query = {};
    this.ids = [];
    this.total = 0;
    this.jobs = new BulkJobs();
    this.records = new BulkRecords();
    this.job = null;
    this.record = null;
    this.bulk = null;
    this.init();
  }
  // MARK: Init
  // ────────────────────────────────────
  init() {
  }
  // MARK: New Job
  // ────────────────────────────────────
  async newJob(query, ids = [], aiSettings = {}) {
    this.query = query || this.query;
    this.ids = ids || this.ids;
    this.total = this.ids.length;
    log("NEW JOB", aiSettings);
    this.job = {
      status: "running",
      meta: {
        total: this.ids.length,
        query: this.query,
        ids: this.ids,
        processed: 0,
        success: 0,
        failed: 0,
        started_at: null,
        completed_at: null,
        settings: {},
        ai_settings: aiSettings || {}
      }
    };
    this.job.id = await this.jobs.add(this.job);
    if (this.job.id) {
      log("BulkGenerate: Created new job with ID " + this.job.id);
      this.start();
    } else {
      log("BulkGenerate: Failed to create new job");
    }
  }
  // MARK: Start Job
  // ────────────────────────────────────
  async start() {
    this.bulk = await $$5.post(DATA$9.ajax_url, {
      action: "csai_bulk_start",
      query: this.query,
      job_id: this.job.id,
      _ajax_nonce: DATA$9.nonce
    });
    new BulkMonitor();
    log("BULK START ==>>", this.bulk);
  }
  // MARK: Cancel Job
  // ────────────────────────────────────
  async cancelJob(id) {
    fetch(DATA$9.ajax_url, {
      method: "POST",
      body: new URLSearchParams({
        action: "csai_bulk_cancel",
        job_id: id || this.job.id,
        nonce: DATA$9.nonce
      })
    });
  }
}
jQuery;
const DATA$8 = window.copyspell_ai_admin || {};
const { __: __$8, _x: _x$7, _n: _n$7, sprintf: sprintf$7 } = wp.i18n;
async function productQuery(_query, mode = "full", limit = 20, page = 1, images = false) {
  var _a;
  if (!_query || typeof _query !== "object") {
    _log("❌ Query must be an object");
    return null;
  }
  let query = JSON.parse(JSON.stringify(_query));
  delete query.description;
  try {
    if (!images) images = "";
    const formData = new FormData();
    formData.append("action", "csai_query");
    formData.append("limit", limit);
    formData.append("page", page);
    formData.append("images", images);
    formData.append("query", JSON.stringify(query));
    formData.append("nonce", (DATA$8 == null ? void 0 : DATA$8.nonce) || "");
    formData.append("mode", mode);
    const response = await fetch(DATA$8.ajax_url, {
      method: "POST",
      body: formData
    });
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    const data = await response.json();
    if (data.success) {
      if (mode == "count") {
        return data.data.count;
      } else if (mode == "ids") {
        return data.data;
      } else if (mode == "full") {
        return data.data;
      }
    } else {
      _log("data", data);
      _log("❌ Error from server:", ((_a = data.data) == null ? void 0 : _a.message) || "Unknown error");
      return null;
    }
  } catch (error) {
    _log("❌ Error getting product count:", error);
    throw error;
  }
}
function buildCategoryTree(categories, parentId = 0, visited = /* @__PURE__ */ new Set()) {
  const tree = [];
  for (const category of categories) {
    if (visited.has(category.term_id)) {
      continue;
    }
    const catParent = category.parent !== void 0 ? category.parent : category.category_parent;
    if (catParent == parentId) {
      visited.add(category.term_id);
      const node = {
        id: category.term_id,
        name: category.name,
        slug: category.slug,
        parent: catParent,
        count: category.count || 0,
        children: []
      };
      node.children = buildCategoryTree(categories, category.term_id, visited);
      tree.push(node);
    }
  }
  return tree;
}
function renderCategoryTree(tree, value) {
  if (!tree.length) return "";
  return `<ul>
		${tree.map((cat) => {
    const isChecked = (value == null ? void 0 : value.includes(String(cat.slug))) ? "checked" : "";
    let liClass = "aai-no-children";
    let caret = "";
    if (cat.children && cat.children.length) {
      liClass = "aai-has-children is-closed";
      caret = '<span class="aai-caret"></span>';
    }
    return `
			<li class="${liClass}">
				<label>
					<input type="checkbox" value="${decodeURIComponent(cat.slug)}" class="aai-category-checkbox" ${isChecked} />
					${caret}
					<span class="aai-name">${cat.name}</span>
				</label>
				${renderCategoryTree(cat.children, value)}
			</li>
		`;
  }).join("")}
	</ul>`;
}
jQuery;
const DATA$7 = window.copyspell_ai_admin || {};
const { __: __$7, _x: _x$6, _n: _n$6, sprintf: sprintf$6 } = wp.i18n;
class BulkListProducts {
  // ────────────────────────────────────
  constructor(query, ids) {
    this.$admin = document.querySelector(".copyspell-ai-tab-content");
    this.$container = null;
    this.$bulkStatus = null;
    this.query = query || {};
    this.products = [];
    this.allIds = [...ids];
    this.ids = [...ids];
    this.totalPages = 0;
    this.currentPage = 1;
    this.count = 0;
    this.init();
  }
  // MARK: Init
  // ────────────────────────────────────
  async init() {
    this.$admin.innerHTML = "";
    this.statusUI();
    this.$container = document.createElement("div");
    this.$container.className = "aai-bulk-products-list";
    this.$admin.appendChild(this.$container);
    this.$container.innerHTML = `
			<div class="aai-initial-loader">
				<div class="aai-loader-container">
					${SVG.loader7}
					<p>Loading products...</p>
				</div>
			</div>
		`;
    this.currentPage = 1;
    this.itemsPerPage = 10;
    this.totalItems = 0;
    await this.fetchProducts(this.query, this.currentPage, this.itemsPerPage);
    this.allIds = this.products.map((p) => p.id);
    this.ids = [...this.allIds];
    this.setCount();
    this.render();
    this.events();
  }
  // MARK: Generate AI Content
  // ────────────────────────────────────
  async generateAIContent() {
    let aiSettings = await AISettings.get("bulk-content");
    log("AI SETTINGS", aiSettings);
    let gen = new BulkGenerate();
    await gen.newJob(this.query, this.ids, aiSettings);
  }
  // MARK: Events
  // ────────────────────────────────────
  events() {
    this.$admin.addEventListener("click", (e) => {
      if (e.target.classList.contains("aai-settings-btn")) {
        AISettings.run("bulk-content");
      }
      if (e.target.classList.contains("aai-select-all-btn")) {
        this.ids = [...this.allIds];
        this.setCount();
        this.render();
      }
      if (e.target.classList.contains("aai-deselect-all-btn")) {
        this.ids = [];
        this.setCount();
        this.render();
      }
      if (e.target.classList.contains("aai-pagination-btn") && !e.target.disabled) {
        const page = parseInt(e.target.dataset.page);
        if (page && page !== this.currentPage) {
          this.handlePagination(page);
        }
      }
      if (e.target.closest(".aai-product-content")) {
        const $item = e.target.closest(".aai-product-item");
        const productId = $item.dataset.id;
        const product = this.products.find((p) => p.id == productId);
        if (product && product.content) {
          this.showContentModal(product);
        }
      }
      if (e.target.closest(".aai-product-settings")) {
        AISettings.run("product-content");
      }
    });
    this.$container.addEventListener("change", (e) => {
      if (e.target.classList.contains("aai-product-select")) {
        const productId = parseInt(e.target.dataset.id);
        const isChecked = e.target.checked;
        if (!isChecked) {
          const index = this.ids.indexOf(productId);
          if (index > -1) this.ids.splice(index, 1);
        } else {
          if (!this.ids.includes(productId)) this.ids.push(productId);
        }
        this.setCount();
      }
      if (e.target.classList.contains("aai-product-select-all")) {
        const isChecked = e.target.checked;
        const checkboxes = this.$container.querySelectorAll(".aai-product-select");
        checkboxes.forEach((checkbox) => {
          const productId = parseInt(checkbox.dataset.id);
          checkbox.checked = isChecked;
          if (!isChecked) {
            const index = this.ids.indexOf(productId);
            if (index > -1) this.ids.splice(index, 1);
          } else {
            if (!this.ids.includes(productId)) this.ids.push(productId);
          }
        });
        this.setCount();
      }
    });
  }
  // MARK: Render
  // ────────────────────────────────────
  render() {
    if (this.fetching) {
      this.$container.innerHTML = `
				<div class="aai-initial-loader">
					<div class="aai-loader-container">
						${SVG.loader7}
						<p>Loading products...</p>
					</div>
				</div>
			`;
      if (!this._renderInterval) {
        this._renderInterval = setInterval(() => {
          if (!this.fetching) {
            clearInterval(this._renderInterval);
            this._renderInterval = null;
            this.render();
          }
        }, 100);
      }
      return;
    }
    if (!this.products.length) {
      this.$container.innerHTML = `<div class="aai-no-records">${__$7("No products found", "copyspell-ai")}</div>`;
      return;
    }
    let html = "";
    html += `
			<div class="aai-select-all-container">
				<button class="aai-btn aai-btn-secondary aai-select-all-btn">${__$7("Select All", "copyspell-ai")}</button>
				<button class="aai-btn aai-btn-secondary aai-deselect-all-btn">${__$7("Deselect All", "copyspell-ai")}</button>
				<div class="actus-flex-1"></div>
				<button class="aai-btn aai-btn-secondary aai-settings-btn">${__$7("AI Settings", "copyspell-ai")}</button>
			</div>
			<div class="aai-products-grid">
		`;
    html += `
			<div class="aai-product-header">
				<div class="aai-product-checkbox"><input type="checkbox" class="aai-product-select-all" checked></div>
				<div class="aai-product-image-h">${__$7("Image", "copyspell-ai")}</div>
				<div class="aai-product-sku">${__$7("SKU", "copyspell-ai")}</div>
				<div class="aai-product-type">${__$7("Type", "copyspell-ai")}</div>
				<div class="aai-product-title">${__$7("Title", "copyspell-ai")}</div>
				<div class="aai-product-content">${__$7("Content", "copyspell-ai")}</div>
				<div class="aai-product-price">${__$7("Price", "copyspell-ai")}</div>
				<div class="aai-product-url">${__$7("Actions", "copyspell-ai")}</div>
			</div>
		`;
    this.products.forEach((product) => {
      const isExcluded = !this.ids.includes(product.id);
      const checkedAttr = isExcluded ? "" : "checked";
      html += `
				<div class="aai-product-item" data-id="${product.id}">
					<div class="aai-product-checkbox"><input type="checkbox" class="aai-product-select" data-id="${product.id}" ${checkedAttr}></div>
					<div class="aai-product-image"><img src="${product.image_url || DATA$7.placeholder}" alt="${product.title}"></div>
					<div class="aai-product-sku">${product.sku || ""}</div>
					<div class="aai-product-type">${product.type || ""}</div>
					<div class="aai-product-title">${product.title || ""}</div>
					<div class="aai-product-content">${product.content || ""}</div>
					<div class="aai-product-price">${product.sale_price ? `<span class="aai-price-sale">${parseFloat(product.sale_price || 0).toFixed(2)}</span> <span class="aai-price-regular"><s>${parseFloat(product.regular_price || 0).toFixed(2)}</s></span>` : `${parseFloat(product.regular_price || 0).toFixed(2)}`}</div>
					<div class="aai-product-url"><button class="aai-product-settings aai-btn aai-btn-secondary">${SVG.gear}</button></div>
				</div>
			`;
    });
    html += "</div>";
    html += this.pagination();
    this.$container.innerHTML = html;
  }
  // MARK: Status UI
  // ────────────────────────────────────
  statusUI() {
    let html = `
			<h4>Selected products: <span class="aai-count">0</span></h4>
			<div class="aai-bulk-pagination"></div>
			<button class="aai-btn aai-btn-primary aai-button-generate">${__$7("Start Bulk Generation", "copyspell-ai")}</button>
		`;
    this.$status = document.createElement("div");
    this.$status.classList.add("aai-bulk-status");
    this.$status.innerHTML = html;
    this.$status.setAttribute("count", "0");
    this.$admin.appendChild(this.$status);
    this.$count = this.$status.querySelector(".aai-count");
    this.$pagination = this.$status.querySelector(".aai-bulk-pagination");
    let $button = this.$status.querySelector(".aai-button-generate");
    $button.addEventListener("click", this.generateAIContent.bind(this));
  }
  // MARK: Show Loader
  // ────────────────────────────────────
  async showLoader() {
    this.$grid = this.$container.querySelector(".aai-products-grid");
    const items = this.$container.querySelectorAll(".aai-products-grid > *");
    items.forEach((item) => item.style.opacity = "0.3");
    if (!this.$loaderOverlay) {
      this.$loaderOverlay = document.createElement("div");
      this.$loaderOverlay.className = "aai-loader-overlay";
      this.$loaderOverlay.innerHTML = `
				<div class="aai-loader-container">
					${SVG.loader7}
					<p>Loading products...</p>
				</div>
			`;
    }
    this.$container.style.position = "relative";
    this.$grid.appendChild(this.$loaderOverlay);
    await new Promise((resolve) => setTimeout(resolve, 100));
  }
  // MARK: Hide Loader
  // ────────────────────────────────────
  hideLoader() {
    if (this.$loaderOverlay && this.$loaderOverlay.parentNode) {
      this.$loaderOverlay.remove();
    }
    const items = this.$container.querySelectorAll(".aai-products-grid > *");
    items.forEach((item) => item.style.opacity = "1");
  }
  // MARK: Handle Pagination
  // ────────────────────────────────────
  async handlePagination(page) {
    this.currentPage = page;
    await this.showLoader();
    await this.fetchProducts(this.query, this.currentPage, this.itemsPerPage);
    this.render();
    this.hideLoader();
    this.$container.scrollIntoView({ behavior: "smooth", block: "start" });
  }
  // MARK: Pagination
  // ────────────────────────────────────
  pagination() {
    this.totalPages = Math.ceil(this.totalItems / this.itemsPerPage);
    if (this.totalPages <= 1) return "";
    let html = '<div class="aai-pagination">';
    const prevDisabled = this.currentPage === 1 ? "disabled" : "";
    html += `<button class="aai-pagination-btn aai-pagination-prev" data-page="${this.currentPage - 1}" ${prevDisabled}>${__$7("Previous", "copyspell-ai")}</button>`;
    html += '<div class="aai-pagination-numbers">';
    const maxVisiblePages = 7;
    let startPage = Math.max(1, this.currentPage - Math.floor(maxVisiblePages / 2));
    let endPage = Math.min(this.totalPages, startPage + maxVisiblePages - 1);
    if (endPage - startPage < maxVisiblePages - 1) {
      startPage = Math.max(1, endPage - maxVisiblePages + 1);
    }
    if (startPage > 1) {
      html += `<button class="aai-pagination-btn" data-page="1">1</button>`;
      if (startPage > 2) {
        html += '<span class="aai-pagination-ellipsis">...</span>';
      }
    }
    for (let i = startPage; i <= endPage; i++) {
      const active = i === this.currentPage ? "active" : "";
      html += `<button class="aai-pagination-btn ${active}" data-page="${i}">${i}</button>`;
    }
    if (endPage < this.totalPages) {
      if (endPage < this.totalPages - 1) {
        html += '<span class="aai-pagination-ellipsis">...</span>';
      }
      html += `<button class="aai-pagination-btn" data-page="${this.totalPages}">${this.totalPages}</button>`;
    }
    html += "</div>";
    const nextDisabled = this.currentPage === this.totalPages ? "disabled" : "";
    html += `<button class="aai-pagination-btn aai-pagination-next" data-page="${this.currentPage + 1}" ${nextDisabled}>${__$7("Next", "copyspell-ai")}</button>`;
    html += `<div class="aai-pagination-info">${sprintf$6(__$7("Page %d of %d (%d items)", "copyspell-ai"), this.currentPage, this.totalPages, this.totalItems)}</div>`;
    html += "</div>";
    return html;
  }
  // MARK: Preview Product
  // ────────────────────────────────────
  showContentModal(product) {
    const $overlay = document.createElement("div");
    $overlay.className = "aai-modal-overlay active";
    const $modal = document.createElement("div");
    $modal.className = "aai-modal";
    $modal.innerHTML = `
			<div class="aai-modal-header">
				<h3 class="aai-modal-title">${product.title}</h3>
				<button class="aai-modal-close">&times;</button>
			</div>
			<div class="aai-modal-body">
				${product.content}
			</div>
		`;
    $overlay.appendChild($modal);
    document.body.appendChild($overlay);
    const closeModal = () => {
      $overlay.classList.remove("active");
      setTimeout(() => $overlay.remove(), 300);
    };
    $overlay.querySelector(".aai-modal-close").addEventListener("click", closeModal);
    $overlay.addEventListener("click", (e) => {
      if (e.target === $overlay) closeModal();
    });
  }
  // MARK: Fetch Products
  // -----------------------------------------------------
  async fetchProducts(query, page, limit = 5) {
    query = query || this.query;
    if (!Object.keys(query).length) return;
    this.query = query;
    this.fetching = true;
    if (this.productsTimeout) {
      clearTimeout(this.productsTimeout);
      this.productsTimeout = null;
    }
    return new Promise((resolve) => {
      this.productsTimeout = setTimeout(async () => {
        let response = await productQuery(query, "full", limit, page);
        this.products = response.products || [];
        this.products = this.products.filter((product) => product.type !== "variation");
        this.totalItems = response.total || 0;
        this.totalPages = Math.ceil(this.totalItems / this.itemsPerPage);
        this.count = response.total;
        this.setCount();
        log("PRODUCTS", this.products);
        this.productsTimeout = null;
        this.fetching = false;
        resolve(this.products);
      }, 1e3);
    });
  }
  // MARK: Set Count
  // ────────────────────────────────────
  setCount(count) {
    count = count || this.ids.length;
    if (count < 0) count = 0;
    this.$count.innerText = count;
    this.$status.setAttribute("count", count);
    if (this.totalPages > 1) {
      this.$pagination.innerHTML = `
				<button class="aai-pagination-btn aai-pagination-prev aai-pagination-compact" ${this.currentPage === 1 ? "disabled" : ""} data-page="${this.currentPage - 1}">${__$7("Previous", "copyspell-ai")}</button>
				<span class="aai-pagination-info">${sprintf$6(__$7("Page %d of %d", "copyspell-ai"), this.currentPage, this.totalPages)}</span>
				<button class="aai-pagination-btn aai-pagination-next aai-pagination-compact" ${this.currentPage === this.totalPages ? "disabled" : ""} data-page="${this.currentPage + 1}">${__$7("Next", "copyspell-ai")}</button>
			`;
    }
  }
}
jQuery;
const DATA$6 = window.copyspell_ai_admin || {};
const { __: __$6, _x: _x$5, _n: _n$5, sprintf: sprintf$5 } = wp.i18n;
class Bulk {
  // ────────────────────────────────────
  constructor() {
    this.$admin = document.querySelector(".copyspell-ai-tab-content");
    this.$container = null;
    this.$status = null;
    this.$bulkStatus = null;
    this.ids = [];
    this.count = 0;
    this.query = {
      /*
      ids			: [],
      specific	: [],
      categories	: [],
      tags		: [],
      date_from	: null,
      date_to		: null,
      */
    };
    this.init();
  }
  // MARK: Init
  // ────────────────────────────────────
  init() {
    this.$admin.innerHTML = "";
    this.$container = document.createElement("div");
    this.$container.className = "aai-bulk";
    this.$admin.appendChild(this.$container);
    const $title = document.createElement("h2");
    $title.className = "aai-bulk-title";
    $title.textContent = __$6("Select Products for Bulk AI Content Generation", "copyspell-ai");
    this.$container.appendChild($title);
    this.$buttons = document.createElement("div");
    this.$buttons.className = "aai-bulk-buttons";
    $title.appendChild(this.$buttons);
    const monitorBtn = document.createElement("button");
    monitorBtn.className = "aai-btn aai-btn-secondary";
    monitorBtn.textContent = __$6("Bulk Jobs", "copyspell-ai");
    monitorBtn.onclick = () => {
      new BulkMonitor();
    };
    this.$buttons.appendChild(monitorBtn);
    const settingsBtn = document.createElement("button");
    settingsBtn.className = "aai-btn aai-btn-secondary";
    settingsBtn.textContent = __$6("AI Settings", "copyspell-ai");
    settingsBtn.onclick = () => {
      AISettings.run("bulk-content");
    };
    this.$buttons.appendChild(settingsBtn);
    this.statusUI();
    this.$query = document.createElement("div");
    this.$query.className = "aai-query";
    this.$container.appendChild(this.$query);
    this.queryFilters();
    this.queryEvents();
    this.queryRender();
  }
  // MARK: List Products
  // ────────────────────────────────────
  listProducts(data) {
    new BulkListProducts(this.query, this.ids);
  }
  // MARK: Status UI
  // ────────────────────────────────────
  statusUI() {
    let html = `
			<h4>${__$6("Selected products:", "copyspell-ai")} <span class="aai-count">0</span></h4>
			<div class="actus-flex-1"></div>
			<button class="aai-btn aai-btn-primary aai-button-list">${__$6("Continue to Products List", "copyspell-ai")}</button>
		`;
    this.$status = document.createElement("div");
    this.$status.classList.add("aai-bulk-status");
    this.$status.innerHTML = html;
    this.$status.setAttribute("count", "0");
    this.$container.appendChild(this.$status);
    this.$count = this.$status.querySelector(".aai-count");
    let $button = this.$status.querySelector(".aai-button-list");
    $button.addEventListener("click", this.listProducts.bind(this));
  }
  // MARK: Query Render
  // ────────────────────────────────────
  queryRender() {
    this.$query.innerHTML = ``;
    this.criteria = 0;
    for (let key of Object.keys(this.query)) {
      const $row = document.createElement("div");
      $row.className = "aai-query-row";
      const value = this.query[key];
      let displayValue = "";
      if (Array.isArray(value)) {
        displayValue = value.join(", ");
      } else {
        displayValue = value || "";
      }
      if (key === "specific") {
        if (!value.length) {
          delete this.query.specific;
          continue;
        }
        key = __$6("Product IDs", "copyspell-ai");
        $row.innerHTML = `<strong>${__$6("Product IDs", "copyspell-ai")}:</strong> ${displayValue}`;
        this.$query.appendChild($row);
        this.criteria++;
        break;
      }
      if (key === "ids") {
        if (!value.length) {
          delete this.query.ids;
          continue;
        }
        key = "Product IDs";
        $row.innerHTML = `<strong>__('Product IDs', 'copyspell-ai'):</strong> ${displayValue}`;
        this.$query.appendChild($row);
        this.criteria++;
        break;
      }
      if (!displayValue) {
        delete this.query[key];
        continue;
      }
      this.criteria++;
      $row.innerHTML = `<strong>${__$6(key, "copyspell-ai")}:</strong> ${displayValue}`;
      this.$query.appendChild($row);
    }
  }
  // MARK: Query Filters
  // ────────────────────────────────────
  queryFilters() {
    this.productsFilters();
    this.categoriesFilters();
    this.tagsFilters();
    this.brandsFilters();
  }
  // MARK: Query Events
  // ────────────────────────────────────
  queryEvents() {
    this.$container.addEventListener("change", (e) => {
      let $el, name, val;
      if (e.target.classList.contains("aai-input, .aai-select")) {
        $el = e.target.closest(".aai-input, .aai-select");
        if ($el) {
          name = $el.name;
          val = $el.value;
        }
      }
      if (!name) return;
      this.filterChanged(name, val, $el);
    });
    this.$container.addEventListener("click", (e) => {
      let $el, name, val, $element;
      $el = e.target.closest(".aai-caret");
      if ($el) {
        e.preventDefault();
        e.stopPropagation();
        $el.closest("li").classList.toggle("is-closed");
      }
      $el = e.target.closest(".aai-tag");
      if ($el) $el.classList.toggle("aai-selected");
      $el = e.target.closest(".aai-tags-container .aai-tag");
      if ($el) {
        val = Array.from($el.parentElement.querySelectorAll(".aai-tag.aai-selected")).map((tag) => decodeURIComponent(tag.getAttribute("data-slug")));
        name = "tags";
        $element = $el;
      }
      $el = e.target.closest(".aai-brands-container .aai-tag");
      if ($el) {
        val = Array.from($el.parentElement.querySelectorAll(".aai-tag.aai-selected")).map((tag) => decodeURIComponent(tag.getAttribute("data-slug")));
        name = "brands";
        $element = $el;
      }
      $el = e.target.closest(".aai-category-tree label input");
      if ($el) {
        val = Array.from($el.closest(".aai-category-tree").querySelectorAll(".aai-category-checkbox:checked")).map((checkbox) => checkbox.value);
        name = "categories";
        $element = $el;
      }
      if (!name) return;
      this.filterChanged(name, val, $element);
    });
  }
  // MARK: Get Product Count
  // -----------------------------------------------------
  async getProductCount() {
    this.$count.innerHTML = SVG.loader2;
    if (this.productCountTimeout) {
      clearTimeout(this.productCountTimeout);
      this.productCountTimeout = null;
    }
    return new Promise((resolve) => {
      if (!this.criteria) {
        this.$count.innerHTML = "0";
        this.$status.setAttribute("count", "0");
        return resolve(0);
      }
      this.productCountTimeout = setTimeout(async () => {
        var _a;
        let query = JSON.parse(JSON.stringify(this.query));
        if (query.specific) {
          query.ids = query.ids || [];
          query.ids = [.../* @__PURE__ */ new Set([...query.ids, ...query.specific])];
          query.ids = query.ids.join(",");
          delete query.specific;
        }
        this.ids = await productQuery(query, "ids");
        this.count = ((_a = this.ids) == null ? void 0 : _a.length) || 0;
        this.$count.innerHTML = this.count || "0";
        this.$status.setAttribute("count", this.count || "0");
        this.productCountTimeout = null;
        resolve(this.count);
      }, 1e3);
    });
  }
  // MARK: Filter Changed
  // ────────────────────────────────────
  filterChanged(name, val, element) {
    this.query[name] = val;
    this.queryRender();
    this.getProductCount();
  }
  // MARK: Products Filters
  // ────────────────────────────────────
  productsFilters() {
    let filterHtml = `
		<div class="aai-filter aai-products-filters actus-open">
			<h3>${__$6("Products", "copyspell-ai")}<span>${SVG.caret}</span></h3>
			<div class="aai-filters-body"></div>
		</div>
		`;
    this.$container.insertAdjacentHTML("beforeend", filterHtml);
    let $filter = this.$container.querySelector(".aai-products-filters .aai-filters-body");
    let html = `
			<div class="aai-filter-row aai-filter-specific actus-flex">
				<label class="aai-label">${__$6("Specific Products", "copyspell-ai")}</label>
				<div class="aai-product-select-container"></div>
			</div>
			<div class="aai-filter-row aai-filter-ids actus-flex">
				<label class="aai-label">${__$6("Product IDs", "copyspell-ai")}</label>
				<input class="aai-input aai-small" type="text" id="ids" name="ids" value="" placeholder="${__$6("enter product IDs separated by commas...", "copyspell-ai")}" />	
			</div>
			<div class="aai-note">${__$6("If product IDs or Specific Products are entered, all other filters will be ignored.", "copyspell-ai")}</div>
		`;
    $filter.insertAdjacentHTML("beforeend", html);
    this.$productSelect = new ProductSelect({
      container: $filter.querySelector(".aai-product-select-container"),
      placeholder: __$6("search products...", "copyspell-ai"),
      multiple: true,
      initialIds: [DATA$6.post.id],
      onChange: (selectedIds) => {
        this.filterChanged("specific", selectedIds, $filter.querySelector(".aai-product-select-container"));
      }
    });
    html = `
		<div class="aai-filter-row aai-filter-created actus-flex">
			<label class="aai-label">${__$6("Created", "copyspell-ai")}</label>
			<div class="aai-form-group actus-flex">
				<label class="aai-label aai-small" for="date_from">${__$6("From:", "copyspell-ai")}</label>
				<input class="aai-input aai-small" type="date" name="date_from" class="aai-on-sale-date-input" value="${this.query.date_from || ""}" />
			</div>
			<div class="aai-form-group actus-flex">
				<label class="aai-label aai-small" for="date_to">${__$6("To:", "copyspell-ai")}</label>
				<input class="aai-input aai-small" type="date" name="date_to" class="aai-on-sale-date-input" value="${this.query.date_to || ""}" />
			</div>
			<button class="aai-btn aai-btn-secondary aai-clear-created-date">${__$6("clear", "copyspell-ai")}</button>
		</div>
		`;
    $filter.insertAdjacentHTML("beforeend", html);
  }
  // MARK: Categories Filters
  // ────────────────────────────────────
  categoriesFilters() {
    let categories = DATA$6.woocommerce.taxonomies.categories.terms || [];
    let tree = buildCategoryTree(categories);
    let filterHtml = `
		<div class="aai-filter aai-categories-filters actus-open">
			<h3>${__$6("Categories", "copyspell-ai")}<span>${SVG.caret}</span></h3>
			<div class="aai-filters-body"></div>
		</div>
		`;
    this.$container.insertAdjacentHTML("beforeend", filterHtml);
    let $filter = this.$container.querySelector(".aai-categories-filters .aai-filters-body");
    let html = `
			<div class="aai-category-tree">
				${renderCategoryTree(tree, this.query.categories)}
			</div>
		`;
    $filter.insertAdjacentHTML("beforeend", html);
  }
  // MARK: Tags Filters
  // ────────────────────────────────────
  tagsFilters() {
    let tags = DATA$6.woocommerce.taxonomies.tags.terms || [];
    let filterHtml = `
		<div class="aai-filter aai-tags-filters actus-open">
			<h3>${__$6("Tags", "copyspell-ai")}<span>${SVG.caret}</span></h3>
			<div class="aai-filters-body"></div>
		</div>
		`;
    this.$container.insertAdjacentHTML("beforeend", filterHtml);
    let $filter = this.$container.querySelector(".aai-tags-filters .aai-filters-body");
    let html = `
			<div class="aai-tags-container">
				${tags.map((tag) => {
      var _a;
      const isSelected = ((_a = this.query.tags) == null ? void 0 : _a.includes(String(tag.slug))) ? "actus-selected" : "";
      return `<div class="aai-tag ${isSelected}" data-id="${tag.term_id}" data-slug="${tag.slug}">${tag.name}</div>`;
    }).join("")}
			</div>
		`;
    $filter.insertAdjacentHTML("beforeend", html);
  }
  // MARK: Brands Filters
  // ────────────────────────────────────
  brandsFilters() {
    let tags = DATA$6.woocommerce.taxonomies.product_brand.terms || [];
    let filterHtml = `
		<div class="aai-filter aai-brands-filters actus-open">
			<h3>${__$6("Brands", "copyspell-ai")}<span>${SVG.caret}</span></h3>
			<div class="aai-filters-body"></div>
		</div>
		`;
    this.$container.insertAdjacentHTML("beforeend", filterHtml);
    let $filter = this.$container.querySelector(".aai-brands-filters .aai-filters-body");
    let html = `
			<div class="aai-brands-container">
				${tags.map((tag) => {
      var _a;
      const isSelected = ((_a = this.query.tags) == null ? void 0 : _a.includes(String(tag.slug))) ? "actus-selected" : "";
      return `<div class="aai-tag ${isSelected}" data-id="${tag.term_id}" data-slug="${tag.slug}">${tag.name}</div>`;
    }).join("")}
			</div>
		`;
    $filter.insertAdjacentHTML("beforeend", html);
  }
}
let $$4 = jQuery;
const { __: __$5, _x: _x$4, _n: _n$4, sprintf: sprintf$4 } = wp.i18n;
const IFC = {};
IFC.init = () => {
  IFC.navigation();
  $$4(".copyspell-ai-nav-tab").first().trigger("click");
  if ($$4(".aai-credits-display").length)
    TOOLS.renderCredits(".aai-credits-display");
};
IFC.navigation = () => {
  $$4(".copyspell-ai-nav-tab").on("click", function() {
    const target = $$4(this).attr("alt");
    $$4(".copyspell-ai-nav-tab").removeClass("copyspell-ai-nav-tab-active");
    $$4(this).addClass("copyspell-ai-nav-tab-active");
    if (target == "home") AdminHome();
    if (target == "bulk") new Bulk();
    if (target == "settings") AdminSettings();
    if (target == "license") AdminLicense();
  });
};
IFC.footerHTML = () => {
  return `
	<div class="aai-footer">
		<div class="aai-footer-logo">
			<img src="/wp-content/plugins/copyspell-ai/img/logo.png" alt="CopySpell AI Logo">
			<span>CopySpell AI v${window.copyspell_ai_admin.version}</span>
		</div>
		<div class="aai-footer-links">
			<span>Developed by</span>
			<img src="/wp-content/plugins/copyspell-ai/img/actus-logo.png" alt="Actus Anima Logo">
			<a href="https://actus.works" target="_blank">Actus Anima</a>
			<span>|</span>
			<a href="https://copyspell.ai/user-guide/" target="_blank">${__$5("Documentation", "copyspell-ai")}</a>
		</div>
	</div>`;
};
const SDK$2 = window.CopyspellAI || {};
const DATA$5 = window.copyspell_ai_admin || {};
const { __: __$4, _x: _x$3, _n: _n$3, sprintf: sprintf$3 } = wp.i18n;
class ResultProduct {
  // ────────────────────────────────────
  constructor(panel, data) {
    this.data = {};
    this.panel = panel || null;
    this.meta = {};
    this.json = {};
    this.selected = {};
    this.revisions = {
      title: [[], [], []],
      excerpt: [[], []],
      content: [[], []]
    };
    this.currentRevision = {
      title: [0, 0, 0],
      excerpt: [0, 0],
      content: [0, 0]
    };
    this.firstResponse = true;
  }
  static run(panel, data, onBack) {
    var _a;
    const c = new ResultProduct(panel, data);
    c.onBack = onBack || (() => {
    });
    c.data = data || {};
    c.meta = data.meta || {};
    c.json = data.json || {};
    c.original = ((_a = data.products) == null ? void 0 : _a[0]) || {};
    c.showSuggestions();
  }
  // ────────────────────────────────────
  setPanel(panel) {
    this.panel = panel;
  }
  // ────────────────────────────────────
  setProductData(data) {
    this.data = data;
  }
  // MARK: Suggestions
  // ────────────────────────────────────
  // This function displays the suggestions for refining the product information.
  // It shows the HTML structure for the suggestions
  // and sets up event handlers for selection.
  // ────────────────────────────────────
  showSuggestions() {
    if (this.firstResponse) {
      for (let key in this.revisions) {
        this.json[key] = this.json[key] || {};
        this.json[key].suggestions = this.json[key].suggestions || [];
        this.revisions[key] = [];
        this.json[key].suggestions.forEach((suggestion, index) => {
          this.revisions[key].push([suggestion || ""]);
        });
      }
    }
    let $panel = this.panel.$el;
    $panel.classList.remove("analysis-options");
    $panel.classList.add("aai-suggestions");
    this.showSuggestionsHTML();
    let selectedCount = this.panel.$el.querySelectorAll(".aai-product-suggestions .aai-suggestion.aai-selected").length;
    if (selectedCount > 0) {
      this.setButtons("select");
    } else {
      this.setButtons("suggestions");
    }
    this.events();
    this.firstResponse = false;
  }
  // MARK: Events
  // ────────────────────────────────────
  events() {
    let $panel = this.panel.$el;
    $panel.querySelectorAll(".aai-product-suggestions .aai-suggestion").forEach((card) => {
      card.onclick = (e) => {
        SDK$2.events.emit("suggestions-click", e);
        e.stopPropagation();
        if (card.classList.contains("aai-editing")) {
          return;
        }
        if (e.target.closest(".aai-revisions-buttons")) {
          const prev = e.target.closest(".aai-prev-revision");
          const next = e.target.closest(".aai-next-revision");
          if (prev) this.showPrevRevision(e);
          if (next) this.showNextRevision(e);
          return;
        }
        if (e.target.closest(".aai-edit-suggestion")) {
          this.editSuggestion(e.target);
          return;
        }
        this.selectSuggestion(card);
      };
    });
    $panel.querySelectorAll(".aai-suggestion-wrapper").forEach((wrapper) => {
      wrapper.onclick = (e) => {
        const span = e.target.closest(".aai-refinement-prompts span");
        if (span && wrapper.contains(span)) {
          e.stopPropagation();
          this.refineSuggestion(span);
        }
      };
    });
  }
  // MARK: Events Buttons
  // ────────────────────────────────────
  buttonsEvents() {
    let $panel = this.panel.$el;
    $panel.querySelector('.aai-panel-footer button[alt="preview"]').onclick = () => {
      this.selected = this.getSelectedData();
      this.showPreview();
    };
    $panel.querySelector('.aai-panel-footer button[alt="update"]').onclick = async () => {
      this.selected = this.getSelectedData();
      await this.updateProduct(this.selected);
      window.location.reload();
    };
  }
  // MARK: RENDER
  // ────────────────────────────────────
  // This function generates the HTML for displaying the suggestions.
  // It creates a structured layout for the title, excerpt, and content suggestions.
  // ────────────────────────────────────
  showSuggestionsHTML() {
    this.setButtons("suggestions");
    let HTML = `<div class="aai-product-suggestions">`;
    HTML += `<div class="aai-bg-pattern"></div>`;
    HTML += this.suggestionsHeaderHTML();
    HTML += this.titleSuggestionsHTML();
    HTML += this.shortDescriptionSuggestionsHTML();
    HTML += this.descriptionSuggestionsHTML();
    let output = document.querySelector(".aai-call-progress .aai-output") || "";
    output.innerHTML = `<p class="aai-row-success">Response from <b>${this.data.model}</b> (${this.data.api})</p>`;
    const $button = this.panel.$header.querySelector("button");
    if (output && $button) {
      this.panel.$header.insertBefore(output, $button);
      this.panel.$header.querySelector("span").style.flex = "0 0 auto";
    }
    this.panel.$body.innerHTML = HTML;
    SDK$2.events.emit("suggestions-rendered", { ...this });
  }
  // MARK: HTML
  // ────────────────────────────────────
  // Header HTML
  suggestionsHeaderHTML(superTitle = __$4("AI Suggestions for", "copyspell-ai")) {
    var _a, _b, _c, _d, _e, _f;
    let code = ((_b = (_a = DATA$5.woocommerce) == null ? void 0 : _a.product) == null ? void 0 : _b.sku) || "";
    if (code) code = `SKU: ${code}`;
    else code = `ID #${DATA$5.post.id}`;
    let imageSrc = ((_c = this.original.imageUrls) == null ? void 0 : _c[0]) || DATA$5.plugin_url + "img/placeholder.jpg";
    let modelName = ((_e = (_d = this.meta) == null ? void 0 : _d.model) == null ? void 0 : _e.replace(/-/g, " ")) || "";
    let HTML = ``;
    HTML += `<div class="aai-card aai-no-header aai-suggestions-header">`;
    HTML += `<img src="${imageSrc}"/>`;
    HTML += `<div class="aai-text">`;
    HTML += `<h4>${superTitle}</h4>`;
    HTML += `<h2>${this.original.title}</h2>`;
    HTML += `<div class="aai-header-bottom-line">`;
    HTML += `<div>${SVG.cube2} <span>${__$4("Woocomerce Product", "copyspell-ai")}</span></div>`;
    HTML += `<div>${SVG.id2} <span>${code}</span></div>`;
    HTML += `<div>${SVG.clock} <span>${__$4("Last updated", "copyspell-ai")} ${this.formatDate(this.original.modified)}</span></div>`;
    HTML += `</div>`;
    if (modelName) {
      HTML += `<div class="aai-header-model">`;
      HTML += `<div>${SVG.robot}Generated with <span>${modelName}</span> in  <span>${(_f = this.meta) == null ? void 0 : _f.duration}s</span></div>`;
      HTML += `</div>`;
    }
    HTML += `</div>`;
    HTML += `</div>`;
    return HTML;
  }
  // Title Suggestions HTML
  titleSuggestionsHTML() {
    let comment = this.json.title.comment || "";
    if (comment) {
      comment = this.stripHtmlTags(comment);
      comment += ` ${__$4("Select a suggestion", "copyspell-ai")}.`;
    } else {
      comment = __$4("Oops—no response from the model. Please try another model or tweak your prompt and try again", "copyspell-ai");
    }
    let HTML = `
		<div class="aai-card aai-suggestions-card aai-suggestions-titles" alt="title">
			<div class="aai-card-header">
				<div class="aai-left">
					<h3>${SVG.title} ${__$4("Select a Product Title", "copyspell-ai")}</h3>
					<p class="comment">${comment}.</p>
				</div>
				<div class="aai-right">
				</div>
			</div>
			<div class="aai-card-body">
				<div class="aai-flex">`;
    this.json.title.suggestions.forEach((suggestion, index) => {
      var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
      let revision = this.revisions.title[index][this.currentRevision.title[index]] || suggestion || "";
      let clss = "";
      if (this.selected.idx_name === String(index)) {
        clss = "aai-selected";
      }
      HTML += `
					<div class="aai-card aai-suggestion aai-selectable aai-no-header aai-card-small aai-flex-3 ${clss}" alt="${index}">
						<div class="aai-revisions">${this.revisionsHTML("title", index)}</div>
						<h3 class="aai-body">${revision}</h3>
						<div class="aai-labels">
							<label class="aai-blank">${SVG.textLines} ${suggestion.length} chars</label>
							${((_b = (_a = this.json.metrics) == null ? void 0 : _a.quality) == null ? void 0 : _b.titles) ? `<label class="aai-blank">${SVG.star2} Quality: ${(_f = (_e = (_d = (_c = this.json) == null ? void 0 : _c.metrics) == null ? void 0 : _d.quality) == null ? void 0 : _e.titles) == null ? void 0 : _f[index]}%</label>` : ""}
							${((_h = (_g = this.json.metrics) == null ? void 0 : _g.seo) == null ? void 0 : _h.titles) ? `<label class="aai-blank">${SVG.search2} SEO: ${(_l = (_k = (_j = (_i = this.json) == null ? void 0 : _i.metrics) == null ? void 0 : _j.seo) == null ? void 0 : _k.titles) == null ? void 0 : _l[index]}%</label>` : ""}
						</div>
						<div class="aai-edit-suggestion">${SVG.edit2}</div>
						<div class="aai-selector">
							${SVG.square}
							${SVG.squareCheck}
						</div>
					</div>`;
    });
    HTML += `
				</div>
				<div class="original">${this.original.title}</div>
			</div>
		</div>`;
    return HTML;
  }
  // Short Description Suggestions HTML
  shortDescriptionSuggestionsHTML() {
    let comment = this.json.excerpt.comment || "";
    if (comment) {
      comment = this.stripHtmlTags(comment);
      comment += ` ${__$4("Select a suggestion", "copyspell-ai")}.`;
    } else {
      comment = __$4("Oops—no response from the model. Please try another model or tweak your prompt and try again", "copyspell-ai");
    }
    let HTML = `
		<div class="aai-card aai-suggestions-card aai-suggestions-excerpt" alt="excerpt">
			<div class="aai-card-header">
				<div class="aai-left">
					<h3>${SVG.shorterText} ${__$4("Select a Short Description", "copyspell-ai")}</h3>
					<p class="comment">${comment}.</p>
				</div>
				<div class="aai-right">
				</div>
			</div>
			<div class="aai-card-body">
				<div class="aai-flex">`;
    this.json.excerpt.suggestions.forEach((suggestion, index) => {
      var _a, _b, _c, _d, _e, _f, _g, _h;
      let revision = this.revisions.excerpt[index][this.currentRevision.excerpt[index]] || suggestion || "";
      let clss = "";
      if (this.selected.idx_short_description === String(index)) {
        clss = "aai-selected";
      }
      HTML += `
					<div class="aai-card aai-suggestion aai-selectable aai-no-header aai-card-small aai-flex-3 ${clss}" alt="${index}">
						<div class="aai-revisions">${this.revisionsHTML("excerpt", index)}</div>
						<div class="aai-body">${revision}</div>
						<div class="aai-labels">
						<label class="aai-blank">${SVG.textLines} ${suggestion.length} chars</label>
						<label class="aai-blank">${SVG.star2} Quality: ${(_d = (_c = (_b = (_a = this.json) == null ? void 0 : _a.metrics) == null ? void 0 : _b.quality) == null ? void 0 : _c.excerpts) == null ? void 0 : _d[index]}%</label>
						<label class="aai-blank">${SVG.search2} SEO: ${(_h = (_g = (_f = (_e = this.json) == null ? void 0 : _e.metrics) == null ? void 0 : _f.seo) == null ? void 0 : _g.excerpts) == null ? void 0 : _h[index]}%</label>
						</div>
						<div class="aai-edit-suggestion">${SVG.edit2}</div>
						<div class="aai-selector">
							${SVG.square}
							${SVG.squareCheck}
						</div>
					</div>`;
    });
    HTML += `
				</div>
				<div class="original">${this.original.excerpt}</div>
			</div>
		</div>`;
    return HTML;
  }
  // Description Suggestions HTML
  descriptionSuggestionsHTML() {
    let comment = this.json.content.comment || "";
    if (comment) {
      comment = this.stripHtmlTags(comment);
      comment += ` ${__$4("Select a suggestion", "copyspell-ai")}.`;
    } else {
      comment = __$4("Oops—no response from the model. Please try another model or tweak your prompt and try again", "copyspell-ai");
    }
    let HTML = `
		<div class="aai-card aai-suggestions-card aai-suggestions-content" alt="content">
			<div class="aai-card-header">
				<h3>${SVG.text} ${__$4("Select a Description", "copyspell-ai")}</h3>
				<p class="comment">${comment}.</p>
			</div>
			<div class="aai-card-body">
				<div class="aai-flex">`;
    this.json.content.suggestions.forEach((suggestion, index) => {
      HTML += this.singleDescriptionHTML(suggestion, index);
    });
    HTML += `
				</div>
				<div class="original">${this.original.content}</div>
			</div>
		</div>
			
		</div>`;
    return HTML;
  }
  // Single Description HTML
  singleDescriptionHTML(suggestion, index) {
    var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n2, _o, _p;
    if (typeof suggestion !== "string") suggestion = "";
    let wordCount = suggestion.trim().split(/\s+/).length || 0;
    let revision = this.revisions.content[index][this.currentRevision.content[index]] || suggestion || "";
    let clss = "";
    if (this.selected.idx_description === String(index)) {
      clss = "aai-selected";
    }
    let HTML = `
		<div class="aai-suggestion-wrapper" alt="${index}">
			<div class="aai-card aai-suggestion aai-selectable aai-no-header aai-card-small aai-flex-3 ${clss}" alt="${index}">
				<div class="aai-revisions">${this.revisionsHTML("content", index)}</div>
				<div class="aai-body aai-description">${revision}</div>
				<div class="aai-labels">
					<label class="aai-blank">${SVG.words} ${wordCount} words</label>
					<label class="aai-blank">${SVG.star2} Quality: ${(_d = (_c = (_b = (_a = this.json) == null ? void 0 : _a.metrics) == null ? void 0 : _b.quality) == null ? void 0 : _c.contents) == null ? void 0 : _d[index]}%</label>
					<label class="aai-blank">${SVG.engagement} Engagement: ${(_h = (_g = (_f = (_e = this.json) == null ? void 0 : _e.metrics) == null ? void 0 : _f.engagement) == null ? void 0 : _g.contents) == null ? void 0 : _h[index]}%</label>
					<label class="aai-blank">${SVG.conversion} Conversion: ${(_l = (_k = (_j = (_i = this.json) == null ? void 0 : _i.metrics) == null ? void 0 : _j.conversion) == null ? void 0 : _k.contents) == null ? void 0 : _l[index]}%</label>
					<label class="aai-blank">${SVG.search2} SEO: ${(_p = (_o = (_n2 = (_m = this.json) == null ? void 0 : _m.metrics) == null ? void 0 : _n2.seo) == null ? void 0 : _o.contents) == null ? void 0 : _p[index]}%</label>
				</div>
				<div class="aai-edit-suggestion">${SVG.edit2}</div>
				<div class="aai-selector">
					${SVG.square}
					${SVG.squareCheck}
				</div>
			</div>
			${this.refinementPromptsHTML(index)}
		</div>`;
    return HTML;
  }
  // Refinement Prompts HTML
  refinementPromptsHTML(index, prompts) {
    this.json.content.refinementPrompts = this.json.content.refinementPrompts || {};
    prompts = prompts || this.json.content.refinementPrompts[index] || [];
    let HTML = `
			<div class="aai-refinement-prompts">`;
    if (prompts) {
      prompts.forEach((prompt2) => {
        HTML += `<span class="aai-chip">${prompt2}</span>`;
      });
      HTML += `<span class="aai-chip aai-custom" alt="longer">${__$4("Make it longer", "copyspell-ai")}</span>`;
      HTML += `<span class="aai-chip aai-custom" alt="shorter">${__$4("Make it shorter", "copyspell-ai")}</span>`;
      HTML += `<span class="aai-chip aai-custom" alt="custom">${__$4("Custom changes", "copyspell-ai")}</span>`;
    }
    HTML += `
			</div>`;
    return HTML;
  }
  // MARK: ACTIONS
  // MARK: Edit
  // ────────────────────────────────────
  editSuggestion(btn) {
    let suggestion = btn.closest(".aai-suggestion");
    let card = suggestion.closest(".aai-suggestions-card ");
    suggestion.classList.add("aai-editing");
    let body = suggestion.querySelector(".aai-body");
    body.contentEditable = true;
    let type = card.getAttribute("alt") || "content";
    let index = suggestion.getAttribute("alt") || 0;
    let revisionIndex = this.currentRevision[type][index] || 0;
    this.revisions[type] = this.revisions[type] || [];
    this.revisions[type][index] = this.revisions[type][index] || [];
    let buttons = `
		<div class="aai-card-buttons">
			<button class="aai-btn aai-btn-secondary">Cancel</button>
			<button class="aai-btn aai-btn-primary">Keep</button>
		</div>`;
    if (!suggestion.querySelector(".aai-card-buttons")) {
      suggestion.insertAdjacentHTML("beforeend", buttons);
    }
    let keepBtn = suggestion.querySelector(".aai-card-buttons button.aai-btn-primary");
    keepBtn.addEventListener("click", (e) => {
      e.stopPropagation();
      suggestion.classList.remove("aai-editing");
      body.contentEditable = false;
      this.revisions[type][index].push(body.innerHTML || "");
      this.currentRevision[type][index] = this.revisions[type][index].length - 1;
      let buttons2 = suggestion.querySelector(".aai-card-buttons");
      buttons2 == null ? void 0 : buttons2.remove();
      let revisionsElement = suggestion.querySelector(".aai-revisions");
      if (revisionsElement) {
        revisionsElement.innerHTML = this.revisionsHTML(type, index);
      }
    });
    let cancelBtn = suggestion.querySelector(".aai-card-buttons button.aai-btn-secondary");
    cancelBtn.addEventListener("click", (e) => {
      e.stopPropagation();
      suggestion.classList.remove("aai-editing");
      body.contentEditable = false;
      body.innerHTML = this.revisions[type][index][revisionIndex] || "";
      let buttons2 = suggestion.querySelector(".aai-card-buttons");
      buttons2 == null ? void 0 : buttons2.remove();
    });
    body.focus();
  }
  // MARK: Refine
  // ────────────────────────────────────
  async refineSuggestion(span) {
    if (!await TOOLS.isAllowed("product-refine")) return;
    let wrapper = span.closest(".aai-suggestion-wrapper");
    let suggestion = wrapper.querySelector(".aai-suggestion");
    suggestion.querySelector(".aai-refinement-prompts");
    let card = suggestion.closest(".aai-suggestions-card ");
    let body = suggestion.querySelector(".aai-body");
    let userPrompt = "";
    if (span.getAttribute("alt") === "custom") {
      let customPrompt = await customRefinement();
      if (!customPrompt) return;
      userPrompt = customPrompt;
    } else {
      userPrompt = span.textContent.trim() || span.val().trim() || "";
    }
    wrapper.querySelector(".aai-refinement-prompts").remove();
    const loaderDiv = document.createElement("div");
    loaderDiv.className = "aai-loader";
    loaderDiv.innerHTML = SVG.loader7;
    suggestion.appendChild(loaderDiv);
    card.scrollIntoView({ behavior: "smooth", block: "center" });
    suggestion.classList.add("aai-refining");
    let response = await copyspellAIContent.refine(userPrompt, body.innerHTML.trim());
    if (!response || response.error) {
      suggestion.classList.remove("aai-refining");
      loaderDiv.remove();
      const errorDiv = document.createElement("div");
      errorDiv.className = "aai-error-message";
      errorDiv.innerHTML = (response == null ? void 0 : response.error) || "Error";
      wrapper.appendChild(errorDiv);
      errorDiv.scrollIntoView({ behavior: "smooth", block: "center" });
      log("❌ Error refining suggestion:", response.error);
      return;
    }
    this.finalizeRefinement(response, suggestion, loaderDiv);
  }
  // MARK: Finalize Refinement
  // ────────────────────────────────────
  finalizeRefinement(response, suggestion, loaderDiv) {
    let card = suggestion.closest(".aai-suggestions-card ");
    let body = suggestion.querySelector(".aai-body");
    let type = card.getAttribute("alt") || "content";
    let index = suggestion.getAttribute("alt") || 0;
    suggestion.classList.remove("aai-refining");
    loaderDiv.remove();
    body.innerHTML = response.content || "";
    let refinementPrompts = this.refinementPromptsHTML(index, response.refinementPrompts);
    suggestion.insertAdjacentHTML("afterend", refinementPrompts);
    this.revisions[type] = this.revisions[type] || [];
    this.revisions[type][index] = this.revisions[type][index] || [];
    this.revisions[type][index].push(response.content || "");
    this.currentRevision[type][index] = this.revisions[type][index].length - 1;
    let revisionsElement = suggestion.querySelector(".aai-revisions");
    if (revisionsElement) {
      revisionsElement.innerHTML = this.revisionsHTML(type, index);
    }
  }
  // MARK: Select
  // ────────────────────────────────────
  // This function is called when a suggestion card is clicked.
  // It toggles the selected state of the button and updates the UI accordingly.
  // ────────────────────────────────────
  selectSuggestion(card) {
    if (card.classList.contains("aai-selected")) {
      card.classList.remove("aai-selected");
    } else {
      card.classList.add("aai-selected");
      card.closest(".aai-flex").querySelectorAll(".aai-suggestion").forEach((sibling) => {
        if (sibling !== card) sibling.classList.remove("aai-selected");
      });
    }
    this.setButtons("select");
  }
  // MARK: Get Selected
  // ────────────────────────────────────
  // This function retrieves the selected data from the suggestions.
  // It checks if a suggestion for title, short description, or description is selected,
  // and returns an object with the selected values or the original product data if no selection is made.
  // ────────────────────────────────────
  getSelectedData() {
    var _a, _b, _c;
    let $panel = this.panel.$el;
    let selectedTitle = $panel.querySelector(".aai-product-suggestions .aai-suggestions-titles .aai-suggestion.aai-selected .aai-body");
    let selectedExcerpt = $panel.querySelector(".aai-product-suggestions .aai-suggestions-excerpt .aai-suggestion.aai-selected .aai-body");
    let selectedContent = $panel.querySelector(".aai-product-suggestions .aai-suggestions-content .aai-suggestion.aai-selected .aai-body");
    if (!selectedTitle && !selectedExcerpt && !selectedContent) {
      if (this.selected.id) return this.selected;
      alert(__$4("Please select a suggestion for title, short description, or description.", "copyspell-ai"));
      return;
    }
    return {
      id: this.original.id,
      name: (selectedTitle == null ? void 0 : selectedTitle.textContent.trim()) || this.original.title,
      description: (selectedContent == null ? void 0 : selectedContent.innerHTML.trim()) || this.original.content,
      short_description: (selectedExcerpt == null ? void 0 : selectedExcerpt.textContent.trim()) || this.original.excerpt,
      idx_name: ((_a = selectedTitle == null ? void 0 : selectedTitle.closest(".aai-suggestion")) == null ? void 0 : _a.getAttribute("alt")) || 0,
      idx_description: ((_b = selectedContent == null ? void 0 : selectedContent.closest(".aai-suggestion")) == null ? void 0 : _b.getAttribute("alt")) || 0,
      idx_short_description: ((_c = selectedExcerpt == null ? void 0 : selectedExcerpt.closest(".aai-suggestion")) == null ? void 0 : _c.getAttribute("alt")) || 0
    };
  }
  // MARK: Preview
  // ────────────────────────────────────
  // This function displays the selected data in the panel.
  // It shows the name, description, and short description of the selected product.
  // It also sets up the continue and back buttons for further actions.
  // ────────────────────────────────────
  showPreview() {
    let $panelBody = this.panel.$body;
    if (!this.selected || !this.selected.id) {
      log("⚠️ No data provided for selected refinement");
      return;
    }
    let HTML = `
		<!-- Preview -->
		<div class="aai-preview">


			<!-- Original -->
			<div class="aai-original-post">
				<h3>${__$4("Original Content", "copyspell-ai")}</h3>
				<div class="aai-card aai-no-header">
				
					<div class="aai-block aai-title">
						<h1 class="aai-selected">${this.original.title}</h1>
					</div>
					<div class="aai-block aai-description">
						<div class="aai-selected">${this.original.content}</div>
					</div>
					<div class="aai-block aai-excerpt">
						<div class="aai-card aai-no-header">
							<label>short description:</label>
							<div class="aai-selected">${this.original.excerpt}</div>
						</div>
					</div>

				</div>
			</div>


			<!-- Selected -->
			<div class="aai-selected-post">
				<h3>${__$4("AI Content", "copyspell-ai")}</h3>
				<div class="aai-card aai-no-header">
					<div class="aai-block aai-title">
						<h1 class="aai-selected">${this.selected.name}</h1>
					</div>
					<div class="aai-block aai-description">
						<div class="aai-selected">${this.selected.description}</div>
					</div>
					<div class="aai-block aai-excerpt">
						<div class="aai-card aai-no-header">
							<label>short description:</label>
							<div class="aai-selected">${this.selected.short_description}</div>
						</div>
					</div>
				</div>
			</div>


		</div>
		`;
    $panelBody.innerHTML = HTML;
    $panelBody.scrollTo({ top: 0, behavior: "smooth" });
    this.setButtons("preview");
  }
  // MARK: Set Buttons
  // ────────────────────────────────────
  // This function sets the visibility of the buttons in the panel.
  // It updates the prompt text and shows or hides buttons based on the current status.
  // ────────────────────────────────────
  setButtons(status = "loading") {
    let $buttons = this.panel.$footer;
    $buttons.innerHTML = `
			<button class="aai-btn-big" alt="back">${SVG.back}${__$4("Back", "copyspell-ai")}</button>
			<button class="aai-btn-big" alt="preview">${SVG.preview}${__$4("Preview", "copyspell-ai")}</button>
			<button class="aai-btn-big" alt="continue">${__$4("Continue", "copyspell-ai")}</button>
			<button class="aai-btn-big" alt="update">${SVG.apply}${__$4("Update Product", "copyspell-ai")}</button>
			<div class="aai-prompt"></div>
		`;
    $buttons.querySelector(".aai-prompt").style.display = "none";
    $buttons.querySelector('button[alt="back"]').style.display = "none";
    $buttons.querySelector('button[alt="preview"]').style.display = "none";
    $buttons.querySelector('button[alt="continue"]').style.display = "none";
    $buttons.querySelector('button[alt="update"]').style.display = "none";
    this.panel.$el.querySelector('.aai-panel-footer button[alt="back"]').onclick = this.onBack;
    this.buttonsEvents();
    if (status == "suggestions") {
      $buttons.querySelector(".aai-prompt").textContent = `${__$4("select a refined title, excerpt or description...", "copyspell-ai")}`;
      $buttons.querySelector(".aai-prompt").style.display = "block";
    }
    if (status == "select") {
      let selectedCount = this.panel.$el.querySelectorAll(".aai-product-suggestions .aai-suggestion.aai-selected").length;
      if (selectedCount > 0) {
        $buttons.querySelector('button[alt="preview"]').style.display = "flex";
        $buttons.querySelector('button[alt="update"]').style.display = "flex";
      } else {
        $buttons.querySelector(".aai-prompt").style.display = "block";
      }
    }
    if (status == "preview") {
      $buttons.querySelector('button[alt="back"]').style.display = "flex";
      $buttons.querySelector('button[alt="update"]').style.display = "flex";
      this.panel.$el.querySelector('.aai-panel-footer button[alt="back"]').onclick = this.showSuggestions.bind(this);
    }
  }
  // MARK: REVISIONS
  // ────────────────────────────────────
  // Revisions HTML
  revisionsHTML(type, index) {
    var _a;
    let currentRevision = this.currentRevision[type][index] || 0;
    let totalRevisions = ((_a = this.revisions[type][index]) == null ? void 0 : _a.length) || 0;
    if (totalRevisions <= 1) return "";
    let labels = this.panel.$el.querySelector(`.aai-suggestions-card[alt="${type}"] .aai-suggestion[alt="${index}"] .aai-labels`);
    if (labels) {
      labels.style.display = "flex";
      if (currentRevision > 0) labels.style.display = "none";
    }
    let HTML = `
			<label>${__$4("Revisions", "copyspell-ai")}: <b>${currentRevision + 1}/${totalRevisions}</b></label>
			<div class="aai-revisions-buttons">`;
    if (totalRevisions > 0) {
      HTML += `
				<div class="aai-prev-revision" data-action="prev">${SVG.caret}</div>
				<div class="aai-next-revision" data-action="next">${SVG.caret}</div>`;
    }
    HTML += `</div>`;
    return HTML;
  }
  // Previous Revision
  showNextRevision(e) {
    let btn = e.target.closest(".aai-next-revision");
    if (btn) {
      let suggestion = btn.closest(".aai-suggestion");
      let index = suggestion.getAttribute("alt") || 0;
      let type = suggestion.closest(".aai-suggestions-card").getAttribute("alt") || "content";
      let body = suggestion.querySelector(".aai-body");
      this.currentRevision[type][index] = Math.min(this.currentRevision[type][index] + 1, this.revisions[type][index].length - 1);
      body.innerHTML = this.revisions[type][index][this.currentRevision[type][index]] || "";
      let revisionsElement = suggestion.querySelector(".aai-revisions");
      if (revisionsElement) {
        revisionsElement.innerHTML = this.revisionsHTML(type, index);
      }
    }
  }
  // Next Revision
  showPrevRevision(e) {
    let btn = e.target.closest(".aai-prev-revision");
    if (btn) {
      let suggestion = btn.closest(".aai-suggestion");
      let index = suggestion.getAttribute("alt") || 0;
      let type = suggestion.closest(".aai-suggestions-card").getAttribute("alt") || "content";
      let body = suggestion.querySelector(".aai-body");
      this.currentRevision[type][index] = Math.max(this.currentRevision[type][index] - 1, 0);
      body.innerHTML = this.revisions[type][index][this.currentRevision[type][index]] || "";
      let revisionsElement = suggestion.querySelector(".aai-revisions");
      if (revisionsElement) {
        revisionsElement.innerHTML = this.revisionsHTML(type, index);
      }
    }
  }
  // MARK: HELPERS
  // MARK: Update
  // ────────────────────────────────────
  // This function updates the product with the provided data.
  // ────────────────────────────────────
  async updateProduct(data) {
    var _a, _b;
    if (!data || !data.id) {
      log("⚠️ No product data provided for update");
      return;
    }
    delete data.idx_short_description;
    delete data.idx_description;
    delete data.idx_name;
    data = await SDK$2.filters.applyAsync("before_update_product", data, { ...this });
    let response = await wpAPI$1.updateProduct(data.id, data);
    let product = ((_b = (_a = this.data) == null ? void 0 : _a.products) == null ? void 0 : _b[0]) || DATA$5.post || {};
    let content = {
      title: data.name || "",
      excerpt: data.short_description || "",
      content: data.description || ""
    };
    if (!await AIH.recordExists(content, product.id)) {
      await AIH.addRecord(
        0,
        product.id || 0,
        {
          _type: "published",
          _action: "product-content",
          api: this.data.api || "",
          model: this.data.model || "",
          duration: this.data.duration || 0
        },
        content
      );
    }
    if (response && response.id) {
      return response;
    } else {
      log("❌ Failed to update product:", response);
      return null;
    }
  }
  // MARK: Strip HTML
  // ────────────────────────────────────
  stripHtmlTags(html) {
    const div = document.createElement("div");
    div.innerHTML = html;
    return div.textContent || div.innerText || "";
  }
  // MARK: Format Date
  // ────────────────────────────────────
  formatDate(dateString) {
    if (!dateString) return "";
    const date = new Date(dateString);
    const now = /* @__PURE__ */ new Date();
    const diffInMilliseconds = now - date;
    const diffInSeconds = Math.floor(diffInMilliseconds / 1e3);
    const diffInMinutes = Math.floor(diffInSeconds / 60);
    const diffInHours = Math.floor(diffInMinutes / 60);
    const diffInDays = Math.floor(diffInHours / 24);
    const diffInWeeks = Math.floor(diffInDays / 7);
    const diffInMonths = Math.floor(diffInDays / 30);
    const diffInYears = Math.floor(diffInDays / 365);
    if (diffInSeconds < 60) {
      return __$4("just now", "copyspell-ai");
    } else if (diffInMinutes === 1) {
      return __$4("1 minute ago", "copyspell-ai");
    } else if (diffInMinutes < 60) {
      return `${__$4(": ", "copyspell-ai")}${diffInMinutes} ${__$4("minutes ago", "copyspell-ai")}`;
    } else if (diffInHours === 1) {
      return __$4("1 hour ago", "copyspell-ai");
    } else if (diffInHours < 24) {
      return `${__$4(": ", "copyspell-ai")}${diffInHours} ${__$4("hours ago", "copyspell-ai")}`;
    } else if (diffInDays === 1) {
      return __$4("1 day ago", "copyspell-ai");
    } else if (diffInDays < 7) {
      return `${__$4(": ", "copyspell-ai")}${diffInDays} ${__$4("days ago", "copyspell-ai")}`;
    } else if (diffInWeeks === 1) {
      return __$4("1 week ago", "copyspell-ai");
    } else if (diffInWeeks < 4) {
      return `${__$4(": ", "copyspell-ai")}${diffInWeeks} ${__$4("weeks ago", "copyspell-ai")}`;
    } else if (diffInMonths === 1) {
      return __$4("1 month ago", "copyspell-ai");
    } else if (diffInMonths < 12) {
      return `${__$4(": ", "copyspell-ai")}${diffInMonths} ${__$4("months ago", "copyspell-ai")}`;
    } else if (diffInYears === 1) {
      return __$4("1 year ago", "copyspell-ai");
    } else {
      return `${__$4(": ", "copyspell-ai")}${diffInYears} ${__$4("years ago", "copyspell-ai")}`;
    }
  }
}
const DATA$4 = window.copyspell_ai_admin || {};
const { __: __$3, _x: _x$2, _n: _n$2, sprintf: sprintf$2 } = wp.i18n;
DATA$4.options || {};
({
  productInfo: { id: DATA$4.post.id || null },
  "brand-tone": DATA$4.brand_tone || "",
  "extra-prompt": DATA$4.extra_prompt || ""
});
class copyspellAIContent {
  // ────────────────────────────────────
  constructor(action) {
    this.AISettings = null;
    this.id = DATA$4.post.id || null;
    this.action = action || "product-content";
    this.form = {};
    this.sources = null;
    if (action === "settings") this.settings();
    if (action === "product-content") this.start();
  }
  // MARK: Settings Panel
  // ────────────────────────────────────
  async settings() {
    requestAnimationFrame(async () => {
      this.AISettings = await AISettings.run("settings");
      log("AISettings", this.AISettings);
      const overlay = document.createElement("div");
      overlay.className = "aai-panel-overlay";
      this.AISettings.panel.$el.parentNode.insertBefore(overlay, this.AISettings.panel.$el);
      document.getElementById("copyspell-ai-metabox-app").classList.remove("aai-clicked");
    });
  }
  // MARK: Suggest
  // ────────────────────────────────────
  static async suggest(name) {
    let action = `product-suggest-${name}`;
    const c = new copyspellAIContent(action);
    c.AISettings = await AISettings.start(action);
    let form = c.AISettings.getFormData();
    console.log("form framework ---------", form.framework);
    const response = await CopySpellCall.run({ action, form });
    return response.json || response;
  }
  // MARK: Change
  // ────────────────────────────────────
  static async change(prompt2, content) {
    let action = `product-change`;
    const c = new copyspellAIContent(action);
    c.AISettings = await AISettings.start(action);
    let form = c.AISettings.getFormData();
    const response = await CopySpellCall.run({ action, form, extraData: { prompt: prompt2, content } });
    return response.json || response;
  }
  // MARK: Refine
  // ────────────────────────────────────
  static async refine(prompt2, content) {
    let action = `product-refine`;
    const c = new copyspellAIContent(action);
    c.AISettings = await AISettings.start(action);
    let form = c.AISettings.getFormData();
    const response = await CopySpellCall.run({ action, form, extraData: { prompt: prompt2, content } });
    return response.json || response;
  }
  // MARK: Start
  // ────────────────────────────────────
  async start() {
    requestAnimationFrame(async () => {
      this.action = "product-content";
      this.AISettings = await AISettings.run(
        this.action,
        __$3("Product Information Improvement", "copyspell-ai"),
        this.onSubmit.bind(this)
      );
      document.getElementById("copyspell-ai-metabox-app").classList.remove("aai-clicked");
    });
  }
  // Submit action
  // ────────────────────────────────────
  async onSubmit(_data = {}) {
    this.AISettings.loadingState();
    this.form = _data.form;
    this.generic = _data.generic;
    this.productInfo = _data.productInfo;
    const response = await CopySpellCall.run({
      action: this.action,
      form: this.form,
      extraData: {
        generic: this.generic,
        productInfo: this.productInfo
      },
      onProgress: (p) => this.callProgress(p)
    });
    if (!response || response.error) return;
    this.saveRecord(response);
    try {
      ResultProduct.run(this.panel, response);
    } catch (resultError) {
      this.callProgress({
        status: "error",
        error: __$3("There was an error rendering the result. Please try again.", "copyspell-ai")
      });
      log("❌ Error in ResultProduct.run", resultError);
    }
  }
  // MARK: Save Record
  // ────────────────────────────────────
  async saveRecord(response) {
    var _a, _b, _c, _d, _e, _f, _g, _h;
    let suggestions = ((_b = (_a = response.json) == null ? void 0 : _a.content) == null ? void 0 : _b.suggestions) || [];
    for (let i = 0; i < suggestions.length; i++) {
      await AIH.addRecord(
        0,
        response.products[0].id || 0,
        {
          _type: "suggestion",
          _action: this.action,
          meta: response.meta.model,
          api: response.meta.api,
          duration: response.meta.duration
        },
        {
          title: ((_e = (_d = (_c = response.json) == null ? void 0 : _c.title) == null ? void 0 : _d.suggestions) == null ? void 0 : _e[i]) || "",
          excerpt: ((_h = (_g = (_f = response.json) == null ? void 0 : _f.excerpt) == null ? void 0 : _g.suggestions) == null ? void 0 : _h[i]) || "",
          content: suggestions[i] || ""
        },
        "product"
      );
    }
  }
  // MARK: Call Progress
  // ────────────────────────────────────
  async callProgress(progress) {
    var _a;
    try {
      this.panel = this.AISettings.panel;
      if (!this.panel || !this.panel.$body) return;
      let output = this.panel.$body.querySelector(".aai-call-progress .aai-output");
      if (progress.status === "success") {
        return;
      }
      let HTML = ``;
      if (progress.status === "processing") {
        let modelName = progress.model.replace(/-/g, " ");
        HTML += `<p class="aai-row-calling">trying with <b>${modelName}</b> @ ${progress.api}...</p>`;
      }
      if (progress.status === "processing error" || progress.status === "error") {
        if (progress.status === "processing error")
          HTML += `<p class="aai-row-error">${progress.error}</p>`;
        if (progress.status === "error" && !progress.model) {
          HTML += modelSelectionDropdown(this.form);
          HTML += await submitButtonHTML(__$3("Try again", "copyspell-ai"));
          HTML += `<button class="aai-btn aai-btn-primary aai-cancel-button">${__$3("Back", "copyspell-ai")}</button>`;
        }
      }
      if (progress.status === "server error") {
        HTML += `<p class="aai-row-error">${progress.error}</p>`;
        HTML += `<p class="aai-row-error-final">All models and providers have been tried without success.</p>`;
        HTML += modelSelectionDropdown(this.form);
        HTML += await submitButtonHTML(__$3("Try again", "copyspell-ai"));
        HTML += `<button class="aai-btn aai-btn-primary aai-cancel-button">${__$3("Back", "copyspell-ai")}</button>`;
      }
      if (output) {
        output.insertAdjacentHTML("beforeend", HTML);
        (_a = output.querySelector(".aai-cancel-button")) == null ? void 0 : _a.addEventListener("click", (e) => {
          this.AISettings.panel.close();
        });
      }
    } catch (error) {
      log("❌ Error in callProgress:", error);
    }
  }
}
let $$3 = jQuery;
const DATA$3 = window.copyspell_ai_admin || {};
class MarketingExtra {
  // ────────────────────────────────────
  constructor() {
    this.prefs = {};
    this.target = null;
    this.productIds = null;
    this.productSelect = null;
    this.data = {};
  }
  // MARK: Get Data
  // ────────────────────────────────────
  get() {
    this.data = {};
    this.target.find("input").each((i, el) => {
      let $el = $$3(el);
      let name = $el.attr("name");
      if (!name) return;
      let val = $el.val();
      this.data[name] = val;
    });
    this.target.find("select").each((i, el) => {
      let $el = $$3(el);
      let name = $el.attr("name");
      if (!name) return;
      let val = $el.val();
      this.data[name] = val;
    });
    this.target.find("textarea").each((i, el) => {
      let $el = $$3(el);
      let name = $el.attr("name");
      if (!name) return;
      let val = $el.val();
      this.data[name] = val;
    });
    if (this.productSelect) this.data.product_ids = this.productSelect.getSelectedIds();
    log("Marketing Extra Data", this.data);
    return this.data;
  }
  // MARK: Render
  // ────────────────────────────────────
  render(prefs, target) {
    this.prefs = prefs;
    this.target = target;
    this.productIds = null;
    this.productSelect = null;
    this.target.empty();
    if (this[this.prefs.group]) {
      let html = this[this.prefs.group](this.prefs.type);
      this.target.append(html);
    }
  }
  // MARK: Blog
  // ────────────────────────────────────
  blog(type) {
    let result = "";
    if (type == 0) {
      result += this.products();
      result += `
			<div class="aai-group">
				<input name="focus_point" value="${this.data.focus_point || ""}" type="text" class="aai-input" placeholder="focus point..." />
				<label>
					Main focus of this blog post.
					eg. Features, Benefits, Use cases, Innovation, Craftsmanship, Story behind product.
				</label>
			</div>
			<div class="aai-group">
				<input name="use_cases" value="${this.data.use_cases || ""}" type="text" class="aai-input" placeholder="use cases..." />
				<label>
					Specific use-case examples to include.
				</label>
			</div>
			` + this.ctaStyle();
    }
    if (type == 1) {
      result += this.products();
      result += this.skillLevel() + `
			<div class="aai-group">
				<input name="tips" value="${this.data.tips || ""}" type="text" class="aai-input" placeholder="tips..." />
				<label>
					Special tips or insights to include.
				</label>
			</div>
			<div class="aai-group">
				<input name="mistakes" value="${this.data.mistakes || ""}" type="text" class="aai-input" placeholder="common mistakes..." />
				<label>
					Common mistakes to include or address.
				</label>
			</div>
			<div class="aai-group">
				<input name="tools" value="${this.data.tools || ""}" type="text" class="aai-input" placeholder="materials/tools..." />
				<label>
					List of materials/tools the user may need.
				</label>
			</div>
			`;
    }
    if (type == 2) {
      result += this.products();
      result += `
			<div class="aai-group">
				<input name="problem" value="${this.data.problem || ""}" type="text" class="aai-input" placeholder="the problem..." />
				<label>
					Specific problem to highlight.
				</label>
			</div>
			<div class="aai-group">
				<input name="solution" value="${this.data.solution || ""}" type="text" class="aai-input" placeholder="solution elements..." />
				<label>
					Key aspects of the solution to emphasize.
					eg. Performance, Usability, Cost savings, Reliability, Speed.
				</label>
			</div>
			`;
    }
    if (type == 3) {
      result += this.products();
      result += `
			<div class="aai-group">
				<input name="focus" value="${this.data.focus || ""}" type="text" class="aai-input" placeholder="trend focus..." />
				<label>
					Specific trend or topic to focus on.
					eg. Market growth, Consumer behavior, Technology, Sustainability, Innovation
				</label>
			</div>
			<div class="aai-group">
				<textarea name="data" class="aai-textarea" placeholder="data points...">${this.data.data || ""}</textarea>
				<label>
					Data, stats, or references to include.
				</label>
			</div>
			<div class="aai-group">
				<select name="expert_angle" value="${this.data.expert_angle || ""}" class="aai-select">
					<option value="" disabled selected>Select user type...</option>
					Industry Trends, Practical Tips, Expert Insights, Data-Backed Analysis, Step-by-Step Guidance, Common Mistakes to Avoid, Pro Best Practices, Future Predictions, Technical Deep Dive, Beginner-Friendly Breakdown
					<option value="industry_trends">Industry Trends</option>
					<option value="practical_tips">Practical Tips</option>
					<option value="expert_insights">Expert Insights</option>
					<option value="data_backed_analysis">Data-Backed Analysis</option>
					<option value="step_by_step_guidance">Step-by-Step Guidance</option>
					<option value="common_mistakes">Common Mistakes to Avoid</option>
					<option value="pro_best_practices">Pro Best Practices</option>
					<option value="future_predictions">Future Predictions</option>
					<option value="technical_deep_dive">Technical Deep Dive</option>
					<option value="beginner_friendly">Beginner-Friendly Breakdown</option>
				</select>
				<label>
					Expert Angle
				</label>
			</div>
			`;
    }
    if (type == 4) {
      result += this.products() + `
			<div class="aai-group">
				<input name="criteria" value="${this.data.criteria || ""}" type="text" class="aai-input" placeholder="criteria..." />
				<label>
					Key comparison criteria.
					eg. Features, Price, Performance, Ease of Use, Support, Reliability
				</label>
			</div>
			`;
    }
    if (type == 5) {
      result += this.products();
      result += `
			<div class="aai-group">
				<input name="client_type" value="${this.data.client_type || ""}" type="text" class="aai-input" placeholder="client type..." />
				<label>
					Type of customer or business featured in the case study.
					eg. Small Business, E-commerce Store, Freelancer, Enterprise, Agency.
				</label>
			</div>
			<div class="aai-group">
				<input name="challenge" value="${this.data.challenge || ""}" type="text" class="aai-input" placeholder="main challenge..." />
				<label>
					Main challenge or problem they faced.
				</label>
			</div>
			<div class="aai-group">
				<input name="outcome" value="${this.data.outcome || ""}" type="text" class="aai-input" placeholder="outcome metrics..." />
				<label>
					Measurable results or improvements.
				</label>
			</div>
			<div class="aai-group">
				<input name="testimonial" value="${this.data.testimonial || ""}" type="text" class="aai-input" placeholder="testimonial quote..." />
				<label>
					Customer quote.
				</label>
			</div>
			`;
    }
    if (type == 6) {
      result += this.products();
      result += `
			<div class="aai-group">
				<input name="theme" value="${this.data.theme || ""}" type="text" class="aai-input" placeholder="list theme..." />
				<label>
					Theme of the list. eg. Tips, Benefits, Use Cases, Mistakes to Avoid, Ideas.
				</label>
			</div>
			<div class="aai-group">
				<input name="list_count" value="${this.data.list_count || 0}" type="number" class="aai-input" placeholder="list items..." />
				<label>
					Number of list items. 
				</label>
			</div>
			` + this.ctaStyle();
    }
    if (type == 7) {
      result += this.products();
      result += `
			<div class="aai-group">
				<input name="theme" value="${this.data.theme || ""}" type="text" class="aai-input" placeholder="list theme..." />
				<label>
					What kind of announcement is this?
					eg. New Product, Feature Update, Event, Sale, Company News.
				</label>
			</div>
			<div class="aai-group">
				<input name="key_details" value="${this.data.key_details || ""}" type="text" class="aai-input" placeholder="key details..." />
				<label>
					Key details to highlight. 
				</label>
			</div>
			` + this.ctaStyle();
    }
    if (type == 8) {
      result += this.products();
      result += `
			<div class="aai-group">
				<input name="topic" value="${this.data.topic || ""}" type="text" class="aai-input" placeholder="topic..." />
				<label>
					Topic or issue you want to express an opinion about.
				</label>
			</div>
			<div class="aai-group">
				<input name="stance" value="${this.data.stance || ""}" type="text" class="aai-input" placeholder="stance..." />
				<label>
					Your position or viewpoint. eg. Support, Critique, Analysis, Prediction. 
				</label>
			</div>
			`;
    }
    if (type == 9) {
      result += this.products();
      result += `
			<div class="aai-group">
				<input name="theme" value="${this.data.theme || ""}" type="text" class="aai-input" placeholder="story theme..." />
				<label>
					Theme or type of story you want to tell.
				</label>
			</div>
			<div class="aai-group">
				<input name="character" value="${this.data.character || ""}" type="text" class="aai-input" placeholder="main character..." />
				<label>
					Who is the main character? eg. Founder, Customer, Employee, Everyday User.
				</label>
			</div>
			`;
    }
    if (type == 10) {
      result += this.products();
      result += `
			<div class="aai-group">
				<textarea name="data" class="aai-textarea" placeholder="data points...">${this.data.data || ""}</textarea>
				<label>
					Data, stats, or references to include.
				</label>
			</div>
			<div class="aai-group">
				<input name="key_findings" value="${this.data.key_findings || ""}" type="text" class="aai-input" placeholder="key findings..." />
				<label>
					Most important findings to highlight.
				</label>
			</div>
			<div class="aai-group">
				<input name="takeaway_style" value="${this.data.takeaway_style || ""}" type="text" class="aai-input" placeholder="takeaway style..." />
				<label>
					Style of the final recommendations. eg. Actionable Steps, Strategic Advice, Best Practices, Future Trends.
				</label>
			</div>
			`;
    }
    if (type == 11) {
      result += this.products();
      result += `
			<div class="aai-group">
				<input name="industry" value="${this.data.industry || ""}" type="text" class="aai-input" placeholder="industry or niche..." />
				<label>
					Industry or niche to cover. eg. Tech, E-commerce, Beauty, Fitness, Marketing, AI, Fashion.
				</label>
			</div>
			<div class="aai-group">
				<input name="topic" value="${this.data.topic || ""}" type="text" class="aai-input" placeholder="trend topic..." />
				<label>
					Specific news or trend to analyze.
				</label>
			</div>
			<div class="aai-group">
				<input name="forecast_style" value="${this.data.forecast_style || ""}" type="text" class="aai-input" placeholder="forecast style..." />
				<label>
					How should the future outlook be framed? eg. Cautious, Optimistic, Balanced, Critical.
				</label>
			</div>
			`;
    }
    return result;
  }
  // MARK: Email
  // ────────────────────────────────────
  email(type) {
    let result = "";
    if (type == 0) {
      result += this.products();
      result += this.benefits(`Describe the key advantage of the product that should be highlighted in this promotional email (e.g., “keeps drinks cold all day,” “enhances productivity”).`) + this.offer();
    }
    if (type == 1) {
      result += this.products();
      result += `
			<div class="aai-group">
				<select name="user_type" value="${this.data.user_type || ""}" class="aai-select">
					<option value="" disabled selected>Select user type...</option>
					<option value="new_subscriber">New Subscriber</option>
					<option value="first_time_buyer">First-Time Buyer</option>
					<option value="app_sign_up">App Sign-Up</option>
					<option value="newsletter_joiner">Newsletter Joiner</option>
					<option value="trial_sign_up">Trial Sign-Up</option>
					<option value="returning_customer">Returning Customer</option>
					<option value="loyalty_program_member">Loyalty Program Member</option>
					<option value="event_registrant">Event / Webinar Registrant</option>
					<option value="social_media_follower">Social Media Follower</option>
					<option value="referral_sign_up">Referral Sign-Up</option>
					<option value="customer">Customer</option>
				</select>
				<label>
					User Type
				</label>
			</div>
			` + this.cta(`Call-to-action to guide the recipient, e.g., “Explore our products,” “Start shopping,” “Learn more about us.”`);
    }
    if (type == 2) {
      result += this.products();
      result += this.launch() + this.cta();
    }
    if (type == 3) {
      result += this.products();
      result += this.benefits("The main features or benefits that should be emphasized in the email.") + `
			<div class="aai-group">
				<input name="recognition" value="${this.data.recognition || ""}" type="text" class="aai-input" placeholder="special notes..." />
				<label>
					Anything notable about the product such as awards, limited edition status, or unique characteristics.
				</label>
			</div>
			` + this.cta();
    }
    if (type == 4) {
      result += this.products();
      result += this.offer() + this.cta();
    }
    if (type == 5) {
      result += this.products();
      result += `
			<div class="aai-group">
				<input name="collection" value="${this.data.collection || ""}" type="text" class="aai-input" placeholder="collection name..." />
				<label>
					The name or theme of the new collection to introduce.
				</label>
			</div>
			` + this.launch() + this.cta();
    }
    if (type == 6) {
      result += this.products("Products Left in Cart") + this.customer() + `<div class="aai-group">
				<input name="discount" value="${this.data.discount || ""}" type="text" class="aai-input" placeholder="discount..." />
				<label>
					Any special offer to encourage completion of the purchase, e.g., “10% off,” “Free shipping.”
				</label>
			</div>` + this.cta();
    }
    if (type == 7) {
      result += this.products() + this.customer(`Personalize the message to make it feel more genuine.`) + `<div class="aai-group">
				<select name="reason" value="${this.data.reason || ""}" class="aai-select">
					<option value="" disabled selected>Select reason...</option>
					<option value="purchase">Purchase</option>
					<option value="newsletter_signup">Newsletter Signup</option>
					<option value="event_participation">Event Participation</option>
					<option value="referral">Referral</option>
					<option value="feedback_submission">Feedback Submission</option>
				</select>
				<label>
					Reason for Thanks
				</label>
			</div>` + this.cta(`Optional next step you want the recipient to take, e.g., “Explore more products,” “Share your experience,” “Follow us on social media.”`);
    }
    if (type == 8) {
      result += this.products();
      result += this.customer(`Personalize the message to make the recipient feel recognized.`) + `<div class="aai-group">
				<select name="reason" value="${this.data.reason || ""}" class="aai-select">
					<option value="" disabled selected>Select reason...</option>
					<option value="inactive_subscriber">Inactive Subscriber</option>
					<option value="no_recent_purchase">Haven’t Purchased in a While</option>
					<option value="abandoned_product_interest">Abandoned Product Interest</option>
					<option value="lapsed_loyalty_member">Lapsed Loyalty Member</option>
					<option value="dormant_app_user">Dormant App User</option>
					<option value="event_no_show">Event No-Show</option>
				</select>
				<label>
					Reason
				</label>
			</div>
			<div class="aai-group">
				<input name="discount" value="${this.data.discount || ""}" type="text" class="aai-input" placeholder="incentive / offer..." />
				<label>
					Any special reason to entice them back (e.g., discount, free shipping, exclusive content).
				</label>
			</div>` + this.cta(`What action you want the recipient to take, e.g., “Visit us again,” “Claim your offer,” “Check out new products.”`);
    }
    if (type == 9) {
      result += this.products();
      result += this.customer() + this.products("Purchased Product(s)") + `
			<div class="aai-group">
				<input name="recommendations" value="${this.data.recommendations || ""}" type="text" class="aai-input" placeholder="next steps / recommendations..." />
				<label>
					Suggestions for complementary products, tips, or related content.
				</label>
			</div>` + this.cta(`Encourage further engagement, e.g., “Share your experience,” “Check out related products,” “Leave a review.”`);
    }
    if (type == 10) {
      result += this.products();
      result += `
			<div class="aai-group">
				<select name="topic" value="${this.data.topic || ""}" class="aai-select">
					<option value="" disabled selected>Select topic...</option>
					<option value="new_arrivals">New Arrivals</option>
					<option value="tips_guides">Tips & Guides</option>
					<option value="industry_news">Industry News</option>
					<option value="product_updates">Product Updates</option>
					<option value="promotions_offers">Promotions & Offers</option>
					<option value="customer_stories">Customer Stories</option>
					<option value="seasonal_highlights">Seasonal Highlights</option>
					<option value="how_to_tutorials">How-To Tutorials</option>
					<option value="behind_the_scenes">Behind the Scenes</option>
					<option value="expert_insights">Expert Insights</option>
					<option value="event_announcements">Event Announcements</option>
					<option value="limited_time_offers">Limited-Time Offers</option>
					<option value="product_comparisons">Product Comparisons</option>
					<option value="diy_ideas">DIY Ideas</option>
					<option value="brand_milestones">Brand Milestones</option>
					<option value="loyalty_program_updates">Loyalty Program Updates</option>
					<option value="trends_insights">Trends & Insights</option>
					<option value="featured_reviews">Featured Reviews</option>
					<option value="special_collaborations">Special Collaborations</option>
					<option value="exclusive_previews">Exclusive Previews</option>
				</select>
				<label>
					Newsletter Topic / Theme
				</label>
			</div>
			<div class="aai-group">
				<textarea name="sections" class="aai-textarea" placeholder="key highlights / sections...">${this.data.sections || ""}</textarea>
				<label>
					The important content pieces or announcements to feature in this newsletter.
				</label>
			</div>` + this.cta(`The main action you want readers to take, e.g., “Read more,” “Shop now,” “Sign up for an event.”`);
    }
    if (type == 11) {
      result += this.products();
      result += this.seasonal() + this.offer(`Include any seasonal offer, discount, or special perk`) + this.cta();
    }
    if (type == 12) {
      result += this.products();
      result += `
			<div class="aai-group">
				<input name="topic" class="aai-input" type="text" placeholder="topic or skill to teach..." value="${this.data.topic || ""}" />
				<label>
					What the email should focus on (e.g., “pet nutrition basics”, “how to choose the right hosting plan”).
				</label>
			</div>
			<div class="aai-group">
				<input name="tips_number" value="${this.data.tips_number || 0}" type="number" class="aai-input" placeholder="number of tips..." />
				<label>
					Specify how many tips or points you want the email to include. 
				</label>
			</div>` + this.skillLevel();
    }
    if (type == 13) {
      result += this.products();
      result += `
			<div class="aai-group">
				<input name="story_theme" value="${this.data.story_theme || ""}" type="text" class="aai-input" placeholder="story theme..." />
				<label>
					Describe the everyday moment or situation where the product naturally fits (e.g., “a quiet morning routine,” “a busy workday,” “a weekend getaway”). This sets the emotional scene of the story.
				</label>
			</div>
			<div class="aai-group">
				<input name="target_persona" value="${this.data.target_persona || ""}" type="text" class="aai-input" placeholder="target persona..." />
				<label>
					Describe the type of person in the story (e.g., “a young professional,” “a busy parent,” “a fitness lover”). This helps tailor tone and perspective.
				</label>
			</div>
			<div class="aai-group">
				<input name="moral" value="${this.data.moral || ""}" type="text" class="aai-input" placeholder="moral of the story..." />
				<label>
					What feeling or insight should remain with the reader at the end.
				</label>
			</div>
			`;
    }
    if (type == 14) {
      result += `<div class="aai-group">
				<input name="milestone" value="${this.data.milestone || ""}" type="text" class="aai-input" placeholder="milestone type..." />
				<label>
					Milestone or Loyalty Event (eg. “Anniversary”, “Spending Milestone”, “Order Count Milestone”, “Birthday”, “VIP Tier Reached”)
				</label>
			</div>` + this.customer() + `<div class="aai-group">
				<input name="reward" value="${this.data.reward || ""}" type="text" class="aai-input" placeholder="reward or gift..." />
				<label>
					Reward or Thank-You Gift (if any)<br>
					e.g., “10% loyalty discount”, “early VIP access”, “free add-on”.
				</label>
			</div>`;
    }
    if (type == 15) {
      result += this.products("Purchased Product(s)");
      result += `
			<div class="aai-group">
				<select name="feedback_type" value="${this.data.feedback_type || ""}" class="aai-select">
					<option value="" disabled selected>Select type...</option>
					<option value="star_rating">Star Rating</option>
					<option value="short_review">Short Review</option>
					<option value="detailed_testimonial">Detailed Testimonial</option>
					<option value="feature_suggestion">Feature Suggestion</option>
					<option value="experience_rating">Experience Rating</option>
					<option value="satisfaction_survey">Satisfaction Survey</option>
					<option value="before_after_story">Before/After Story</option>
					<option value="video_review">Video Review</option>
					<option value="social_media_post">Social Media Post</option>
				</select>
				<label>
					Feedback Type
				</label>
			</div>
			`;
      result += this.customer() + `
			<div class="aai-group">
				<input name="reward" value="${this.data.reward || ""}" type="text" class="aai-input" placeholder="reward or gift..." />
				<label>
					Reward for Leaving Feedback (if any)<br>
					e.g., “10% discount”, “early VIP access”, “free add-on”.
				</label>
			</div>
			<div class="aai-group">
				<input name="purpose" value="${this.data.purpose || ""}" type="text" class="aai-input" placeholder="purpose of feedback..." />
				<label>
					How Will the Feedback Be Used?<br>
					e.g., “improving the product”, “website testimonials”, “future updates”.
				</label>
			</div>
			`;
    }
    if (type == 16) {
      result += `
			<div class="aai-group">
				<input name="vip_level" value="${this.data.vip_level || ""}" type="text" class="aai-input" placeholder="member level..." />
				<label>
					VIP Tier / Member Level.<br>
					e.g., “VIP”, “Gold Member”, “Platinum Member”, “Elite”, “Loyalty Plus”.
				</label>
			</div>` + this.offer(`Exclusive Access or Benefit.<br>e.g., “early access to new products”, “private sale”, “members-only discount”.`);
      result += `
			<div class="aai-group">
				<input name="reason" value="${this.data.reason || ""}" type="text" class="aai-input" placeholder="reason for exclusive access..." />
				<label>
					Reason for Exclusive Access.<br>
					e.g., “your loyalty”, “your long-time support”, “your purchase history”.
				</label>
			</div>`;
    }
    return result;
  }
  // MARK: Advertisement
  // ────────────────────────────────────
  adv(type) {
    let result = "";
    if (type == 0) {
      result += this.products();
      result += this.benefits(`Tell us the most important benefit of the product (e.g., “keeps drinks cold for 24 hours”, “reduces back pain”).`);
    }
    if (type == 1) {
      result += this.products();
      result += this.offer();
    }
    if (type == 2) {
      result += this.products();
      result += `
			<div class="aai-group">
				<input name="features" value="${this.data.features || ""}" type="text" class="aai-input" placeholder="key features..." />
				<label>
					List the main features or attributes of the product that you want highlighted (e.g., “lightweight, waterproof, long battery life”).
				</label>
			</div>
			<div class="aai-group">
				<input name="special" value="${this.data.special || ""}" type="text" class="aai-input" placeholder="what makes it special..." />
				<label>
					Explain what sets this product apart or why people will love it (e.g., “crafted from sustainable materials,” “limited edition design,” “enhanced performance”).
				</label>
			</div>
			` + this.launch();
    }
    if (type == 3) {
      result += this.products();
      result += `
			<div class="aai-group">
				<input name="values" value="${this.data.values || ""}" type="text" class="aai-input" placeholder="brand values to emphasize..." />
				<label>
					List the core values you want to highlight (e.g., “sustainability,” “innovation,” “attention to detail,” “community focus”). These will be woven naturally into the story to strengthen your brand identity.
				</label>
			</div>
			`;
    }
    if (type == 4) {
      result += this.products();
      result += this.customer(`Personalize the message to make the recipient feel recognized.`) + `
			<div class="aai-group">
				<input name="discount" value="${this.data.discount || ""}" type="text" class="aai-input" placeholder="incentive / offer..." />
				<label>
					Any special reason to entice them back (e.g., discount, free shipping, exclusive content).
				</label>
			</div>` + this.cta(`What action you want the recipient to take, e.g., “Visit us again,” “Claim your offer,” “Check out new products.”`);
    }
    if (type == 5) {
      result += this.products();
      result += this.seasonal();
      result += this.offer();
    }
    if (type == 6) {
      result += this.products();
      result += this.benefits(`Specify the key advantage or positive effect the customer experienced (e.g., “keeps drinks cold all day,” “made my skin feel smoother,” “easy to assemble”).`) + this.customer();
    }
    if (type == 7) {
      result += this.products() + `
			<div class="aai-group">
				<input name="advantages" value="${this.data.advantages || ""}" type="text" class="aai-input" placeholder="key advantages..." />
				<label>
					List the 2-4 main benefits or standout features of your product that you want emphasized in the comparison.
				</label>
			</div>`;
    }
    if (type == 8) {
      result += this.products();
    }
    if (type == 9) {
      result += this.products();
      result += this.offer() + this.cta();
    }
    if (type == 10) {
      result += this.products();
      result += `
			<div class="aai-group">
				<input name="problem" value="${this.data.problem || ""}" type="text" class="aai-input" placeholder="the problem..." />
				<label>
					Specific problem to highlight.
				</label>
			</div>
			<div class="aai-group">
				<input name="solution" value="${this.data.solution || ""}" type="text" class="aai-input" placeholder="solution elements..." />
				<label>
					Key aspects of the solution to emphasize.
					eg. Performance, Usability, Cost savings, Reliability, Speed.
				</label>
			</div>
			`;
    }
    if (type == 11) {
      result += this.products();
      result += this.benefits(`Tell us the main unique selling proposition or value of the product(s).`);
    }
    return result;
  }
  // MARK: Social
  // ────────────────────────────────────
  social(type) {
    let result = "";
    if (type == 0) {
      result += this.products();
      result += this.benefits(`Tell us the most important benefit of the product (e.g., “keeps drinks cold for 24 hours”, “reduces back pain”).`);
    }
    if (type == 1) {
      result += this.products();
      result += `
			<div class="aai-group">
				<input name="use_case" value="${this.data.use_case || ""}" type="text" class="aai-input" placeholder="specific use case or scenario..." />
				<label>
					Describe the specific scenario in which the product is being used (e.g., “cleaning a car interior,” “making a smoothie,” “organizing cables”). This sets the context for the tutorial.
				</label>
			</div>
			<div class="aai-group">
				<input name="key_steps" value="${this.data.key_steps || ""}" type="text" class="aai-input" placeholder="main steps involved..." />
				<label>
					List the main steps involved in using the product. These will be transformed into a clear, user-friendly demonstration.
				</label>
			</div>
			` + this.skillLevel();
    }
    if (type == 2) {
      result += this.products();
      result += `
			<div class="aai-group">
				<input name="ideal_scenario" value="${this.data.ideal_scenario || ""}" type="text" class="aai-input" placeholder="ideal scenario..." />
				<label>
					Describe the everyday moment or situation where the product naturally fits (e.g., “a quiet morning routine,” “a busy workday,” “a weekend getaway”). This sets the emotional scene of the story.
				</label>
			</div>
			<div class="aai-group">
				<input name="target_persona" value="${this.data.target_persona || ""}" type="text" class="aai-input" placeholder="target persona..." />
				<label>
					Describe the type of person in the story (e.g., “a young professional,” “a busy parent,” “a fitness lover”). This helps tailor tone and perspective.
				</label>
			</div>
			<div class="aai-group">
				<input name="story_theme" value="${this.data.story_theme || ""}" type="text" class="aai-input" placeholder="specific story theme..." />
				<label>
					Write the emotional or narrative theme you want the story to follow (e.g., “self-care,” “productivity boost,” “cozy moments,” “confidence,” “simplicity”). This influences the mood and message.
				</label>
			</div>
			`;
    }
    if (type == 3) {
      result += this.products();
      result += this.offer();
    }
    if (type == 4) {
      result += this.products();
      result += `
			<div class="aai-group">
				<input name="main_lesson" value="${this.data.main_lesson || ""}" type="text" class="aai-input" placeholder="main lesson..." />
				<label>
					Write the core educational takeaway you want the audience to learn<br>
					(e.g., “how to clean leather safely,” “why hydration matters,” “the benefits of ergonomic design”).
				</label>
			</div>
			<div class="aai-group">
				<input name="facts" value="${this.data.facts || ""}" type="text" class="aai-input" placeholder="facts or notes..." />
				<label>
					Provide any special knowledge, interesting facts, or expert notes you want included (e.g., “this material lasts 2x longer,” “95% of people use it incorrectly”). Leave blank if none.
				</label>
			</div>
			<div class="aai-group">
				<input name="tips_number" value="${this.data.tips_number || 0}" type="number" class="aai-input" placeholder="number of tips..." />
				<label>
					Specify how many tips or points you want the post to include. 
				</label>
			</div>
			`;
    }
    if (type == 5) {
      result += this.products();
      result += this.benefits(`Specify the key advantage or positive effect the customer experienced (e.g., “keeps drinks cold all day,” “made my skin feel smoother,” “easy to assemble”).`) + this.customer();
    }
    if (type == 6) {
      result += this.products() + `
			<div class="aai-group">
				<input name="advantages" value="${this.data.advantages || ""}" type="text" class="aai-input" placeholder="key advantages..." />
				<label>
					List the 2-4 main benefits or standout features of your product that you want emphasized in the comparison.
				</label>
			</div>`;
    }
    if (type == 7) {
      result += this.products();
      result += `
			<div class="aai-group">
				<input name="features" value="${this.data.features || ""}" type="text" class="aai-input" placeholder="key features..." />
				<label>
					List the main features or attributes of the product that you want highlighted (e.g., “lightweight, waterproof, long battery life”).
				</label>
			</div>
			<div class="aai-group">
				<input name="special" value="${this.data.special || ""}" type="text" class="aai-input" placeholder="what makes it special..." />
				<label>
					Explain what sets this product apart or why people will love it (e.g., “crafted from sustainable materials,” “limited edition design,” “enhanced performance”).
				</label>
			</div>
			` + this.launch();
    }
    if (type == 8) {
      result += this.products();
      result += this.seasonal();
      result += this.offer();
    }
    if (type == 9) {
      result += this.products();
      result += `
			<div class="aai-group">
				<input name="process" value="${this.data.process || ""}" type="text" class="aai-input" placeholder="part of the process to highlight..." />
				<label>
					Specify the step, activity, or aspect of your process that you want featured (e.g., “handcrafting each item,” “quality checks,” “team brainstorming sessions”). This helps illustrate authenticity and human effort.
				</label>
			</div>
			<div class="aai-group">
				<input name="values" value="${this.data.values || ""}" type="text" class="aai-input" placeholder="brand values to emphasize..." />
				<label>
					List the core values you want to highlight (e.g., “sustainability,” “innovation,” “attention to detail,” “community focus”). These will be woven naturally into the story to strengthen your brand identity.
				</label>
			</div>
			`;
    }
    if (type == 10) {
      result += this.products();
      result += `
			<div class="aai-group">
				<input name="tips_number" value="${this.data.tips_number || 0}" type="number" class="aai-input" placeholder="number of tips..." />
				<label>
					Specify how many tips or points you want the post to include. 
				</label>
			</div>
			<div class="aai-group">
				<input name="tips_type" value="${this.data.tips_type || ""}" type="text" class="aai-input" placeholder="type of tips..." />
				<label>
					Define the style or focus of the tips (e.g., “product hacks,” “time-saving techniques,” “creative uses,” “maintenance tips”).
				</label>
			</div>
			` + this.skillLevel();
    }
    if (type == 11) {
      result += this.products();
      result += `
			<div class="aai-group">
				<input name="question" value="${this.data.question || ""}" type="text" class="aai-input" placeholder="main question..." />
				<label>
					Write the central question you want to ask the audience (e.g., “Which color do you prefer?”, “How do you usually use this product?”). This will be the focus of the post.
				</label>
			</div>
			<div class="aai-group">
				<input name="poll_options" value="${this.data.poll_options || ""}" type="text" class="aai-input" placeholder="poll options..." />
				<label>
					Provide the answer choices or options for the poll (e.g., “Red, Blue, Green” or “Morning, Afternoon, Evening”). Leave blank if open-ended.
				</label>
			</div>
			<div class="aai-group">
				<input name="insight" value="${this.data.insight || ""}" type="text" class="aai-input" placeholder="insight to gather..." />
				<label>
					Describe what insight or feedback you want from the audience (e.g., “to learn the most popular usage,” “to understand style preferences”). This guides the tone and framing of the post.
				</label>
			</div>
			`;
    }
    return result;
  }
  // MARK: Seasonal
  // - seasonal_event
  // ────────────────────────────────────
  seasonal(label) {
    label = label || `Specify the exact holiday, season, or special event.<br>(e.g. Christmas, Easter, Summer Sale, Valentine's Day, Back to School, Black Friday, Mother's Day)`;
    return `
		<div class="aai-group">
			<input name="seasonal_event" value="${this.data.seasonal_event || ""}" type="text" class="aai-input" placeholder="holiday, season, or event..." />
			<label>${label}</label>
		</div>
		`;
  }
  // MARK: Skill Level
  // ────────────────────────────────────
  skillLevel() {
    return `
		<div class="aai-group">
			<select name="skill_level" value="${this.data.skill_level || ""}" class="aai-select">
				<option value="" disabled selected>Select skill level...</option>
				<option value="beginner">Beginner</option>
				<option value="intermediate">Intermediate</option>
				<option value="expert">Expert</option>
			</select>
			<label>
				Skill Level
			</label>
		</div>
		`;
  }
  // MARK: Offer
  // - offer
  // ────────────────────────────────────
  offer(label, timeframe = true) {
    label = label || "Specify the promotion, discount, or incentive (e.g., “20% off all products,” “Buy 1 Get 1 Free,” “Free shipping”).";
    let result = `
		<div class="aai-group">
			<input name="offer" value="${this.data.offer || ""}" type="text" class="aai-input" placeholder="offer, discount, or deal..." />
			<label>${label}</label>
		</div>
		`;
    if (timeframe) {
      result += `
			<div class="aai-group">
				<input name="offer_timeframe" value="${this.data.offer_timeframe || ""}" type="text" class="aai-input" placeholder="offer timeframe..." />
				<label>
					Specify when the offer begins and ends (e.g., “Valid until Sunday,” “Only this week,” “Ends on March 12”).<br>
					If the promotion has no timeframe, leave this empty.
				</label>
			</div>`;
    }
    return result;
  }
  // MARK: CTA
  // ────────────────────────────────────
  cta(label) {
    label = label || `The action you want the recipient to take, e.g., “Shop now,” “Pre-order today,” “Learn more.”`;
    return `
			<div class="aai-group">
				<input name="cta" value="${this.data.cta || ""}" type="text" class="aai-input" placeholder="suggested call-to-action..." />
				<label>${label}</label>
			</div>
		`;
  }
  // MARK: CTA Style
  // ────────────────────────────────────
  ctaStyle(label) {
    label = label || `The style of the call-to-action.`;
    return `
			<div class="aai-group">
				<select name="user_type" value="${this.data.user_type || ""}" class="aai-select">
					<option value="" disabled selected>Select cta style...</option>
					<option value="soft">Soft CTA (subtle prompt)</option>
					<option value="strong">Strong CTA (direct command)</option>
					<option value="value-driven">Value-Driven CTA (focus on benefits)</option>
					<option value="urgent">Urgent CTA (creates urgency)</option>
					<option value="friendly">Friendly CTA (conversational tone)</option>
					<option value="teaser">Teaser CTA (creates curiosity)</option>
					<option value="none">No CTA</option>
				</select>
				<label>${label}</label>
			</div>
		`;
  }
  // MARK: benefits
  // ────────────────────────────────────
  benefits(label) {
    label = label || `Short list of what makes this product unique or valuable.`;
    return `
			<div class="aai-group">
				<input name="key_benefits" value="${this.data.key_benefits || ""}" type="text" class="aai-input" placeholder="key benefits..." />
				<label>
					${label}
				</label>
			</div>
		`;
  }
  // MARK: Launch
  // ────────────────────────────────────
  launch(label) {
    label = label || `The official release date. Leave blank if timing is flexible.`;
    return `
		<div class="aai-group">
			<input name="launch" value="${this.data.launch || ""}" type="date" class="aai-input"/>
			<label>${label}</label>
		</div>
		`;
  }
  // MARK: Customer
  // ────────────────────────────────────
  customer(label) {
    label = label || `Enter the customer's name to personalize the post. Leave blank if anonymous.`;
    return `
			<div class="aai-group">
				<input name="customer_name" value="${this.data.customer_name || ""}" type="text" class="aai-input" placeholder="customer name..." />
				<label>${label}</label>
			</div>
		`;
  }
  // MARK: Products
  // ────────────────────────────────────
  products1(label) {
    return `
			<div class="aai-group">
				<input name="products" value="${this.data.products || ""}" type="text" class="aai-input" placeholder="select products..." />
				${label ? `<label>${label}</label>` : ""}
			</div>
		`;
  }
  // MARK: Products
  // ────────────────────────────────────
  products(label) {
    if (label !== false) label = label || "Relevant Products";
    setTimeout(() => {
      this.productSelect = new ProductSelect({
        label,
        container: this.target[0].querySelector(".aai-select-products-container"),
        placeholder: "search products...",
        multiple: true,
        initialIds: [DATA$3.post.id],
        onChange: (selectedIds) => {
        }
      });
    }, 10);
    return '<div class="aai-select-products-container"></div>';
  }
}
let $$2 = jQuery;
const SDK$1 = window.CopyspellAI || {};
const DATA$2 = window.copyspell_ai_admin || {};
const { __: __$2, _x: _x$1, _n: _n$1, sprintf: sprintf$1 } = wp.i18n;
let OPT = DATA$2.options || {};
const defaultPrefs = {
  group: "social",
  type: 0,
  medium: 0,
  mediumName: "Facebook Post",
  includeLinks: true,
  useEmojis: true,
  noPrices: false
};
class copyspellAIMarketing {
  // ────────────────────────────────────
  constructor(action) {
    this.prefsName = "copyspell-ai-marketing-prefs";
    this.prefs = AIH.LOCAL.get(this.prefsName);
    if (!this.prefs) {
      this.prefs = JSON.parse(JSON.stringify(defaultPrefs));
      AIH.LOCAL.set(this.prefsName, defaultPrefs);
    }
    this.prefs = { ...defaultPrefs, ...this.prefs };
    log("Marketing prefs", this.prefs);
    this.AIPanel = null;
    this.Sources = {};
    this.id = DATA$2.post.id || null;
    this.panel = null;
    this.action = action || "marketing-content";
    this.item = DATA$2.post || {};
    this.callData = {};
    this.form = {};
    this.$controls = null;
    this.$controls2 = null;
    this.$groups = null;
    this.$types = null;
    this.$result = null;
    this.extra = new MarketingExtra();
    this.resultRenderer = new MarketingResultRenderer();
    this.cur = {
      suggestion: 0
    };
    this.groups = CFG.marketing.groups;
    this.groupsShort = CFG.marketing.groupsShort;
    this.media = CFG.marketing.media;
    this.types = CFG.marketing.types;
    this.descriptions = CFG.marketing.descriptions;
    if (action === "marketing-content") this.start();
  }
  // MARK: Start
  // ────────────────────────────────────
  async start() {
    requestAnimationFrame(async () => {
      SDK$1.data.set("CopySpellCall", CopySpellCall);
      this.AISettings = await AISettings.run(
        this.action,
        __$2("Marketing Tools", "copyspell-ai")
      );
      this.panel = this.AISettings.panel;
      this.createInterface();
      this.events();
      await this.typeButtons();
      this.$description.html(`${this.types[this.prefs.group][this.prefs.type]}<span>${this.descriptions[this.prefs.group][this.prefs.type] || ""}</span>`);
      this.license = await TOOLS.loadOption("copyspell-ai-license");
      document.getElementById("copyspell-ai-metabox-app").classList.remove("aai-clicked");
    });
  }
  // MARK: Create Interface
  // ────────────────────────────────────
  createInterface() {
    this.$body = $$2(this.panel.$body);
    this.$controls2 = $$2('<div class="aai-marketing-controls-2 aai-section">').prependTo(this.$body);
    this.$controls = $$2('<div class="aai-marketing-controls aai-section">').prependTo(this.$body);
    this.$controls.html(`
			<div class="aai-marketing-groups"></div>
			<div class="aai-marketing-media"></div>
		`);
    this.$controls2.html(`
			<div class="aai-marketing-flex">
				<div class="aai-marketing-types"></div>
				<div class="aai-marketing-flex-right">
					<div class="aai-marketing-extra"></div>
					<div class="aai-flex-1"></div>
					<div class="aai-marketing-flags"></div>
					<div class="aai-bottom-flex aai-flex">
						<div class="aai-marketing-description"></div>
							<button class="aai-btn aai-btn-primary aai-marketing-create">${SVG.play} ${__$2("Create", "copyspell-ai")}</button>
					</div>
				</div>
			</div>
		`);
    this.$result = $$2('<div class="aai-marketing-result aai-section">').insertAfter(this.$controls2);
    this.$groups = this.$controls.find(".aai-marketing-groups");
    this.$media = this.$controls.find(".aai-marketing-media");
    this.$types = this.$controls2.find(".aai-marketing-types");
    this.$extra = this.$controls2.find(".aai-marketing-extra");
    this.$flags = this.$controls2.find(".aai-marketing-flags");
    this.$bottom = this.$controls2.find(".aai-bottom-flex");
    this.$description = this.$controls2.find(".aai-marketing-description");
    this.$create = this.$controls2.find(".aai-marketing-create");
    this.$extraPrompt = this.$body.find(".aai-extra-prompt-group");
    this.$bottom.before(this.$extraPrompt);
    $$2('<div class="aai-marketing-controls-3">').insertBefore(this.$result).html(
      historyButtonHTML() + this.modelSelectionDropdown({ _model: this.prefs.model })
    );
    this.flags();
  }
  // MARK: Flags
  // ────────────────────────────────────
  flags() {
    let flagHtml = `
			<div class="aai-group aai-group-checkbox">
				<input type="checkbox" class="aai-checkbox" id="use-emojis" name="useEmojis"/>
				<label class="aai-label" for="use-emojis">Use emojis</label>
			</div>
			<div class="aai-group aai-group-checkbox">
				<input type="checkbox" class="aai-checkbox" id="include-links" name="includeLinks"/>
				<label class="aai-label" for="include-links">Include links</label>
			</div>
			<div class="aai-group aai-group-checkbox">
				<input type="checkbox" class="aai-checkbox" id="no-prices" name="noPrices"/>
				<label class="aai-label" for="no-prices">Do not show prices</label>
			</div>
		`;
    this.$flags.html(flagHtml);
    if (this.prefs.useEmojis) this.$flags.find("#use-emojis").prop("checked", true);
    if (this.prefs.includeLinks) this.$flags.find("#include-links").prop("checked", true);
    if (this.prefs.noPrices) this.$flags.find("#no-prices").prop("checked", true);
    this.$flags.on("change", "input", (e) => {
      let checked = $$2(e.target).is(":checked");
      let name = $$2(e.target).attr("name");
      this.prefs[name] = checked;
      AIH.LOCAL.set("copyspell-ai-marketing-prefs", this.prefs);
      log("No prices clicked:", this.prefs);
    });
  }
  // MARK: Type Buttons
  // ────────────────────────────────────
  async typeButtons() {
    let groupButtons = "";
    for (let key in this.groups) {
      groupButtons += `<button class="aai-btn" data-type="${key}">${this.groups[key]}</button>`;
    }
    groupButtons += '<div class="aai-flex-1"></div>';
    groupButtons += await TOOLS.renderCredits();
    let mediumButtons = "";
    let i = 0;
    if (this.media[this.prefs.group]) {
      for (let medium of this.media[this.prefs.group]) {
        mediumButtons += `<button class="aai-btn medium" data-type="${i}">${medium}</button>`;
        i++;
      }
    }
    let typeButtons = "";
    i = 0;
    if (this.types[this.prefs.group]) {
      for (let type of this.types[this.prefs.group]) {
        typeButtons += `<button class="aai-btn medium" data-type="${i}">${type}</button>`;
        i++;
      }
    }
    this.$groups.html(groupButtons);
    this.$media.html(mediumButtons);
    this.$types.html(typeButtons);
    this.$groups.find(`[data-type="${this.prefs.group}"]`).addClass("aai-active");
    this.$media.find(`[data-type="${this.prefs.medium}"]`).trigger("click");
    this.$types.find(`[data-type="${this.prefs.type}"]`).trigger("click");
  }
  // MARK: Events
  // ────────────────────────────────────
  events() {
    this.$groups.off("click", "button");
    this.$groups.on("click", "button", async (e) => {
      e.preventDefault();
      e.stopPropagation();
      let $btn = $$2(e.target).closest("button.aai-btn");
      this.prefs.group = $btn.data("type");
      this.$groups.children().removeClass("aai-active");
      $btn.addClass("aai-active");
      this.prefs.medium = 0;
      this.prefs.mediumName = this.media[this.prefs.group] ? this.media[this.prefs.group][0] : "";
      this.prefs.type = 0;
      AIH.LOCAL.set("copyspell-ai-marketing-prefs", this.prefs);
      this.$description.html(`${this.types[this.prefs.group][this.prefs.type]}<span>${this.descriptions[this.prefs.group][this.prefs.type] || ""}</span>`);
      this.typeButtons();
      this.events();
    });
    this.$media.off("click", "button");
    this.$media.on("click", "button", async (e) => {
      e.preventDefault();
      e.stopPropagation();
      let $btn = $$2(e.target).closest("button.aai-btn");
      this.prefs.medium = parseInt($btn.data("type"));
      this.prefs.mediumName = $btn.text();
      AIH.LOCAL.set("copyspell-ai-marketing-prefs", this.prefs);
      this.$media.children().removeClass("aai-active");
      $btn.addClass("aai-active");
    });
    this.$types.off("click", "button");
    this.$types.on("click", "button", async (e) => {
      e.preventDefault();
      e.stopPropagation();
      let $btn = $$2(e.target).closest("button.aai-btn");
      this.prefs.type = parseInt($btn.data("type"));
      AIH.LOCAL.set("copyspell-ai-marketing-prefs", this.prefs);
      this.$types.children().removeClass("aai-active");
      $btn.addClass("aai-active");
      this.$description.html(`${this.types[this.prefs.group][this.prefs.type]}<span>${this.descriptions[this.prefs.group][this.prefs.type] || ""}</span>`);
      this.extra.render(this.prefs, this.$extra);
      this.$body.find(".aai-marketing-extra .aai-group:not(.aai-group-checkbox)").each(function() {
        const $group = $$2(this);
        const $label = $group.find("> label");
        if ($label.length && !$label.prev(".aai-help").length) {
          $$2('<span class="aai-help">').html(SVG.help).insertBefore($label).click(function(e2) {
            $label.toggle();
          });
        }
      });
      $$2(".aai-marketing-extra .aai-select-products-container").appendTo(".aai-marketing-extra");
    });
    this.$body[0].addEventListener("click", (e) => {
      if (e.target.matches(".aai-marketing-create") || e.target.matches(".aai-submit-btn")) {
        e.preventDefault();
        e.stopPropagation();
        if (e.target.disabled) return;
        e.target.disabled = true;
        this.generatePost().finally(() => {
          e.target.disabled = false;
        });
      }
    });
    this.$body[0].addEventListener("change", (e) => {
      if (e.target.matches(".aai-select-model")) {
        let model = e.target.value;
        this.prefs.model = model;
        AIH.LOCAL.set(this.prefsName, this.prefs);
        document.querySelectorAll(".aai-select-model").forEach((select) => {
          select.value = model;
        });
      }
    });
    this.$result.off("click", ".aai-create-image");
    this.$result.on("click", ".aai-create-image", async (e) => {
      e.preventDefault();
      e.stopPropagation();
      const $btn = $$2(e.target).closest(".aai-create-image");
      $btn.prop("disabled", true).html(`${SVG.loader} Creating...`);
      $btn.prop("disabled", false).html(`Create Image`);
    });
  }
  // MARK: Events Destroy
  // ────────────────────────────────────
  eventsDestroy() {
    this.$groups.replaceWith(this.$groups.cloneNode(true));
    this.$media.replaceWith(this.$media.cloneNode(true));
    this.$types.replaceWith(this.$types.cloneNode(true));
  }
  // MARK: Generate Post
  // ────────────────────────────────────
  async generatePost() {
    if (!await TOOLS.isAllowed("marketing-content")) return;
    let formData = this.AISettings.getFormData();
    let extraData = this.extra.get();
    extraData.prefs = this.prefs;
    extraData.generic = OPT.generic;
    let loadingHtml = `
		<div class="aai-call-progress loading">
			<div class="copyspell-ai-loading">
				${SVG.loader}<label>${__$2("AI analysis", "copyspell-ai")}...</label>
			</div>
			<div class="aai-processing">
				<div class="status-pulse"></div>
				<span class="status-label">thinking</span>
			</div>
			<div class="aai-output"></div>
		</div>`;
    this.$result.html(loadingHtml);
    this.$result[0].scrollIntoView({ behavior: "smooth", block: "center" });
    const response = await CopySpellCall.run({
      action: this.action,
      form: formData,
      extraData,
      onProgress: (p) => this.callProgress(p)
    });
    if (!response || response.error) return;
    this.saveRecord(response);
    SDK$1.data.set("marketing-result", response);
    try {
      await this.resultRenderer.render(response, this.prefs, this.$result);
    } catch (renderError) {
      this.callProgress({
        status: "error",
        error: __$2("There was an error rendering the result. Please try again.", "copyspell-ai")
      });
      log("❌ Error rendering marketing result:", renderError);
    }
  }
  // MARK: Save Record
  // ────────────────────────────────────
  async saveRecord(response) {
    let json = { ...response.json };
    delete json.refinementPrompts;
    await AIH.addRecord(
      0,
      response.products[0].id || 0,
      {
        _type: this.groupsShort[this.prefs.group] || "marketing",
        _action: this.action,
        meta: response.meta.model,
        api: response.meta.api,
        duration: response.meta.duration,
        prefs: this.prefs
      },
      json,
      "marketing"
      /*
      {
      	suggestions	: response.json?.suggestions?.[i] || [],
      	visualSuggestions : response.json?.visualSuggestions?.[i]  || [],
      	hashtags : response.json?.hashtags?.[i]  || [],
      }
      */
    );
  }
  // MARK: Render Result
  // ────────────────────────────────────
  renderResult(response) {
    let json = response.json || {};
    this.suggestions = JSON.parse(JSON.stringify(json.suggestions || {}));
    this.refinements = JSON.parse(JSON.stringify(json.refinementPrompts || {}));
    this.visuals = JSON.parse(JSON.stringify(json.visualSuggestions || {}));
    log("JSON", json);
    let html = this.renderResultCard(response);
    let refinement = this.renderRefinement();
    let visuals = "";
    this.$result.html(`
			<div class="aai-marketing-result-output">
				<div class="aai-flex">
					<div class="aai-marketing-cards">
						<div class="aai-marketing-cards-buttons">
							${this.suggestions.map((s, i) => `
								<button class="aai-btn medium ${this.cur.suggestion === i ? "aai-active" : ""}">version ${i + 1}</button>
							`).join("")}
						</div>
						<div class="aai-marketing-card">
							${html}
						</div>
						<div class="aai-marketing-cards-footer">
						</div>
					</div>
					<div class="aai-marketing-refine">
						${refinement}
						${visuals}
					</div>
				</div>
			</div>
		`);
    this.$card = this.$result.find(".aai-marketing-card");
    this.$refine = this.$result.find(".aai-marketing-refine");
    this.$result[0].scrollIntoView({ behavior: "smooth", block: "center" });
    this.$result.off("click", ".aai-marketing-cards-buttons button");
    this.$result.on("click", ".aai-marketing-cards-buttons button", (e) => {
      e.stopPropagation();
      e.preventDefault();
      const $btn = $$2(e.target).closest("button.aai-btn");
      this.$result.find(".aai-marketing-cards-buttons button").removeClass("aai-active");
      $btn.addClass("aai-active");
      this.cur.suggestion = parseInt($btn.index());
      let html2 = this.renderResultCard();
      let refinement2 = this.renderRefinement();
      this.$card.html(html2);
      this.$refine.html(refinement2);
    });
    this.$result.off("click", ".aai-refinement-prompts span");
    this.$result.on("click", ".aai-refinement-prompts span", (e) => {
      e.preventDefault();
      e.stopPropagation();
      const span = $$2(e.target).closest(".aai-refinement-prompts span");
      this.refine(span, json);
    });
    this.$result.off("click", ".aai-refinement-custom-submit");
    this.$result.on("click", ".aai-refinement-custom-submit", (e) => {
      e.preventDefault();
      e.stopPropagation();
      const span = $$2(e.target).closest("button").siblings("textarea");
      this.refine(span, json);
    });
    this.$result.off("click", ".aai-marketing-visuals span");
    this.$result.on("click", ".aai-marketing-visuals span", (e) => {
      e.preventDefault();
      e.stopPropagation();
      const span = $$2(e.target).closest(".aai-marketing-visuals span");
      this.createImage(span, json);
    });
  }
  // MARK: Create Image
  // ────────────────────────────────────
  async createImage(span, json) {
    let visualPrompt = span.text();
    let prompt2 = "";
    prompt2 = `Create an image for this ${this.prefs.mediumName.toLowerCase()}: ${visualPrompt}.`;
    prompt2 = `You can change everything in the image as asked in the prompt, but keep the product always visually consistent with the provided image.`;
    const response = await fetch("https://copyspell.actusanima.com/v1/image", {
      method: "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify({
        prompt: prompt2,
        model: "Lykon/DreamShaper",
        model: "google/gemini-3-pro-image"
      })
    });
    console.log("IMAGE RESPONSE", response);
    if (response.error) {
      log("❌ Error fetching credits:", response.error || "Unknown error");
      TOOLS.showNotification(response.error || "Error creating image.", "error");
      return null;
    }
    const data = await response.json();
    console.log("IMAGE RESPONSE", data);
    this.postImage = data.image || "";
    const $imageContainer = this.$result.find(".aai-card-result-image");
    $$2("<img>").attr("src", data.image).appendTo($imageContainer.empty());
  }
  // MARK: Refinement
  // ────────────────────────────────────
  renderRefinement(prompts) {
    prompts = prompts || this.refinements[this.cur.suggestion] || [];
    let HTML = `
			<div class="aai-refinement-prompts">
				<div class="aai-refinement-custom">
					<textarea class="aai-textarea" placeholder="${__$2("refine the content—what would you like different?...", "copyspell-ai")}"></textarea>
					<button class="aai-btn aai-btn-primary aai-refinement-custom-submit">${SVG.play}</button>
				</div>`;
    if (prompts) {
      prompts.forEach((prompt2) => {
        HTML += `<span class="aai-chip">${prompt2}</span>`;
      });
      HTML += `<span class="aai-chip aai-custom" alt="longer">${__$2("Make it longer", "copyspell-ai")}</span>`;
      HTML += `<span class="aai-chip aai-custom" alt="shorter">${__$2("Make it shorter", "copyspell-ai")}</span>`;
    }
    HTML += `
			</div>`;
    return HTML;
  }
  // MARK: Visuals
  // ────────────────────────────────────
  renderVisuals() {
    console.log("visuals:", this.visuals);
    let HTML = `<div class="aai-marketing-visuals">`;
    if (this.visuals.length) {
      this.visuals.forEach((prompt2) => {
        HTML += `<span class="aai-chip">${prompt2}</span>`;
      });
    }
    HTML += `
			</div>`;
    return HTML;
  }
  // MARK: Result Card
  // ────────────────────────────────────
  renderResultCard(response, postBody = "", postImage) {
    var _a, _b, _c;
    postBody = postBody || this.suggestions[this.cur.suggestion] || "";
    postImage = postImage || this.postImage || ((_c = (_b = (_a = response == null ? void 0 : response.products) == null ? void 0 : _a[0]) == null ? void 0 : _b.imageUrls) == null ? void 0 : _c[0]) || "";
    this.postImage = postImage;
    let bodyHtml = postBody;
    if (this.prefs.group === "social" || this.prefs.group === "adv") {
      bodyHtml = markdownToHTML(postBody);
    }
    let html = `
		<div class="aai-card  aai-card-result" data-group="${this.prefs.group}" data-medium="${this.prefs.mediumName.toLowerCase().replace(/ /g, "-")}">
			

			<div class="aai-card-result-header">
			
				${this.prefs.group === "blog" && postImage ? `<img class="aai-post-image" src="${postImage}" alt="Post Image">` : ""}

				${this.prefs.group === "email" ? `${SVG.email}` : ""}


				${this.prefs.group === "social" ? `${SVG.user}
					<div class="aai-card-result-user-info">
						${DATA$2.siteName || "CopySpell AI"}<br>
						
						${this.prefs.medium < 2 ? `<span>Just now</span>` : ""}

						${this.prefs.medium == 2 ? `<span>7642 followers</span><br><span>16m • 🌎</span>` : ""}

						${this.prefs.medium == 3 ? `<span>@${DATA$2.siteName.toLowerCase().replace(/ /g, "")} • 1h</span>` : ""}



					</div>` : ""}

				
			</div>

			${this.prefs.group === "social" && this.prefs.medium == 1 ? `<img class="aai-post-image" src="${postImage}" alt="Post Image"><img class="aai-insta-icons" src="/wp-content/plugins/copyspell-ai/img/insta-icons.jpg" alt="Instagram Icons">` : ""}
			

			<div class="aai-card-result-body">
				${bodyHtml}
			</div>

			<div class="aai-card-result-image">
				${this.prefs.group === "social" && postImage && (this.prefs.medium == 0 || this.prefs.medium == 2 || this.prefs.medium == 3) ? `<img src="${postImage}" alt="Post Image">` : ""}
			</div>


			<div class="aai-card-result-footer">
				${this.prefs.group === "social" && this.prefs.medium == 0 ? `<img src="/wp-content/plugins/copyspell-ai/img/facebook-footer.jpg" alt="Facebook Footer Image">` : ""}
				${this.prefs.group === "social" && this.prefs.medium == 2 ? `<img src="/wp-content/plugins/copyspell-ai/img/linkedin-footer.jpg" alt="LinkedIn Footer Image">` : ""}
				${this.prefs.group === "social" && this.prefs.medium == 3 ? `<img src="/wp-content/plugins/copyspell-ai/img/tweet-icons.jpg" alt="LinkedIn Footer Image">` : ""}
			</div>
		</div>
		`;
    return html;
  }
  // MARK: Call Progress
  // ────────────────────────────────────
  async callProgress(progress) {
    try {
      this.panel = this.AISettings.panel;
      if (!this.panel || !this.panel.$body) return;
      let output = this.$result[0].querySelector(".aai-output");
      if (progress.status === "success") {
        return;
      }
      let HTML = ``;
      if (progress.status === "processing") {
        let modelName = progress.model.replace(/-/g, " ");
        HTML += `<p class="aai-row-calling">trying with <b>${modelName}</b> @ ${progress.api}...</p>`;
      }
      if (progress.status === "processing error" || progress.status === "error") {
        if (progress.model)
          HTML += `<p class="aai-row-error">${progress.error}</p>`;
        if (progress.status === "error" && !progress.model) {
          HTML += await submitButtonHTML(__$2("Try again", "copyspell-ai"));
          HTML += modelSelectionDropdown({ _model: this.prefs.model });
          $$2(".aai-call-progress .copyspell-ai-loading").hide();
          $$2(".aai-call-progress .aai-processing").hide();
        }
      }
      if (progress.status === "server error") {
        HTML += `<p class="aai-row-error">${progress.error}</p>`;
        HTML += `<p class="aai-row-error-final">All models and providers have been tried without success.</p>`;
        HTML += submitButtonHTML(__$2("Try again", "copyspell-ai"));
        HTML += modelSelectionDropdown({ _model: this.prefs.model });
        $$2(".aai-call-progress .copyspell-ai-loading").hide();
        $$2(".aai-call-progress .aai-processing").hide();
      }
      if (output) output.insertAdjacentHTML("beforeend", HTML);
    } catch (error) {
      log("❌ Error in callProgress:", error);
    }
  }
  // MARK: Refine
  // ────────────────────────────────────
  async refine(span, meta) {
    var _a, _b;
    let $prompts = span.closest(".aai-refinement-prompts");
    if (!await TOOLS.isAllowed("marketing-refine")) return;
    $prompts.addClass("aai-loading");
    const loaderDiv = $$2('<div class="aai-loader">').html(SVG.loader7).insertAfter($prompts);
    let formData = this.AISettings.getFormData();
    let extraData = this.extra.get();
    extraData.prefs = this.prefs;
    console.log("▶ extraData:", extraData);
    const response = await CopySpellCall.run({
      action: "marketing-refine",
      form: formData,
      extraData: {
        prompt: ((_a = span.text()) == null ? void 0 : _a.trim()) || ((_b = span.val()) == null ? void 0 : _b.trim()) || "",
        content: meta.suggestions[this.cur.suggestion] || ""
      }
    });
    loaderDiv.remove();
    $prompts.removeClass("aai-loading");
    if (!response || response.error) {
      $prompts.html(`<div class="aai-error-message">${(response == null ? void 0 : response.error) || "Error"}</div>`);
      return;
    }
    this.finalizeRefinement(response);
    return response.json || response;
  }
  // MARK: Finalize Refinement
  // ────────────────────────────────────
  finalizeRefinement(response) {
    var _a;
    this.suggestions[this.cur.suggestion] = ((_a = response.json) == null ? void 0 : _a.content) || this.suggestions[this.cur.suggestion];
    this.refinements[this.cur.suggestion] = response.refinementPrompts || this.refinements[this.cur.suggestion];
    let html = this.renderResultCard(response);
    let refinement = this.renderRefinement();
    this.$card.html(html);
    this.$refine.html(refinement);
  }
}
copyspellAIMarketing.prototype.modelSelectionDropdown = modelSelectionDropdown;
copyspellAIMarketing.prototype.loadingState = loadingState;
let $$1 = jQuery;
const SDK = window.CopyspellAI || {};
const DATA$1 = window.copyspell_ai_admin || {};
const { __: __$1, _x, _n, sprintf } = wp.i18n;
TOOLS.loadCSS(`source-preview.css?v=${DATA$1.version}`);
TOOLS.loadCSS(`seo.css?v=${DATA$1.version}`);
class CopyspellEdit {
  // ────────────────────────────────────
  constructor() {
    this.init();
  }
  // MARK: Init
  // ────────────────────────────────────
  init() {
    this.copySpellButtons();
    document.querySelectorAll("#copyspell-ai-metabox-app .aai-btn").forEach((btn) => btn.classList.remove("aai-disabled"));
    this.titleAIButton();
    setTimeout(() => {
      if (document.querySelector("#poststuff #postdivrich .postbox-header")) {
        this.descriptionAIButton();
      } else {
        setTimeout(() => {
          this.descriptionAIButton();
        }, 500);
      }
    }, 500);
    this.excerptAIButton();
  }
  // MARK: AI buttons
  // ────────────────────────────────────
  copySpellButtons() {
    SDK.ui.renderSlots();
    const metabox = document.getElementById("copyspell-ai-metabox-app");
    document.getElementById("copyspell-ai-generate-content").addEventListener("click", async (e) => {
      metabox.classList.add("aai-clicked");
      new copyspellAIContent("product-content");
    });
    document.getElementById("copyspell-ai-generate-marketing").addEventListener("click", async (e) => {
      metabox.classList.add("aai-clicked");
      new copyspellAIMarketing("marketing-content");
    });
  }
  // MARK: SEO report render
  // ────────────────────────────────────
  seoReportRender(response) {
    response.json || {};
    const modal = document.createElement("div");
    modal.className = "source-preview-modal";
    modal.innerHTML = `
			<div class="source-preview-backdrop"></div>
			<div class="source-preview-container">
				<div class="source-preview-header">
					<div class="source-preview-title">
						<span>${__$1("SEO Report", "copyspell-ai")}</span>
					</div>
					<button class="source-preview-close">&times;</button>
				</div>
				<div class="source-preview-content">
					${response.content}
				</div>
				<div class="source-preview-footer">
					<button class="aai-btn aai-btn-secondary aai-cancel">${__$1("Cancel", "copyspell-ai")}</button>
					<button class="aai-btn aai-btn-primary aai-save-changes">${__$1("Save", "copyspell-ai")}</button>
				</div>
			</div>
		`;
    document.body.appendChild(modal);
    setTimeout(() => {
      modal.classList.add("active");
    }, 10);
  }
  // MARK: Title button
  // ────────────────────────────────────
  titleAIButton() {
    const aiButton = document.createElement("button");
    aiButton.type = "button";
    aiButton.className = "aai-title-ai-button";
    aiButton.innerHTML = `
			<img src="${DATA$1.logo}" alt="CopySpell AI Logo">
		`;
    const titleWrap = document.querySelector("#poststuff #titlewrap");
    if (titleWrap) {
      titleWrap.appendChild(aiButton);
    }
    aiButton.addEventListener("click", async (e) => {
      e.preventDefault();
      this.titleAIpop();
    });
  }
  // MARK: Title popover
  // ────────────────────────────────────
  async titleAIpop() {
    const existingPop = document.querySelector(".aai-title-ai-pop");
    if (existingPop) {
      existingPop.remove();
      return;
    }
    const titleAIPop = document.createElement("div");
    titleAIPop.className = "aai-ai-pop aai-title-ai-pop";
    titleAIPop.innerHTML = `
			<div class="aai-buttons">
				<div class="aai-button aai-button-2">${__$1("Suggest 5 titles", "copyspell-ai")}</div>
				<div class="aai-button aai-button-1">${SVG.gear}</div>
			</div>
		`;
    const titleWrap = document.querySelector("#poststuff #titlewrap");
    titleWrap.insertAdjacentElement("afterend", titleAIPop);
    const buttonsDiv = titleAIPop.querySelector(".aai-buttons");
    const button1 = titleAIPop.querySelector(".aai-button-1");
    const button2 = titleAIPop.querySelector(".aai-button-2");
    button1.addEventListener("click", async () => {
      AISettings.run("product-suggest");
    });
    button2.addEventListener("click", async () => {
      if (!await TOOLS.isAllowed("product-suggest-titles")) return;
      buttonsDiv.innerHTML = `<div class="copyspell-ai-loading"><span>${__$1("thinking", "copyspell-ai")}...</span>${SVG.loader14}</div>`;
      let responseMeta;
      if (!DATA$1.sample_call) {
        responseMeta = await copyspellAIContent.suggest("titles");
      } else {
        responseMeta = sampleTitles;
      }
      if (!responseMeta || responseMeta.error) {
        buttonsDiv.innerHTML = `<div class="aai-error-message">${(responseMeta == null ? void 0 : responseMeta.error) || "Error"}</div>`;
        return;
      }
      this.titleAIResult(responseMeta, titleAIPop);
    });
  }
  // MARK: Title result
  // ────────────────────────────────────
  async titleAIResult(responseMeta, titleAIPop) {
    titleAIPop.innerHTML = `
			<div class="aai-pop-suggestions aai-pop-suggested-titles">
				<ul>
					${responseMeta.suggestions.map((s) => `<li class="aai-pop-suggestion aai-pop-suggested-title">${s}</li>`).join("")}
				</ul>
			</div>
		`;
    const suggestedTitles = titleAIPop.querySelectorAll(".aai-pop-suggested-title");
    suggestedTitles.forEach((title) => {
      title.addEventListener("click", function() {
        const titleInput = document.querySelector("#poststuff #titlewrap input#title");
        titleInput.value = this.textContent;
        titleInput.dispatchEvent(new Event("input"));
      });
    });
  }
  // MARK: Description button
  // ────────────────────────────────────
  descriptionAIButton() {
    const aiButton = document.createElement("button");
    aiButton.type = "button";
    aiButton.className = "aai-descr-ai-button";
    aiButton.innerHTML = `
			<img src="${DATA$1.logo}" alt="CopySpell AI Logo">
		`;
    const postboxHeader = document.querySelector("#poststuff #postdivrich .postbox-header");
    if (postboxHeader) {
      postboxHeader.appendChild(aiButton);
    }
    aiButton.addEventListener("click", async (e) => {
      e.preventDefault();
      this.descriptionAIpop();
    });
  }
  // MARK: Description popover
  // ────────────────────────────────────
  async descriptionAIpop() {
    const existingPop = document.querySelector(".aai-description-ai-pop");
    if (existingPop) {
      existingPop.remove();
      return;
    }
    const descriptionAIPop = document.createElement("div");
    descriptionAIPop.className = "aai-ai-pop aai-description-ai-pop";
    descriptionAIPop.innerHTML = `
			<div class="aai-buttons">
				<input class="aai-input small" placeholder="what would you like different?">
				<div class="aai-button-4">${SVG.play}</div>
				<div class="aai-button aai-button-2">${__$1("Suggest 2 descriptions", "copyspell-ai")}</div>
				<div class="aai-button aai-button-1">${SVG.gear}</div>
			</div>
		`;
    const postdivrich = document.querySelector("#poststuff #postdivrich");
    postdivrich.parentNode.insertBefore(descriptionAIPop, postdivrich);
    descriptionAIPop.querySelector(".aai-button-1").addEventListener("click", async () => {
      AISettings.run("product-suggest");
    });
    descriptionAIPop.querySelector(".aai-button-4").addEventListener("click", async (e) => {
      const userPrompt = e.currentTarget.parentElement.querySelector(".aai-input").value.trim();
      if (!userPrompt) return;
      if (!await TOOLS.isAllowed("product-change")) return;
      descriptionAIPop.querySelector(".aai-buttons").innerHTML = `<div class="copyspell-ai-loading"><span>${__$1("thinking", "copyspell-ai")}...</span>${SVG.loader14}</div>`;
      let response = await this.customChangeCall(userPrompt);
      if (!response || response.error) {
        descriptionAIPop.querySelector(".aai-buttons").innerHTML = `<div class="aai-error-message">${(response == null ? void 0 : response.error) || "Error"}</div>`;
        return;
      }
      this.customChangeResult(response);
    });
    descriptionAIPop.querySelector(".aai-button-2").addEventListener("click", async () => {
      if (!await TOOLS.isAllowed("product-suggest-descriptions")) return;
      descriptionAIPop.querySelector(".aai-buttons").innerHTML = `<div class="copyspell-ai-loading"><span>${__$1("thinking", "copyspell-ai")}...</span>${SVG.loader14}</div>`;
      let responseMeta;
      if (!DATA$1.sample_call) {
        responseMeta = await copyspellAIContent.suggest("descriptions");
      } else {
        responseMeta = sampleDescriptions;
      }
      if (!responseMeta || responseMeta.error) {
        descriptionAIPop.querySelector(".aai-buttons").innerHTML = `<div class="aai-error-message">${(responseMeta == null ? void 0 : responseMeta.error) || "Error"}</div>`;
        return;
      }
      this.descriptionAIResult(responseMeta, descriptionAIPop);
    });
  }
  // MARK: Description result
  // ────────────────────────────────────
  async descriptionAIResult(responseMeta, descriptionAIPop) {
    descriptionAIPop.innerHTML = `
			<div class="aai-pop-suggestions aai-pop-suggested-descriptions">
				${responseMeta.suggestions.map((s) => `<div class="aai-pop-suggestion aai-pop-suggested-description">${s}</div>`).join("")}
			</div>
			<div class="aai-pop-controls">
				<div class="aai-pop-controls-left">
					<div class="aai-btn aai-btn-outline medium aai-pop-sug-1 active" alt="0">Suggestion 1</div>
					<div class="aai-btn aai-btn-outline medium aai-pop-sug-2" alt="1">Suggestion 2</div>
				</div>
				<div class="aai-pop-controls-right">
					<div class="aai-btn aai-btn-primary medium aai-pop-cancel">Cancel</div>
					<div class="aai-btn aai-btn-primary medium aai-pop-refine">Refine</div>
					<div class="aai-btn aai-btn-primary medium aai-pop-select">Select</div>
				</div>
			</div>
		`;
    descriptionAIPop.querySelector(".aai-pop-suggested-description:nth-child(1)").classList.add("active");
    descriptionAIPop.scrollIntoView({ behavior: "smooth", block: "center" });
    descriptionAIPop.querySelector(".aai-pop-cancel").addEventListener("click", async () => {
      descriptionAIPop.remove();
    });
    descriptionAIPop.querySelector(".aai-pop-refine").addEventListener("click", async () => {
      this.refinementPrompts(responseMeta, (result) => {
        responseMeta = result;
      });
    });
    descriptionAIPop.querySelector(".aai-pop-select").addEventListener("click", async () => {
      this.setProductDescription(descriptionAIPop.querySelector(".aai-pop-suggested-description.active").innerHTML);
      const postdivrich = document.querySelector("#postdivrich");
      window.scrollTo({
        top: postdivrich.offsetTop - 50,
        behavior: "smooth"
      });
    });
    descriptionAIPop.querySelectorAll(".aai-pop-controls-left .aai-btn").forEach((btn) => {
      btn.addEventListener("click", async function() {
        const refinementPop = document.querySelector(".aai-refinement-pop");
        if (refinementPop) refinementPop.remove();
        const selection = this.classList.contains("aai-pop-sug-1") ? 1 : 2;
        this.parentElement.querySelectorAll(".aai-btn").forEach((btn2) => btn2.classList.remove("active"));
        this.classList.add("active");
        descriptionAIPop.querySelectorAll(".aai-pop-suggested-description").forEach((desc) => desc.classList.remove("active"));
        descriptionAIPop.querySelector(`.aai-pop-suggested-description:nth-child(${selection})`).classList.add("active");
      });
    });
  }
  // MARK: excerpt button
  // ────────────────────────────────────
  excerptAIButton() {
    const aiButton = document.createElement("button");
    aiButton.type = "button";
    aiButton.className = "aai-excerpt-ai-button";
    aiButton.innerHTML = `
			<img src="${DATA$1.logo}" alt="CopySpell AI Logo">
		`;
    const excerptHeader = document.querySelector("#poststuff #postexcerpt .postbox-header");
    if (excerptHeader) {
      excerptHeader.appendChild(aiButton);
    }
    aiButton.addEventListener("click", async (e) => {
      e.preventDefault();
      this.excerptAIpop();
    });
  }
  // MARK: excerpt popover
  // ────────────────────────────────────
  async excerptAIpop() {
    const existingPop = document.querySelector(".aai-excerpt-ai-pop");
    if (existingPop) {
      existingPop.remove();
      return;
    }
    const excerptAIPop = document.createElement("div");
    excerptAIPop.className = "aai-ai-pop aai-excerpt-ai-pop";
    excerptAIPop.innerHTML = `
			<div class="aai-buttons">
				<div class="aai-button aai-button-2">${__$1("Suggest 3 short descriptions", "copyspell-ai")}</div>
				<div class="aai-button aai-button-1">${SVG.gear}</div>
			</div>
		`;
    const postexcerpt = document.querySelector("#poststuff #postexcerpt");
    postexcerpt.parentNode.insertBefore(excerptAIPop, postexcerpt);
    excerptAIPop.querySelector(".aai-button-1").addEventListener("click", async () => {
      AISettings.run("product-suggest");
    });
    excerptAIPop.querySelector(".aai-button-2").addEventListener("click", async () => {
      if (!await TOOLS.isAllowed("product-suggest-excerpts")) return;
      excerptAIPop.querySelector(".aai-buttons").innerHTML = `<div class="copyspell-ai-loading"><span>${__$1("thinking", "copyspell-ai")}...</span>${SVG.loader14}</div>`;
      let responseMeta;
      if (!DATA$1.sample_call) {
        responseMeta = await copyspellAIContent.suggest("excerpts");
      } else {
        responseMeta = sampleExcerpts;
      }
      if (!responseMeta || responseMeta.error) {
        excerptAIPop.querySelector(".aai-buttons").innerHTML = `<div class="aai-error-message">${(responseMeta == null ? void 0 : responseMeta.error) || "Error"}</div>`;
        return;
      }
      this.excerptAIResult(responseMeta, excerptAIPop);
    });
  }
  // MARK: excerpt result
  // ────────────────────────────────────
  excerptAIResult(responseMeta, excerptAIPop) {
    excerptAIPop.innerHTML = `
			<div class="aai-pop-suggestions aai-pop-suggested-excerpts">
				<ul>
					${responseMeta.suggestions.map((s) => `<li class="aai-pop-suggestion aai-pop-suggested-excerpt">${s}</li>`).join("")}
				</ul>
			</div>
		`;
    excerptAIPop.querySelectorAll(".aai-pop-suggested-excerpt").forEach((excerpt) => {
      excerpt.addEventListener("click", () => {
        this.setProductExcerpt(excerpt.innerHTML);
      });
    });
  }
  // MARK: Custom Change Call
  // ────────────────────────────────────
  async customChangeCall(prompt2, content) {
    let response = await copyspellAIContent.change(prompt2, content);
    if (!response || response.error) {
      return response || { error: "Error" };
    }
    return response;
  }
  // MARK: Custom Change Result
  // ────────────────────────────────────
  async customChangeResult(response) {
    const descriptionAIPop = document.querySelector(".aai-description-ai-pop");
    descriptionAIPop.innerHTML = `
			<div class="aai-pop-suggestions aai-pop-changed-content">
				<div class="aai-pop-suggestion aai-pop-suggested-description">${response.content}</div>
			</div>
			<div class="aai-pop-controls">
				<div class="aai-pop-controls-left">
				<div class="aai-custom-refine">
					<input class="aai-input small" placeholder="what would you like different?">
					<div class="aai-button-4">${SVG.play}</div>
				</div>
				</div>
				<div class="aai-pop-controls-right">
					<div class="aai-btn aai-btn-primary medium aai-pop-cancel">Cancel</div>
					<div class="aai-btn aai-btn-primary medium aai-pop-select">Keep</div>
				</div>
			</div>
		`;
    descriptionAIPop.scrollIntoView({ behavior: "smooth", block: "center" });
    descriptionAIPop.querySelector(".aai-pop-cancel").addEventListener("click", async () => {
      document.querySelector(".aai-description-ai-pop").remove();
    });
    descriptionAIPop.querySelector(".aai-pop-select").addEventListener("click", async () => {
      this.setProductDescription(document.querySelector(".aai-pop-suggested-description").innerHTML);
      const postdivrich = document.querySelector("#postdivrich");
      window.scrollTo({
        top: postdivrich.offsetTop - 50,
        behavior: "smooth"
      });
      document.querySelector(".aai-description-ai-pop").remove();
    });
    descriptionAIPop.querySelector(".aai-custom-refine .aai-button-4").addEventListener("click", async (e) => {
      const userPrompt = e.currentTarget.parentElement.querySelector(".aai-input").value.trim();
      if (!userPrompt) return;
      if (!await TOOLS.isAllowed("product-change")) return;
      document.querySelector(".aai-description-ai-pop").innerHTML = `<div class="aai-buttons"><div class="copyspell-ai-loading"><span>${__$1("thinking", "copyspell-ai")}...</span>${SVG.loader14}</div></div>`;
      descriptionAIPop.scrollIntoView({ behavior: "smooth", block: "center" });
      let newResponse = await this.customChangeCall(userPrompt, response.content);
      if (!newResponse || newResponse.error) {
        document.querySelector(".aai-description-ai-pop").querySelector(".aai-buttons").innerHTML = `<div class="aai-error-message">${(newResponse == null ? void 0 : newResponse.error) || "Error"}</div>`;
        return;
      }
      this.customChangeResult(newResponse);
    });
  }
  // MARK: Set Product Description
  // ────────────────────────────────────
  setProductDescription(htmlContent) {
    if (typeof tinymce !== "undefined" && tinymce.get("content")) {
      tinymce.get("content").setContent(htmlContent);
      tinymce.get("content").fire("change");
    } else if (wp.data && wp.data.dispatch("core/editor")) {
      wp.data.dispatch("core/editor").editPost({
        content: htmlContent
      });
    } else {
      const contentElement = document.getElementById("content_ifr");
      if (contentElement) {
        contentElement.value = htmlContent;
        contentElement.dispatchEvent(new Event("input"));
      }
    }
  }
  // MARK: Set product excerpt
  // ────────────────────────────────────
  setProductExcerpt(htmlContent) {
    if (typeof tinymce !== "undefined" && tinymce.get("excerpt")) {
      tinymce.get("excerpt").setContent(htmlContent);
      tinymce.get("excerpt").fire("change");
    } else if (wp.data && wp.data.dispatch("core/editor")) {
      wp.data.dispatch("core/editor").editPost({
        excerpt: htmlContent
      });
    } else {
      $$1("#excerpt").val(htmlContent);
      $$1("#excerpt").trigger("input");
    }
  }
  // MARK: Refinement Prompts
  // ────────────────────────────────────
  refinementPrompts(responseData, callback) {
    callback = callback || function() {
    };
    const existingPop = document.querySelector(".aai-refinement-pop");
    if (existingPop) {
      existingPop.remove();
      return;
    }
    const activeBtn = document.querySelector(".aai-pop-controls-left .aai-btn.active");
    let index = parseInt(activeBtn.getAttribute("alt"));
    let prompts = responseData.refinementPrompts ? responseData.refinementPrompts[index] : [];
    let suggestion = responseData.suggestions ? responseData.suggestions[index] : "";
    const refinementPop = document.createElement("div");
    refinementPop.className = "aai-refinement-pop";
    refinementPop.innerHTML = this.refinementPromptsHTML(prompts);
    const suggestionsContainer = document.querySelector(".aai-pop-suggested-descriptions");
    suggestionsContainer.insertAdjacentElement("afterend", refinementPop);
    const promptSpans = refinementPop.querySelectorAll("span");
    promptSpans.forEach((span) => {
      span.addEventListener("click", async (e) => {
        e.stopPropagation();
        let result = await this.refineSuggestion(span, suggestion);
        callback(result);
      });
    });
  }
  // MARK: Refine suggestion
  // ────────────────────────────────────
  async refineSuggestion(span, suggestion) {
    let userPrompt = "";
    if (span.getAttribute("alt") === "custom") {
      let customPrompt = await customRefinement();
      if (!customPrompt) return;
      userPrompt = customPrompt;
    } else {
      userPrompt = span.textContent.trim();
    }
    if (!await TOOLS.isAllowed("product-refine")) return;
    document.querySelector(".aai-refinement-pop").innerHTML = `<div class="copyspell-ai-loading"><span>${__$1("thinking", "copyspell-ai")}...</span>${SVG.loader14}</div>`;
    let response = await copyspellAIContent.refine(userPrompt, suggestion);
    if (!response || response.error) {
      document.querySelector(".aai-refinement-pop").innerHTML = `<div class="aai-error-message">${response.error || "Error refining suggestion. Please try again."}</div>`;
      return;
    }
    this.finalizeRefinement(response);
  }
  // MARK: Finalize Refinement
  // ────────────────────────────────────
  finalizeRefinement(response) {
    let suggestion = response.content || "";
    document.querySelector(".aai-pop-suggested-description.active").innerHTML = suggestion;
    const refinementPop = document.querySelector(".aai-refinement-pop");
    refinementPop.innerHTML = this.refinementPromptsHTML(response.refinementPrompts);
    const promptSpans = refinementPop.querySelectorAll("span");
    promptSpans.forEach((span) => {
      span.addEventListener("click", async (e) => {
        e.stopPropagation();
        await this.refineSuggestion(span, suggestion);
      });
    });
  }
  // MARK: Refinement Prompts HTML
  // ────────────────────────────────────
  refinementPromptsHTML(prompts) {
    let HTML = `
			<div class="aai-refinement-prompts">`;
    if (prompts) {
      prompts.forEach((prompt2) => {
        HTML += `<span class="aai-chip">${prompt2}</span>`;
      });
      HTML += `<span class="aai-chip aai-custom" alt="longer">${__$1("Make it longer", "copyspell-ai")}</span>`;
      HTML += `<span class="aai-chip aai-custom" alt="shorter">${__$1("Make it shorter", "copyspell-ai")}</span>`;
      HTML += `<span class="aai-chip aai-custom" alt="custom">${__$1("Custom changes", "copyspell-ai")}</span>`;
    }
    HTML += `
			</div>`;
    return HTML;
  }
}
jQuery;
const DATA = window.copyspell_ai_admin || {};
const { __ } = wp.i18n;
log("DATA", DATA);
if (typeof jQuery !== "undefined") {
  IFC.init();
} else {
  console.warn("WordPress dependencies not available");
}
document.addEventListener("DOMContentLoaded", async () => {
  window.CopyspellAI.initExtensions(window.CopyspellAI);
  log("Extensions", window.CopyspellAI.getExtensions());
  if (window.pagenow === "product" && window.typenow === "product") {
    new CopyspellEdit();
  }
});
