function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
/**
 * EditableItemLayer - 编辑态图元层：拖拽、缩放、选中、吸附
 */
import React, { useCallback, useMemo, useRef, useState } from 'react';
import classNames from 'classnames';
function isSceneLayoutTransformLocked(item) {
  var _item$_sceneElement;
  return Boolean((_item$_sceneElement = item._sceneElement) === null || _item$_sceneElement === void 0 ? void 0 : _item$_sceneElement.layoutTransformLocked);
}
import { snapRect } from "../utils/snap";
import { snapRectToOthers } from "../utils/alignSnap";
import { FloorMapEditQuickActions } from "./FloorMapEditQuickActions";
import "./EditableItemLayer.less";
var PREFIX = 'pisell-floor-map-layout';
var DRAG_THRESHOLD = 4;
var RESIZE_HANDLE_SIZE = 8;
/** 选中图元抬升到该层级，保证快捷栏与缩放点不被其它图元（任意 item.zIndex）遮住 */
var SELECTED_ITEM_STACK_Z = 1000000;

/** 仅四角缩放；边中点（n/e/s/w）不渲染，避免单轴拉伸 */

var RESIZE_CORNER_HANDLES = ['nw', 'ne', 'se', 'sw'];
function getItemKey(item, index, rowKey) {
  var _rowKey;
  if (!rowKey) return item.id;
  if (typeof rowKey === 'string') return String((_rowKey = item[rowKey]) !== null && _rowKey !== void 0 ? _rowKey : item.id);
  return rowKey(item, index);
}
function getShapeStyle() {
  var shape = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'rect';
  switch (shape) {
    case 'circle':
      return {
        borderRadius: '50%'
      };
    case 'triangle':
      return {
        clipPath: 'polygon(50% 0%, 0% 100%, 100% 100%)'
      };
    default:
      return {};
  }
}
export function EditableItemLayer(props) {
  var items = props.items,
    renderItem = props.renderItem,
    rowKey = props.rowKey,
    cellSize = props.cellSize,
    _props$itemUnit = props.itemUnit,
    itemUnit = _props$itemUnit === void 0 ? 'pixel' : _props$itemUnit,
    _props$itemGap = props.itemGap,
    itemGap = _props$itemGap === void 0 ? 0 : _props$itemGap,
    contentWidth = props.contentWidth,
    contentHeight = props.contentHeight,
    _props$contentOffsetX = props.contentOffsetX,
    contentOffsetX = _props$contentOffsetX === void 0 ? 0 : _props$contentOffsetX,
    _props$contentOffsetY = props.contentOffsetY,
    contentOffsetY = _props$contentOffsetY === void 0 ? 0 : _props$contentOffsetY,
    selectedId = props.selectedId,
    onSelect = props.onSelect,
    onUpdateItem = props.onUpdateItem,
    _props$snapStep = props.snapStep,
    snapStep = _props$snapStep === void 0 ? 0 : _props$snapStep,
    _props$scale = props.scale,
    scale = _props$scale === void 0 ? 1 : _props$scale,
    onInteractionChange = props.onInteractionChange,
    onLiveRectChange = props.onLiveRectChange,
    _props$alignSnapThres = props.alignSnapThresholdPx,
    alignSnapThresholdPx = _props$alignSnapThres === void 0 ? 6 : _props$alignSnapThres,
    onAlignGuidesChange = props.onAlignGuidesChange,
    _props$alignGuideStro = props.alignGuideStroke,
    alignGuideStroke = _props$alignGuideStro === void 0 ? '#1570EF' : _props$alignGuideStro,
    getMergedItemWrapperStyle = props.getMergedItemWrapperStyle,
    className = props.className,
    editQuickBar = props.editQuickBar;
  var contentRef = useRef(null);
  var liveRectRef = useRef(null);
  var _useState = useState(null),
    _useState2 = _slicedToArray(_useState, 2),
    interaction = _useState2[0],
    setInteraction = _useState2[1];
  var _useState3 = useState(null),
    _useState4 = _slicedToArray(_useState3, 2),
    liveRect = _useState4[0],
    setLiveRect = _useState4[1];
  /** 拖动/缩放过程中的对齐辅助线（红色虚线） */
  var _useState5 = useState([]),
    _useState6 = _slicedToArray(_useState5, 2),
    alignGuides = _useState6[0],
    setAlignGuides = _useState6[1];

  /** 基础像素矩形（与 liveRect 无关），供对齐吸附排除自身后参考 */
  var getBaseRect = useCallback(function (item) {
    var _item$width2, _item$height2;
    var isPixel = itemUnit === 'pixel';
    var g = itemGap !== null && itemGap !== void 0 ? itemGap : 0;
    if (isPixel) {
      var _item$width, _item$height;
      return {
        left: item.x,
        top: item.y,
        width: (_item$width = item.width) !== null && _item$width !== void 0 ? _item$width : cellSize,
        height: (_item$height = item.height) !== null && _item$height !== void 0 ? _item$height : cellSize
      };
    }
    var w = (_item$width2 = item.width) !== null && _item$width2 !== void 0 ? _item$width2 : 1;
    var h = (_item$height2 = item.height) !== null && _item$height2 !== void 0 ? _item$height2 : 1;
    return {
      left: g > 0 ? item.x * (cellSize + g) + g : item.x * cellSize,
      top: g > 0 ? item.y * (cellSize + g) + g : item.y * cellSize,
      width: g > 0 ? w * cellSize + (w - 1) * g : w * cellSize,
      height: g > 0 ? h * cellSize + (h - 1) * g : h * cellSize
    };
  }, [cellSize, itemGap, itemUnit]);
  var getItemStyle = useCallback(function (item, index) {
    var merged = item;
    var isPixel = itemUnit === 'pixel';
    var g = itemGap !== null && itemGap !== void 0 ? itemGap : 0;
    var left;
    var top;
    var width;
    var height;
    if (isPixel) {
      var _item$width3, _item$height3;
      width = (_item$width3 = item.width) !== null && _item$width3 !== void 0 ? _item$width3 : cellSize;
      height = (_item$height3 = item.height) !== null && _item$height3 !== void 0 ? _item$height3 : cellSize;
      left = item.x;
      top = item.y;
    } else {
      var _item$width4, _item$height4;
      var w = (_item$width4 = item.width) !== null && _item$width4 !== void 0 ? _item$width4 : 1;
      var h = (_item$height4 = item.height) !== null && _item$height4 !== void 0 ? _item$height4 : 1;
      left = g > 0 ? item.x * (cellSize + g) + g : item.x * cellSize;
      top = g > 0 ? item.y * (cellSize + g) + g : item.y * cellSize;
      width = g > 0 ? w * cellSize + (w - 1) * g : w * cellSize;
      height = g > 0 ? h * cellSize + (h - 1) * g : h * cellSize;
    }
    if (liveRect && liveRect.id === item.id) {
      left = liveRect.x;
      top = liveRect.y;
      width = liveRect.width;
      height = liveRect.height;
    }
    return {
      left: left,
      top: top,
      width: width,
      height: height
    };
  }, [itemUnit, cellSize, itemGap, liveRect]);

  /** 使用 Pointer Events，触控/笔/鼠标均可拖拽；仅靠 mouse 事件在触控设备上无法连续触发 move/up */
  var handlePointerDown = useCallback(function (e, item, index) {
    if (e.button !== 0) return;
    if (e.target.closest(".".concat(PREFIX, "-editable-resize-handle"))) return;
    var merged = item;
    if (isSceneLayoutTransformLocked(merged)) {
      return;
    }
    e.stopPropagation();
    e.preventDefault();
    onInteractionChange === null || onInteractionChange === void 0 || onInteractionChange(true);
    var style = getItemStyle(item, index);
    setInteraction({
      type: 'drag',
      itemId: item.id,
      startX: e.clientX,
      startY: e.clientY,
      itemX: style.left,
      itemY: style.top,
      itemW: style.width,
      itemH: style.height
    });
  }, [getItemStyle, onInteractionChange]);
  var handleResizePointerDown = useCallback(function (e, itemId, handle) {
    if (e.button !== 0) return;
    var item = items.find(function (i) {
      return i.id === itemId;
    });
    if (!item) return;
    if (isSceneLayoutTransformLocked(item)) {
      return;
    }
    e.stopPropagation();
    e.preventDefault();
    onInteractionChange === null || onInteractionChange === void 0 || onInteractionChange(true);
    var idx = items.indexOf(item);
    var style = getItemStyle(item, idx);
    setInteraction({
      type: 'resize',
      itemId: itemId,
      handle: handle,
      startX: e.clientX,
      startY: e.clientY,
      startW: style.width,
      startH: style.height,
      startItemX: style.left,
      startItemY: style.top
    });
  }, [items, getItemStyle, onInteractionChange]);
  React.useEffect(function () {
    if (!interaction) return;
    /** 阈值按 scale 折算到内容坐标，让它在屏幕上恒定 */
    var threshold = Math.max(0, alignSnapThresholdPx) / Math.max(scale, 0.01);
    /** 内部计算 snap 目标：排除自身，使用基础 rect（避开 liveRect 自吸） */
    var otherRects = items.filter(function (it) {
      return it.id !== interaction.itemId;
    }).map(function (it) {
      return _objectSpread({
        id: it.id
      }, getBaseRect(it));
    });
    var onMove = function onMove(e) {
      if (interaction.type === 'drag') {
        var dx = (e.clientX - interaction.startX) / scale;
        var dy = (e.clientY - interaction.startY) / scale;
        var rawNext = {
          x: interaction.itemX + dx,
          y: interaction.itemY + dy,
          width: interaction.itemW,
          height: interaction.itemH
        };
        var snap = snapRectToOthers({
          id: interaction.itemId,
          left: rawNext.x,
          top: rawNext.y,
          width: rawNext.width,
          height: rawNext.height
        }, otherRects, {
          mode: 'drag',
          threshold: threshold
        });
        var next = {
          x: snap.rect.left,
          y: snap.rect.top,
          width: snap.rect.width,
          height: snap.rect.height
        };
        liveRectRef.current = next;
        setLiveRect(_objectSpread({
          id: interaction.itemId
        }, next));
        onLiveRectChange === null || onLiveRectChange === void 0 || onLiveRectChange(interaction.itemId, {
          left: next.x,
          top: next.y,
          width: next.width,
          height: next.height
        });
        setAlignGuides(snap.guides);
        onAlignGuidesChange === null || onAlignGuidesChange === void 0 || onAlignGuidesChange(snap.guides);
      } else {
        var _dx = (e.clientX - interaction.startX) / scale;
        var _dy = (e.clientY - interaction.startY) / scale;
        var handle = interaction.handle,
          startW = interaction.startW,
          startH = interaction.startH,
          startItemX = interaction.startItemX,
          startItemY = interaction.startItemY;
        var w = startW;
        var h = startH;
        var x = startItemX;
        var y = startItemY;
        if (handle.includes('e')) w = Math.max(20, startW + _dx);
        if (handle.includes('w')) {
          w = Math.max(20, startW - _dx);
          x = startItemX + _dx;
        }
        if (handle.includes('s')) h = Math.max(20, startH + _dy);
        if (handle.includes('n')) {
          h = Math.max(20, startH - _dy);
          y = startItemY + _dy;
        }
        var movableEdgesX = handle.includes('w') ? ['left'] : handle.includes('e') ? ['right'] : [];
        var movableEdgesY = handle.includes('n') ? ['top'] : handle.includes('s') ? ['bottom'] : [];
        var _snap = snapRectToOthers({
          id: interaction.itemId,
          left: x,
          top: y,
          width: w,
          height: h
        }, otherRects, {
          mode: 'resize',
          threshold: threshold,
          movableEdgesX: movableEdgesX,
          movableEdgesY: movableEdgesY
        });
        var _next = {
          x: _snap.rect.left,
          y: _snap.rect.top,
          width: Math.max(20, _snap.rect.width),
          height: Math.max(20, _snap.rect.height)
        };
        liveRectRef.current = _next;
        setLiveRect(_objectSpread({
          id: interaction.itemId
        }, _next));
        onLiveRectChange === null || onLiveRectChange === void 0 || onLiveRectChange(interaction.itemId, {
          left: _next.x,
          top: _next.y,
          width: _next.width,
          height: _next.height
        });
        setAlignGuides(_snap.guides);
        onAlignGuidesChange === null || onAlignGuidesChange === void 0 || onAlignGuidesChange(_snap.guides);
      }
    };
    var onUp = function onUp() {
      var current = interaction;
      if (!current) return;
      var last = liveRectRef.current;
      onInteractionChange === null || onInteractionChange === void 0 || onInteractionChange(false);
      onLiveRectChange === null || onLiveRectChange === void 0 || onLiveRectChange(null, null);
      setAlignGuides([]);
      onAlignGuidesChange === null || onAlignGuidesChange === void 0 || onAlignGuidesChange([]);
      setLiveRect(null);
      liveRectRef.current = null;
      setInteraction(null);
      if (current.type === 'drag') {
        if (last && (Math.abs(last.x - current.itemX) > DRAG_THRESHOLD || Math.abs(last.y - current.itemY) > DRAG_THRESHOLD)) {
          var snapped = snapRect(last.x, last.y, 0, 0, snapStep);
          onUpdateItem(current.itemId, {
            x: Math.round(snapped.x),
            y: Math.round(snapped.y)
          });
        }
      } else {
        if (last) {
          var _snapped = snapRect(last.x, last.y, last.width, last.height, snapStep);
          onUpdateItem(current.itemId, {
            x: Math.round(_snapped.x),
            y: Math.round(_snapped.y),
            width: Math.round(_snapped.width),
            height: Math.round(_snapped.height)
          });
        }
      }
    };
    var opts = {
      capture: true
    };
    document.addEventListener('pointermove', onMove, opts);
    document.addEventListener('pointerup', onUp, opts);
    document.addEventListener('pointercancel', onUp, opts);
    return function () {
      document.removeEventListener('pointermove', onMove, opts);
      document.removeEventListener('pointerup', onUp, opts);
      document.removeEventListener('pointercancel', onUp, opts);
    };
  }, [interaction, scale, snapStep, onUpdateItem, onInteractionChange, onLiveRectChange, items, getBaseRect, alignSnapThresholdPx, onAlignGuidesChange]);
  var handleItemClick = useCallback(function (e, item) {
    if (interaction) return;
    e.stopPropagation();
    onSelect(item.id);
  }, [interaction, onSelect]);
  var itemNodes = useMemo(function () {
    var sorted = _toConsumableArray(items).sort(function (a, b) {
      var _a$zIndex, _b$zIndex;
      return ((_a$zIndex = a.zIndex) !== null && _a$zIndex !== void 0 ? _a$zIndex : 0) - ((_b$zIndex = b.zIndex) !== null && _b$zIndex !== void 0 ? _b$zIndex : 0);
    });
    return sorted.map(function (item, index) {
      var _item$zIndex, _item$zIndex2;
      var key = getItemKey(item, index, rowKey);
      var merged = item;
      var style = getItemStyle(item, index);
      var shapeStyle = getShapeStyle(item.shape);
      var isSelected = selectedId === item.id;
      var wrapperStyle = getMergedItemWrapperStyle === null || getMergedItemWrapperStyle === void 0 ? void 0 : getMergedItemWrapperStyle(item, index);
      var baseZ = (wrapperStyle === null || wrapperStyle === void 0 ? void 0 : wrapperStyle.zIndex) !== undefined ? wrapperStyle.zIndex : (_item$zIndex = item.zIndex) !== null && _item$zIndex !== void 0 ? _item$zIndex : 0;
      return /*#__PURE__*/React.createElement("div", {
        key: key,
        className: classNames("".concat(PREFIX, "-editable-item"), _defineProperty(_defineProperty({}, "".concat(PREFIX, "-editable-item-selected"), isSelected), "".concat(PREFIX, "-editable-item-selected-lock"), isSelected && isSceneLayoutTransformLocked(merged))),
        style: _objectSpread(_objectSpread(_objectSpread({
          position: 'absolute',
          left: style.left,
          top: style.top,
          width: style.width,
          height: style.height,
          boxSizing: 'border-box'
        }, shapeStyle), wrapperStyle), {}, {
          zIndex: isSelected ? SELECTED_ITEM_STACK_Z + ((_item$zIndex2 = item.zIndex) !== null && _item$zIndex2 !== void 0 ? _item$zIndex2 : 0) : baseZ
        }),
        onPointerDown: function onPointerDown(e) {
          return handlePointerDown(e, item, index);
        },
        onClick: function onClick(e) {
          return handleItemClick(e, item);
        }
      }, /*#__PURE__*/React.createElement("div", {
        className: "".concat(PREFIX, "-editable-item-inner")
      }, renderItem(item, index, {
        viewportScale: scale
      })), isSelected && !isSceneLayoutTransformLocked(merged) && /*#__PURE__*/React.createElement(React.Fragment, null, RESIZE_CORNER_HANDLES.map(function (h) {
        /** viewport scale 补偿：保持视觉 20px 不随画布放大变大 */
        var size = 20 / Math.max(scale, 0.01);
        var half = size / 2;
        return /*#__PURE__*/React.createElement("div", {
          key: h,
          className: classNames("".concat(PREFIX, "-editable-resize-handle"), "".concat(PREFIX, "-editable-resize-handle-").concat(h)),
          onPointerDown: function onPointerDown(e) {
            return handleResizePointerDown(e, item.id, h);
          },
          style: {
            position: 'absolute',
            width: size,
            height: size,
            marginTop: -half,
            marginRight: -half,
            marginBottom: -half,
            marginLeft: -half
          }
        });
      })), isSelected && editQuickBar ? /*#__PURE__*/React.createElement(FloorMapEditQuickActions, {
        labels: editQuickBar.labels,
        isLocked: editQuickBar.isLocked,
        onToggleLock: editQuickBar.onToggleLock,
        onDuplicate: editQuickBar.onDuplicate,
        onDelete: editQuickBar.onDelete,
        viewportScale: scale
      }) : null);
    });
  }, [items, renderItem, rowKey, getItemStyle, selectedId, handlePointerDown, handleItemClick, handleResizePointerDown, getMergedItemWrapperStyle, editQuickBar, scale]);
  return /*#__PURE__*/React.createElement("div", {
    ref: contentRef,
    className: classNames("".concat(PREFIX, "-editable-item-layer"), className),
    style: {
      position: 'absolute',
      left: 0,
      top: 0,
      width: contentWidth,
      height: contentHeight,
      minWidth: contentWidth,
      minHeight: contentHeight
    }
  }, contentOffsetX !== 0 || contentOffsetY !== 0 ? /*#__PURE__*/React.createElement("div", {
    style: {
      position: 'absolute',
      left: 0,
      top: 0,
      width: contentWidth,
      height: contentHeight,
      transform: "translate(".concat(contentOffsetX, "px, ").concat(contentOffsetY, "px)")
    }
  }, itemNodes, alignGuides.length > 0 ? /*#__PURE__*/React.createElement(AlignGuideOverlay, {
    guides: alignGuides,
    width: contentWidth,
    height: contentHeight,
    scale: scale,
    stroke: alignGuideStroke
  }) : null) : /*#__PURE__*/React.createElement(React.Fragment, null, itemNodes, alignGuides.length > 0 ? /*#__PURE__*/React.createElement(AlignGuideOverlay, {
    guides: alignGuides,
    width: contentWidth,
    height: contentHeight,
    scale: scale,
    stroke: alignGuideStroke
  }) : null));
}

