@univer-cli/resource-library 1.6.1 → 1.7.0-alpha.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.
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x9717c2=_0x4ed8;(function(_0xeaea9f,_0x136e52){const _0x2f67c5=_0x4ed8,_0x1a14cf=_0xeaea9f();while(!![]){try{const _0x1c1cc1=-parseInt(_0x2f67c5(0x284))/0x1*(parseInt(_0x2f67c5(0x26f))/0x2)+parseInt(_0x2f67c5(0x27f))/0x3*(parseInt(_0x2f67c5(0x1f7))/0x4)+parseInt(_0x2f67c5(0x1d2))/0x5*(parseInt(_0x2f67c5(0x25f))/0x6)+-parseInt(_0x2f67c5(0x1f1))/0x7+parseInt(_0x2f67c5(0x225))/0x8*(-parseInt(_0x2f67c5(0x23f))/0x9)+parseInt(_0x2f67c5(0x214))/0xa*(parseInt(_0x2f67c5(0x1e4))/0xb)+parseInt(_0x2f67c5(0x235))/0xc;if(_0x1c1cc1===_0x136e52)break;else _0x1a14cf['push'](_0x1a14cf['shift']());}catch(_0x91262c){_0x1a14cf['push'](_0x1a14cf['shift']());}}}(_0x52e4,0xebfa3));import{randomUUID as _0x1ab1d6}from'node:crypto';import{mkdir as _0x3fc9b7,readFile as _0x33964c,readdir as _0x6e7aef,rename as _0x548896,rm as _0x23a888,stat as _0x1d27be,unlink as _0x1e4748,writeFile as _0x117ea0}from'node:fs/promises';import{dirname as _0x50e1fe,isAbsolute as _0x1ba7ef,join as _0x4a2b5a,parse as _0x55e14d,resolve as _0x5cd530}from'node:path';import{readFileSync as _0x4ca26e}from'node:fs';var h=class extends Error{[_0x9717c2(0x242)];[_0x9717c2(0x224)];constructor(_0x5a12b5,_0x5d3df0,_0x40ac56,_0x2b7eb9){const _0x4d9fea=_0x9717c2;super(_0x5d3df0,_0x2b7eb9),this[_0x4d9fea(0x242)]=_0x5a12b5,this[_0x4d9fea(0x224)]=_0x40ac56,this['name']=_0x4d9fea(0x23e);}};function g(_0x56a20f){return _0x56a20f instanceof h;}var _=/^[A-Za-z0-9._-]+$/u,v=0xff,y=0x4;function b(_0x336412){return _['test'](_0x336412)&&_0x336412!=='.'&&_0x336412!=='..';}function x(_0x363b44){const _0x49bf4e=_0x9717c2;if(!b(_0x363b44)||_0x363b44[_0x49bf4e(0x1e1)]('-')||_0x363b44['includes']('--')||_0x363b44[_0x49bf4e(0x1d7)]>v)throw new h(_0x49bf4e(0x1ee),_0x49bf4e(0x251)+_0x363b44+_0x49bf4e(0x1f0));}function S(_0xb545c9){const _0x1d8f45=_0x9717c2;if(!b(_0xb545c9)||_0xb545c9[_0x1d8f45(0x1d7)]+y>v)throw new h('resource-invalid-resource-id',_0x1d8f45(0x26e)+_0xb545c9+_0x1d8f45(0x226));}function C(_0x4800bf){const _0x39ed3b=_0x9717c2;let _0x5b5a8d=_0x4800bf[_0x39ed3b(0x21c)]('/');if(_0x5b5a8d[_0x39ed3b(0x1d7)]!==0x2||_0x5b5a8d[0x0]===''||_0x5b5a8d[0x1]==='')throw new h(_0x39ed3b(0x27d),'Invalid\x20resource\x20handle\x20\x22'+_0x4800bf+_0x39ed3b(0x229),_0x4800bf);let _0x56ead4=_0x5b5a8d[0x0],_0x35b95e=_0x5b5a8d[0x1];return x(_0x56ead4),S(_0x35b95e),{'registryId':_0x56ead4,'resourceId':_0x35b95e};}function ee(_0x52151a,_0x101520){return x(_0x52151a),S(_0x101520),_0x52151a+'/'+_0x101520;}function w(_0x46f9e6){const _0x5009fa=_0x9717c2;let {registryId:_0x155142,resourceId:_0x103c9d}=C(_0x46f9e6),_0x9ce061=_0x155142+'--'+_0x103c9d+_0x5009fa(0x1dd);if(_0x9ce061[_0x5009fa(0x1d7)]>v)throw new h(_0x5009fa(0x246),_0x5009fa(0x1e7)+v+'\x20bytes.',_0x46f9e6);return _0x9ce061;}function T(_0x5f067e){const _0x201dd0=_0x9717c2;return new h(_0x201dd0(0x21f),'Invalid\x20resource\x20manifest:\x20'+_0x5f067e);}function E(_0x2706b3,_0x368810){const _0x169c73=_0x9717c2;if(typeof _0x2706b3!=_0x169c73(0x27a)||!_0x2706b3||Array[_0x169c73(0x22f)](_0x2706b3))throw T(_0x368810+_0x169c73(0x1f5));return _0x2706b3;}function D(_0x461a80,_0x5b58ba,_0x26c923=!0x1){const _0x5f1818=_0x9717c2;if(_0x26c923&&_0x461a80===void 0x0)return[];if(!Array['isArray'](_0x461a80))throw T(_0x5b58ba+_0x5f1818(0x233));return _0x461a80;}function O(_0x553899,_0x2be073){const _0x30030d=_0x9717c2;if(typeof _0x553899!=_0x30030d(0x26c)||_0x553899==='')throw T(_0x2be073+_0x30030d(0x219));return _0x553899;}function k(_0x67a76,_0x233441,_0xe37093=!0x1){const _0x3f7bfd=_0x9717c2;return D(_0x67a76,_0x233441,_0xe37093)[_0x3f7bfd(0x20c)]((_0x496e96,_0x584d8e)=>O(_0x496e96,_0x233441+'['+_0x584d8e+']'));}function A(_0x3edaee,_0x41b5dd){const _0x4156af=_0x9717c2;return D(_0x3edaee,_0x41b5dd,!0x0)[_0x4156af(0x20c)]((_0x592a24,_0x6e295d)=>{const _0x3e01af=_0x4156af;if(typeof _0x592a24!=_0x3e01af(0x26c))throw T(_0x41b5dd+'['+_0x6e295d+_0x3e01af(0x231));return _0x592a24;})['filter'](_0x800de1=>_0x800de1!=='');}function j(_0x473096,_0x21d126){const _0x1a4efd=_0x9717c2;if(typeof _0x473096!=_0x1a4efd(0x25c)||!Number[_0x1a4efd(0x1f6)](_0x473096))throw T(_0x21d126+_0x1a4efd(0x256));return _0x473096;}function M(_0x5b89db,_0x12ecc9){const _0x56787c=_0x9717c2;if(typeof _0x5b89db!='boolean')throw T(_0x12ecc9+_0x56787c(0x258));return _0x5b89db;}function N(_0x5c86c5,_0x25fa78,_0x3ecba4){const _0xbc4227=_0x9717c2;if(typeof _0x5c86c5==_0xbc4227(0x26c)&&_0x5c86c5!=='')return _0x5c86c5;let _0x3172f9=E(_0x5c86c5,_0x25fa78),_0x43c44b=_0x3ecba4===void 0x0?void 0x0:_0x3172f9[_0x3ecba4];if(typeof _0x43c44b==_0xbc4227(0x26c)&&_0x43c44b!=='')return _0x43c44b;let _0x51aa6f=_0x3172f9['en-US'];if(typeof _0x51aa6f=='string'&&_0x51aa6f!=='')return _0x51aa6f;let _0x3d21d0=Object[_0xbc4227(0x25a)](_0x3172f9)['find'](_0x379377=>typeof _0x379377==_0xbc4227(0x26c)&&_0x379377!=='');if(_0x3d21d0!==void 0x0)return _0x3d21d0;throw T(_0x25fa78+_0xbc4227(0x227));}function P(_0x544e57,_0x48975f,_0x5de375){const _0x1476fd=_0x9717c2;try{_0x5de375===_0x1476fd(0x25b)?x(_0x544e57):S(_0x544e57);}catch(_0x3f06ef){throw T(_0x48975f+':\x20'+(_0x3f06ef instanceof Error?_0x3f06ef[_0x1476fd(0x238)]:String(_0x3f06ef)));}}function F(_0x16d123,_0x6885a0,_0x2b46b1){const _0x2e1041=_0x9717c2;let _0x223c44=new Map();for(let [_0x288c50,_0x3e620a]of D(_0x16d123,_0x6885a0,!0x0)[_0x2e1041(0x260)]()){let _0x57f67e=E(_0x3e620a,_0x6885a0+'['+_0x288c50+']'),_0x5c9cad=O(_0x57f67e['id'],_0x6885a0+'['+_0x288c50+_0x2e1041(0x24c));if(P(_0x5c9cad,_0x6885a0+'['+_0x288c50+_0x2e1041(0x24c),_0x2e1041(0x243)),_0x223c44[_0x2e1041(0x1f3)](_0x5c9cad))throw T(_0x2e1041(0x216)+_0x6885a0+_0x2e1041(0x22d)+_0x5c9cad+'\x22.');_0x223c44[_0x2e1041(0x1fe)](_0x5c9cad,N(_0x57f67e[_0x2e1041(0x215)],_0x6885a0+'['+_0x288c50+_0x2e1041(0x1ec),_0x2b46b1));}return _0x223c44;}function I(_0x3317a8,_0x2d7e07){const _0x178471=_0x9717c2;let _0x1bca1d=E(_0x3317a8[_0x178471(0x27e)],_0x2d7e07+_0x178471(0x24a)),_0x4cbf7f=j(_0x1bca1d[_0x178471(0x285)],_0x2d7e07+'.intrinsicSize.width'),_0x26ce33=j(_0x1bca1d['height'],_0x2d7e07+_0x178471(0x23b));if(_0x4cbf7f<=0x0||_0x26ce33<=0x0)throw T(_0x2d7e07+_0x178471(0x283));return{'width':_0x4cbf7f,'height':_0x26ce33};}function L(_0x717195,_0x29ff4d){const _0x10d914=_0x9717c2;if(_0x717195['type']!==_0x10d914(0x1c3))throw T(_0x29ff4d+'.type\x20must\x20be\x20\x22image\x22.');if(_0x717195[_0x10d914(0x1c8)]!==_0x10d914(0x279))throw T(_0x29ff4d+_0x10d914(0x1de));let _0x5ef15f=E(_0x717195[_0x10d914(0x24f)],_0x29ff4d+_0x10d914(0x1f4));if(_0x5ef15f[_0x10d914(0x26b)]!==_0x10d914(0x250))throw T(_0x29ff4d+_0x10d914(0x22b));let _0x38fc07=O(_0x5ef15f[_0x10d914(0x278)],_0x29ff4d+_0x10d914(0x1cb)),_0x37e751;try{_0x37e751=new URL(_0x38fc07);}catch{throw T(_0x29ff4d+_0x10d914(0x1fa));}if(_0x37e751[_0x10d914(0x264)]!==_0x10d914(0x222))throw T(_0x29ff4d+_0x10d914(0x267));return _0x38fc07;}function R(_0xfc75f7){const _0x56c9f7=_0x9717c2;return _0xfc75f7[_0x56c9f7(0x1eb)](_0x56c9f7(0x1d0))[_0x56c9f7(0x20e)]()[_0x56c9f7(0x274)]()['replace'](/\s+/gu,'\x20');}function z(_0x2b1d59){const _0x3c6da3=_0x9717c2;let _0x462aaa=E(_0x2b1d59,'manifest'),_0x4022a2=new Map(),_0x5f3bdc=new Map(),_0x45bd55=[],_0x539c8d=[],_0x5f38ac=new Set(),_0x303405=0x0;for(let [_0xcd307f,_0x3fd15c]of D(_0x462aaa[_0x3c6da3(0x1f2)],_0x3c6da3(0x20b))[_0x3c6da3(0x260)]()){let _0xc8e4e4=E(E(_0x3fd15c,_0x3c6da3(0x236)+_0xcd307f+']')['input'],_0x3c6da3(0x236)+_0xcd307f+_0x3c6da3(0x269)),_0x4bfb85=O(_0xc8e4e4[_0x3c6da3(0x275)],'registrations['+_0xcd307f+_0x3c6da3(0x21b));if(P(_0x4bfb85,_0x3c6da3(0x236)+_0xcd307f+_0x3c6da3(0x21b),_0x3c6da3(0x25b)),_0x4022a2['has'](_0x4bfb85))throw T('Duplicate\x20registry\x20ID\x20\x22'+_0x4bfb85+'\x22.');let _0x266851=_0xc8e4e4[_0x3c6da3(0x1c1)]===void 0x0?void 0x0:O(_0xc8e4e4[_0x3c6da3(0x1c1)],_0x3c6da3(0x236)+_0xcd307f+'].input.defaultLocale'),_0x42a14d=F(_0xc8e4e4[_0x3c6da3(0x20a)],_0x3c6da3(0x236)+_0xcd307f+_0x3c6da3(0x1c2),_0x266851),_0x16007b=F(_0xc8e4e4[_0x3c6da3(0x1ff)],_0x3c6da3(0x236)+_0xcd307f+'].input.tags',_0x266851),_0xae710=[];for(let [_0x36570d,_0x53110e]of D(_0xc8e4e4[_0x3c6da3(0x1d9)],_0x3c6da3(0x236)+_0xcd307f+_0x3c6da3(0x1e3))[_0x3c6da3(0x260)]()){let _0x28e3f9=_0x3c6da3(0x236)+_0xcd307f+'].input.resources['+_0x36570d+']',_0xa52b7b=E(_0x53110e,_0x28e3f9),_0x16e71e=O(_0xa52b7b['id'],_0x28e3f9+_0x3c6da3(0x26d));P(_0x16e71e,_0x28e3f9+_0x3c6da3(0x26d),_0x3c6da3(0x243));let _0x5eab47=ee(_0x4bfb85,_0x16e71e);if(_0x5f3bdc[_0x3c6da3(0x1f3)](_0x5eab47))throw T('Duplicate\x20resource\x20handle\x20\x22'+_0x5eab47+'\x22.');let _0x2a809c;try{_0x2a809c=w(_0x5eab47);}catch(_0x450968){throw T(_0x28e3f9+':\x20'+(_0x450968 instanceof Error?_0x450968['message']:String(_0x450968)));}if(_0x5f38ac['has'](_0x2a809c))throw T(_0x3c6da3(0x272)+_0x2a809c+'\x22.');_0x5f38ac['add'](_0x2a809c);let _0x560370=_0xa52b7b[_0x3c6da3(0x1d4)]===void 0x0?void 0x0:O(_0xa52b7b[_0x3c6da3(0x1d4)],_0x28e3f9+'.groupId');if(_0x560370!==void 0x0&&!_0x42a14d[_0x3c6da3(0x1f3)](_0x560370))throw T(_0x28e3f9+_0x3c6da3(0x248)+_0x560370+'\x22.');let _0x46bb58=k(_0xa52b7b[_0x3c6da3(0x221)],_0x28e3f9+'.tagIds',!0x0);for(let _0x3ce9f0 of _0x46bb58)if(!_0x16007b[_0x3c6da3(0x1f3)](_0x3ce9f0))throw T(_0x28e3f9+'.tagIds\x20references\x20unknown\x20tag\x20\x22'+_0x3ce9f0+'\x22.');let _0x24ffa7=A(_0xa52b7b[_0x3c6da3(0x1ea)],_0x28e3f9+_0x3c6da3(0x207)),_0x3a6c0c=N(_0xa52b7b[_0x3c6da3(0x252)],_0x28e3f9+_0x3c6da3(0x217),_0x266851),_0x31c223=_0xa52b7b['description']===void 0x0?void 0x0:N(_0xa52b7b[_0x3c6da3(0x220)],_0x28e3f9+'.description',_0x266851),_0x4b0248=_0x560370===void 0x0?null:{'id':_0x560370,'label':_0x42a14d[_0x3c6da3(0x271)](_0x560370)},_0x3cc7eb=_0x46bb58[_0x3c6da3(0x20c)](_0x411b8e=>({'id':_0x411b8e,'label':_0x16007b[_0x3c6da3(0x271)](_0x411b8e)})),_0x58a4b4=E(_0xa52b7b[_0x3c6da3(0x1c6)],_0x28e3f9+'.payload'),_0x20a3e0=_0xa52b7b[_0x3c6da3(0x244)]===void 0x0?null:j(_0xa52b7b[_0x3c6da3(0x244)],_0x28e3f9+'.order'),_0x486092=M(_0x58a4b4[_0x3c6da3(0x1fd)],_0x28e3f9+_0x3c6da3(0x1d8)),_0xcabf0b={'handle':_0x5eab47,'registryId':_0x4bfb85,'id':_0x16e71e,'name':_0x3a6c0c,..._0x31c223===void 0x0?{}:{'description':_0x31c223},'group':_0x4b0248,'tags':_0x3cc7eb,'keywords':_0x24ffa7,'order':_0x20a3e0,'intrinsicSize':I(_0x58a4b4,_0x28e3f9+_0x3c6da3(0x26a)),'colorEditable':_0x486092,'sourceUrl':L(_0x58a4b4,_0x28e3f9+_0x3c6da3(0x26a)),'registrationIndex':_0xcd307f,'resourceIndex':_0x36570d,'globalIndex':_0x303405,'searchText':R([_0x3a6c0c,_0x31c223,_0x4b0248?.[_0x3c6da3(0x215)],..._0x3cc7eb[_0x3c6da3(0x20c)](_0x2f4865=>_0x2f4865['label']),..._0x24ffa7][_0x3c6da3(0x249)](_0x49cd90=>_0x49cd90!==void 0x0)[_0x3c6da3(0x280)]('\x20'))};_0x303405++,_0xae710[_0x3c6da3(0x23c)](_0xcabf0b),_0x539c8d[_0x3c6da3(0x23c)](_0xcabf0b),_0x5f3bdc['set'](_0x5eab47,_0xcabf0b);}let _0x259895={'id':_0x4bfb85,'groups':_0x42a14d,'tags':_0x16007b,'resources':_0xae710};_0x45bd55[_0x3c6da3(0x23c)](_0x259895),_0x4022a2[_0x3c6da3(0x1fe)](_0x4bfb85,_0x259895);}if(_0x45bd55[_0x3c6da3(0x1d7)]===0x0)throw T(_0x3c6da3(0x1c7));return{'registries':_0x45bd55,'registryById':_0x4022a2,'resourceByHandle':_0x5f3bdc,'resources':_0x539c8d};}function _0x4ed8(_0x3a83b9,_0xf4a837){_0x3a83b9=_0x3a83b9-0x1bf;const _0x52e466=_0x52e4();let _0x4ed893=_0x52e466[_0x3a83b9];return _0x4ed893;}function B(_0x126910,_0x315195){const _0x5e6af7=_0x9717c2;C(_0x315195);let _0x3d3d46=_0x126910[_0x5e6af7(0x1bf)]['get'](_0x315195);if(_0x3d3d46===void 0x0)throw new h(_0x5e6af7(0x24b),_0x5e6af7(0x1cd)+_0x315195+_0x5e6af7(0x208),_0x315195);return _0x3d3d46;}function te(_0x547d0a){const _0x312f33=_0x9717c2;return _0x547d0a[_0x312f33(0x27b)]['map'](_0x241b66=>({'id':_0x241b66['id'],'resourceCount':_0x241b66[_0x312f33(0x1d9)]['length'],'groupCount':_0x241b66[_0x312f33(0x20a)][_0x312f33(0x1dc)],'tagCount':_0x241b66[_0x312f33(0x1ff)][_0x312f33(0x1dc)],'colorEditableCount':_0x241b66[_0x312f33(0x1d9)][_0x312f33(0x249)](_0x4bc2b2=>_0x4bc2b2[_0x312f33(0x1fd)])[_0x312f33(0x1d7)]}));}function ne(_0x40c129){const _0x1d5e31=_0x9717c2;return{'handle':_0x40c129[_0x1d5e31(0x224)],'registryId':_0x40c129[_0x1d5e31(0x275)],'id':_0x40c129['id'],'name':_0x40c129['name'],'group':_0x40c129[_0x1d5e31(0x22e)],'tags':_0x40c129['tags'],'keywords':_0x40c129[_0x1d5e31(0x1ea)],'order':_0x40c129[_0x1d5e31(0x244)],'intrinsicSize':_0x40c129[_0x1d5e31(0x27e)],'colorEditable':_0x40c129[_0x1d5e31(0x1fd)]};}function re(_0x5733e3,_0x359239){const _0x5d2c59=_0x9717c2;let _0x641a6b=(_0x5733e3[_0x5d2c59(0x244)]??_0x5733e3[_0x5d2c59(0x1c4)])-(_0x359239[_0x5d2c59(0x244)]??_0x359239[_0x5d2c59(0x1c4)]);if(_0x641a6b!==0x0)return _0x641a6b;let _0x40b7fd=_0x5733e3['registrationIndex']-_0x359239['registrationIndex'];if(_0x40b7fd!==0x0)return _0x40b7fd;let _0x25d033=_0x5733e3[_0x5d2c59(0x1e9)]-_0x359239[_0x5d2c59(0x1e9)];return _0x25d033===0x0?_0x5733e3[_0x5d2c59(0x224)][_0x5d2c59(0x277)](_0x359239[_0x5d2c59(0x224)]):_0x25d033;}function ie(_0x65fb9e,_0x493e1c){const _0x58c782=_0x9717c2;let _0x9ba221=_0x493e1c['queries']['map'](R)[_0x58c782(0x249)](_0x46adf4=>_0x46adf4!=='');if(_0x9ba221[_0x58c782(0x1d7)]===0x0)throw new h(_0x58c782(0x266),_0x58c782(0x1e2));let _0x5ae933=new Set(_0x493e1c['registries']??[]);for(let _0x323dd8 of _0x5ae933)if(!_0x65fb9e[_0x58c782(0x1f8)][_0x58c782(0x1f3)](_0x323dd8))throw new h(_0x58c782(0x1cc),'Unknown\x20resource\x20registry\x20\x22'+_0x323dd8+'\x22.');let _0x17979b=_0x493e1c[_0x58c782(0x1ca)]??_0x65fb9e[_0x58c782(0x1d9)][_0x58c782(0x1d7)];if(!Number[_0x58c782(0x1ed)](_0x17979b)||_0x17979b<0x1)throw new h(_0x58c782(0x213),'Resource\x20search\x20limit\x20must\x20be\x20a\x20positive\x20integer;\x20received\x20\x22'+_0x17979b+'\x22.');let _0x6b0f05=_0x65fb9e[_0x58c782(0x1d9)][_0x58c782(0x249)](_0x258dcd=>_0x5ae933[_0x58c782(0x1dc)]===0x0||_0x5ae933[_0x58c782(0x1f3)](_0x258dcd[_0x58c782(0x275)]))[_0x58c782(0x249)](_0x4ddcc0=>_0x9ba221['some'](_0x5dc5b8=>_0x4ddcc0[_0x58c782(0x228)]['includes'](_0x5dc5b8)))['sort'](re);return{'resources':_0x6b0f05[_0x58c782(0x232)](0x0,_0x17979b)['map'](ne),'total':_0x6b0f05[_0x58c782(0x1d7)]};}function V(_0xa8ddb0){const _0x35a4aa=_0x9717c2;return/^\s*(?:<\?xml[^>]*>\s*)?(?:<!--[^]*?-->\s*)*<svg(?:\s|>)/iu[_0x35a4aa(0x27c)](_0xa8ddb0);}function H(_0x9878ac,_0x440d45){const _0x5cf3c1=_0x9717c2;return g(_0x440d45)?{'handle':_0x9878ac,'code':_0x440d45[_0x5cf3c1(0x242)],'message':_0x440d45[_0x5cf3c1(0x238)]}:{'handle':_0x9878ac,'code':_0x5cf3c1(0x23d),'message':_0x440d45 instanceof Error?_0x440d45['message']:String(_0x440d45)};}var U=class{['options'];[_0x9717c2(0x1db)];constructor(_0x4e8717){const _0x139c9d=_0x9717c2;this['options']=_0x4e8717,this[_0x139c9d(0x1db)]=z(_0x4e8717[_0x139c9d(0x211)]);}get[_0x9717c2(0x247)](){const _0x54ea3c=_0x9717c2;return this[_0x54ea3c(0x24d)][_0x54ea3c(0x21d)][_0x54ea3c(0x22c)];}['listRegistries'](){return te(this['catalog']);}[_0x9717c2(0x281)](_0x370bd5){return ie(this['catalog'],_0x370bd5);}async['read'](_0x100619){const _0x3027b9=_0x9717c2;let _0x557b00=B(this['catalog'],_0x100619[_0x3027b9(0x224)]),_0x4833a6=await this['options'][_0x3027b9(0x21d)][_0x3027b9(0x237)](_0x100619['handle']);if(_0x4833a6!==void 0x0&&V(_0x4833a6))return{'handle':_0x100619['handle'],'svg':_0x4833a6};let _0xb5eba5;try{_0xb5eba5=await this['options'][_0x3027b9(0x1f9)][_0x3027b9(0x1c5)](_0x557b00['sourceUrl']);}catch(_0xaa454e){throw g(_0xaa454e)?_0xaa454e:new h('resource-download-failed','Failed\x20to\x20download\x20\x22'+_0x100619[_0x3027b9(0x224)]+'\x22:\x20'+(_0xaa454e instanceof Error?_0xaa454e[_0x3027b9(0x238)]:String(_0xaa454e)),_0x100619[_0x3027b9(0x224)],{'cause':_0xaa454e});}if(!V(_0xb5eba5))throw new h('resource-invalid-svg',_0x3027b9(0x22a)+_0x100619['handle']+_0x3027b9(0x1d5),_0x100619['handle']);return await this[_0x3027b9(0x24d)][_0x3027b9(0x21d)]['write'](_0x100619[_0x3027b9(0x224)],_0xb5eba5),{'handle':_0x100619[_0x3027b9(0x224)],'svg':_0xb5eba5};}async[_0x9717c2(0x1fc)](_0x1ad53d){const _0xa2ab69=_0x9717c2;let _0x13aac1=[],_0x1fcfae=[];for(let _0x2d274f of _0x1ad53d['handles'])try{let {svg:_0x4160f5}=await this[_0xa2ab69(0x237)]({'handle':_0x2d274f}),_0x4fcacc=await this[_0xa2ab69(0x24d)][_0xa2ab69(0x1e5)]['write'](_0x1ad53d[_0xa2ab69(0x240)],w(_0x2d274f),_0x4160f5);_0x13aac1[_0xa2ab69(0x23c)]({'handle':_0x2d274f,'path':_0x4fcacc});}catch(_0x139906){_0x1fcfae['push'](H(_0x2d274f,_0x139906));}return{'exported':_0x13aac1,'failed':_0x1fcfae};}async[_0x9717c2(0x205)](){const _0x2d5622=_0x9717c2;return await this[_0x2d5622(0x24d)][_0x2d5622(0x21d)][_0x2d5622(0x239)]();}};function W(_0x2c84d1){return new U(_0x2c84d1);}function _0x52e4(){const _0x4f10c5=['groupId','\x22\x20is\x20not\x20an\x20SVG\x20document.','signal','length','.payload.colorEditable','resources','resource-manifest-read-failed','catalog','size','.svg','.storagePolicy\x20must\x20be\x20\x22reference\x22.','resource-download-timeout','path','startsWith','Resource\x20search\x20needs\x20at\x20least\x20one\x20non-empty\x20query.','].input.resources','22rthesX','output','Resource\x20request\x20redirected\x20to\x20a\x20non-HTTPS\x20URL.','Resource\x20export\x20filename\x20exceeds\x20','resource-cache-root-invalid','resourceIndex','keywords','normalize','].label','isInteger','resource-invalid-registry-id','utf8','\x22:\x20expected\x20an\x20addressable\x20filesystem-safe\x20component\x20without\x20\x22--\x22.','4029186mFgVeI','registrations','has','.source','\x20must\x20be\x20an\x20object.','isFinite','48104PBYpij','registryById','downloader','.source.value\x20must\x20be\x20a\x20URL.','getReader','export','colorEditable','set','tags','Resource\x20response\x20is\x20not\x20valid\x20UTF-8.','Resource\x20exceeds\x20the\x20maximum\x20size\x20of\x20','Resource\x20request\x20followed\x20too\x20many\x20redirects;\x20maximum\x20','text','done','clearCache','decode','.keywords','\x22;\x20try\x20resources\x20find\x20<query>.','fetchImpl','groups','manifest.registrations','map','catch','toLowerCase','body','Cannot\x20read\x20resource\x20manifest\x20at\x20','manifest','Resource\x20cache\x20root\x20must\x20be\x20an\x20absolute,\x20dedicated\x20directory\x20below\x20the\x20filesystem\x20root;\x20received\x20\x22','resource-limit-invalid','2952310BTQtwN','label','Duplicate\x20','.name','\x20bytes.','\x20must\x20be\x20a\x20non-empty\x20string.','maxRedirects','].input.registryId','split','cache','Resource\x20server\x20returned\x20an\x20invalid\x20redirect\x20URL.','resource-manifest-invalid','description','tagIds','https:','resource-download-invalid-svg','handle','7672VPetZs','\x22:\x20expected\x20filesystem-safe\x20characters.','\x20contains\x20no\x20usable\x20localized\x20text.','searchText','\x22;\x20expected\x20<registryId>/<resourceId>.','Downloaded\x20resource\x20\x22','.source.type\x20must\x20be\x20\x22url\x22.','location','\x20ID\x20\x22','group','isArray','\x20without\x20a\x20Location\x20header.',']\x20must\x20be\x20a\x20string.','slice','\x20must\x20be\x20an\x20array.','manual','22863624euLkec','registrations[','read','message','clear','headers','.intrinsicSize.height','push','resource-export-failed','ResourceLibraryError','7155QMtArr','destination','abort','code','resource','order','pid','resource-export-filename-too-long','cacheLocation','.groupId\x20references\x20unknown\x20group\x20\x22','filter','.intrinsicSize','resource-not-found','].id','options','fetch','source','url','Invalid\x20registry\x20ID\x20\x22','name','maxBytes','resource-download-too-many-redirects','Resource\x20download\x20timed\x20out\x20after\x20','\x20must\x20be\x20a\x20finite\x20number.','resource-download-too-large','\x20must\x20be\x20a\x20boolean.','utf-8','values','registry','number','content-length','ENOENT','6lLrilk','entries','byteLength','manifestPath','timeoutMs','protocol','resource-download-insecure-redirect','resource-query-empty','.source.value\x20must\x20use\x20HTTPS.','byteCount','].input','.payload','type','string','.id','Invalid\x20resource\x20ID\x20\x22','1698GLrvCA','aborted','get','Duplicate\x20export\x20filename\x20\x22','isFile','trim','registryId','resource-download-invalid-utf8','localeCompare','value','reference','object','registries','test','resource-invalid-handle','intrinsicSize','237XntFOj','join','find','resource-download-insecure','.intrinsicSize\x20must\x20be\x20positive.','1345ZeLMak','width','resourceByHandle','root','defaultLocale','].input.groups','image','globalIndex','download','payload','registrations\x20must\x20not\x20be\x20empty.','storagePolicy','status','limit','.source.value','resource-registry-not-found','Unknown\x20resource\x20\x22','resource-download-invalid-redirect','Resource\x20response\x20is\x20not\x20an\x20SVG\x20document.','NFKC','parse','3265qzooIA','write'];_0x52e4=function(){return _0x4f10c5;};return _0x52e4();}function G(_0x518be5){const _0x588822=_0x9717c2;return _0x518be5 instanceof Error&&_0x588822(0x242)in _0x518be5;}function K(_0x2cf6a4){const _0x44b2e6=_0x9717c2;let _0x12d931=_0x5cd530(_0x2cf6a4);if(!_0x1ba7ef(_0x2cf6a4)||_0x12d931===_0x55e14d(_0x12d931)[_0x44b2e6(0x1c0)])throw new h(_0x44b2e6(0x1e8),_0x44b2e6(0x212)+_0x2cf6a4+'\x22.');return _0x12d931;}async function q(_0x425abe){const _0x46b453=_0x9717c2;let _0x2714ce;try{_0x2714ce=await _0x6e7aef(_0x425abe,{'withFileTypes':!0x0});}catch(_0x1b5b9f){if(G(_0x1b5b9f)&&_0x1b5b9f[_0x46b453(0x242)]===_0x46b453(0x25e))return{'resourceCount':0x0,'byteCount':0x0};throw _0x1b5b9f;}let _0x283b1e=0x0,_0x48717f=0x0;for(let _0x12fde6 of _0x2714ce){let _0x9176a2=_0x4a2b5a(_0x425abe,_0x12fde6[_0x46b453(0x252)]);if(_0x12fde6['isDirectory']()){let _0x1ed607=await q(_0x9176a2);_0x283b1e+=_0x1ed607['resourceCount'],_0x48717f+=_0x1ed607[_0x46b453(0x268)];}else{if(_0x12fde6[_0x46b453(0x273)]()&&_0x12fde6[_0x46b453(0x252)]['endsWith'](_0x46b453(0x1dd))){let _0x1adfb5=await _0x1d27be(_0x9176a2);_0x283b1e++,_0x48717f+=_0x1adfb5[_0x46b453(0x1dc)];}}}return{'resourceCount':_0x283b1e,'byteCount':_0x48717f};}var J=class{[_0x9717c2(0x22c)];constructor(_0xa79183){const _0x5f182d=_0x9717c2;this[_0x5f182d(0x22c)]=K(_0xa79183);}[_0x9717c2(0x1e0)](_0x45dd67){const _0x8ef494=_0x9717c2;let {registryId:_0x31e557,resourceId:_0x5e4486}=C(_0x45dd67);return _0x4a2b5a(this[_0x8ef494(0x22c)],_0x31e557,_0x5e4486+_0x8ef494(0x1dd));}async['read'](_0x113ceb){const _0xbe587e=_0x9717c2;try{return await _0x33964c(this[_0xbe587e(0x1e0)](_0x113ceb),_0xbe587e(0x1ef));}catch(_0x3c97fa){if(G(_0x3c97fa)&&_0x3c97fa['code']===_0xbe587e(0x25e))return;throw _0x3c97fa;}}async[_0x9717c2(0x1d3)](_0x46828f,_0x369bc7){const _0x1e34df=_0x9717c2;let _0x322026=this['path'](_0x46828f);await _0x3fc9b7(_0x50e1fe(_0x322026),{'recursive':!0x0});let _0x172bdc=_0x4a2b5a(_0x50e1fe(_0x322026),'.resource-'+process[_0x1e34df(0x245)]+'-'+_0x1ab1d6()+'.tmp');try{await _0x117ea0(_0x172bdc,_0x369bc7,{'encoding':_0x1e34df(0x1ef),'mode':0x180}),await _0x548896(_0x172bdc,_0x322026);}catch(_0x1ae92){throw await _0x1e4748(_0x172bdc)[_0x1e34df(0x20d)](()=>void 0x0),_0x1ae92;}}async[_0x9717c2(0x239)](){const _0x4cde29=_0x9717c2;let _0x1cbed6=await q(this['location']);return await _0x23a888(this[_0x4cde29(0x22c)],{'force':!0x0,'recursive':!0x0}),{'path':this[_0x4cde29(0x22c)],..._0x1cbed6};}},Y=class{async[_0x9717c2(0x1d3)](_0x125da8,_0x4dd50a,_0x3e2c69){const _0x546a22=_0x9717c2;await _0x3fc9b7(_0x125da8,{'recursive':!0x0});let _0x262ab6=_0x4a2b5a(_0x125da8,_0x4dd50a);return await _0x117ea0(_0x262ab6,_0x3e2c69,_0x546a22(0x1ef)),_0x262ab6;}},X=0x7530,ae=0xa00000,oe=0xa,se=new Set([0x12d,0x12e,0x12f,0x133,0x134]);function Z(_0x5167d2){const _0x31bd62=_0x9717c2;return new h(_0x31bd62(0x257),_0x31bd62(0x201)+_0x5167d2+_0x31bd62(0x218));}async function ce(_0x10aa36,_0x499d56){const _0x574fba=_0x9717c2;let _0x22339c=Number(_0x10aa36[_0x574fba(0x23a)][_0x574fba(0x271)](_0x574fba(0x25d)));if(Number[_0x574fba(0x1f6)](_0x22339c)&&_0x22339c>_0x499d56)throw Z(_0x499d56);if(_0x10aa36['body']===null){let _0x2a2c86=await _0x10aa36[_0x574fba(0x203)]();if(Buffer[_0x574fba(0x261)](_0x2a2c86)>_0x499d56)throw Z(_0x499d56);return _0x2a2c86;}let _0x1703a7=_0x10aa36[_0x574fba(0x20f)][_0x574fba(0x1fb)](),_0x42955e=[],_0x32e26e=0x0;try{for(;;){let _0x46ff32=await _0x1703a7[_0x574fba(0x237)]();if(_0x46ff32[_0x574fba(0x204)])break;if(_0x32e26e+=_0x46ff32[_0x574fba(0x278)][_0x574fba(0x261)],_0x32e26e>_0x499d56)throw await _0x1703a7['cancel']()['catch'](()=>void 0x0),Z(_0x499d56);_0x42955e['push'](_0x46ff32[_0x574fba(0x278)]);}}finally{_0x1703a7['releaseLock']();}try{return new TextDecoder(_0x574fba(0x259),{'fatal':!0x0})[_0x574fba(0x206)](Buffer['concat'](_0x42955e,_0x32e26e));}catch{throw new h(_0x574fba(0x276),_0x574fba(0x200));}}var Q=class{['fetchImpl'];[_0x9717c2(0x263)];[_0x9717c2(0x253)];['maxRedirects'];constructor(_0x51e3b8={}){const _0x16a2b7=_0x9717c2;this['fetchImpl']=_0x51e3b8[_0x16a2b7(0x24e)]??fetch,this[_0x16a2b7(0x263)]=_0x51e3b8['timeoutMs']??X,this['maxBytes']=_0x51e3b8['maxBytes']??ae,this[_0x16a2b7(0x21a)]=_0x51e3b8[_0x16a2b7(0x21a)]??oe;}async[_0x9717c2(0x1c5)](_0x4025c2){const _0x2b1e01=_0x9717c2;let _0x216af0=new URL(_0x4025c2);if(_0x216af0[_0x2b1e01(0x264)]!=='https:')throw new h(_0x2b1e01(0x282),'Resource\x20URL\x20must\x20use\x20HTTPS.');let _0x3f5630=new AbortController(),_0x1001db=setTimeout(()=>_0x3f5630[_0x2b1e01(0x241)](),this[_0x2b1e01(0x263)]);try{let _0x23407f=_0x216af0;for(let _0xbf5017=0x0;;_0xbf5017++){let _0x433821=await this[_0x2b1e01(0x209)](_0x23407f,{'redirect':_0x2b1e01(0x234),'signal':_0x3f5630[_0x2b1e01(0x1d6)]});if(se[_0x2b1e01(0x1f3)](_0x433821[_0x2b1e01(0x1c9)])){if(_0xbf5017>=this[_0x2b1e01(0x21a)])throw new h(_0x2b1e01(0x254),_0x2b1e01(0x202)+this[_0x2b1e01(0x21a)]+'.');let _0x4bc6b0=_0x433821[_0x2b1e01(0x23a)][_0x2b1e01(0x271)](_0x2b1e01(0x22c));if(_0x4bc6b0===null)throw new h(_0x2b1e01(0x1ce),'Resource\x20server\x20returned\x20HTTP\x20'+_0x433821[_0x2b1e01(0x1c9)]+_0x2b1e01(0x230));let _0x2b6cf2;try{_0x2b6cf2=new URL(_0x4bc6b0,_0x23407f);}catch{throw new h('resource-download-invalid-redirect',_0x2b1e01(0x21e));}if(_0x2b6cf2[_0x2b1e01(0x264)]!==_0x2b1e01(0x222))throw new h(_0x2b1e01(0x265),_0x2b1e01(0x1e6));_0x23407f=_0x2b6cf2;continue;}if(!_0x433821['ok'])throw new h('resource-download-http','Resource\x20server\x20returned\x20HTTP\x20'+_0x433821['status']+'.');if(_0x433821[_0x2b1e01(0x250)]!==''&&new URL(_0x433821[_0x2b1e01(0x250)])['protocol']!==_0x2b1e01(0x222))throw new h(_0x2b1e01(0x265),'Resource\x20request\x20redirected\x20to\x20a\x20non-HTTPS\x20URL.');let _0x19e031=await ce(_0x433821,this[_0x2b1e01(0x253)]);if(!V(_0x19e031))throw new h(_0x2b1e01(0x223),_0x2b1e01(0x1cf));return _0x19e031;}}catch(_0x5999c2){throw _0x3f5630[_0x2b1e01(0x1d6)][_0x2b1e01(0x270)]?new h(_0x2b1e01(0x1df),_0x2b1e01(0x255)+this[_0x2b1e01(0x263)]+'\x20ms.'):_0x5999c2;}finally{clearTimeout(_0x1001db);}}};function $(_0x381057){const _0x16ddb2=_0x9717c2;try{return JSON[_0x16ddb2(0x1d1)](_0x4ca26e(_0x381057,_0x16ddb2(0x1ef)));}catch(_0x460f35){throw new h(_0x16ddb2(0x1da),_0x16ddb2(0x210)+_0x381057+':\x20'+(_0x460f35 instanceof Error?_0x460f35[_0x16ddb2(0x238)]:String(_0x460f35)),void 0x0,{'cause':_0x460f35});}}function le(_0x50068a){const _0xf8986=_0x9717c2;let _0x169498;return()=>(_0x169498??=W({'manifest':$(_0x50068a[_0xf8986(0x262)]),'cache':new J(_0x50068a['cacheRoot']),'downloader':new Q(_0x50068a[_0xf8986(0x1f9)]),'output':new Y()}),_0x169498);}export{J as FilesystemResourceCache,Y as FilesystemResourceOutput,Q as HttpsResourceDownloader,h as ResourceLibraryError,le as createNodeResourceLibraryFactory,W as createResourceLibrary,g as isResourceLibraryError,$ as loadResourceManifestFromPath,K as validateResourceCacheRoot};
|
|
1
|
+
const _0x475546=_0x5719;function _0x5719(_0x18aace,_0x562e3e){_0x18aace=_0x18aace-0x144;const _0x449913=_0x4499();let _0x57194b=_0x449913[_0x18aace];return _0x57194b;}(function(_0x14594b,_0x154876){const _0x38fb64=_0x5719,_0x4a8700=_0x14594b();while(!![]){try{const _0x16ee6c=-parseInt(_0x38fb64(0x152))/0x1+-parseInt(_0x38fb64(0x1a0))/0x2*(-parseInt(_0x38fb64(0x214))/0x3)+-parseInt(_0x38fb64(0x20a))/0x4+-parseInt(_0x38fb64(0x207))/0x5*(parseInt(_0x38fb64(0x165))/0x6)+parseInt(_0x38fb64(0x190))/0x7+parseInt(_0x38fb64(0x1d3))/0x8+parseInt(_0x38fb64(0x14d))/0x9;if(_0x16ee6c===_0x154876)break;else _0x4a8700['push'](_0x4a8700['shift']());}catch(_0x284cce){_0x4a8700['push'](_0x4a8700['shift']());}}}(_0x4499,0x1cfe9));import{randomUUID as _0x2893f4}from'node:crypto';import{mkdir as _0x3a3f8d,readFile as _0x13809d,readdir as _0x29b619,rename as _0x2fe6fe,rm as _0x135ca4,stat as _0x12e2ce,unlink as _0x261243,writeFile as _0x285ccc}from'node:fs/promises';import{dirname as _0x32abfa,isAbsolute as _0x3217d9,join as _0x202795,parse as _0x50a63d,resolve as _0xe6d384}from'node:path';import{readFileSync as _0x1c35fa}from'node:fs';var h=class extends Error{['code'];[_0x475546(0x1cb)];constructor(_0x410894,_0x5a7484,_0x31cd83,_0x28fc8e){const _0x14a83d=_0x475546;super(_0x5a7484,_0x28fc8e),this[_0x14a83d(0x18a)]=_0x410894,this[_0x14a83d(0x1cb)]=_0x31cd83,this[_0x14a83d(0x1ac)]=_0x14a83d(0x195);}};function g(_0x392b1b){return _0x392b1b instanceof h;}var _=/^[A-Za-z0-9._-]+$/u,v=0xff,y=0x4;function b(_0x33eb6c){return _['test'](_0x33eb6c)&&_0x33eb6c!=='.'&&_0x33eb6c!=='..';}function x(_0x31d917){const _0x20ae9b=_0x475546;if(!b(_0x31d917)||_0x31d917[_0x20ae9b(0x1ce)]('-')||_0x31d917[_0x20ae9b(0x212)]('--')||_0x31d917['length']>v)throw new h(_0x20ae9b(0x1ec),_0x20ae9b(0x15e)+_0x31d917+_0x20ae9b(0x17a));}function S(_0x351622){const _0x3d810a=_0x475546;if(!b(_0x351622)||_0x351622[_0x3d810a(0x1ee)]+y>v)throw new h(_0x3d810a(0x175),'Invalid\x20resource\x20ID\x20\x22'+_0x351622+_0x3d810a(0x172));}function C(_0x3a1788){const _0x516d52=_0x475546;let _0x236905=_0x3a1788[_0x516d52(0x16e)]('/');if(_0x236905[_0x516d52(0x1ee)]!==0x2||_0x236905[0x0]===''||_0x236905[0x1]==='')throw new h(_0x516d52(0x144),_0x516d52(0x20f)+_0x3a1788+_0x516d52(0x1e7),_0x3a1788);let _0x29d898=_0x236905[0x0],_0x133541=_0x236905[0x1];return x(_0x29d898),S(_0x133541),{'registryId':_0x29d898,'resourceId':_0x133541};}function ee(_0xfe80e6,_0x4ab574){return x(_0xfe80e6),S(_0x4ab574),_0xfe80e6+'/'+_0x4ab574;}function w(_0x4f8dae){const _0x4c2da8=_0x475546;let {registryId:_0x128a84,resourceId:_0x22e4db}=C(_0x4f8dae),_0x295759=_0x128a84+'--'+_0x22e4db+_0x4c2da8(0x150);if(_0x295759[_0x4c2da8(0x1ee)]>v)throw new h(_0x4c2da8(0x1b0),_0x4c2da8(0x1a8)+v+'\x20bytes.',_0x4f8dae);return _0x295759;}function T(_0x31e6b7){const _0xea3d88=_0x475546;return new h(_0xea3d88(0x1fe),'Invalid\x20resource\x20manifest:\x20'+_0x31e6b7);}function E(_0x23dfeb,_0x246d4b){const _0xa4a35d=_0x475546;if(typeof _0x23dfeb!='object'||!_0x23dfeb||Array[_0xa4a35d(0x1e2)](_0x23dfeb))throw T(_0x246d4b+_0xa4a35d(0x1d1));return _0x23dfeb;}function D(_0x2f4234,_0x50e2f4,_0x51278a=!0x1){const _0x4a83d8=_0x475546;if(_0x51278a&&_0x2f4234===void 0x0)return[];if(!Array[_0x4a83d8(0x1e2)](_0x2f4234))throw T(_0x50e2f4+_0x4a83d8(0x203));return _0x2f4234;}function O(_0x44ef52,_0x49941e){const _0x2bbb98=_0x475546;if(typeof _0x44ef52!='string'||_0x44ef52==='')throw T(_0x49941e+_0x2bbb98(0x1a3));return _0x44ef52;}function k(_0x5a053d,_0x216f72,_0x596569=!0x1){return D(_0x5a053d,_0x216f72,_0x596569)['map']((_0x57558a,_0x531152)=>O(_0x57558a,_0x216f72+'['+_0x531152+']'));}function A(_0x496729,_0x7305e9){const _0x1958ea=_0x475546;return D(_0x496729,_0x7305e9,!0x0)[_0x1958ea(0x1be)]((_0x5e978c,_0x57a408)=>{const _0x15750e=_0x1958ea;if(typeof _0x5e978c!=_0x15750e(0x199))throw T(_0x7305e9+'['+_0x57a408+_0x15750e(0x17e));return _0x5e978c;})[_0x1958ea(0x1ed)](_0x288d21=>_0x288d21!=='');}function j(_0x4e3ae9,_0x5d62ef){const _0x46b34b=_0x475546;if(typeof _0x4e3ae9!='number'||!Number[_0x46b34b(0x178)](_0x4e3ae9))throw T(_0x5d62ef+'\x20must\x20be\x20a\x20finite\x20number.');return _0x4e3ae9;}function M(_0x587a79,_0x33b647){const _0x561ee6=_0x475546;if(typeof _0x587a79!=_0x561ee6(0x1e0))throw T(_0x33b647+'\x20must\x20be\x20a\x20boolean.');return _0x587a79;}function N(_0x340db0,_0x19ed6b,_0x49a4ae){const _0xc13024=_0x475546;if(typeof _0x340db0==_0xc13024(0x199)&&_0x340db0!=='')return _0x340db0;let _0x447bd9=E(_0x340db0,_0x19ed6b),_0x40200d=_0x49a4ae===void 0x0?void 0x0:_0x447bd9[_0x49a4ae];if(typeof _0x40200d==_0xc13024(0x199)&&_0x40200d!=='')return _0x40200d;let _0x5df481=_0x447bd9[_0xc13024(0x163)];if(typeof _0x5df481==_0xc13024(0x199)&&_0x5df481!=='')return _0x5df481;let _0xdd7b81=Object[_0xc13024(0x1e8)](_0x447bd9)[_0xc13024(0x15a)](_0x3c5eae=>typeof _0x3c5eae==_0xc13024(0x199)&&_0x3c5eae!=='');if(_0xdd7b81!==void 0x0)return _0xdd7b81;throw T(_0x19ed6b+_0xc13024(0x1c7));}function P(_0x335a35,_0x223fd4,_0x228838){const _0x37c061=_0x475546;try{_0x228838===_0x37c061(0x157)?x(_0x335a35):S(_0x335a35);}catch(_0x2396d0){throw T(_0x223fd4+':\x20'+(_0x2396d0 instanceof Error?_0x2396d0[_0x37c061(0x1bb)]:String(_0x2396d0)));}}function F(_0x553d6e,_0x4932db,_0xdaba06){const _0x39d56c=_0x475546;let _0x570efd=new Map();for(let [_0x582ebc,_0x1e22f9]of D(_0x553d6e,_0x4932db,!0x0)[_0x39d56c(0x1b5)]()){let _0x430363=E(_0x1e22f9,_0x4932db+'['+_0x582ebc+']'),_0x3c4c8b=O(_0x430363['id'],_0x4932db+'['+_0x582ebc+_0x39d56c(0x1b8));if(P(_0x3c4c8b,_0x4932db+'['+_0x582ebc+_0x39d56c(0x1b8),_0x39d56c(0x173)),_0x570efd[_0x39d56c(0x1ad)](_0x3c4c8b))throw T(_0x39d56c(0x1d6)+_0x4932db+_0x39d56c(0x1c6)+_0x3c4c8b+'\x22.');_0x570efd['set'](_0x3c4c8b,N(_0x430363[_0x39d56c(0x1c9)],_0x4932db+'['+_0x582ebc+_0x39d56c(0x14b),_0xdaba06));}return _0x570efd;}function I(_0x463986,_0x34b662){const _0xf3c0a=_0x475546;let _0x482824=E(_0x463986[_0xf3c0a(0x197)],_0x34b662+_0xf3c0a(0x1c5)),_0x1f1872=j(_0x482824[_0xf3c0a(0x1dd)],_0x34b662+'.intrinsicSize.width'),_0x315732=j(_0x482824[_0xf3c0a(0x1ef)],_0x34b662+_0xf3c0a(0x171));if(_0x1f1872<=0x0||_0x315732<=0x0)throw T(_0x34b662+_0xf3c0a(0x1ab));return{'width':_0x1f1872,'height':_0x315732};}function L(_0x5cdebf,_0x17c6f7){const _0x3a7a77=_0x475546;if(_0x5cdebf[_0x3a7a77(0x146)]!==_0x3a7a77(0x16d))throw T(_0x17c6f7+_0x3a7a77(0x213));if(_0x5cdebf[_0x3a7a77(0x192)]!=='reference')throw T(_0x17c6f7+_0x3a7a77(0x17c));let _0x42682d=E(_0x5cdebf[_0x3a7a77(0x148)],_0x17c6f7+_0x3a7a77(0x20d));if(_0x42682d[_0x3a7a77(0x146)]!=='url')throw T(_0x17c6f7+'.source.type\x20must\x20be\x20\x22url\x22.');let _0xcfeed2=O(_0x42682d[_0x3a7a77(0x160)],_0x17c6f7+_0x3a7a77(0x169)),_0x1c3bc3;try{_0x1c3bc3=new URL(_0xcfeed2);}catch{throw T(_0x17c6f7+_0x3a7a77(0x1e1));}if(_0x1c3bc3[_0x3a7a77(0x15b)]!==_0x3a7a77(0x19b))throw T(_0x17c6f7+'.source.value\x20must\x20use\x20HTTPS.');return _0xcfeed2;}function _0x4499(){const _0x45a891=['.intrinsicSize','\x20ID\x20\x22','\x20contains\x20no\x20usable\x20localized\x20text.','sourceUrl','label','].input.groups','handle','searchText','Resource\x20URL\x20must\x20use\x20HTTPS.','startsWith','listRegistries','.payload.colorEditable','\x20must\x20be\x20an\x20object.','manifestPath','318032WgXvtv','options','payload','Duplicate\x20','push','url','registryId','pid','\x20without\x20a\x20Location\x20header.','decode','width','.resource-','isDirectory','boolean','.source.value\x20must\x20be\x20a\x20URL.','isArray','].input','\x22;\x20try\x20resources\x20find\x20<query>.','utf-8','body','\x22;\x20expected\x20<registryId>/<resourceId>.','values','Resource\x20response\x20is\x20not\x20an\x20SVG\x20document.','Resource\x20search\x20limit\x20must\x20be\x20a\x20positive\x20integer;\x20received\x20\x22','\x20ms.','resource-invalid-registry-id','filter','length','height','Resource\x20request\x20redirected\x20to\x20a\x20non-HTTPS\x20URL.','resource-download-http','status','catch','.tmp','normalize','Failed\x20to\x20download\x20\x22','endsWith','join','localeCompare','resource-download-too-large','Resource\x20server\x20returned\x20HTTP\x20','resources','ENOENT','resource-manifest-invalid','text','Duplicate\x20registry\x20ID\x20\x22','byteCount','].input.registryId','\x20must\x20be\x20an\x20array.','].input.resources','.keywords','output','204355vUvrKk','Cannot\x20read\x20resource\x20manifest\x20at\x20','manifest','724508yHhmJO','Resource\x20search\x20needs\x20at\x20least\x20one\x20non-empty\x20query.','timeoutMs','.source','location','Invalid\x20resource\x20handle\x20\x22','resource-registry-not-found','.tagIds\x20references\x20unknown\x20tag\x20\x22','includes','.type\x20must\x20be\x20\x22image\x22.','24099NOcmSL','resource-invalid-handle','registrations','type','].input.resources[','source','Resource\x20exceeds\x20the\x20maximum\x20size\x20of\x20','input','].label','byteLength','2101482bCqJwm','download','Resource\x20cache\x20root\x20must\x20be\x20an\x20absolute,\x20dedicated\x20directory\x20below\x20the\x20filesystem\x20root;\x20received\x20\x22','.svg','resource-download-invalid-svg','209796XgigOc','isFile','tagIds','order','registries','registry','clearCache','resource-download-insecure-redirect','find','protocol','headers','\x20bytes.','Invalid\x20registry\x20ID\x20\x22','write','value','export','destination','en-US','.description','24zkinGM','content-length','registrationIndex','concat','.source.value','description','done','\x22:\x20','image','split','Downloaded\x20resource\x20\x22','slice','.intrinsicSize.height','\x22:\x20expected\x20filesystem-safe\x20characters.','resource','Resource\x20server\x20returned\x20an\x20invalid\x20redirect\x20URL.','resource-invalid-resource-id','manual','handles','isFinite','read','\x22:\x20expected\x20an\x20addressable\x20filesystem-safe\x20component\x20without\x20\x22--\x22.','Duplicate\x20resource\x20handle\x20\x22','.storagePolicy\x20must\x20be\x20\x22reference\x22.','groups',']\x20must\x20be\x20a\x20string.','size','group','colorEditable','fetchImpl','cacheLocation','cache','get','resource-download-insecure','registrations\x20must\x20not\x20be\x20empty.','clear','resource-invalid-svg','code','maxRedirects','groupId','resource-query-empty','registryById','catalog','1618561YLCYsf','set','storagePolicy','releaseLock','resource-manifest-read-failed','ResourceLibraryError','resource-download-failed','intrinsicSize','.name','string','cacheRoot','https:','signal','utf8','path','.order','42RhhbVu','.groupId','replace','\x20must\x20be\x20a\x20non-empty\x20string.','resourceIndex','.tagIds','root','Unknown\x20resource\x20registry\x20\x22','Resource\x20export\x20filename\x20exceeds\x20','tags','downloader','.intrinsicSize\x20must\x20be\x20positive.','name','has','Resource\x20download\x20timed\x20out\x20after\x20','.groupId\x20references\x20unknown\x20group\x20\x22','resource-export-filename-too-long','defaultLocale','getReader','Unknown\x20resource\x20\x22','registrations[','entries','.id','keywords','].id','manifest.registrations','add','message','aborted','isInteger','map','.payload','maxBytes','globalIndex','\x22\x20is\x20not\x20an\x20SVG\x20document.','test','parse'];_0x4499=function(){return _0x45a891;};return _0x4499();}function R(_0x422952){const _0x187ab3=_0x475546;return _0x422952[_0x187ab3(0x1f5)]('NFKC')['toLowerCase']()['trim']()[_0x187ab3(0x1a2)](/\s+/gu,'\x20');}function z(_0xb60226){const _0x4372b8=_0x475546;let _0x433654=E(_0xb60226,_0x4372b8(0x209)),_0x1c7581=new Map(),_0x135b68=new Map(),_0xdc71f2=[],_0x3a80d5=[],_0x3a6f67=new Set(),_0x11af76=0x0;for(let [_0xfa68c5,_0x3b68f8]of D(_0x433654[_0x4372b8(0x145)],_0x4372b8(0x1b9))[_0x4372b8(0x1b5)]()){let _0x5ace41=E(E(_0x3b68f8,'registrations['+_0xfa68c5+']')[_0x4372b8(0x14a)],_0x4372b8(0x1b4)+_0xfa68c5+_0x4372b8(0x1e3)),_0x56c50c=O(_0x5ace41[_0x4372b8(0x1d9)],_0x4372b8(0x1b4)+_0xfa68c5+_0x4372b8(0x202));if(P(_0x56c50c,'registrations['+_0xfa68c5+_0x4372b8(0x202),'registry'),_0x1c7581[_0x4372b8(0x1ad)](_0x56c50c))throw T(_0x4372b8(0x200)+_0x56c50c+'\x22.');let _0x184e64=_0x5ace41[_0x4372b8(0x1b1)]===void 0x0?void 0x0:O(_0x5ace41[_0x4372b8(0x1b1)],_0x4372b8(0x1b4)+_0xfa68c5+'].input.defaultLocale'),_0x3b8988=F(_0x5ace41[_0x4372b8(0x17d)],_0x4372b8(0x1b4)+_0xfa68c5+_0x4372b8(0x1ca),_0x184e64),_0x186e25=F(_0x5ace41[_0x4372b8(0x1a9)],_0x4372b8(0x1b4)+_0xfa68c5+'].input.tags',_0x184e64),_0x4a9da3=[];for(let [_0xe8e84a,_0x1ab79a]of D(_0x5ace41['resources'],_0x4372b8(0x1b4)+_0xfa68c5+_0x4372b8(0x204))[_0x4372b8(0x1b5)]()){let _0x27b2a3=_0x4372b8(0x1b4)+_0xfa68c5+_0x4372b8(0x147)+_0xe8e84a+']',_0x5ef0f3=E(_0x1ab79a,_0x27b2a3),_0x3ffb3f=O(_0x5ef0f3['id'],_0x27b2a3+_0x4372b8(0x1b6));P(_0x3ffb3f,_0x27b2a3+_0x4372b8(0x1b6),_0x4372b8(0x173));let _0x372dd8=ee(_0x56c50c,_0x3ffb3f);if(_0x135b68[_0x4372b8(0x1ad)](_0x372dd8))throw T(_0x4372b8(0x17b)+_0x372dd8+'\x22.');let _0x47721e;try{_0x47721e=w(_0x372dd8);}catch(_0x557129){throw T(_0x27b2a3+':\x20'+(_0x557129 instanceof Error?_0x557129[_0x4372b8(0x1bb)]:String(_0x557129)));}if(_0x3a6f67[_0x4372b8(0x1ad)](_0x47721e))throw T('Duplicate\x20export\x20filename\x20\x22'+_0x47721e+'\x22.');_0x3a6f67[_0x4372b8(0x1ba)](_0x47721e);let _0x15ed39=_0x5ef0f3[_0x4372b8(0x18c)]===void 0x0?void 0x0:O(_0x5ef0f3[_0x4372b8(0x18c)],_0x27b2a3+_0x4372b8(0x1a1));if(_0x15ed39!==void 0x0&&!_0x3b8988[_0x4372b8(0x1ad)](_0x15ed39))throw T(_0x27b2a3+_0x4372b8(0x1af)+_0x15ed39+'\x22.');let _0x35f2b6=k(_0x5ef0f3[_0x4372b8(0x154)],_0x27b2a3+_0x4372b8(0x1a5),!0x0);for(let _0x59cf17 of _0x35f2b6)if(!_0x186e25['has'](_0x59cf17))throw T(_0x27b2a3+_0x4372b8(0x211)+_0x59cf17+'\x22.');let _0x2a3266=A(_0x5ef0f3['keywords'],_0x27b2a3+_0x4372b8(0x205)),_0x1997f8=N(_0x5ef0f3[_0x4372b8(0x1ac)],_0x27b2a3+_0x4372b8(0x198),_0x184e64),_0xbc4740=_0x5ef0f3[_0x4372b8(0x16a)]===void 0x0?void 0x0:N(_0x5ef0f3[_0x4372b8(0x16a)],_0x27b2a3+_0x4372b8(0x164),_0x184e64),_0x4ee1b8=_0x15ed39===void 0x0?null:{'id':_0x15ed39,'label':_0x3b8988[_0x4372b8(0x185)](_0x15ed39)},_0x4269e2=_0x35f2b6[_0x4372b8(0x1be)](_0xdfe35c=>({'id':_0xdfe35c,'label':_0x186e25[_0x4372b8(0x185)](_0xdfe35c)})),_0x238066=E(_0x5ef0f3[_0x4372b8(0x1d5)],_0x27b2a3+_0x4372b8(0x1bf)),_0x34cb5a=_0x5ef0f3[_0x4372b8(0x155)]===void 0x0?null:j(_0x5ef0f3['order'],_0x27b2a3+_0x4372b8(0x19f)),_0x1c8a48=M(_0x238066[_0x4372b8(0x181)],_0x27b2a3+_0x4372b8(0x1d0)),_0x242c88={'handle':_0x372dd8,'registryId':_0x56c50c,'id':_0x3ffb3f,'name':_0x1997f8,..._0xbc4740===void 0x0?{}:{'description':_0xbc4740},'group':_0x4ee1b8,'tags':_0x4269e2,'keywords':_0x2a3266,'order':_0x34cb5a,'intrinsicSize':I(_0x238066,_0x27b2a3+_0x4372b8(0x1bf)),'colorEditable':_0x1c8a48,'sourceUrl':L(_0x238066,_0x27b2a3+'.payload'),'registrationIndex':_0xfa68c5,'resourceIndex':_0xe8e84a,'globalIndex':_0x11af76,'searchText':R([_0x1997f8,_0xbc4740,_0x4ee1b8?.[_0x4372b8(0x1c9)],..._0x4269e2[_0x4372b8(0x1be)](_0x11cabb=>_0x11cabb[_0x4372b8(0x1c9)]),..._0x2a3266][_0x4372b8(0x1ed)](_0x591a02=>_0x591a02!==void 0x0)[_0x4372b8(0x1f8)]('\x20'))};_0x11af76++,_0x4a9da3[_0x4372b8(0x1d7)](_0x242c88),_0x3a80d5[_0x4372b8(0x1d7)](_0x242c88),_0x135b68['set'](_0x372dd8,_0x242c88);}let _0x157c82={'id':_0x56c50c,'groups':_0x3b8988,'tags':_0x186e25,'resources':_0x4a9da3};_0xdc71f2['push'](_0x157c82),_0x1c7581[_0x4372b8(0x191)](_0x56c50c,_0x157c82);}if(_0xdc71f2[_0x4372b8(0x1ee)]===0x0)throw T(_0x4372b8(0x187));return{'registries':_0xdc71f2,'registryById':_0x1c7581,'resourceByHandle':_0x135b68,'resources':_0x3a80d5};}function B(_0xf82f90,_0x1c724e){const _0x328054=_0x475546;C(_0x1c724e);let _0x3cf886=_0xf82f90['resourceByHandle'][_0x328054(0x185)](_0x1c724e);if(_0x3cf886===void 0x0)throw new h('resource-not-found',_0x328054(0x1b3)+_0x1c724e+_0x328054(0x1e4),_0x1c724e);return _0x3cf886;}function te(_0xa49a2a){const _0x5a738a=_0x475546;return _0xa49a2a['registries'][_0x5a738a(0x1be)](_0x2e9b6f=>({'id':_0x2e9b6f['id'],'resourceCount':_0x2e9b6f[_0x5a738a(0x1fc)]['length'],'groupCount':_0x2e9b6f[_0x5a738a(0x17d)][_0x5a738a(0x17f)],'tagCount':_0x2e9b6f[_0x5a738a(0x1a9)][_0x5a738a(0x17f)],'colorEditableCount':_0x2e9b6f['resources']['filter'](_0x2c4d73=>_0x2c4d73[_0x5a738a(0x181)])[_0x5a738a(0x1ee)]}));}function ne(_0x28c4ba){const _0x267061=_0x475546;return{'handle':_0x28c4ba[_0x267061(0x1cb)],'registryId':_0x28c4ba[_0x267061(0x1d9)],'id':_0x28c4ba['id'],'name':_0x28c4ba[_0x267061(0x1ac)],'group':_0x28c4ba[_0x267061(0x180)],'tags':_0x28c4ba[_0x267061(0x1a9)],'keywords':_0x28c4ba[_0x267061(0x1b7)],'order':_0x28c4ba[_0x267061(0x155)],'intrinsicSize':_0x28c4ba['intrinsicSize'],'colorEditable':_0x28c4ba['colorEditable']};}function re(_0x121cad,_0x56c3bd){const _0x1b81f3=_0x475546;let _0x49b6e8=(_0x121cad[_0x1b81f3(0x155)]??_0x121cad[_0x1b81f3(0x1c1)])-(_0x56c3bd[_0x1b81f3(0x155)]??_0x56c3bd[_0x1b81f3(0x1c1)]);if(_0x49b6e8!==0x0)return _0x49b6e8;let _0x20ec7c=_0x121cad[_0x1b81f3(0x167)]-_0x56c3bd[_0x1b81f3(0x167)];if(_0x20ec7c!==0x0)return _0x20ec7c;let _0x4160dd=_0x121cad[_0x1b81f3(0x1a4)]-_0x56c3bd[_0x1b81f3(0x1a4)];return _0x4160dd===0x0?_0x121cad[_0x1b81f3(0x1cb)][_0x1b81f3(0x1f9)](_0x56c3bd[_0x1b81f3(0x1cb)]):_0x4160dd;}function ie(_0x69a7e4,_0x589bdd){const _0x4411e1=_0x475546;let _0x15f8d8=_0x589bdd['queries'][_0x4411e1(0x1be)](R)[_0x4411e1(0x1ed)](_0x22db5f=>_0x22db5f!=='');if(_0x15f8d8[_0x4411e1(0x1ee)]===0x0)throw new h(_0x4411e1(0x18d),_0x4411e1(0x20b));let _0x224e59=new Set(_0x589bdd[_0x4411e1(0x156)]??[]);for(let _0x6350e3 of _0x224e59)if(!_0x69a7e4[_0x4411e1(0x18e)][_0x4411e1(0x1ad)](_0x6350e3))throw new h(_0x4411e1(0x210),_0x4411e1(0x1a7)+_0x6350e3+'\x22.');let _0x1e4932=_0x589bdd['limit']??_0x69a7e4[_0x4411e1(0x1fc)][_0x4411e1(0x1ee)];if(!Number[_0x4411e1(0x1bd)](_0x1e4932)||_0x1e4932<0x1)throw new h('resource-limit-invalid',_0x4411e1(0x1ea)+_0x1e4932+'\x22.');let _0x5f42b6=_0x69a7e4[_0x4411e1(0x1fc)][_0x4411e1(0x1ed)](_0x3a1e75=>_0x224e59[_0x4411e1(0x17f)]===0x0||_0x224e59[_0x4411e1(0x1ad)](_0x3a1e75[_0x4411e1(0x1d9)]))['filter'](_0x5944a1=>_0x15f8d8['some'](_0x37e9b6=>_0x5944a1[_0x4411e1(0x1cc)][_0x4411e1(0x212)](_0x37e9b6)))['sort'](re);return{'resources':_0x5f42b6[_0x4411e1(0x170)](0x0,_0x1e4932)['map'](ne),'total':_0x5f42b6[_0x4411e1(0x1ee)]};}function V(_0x51832f){const _0x3bea45=_0x475546;return/^\s*(?:<\?xml[^>]*>\s*)?(?:<!--[^]*?-->\s*)*<svg(?:\s|>)/iu[_0x3bea45(0x1c3)](_0x51832f);}function H(_0x95646a,_0x3f8e26){const _0x4465c3=_0x475546;return g(_0x3f8e26)?{'handle':_0x95646a,'code':_0x3f8e26[_0x4465c3(0x18a)],'message':_0x3f8e26['message']}:{'handle':_0x95646a,'code':'resource-export-failed','message':_0x3f8e26 instanceof Error?_0x3f8e26['message']:String(_0x3f8e26)};}var U=class{[_0x475546(0x1d4)];[_0x475546(0x18f)];constructor(_0x440e92){const _0x3cd868=_0x475546;this['options']=_0x440e92,this[_0x3cd868(0x18f)]=z(_0x440e92['manifest']);}get[_0x475546(0x183)](){const _0x552303=_0x475546;return this['options']['cache'][_0x552303(0x20e)];}[_0x475546(0x1cf)](){const _0x394160=_0x475546;return te(this[_0x394160(0x18f)]);}[_0x475546(0x15a)](_0x1113dd){return ie(this['catalog'],_0x1113dd);}async[_0x475546(0x179)](_0x1f3dc3){const _0x2bc678=_0x475546;let _0x14fdc1=B(this['catalog'],_0x1f3dc3[_0x2bc678(0x1cb)]),_0x29e4dd=await this[_0x2bc678(0x1d4)][_0x2bc678(0x184)]['read'](_0x1f3dc3[_0x2bc678(0x1cb)]);if(_0x29e4dd!==void 0x0&&V(_0x29e4dd))return{'handle':_0x1f3dc3[_0x2bc678(0x1cb)],'svg':_0x29e4dd};let _0x5d6d49;try{_0x5d6d49=await this['options'][_0x2bc678(0x1aa)][_0x2bc678(0x14e)](_0x14fdc1[_0x2bc678(0x1c8)]);}catch(_0x375e29){throw g(_0x375e29)?_0x375e29:new h(_0x2bc678(0x196),_0x2bc678(0x1f6)+_0x1f3dc3[_0x2bc678(0x1cb)]+_0x2bc678(0x16c)+(_0x375e29 instanceof Error?_0x375e29[_0x2bc678(0x1bb)]:String(_0x375e29)),_0x1f3dc3[_0x2bc678(0x1cb)],{'cause':_0x375e29});}if(!V(_0x5d6d49))throw new h(_0x2bc678(0x189),_0x2bc678(0x16f)+_0x1f3dc3[_0x2bc678(0x1cb)]+_0x2bc678(0x1c2),_0x1f3dc3['handle']);return await this[_0x2bc678(0x1d4)][_0x2bc678(0x184)]['write'](_0x1f3dc3[_0x2bc678(0x1cb)],_0x5d6d49),{'handle':_0x1f3dc3[_0x2bc678(0x1cb)],'svg':_0x5d6d49};}async[_0x475546(0x161)](_0x1b1a47){const _0x3c95e9=_0x475546;let _0x207899=[],_0x5626b0=[];for(let _0x57630d of _0x1b1a47[_0x3c95e9(0x177)])try{let {svg:_0x5f0a5d}=await this[_0x3c95e9(0x179)]({'handle':_0x57630d}),_0xa5ab79=await this[_0x3c95e9(0x1d4)][_0x3c95e9(0x206)][_0x3c95e9(0x15f)](_0x1b1a47[_0x3c95e9(0x162)],w(_0x57630d),_0x5f0a5d);_0x207899[_0x3c95e9(0x1d7)]({'handle':_0x57630d,'path':_0xa5ab79});}catch(_0x30e150){_0x5626b0[_0x3c95e9(0x1d7)](H(_0x57630d,_0x30e150));}return{'exported':_0x207899,'failed':_0x5626b0};}async[_0x475546(0x158)](){const _0x5371ca=_0x475546;return await this[_0x5371ca(0x1d4)][_0x5371ca(0x184)][_0x5371ca(0x188)]();}};function W(_0x1a66b9){return new U(_0x1a66b9);}function G(_0x53ea27){const _0x576d05=_0x475546;return _0x53ea27 instanceof Error&&_0x576d05(0x18a)in _0x53ea27;}function K(_0x4510ea){const _0x2063f3=_0x475546;let _0x3aa660=_0xe6d384(_0x4510ea);if(!_0x3217d9(_0x4510ea)||_0x3aa660===_0x50a63d(_0x3aa660)[_0x2063f3(0x1a6)])throw new h('resource-cache-root-invalid',_0x2063f3(0x14f)+_0x4510ea+'\x22.');return _0x3aa660;}async function q(_0x487c0d){const _0x16f053=_0x475546;let _0x5a914f;try{_0x5a914f=await _0x29b619(_0x487c0d,{'withFileTypes':!0x0});}catch(_0x565fbd){if(G(_0x565fbd)&&_0x565fbd[_0x16f053(0x18a)]===_0x16f053(0x1fd))return{'resourceCount':0x0,'byteCount':0x0};throw _0x565fbd;}let _0x4380b6=0x0,_0x451696=0x0;for(let _0x436587 of _0x5a914f){let _0x4aca04=_0x202795(_0x487c0d,_0x436587[_0x16f053(0x1ac)]);if(_0x436587[_0x16f053(0x1df)]()){let _0x3679e2=await q(_0x4aca04);_0x4380b6+=_0x3679e2['resourceCount'],_0x451696+=_0x3679e2[_0x16f053(0x201)];}else{if(_0x436587[_0x16f053(0x153)]()&&_0x436587['name'][_0x16f053(0x1f7)](_0x16f053(0x150))){let _0xaa5087=await _0x12e2ce(_0x4aca04);_0x4380b6++,_0x451696+=_0xaa5087[_0x16f053(0x17f)];}}}return{'resourceCount':_0x4380b6,'byteCount':_0x451696};}var J=class{[_0x475546(0x20e)];constructor(_0x56ccfc){this['location']=K(_0x56ccfc);}[_0x475546(0x19e)](_0x10007b){const _0x1df91d=_0x475546;let {registryId:_0x4e74d,resourceId:_0x972c6f}=C(_0x10007b);return _0x202795(this[_0x1df91d(0x20e)],_0x4e74d,_0x972c6f+_0x1df91d(0x150));}async[_0x475546(0x179)](_0x373ca3){const _0x224aa1=_0x475546;try{return await _0x13809d(this[_0x224aa1(0x19e)](_0x373ca3),'utf8');}catch(_0x4f078c){if(G(_0x4f078c)&&_0x4f078c[_0x224aa1(0x18a)]===_0x224aa1(0x1fd))return;throw _0x4f078c;}}async['write'](_0x1d4f1f,_0x20fed7){const _0x21ec28=_0x475546;let _0x193c4a=this[_0x21ec28(0x19e)](_0x1d4f1f);await _0x3a3f8d(_0x32abfa(_0x193c4a),{'recursive':!0x0});let _0x29a812=_0x202795(_0x32abfa(_0x193c4a),_0x21ec28(0x1de)+process[_0x21ec28(0x1da)]+'-'+_0x2893f4()+_0x21ec28(0x1f4));try{await _0x285ccc(_0x29a812,_0x20fed7,{'encoding':_0x21ec28(0x19d),'mode':0x180}),await _0x2fe6fe(_0x29a812,_0x193c4a);}catch(_0x27fe43){throw await _0x261243(_0x29a812)['catch'](()=>void 0x0),_0x27fe43;}}async[_0x475546(0x188)](){const _0x4587bc=_0x475546;let _0x13eff6=await q(this['location']);return await _0x135ca4(this[_0x4587bc(0x20e)],{'force':!0x0,'recursive':!0x0}),{'path':this['location'],..._0x13eff6};}},Y=class{async[_0x475546(0x15f)](_0x56bf32,_0x117221,_0x28546d){const _0x1a5742=_0x475546;await _0x3a3f8d(_0x56bf32,{'recursive':!0x0});let _0xa762a7=_0x202795(_0x56bf32,_0x117221);return await _0x285ccc(_0xa762a7,_0x28546d,_0x1a5742(0x19d)),_0xa762a7;}},X=0x7530,ae=0xa00000,oe=0xa,se=new Set([0x12d,0x12e,0x12f,0x133,0x134]);function Z(_0x18c45e){const _0x18ed01=_0x475546;return new h(_0x18ed01(0x1fa),_0x18ed01(0x149)+_0x18c45e+_0x18ed01(0x15d));}async function ce(_0x4f9e1f,_0x480f7e){const _0x4245fd=_0x475546;let _0x9e619d=Number(_0x4f9e1f[_0x4245fd(0x15c)][_0x4245fd(0x185)](_0x4245fd(0x166)));if(Number[_0x4245fd(0x178)](_0x9e619d)&&_0x9e619d>_0x480f7e)throw Z(_0x480f7e);if(_0x4f9e1f[_0x4245fd(0x1e6)]===null){let _0x5811e0=await _0x4f9e1f[_0x4245fd(0x1ff)]();if(Buffer[_0x4245fd(0x14c)](_0x5811e0)>_0x480f7e)throw Z(_0x480f7e);return _0x5811e0;}let _0x591699=_0x4f9e1f[_0x4245fd(0x1e6)][_0x4245fd(0x1b2)](),_0x7da6a9=[],_0x50ee40=0x0;try{for(;;){let _0x1dda2d=await _0x591699[_0x4245fd(0x179)]();if(_0x1dda2d[_0x4245fd(0x16b)])break;if(_0x50ee40+=_0x1dda2d['value'][_0x4245fd(0x14c)],_0x50ee40>_0x480f7e)throw await _0x591699['cancel']()[_0x4245fd(0x1f3)](()=>void 0x0),Z(_0x480f7e);_0x7da6a9['push'](_0x1dda2d['value']);}}finally{_0x591699[_0x4245fd(0x193)]();}try{return new TextDecoder(_0x4245fd(0x1e5),{'fatal':!0x0})[_0x4245fd(0x1dc)](Buffer[_0x4245fd(0x168)](_0x7da6a9,_0x50ee40));}catch{throw new h('resource-download-invalid-utf8','Resource\x20response\x20is\x20not\x20valid\x20UTF-8.');}}var Q=class{[_0x475546(0x182)];['timeoutMs'];['maxBytes'];[_0x475546(0x18b)];constructor(_0x314a29={}){const _0x30e63a=_0x475546;this[_0x30e63a(0x182)]=_0x314a29['fetch']??fetch,this[_0x30e63a(0x20c)]=_0x314a29[_0x30e63a(0x20c)]??X,this[_0x30e63a(0x1c0)]=_0x314a29[_0x30e63a(0x1c0)]??ae,this['maxRedirects']=_0x314a29['maxRedirects']??oe;}async[_0x475546(0x14e)](_0x5afd19){const _0x58f6d3=_0x475546;let _0x100616=new URL(_0x5afd19);if(_0x100616[_0x58f6d3(0x15b)]!==_0x58f6d3(0x19b))throw new h(_0x58f6d3(0x186),_0x58f6d3(0x1cd));let _0x2bd3cb=new AbortController(),_0x38f15b=setTimeout(()=>_0x2bd3cb['abort'](),this['timeoutMs']);try{let _0x891e6a=_0x100616;for(let _0x1359e7=0x0;;_0x1359e7++){let _0x3e7530=await this[_0x58f6d3(0x182)](_0x891e6a,{'redirect':_0x58f6d3(0x176),'signal':_0x2bd3cb[_0x58f6d3(0x19c)]});if(se[_0x58f6d3(0x1ad)](_0x3e7530['status'])){if(_0x1359e7>=this[_0x58f6d3(0x18b)])throw new h('resource-download-too-many-redirects','Resource\x20request\x20followed\x20too\x20many\x20redirects;\x20maximum\x20'+this[_0x58f6d3(0x18b)]+'.');let _0x3da07b=_0x3e7530[_0x58f6d3(0x15c)][_0x58f6d3(0x185)](_0x58f6d3(0x20e));if(_0x3da07b===null)throw new h('resource-download-invalid-redirect',_0x58f6d3(0x1fb)+_0x3e7530[_0x58f6d3(0x1f2)]+_0x58f6d3(0x1db));let _0x41efd0;try{_0x41efd0=new URL(_0x3da07b,_0x891e6a);}catch{throw new h('resource-download-invalid-redirect',_0x58f6d3(0x174));}if(_0x41efd0[_0x58f6d3(0x15b)]!==_0x58f6d3(0x19b))throw new h(_0x58f6d3(0x159),'Resource\x20request\x20redirected\x20to\x20a\x20non-HTTPS\x20URL.');_0x891e6a=_0x41efd0;continue;}if(!_0x3e7530['ok'])throw new h(_0x58f6d3(0x1f1),_0x58f6d3(0x1fb)+_0x3e7530[_0x58f6d3(0x1f2)]+'.');if(_0x3e7530[_0x58f6d3(0x1d8)]!==''&&new URL(_0x3e7530[_0x58f6d3(0x1d8)])[_0x58f6d3(0x15b)]!==_0x58f6d3(0x19b))throw new h(_0x58f6d3(0x159),_0x58f6d3(0x1f0));let _0x8ad3d1=await ce(_0x3e7530,this['maxBytes']);if(!V(_0x8ad3d1))throw new h(_0x58f6d3(0x151),_0x58f6d3(0x1e9));return _0x8ad3d1;}}catch(_0x452319){throw _0x2bd3cb['signal'][_0x58f6d3(0x1bc)]?new h('resource-download-timeout',_0x58f6d3(0x1ae)+this[_0x58f6d3(0x20c)]+_0x58f6d3(0x1eb)):_0x452319;}finally{clearTimeout(_0x38f15b);}}};function $(_0x25ef18){const _0x2eebe5=_0x475546;try{return JSON[_0x2eebe5(0x1c4)](_0x1c35fa(_0x25ef18,_0x2eebe5(0x19d)));}catch(_0x484619){throw new h(_0x2eebe5(0x194),_0x2eebe5(0x208)+_0x25ef18+':\x20'+(_0x484619 instanceof Error?_0x484619[_0x2eebe5(0x1bb)]:String(_0x484619)),void 0x0,{'cause':_0x484619});}}function le(_0x218f98){const _0x10e1b2=_0x475546;let _0x1d85ea;return()=>(_0x1d85ea??=W({'manifest':$(_0x218f98[_0x10e1b2(0x1d2)]),'cache':new J(_0x218f98[_0x10e1b2(0x19a)]),'downloader':new Q(_0x218f98[_0x10e1b2(0x1aa)]),'output':new Y()}),_0x1d85ea);}export{J as FilesystemResourceCache,Y as FilesystemResourceOutput,Q as HttpsResourceDownloader,h as ResourceLibraryError,le as createNodeResourceLibraryFactory,W as createResourceLibrary,g as isResourceLibraryError,$ as loadResourceManifestFromPath,K as validateResourceCacheRoot};
|