"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../loadPlugins.js"),r=require("../mixins/mixins.js"),t=require("../../utils/amap-helpers.js"),n=require("../mixins/props.js"),a=require("../mixins/methods.js"),s=require("../mixins/geometry.js"),i=require("../mixins/editable.js");function d(e,r){return!(!e||!r)&&(t.near(e[0][0],r[0][0])&&t.near(e[0][1],r[0][1])&&t.near(e[1][0],r[1][0])&&t.near(e[1][1],r[1][1]))}var o=r.default(s.plane,i.default).extend({name:"AmapRectangle",amapMeta:{initComponent:async(e,r)=>new e.Rectangle(r),editable:{events:["move","end","adjust"],async loadEditor(){await e.default("AMap.RectangleEditor")},async initEditor(e,r,t){return new e.RectangleEditor(r,t,this.draggable)},onEdit(e){const r=t.bounds2Array(e.target.getBounds());this.$emit("update:bounds",r)}}},props:{bounds:n.defineProp({type:Array,deep:!0,setter(e,r){if(this.$props.editable||this.$props.draggable){if(d(t.bounds2Array(e.getBounds()),r))return}e.setBounds(t.makeBounds(r))},getter:e=>t.bounds2Array(e.getBounds()),transform:t.makeBounds,clone:!0,equals:d,events:["dragging","dragend"]})},methods:{getArea:a.defineMethod("getArea")}});exports.default=o;