/** 拖动/缩放时的对齐辅助线层；线宽按 scale 反向缩放，保持屏幕恒定 1px */
function AlignGuideOverlay(props) {
  var guides = props.guides,
    width = props.width,
    height = props.height,
    scale = props.scale,
    stroke = props.stroke;
  var safeScale = Math.max(scale, 0.01);
  var sw = 1 / safeScale;
  return /*#__PURE__*/React.createElement("svg", {
    width: width,
    height: height,
    style: {
      position: 'absolute',
      left: 0,
      top: 0,
      pointerEvents: 'none',
      overflow: 'visible'
    },
    "aria-hidden": true
  }, guides.map(function (g, i) {
    if (g.orientation === 'v') {
      return /*#__PURE__*/React.createElement("line", {
        key: "v-".concat(i, "-").concat(g.position),
        x1: g.position,
        y1: g.start,
        x2: g.position,
        y2: g.end,
        stroke: stroke,
        strokeWidth: sw,
        strokeDasharray: "".concat(4 / safeScale, " ").concat(3 / safeScale)
      });
    }
    return /*#__PURE__*/React.createElement("line", {
      key: "h-".concat(i, "-").concat(g.position),
      x1: g.start,
      y1: g.position,
      x2: g.end,
      y2: g.position,
      stroke: stroke,
      strokeWidth: sw,
      strokeDasharray: "".concat(4 / safeScale, " ").concat(3 / safeScale)
    });
  }));
}
export default EditableItemLayer;