{"version":3,"file":"rename-server-file.action-D7Mgu4PR.js","sources":["../../../src/packages/core/server-file-system/rename/modal/rename-server-file-modal.token.ts","../../../src/packages/core/server-file-system/rename/rename-server-file.action.ts"],"sourcesContent":["import { UMB_RENAME_SERVER_FILE_MODAL_ALIAS } from './manifests.js';\nimport { UmbModalToken } from '@umbraco-cms/backoffice/modal';\n\nexport interface UmbRenameModalData {\n\trenameRepositoryAlias: string;\n\titemRepositoryAlias: string;\n\tunique: string;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface UmbRenameServerFileModalValue {}\n\nexport const UMB_RENAME_SERVER_FILE_MODAL = new UmbModalToken(\n\tUMB_RENAME_SERVER_FILE_MODAL_ALIAS,\n\t{\n\t\tmodal: {\n\t\t\ttype: 'sidebar',\n\t\t\tsize: 'small',\n\t\t},\n\t},\n);\n","import { UMB_RENAME_SERVER_FILE_MODAL } from './modal/rename-server-file-modal.token.js';\nimport { UmbEntityActionBase, UmbRequestReloadStructureForEntityEvent } from '@umbraco-cms/backoffice/entity-action';\nimport { UMB_MODAL_MANAGER_CONTEXT } from '@umbraco-cms/backoffice/modal';\nimport type { MetaEntityActionRenameServerFileKind } from '@umbraco-cms/backoffice/extension-registry';\nimport { UMB_ACTION_EVENT_CONTEXT } from '@umbraco-cms/backoffice/action';\n\nexport class UmbRenameEntityAction extends UmbEntityActionBase {\n\toverride async execute() {\n\t\tif (!this.args.unique) throw new Error('Unique is required to rename an entity');\n\n\t\tconst modalManager = await this.getContext(UMB_MODAL_MANAGER_CONTEXT);\n\t\tconst modalContext = modalManager.open(this, UMB_RENAME_SERVER_FILE_MODAL, {\n\t\t\tdata: {\n\t\t\t\tunique: this.args.unique,\n\t\t\t\trenameRepositoryAlias: this.args.meta.renameRepositoryAlias,\n\t\t\t\titemRepositoryAlias: this.args.meta.itemRepositoryAlias,\n\t\t\t},\n\t\t});\n\n\t\tawait modalContext.onSubmit();\n\n\t\tconst actionEventContext = await this.getContext(UMB_ACTION_EVENT_CONTEXT);\n\t\tconst event = new UmbRequestReloadStructureForEntityEvent({\n\t\t\tunique: this.args.unique,\n\t\t\tentityType: this.args.entityType,\n\t\t});\n\n\t\tactionEventContext.dispatchEvent(event);\n\t}\n}\n\nexport default UmbRenameEntityAction;\n"],"names":["UMB_RENAME_SERVER_FILE_MODAL","UmbModalToken","UMB_RENAME_SERVER_FILE_MODAL_ALIAS","UmbRenameEntityAction","UmbEntityActionBase","UMB_MODAL_MANAGER_CONTEXT","actionEventContext","UMB_ACTION_EVENT_CONTEXT","event","UmbRequestReloadStructureForEntityEvent"],"mappings":";;;;AAYO,MAAMA,IAA+B,IAAIC;AAAA,EAC/CC;AAAA,EACA;AAAA,IACC,OAAO;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,IACP;AAAA,EACD;AACD;ACdO,MAAMC,UAA8BC,EAA0D;AAAA,EACpG,MAAe,UAAU;AACxB,QAAI,CAAC,KAAK,KAAK,OAAc,OAAA,IAAI,MAAM,wCAAwC;AAW/E,WATqB,MAAM,KAAK,WAAWC,CAAyB,GAClC,KAAK,MAAML,GAA8B;AAAA,MAC1E,MAAM;AAAA,QACL,QAAQ,KAAK,KAAK;AAAA,QAClB,uBAAuB,KAAK,KAAK,KAAK;AAAA,QACtC,qBAAqB,KAAK,KAAK,KAAK;AAAA,MACrC;AAAA,IAAA,CACA,EAEkB;AAEnB,UAAMM,IAAqB,MAAM,KAAK,WAAWC,CAAwB,GACnEC,IAAQ,IAAIC,EAAwC;AAAA,MACzD,QAAQ,KAAK,KAAK;AAAA,MAClB,YAAY,KAAK,KAAK;AAAA,IAAA,CACtB;AAED,IAAAH,EAAmB,cAAcE,CAAK;AAAA,EACvC;AACD;"}