UNPKG

@ckeditor/ckeditor5-ai

Version:

AI features for CKEditor 5.

23 lines 4.54 kB
/* * Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved. * * * * * +---------------------------------------------------------------------------------+ * | | * | Hello stranger! | * | | * | | * | What you're currently looking at is the source code of a legally protected, | * | proprietary software. Any attempts to deobfuscate / disassemble this code | * | are forbidden and will result in legal consequences. | * | | * | | * +---------------------------------------------------------------------------------+ * * * * */ const _0x3c06f7=_0x2ef4;function _0x2ef4(_0x47099c,_0x1cce9e){const _0x21dbd5=_0x21db();return _0x2ef4=function(_0x2ef439,_0x2eda87){_0x2ef439=_0x2ef439-0x84;let _0x4a0e7c=_0x21dbd5[_0x2ef439];return _0x4a0e7c;},_0x2ef4(_0x47099c,_0x1cce9e);}(function(_0x5a6519,_0xcf4bca){const _0x2b0b93=_0x2ef4,_0xe9149a=_0x5a6519();while(!![]){try{const _0x351319=-parseInt(_0x2b0b93(0x85))/0x1+-parseInt(_0x2b0b93(0x84))/0x2+parseInt(_0x2b0b93(0xa5))/0x3*(-parseInt(_0x2b0b93(0x9a))/0x4)+-parseInt(_0x2b0b93(0x87))/0x5+-parseInt(_0x2b0b93(0xa4))/0x6+-parseInt(_0x2b0b93(0x8f))/0x7+-parseInt(_0x2b0b93(0x96))/0x8*(-parseInt(_0x2b0b93(0x9b))/0x9);if(_0x351319===_0xcf4bca)break;else _0xe9149a['push'](_0xe9149a['shift']());}catch(_0x248970){_0xe9149a['push'](_0xe9149a['shift']());}}}(_0x21db,0x52659));import{Plugin as _0x5b64a2}from'ckeditor5/src/core.js';import{CKEditorError as _0x466e38}from'ckeditor5/src/utils.js';function _0x21db(){const _0x33fb58=['AI_ERROR_GET_HEADERS','makeRequest','resolve','assign','catch','signal','3545654BvgFFQ','name','_prepareRequestParameters','plugins','aitextadapter-send-request-failed','object','requires','8PjzkVt','locale','error','get','528PRYexD','20985273lhfCSg','abort','_prepareRequestHeaders','application/json','abortController','init','AI_ERROR_GET_PARAMETERS','editor','textAdapter','3225318XsPZqp','1605iayhiV','reject','aborted','165764uKhmQa','556692UggJbf','AbortError','1199655ubfPTY','sendRequest'];_0x21db=function(){return _0x33fb58;};return _0x21db();}import{AIAdapter as _0x4c57fa,AIRequestError as _0x595db6}from'./aiadapter.js';import{getTranslation as _0x3348a5}from'../utils/common-translations.js';export class AITextAdapter extends _0x5b64a2{[_0x3c06f7(0x9f)];static get[_0x3c06f7(0x95)](){return[_0x4c57fa];}constructor(_0x421fc5){const _0x4c4ade=_0x3c06f7;super(_0x421fc5),this[_0x4c4ade(0x9f)]=new AbortController();}[_0x3c06f7(0xa0)](){const _0x409cfb=_0x3c06f7;this[_0x409cfb(0xa2)][_0x409cfb(0x92)][_0x409cfb(0x99)](_0x4c57fa)[_0x409cfb(0xa3)]=this;}[_0x3c06f7(0x9c)](){const _0x30f802=_0x3c06f7;this[_0x30f802(0x9f)][_0x30f802(0x8e)][_0x30f802(0xa7)]||(this[_0x30f802(0x9f)][_0x30f802(0x9c)](),this[_0x30f802(0x9f)]=new AbortController());}async[_0x3c06f7(0x8a)](_0x322a9b){const _0x19d1f0=_0x3c06f7;return this[_0x19d1f0(0x88)](_0x322a9b)[_0x19d1f0(0x8d)](_0x2d77da=>{const _0x488a32=_0x19d1f0;if(_0x2d77da instanceof _0x595db6)return Promise[_0x488a32(0xa6)](_0x2d77da);if(_0x488a32(0x86)==_0x2d77da[_0x488a32(0x90)])return Promise[_0x488a32(0x8b)]();throw console[_0x488a32(0x98)](_0x2d77da),new _0x466e38(_0x488a32(0x93),null);});}async[_0x3c06f7(0x9d)](_0x32fbb3,_0x1eb41e){const _0x31b533=_0x3c06f7,_0xd78a4a=this[_0x31b533(0xa2)][_0x31b533(0x97)],_0x56196e={'Content-Type':_0x31b533(0x9e)};if(_0x31b533(0x94)==typeof _0x32fbb3)Object[_0x31b533(0x8c)](_0x56196e,_0x32fbb3);else{if(_0x32fbb3)try{const _0x5427d9=await _0x32fbb3(_0x1eb41e);Object[_0x31b533(0x8c)](_0x56196e,_0x5427d9);}catch{return Promise[_0x31b533(0xa6)](new _0x595db6(_0x3348a5(_0xd78a4a,_0x31b533(0x89))));}}return _0x56196e;}async[_0x3c06f7(0x91)](_0x5161a8,_0x36f3a7){const _0x478832=_0x3c06f7,_0x5946d1=this[_0x478832(0xa2)][_0x478832(0x97)];if(_0x478832(0x94)==typeof _0x5161a8)return _0x5161a8;try{return await _0x5161a8(_0x36f3a7);}catch{return Promise[_0x478832(0xa6)](new _0x595db6(_0x3348a5(_0x5946d1,_0x478832(0xa1))));}}}