@ckeditor/ckeditor5-export-inline-styles
Version:
The export with inline styles feature for CKEditor 5.
23 lines • 5.65 kB
JavaScript
/*
* 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. |
* | |
* | |
* +---------------------------------------------------------------------------------+
*
*
*
*
*/
(function(_0x2df22d,_0x18774c){const _0xf29224=_0x3013,_0x32c40a=_0x2df22d();while(!![]){try{const _0x1e250d=parseInt(_0xf29224(0xa8))/0x1+-parseInt(_0xf29224(0xa6))/0x2*(parseInt(_0xf29224(0xaa))/0x3)+parseInt(_0xf29224(0xb2))/0x4+-parseInt(_0xf29224(0xb8))/0x5+parseInt(_0xf29224(0xa2))/0x6+-parseInt(_0xf29224(0xb0))/0x7+parseInt(_0xf29224(0xac))/0x8*(parseInt(_0xf29224(0xa1))/0x9);if(_0x1e250d===_0x18774c)break;else _0x32c40a['push'](_0x32c40a['shift']());}catch(_0x11e710){_0x32c40a['push'](_0x32c40a['shift']());}}}(_0x2222,0xa4404));import{calculate as _0x508593,compare as _0x15e4f2}from'specificity';import{StylesMap as _0x1a7db5}from'ckeditor5/src/engine.js';import{collectStylesheets as _0x1cfb81}from'ckeditor5/src/utils.js';import{collectRootStylesheetsVariables as _0x1efcd4}from'./exportinlinestylescssvariables.js';import{splitByTopLevelComma as _0x18ec0b}from'../exportinlinestylesutils.js';function _0x2222(){const _0x20c3b7=['150255nytRwJ','slice','705208TWDSCe','length','replace','trim','join','specificity','2932150GmzteF','indexOf','filter','cssText','from','flatMap','9VzhqoO','6046296dqNTCr','cssRules','sort','map','2kuJZQa','setTo','192862FWSxLW','stylesheets','2287848ywrnqu','stylesProcessor','5331224XwzEly',':where(','specificityArray','inlineCss'];_0x2222=function(){return _0x20c3b7;};return _0x2222();}function _0x3013(_0x1d245a,_0xd07769){const _0x2222e5=_0x2222();return _0x3013=function(_0x301355,_0x2db445){_0x301355=_0x301355-0xa0;let _0x4ef848=_0x2222e5[_0x301355];return _0x4ef848;},_0x3013(_0x1d245a,_0xd07769);}export async function collectAndProcessStylesheets(_0x4c35ae){const _0x2f57d6=_0x3013,_0x3fada7=[await _0x1cfb81(_0x4c35ae[_0x2f57d6(0xa9)]),_0x4c35ae[_0x2f57d6(0xaf)]][_0x2f57d6(0xba)](_0x4ca043=>_0x4ca043&&_0x4ca043[_0x2f57d6(0xb3)])[_0x2f57d6(0xb6)]('\x0a'),_0x49bd77=await async function(_0x5b9fb0,_0x1678db){const _0x19603a=_0x2f57d6,_0x2da6cd=new CSSStyleSheet();return await _0x2da6cd[_0x19603a(0xb4)](_0x1678db),C(Array[_0x19603a(0xbc)](_0x2da6cd[_0x19603a(0xa3)])[_0x19603a(0xba)](_0x3f32a0=>_0x3f32a0 instanceof CSSStyleRule))[_0x19603a(0xa0)](({selectorText:_0x19f7c7,contentCssText:_0xb4a3de})=>{const _0x3f39f1=_0x19603a,_0x3d2ec3=_0x18ec0b(_0x19f7c7),_0x212328=new _0x1a7db5(_0x5b9fb0)[_0x3f39f1(0xa7)](_0xb4a3de);return _0x3d2ec3[_0x3f39f1(0xa5)](_0x126c0c=>{const _0x153a41=_0x3f39f1,_0x3aa3a3=function(_0x3b752a){const _0x312f22=_0x3013,_0x43ec63=_0x312f22(0xad);let _0x3a894d=_0x3b752a,_0x15f1ba=0x0;for(let _0x8c982d=0x0;_0x8c982d<0x64;_0x8c982d++){const _0x50cf62=_0x3a894d[_0x312f22(0xb9)](_0x43ec63,_0x15f1ba);if(-0x1===_0x50cf62)break;let _0x2990a1=0x0;for(let _0x140f1c=0x0;_0x140f1c<_0x50cf62;_0x140f1c++)'('===_0x3a894d[_0x140f1c]?_0x2990a1++:')'===_0x3a894d[_0x140f1c]&&_0x2990a1--;if(_0x2990a1>0x0){_0x15f1ba=_0x50cf62+_0x43ec63[_0x312f22(0xb3)];continue;}let _0x5274b2=-0x1;for(let _0x3d381a=_0x50cf62+_0x43ec63[_0x312f22(0xb3)],_0xa9948e=0x1;_0x3d381a<_0x3a894d[_0x312f22(0xb3)];_0x3d381a++)if('('===_0x3a894d[_0x3d381a]?_0xa9948e++:')'===_0x3a894d[_0x3d381a]&&_0xa9948e--,!_0xa9948e){_0x5274b2=_0x3d381a;break;}-0x1!==_0x5274b2?(_0x3a894d=_0x3a894d[_0x312f22(0xb1)](0x0,_0x50cf62)+_0x3a894d[_0x312f22(0xb1)](_0x5274b2+0x1),_0x15f1ba=_0x50cf62):_0x15f1ba=_0x50cf62+_0x43ec63[_0x312f22(0xb3)];}return _0x3a894d[_0x312f22(0xb4)](/\s+/g,'\x20')[_0x312f22(0xb5)]();}(_0x126c0c),_0x4c22c9=_0x3aa3a3?_0x508593(_0x3aa3a3)[0x0][_0x153a41(0xae)]:[0x0,0x0,0x0,0x0];return{'stylesMap':_0x212328,'flatSelector':_0x126c0c,'specificity':_0x4c22c9};});})[_0x19603a(0xa4)]((_0xa842e0,_0x361b27)=>_0x15e4f2(_0xa842e0[_0x19603a(0xb7)],_0x361b27[_0x19603a(0xb7)]));}(_0x4c35ae[_0x2f57d6(0xab)],_0x3fada7);return{'parsedCssRules':_0x49bd77,'rootCssVariables':_0x1efcd4(_0x49bd77)};}function C(_0x13ffec,_0x103f80=''){const _0x4e6b6e=_0x3013;return _0x13ffec[_0x4e6b6e(0xa0)](_0x4a5e14=>{const _0x3dd100=_0x4e6b6e,{selectorText:_0xc2ad85,cssText:_0x1c82dc,cssRules:_0x4dbcaf}=_0x4a5e14;if(!_0xc2ad85)return[];const _0x783e94=_0xc2ad85[_0x3dd100(0xb4)](/&/g,_0x103f80);let _0x289ff5=_0x1c82dc[_0x3dd100(0xb4)](_0xc2ad85,'')[_0x3dd100(0xb5)]()[_0x3dd100(0xb4)](/^{|}$/g,'');if(!_0x4dbcaf||!_0x4dbcaf[_0x3dd100(0xb3)])return[{'selectorText':_0x783e94,'contentCssText':_0x289ff5}];for(const _0xd61bac of _0x4dbcaf)_0x289ff5=_0x289ff5[_0x3dd100(0xb4)](_0xd61bac[_0x3dd100(0xbb)],'')[_0x3dd100(0xb5)]();return[{'selectorText':_0x783e94,'contentCssText':_0x289ff5},...C(Array[_0x3dd100(0xbc)](_0x4dbcaf),_0x783e94)];});}