@ckeditor/ckeditor5-ai 0.0.0-nightly-20240116.0 → 0.0.0-nightly-20240118.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/LICENSE.md +13 -5
  2. package/README.md +9 -10
  3. package/build/ai.js +6 -6
  4. package/build/translations/ar.js +1 -1
  5. package/build/translations/bg.js +1 -1
  6. package/build/translations/bn.js +1 -1
  7. package/build/translations/ca.js +1 -1
  8. package/build/translations/cs.js +1 -1
  9. package/build/translations/da.js +1 -1
  10. package/build/translations/de.js +1 -1
  11. package/build/translations/el.js +1 -1
  12. package/build/translations/es.js +1 -1
  13. package/build/translations/et.js +1 -1
  14. package/build/translations/fi.js +1 -1
  15. package/build/translations/fr.js +1 -1
  16. package/build/translations/he.js +1 -1
  17. package/build/translations/hi.js +1 -1
  18. package/build/translations/hu.js +1 -1
  19. package/build/translations/id.js +1 -1
  20. package/build/translations/it.js +1 -1
  21. package/build/translations/ja.js +1 -1
  22. package/build/translations/ko.js +1 -1
  23. package/build/translations/lt.js +1 -1
  24. package/build/translations/lv.js +1 -1
  25. package/build/translations/ms.js +1 -1
  26. package/build/translations/nl.js +1 -1
  27. package/build/translations/no.js +1 -1
  28. package/build/translations/pl.js +1 -1
  29. package/build/translations/pt-br.js +1 -1
  30. package/build/translations/pt.js +1 -1
  31. package/build/translations/ro.js +1 -1
  32. package/build/translations/ru.js +1 -1
  33. package/build/translations/sk.js +1 -1
  34. package/build/translations/sr.js +1 -1
  35. package/build/translations/sv.js +1 -1
  36. package/build/translations/th.js +1 -1
  37. package/build/translations/tr.js +1 -1
  38. package/build/translations/uk.js +1 -1
  39. package/build/translations/vi.js +1 -1
  40. package/build/translations/zh-cn.js +1 -1
  41. package/build/translations/zh.js +1 -1
  42. package/lang/translations/ar.po +2 -2
  43. package/lang/translations/bg.po +2 -2
  44. package/lang/translations/bn.po +2 -2
  45. package/lang/translations/ca.po +2 -2
  46. package/lang/translations/cs.po +2 -2
  47. package/lang/translations/da.po +2 -2
  48. package/lang/translations/de.po +2 -2
  49. package/lang/translations/el.po +2 -2
  50. package/lang/translations/es.po +2 -2
  51. package/lang/translations/et.po +2 -2
  52. package/lang/translations/fi.po +2 -2
  53. package/lang/translations/fr.po +2 -2
  54. package/lang/translations/he.po +2 -2
  55. package/lang/translations/hi.po +2 -2
  56. package/lang/translations/hu.po +2 -2
  57. package/lang/translations/id.po +2 -2
  58. package/lang/translations/it.po +2 -2
  59. package/lang/translations/ja.po +2 -2
  60. package/lang/translations/ko.po +2 -2
  61. package/lang/translations/lt.po +2 -2
  62. package/lang/translations/lv.po +2 -2
  63. package/lang/translations/ms.po +2 -2
  64. package/lang/translations/nl.po +2 -2
  65. package/lang/translations/no.po +2 -2
  66. package/lang/translations/pl.po +2 -2
  67. package/lang/translations/pt-br.po +2 -2
  68. package/lang/translations/pt.po +2 -2
  69. package/lang/translations/ro.po +2 -2
  70. package/lang/translations/ru.po +2 -2
  71. package/lang/translations/sk.po +2 -2
  72. package/lang/translations/sr.po +2 -2
  73. package/lang/translations/sv.po +2 -2
  74. package/lang/translations/th.po +2 -2
  75. package/lang/translations/tr.po +2 -2
  76. package/lang/translations/uk.po +2 -2
  77. package/lang/translations/vi.po +2 -2
  78. package/lang/translations/zh-cn.po +2 -2
  79. package/lang/translations/zh.po +2 -2
  80. package/package.json +6 -6
  81. package/src/adapters/aiadapter.js +1 -1
  82. package/src/adapters/aitextadapter.js +1 -1
  83. package/src/adapters/awstextadapter.d.ts +21 -21
  84. package/src/adapters/awstextadapter.js +1 -1
  85. package/src/adapters/openaitextadapter.js +1 -1
  86. package/src/aiassistant.js +1 -1
  87. package/src/aiassistantediting.js +1 -1
  88. package/src/aiassistantui.js +1 -1
  89. package/src/aiconfig.d.ts +1 -1
  90. package/src/ui/aiassistantcontroller.js +1 -1
  91. package/src/ui/dropdown/aicommandslistview.js +1 -1
  92. package/src/ui/dropdown/buttonlabelwithhighlightview.js +1 -1
  93. package/src/ui/dropdown/labelwithhighlightview.js +1 -1
  94. package/src/ui/form/aiformcontentarea.js +1 -1
  95. package/src/ui/form/aiformerrorview.js +1 -1
  96. package/src/ui/form/aiformpromptview.js +1 -1
  97. package/src/ui/form/aiformtoolbarview.js +1 -1
  98. package/src/ui/form/aiformview.js +1 -1
  99. package/src/ui/form/aihistorylistitemview.js +1 -1
  100. package/src/ui/form/aihistorylistview.js +1 -1
  101. package/src/ui/form/prompthistory.js +1 -1
  102. package/src/ui/showaiassistantcommand.js +1 -1
  103. package/src/utils/common-translations.js +1 -1
  104. package/theme/ai-form.css +13 -1
@@ -215,11 +215,11 @@ msgstr "İstek başlıklarının hazırlanması başarısız oldu."
215
215
 
216
216
  msgctxt "Error message displayed when preparing request parameters fails."
217
217
  msgid "AI_ERROR_GET_PARAMETERS"
218
- msgstr ""
218
+ msgstr "İstek parametreleri hazırlanamadı"
219
219
 
220
220
  msgctxt "Error message displayed when the requested AI model is not supported."
221
221
  msgid "AI_ERROR_UNSUPPORTED_MODEL"
222
- msgstr ""
222
+ msgstr "İstenen yapay zeka modeli (\"%0\") desteklenmiyor"
223
223
 
224
224
  msgctxt "Error message displayed when the content selected for AI processing is too long"
225
225
  msgid "AI_ERROR_CONTEXT_LENGTH"
@@ -215,11 +215,11 @@ msgstr "Не вдалося підготувати заголовки запит
215
215
 
216
216
  msgctxt "Error message displayed when preparing request parameters fails."
217
217
  msgid "AI_ERROR_GET_PARAMETERS"
218
- msgstr ""
218
+ msgstr "Не вдалось підготувати параметри запиту"
219
219
 
220
220
  msgctxt "Error message displayed when the requested AI model is not supported."
221
221
  msgid "AI_ERROR_UNSUPPORTED_MODEL"
222
- msgstr ""
222
+ msgstr "Запитувана модель ШІ (\"%0\") не підтримується"
223
223
 
224
224
  msgctxt "Error message displayed when the content selected for AI processing is too long"
225
225
  msgid "AI_ERROR_CONTEXT_LENGTH"
@@ -215,11 +215,11 @@ msgstr "Chuẩn bị tiêu đề yêu cầu không thành công"
215
215
 
216
216
  msgctxt "Error message displayed when preparing request parameters fails."
217
217
  msgid "AI_ERROR_GET_PARAMETERS"
218
- msgstr ""
218
+ msgstr "Không thể chuẩn bị tham số yêu cầu"
219
219
 
220
220
  msgctxt "Error message displayed when the requested AI model is not supported."
221
221
  msgid "AI_ERROR_UNSUPPORTED_MODEL"
222
- msgstr ""
222
+ msgstr "Không hỗ trợ mô hình AI được yêu cầu (\"%0\")"
223
223
 
224
224
  msgctxt "Error message displayed when the content selected for AI processing is too long"
225
225
  msgid "AI_ERROR_CONTEXT_LENGTH"
@@ -215,11 +215,11 @@ msgstr "准备请求头失败"
215
215
 
216
216
  msgctxt "Error message displayed when preparing request parameters fails."
217
217
  msgid "AI_ERROR_GET_PARAMETERS"
218
- msgstr ""
218
+ msgstr "请求参数准备失败"
219
219
 
220
220
  msgctxt "Error message displayed when the requested AI model is not supported."
221
221
  msgid "AI_ERROR_UNSUPPORTED_MODEL"
222
- msgstr ""
222
+ msgstr "不支持请求的 AI 模型 (\"%0\")"
223
223
 
224
224
  msgctxt "Error message displayed when the content selected for AI processing is too long"
225
225
  msgid "AI_ERROR_CONTEXT_LENGTH"
@@ -215,11 +215,11 @@ msgstr "要求標頭準備失敗"
215
215
 
216
216
  msgctxt "Error message displayed when preparing request parameters fails."
217
217
  msgid "AI_ERROR_GET_PARAMETERS"
218
- msgstr ""
218
+ msgstr "要求參數準備失敗"
219
219
 
220
220
  msgctxt "Error message displayed when the requested AI model is not supported."
221
221
  msgid "AI_ERROR_UNSUPPORTED_MODEL"
222
- msgstr ""
222
+ msgstr "不支援要求的 AI 模型(\"%0\")"
223
223
 
224
224
  msgctxt "Error message displayed when the content selected for AI processing is too long"
