UNPKG

@ckeditor/ckeditor5-ai

Version:

AI Assistant feature for CKEditor 5.

23 lines • 10.5 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 _0x3c05ca=_0x483b;function _0x483b(_0x4f48a5,_0x45c79f){const _0x483452=_0x4834();return _0x483b=function(_0x483b69,_0x373a55){_0x483b69=_0x483b69-0x167;let _0x123760=_0x483452[_0x483b69];return _0x123760;},_0x483b(_0x4f48a5,_0x45c79f);}(function(_0x4a86c0,_0x43995d){const _0x4fd9ff=_0x483b,_0x5e9c2b=_0x4a86c0();while(!![]){try{const _0x496b87=-parseInt(_0x4fd9ff(0x1af))/0x1+-parseInt(_0x4fd9ff(0x17d))/0x2+parseInt(_0x4fd9ff(0x172))/0x3*(parseInt(_0x4fd9ff(0x18e))/0x4)+parseInt(_0x4fd9ff(0x1aa))/0x5+parseInt(_0x4fd9ff(0x174))/0x6+-parseInt(_0x4fd9ff(0x168))/0x7+-parseInt(_0x4fd9ff(0x1b9))/0x8;if(_0x496b87===_0x43995d)break;else _0x5e9c2b['push'](_0x5e9c2b['shift']());}catch(_0x155c64){_0x5e9c2b['push'](_0x5e9c2b['shift']());}}}(_0x4834,0xcbf02));import{Plugin as _0x527f6a}from'ckeditor5/src/core.js';import _0x590c05 from'./aiassistantui.js';import _0x1ed429 from'./aiassistantediting.js';import{getTranslation as _0x5dc0b7}from'./utils/common-translations.js';import{normalizeCommandsConfig as _0x3a56ec}from'./utils/normalizecommandsconfig.js';function _0x4834(){const _0x4d4406=['Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.','Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.','3USCZhD','Hindi','6838362VyTBKo','translateFrench','push','Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.','ai.aiAssistant.removeCommands','generate','Translate\x20the\x20content\x20to\x20Spanish\x20language.','Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.','Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.','55450eDApzG','Edit\x20or\x20review','German','legal','pluginName','friendly','Legal','Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.','Confident','concat','forEach','ai.aiAssistant.preserveComments','Spanish','changeStyle','French','Summarize\x20this\x20content\x20into\x20one\x20paragraph\x20of\x20text.\x20Include\x20only\x20the\x20key\x20ideas\x20and\x20conclusions.\x20Keep\x20it\x20short.\x20Do\x20not\x20keep\x20original\x20text\x20formatting.','Translate\x20the\x20content\x20to\x20Portuguese\x20language.','3238316LIQnbE','set','English','Friendly','Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.','Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.','editOrReview','Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.','Simplify\x20language','AIAssistant','locale','Make\x20shorter','changeTone','casual','Portuguese','Translate\x20the\x20content\x20to\x20German\x20language.','Simplified\x20Chinese','ai.aiAssistant.commands','Professional','Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.','Poetic','Make\x20longer','Remove\x20any\x20repetitive,\x20redundant,\x20or\x20non-essential\x20writing\x20in\x20this\x20content\x20without\x20changing\x20the\x20meaning\x20or\x20losing\x20any\x20key\x20information.','translateEnglish','translate','Arabic','define','translateHindi','1612010GucpSt','isPremiumPlugin','makeLonger','improveWriting','config','1145211xiscXG','poetic','translateGerman','direct','Journalism','Casual','Translate\x20the\x20content\x20to\x20French\x20language.','Generate\x20from\x20selection','professional','groupId','527864UtbHVr','isOfficialPlugin','makeShorter','Translate\x20the\x20content\x20to\x20Hindi\x20language.','filter','Change\x20style','get','Business','commands','Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.','Start\x20with\x20the\x20provided\x20content\x20and\x20write\x20at\x20the\x20end\x20of\x20it\x20continuing\x20this\x20topic.\x20Keep\x20the\x20added\x20part\x20short.','translateChinese','ai.aiAssistant.extraCommandGroups','translateSpanish','continue','summarize','journalism','Simplify\x20the\x20writing\x20style\x20of\x20this\x20content\x20and\x20reduce\x20the\x20complexity,\x20so\x20that\x20the\x20content\x20is\x20easy\x20to\x20understand.','simplifyLanguage','requires','Summarize','confident','Translate','Translate\x20the\x20content\x20to\x20Arabic\x20language.','Continue','Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.','Direct','business','1382213uHJMzM','Translate\x20the\x20content\x20to\x20English\x20language.','Improve\x20writing','includes','translatePortuguese','Change\x20tone','find','translateArabic'];_0x4834=function(){return _0x4d4406;};return _0x4834();}export default class r extends _0x527f6a{static get[_0x3c05ca(0x1cc)](){return[_0x590c05,_0x1ed429];}static get[_0x3c05ca(0x181)](){const _0x11a1e8=_0x3c05ca;return _0x11a1e8(0x197);}static get[_0x3c05ca(0x1ba)](){return!0x0;}static get[_0x3c05ca(0x1ab)](){return!0x0;}constructor(_0x57e8b4){const _0x285554=_0x3c05ca;super(_0x57e8b4);const _0x4063cd=_0x57e8b4[_0x285554(0x1ae)],_0x52fc15=_0x57e8b4[_0x285554(0x198)];_0x4063cd[_0x285554(0x1a8)](_0x285554(0x188),!0x0),_0x4063cd[_0x285554(0x1a8)](_0x285554(0x19f),getDefaultCommands(_0x52fc15)),_0x4063cd[_0x285554(0x1a8)](_0x285554(0x1c5),[]),_0x4063cd[_0x285554(0x1a8)](_0x285554(0x178),[]);let _0x9186e2=_0x3a56ec(_0x4063cd[_0x285554(0x1bf)](_0x285554(0x19f)),_0x52fc15);const _0x2d8658=_0x4063cd[_0x285554(0x1bf)](_0x285554(0x1c5)),_0x799af=_0x4063cd[_0x285554(0x1bf)](_0x285554(0x178));_0x2d8658[_0x285554(0x187)](_0x2577ac=>{const _0x3bc8d8=_0x285554,_0x525c38=_0x9186e2[_0x3bc8d8(0x16e)](_0xfd5c0a=>_0xfd5c0a[_0x3bc8d8(0x1b8)]===_0x2577ac[_0x3bc8d8(0x1b8)]);_0x525c38?_0x525c38[_0x3bc8d8(0x1c1)]=_0x525c38[_0x3bc8d8(0x1c1)][_0x3bc8d8(0x186)](_0x2577ac[_0x3bc8d8(0x1c1)]):_0x9186e2[_0x3bc8d8(0x176)](_0x2577ac);}),_0x9186e2=_0x9186e2[_0x285554(0x1bd)](_0x59eea0=>!_0x799af[_0x285554(0x16b)](_0x59eea0[_0x285554(0x1b8)])),_0x9186e2[_0x285554(0x187)](_0x4285c8=>{const _0x1dffd9=_0x285554;_0x4285c8[_0x1dffd9(0x1c1)]=_0x4285c8[_0x1dffd9(0x1c1)][_0x1dffd9(0x1bd)](_0x3dd446=>!_0x799af[_0x1dffd9(0x16b)](_0x3dd446['id']));}),_0x4063cd[_0x285554(0x18f)](_0x285554(0x19f),_0x9186e2);}}export function getDefaultCommands(_0x3f2793){const _0x5e64c9=_0x3c05ca;return[{'groupId':_0x5e64c9(0x194),'groupLabel':_0x5dc0b7(_0x3f2793,_0x5e64c9(0x17e)),'commands':[{'id':_0x5e64c9(0x1ad),'label':_0x5dc0b7(_0x3f2793,_0x5e64c9(0x16a)),'prompt':_0x5e64c9(0x193)},{'id':_0x5e64c9(0x1bb),'label':_0x5dc0b7(_0x3f2793,_0x5e64c9(0x199)),'prompt':_0x5e64c9(0x1a4)},{'id':_0x5e64c9(0x1ac),'label':_0x5dc0b7(_0x3f2793,_0x5e64c9(0x1a3)),'prompt':_0x5e64c9(0x184)},{'id':_0x5e64c9(0x1cb),'label':_0x5dc0b7(_0x3f2793,_0x5e64c9(0x196)),'prompt':_0x5e64c9(0x1ca)}]},{'groupId':_0x5e64c9(0x179),'groupLabel':_0x5dc0b7(_0x3f2793,_0x5e64c9(0x1b6)),'commands':[{'id':_0x5e64c9(0x1c8),'label':_0x5dc0b7(_0x3f2793,_0x5e64c9(0x1cd)),'prompt':_0x5e64c9(0x18c)},{'id':_0x5e64c9(0x1c7),'label':_0x5dc0b7(_0x3f2793,_0x5e64c9(0x1d1)),'prompt':_0x5e64c9(0x1c3)}]},{'groupId':_0x5e64c9(0x19a),'groupLabel':_0x5dc0b7(_0x3f2793,_0x5e64c9(0x16d)),'commands':[{'id':_0x5e64c9(0x1b7),'label':_0x5dc0b7(_0x3f2793,_0x5e64c9(0x1a0)),'prompt':_0x5e64c9(0x1c2)},{'id':_0x5e64c9(0x19b),'label':_0x5dc0b7(_0x3f2793,_0x5e64c9(0x1b4)),'prompt':_0x5e64c9(0x171)},{'id':_0x5e64c9(0x1b2),'label':_0x5dc0b7(_0x3f2793,_0x5e64c9(0x1d3)),'prompt':_0x5e64c9(0x192)},{'id':_0x5e64c9(0x1ce),'label':_0x5dc0b7(_0x3f2793,_0x5e64c9(0x185)),'prompt':_0x5e64c9(0x195)},{'id':_0x5e64c9(0x182),'label':_0x5dc0b7(_0x3f2793,_0x5e64c9(0x191)),'prompt':_0x5e64c9(0x17b)}]},{'groupId':_0x5e64c9(0x18a),'groupLabel':_0x5dc0b7(_0x3f2793,_0x5e64c9(0x1be)),'commands':[{'id':_0x5e64c9(0x167),'label':_0x5dc0b7(_0x3f2793,_0x5e64c9(0x1c0)),'prompt':_0x5e64c9(0x170)},{'id':_0x5e64c9(0x180),'label':_0x5dc0b7(_0x3f2793,_0x5e64c9(0x183)),'prompt':_0x5e64c9(0x1a1)},{'id':_0x5e64c9(0x1c9),'label':_0x5dc0b7(_0x3f2793,_0x5e64c9(0x1b3)),'prompt':_0x5e64c9(0x177)},{'id':_0x5e64c9(0x1b0),'label':_0x5dc0b7(_0x3f2793,_0x5e64c9(0x1a2)),'prompt':_0x5e64c9(0x1d2)}]},{'groupId':_0x5e64c9(0x1a6),'groupLabel':_0x5dc0b7(_0x3f2793,_0x5e64c9(0x1cf)),'commands':[{'id':_0x5e64c9(0x1a5),'label':_0x5dc0b7(_0x3f2793,_0x5e64c9(0x190)),'prompt':_0x5e64c9(0x169)},{'id':_0x5e64c9(0x1c6),'label':_0x5dc0b7(_0x3f2793,_0x5e64c9(0x189)),'prompt':_0x5e64c9(0x17a)},{'id':_0x5e64c9(0x16c),'label':_0x5dc0b7(_0x3f2793,_0x5e64c9(0x19c)),'prompt':_0x5e64c9(0x18d)},{'id':_0x5e64c9(0x1b1),'label':_0x5dc0b7(_0x3f2793,_0x5e64c9(0x17f)),'prompt':_0x5e64c9(0x19d)},{'id':_0x5e64c9(0x175),'label':_0x5dc0b7(_0x3f2793,_0x5e64c9(0x18b)),'prompt':_0x5e64c9(0x1b5)},{'id':_0x5e64c9(0x1c4),'label':_0x5dc0b7(_0x3f2793,_0x5e64c9(0x19e)),'prompt':_0x5e64c9(0x17c)},{'id':_0x5e64c9(0x1a9),'label':_0x5dc0b7(_0x3f2793,_0x5e64c9(0x173)),'prompt':_0x5e64c9(0x1bc)},{'id':_0x5e64c9(0x16f),'label':_0x5dc0b7(_0x3f2793,_0x5e64c9(0x1a7)),'prompt':_0x5e64c9(0x1d0)}]}];}