@univer-cli/resource-library 1.0.0-beta.2 → 1.0.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
|
-
function _0x17f1(){const _0x27845=['\x20must\x20be\x20a\x20non-empty\x20string.','includes','\x20must\x20be\x20a\x20boolean.','isArray','limit','colorEditable','].id','\x20ms.','213924WtSmjM','].label','resources','isInteger','registryId','Invalid\x20resource\x20ID\x20\x22','.svg','.name','get','resource-manifest-read-failed','].input','root','724100eeajHG','message','Resource\x20cache\x20root\x20must\x20be\x20an\x20absolute,\x20dedicated\x20directory\x20below\x20the\x20filesystem\x20root;\x20received\x20\x22','resource-download-invalid-redirect','output','ENOENT','Resource\x20export\x20filename\x20exceeds\x20','resource-not-found','1403036LidpzP','Downloaded\x20resource\x20\x22','.resource-','reference','download','keywords','resource-registry-not-found','order','headers','location','.intrinsicSize.height','.tmp',']\x20must\x20be\x20a\x20string.','Failed\x20to\x20download\x20\x22','registry','join','.order','push','.storagePolicy\x20must\x20be\x20\x22reference\x22.','set','globalIndex','1282666PjqtPj','Duplicate\x20resource\x20handle\x20\x22','groups','intrinsicSize','\x20without\x20a\x20Location\x20header.','cacheRoot','tags','resource-invalid-handle','manual','maxBytes','NFKC','split','.keywords','storagePolicy','.description','filter','read','Duplicate\x20','Resource\x20search\x20limit\x20must\x20be\x20a\x20positive\x20integer;\x20received\x20\x22','maxRedirects','protocol','downloader','.intrinsicSize.width','test','sourceUrl','string','10643056YumWdT','resource-download-invalid-svg','registrations','concat','signal','cancel','\x20must\x20be\x20an\x20object.','add','Resource\x20exceeds\x20the\x20maximum\x20size\x20of\x20','timeoutMs','Unknown\x20resource\x20registry\x20\x22','registrationIndex','].input.groups','https:','slice','label','isFile','localeCompare','resourceIndex','Resource\x20request\x20redirected\x20to\x20a\x20non-HTTPS\x20URL.','some','boolean','resource-query-empty','\x20ID\x20\x22','height','parse','values','isDirectory','Resource\x20download\x20timed\x20out\x20after\x20','aborted','Unknown\x20resource\x20\x22','code','clear','write','content-length','.source.type\x20must\x20be\x20\x22url\x22.','resource-invalid-svg','Invalid\x20registry\x20ID\x20\x22','defaultLocale','.groupId','type','.payload.colorEditable','.tagIds\x20references\x20unknown\x20tag\x20\x22','].input.defaultLocale','Duplicate\x20export\x20filename\x20\x22','ResourceLibraryError','byteCount','resource-download-too-many-redirects','length','Resource\x20server\x20returned\x20an\x20invalid\x20redirect\x20URL.','.id','742tLJBTQ','fetchImpl','toLowerCase','groupId','resource-download-too-large','.source','Cannot\x20read\x20resource\x20manifest\x20at\x20','url','utf8','isFinite','image','searchText','source','registrations\x20must\x20not\x20be\x20empty.','registrations[','Resource\x20response\x20is\x20not\x20valid\x20UTF-8.','group','number','entries','releaseLock','pid','catalog','map','resource-download-insecure-redirect','].input.registryId','options','resource-download-failed','queries','decode','manifest.registrations','catch','status','Invalid\x20resource\x20handle\x20\x22','path','resource-download-http','name','\x20bytes.','].input.resources','453jgnEsN','registries','Resource\x20server\x20returned\x20HTTP\x20','Invalid\x20resource\x20manifest:\x20','resource-invalid-resource-id','resource-export-filename-too-long','manifest','Resource\x20request\x20followed\x20too\x20many\x20redirects;\x20maximum\x20','Duplicate\x20registry\x20ID\x20\x22','done','byteLength','handle','.tagIds','cache','sort','.source.value\x20must\x20use\x20HTTPS.','.payload','has','destination','2616372DKypiW','size','\x22\x20is\x20not\x20an\x20SVG\x20document.','object','width','resource-invalid-registry-id','description','value','endsWith','resource','resource-download-insecure'];_0x17f1=function(){return _0x27845;};return _0x17f1();}const _0x122181=_0xdc40;(function(_0x3802ae,_0x3f3448){const _0x3d5fb7=_0xdc40,_0x381b6f=_0x3802ae();while(!![]){try{const _0x3bedab=-parseInt(_0x3d5fb7(0x1bf))/0x1+-parseInt(_0x3d5fb7(0x235))/0x2*(parseInt(_0x3d5fb7(0x199))/0x3)+-parseInt(_0x3d5fb7(0x1d3))/0x4+parseInt(_0x3d5fb7(0x1cb))/0x5+-parseInt(_0x3d5fb7(0x1ac))/0x6+-parseInt(_0x3d5fb7(0x1e8))/0x7+parseInt(_0x3d5fb7(0x202))/0x8;if(_0x3bedab===_0x3f3448)break;else _0x381b6f['push'](_0x381b6f['shift']());}catch(_0x2be24b){_0x381b6f['push'](_0x381b6f['shift']());}}}(_0x17f1,0x396be));import{randomUUID as _0x1c8bca}from'node:crypto';import{mkdir as _0x39a1a4,readFile as _0x3da128,readdir as _0x135f30,rename as _0x2e1d93,rm as _0x16f7b4,stat as _0x20e29a,unlink as _0x22e0b2,writeFile as _0x5f3f74}from'node:fs/promises';import{dirname as _0x5d4545,isAbsolute as _0x2d5484,join as _0x55ac48,parse as _0x569a81,resolve as _0x2c9d4a}from'node:path';import{readFileSync as _0x4310a8}from'node:fs';var h=class extends Error{[_0x122181(0x221)];[_0x122181(0x1a4)];constructor(_0x5e5cad,_0x1829d7,_0x2bcfc0,_0x445aca){const _0x55e5d2=_0x122181;super(_0x1829d7,_0x445aca),this['code']=_0x5e5cad,this[_0x55e5d2(0x1a4)]=_0x2bcfc0,this[_0x55e5d2(0x196)]=_0x55e5d2(0x22f);}};function g(_0xff85ec){return _0xff85ec instanceof h;}var _=/^[A-Za-z0-9._-]+$/u,v=0xff,y=0x4;function b(_0x5b3f79){return _['test'](_0x5b3f79)&&_0x5b3f79!=='.'&&_0x5b3f79!=='..';}function x(_0x3d9260){const _0x565df7=_0x122181;if(!b(_0x3d9260)||_0x3d9260['startsWith']('-')||_0x3d9260[_0x565df7(0x1b8)]('--')||_0x3d9260[_0x565df7(0x232)]>v)throw new h(_0x565df7(0x1b1),_0x565df7(0x227)+_0x3d9260+'\x22:\x20expected\x20an\x20addressable\x20filesystem-safe\x20component\x20without\x20\x22--\x22.');}function S(_0xc0c9bc){const _0x2978d1=_0x122181;if(!b(_0xc0c9bc)||_0xc0c9bc['length']+y>v)throw new h(_0x2978d1(0x19d),_0x2978d1(0x1c4)+_0xc0c9bc+'\x22:\x20expected\x20filesystem-safe\x20characters.');}function C(_0x449baa){const _0x35fb34=_0x122181;let _0x547fa9=_0x449baa[_0x35fb34(0x1f3)]('/');if(_0x547fa9[_0x35fb34(0x232)]!==0x2||_0x547fa9[0x0]===''||_0x547fa9[0x1]==='')throw new h(_0x35fb34(0x1ef),_0x35fb34(0x193)+_0x449baa+'\x22;\x20expected\x20<registryId>/<resourceId>.',_0x449baa);let _0x105c52=_0x547fa9[0x0],_0x401a36=_0x547fa9[0x1];return x(_0x105c52),S(_0x401a36),{'registryId':_0x105c52,'resourceId':_0x401a36};}function ee(_0xdf9125,_0x6f55a1){return x(_0xdf9125),S(_0x6f55a1),_0xdf9125+'/'+_0x6f55a1;}function w(_0x32832f){const _0x51f58f=_0x122181;let {registryId:_0x3ad601,resourceId:_0x5a3b74}=C(_0x32832f),_0x52998b=_0x3ad601+'--'+_0x5a3b74+'.svg';if(_0x52998b[_0x51f58f(0x232)]>v)throw new h(_0x51f58f(0x19e),_0x51f58f(0x1d1)+v+_0x51f58f(0x197),_0x32832f);return _0x52998b;}function T(_0x55b916){const _0x5c4101=_0x122181;return new h('resource-manifest-invalid',_0x5c4101(0x19c)+_0x55b916);}function E(_0x64d269,_0x36095c){const _0xb29428=_0x122181;if(typeof _0x64d269!=_0xb29428(0x1af)||!_0x64d269||Array[_0xb29428(0x1ba)](_0x64d269))throw T(_0x36095c+_0xb29428(0x208));return _0x64d269;}function D(_0xad8440,_0x2e384c,_0x28cba7=!0x1){const _0x2f2ff9=_0x122181;if(_0x28cba7&&_0xad8440===void 0x0)return[];if(!Array[_0x2f2ff9(0x1ba)](_0xad8440))throw T(_0x2e384c+'\x20must\x20be\x20an\x20array.');return _0xad8440;}function O(_0x557765,_0x580864){const _0x4ca156=_0x122181;if(typeof _0x557765!=_0x4ca156(0x201)||_0x557765==='')throw T(_0x580864+_0x4ca156(0x1b7));return _0x557765;}function k(_0x2a86a2,_0x347456,_0x1a19a1=!0x1){const _0x1b9c0c=_0x122181;return D(_0x2a86a2,_0x347456,_0x1a19a1)[_0x1b9c0c(0x189)]((_0x488a8f,_0x1e668d)=>O(_0x488a8f,_0x347456+'['+_0x1e668d+']'));}function A(_0x16a583,_0x156518){const _0x127920=_0x122181;return D(_0x16a583,_0x156518,!0x0)[_0x127920(0x189)]((_0x108957,_0x29d3ac)=>{const _0x26784e=_0x127920;if(typeof _0x108957!=_0x26784e(0x201))throw T(_0x156518+'['+_0x29d3ac+_0x26784e(0x1df));return _0x108957;})[_0x127920(0x1f7)](_0x51e1d8=>_0x51e1d8!=='');}function j(_0x23830e,_0x473cb6){const _0x12ef14=_0x122181;if(typeof _0x23830e!=_0x12ef14(0x184)||!Number[_0x12ef14(0x23e)](_0x23830e))throw T(_0x473cb6+'\x20must\x20be\x20a\x20finite\x20number.');return _0x23830e;}function M(_0x5b25b,_0x5019d7){const _0x3b939e=_0x122181;if(typeof _0x5b25b!=_0x3b939e(0x217))throw T(_0x5019d7+_0x3b939e(0x1b9));return _0x5b25b;}function N(_0x373d20,_0x54ee5b,_0x5eab82){const _0x4b2f7f=_0x122181;if(typeof _0x373d20==_0x4b2f7f(0x201)&&_0x373d20!=='')return _0x373d20;let _0x3c278d=E(_0x373d20,_0x54ee5b),_0xad768b=_0x5eab82===void 0x0?void 0x0:_0x3c278d[_0x5eab82];if(typeof _0xad768b==_0x4b2f7f(0x201)&&_0xad768b!=='')return _0xad768b;let _0x10c412=_0x3c278d['en-US'];if(typeof _0x10c412==_0x4b2f7f(0x201)&&_0x10c412!=='')return _0x10c412;let _0x33d5e1=Object[_0x4b2f7f(0x21c)](_0x3c278d)['find'](_0x43878a=>typeof _0x43878a==_0x4b2f7f(0x201)&&_0x43878a!=='');if(_0x33d5e1!==void 0x0)return _0x33d5e1;throw T(_0x54ee5b+'\x20contains\x20no\x20usable\x20localized\x20text.');}function P(_0x49e1b9,_0x165cc4,_0x51ba83){const _0x367f7c=_0x122181;try{_0x51ba83===_0x367f7c(0x1e1)?x(_0x49e1b9):S(_0x49e1b9);}catch(_0x1e3062){throw T(_0x165cc4+':\x20'+(_0x1e3062 instanceof Error?_0x1e3062['message']:String(_0x1e3062)));}}function F(_0x348a38,_0x2cf3d7,_0x1222b3){const _0x257613=_0x122181;let _0x22f2f9=new Map();for(let [_0x28a7d5,_0x60f576]of D(_0x348a38,_0x2cf3d7,!0x0)[_0x257613(0x185)]()){let _0x45556d=E(_0x60f576,_0x2cf3d7+'['+_0x28a7d5+']'),_0x3c54d0=O(_0x45556d['id'],_0x2cf3d7+'['+_0x28a7d5+_0x257613(0x1bd));if(P(_0x3c54d0,_0x2cf3d7+'['+_0x28a7d5+_0x257613(0x1bd),_0x257613(0x1b5)),_0x22f2f9[_0x257613(0x1aa)](_0x3c54d0))throw T(_0x257613(0x1f9)+_0x2cf3d7+_0x257613(0x219)+_0x3c54d0+'\x22.');_0x22f2f9[_0x257613(0x1e6)](_0x3c54d0,N(_0x45556d['label'],_0x2cf3d7+'['+_0x28a7d5+_0x257613(0x1c0),_0x1222b3));}return _0x22f2f9;}function I(_0x25498a,_0x4a1781){const _0x4ad82f=_0x122181;let _0x924842=E(_0x25498a[_0x4ad82f(0x1eb)],_0x4a1781+'.intrinsicSize'),_0x29527b=j(_0x924842[_0x4ad82f(0x1b0)],_0x4a1781+_0x4ad82f(0x1fe)),_0x33a79a=j(_0x924842[_0x4ad82f(0x21a)],_0x4a1781+_0x4ad82f(0x1dd));if(_0x29527b<=0x0||_0x33a79a<=0x0)throw T(_0x4a1781+'.intrinsicSize\x20must\x20be\x20positive.');return{'width':_0x29527b,'height':_0x33a79a};}function L(_0x56cd64,_0x10dc72){const _0x16c019=_0x122181;if(_0x56cd64[_0x16c019(0x22a)]!==_0x16c019(0x23f))throw T(_0x10dc72+'.type\x20must\x20be\x20\x22image\x22.');if(_0x56cd64[_0x16c019(0x1f5)]!==_0x16c019(0x1d6))throw T(_0x10dc72+_0x16c019(0x1e5));let _0x5a556e=E(_0x56cd64[_0x16c019(0x241)],_0x10dc72+_0x16c019(0x23a));if(_0x5a556e[_0x16c019(0x22a)]!==_0x16c019(0x23c))throw T(_0x10dc72+_0x16c019(0x225));let _0x1e8e7f=O(_0x5a556e[_0x16c019(0x1b3)],_0x10dc72+'.source.value'),_0x5b80bd;try{_0x5b80bd=new URL(_0x1e8e7f);}catch{throw T(_0x10dc72+'.source.value\x20must\x20be\x20a\x20URL.');}if(_0x5b80bd[_0x16c019(0x1fc)]!==_0x16c019(0x20f))throw T(_0x10dc72+_0x16c019(0x1a8));return _0x1e8e7f;}function R(_0x338829){const _0xed712=_0x122181;return _0x338829['normalize'](_0xed712(0x1f2))[_0xed712(0x237)]()['trim']()['replace'](/\s+/gu,'\x20');}function z(_0x421780){const _0x3b2773=_0x122181;let _0x4ded96=E(_0x421780,_0x3b2773(0x19f)),_0x5bd23b=new Map(),_0x2be1d0=new Map(),_0x7e3edd=[],_0x1b4863=[],_0x368130=new Set(),_0x3b85d8=0x0;for(let [_0x5a141b,_0x58698f]of D(_0x4ded96[_0x3b2773(0x204)],_0x3b2773(0x190))[_0x3b2773(0x185)]()){let _0x79277d=E(E(_0x58698f,'registrations['+_0x5a141b+']')['input'],'registrations['+_0x5a141b+_0x3b2773(0x1c9)),_0x5ed2c5=O(_0x79277d[_0x3b2773(0x1c3)],_0x3b2773(0x181)+_0x5a141b+_0x3b2773(0x18b));if(P(_0x5ed2c5,'registrations['+_0x5a141b+_0x3b2773(0x18b),'registry'),_0x5bd23b['has'](_0x5ed2c5))throw T(_0x3b2773(0x1a1)+_0x5ed2c5+'\x22.');let _0x1f99de=_0x79277d['defaultLocale']===void 0x0?void 0x0:O(_0x79277d[_0x3b2773(0x228)],_0x3b2773(0x181)+_0x5a141b+_0x3b2773(0x22d)),_0x3658d5=F(_0x79277d['groups'],_0x3b2773(0x181)+_0x5a141b+_0x3b2773(0x20e),_0x1f99de),_0x35c547=F(_0x79277d[_0x3b2773(0x1ee)],'registrations['+_0x5a141b+'].input.tags',_0x1f99de),_0x80ed2e=[];for(let [_0x72a6cb,_0x32daea]of D(_0x79277d['resources'],'registrations['+_0x5a141b+_0x3b2773(0x198))['entries']()){let _0x13c951=_0x3b2773(0x181)+_0x5a141b+'].input.resources['+_0x72a6cb+']',_0x391d0c=E(_0x32daea,_0x13c951),_0x3b211e=O(_0x391d0c['id'],_0x13c951+_0x3b2773(0x234));P(_0x3b211e,_0x13c951+'.id','resource');let _0xe9a1c8=ee(_0x5ed2c5,_0x3b211e);if(_0x2be1d0['has'](_0xe9a1c8))throw T(_0x3b2773(0x1e9)+_0xe9a1c8+'\x22.');let _0x3e7bd4;try{_0x3e7bd4=w(_0xe9a1c8);}catch(_0x537fd5){throw T(_0x13c951+':\x20'+(_0x537fd5 instanceof Error?_0x537fd5[_0x3b2773(0x1cc)]:String(_0x537fd5)));}if(_0x368130['has'](_0x3e7bd4))throw T(_0x3b2773(0x22e)+_0x3e7bd4+'\x22.');_0x368130[_0x3b2773(0x209)](_0x3e7bd4);let _0xc74fb4=_0x391d0c[_0x3b2773(0x238)]===void 0x0?void 0x0:O(_0x391d0c['groupId'],_0x13c951+_0x3b2773(0x229));if(_0xc74fb4!==void 0x0&&!_0x3658d5[_0x3b2773(0x1aa)](_0xc74fb4))throw T(_0x13c951+'.groupId\x20references\x20unknown\x20group\x20\x22'+_0xc74fb4+'\x22.');let _0x967853=k(_0x391d0c['tagIds'],_0x13c951+_0x3b2773(0x1a5),!0x0);for(let _0x4c2214 of _0x967853)if(!_0x35c547[_0x3b2773(0x1aa)](_0x4c2214))throw T(_0x13c951+_0x3b2773(0x22c)+_0x4c2214+'\x22.');let _0x510f47=A(_0x391d0c[_0x3b2773(0x1d8)],_0x13c951+_0x3b2773(0x1f4)),_0x198bbc=N(_0x391d0c[_0x3b2773(0x196)],_0x13c951+_0x3b2773(0x1c6),_0x1f99de),_0x5210df=_0x391d0c[_0x3b2773(0x1b2)]===void 0x0?void 0x0:N(_0x391d0c[_0x3b2773(0x1b2)],_0x13c951+_0x3b2773(0x1f6),_0x1f99de),_0x587e75=_0xc74fb4===void 0x0?null:{'id':_0xc74fb4,'label':_0x3658d5[_0x3b2773(0x1c7)](_0xc74fb4)},_0x321d60=_0x967853[_0x3b2773(0x189)](_0xcc2284=>({'id':_0xcc2284,'label':_0x35c547[_0x3b2773(0x1c7)](_0xcc2284)})),_0x298300=E(_0x391d0c['payload'],_0x13c951+_0x3b2773(0x1a9)),_0x1d3e1e=_0x391d0c[_0x3b2773(0x1da)]===void 0x0?null:j(_0x391d0c['order'],_0x13c951+_0x3b2773(0x1e3)),_0x2813e6=M(_0x298300[_0x3b2773(0x1bc)],_0x13c951+_0x3b2773(0x22b)),_0x2d2b23={'handle':_0xe9a1c8,'registryId':_0x5ed2c5,'id':_0x3b211e,'name':_0x198bbc,..._0x5210df===void 0x0?{}:{'description':_0x5210df},'group':_0x587e75,'tags':_0x321d60,'keywords':_0x510f47,'order':_0x1d3e1e,'intrinsicSize':I(_0x298300,_0x13c951+_0x3b2773(0x1a9)),'colorEditable':_0x2813e6,'sourceUrl':L(_0x298300,_0x13c951+_0x3b2773(0x1a9)),'registrationIndex':_0x5a141b,'resourceIndex':_0x72a6cb,'globalIndex':_0x3b85d8,'searchText':R([_0x198bbc,_0x5210df,_0x587e75?.['label'],..._0x321d60[_0x3b2773(0x189)](_0x9a9abf=>_0x9a9abf[_0x3b2773(0x211)]),..._0x510f47]['filter'](_0x94574a=>_0x94574a!==void 0x0)[_0x3b2773(0x1e2)]('\x20'))};_0x3b85d8++,_0x80ed2e['push'](_0x2d2b23),_0x1b4863['push'](_0x2d2b23),_0x2be1d0[_0x3b2773(0x1e6)](_0xe9a1c8,_0x2d2b23);}let _0x50c4a2={'id':_0x5ed2c5,'groups':_0x3658d5,'tags':_0x35c547,'resources':_0x80ed2e};_0x7e3edd[_0x3b2773(0x1e4)](_0x50c4a2),_0x5bd23b['set'](_0x5ed2c5,_0x50c4a2);}if(_0x7e3edd['length']===0x0)throw T(_0x3b2773(0x242));return{'registries':_0x7e3edd,'registryById':_0x5bd23b,'resourceByHandle':_0x2be1d0,'resources':_0x1b4863};}function B(_0x2385ac,_0x63e13){const _0xd680f5=_0x122181;C(_0x63e13);let _0x40cde9=_0x2385ac['resourceByHandle'][_0xd680f5(0x1c7)](_0x63e13);if(_0x40cde9===void 0x0)throw new h(_0xd680f5(0x1d2),_0xd680f5(0x220)+_0x63e13+'\x22;\x20try\x20resources\x20find\x20<query>.',_0x63e13);return _0x40cde9;}function te(_0x291ae5){const _0x42077d=_0x122181;return _0x291ae5[_0x42077d(0x19a)]['map'](_0x33d2cc=>({'id':_0x33d2cc['id'],'resourceCount':_0x33d2cc['resources'][_0x42077d(0x232)],'groupCount':_0x33d2cc[_0x42077d(0x1ea)]['size'],'tagCount':_0x33d2cc['tags']['size'],'colorEditableCount':_0x33d2cc['resources'][_0x42077d(0x1f7)](_0x287787=>_0x287787[_0x42077d(0x1bc)])[_0x42077d(0x232)]}));}function _0xdc40(_0x2beb71,_0x4218c4){_0x2beb71=_0x2beb71-0x181;const _0x17f1b8=_0x17f1();let _0xdc401=_0x17f1b8[_0x2beb71];return _0xdc401;}function ne(_0x440fb9){const _0x361a6e=_0x122181;return{'handle':_0x440fb9['handle'],'registryId':_0x440fb9[_0x361a6e(0x1c3)],'id':_0x440fb9['id'],'name':_0x440fb9['name'],'group':_0x440fb9[_0x361a6e(0x183)],'tags':_0x440fb9[_0x361a6e(0x1ee)],'keywords':_0x440fb9[_0x361a6e(0x1d8)],'order':_0x440fb9[_0x361a6e(0x1da)],'intrinsicSize':_0x440fb9[_0x361a6e(0x1eb)],'colorEditable':_0x440fb9[_0x361a6e(0x1bc)]};}function re(_0x532db9,_0x672a7f){const _0x42e887=_0x122181;let _0x1db52c=(_0x532db9[_0x42e887(0x1da)]??_0x532db9['globalIndex'])-(_0x672a7f['order']??_0x672a7f[_0x42e887(0x1e7)]);if(_0x1db52c!==0x0)return _0x1db52c;let _0x2a2757=_0x532db9[_0x42e887(0x20d)]-_0x672a7f['registrationIndex'];if(_0x2a2757!==0x0)return _0x2a2757;let _0x39efc4=_0x532db9[_0x42e887(0x214)]-_0x672a7f[_0x42e887(0x214)];return _0x39efc4===0x0?_0x532db9['handle'][_0x42e887(0x213)](_0x672a7f[_0x42e887(0x1a4)]):_0x39efc4;}function ie(_0x10fdd8,_0x1b2256){const _0x2f44fa=_0x122181;let _0x1b84bc=_0x1b2256[_0x2f44fa(0x18e)][_0x2f44fa(0x189)](R)[_0x2f44fa(0x1f7)](_0x52fc40=>_0x52fc40!=='');if(_0x1b84bc[_0x2f44fa(0x232)]===0x0)throw new h(_0x2f44fa(0x218),'Resource\x20search\x20needs\x20at\x20least\x20one\x20non-empty\x20query.');let _0x2a948c=new Set(_0x1b2256[_0x2f44fa(0x19a)]??[]);for(let _0xd67a87 of _0x2a948c)if(!_0x10fdd8['registryById'][_0x2f44fa(0x1aa)](_0xd67a87))throw new h(_0x2f44fa(0x1d9),_0x2f44fa(0x20c)+_0xd67a87+'\x22.');let _0x3af645=_0x1b2256[_0x2f44fa(0x1bb)]??_0x10fdd8[_0x2f44fa(0x1c1)][_0x2f44fa(0x232)];if(!Number[_0x2f44fa(0x1c2)](_0x3af645)||_0x3af645<0x1)throw new h('resource-limit-invalid',_0x2f44fa(0x1fa)+_0x3af645+'\x22.');let _0xf18d78=_0x10fdd8['resources'][_0x2f44fa(0x1f7)](_0x2dbff9=>_0x2a948c[_0x2f44fa(0x1ad)]===0x0||_0x2a948c[_0x2f44fa(0x1aa)](_0x2dbff9[_0x2f44fa(0x1c3)]))[_0x2f44fa(0x1f7)](_0x3e8f23=>_0x1b84bc[_0x2f44fa(0x216)](_0x54e3af=>_0x3e8f23[_0x2f44fa(0x240)][_0x2f44fa(0x1b8)](_0x54e3af)))[_0x2f44fa(0x1a7)](re);return{'resources':_0xf18d78[_0x2f44fa(0x210)](0x0,_0x3af645)[_0x2f44fa(0x189)](ne),'total':_0xf18d78['length']};}function V(_0x3b2c3a){const _0x1187ad=_0x122181;return/^\s*(?:<\?xml[^>]*>\s*)?(?:<!--[^]*?-->\s*)*<svg(?:\s|>)/iu[_0x1187ad(0x1ff)](_0x3b2c3a);}function H(_0x5120e7,_0x38f76f){const _0x50aa87=_0x122181;return g(_0x38f76f)?{'handle':_0x5120e7,'code':_0x38f76f[_0x50aa87(0x221)],'message':_0x38f76f['message']}:{'handle':_0x5120e7,'code':'resource-export-failed','message':_0x38f76f instanceof Error?_0x38f76f['message']:String(_0x38f76f)};}var U=class{[_0x122181(0x18c)];['catalog'];constructor(_0x56b4a9){const _0x32a90c=_0x122181;this['options']=_0x56b4a9,this[_0x32a90c(0x188)]=z(_0x56b4a9[_0x32a90c(0x19f)]);}get['cacheLocation'](){const _0x3a6699=_0x122181;return this[_0x3a6699(0x18c)][_0x3a6699(0x1a6)][_0x3a6699(0x1dc)];}['listRegistries'](){const _0x44c0f5=_0x122181;return te(this[_0x44c0f5(0x188)]);}['find'](_0x492e74){const _0x238532=_0x122181;return ie(this[_0x238532(0x188)],_0x492e74);}async[_0x122181(0x1f8)](_0x585915){const _0x33541e=_0x122181;let _0xa605f8=B(this[_0x33541e(0x188)],_0x585915['handle']),_0x3ad5a1=await this['options']['cache']['read'](_0x585915[_0x33541e(0x1a4)]);if(_0x3ad5a1!==void 0x0&&V(_0x3ad5a1))return{'handle':_0x585915[_0x33541e(0x1a4)],'svg':_0x3ad5a1};let _0x3abe09;try{_0x3abe09=await this['options'][_0x33541e(0x1fd)][_0x33541e(0x1d7)](_0xa605f8[_0x33541e(0x200)]);}catch(_0x360a3b){throw g(_0x360a3b)?_0x360a3b:new h(_0x33541e(0x18d),_0x33541e(0x1e0)+_0x585915[_0x33541e(0x1a4)]+'\x22:\x20'+(_0x360a3b instanceof Error?_0x360a3b[_0x33541e(0x1cc)]:String(_0x360a3b)),_0x585915[_0x33541e(0x1a4)],{'cause':_0x360a3b});}if(!V(_0x3abe09))throw new h(_0x33541e(0x226),_0x33541e(0x1d4)+_0x585915[_0x33541e(0x1a4)]+_0x33541e(0x1ae),_0x585915['handle']);return await this[_0x33541e(0x18c)]['cache'][_0x33541e(0x223)](_0x585915[_0x33541e(0x1a4)],_0x3abe09),{'handle':_0x585915[_0x33541e(0x1a4)],'svg':_0x3abe09};}async['export'](_0x28323d){const _0x2a1f8b=_0x122181;let _0x4f1dfb=[],_0x431d62=[];for(let _0x56613c of _0x28323d['handles'])try{let {svg:_0x30e191}=await this['read']({'handle':_0x56613c}),_0x20b4ca=await this[_0x2a1f8b(0x18c)][_0x2a1f8b(0x1cf)][_0x2a1f8b(0x223)](_0x28323d[_0x2a1f8b(0x1ab)],w(_0x56613c),_0x30e191);_0x4f1dfb['push']({'handle':_0x56613c,'path':_0x20b4ca});}catch(_0x2c6760){_0x431d62[_0x2a1f8b(0x1e4)](H(_0x56613c,_0x2c6760));}return{'exported':_0x4f1dfb,'failed':_0x431d62};}async['clearCache'](){const _0x13e76f=_0x122181;return await this['options'][_0x13e76f(0x1a6)][_0x13e76f(0x222)]();}};function W(_0x26c59b){return new U(_0x26c59b);}function G(_0x23df4a){const _0x5cc9f8=_0x122181;return _0x23df4a instanceof Error&&_0x5cc9f8(0x221)in _0x23df4a;}function K(_0x3a24e4){const _0xd66f80=_0x122181;let _0x4c36bc=_0x2c9d4a(_0x3a24e4);if(!_0x2d5484(_0x3a24e4)||_0x4c36bc===_0x569a81(_0x4c36bc)[_0xd66f80(0x1ca)])throw new h('resource-cache-root-invalid',_0xd66f80(0x1cd)+_0x3a24e4+'\x22.');return _0x4c36bc;}async function q(_0x27e542){const _0x14e495=_0x122181;let _0x13b257;try{_0x13b257=await _0x135f30(_0x27e542,{'withFileTypes':!0x0});}catch(_0x59026d){if(G(_0x59026d)&&_0x59026d[_0x14e495(0x221)]===_0x14e495(0x1d0))return{'resourceCount':0x0,'byteCount':0x0};throw _0x59026d;}let _0x2314b1=0x0,_0x3ceb7f=0x0;for(let _0x5f5442 of _0x13b257){let _0x3448d1=_0x55ac48(_0x27e542,_0x5f5442['name']);if(_0x5f5442[_0x14e495(0x21d)]()){let _0x5409aa=await q(_0x3448d1);_0x2314b1+=_0x5409aa['resourceCount'],_0x3ceb7f+=_0x5409aa[_0x14e495(0x230)];}else{if(_0x5f5442[_0x14e495(0x212)]()&&_0x5f5442['name'][_0x14e495(0x1b4)](_0x14e495(0x1c5))){let _0xf71c48=await _0x20e29a(_0x3448d1);_0x2314b1++,_0x3ceb7f+=_0xf71c48[_0x14e495(0x1ad)];}}}return{'resourceCount':_0x2314b1,'byteCount':_0x3ceb7f};}var J=class{['location'];constructor(_0x23a1fa){this['location']=K(_0x23a1fa);}[_0x122181(0x194)](_0x347645){const _0x181737=_0x122181;let {registryId:_0x3ad447,resourceId:_0x4549f6}=C(_0x347645);return _0x55ac48(this[_0x181737(0x1dc)],_0x3ad447,_0x4549f6+_0x181737(0x1c5));}async[_0x122181(0x1f8)](_0x28f4e0){const _0x1b3b30=_0x122181;try{return await _0x3da128(this[_0x1b3b30(0x194)](_0x28f4e0),'utf8');}catch(_0x38ce24){if(G(_0x38ce24)&&_0x38ce24['code']===_0x1b3b30(0x1d0))return;throw _0x38ce24;}}async[_0x122181(0x223)](_0x433344,_0x227a96){const _0x18bc00=_0x122181;let _0x1a28bd=this['path'](_0x433344);await _0x39a1a4(_0x5d4545(_0x1a28bd),{'recursive':!0x0});let _0x12c64d=_0x55ac48(_0x5d4545(_0x1a28bd),_0x18bc00(0x1d5)+process[_0x18bc00(0x187)]+'-'+_0x1c8bca()+_0x18bc00(0x1de));try{await _0x5f3f74(_0x12c64d,_0x227a96,{'encoding':_0x18bc00(0x23d),'mode':0x180}),await _0x2e1d93(_0x12c64d,_0x1a28bd);}catch(_0xe01c21){throw await _0x22e0b2(_0x12c64d)[_0x18bc00(0x191)](()=>void 0x0),_0xe01c21;}}async[_0x122181(0x222)](){const _0x3ec302=_0x122181;let _0x314b0d=await q(this[_0x3ec302(0x1dc)]);return await _0x16f7b4(this[_0x3ec302(0x1dc)],{'force':!0x0,'recursive':!0x0}),{'path':this[_0x3ec302(0x1dc)],..._0x314b0d};}},Y=class{async['write'](_0x36a2ea,_0x1a2f17,_0x4f86e3){const _0x2613f7=_0x122181;await _0x39a1a4(_0x36a2ea,{'recursive':!0x0});let _0x2b02f3=_0x55ac48(_0x36a2ea,_0x1a2f17);return await _0x5f3f74(_0x2b02f3,_0x4f86e3,_0x2613f7(0x23d)),_0x2b02f3;}},X=0x7530,ae=0xa00000,oe=0xa,se=new Set([0x12d,0x12e,0x12f,0x133,0x134]);function Z(_0x4613bc){const _0xddbdbf=_0x122181;return new h(_0xddbdbf(0x239),_0xddbdbf(0x20a)+_0x4613bc+'\x20bytes.');}async function ce(_0x34c2b7,_0x98761b){const _0x3d6ce5=_0x122181;let _0x3e4f78=Number(_0x34c2b7['headers'][_0x3d6ce5(0x1c7)](_0x3d6ce5(0x224)));if(Number[_0x3d6ce5(0x23e)](_0x3e4f78)&&_0x3e4f78>_0x98761b)throw Z(_0x98761b);if(_0x34c2b7['body']===null){let _0x477009=await _0x34c2b7['text']();if(Buffer['byteLength'](_0x477009)>_0x98761b)throw Z(_0x98761b);return _0x477009;}let _0x50ba84=_0x34c2b7['body']['getReader'](),_0x5091cd=[],_0x328112=0x0;try{for(;;){let _0x57bc1e=await _0x50ba84[_0x3d6ce5(0x1f8)]();if(_0x57bc1e[_0x3d6ce5(0x1a2)])break;if(_0x328112+=_0x57bc1e[_0x3d6ce5(0x1b3)][_0x3d6ce5(0x1a3)],_0x328112>_0x98761b)throw await _0x50ba84[_0x3d6ce5(0x207)]()[_0x3d6ce5(0x191)](()=>void 0x0),Z(_0x98761b);_0x5091cd[_0x3d6ce5(0x1e4)](_0x57bc1e[_0x3d6ce5(0x1b3)]);}}finally{_0x50ba84[_0x3d6ce5(0x186)]();}try{return new TextDecoder('utf-8',{'fatal':!0x0})[_0x3d6ce5(0x18f)](Buffer[_0x3d6ce5(0x205)](_0x5091cd,_0x328112));}catch{throw new h('resource-download-invalid-utf8',_0x3d6ce5(0x182));}}var Q=class{[_0x122181(0x236)];[_0x122181(0x20b)];[_0x122181(0x1f1)];['maxRedirects'];constructor(_0x3d8433={}){const _0x2d926e=_0x122181;this[_0x2d926e(0x236)]=_0x3d8433['fetch']??fetch,this[_0x2d926e(0x20b)]=_0x3d8433[_0x2d926e(0x20b)]??X,this[_0x2d926e(0x1f1)]=_0x3d8433[_0x2d926e(0x1f1)]??ae,this['maxRedirects']=_0x3d8433['maxRedirects']??oe;}async[_0x122181(0x1d7)](_0x10284a){const _0x235f0e=_0x122181;let _0x3f75b6=new URL(_0x10284a);if(_0x3f75b6[_0x235f0e(0x1fc)]!==_0x235f0e(0x20f))throw new h(_0x235f0e(0x1b6),'Resource\x20URL\x20must\x20use\x20HTTPS.');let _0x451ab1=new AbortController(),_0x4ef3c3=setTimeout(()=>_0x451ab1['abort'](),this[_0x235f0e(0x20b)]);try{let _0x46acf5=_0x3f75b6;for(let _0x34a8ec=0x0;;_0x34a8ec++){let _0x3dd46d=await this[_0x235f0e(0x236)](_0x46acf5,{'redirect':_0x235f0e(0x1f0),'signal':_0x451ab1[_0x235f0e(0x206)]});if(se[_0x235f0e(0x1aa)](_0x3dd46d['status'])){if(_0x34a8ec>=this[_0x235f0e(0x1fb)])throw new h(_0x235f0e(0x231),_0x235f0e(0x1a0)+this[_0x235f0e(0x1fb)]+'.');let _0x16a53a=_0x3dd46d[_0x235f0e(0x1db)][_0x235f0e(0x1c7)](_0x235f0e(0x1dc));if(_0x16a53a===null)throw new h(_0x235f0e(0x1ce),_0x235f0e(0x19b)+_0x3dd46d[_0x235f0e(0x192)]+_0x235f0e(0x1ec));let _0x21c98e;try{_0x21c98e=new URL(_0x16a53a,_0x46acf5);}catch{throw new h('resource-download-invalid-redirect',_0x235f0e(0x233));}if(_0x21c98e[_0x235f0e(0x1fc)]!==_0x235f0e(0x20f))throw new h(_0x235f0e(0x18a),'Resource\x20request\x20redirected\x20to\x20a\x20non-HTTPS\x20URL.');_0x46acf5=_0x21c98e;continue;}if(!_0x3dd46d['ok'])throw new h(_0x235f0e(0x195),_0x235f0e(0x19b)+_0x3dd46d['status']+'.');if(_0x3dd46d[_0x235f0e(0x23c)]!==''&&new URL(_0x3dd46d[_0x235f0e(0x23c)])[_0x235f0e(0x1fc)]!=='https:')throw new h(_0x235f0e(0x18a),_0x235f0e(0x215));let _0x4a630a=await ce(_0x3dd46d,this[_0x235f0e(0x1f1)]);if(!V(_0x4a630a))throw new h(_0x235f0e(0x203),'Resource\x20response\x20is\x20not\x20an\x20SVG\x20document.');return _0x4a630a;}}catch(_0x31ca45){throw _0x451ab1[_0x235f0e(0x206)][_0x235f0e(0x21f)]?new h('resource-download-timeout',_0x235f0e(0x21e)+this['timeoutMs']+_0x235f0e(0x1be)):_0x31ca45;}finally{clearTimeout(_0x4ef3c3);}}};function $(_0x3f391){const _0x2ec21c=_0x122181;try{return JSON[_0x2ec21c(0x21b)](_0x4310a8(_0x3f391,_0x2ec21c(0x23d)));}catch(_0x15719d){throw new h(_0x2ec21c(0x1c8),_0x2ec21c(0x23b)+_0x3f391+':\x20'+(_0x15719d instanceof Error?_0x15719d[_0x2ec21c(0x1cc)]:String(_0x15719d)),void 0x0,{'cause':_0x15719d});}}function le(_0x2b656a){const _0x392ae9=_0x122181;let _0x4cb040;return()=>(_0x4cb040??=W({'manifest':$(_0x2b656a['manifestPath']),'cache':new J(_0x2b656a[_0x392ae9(0x1ed)]),'downloader':new Q(_0x2b656a['downloader']),'output':new Y()}),_0x4cb040);}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
|
+
function _0x2b7f(_0x5ecc42,_0x271a6c){_0x5ecc42=_0x5ecc42-0x1ae;const _0x54fd31=_0x54fd();let _0x2b7f7c=_0x54fd31[_0x5ecc42];return _0x2b7f7c;}const _0x19c91c=_0x2b7f;(function(_0x5abb1a,_0x254e1d){const _0x43f1bd=_0x2b7f,_0x6c601d=_0x5abb1a();while(!![]){try{const _0x461ba4=-parseInt(_0x43f1bd(0x207))/0x1*(parseInt(_0x43f1bd(0x22c))/0x2)+-parseInt(_0x43f1bd(0x237))/0x3+-parseInt(_0x43f1bd(0x20a))/0x4*(parseInt(_0x43f1bd(0x24d))/0x5)+parseInt(_0x43f1bd(0x20c))/0x6+-parseInt(_0x43f1bd(0x1e7))/0x7+-parseInt(_0x43f1bd(0x228))/0x8+parseInt(_0x43f1bd(0x273))/0x9*(parseInt(_0x43f1bd(0x217))/0xa);if(_0x461ba4===_0x254e1d)break;else _0x6c601d['push'](_0x6c601d['shift']());}catch(_0x9b2e43){_0x6c601d['push'](_0x6c601d['shift']());}}}(_0x54fd,0x8292f));function _0x54fd(){const _0x282fa8=['tags','en-US','length','manifest.registrations','body','number','catalog','concat','protocol','.source.value\x20must\x20use\x20HTTPS.','.tagIds','split','byteLength','.resource-','resource','Invalid\x20resource\x20manifest:\x20','\x20must\x20be\x20a\x20non-empty\x20string.','Failed\x20to\x20download\x20\x22','searchText','groups','].input.resources','ResourceLibraryError','get','queries','resource-registry-not-found','.groupId\x20references\x20unknown\x20group\x20\x22','\x20ms.','intrinsicSize','pid','resource-not-found','18424242WeGfiB','join','content-length','tagIds','name','filter','.groupId','].input.groups','isDirectory','\x22\x20is\x20not\x20an\x20SVG\x20document.','resource-invalid-registry-id','Resource\x20request\x20redirected\x20to\x20a\x20non-HTTPS\x20URL.','size','NFKC','Resource\x20search\x20needs\x20at\x20least\x20one\x20non-empty\x20query.','\x20ID\x20\x22','image','maxBytes','string','label','read','find','.payload.colorEditable','resource-export-filename-too-long','options','resource-download-too-many-redirects','registrationIndex','.order','isFile','manual','width','values','resource-cache-root-invalid','aborted','.id','resource-invalid-svg','catch','listRegistries','\x20contains\x20no\x20usable\x20localized\x20text.','Invalid\x20registry\x20ID\x20\x22','Unknown\x20resource\x20registry\x20\x22','getReader','cacheRoot','resource-manifest-invalid','registry','destination','defaultLocale','].label','Unknown\x20resource\x20\x22','isArray','.tagIds\x20references\x20unknown\x20tag\x20\x22','replace','toLowerCase','resourceIndex','].input.registryId','Resource\x20server\x20returned\x20HTTP\x20','.description','.intrinsicSize.width','https:','resource-export-failed','isFinite','.intrinsicSize.height','registries','.keywords','headers','handles','4474799AxvVhv','byteCount','Resource\x20response\x20is\x20not\x20valid\x20UTF-8.','].id','.name','Duplicate\x20registry\x20ID\x20\x22','payload','resources','cache','Invalid\x20resource\x20ID\x20\x22','includes','.tmp','download','some','registrations','height','\x20bytes.','Resource\x20request\x20followed\x20too\x20many\x20redirects;\x20maximum\x20','resource-manifest-read-failed','.intrinsicSize\x20must\x20be\x20positive.','url','map','timeoutMs','\x20without\x20a\x20Location\x20header.','Resource\x20URL\x20must\x20use\x20HTTPS.','location','description','maxRedirects','set','Invalid\x20resource\x20handle\x20\x22','ENOENT','signal','1627BCSsTI','resource-limit-invalid','\x20must\x20be\x20an\x20array.','15536mcphLC','\x20must\x20be\x20an\x20object.','563964IiRwnG','reference','Resource\x20exceeds\x20the\x20maximum\x20size\x20of\x20','Resource\x20server\x20returned\x20an\x20invalid\x20redirect\x20URL.','resource-query-empty','\x20must\x20be\x20a\x20finite\x20number.','fetchImpl','startsWith','.payload','resource-invalid-handle','].input.resources[','20hzDntu','globalIndex','code','registryById','Resource\x20response\x20is\x20not\x20an\x20SVG\x20document.','clear','type','output','Cannot\x20read\x20resource\x20manifest\x20at\x20','registrations\x20must\x20not\x20be\x20empty.','input','colorEditable','clearCache','\x22;\x20try\x20resources\x20find\x20<query>.','message','.source.value\x20must\x20be\x20a\x20URL.','export','3459792VAqXWG','registrations[','slice','Resource\x20cache\x20root\x20must\x20be\x20an\x20absolute,\x20dedicated\x20directory\x20below\x20the\x20filesystem\x20root;\x20received\x20\x22','1036xBetMQ','status','keywords','value','resource-download-too-large','.type\x20must\x20be\x20\x22image\x22.','storagePolicy','endsWith','.source.type\x20must\x20be\x20\x22url\x22.','registryId','\x22:\x20expected\x20an\x20addressable\x20filesystem-safe\x20component\x20without\x20\x22--\x22.','3177666hMdANU','resource-download-insecure-redirect','test','.source','sort','Resource\x20download\x20timed\x20out\x20after\x20','root','.svg','manifest','push','resource-download-invalid-redirect','Resource\x20search\x20limit\x20must\x20be\x20a\x20positive\x20integer;\x20received\x20\x22','downloader','path','text','handle','entries','has','write','utf8','add','order','875sKCojS','].input.tags','manifestPath','resourceCount','groupId','.storagePolicy\x20must\x20be\x20\x22reference\x22.','fetch','resource-download-invalid-svg'];_0x54fd=function(){return _0x282fa8;};return _0x54fd();}import{randomUUID as _0x2f2b18}from'node:crypto';import{mkdir as _0x147b1b,readFile as _0x2f8c48,readdir as _0x1777e5,rename as _0x3a8b8c,rm as _0x54c064,stat as _0x223d32,unlink as _0x2037ed,writeFile as _0x2c7421}from'node:fs/promises';import{dirname as _0x2f664c,isAbsolute as _0x8095c8,join as _0x29feae,parse as _0x4ce26a,resolve as _0x1f582e}from'node:path';import{readFileSync as _0x3422d9}from'node:fs';var h=class extends Error{[_0x19c91c(0x219)];[_0x19c91c(0x246)];constructor(_0x3312ec,_0x7ec013,_0xfc5f90,_0x48a711){const _0x1491f0=_0x19c91c;super(_0x7ec013,_0x48a711),this[_0x1491f0(0x219)]=_0x3312ec,this[_0x1491f0(0x246)]=_0xfc5f90,this[_0x1491f0(0x277)]=_0x1491f0(0x26a);}};function g(_0x2144f0){return _0x2144f0 instanceof h;}var _=/^[A-Za-z0-9._-]+$/u,v=0xff,y=0x4;function b(_0x2c9315){const _0x51ac93=_0x19c91c;return _[_0x51ac93(0x239)](_0x2c9315)&&_0x2c9315!=='.'&&_0x2c9315!=='..';}function x(_0x88aa52){const _0x348cf8=_0x19c91c;if(!b(_0x88aa52)||_0x88aa52[_0x348cf8(0x213)]('-')||_0x88aa52[_0x348cf8(0x1f1)]('--')||_0x88aa52[_0x348cf8(0x257)]>v)throw new h(_0x348cf8(0x1af),_0x348cf8(0x1cc)+_0x88aa52+_0x348cf8(0x236));}function S(_0xa24fff){const _0x1b1d7a=_0x19c91c;if(!b(_0xa24fff)||_0xa24fff[_0x1b1d7a(0x257)]+y>v)throw new h('resource-invalid-resource-id',_0x1b1d7a(0x1f0)+_0xa24fff+'\x22:\x20expected\x20filesystem-safe\x20characters.');}function C(_0x5b9717){const _0x31c88c=_0x19c91c;let _0x4f54c0=_0x5b9717[_0x31c88c(0x260)]('/');if(_0x4f54c0['length']!==0x2||_0x4f54c0[0x0]===''||_0x4f54c0[0x1]==='')throw new h(_0x31c88c(0x215),_0x31c88c(0x204)+_0x5b9717+'\x22;\x20expected\x20<registryId>/<resourceId>.',_0x5b9717);let _0x49c433=_0x4f54c0[0x0],_0x527032=_0x4f54c0[0x1];return x(_0x49c433),S(_0x527032),{'registryId':_0x49c433,'resourceId':_0x527032};}function ee(_0x5b1308,_0x1b2308){return x(_0x5b1308),S(_0x1b2308),_0x5b1308+'/'+_0x1b2308;}function w(_0x540fb2){const _0x547c1e=_0x19c91c;let {registryId:_0x2ef445,resourceId:_0x4090f0}=C(_0x540fb2),_0x57b762=_0x2ef445+'--'+_0x4090f0+_0x547c1e(0x23e);if(_0x57b762[_0x547c1e(0x257)]>v)throw new h(_0x547c1e(0x1bc),'Resource\x20export\x20filename\x20exceeds\x20'+v+_0x547c1e(0x1f7),_0x540fb2);return _0x57b762;}function T(_0x349904){const _0x575688=_0x19c91c;return new h(_0x575688(0x1d0),_0x575688(0x264)+_0x349904);}function E(_0x21944c,_0x2c3a45){const _0x4569eb=_0x19c91c;if(typeof _0x21944c!='object'||!_0x21944c||Array[_0x4569eb(0x1d6)](_0x21944c))throw T(_0x2c3a45+_0x4569eb(0x20b));return _0x21944c;}function D(_0x21dbd7,_0x16e1a5,_0x49a9d1=!0x1){const _0xcde75c=_0x19c91c;if(_0x49a9d1&&_0x21dbd7===void 0x0)return[];if(!Array[_0xcde75c(0x1d6)](_0x21dbd7))throw T(_0x16e1a5+_0xcde75c(0x209));return _0x21dbd7;}function O(_0x4fc67b,_0x270539){const _0x3ba532=_0x19c91c;if(typeof _0x4fc67b!=_0x3ba532(0x1b7)||_0x4fc67b==='')throw T(_0x270539+_0x3ba532(0x265));return _0x4fc67b;}function k(_0x2c961f,_0x1ff26e,_0x53f9f8=!0x1){const _0x23ccee=_0x19c91c;return D(_0x2c961f,_0x1ff26e,_0x53f9f8)[_0x23ccee(0x1fc)]((_0x49159b,_0x284ca9)=>O(_0x49159b,_0x1ff26e+'['+_0x284ca9+']'));}function A(_0x1d5217,_0x299d63){const _0x20e396=_0x19c91c;return D(_0x1d5217,_0x299d63,!0x0)[_0x20e396(0x1fc)]((_0x547d30,_0x260797)=>{if(typeof _0x547d30!='string')throw T(_0x299d63+'['+_0x260797+']\x20must\x20be\x20a\x20string.');return _0x547d30;})[_0x20e396(0x278)](_0x5b4704=>_0x5b4704!=='');}function j(_0x27d851,_0xbed9b){const _0x3be18b=_0x19c91c;if(typeof _0x27d851!=_0x3be18b(0x25a)||!Number[_0x3be18b(0x1e1)](_0x27d851))throw T(_0xbed9b+_0x3be18b(0x211));return _0x27d851;}function M(_0x2f1a41,_0x1fb5b3){if(typeof _0x2f1a41!='boolean')throw T(_0x1fb5b3+'\x20must\x20be\x20a\x20boolean.');return _0x2f1a41;}function N(_0x28e873,_0x57a5de,_0x178f3d){const _0x406d64=_0x19c91c;if(typeof _0x28e873=='string'&&_0x28e873!=='')return _0x28e873;let _0x4987b9=E(_0x28e873,_0x57a5de),_0x3e36b=_0x178f3d===void 0x0?void 0x0:_0x4987b9[_0x178f3d];if(typeof _0x3e36b==_0x406d64(0x1b7)&&_0x3e36b!=='')return _0x3e36b;let _0x2f8d93=_0x4987b9[_0x406d64(0x256)];if(typeof _0x2f8d93==_0x406d64(0x1b7)&&_0x2f8d93!=='')return _0x2f8d93;let _0x33bc6f=Object[_0x406d64(0x1c4)](_0x4987b9)[_0x406d64(0x1ba)](_0x222740=>typeof _0x222740=='string'&&_0x222740!=='');if(_0x33bc6f!==void 0x0)return _0x33bc6f;throw T(_0x57a5de+_0x406d64(0x1cb));}function P(_0x4d4afe,_0x4f9879,_0x431c7b){const _0x40be61=_0x19c91c;try{_0x431c7b===_0x40be61(0x1d1)?x(_0x4d4afe):S(_0x4d4afe);}catch(_0x1b9163){throw T(_0x4f9879+':\x20'+(_0x1b9163 instanceof Error?_0x1b9163[_0x40be61(0x225)]:String(_0x1b9163)));}}function F(_0x5a8434,_0x2e70c2,_0x1fd145){const _0x5cb2c6=_0x19c91c;let _0x389667=new Map();for(let [_0x2c053a,_0x488d24]of D(_0x5a8434,_0x2e70c2,!0x0)[_0x5cb2c6(0x247)]()){let _0x2fe00c=E(_0x488d24,_0x2e70c2+'['+_0x2c053a+']'),_0x4b39ea=O(_0x2fe00c['id'],_0x2e70c2+'['+_0x2c053a+_0x5cb2c6(0x1ea));if(P(_0x4b39ea,_0x2e70c2+'['+_0x2c053a+_0x5cb2c6(0x1ea),'resource'),_0x389667[_0x5cb2c6(0x248)](_0x4b39ea))throw T('Duplicate\x20'+_0x2e70c2+_0x5cb2c6(0x1b4)+_0x4b39ea+'\x22.');_0x389667['set'](_0x4b39ea,N(_0x2fe00c['label'],_0x2e70c2+'['+_0x2c053a+_0x5cb2c6(0x1d4),_0x1fd145));}return _0x389667;}function I(_0x118717,_0x71a2b5){const _0x1eccd6=_0x19c91c;let _0x5abf64=E(_0x118717[_0x1eccd6(0x270)],_0x71a2b5+'.intrinsicSize'),_0x3f1bfd=j(_0x5abf64[_0x1eccd6(0x1c3)],_0x71a2b5+_0x1eccd6(0x1de)),_0x491e6d=j(_0x5abf64[_0x1eccd6(0x1f6)],_0x71a2b5+_0x1eccd6(0x1e2));if(_0x3f1bfd<=0x0||_0x491e6d<=0x0)throw T(_0x71a2b5+_0x1eccd6(0x1fa));return{'width':_0x3f1bfd,'height':_0x491e6d};}function L(_0x599e62,_0x2da2ce){const _0x1ecc23=_0x19c91c;if(_0x599e62[_0x1ecc23(0x21d)]!==_0x1ecc23(0x1b5))throw T(_0x2da2ce+_0x1ecc23(0x231));if(_0x599e62[_0x1ecc23(0x232)]!==_0x1ecc23(0x20d))throw T(_0x2da2ce+_0x1ecc23(0x252));let _0x32b3bc=E(_0x599e62['source'],_0x2da2ce+_0x1ecc23(0x23a));if(_0x32b3bc[_0x1ecc23(0x21d)]!=='url')throw T(_0x2da2ce+_0x1ecc23(0x234));let _0x48e51a=O(_0x32b3bc[_0x1ecc23(0x22f)],_0x2da2ce+'.source.value'),_0x16a766;try{_0x16a766=new URL(_0x48e51a);}catch{throw T(_0x2da2ce+_0x1ecc23(0x226));}if(_0x16a766[_0x1ecc23(0x25d)]!==_0x1ecc23(0x1df))throw T(_0x2da2ce+_0x1ecc23(0x25e));return _0x48e51a;}function R(_0x1a1005){const _0x56fb23=_0x19c91c;return _0x1a1005['normalize'](_0x56fb23(0x1b2))[_0x56fb23(0x1d9)]()['trim']()[_0x56fb23(0x1d8)](/\s+/gu,'\x20');}function z(_0x2b973e){const _0x12911b=_0x19c91c;let _0x4455d0=E(_0x2b973e,_0x12911b(0x23f)),_0x22d1e3=new Map(),_0x284c4e=new Map(),_0x10906c=[],_0x5a6c67=[],_0x23d4e5=new Set(),_0x3dfab2=0x0;for(let [_0x130fa0,_0x515cba]of D(_0x4455d0[_0x12911b(0x1f5)],_0x12911b(0x258))[_0x12911b(0x247)]()){let _0x4f376e=E(E(_0x515cba,_0x12911b(0x229)+_0x130fa0+']')[_0x12911b(0x221)],'registrations['+_0x130fa0+'].input'),_0x183d30=O(_0x4f376e['registryId'],_0x12911b(0x229)+_0x130fa0+_0x12911b(0x1db));if(P(_0x183d30,_0x12911b(0x229)+_0x130fa0+_0x12911b(0x1db),_0x12911b(0x1d1)),_0x22d1e3[_0x12911b(0x248)](_0x183d30))throw T(_0x12911b(0x1ec)+_0x183d30+'\x22.');let _0x6d3087=_0x4f376e[_0x12911b(0x1d3)]===void 0x0?void 0x0:O(_0x4f376e[_0x12911b(0x1d3)],_0x12911b(0x229)+_0x130fa0+'].input.defaultLocale'),_0x1201d5=F(_0x4f376e[_0x12911b(0x268)],_0x12911b(0x229)+_0x130fa0+_0x12911b(0x27a),_0x6d3087),_0x1fe1e3=F(_0x4f376e['tags'],'registrations['+_0x130fa0+_0x12911b(0x24e),_0x6d3087),_0x52176f=[];for(let [_0x5e58c5,_0x29ba2b]of D(_0x4f376e['resources'],_0x12911b(0x229)+_0x130fa0+_0x12911b(0x269))[_0x12911b(0x247)]()){let _0x1d65fe=_0x12911b(0x229)+_0x130fa0+_0x12911b(0x216)+_0x5e58c5+']',_0x569d76=E(_0x29ba2b,_0x1d65fe),_0xa06dee=O(_0x569d76['id'],_0x1d65fe+'.id');P(_0xa06dee,_0x1d65fe+_0x12911b(0x1c7),_0x12911b(0x263));let _0x4bcdba=ee(_0x183d30,_0xa06dee);if(_0x284c4e[_0x12911b(0x248)](_0x4bcdba))throw T('Duplicate\x20resource\x20handle\x20\x22'+_0x4bcdba+'\x22.');let _0x5ab815;try{_0x5ab815=w(_0x4bcdba);}catch(_0x44bd3e){throw T(_0x1d65fe+':\x20'+(_0x44bd3e instanceof Error?_0x44bd3e[_0x12911b(0x225)]:String(_0x44bd3e)));}if(_0x23d4e5[_0x12911b(0x248)](_0x5ab815))throw T('Duplicate\x20export\x20filename\x20\x22'+_0x5ab815+'\x22.');_0x23d4e5[_0x12911b(0x24b)](_0x5ab815);let _0x417848=_0x569d76['groupId']===void 0x0?void 0x0:O(_0x569d76[_0x12911b(0x251)],_0x1d65fe+_0x12911b(0x279));if(_0x417848!==void 0x0&&!_0x1201d5[_0x12911b(0x248)](_0x417848))throw T(_0x1d65fe+_0x12911b(0x26e)+_0x417848+'\x22.');let _0x533cb3=k(_0x569d76[_0x12911b(0x276)],_0x1d65fe+_0x12911b(0x25f),!0x0);for(let _0x3f5f11 of _0x533cb3)if(!_0x1fe1e3[_0x12911b(0x248)](_0x3f5f11))throw T(_0x1d65fe+_0x12911b(0x1d7)+_0x3f5f11+'\x22.');let _0x1513ac=A(_0x569d76['keywords'],_0x1d65fe+_0x12911b(0x1e4)),_0x295c94=N(_0x569d76['name'],_0x1d65fe+_0x12911b(0x1eb),_0x6d3087),_0x3189=_0x569d76[_0x12911b(0x201)]===void 0x0?void 0x0:N(_0x569d76[_0x12911b(0x201)],_0x1d65fe+_0x12911b(0x1dd),_0x6d3087),_0x507a47=_0x417848===void 0x0?null:{'id':_0x417848,'label':_0x1201d5[_0x12911b(0x26b)](_0x417848)},_0x4458f6=_0x533cb3[_0x12911b(0x1fc)](_0x27d830=>({'id':_0x27d830,'label':_0x1fe1e3[_0x12911b(0x26b)](_0x27d830)})),_0x11a277=E(_0x569d76[_0x12911b(0x1ed)],_0x1d65fe+_0x12911b(0x214)),_0x178057=_0x569d76[_0x12911b(0x24c)]===void 0x0?null:j(_0x569d76['order'],_0x1d65fe+_0x12911b(0x1c0)),_0x418530=M(_0x11a277[_0x12911b(0x222)],_0x1d65fe+_0x12911b(0x1bb)),_0x115a12={'handle':_0x4bcdba,'registryId':_0x183d30,'id':_0xa06dee,'name':_0x295c94,..._0x3189===void 0x0?{}:{'description':_0x3189},'group':_0x507a47,'tags':_0x4458f6,'keywords':_0x1513ac,'order':_0x178057,'intrinsicSize':I(_0x11a277,_0x1d65fe+'.payload'),'colorEditable':_0x418530,'sourceUrl':L(_0x11a277,_0x1d65fe+_0x12911b(0x214)),'registrationIndex':_0x130fa0,'resourceIndex':_0x5e58c5,'globalIndex':_0x3dfab2,'searchText':R([_0x295c94,_0x3189,_0x507a47?.[_0x12911b(0x1b8)],..._0x4458f6['map'](_0x1ad7a9=>_0x1ad7a9[_0x12911b(0x1b8)]),..._0x1513ac]['filter'](_0x5d3ad9=>_0x5d3ad9!==void 0x0)[_0x12911b(0x274)]('\x20'))};_0x3dfab2++,_0x52176f['push'](_0x115a12),_0x5a6c67[_0x12911b(0x240)](_0x115a12),_0x284c4e['set'](_0x4bcdba,_0x115a12);}let _0x47660f={'id':_0x183d30,'groups':_0x1201d5,'tags':_0x1fe1e3,'resources':_0x52176f};_0x10906c['push'](_0x47660f),_0x22d1e3[_0x12911b(0x203)](_0x183d30,_0x47660f);}if(_0x10906c[_0x12911b(0x257)]===0x0)throw T(_0x12911b(0x220));return{'registries':_0x10906c,'registryById':_0x22d1e3,'resourceByHandle':_0x284c4e,'resources':_0x5a6c67};}function B(_0x578571,_0x19dcce){const _0x4a0070=_0x19c91c;C(_0x19dcce);let _0x584714=_0x578571['resourceByHandle'][_0x4a0070(0x26b)](_0x19dcce);if(_0x584714===void 0x0)throw new h(_0x4a0070(0x272),_0x4a0070(0x1d5)+_0x19dcce+_0x4a0070(0x224),_0x19dcce);return _0x584714;}function te(_0x50472e){const _0x43c980=_0x19c91c;return _0x50472e[_0x43c980(0x1e3)][_0x43c980(0x1fc)](_0x102c7b=>({'id':_0x102c7b['id'],'resourceCount':_0x102c7b['resources']['length'],'groupCount':_0x102c7b[_0x43c980(0x268)][_0x43c980(0x1b1)],'tagCount':_0x102c7b[_0x43c980(0x255)][_0x43c980(0x1b1)],'colorEditableCount':_0x102c7b[_0x43c980(0x1ee)][_0x43c980(0x278)](_0x5a2490=>_0x5a2490[_0x43c980(0x222)])['length']}));}function ne(_0xc67f93){const _0xb3800a=_0x19c91c;return{'handle':_0xc67f93[_0xb3800a(0x246)],'registryId':_0xc67f93[_0xb3800a(0x235)],'id':_0xc67f93['id'],'name':_0xc67f93[_0xb3800a(0x277)],'group':_0xc67f93['group'],'tags':_0xc67f93[_0xb3800a(0x255)],'keywords':_0xc67f93[_0xb3800a(0x22e)],'order':_0xc67f93['order'],'intrinsicSize':_0xc67f93[_0xb3800a(0x270)],'colorEditable':_0xc67f93[_0xb3800a(0x222)]};}function re(_0x1eb7e1,_0x20085a){const _0x30a735=_0x19c91c;let _0x2f2ec5=(_0x1eb7e1[_0x30a735(0x24c)]??_0x1eb7e1[_0x30a735(0x218)])-(_0x20085a[_0x30a735(0x24c)]??_0x20085a[_0x30a735(0x218)]);if(_0x2f2ec5!==0x0)return _0x2f2ec5;let _0x281922=_0x1eb7e1[_0x30a735(0x1bf)]-_0x20085a['registrationIndex'];if(_0x281922!==0x0)return _0x281922;let _0x128658=_0x1eb7e1[_0x30a735(0x1da)]-_0x20085a[_0x30a735(0x1da)];return _0x128658===0x0?_0x1eb7e1[_0x30a735(0x246)]['localeCompare'](_0x20085a[_0x30a735(0x246)]):_0x128658;}function ie(_0x5e24c0,_0x8e82c4){const _0x5c7ec6=_0x19c91c;let _0x4e0663=_0x8e82c4[_0x5c7ec6(0x26c)][_0x5c7ec6(0x1fc)](R)[_0x5c7ec6(0x278)](_0x30a5c4=>_0x30a5c4!=='');if(_0x4e0663[_0x5c7ec6(0x257)]===0x0)throw new h(_0x5c7ec6(0x210),_0x5c7ec6(0x1b3));let _0x4242e4=new Set(_0x8e82c4['registries']??[]);for(let _0x2ba7e2 of _0x4242e4)if(!_0x5e24c0[_0x5c7ec6(0x21a)][_0x5c7ec6(0x248)](_0x2ba7e2))throw new h(_0x5c7ec6(0x26d),_0x5c7ec6(0x1cd)+_0x2ba7e2+'\x22.');let _0x28dd0f=_0x8e82c4['limit']??_0x5e24c0[_0x5c7ec6(0x1ee)][_0x5c7ec6(0x257)];if(!Number['isInteger'](_0x28dd0f)||_0x28dd0f<0x1)throw new h(_0x5c7ec6(0x208),_0x5c7ec6(0x242)+_0x28dd0f+'\x22.');let _0x5458f8=_0x5e24c0[_0x5c7ec6(0x1ee)][_0x5c7ec6(0x278)](_0x13d7a9=>_0x4242e4['size']===0x0||_0x4242e4[_0x5c7ec6(0x248)](_0x13d7a9[_0x5c7ec6(0x235)]))[_0x5c7ec6(0x278)](_0x575ccc=>_0x4e0663[_0x5c7ec6(0x1f4)](_0x43b9f4=>_0x575ccc[_0x5c7ec6(0x267)][_0x5c7ec6(0x1f1)](_0x43b9f4)))[_0x5c7ec6(0x23b)](re);return{'resources':_0x5458f8[_0x5c7ec6(0x22a)](0x0,_0x28dd0f)['map'](ne),'total':_0x5458f8[_0x5c7ec6(0x257)]};}function V(_0x31855b){return/^\s*(?:<\?xml[^>]*>\s*)?(?:<!--[^]*?-->\s*)*<svg(?:\s|>)/iu['test'](_0x31855b);}function H(_0x283137,_0x40ab9c){const _0x639676=_0x19c91c;return g(_0x40ab9c)?{'handle':_0x283137,'code':_0x40ab9c[_0x639676(0x219)],'message':_0x40ab9c['message']}:{'handle':_0x283137,'code':_0x639676(0x1e0),'message':_0x40ab9c instanceof Error?_0x40ab9c[_0x639676(0x225)]:String(_0x40ab9c)};}var U=class{[_0x19c91c(0x1bd)];[_0x19c91c(0x25b)];constructor(_0x9ece37){const _0x1b52e0=_0x19c91c;this['options']=_0x9ece37,this[_0x1b52e0(0x25b)]=z(_0x9ece37[_0x1b52e0(0x23f)]);}get['cacheLocation'](){const _0x675322=_0x19c91c;return this[_0x675322(0x1bd)]['cache']['location'];}[_0x19c91c(0x1ca)](){const _0x313c4f=_0x19c91c;return te(this[_0x313c4f(0x25b)]);}[_0x19c91c(0x1ba)](_0x1288a1){return ie(this['catalog'],_0x1288a1);}async[_0x19c91c(0x1b9)](_0x1a1f1b){const _0x340764=_0x19c91c;let _0x130c0d=B(this[_0x340764(0x25b)],_0x1a1f1b['handle']),_0x2a3810=await this[_0x340764(0x1bd)][_0x340764(0x1ef)]['read'](_0x1a1f1b[_0x340764(0x246)]);if(_0x2a3810!==void 0x0&&V(_0x2a3810))return{'handle':_0x1a1f1b['handle'],'svg':_0x2a3810};let _0x7acbdc;try{_0x7acbdc=await this[_0x340764(0x1bd)][_0x340764(0x243)][_0x340764(0x1f3)](_0x130c0d['sourceUrl']);}catch(_0x46295d){throw g(_0x46295d)?_0x46295d:new h('resource-download-failed',_0x340764(0x266)+_0x1a1f1b[_0x340764(0x246)]+'\x22:\x20'+(_0x46295d instanceof Error?_0x46295d['message']:String(_0x46295d)),_0x1a1f1b[_0x340764(0x246)],{'cause':_0x46295d});}if(!V(_0x7acbdc))throw new h(_0x340764(0x1c8),'Downloaded\x20resource\x20\x22'+_0x1a1f1b['handle']+_0x340764(0x1ae),_0x1a1f1b[_0x340764(0x246)]);return await this['options'][_0x340764(0x1ef)][_0x340764(0x249)](_0x1a1f1b[_0x340764(0x246)],_0x7acbdc),{'handle':_0x1a1f1b[_0x340764(0x246)],'svg':_0x7acbdc};}async[_0x19c91c(0x227)](_0x11cb35){const _0x4946e0=_0x19c91c;let _0x573117=[],_0x53dbc4=[];for(let _0x4501ac of _0x11cb35[_0x4946e0(0x1e6)])try{let {svg:_0x38f2c0}=await this[_0x4946e0(0x1b9)]({'handle':_0x4501ac}),_0x2235e5=await this[_0x4946e0(0x1bd)][_0x4946e0(0x21e)][_0x4946e0(0x249)](_0x11cb35[_0x4946e0(0x1d2)],w(_0x4501ac),_0x38f2c0);_0x573117[_0x4946e0(0x240)]({'handle':_0x4501ac,'path':_0x2235e5});}catch(_0x32f7e8){_0x53dbc4['push'](H(_0x4501ac,_0x32f7e8));}return{'exported':_0x573117,'failed':_0x53dbc4};}async[_0x19c91c(0x223)](){const _0x2d608e=_0x19c91c;return await this[_0x2d608e(0x1bd)][_0x2d608e(0x1ef)][_0x2d608e(0x21c)]();}};function W(_0x286d2a){return new U(_0x286d2a);}function G(_0x7032ac){return _0x7032ac instanceof Error&&'code'in _0x7032ac;}function K(_0x35016b){const _0x53e10d=_0x19c91c;let _0x424446=_0x1f582e(_0x35016b);if(!_0x8095c8(_0x35016b)||_0x424446===_0x4ce26a(_0x424446)[_0x53e10d(0x23d)])throw new h(_0x53e10d(0x1c5),_0x53e10d(0x22b)+_0x35016b+'\x22.');return _0x424446;}async function q(_0x3c678e){const _0x17e229=_0x19c91c;let _0x27b93d;try{_0x27b93d=await _0x1777e5(_0x3c678e,{'withFileTypes':!0x0});}catch(_0x150a8f){if(G(_0x150a8f)&&_0x150a8f[_0x17e229(0x219)]===_0x17e229(0x205))return{'resourceCount':0x0,'byteCount':0x0};throw _0x150a8f;}let _0x21b2ec=0x0,_0x5ad8d7=0x0;for(let _0x487b35 of _0x27b93d){let _0x2ab7d3=_0x29feae(_0x3c678e,_0x487b35[_0x17e229(0x277)]);if(_0x487b35[_0x17e229(0x27b)]()){let _0x2709d3=await q(_0x2ab7d3);_0x21b2ec+=_0x2709d3[_0x17e229(0x250)],_0x5ad8d7+=_0x2709d3[_0x17e229(0x1e8)];}else{if(_0x487b35[_0x17e229(0x1c1)]()&&_0x487b35[_0x17e229(0x277)][_0x17e229(0x233)](_0x17e229(0x23e))){let _0x59f8f9=await _0x223d32(_0x2ab7d3);_0x21b2ec++,_0x5ad8d7+=_0x59f8f9[_0x17e229(0x1b1)];}}}return{'resourceCount':_0x21b2ec,'byteCount':_0x5ad8d7};}var J=class{[_0x19c91c(0x200)];constructor(_0x33b1bc){const _0x112a08=_0x19c91c;this[_0x112a08(0x200)]=K(_0x33b1bc);}[_0x19c91c(0x244)](_0x56d153){const _0x1a4c28=_0x19c91c;let {registryId:_0x3c9cf2,resourceId:_0x2f84e0}=C(_0x56d153);return _0x29feae(this[_0x1a4c28(0x200)],_0x3c9cf2,_0x2f84e0+_0x1a4c28(0x23e));}async[_0x19c91c(0x1b9)](_0x43e7c4){const _0xbed78c=_0x19c91c;try{return await _0x2f8c48(this['path'](_0x43e7c4),_0xbed78c(0x24a));}catch(_0xe1f71){if(G(_0xe1f71)&&_0xe1f71[_0xbed78c(0x219)]===_0xbed78c(0x205))return;throw _0xe1f71;}}async[_0x19c91c(0x249)](_0x51e7d4,_0x56a884){const _0x131dc8=_0x19c91c;let _0x7534eb=this['path'](_0x51e7d4);await _0x147b1b(_0x2f664c(_0x7534eb),{'recursive':!0x0});let _0x4860d8=_0x29feae(_0x2f664c(_0x7534eb),_0x131dc8(0x262)+process[_0x131dc8(0x271)]+'-'+_0x2f2b18()+_0x131dc8(0x1f2));try{await _0x2c7421(_0x4860d8,_0x56a884,{'encoding':_0x131dc8(0x24a),'mode':0x180}),await _0x3a8b8c(_0x4860d8,_0x7534eb);}catch(_0x5e52a3){throw await _0x2037ed(_0x4860d8)[_0x131dc8(0x1c9)](()=>void 0x0),_0x5e52a3;}}async[_0x19c91c(0x21c)](){const _0x56d12c=_0x19c91c;let _0x86a72f=await q(this[_0x56d12c(0x200)]);return await _0x54c064(this[_0x56d12c(0x200)],{'force':!0x0,'recursive':!0x0}),{'path':this[_0x56d12c(0x200)],..._0x86a72f};}},Y=class{async[_0x19c91c(0x249)](_0x28ac3c,_0x32c4be,_0x4c100d){const _0xf04f5=_0x19c91c;await _0x147b1b(_0x28ac3c,{'recursive':!0x0});let _0x1e53a7=_0x29feae(_0x28ac3c,_0x32c4be);return await _0x2c7421(_0x1e53a7,_0x4c100d,_0xf04f5(0x24a)),_0x1e53a7;}},X=0x7530,ae=0xa00000,oe=0xa,se=new Set([0x12d,0x12e,0x12f,0x133,0x134]);function Z(_0x44b768){const _0x1eaf14=_0x19c91c;return new h(_0x1eaf14(0x230),_0x1eaf14(0x20e)+_0x44b768+_0x1eaf14(0x1f7));}async function ce(_0x1f7f54,_0x3f0eec){const _0x3f3351=_0x19c91c;let _0x5df6ad=Number(_0x1f7f54[_0x3f3351(0x1e5)]['get'](_0x3f3351(0x275)));if(Number[_0x3f3351(0x1e1)](_0x5df6ad)&&_0x5df6ad>_0x3f0eec)throw Z(_0x3f0eec);if(_0x1f7f54['body']===null){let _0x6ea9aa=await _0x1f7f54[_0x3f3351(0x245)]();if(Buffer[_0x3f3351(0x261)](_0x6ea9aa)>_0x3f0eec)throw Z(_0x3f0eec);return _0x6ea9aa;}let _0x31a277=_0x1f7f54[_0x3f3351(0x259)][_0x3f3351(0x1ce)](),_0x11cd20=[],_0x52ffdf=0x0;try{for(;;){let _0x17b6f1=await _0x31a277[_0x3f3351(0x1b9)]();if(_0x17b6f1['done'])break;if(_0x52ffdf+=_0x17b6f1[_0x3f3351(0x22f)][_0x3f3351(0x261)],_0x52ffdf>_0x3f0eec)throw await _0x31a277['cancel']()[_0x3f3351(0x1c9)](()=>void 0x0),Z(_0x3f0eec);_0x11cd20['push'](_0x17b6f1[_0x3f3351(0x22f)]);}}finally{_0x31a277['releaseLock']();}try{return new TextDecoder('utf-8',{'fatal':!0x0})['decode'](Buffer[_0x3f3351(0x25c)](_0x11cd20,_0x52ffdf));}catch{throw new h('resource-download-invalid-utf8',_0x3f3351(0x1e9));}}var Q=class{[_0x19c91c(0x212)];[_0x19c91c(0x1fd)];[_0x19c91c(0x1b6)];['maxRedirects'];constructor(_0x95daa9={}){const _0x501924=_0x19c91c;this['fetchImpl']=_0x95daa9[_0x501924(0x253)]??fetch,this[_0x501924(0x1fd)]=_0x95daa9[_0x501924(0x1fd)]??X,this[_0x501924(0x1b6)]=_0x95daa9[_0x501924(0x1b6)]??ae,this['maxRedirects']=_0x95daa9[_0x501924(0x202)]??oe;}async['download'](_0x129849){const _0x462e29=_0x19c91c;let _0x4803e9=new URL(_0x129849);if(_0x4803e9[_0x462e29(0x25d)]!=='https:')throw new h('resource-download-insecure',_0x462e29(0x1ff));let _0x278c69=new AbortController(),_0x3a41da=setTimeout(()=>_0x278c69['abort'](),this['timeoutMs']);try{let _0x576d5a=_0x4803e9;for(let _0x3a6560=0x0;;_0x3a6560++){let _0xee2293=await this[_0x462e29(0x212)](_0x576d5a,{'redirect':_0x462e29(0x1c2),'signal':_0x278c69[_0x462e29(0x206)]});if(se[_0x462e29(0x248)](_0xee2293[_0x462e29(0x22d)])){if(_0x3a6560>=this[_0x462e29(0x202)])throw new h(_0x462e29(0x1be),_0x462e29(0x1f8)+this[_0x462e29(0x202)]+'.');let _0x5d4c53=_0xee2293['headers']['get'](_0x462e29(0x200));if(_0x5d4c53===null)throw new h(_0x462e29(0x241),_0x462e29(0x1dc)+_0xee2293[_0x462e29(0x22d)]+_0x462e29(0x1fe));let _0x567ffd;try{_0x567ffd=new URL(_0x5d4c53,_0x576d5a);}catch{throw new h(_0x462e29(0x241),_0x462e29(0x20f));}if(_0x567ffd['protocol']!==_0x462e29(0x1df))throw new h(_0x462e29(0x238),'Resource\x20request\x20redirected\x20to\x20a\x20non-HTTPS\x20URL.');_0x576d5a=_0x567ffd;continue;}if(!_0xee2293['ok'])throw new h('resource-download-http','Resource\x20server\x20returned\x20HTTP\x20'+_0xee2293['status']+'.');if(_0xee2293[_0x462e29(0x1fb)]!==''&&new URL(_0xee2293[_0x462e29(0x1fb)])[_0x462e29(0x25d)]!==_0x462e29(0x1df))throw new h(_0x462e29(0x238),_0x462e29(0x1b0));let _0x38061f=await ce(_0xee2293,this[_0x462e29(0x1b6)]);if(!V(_0x38061f))throw new h(_0x462e29(0x254),_0x462e29(0x21b));return _0x38061f;}}catch(_0x1697a1){throw _0x278c69[_0x462e29(0x206)][_0x462e29(0x1c6)]?new h('resource-download-timeout',_0x462e29(0x23c)+this[_0x462e29(0x1fd)]+_0x462e29(0x26f)):_0x1697a1;}finally{clearTimeout(_0x3a41da);}}};function $(_0x19498){const _0x24587e=_0x19c91c;try{return JSON['parse'](_0x3422d9(_0x19498,_0x24587e(0x24a)));}catch(_0x79b721){throw new h(_0x24587e(0x1f9),_0x24587e(0x21f)+_0x19498+':\x20'+(_0x79b721 instanceof Error?_0x79b721[_0x24587e(0x225)]:String(_0x79b721)),void 0x0,{'cause':_0x79b721});}}function le(_0x38563d){const _0x260b34=_0x19c91c;let _0xcf51c;return()=>(_0xcf51c??=W({'manifest':$(_0x38563d[_0x260b34(0x24f)]),'cache':new J(_0x38563d[_0x260b34(0x1cf)]),'downloader':new Q(_0x38563d[_0x260b34(0x243)]),'output':new Y()}),_0xcf51c);}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};
|