'use strict';

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

var vue = require('vue');
var TsImageLoader = require('./TsImageLoader.js');
var TsRatings = require('./TsRatings.js');
var headerText = require('./headerText-2eeecf55.js');
var paragraphText = require('./paragraphText-6f209f78.js');
var TsIcon = require('./TsIcon.js');
var TsButton = require('./TsButton.js');
var index = require('./index-293bcbe3.js');
require('./_commonjsHelpers-b3309d7b.js');
require('http');
require('https');
require('stream');
require('assert');
require('tty');
require('util');
require('os');
require('has-flag');
require('zlib');
require('form-data');

var script = vue.defineComponent({
    components: {
        TsIcon: TsIcon["default"],
        TsImageLoader: TsImageLoader["default"],
        TsHeaderText: headerText.script,
        TsRatings: TsRatings["default"],
        TsParagraphText: paragraphText.script,
        TsButton: TsButton["default"],
    },
    props: {
        data: {
            type: Object,
        },
        showSaved: {
            type: Boolean,
            default: false,
        },
        isSaved: {
            type: Boolean,
            default: false,
        },
        saveTutor: {
            type: Function,
            required: false,
        },
    },
    name: "TsTutorCard",
    setup() {
        const avatarColors = [
            "bg-primaryPurple",
            "bg-primaryGreen",
            "bg-primaryOrange",
            "bg-primaryBlue",
        ];
        return {
            avatarColors,
            Logic: index.Logic,
        };
    },
});

const _hoisted_1 = { class: "flex pt-3 px-3 mdlg:!pt-0 mdlg:px-0 mdlg:py-0 flex-row space-x-2 mdlg:items-start lg:items-start items-center lg:w-[16%] mdlg:w-[18%] sm:w-full" };
const _hoisted_2 = {
  key: 0,
  class: "text-white text-[18px] font-bold"
};
const _hoisted_3 = /*#__PURE__*/vue.createElementVNode("span", { class: "mdlg:!h-[16px] mdlg:!w-[16px] h-[13px] w-[13px] bg-onlineGreen rounded-full absolute z-10 right-0 mdlg:bottom-[6px] bottom-[4px]" }, null, -1 /* HOISTED */);
const _hoisted_4 = { class: "flex mdlg:hidden lg:hidden flex-col space-y-1 items-start" };
const _hoisted_5 = { class: "flex flex-row items-center space-x-1" };
const _hoisted_6 = /*#__PURE__*/vue.createTextVNode(" $22 per hour ");
const _hoisted_7 = { class: "flex flex-col space-y-1 items-start px-3 mdlg:px-2 lg:w-[69%] mdlg:w-[67%] sm:w-full" };
const _hoisted_8 = { class: "flex-row items-center space-x-1 hidden mdlg:!flex" };
const _hoisted_9 = { class: "flex flex-row items-center space-x-2 text-xs" };
const _hoisted_10 = { class: "flex flex-row items-center space-x-2" };
const _hoisted_11 = /*#__PURE__*/vue.createElementVNode("span", { class: "h-[4px] w-[4px] bg-paragraphTextLight rounded-full" }, null, -1 /* HOISTED */);
const _hoisted_12 = { class: "flex flex-col space-y-1 mdlg:justify-between items-end mdlg:!w-[15%] lg:!w-[15%] w-full" };
const _hoisted_13 = /*#__PURE__*/vue.createTextVNode(" $22 per hour ");
const _hoisted_14 = { class: "mdlg:flex mdlg:flex-col grid grid-cols-12 mdlg:space-y-2 mdlg:!gap-0 gap-2 mdlg:pt-2 mdlg:!px-0 px-3 mdlg:w-auto lg:w-auto mdlg:!pb-0 pt-2 pb-3 w-full" };
const _hoisted_15 = /*#__PURE__*/vue.createTextVNode(" Book private ");
const _hoisted_16 = /*#__PURE__*/vue.createTextVNode(" Book shared ");

