var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/components/pisellFloorMapLayout/utils/floorMapBuiltinShapes.tsx
var floorMapBuiltinShapes_exports = {};
__export(floorMapBuiltinShapes_exports, {
  FLOOR_MAP_BUILTIN_SHAPES: () => FLOOR_MAP_BUILTIN_SHAPES,
  FLOOR_MAP_BUILTIN_SHAPE_DEFAULT_FILL: () => DEFAULT_FILL,
  FLOOR_MAP_BUILTIN_SHAPE_DEFAULT_STROKE: () => DEFAULT_STROKE,
  getFloorMapBuiltinShapeDef: () => getFloorMapBuiltinShapeDef
});
module.exports = __toCommonJS(floorMapBuiltinShapes_exports);
var import_react = __toESM(require("react"));
var I18N_PREFIX = "pisell-floor-map-layout.builtin-shape";
function ShapeSvg(props) {
  const { children, viewBox, preserveAspectRatio = "xMidYMid meet" } = props;
  return /* @__PURE__ */ import_react.default.createElement(
    "svg",
    {
      width: "100%",
      height: "100%",
      viewBox,
      preserveAspectRatio,
      xmlns: "http://www.w3.org/2000/svg",
      style: { display: "block", pointerEvents: "none", overflow: "visible" }
    },
    children
  );
}
var DEFAULT_FILL = "#f1f3f5";
var DEFAULT_STROKE = "#6b7280";
function renderToilet(props) {
  const fill = props.fillColor ?? DEFAULT_FILL;
  const stroke = props.strokeColor ?? DEFAULT_STROKE;
  return /* @__PURE__ */ import_react.default.createElement(ShapeSvg, { viewBox: "0 0 100 100" }, /* @__PURE__ */ import_react.default.createElement(
    "rect",
    {
      x: "3",
      y: "3",
      width: "94",
      height: "94",
      rx: "8",
      ry: "8",
      fill,
      stroke,
      strokeWidth: "2.5"
    }
  ), /* @__PURE__ */ import_react.default.createElement(
    "line",
    {
      x1: "50",
      y1: "14",
      x2: "50",
      y2: "86",
      stroke,
      strokeOpacity: "0.45",
      strokeWidth: "1.5"
    }
  ), /* @__PURE__ */ import_react.default.createElement("circle", { cx: "28", cy: "22", r: "6.5", fill: stroke }), /* @__PURE__ */ import_react.default.createElement("rect", { x: "22", y: "31", width: "12", height: "20", rx: "2", fill: stroke }), /* @__PURE__ */ import_react.default.createElement("rect", { x: "22", y: "48", width: "4.5", height: "28", rx: "1.5", fill: stroke }), /* @__PURE__ */ import_react.default.createElement("rect", { x: "29.5", y: "48", width: "4.5", height: "28", rx: "1.5", fill: stroke }), /* @__PURE__ */ import_react.default.createElement("circle", { cx: "72", cy: "22", r: "6.5", fill: stroke }), /* @__PURE__ */ import_react.default.createElement("path", { d: "M 65 31 L 79 31 L 86 60 L 58 60 Z", fill: stroke }), /* @__PURE__ */ import_react.default.createElement("rect", { x: "66", y: "58", width: "4.5", height: "18", rx: "1.5", fill: stroke }), /* @__PURE__ */ import_react.default.createElement("rect", { x: "73.5", y: "58", width: "4.5", height: "18", rx: "1.5", fill: stroke }));
}
function renderDivider(props) {
  const fill = props.fillColor ?? "#7a818c";
  const stroke = props.strokeColor ?? "#3f4651";
  return /* @__PURE__ */ import_react.default.createElement(ShapeSvg, { viewBox: "0 0 100 100", preserveAspectRatio: "none" }, /* @__PURE__ */ import_react.default.createElement(
    "rect",
    {
      x: "0",
      y: "0",
      width: "100",
      height: "100",
      fill,
      stroke,
      strokeWidth: "1",
      vectorEffect: "non-scaling-stroke"
    }
  ));
}
function renderColumn(props) {
  const fill = props.fillColor ?? "#4b5563";
  const stroke = props.strokeColor ?? "#1f2937";
  return /* @__PURE__ */ import_react.default.createElement(ShapeSvg, { viewBox: "0 0 100 100" }, /* @__PURE__ */ import_react.default.createElement(
    "circle",
    {
      cx: "50",
      cy: "50",
      r: "40",
      fill: "none",
      stroke,
      strokeWidth: "1.5",
      opacity: "0.5"
    }
  ), /* @__PURE__ */ import_react.default.createElement(
    "circle",
    {
      cx: "50",
      cy: "50",
      r: "34",
      fill,
      stroke,
      strokeWidth: "2"
    }
  ), /* @__PURE__ */ import_react.default.createElement("circle", { cx: "42", cy: "42", r: "6", fill: "#ffffff", opacity: "0.18" }));
}
function renderSofa(props) {
  const fill = props.fillColor ?? "#cbd2dc";
  const stroke = props.strokeColor ?? "#4b5563";
  const cushion = props.fillColor ? props.fillColor : "#eef1f6";
  return /* @__PURE__ */ import_react.default.createElement(ShapeSvg, { viewBox: "0 0 200 100" }, /* @__PURE__ */ import_react.default.createElement(
    "rect",
    {
      x: "14",
      y: "8",
      width: "54",
      height: "32",
      rx: "14",
      ry: "14",
      fill,
      stroke,
      strokeWidth: "2"
    }
  ), /* @__PURE__ */ import_react.default.createElement(
    "rect",
    {
      x: "73",
      y: "8",
      width: "54",
      height: "32",
      rx: "14",
      ry: "14",
      fill,
      stroke,
      strokeWidth: "2"
    }
  ), /* @__PURE__ */ import_react.default.createElement(
    "rect",
    {
      x: "132",
      y: "8",
      width: "54",
      height: "32",
      rx: "14",
      ry: "14",
      fill,
      stroke,
      strokeWidth: "2"
    }
  ), /* @__PURE__ */ import_react.default.createElement(
    "rect",
    {
      x: "4",
      y: "34",
      width: "192",
      height: "52",
      rx: "12",
      ry: "12",
      fill,
      stroke,
      strokeWidth: "2.2"
    }
  ), /* @__PURE__ */ import_react.default.createElement(
    "rect",
    {
      x: "4",
      y: "44",
      width: "24",
      height: "42",
      rx: "8",
      ry: "8",
      fill: stroke,
      opacity: "0.2"
    }
  ), /* @__PURE__ */ import_react.default.createElement(
    "rect",
    {
      x: "172",
      y: "44",
      width: "24",
      height: "42",
      rx: "8",
      ry: "8",
      fill: stroke,
      opacity: "0.2"
    }
  ), /* @__PURE__ */ import_react.default.createElement(
    "rect",
    {
      x: "32",
      y: "48",
      width: "44",
      height: "32",
      rx: "6",
      ry: "6",
      fill: cushion,
      stroke,
      strokeOpacity: "0.4",
      strokeWidth: "1"
    }
  ), /* @__PURE__ */ import_react.default.createElement(
    "rect",
    {
      x: "78",
      y: "48",
      width: "44",
      height: "32",
      rx: "6",
      ry: "6",
      fill: cushion,
      stroke,
      strokeOpacity: "0.4",
      strokeWidth: "1"
    }
  ), /* @__PURE__ */ import_react.default.createElement(
    "rect",
    {
      x: "124",
      y: "48",
      width: "44",
      height: "32",
      rx: "6",
      ry: "6",
      fill: cushion,
      stroke,
      strokeOpacity: "0.4",
      strokeWidth: "1"
    }
  ), /* @__PURE__ */ import_react.default.createElement("rect", { x: "14", y: "86", width: "8", height: "10", rx: "2", fill: stroke }), /* @__PURE__ */ import_react.default.createElement("rect", { x: "178", y: "86", width: "8", height: "10", rx: "2", fill: stroke }));
}
function FlowerHead(props) {
  const { cx, cy, r, petalFill, petalStroke, centerFill } = props;
  const petalAngles = [0, 72, 144, 216, 288];
  return /* @__PURE__ */ import_react.default.createElement("g", { transform: `translate(${cx}, ${cy})` }, petalAngles.map((deg) => /* @__PURE__ */ import_react.default.createElement(
    "ellipse",
    {
      key: deg,
      cx: "0",
      cy: -r * 0.52,
      rx: r * 0.38,
      ry: r * 0.58,
      fill: petalFill,
      stroke: petalStroke,
      strokeWidth: "1",
      transform: `rotate(${deg})`
    }
  )), /* @__PURE__ */ import_react.default.createElement(
    "circle",
    {
      r: r * 0.24,
      fill: centerFill,
      stroke: petalStroke,
      strokeWidth: "0.9"
    }
  ));
}
function renderFlowerPot(props) {
  const fill = props.fillColor ?? "#e8ece4";
  const stroke = props.strokeColor ?? "#4b5563";
  const petalFill = "#fce7f3";
  const petalStroke = "#db2777";
  const centerFill = "#fbbf24";
  const leafFill = "#86efac";
  const leafStroke = "#15803d";
  return /* @__PURE__ */ import_react.default.createElement(ShapeSvg, { viewBox: "0 0 100 100" }, /* @__PURE__ */ import_react.default.createElement(
    "path",
    {
      d: "M 22 42 L 78 42 L 68 88 L 32 88 Z",
      fill,
      stroke,
      strokeWidth: "2",
      strokeLinejoin: "round"
    }
  ), /* @__PURE__ */ import_react.default.createElement(
    "ellipse",
    {
      cx: "50",
      cy: "42",
      rx: "30",
      ry: "7",
      fill,
      stroke,
      strokeWidth: "2"
    }
  ), /* @__PURE__ */ import_react.default.createElement(
    "ellipse",
    {
      cx: "50",
      cy: "40",
      rx: "26",
      ry: "5",
      fill: stroke,
      opacity: "0.12"
    }
  ), /* @__PURE__ */ import_react.default.createElement(
    "ellipse",
    {
      cx: "38",
      cy: "36",
      rx: "10",
      ry: "5",
      fill: leafFill,
      stroke: leafStroke,
      strokeWidth: "1",
      transform: "rotate(-18 38 36)"
    }
  ), /* @__PURE__ */ import_react.default.createElement(
    "ellipse",
    {
      cx: "62",
      cy: "36",
      rx: "10",
      ry: "5",
      fill: leafFill,
      stroke: leafStroke,
      strokeWidth: "1",
      transform: "rotate(18 62 36)"
    }
  ), /* @__PURE__ */ import_react.default.createElement(
    FlowerHead,
    {
      cx: 50,
      cy: 22,
      r: 13,
      petalFill,
      petalStroke,
      centerFill
    }
  ), /* @__PURE__ */ import_react.default.createElement(
    FlowerHead,
    {
      cx: 33,
      cy: 30,
      r: 9,
      petalFill,
      petalStroke,
      centerFill
    }
  ), /* @__PURE__ */ import_react.default.createElement(
    FlowerHead,
    {
      cx: 67,
      cy: 30,
      r: 9,
      petalFill,
      petalStroke,
      centerFill
    }
  ));
}
function renderDoor(props) {
  const fill = props.fillColor ?? "#f8fafc";
  const stroke = props.strokeColor ?? "#1f2937";
  return /* @__PURE__ */ import_react.default.createElement(ShapeSvg, { viewBox: "0 0 100 100" }, /* @__PURE__ */ import_react.default.createElement("rect", { x: "0", y: "0", width: "100", height: "100", fill, opacity: "0" }), /* @__PURE__ */ import_react.default.createElement("rect", { x: "0", y: "80", width: "22", height: "12", rx: "1", fill: stroke }), /* @__PURE__ */ import_react.default.createElement("rect", { x: "80", y: "80", width: "20", height: "12", rx: "1", fill: stroke }), /* @__PURE__ */ import_react.default.createElement(
    "rect",
    {
      x: "18",
      y: "14",
      width: "6",
      height: "72",
      rx: "2",
      ry: "2",
      fill: stroke
    }
  ), /* @__PURE__ */ import_react.default.createElement("circle", { cx: "21", cy: "86", r: "3.5", fill: "#ffffff", stroke, strokeWidth: "1.5" }), /* @__PURE__ */ import_react.default.createElement(
    "path",
    {
      d: "M 24 16 A 64 64 0 0 1 84 86",
      fill: "none",
      stroke,
      strokeOpacity: "0.65",
      strokeWidth: "1.6",
      strokeDasharray: "5 4"
    }
  ));
}
var FLOOR_MAP_BUILTIN_SHAPES = [
  {
    key: "toilet",
    labelKey: `${I18N_PREFIX}.toilet`,
    defaultSize: { width: 96, height: 96 },
    render: renderToilet
  },
  {
    key: "divider",
    labelKey: `${I18N_PREFIX}.divider`,
    defaultSize: { width: 32, height: 160 },
    render: renderDivider
  },
  {
    key: "column",
    labelKey: `${I18N_PREFIX}.column`,
    defaultSize: { width: 72, height: 72 },
    render: renderColumn
  },
  {
    key: "sofa",
    labelKey: `${I18N_PREFIX}.sofa`,
    defaultSize: { width: 220, height: 110 },
    render: renderSofa,
    /** 沙发原始 2:1 横向；拖成瘦高比时整张图形自动 rotate 90deg */
    orientationAware: true
  },
  {
    key: "door",
    labelKey: `${I18N_PREFIX}.door`,
    defaultSize: { width: 96, height: 96 },
    render: renderDoor,
    /** 门贴在底墙；拖成瘦高比时整张图形自动 rotate 90deg → 贴侧墙 */
    orientationAware: true
  },
  {
    key: "flowerPot",
    labelKey: `${I18N_PREFIX}.flower-pot`,
    defaultSize: { width: 80, height: 96 },
    render: renderFlowerPot
  }
];
function getFloorMapBuiltinShapeDef(key) {
  if (!key) return void 0;
  return FLOOR_MAP_BUILTIN_SHAPES.find((s) => s.key === key);
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  FLOOR_MAP_BUILTIN_SHAPES,
  FLOOR_MAP_BUILTIN_SHAPE_DEFAULT_FILL,
  FLOOR_MAP_BUILTIN_SHAPE_DEFAULT_STROKE,
  getFloorMapBuiltinShapeDef
});
