'use strict';

var chunkTJZDPOO7_js = require('../../../chunk-TJZDPOO7.js');
require('../../../chunk-Z6ZWNWWR.js');
var React3 = require('react');
var components = require('@tarojs/components');

function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }

var React3__default = /*#__PURE__*/_interopDefault(React3);

var PageHeader = ({ title, subtitle, actions, cta }) => {
  return /* @__PURE__ */ React3__default.default.createElement(components.View, { className: "mx-4 mt-6 rounded-3xl bg-white px-5 py-5 shadow-xl" }, /* @__PURE__ */ React3__default.default.createElement(components.View, { className: "flex items-start justify-between" }, /* @__PURE__ */ React3__default.default.createElement(components.View, null, /* @__PURE__ */ React3__default.default.createElement(components.Text, { className: "text-xl font-semibold" }, title), subtitle && /* @__PURE__ */ React3__default.default.createElement(components.Text, { className: "mt-2 block text-sm text-slate-500" }, subtitle)), actions && actions.length > 0 && /* @__PURE__ */ React3__default.default.createElement(components.View, { className: "flex flex-col items-end gap-2" }, actions.map((action) => /* @__PURE__ */ React3__default.default.createElement(
    components.Button,
    {
      key: action.label,
      className: action.variant === "ghost" ? "h-8 rounded-full border border-slate-200 bg-white px-4 text-xs font-semibold text-slate-700" : "h-8 rounded-full bg-slate-900 px-4 text-xs font-semibold text-white",
      onClick: action.onClick
    },
    action.label
  )))), cta && /* @__PURE__ */ React3__default.default.createElement(
    components.Button,
    {
      className: "mt-4 h-10 w-32 rounded-full bg-slate-900 text-sm font-semibold text-white",
      onClick: cta.onClick
    },
    cta.label
  ));
};
var PageHeader_default = PageHeader;
function CategoryTabs({
  items,
  activeValue,
  onChange
}) {
  return /* @__PURE__ */ React3__default.default.createElement(components.ScrollView, { scrollX: true, className: "mt-3", showScrollbar: false }, /* @__PURE__ */ React3__default.default.createElement(components.View, { className: "flex gap-2 pb-2" }, items.map((item) => /* @__PURE__ */ React3__default.default.createElement(
    components.View,
    {
      key: item.value,
      className: `rounded-full px-4 py-2 text-xs ${activeValue === item.value ? "bg-slate-900 text-white" : "bg-white text-slate-600 shadow-md"}`,
      onClick: () => onChange(item.value)
    },
    /* @__PURE__ */ React3__default.default.createElement(components.Text, null, item.label)
  ))));
}
var CategoryTabs_default = CategoryTabs;
var CollectionCard = ({
  collection,
  actions,
  showCategory = true,
  showDescription = true,
  variant = "default"
}) => {
  const isCompact = variant === "compact";
  return /* @__PURE__ */ React3__default.default.createElement(components.View, { className: "overflow-hidden rounded-3xl bg-white shadow-xl" }, collection.coverImage ? /* @__PURE__ */ React3__default.default.createElement(
    components.Image,
    {
      src: collection.coverImage,
      mode: "aspectFill",
      className: isCompact ? "h-24 w-24 rounded-2xl" : "h-44 w-full"
    }
  ) : /* @__PURE__ */ React3__default.default.createElement(
    components.View,
    {
      className: isCompact ? "flex h-24 w-24 items-center justify-center rounded-2xl bg-slate-200 text-xs text-slate-500" : "flex h-44 items-center justify-center bg-slate-200 text-sm text-slate-500"
    },
    "\u6682\u65E0\u56FE\u7247"
  ), /* @__PURE__ */ React3__default.default.createElement(components.View, { className: isCompact ? "flex-1 px-3 py-1" : "px-4 py-4" }, /* @__PURE__ */ React3__default.default.createElement(components.View, { className: "flex items-center justify-between gap-2" }, /* @__PURE__ */ React3__default.default.createElement(components.Text, { className: isCompact ? "text-sm font-semibold" : "text-base font-semibold" }, collection.title), showCategory && !isCompact && /* @__PURE__ */ React3__default.default.createElement(components.Text, { className: "rounded-full bg-slate-100 px-3 py-1 text-xs text-slate-600" }, chunkTJZDPOO7_js.getCategoryLabel(collection.category))), showDescription && collection.description && !isCompact && /* @__PURE__ */ React3__default.default.createElement(components.Text, { className: "mt-2 block text-xs text-slate-500" }, collection.description), /* @__PURE__ */ React3__default.default.createElement(components.Text, { className: "mt-1 block text-xs text-slate-500" }, "\u7F16\u53F7\uFF1A", collection.number), /* @__PURE__ */ React3__default.default.createElement(components.Text, { className: "mt-1 block text-xs text-slate-500" }, "\u4EF7\u683C\uFF1A", chunkTJZDPOO7_js.formatPrice(collection.price)), actions && actions.length > 0 && /* @__PURE__ */ React3__default.default.createElement(components.View, { className: isCompact ? "mt-2 flex gap-2" : "mt-4 flex gap-2" }, actions.map((action) => /* @__PURE__ */ React3__default.default.createElement(
    components.Button,
    {
      key: action.label,
      className: action.variant === "ghost" ? "h-8 rounded-full border border-slate-200 bg-white px-4 text-xs font-semibold text-slate-700" : "h-8 rounded-full bg-slate-900 px-4 text-xs font-semibold text-white",
      onClick: action.onClick
    },
    action.label
  )))));
};
var CollectionCard_default = CollectionCard;
var BookingSteps = ({ step }) => {
  return /* @__PURE__ */ React3__default.default.createElement(components.View, { className: "mx-4 mt-4 flex items-center gap-3" }, /* @__PURE__ */ React3__default.default.createElement(
    components.View,
    {
      className: `flex items-center gap-2 rounded-full px-4 py-2 text-xs ${step === "select" ? "bg-slate-900 text-white" : "bg-white text-slate-600"}`
    },
    /* @__PURE__ */ React3__default.default.createElement(components.Text, null, step === "select" ? "1" : "\u2713"),
    /* @__PURE__ */ React3__default.default.createElement(components.Text, null, "\u9009\u62E9\u753B\u96C6")
  ), /* @__PURE__ */ React3__default.default.createElement(components.View, { className: "h-px flex-1 bg-slate-200" }), /* @__PURE__ */ React3__default.default.createElement(
    components.View,
    {
      className: `flex items-center gap-2 rounded-full px-4 py-2 text-xs ${step === "form" ? "bg-slate-900 text-white" : "bg-white text-slate-600"}`
    },
    /* @__PURE__ */ React3__default.default.createElement(components.Text, null, "2"),
    /* @__PURE__ */ React3__default.default.createElement(components.Text, null, "\u586B\u5199\u4FE1\u606F")
  ));
};
var BookingSteps_default = BookingSteps;
var FormInput = ({
  label,
  value,
  placeholder,
  disabled,
  error,
  type = "text",
  onChange
}) => {
  return /* @__PURE__ */ React3__default.default.createElement(components.View, { className: "mt-4" }, /* @__PURE__ */ React3__default.default.createElement(components.Text, { className: "text-xs text-slate-600" }, label), /* @__PURE__ */ React3__default.default.createElement(
    components.Input,
    {
      value,
      placeholder,
      onInput: (event) => onChange(event.detail.value),
      className: `mt-2 h-10 w-full rounded-xl border px-3 text-sm ${error ? "border-rose-400" : "border-slate-200"}`,
      disabled,
      type
    }
  ), error && /* @__PURE__ */ React3__default.default.createElement(components.Text, { className: "mt-1 block text-xs text-rose-500" }, error));
};
var FormTextarea = ({
  label,
  value,
  placeholder,
  disabled,
  error,
  onChange
}) => {
  return /* @__PURE__ */ React3__default.default.createElement(components.View, { className: "mt-4" }, /* @__PURE__ */ React3__default.default.createElement(components.Text, { className: "text-xs text-slate-600" }, label), /* @__PURE__ */ React3__default.default.createElement(
    components.Textarea,
    {
      value,
      placeholder,
      onInput: (event) => onChange(event.detail.value),
      className: `mt-2 min-h-24 w-full rounded-xl border px-3 py-2 text-sm ${error ? "border-rose-400" : "border-slate-200"}`,
      disabled
    }
  ), error && /* @__PURE__ */ React3__default.default.createElement(components.Text, { className: "mt-1 block text-xs text-rose-500" }, error));
};
var CartItemCard = ({ item, onIncrease, onDecrease, onRemove }) => {
  return /* @__PURE__ */ React3__default.default.createElement(components.View, { className: "flex gap-3 rounded-2xl bg-white p-3 shadow-md" }, item.collection.coverImage ? /* @__PURE__ */ React3__default.default.createElement(
    components.Image,
    {
      src: item.collection.coverImage,
      mode: "aspectFill",
      className: "h-20 w-20 rounded-2xl"
    }
  ) : /* @__PURE__ */ React3__default.default.createElement(components.View, { className: "flex h-20 w-20 items-center justify-center rounded-2xl bg-slate-200 text-xs text-slate-500" }, "\u6682\u65E0\u56FE\u7247"), /* @__PURE__ */ React3__default.default.createElement(components.View, { className: "flex-1" }, /* @__PURE__ */ React3__default.default.createElement(components.Text, { className: "text-sm font-semibold" }, item.collection.title), /* @__PURE__ */ React3__default.default.createElement(components.Text, { className: "mt-1 block text-xs text-slate-500" }, "\u7F16\u53F7\uFF1A", item.collection.number), /* @__PURE__ */ React3__default.default.createElement(components.Text, { className: "mt-1 block text-xs text-slate-500" }, "\u4EF7\u683C\uFF1A", chunkTJZDPOO7_js.formatPrice(item.collection.price)), /* @__PURE__ */ React3__default.default.createElement(components.View, { className: "mt-3 flex items-center gap-2" }, /* @__PURE__ */ React3__default.default.createElement(
    components.Button,
    {
      className: "h-8 w-8 rounded-full border border-slate-200 bg-white text-base text-slate-700",
      onClick: onDecrease
    },
    "-"
  ), /* @__PURE__ */ React3__default.default.createElement(components.Text, { className: "text-sm font-semibold" }, item.quantity), /* @__PURE__ */ React3__default.default.createElement(
    components.Button,
    {
      className: "h-8 w-8 rounded-full border border-slate-200 bg-white text-base text-slate-700",
      onClick: onIncrease
    },
    "+"
  ), /* @__PURE__ */ React3__default.default.createElement(
    components.Button,
    {
      className: "ml-auto h-8 rounded-full border border-rose-200 bg-rose-50 px-3 text-xs text-rose-600",
      onClick: onRemove
    },
    "\u79FB\u9664"
  ))));
};
var CartItemCard_default = CartItemCard;
var statusLabelMap = {
  pending: "\u5F85\u786E\u8BA4",
  confirmed: "\u5DF2\u786E\u8BA4",
  completed: "\u5DF2\u5B8C\u6210",
  cancelled: "\u5DF2\u53D6\u6D88"
};
var HistoryRecordCard = ({ record }) => {
  return /* @__PURE__ */ React3__default.default.createElement(components.View, { className: "flex gap-3 rounded-2xl bg-white p-3 shadow-md" }, record.collection?.coverImage ? /* @__PURE__ */ React3__default.default.createElement(
    components.Image,
    {
      src: record.collection.coverImage,
      mode: "aspectFill",
      className: "h-20 w-20 rounded-2xl"
    }
  ) : /* @__PURE__ */ React3__default.default.createElement(components.View, { className: "flex h-20 w-20 items-center justify-center rounded-2xl bg-slate-200 text-xs text-slate-500" }, "\u6682\u65E0\u56FE\u7247"), /* @__PURE__ */ React3__default.default.createElement(components.View, { className: "flex-1" }, /* @__PURE__ */ React3__default.default.createElement(components.Text, { className: "text-sm font-semibold" }, record.collection?.title || "\u753B\u96C6"), /* @__PURE__ */ React3__default.default.createElement(components.Text, { className: "mt-1 block text-xs text-slate-500" }, "\u6570\u91CF\uFF1A", record.quantity), /* @__PURE__ */ React3__default.default.createElement(components.Text, { className: "mt-1 block text-xs text-slate-500" }, "\u4EF7\u683C\uFF1A", chunkTJZDPOO7_js.formatPrice(record.collection?.price)), /* @__PURE__ */ React3__default.default.createElement(components.View, { className: "mt-2 flex items-center justify-between" }, /* @__PURE__ */ React3__default.default.createElement(components.Text, { className: "text-xs text-slate-500" }, "\u72B6\u6001\uFF1A", statusLabelMap[record.status] || record.status), /* @__PURE__ */ React3__default.default.createElement(components.Text, { className: "text-xs text-slate-400" }, record.createdAt?.slice(0, 10)))));
};
var HistoryRecordCard_default = HistoryRecordCard;

exports.BookingSteps = BookingSteps_default;
exports.CartItemCard = CartItemCard_default;
exports.CategoryTabs = CategoryTabs_default;
exports.FormInput = FormInput;
exports.FormTextarea = FormTextarea;
exports.HistoryRecordCard = HistoryRecordCard_default;
exports.MiniappCollectionCard = CollectionCard_default;
exports.PageHeader = PageHeader_default;
//# sourceMappingURL=index.js.map
//# sourceMappingURL=index.js.map