import BaseRegionBehavior from"../../../common/documents/region-behavior.mjs";import{getProperty,getType,setProperty}from"../../../common/utils/helpers.mjs";import ServerDocumentMixin from"../backend/server-document.mjs";import*as fields from"../../../common/data/fields.mjs";export default class RegionBehavior extends(ServerDocumentMixin(BaseRegionBehavior)){static _migrationRegistry=[...super._migrationRegistry,{fn:migrateExecuteMacroEveryone,version:"12.326"},{fn:migrateDisplayScrollingTextEvents,version:"13.337"}];static identifySanitizedFields(){const e=super.identifySanitizedFields();return e._types.executeScript={system:{source:new fields.JavaScriptField({async:!0,gmOnly:!0})}},e}}function migrateExecuteMacroEveryone(e){return"executeMacro"===e.type&&(setProperty(e,"system.everyone",!0),!0)}function migrateDisplayScrollingTextEvents(e){if("displayScrollingText"!==e.type)return!1;const t=getProperty(e,"system.events");return"Array"===getType(t)&&(setProperty(e,"system.events",Array.from(new Set(t.map((e=>"tokenEnter"===e||"tokenMoveIn"===e?"tokenAnimateIn":"tokenExit"===e||"tokenMoveOut"===e?"tokenAnimateOut":e))))),!0)}