function render(_ctx, _cache, $props, $setup, $data, $options) {
  const _component_ts_image_loader = vue.resolveComponent("ts-image-loader");
  const _component_ts_header_text = vue.resolveComponent("ts-header-text");
  const _component_ts_icon = vue.resolveComponent("ts-icon");
  const _component_ts_ratings = vue.resolveComponent("ts-ratings");
  const _component_ts_paragraph_text = vue.resolveComponent("ts-paragraph-text");
  const _component_ts_button = vue.resolveComponent("ts-button");

  return (_ctx.data)
    ? (vue.openBlock(), vue.createElementBlock("div", {
        key: 0,
        onClick: _cache[4] || (_cache[4] = $event => (_ctx.Logic.common.GoToRoute('/tutors/' + _ctx.data?.id))),
        class: "w-full flex flex-row flex-wrap mdlg:space-x-0 space-x-0 justify-between rounded border-[1px] border-gray-200 lg:py-5 lg:px-5 mdlg:py-4 mdlg:px-4 md:px-3 md:py-3"
      }, [
        vue.createElementVNode("div", _hoisted_1, [
          vue.createVNode(_component_ts_image_loader, {
            "custom-class": `mdlg:!h-[120px] mdlg:!w-[130px] h-[80px] w-[80px] mdlg:!rounded-br-[40px] ${
          _ctx.avatarColors[Math.floor(Math.random() * _ctx.avatarColors.length)]
        } !rounded-br-[30px]  rounded relative flex text-xs font-semibold flex-row items-center justify-center`,
            "photo-url": _ctx.data.bio.photo?.link || ''
          }, {
            default: vue.withCtx(() => [
              (!_ctx.data.bio.photo?.link)
                ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2, vue.toDisplayString(Array.from(_ctx.data.bio.name.first)[0].toUpperCase()), 1 /* TEXT */))
                : vue.createCommentVNode("v-if", true),
              _hoisted_3
            ]),
            _: 1 /* STABLE */
          }, 8 /* PROPS */, ["custom-class", "photo-url"]),
          vue.createElementVNode("div", _hoisted_4, [
            vue.createElementVNode("div", _hoisted_5, [
              vue.createVNode(_component_ts_header_text, { size: "base" }, {
                default: vue.withCtx(() => [
                  vue.createTextVNode(vue.toDisplayString(_ctx.data.bio.name.full), 1 /* TEXT */)
                ]),
                _: 1 /* STABLE */
              }),
              (_ctx.showSaved)
                ? (vue.openBlock(), vue.createBlock(_component_ts_icon, {
                    key: 0,
                    name: `${_ctx.isSaved ? 'like_active' : 'like'}`,
                    customClass: 'h-[15px]',
                    onClick: _cache[0] || (_cache[0] = vue.withModifiers($event => (_ctx.saveTutor ? _ctx.saveTutor(_ctx.data?.id, _ctx.isSaved) : ''), ["stop"]))
                  }, null, 8 /* PROPS */, ["name"]))
                : vue.createCommentVNode("v-if", true)
            ]),
            vue.createVNode(_component_ts_ratings),
            vue.createVNode(_component_ts_paragraph_text, { faded: true }, {
              default: vue.withCtx(() => [
                _hoisted_6
              ]),
              _: 1 /* STABLE */
            })
          ])
        ]),
        vue.createElementVNode("div", _hoisted_7, [
          vue.createElementVNode("div", _hoisted_8, [
            vue.createVNode(_component_ts_header_text, {
              size: "base",
              "custom-class": "hidden mdlg:!inline-block"
            }, {
              default: vue.withCtx(() => [
                vue.createTextVNode(vue.toDisplayString(_ctx.data.bio.name.full), 1 /* TEXT */)
              ]),
              _: 1 /* STABLE */
            }),
            (_ctx.showSaved)
              ? (vue.openBlock(), vue.createBlock(_component_ts_icon, {
                  key: 0,
                  name: `${_ctx.isSaved ? 'like_active' : 'like'}`,
                  customClass: 'h-[15px] cursor-pointer',
                  onClick: _cache[1] || (_cache[1] = vue.withModifiers($event => (_ctx.saveTutor ? _ctx.saveTutor(_ctx.data?.id, _ctx.isSaved) : ''), ["stop"]))
                }, null, 8 /* PROPS */, ["name"]))
              : vue.createCommentVNode("v-if", true)
          ]),
          vue.createElementVNode("span", _hoisted_9, [
            vue.createVNode(_component_ts_icon, {
              name: "tutors",
              "custom-class": "h-[12px]"
            }),
            vue.createVNode(_component_ts_paragraph_text, {
              faded: true,
              "custom-class": "text-xs"
            }, {
              default: vue.withCtx(() => [
                vue.createTextVNode(vue.toDisplayString(_ctx.Logic.questions.subjects.GetSubjectTitle(
              _ctx.data?.tutor.subjects[1] || ""
            )), 1 /* TEXT */)
              ]),
              _: 1 /* STABLE */
            })
          ]),
          vue.createElementVNode("span", _hoisted_10, [
            vue.createVNode(_component_ts_icon, {
              name: "profile",
              "custom-class": "h-[12px]"
            }),
            vue.createVNode(_component_ts_paragraph_text, {
              faded: true,
              "custom-class": "text-xs"
            }, {
              default: vue.withCtx(() => [
                vue.createTextVNode(vue.toDisplayString(_ctx.data.meta.students) + " students ", 1 /* TEXT */)
              ]),
              _: 1 /* STABLE */
            }),
            _hoisted_11,
            vue.createVNode(_component_ts_paragraph_text, {
              faded: true,
              "custom-class": "text-xs"
            }, {
              default: vue.withCtx(() => [
                vue.createTextVNode(vue.toDisplayString(_ctx.data.meta.sessionsHosted) + " sessions ", 1 /* TEXT */)
              ]),
              _: 1 /* STABLE */
            })
          ]),
          vue.createVNode(_component_ts_paragraph_text, {
            "custom-class": "text-left pt-1 line-clamp-3",
            "has-readmore": true
          }, {
            default: vue.withCtx(() => [
              vue.createTextVNode(vue.toDisplayString(_ctx.data.bio.description), 1 /* TEXT */)
            ]),
            _: 1 /* STABLE */
          })
        ]),
        vue.createElementVNode("div", _hoisted_12, [
          vue.createVNode(_component_ts_ratings, { "custom-class": "hidden mdlg:flex" }),
          vue.createVNode(_component_ts_paragraph_text, { "custom-class": "hidden mdlg:inline-block" }, {
            default: vue.withCtx(() => [
              _hoisted_13
            ]),
            _: 1 /* STABLE */
          }),
          vue.createElementVNode("div", _hoisted_14, [
            vue.createVNode(_component_ts_button, {
              "bg-color": "bg-primaryPurple",
              "custom-class": "col-span-6 w-full",
              padding: "py-3 mdlg:py-2",
              onClick: _cache[2] || (_cache[2] = vue.withModifiers($event => (
            _ctx.Logic.common.GoToRoute('/sessions/book/private?tutorId=' + _ctx.data?.id)
          ), ["stop"]))
            }, {
              default: vue.withCtx(() => [
                _hoisted_15
              ]),
              _: 1 /* STABLE */
            }),
            vue.createVNode(_component_ts_button, {
              "bg-color": "bg-primaryGreen",
              "custom-class": "col-span-6 w-full",
              padding: "py-3 mdlg:py-2",
              onClick: _cache[3] || (_cache[3] = vue.withModifiers($event => (
            _ctx.Logic.common.GoToRoute('/sessions/book/shared?tutorId=' + _ctx.data?.id)
          ), ["stop"]))
            }, {
              default: vue.withCtx(() => [
                _hoisted_16
              ]),
              _: 1 /* STABLE */
            })
          ])
        ])
      ]))
    : vue.createCommentVNode("v-if", true)
}

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

exports["default"] = script;
