'use strict';

Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });

const shared_tailwindElement_index = require('../../index-179a633e.cjs');
const queryAssignedElements = require('../../query-assigned-elements-d5e45650.cjs');

const style = ":host {\n    display: inline-flex\n}";

var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __decorateClass = (decorators, target, key, kind) => {
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
    if (decorator = decorators[i])
      result = (kind ? decorator(target, key, result) : decorator(result)) || result;
  if (kind && result)
    __defProp(target, key, result);
  return result;
};
exports.LuksoShare = class LuksoShare extends shared_tailwindElement_index.TailwindStyledElement(style) {
  constructor() {
    super(...arguments);
    this.customStyle = "";
    this.providers = "";
    this.defaultProviders = [
      "twitter",
      "instagram",
      "linkedin",
      "telegram",
      "discord",
      "reddit",
      "medium",
      "github"
    ];
    this.defaultProviderLinks = {
      twitter: "https://twitter.com/ERC725Account",
      instagram: "https://www.instagram.com/lukso",
      linkedin: "https://linkedin.com/company/lukso",
      telegram: "https://t.me/LUKSO_News",
      discord: "https://discord.gg/lukso",
      reddit: "https://www.reddit.com/r/lukso",
      medium: "https://medium.com/lukso",
      github: "https://github.com/lukso-network"
    };
  }
  linkTemplate(name, url) {
    return shared_tailwindElement_index.x`<a
      href=${url}
      target="_blank"
      class="transition-all duration-300 rounded-full opacity-50 hover:opacity-80 hover:shadow-button-medium-hover-primary h-7 w-7"
      ><img src="/assets/images/social-${name}.svg" alt=""
    /></a>`;
  }
  render() {
    const linkTemplates = [];
    let providers = this.defaultProviders;
    try {
      providers = JSON.parse(this.providers);
    } catch (error) {
    }
    for (const provider of providers) {
      if (typeof provider === "string") {
        linkTemplates.push(
          this.linkTemplate(provider, this.defaultProviderLinks[provider])
        );
      } else {
        linkTemplates.push(this.linkTemplate(provider.name, provider.url));
      }
    }
    return shared_tailwindElement_index.x`<div
      class="grid gap-2 sm:gap-4"
      style="grid-template-columns: repeat(${providers.length}, max-content); ${this.customStyle}"
    >
      ${linkTemplates}
    </div>`;
  }
};
__decorateClass([
  queryAssignedElements.n({ type: String, attribute: "custom-style" })
], exports.LuksoShare.prototype, "customStyle", 2);
__decorateClass([
  queryAssignedElements.n({ type: String })
], exports.LuksoShare.prototype, "providers", 2);
exports.LuksoShare = __decorateClass([
  queryAssignedElements.e("lukso-share")
], exports.LuksoShare);
