@ckeditor/ckeditor5-angular
Version:
Official Angular component for CKEditor 5 – the best browser-based rich text editor.
1 lines • 30.8 kB
Source Map (JSON)
{"version":3,"file":"ckeditor-ckeditor5-angular.mjs","sources":["../../src/ckeditor/plugins/angular-integration-usage-data.plugin.ts","../../src/ckeditor/plugins/append-all-integration-plugins-to-config.ts","../../src/ckeditor/ckeditor.component.ts","../../src/ckeditor/ckeditor.module.ts","../../src/ckeditor/index.ts","../../src/ckeditor/ckeditor-ckeditor5-angular.ts"],"sourcesContent":["/**\n * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\nimport { VERSION } from '@angular/core';\nimport { createIntegrationUsageDataPlugin } from '@ckeditor/ckeditor5-integrations-common';\n\n/**\n * This part of the code is not executed in open-source implementations using a GPL key.\n * It only runs when a specific license key is provided. If you are uncertain whether\n * this applies to your installation, please contact our support team.\n */\nexport const AngularIntegrationUsageDataPlugin = createIntegrationUsageDataPlugin(\n\t'angular',\n\t{\n\t\tversion: /* replace-version:start */ '10.0.0' /* replace-version:end */,\n\t\tframeworkVersion: VERSION.full\n\t}\n);\n","/**\n * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\nimport { appendExtraPluginsToEditorConfig, isCKEditorFreeLicense } from '@ckeditor/ckeditor5-integrations-common';\nimport type { EditorConfig, PluginConstructor } from 'ckeditor5';\n\nimport { AngularIntegrationUsageDataPlugin } from './angular-integration-usage-data.plugin';\n\n/**\n * Appends all integration plugins to the editor configuration.\n *\n * @param editorConfig The editor configuration.\n * @returns The editor configuration with all integration plugins appended.\n */\nexport function appendAllIntegrationPluginsToConfig( editorConfig: EditorConfig ): EditorConfig {\n\tconst extraPlugins: Array<PluginConstructor> = [];\n\n\tif ( !isCKEditorFreeLicense( editorConfig.licenseKey ) ) {\n\t\t/**\n\t\t * This part of the code is not executed in open-source implementations using a GPL key.\n\t\t * It only runs when a specific license key is provided. If you are uncertain whether\n\t\t * this applies to your installation, please contact our support team.\n\t\t */\n\t\textraPlugins.push( AngularIntegrationUsageDataPlugin );\n\t}\n\n\treturn appendExtraPluginsToEditorConfig( editorConfig, extraPlugins );\n}\n","/**\n * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\nimport {\n\tComponent,\n\tElementRef,\n\tEventEmitter,\n\tforwardRef,\n\tInject,\n\tInput,\n\tNgZone,\n\tOutput,\n\ttype AfterViewInit,\n\ttype OnChanges,\n\ttype OnDestroy,\n\ttype SimpleChanges\n} from '@angular/core';\n\nimport { first } from 'rxjs/operators';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\n\nimport type {\n\tContextWatchdog,\n\tEditorWatchdog,\n\tWatchdogConfig,\n\tEditor,\n\tEditorConfig,\n\tGetEventInfo,\n\tModelDocumentChangeEvent,\n\tEditorWatchdogCreatorFunction,\n\tViewDocumentBlurEvent,\n\tViewDocumentFocusEvent\n} from 'ckeditor5';\nimport type { ControlValueAccessor } from '@angular/forms';\n\nimport { uid } from '@ckeditor/ckeditor5-integrations-common';\nimport { appendAllIntegrationPluginsToConfig } from './plugins/append-all-integration-plugins-to-config';\n\nconst ANGULAR_INTEGRATION_READ_ONLY_LOCK_ID = 'Lock from Angular integration (@ckeditor/ckeditor5-angular)';\n\nexport interface BlurEvent<TEditor extends Editor = Editor> {\n\tevent: GetEventInfo<ViewDocumentBlurEvent>;\n\teditor: TEditor;\n}\n\nexport interface FocusEvent<TEditor extends Editor = Editor> {\n\tevent: GetEventInfo<ViewDocumentFocusEvent>;\n\teditor: TEditor;\n}\n\nexport interface ChangeEvent<TEditor extends Editor = Editor> {\n\tevent: GetEventInfo<ModelDocumentChangeEvent>;\n\teditor: TEditor;\n}\n\n@Component( {\n\tselector: 'ckeditor',\n\ttemplate: '<ng-template></ng-template>',\n\n\t// Integration with @angular/forms.\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: forwardRef( () => CKEditorComponent ),\n\t\t\tmulti: true\n\t\t}\n\t]\n} )\nexport class CKEditorComponent<TEditor extends Editor = Editor> implements AfterViewInit, OnDestroy, OnChanges, ControlValueAccessor {\n\t/**\n\t * The reference to the DOM element created by the component.\n\t */\n\tprivate elementRef!: ElementRef<HTMLElement>;\n\n\t/**\n\t * The constructor of the editor to be used for the instance of the component.\n\t * It can be e.g. the `ClassicEditorBuild`, `InlineEditorBuild` or some custom editor.\n\t */\n\t@Input() public editor?: {\n\t\tcreate( sourceElementOrData: HTMLElement | string, config?: EditorConfig ): Promise<TEditor>;\n\t\tEditorWatchdog: typeof EditorWatchdog;\n\t};\n\n\t/**\n\t * The configuration of the editor.\n\t * See https://ckeditor.com/docs/ckeditor5/latest/api/module_core_editor_editorconfig-EditorConfig.html\n\t * to learn more.\n\t */\n\t@Input() public config: EditorConfig = {\n\t\tlicenseKey: 'GPL'\n\t};\n\n\t/**\n\t * The initial data of the editor. Useful when not using the ngModel.\n\t * See https://angular.io/api/forms/NgModel to learn more.\n\t */\n\t@Input() public data = '';\n\n\t/**\n\t * Tag name of the editor component.\n\t *\n\t * The default tag is 'div'.\n\t */\n\t@Input() public tagName = 'div';\n\n\t// TODO Change to ContextWatchdog<Editor, HTMLElement> after new ckeditor5 alpha release\n\t/**\n\t * The context watchdog.\n\t */\n\t@Input() public watchdog?: ContextWatchdog;\n\n\t/**\n\t * Config for the EditorWatchdog.\n\t */\n\t@Input() public editorWatchdogConfig?: WatchdogConfig;\n\n\t/**\n\t * Allows disabling the two-way data binding mechanism. Disabling it can boost performance for large documents.\n\t *\n\t * When a component is connected using the [(ngModel)] or [formControl] directives and this value is set to true then none of the data\n\t * will ever be synchronized.\n\t *\n\t * An integrator must call `editor.data.get()` manually once the application needs the editor's data.\n\t * An editor instance can be received in the `ready()` callback.\n\t */\n\t@Input() public disableTwoWayDataBinding = false;\n\n\t/**\n\t * When set `true`, the editor becomes read-only.\n\t * See https://ckeditor.com/docs/ckeditor5/latest/api/module_core_editor_editor-Editor.html#member-isReadOnly\n\t * to learn more.\n\t */\n\t@Input() public set disabled( isDisabled: boolean ) {\n\t\tthis.setDisabledState( isDisabled );\n\t}\n\n\tpublic get disabled(): boolean {\n\t\tif ( this.editorInstance ) {\n\t\t\treturn this.editorInstance.isReadOnly;\n\t\t}\n\n\t\treturn this.initiallyDisabled;\n\t}\n\n\t/**\n\t * Fires when the editor is ready. It corresponds with the `editor#ready`\n\t * https://ckeditor.com/docs/ckeditor5/latest/api/module_core_editor_editor-Editor.html#event-ready\n\t * event.\n\t */\n\t@Output() public ready = new EventEmitter<TEditor>();\n\n\t/**\n\t * Fires when the content of the editor has changed. It corresponds with the `editor.model.document#change`\n\t * https://ckeditor.com/docs/ckeditor5/latest/api/module_engine_model_document-Document.html#event-change\n\t * event.\n\t */\n\t@Output() public change = new EventEmitter<ChangeEvent<TEditor>>();\n\n\t/**\n\t * Fires when the editing view of the editor is blurred. It corresponds with the `editor.editing.view.document#blur`\n\t * https://ckeditor.com/docs/ckeditor5/latest/api/module_engine_view_document-Document.html#event-event:blur\n\t * event.\n\t */\n\t@Output() public blur = new EventEmitter<BlurEvent<TEditor>>();\n\n\t/**\n\t * Fires when the editing view of the editor is focused. It corresponds with the `editor.editing.view.document#focus`\n\t * https://ckeditor.com/docs/ckeditor5/latest/api/module_engine_view_document-Document.html#event-event:focus\n\t * event.\n\t */\n\t@Output() public focus = new EventEmitter<FocusEvent<TEditor>>();\n\n\t/**\n\t * Fires when the editor component crashes.\n\t */\n\t@Output() public error = new EventEmitter<unknown>();\n\n\t/**\n\t * The instance of the editor created by this component.\n\t */\n\tpublic get editorInstance(): TEditor | null {\n\t\tlet editorWatchdog = this.editorWatchdog;\n\n\t\tif ( this.watchdog ) {\n\t\t\t// Temporarily use the `_watchdogs` internal map as the `getItem()` method throws\n\t\t\t// an error when the item is not registered yet.\n\t\t\t// See https://github.com/ckeditor/ckeditor5-angular/issues/177.\n\t\t\t// TODO should be able to change when new chages in Watcdog are released.\n\t\t\teditorWatchdog = ( this.watchdog as any )._watchdogs.get( this.id );\n\t\t}\n\n\t\tif ( editorWatchdog ) {\n\t\t\treturn editorWatchdog.editor;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * The editor watchdog. It is created when the context watchdog is not passed to the component.\n\t * It keeps the editor running.\n\t */\n\tprivate editorWatchdog?: EditorWatchdog<TEditor>;\n\n\t/**\n\t * If the component is read–only before the editor instance is created, it remembers that state,\n\t * so the editor can become read–only once it is ready.\n\t */\n\tprivate initiallyDisabled = false;\n\n\t/**\n\t * An instance of https://angular.io/api/core/NgZone to allow the interaction with the editor\n\t * withing the Angular event loop.\n\t */\n\tprivate ngZone: NgZone;\n\n\t/**\n\t * A callback executed when the content of the editor changes. Part of the\n\t * `ControlValueAccessor` (https://angular.io/api/forms/ControlValueAccessor) interface.\n\t *\n\t * Note: Unset unless the component uses the `ngModel`.\n\t */\n\tprivate cvaOnChange?: ( data: string ) => void;\n\n\t/**\n\t * A callback executed when the editor has been blurred. Part of the\n\t * `ControlValueAccessor` (https://angular.io/api/forms/ControlValueAccessor) interface.\n\t *\n\t * Note: Unset unless the component uses the `ngModel`.\n\t */\n\tprivate cvaOnTouched?: () => void;\n\n\t/**\n\t * Reference to the source element used by the editor.\n\t */\n\tprivate editorElement?: HTMLElement;\n\n\t/**\n\t * A lock flag preventing from calling the `cvaOnChange()` during setting editor data.\n\t */\n\tprivate isEditorSettingData = false;\n\n\tprivate id = uid();\n\n\tpublic getId(): string {\n\t\treturn this.id;\n\t}\n\n\tpublic constructor( @Inject( ElementRef ) elementRef: ElementRef, @Inject( NgZone ) ngZone: NgZone ) {\n\t\tthis.ngZone = ngZone;\n\t\tthis.elementRef = elementRef;\n\n\t\tthis.checkVersion();\n\t}\n\n\tprivate checkVersion() {\n\t\t// To avoid issues with the community typings and CKEditor 5, let's treat window as any. See #342.\n\t\tconst { CKEDITOR_VERSION } = ( window as any );\n\n\t\tif ( !CKEDITOR_VERSION ) {\n\t\t\treturn console.warn( 'Cannot find the \"CKEDITOR_VERSION\" in the \"window\" scope.' );\n\t\t}\n\n\t\tconst [ major ] = CKEDITOR_VERSION.split( '.' ).map( Number );\n\n\t\tif ( major >= 42 || CKEDITOR_VERSION.startsWith( '0.0.0' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconsole.warn( 'The <CKEditor> component requires using CKEditor 5 in version 42+ or nightly build.' );\n\t}\n\n\t// Implementing the OnChanges interface. Whenever the `data` property is changed, update the editor content.\n\tpublic ngOnChanges( changes: SimpleChanges ): void {\n\t\tif ( Object.prototype.hasOwnProperty.call( changes, 'data' ) && changes.data && !changes.data.isFirstChange() ) {\n\t\t\tthis.writeValue( changes.data.currentValue );\n\t\t}\n\t}\n\n\t// Implementing the AfterViewInit interface.\n\tpublic ngAfterViewInit(): void {\n\t\tthis.attachToWatchdog();\n\t}\n\n\t// Implementing the OnDestroy interface.\n\tpublic async ngOnDestroy(): Promise<void> {\n\t\tif ( this.watchdog ) {\n\t\t\tawait this.watchdog.remove( this.id );\n\t\t} else if ( this.editorWatchdog && this.editorWatchdog.editor ) {\n\t\t\tawait this.editorWatchdog.destroy();\n\n\t\t\tthis.editorWatchdog = undefined;\n\t\t}\n\t}\n\n\t// Implementing the ControlValueAccessor interface (only when binding to ngModel).\n\tpublic writeValue( value: string | null ): void {\n\t\t// This method is called with the `null` value when the form resets.\n\t\t// A component's responsibility is to restore to the initial state.\n\t\tif ( value === null ) {\n\t\t\tvalue = '';\n\t\t}\n\n\t\t// If already initialized.\n\t\tif ( this.editorInstance ) {\n\t\t\t// The lock mechanism prevents from calling `cvaOnChange()` during changing\n\t\t\t// the editor state. See #139\n\t\t\tthis.isEditorSettingData = true;\n\t\t\tthis.editorInstance.data.set( value );\n\t\t\tthis.isEditorSettingData = false;\n\t\t}\n\t\t// If not, wait for it to be ready; store the data.\n\t\telse {\n\t\t\t// If the editor element is already available, then update its content.\n\t\t\tthis.data = value;\n\n\t\t\t// If not, then wait until it is ready\n\t\t\t// and change data only for the first `ready` event.\n\t\t\tthis.ready\n\t\t\t\t.pipe( first() )\n\t\t\t\t.subscribe( editor => {\n\t\t\t\t\teditor.data.set( this.data );\n\t\t\t\t} );\n\t\t}\n\t}\n\n\t// Implementing the ControlValueAccessor interface (only when binding to ngModel).\n\tpublic registerOnChange( callback: ( data: string ) => void ): void {\n\t\tthis.cvaOnChange = callback;\n\t}\n\n\t// Implementing the ControlValueAccessor interface (only when binding to ngModel).\n\tpublic registerOnTouched( callback: () => void ): void {\n\t\tthis.cvaOnTouched = callback;\n\t}\n\n\t// Implementing the ControlValueAccessor interface (only when binding to ngModel).\n\tpublic setDisabledState( isDisabled: boolean ): void {\n\t\t// If already initialized.\n\t\tif ( this.editorInstance ) {\n\t\t\tif ( isDisabled ) {\n\t\t\t\tthis.editorInstance.enableReadOnlyMode( ANGULAR_INTEGRATION_READ_ONLY_LOCK_ID );\n\t\t\t} else {\n\t\t\t\tthis.editorInstance.disableReadOnlyMode( ANGULAR_INTEGRATION_READ_ONLY_LOCK_ID );\n\t\t\t}\n\t\t}\n\n\t\t// Store the state anyway to use it once the editor is created.\n\t\tthis.initiallyDisabled = isDisabled;\n\t}\n\n\t/**\n\t * Creates the editor instance, sets initial editor data, then integrates\n\t * the editor with the Angular component. This method does not use the `editor.data.set()`\n\t * because of the issue in the collaboration mode (#6).\n\t */\n\tprivate attachToWatchdog() {\n\t\t// TODO: elementOrData parameter type can be simplified to HTMLElemen after templated Watchdog will be released.\n\t\tconst creator: EditorWatchdogCreatorFunction<TEditor> = ( ( elementOrData, config ) => {\n\t\t\treturn this.ngZone.runOutsideAngular( async () => {\n\t\t\t\tthis.elementRef.nativeElement.appendChild( elementOrData as HTMLElement );\n\n\t\t\t\tconst editor = await this.editor!.create( elementOrData as HTMLElement, config );\n\n\t\t\t\tif ( this.initiallyDisabled ) {\n\t\t\t\t\teditor.enableReadOnlyMode( ANGULAR_INTEGRATION_READ_ONLY_LOCK_ID );\n\t\t\t\t}\n\n\t\t\t\tthis.ngZone.run( () => {\n\t\t\t\t\tthis.ready.emit( editor );\n\t\t\t\t} );\n\n\t\t\t\tthis.setUpEditorEvents( editor );\n\n\t\t\t\treturn editor;\n\t\t\t} );\n\t\t} );\n\n\t\tconst destructor = async ( editor: Editor ) => {\n\t\t\tawait editor.destroy();\n\n\t\t\tthis.elementRef.nativeElement.removeChild( this.editorElement! );\n\t\t};\n\n\t\tconst emitError = ( e?: unknown ) => {\n\t\t\t// Do not run change detection by re-entering the Angular zone if the `error`\n\t\t\t// emitter doesn't have any subscribers.\n\t\t\t// Subscribers are pushed onto the list whenever `error` is listened inside the template:\n\t\t\t// `<ckeditor (error)=\"onError(...)\"></ckeditor>`.\n\t\t\tif ( hasObservers( this.error ) ) {\n\t\t\t\tthis.ngZone.run( () => this.error.emit( e ) );\n\t\t\t} else {\n\t\t\t\t// Print error to the console when there are no subscribers to the `error` event.\n\t\t\t\tconsole.error( e );\n\t\t\t}\n\t\t};\n\t\tconst element = document.createElement( this.tagName );\n\t\tconst config = this.getConfig();\n\n\t\tthis.editorElement = element;\n\n\t\t// Based on the presence of the watchdog decide how to initialize the editor.\n\t\tif ( this.watchdog ) {\n\t\t\t// When the context watchdog is passed add the new item to it based on the passed configuration.\n\t\t\tthis.watchdog.add( {\n\t\t\t\tid: this.id,\n\t\t\t\ttype: 'editor',\n\t\t\t\tcreator,\n\t\t\t\tdestructor,\n\t\t\t\tsourceElementOrData: element,\n\t\t\t\tconfig\n\t\t\t} ).catch( e => {\n\t\t\t\temitError( e );\n\t\t\t} );\n\n\t\t\tthis.watchdog.on( 'itemError', ( _, { itemId } ) => {\n\t\t\t\tif ( itemId === this.id ) {\n\t\t\t\t\temitError();\n\t\t\t\t}\n\t\t\t} );\n\t\t} else {\n\t\t\t// In the other case create the watchdog by hand to keep the editor running.\n\t\t\tconst editorWatchdog = new this.editor!.EditorWatchdog(\n\t\t\t\tthis.editor!,\n\t\t\t\tthis.editorWatchdogConfig\n\t\t\t);\n\n\t\t\teditorWatchdog.setCreator( creator );\n\t\t\teditorWatchdog.setDestructor( destructor );\n\t\t\teditorWatchdog.on( 'error', emitError );\n\n\t\t\tthis.editorWatchdog = editorWatchdog;\n\t\t\tthis.ngZone.runOutsideAngular( () => {\n\t\t\t\t// Note: must be called outside of the Angular zone too because `create` is calling\n\t\t\t\t// `_startErrorHandling` within a microtask which sets up `error` listener on the window.\n\t\t\t\teditorWatchdog.create( element, config ).catch( e => {\n\t\t\t\t\temitError( e );\n\t\t\t\t} );\n\t\t\t} );\n\t\t}\n\t}\n\n\tprivate getConfig() {\n\t\tif ( this.data && this.config.initialData ) {\n\t\t\tthrow new Error( 'Editor data should be provided either using `config.initialData` or `data` properties.' );\n\t\t}\n\n\t\tconst config = { ...this.config };\n\n\t\t// Merge two possible ways of providing data into the `config.initialData` field.\n\t\tconst initialData = this.config.initialData || this.data;\n\n\t\tif ( initialData ) {\n\t\t\t// Define the `config.initialData` only when the initial content is specified.\n\t\t\tconfig.initialData = initialData;\n\t\t}\n\n\t\treturn appendAllIntegrationPluginsToConfig( config );\n\t}\n\n\t/**\n\t * Integrates the editor with the component by attaching related event listeners.\n\t */\n\tprivate setUpEditorEvents( editor: TEditor ): void {\n\t\tconst modelDocument = editor.model.document;\n\t\tconst viewDocument = editor.editing.view.document;\n\n\t\tmodelDocument.on<ModelDocumentChangeEvent>( 'change:data', evt => {\n\t\t\tthis.ngZone.run( () => {\n\t\t\t\tif ( this.disableTwoWayDataBinding ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( this.cvaOnChange && !this.isEditorSettingData ) {\n\t\t\t\t\tconst data = editor.data.get();\n\n\t\t\t\t\tthis.cvaOnChange( data );\n\t\t\t\t}\n\n\t\t\t\tthis.change.emit( { event: evt, editor } );\n\t\t\t} );\n\t\t} );\n\n\t\tviewDocument.on<ViewDocumentFocusEvent>( 'focus', evt => {\n\t\t\tthis.ngZone.run( () => {\n\t\t\t\tthis.focus.emit( { event: evt, editor } );\n\t\t\t} );\n\t\t} );\n\n\t\tviewDocument.on<ViewDocumentBlurEvent>( 'blur', evt => {\n\t\t\tthis.ngZone.run( () => {\n\t\t\t\tif ( this.cvaOnTouched ) {\n\t\t\t\t\tthis.cvaOnTouched();\n\t\t\t\t}\n\n\t\t\t\tthis.blur.emit( { event: evt, editor } );\n\t\t\t} );\n\t\t} );\n\t}\n}\n\nfunction hasObservers<T>( emitter: EventEmitter<T> ): boolean {\n\t// Cast to `any` because `observed` property is available in RxJS >= 7.2.0.\n\t// Fallback to checking `observers` list if this property is not defined.\n\treturn ( emitter as any ).observed || emitter.observers.length > 0;\n}\n","/**\n * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\nimport { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\nimport { CKEditorComponent } from './ckeditor.component';\n\n@NgModule( {\n\timports: [ FormsModule, CommonModule ],\n\tdeclarations: [ CKEditorComponent ],\n\texports: [ CKEditorComponent ]\n} )\nexport class CKEditorModule {}\n","/**\n * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\nexport * from './ckeditor.component';\nexport * from './ckeditor.module';\n\nexport {\n\tloadCKEditorCloud,\n\ttype CKEditorCloudResult,\n\ttype CKEditorCloudConfig\n} from '@ckeditor/ckeditor5-integrations-common';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAAA;;;AAGG;AAKH;;;;AAIG;AACI,MAAM,iCAAiC,GAAG,gCAAgC,CAChF,SAAS,EACT;AACC,IAAA,OAAO,8BAA8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