{"version":3,"sources":["webpack:///./node_modules/@ckeditor/ckeditor5-undo/theme/icons/redo.svg","webpack:///./node_modules/@ckeditor/ckeditor5-upload/src/adapters/base64uploadadapter.js","webpack:///./node_modules/@ckeditor/ckeditor5-upload/src/adapters/simpleuploadadapter.js","webpack:///./node_modules/@ckeditor/ckeditor5-undo/theme/icons/undo.svg"],"names":["module","exports","Plugin","Adapter","loader","Object","D_Projects_UA_repo_Source_Client_UA_User_Web_node_modules_babel_runtime_helpers_esm_classCallCheck_js__WEBPACK_IMPORTED_MODULE_1__","this","_this","Promise","resolve","reject","reader","window","FileReader","addEventListener","default","result","err","file","then","readAsDataURL","abort","SimpleUploadAdapter","options","editor","config","get","uploadUrl","plugins","FileRepository","createUploadAdapter","logWarning","D_Projects_UA_repo_Source_Client_UA_User_Web_node_modules_babel_runtime_helpers_esm_classCallCheck_js__WEBPACK_IMPORTED_MODULE_6__","_initRequest","_initListeners","_sendRequest","xhr","XMLHttpRequest","open","responseType","genericErrorText","concat","name","response","error","message","urls","url","_objectSpread","upload","evt","lengthComputable","uploadTotal","total","uploaded","loaded","headers","withCredentials","_i","_Object$keys","keys","length","headerName","setRequestHeader","data","FormData","append","send"],"mappings":"mGAAAA,EAAAC,QAAA;;;;GC0BiDC,WA6B3CC,aAML,SAAAA,EAAaC,GAASC,OAAAC,EAAA,KAAAD,CAAAE,KAAAJ,GAMrBI,KAAKH,OAASA,+CASf,WAAS,IAAAI,EAAAD,KACR,OAAO,IAAIE,QAAS,SAAEC,EAASC,GAC9B,IAAMC,EAASJ,EAAKI,OAAS,IAAIC,OAAOC,WAExCF,EAAOG,iBAAkB,OAAQ,WAChCL,GAAWM,QAASJ,EAAOK,WAG5BL,EAAOG,iBAAkB,QAAS,SAAAG,GACjCP,EAAQO,KAGTN,EAAOG,iBAAkB,QAAS,WACjCJ,MAGDH,EAAKJ,OAAOe,KAAKC,KAAM,SAAAD,GACtBP,EAAOS,cAAeF,4BAWzB,WACCZ,KAAKK,OAAOU;;;;O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YAMGV,EAAIa,QACRb,EAAIa,OAAOnC,iBAAkB,WAAY,SAAAoC,GACnCA,EAAIC,mBACRhD,EAAOiD,YAAcF,EAAIG,MACzBlD,EAAOmD,SAAWJ,EAAIK,sCAY1B,SAAcrC,GAOb,IALA,IAAMsC,EAAUlD,KAAKiB,QAAQiC,YAGvBC,EAAkBnD,KAAKiB,QAAQkC,kBAAmB,EAExDC,EAAA,EAAAC,EAA0BvD,OAAOwD,KAAMJ,GAAvCE,EAAAC,EAAAE,OAAAH,IAAmD,CAA7C,IAAMI,EAAUH,EAAAD,GACrBpD,KAAK8B,IAAI2B,iBAAkBD,EAAYN,EAASM,IAGjDxD,KAAK8B,IAAIqB,gBAAkBA,EAG3B,IAAMO,EAAO,IAAIC,SAEjBD,EAAKE,OAAQ,SAAUhD,GAGvBZ,KAAK8B,IAAI+B,KAAMH,gCC/NjBjE,EAAAC,QAAA","file":"js/chunk-434a88ee.65ac5fb3.js","sourcesContent":["module.exports = \"\"","/**\n * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module upload/adapters/base64uploadadapter\n */\n\n/* globals window */\n\nimport Plugin from '@ckeditor/ckeditor5-core/src/plugin';\nimport FileRepository from '../filerepository';\n\n/**\n * A plugin that converts images inserted into the editor into [Base64 strings](https://en.wikipedia.org/wiki/Base64)\n * in the {@glink builds/guides/integration/saving-data editor output}.\n *\n * This kind of image upload does not require server processing – images are stored with the rest of the text and\n * displayed by the web browser without additional requests.\n *\n * Check out the {@glink features/images/image-upload/image-upload comprehensive \"Image upload overview\"} to learn about\n * other ways to upload images into CKEditor 5.\n *\n * @extends module:core/plugin~Plugin\n */\nexport default class Base64UploadAdapter extends Plugin {\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get requires() {\n\t\treturn [ FileRepository ];\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get pluginName() {\n\t\treturn 'Base64UploadAdapter';\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tinit() {\n\t\tthis.editor.plugins.get( FileRepository ).createUploadAdapter = loader => new Adapter( loader );\n\t}\n}\n\n/**\n * The upload adapter that converts images inserted into the editor into Base64 strings.\n *\n * @private\n * @implements module:upload/filerepository~UploadAdapter\n */\nclass Adapter {\n\t/**\n\t * Creates a new adapter instance.\n\t *\n\t * @param {module:upload/filerepository~FileLoader} loader\n\t */\n\tconstructor( loader ) {\n\t\t/**\n\t\t * `FileLoader` instance to use during the upload.\n\t\t *\n\t\t * @member {module:upload/filerepository~FileLoader} #loader\n\t\t */\n\t\tthis.loader = loader;\n\t}\n\n\t/**\n\t * Starts the upload process.\n\t *\n\t * @see module:upload/filerepository~UploadAdapter#upload\n\t * @returns {Promise}\n\t */\n\tupload() {\n\t\treturn new Promise( ( resolve, reject ) => {\n\t\t\tconst reader = this.reader = new window.FileReader();\n\n\t\t\treader.addEventListener( 'load', () => {\n\t\t\t\tresolve( { default: reader.result } );\n\t\t\t} );\n\n\t\t\treader.addEventListener( 'error', err => {\n\t\t\t\treject( err );\n\t\t\t} );\n\n\t\t\treader.addEventListener( 'abort', () => {\n\t\t\t\treject();\n\t\t\t} );\n\n\t\t\tthis.loader.file.then( file => {\n\t\t\t\treader.readAsDataURL( file );\n\t\t\t} );\n\t\t} );\n\t}\n\n\t/**\n\t * Aborts the upload process.\n\t *\n\t * @see module:upload/filerepository~UploadAdapter#abort\n\t * @returns {Promise}\n\t */\n\tabort() {\n\t\tthis.reader.abort();\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module upload/adapters/simpleuploadadapter\n */\n\n/* globals XMLHttpRequest, FormData */\n\nimport Plugin from '@ckeditor/ckeditor5-core/src/plugin';\nimport FileRepository from '../filerepository';\nimport { logWarning } from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\n\n/**\n * The Simple upload adapter allows uploading images to an application running on your server using\n * the [`XMLHttpRequest`](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest) API with a\n * minimal {@link module:upload/adapters/simpleuploadadapter~SimpleUploadConfig editor configuration}.\n *\n *\t\tClassicEditor\n *\t\t\t.create( document.querySelector( '#editor' ), {\n *\t\t\t\tsimpleUpload: {\n *\t\t\t\t\tuploadUrl: 'http://example.com',\n *\t\t\t\t\theaders: {\n *\t\t\t\t\t\t...\n *\t\t\t\t\t}\n *\t\t\t\t}\n *\t\t\t} )\n *\t\t\t.then( ... )\n *\t\t\t.catch( ... );\n *\n * See the {@glink features/images/image-upload/simple-upload-adapter \"Simple upload adapter\"} guide to learn how to\n * learn more about the feature (configuration, server–side requirements, etc.).\n *\n * Check out the {@glink features/images/image-upload/image-upload comprehensive \"Image upload overview\"} to learn about\n * other ways to upload images into CKEditor 5.\n *\n * @extends module:core/plugin~Plugin\n */\nexport default class SimpleUploadAdapter extends Plugin {\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get requires() {\n\t\treturn [ FileRepository ];\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get pluginName() {\n\t\treturn 'SimpleUploadAdapter';\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tinit() {\n\t\tconst options = this.editor.config.get( 'simpleUpload' );\n\n\t\tif ( !options ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( !options.uploadUrl ) {\n\t\t\t/**\n\t\t\t * The {@link module:upload/adapters/simpleuploadadapter~SimpleUploadConfig#uploadUrl `config.simpleUpload.uploadUrl`}\n\t\t\t * configuration required by the {@link module:upload/adapters/simpleuploadadapter~SimpleUploadAdapter `SimpleUploadAdapter`}\n\t\t\t * is missing. Make sure the correct URL is specified for the image upload to work properly.\n\t\t\t *\n\t\t\t * @error simple-upload-adapter-missing-uploadurl\n\t\t\t */\n\t\t\tlogWarning( 'simple-upload-adapter-missing-uploadurl' );\n\n\t\t\treturn;\n\t\t}\n\n\t\tthis.editor.plugins.get( FileRepository ).createUploadAdapter = loader => {\n\t\t\treturn new Adapter( loader, options );\n\t\t};\n\t}\n}\n\n/**\n * Upload adapter.\n *\n * @private\n * @implements module:upload/filerepository~UploadAdapter\n */\nclass Adapter {\n\t/**\n\t * Creates a new adapter instance.\n\t *\n\t * @param {module:upload/filerepository~FileLoader} loader\n\t * @param {module:upload/adapters/simpleuploadadapter~SimpleUploadConfig} options\n\t */\n\tconstructor( loader, options ) {\n\t\t/**\n\t\t * FileLoader instance to use during the upload.\n\t\t *\n\t\t * @member {module:upload/filerepository~FileLoader} #loader\n\t\t */\n\t\tthis.loader = loader;\n\n\t\t/**\n\t\t * The configuration of the adapter.\n\t\t *\n\t\t * @member {module:upload/adapters/simpleuploadadapter~SimpleUploadConfig} #options\n\t\t */\n\t\tthis.options = options;\n\t}\n\n\t/**\n\t * Starts the upload process.\n\t *\n\t * @see module:upload/filerepository~UploadAdapter#upload\n\t * @returns {Promise}\n\t */\n\tupload() {\n\t\treturn this.loader.file\n\t\t\t.then( file => new Promise( ( resolve, reject ) => {\n\t\t\t\tthis._initRequest();\n\t\t\t\tthis._initListeners( resolve, reject, file );\n\t\t\t\tthis._sendRequest( file );\n\t\t\t} ) );\n\t}\n\n\t/**\n\t * Aborts the upload process.\n\t *\n\t * @see module:upload/filerepository~UploadAdapter#abort\n\t * @returns {Promise}\n\t */\n\tabort() {\n\t\tif ( this.xhr ) {\n\t\t\tthis.xhr.abort();\n\t\t}\n\t}\n\n\t/**\n\t * Initializes the `XMLHttpRequest` object using the URL specified as\n\t * {@link module:upload/adapters/simpleuploadadapter~SimpleUploadConfig#uploadUrl `simpleUpload.uploadUrl`} in the editor's\n\t * configuration.\n\t *\n\t * @private\n\t */\n\t_initRequest() {\n\t\tconst xhr = this.xhr = new XMLHttpRequest();\n\n\t\txhr.open( 'POST', this.options.uploadUrl, true );\n\t\txhr.responseType = 'json';\n\t}\n\n\t/**\n\t * Initializes XMLHttpRequest listeners\n\t *\n\t * @private\n\t * @param {Function} resolve Callback function to be called when the request is successful.\n\t * @param {Function} reject Callback function to be called when the request cannot be completed.\n\t * @param {File} file Native File object.\n\t */\n\t_initListeners( resolve, reject, file ) {\n\t\tconst xhr = this.xhr;\n\t\tconst loader = this.loader;\n\t\tconst genericErrorText = `Couldn't upload file: ${ file.name }.`;\n\n\t\txhr.addEventListener( 'error', () => reject( genericErrorText ) );\n\t\txhr.addEventListener( 'abort', () => reject() );\n\t\txhr.addEventListener( 'load', () => {\n\t\t\tconst response = xhr.response;\n\n\t\t\tif ( !response || response.error ) {\n\t\t\t\treturn reject( response && response.error && response.error.message ? response.error.message : genericErrorText );\n\t\t\t}\n\n\t\t\tconst urls = response.url ? { default: response.url } : response.urls;\n\n\t\t\t// Resolve with the normalized `urls` property and pass the rest of the response\n\t\t\t// to allow customizing the behavior of features relying on the upload adapters.\n\t\t\tresolve( {\n\t\t\t\t...response,\n\t\t\t\turls\n\t\t\t} );\n\t\t} );\n\n\t\t// Upload progress when it is supported.\n\t\t/* istanbul ignore else */\n\t\tif ( xhr.upload ) {\n\t\t\txhr.upload.addEventListener( 'progress', evt => {\n\t\t\t\tif ( evt.lengthComputable ) {\n\t\t\t\t\tloader.uploadTotal = evt.total;\n\t\t\t\t\tloader.uploaded = evt.loaded;\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t}\n\n\t/**\n\t * Prepares the data and sends the request.\n\t *\n\t * @private\n\t * @param {File} file File instance to be uploaded.\n\t */\n\t_sendRequest( file ) {\n\t\t// Set headers if specified.\n\t\tconst headers = this.options.headers || {};\n\n\t\t// Use the withCredentials flag if specified.\n\t\tconst withCredentials = this.options.withCredentials || false;\n\n\t\tfor ( const headerName of Object.keys( headers ) ) {\n\t\t\tthis.xhr.setRequestHeader( headerName, headers[ headerName ] );\n\t\t}\n\n\t\tthis.xhr.withCredentials = withCredentials;\n\n\t\t// Prepare the form data.\n\t\tconst data = new FormData();\n\n\t\tdata.append( 'upload', file );\n\n\t\t// Send the request.\n\t\tthis.xhr.send( data );\n\t}\n}\n\n/**\n * The configuration of the {@link module:upload/adapters/simpleuploadadapter~SimpleUploadAdapter simple upload adapter}.\n *\n *\t\tClassicEditor\n *\t\t\t.create( editorElement, {\n *\t\t\t\tsimpleUpload: {\n *\t\t\t\t\t// The URL the images are uploaded to.\n *\t\t\t\t\tuploadUrl: 'http://example.com',\n *\n *\t\t\t\t\t// Headers sent along with the XMLHttpRequest to the upload server.\n *\t\t\t\t\theaders: {\n *\t\t\t\t\t\t...\n *\t\t\t\t\t}\n *\t\t\t\t}\n *\t\t\t} );\n *\t\t\t.then( ... )\n *\t\t\t.catch( ... );\n *\n * See the {@glink features/images/image-upload/simple-upload-adapter \"Simple upload adapter\"} guide to learn more.\n *\n * See {@link module:core/editor/editorconfig~EditorConfig all editor configuration options}.\n *\n * @interface SimpleUploadConfig\n */\n\n/**\n * The configuration of the {@link module:upload/adapters/simpleuploadadapter~SimpleUploadAdapter simple upload adapter}.\n *\n * Read more in {@link module:upload/adapters/simpleuploadadapter~SimpleUploadConfig}.\n *\n * @member {module:upload/adapters/simpleuploadadapter~SimpleUploadConfig} module:core/editor/editorconfig~EditorConfig#simpleUpload\n */\n\n/**\n * The path (URL) to the server (application) which handles the file upload. When specified, enables the automatic\n * upload of resources (images) inserted into the editor content.\n *\n * Learn more about the server application requirements in the\n * {@glink features/images/image-upload/simple-upload-adapter#server-side-configuration \"Server-side configuration\"} section\n * of the feature guide.\n *\n * @member {String} module:upload/adapters/simpleuploadadapter~SimpleUploadConfig#uploadUrl\n */\n\n/**\n * An object that defines additional [headers](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers) sent with\n * the request to the server during the upload. This is the right place to implement security mechanisms like\n * authentication and [CSRF](https://developer.mozilla.org/en-US/docs/Glossary/CSRF) protection.\n *\n *\t\tClassicEditor\n *\t\t\t.create( editorElement, {\n *\t\t\t\tsimpleUpload: {\n *\t\t\t\t\theaders: {\n *\t\t\t\t\t\t'X-CSRF-TOKEN': 'CSRF-Token',\n *\t\t\t\t\t\tAuthorization: 'Bearer '\n *\t\t\t\t\t}\n *\t\t\t\t}\n *\t\t\t} );\n *\t\t\t.then( ... )\n *\t\t\t.catch( ... );\n *\n * Learn more about the server application requirements in the\n * {@glink features/images/image-upload/simple-upload-adapter#server-side-configuration \"Server-side configuration\"} section\n * of the feature guide.\n *\n * @member {Object.} module:upload/adapters/simpleuploadadapter~SimpleUploadConfig#headers\n */\n\n/**\n * This flag enables the\n * [`withCredentials`](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials)\n * property of the request sent to the server during the upload. It affects cross-site requests only and, for instance,\n * allows credentials such as cookies to be sent along with the request.\n *\n *\t\tClassicEditor\n *\t\t\t.create( editorElement, {\n *\t\t\t\tsimpleUpload: {\n *\t\t\t\t\twithCredentials: true\n *\t\t\t\t}\n *\t\t\t} );\n *\t\t\t.then( ... )\n *\t\t\t.catch( ... );\n *\n * Learn more about the server application requirements in the\n * {@glink features/images/image-upload/simple-upload-adapter#server-side-configuration \"Server-side configuration\"} section\n * of the feature guide.\n *\n * @member {Boolean} [module:upload/adapters/simpleuploadadapter~SimpleUploadConfig#withCredentials=false]\n */\n","module.exports = \"\""],"sourceRoot":""}