'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var vue = require('vue');
var TsIcon = require('./TsIcon.js');
var TsAvatar = require('./TsAvatar.js');
var normalText = require('./normalText-7b937f11.js');
require('./TsImageLoader.js');

var script = vue.defineComponent({
    components: {
        TsIcon: TsIcon["default"],
        TsAvatar: TsAvatar["default"],
        TsNormalText: normalText.script,
    },
    props: {
        users: {
            type: Object,
            required: true,
        },
        paidUsers: {
            type: [],
            required: false,
        },
        hasRemove: {
            type: Boolean,
            default: false,
        },
    },
    name: "TsUsersList",
    setup() {
        const avatarColors = [
            "bg-primaryPurple",
            "bg-primaryGreen",
            "bg-primaryOrange",
            "bg-primaryBlue",
        ];
        return {
            avatarColors,
        };
    },
});

const _hoisted_1 = { class: "flex flex-col space-y-2 w-full" };
const _hoisted_2 = { class: "flex flex-row items-center space-x-2" };
const _hoisted_3 = { class: "flex flex-row space-x-2 items-center" };
const _hoisted_4 = /*#__PURE__*/vue.createElementVNode("span", {
  class: /*#__PURE__*/vue.normalizeClass(`h-[4px] w-[4px] bg-paragraphTextLight rounded-full`)
}, null, -1 /* HOISTED */);
const _hoisted_5 = /*#__PURE__*/vue.createTextVNode(" Pay ");

function render(_ctx, _cache, $props, $setup, $data, $options) {
  const _component_ts_avatar = vue.resolveComponent("ts-avatar");
  const _component_ts_normal_text = vue.resolveComponent("ts-normal-text");
  const _component_ts_icon = vue.resolveComponent("ts-icon");

  return (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
    (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.users, (user, index) => {
      return (vue.openBlock(), vue.createElementBlock("div", {
        class: "flex flex-row items-center space-x-2 justify-between",
        key: index
      }, [
        vue.createElementVNode("div", _hoisted_2, [
          vue.createVNode(_component_ts_avatar, {
            bgColor: 
            _ctx.avatarColors[Math.floor(Math.random() * _ctx.avatarColors.length)]
          ,
            customClass: 'text-white',
            photoUrl: user.bio.photo?.link || '',
            size: '25'
          }, {
            default: vue.withCtx(() => [
              vue.createTextVNode(vue.toDisplayString(user.bio.name.first.charAt(0)), 1 /* TEXT */)
            ]),
            _: 2 /* DYNAMIC */
          }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["bgColor", "photoUrl"]),
          vue.createElementVNode("div", _hoisted_3, [
            vue.createVNode(_component_ts_normal_text, null, {
              default: vue.withCtx(() => [
                vue.createTextVNode(vue.toDisplayString(user.bio.name.full), 1 /* TEXT */)
              ]),
              _: 2 /* DYNAMIC */
            }, 1024 /* DYNAMIC_SLOTS */),
            (!_ctx.hasRemove)
              ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
                  vue.createElementVNode("span", {
                    class: vue.normalizeClass(`h-[4px] w-[4px] ${
                _ctx.paidUsers?.includes(user.id)
                  ? 'bg-primaryGreen'
                  : 'bg-errorColor'
              }  rounded-full`)
                  }, null, 2 /* CLASS */),
                  vue.createVNode(_component_ts_normal_text, {
                    color: `${
                _ctx.paidUsers?.includes(user.id)
                  ? 'text-primaryGreen'
                  : 'text-errorColor'
              }`
                  }, {
                    default: vue.withCtx(() => [
                      vue.createTextVNode(vue.toDisplayString(_ctx.paidUsers?.includes(user.id) ? "Paid" : "Unpaid"), 1 /* TEXT */)
                    ]),
                    _: 2 /* DYNAMIC */
                  }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["color"]),
                  (!_ctx.paidUsers?.includes(user.id))
                    ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
                        _hoisted_4,
                        vue.createVNode(_component_ts_normal_text, { color: 'text-primaryPurple' }, {
                          default: vue.withCtx(() => [
                            _hoisted_5
                          ]),
                          _: 1 /* STABLE */
                        })
                      ], 64 /* STABLE_FRAGMENT */))
                    : vue.createCommentVNode("v-if", true)
                ], 64 /* STABLE_FRAGMENT */))
              : vue.createCommentVNode("v-if", true)
          ])
        ]),
        (_ctx.hasRemove)
          ? (vue.openBlock(), vue.createBlock(_component_ts_icon, {
              key: 0,
              name: "remove",
              customClass: 'h-[15px]'
            }))
          : vue.createCommentVNode("v-if", true)
      ]))
    }), 128 /* KEYED_FRAGMENT */))
  ]))
}

script.render = render;
script.__file = "src/components/TsUsersList/index.vue";

exports["default"] = script;