225
225
  msgid "AI_ERROR_CONTEXT_LENGTH"
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-ai",
3
- "version": "0.0.0-nightly-20240116.0",
4
- "description": "AI-powered features for CKEditor 5.",
3
+ "version": "0.0.0-nightly-20240118.0",
4
+ "description": "AI Assistant feature for CKEditor 5.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "CKSource (http://cksource.com/)",
7
- "homepage": "https://ckeditor.com/collaboration/",
7
+ "homepage": "https://ckeditor.com/ckeditor-5",
8
8
  "keywords": [
9
9
  "CKEditor",
10
10
  "ckeditor5",
@@ -23,10 +23,10 @@
23
23
  "framework"
24
24
  ],
25
25
  "dependencies": {
26
- "ckeditor5": "0.0.0-nightly-20240116.0",
27
- "ckeditor5-collaboration": "0.0.0-nightly-20240116.0",
26
+ "ckeditor5": "0.0.0-nightly-20240118.0",
27
+ "ckeditor5-collaboration": "0.0.0-nightly-20240118.0",
28
28
  "@aws-sdk/client-bedrock-runtime": "3.470.0",
29
- "@ckeditor/ckeditor5-ui": "0.0.0-nightly-20240116.0",
29
+ "@ckeditor/ckeditor5-ui": "0.0.0-nightly-20240118.0",
30
30
  "lodash-es": "4.17.21"
31
31
  },
32
32
  "type": "module",
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- var _0x5f26=['AIAdapter','name','pluginName','afterInit','aiadapter-text-adapter-not-set'];(function(_0x3c18d4,_0x5f261){var _0x589475=function(_0x6f6abd){while(--_0x6f6abd){_0x3c18d4['push'](_0x3c18d4['shift']());}};_0x589475(++_0x5f261);}(_0x5f26,0x160));var _0x5894=function(_0x3c18d4,_0x5f261){_0x3c18d4=_0x3c18d4-0x0;var _0x589475=_0x5f26[_0x3c18d4];return _0x589475;};import{Plugin as _0x6f0a83}from'ckeditor5/src/core.js';import{CKEditorError as _0x33691c}from'ckeditor5/src/utils.js';export default class I extends _0x6f0a83{static get[_0x5894('0x0')](){return _0x5894('0x3');}[_0x5894('0x1')](){if(!this['textAdapter'])throw new _0x33691c(_0x5894('0x2'),null);}}export class AIRequestError extends Error{constructor(_0x274a18){super(_0x274a18),this[_0x5894('0x4')]='AIRequestError';}}
23
+ var _0x4929=['afterInit','AIRequestError','pluginName','aiadapter-text-adapter-not-set','name','textAdapter'];(function(_0x48a972,_0x492963){var _0x4372c2=function(_0xf67a33){while(--_0xf67a33){_0x48a972['push'](_0x48a972['shift']());}};_0x4372c2(++_0x492963);}(_0x4929,0x195));var _0x4372=function(_0x48a972,_0x492963){_0x48a972=_0x48a972-0x0;var _0x4372c2=_0x4929[_0x48a972];return _0x4372c2;};import{Plugin as _0x6481c8}from'ckeditor5/src/core.js';import{CKEditorError as _0x47cafc}from'ckeditor5/src/utils.js';export default class I extends _0x6481c8{static get[_0x4372('0x5')](){return'AIAdapter';}[_0x4372('0x3')](){if(!this[_0x4372('0x2')])throw new _0x47cafc(_0x4372('0x0'),null);}}export class AIRequestError extends Error{constructor(_0x213ad9){super(_0x213ad9),this[_0x4372('0x1')]=_0x4372('0x4');}}
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x4803=['get','aitextadapter-send-request-failed','resolve','editor','catch','aborted','reject','signal','abortController','sendRequest','plugins','error','assign','abort','object','requires','AbortError','application/json','AI_ERROR_GET_PARAMETERS'];(function(_0x2e1363,_0x48039a){const _0x3a7cde=function(_0x299ac9){while(--_0x299ac9){_0x2e1363['push'](_0x2e1363['shift']());}};_0x3a7cde(++_0x48039a);}(_0x4803,0x70));const _0x3a7c=function(_0x2e1363,_0x48039a){_0x2e1363=_0x2e1363-0x0;let _0x3a7cde=_0x4803[_0x2e1363];return _0x3a7cde;};import{Plugin as _0x5ec511}from'ckeditor5/src/core.js';import{CKEditorError as _0x4c860d}from'ckeditor5/src/utils.js';import{default as _0x3f8e0d,AIRequestError as _0x4fd925}from'./aiadapter.js';import{getTranslation as _0x1fa8ad}from'../utils/common-translations.js';export default class _ extends _0x5ec511{static get[_0x3a7c('0x11')](){return[_0x3f8e0d];}constructor(_0x2c0c68){super(_0x2c0c68),this[_0x3a7c('0xa')]=new AbortController();}['init'](){this['editor'][_0x3a7c('0xc')][_0x3a7c('0x2')](_0x3f8e0d)['textAdapter']=this;}[_0x3a7c('0xf')](){this[_0x3a7c('0xa')][_0x3a7c('0x9')][_0x3a7c('0x7')]||(this['abortController'][_0x3a7c('0xf')](),this[_0x3a7c('0xa')]=new AbortController());}async['makeRequest'](_0x19b1fa){return this[_0x3a7c('0xb')](_0x19b1fa)[_0x3a7c('0x6')](_0x1ea240=>{if(_0x1ea240 instanceof _0x4fd925)return Promise[_0x3a7c('0x8')](_0x1ea240);if(_0x3a7c('0x12')==_0x1ea240['name'])return Promise[_0x3a7c('0x4')]();throw console[_0x3a7c('0xd')](_0x1ea240),new _0x4c860d(_0x3a7c('0x3'),null);});}async['_prepareRequestHeaders'](_0x1acc06,_0x1f9e51){const _0x1ac51a=this[_0x3a7c('0x5')]['locale'],_0x2108b9={'Content-Type':_0x3a7c('0x0')};if('object'==typeof _0x1acc06)Object[_0x3a7c('0xe')](_0x2108b9,_0x1acc06);else{if(_0x1acc06)try{const _0x4299db=await _0x1acc06(_0x1f9e51);Object[_0x3a7c('0xe')](_0x2108b9,_0x4299db);}catch(_0x5e8bc8){return Promise[_0x3a7c('0x8')](new _0x4fd925(_0x1fa8ad(_0x1ac51a,'AI_ERROR_GET_HEADERS')));}}return _0x2108b9;}async['_prepareRequestParameters'](_0xd5c75d,_0x44cf2e){const _0x1f98cc=this[_0x3a7c('0x5')]['locale'];if(_0x3a7c('0x10')==typeof _0xd5c75d)return _0xd5c75d;try{return await _0xd5c75d(_0x44cf2e);}catch(_0x3ea28b){return Promise[_0x3a7c('0x8')](new _0x4fd925(_0x1fa8ad(_0x1f98cc,_0x3a7c('0x1'))));}}}
23
+ const _0x4ad0=['locale','get','object','_prepareRequestHeaders','reject','requires','AbortError','assign','catch','abortController','signal','AI_ERROR_GET_HEADERS','sendRequest','_prepareRequestParameters','abort','plugins','init','application/json','makeRequest','aborted','resolve','editor'];(function(_0x5a8fee,_0x4ad0c1){const _0x300195=function(_0x48d82a){while(--_0x48d82a){_0x5a8fee['push'](_0x5a8fee['shift']());}};_0x300195(++_0x4ad0c1);}(_0x4ad0,0x1e0));const _0x3001=function(_0x5a8fee,_0x4ad0c1){_0x5a8fee=_0x5a8fee-0x0;let _0x300195=_0x4ad0[_0x5a8fee];return _0x300195;};import{Plugin as _0x41bd4c}from'ckeditor5/src/core.js';import{CKEditorError as _0x411fa7}from'ckeditor5/src/utils.js';import{default as _0x1ee6e0,AIRequestError as _0x2218e4}from'./aiadapter.js';import{getTranslation as _0x4e8498}from'../utils/common-translations.js';export default class _ extends _0x41bd4c{static get[_0x3001('0x9')](){return[_0x1ee6e0];}constructor(_0x1025f4){super(_0x1025f4),this[_0x3001('0xd')]=new AbortController();}[_0x3001('0x14')](){this['editor'][_0x3001('0x13')][_0x3001('0x5')](_0x1ee6e0)['textAdapter']=this;}[_0x3001('0x12')](){this['abortController'][_0x3001('0xe')][_0x3001('0x1')]||(this['abortController'][_0x3001('0x12')](),this[_0x3001('0xd')]=new AbortController());}async[_0x3001('0x0')](_0x5ef145){return this[_0x3001('0x10')](_0x5ef145)[_0x3001('0xc')](_0x9bb6d1=>{if(_0x9bb6d1 instanceof _0x2218e4)return Promise['reject'](_0x9bb6d1);if(_0x3001('0xa')==_0x9bb6d1['name'])return Promise[_0x3001('0x2')]();throw console['error'](_0x9bb6d1),new _0x411fa7('aitextadapter-send-request-failed',null);});}async[_0x3001('0x7')](_0x1b2861,_0xf44b63){const _0x4247fb=this[_0x3001('0x3')][_0x3001('0x4')],_0x268a00={'Content-Type':_0x3001('0x15')};if('object'==typeof _0x1b2861)Object[_0x3001('0xb')](_0x268a00,_0x1b2861);else{if(_0x1b2861)try{const _0x335a2d=await _0x1b2861(_0xf44b63);Object['assign'](_0x268a00,_0x335a2d);}catch(_0x331846){return Promise[_0x3001('0x8')](new _0x2218e4(_0x4e8498(_0x4247fb,_0x3001('0xf'))));}}return _0x268a00;}async[_0x3001('0x11')](_0x2b80eb,_0x1b39e7){const _0x4fb631=this[_0x3001('0x3')][_0x3001('0x4')];if(_0x3001('0x6')==typeof _0x2b80eb)return _0x2b80eb;try{return await _0x2b80eb(_0x1b39e7);}catch(_0x14f26a){return Promise[_0x3001('0x8')](new _0x2218e4(_0x4e8498(_0x4fb631,'AI_ERROR_GET_PARAMETERS')));}}}
@@ -10,7 +10,7 @@ import { type Editor } from 'ckeditor5/src/core.js';
10
10
  import { default as AITextAdapter, type AITextAdapterRequestData, type RequestHeaders, type RequestParameters } from './aitextadapter.js';
11
11
  import { type BedrockRuntimeClientConfig } from '@aws-sdk/client-bedrock-runtime';
12
12
  /**
13
- * Adapter for AI text-related requests that supports AWS Bedrock service.
13
+ * Adapter for AI text-related requests that supports the Amazon Bedrock service.
14
14
  *
15
15
  * See also {@link module:ai/adapters/aitextadapter~AITextAdapter}.
16
16
  */
@@ -24,13 +24,13 @@ export default class AWSTextAdapter extends AITextAdapter {
24
24
  */
25
25
  constructor(editor: Editor);
26
26
  /**
27
- * Performs the request to the AWS Bedrock service or to the endpoint provided in the editor configuration.
27
+ * Performs the request to the Amazon Bedrock service or to the endpoint provided in the editor configuration.
28
28
  *
29
29
  * If you want to extend this adapter, you can overload this method to do some additional processing or make an external call.
30
30
  */
31
31
  sendRequest({ query, context, onData, actionId }: AITextAdapterRequestData): Promise<void>;
32
32
  /**
33
- * Prepares the actual full prompt for the request to the AWS Bedrock API.
33
+ * Prepares the actual full prompt for the request to the Amazon Bedrock API.
34
34
  *
35
35
  * The prompt may differ depending on what model is used.
36
36
  *
@@ -43,18 +43,18 @@ export default class AWSTextAdapter extends AITextAdapter {
43
43
  */
44
44
  preparePrompt(query: string, context: string, model: string, actionId: string): Promise<string>;
45
45
  /**
46
- * For given `model`, returns the family to which this model belongs.
46
+ * For a given model, it returns the family to which this model belongs.
47
47
  *
48
- * For example, for `anthropic.claude-instant-v1` will return `anthropic.claude`.
48
+ * For example, for `anthropic.claude-instant-v1` it will return `anthropic.claude`.
49
49
  *
50
- * Throws {@link module:ai/adapters/aiadapter~AIRequestError `AIRequestError`} if given `model` is not supported.
50
+ * Throws {@link module:ai/adapters/aiadapter~AIRequestError `AIRequestError`} if a given model is not supported.
51
51
  */
52
52
  getModelFamily(model: string): AWSModelFamily;
53
53
  }
54
54
  /**
55
- * The configuration for the AWS Bedrock adapter.
55
+ * The configuration for the Amazon Bedrock adapter.
56
56
  *
57
- * The properties defined in this config are set in the `config.ai.aws` namespace.
57
+ * The properties defined in this configuration are set in the `config.ai.aws` namespace.
58
58
  *
59
59
  * ```ts
60
60
  * ClassicEditor
@@ -77,20 +77,20 @@ export interface AWSTextAdapterConfig {
77
77
  /**
78
78
  * The URL to which the AI service request will be sent.
79
79
  *
80
- * Set this value only if you want to connect to AWS Bedrock using a proxy endpoint.
80
+ * Set this value only if you want to connect to Amazon Bedrock using a proxy endpoint.
81
81
  *
82
82
  * If `apiUrl` is not provided, the AWS-SDK library will be used to process the request. It will set a proper URL on its own.
83
83
  */
84
84
  apiUrl?: string;
85
85
  /**
86
- * Object with headers to set in the request to the AI service.
86
+ * An object with headers to set in the request to the AI service.
87
87
  *
88
- * **These headers are only used when connecting to AWS through the proxy endpoint (i.e. when `apiUrl` is set).**
88
+ * **These headers are only used when connecting to AWS through the proxy endpoint (that is, when `apiUrl` is set).**
89
89
  *
90
- * Otherwise, AWS-SDK library is used, and it sets the request headers on its own. In this mode, the request headers cannot be
90
+ * Otherwise, the AWS-SDK library is used, and it sets the request headers on its own. In this mode, the request headers cannot be
91
91
  * customized.
92
92
  *
93
- * If the provided value is an `object`, it is simply used as provided.
93
+ * If the provided value is an object, it is simply used as provided.
94
94
  *
95
95
  * ```js
96
96
  * {
@@ -105,9 +105,9 @@ export interface AWSTextAdapterConfig {
105
105
  * }
106
106
  * ```
107
107
  *
108
- * If the provided value is a function, it should be a function that returns a `Promise` which resolves with the headers object.
108
+ * If the provided value is a function, it should be a function that returns a promise which resolves with the headers object.
109
109
  * This way, you can perform an authorization request to your application and receive the authorization token (and also implement
110
- * any custom logic on the back-end side). The headers object is then used to make the actual call to the AI service.
110
+ * any custom logic on the backend side). The headers object is then used to make the actual call to the AI service.
111
111
  *
112
112
  * ```js
113
113
  * {
@@ -126,7 +126,7 @@ export interface AWSTextAdapterConfig {
126
126
  * }
127
127
  * ```
128
128
  *
129
- * The function is passed {@link module:ai/adapters/aitextadapter~AITextAdapterRequestData#actionId `actionId`} parameter to make it
129
+ * The function is passed the {@link module:ai/adapters/aitextadapter~AITextAdapterRequestData#actionId `actionId`} parameter to make it
130
130
  * possible to further customize the headers.
131
131
  *
132
132
  * If the function fails for any reason, the promise should be rejected. In this case, a feature that made the request should display
@@ -141,12 +141,12 @@ export interface AWSTextAdapterConfig {
141
141
  *
142
142
  * See [AWS model parameters reference](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html) to learn more.
143
143
  *
144
- * If the provided value is an `object`, it is passed to the request as provided.
144
+ * If the provided value is an object, it is passed to the request as provided.
145
145
  *
146
- * If the provided value is a function, it should be a function that returns a `Promise` which resolves with the request parameters
146
+ * If the provided value is a function, it should be a function that returns a promise which resolves with the request parameters
147
147
  * object. This gives you more flexibility to provide parameters for the AI model.
148
148
  *
149
- * The function is passed {@link module:ai/adapters/aitextadapter~AITextAdapterRequestData#actionId `actionId`} parameter to make it
149
+ * The function is passed the {@link module:ai/adapters/aitextadapter~AITextAdapterRequestData#actionId `actionId`} parameter to make it
150
150
  * possible to further customize the parameters.
151
151
  *
152
152
  * If the function fails for any reason, the promise should be rejected. In this case, the feature that made the request should display
@@ -168,10 +168,10 @@ export interface AWSTextAdapterConfig {
168
168
  */
169
169
  requestParameters?: RequestParameters;
170
170
  /**
171
- * Configuration for AWS-SDK Bedrock Runtime Client.
171
+ * The configuration for AWS-SDK Bedrock Runtime Client.
172
172
  *
173
173
  * If `apiUrl` is not provided, this configuration will be used to initialize the Bedrock Runtime Client which will be used to process
174
- * the requests. The adapter will make requests directly to the AWS Bedrock service.
174
+ * the requests. The adapter will make requests directly to the Amazon Bedrock service.
175
175
  */
176
176
  bedrockClientConfig?: BedrockRuntimeClientConfig;
177
177
  }
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x559d=['map','split','<<SYS>>\x0a','ai.aws.requestParameters.stream','define','parse','editor','pluginName','_prepareRequestParameters','_readStaticResponse','ai21.j2','toString','completion','<span>','data','Your\x20task\x20is\x20to\x20execute\x20the\x20instruction\x20using\x20the\x20provided\x20HTML\x20content.\x20Follow\x20the\x20instruction\x20closely.\x20Your\x20answer\x20must\x20be\x20a\x20properly\x20formatted\x20HTML\x20code.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.','</span>','_requestHeaders','cohere.command','completions','_getGeneratedText','ai.aws.requestParameters','meta.llama','getModelFamily','locale','utf-8','bytes','_bedrockClientConfig','ai.aws.requestHeaders','_prepareRequestHeaders','ai.aws.requestParameters.temperature','stringify','_processAWSRequest','json','startsWith','Instruction:\x0a','text','resolve','_readAsyncIterableResponse','abortController','preparePrompt','application/json','filter','ai.aws.requestParameters.top_k','signal','anthropic.claude','_requestParameters','Your\x20task\x20is\x20to\x20generate\x20HTML\x20content\x20accordingly\x20to\x20the\x20given\x20instruction.\x20Never\x20include\x20<img>\x20tag\x20in\x20your\x20response\x20even\x20if\x20asked\x20for.\x20Your\x20answer\x20must\x20be\x20a\x20well-structured\x20and\x20properly\x20formatted\x20HTML\x20code.\x20Answer\x20only\x20with\x20the\x20generated\x20HTML\x20content.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.','join','ai.aws.bedrockClientConfig','ai.aws.apiUrl','_processProxyRequest','config','sendRequest','generations','read','decode','getReader','_readStreamableResponse','test','from','get','length','body','ai.aws.requestParameters.top_p','send','chunk','ai.aws.requestParameters.anthropic_version'];(function(_0x2173f4,_0x559dd8){const _0x1d216e=function(_0x2164ba){while(--_0x2164ba){_0x2173f4['push'](_0x2173f4['shift']());}};_0x1d216e(++_0x559dd8);}(_0x559d,0xf0));const _0x1d21=function(_0x2173f4,_0x559dd8){_0x2173f4=_0x2173f4-0x0;let _0x1d216e=_0x559d[_0x2173f4];return _0x1d216e;};import{default as _0x1ef60f}from'./aitextadapter.js';import{AIRequestError as _0x52b26e}from'./aiadapter.js';import{BedrockRuntimeClient as _0x1d90fc,InvokeModelCommand as _0xd02a1e,InvokeModelWithResponseStreamCommand as _0x3f912a}from'@aws-sdk/client-bedrock-runtime';import{getTranslation as _0x5e777d}from'../utils/common-translations.js';export default class H extends _0x1ef60f{static get[_0x1d21('0x27')](){return'AWSTextAdapter';}constructor(_0x59dd66){super(_0x59dd66),_0x59dd66[_0x1d21('0x10')][_0x1d21('0x19')](_0x1d21('0x35'))||(_0x59dd66[_0x1d21('0x10')]['define']('ai.aws.requestParameters.model','anthropic.claude-v2'),_0x59dd66[_0x1d21('0x10')]['define']('ai.aws.requestParameters.max_tokens_to_sample',0x7d0),_0x59dd66[_0x1d21('0x10')][_0x1d21('0x24')](_0x1d21('0x3e'),0x1),_0x59dd66[_0x1d21('0x10')][_0x1d21('0x24')](_0x1d21('0x1c'),0x1),_0x59dd66[_0x1d21('0x10')]['define'](_0x1d21('0x7'),0xfa),_0x59dd66[_0x1d21('0x10')]['define'](_0x1d21('0x1f'),'bedrock-2023-05-31'),_0x59dd66[_0x1d21('0x10')][_0x1d21('0x24')](_0x1d21('0x23'),!0x0)),this['_apiUrl']=_0x59dd66[_0x1d21('0x10')]['get'](_0x1d21('0xe')),this[_0x1d21('0x3b')]=_0x59dd66['config'][_0x1d21('0x19')](_0x1d21('0xd')),this['_requestHeaders']=_0x59dd66[_0x1d21('0x10')][_0x1d21('0x19')](_0x1d21('0x3c')),this[_0x1d21('0xa')]=_0x59dd66[_0x1d21('0x10')]['get'](_0x1d21('0x35'));}async[_0x1d21('0x11')]({query:_0x1a1309,context:_0x2417c6,onData:_0x96584e,actionId:_0x4fe7ab}){const {model:_0x5c1945,stream:_0x5a6afb,..._0x13b22d}=await this[_0x1d21('0x28')](this[_0x1d21('0xa')],_0x4fe7ab),_0x17d9b2={'prompt':await this[_0x1d21('0x4')](_0x1a1309,_0x2417c6,_0x5c1945,_0x4fe7ab),..._0x13b22d};this['_apiUrl']?await this[_0x1d21('0xf')](_0x17d9b2,_0x5c1945,_0x5a6afb,_0x96584e,_0x4fe7ab):await this[_0x1d21('0x40')](_0x17d9b2,_0x5c1945,_0x5a6afb,_0x96584e);}async[_0x1d21('0x4')](_0x39863d,_0x3d86eb,_0x152165,_0x6567e3){let _0x5637f3,_0xb5805a;return _0x3d86eb?(_0x5637f3=_0x1d21('0x2f'),_0xb5805a=_0x1d21('0x43')+_0x39863d+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+(_0x3d86eb[_0x1d21('0x42')]('<')?_0x3d86eb:_0x1d21('0x2d')+_0x3d86eb+_0x1d21('0x30'))):(_0x5637f3=_0x1d21('0xb'),_0xb5805a=_0x39863d),_0x1d21('0x36')==this['getModelFamily'](_0x152165)?_0x1d21('0x22')+_0x5637f3+'\x0a<</SYS>>\x0a[INST]\x0a'+_0xb5805a+'\x0a[/INST]':'Human:\x0a'+_0x5637f3+'\x0a'+_0xb5805a+'\x0a\x0aAssistant:';}[_0x1d21('0x37')](_0x2af8a4){if(/^anthropic\.claude/['test'](_0x2af8a4))return _0x1d21('0x9');if(/^ai21\.j2/[_0x1d21('0x17')](_0x2af8a4))return _0x1d21('0x2a');if(/^cohere\.command/[_0x1d21('0x17')](_0x2af8a4))return _0x1d21('0x32');if(/^meta\.llama/[_0x1d21('0x17')](_0x2af8a4))return _0x1d21('0x36');throw new _0x52b26e(_0x5e777d(this[_0x1d21('0x26')][_0x1d21('0x38')],'AI_ERROR_UNSUPPORTED_MODEL',_0x2af8a4));}async[_0x1d21('0xf')](_0x3f9132,_0x2ae873,_0x51afc0,_0x5d4b16,_0x178191){const _0x28dbc2={'method':'POST','headers':await this[_0x1d21('0x3d')](this[_0x1d21('0x31')],_0x178191),'body':JSON[_0x1d21('0x3f')]({..._0x3f9132,'model':_0x2ae873,'stream':_0x51afc0}),'signal':this['abortController'][_0x1d21('0x8')]},_0x385925=await fetch(this['_apiUrl'],_0x28dbc2);_0x51afc0?await this['_readStreamableResponse'](_0x385925,_0x2ae873,_0x5d4b16):await this['_readStaticResponse'](_0x385925,_0x2ae873,_0x5d4b16);}async[_0x1d21('0x40')](_0x26f162,_0x3f1f15,_0x47acf0,_0x1c9dbe){const _0x34b4a4=new _0x1d90fc(this[_0x1d21('0x3b')]),_0x2fc95d={'body':JSON['stringify'](_0x26f162),'contentType':'application/json','accept':_0x1d21('0x5'),'modelId':_0x3f1f15};let _0x89306b;if(_0x47acf0){const _0x53adc2=new _0x3f912a(_0x2fc95d);_0x89306b=await _0x34b4a4[_0x1d21('0x1d')](_0x53adc2,{'abortSignal':this['abortController'][_0x1d21('0x8')]}),await this[_0x1d21('0x2')](_0x89306b,_0x3f1f15,_0x1c9dbe);}else{const _0x3830ba=new _0xd02a1e(_0x2fc95d);_0x89306b=await _0x34b4a4['send'](_0x3830ba,{'abortSignal':this[_0x1d21('0x3')][_0x1d21('0x8')]}),await this[_0x1d21('0x29')](_0x89306b,_0x3f1f15,_0x1c9dbe);}}async[_0x1d21('0x2')](_0xf8841e,_0x15aeec,_0x56497b){const _0x2a2f66=_0xf8841e[_0x1d21('0x1b')],_0x48b1ec=new TextDecoder(_0x1d21('0x39'));let _0x2c788b='';for await(const _0x3c0fca of _0x2a2f66)if(_0x3c0fca[_0x1d21('0x1e')]){const _0x25b16f=_0x48b1ec[_0x1d21('0x14')](_0x3c0fca[_0x1d21('0x1e')][_0x1d21('0x3a')]),_0x283dd9=JSON[_0x1d21('0x25')](_0x25b16f);_0x2c788b+=this[_0x1d21('0x34')](_0x283dd9,_0x15aeec),_0x56497b(_0x2c788b);}return Promise[_0x1d21('0x1')]();}async[_0x1d21('0x16')](_0x342d4f,_0x351269,_0x5a1535){const _0x46ef3d=_0x342d4f[_0x1d21('0x1b')],_0x308d42=new TextDecoder(_0x1d21('0x39')),_0x39572d=_0x46ef3d[_0x1d21('0x15')]();let _0x4160ff='',_0x1e17ac='',_0xf502f7=!0x1;for(;!_0xf502f7;){const {done:_0x41d8f6,value:_0xd5e8d6}=await _0x39572d[_0x1d21('0x13')]();if(_0xf502f7=_0x41d8f6,_0xf502f7)break;const _0x49d2cd=(_0x4160ff+_0x308d42[_0x1d21('0x14')](_0xd5e8d6))[_0x1d21('0x21')]('\x0a')[_0x1d21('0x20')](_0x1d4a5e=>{try{return _0x4160ff='',JSON['parse'](_0x1d4a5e);}catch(_0x980344){return _0x4160ff=_0x1d4a5e,null;}})[_0x1d21('0x6')](_0x4f16e5=>null!==_0x4f16e5);_0x49d2cd[_0x1d21('0x1a')]&&(_0x1e17ac+=_0x49d2cd['map'](_0x4d1c5b=>this[_0x1d21('0x34')](_0x4d1c5b,_0x351269))[_0x1d21('0xc')](''),_0x5a1535(_0x1e17ac));}return Promise[_0x1d21('0x1')]();}async[_0x1d21('0x29')](_0x17d17e,_0x4e227b,_0x5f8ecf){let _0x40275;return _0x40275=_0x17d17e instanceof Response?await _0x17d17e[_0x1d21('0x41')]():JSON[_0x1d21('0x25')](Buffer[_0x1d21('0x18')](_0x17d17e[_0x1d21('0x1b')])[_0x1d21('0x2b')]('utf8')),(_0x5f8ecf(this[_0x1d21('0x34')](_0x40275,_0x4e227b)),Promise[_0x1d21('0x1')]());}[_0x1d21('0x34')](_0x369f96,_0x278104){switch(this[_0x1d21('0x37')](_0x278104)){case'anthropic.claude':return _0x369f96[_0x1d21('0x2c')];case'ai21.j2':return _0x369f96[_0x1d21('0x33')][0x0][_0x1d21('0x2e')][_0x1d21('0x0')];case'cohere.command':return _0x369f96[_0x1d21('0x12')][0x0][_0x1d21('0x0')];case'meta.llama':return _0x369f96['generation'];}}}
23
+ const _0x404e=['toString','stringify','anthropic.claude-v2','_requestHeaders','getModelFamily','anthropic.claude','ai.aws.requestHeaders','split','signal','Your\x20task\x20is\x20to\x20execute\x20the\x20instruction\x20using\x20the\x20provided\x20HTML\x20content.\x20Follow\x20the\x20instruction\x20closely.\x20Your\x20answer\x20must\x20be\x20a\x20properly\x20formatted\x20HTML\x20code.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.','<span>','ai.aws.apiUrl','_readAsyncIterableResponse','Human:\x0a','AI_ERROR_UNSUPPORTED_MODEL','Instruction:\x0a','abortController','chunk','decode','ai.aws.requestParameters.temperature','_readStreamableResponse','ai.aws.requestParameters.top_p','text','POST','\x0a<</SYS>>\x0a[INST]\x0a','\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a','\x0a[/INST]','\x0a\x0aAssistant:','_prepareRequestHeaders','_getGeneratedText','_readStaticResponse','ai.aws.requestParameters.top_k','preparePrompt','locale','application/json','getReader','resolve','ai.aws.requestParameters.stream','generations','from','map','parse','_processProxyRequest','bytes','get','send','body','_bedrockClientConfig','ai21.j2','_apiUrl','<<SYS>>\x0a','test','bedrock-2023-05-31','ai.aws.requestParameters','AWSTextAdapter','cohere.command','completion','utf-8','ai.aws.requestParameters.anthropic_version','startsWith','pluginName','_prepareRequestParameters','</span>','_processAWSRequest','_requestParameters','generation','completions','define','read','config','meta.llama'];(function(_0x219d51,_0x404ee1){const _0x488cec=function(_0x10f985){while(--_0x10f985){_0x219d51['push'](_0x219d51['shift']());}};_0x488cec(++_0x404ee1);}(_0x404e,0xf1));const _0x488c=function(_0x219d51,_0x404ee1){_0x219d51=_0x219d51-0x0;let _0x488cec=_0x404e[_0x219d51];return _0x488cec;};import{default as _0x40c9fa}from'./aitextadapter.js';import{AIRequestError as _0x5a7d01}from'./aiadapter.js';import{BedrockRuntimeClient as _0x54d077,InvokeModelCommand as _0x30fcdb,InvokeModelWithResponseStreamCommand as _0x2a7aa7}from'@aws-sdk/client-bedrock-runtime';import{getTranslation as _0xadc9ae}from'../utils/common-translations.js';export default class H extends _0x40c9fa{static get[_0x488c('0x20')](){return _0x488c('0x1a');}constructor(_0x2cdfd5){super(_0x2cdfd5),_0x2cdfd5['config']['get'](_0x488c('0x19'))||(_0x2cdfd5[_0x488c('0x29')][_0x488c('0x27')]('ai.aws.requestParameters.model',_0x488c('0x2d')),_0x2cdfd5[_0x488c('0x29')]['define']('ai.aws.requestParameters.max_tokens_to_sample',0x7d0),_0x2cdfd5[_0x488c('0x29')][_0x488c('0x27')](_0x488c('0x3e'),0x1),_0x2cdfd5[_0x488c('0x29')][_0x488c('0x27')](_0x488c('0x40'),0x1),_0x2cdfd5[_0x488c('0x29')][_0x488c('0x27')](_0x488c('0x3'),0xfa),_0x2cdfd5[_0x488c('0x29')]['define'](_0x488c('0x1e'),_0x488c('0x18')),_0x2cdfd5['config']['define'](_0x488c('0x9'),!0x0)),this[_0x488c('0x15')]=_0x2cdfd5['config'][_0x488c('0x10')](_0x488c('0x36')),this[_0x488c('0x13')]=_0x2cdfd5[_0x488c('0x29')][_0x488c('0x10')]('ai.aws.bedrockClientConfig'),this[_0x488c('0x2e')]=_0x2cdfd5[_0x488c('0x29')][_0x488c('0x10')](_0x488c('0x31')),this[_0x488c('0x24')]=_0x2cdfd5[_0x488c('0x29')][_0x488c('0x10')](_0x488c('0x19'));}async['sendRequest']({query:_0x5eb52e,context:_0xe8ef47,onData:_0x2fd2b9,actionId:_0x3dcee4}){const {model:_0x50813b,stream:_0x49350e,..._0x1be1ac}=await this[_0x488c('0x21')](this[_0x488c('0x24')],_0x3dcee4),_0x5d2e52={'prompt':await this[_0x488c('0x4')](_0x5eb52e,_0xe8ef47,_0x50813b,_0x3dcee4),..._0x1be1ac};this[_0x488c('0x15')]?await this['_processProxyRequest'](_0x5d2e52,_0x50813b,_0x49350e,_0x2fd2b9,_0x3dcee4):await this['_processAWSRequest'](_0x5d2e52,_0x50813b,_0x49350e,_0x2fd2b9);}async[_0x488c('0x4')](_0x27eac9,_0x34747d,_0x1c5d7a,_0x167a70){let _0x5f50ee,_0x240113;return _0x34747d?(_0x5f50ee=_0x488c('0x34'),_0x240113=_0x488c('0x3a')+_0x27eac9+_0x488c('0x44')+(_0x34747d[_0x488c('0x1f')]('<')?_0x34747d:_0x488c('0x35')+_0x34747d+_0x488c('0x22'))):(_0x5f50ee='Your\x20task\x20is\x20to\x20generate\x20HTML\x20content\x20accordingly\x20to\x20the\x20given\x20instruction.\x20Never\x20include\x20<img>\x20tag\x20in\x20your\x20response\x20even\x20if\x20asked\x20for.\x20Your\x20answer\x20must\x20be\x20a\x20well-structured\x20and\x20properly\x20formatted\x20HTML\x20code.\x20Answer\x20only\x20with\x20the\x20generated\x20HTML\x20content.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.',_0x240113=_0x27eac9),_0x488c('0x2a')==this[_0x488c('0x2f')](_0x1c5d7a)?_0x488c('0x16')+_0x5f50ee+_0x488c('0x43')+_0x240113+_0x488c('0x45'):_0x488c('0x38')+_0x5f50ee+'\x0a'+_0x240113+_0x488c('0x46');}[_0x488c('0x2f')](_0x5d1154){if(/^anthropic\.claude/[_0x488c('0x17')](_0x5d1154))return _0x488c('0x30');if(/^ai21\.j2/['test'](_0x5d1154))return _0x488c('0x14');if(/^cohere\.command/['test'](_0x5d1154))return _0x488c('0x1b');if(/^meta\.llama/[_0x488c('0x17')](_0x5d1154))return _0x488c('0x2a');throw new _0x5a7d01(_0xadc9ae(this['editor'][_0x488c('0x5')],_0x488c('0x39'),_0x5d1154));}async[_0x488c('0xe')](_0x34ff56,_0x45fd63,_0x4e148e,_0x5e1c1a,_0x232ce8){const _0x371cde={'method':_0x488c('0x42'),'headers':await this[_0x488c('0x0')](this[_0x488c('0x2e')],_0x232ce8),'body':JSON[_0x488c('0x2c')]({..._0x34ff56,'model':_0x45fd63,'stream':_0x4e148e}),'signal':this['abortController'][_0x488c('0x33')]},_0x2c1d49=await fetch(this['_apiUrl'],_0x371cde);_0x4e148e?await this[_0x488c('0x3f')](_0x2c1d49,_0x45fd63,_0x5e1c1a):await this[_0x488c('0x2')](_0x2c1d49,_0x45fd63,_0x5e1c1a);}async[_0x488c('0x23')](_0x186cd1,_0x16f840,_0x3221cb,_0x407b7b){const _0x4e2959=new _0x54d077(this['_bedrockClientConfig']),_0x17596f={'body':JSON[_0x488c('0x2c')](_0x186cd1),'contentType':_0x488c('0x6'),'accept':_0x488c('0x6'),'modelId':_0x16f840};let _0x26911e;if(_0x3221cb){const _0x33964b=new _0x2a7aa7(_0x17596f);_0x26911e=await _0x4e2959['send'](_0x33964b,{'abortSignal':this[_0x488c('0x3b')][_0x488c('0x33')]}),await this[_0x488c('0x37')](_0x26911e,_0x16f840,_0x407b7b);}else{const _0x952260=new _0x30fcdb(_0x17596f);_0x26911e=await _0x4e2959[_0x488c('0x11')](_0x952260,{'abortSignal':this[_0x488c('0x3b')][_0x488c('0x33')]}),await this[_0x488c('0x2')](_0x26911e,_0x16f840,_0x407b7b);}}async[_0x488c('0x37')](_0x13c319,_0x2cde77,_0x26afae){const _0x540fc0=_0x13c319[_0x488c('0x12')],_0x2f419f=new TextDecoder(_0x488c('0x1d'));let _0x177336='';for await(const _0x38b4fc of _0x540fc0)if(_0x38b4fc[_0x488c('0x3c')]){const _0x24731a=_0x2f419f[_0x488c('0x3d')](_0x38b4fc[_0x488c('0x3c')][_0x488c('0xf')]),_0x24bea2=JSON['parse'](_0x24731a);_0x177336+=this[_0x488c('0x1')](_0x24bea2,_0x2cde77),_0x26afae(_0x177336);}return Promise[_0x488c('0x8')]();}async[_0x488c('0x3f')](_0x230a56,_0x1f9b13,_0x3652a0){const _0x5566c5=_0x230a56[_0x488c('0x12')],_0x55fdf9=new TextDecoder('utf-8'),_0x2cfcb3=_0x5566c5[_0x488c('0x7')]();let _0x37d72f='',_0x2a99ed='',_0x2ba91c=!0x1;for(;!_0x2ba91c;){const {done:_0x5c3510,value:_0x200a10}=await _0x2cfcb3[_0x488c('0x28')]();if(_0x2ba91c=_0x5c3510,_0x2ba91c)break;const _0x51398e=(_0x37d72f+_0x55fdf9['decode'](_0x200a10))[_0x488c('0x32')]('\x0a')[_0x488c('0xc')](_0x1779dc=>{try{return _0x37d72f='',JSON[_0x488c('0xd')](_0x1779dc);}catch(_0x53d2e8){return _0x37d72f=_0x1779dc,null;}})['filter'](_0x2c24c9=>null!==_0x2c24c9);_0x51398e['length']&&(_0x2a99ed+=_0x51398e[_0x488c('0xc')](_0x1893da=>this['_getGeneratedText'](_0x1893da,_0x1f9b13))['join'](''),_0x3652a0(_0x2a99ed));}return Promise['resolve']();}async[_0x488c('0x2')](_0x218434,_0x37abea,_0x2d5da2){let _0x18fe71;return _0x18fe71=_0x218434 instanceof Response?await _0x218434['json']():JSON['parse'](Buffer[_0x488c('0xb')](_0x218434[_0x488c('0x12')])[_0x488c('0x2b')]('utf8')),(_0x2d5da2(this[_0x488c('0x1')](_0x18fe71,_0x37abea)),Promise[_0x488c('0x8')]());}[_0x488c('0x1')](_0x53b390,_0x59454c){switch(this[_0x488c('0x2f')](_0x59454c)){case'anthropic.claude':return _0x53b390[_0x488c('0x1c')];case _0x488c('0x14'):return _0x53b390[_0x488c('0x26')][0x0]['data'][_0x488c('0x41')];case'cohere.command':return _0x53b390[_0x488c('0xa')][0x0][_0x488c('0x41')];case _0x488c('0x2a'):return _0x53b390[_0x488c('0x25')];}}}
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x3032=['map','editor','Instruction:\x0a','user','decode','text','delta','prepareMessages','_apiUrl','</span>','body','context_length_exceeded','join','_prepareRequestHeaders','replace','reject','Moderation','_cleanUpData','pluginName','_requestHeaders','config','_readStreamableResponse','stream','resolve','length','getReader','ai.openAI.requestParameters.model','system','signal','ai.openAI.requestParameters.max_tokens','content','get','abortController','ai.openAI.apiUrl','json','stringify','gpt-3.5-turbo','[DONE]','<span>','_requestParameters','locale','filter','_isBufferIncomplete','define','_readStaticResponse','ai.openAI.requestParameters.stream','ai.openAI.requestParameters.top_p','read','ai.openAI.requestParameters','split','sendRequest','https://api.openai.com/v1/chat/completions','OpenAITextAdapter','choices'];(function(_0x34ceb3,_0x3032d3){const _0x2cf5d7=function(_0x427131){while(--_0x427131){_0x34ceb3['push'](_0x34ceb3['shift']());}};_0x2cf5d7(++_0x3032d3);}(_0x3032,0x71));const _0x2cf5=function(_0x34ceb3,_0x3032d3){_0x34ceb3=_0x34ceb3-0x0;let _0x2cf5d7=_0x3032[_0x34ceb3];return _0x2cf5d7;};import{default as _0x522d4c}from'./aitextadapter.js';import{AIRequestError as _0x1abf50}from'./aiadapter.js';import{getTranslation as _0x51c460}from'../utils/common-translations.js';export default class M extends _0x522d4c{static get[_0x2cf5('0xd')](){return _0x2cf5('0x2f');}constructor(_0x3f9456){super(_0x3f9456),_0x3f9456['config'][_0x2cf5('0x26')](_0x2cf5('0x1c'),_0x2cf5('0x2e')),_0x3f9456[_0x2cf5('0xf')]['define'](_0x2cf5('0x15'),_0x2cf5('0x1f')),_0x3f9456[_0x2cf5('0xf')]['define'](_0x2cf5('0x18'),0x7d0),_0x3f9456[_0x2cf5('0xf')][_0x2cf5('0x26')]('ai.openAI.requestParameters.temperature',0x1),_0x3f9456['config'][_0x2cf5('0x26')](_0x2cf5('0x29'),0x1),_0x3f9456[_0x2cf5('0xf')]['define'](_0x2cf5('0x28'),!0x0),this[_0x2cf5('0x3')]=_0x3f9456[_0x2cf5('0xf')]['get'](_0x2cf5('0x1c')),this[_0x2cf5('0xe')]=_0x3f9456[_0x2cf5('0xf')][_0x2cf5('0x1a')]('ai.openAI.requestHeaders')||{},this[_0x2cf5('0x22')]=_0x3f9456[_0x2cf5('0xf')][_0x2cf5('0x1a')](_0x2cf5('0x2b'));}async[_0x2cf5('0x2d')]({query:_0x4e2100,context:_0xa5fcfc,onData:_0x290ca8,actionId:_0x424158}){const _0xb031f3=this[_0x2cf5('0x32')][_0x2cf5('0x23')],_0x5f1add=await this[_0x2cf5('0x2')](_0x4e2100,_0xa5fcfc,_0x424158),_0x464f63=await this[_0x2cf5('0x8')](this[_0x2cf5('0xe')],_0x424158),_0x44f1ff=await this['_prepareRequestParameters'](this['_requestParameters'],_0x424158),_0x5dc0b2={'messages':_0x5f1add,..._0x44f1ff},_0x417088={'method':'POST','headers':_0x464f63,'body':JSON[_0x2cf5('0x1e')](_0x5dc0b2),'signal':this[_0x2cf5('0x1b')][_0x2cf5('0x17')]},_0x436c6a=await fetch(this[_0x2cf5('0x3')],_0x417088);if(_0x436c6a['ok'])return _0x44f1ff[_0x2cf5('0x11')]?await this[_0x2cf5('0x10')](_0x436c6a,_0x290ca8):await this['_readStaticResponse'](_0x436c6a,_0x290ca8),Promise[_0x2cf5('0x12')]();{const _0x4e1d4e=await _0x436c6a[_0x2cf5('0x0')]();return _0x4e1d4e['includes'](_0x2cf5('0x6'))?Promise[_0x2cf5('0xa')](new _0x1abf50(_0x51c460(_0xb031f3,'AI_ERROR_CONTEXT_LENGTH'))):_0x4e1d4e['includes'](_0x2cf5('0xb'))?Promise[_0x2cf5('0xa')](new _0x1abf50(_0x51c460(_0xb031f3,'AI_ERROR_MODERATION'))):Promise[_0x2cf5('0xa')](new Error(_0x4e1d4e));}}async['prepareMessages'](_0x5ef765,_0x43a42f,_0x4febef){let _0x347894,_0x31da1e;return _0x43a42f?(_0x347894='Your\x20task\x20is\x20to\x20execute\x20the\x20instruction\x20using\x20the\x20provided\x20HTML\x20content.\x20Follow\x20the\x20instruction\x20closely.\x20Your\x20answer\x20must\x20be\x20a\x20properly\x20formatted\x20HTML\x20code.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.',_0x31da1e=_0x2cf5('0x33')+_0x5ef765+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+(_0x43a42f['startsWith']('<')?_0x43a42f:_0x2cf5('0x21')+_0x43a42f+_0x2cf5('0x4'))):(_0x347894='Your\x20task\x20is\x20to\x20generate\x20HTML\x20content\x20accordingly\x20to\x20the\x20given\x20instruction.\x20Never\x20include\x20<img>\x20tag\x20in\x20your\x20response\x20even\x20if\x20asked\x20for.\x20Your\x20answer\x20must\x20be\x20a\x20well-structured\x20and\x20properly\x20formatted\x20HTML\x20code.\x20Answer\x20only\x20with\x20the\x20generated\x20HTML\x20content.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.',_0x31da1e=_0x5ef765),[{'role':_0x2cf5('0x16'),'content':_0x347894},{'role':_0x2cf5('0x34'),'content':_0x31da1e}];}async[_0x2cf5('0x10')](_0x3ff4c9,_0x3d10ae){const _0x307ab5=_0x3ff4c9[_0x2cf5('0x5')][_0x2cf5('0x14')](),_0x3cbf23=new TextDecoder();let _0x405f8b='',_0x4a2fa0='',_0x547a5a='',_0x40efc7=!0x1;for(;!_0x40efc7;){const {done:_0x1e9ac2,value:_0x5ba188}=await _0x307ab5[_0x2cf5('0x2a')](),_0x4663d9=_0x405f8b+_0x3cbf23[_0x2cf5('0x35')](_0x5ba188);let _0x5ee713='';_0x40efc7=_0x1e9ac2;try{_0x5ee713=this['_cleanUpData'](_0x4663d9),_0x405f8b='';}catch(_0xa467c3){_0x405f8b=_0x4663d9;continue;}_0x4a2fa0+=_0x5ee713,!_0x40efc7&&this[_0x2cf5('0x25')](_0x4a2fa0)||_0x4a2fa0&&(_0x547a5a+=_0x4a2fa0,_0x4a2fa0='',_0x3d10ae(_0x547a5a));}return Promise[_0x2cf5('0x12')]();}async[_0x2cf5('0x27')](_0x3413c3,_0x44b79d){return _0x44b79d((await _0x3413c3[_0x2cf5('0x1d')]())[_0x2cf5('0x30')][0x0]['message'][_0x2cf5('0x19')]),Promise[_0x2cf5('0x12')]();}['_isBufferIncomplete'](_0x3c5f7b){const _0x10b87e=_0x3c5f7b[_0x2cf5('0x2c')]('<')[_0x2cf5('0x13')]!==_0x3c5f7b[_0x2cf5('0x2c')]('>')[_0x2cf5('0x13')],_0x1fb2d9=_0x3c5f7b[_0x2cf5('0x13')]<0x1e;return _0x10b87e&&_0x1fb2d9;}[_0x2cf5('0xc')](_0x2ea995){return _0x2ea995[_0x2cf5('0x2c')](/\n(?![^{]*\})/g)['map'](_0x595fa4=>_0x595fa4[_0x2cf5('0x9')]('data:\x20',''))[_0x2cf5('0x24')](_0x5e89e4=>_0x5e89e4&&_0x5e89e4[_0x2cf5('0x13')]>0x0&&_0x2cf5('0x20')!==_0x5e89e4)[_0x2cf5('0x31')](_0x5833ad=>{const {choices:_0x5d0a9b}=JSON['parse'](_0x5833ad);if(_0x5d0a9b[0x0]&&_0x5d0a9b[0x0][_0x2cf5('0x1')]&&_0x5d0a9b[0x0][_0x2cf5('0x1')][_0x2cf5('0x19')])return _0x5d0a9b[0x0][_0x2cf5('0x1')][_0x2cf5('0x19')];})[_0x2cf5('0x24')](_0x80da1c=>_0x80da1c)[_0x2cf5('0x7')]('');}}
23
+ const _0x2b0f=['_readStaticResponse','ai.openAI.requestParameters.stream','_requestParameters','startsWith','join','ai.openAI.requestParameters.max_tokens','\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a','config','resolve','delta','data:\x20','get','choices','define','stringify','text','ai.openAI.requestParameters.top_p','read','message','pluginName','ai.openAI.requestHeaders','getReader','</span>','_prepareRequestHeaders','POST','json','AI_ERROR_MODERATION','body','_isBufferIncomplete','prepareMessages','system','ai.openAI.requestParameters.model','user','Instruction:\x0a','abortController','editor','[DONE]','length','stream','parse','_readStreamableResponse','ai.openAI.requestParameters.temperature','AI_ERROR_CONTEXT_LENGTH','Your\x20task\x20is\x20to\x20execute\x20the\x20instruction\x20using\x20the\x20provided\x20HTML\x20content.\x20Follow\x20the\x20instruction\x20closely.\x20Your\x20answer\x20must\x20be\x20a\x20properly\x20formatted\x20HTML\x20code.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.','signal','_cleanUpData','reject','_requestHeaders','split','replace','_apiUrl','content','map','context_length_exceeded','locale','decode','ai.openAI.apiUrl'];(function(_0x54c0a4,_0x2b0fc0){const _0x1d1c92=function(_0x1376ee){while(--_0x1376ee){_0x54c0a4['push'](_0x54c0a4['shift']());}};_0x1d1c92(++_0x2b0fc0);}(_0x2b0f,0x1c8));const _0x1d1c=function(_0x54c0a4,_0x2b0fc0){_0x54c0a4=_0x54c0a4-0x0;let _0x1d1c92=_0x2b0f[_0x54c0a4];return _0x1d1c92;};import{default as _0x5e9e3c}from'./aitextadapter.js';import{AIRequestError as _0x12def1}from'./aiadapter.js';import{getTranslation as _0x4dafd2}from'../utils/common-translations.js';export default class M extends _0x5e9e3c{static get[_0x1d1c('0x13')](){return'OpenAITextAdapter';}constructor(_0x1ea76f){super(_0x1ea76f),_0x1ea76f[_0x1d1c('0x7')][_0x1d1c('0xd')](_0x1d1c('0x38'),'https://api.openai.com/v1/chat/completions'),_0x1ea76f['config'][_0x1d1c('0xd')](_0x1d1c('0x1f'),'gpt-3.5-turbo'),_0x1ea76f['config'][_0x1d1c('0xd')](_0x1d1c('0x5'),0x7d0),_0x1ea76f['config'][_0x1d1c('0xd')](_0x1d1c('0x29'),0x1),_0x1ea76f[_0x1d1c('0x7')][_0x1d1c('0xd')](_0x1d1c('0x10'),0x1),_0x1ea76f[_0x1d1c('0x7')][_0x1d1c('0xd')](_0x1d1c('0x1'),!0x0),this[_0x1d1c('0x32')]=_0x1ea76f['config']['get']('ai.openAI.apiUrl'),this[_0x1d1c('0x2f')]=_0x1ea76f['config']['get'](_0x1d1c('0x14'))||{},this[_0x1d1c('0x2')]=_0x1ea76f['config'][_0x1d1c('0xb')]('ai.openAI.requestParameters');}async['sendRequest']({query:_0x43bd94,context:_0xc154d8,onData:_0x2fdd82,actionId:_0x3cc313}){const _0x1680ca=this[_0x1d1c('0x23')][_0x1d1c('0x36')],_0x54640b=await this[_0x1d1c('0x1d')](_0x43bd94,_0xc154d8,_0x3cc313),_0x3caf8c=await this[_0x1d1c('0x17')](this['_requestHeaders'],_0x3cc313),_0x204f99=await this['_prepareRequestParameters'](this[_0x1d1c('0x2')],_0x3cc313),_0x1677db={'messages':_0x54640b,..._0x204f99},_0xf6ce2e={'method':_0x1d1c('0x18'),'headers':_0x3caf8c,'body':JSON[_0x1d1c('0xe')](_0x1677db),'signal':this[_0x1d1c('0x22')][_0x1d1c('0x2c')]},_0x1afe5f=await fetch(this[_0x1d1c('0x32')],_0xf6ce2e);if(_0x1afe5f['ok'])return _0x204f99[_0x1d1c('0x26')]?await this[_0x1d1c('0x28')](_0x1afe5f,_0x2fdd82):await this[_0x1d1c('0x0')](_0x1afe5f,_0x2fdd82),Promise[_0x1d1c('0x8')]();{const _0x36abf7=await _0x1afe5f[_0x1d1c('0xf')]();return _0x36abf7['includes'](_0x1d1c('0x35'))?Promise[_0x1d1c('0x2e')](new _0x12def1(_0x4dafd2(_0x1680ca,_0x1d1c('0x2a')))):_0x36abf7['includes']('Moderation')?Promise[_0x1d1c('0x2e')](new _0x12def1(_0x4dafd2(_0x1680ca,_0x1d1c('0x1a')))):Promise[_0x1d1c('0x2e')](new Error(_0x36abf7));}}async[_0x1d1c('0x1d')](_0x44939a,_0x5eaf46,_0xf10ed1){let _0x488305,_0xc14d92;return _0x5eaf46?(_0x488305=_0x1d1c('0x2b'),_0xc14d92=_0x1d1c('0x21')+_0x44939a+_0x1d1c('0x6')+(_0x5eaf46[_0x1d1c('0x3')]('<')?_0x5eaf46:'<span>'+_0x5eaf46+_0x1d1c('0x16'))):(_0x488305='Your\x20task\x20is\x20to\x20generate\x20HTML\x20content\x20accordingly\x20to\x20the\x20given\x20instruction.\x20Never\x20include\x20<img>\x20tag\x20in\x20your\x20response\x20even\x20if\x20asked\x20for.\x20Your\x20answer\x20must\x20be\x20a\x20well-structured\x20and\x20properly\x20formatted\x20HTML\x20code.\x20Answer\x20only\x20with\x20the\x20generated\x20HTML\x20content.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.',_0xc14d92=_0x44939a),[{'role':_0x1d1c('0x1e'),'content':_0x488305},{'role':_0x1d1c('0x20'),'content':_0xc14d92}];}async['_readStreamableResponse'](_0x12133f,_0x1c0132){const _0x24fb38=_0x12133f[_0x1d1c('0x1b')][_0x1d1c('0x15')](),_0x4d26fe=new TextDecoder();let _0x88fc6a='',_0x38c65a='',_0x5c2f20='',_0x5125ce=!0x1;for(;!_0x5125ce;){const {done:_0x4909e3,value:_0x14121d}=await _0x24fb38[_0x1d1c('0x11')](),_0x40a1a9=_0x88fc6a+_0x4d26fe[_0x1d1c('0x37')](_0x14121d);let _0x2e9d4b='';_0x5125ce=_0x4909e3;try{_0x2e9d4b=this[_0x1d1c('0x2d')](_0x40a1a9),_0x88fc6a='';}catch(_0x2b526c){_0x88fc6a=_0x40a1a9;continue;}_0x38c65a+=_0x2e9d4b,!_0x5125ce&&this[_0x1d1c('0x1c')](_0x38c65a)||_0x38c65a&&(_0x5c2f20+=_0x38c65a,_0x38c65a='',_0x1c0132(_0x5c2f20));}return Promise['resolve']();}async[_0x1d1c('0x0')](_0x49c350,_0x522e6a){return _0x522e6a((await _0x49c350[_0x1d1c('0x19')]())[_0x1d1c('0xc')][0x0][_0x1d1c('0x12')]['content']),Promise[_0x1d1c('0x8')]();}[_0x1d1c('0x1c')](_0x3dc68f){const _0x2a7a6f=_0x3dc68f['split']('<')[_0x1d1c('0x25')]!==_0x3dc68f[_0x1d1c('0x30')]('>')[_0x1d1c('0x25')],_0x3907e1=_0x3dc68f[_0x1d1c('0x25')]<0x1e;return _0x2a7a6f&&_0x3907e1;}['_cleanUpData'](_0x6978){return _0x6978[_0x1d1c('0x30')](/\n(?![^{]*\})/g)[_0x1d1c('0x34')](_0x2a3c89=>_0x2a3c89[_0x1d1c('0x31')](_0x1d1c('0xa'),''))['filter'](_0x1f6d16=>_0x1f6d16&&_0x1f6d16['length']>0x0&&_0x1d1c('0x24')!==_0x1f6d16)[_0x1d1c('0x34')](_0x3a6c48=>{const {choices:_0x4d4ade}=JSON[_0x1d1c('0x27')](_0x3a6c48);if(_0x4d4ade[0x0]&&_0x4d4ade[0x0][_0x1d1c('0x9')]&&_0x4d4ade[0x0][_0x1d1c('0x9')][_0x1d1c('0x33')])return _0x4d4ade[0x0][_0x1d1c('0x9')][_0x1d1c('0x33')];})['filter'](_0x337bc5=>_0x337bc5)[_0x1d1c('0x4')]('');}}
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x294e=['find','generate','Simplified\x20Chinese','direct','continue','Make\x20shorter','Make\x20longer','forEach','Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.','aiLicenseKeyTrial','Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.','Remove\x20any\x20repetitive,\x20redundant,\x20or\x20non-essential\x20writing\x20in\x20this\x20content\x20without\x20changing\x20the\x20meaning\x20or\x20losing\x20any\x20key\x20information.','destroy','business','commands','translateChinese','pluginName','Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.','Translate\x20the\x20content\x20to\x20Hindi\x20language.','journalism','Translate\x20the\x20content\x20to\x20English\x20language.','push','summarize','Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.','aiLicenseKeyInvalid','Start\x20with\x20the\x20provided\x20content\x20and\x20write\x20at\x20the\x20end\x20of\x20it\x20continuing\x20this\x20topic.\x20Keep\x20the\x20added\x20part\x20short.','Portuguese','French','Friendly','define','translateGerman','Translate','Hindi','config','Simplify\x20the\x20writing\x20style\x20of\x20this\x20content\x20and\x20reduce\x20the\x20complexity,\x20so\x20that\x20the\x20content\x20is\x20easy\x20to\x20understand.','simplifyLanguage','groupId','casual','Change\x20tone','get','ai-trial-license-key-reached-limit-changes','requires','translateEnglish','licenseKey','ai.aiAssistant.removeCommands','Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.','German','_licenseKeyCheckInterval','Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.','Translate\x20to\x20%0','You\x20are\x20using\x20the\x20trial\x20version\x20of\x20CKEditor\x205\x20ai\x20plugin\x20with\x20limited\x20usage.\x20Make\x20sure\x20you\x20will\x20not\x20use\x20it\x20in\x20the\x20production\x20environment.','Professional','locale','Confident','Arabic','ai-invalid-license-key','AIAssistant','Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.','Generate\x20from\x20selection','confident','Journalism','Translate\x20the\x20content\x20to\x20Portuguese\x20language.','Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.','Summarize','Edit\x20or\x20review','aiLicenseKeyTrialLimit:operations','Translate\x20the\x20content\x20to\x20German\x20language.','filter','English','ai.aiAssistant.commands','Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.','friendly','Continue','includes','improveWriting','Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.','Direct','Legal','professional','ai.aiAssistant.extraCommandGroups','Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.','Poetic'];(function(_0x4bb908,_0x294e0c){const _0xfe2f55=function(_0x50fa3b){while(--_0x50fa3b){_0x4bb908['push'](_0x4bb908['shift']());}};_0xfe2f55(++_0x294e0c);}(_0x294e,0x1a2));const _0xfe2f=function(_0x4bb908,_0x294e0c){_0x4bb908=_0x4bb908-0x0;let _0xfe2f55=_0x294e[_0x4bb908];return _0xfe2f55;};import{CKEditorError as _0x3bbacc}from'ckeditor5/src/utils.js';import{Plugin as _0x42d85c}from'ckeditor5/src/core.js';import _0x18aafb from'./aiassistantui.js';import _0x50da61 from'./aiassistantediting.js';import{getTranslation as _0x539721}from'./utils/common-translations.js';export default class r extends _0x42d85c{static get[_0xfe2f('0x21')](){return[_0x18aafb,_0x50da61];}static get[_0xfe2f('0x8')](){return _0xfe2f('0x30');}constructor(_0x4f0bdb){super(_0x4f0bdb);const _0x5a2ab4=_0x4f0bdb['config'];_0x5a2ab4[_0xfe2f('0x15')](_0xfe2f('0x3d'),getDefaultCommands(_0x4f0bdb[_0xfe2f('0x2c')])),_0x5a2ab4[_0xfe2f('0x15')](_0xfe2f('0x47'),[]),_0x5a2ab4['define'](_0xfe2f('0x24'),[]);const _0x214a4e=_0x5a2ab4[_0xfe2f('0x1f')]('ai.aiAssistant.commands'),_0x548e87=_0x5a2ab4['get'](_0xfe2f('0x47')),_0x2bedf6=_0x5a2ab4['get'](_0xfe2f('0x24'));_0x548e87[_0xfe2f('0x51')](_0x2d7fc6=>{const _0xa2de33=_0x214a4e[_0xfe2f('0x4a')](_0x3a0586=>_0x3a0586[_0xfe2f('0x1c')]===_0x2d7fc6[_0xfe2f('0x1c')]);_0xa2de33?_0xa2de33['commands']=_0xa2de33[_0xfe2f('0x6')]['concat'](_0x2d7fc6[_0xfe2f('0x6')]):_0x214a4e[_0xfe2f('0xd')](_0x2d7fc6);}),_0x214a4e[_0xfe2f('0x51')](_0x51d0fb=>{_0x51d0fb['commands']=_0x51d0fb[_0xfe2f('0x6')][_0xfe2f('0x3b')](_0x35bf02=>!_0x2bedf6[_0xfe2f('0x41')](_0x35bf02['id']));}),_0x5a2ab4['set'](_0xfe2f('0x3d'),_0x214a4e);}['init'](){const _0x56660a=this['editor'];this[_0xfe2f('0x23')]=_0x56660a[_0xfe2f('0x19')]['get'](_0xfe2f('0x23')),this[_0xfe2f('0x27')]=setInterval(()=>{let _0x22e13d;for(const _0x190449 in _0x56660a){const _0x4511be=_0x190449,_0x4b0217=_0x56660a[_0x4511be];if(_0xfe2f('0x1')===_0x4b0217||'aiLicenseKeyInvalid'===_0x4b0217||'aiLicenseKeyValid'===_0x4b0217||_0xfe2f('0x39')===_0x4b0217){delete _0x56660a[_0x4511be],_0x22e13d=_0x4b0217;break;}}if(_0xfe2f('0x10')===_0x22e13d)throw clearInterval(this['_licenseKeyCheckInterval']),new _0x3bbacc(_0xfe2f('0x2f'),null);if(_0xfe2f('0x1')===_0x22e13d&&console['info'](_0xfe2f('0x2a')),_0xfe2f('0x39')===_0x22e13d)throw clearInterval(this[_0xfe2f('0x27')]),new _0x3bbacc(_0xfe2f('0x20'),null);'aiLicenseKeyValid'===_0x22e13d&&clearInterval(this[_0xfe2f('0x27')]);},0x3e8);}[_0xfe2f('0x4')](){this[_0xfe2f('0x27')]&&clearInterval(this['_licenseKeyCheckInterval']);}}export function getDefaultCommands(_0xfca2c1){return[{'groupId':'editOrReview','groupLabel':_0x539721(_0xfca2c1,_0xfe2f('0x38')),'commands':[{'id':_0xfe2f('0x42'),'label':_0x539721(_0xfca2c1,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':_0x539721(_0xfca2c1,_0xfe2f('0x4f')),'prompt':_0xfe2f('0x3')},{'id':'makeLonger','label':_0x539721(_0xfca2c1,_0xfe2f('0x50')),'prompt':_0xfe2f('0x0')},{'id':_0xfe2f('0x1b'),'label':_0x539721(_0xfca2c1,'Simplify\x20language'),'prompt':_0xfe2f('0x1a')}]},{'groupId':_0xfe2f('0x4b'),'groupLabel':_0x539721(_0xfca2c1,_0xfe2f('0x32')),'commands':[{'id':_0xfe2f('0xe'),'label':_0x539721(_0xfca2c1,_0xfe2f('0x37')),'prompt':'Summarize\x20this\x20content\x20into\x20one\x20paragraph\x20of\x20text.\x20Include\x20only\x20the\x20key\x20ideas\x20and\x20conclusions.\x20Keep\x20it\x20short.\x20Do\x20not\x20keep\x20original\x20text\x20formatting.'},{'id':_0xfe2f('0x4e'),'label':_0x539721(_0xfca2c1,_0xfe2f('0x40')),'prompt':_0xfe2f('0x11')}]},{'groupId':'changeTone','groupLabel':_0x539721(_0xfca2c1,_0xfe2f('0x1e')),'commands':[{'id':_0xfe2f('0x46'),'label':_0x539721(_0xfca2c1,_0xfe2f('0x2b')),'prompt':_0xfe2f('0x25')},{'id':_0xfe2f('0x1d'),'label':_0x539721(_0xfca2c1,'Casual'),'prompt':_0xfe2f('0x43')},{'id':_0xfe2f('0x4d'),'label':_0x539721(_0xfca2c1,_0xfe2f('0x44')),'prompt':_0xfe2f('0x2')},{'id':_0xfe2f('0x33'),'label':_0x539721(_0xfca2c1,_0xfe2f('0x2d')),'prompt':_0xfe2f('0x31')},{'id':_0xfe2f('0x3f'),'label':_0x539721(_0xfca2c1,_0xfe2f('0x14')),'prompt':_0xfe2f('0xf')}]},{'groupId':'changeStyle','groupLabel':_0x539721(_0xfca2c1,'Change\x20style'),'commands':[{'id':_0xfe2f('0x5'),'label':_0x539721(_0xfca2c1,'Business'),'prompt':_0xfe2f('0x36')},{'id':'legal','label':_0x539721(_0xfca2c1,_0xfe2f('0x45')),'prompt':_0xfe2f('0x3e')},{'id':_0xfe2f('0xb'),'label':_0x539721(_0xfca2c1,_0xfe2f('0x34')),'prompt':_0xfe2f('0x28')},{'id':'poetic','label':_0x539721(_0xfca2c1,_0xfe2f('0x49')),'prompt':_0xfe2f('0x48')}]},{'groupId':'translate','groupLabel':_0x539721(_0xfca2c1,_0xfe2f('0x17')),'commands':[{'id':_0xfe2f('0x22'),'label':_0x539721(_0xfca2c1,'Translate\x20to\x20%0',[_0x539721(_0xfca2c1,_0xfe2f('0x3c'))]),'prompt':_0xfe2f('0xc')},{'id':'translateSpanish','label':_0x539721(_0xfca2c1,_0xfe2f('0x29'),[_0x539721(_0xfca2c1,'Spanish')]),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':_0x539721(_0xfca2c1,_0xfe2f('0x29'),[_0x539721(_0xfca2c1,_0xfe2f('0x12'))]),'prompt':_0xfe2f('0x35')},{'id':_0xfe2f('0x16'),'label':_0x539721(_0xfca2c1,'Translate\x20to\x20%0',[_0x539721(_0xfca2c1,_0xfe2f('0x26'))]),'prompt':_0xfe2f('0x3a')},{'id':'translateFrench','label':_0x539721(_0xfca2c1,_0xfe2f('0x29'),[_0x539721(_0xfca2c1,_0xfe2f('0x13'))]),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':_0xfe2f('0x7'),'label':_0x539721(_0xfca2c1,_0xfe2f('0x29'),[_0x539721(_0xfca2c1,_0xfe2f('0x4c'))]),'prompt':_0xfe2f('0x9')},{'id':'translateHindi','label':_0x539721(_0xfca2c1,_0xfe2f('0x29'),[_0x539721(_0xfca2c1,_0xfe2f('0x18'))]),'prompt':_0xfe2f('0xa')},{'id':'translateArabic','label':_0x539721(_0xfca2c1,'Translate\x20to\x20%0',[_0x539721(_0xfca2c1,_0xfe2f('0x2e'))]),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}
23
+ const _0x4047=['_licenseKeyCheckInterval','Professional','Translate\x20to\x20%0','English','translateEnglish','filter','Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.','ai.aiAssistant.extraCommandGroups','confident','info','continue','Business','Translate\x20the\x20content\x20to\x20Spanish\x20language.','pluginName','translateHindi','Arabic','poetic','simplifyLanguage','locale','ai.aiAssistant.removeCommands','Translate\x20the\x20content\x20to\x20English\x20language.','changeTone','Continue','makeShorter','get','makeLonger','Edit\x20or\x20review','aiLicenseKeyValid','Confident','translate','direct','German','Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.','Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.','Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.','legal','casual','professional','forEach','Friendly','French','Make\x20longer','translateSpanish','Translate\x20the\x20content\x20to\x20Portuguese\x20language.','generate','editOrReview','Translate\x20the\x20content\x20to\x20French\x20language.','init','licenseKey','commands','ai.aiAssistant.commands','Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.','Translate\x20the\x20content\x20to\x20Hindi\x20language.','Translate\x20the\x20content\x20to\x20Arabic\x20language.','Simplified\x20Chinese','requires','Poetic','friendly','Direct','includes','groupId','Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.','translatePortuguese','Simplify\x20the\x20writing\x20style\x20of\x20this\x20content\x20and\x20reduce\x20the\x20complexity,\x20so\x20that\x20the\x20content\x20is\x20easy\x20to\x20understand.','aiLicenseKeyTrialLimit:operations','Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.','Translate\x20the\x20content\x20to\x20German\x20language.','translateChinese','config','Spanish','Generate\x20from\x20selection','translateArabic','ai-invalid-license-key','set','Make\x20shorter','destroy','aiLicenseKeyTrial','You\x20are\x20using\x20the\x20trial\x20version\x20of\x20CKEditor\x205\x20ai\x20plugin\x20with\x20limited\x20usage.\x20Make\x20sure\x20you\x20will\x20not\x20use\x20it\x20in\x20the\x20production\x20environment.','AIAssistant','Start\x20with\x20the\x20provided\x20content\x20and\x20write\x20at\x20the\x20end\x20of\x20it\x20continuing\x20this\x20topic.\x20Keep\x20the\x20added\x20part\x20short.','aiLicenseKeyInvalid','define','Summarize','Summarize\x20this\x20content\x20into\x20one\x20paragraph\x20of\x20text.\x20Include\x20only\x20the\x20key\x20ideas\x20and\x20conclusions.\x20Keep\x20it\x20short.\x20Do\x20not\x20keep\x20original\x20text\x20formatting.','Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.','Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.','Simplify\x20language'];(function(_0x4e4168,_0x4047ce){const _0x1201df=function(_0x5da9bd){while(--_0x5da9bd){_0x4e4168['push'](_0x4e4168['shift']());}};_0x1201df(++_0x4047ce);}(_0x4047,0x1ad));const _0x1201=function(_0x4e4168,_0x4047ce){_0x4e4168=_0x4e4168-0x0;let _0x1201df=_0x4047[_0x4e4168];return _0x1201df;};import{CKEditorError as _0x3cd7f7}from'ckeditor5/src/utils.js';import{Plugin as _0x125298}from'ckeditor5/src/core.js';import _0x128af5 from'./aiassistantui.js';import _0x13240d from'./aiassistantediting.js';import{getTranslation as _0x4b6a32}from'./utils/common-translations.js';export default class r extends _0x125298{static get[_0x1201('0x3d')](){return[_0x128af5,_0x13240d];}static get[_0x1201('0x13')](){return _0x1201('0x54');}constructor(_0x9ecaa0){super(_0x9ecaa0);const _0x23942f=_0x9ecaa0[_0x1201('0x4a')];_0x23942f[_0x1201('0x0')](_0x1201('0x38'),getDefaultCommands(_0x9ecaa0[_0x1201('0x18')])),_0x23942f['define'](_0x1201('0xd'),[]),_0x23942f[_0x1201('0x0')](_0x1201('0x19'),[]);const _0xecdcea=_0x23942f[_0x1201('0x1e')](_0x1201('0x38')),_0x3ca675=_0x23942f['get'](_0x1201('0xd')),_0x472234=_0x23942f[_0x1201('0x1e')](_0x1201('0x19'));_0x3ca675[_0x1201('0x2c')](_0x334e09=>{const _0x51adf6=_0xecdcea['find'](_0x47c9c7=>_0x47c9c7[_0x1201('0x42')]===_0x334e09[_0x1201('0x42')]);_0x51adf6?_0x51adf6[_0x1201('0x37')]=_0x51adf6[_0x1201('0x37')]['concat'](_0x334e09['commands']):_0xecdcea['push'](_0x334e09);}),_0xecdcea['forEach'](_0xcd14bb=>{_0xcd14bb['commands']=_0xcd14bb[_0x1201('0x37')][_0x1201('0xb')](_0x4ffef9=>!_0x472234[_0x1201('0x41')](_0x4ffef9['id']));}),_0x23942f[_0x1201('0x4f')](_0x1201('0x38'),_0xecdcea);}[_0x1201('0x35')](){const _0xbb6be9=this['editor'];this[_0x1201('0x36')]=_0xbb6be9[_0x1201('0x4a')]['get'](_0x1201('0x36')),this[_0x1201('0x6')]=setInterval(()=>{let _0x2f3f1b;for(const _0x2174d0 in _0xbb6be9){const _0x2087c0=_0x2174d0,_0x532e93=_0xbb6be9[_0x2087c0];if(_0x1201('0x52')===_0x532e93||_0x1201('0x56')===_0x532e93||_0x1201('0x21')===_0x532e93||_0x1201('0x46')===_0x532e93){delete _0xbb6be9[_0x2087c0],_0x2f3f1b=_0x532e93;break;}}if(_0x1201('0x56')===_0x2f3f1b)throw clearInterval(this[_0x1201('0x6')]),new _0x3cd7f7(_0x1201('0x4e'),null);if(_0x1201('0x52')===_0x2f3f1b&&console[_0x1201('0xf')](_0x1201('0x53')),_0x1201('0x46')===_0x2f3f1b)throw clearInterval(this[_0x1201('0x6')]),new _0x3cd7f7('ai-trial-license-key-reached-limit-changes',null);_0x1201('0x21')===_0x2f3f1b&&clearInterval(this[_0x1201('0x6')]);},0x3e8);}[_0x1201('0x51')](){this[_0x1201('0x6')]&&clearInterval(this[_0x1201('0x6')]);}}export function getDefaultCommands(_0x5476d3){return[{'groupId':_0x1201('0x33'),'groupLabel':_0x4b6a32(_0x5476d3,_0x1201('0x20')),'commands':[{'id':'improveWriting','label':_0x4b6a32(_0x5476d3,'Improve\x20writing'),'prompt':_0x1201('0xc')},{'id':_0x1201('0x1d'),'label':_0x4b6a32(_0x5476d3,_0x1201('0x50')),'prompt':'Remove\x20any\x20repetitive,\x20redundant,\x20or\x20non-essential\x20writing\x20in\x20this\x20content\x20without\x20changing\x20the\x20meaning\x20or\x20losing\x20any\x20key\x20information.'},{'id':_0x1201('0x1f'),'label':_0x4b6a32(_0x5476d3,_0x1201('0x2f')),'prompt':_0x1201('0x26')},{'id':_0x1201('0x17'),'label':_0x4b6a32(_0x5476d3,_0x1201('0x5')),'prompt':_0x1201('0x45')}]},{'groupId':_0x1201('0x32'),'groupLabel':_0x4b6a32(_0x5476d3,_0x1201('0x4c')),'commands':[{'id':'summarize','label':_0x4b6a32(_0x5476d3,_0x1201('0x1')),'prompt':_0x1201('0x2')},{'id':_0x1201('0x10'),'label':_0x4b6a32(_0x5476d3,_0x1201('0x1c')),'prompt':_0x1201('0x55')}]},{'groupId':_0x1201('0x1b'),'groupLabel':_0x4b6a32(_0x5476d3,'Change\x20tone'),'commands':[{'id':_0x1201('0x2b'),'label':_0x4b6a32(_0x5476d3,_0x1201('0x7')),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':_0x1201('0x2a'),'label':_0x4b6a32(_0x5476d3,'Casual'),'prompt':_0x1201('0x4')},{'id':_0x1201('0x24'),'label':_0x4b6a32(_0x5476d3,_0x1201('0x40')),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':_0x1201('0xe'),'label':_0x4b6a32(_0x5476d3,_0x1201('0x22')),'prompt':_0x1201('0x39')},{'id':_0x1201('0x3f'),'label':_0x4b6a32(_0x5476d3,_0x1201('0x2d')),'prompt':_0x1201('0x3')}]},{'groupId':'changeStyle','groupLabel':_0x4b6a32(_0x5476d3,'Change\x20style'),'commands':[{'id':'business','label':_0x4b6a32(_0x5476d3,_0x1201('0x11')),'prompt':_0x1201('0x47')},{'id':_0x1201('0x29'),'label':_0x4b6a32(_0x5476d3,'Legal'),'prompt':_0x1201('0x27')},{'id':'journalism','label':_0x4b6a32(_0x5476d3,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':_0x1201('0x16'),'label':_0x4b6a32(_0x5476d3,_0x1201('0x3e')),'prompt':_0x1201('0x28')}]},{'groupId':_0x1201('0x23'),'groupLabel':_0x4b6a32(_0x5476d3,'Translate'),'commands':[{'id':_0x1201('0xa'),'label':_0x4b6a32(_0x5476d3,_0x1201('0x8'),[_0x4b6a32(_0x5476d3,_0x1201('0x9'))]),'prompt':_0x1201('0x1a')},{'id':_0x1201('0x30'),'label':_0x4b6a32(_0x5476d3,_0x1201('0x8'),[_0x4b6a32(_0x5476d3,_0x1201('0x4b'))]),'prompt':_0x1201('0x12')},{'id':_0x1201('0x44'),'label':_0x4b6a32(_0x5476d3,_0x1201('0x8'),[_0x4b6a32(_0x5476d3,'Portuguese')]),'prompt':_0x1201('0x31')},{'id':'translateGerman','label':_0x4b6a32(_0x5476d3,_0x1201('0x8'),[_0x4b6a32(_0x5476d3,_0x1201('0x25'))]),'prompt':_0x1201('0x48')},{'id':'translateFrench','label':_0x4b6a32(_0x5476d3,_0x1201('0x8'),[_0x4b6a32(_0x5476d3,_0x1201('0x2e'))]),'prompt':_0x1201('0x34')},{'id':_0x1201('0x49'),'label':_0x4b6a32(_0x5476d3,'Translate\x20to\x20%0',[_0x4b6a32(_0x5476d3,_0x1201('0x3c'))]),'prompt':_0x1201('0x43')},{'id':_0x1201('0x14'),'label':_0x4b6a32(_0x5476d3,'Translate\x20to\x20%0',[_0x4b6a32(_0x5476d3,'Hindi')]),'prompt':_0x1201('0x3a')},{'id':_0x1201('0x4d'),'label':_0x4b6a32(_0x5476d3,_0x1201('0x8'),[_0x4b6a32(_0x5476d3,_0x1201('0x15'))]),'prompt':_0x1201('0x3b')}]}];}
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x252b=['hideFakeVisualSelection','ai-ui-candidate','ck-fake-ai-selection_collapsed','ck-ai-assistant-ui_theme','ck-fake-ai-selection-candidate','ai-ui','editor','change','isContent','editingDowncast','conversion','showFakeVisualSelection','markerToHighlight','init','getRange','data','get','document','insertContentBelow','removeMarker','span','end','markers','pop','getLastPosition','createRange','for','config','isAtEnd','getFirstRange','start','selection','processor','has','markerToElement','insertContent','canEditAt','ai.useTheme','addMarker','from','createSelection','setSelection','model'];(function(_0x4b6e7c,_0x252b64){const _0x22f3f7=function(_0x4eac77){while(--_0x4eac77){_0x4b6e7c['push'](_0x4b6e7c['shift']());}};_0x22f3f7(++_0x252b64);}(_0x252b,0x1a1));const _0x22f3=function(_0x4b6e7c,_0x252b64){_0x4b6e7c=_0x4b6e7c-0x0;let _0x22f3f7=_0x252b[_0x4b6e7c];return _0x22f3f7;};import{Plugin as _0x326b45}from'ckeditor5/src/core.js';const s=_0x22f3('0x12'),c=_0x22f3('0xe');export default class i extends _0x326b45{static get['pluginName'](){return'AIAssistantEditing';}[_0x22f3('0x1a')](){const {editor:_0x5682f7}=this,_0x5ed718=['ck-fake-ai-selection'];_0x5682f7[_0x22f3('0x28')][_0x22f3('0x1d')](_0x22f3('0x7'))&&_0x5ed718['push'](_0x22f3('0x10')),_0x5682f7[_0x22f3('0x17')][_0x22f3('0x27')](_0x22f3('0x16'))['markerToHighlight']({'model':s,'view':{'classes':_0x5ed718}}),_0x5682f7[_0x22f3('0x17')][_0x22f3('0x27')]('editingDowncast')['markerToElement']({'model':s,'view':{'name':'span','classes':['ck-fake-ai-selection',_0x22f3('0xf')]}}),_0x5682f7['conversion'][_0x22f3('0x27')](_0x22f3('0x16'))[_0x22f3('0x19')]({'model':c,'view':{'classes':[_0x22f3('0x11')]}}),_0x5682f7[_0x22f3('0x17')][_0x22f3('0x27')]('editingDowncast')[_0x22f3('0x4')]({'model':c,'view':{'name':_0x22f3('0x21'),'classes':[_0x22f3('0x11'),_0x22f3('0xf')]}});}[_0x22f3('0x18')](_0x1e680c){const _0x1c8d1f=this['editor']['model'],_0x10b92a=_0x1e680c?c:s;_0x1c8d1f[_0x22f3('0x14')](_0x1800ae=>{const _0x402202=_0x1c8d1f['document'][_0x22f3('0x1')][_0x22f3('0x2a')]();if(_0x1c8d1f[_0x22f3('0x23')][_0x22f3('0x3')](_0x10b92a))_0x1800ae['updateMarker'](_0x10b92a,{'range':_0x402202});else{if(_0x402202[_0x22f3('0x0')][_0x22f3('0x29')]){const _0x5dfa4f=_0x402202['start']['getLastMatchingPosition'](({item:_0x387f69})=>!_0x1c8d1f['schema'][_0x22f3('0x15')](_0x387f69),{'boundaries':_0x402202});_0x1800ae[_0x22f3('0x8')](_0x10b92a,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1800ae[_0x22f3('0x26')](_0x5dfa4f,_0x402202[_0x22f3('0x22')])});}else _0x1800ae[_0x22f3('0x8')](_0x10b92a,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x402202});}});}[_0x22f3('0xd')](_0x390c15){const _0x340c76=this['editor'][_0x22f3('0xc')],_0x12d3a3=_0x390c15?c:s;_0x340c76[_0x22f3('0x23')][_0x22f3('0x3')](_0x12d3a3)&&_0x340c76['change'](_0x5f4333=>{_0x5f4333[_0x22f3('0x20')](_0x12d3a3);});}[_0x22f3('0x5')](_0x3277f7,_0xffa2a1){const _0x565eea=_0xffa2a1||this['editor']['model']['markers']['get'](s)[_0x22f3('0x1b')]();if(!this[_0x22f3('0x13')][_0x22f3('0xc')][_0x22f3('0x6')](_0x565eea))return;const _0x775734=this[_0x22f3('0x13')]['data'][_0x22f3('0x2')]['toView'](_0x3277f7),_0x4df6bb=this['editor'][_0x22f3('0x1c')]['toModel'](_0x775734);this['editor'][_0x22f3('0xc')]['change'](_0x24de97=>{this['hideFakeVisualSelection']();const _0x535aee=this[_0x22f3('0x13')][_0x22f3('0xc')][_0x22f3('0x5')](_0x4df6bb,_0x565eea);_0x535aee&&_0x24de97[_0x22f3('0xb')](_0x535aee);});}[_0x22f3('0x1f')](_0x537040){const {model:_0x541b11}=this[_0x22f3('0x13')],_0x35f746=Array[_0x22f3('0x9')](_0x541b11[_0x22f3('0xa')](this['editor'][_0x22f3('0xc')][_0x22f3('0x23')]['get'](s)['getRange']())['getSelectedBlocks']()),_0x5b3c35=_0x35f746['length']?_0x541b11['createPositionAfter'](_0x35f746[_0x22f3('0x24')]()):_0x541b11[_0x22f3('0x1e')]['selection'][_0x22f3('0x25')]();this[_0x22f3('0x5')](_0x537040,_0x5b3c35);}}
23
+ const _0x2782=['processor','ck-fake-ai-selection','ck-fake-ai-selection-candidate','get','end','conversion','model','document','addMarker','markerToElement','push','selection','insertContentBelow','getRange','ai.useTheme','from','editor','ai-ui-candidate','markers','data','isAtEnd','hideFakeVisualSelection','canEditAt','start','init','isContent','getSelectedBlocks','pluginName','AIAssistantEditing','createSelection','config','showFakeVisualSelection','change','getFirstRange','toView','updateMarker','ck-ai-assistant-ui_theme','span','ai-ui','length','toModel','setSelection','ck-fake-ai-selection_collapsed','pop','insertContent','removeMarker','getLastPosition','for','editingDowncast','has','schema'];(function(_0x24cb2d,_0x278274){const _0x28abe5=function(_0xb5d823){while(--_0xb5d823){_0x24cb2d['push'](_0x24cb2d['shift']());}};_0x28abe5(++_0x278274);}(_0x2782,0xfe));const _0x28ab=function(_0x24cb2d,_0x278274){_0x24cb2d=_0x24cb2d-0x0;let _0x28abe5=_0x2782[_0x24cb2d];return _0x28abe5;};import{Plugin as _0x3c9018}from'ckeditor5/src/core.js';const s=_0x28ab('0x27'),c=_0x28ab('0x12');export default class i extends _0x3c9018{static get[_0x28ab('0x1c')](){return _0x28ab('0x1d');}[_0x28ab('0x19')](){const {editor:_0x180c81}=this,_0x46b55d=[_0x28ab('0x2')];_0x180c81[_0x28ab('0x1f')][_0x28ab('0x4')](_0x28ab('0xf'))&&_0x46b55d[_0x28ab('0xb')](_0x28ab('0x25')),_0x180c81[_0x28ab('0x6')]['for'](_0x28ab('0x31'))['markerToHighlight']({'model':s,'view':{'classes':_0x46b55d}}),_0x180c81['conversion'][_0x28ab('0x30')](_0x28ab('0x31'))[_0x28ab('0xa')]({'model':s,'view':{'name':'span','classes':['ck-fake-ai-selection',_0x28ab('0x2b')]}}),_0x180c81[_0x28ab('0x6')][_0x28ab('0x30')](_0x28ab('0x31'))['markerToHighlight']({'model':c,'view':{'classes':[_0x28ab('0x3')]}}),_0x180c81[_0x28ab('0x6')][_0x28ab('0x30')](_0x28ab('0x31'))['markerToElement']({'model':c,'view':{'name':_0x28ab('0x26'),'classes':['ck-fake-ai-selection-candidate',_0x28ab('0x2b')]}});}[_0x28ab('0x20')](_0x5ecd80){const _0x52866e=this[_0x28ab('0x11')]['model'],_0x4306db=_0x5ecd80?c:s;_0x52866e[_0x28ab('0x21')](_0x5df0b2=>{const _0x2a66dd=_0x52866e[_0x28ab('0x8')][_0x28ab('0xc')][_0x28ab('0x22')]();if(_0x52866e['markers'][_0x28ab('0x32')](_0x4306db))_0x5df0b2[_0x28ab('0x24')](_0x4306db,{'range':_0x2a66dd});else{if(_0x2a66dd[_0x28ab('0x18')][_0x28ab('0x15')]){const _0x359c41=_0x2a66dd[_0x28ab('0x18')]['getLastMatchingPosition'](({item:_0x42b487})=>!_0x52866e[_0x28ab('0x0')][_0x28ab('0x1a')](_0x42b487),{'boundaries':_0x2a66dd});_0x5df0b2[_0x28ab('0x9')](_0x4306db,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x5df0b2['createRange'](_0x359c41,_0x2a66dd[_0x28ab('0x5')])});}else _0x5df0b2['addMarker'](_0x4306db,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x2a66dd});}});}[_0x28ab('0x16')](_0x5de48a){const _0x8f25f6=this[_0x28ab('0x11')]['model'],_0x506be8=_0x5de48a?c:s;_0x8f25f6[_0x28ab('0x13')][_0x28ab('0x32')](_0x506be8)&&_0x8f25f6[_0x28ab('0x21')](_0x2feff8=>{_0x2feff8[_0x28ab('0x2e')](_0x506be8);});}[_0x28ab('0x2d')](_0x5af56c,_0x2399ff){const _0x569475=_0x2399ff||this[_0x28ab('0x11')][_0x28ab('0x7')][_0x28ab('0x13')]['get'](s)[_0x28ab('0xe')]();if(!this[_0x28ab('0x11')]['model'][_0x28ab('0x17')](_0x569475))return;const _0x539fd7=this[_0x28ab('0x11')][_0x28ab('0x14')][_0x28ab('0x1')][_0x28ab('0x23')](_0x5af56c),_0x518b92=this[_0x28ab('0x11')][_0x28ab('0x14')][_0x28ab('0x29')](_0x539fd7);this['editor'][_0x28ab('0x7')]['change'](_0x2cc78f=>{this['hideFakeVisualSelection']();const _0x5eef1e=this['editor']['model'][_0x28ab('0x2d')](_0x518b92,_0x569475);_0x5eef1e&&_0x2cc78f[_0x28ab('0x2a')](_0x5eef1e);});}[_0x28ab('0xd')](_0x41318f){const {model:_0x5aef15}=this[_0x28ab('0x11')],_0xf56b2d=Array[_0x28ab('0x10')](_0x5aef15[_0x28ab('0x1e')](this[_0x28ab('0x11')]['model'][_0x28ab('0x13')]['get'](s)['getRange']())[_0x28ab('0x1b')]()),_0x3c0f2a=_0xf56b2d[_0x28ab('0x28')]?_0x5aef15['createPositionAfter'](_0xf56b2d[_0x28ab('0x2c')]()):_0x5aef15[_0x28ab('0x8')][_0x28ab('0xc')][_0x28ab('0x2f')]();this[_0x28ab('0x2d')](_0x41318f,_0x3c0f2a);}}