import BaseTile from"../../../common/documents/tile.mjs";import ServerDocumentMixin from"../backend/server-document.mjs";import{getType,setProperty}from"../../../common/utils/helpers.mjs";export default class Tile extends(ServerDocumentMixin(BaseTile)){static _migrationRegistry=[...super._migrationRegistry,{fn:migrateTextureData,version:12},{fn:migrateOcclusion,version:12}]}function migrateTextureData(e){const t=Tile._addDataFieldMigration(e,"img","texture.src"),i=Tile._addDataFieldMigration(e,"tint","texture.tint");let r=!1;"width"in e&&e.width<0&&(e.width=Math.abs(e.width),setProperty(e,"texture.scaleX",-1),r=!0);let o=!1;return"height"in e&&e.height<0&&(e.height=Math.abs(e.height),setProperty(e,"texture.scaleY",-1),o=!0),t||i||r||o}function migrateOcclusion(e){return"Object"===getType(e.occlusion)&&(2===Number(e.occlusion.mode)&&(e.occlusion.mode=1,e.roof=!0,!0))}