var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { BlockElement } from '@blockeditor/lit';
import { html } from 'lit';
import { customElement, property } from 'lit/decorators.js';
import { styleMap } from 'lit/directives/style-map.js';
import { Bound } from '../surface-block/index.js';
let ImageBlockEdgelessComponent = class ImageBlockEdgelessComponent extends BlockElement {
    get surface() {
        return this.closest('affine-edgeless-page')?.surface;
    }
    render() {
        const bound = Bound.deserialize((this.surface?.pickById(this.model.id) ?? this.model)
            .xywh);
        return html `<img
      style=${styleMap({
            transform: `rotate(${this.model.rotate}deg)`,
            transformOrigin: 'center',
        })}
      src=${this.source}
      draggable="false"
      width="${bound.w}px"
      height="${bound.h}px"
    />`;
    }
};
__decorate([
    property()
], ImageBlockEdgelessComponent.prototype, "source", void 0);
ImageBlockEdgelessComponent = __decorate([
    customElement('affine-edgeless-image')
], ImageBlockEdgelessComponent);
export { ImageBlockEdgelessComponent };
//# sourceMappingURL=edgeless-image-block.js.map