@signalk/freeboard-sk 2.24.0 → 2.24.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/assets/icons/icon-192x192.png +0 -0
  3. package/docs/screenshots/1_freeboard-sk.png +0 -0
  4. package/docs/screenshots/README.md +31 -0
  5. package/package.json +26 -7
  6. package/public/3rdpartylicenses.txt +9 -361
  7. package/public/chunk-2AF4T5IB.js +1 -0
  8. package/public/chunk-346FAZUS.js +1 -0
  9. package/public/{chunk-BTVNOQ7K.js → chunk-3GHIRJ3C.js} +2 -2
  10. package/public/chunk-4SHFYAXK.js +1 -0
  11. package/public/{chunk-2LV2AYBP.js → chunk-64QDJX7X.js} +1 -1
  12. package/public/chunk-A4TULHTL.js +1 -0
  13. package/public/chunk-AEB5DG3B.js +1 -0
  14. package/public/chunk-AFVK3UQJ.js +5482 -0
  15. package/public/chunk-AX3UMUXB.js +1 -0
  16. package/public/{chunk-TLBNKF2R.js → chunk-EFVTFEXB.js} +1 -1
  17. package/public/chunk-FALIRPMH.js +1035 -0
  18. package/public/{chunk-A7QJNGJ7.js → chunk-FEIJMPL7.js} +2 -2
  19. package/public/chunk-G4GM24WE.js +1 -0
  20. package/public/{chunk-DPEXDGKO.js → chunk-GQXHMDKV.js} +1 -1
  21. package/public/chunk-KFWFMRV7.js +1 -0
  22. package/public/chunk-LXUTMJYP.js +1145 -0
  23. package/public/chunk-NTIQMWPW.js +2718 -0
  24. package/public/chunk-QIOZNURQ.js +1 -0
  25. package/public/chunk-RWJHAOI2.js +1 -0
  26. package/public/chunk-SBFXQ3G7.js +1 -0
  27. package/public/chunk-TAJAMNLU.js +1 -0
  28. package/public/chunk-UEUVGTXJ.js +1 -0
  29. package/public/{chunk-WUXY5N7A.js → chunk-WA2ENVQZ.js} +1 -1
  30. package/public/index.html +2 -2
  31. package/public/main-AZEF35BN.js +466 -0
  32. package/public/polyfills-RV3JTMEC.js +2 -0
  33. package/public/styles-FMJMFQ5P.css +1 -0
  34. package/public/worker-AUTVLQL7.js +3 -0
  35. package/public/worker-FRXPLBUO.js +12 -0
  36. package/public/worker-T4RJR7DG.js +12 -0
  37. package/public/worker-Y35X2QU7.js +26 -0
  38. package/public/chunk-3MOH2GUU.js +0 -1
  39. package/public/chunk-3ZBG3EOD.js +0 -1
  40. package/public/chunk-4SN3Q6K3.js +0 -1
  41. package/public/chunk-5KDMJ54F.js +0 -1
  42. package/public/chunk-67IVDHNW.js +0 -1
  43. package/public/chunk-AZK5ODAA.js +0 -1
  44. package/public/chunk-GMWUHE7S.js +0 -131
  45. package/public/chunk-GQRIAFM6.js +0 -1
  46. package/public/chunk-HQSHA6SH.js +0 -13
  47. package/public/chunk-LXWUCH7T.js +0 -1
  48. package/public/chunk-QPQHN5VS.js +0 -22
  49. package/public/chunk-RBFFWNLA.js +0 -1
  50. package/public/chunk-TQPGRJVE.js +0 -19
  51. package/public/chunk-V3DD3MHN.js +0 -1
  52. package/public/chunk-Y6FV7FIU.js +0 -1
  53. package/public/chunk-YPACWLLV.js +0 -1
  54. package/public/chunk-YUTPR5Z4.js +0 -1
  55. package/public/main-SF5NH7GR.js +0 -11
  56. package/public/polyfills-5CFQRCPP.js +0 -2
  57. package/public/styles-N7HVRSAT.css +0 -1
  58. package/public/worker-42LKK6ER.js +0 -26
  59. package/public/worker-FPJG6QKK.js +0 -5
  60. package/public/worker-UZNU4LIJ.js +0 -12
  61. package/public/worker-WYOFLVNH.js +0 -12
@@ -1,2 +1,2 @@
1
- import{a as re}from"./chunk-A7QJNGJ7.js";import{E as se,H as le,b as $,c as A,m as H,n as j,o as N,p as Y,q as Z,r as ee,s as te,t as ie,u as ne,v as ae,y as oe}from"./chunk-GMWUHE7S.js";import{i as U,j as z,k as q}from"./chunk-TQPGRJVE.js";import{e as B}from"./chunk-HQSHA6SH.js";import{Aa as f,Ba as x,Da as b,Ea as T,Ed as V,Fa as v,Ga as h,Gd as O,Ha as a,Ia as o,Ja as y,Jd as W,L as C,Ld as F,M as d,Md as K,N as m,Qa as u,Sa as _,Ua as p,cb as w,ce as L,fa as l,hb as r,ib as P,jb as M,ka as S,kb as D,na as I,ne as J,rd as E,sd as R,se as Q,vd as G,xd as X}from"./chunk-QPQHN5VS.js";import{f as k}from"./chunk-EQVTEUXC.js";function ce(s,t){if(s&1){let e=u();a(0,"button",11),_("click",function(){d(e);let i=p();return m(i.load())}),a(1,"mat-icon"),r(2,"file_upload"),o(),r(3," \xA0Load "),o()}if(s&2){let e=p();h("disabled",!e.display.loadRoutesOK&&!e.display.loadWaypointsOK&&!e.display.loadTracksOK)}}function de(s,t){s&1&&(a(0,"div",10)(1,"div")(2,"b"),r(3,"Invalid GPX Data:"),o(),y(4,"br")(5,"br"),a(6,"i"),r(7,"Selected file does not contain GPX data or"),y(8,"br"),r(9," does not correctly implement namespaced <extensions> attributes."),o()()())}function me(s,t){s&1&&y(0,"mat-progress-bar",12)}function he(s,t){if(s&1){let e=u();a(0,"div",23)(1,"div",24),r(2),o(),a(3,"div",25)(4,"mat-checkbox",26,0),_("change",function(){let i=d(e).$index,c=w(5),g=p(4);return m(g.checkWpt(c.checked,i))}),o()()()}if(s&2){let e=t.$implicit,n=t.$index,i=p(4);l(2),P(e.name),l(2),h("checked",i.selWaypoints[n])}}function _e(s,t){if(s&1){let e=u();a(0,"div",13)(1,"mat-expansion-panel",16),_("opened",function(){d(e);let i=p(3);return m(i.display.expand.waypoints=!0)})("closed",function(){d(e);let i=p(3);return m(i.display.expand.waypoints=!1)}),a(2,"mat-expansion-panel-header",17)(3,"mat-panel-title")(4,"mat-icon",18),r(5,"place"),o(),r(6," \xA0\xA0 "),a(7,"b"),r(8,"Waypoints:"),o()(),a(9,"mat-panel-description")(10,"div",5)(11,"span",19),r(12),o(),a(13,"span",20)(14,"mat-checkbox",21),_("change",function(i){d(e);let c=p(3);return m(c.checkWpt(i.checked,-1))})("click",function(i){return d(e),m(i.cancelBubble=!0)}),o()()()()(),a(15,"div",22),T(16,he,6,2,"div",23,b),o()()()}if(s&2){let e=p(3);l(),h("expanded",e.display.expand.waypoints),l(11),D(" (",e.display.selCount.waypoints," of ",e.gpxData==null?null:e.gpxData.waypoints.length,") "),l(2),h("indeterminate",e.display.someWptChecked)("checked",e.display.allWaypointsChecked)("disabled",e.gpxData.waypoints.length===0),l(2),v(e.gpxData.waypoints)}}function ue(s,t){if(s&1){let e=u();a(0,"div",23)(1,"div",24),r(2),o(),a(3,"div",25)(4,"mat-checkbox",29,1),_("change",function(){let i=d(e).$index,c=w(5),g=p(4);return m(g.checkRte(c.checked,i))}),o()()()}if(s&2){let e=t.$implicit,n=t.$index,i=p(4);l(2),P(e.name),l(2),h("checked",i.selRoutes[n])}}function fe(s,t){if(s&1){let e=u();a(0,"div",13)(1,"mat-expansion-panel",16),_("opened",function(){d(e);let i=p(3);return m(i.display.expand.routes=!0)})("closed",function(){d(e);let i=p(3);return m(i.display.expand.routes=!1)}),a(2,"mat-expansion-panel-header",17)(3,"mat-panel-title")(4,"mat-icon",27),r(5,"directions"),o(),r(6," \xA0\xA0 "),a(7,"b"),r(8,"Routes:"),o()(),a(9,"mat-panel-description")(10,"div",5)(11,"span",19),r(12),o(),a(13,"span",20)(14,"mat-checkbox",28),_("change",function(i){d(e);let c=p(3);return m(c.checkRte(i.checked,-1))})("click",function(i){return d(e),m(i.cancelBubble=!0)}),o()()()()(),a(15,"div",22),T(16,ue,6,2,"div",23,b),o()()()}if(s&2){let e=p(3);l(),h("expanded",e.display.expand.routes),l(11),D(" (",e.display.selCount.routes," of ",e.gpxData==null?null:e.gpxData.routes.length,") "),l(2),h("indeterminate",e.display.someRteChecked)("checked",e.display.allRoutesChecked)("disabled",e.gpxData.routes.length==0),l(2),v(e.gpxData.routes)}}function xe(s,t){if(s&1){let e=u();a(0,"div",23)(1,"div",24),r(2),o(),a(3,"div",25)(4,"mat-checkbox",32,2),_("change",function(){let i=d(e).$index,c=w(5),g=p(4);return m(g.checkTrk(c.checked,i))}),o()()()}if(s&2){let e=t.$implicit,n=t.$index,i=p(4);l(2),P(e.name),l(2),h("checked",i.selTracks[n])}}function ge(s,t){if(s&1){let e=u();a(0,"div",13)(1,"mat-expansion-panel",16),_("opened",function(){d(e);let i=p(3);return m(i.display.expand.tracks=!0)})("closed",function(){d(e);let i=p(3);return m(i.display.expand.tracks=!1)}),a(2,"mat-expansion-panel-header",17)(3,"mat-panel-title")(4,"mat-icon",30),r(5,"show_chart"),o(),r(6," \xA0\xA0 "),a(7,"b"),r(8,"Tracks:"),o()(),a(9,"mat-panel-description")(10,"div",5)(11,"span",19),r(12),o(),a(13,"span",20)(14,"mat-checkbox",31),_("change",function(i){d(e);let c=p(3);return m(c.checkTrk(i.checked,-1))})("click",function(i){return d(e),m(i.cancelBubble=!0)}),o()()()()(),a(15,"div",22),T(16,xe,6,2,"div",23,b),o()()()}if(s&2){let e=p(3);l(),h("expanded",e.display.expand.tracks),l(11),D(" (",e.display.selCount.tracks," of ",e.gpxData==null?null:e.gpxData.tracks.length,") "),l(2),h("indeterminate",e.display.someTrkChecked)("checked",e.display.allTracksChecked)("disabled",e.gpxData.tracks.length==0),l(2),v(e.gpxData.tracks)}}function Ce(s,t){if(s&1&&(a(0,"div",13)(1,"div",14)(2,"div"),r(3,"File:"),o(),a(4,"div",15),r(5),o()(),y(6,"mat-divider"),o(),f(7,_e,18,6,"div",13),f(8,fe,18,6,"div",13),f(9,ge,18,6,"div",13)),s&2){let e=p(2);l(5),M(" ",e.data.fileName," "),l(2),x(e.gpxData.waypoints.length!=0?7:-1),l(),x(e.gpxData.routes.length!=0?8:-1),l(),x(e.gpxData.tracks.length!=0&&e.app.featureFlags().resourceTracks?9:-1)}}function ye(s,t){if(s&1&&(a(0,"div",10),f(1,me,1,0,"mat-progress-bar",12)(2,Ce,10,4),o()),s&2){let e=p();l(),x(e.app.sIsFetching()?1:2)}}var pe=class s{constructor(t){this.data=t}gpxData={name:"",routes:[],waypoints:[],tracks:[]};selRoutes=[];selectedRoute=null;selWaypoints=[];selTracks=[];display={notValid:!1,allRoutesChecked:!1,allWaypointsChecked:!1,allTracksChecked:!1,someWptChecked:!1,someRteChecked:!1,someTrkChecked:!1,loadRoutesOK:!1,loadWaypointsOK:!1,loadTracksOK:!1,routeViewer:!1,selCount:{routes:0,waypoints:0,tracks:0},expand:{routes:!1,waypoints:!1,tracks:!1}};errorCount=0;subCount=0;gpx;app=C(se);dialogRef=C(E);skres=C(le);signalk=C(oe);ngOnInit(){this.data.fileData=this.data.fileData||null,this.parseGPXData(this.data.fileData)}ngOnDestroy(){this.clear()}load(){this.uploadToServer({rte:{selected:this.selRoutes},wpt:{selected:this.selWaypoints},trk:{selected:this.selTracks}})}parseGPXData(t){return k(this,null,function*(){if(this.display.allRoutesChecked=!1,this.display.loadRoutesOK=!1,this.selRoutes=[],this.display.allWaypointsChecked=!1,this.display.loadWaypointsOK=!1,this.selWaypoints=[],this.display.allTracksChecked=!1,this.display.loadTracksOK=!1,this.selTracks=[],this.display.selCount={routes:0,waypoints:0,tracks:0},this.display.expand={routes:!1,waypoints:!1,tracks:!1},this.display.notValid=!1,this.gpxData=yield this.parseFileData(t),!this.gpxData){console.warn(`Selected file does not contain GPX data or
2
- does not correctly implement namespaced <extensions> attributes`,"Invalid GPX Data:"),this.display.notValid=!0;return}this.gpxData.routes.forEach(()=>{this.selRoutes.push(!1)}),this.selRoutes.length===1&&(this.selRoutes[0]=!0,this.display.allRoutesChecked=!0,this.display.expand.routes=!0,this.display.loadRoutesOK=!0,this.display.selCount.routes=1),this.gpxData.waypoints.forEach(()=>{this.selWaypoints.push(!1)}),this.selWaypoints.length===1&&(this.selWaypoints[0]=!0,this.display.allWaypointsChecked=!0,this.display.expand.waypoints=!0,this.display.loadWaypointsOK=!0,this.display.selCount.waypoints=1),this.gpxData.tracks.forEach(()=>{this.selTracks.push(!1)}),this.selTracks.length===1&&(this.selTracks[0]=!0,this.display.allTracksChecked=!0,this.display.expand.tracks=!0,this.display.loadTracksOK=!0,this.display.selCount.tracks=1)})}checkRte(t,e=-1){let n=0;if(e!==-1){this.selRoutes[e]=t,this.display.loadRoutesOK=t;for(let i of this.selRoutes)i&&n++;this.display.loadRoutesOK=n!==0,this.display.selCount.routes=n,this.display.allRoutesChecked=n===this.selRoutes.length}else{for(let i=0;i<this.selRoutes.length;i++)this.selRoutes[i]=t,this.display.loadRoutesOK=t,this.display.allRoutesChecked=t;this.display.selCount.routes=t?this.selRoutes.length:0}this.display.someRteChecked=!(this.display.allRoutesChecked||n===0)}checkWpt(t,e=-1){let n=0;if(e!==-1){this.selWaypoints[e]=t,this.display.loadWaypointsOK=t;for(let i of this.selWaypoints)i&&n++;this.display.loadWaypointsOK=n!==0,this.display.selCount.waypoints=n,this.display.allWaypointsChecked=n===this.selWaypoints.length}else{for(let i=0;i<this.selWaypoints.length;i++)this.selWaypoints[i]=t,this.display.loadWaypointsOK=t,this.display.allWaypointsChecked=t;this.display.selCount.waypoints=t?this.selWaypoints.length:0}this.display.someWptChecked=!(this.display.allWaypointsChecked||n===0)}checkTrk(t,e=-1){let n=0;if(e!==-1){this.selTracks[e]=t,this.display.loadTracksOK=t;for(let i of this.selTracks)i&&n++;this.display.loadTracksOK=n!==0,this.display.selCount.tracks=n,this.display.allTracksChecked=n===this.selTracks.length}else{for(let i=0;i<this.selTracks.length;i++)this.selTracks[i]=t,this.display.loadTracksOK=t,this.display.allTracksChecked=t;this.display.selCount.tracks=t?this.selTracks.length:0}this.display.someTrkChecked=!(this.display.allTracksChecked||n===0)}clear(){this.gpx=null}parseFileData(t){return k(this,null,function*(){let e={name:"",routes:[],waypoints:[],tracks:[]};if(this.gpx=new re,this.app.sIsFetching.set(!0),!(yield this.gpx.parse(t)))return this.app.sIsFetching.set(!1),null;let n=1;return this.gpx.rte.forEach(i=>{e.routes.push({name:i.name!==""?i.name:`Rte: ${n}`,description:i.desc?i.desc:i.cmt?i.cmt:"",wptcount:i.rtept.length}),n++}),n=1,this.gpx.wpt.forEach(i=>{e.waypoints.push({name:i.name?i.name:`Wpt: ${n}`,description:i.desc?i.desc:i.cmt?i.cmt:""}),n++}),n=1,this.gpx.trk.forEach(i=>{e.tracks.push({name:i.name?i.name:`Trk: ${n}`,description:i.desc?i.desc:i.cmt?i.cmt:""}),n++}),this.app.sIsFetching.set(!1),e})}uploadToServer(t){return k(this,null,function*(){this.app.sIsFetching.set(!0),this.errorCount=0,this.subCount=0;for(let n=0;n<t.rte.selected.length;n++)t.rte.selected[n]&&this.transformRoute(this.gpx.rte[n]);for(let n=0;n<t.wpt.selected.length;n++)t.wpt.selected[n]&&this.transformWaypoint(this.gpx.wpt[n]);let e=[];for(let n=0;n<t.trk.selected.length;n++)if(t.trk.selected[n]){let i=this.transformTrack(this.gpx.trk[n]);this.subCount++;try{let c=yield this.skres.postToServer("tracks",i);this.subCount--,Math.floor(c.statusCode/100)===2?(e.push(c.id),this.app.debug("SUCCESS: Track added.")):this.errorCount++,this.checkComplete()}catch(c){this.errorCount++,this.subCount--,this.logError(c),this.checkComplete()}}e.length!==0&&this.skres.trackAddFromServer(e)})}errorList=[];logError(t){let e=t.error?t.error.message:t.message;this.errorList.push({status:t.status,message:e})}checkComplete(){this.subCount===0&&(this.app.sIsFetching.set(!1),this.app.saveConfig(),this.dialogRef.close({errCount:this.errorCount,errList:this.errorList}),this.app.debug(`GPXLoad: complete: ${this.errorCount}`))}transformRoute(t){let e=this.skres.buildRoute(t.rtept.map(i=>[i.lon,i.lat])),n=e[1];n.name=t.name??"",n.description=t.desc??"",t.cmt&&(n.feature.properties.cmt=t.cmt),t.src&&(n.feature.properties.src=t.src),t.number&&(n.feature.properties.number=t.number),t.type&&(n.feature.properties.type=t.type),n.feature.properties.coordinatesMeta=[],n.feature.properties.coordinatesMeta=t.rtept.map(i=>{let c={name:i.name??""};return i.cmt&&(c.description=i.cmt),c}),this.subCount++,this.signalk.api.put(this.app.skApiVersion,`/resources/routes/${e[0]}`,e[1]).subscribe(i=>{this.subCount--,Math.floor(i.statusCode/100)===2?(this.app.debug("SUCCESS: Route added."),this.app.config.selections.routes.push(e[0])):this.errorCount++,this.checkComplete()},i=>{this.errorCount++,this.subCount--,this.logError(i),this.checkComplete()})}transformWaypoint(t){let e=this.skres.buildWaypoint([t.lon,t.lat]),n=e[1];t.ele&&n.feature.geometry.coordinates.push(t.ele),t.name&&t.name.length!==0&&(n.name=t.name),t.desc&&t.desc.length!==0&&(n.description=t.desc),t.type&&(n.type=t.type),t.cmt&&(n.feature.properties.cmt=t.cmt),t.src&&(n.feature.properties.src=t.src),t.sym&&(n.feature.properties.sym=t.sym),this.subCount++,this.signalk.api.put(this.app.skApiVersion,`/resources/waypoints/${e[0]}`,e[1]).subscribe(i=>{this.subCount--,Math.floor(i.statusCode/100)===2?(this.app.debug("SUCCESS: Waypoint added."),this.app.config.selections.waypoints.push(e[0])):this.errorCount++,this.checkComplete()},i=>{this.errorCount++,this.subCount--,this.logError(i),this.checkComplete()})}transformTrack(t){let e={feature:{type:"Feature",geometry:{type:"MultiLineString",coordinates:[]},properties:{},id:""}};return t.trkseg&&t.trkseg.forEach(n=>{let i=[];n.trkpt.forEach(c=>{i.push([c.lon,c.lat])}),e.feature.geometry.coordinates.push(i)}),t.name&&t.name.length!==0?e.feature.properties.name=t.name:e.feature.properties.name=`gpxtrk #${Math.random().toString().slice(-5)}`,t.desc&&t.desc.length!==0&&(e.feature.properties.description=t.desc),t.cmt&&(e.feature.properties.cmt=t.cmt),t.src&&(e.feature.properties.src=t.src),t.type&&(e.feature.properties.type=t.type),e}static \u0275fac=function(e){return new(e||s)(S(R))};static \u0275cmp=I({type:s,selectors:[["gpxload-dialog"]],decls:13,vars:3,consts:[["wval",""],["rval",""],["tval",""],[1,"gpxload-dialog"],[2,"background-color","transparent"],[2,"display","flex","width","100%"],["mat-raised-button","","matTooltip","Load selected resources","matTooltipPosition","right",2,"width","85px",3,"disabled"],[2,"flex","1 1 auto","text-align","center"],[2,"text-align","right"],["mat-icon-button","",3,"click","disabled"],["mat-dialog-content",""],["mat-raised-button","","matTooltip","Load selected resources","matTooltipPosition","right",2,"width","85px",3,"click","disabled"],["mode","indeterminate"],[1,"card-group"],[2,"display","flex"],[2,"flex","1 1 auto","padding-left","10px","overflow","hidden","display","-webkit-box","-webkit-box-orient","vertical","-webkit-line-clamp","1","line-clamp","1","text-overflow","ellipsis"],[3,"opened","closed","expanded"],[2,"padding","0 12px"],[1,"icon-waypoint"],[1,"pnlSelectedItems"],[1,"pnlSelect"],["matTooltip","Select all Waypoints","matTooltipPosition","before",3,"change","click","indeterminate","checked","disabled"],[1,"list-container-scrollable"],[1,"item-row"],[1,"name"],[1,"check"],["matTooltip","Select Waypoint","matTooltipPosition","below",3,"change","checked"],[1,"icon-route"],["matTooltip","Select all Routes","matTooltipPosition","before",3,"change","click","indeterminate","checked","disabled"],["matTooltip","Select this Route","matTooltipPosition","below",3,"change","checked"],[1,"icon-track"],["matTooltip","Select all Tracks","matTooltipPosition","before",3,"change","click","indeterminate","checked","disabled"],["matTooltip","Select this Track","matTooltipPosition","below",3,"change","checked"]],template:function(e,n){e&1&&(a(0,"div",3)(1,"mat-toolbar",4)(2,"div",5)(3,"div"),f(4,ce,4,1,"button",6),o(),a(5,"div",7),r(6,"Import GPX"),o(),a(7,"div",8)(8,"button",9),_("click",function(){return n.dialogRef.close(-1)}),a(9,"mat-icon"),r(10,"close"),o()()()()(),f(11,de,10,0,"div",10)(12,ye,3,1,"div",10),o()),e&2&&(l(4),x(n.app.sIsFetching()?-1:4),l(4),h("disabled",n.app.sIsFetching()),l(3),x(n.display.notValid?11:12))},dependencies:[ae,ne,N,j,X,G,K,F,W,O,V,U,J,Q,A,$,ie,Y,Z,te,ee,q,z,H,B,L],styles:[".gpxload-dialog[_ngcontent-%COMP%]{font-family:roboto;position:relative}.mat-expansion-panel-body[_ngcontent-%COMP%]{padding:0 12px 6px}.card-group-title[_ngcontent-%COMP%]{font-weight:700;font-size:10pt;font-family:Arial,Helvetica,sans-serif;padding:10px 0}.item-row[_ngcontent-%COMP%]{display:flex;width:100%;padding:2px 0}.item-row[_ngcontent-%COMP%] .name[_ngcontent-%COMP%]{flex:1 1 auto;overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;text-overflow:ellipsis;line-height:2.5em}.item-row[_ngcontent-%COMP%] .check[_ngcontent-%COMP%]{text-align:right;padding-right:15px}.pnlSelectedItems[_ngcontent-%COMP%]{display:none;line-height:2.9em}.pnlSelect[_ngcontent-%COMP%]{flex:1 1 auto;padding-left:3px;padding-right:3px;text-align:right}.txtSelect[_ngcontent-%COMP%]{display:none}button[_ngcontent-%COMP%]{min-width:unset;padding:unset}@media only screen and (min-width:400px){.pnlSelectedItems[_ngcontent-%COMP%]{display:inline}}@media only screen and (min-width:475px){.pnlSelectedItems[_ngcontent-%COMP%]{display:inline;line-height:2.9em}.txtSelect[_ngcontent-%COMP%]{display:inline}.pnlSelect[_ngcontent-%COMP%]{flex:1 1 auto;padding-left:20px;padding-right:15px;text-align:right}button[_ngcontent-%COMP%]{min-width:inherit;padding:inherit}}"]})};export{pe as GPXImportDialog};
1
+ import{a as re}from"./chunk-FEIJMPL7.js";import{E as se,H as le,b as A,c as L,m as H,n as j,o as N,p as Y,q as Z,r as ee,s as te,t as ie,u as ne,v as ae,y as oe}from"./chunk-AFVK3UQJ.js";import{i as U,j as z,k as q}from"./chunk-LXUTMJYP.js";import{e as B}from"./chunk-FALIRPMH.js";import{Aa as x,Ca as b,Da as T,Ea as v,Fa as u,Fd as O,Ga as a,Ha as o,Hd as W,Ia as y,K as C,Kd as V,L as d,M as m,Md as F,Nd as K,Pa as _,Ra as h,Ta as p,bb as w,de as $,ea as l,gb as r,hb as P,ib as M,ja as S,jb as D,ma as I,oe as J,sd as E,td as R,te as Q,wd as G,yd as X,za as f}from"./chunk-NTIQMWPW.js";import{f as k}from"./chunk-EQVTEUXC.js";function ce(s,t){if(s&1){let e=_();a(0,"button",11),h("click",function(){d(e);let i=p();return m(i.load())}),a(1,"mat-icon"),r(2,"file_upload"),o(),r(3," \xA0Load "),o()}if(s&2){let e=p();u("disabled",!e.display.loadRoutesOK&&!e.display.loadWaypointsOK&&!e.display.loadTracksOK)}}function de(s,t){s&1&&(a(0,"div",10)(1,"div")(2,"b"),r(3,"Invalid GPX Data:"),o(),y(4,"br")(5,"br"),a(6,"i"),r(7,"Selected file does not contain GPX data or"),y(8,"br"),r(9," does not correctly implement namespaced <extensions> attributes."),o()()())}function me(s,t){s&1&&y(0,"mat-progress-bar",12)}function ue(s,t){if(s&1){let e=_();a(0,"div",23)(1,"div",24),r(2),o(),a(3,"div",25)(4,"mat-checkbox",26,0),h("change",function(){let i=d(e).$index,c=w(5),g=p(4);return m(g.checkWpt(c.checked,i))}),o()()()}if(s&2){let e=t.$implicit,n=t.$index,i=p(4);l(2),P(e.name),l(2),u("checked",i.selWaypoints[n])}}function he(s,t){if(s&1){let e=_();a(0,"div",13)(1,"mat-expansion-panel",16),h("opened",function(){d(e);let i=p(3);return m(i.display.expand.waypoints=!0)})("closed",function(){d(e);let i=p(3);return m(i.display.expand.waypoints=!1)}),a(2,"mat-expansion-panel-header",17)(3,"mat-panel-title")(4,"mat-icon",18),r(5,"place"),o(),r(6," \xA0\xA0 "),a(7,"b"),r(8,"Waypoints:"),o()(),a(9,"mat-panel-description")(10,"div",5)(11,"span",19),r(12),o(),a(13,"span",20)(14,"mat-checkbox",21),h("change",function(i){d(e);let c=p(3);return m(c.checkWpt(i.checked,-1))})("click",function(i){return i.cancelBubble=!0}),o()()()()(),a(15,"div",22),T(16,ue,6,2,"div",23,b),o()()()}if(s&2){let e=p(3);l(),u("expanded",e.display.expand.waypoints),l(11),D(" (",e.display.selCount.waypoints," of ",e.gpxData==null?null:e.gpxData.waypoints.length,") "),l(2),u("indeterminate",e.display.someWptChecked)("checked",e.display.allWaypointsChecked)("disabled",e.gpxData.waypoints.length===0),l(2),v(e.gpxData.waypoints)}}function _e(s,t){if(s&1){let e=_();a(0,"div",23)(1,"div",24),r(2),o(),a(3,"div",25)(4,"mat-checkbox",29,1),h("change",function(){let i=d(e).$index,c=w(5),g=p(4);return m(g.checkRte(c.checked,i))}),o()()()}if(s&2){let e=t.$implicit,n=t.$index,i=p(4);l(2),P(e.name),l(2),u("checked",i.selRoutes[n])}}function fe(s,t){if(s&1){let e=_();a(0,"div",13)(1,"mat-expansion-panel",16),h("opened",function(){d(e);let i=p(3);return m(i.display.expand.routes=!0)})("closed",function(){d(e);let i=p(3);return m(i.display.expand.routes=!1)}),a(2,"mat-expansion-panel-header",17)(3,"mat-panel-title")(4,"mat-icon",27),r(5,"directions"),o(),r(6," \xA0\xA0 "),a(7,"b"),r(8,"Routes:"),o()(),a(9,"mat-panel-description")(10,"div",5)(11,"span",19),r(12),o(),a(13,"span",20)(14,"mat-checkbox",28),h("change",function(i){d(e);let c=p(3);return m(c.checkRte(i.checked,-1))})("click",function(i){return i.cancelBubble=!0}),o()()()()(),a(15,"div",22),T(16,_e,6,2,"div",23,b),o()()()}if(s&2){let e=p(3);l(),u("expanded",e.display.expand.routes),l(11),D(" (",e.display.selCount.routes," of ",e.gpxData==null?null:e.gpxData.routes.length,") "),l(2),u("indeterminate",e.display.someRteChecked)("checked",e.display.allRoutesChecked)("disabled",e.gpxData.routes.length==0),l(2),v(e.gpxData.routes)}}function xe(s,t){if(s&1){let e=_();a(0,"div",23)(1,"div",24),r(2),o(),a(3,"div",25)(4,"mat-checkbox",32,2),h("change",function(){let i=d(e).$index,c=w(5),g=p(4);return m(g.checkTrk(c.checked,i))}),o()()()}if(s&2){let e=t.$implicit,n=t.$index,i=p(4);l(2),P(e.name),l(2),u("checked",i.selTracks[n])}}function ge(s,t){if(s&1){let e=_();a(0,"div",13)(1,"mat-expansion-panel",16),h("opened",function(){d(e);let i=p(3);return m(i.display.expand.tracks=!0)})("closed",function(){d(e);let i=p(3);return m(i.display.expand.tracks=!1)}),a(2,"mat-expansion-panel-header",17)(3,"mat-panel-title")(4,"mat-icon",30),r(5,"show_chart"),o(),r(6," \xA0\xA0 "),a(7,"b"),r(8,"Tracks:"),o()(),a(9,"mat-panel-description")(10,"div",5)(11,"span",19),r(12),o(),a(13,"span",20)(14,"mat-checkbox",31),h("change",function(i){d(e);let c=p(3);return m(c.checkTrk(i.checked,-1))})("click",function(i){return i.cancelBubble=!0}),o()()()()(),a(15,"div",22),T(16,xe,6,2,"div",23,b),o()()()}if(s&2){let e=p(3);l(),u("expanded",e.display.expand.tracks),l(11),D(" (",e.display.selCount.tracks," of ",e.gpxData==null?null:e.gpxData.tracks.length,") "),l(2),u("indeterminate",e.display.someTrkChecked)("checked",e.display.allTracksChecked)("disabled",e.gpxData.tracks.length==0),l(2),v(e.gpxData.tracks)}}function Ce(s,t){if(s&1&&(a(0,"div",13)(1,"div",14)(2,"div"),r(3,"File:"),o(),a(4,"div",15),r(5),o()(),y(6,"mat-divider"),o(),f(7,he,18,6,"div",13),f(8,fe,18,6,"div",13),f(9,ge,18,6,"div",13)),s&2){let e=p(2);l(5),M(" ",e.data.fileName," "),l(2),x(e.gpxData.waypoints.length!=0?7:-1),l(),x(e.gpxData.routes.length!=0?8:-1),l(),x(e.gpxData.tracks.length!=0&&e.app.featureFlags().resourceTracks?9:-1)}}function ye(s,t){if(s&1&&(a(0,"div",10),f(1,me,1,0,"mat-progress-bar",12)(2,Ce,10,4),o()),s&2){let e=p();l(),x(e.app.sIsFetching()?1:2)}}var pe=class s{constructor(t){this.data=t}gpxData={name:"",routes:[],waypoints:[],tracks:[]};selRoutes=[];selectedRoute=null;selWaypoints=[];selTracks=[];display={notValid:!1,allRoutesChecked:!1,allWaypointsChecked:!1,allTracksChecked:!1,someWptChecked:!1,someRteChecked:!1,someTrkChecked:!1,loadRoutesOK:!1,loadWaypointsOK:!1,loadTracksOK:!1,routeViewer:!1,selCount:{routes:0,waypoints:0,tracks:0},expand:{routes:!1,waypoints:!1,tracks:!1}};errorCount=0;subCount=0;gpx;app=C(se);dialogRef=C(E);skres=C(le);signalk=C(oe);ngOnInit(){this.data.fileData=this.data.fileData||null,this.parseGPXData(this.data.fileData)}ngOnDestroy(){this.clear()}load(){this.uploadToServer({rte:{selected:this.selRoutes},wpt:{selected:this.selWaypoints},trk:{selected:this.selTracks}})}parseGPXData(t){return k(this,null,function*(){if(this.display.allRoutesChecked=!1,this.display.loadRoutesOK=!1,this.selRoutes=[],this.display.allWaypointsChecked=!1,this.display.loadWaypointsOK=!1,this.selWaypoints=[],this.display.allTracksChecked=!1,this.display.loadTracksOK=!1,this.selTracks=[],this.display.selCount={routes:0,waypoints:0,tracks:0},this.display.expand={routes:!1,waypoints:!1,tracks:!1},this.display.notValid=!1,this.gpxData=yield this.parseFileData(t),!this.gpxData){console.warn(`Selected file does not contain GPX data or
2
+ does not correctly implement namespaced <extensions> attributes`,"Invalid GPX Data:"),this.display.notValid=!0;return}this.gpxData.routes.forEach(()=>{this.selRoutes.push(!1)}),this.selRoutes.length===1&&(this.selRoutes[0]=!0,this.display.allRoutesChecked=!0,this.display.expand.routes=!0,this.display.loadRoutesOK=!0,this.display.selCount.routes=1),this.gpxData.waypoints.forEach(()=>{this.selWaypoints.push(!1)}),this.selWaypoints.length===1&&(this.selWaypoints[0]=!0,this.display.allWaypointsChecked=!0,this.display.expand.waypoints=!0,this.display.loadWaypointsOK=!0,this.display.selCount.waypoints=1),this.gpxData.tracks.forEach(()=>{this.selTracks.push(!1)}),this.selTracks.length===1&&(this.selTracks[0]=!0,this.display.allTracksChecked=!0,this.display.expand.tracks=!0,this.display.loadTracksOK=!0,this.display.selCount.tracks=1)})}checkRte(t,e=-1){let n=0;if(e!==-1){this.selRoutes[e]=t,this.display.loadRoutesOK=t;for(let i of this.selRoutes)i&&n++;this.display.loadRoutesOK=n!==0,this.display.selCount.routes=n,this.display.allRoutesChecked=n===this.selRoutes.length}else{for(let i=0;i<this.selRoutes.length;i++)this.selRoutes[i]=t,this.display.loadRoutesOK=t,this.display.allRoutesChecked=t;this.display.selCount.routes=t?this.selRoutes.length:0}this.display.someRteChecked=!(this.display.allRoutesChecked||n===0)}checkWpt(t,e=-1){let n=0;if(e!==-1){this.selWaypoints[e]=t,this.display.loadWaypointsOK=t;for(let i of this.selWaypoints)i&&n++;this.display.loadWaypointsOK=n!==0,this.display.selCount.waypoints=n,this.display.allWaypointsChecked=n===this.selWaypoints.length}else{for(let i=0;i<this.selWaypoints.length;i++)this.selWaypoints[i]=t,this.display.loadWaypointsOK=t,this.display.allWaypointsChecked=t;this.display.selCount.waypoints=t?this.selWaypoints.length:0}this.display.someWptChecked=!(this.display.allWaypointsChecked||n===0)}checkTrk(t,e=-1){let n=0;if(e!==-1){this.selTracks[e]=t,this.display.loadTracksOK=t;for(let i of this.selTracks)i&&n++;this.display.loadTracksOK=n!==0,this.display.selCount.tracks=n,this.display.allTracksChecked=n===this.selTracks.length}else{for(let i=0;i<this.selTracks.length;i++)this.selTracks[i]=t,this.display.loadTracksOK=t,this.display.allTracksChecked=t;this.display.selCount.tracks=t?this.selTracks.length:0}this.display.someTrkChecked=!(this.display.allTracksChecked||n===0)}clear(){this.gpx=null}parseFileData(t){return k(this,null,function*(){let e={name:"",routes:[],waypoints:[],tracks:[]};if(this.gpx=new re,this.app.sIsFetching.set(!0),!(yield this.gpx.parse(t)))return this.app.sIsFetching.set(!1),null;let n=1;return this.gpx.rte.forEach(i=>{e.routes.push({name:i.name!==""?i.name:`Rte: ${n}`,description:i.desc?i.desc:i.cmt?i.cmt:"",wptcount:i.rtept.length}),n++}),n=1,this.gpx.wpt.forEach(i=>{e.waypoints.push({name:i.name?i.name:`Wpt: ${n}`,description:i.desc?i.desc:i.cmt?i.cmt:""}),n++}),n=1,this.gpx.trk.forEach(i=>{e.tracks.push({name:i.name?i.name:`Trk: ${n}`,description:i.desc?i.desc:i.cmt?i.cmt:""}),n++}),this.app.sIsFetching.set(!1),e})}uploadToServer(t){return k(this,null,function*(){this.app.sIsFetching.set(!0),this.errorCount=0,this.subCount=0;for(let n=0;n<t.rte.selected.length;n++)t.rte.selected[n]&&this.transformRoute(this.gpx.rte[n]);for(let n=0;n<t.wpt.selected.length;n++)t.wpt.selected[n]&&this.transformWaypoint(this.gpx.wpt[n]);let e=[];for(let n=0;n<t.trk.selected.length;n++)if(t.trk.selected[n]){let i=this.transformTrack(this.gpx.trk[n]);this.subCount++;try{let c=yield this.skres.postToServer("tracks",i);this.subCount--,Math.floor(c.statusCode/100)===2?(e.push(c.id),this.app.debug("SUCCESS: Track added.")):this.errorCount++,this.checkComplete()}catch(c){this.errorCount++,this.subCount--,this.logError(c),this.checkComplete()}}e.length!==0&&this.skres.trackAddFromServer(e)})}errorList=[];logError(t){let e=t.error?t.error.message:t.message;this.errorList.push({status:t.status,message:e})}checkComplete(){this.subCount===0&&(this.app.sIsFetching.set(!1),this.app.saveConfig(),this.dialogRef.close({errCount:this.errorCount,errList:this.errorList}),this.app.debug(`GPXLoad: complete: ${this.errorCount}`))}transformRoute(t){let e=this.skres.buildRoute(t.rtept.map(i=>[i.lon,i.lat])),n=e[1];n.name=t.name??"",n.description=t.desc??"",t.cmt&&(n.feature.properties.cmt=t.cmt),t.src&&(n.feature.properties.src=t.src),t.number&&(n.feature.properties.number=t.number),t.type&&(n.feature.properties.type=t.type),n.feature.properties.coordinatesMeta=[],n.feature.properties.coordinatesMeta=t.rtept.map(i=>{let c={name:i.name??""};return i.cmt&&(c.description=i.cmt),c}),this.subCount++,this.signalk.api.put(this.app.skApiVersion,`/resources/routes/${e[0]}`,e[1]).subscribe(i=>{this.subCount--,Math.floor(i.statusCode/100)===2?(this.app.debug("SUCCESS: Route added."),this.app.config.selections.routes.push(e[0])):this.errorCount++,this.checkComplete()},i=>{this.errorCount++,this.subCount--,this.logError(i),this.checkComplete()})}transformWaypoint(t){let e=this.skres.buildWaypoint([t.lon,t.lat]),n=e[1];t.ele&&n.feature.geometry.coordinates.push(t.ele),t.name&&t.name.length!==0&&(n.name=t.name),t.desc&&t.desc.length!==0&&(n.description=t.desc),t.type&&(n.type=t.type),t.cmt&&(n.feature.properties.cmt=t.cmt),t.src&&(n.feature.properties.src=t.src),t.sym&&(n.feature.properties.sym=t.sym),this.subCount++,this.signalk.api.put(this.app.skApiVersion,`/resources/waypoints/${e[0]}`,e[1]).subscribe(i=>{this.subCount--,Math.floor(i.statusCode/100)===2?(this.app.debug("SUCCESS: Waypoint added."),this.app.config.selections.waypoints.push(e[0])):this.errorCount++,this.checkComplete()},i=>{this.errorCount++,this.subCount--,this.logError(i),this.checkComplete()})}transformTrack(t){let e={feature:{type:"Feature",geometry:{type:"MultiLineString",coordinates:[]},properties:{},id:""}};return t.trkseg&&t.trkseg.forEach(n=>{let i=[];n.trkpt.forEach(c=>{i.push([c.lon,c.lat])}),e.feature.geometry.coordinates.push(i)}),t.name&&t.name.length!==0?e.feature.properties.name=t.name:e.feature.properties.name=`gpxtrk #${Math.random().toString().slice(-5)}`,t.desc&&t.desc.length!==0&&(e.feature.properties.description=t.desc),t.cmt&&(e.feature.properties.cmt=t.cmt),t.src&&(e.feature.properties.src=t.src),t.type&&(e.feature.properties.type=t.type),e}static \u0275fac=function(e){return new(e||s)(S(R))};static \u0275cmp=I({type:s,selectors:[["gpxload-dialog"]],decls:13,vars:3,consts:[["wval",""],["rval",""],["tval",""],[1,"gpxload-dialog"],[2,"background-color","transparent"],[2,"display","flex","width","100%"],["mat-raised-button","","matTooltip","Load selected resources","matTooltipPosition","right",2,"width","85px",3,"disabled"],[2,"flex","1 1 auto","text-align","center"],[2,"text-align","right"],["mat-icon-button","",3,"click","disabled"],["mat-dialog-content",""],["mat-raised-button","","matTooltip","Load selected resources","matTooltipPosition","right",2,"width","85px",3,"click","disabled"],["mode","indeterminate"],[1,"card-group"],[2,"display","flex"],[2,"flex","1 1 auto","padding-left","10px","overflow","hidden","display","-webkit-box","-webkit-box-orient","vertical","-webkit-line-clamp","1","line-clamp","1","text-overflow","ellipsis"],[3,"opened","closed","expanded"],[2,"padding","0 12px"],[1,"icon-waypoint"],[1,"pnlSelectedItems"],[1,"pnlSelect"],["matTooltip","Select all Waypoints","matTooltipPosition","before",3,"change","click","indeterminate","checked","disabled"],[1,"list-container-scrollable"],[1,"item-row"],[1,"name"],[1,"check"],["matTooltip","Select Waypoint","matTooltipPosition","below",3,"change","checked"],[1,"icon-route"],["matTooltip","Select all Routes","matTooltipPosition","before",3,"change","click","indeterminate","checked","disabled"],["matTooltip","Select this Route","matTooltipPosition","below",3,"change","checked"],[1,"icon-track"],["matTooltip","Select all Tracks","matTooltipPosition","before",3,"change","click","indeterminate","checked","disabled"],["matTooltip","Select this Track","matTooltipPosition","below",3,"change","checked"]],template:function(e,n){e&1&&(a(0,"div",3)(1,"mat-toolbar",4)(2,"div",5)(3,"div"),f(4,ce,4,1,"button",6),o(),a(5,"div",7),r(6,"Import GPX"),o(),a(7,"div",8)(8,"button",9),h("click",function(){return n.dialogRef.close(-1)}),a(9,"mat-icon"),r(10,"close"),o()()()()(),f(11,de,10,0,"div",10)(12,ye,3,1,"div",10),o()),e&2&&(l(4),x(n.app.sIsFetching()?-1:4),l(4),u("disabled",n.app.sIsFetching()),l(3),x(n.display.notValid?11:12))},dependencies:[ae,ne,N,j,X,G,K,F,V,W,O,U,J,Q,L,A,ie,Y,Z,te,ee,q,z,H,B,$],styles:[".gpxload-dialog[_ngcontent-%COMP%]{font-family:roboto;position:relative}.mat-expansion-panel-body[_ngcontent-%COMP%]{padding:0 12px 6px}.card-group-title[_ngcontent-%COMP%]{font-weight:700;font-size:10pt;font-family:Arial,Helvetica,sans-serif;padding:10px 0}.item-row[_ngcontent-%COMP%]{display:flex;width:100%;padding:2px 0}.item-row[_ngcontent-%COMP%] .name[_ngcontent-%COMP%]{flex:1 1 auto;overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;text-overflow:ellipsis;line-height:2.5em}.item-row[_ngcontent-%COMP%] .check[_ngcontent-%COMP%]{text-align:right;padding-right:15px}.pnlSelectedItems[_ngcontent-%COMP%]{display:none;line-height:2.9em}.pnlSelect[_ngcontent-%COMP%]{flex:1 1 auto;padding-left:3px;padding-right:3px;text-align:right}.txtSelect[_ngcontent-%COMP%]{display:none}button[_ngcontent-%COMP%]{min-width:unset;padding:unset}@media only screen and (min-width:400px){.pnlSelectedItems[_ngcontent-%COMP%]{display:inline}}@media only screen and (min-width:475px){.pnlSelectedItems[_ngcontent-%COMP%]{display:inline;line-height:2.9em}.txtSelect[_ngcontent-%COMP%]{display:inline}.pnlSelect[_ngcontent-%COMP%]{flex:1 1 auto;padding-left:20px;padding-right:15px;text-align:right}button[_ngcontent-%COMP%]{min-width:inherit;padding:inherit}}"]})};export{pe as GPXImportDialog};
@@ -0,0 +1 @@
1
+ import{f as s}from"./chunk-EQVTEUXC.js";function u(n,t){let r=n.length-t,c=0;do{for(let i=t;i>0;i--)n[c+t]+=n[c],c++;r-=t}while(r>0)}function p(n,t,r){let c=0,i=n.length,f=i/r;for(;i>t;){for(let e=t;e>0;--e)n[c+t]+=n[c],++c;i-=t}let a=n.slice();for(let e=0;e<f;++e)for(let o=0;o<r;++o)n[r*e+o]=a[(r-o-1)*f+e]}function d(n,t,r,c,i,f){if(!t||t===1)return n;for(let o=0;o<i.length;++o){if(i[o]%8!==0)throw new Error("When decoding with predictor, only multiple of 8 bits are supported.");if(i[o]!==i[0])throw new Error("When decoding with predictor, all samples must have the same size.")}let a=i[0]/8,e=f===2?1:i.length;for(let o=0;o<c&&!(o*e*r*a>=n.byteLength);++o){let l;if(t===2){switch(i[0]){case 8:l=new Uint8Array(n,o*e*r*a,e*r*a);break;case 16:l=new Uint16Array(n,o*e*r*a,e*r*a/2);break;case 32:l=new Uint32Array(n,o*e*r*a,e*r*a/4);break;default:throw new Error(`Predictor 2 not allowed with ${i[0]} bits per sample.`)}u(l,e)}else t===3&&(l=new Uint8Array(n,o*e*r*a,e*r*a),p(l,e,a))}return n}var h=class{constructor(t){this.parameters=t}decodeBlock(t){throw new Error("decodeBlock not implemented")}decode(t){return s(this,null,function*(){let r=yield this.decodeBlock(t),{tileWidth:c,tileHeight:i,predictor:f,bitsPerSample:a,planarConfiguration:e}=this.parameters;if(f!==1){let l=Array.isArray(a)||ArrayBuffer.isView(a)?Array.from(a):[a];return d(r,f,c,i,l,e)}return r})}};export{h as a};
@@ -1 +1 @@
1
- function he(e){let i=e.length;for(;--i>=0;)e[i]=0}var Bi=0,fi=1,Ki=2,Pi=3,Xi=258,wt=29,Re=256,ve=Re+1+wt,fe=30,bt=19,oi=2*ve+1,Q=15,Ye=16,Yi=7,gt=256,_i=16,hi=17,di=18,lt=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),Fe=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),Gi=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),si=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ji=512,P=new Array((ve+2)*2);he(P);var ge=new Array(fe*2);he(ge);var ke=new Array(ji);he(ke);var Ee=new Array(Xi-Pi+1);he(Ee);var pt=new Array(wt);he(pt);var Me=new Array(fe);he(Me);function Ge(e,i,t,n,r){this.static_tree=e,this.extra_bits=i,this.extra_base=t,this.elems=n,this.max_length=r,this.has_stree=e&&e.length}var ci,ui,wi;function je(e,i){this.dyn_tree=e,this.max_code=0,this.stat_desc=i}var bi=e=>e<256?ke[e]:ke[256+(e>>>7)],ye=(e,i)=>{e.pending_buf[e.pending++]=i&255,e.pending_buf[e.pending++]=i>>>8&255},N=(e,i,t)=>{e.bi_valid>Ye-t?(e.bi_buf|=i<<e.bi_valid&65535,ye(e,e.bi_buf),e.bi_buf=i>>Ye-e.bi_valid,e.bi_valid+=t-Ye):(e.bi_buf|=i<<e.bi_valid&65535,e.bi_valid+=t)},M=(e,i,t)=>{N(e,t[i*2],t[i*2+1])},gi=(e,i)=>{let t=0;do t|=e&1,e>>>=1,t<<=1;while(--i>0);return t>>>1},Wi=e=>{e.bi_valid===16?(ye(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},Vi=(e,i)=>{let t=i.dyn_tree,n=i.max_code,r=i.stat_desc.static_tree,a=i.stat_desc.has_stree,o=i.stat_desc.extra_bits,f=i.stat_desc.extra_base,c=i.stat_desc.max_length,l,_,y,s,h,u,T=0;for(s=0;s<=Q;s++)e.bl_count[s]=0;for(t[e.heap[e.heap_max]*2+1]=0,l=e.heap_max+1;l<oi;l++)_=e.heap[l],s=t[t[_*2+1]*2+1]+1,s>c&&(s=c,T++),t[_*2+1]=s,!(_>n)&&(e.bl_count[s]++,h=0,_>=f&&(h=o[_-f]),u=t[_*2],e.opt_len+=u*(s+h),a&&(e.static_len+=u*(r[_*2+1]+h)));if(T!==0){do{for(s=c-1;e.bl_count[s]===0;)s--;e.bl_count[s]--,e.bl_count[s+1]+=2,e.bl_count[c]--,T-=2}while(T>0);for(s=c;s!==0;s--)for(_=e.bl_count[s];_!==0;)y=e.heap[--l],!(y>n)&&(t[y*2+1]!==s&&(e.opt_len+=(s-t[y*2+1])*t[y*2],t[y*2+1]=s),_--)}},pi=(e,i,t)=>{let n=new Array(Q+1),r=0,a,o;for(a=1;a<=Q;a++)r=r+t[a-1]<<1,n[a]=r;for(o=0;o<=i;o++){let f=e[o*2+1];f!==0&&(e[o*2]=gi(n[f]++,f))}},Ji=()=>{let e,i,t,n,r,a=new Array(Q+1);for(t=0,n=0;n<wt-1;n++)for(pt[n]=t,e=0;e<1<<lt[n];e++)Ee[t++]=n;for(Ee[t-1]=n,r=0,n=0;n<16;n++)for(Me[n]=r,e=0;e<1<<Fe[n];e++)ke[r++]=n;for(r>>=7;n<fe;n++)for(Me[n]=r<<7,e=0;e<1<<Fe[n]-7;e++)ke[256+r++]=n;for(i=0;i<=Q;i++)a[i]=0;for(e=0;e<=143;)P[e*2+1]=8,e++,a[8]++;for(;e<=255;)P[e*2+1]=9,e++,a[9]++;for(;e<=279;)P[e*2+1]=7,e++,a[7]++;for(;e<=287;)P[e*2+1]=8,e++,a[8]++;for(pi(P,ve+1,a),e=0;e<fe;e++)ge[e*2+1]=5,ge[e*2]=gi(e,5);ci=new Ge(P,lt,Re+1,ve,Q),ui=new Ge(ge,Fe,0,fe,Q),wi=new Ge(new Array(0),Gi,0,bt,Yi)},xi=e=>{let i;for(i=0;i<ve;i++)e.dyn_ltree[i*2]=0;for(i=0;i<fe;i++)e.dyn_dtree[i*2]=0;for(i=0;i<bt;i++)e.bl_tree[i*2]=0;e.dyn_ltree[gt*2]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},vi=e=>{e.bi_valid>8?ye(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},yt=(e,i,t,n)=>{let r=i*2,a=t*2;return e[r]<e[a]||e[r]===e[a]&&n[i]<=n[t]},We=(e,i,t)=>{let n=e.heap[t],r=t<<1;for(;r<=e.heap_len&&(r<e.heap_len&&yt(i,e.heap[r+1],e.heap[r],e.depth)&&r++,!yt(i,n,e.heap[r],e.depth));)e.heap[t]=e.heap[r],t=r,r<<=1;e.heap[t]=n},mt=(e,i,t)=>{let n,r,a=0,o,f;if(e.sym_next!==0)do n=e.pending_buf[e.sym_buf+a++]&255,n+=(e.pending_buf[e.sym_buf+a++]&255)<<8,r=e.pending_buf[e.sym_buf+a++],n===0?M(e,r,i):(o=Ee[r],M(e,o+Re+1,i),f=lt[o],f!==0&&(r-=pt[o],N(e,r,f)),n--,o=bi(n),M(e,o,t),f=Fe[o],f!==0&&(n-=Me[o],N(e,n,f)));while(a<e.sym_next);M(e,gt,i)},ft=(e,i)=>{let t=i.dyn_tree,n=i.stat_desc.static_tree,r=i.stat_desc.has_stree,a=i.stat_desc.elems,o,f,c=-1,l;for(e.heap_len=0,e.heap_max=oi,o=0;o<a;o++)t[o*2]!==0?(e.heap[++e.heap_len]=c=o,e.depth[o]=0):t[o*2+1]=0;for(;e.heap_len<2;)l=e.heap[++e.heap_len]=c<2?++c:0,t[l*2]=1,e.depth[l]=0,e.opt_len--,r&&(e.static_len-=n[l*2+1]);for(i.max_code=c,o=e.heap_len>>1;o>=1;o--)We(e,t,o);l=a;do o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],We(e,t,1),f=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=f,t[l*2]=t[o*2]+t[f*2],e.depth[l]=(e.depth[o]>=e.depth[f]?e.depth[o]:e.depth[f])+1,t[o*2+1]=t[f*2+1]=l,e.heap[1]=l++,We(e,t,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],Vi(e,i),pi(t,c,e.bl_count)},zt=(e,i,t)=>{let n,r=-1,a,o=i[1],f=0,c=7,l=4;for(o===0&&(c=138,l=3),i[(t+1)*2+1]=65535,n=0;n<=t;n++)a=o,o=i[(n+1)*2+1],!(++f<c&&a===o)&&(f<l?e.bl_tree[a*2]+=f:a!==0?(a!==r&&e.bl_tree[a*2]++,e.bl_tree[_i*2]++):f<=10?e.bl_tree[hi*2]++:e.bl_tree[di*2]++,f=0,r=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4))},St=(e,i,t)=>{let n,r=-1,a,o=i[1],f=0,c=7,l=4;for(o===0&&(c=138,l=3),n=0;n<=t;n++)if(a=o,o=i[(n+1)*2+1],!(++f<c&&a===o)){if(f<l)do M(e,a,e.bl_tree);while(--f!==0);else a!==0?(a!==r&&(M(e,a,e.bl_tree),f--),M(e,_i,e.bl_tree),N(e,f-3,2)):f<=10?(M(e,hi,e.bl_tree),N(e,f-3,3)):(M(e,di,e.bl_tree),N(e,f-11,7));f=0,r=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4)}},Qi=e=>{let i;for(zt(e,e.dyn_ltree,e.l_desc.max_code),zt(e,e.dyn_dtree,e.d_desc.max_code),ft(e,e.bl_desc),i=bt-1;i>=3&&e.bl_tree[si[i]*2+1]===0;i--);return e.opt_len+=3*(i+1)+5+5+4,i},qi=(e,i,t,n)=>{let r;for(N(e,i-257,5),N(e,t-1,5),N(e,n-4,4),r=0;r<n;r++)N(e,e.bl_tree[si[r]*2+1],3);St(e,e.dyn_ltree,i-1),St(e,e.dyn_dtree,t-1)},en=e=>{let i=4093624447,t;for(t=0;t<=31;t++,i>>>=1)if(i&1&&e.dyn_ltree[t*2]!==0)return 0;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return 1;for(t=32;t<Re;t++)if(e.dyn_ltree[t*2]!==0)return 1;return 0},At=!1,tn=e=>{At||(Ji(),At=!0),e.l_desc=new je(e.dyn_ltree,ci),e.d_desc=new je(e.dyn_dtree,ui),e.bl_desc=new je(e.bl_tree,wi),e.bi_buf=0,e.bi_valid=0,xi(e)},ki=(e,i,t,n)=>{N(e,(Bi<<1)+(n?1:0),3),vi(e),ye(e,t),ye(e,~t),t&&e.pending_buf.set(e.window.subarray(i,i+t),e.pending),e.pending+=t},nn=e=>{N(e,fi<<1,3),M(e,gt,P),Wi(e)},an=(e,i,t,n)=>{let r,a,o=0;e.level>0?(e.strm.data_type===2&&(e.strm.data_type=en(e)),ft(e,e.l_desc),ft(e,e.d_desc),o=Qi(e),r=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=r&&(r=a)):r=a=t+5,t+4<=r&&i!==-1?ki(e,i,t,n):e.strategy===4||a===r?(N(e,(fi<<1)+(n?1:0),3),mt(e,P,ge)):(N(e,(Ki<<1)+(n?1:0),3),qi(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),mt(e,e.dyn_ltree,e.dyn_dtree)),xi(e),n&&vi(e)},rn=(e,i,t)=>(e.pending_buf[e.sym_buf+e.sym_next++]=i,e.pending_buf[e.sym_buf+e.sym_next++]=i>>8,e.pending_buf[e.sym_buf+e.sym_next++]=t,i===0?e.dyn_ltree[t*2]++:(e.matches++,i--,e.dyn_ltree[(Ee[t]+Re+1)*2]++,e.dyn_dtree[bi(i)*2]++),e.sym_next===e.sym_end),ln=tn,fn=ki,on=an,_n=rn,hn=nn,dn={_tr_init:ln,_tr_stored_block:fn,_tr_flush_block:on,_tr_tally:_n,_tr_align:hn},sn=(e,i,t,n)=>{let r=e&65535|0,a=e>>>16&65535|0,o=0;for(;t!==0;){o=t>2e3?2e3:t,t-=o;do r=r+i[n++]|0,a=a+r|0;while(--o);r%=65521,a%=65521}return r|a<<16|0},me=sn,cn=()=>{let e,i=[];for(var t=0;t<256;t++){e=t;for(var n=0;n<8;n++)e=e&1?3988292384^e>>>1:e>>>1;i[t]=e}return i},un=new Uint32Array(cn()),wn=(e,i,t,n)=>{let r=un,a=n+t;e^=-1;for(let o=n;o<a;o++)e=e>>>8^r[(e^i[o])&255];return e^-1},Z=wn,te={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},de={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},{_tr_init:bn,_tr_stored_block:ot,_tr_flush_block:gn,_tr_tally:j,_tr_align:pn}=dn,{Z_NO_FLUSH:W,Z_PARTIAL_FLUSH:xn,Z_FULL_FLUSH:vn,Z_FINISH:C,Z_BLOCK:Rt,Z_OK:I,Z_STREAM_END:Tt,Z_STREAM_ERROR:H,Z_DATA_ERROR:kn,Z_BUF_ERROR:Ve,Z_DEFAULT_COMPRESSION:En,Z_FILTERED:yn,Z_HUFFMAN_ONLY:Ne,Z_RLE:mn,Z_FIXED:zn,Z_DEFAULT_STRATEGY:Sn,Z_UNKNOWN:An,Z_DEFLATED:Ke}=de,Rn=9,Tn=15,Dn=8,Zn=29,In=256,_t=In+1+Zn,On=30,Nn=19,Ln=2*_t+1,Un=15,v=3,G=258,B=G+v+1,Cn=32,oe=42,xt=57,ht=69,dt=73,st=91,ct=103,q=113,we=666,O=1,se=2,ie=3,ce=4,$n=3,ee=(e,i)=>(e.msg=te[i],i),Dt=e=>e*2-(e>4?9:0),Y=e=>{let i=e.length;for(;--i>=0;)e[i]=0},Fn=e=>{let i,t,n,r=e.w_size;i=e.hash_size,n=i;do t=e.head[--n],e.head[n]=t>=r?t-r:0;while(--i);i=r,n=i;do t=e.prev[--n],e.prev[n]=t>=r?t-r:0;while(--i)},Mn=(e,i,t)=>(i<<e.hash_shift^t)&e.hash_mask,V=Mn,L=e=>{let i=e.state,t=i.pending;t>e.avail_out&&(t=e.avail_out),t!==0&&(e.output.set(i.pending_buf.subarray(i.pending_out,i.pending_out+t),e.next_out),e.next_out+=t,i.pending_out+=t,e.total_out+=t,e.avail_out-=t,i.pending-=t,i.pending===0&&(i.pending_out=0))},U=(e,i)=>{gn(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,i),e.block_start=e.strstart,L(e.strm)},z=(e,i)=>{e.pending_buf[e.pending++]=i},ue=(e,i)=>{e.pending_buf[e.pending++]=i>>>8&255,e.pending_buf[e.pending++]=i&255},ut=(e,i,t,n)=>{let r=e.avail_in;return r>n&&(r=n),r===0?0:(e.avail_in-=r,i.set(e.input.subarray(e.next_in,e.next_in+r),t),e.state.wrap===1?e.adler=me(e.adler,i,r,t):e.state.wrap===2&&(e.adler=Z(e.adler,i,r,t)),e.next_in+=r,e.total_in+=r,r)},Ei=(e,i)=>{let t=e.max_chain_length,n=e.strstart,r,a,o=e.prev_length,f=e.nice_match,c=e.strstart>e.w_size-B?e.strstart-(e.w_size-B):0,l=e.window,_=e.w_mask,y=e.prev,s=e.strstart+G,h=l[n+o-1],u=l[n+o];e.prev_length>=e.good_match&&(t>>=2),f>e.lookahead&&(f=e.lookahead);do if(r=i,!(l[r+o]!==u||l[r+o-1]!==h||l[r]!==l[n]||l[++r]!==l[n+1])){n+=2,r++;do;while(l[++n]===l[++r]&&l[++n]===l[++r]&&l[++n]===l[++r]&&l[++n]===l[++r]&&l[++n]===l[++r]&&l[++n]===l[++r]&&l[++n]===l[++r]&&l[++n]===l[++r]&&n<s);if(a=G-(s-n),n=s-G,a>o){if(e.match_start=i,o=a,a>=f)break;h=l[n+o-1],u=l[n+o]}}while((i=y[i&_])>c&&--t!==0);return o<=e.lookahead?o:e.lookahead},_e=e=>{let i=e.w_size,t,n,r;do{if(n=e.window_size-e.lookahead-e.strstart,e.strstart>=i+(i-B)&&(e.window.set(e.window.subarray(i,i+i-n),0),e.match_start-=i,e.strstart-=i,e.block_start-=i,e.insert>e.strstart&&(e.insert=e.strstart),Fn(e),n+=i),e.strm.avail_in===0)break;if(t=ut(e.strm,e.window,e.strstart+e.lookahead,n),e.lookahead+=t,e.lookahead+e.insert>=v)for(r=e.strstart-e.insert,e.ins_h=e.window[r],e.ins_h=V(e,e.ins_h,e.window[r+1]);e.insert&&(e.ins_h=V(e,e.ins_h,e.window[r+v-1]),e.prev[r&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=r,r++,e.insert--,!(e.lookahead+e.insert<v)););}while(e.lookahead<B&&e.strm.avail_in!==0)},yi=(e,i)=>{let t=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,n,r,a,o=0,f=e.strm.avail_in;do{if(n=65535,a=e.bi_valid+42>>3,e.strm.avail_out<a||(a=e.strm.avail_out-a,r=e.strstart-e.block_start,n>r+e.strm.avail_in&&(n=r+e.strm.avail_in),n>a&&(n=a),n<t&&(n===0&&i!==C||i===W||n!==r+e.strm.avail_in)))break;o=i===C&&n===r+e.strm.avail_in?1:0,ot(e,0,0,o),e.pending_buf[e.pending-4]=n,e.pending_buf[e.pending-3]=n>>8,e.pending_buf[e.pending-2]=~n,e.pending_buf[e.pending-1]=~n>>8,L(e.strm),r&&(r>n&&(r=n),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+r),e.strm.next_out),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r,e.block_start+=r,n-=r),n&&(ut(e.strm,e.strm.output,e.strm.next_out,n),e.strm.next_out+=n,e.strm.avail_out-=n,e.strm.total_out+=n)}while(o===0);return f-=e.strm.avail_in,f&&(f>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=f&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-f,e.strm.next_in),e.strstart),e.strstart+=f,e.insert+=f>e.w_size-e.insert?e.w_size-e.insert:f),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),o?ce:i!==W&&i!==C&&e.strm.avail_in===0&&e.strstart===e.block_start?se:(a=e.window_size-e.strstart,e.strm.avail_in>a&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,a+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),a>e.strm.avail_in&&(a=e.strm.avail_in),a&&(ut(e.strm,e.window,e.strstart,a),e.strstart+=a,e.insert+=a>e.w_size-e.insert?e.w_size-e.insert:a),e.high_water<e.strstart&&(e.high_water=e.strstart),a=e.bi_valid+42>>3,a=e.pending_buf_size-a>65535?65535:e.pending_buf_size-a,t=a>e.w_size?e.w_size:a,r=e.strstart-e.block_start,(r>=t||(r||i===C)&&i!==W&&e.strm.avail_in===0&&r<=a)&&(n=r>a?a:r,o=i===C&&e.strm.avail_in===0&&n===r?1:0,ot(e,e.block_start,n,o),e.block_start+=n,L(e.strm)),o?ie:O)},Je=(e,i)=>{let t,n;for(;;){if(e.lookahead<B){if(_e(e),e.lookahead<B&&i===W)return O;if(e.lookahead===0)break}if(t=0,e.lookahead>=v&&(e.ins_h=V(e,e.ins_h,e.window[e.strstart+v-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),t!==0&&e.strstart-t<=e.w_size-B&&(e.match_length=Ei(e,t)),e.match_length>=v)if(n=j(e,e.strstart-e.match_start,e.match_length-v),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=v){e.match_length--;do e.strstart++,e.ins_h=V(e,e.ins_h,e.window[e.strstart+v-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=V(e,e.ins_h,e.window[e.strstart+1]);else n=j(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(U(e,!1),e.strm.avail_out===0))return O}return e.insert=e.strstart<v-1?e.strstart:v-1,i===C?(U(e,!0),e.strm.avail_out===0?ie:ce):e.sym_next&&(U(e,!1),e.strm.avail_out===0)?O:se},re=(e,i)=>{let t,n,r;for(;;){if(e.lookahead<B){if(_e(e),e.lookahead<B&&i===W)return O;if(e.lookahead===0)break}if(t=0,e.lookahead>=v&&(e.ins_h=V(e,e.ins_h,e.window[e.strstart+v-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=v-1,t!==0&&e.prev_length<e.max_lazy_match&&e.strstart-t<=e.w_size-B&&(e.match_length=Ei(e,t),e.match_length<=5&&(e.strategy===yn||e.match_length===v&&e.strstart-e.match_start>4096)&&(e.match_length=v-1)),e.prev_length>=v&&e.match_length<=e.prev_length){r=e.strstart+e.lookahead-v,n=j(e,e.strstart-1-e.prev_match,e.prev_length-v),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=r&&(e.ins_h=V(e,e.ins_h,e.window[e.strstart+v-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=v-1,e.strstart++,n&&(U(e,!1),e.strm.avail_out===0))return O}else if(e.match_available){if(n=j(e,0,e.window[e.strstart-1]),n&&U(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return O}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=j(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<v-1?e.strstart:v-1,i===C?(U(e,!0),e.strm.avail_out===0?ie:ce):e.sym_next&&(U(e,!1),e.strm.avail_out===0)?O:se},Hn=(e,i)=>{let t,n,r,a,o=e.window;for(;;){if(e.lookahead<=G){if(_e(e),e.lookahead<=G&&i===W)return O;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=v&&e.strstart>0&&(r=e.strstart-1,n=o[r],n===o[++r]&&n===o[++r]&&n===o[++r])){a=e.strstart+G;do;while(n===o[++r]&&n===o[++r]&&n===o[++r]&&n===o[++r]&&n===o[++r]&&n===o[++r]&&n===o[++r]&&n===o[++r]&&r<a);e.match_length=G-(a-r),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=v?(t=j(e,1,e.match_length-v),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(t=j(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),t&&(U(e,!1),e.strm.avail_out===0))return O}return e.insert=0,i===C?(U(e,!0),e.strm.avail_out===0?ie:ce):e.sym_next&&(U(e,!1),e.strm.avail_out===0)?O:se},Bn=(e,i)=>{let t;for(;;){if(e.lookahead===0&&(_e(e),e.lookahead===0)){if(i===W)return O;break}if(e.match_length=0,t=j(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,t&&(U(e,!1),e.strm.avail_out===0))return O}return e.insert=0,i===C?(U(e,!0),e.strm.avail_out===0?ie:ce):e.sym_next&&(U(e,!1),e.strm.avail_out===0)?O:se};function F(e,i,t,n,r){this.good_length=e,this.max_lazy=i,this.nice_length=t,this.max_chain=n,this.func=r}var be=[new F(0,0,0,0,yi),new F(4,4,8,4,Je),new F(4,5,16,8,Je),new F(4,6,32,32,Je),new F(4,4,16,16,re),new F(8,16,32,32,re),new F(8,16,128,128,re),new F(8,32,128,256,re),new F(32,128,258,1024,re),new F(32,258,258,4096,re)],Kn=e=>{e.window_size=2*e.w_size,Y(e.head),e.max_lazy_match=be[e.level].max_lazy,e.good_match=be[e.level].good_length,e.nice_match=be[e.level].nice_length,e.max_chain_length=be[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=v-1,e.match_available=0,e.ins_h=0};function Pn(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Ke,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(Ln*2),this.dyn_dtree=new Uint16Array((2*On+1)*2),this.bl_tree=new Uint16Array((2*Nn+1)*2),Y(this.dyn_ltree),Y(this.dyn_dtree),Y(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(Un+1),this.heap=new Uint16Array(2*_t+1),Y(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*_t+1),Y(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var Te=e=>{if(!e)return 1;let i=e.state;return!i||i.strm!==e||i.status!==oe&&i.status!==xt&&i.status!==ht&&i.status!==dt&&i.status!==st&&i.status!==ct&&i.status!==q&&i.status!==we?1:0},mi=e=>{if(Te(e))return ee(e,H);e.total_in=e.total_out=0,e.data_type=An;let i=e.state;return i.pending=0,i.pending_out=0,i.wrap<0&&(i.wrap=-i.wrap),i.status=i.wrap===2?xt:i.wrap?oe:q,e.adler=i.wrap===2?0:1,i.last_flush=-2,bn(i),I},zi=e=>{let i=mi(e);return i===I&&Kn(e.state),i},Xn=(e,i)=>Te(e)||e.state.wrap!==2?H:(e.state.gzhead=i,I),Si=(e,i,t,n,r,a)=>{if(!e)return H;let o=1;if(i===En&&(i=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),r<1||r>Rn||t!==Ke||n<8||n>15||i<0||i>9||a<0||a>zn||n===8&&o!==1)return ee(e,H);n===8&&(n=9);let f=new Pn;return e.state=f,f.strm=e,f.status=oe,f.wrap=o,f.gzhead=null,f.w_bits=n,f.w_size=1<<f.w_bits,f.w_mask=f.w_size-1,f.hash_bits=r+7,f.hash_size=1<<f.hash_bits,f.hash_mask=f.hash_size-1,f.hash_shift=~~((f.hash_bits+v-1)/v),f.window=new Uint8Array(f.w_size*2),f.head=new Uint16Array(f.hash_size),f.prev=new Uint16Array(f.w_size),f.lit_bufsize=1<<r+6,f.pending_buf_size=f.lit_bufsize*4,f.pending_buf=new Uint8Array(f.pending_buf_size),f.sym_buf=f.lit_bufsize,f.sym_end=(f.lit_bufsize-1)*3,f.level=i,f.strategy=a,f.method=t,zi(e)},Yn=(e,i)=>Si(e,i,Ke,Tn,Dn,Sn),Gn=(e,i)=>{if(Te(e)||i>Rt||i<0)return e?ee(e,H):H;let t=e.state;if(!e.output||e.avail_in!==0&&!e.input||t.status===we&&i!==C)return ee(e,e.avail_out===0?Ve:H);let n=t.last_flush;if(t.last_flush=i,t.pending!==0){if(L(e),e.avail_out===0)return t.last_flush=-1,I}else if(e.avail_in===0&&Dt(i)<=Dt(n)&&i!==C)return ee(e,Ve);if(t.status===we&&e.avail_in!==0)return ee(e,Ve);if(t.status===oe&&t.wrap===0&&(t.status=q),t.status===oe){let r=Ke+(t.w_bits-8<<4)<<8,a=-1;if(t.strategy>=Ne||t.level<2?a=0:t.level<6?a=1:t.level===6?a=2:a=3,r|=a<<6,t.strstart!==0&&(r|=Cn),r+=31-r%31,ue(t,r),t.strstart!==0&&(ue(t,e.adler>>>16),ue(t,e.adler&65535)),e.adler=1,t.status=q,L(e),t.pending!==0)return t.last_flush=-1,I}if(t.status===xt){if(e.adler=0,z(t,31),z(t,139),z(t,8),t.gzhead)z(t,(t.gzhead.text?1:0)+(t.gzhead.hcrc?2:0)+(t.gzhead.extra?4:0)+(t.gzhead.name?8:0)+(t.gzhead.comment?16:0)),z(t,t.gzhead.time&255),z(t,t.gzhead.time>>8&255),z(t,t.gzhead.time>>16&255),z(t,t.gzhead.time>>24&255),z(t,t.level===9?2:t.strategy>=Ne||t.level<2?4:0),z(t,t.gzhead.os&255),t.gzhead.extra&&t.gzhead.extra.length&&(z(t,t.gzhead.extra.length&255),z(t,t.gzhead.extra.length>>8&255)),t.gzhead.hcrc&&(e.adler=Z(e.adler,t.pending_buf,t.pending,0)),t.gzindex=0,t.status=ht;else if(z(t,0),z(t,0),z(t,0),z(t,0),z(t,0),z(t,t.level===9?2:t.strategy>=Ne||t.level<2?4:0),z(t,$n),t.status=q,L(e),t.pending!==0)return t.last_flush=-1,I}if(t.status===ht){if(t.gzhead.extra){let r=t.pending,a=(t.gzhead.extra.length&65535)-t.gzindex;for(;t.pending+a>t.pending_buf_size;){let f=t.pending_buf_size-t.pending;if(t.pending_buf.set(t.gzhead.extra.subarray(t.gzindex,t.gzindex+f),t.pending),t.pending=t.pending_buf_size,t.gzhead.hcrc&&t.pending>r&&(e.adler=Z(e.adler,t.pending_buf,t.pending-r,r)),t.gzindex+=f,L(e),t.pending!==0)return t.last_flush=-1,I;r=0,a-=f}let o=new Uint8Array(t.gzhead.extra);t.pending_buf.set(o.subarray(t.gzindex,t.gzindex+a),t.pending),t.pending+=a,t.gzhead.hcrc&&t.pending>r&&(e.adler=Z(e.adler,t.pending_buf,t.pending-r,r)),t.gzindex=0}t.status=dt}if(t.status===dt){if(t.gzhead.name){let r=t.pending,a;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>r&&(e.adler=Z(e.adler,t.pending_buf,t.pending-r,r)),L(e),t.pending!==0)return t.last_flush=-1,I;r=0}t.gzindex<t.gzhead.name.length?a=t.gzhead.name.charCodeAt(t.gzindex++)&255:a=0,z(t,a)}while(a!==0);t.gzhead.hcrc&&t.pending>r&&(e.adler=Z(e.adler,t.pending_buf,t.pending-r,r)),t.gzindex=0}t.status=st}if(t.status===st){if(t.gzhead.comment){let r=t.pending,a;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>r&&(e.adler=Z(e.adler,t.pending_buf,t.pending-r,r)),L(e),t.pending!==0)return t.last_flush=-1,I;r=0}t.gzindex<t.gzhead.comment.length?a=t.gzhead.comment.charCodeAt(t.gzindex++)&255:a=0,z(t,a)}while(a!==0);t.gzhead.hcrc&&t.pending>r&&(e.adler=Z(e.adler,t.pending_buf,t.pending-r,r))}t.status=ct}if(t.status===ct){if(t.gzhead.hcrc){if(t.pending+2>t.pending_buf_size&&(L(e),t.pending!==0))return t.last_flush=-1,I;z(t,e.adler&255),z(t,e.adler>>8&255),e.adler=0}if(t.status=q,L(e),t.pending!==0)return t.last_flush=-1,I}if(e.avail_in!==0||t.lookahead!==0||i!==W&&t.status!==we){let r=t.level===0?yi(t,i):t.strategy===Ne?Bn(t,i):t.strategy===mn?Hn(t,i):be[t.level].func(t,i);if((r===ie||r===ce)&&(t.status=we),r===O||r===ie)return e.avail_out===0&&(t.last_flush=-1),I;if(r===se&&(i===xn?pn(t):i!==Rt&&(ot(t,0,0,!1),i===vn&&(Y(t.head),t.lookahead===0&&(t.strstart=0,t.block_start=0,t.insert=0))),L(e),e.avail_out===0))return t.last_flush=-1,I}return i!==C?I:t.wrap<=0?Tt:(t.wrap===2?(z(t,e.adler&255),z(t,e.adler>>8&255),z(t,e.adler>>16&255),z(t,e.adler>>24&255),z(t,e.total_in&255),z(t,e.total_in>>8&255),z(t,e.total_in>>16&255),z(t,e.total_in>>24&255)):(ue(t,e.adler>>>16),ue(t,e.adler&65535)),L(e),t.wrap>0&&(t.wrap=-t.wrap),t.pending!==0?I:Tt)},jn=e=>{if(Te(e))return H;let i=e.state.status;return e.state=null,i===q?ee(e,kn):I},Wn=(e,i)=>{let t=i.length;if(Te(e))return H;let n=e.state,r=n.wrap;if(r===2||r===1&&n.status!==oe||n.lookahead)return H;if(r===1&&(e.adler=me(e.adler,i,t,0)),n.wrap=0,t>=n.w_size){r===0&&(Y(n.head),n.strstart=0,n.block_start=0,n.insert=0);let c=new Uint8Array(n.w_size);c.set(i.subarray(t-n.w_size,t),0),i=c,t=n.w_size}let a=e.avail_in,o=e.next_in,f=e.input;for(e.avail_in=t,e.next_in=0,e.input=i,_e(n);n.lookahead>=v;){let c=n.strstart,l=n.lookahead-(v-1);do n.ins_h=V(n,n.ins_h,n.window[c+v-1]),n.prev[c&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=c,c++;while(--l);n.strstart=c,n.lookahead=v-1,_e(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=v-1,n.match_available=0,e.next_in=o,e.input=f,e.avail_in=a,n.wrap=r,I},Vn=Yn,Jn=Si,Qn=zi,qn=mi,ea=Xn,ta=Gn,ia=jn,na=Wn,aa="pako deflate (from Nodeca project)",pe={deflateInit:Vn,deflateInit2:Jn,deflateReset:Qn,deflateResetKeep:qn,deflateSetHeader:ea,deflate:ta,deflateEnd:ia,deflateSetDictionary:na,deflateInfo:aa},ra=(e,i)=>Object.prototype.hasOwnProperty.call(e,i),la=function(e){let i=Array.prototype.slice.call(arguments,1);for(;i.length;){let t=i.shift();if(t){if(typeof t!="object")throw new TypeError(t+"must be non-object");for(let n in t)ra(t,n)&&(e[n]=t[n])}}return e},fa=e=>{let i=0;for(let n=0,r=e.length;n<r;n++)i+=e[n].length;let t=new Uint8Array(i);for(let n=0,r=0,a=e.length;n<a;n++){let o=e[n];t.set(o,r),r+=o.length}return t},Pe={assign:la,flattenChunks:fa},Ai=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Ai=!1}var ze=new Uint8Array(256);for(let e=0;e<256;e++)ze[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;ze[254]=ze[254]=1;var oa=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let i,t,n,r,a,o=e.length,f=0;for(r=0;r<o;r++)t=e.charCodeAt(r),(t&64512)===55296&&r+1<o&&(n=e.charCodeAt(r+1),(n&64512)===56320&&(t=65536+(t-55296<<10)+(n-56320),r++)),f+=t<128?1:t<2048?2:t<65536?3:4;for(i=new Uint8Array(f),a=0,r=0;a<f;r++)t=e.charCodeAt(r),(t&64512)===55296&&r+1<o&&(n=e.charCodeAt(r+1),(n&64512)===56320&&(t=65536+(t-55296<<10)+(n-56320),r++)),t<128?i[a++]=t:t<2048?(i[a++]=192|t>>>6,i[a++]=128|t&63):t<65536?(i[a++]=224|t>>>12,i[a++]=128|t>>>6&63,i[a++]=128|t&63):(i[a++]=240|t>>>18,i[a++]=128|t>>>12&63,i[a++]=128|t>>>6&63,i[a++]=128|t&63);return i},_a=(e,i)=>{if(i<65534&&e.subarray&&Ai)return String.fromCharCode.apply(null,e.length===i?e:e.subarray(0,i));let t="";for(let n=0;n<i;n++)t+=String.fromCharCode(e[n]);return t},ha=(e,i)=>{let t=i||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,i));let n,r,a=new Array(t*2);for(r=0,n=0;n<t;){let o=e[n++];if(o<128){a[r++]=o;continue}let f=ze[o];if(f>4){a[r++]=65533,n+=f-1;continue}for(o&=f===2?31:f===3?15:7;f>1&&n<t;)o=o<<6|e[n++]&63,f--;if(f>1){a[r++]=65533;continue}o<65536?a[r++]=o:(o-=65536,a[r++]=55296|o>>10&1023,a[r++]=56320|o&1023)}return _a(a,r)},da=(e,i)=>{i=i||e.length,i>e.length&&(i=e.length);let t=i-1;for(;t>=0&&(e[t]&192)===128;)t--;return t<0||t===0?i:t+ze[e[t]]>i?t:i},Se={string2buf:oa,buf2string:ha,utf8border:da};function sa(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var Ri=sa,Ti=Object.prototype.toString,{Z_NO_FLUSH:ca,Z_SYNC_FLUSH:ua,Z_FULL_FLUSH:wa,Z_FINISH:ba,Z_OK:He,Z_STREAM_END:ga,Z_DEFAULT_COMPRESSION:pa,Z_DEFAULT_STRATEGY:xa,Z_DEFLATED:va}=de;function De(e){this.options=Pe.assign({level:pa,method:va,chunkSize:16384,windowBits:15,memLevel:8,strategy:xa},e||{});let i=this.options;i.raw&&i.windowBits>0?i.windowBits=-i.windowBits:i.gzip&&i.windowBits>0&&i.windowBits<16&&(i.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ri,this.strm.avail_out=0;let t=pe.deflateInit2(this.strm,i.level,i.method,i.windowBits,i.memLevel,i.strategy);if(t!==He)throw new Error(te[t]);if(i.header&&pe.deflateSetHeader(this.strm,i.header),i.dictionary){let n;if(typeof i.dictionary=="string"?n=Se.string2buf(i.dictionary):Ti.call(i.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(i.dictionary):n=i.dictionary,t=pe.deflateSetDictionary(this.strm,n),t!==He)throw new Error(te[t]);this._dict_set=!0}}De.prototype.push=function(e,i){let t=this.strm,n=this.options.chunkSize,r,a;if(this.ended)return!1;for(i===~~i?a=i:a=i===!0?ba:ca,typeof e=="string"?t.input=Se.string2buf(e):Ti.call(e)==="[object ArrayBuffer]"?t.input=new Uint8Array(e):t.input=e,t.next_in=0,t.avail_in=t.input.length;;){if(t.avail_out===0&&(t.output=new Uint8Array(n),t.next_out=0,t.avail_out=n),(a===ua||a===wa)&&t.avail_out<=6){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(r=pe.deflate(t,a),r===ga)return t.next_out>0&&this.onData(t.output.subarray(0,t.next_out)),r=pe.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===He;if(t.avail_out===0){this.onData(t.output);continue}if(a>0&&t.next_out>0){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(t.avail_in===0)break}return!0};De.prototype.onData=function(e){this.chunks.push(e)};De.prototype.onEnd=function(e){e===He&&(this.result=Pe.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function vt(e,i){let t=new De(i);if(t.push(e,!0),t.err)throw t.msg||te[t.err];return t.result}function ka(e,i){return i=i||{},i.raw=!0,vt(e,i)}function Ea(e,i){return i=i||{},i.gzip=!0,vt(e,i)}var ya=De,ma=vt,za=ka,Sa=Ea,Aa=de,Ra={Deflate:ya,deflate:ma,deflateRaw:za,gzip:Sa,constants:Aa},Le=16209,Ta=16191,Da=function(i,t){let n,r,a,o,f,c,l,_,y,s,h,u,T,k,g,S,p,d,m,D,w,A,E,b,x=i.state;n=i.next_in,E=i.input,r=n+(i.avail_in-5),a=i.next_out,b=i.output,o=a-(t-i.avail_out),f=a+(i.avail_out-257),c=x.dmax,l=x.wsize,_=x.whave,y=x.wnext,s=x.window,h=x.hold,u=x.bits,T=x.lencode,k=x.distcode,g=(1<<x.lenbits)-1,S=(1<<x.distbits)-1;e:do{u<15&&(h+=E[n++]<<u,u+=8,h+=E[n++]<<u,u+=8),p=T[h&g];t:for(;;){if(d=p>>>24,h>>>=d,u-=d,d=p>>>16&255,d===0)b[a++]=p&65535;else if(d&16){m=p&65535,d&=15,d&&(u<d&&(h+=E[n++]<<u,u+=8),m+=h&(1<<d)-1,h>>>=d,u-=d),u<15&&(h+=E[n++]<<u,u+=8,h+=E[n++]<<u,u+=8),p=k[h&S];i:for(;;){if(d=p>>>24,h>>>=d,u-=d,d=p>>>16&255,d&16){if(D=p&65535,d&=15,u<d&&(h+=E[n++]<<u,u+=8,u<d&&(h+=E[n++]<<u,u+=8)),D+=h&(1<<d)-1,D>c){i.msg="invalid distance too far back",x.mode=Le;break e}if(h>>>=d,u-=d,d=a-o,D>d){if(d=D-d,d>_&&x.sane){i.msg="invalid distance too far back",x.mode=Le;break e}if(w=0,A=s,y===0){if(w+=l-d,d<m){m-=d;do b[a++]=s[w++];while(--d);w=a-D,A=b}}else if(y<d){if(w+=l+y-d,d-=y,d<m){m-=d;do b[a++]=s[w++];while(--d);if(w=0,y<m){d=y,m-=d;do b[a++]=s[w++];while(--d);w=a-D,A=b}}}else if(w+=y-d,d<m){m-=d;do b[a++]=s[w++];while(--d);w=a-D,A=b}for(;m>2;)b[a++]=A[w++],b[a++]=A[w++],b[a++]=A[w++],m-=3;m&&(b[a++]=A[w++],m>1&&(b[a++]=A[w++]))}else{w=a-D;do b[a++]=b[w++],b[a++]=b[w++],b[a++]=b[w++],m-=3;while(m>2);m&&(b[a++]=b[w++],m>1&&(b[a++]=b[w++]))}}else if((d&64)===0){p=k[(p&65535)+(h&(1<<d)-1)];continue i}else{i.msg="invalid distance code",x.mode=Le;break e}break}}else if((d&64)===0){p=T[(p&65535)+(h&(1<<d)-1)];continue t}else if(d&32){x.mode=Ta;break e}else{i.msg="invalid literal/length code",x.mode=Le;break e}break}}while(n<r&&a<f);m=u>>3,n-=m,u-=m<<3,h&=(1<<u)-1,i.next_in=n,i.next_out=a,i.avail_in=n<r?5+(r-n):5-(n-r),i.avail_out=a<f?257+(f-a):257-(a-f),x.hold=h,x.bits=u},le=15,Zt=852,It=592,Ot=0,Qe=1,Nt=2,Za=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),Ia=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),Oa=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),Na=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),La=(e,i,t,n,r,a,o,f)=>{let c=f.bits,l=0,_=0,y=0,s=0,h=0,u=0,T=0,k=0,g=0,S=0,p,d,m,D,w,A=null,E,b=new Uint16Array(le+1),x=new Uint16Array(le+1),J=null,Et,Ie,Oe;for(l=0;l<=le;l++)b[l]=0;for(_=0;_<n;_++)b[i[t+_]]++;for(h=c,s=le;s>=1&&b[s]===0;s--);if(h>s&&(h=s),s===0)return r[a++]=1<<24|64<<16|0,r[a++]=1<<24|64<<16|0,f.bits=1,0;for(y=1;y<s&&b[y]===0;y++);for(h<y&&(h=y),k=1,l=1;l<=le;l++)if(k<<=1,k-=b[l],k<0)return-1;if(k>0&&(e===Ot||s!==1))return-1;for(x[1]=0,l=1;l<le;l++)x[l+1]=x[l]+b[l];for(_=0;_<n;_++)i[t+_]!==0&&(o[x[i[t+_]]++]=_);if(e===Ot?(A=J=o,E=20):e===Qe?(A=Za,J=Ia,E=257):(A=Oa,J=Na,E=0),S=0,_=0,l=y,w=a,u=h,T=0,m=-1,g=1<<h,D=g-1,e===Qe&&g>Zt||e===Nt&&g>It)return 1;for(;;){Et=l-T,o[_]+1<E?(Ie=0,Oe=o[_]):o[_]>=E?(Ie=J[o[_]-E],Oe=A[o[_]-E]):(Ie=96,Oe=0),p=1<<l-T,d=1<<u,y=d;do d-=p,r[w+(S>>T)+d]=Et<<24|Ie<<16|Oe|0;while(d!==0);for(p=1<<l-1;S&p;)p>>=1;if(p!==0?(S&=p-1,S+=p):S=0,_++,--b[l]===0){if(l===s)break;l=i[t+o[_]]}if(l>h&&(S&D)!==m){for(T===0&&(T=h),w+=y,u=l-T,k=1<<u;u+T<s&&(k-=b[u+T],!(k<=0));)u++,k<<=1;if(g+=1<<u,e===Qe&&g>Zt||e===Nt&&g>It)return 1;m=S&D,r[m]=h<<24|u<<16|w-a|0}}return S!==0&&(r[w+S]=l-T<<24|64<<16|0),f.bits=h,0},xe=La,Ua=0,Di=1,Zi=2,{Z_FINISH:Lt,Z_BLOCK:Ca,Z_TREES:Ue,Z_OK:ne,Z_STREAM_END:$a,Z_NEED_DICT:Fa,Z_STREAM_ERROR:$,Z_DATA_ERROR:Ii,Z_MEM_ERROR:Oi,Z_BUF_ERROR:Ma,Z_DEFLATED:Ut}=de,Xe=16180,Ct=16181,$t=16182,Ft=16183,Mt=16184,Ht=16185,Bt=16186,Kt=16187,Pt=16188,Xt=16189,Be=16190,K=16191,qe=16192,Yt=16193,et=16194,Gt=16195,jt=16196,Wt=16197,Vt=16198,Ce=16199,$e=16200,Jt=16201,Qt=16202,qt=16203,ei=16204,ti=16205,tt=16206,ii=16207,ni=16208,R=16209,Ni=16210,Li=16211,Ha=852,Ba=592,Ka=15,Pa=Ka,ai=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function Xa(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var ae=e=>{if(!e)return 1;let i=e.state;return!i||i.strm!==e||i.mode<Xe||i.mode>Li?1:0},Ui=e=>{if(ae(e))return $;let i=e.state;return e.total_in=e.total_out=i.total=0,e.msg="",i.wrap&&(e.adler=i.wrap&1),i.mode=Xe,i.last=0,i.havedict=0,i.flags=-1,i.dmax=32768,i.head=null,i.hold=0,i.bits=0,i.lencode=i.lendyn=new Int32Array(Ha),i.distcode=i.distdyn=new Int32Array(Ba),i.sane=1,i.back=-1,ne},Ci=e=>{if(ae(e))return $;let i=e.state;return i.wsize=0,i.whave=0,i.wnext=0,Ui(e)},$i=(e,i)=>{let t;if(ae(e))return $;let n=e.state;return i<0?(t=0,i=-i):(t=(i>>4)+5,i<48&&(i&=15)),i&&(i<8||i>15)?$:(n.window!==null&&n.wbits!==i&&(n.window=null),n.wrap=t,n.wbits=i,Ci(e))},Fi=(e,i)=>{if(!e)return $;let t=new Xa;e.state=t,t.strm=e,t.window=null,t.mode=Xe;let n=$i(e,i);return n!==ne&&(e.state=null),n},Ya=e=>Fi(e,Pa),ri=!0,it,nt,Ga=e=>{if(ri){it=new Int32Array(512),nt=new Int32Array(32);let i=0;for(;i<144;)e.lens[i++]=8;for(;i<256;)e.lens[i++]=9;for(;i<280;)e.lens[i++]=7;for(;i<288;)e.lens[i++]=8;for(xe(Di,e.lens,0,288,it,0,e.work,{bits:9}),i=0;i<32;)e.lens[i++]=5;xe(Zi,e.lens,0,32,nt,0,e.work,{bits:5}),ri=!1}e.lencode=it,e.lenbits=9,e.distcode=nt,e.distbits=5},Mi=(e,i,t,n)=>{let r,a=e.state;return a.window===null&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),n>=a.wsize?(a.window.set(i.subarray(t-a.wsize,t),0),a.wnext=0,a.whave=a.wsize):(r=a.wsize-a.wnext,r>n&&(r=n),a.window.set(i.subarray(t-n,t-n+r),a.wnext),n-=r,n?(a.window.set(i.subarray(t-n,t),0),a.wnext=n,a.whave=a.wsize):(a.wnext+=r,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=r))),0},ja=(e,i)=>{let t,n,r,a,o,f,c,l,_,y,s,h,u,T,k=0,g,S,p,d,m,D,w,A,E=new Uint8Array(4),b,x,J=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(ae(e)||!e.output||!e.input&&e.avail_in!==0)return $;t=e.state,t.mode===K&&(t.mode=qe),o=e.next_out,r=e.output,c=e.avail_out,a=e.next_in,n=e.input,f=e.avail_in,l=t.hold,_=t.bits,y=f,s=c,A=ne;e:for(;;)switch(t.mode){case Xe:if(t.wrap===0){t.mode=qe;break}for(;_<16;){if(f===0)break e;f--,l+=n[a++]<<_,_+=8}if(t.wrap&2&&l===35615){t.wbits===0&&(t.wbits=15),t.check=0,E[0]=l&255,E[1]=l>>>8&255,t.check=Z(t.check,E,2,0),l=0,_=0,t.mode=Ct;break}if(t.head&&(t.head.done=!1),!(t.wrap&1)||(((l&255)<<8)+(l>>8))%31){e.msg="incorrect header check",t.mode=R;break}if((l&15)!==Ut){e.msg="unknown compression method",t.mode=R;break}if(l>>>=4,_-=4,w=(l&15)+8,t.wbits===0&&(t.wbits=w),w>15||w>t.wbits){e.msg="invalid window size",t.mode=R;break}t.dmax=1<<t.wbits,t.flags=0,e.adler=t.check=1,t.mode=l&512?Xt:K,l=0,_=0;break;case Ct:for(;_<16;){if(f===0)break e;f--,l+=n[a++]<<_,_+=8}if(t.flags=l,(t.flags&255)!==Ut){e.msg="unknown compression method",t.mode=R;break}if(t.flags&57344){e.msg="unknown header flags set",t.mode=R;break}t.head&&(t.head.text=l>>8&1),t.flags&512&&t.wrap&4&&(E[0]=l&255,E[1]=l>>>8&255,t.check=Z(t.check,E,2,0)),l=0,_=0,t.mode=$t;case $t:for(;_<32;){if(f===0)break e;f--,l+=n[a++]<<_,_+=8}t.head&&(t.head.time=l),t.flags&512&&t.wrap&4&&(E[0]=l&255,E[1]=l>>>8&255,E[2]=l>>>16&255,E[3]=l>>>24&255,t.check=Z(t.check,E,4,0)),l=0,_=0,t.mode=Ft;case Ft:for(;_<16;){if(f===0)break e;f--,l+=n[a++]<<_,_+=8}t.head&&(t.head.xflags=l&255,t.head.os=l>>8),t.flags&512&&t.wrap&4&&(E[0]=l&255,E[1]=l>>>8&255,t.check=Z(t.check,E,2,0)),l=0,_=0,t.mode=Mt;case Mt:if(t.flags&1024){for(;_<16;){if(f===0)break e;f--,l+=n[a++]<<_,_+=8}t.length=l,t.head&&(t.head.extra_len=l),t.flags&512&&t.wrap&4&&(E[0]=l&255,E[1]=l>>>8&255,t.check=Z(t.check,E,2,0)),l=0,_=0}else t.head&&(t.head.extra=null);t.mode=Ht;case Ht:if(t.flags&1024&&(h=t.length,h>f&&(h=f),h&&(t.head&&(w=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(n.subarray(a,a+h),w)),t.flags&512&&t.wrap&4&&(t.check=Z(t.check,n,h,a)),f-=h,a+=h,t.length-=h),t.length))break e;t.length=0,t.mode=Bt;case Bt:if(t.flags&2048){if(f===0)break e;h=0;do w=n[a+h++],t.head&&w&&t.length<65536&&(t.head.name+=String.fromCharCode(w));while(w&&h<f);if(t.flags&512&&t.wrap&4&&(t.check=Z(t.check,n,h,a)),f-=h,a+=h,w)break e}else t.head&&(t.head.name=null);t.length=0,t.mode=Kt;case Kt:if(t.flags&4096){if(f===0)break e;h=0;do w=n[a+h++],t.head&&w&&t.length<65536&&(t.head.comment+=String.fromCharCode(w));while(w&&h<f);if(t.flags&512&&t.wrap&4&&(t.check=Z(t.check,n,h,a)),f-=h,a+=h,w)break e}else t.head&&(t.head.comment=null);t.mode=Pt;case Pt:if(t.flags&512){for(;_<16;){if(f===0)break e;f--,l+=n[a++]<<_,_+=8}if(t.wrap&4&&l!==(t.check&65535)){e.msg="header crc mismatch",t.mode=R;break}l=0,_=0}t.head&&(t.head.hcrc=t.flags>>9&1,t.head.done=!0),e.adler=t.check=0,t.mode=K;break;case Xt:for(;_<32;){if(f===0)break e;f--,l+=n[a++]<<_,_+=8}e.adler=t.check=ai(l),l=0,_=0,t.mode=Be;case Be:if(t.havedict===0)return e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=f,t.hold=l,t.bits=_,Fa;e.adler=t.check=1,t.mode=K;case K:if(i===Ca||i===Ue)break e;case qe:if(t.last){l>>>=_&7,_-=_&7,t.mode=tt;break}for(;_<3;){if(f===0)break e;f--,l+=n[a++]<<_,_+=8}switch(t.last=l&1,l>>>=1,_-=1,l&3){case 0:t.mode=Yt;break;case 1:if(Ga(t),t.mode=Ce,i===Ue){l>>>=2,_-=2;break e}break;case 2:t.mode=jt;break;case 3:e.msg="invalid block type",t.mode=R}l>>>=2,_-=2;break;case Yt:for(l>>>=_&7,_-=_&7;_<32;){if(f===0)break e;f--,l+=n[a++]<<_,_+=8}if((l&65535)!==(l>>>16^65535)){e.msg="invalid stored block lengths",t.mode=R;break}if(t.length=l&65535,l=0,_=0,t.mode=et,i===Ue)break e;case et:t.mode=Gt;case Gt:if(h=t.length,h){if(h>f&&(h=f),h>c&&(h=c),h===0)break e;r.set(n.subarray(a,a+h),o),f-=h,a+=h,c-=h,o+=h,t.length-=h;break}t.mode=K;break;case jt:for(;_<14;){if(f===0)break e;f--,l+=n[a++]<<_,_+=8}if(t.nlen=(l&31)+257,l>>>=5,_-=5,t.ndist=(l&31)+1,l>>>=5,_-=5,t.ncode=(l&15)+4,l>>>=4,_-=4,t.nlen>286||t.ndist>30){e.msg="too many length or distance symbols",t.mode=R;break}t.have=0,t.mode=Wt;case Wt:for(;t.have<t.ncode;){for(;_<3;){if(f===0)break e;f--,l+=n[a++]<<_,_+=8}t.lens[J[t.have++]]=l&7,l>>>=3,_-=3}for(;t.have<19;)t.lens[J[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,b={bits:t.lenbits},A=xe(Ua,t.lens,0,19,t.lencode,0,t.work,b),t.lenbits=b.bits,A){e.msg="invalid code lengths set",t.mode=R;break}t.have=0,t.mode=Vt;case Vt:for(;t.have<t.nlen+t.ndist;){for(;k=t.lencode[l&(1<<t.lenbits)-1],g=k>>>24,S=k>>>16&255,p=k&65535,!(g<=_);){if(f===0)break e;f--,l+=n[a++]<<_,_+=8}if(p<16)l>>>=g,_-=g,t.lens[t.have++]=p;else{if(p===16){for(x=g+2;_<x;){if(f===0)break e;f--,l+=n[a++]<<_,_+=8}if(l>>>=g,_-=g,t.have===0){e.msg="invalid bit length repeat",t.mode=R;break}w=t.lens[t.have-1],h=3+(l&3),l>>>=2,_-=2}else if(p===17){for(x=g+3;_<x;){if(f===0)break e;f--,l+=n[a++]<<_,_+=8}l>>>=g,_-=g,w=0,h=3+(l&7),l>>>=3,_-=3}else{for(x=g+7;_<x;){if(f===0)break e;f--,l+=n[a++]<<_,_+=8}l>>>=g,_-=g,w=0,h=11+(l&127),l>>>=7,_-=7}if(t.have+h>t.nlen+t.ndist){e.msg="invalid bit length repeat",t.mode=R;break}for(;h--;)t.lens[t.have++]=w}}if(t.mode===R)break;if(t.lens[256]===0){e.msg="invalid code -- missing end-of-block",t.mode=R;break}if(t.lenbits=9,b={bits:t.lenbits},A=xe(Di,t.lens,0,t.nlen,t.lencode,0,t.work,b),t.lenbits=b.bits,A){e.msg="invalid literal/lengths set",t.mode=R;break}if(t.distbits=6,t.distcode=t.distdyn,b={bits:t.distbits},A=xe(Zi,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,b),t.distbits=b.bits,A){e.msg="invalid distances set",t.mode=R;break}if(t.mode=Ce,i===Ue)break e;case Ce:t.mode=$e;case $e:if(f>=6&&c>=258){e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=f,t.hold=l,t.bits=_,Da(e,s),o=e.next_out,r=e.output,c=e.avail_out,a=e.next_in,n=e.input,f=e.avail_in,l=t.hold,_=t.bits,t.mode===K&&(t.back=-1);break}for(t.back=0;k=t.lencode[l&(1<<t.lenbits)-1],g=k>>>24,S=k>>>16&255,p=k&65535,!(g<=_);){if(f===0)break e;f--,l+=n[a++]<<_,_+=8}if(S&&(S&240)===0){for(d=g,m=S,D=p;k=t.lencode[D+((l&(1<<d+m)-1)>>d)],g=k>>>24,S=k>>>16&255,p=k&65535,!(d+g<=_);){if(f===0)break e;f--,l+=n[a++]<<_,_+=8}l>>>=d,_-=d,t.back+=d}if(l>>>=g,_-=g,t.back+=g,t.length=p,S===0){t.mode=ti;break}if(S&32){t.back=-1,t.mode=K;break}if(S&64){e.msg="invalid literal/length code",t.mode=R;break}t.extra=S&15,t.mode=Jt;case Jt:if(t.extra){for(x=t.extra;_<x;){if(f===0)break e;f--,l+=n[a++]<<_,_+=8}t.length+=l&(1<<t.extra)-1,l>>>=t.extra,_-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=Qt;case Qt:for(;k=t.distcode[l&(1<<t.distbits)-1],g=k>>>24,S=k>>>16&255,p=k&65535,!(g<=_);){if(f===0)break e;f--,l+=n[a++]<<_,_+=8}if((S&240)===0){for(d=g,m=S,D=p;k=t.distcode[D+((l&(1<<d+m)-1)>>d)],g=k>>>24,S=k>>>16&255,p=k&65535,!(d+g<=_);){if(f===0)break e;f--,l+=n[a++]<<_,_+=8}l>>>=d,_-=d,t.back+=d}if(l>>>=g,_-=g,t.back+=g,S&64){e.msg="invalid distance code",t.mode=R;break}t.offset=p,t.extra=S&15,t.mode=qt;case qt:if(t.extra){for(x=t.extra;_<x;){if(f===0)break e;f--,l+=n[a++]<<_,_+=8}t.offset+=l&(1<<t.extra)-1,l>>>=t.extra,_-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){e.msg="invalid distance too far back",t.mode=R;break}t.mode=ei;case ei:if(c===0)break e;if(h=s-c,t.offset>h){if(h=t.offset-h,h>t.whave&&t.sane){e.msg="invalid distance too far back",t.mode=R;break}h>t.wnext?(h-=t.wnext,u=t.wsize-h):u=t.wnext-h,h>t.length&&(h=t.length),T=t.window}else T=r,u=o-t.offset,h=t.length;h>c&&(h=c),c-=h,t.length-=h;do r[o++]=T[u++];while(--h);t.length===0&&(t.mode=$e);break;case ti:if(c===0)break e;r[o++]=t.length,c--,t.mode=$e;break;case tt:if(t.wrap){for(;_<32;){if(f===0)break e;f--,l|=n[a++]<<_,_+=8}if(s-=c,e.total_out+=s,t.total+=s,t.wrap&4&&s&&(e.adler=t.check=t.flags?Z(t.check,r,s,o-s):me(t.check,r,s,o-s)),s=c,t.wrap&4&&(t.flags?l:ai(l))!==t.check){e.msg="incorrect data check",t.mode=R;break}l=0,_=0}t.mode=ii;case ii:if(t.wrap&&t.flags){for(;_<32;){if(f===0)break e;f--,l+=n[a++]<<_,_+=8}if(t.wrap&4&&l!==(t.total&4294967295)){e.msg="incorrect length check",t.mode=R;break}l=0,_=0}t.mode=ni;case ni:A=$a;break e;case R:A=Ii;break e;case Ni:return Oi;case Li:default:return $}return e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=f,t.hold=l,t.bits=_,(t.wsize||s!==e.avail_out&&t.mode<R&&(t.mode<tt||i!==Lt))&&Mi(e,e.output,e.next_out,s-e.avail_out),y-=e.avail_in,s-=e.avail_out,e.total_in+=y,e.total_out+=s,t.total+=s,t.wrap&4&&s&&(e.adler=t.check=t.flags?Z(t.check,r,s,e.next_out-s):me(t.check,r,s,e.next_out-s)),e.data_type=t.bits+(t.last?64:0)+(t.mode===K?128:0)+(t.mode===Ce||t.mode===et?256:0),(y===0&&s===0||i===Lt)&&A===ne&&(A=Ma),A},Wa=e=>{if(ae(e))return $;let i=e.state;return i.window&&(i.window=null),e.state=null,ne},Va=(e,i)=>{if(ae(e))return $;let t=e.state;return(t.wrap&2)===0?$:(t.head=i,i.done=!1,ne)},Ja=(e,i)=>{let t=i.length,n,r,a;return ae(e)||(n=e.state,n.wrap!==0&&n.mode!==Be)?$:n.mode===Be&&(r=1,r=me(r,i,t,0),r!==n.check)?Ii:(a=Mi(e,i,t,t),a?(n.mode=Ni,Oi):(n.havedict=1,ne))},Qa=Ci,qa=$i,er=Ui,tr=Ya,ir=Fi,nr=ja,ar=Wa,rr=Va,lr=Ja,fr="pako inflate (from Nodeca project)",X={inflateReset:Qa,inflateReset2:qa,inflateResetKeep:er,inflateInit:tr,inflateInit2:ir,inflate:nr,inflateEnd:ar,inflateGetHeader:rr,inflateSetDictionary:lr,inflateInfo:fr};function or(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var _r=or,Hi=Object.prototype.toString,{Z_NO_FLUSH:hr,Z_FINISH:dr,Z_OK:Ae,Z_STREAM_END:at,Z_NEED_DICT:rt,Z_STREAM_ERROR:sr,Z_DATA_ERROR:li,Z_MEM_ERROR:cr}=de;function Ze(e){this.options=Pe.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});let i=this.options;i.raw&&i.windowBits>=0&&i.windowBits<16&&(i.windowBits=-i.windowBits,i.windowBits===0&&(i.windowBits=-15)),i.windowBits>=0&&i.windowBits<16&&!(e&&e.windowBits)&&(i.windowBits+=32),i.windowBits>15&&i.windowBits<48&&(i.windowBits&15)===0&&(i.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ri,this.strm.avail_out=0;let t=X.inflateInit2(this.strm,i.windowBits);if(t!==Ae)throw new Error(te[t]);if(this.header=new _r,X.inflateGetHeader(this.strm,this.header),i.dictionary&&(typeof i.dictionary=="string"?i.dictionary=Se.string2buf(i.dictionary):Hi.call(i.dictionary)==="[object ArrayBuffer]"&&(i.dictionary=new Uint8Array(i.dictionary)),i.raw&&(t=X.inflateSetDictionary(this.strm,i.dictionary),t!==Ae)))throw new Error(te[t])}Ze.prototype.push=function(e,i){let t=this.strm,n=this.options.chunkSize,r=this.options.dictionary,a,o,f;if(this.ended)return!1;for(i===~~i?o=i:o=i===!0?dr:hr,Hi.call(e)==="[object ArrayBuffer]"?t.input=new Uint8Array(e):t.input=e,t.next_in=0,t.avail_in=t.input.length;;){for(t.avail_out===0&&(t.output=new Uint8Array(n),t.next_out=0,t.avail_out=n),a=X.inflate(t,o),a===rt&&r&&(a=X.inflateSetDictionary(t,r),a===Ae?a=X.inflate(t,o):a===li&&(a=rt));t.avail_in>0&&a===at&&t.state.wrap>0&&e[t.next_in]!==0;)X.inflateReset(t),a=X.inflate(t,o);switch(a){case sr:case li:case rt:case cr:return this.onEnd(a),this.ended=!0,!1}if(f=t.avail_out,t.next_out&&(t.avail_out===0||a===at))if(this.options.to==="string"){let c=Se.utf8border(t.output,t.next_out),l=t.next_out-c,_=Se.buf2string(t.output,c);t.next_out=l,t.avail_out=n-l,l&&t.output.set(t.output.subarray(c,c+l),0),this.onData(_)}else this.onData(t.output.length===t.next_out?t.output:t.output.subarray(0,t.next_out));if(!(a===Ae&&f===0)){if(a===at)return a=X.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(t.avail_in===0)break}}return!0};Ze.prototype.onData=function(e){this.chunks.push(e)};Ze.prototype.onEnd=function(e){e===Ae&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Pe.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function kt(e,i){let t=new Ze(i);if(t.push(e),t.err)throw t.msg||te[t.err];return t.result}function ur(e,i){return i=i||{},i.raw=!0,kt(e,i)}var wr=Ze,br=kt,gr=ur,pr=kt,xr=de,vr={Inflate:wr,inflate:br,inflateRaw:gr,ungzip:pr,constants:xr},{Deflate:Er,deflate:yr,deflateRaw:mr,gzip:zr}=Ra,{Inflate:Sr,inflate:kr,inflateRaw:Ar,ungzip:Rr}=vr;var Tr=kr;export{Tr as a};
1
+ function he(e){let i=e.length;for(;--i>=0;)e[i]=0}var Bi=0,fi=1,Ki=2,Pi=3,Xi=258,wt=29,Re=256,ve=Re+1+wt,fe=30,bt=19,oi=2*ve+1,Q=15,Ye=16,Yi=7,gt=256,_i=16,hi=17,di=18,lt=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),Fe=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),Gi=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),si=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ji=512,P=new Array((ve+2)*2);he(P);var ge=new Array(fe*2);he(ge);var ke=new Array(ji);he(ke);var Ee=new Array(Xi-Pi+1);he(Ee);var pt=new Array(wt);he(pt);var Me=new Array(fe);he(Me);function Ge(e,i,t,n,r){this.static_tree=e,this.extra_bits=i,this.extra_base=t,this.elems=n,this.max_length=r,this.has_stree=e&&e.length}var ci,ui,wi;function je(e,i){this.dyn_tree=e,this.max_code=0,this.stat_desc=i}var bi=e=>e<256?ke[e]:ke[256+(e>>>7)],ye=(e,i)=>{e.pending_buf[e.pending++]=i&255,e.pending_buf[e.pending++]=i>>>8&255},N=(e,i,t)=>{e.bi_valid>Ye-t?(e.bi_buf|=i<<e.bi_valid&65535,ye(e,e.bi_buf),e.bi_buf=i>>Ye-e.bi_valid,e.bi_valid+=t-Ye):(e.bi_buf|=i<<e.bi_valid&65535,e.bi_valid+=t)},M=(e,i,t)=>{N(e,t[i*2],t[i*2+1])},gi=(e,i)=>{let t=0;do t|=e&1,e>>>=1,t<<=1;while(--i>0);return t>>>1},Wi=e=>{e.bi_valid===16?(ye(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},Vi=(e,i)=>{let t=i.dyn_tree,n=i.max_code,r=i.stat_desc.static_tree,a=i.stat_desc.has_stree,o=i.stat_desc.extra_bits,f=i.stat_desc.extra_base,c=i.stat_desc.max_length,l,_,y,s,h,u,T=0;for(s=0;s<=Q;s++)e.bl_count[s]=0;for(t[e.heap[e.heap_max]*2+1]=0,l=e.heap_max+1;l<oi;l++)_=e.heap[l],s=t[t[_*2+1]*2+1]+1,s>c&&(s=c,T++),t[_*2+1]=s,!(_>n)&&(e.bl_count[s]++,h=0,_>=f&&(h=o[_-f]),u=t[_*2],e.opt_len+=u*(s+h),a&&(e.static_len+=u*(r[_*2+1]+h)));if(T!==0){do{for(s=c-1;e.bl_count[s]===0;)s--;e.bl_count[s]--,e.bl_count[s+1]+=2,e.bl_count[c]--,T-=2}while(T>0);for(s=c;s!==0;s--)for(_=e.bl_count[s];_!==0;)y=e.heap[--l],!(y>n)&&(t[y*2+1]!==s&&(e.opt_len+=(s-t[y*2+1])*t[y*2],t[y*2+1]=s),_--)}},pi=(e,i,t)=>{let n=new Array(Q+1),r=0,a,o;for(a=1;a<=Q;a++)r=r+t[a-1]<<1,n[a]=r;for(o=0;o<=i;o++){let f=e[o*2+1];f!==0&&(e[o*2]=gi(n[f]++,f))}},Ji=()=>{let e,i,t,n,r,a=new Array(Q+1);for(t=0,n=0;n<wt-1;n++)for(pt[n]=t,e=0;e<1<<lt[n];e++)Ee[t++]=n;for(Ee[t-1]=n,r=0,n=0;n<16;n++)for(Me[n]=r,e=0;e<1<<Fe[n];e++)ke[r++]=n;for(r>>=7;n<fe;n++)for(Me[n]=r<<7,e=0;e<1<<Fe[n]-7;e++)ke[256+r++]=n;for(i=0;i<=Q;i++)a[i]=0;for(e=0;e<=143;)P[e*2+1]=8,e++,a[8]++;for(;e<=255;)P[e*2+1]=9,e++,a[9]++;for(;e<=279;)P[e*2+1]=7,e++,a[7]++;for(;e<=287;)P[e*2+1]=8,e++,a[8]++;for(pi(P,ve+1,a),e=0;e<fe;e++)ge[e*2+1]=5,ge[e*2]=gi(e,5);ci=new Ge(P,lt,Re+1,ve,Q),ui=new Ge(ge,Fe,0,fe,Q),wi=new Ge(new Array(0),Gi,0,bt,Yi)},xi=e=>{let i;for(i=0;i<ve;i++)e.dyn_ltree[i*2]=0;for(i=0;i<fe;i++)e.dyn_dtree[i*2]=0;for(i=0;i<bt;i++)e.bl_tree[i*2]=0;e.dyn_ltree[gt*2]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},vi=e=>{e.bi_valid>8?ye(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},yt=(e,i,t,n)=>{let r=i*2,a=t*2;return e[r]<e[a]||e[r]===e[a]&&n[i]<=n[t]},We=(e,i,t)=>{let n=e.heap[t],r=t<<1;for(;r<=e.heap_len&&(r<e.heap_len&&yt(i,e.heap[r+1],e.heap[r],e.depth)&&r++,!yt(i,n,e.heap[r],e.depth));)e.heap[t]=e.heap[r],t=r,r<<=1;e.heap[t]=n},mt=(e,i,t)=>{let n,r,a=0,o,f;if(e.sym_next!==0)do n=e.pending_buf[e.sym_buf+a++]&255,n+=(e.pending_buf[e.sym_buf+a++]&255)<<8,r=e.pending_buf[e.sym_buf+a++],n===0?M(e,r,i):(o=Ee[r],M(e,o+Re+1,i),f=lt[o],f!==0&&(r-=pt[o],N(e,r,f)),n--,o=bi(n),M(e,o,t),f=Fe[o],f!==0&&(n-=Me[o],N(e,n,f)));while(a<e.sym_next);M(e,gt,i)},ft=(e,i)=>{let t=i.dyn_tree,n=i.stat_desc.static_tree,r=i.stat_desc.has_stree,a=i.stat_desc.elems,o,f,c=-1,l;for(e.heap_len=0,e.heap_max=oi,o=0;o<a;o++)t[o*2]!==0?(e.heap[++e.heap_len]=c=o,e.depth[o]=0):t[o*2+1]=0;for(;e.heap_len<2;)l=e.heap[++e.heap_len]=c<2?++c:0,t[l*2]=1,e.depth[l]=0,e.opt_len--,r&&(e.static_len-=n[l*2+1]);for(i.max_code=c,o=e.heap_len>>1;o>=1;o--)We(e,t,o);l=a;do o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],We(e,t,1),f=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=f,t[l*2]=t[o*2]+t[f*2],e.depth[l]=(e.depth[o]>=e.depth[f]?e.depth[o]:e.depth[f])+1,t[o*2+1]=t[f*2+1]=l,e.heap[1]=l++,We(e,t,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],Vi(e,i),pi(t,c,e.bl_count)},zt=(e,i,t)=>{let n,r=-1,a,o=i[1],f=0,c=7,l=4;for(o===0&&(c=138,l=3),i[(t+1)*2+1]=65535,n=0;n<=t;n++)a=o,o=i[(n+1)*2+1],!(++f<c&&a===o)&&(f<l?e.bl_tree[a*2]+=f:a!==0?(a!==r&&e.bl_tree[a*2]++,e.bl_tree[_i*2]++):f<=10?e.bl_tree[hi*2]++:e.bl_tree[di*2]++,f=0,r=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4))},St=(e,i,t)=>{let n,r=-1,a,o=i[1],f=0,c=7,l=4;for(o===0&&(c=138,l=3),n=0;n<=t;n++)if(a=o,o=i[(n+1)*2+1],!(++f<c&&a===o)){if(f<l)do M(e,a,e.bl_tree);while(--f!==0);else a!==0?(a!==r&&(M(e,a,e.bl_tree),f--),M(e,_i,e.bl_tree),N(e,f-3,2)):f<=10?(M(e,hi,e.bl_tree),N(e,f-3,3)):(M(e,di,e.bl_tree),N(e,f-11,7));f=0,r=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4)}},Qi=e=>{let i;for(zt(e,e.dyn_ltree,e.l_desc.max_code),zt(e,e.dyn_dtree,e.d_desc.max_code),ft(e,e.bl_desc),i=bt-1;i>=3&&e.bl_tree[si[i]*2+1]===0;i--);return e.opt_len+=3*(i+1)+5+5+4,i},qi=(e,i,t,n)=>{let r;for(N(e,i-257,5),N(e,t-1,5),N(e,n-4,4),r=0;r<n;r++)N(e,e.bl_tree[si[r]*2+1],3);St(e,e.dyn_ltree,i-1),St(e,e.dyn_dtree,t-1)},en=e=>{let i=4093624447,t;for(t=0;t<=31;t++,i>>>=1)if(i&1&&e.dyn_ltree[t*2]!==0)return 0;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return 1;for(t=32;t<Re;t++)if(e.dyn_ltree[t*2]!==0)return 1;return 0},At=!1,tn=e=>{At||(Ji(),At=!0),e.l_desc=new je(e.dyn_ltree,ci),e.d_desc=new je(e.dyn_dtree,ui),e.bl_desc=new je(e.bl_tree,wi),e.bi_buf=0,e.bi_valid=0,xi(e)},ki=(e,i,t,n)=>{N(e,(Bi<<1)+(n?1:0),3),vi(e),ye(e,t),ye(e,~t),t&&e.pending_buf.set(e.window.subarray(i,i+t),e.pending),e.pending+=t},nn=e=>{N(e,fi<<1,3),M(e,gt,P),Wi(e)},an=(e,i,t,n)=>{let r,a,o=0;e.level>0?(e.strm.data_type===2&&(e.strm.data_type=en(e)),ft(e,e.l_desc),ft(e,e.d_desc),o=Qi(e),r=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=r&&(r=a)):r=a=t+5,t+4<=r&&i!==-1?ki(e,i,t,n):e.strategy===4||a===r?(N(e,(fi<<1)+(n?1:0),3),mt(e,P,ge)):(N(e,(Ki<<1)+(n?1:0),3),qi(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),mt(e,e.dyn_ltree,e.dyn_dtree)),xi(e),n&&vi(e)},rn=(e,i,t)=>(e.pending_buf[e.sym_buf+e.sym_next++]=i,e.pending_buf[e.sym_buf+e.sym_next++]=i>>8,e.pending_buf[e.sym_buf+e.sym_next++]=t,i===0?e.dyn_ltree[t*2]++:(e.matches++,i--,e.dyn_ltree[(Ee[t]+Re+1)*2]++,e.dyn_dtree[bi(i)*2]++),e.sym_next===e.sym_end),ln=tn,fn=ki,on=an,_n=rn,hn=nn,dn={_tr_init:ln,_tr_stored_block:fn,_tr_flush_block:on,_tr_tally:_n,_tr_align:hn},sn=(e,i,t,n)=>{let r=e&65535|0,a=e>>>16&65535|0,o=0;for(;t!==0;){o=t>2e3?2e3:t,t-=o;do r=r+i[n++]|0,a=a+r|0;while(--o);r%=65521,a%=65521}return r|a<<16|0},me=sn,cn=()=>{let e,i=[];for(var t=0;t<256;t++){e=t;for(var n=0;n<8;n++)e=e&1?3988292384^e>>>1:e>>>1;i[t]=e}return i},un=new Uint32Array(cn()),wn=(e,i,t,n)=>{let r=un,a=n+t;e^=-1;for(let o=n;o<a;o++)e=e>>>8^r[(e^i[o])&255];return e^-1},Z=wn,te={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},de={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},{_tr_init:bn,_tr_stored_block:ot,_tr_flush_block:gn,_tr_tally:j,_tr_align:pn}=dn,{Z_NO_FLUSH:W,Z_PARTIAL_FLUSH:xn,Z_FULL_FLUSH:vn,Z_FINISH:C,Z_BLOCK:Rt,Z_OK:I,Z_STREAM_END:Tt,Z_STREAM_ERROR:H,Z_DATA_ERROR:kn,Z_BUF_ERROR:Ve,Z_DEFAULT_COMPRESSION:En,Z_FILTERED:yn,Z_HUFFMAN_ONLY:Ne,Z_RLE:mn,Z_FIXED:zn,Z_DEFAULT_STRATEGY:Sn,Z_UNKNOWN:An,Z_DEFLATED:Ke}=de,Rn=9,Tn=15,Dn=8,Zn=29,In=256,_t=In+1+Zn,On=30,Nn=19,Ln=2*_t+1,Un=15,v=3,G=258,B=G+v+1,Cn=32,oe=42,xt=57,ht=69,dt=73,st=91,ct=103,q=113,we=666,O=1,se=2,ie=3,ce=4,$n=3,ee=(e,i)=>(e.msg=te[i],i),Dt=e=>e*2-(e>4?9:0),Y=e=>{let i=e.length;for(;--i>=0;)e[i]=0},Fn=e=>{let i,t,n,r=e.w_size;i=e.hash_size,n=i;do t=e.head[--n],e.head[n]=t>=r?t-r:0;while(--i);i=r,n=i;do t=e.prev[--n],e.prev[n]=t>=r?t-r:0;while(--i)},Mn=(e,i,t)=>(i<<e.hash_shift^t)&e.hash_mask,V=Mn,L=e=>{let i=e.state,t=i.pending;t>e.avail_out&&(t=e.avail_out),t!==0&&(e.output.set(i.pending_buf.subarray(i.pending_out,i.pending_out+t),e.next_out),e.next_out+=t,i.pending_out+=t,e.total_out+=t,e.avail_out-=t,i.pending-=t,i.pending===0&&(i.pending_out=0))},U=(e,i)=>{gn(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,i),e.block_start=e.strstart,L(e.strm)},z=(e,i)=>{e.pending_buf[e.pending++]=i},ue=(e,i)=>{e.pending_buf[e.pending++]=i>>>8&255,e.pending_buf[e.pending++]=i&255},ut=(e,i,t,n)=>{let r=e.avail_in;return r>n&&(r=n),r===0?0:(e.avail_in-=r,i.set(e.input.subarray(e.next_in,e.next_in+r),t),e.state.wrap===1?e.adler=me(e.adler,i,r,t):e.state.wrap===2&&(e.adler=Z(e.adler,i,r,t)),e.next_in+=r,e.total_in+=r,r)},Ei=(e,i)=>{let t=e.max_chain_length,n=e.strstart,r,a,o=e.prev_length,f=e.nice_match,c=e.strstart>e.w_size-B?e.strstart-(e.w_size-B):0,l=e.window,_=e.w_mask,y=e.prev,s=e.strstart+G,h=l[n+o-1],u=l[n+o];e.prev_length>=e.good_match&&(t>>=2),f>e.lookahead&&(f=e.lookahead);do if(r=i,!(l[r+o]!==u||l[r+o-1]!==h||l[r]!==l[n]||l[++r]!==l[n+1])){n+=2,r++;do;while(l[++n]===l[++r]&&l[++n]===l[++r]&&l[++n]===l[++r]&&l[++n]===l[++r]&&l[++n]===l[++r]&&l[++n]===l[++r]&&l[++n]===l[++r]&&l[++n]===l[++r]&&n<s);if(a=G-(s-n),n=s-G,a>o){if(e.match_start=i,o=a,a>=f)break;h=l[n+o-1],u=l[n+o]}}while((i=y[i&_])>c&&--t!==0);return o<=e.lookahead?o:e.lookahead},_e=e=>{let i=e.w_size,t,n,r;do{if(n=e.window_size-e.lookahead-e.strstart,e.strstart>=i+(i-B)&&(e.window.set(e.window.subarray(i,i+i-n),0),e.match_start-=i,e.strstart-=i,e.block_start-=i,e.insert>e.strstart&&(e.insert=e.strstart),Fn(e),n+=i),e.strm.avail_in===0)break;if(t=ut(e.strm,e.window,e.strstart+e.lookahead,n),e.lookahead+=t,e.lookahead+e.insert>=v)for(r=e.strstart-e.insert,e.ins_h=e.window[r],e.ins_h=V(e,e.ins_h,e.window[r+1]);e.insert&&(e.ins_h=V(e,e.ins_h,e.window[r+v-1]),e.prev[r&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=r,r++,e.insert--,!(e.lookahead+e.insert<v)););}while(e.lookahead<B&&e.strm.avail_in!==0)},yi=(e,i)=>{let t=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,n,r,a,o=0,f=e.strm.avail_in;do{if(n=65535,a=e.bi_valid+42>>3,e.strm.avail_out<a||(a=e.strm.avail_out-a,r=e.strstart-e.block_start,n>r+e.strm.avail_in&&(n=r+e.strm.avail_in),n>a&&(n=a),n<t&&(n===0&&i!==C||i===W||n!==r+e.strm.avail_in)))break;o=i===C&&n===r+e.strm.avail_in?1:0,ot(e,0,0,o),e.pending_buf[e.pending-4]=n,e.pending_buf[e.pending-3]=n>>8,e.pending_buf[e.pending-2]=~n,e.pending_buf[e.pending-1]=~n>>8,L(e.strm),r&&(r>n&&(r=n),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+r),e.strm.next_out),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r,e.block_start+=r,n-=r),n&&(ut(e.strm,e.strm.output,e.strm.next_out,n),e.strm.next_out+=n,e.strm.avail_out-=n,e.strm.total_out+=n)}while(o===0);return f-=e.strm.avail_in,f&&(f>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=f&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-f,e.strm.next_in),e.strstart),e.strstart+=f,e.insert+=f>e.w_size-e.insert?e.w_size-e.insert:f),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),o?ce:i!==W&&i!==C&&e.strm.avail_in===0&&e.strstart===e.block_start?se:(a=e.window_size-e.strstart,e.strm.avail_in>a&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,a+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),a>e.strm.avail_in&&(a=e.strm.avail_in),a&&(ut(e.strm,e.window,e.strstart,a),e.strstart+=a,e.insert+=a>e.w_size-e.insert?e.w_size-e.insert:a),e.high_water<e.strstart&&(e.high_water=e.strstart),a=e.bi_valid+42>>3,a=e.pending_buf_size-a>65535?65535:e.pending_buf_size-a,t=a>e.w_size?e.w_size:a,r=e.strstart-e.block_start,(r>=t||(r||i===C)&&i!==W&&e.strm.avail_in===0&&r<=a)&&(n=r>a?a:r,o=i===C&&e.strm.avail_in===0&&n===r?1:0,ot(e,e.block_start,n,o),e.block_start+=n,L(e.strm)),o?ie:O)},Je=(e,i)=>{let t,n;for(;;){if(e.lookahead<B){if(_e(e),e.lookahead<B&&i===W)return O;if(e.lookahead===0)break}if(t=0,e.lookahead>=v&&(e.ins_h=V(e,e.ins_h,e.window[e.strstart+v-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),t!==0&&e.strstart-t<=e.w_size-B&&(e.match_length=Ei(e,t)),e.match_length>=v)if(n=j(e,e.strstart-e.match_start,e.match_length-v),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=v){e.match_length--;do e.strstart++,e.ins_h=V(e,e.ins_h,e.window[e.strstart+v-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=V(e,e.ins_h,e.window[e.strstart+1]);else n=j(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(U(e,!1),e.strm.avail_out===0))return O}return e.insert=e.strstart<v-1?e.strstart:v-1,i===C?(U(e,!0),e.strm.avail_out===0?ie:ce):e.sym_next&&(U(e,!1),e.strm.avail_out===0)?O:se},re=(e,i)=>{let t,n,r;for(;;){if(e.lookahead<B){if(_e(e),e.lookahead<B&&i===W)return O;if(e.lookahead===0)break}if(t=0,e.lookahead>=v&&(e.ins_h=V(e,e.ins_h,e.window[e.strstart+v-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=v-1,t!==0&&e.prev_length<e.max_lazy_match&&e.strstart-t<=e.w_size-B&&(e.match_length=Ei(e,t),e.match_length<=5&&(e.strategy===yn||e.match_length===v&&e.strstart-e.match_start>4096)&&(e.match_length=v-1)),e.prev_length>=v&&e.match_length<=e.prev_length){r=e.strstart+e.lookahead-v,n=j(e,e.strstart-1-e.prev_match,e.prev_length-v),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=r&&(e.ins_h=V(e,e.ins_h,e.window[e.strstart+v-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=v-1,e.strstart++,n&&(U(e,!1),e.strm.avail_out===0))return O}else if(e.match_available){if(n=j(e,0,e.window[e.strstart-1]),n&&U(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return O}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=j(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<v-1?e.strstart:v-1,i===C?(U(e,!0),e.strm.avail_out===0?ie:ce):e.sym_next&&(U(e,!1),e.strm.avail_out===0)?O:se},Hn=(e,i)=>{let t,n,r,a,o=e.window;for(;;){if(e.lookahead<=G){if(_e(e),e.lookahead<=G&&i===W)return O;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=v&&e.strstart>0&&(r=e.strstart-1,n=o[r],n===o[++r]&&n===o[++r]&&n===o[++r])){a=e.strstart+G;do;while(n===o[++r]&&n===o[++r]&&n===o[++r]&&n===o[++r]&&n===o[++r]&&n===o[++r]&&n===o[++r]&&n===o[++r]&&r<a);e.match_length=G-(a-r),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=v?(t=j(e,1,e.match_length-v),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(t=j(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),t&&(U(e,!1),e.strm.avail_out===0))return O}return e.insert=0,i===C?(U(e,!0),e.strm.avail_out===0?ie:ce):e.sym_next&&(U(e,!1),e.strm.avail_out===0)?O:se},Bn=(e,i)=>{let t;for(;;){if(e.lookahead===0&&(_e(e),e.lookahead===0)){if(i===W)return O;break}if(e.match_length=0,t=j(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,t&&(U(e,!1),e.strm.avail_out===0))return O}return e.insert=0,i===C?(U(e,!0),e.strm.avail_out===0?ie:ce):e.sym_next&&(U(e,!1),e.strm.avail_out===0)?O:se};function F(e,i,t,n,r){this.good_length=e,this.max_lazy=i,this.nice_length=t,this.max_chain=n,this.func=r}var be=[new F(0,0,0,0,yi),new F(4,4,8,4,Je),new F(4,5,16,8,Je),new F(4,6,32,32,Je),new F(4,4,16,16,re),new F(8,16,32,32,re),new F(8,16,128,128,re),new F(8,32,128,256,re),new F(32,128,258,1024,re),new F(32,258,258,4096,re)],Kn=e=>{e.window_size=2*e.w_size,Y(e.head),e.max_lazy_match=be[e.level].max_lazy,e.good_match=be[e.level].good_length,e.nice_match=be[e.level].nice_length,e.max_chain_length=be[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=v-1,e.match_available=0,e.ins_h=0};function Pn(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Ke,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(Ln*2),this.dyn_dtree=new Uint16Array((2*On+1)*2),this.bl_tree=new Uint16Array((2*Nn+1)*2),Y(this.dyn_ltree),Y(this.dyn_dtree),Y(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(Un+1),this.heap=new Uint16Array(2*_t+1),Y(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*_t+1),Y(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var Te=e=>{if(!e)return 1;let i=e.state;return!i||i.strm!==e||i.status!==oe&&i.status!==xt&&i.status!==ht&&i.status!==dt&&i.status!==st&&i.status!==ct&&i.status!==q&&i.status!==we?1:0},mi=e=>{if(Te(e))return ee(e,H);e.total_in=e.total_out=0,e.data_type=An;let i=e.state;return i.pending=0,i.pending_out=0,i.wrap<0&&(i.wrap=-i.wrap),i.status=i.wrap===2?xt:i.wrap?oe:q,e.adler=i.wrap===2?0:1,i.last_flush=-2,bn(i),I},zi=e=>{let i=mi(e);return i===I&&Kn(e.state),i},Xn=(e,i)=>Te(e)||e.state.wrap!==2?H:(e.state.gzhead=i,I),Si=(e,i,t,n,r,a)=>{if(!e)return H;let o=1;if(i===En&&(i=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),r<1||r>Rn||t!==Ke||n<8||n>15||i<0||i>9||a<0||a>zn||n===8&&o!==1)return ee(e,H);n===8&&(n=9);let f=new Pn;return e.state=f,f.strm=e,f.status=oe,f.wrap=o,f.gzhead=null,f.w_bits=n,f.w_size=1<<f.w_bits,f.w_mask=f.w_size-1,f.hash_bits=r+7,f.hash_size=1<<f.hash_bits,f.hash_mask=f.hash_size-1,f.hash_shift=~~((f.hash_bits+v-1)/v),f.window=new Uint8Array(f.w_size*2),f.head=new Uint16Array(f.hash_size),f.prev=new Uint16Array(f.w_size),f.lit_bufsize=1<<r+6,f.pending_buf_size=f.lit_bufsize*4,f.pending_buf=new Uint8Array(f.pending_buf_size),f.sym_buf=f.lit_bufsize,f.sym_end=(f.lit_bufsize-1)*3,f.level=i,f.strategy=a,f.method=t,zi(e)},Yn=(e,i)=>Si(e,i,Ke,Tn,Dn,Sn),Gn=(e,i)=>{if(Te(e)||i>Rt||i<0)return e?ee(e,H):H;let t=e.state;if(!e.output||e.avail_in!==0&&!e.input||t.status===we&&i!==C)return ee(e,e.avail_out===0?Ve:H);let n=t.last_flush;if(t.last_flush=i,t.pending!==0){if(L(e),e.avail_out===0)return t.last_flush=-1,I}else if(e.avail_in===0&&Dt(i)<=Dt(n)&&i!==C)return ee(e,Ve);if(t.status===we&&e.avail_in!==0)return ee(e,Ve);if(t.status===oe&&t.wrap===0&&(t.status=q),t.status===oe){let r=Ke+(t.w_bits-8<<4)<<8,a=-1;if(t.strategy>=Ne||t.level<2?a=0:t.level<6?a=1:t.level===6?a=2:a=3,r|=a<<6,t.strstart!==0&&(r|=Cn),r+=31-r%31,ue(t,r),t.strstart!==0&&(ue(t,e.adler>>>16),ue(t,e.adler&65535)),e.adler=1,t.status=q,L(e),t.pending!==0)return t.last_flush=-1,I}if(t.status===xt){if(e.adler=0,z(t,31),z(t,139),z(t,8),t.gzhead)z(t,(t.gzhead.text?1:0)+(t.gzhead.hcrc?2:0)+(t.gzhead.extra?4:0)+(t.gzhead.name?8:0)+(t.gzhead.comment?16:0)),z(t,t.gzhead.time&255),z(t,t.gzhead.time>>8&255),z(t,t.gzhead.time>>16&255),z(t,t.gzhead.time>>24&255),z(t,t.level===9?2:t.strategy>=Ne||t.level<2?4:0),z(t,t.gzhead.os&255),t.gzhead.extra&&t.gzhead.extra.length&&(z(t,t.gzhead.extra.length&255),z(t,t.gzhead.extra.length>>8&255)),t.gzhead.hcrc&&(e.adler=Z(e.adler,t.pending_buf,t.pending,0)),t.gzindex=0,t.status=ht;else if(z(t,0),z(t,0),z(t,0),z(t,0),z(t,0),z(t,t.level===9?2:t.strategy>=Ne||t.level<2?4:0),z(t,$n),t.status=q,L(e),t.pending!==0)return t.last_flush=-1,I}if(t.status===ht){if(t.gzhead.extra){let r=t.pending,a=(t.gzhead.extra.length&65535)-t.gzindex;for(;t.pending+a>t.pending_buf_size;){let f=t.pending_buf_size-t.pending;if(t.pending_buf.set(t.gzhead.extra.subarray(t.gzindex,t.gzindex+f),t.pending),t.pending=t.pending_buf_size,t.gzhead.hcrc&&t.pending>r&&(e.adler=Z(e.adler,t.pending_buf,t.pending-r,r)),t.gzindex+=f,L(e),t.pending!==0)return t.last_flush=-1,I;r=0,a-=f}let o=new Uint8Array(t.gzhead.extra);t.pending_buf.set(o.subarray(t.gzindex,t.gzindex+a),t.pending),t.pending+=a,t.gzhead.hcrc&&t.pending>r&&(e.adler=Z(e.adler,t.pending_buf,t.pending-r,r)),t.gzindex=0}t.status=dt}if(t.status===dt){if(t.gzhead.name){let r=t.pending,a;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>r&&(e.adler=Z(e.adler,t.pending_buf,t.pending-r,r)),L(e),t.pending!==0)return t.last_flush=-1,I;r=0}t.gzindex<t.gzhead.name.length?a=t.gzhead.name.charCodeAt(t.gzindex++)&255:a=0,z(t,a)}while(a!==0);t.gzhead.hcrc&&t.pending>r&&(e.adler=Z(e.adler,t.pending_buf,t.pending-r,r)),t.gzindex=0}t.status=st}if(t.status===st){if(t.gzhead.comment){let r=t.pending,a;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>r&&(e.adler=Z(e.adler,t.pending_buf,t.pending-r,r)),L(e),t.pending!==0)return t.last_flush=-1,I;r=0}t.gzindex<t.gzhead.comment.length?a=t.gzhead.comment.charCodeAt(t.gzindex++)&255:a=0,z(t,a)}while(a!==0);t.gzhead.hcrc&&t.pending>r&&(e.adler=Z(e.adler,t.pending_buf,t.pending-r,r))}t.status=ct}if(t.status===ct){if(t.gzhead.hcrc){if(t.pending+2>t.pending_buf_size&&(L(e),t.pending!==0))return t.last_flush=-1,I;z(t,e.adler&255),z(t,e.adler>>8&255),e.adler=0}if(t.status=q,L(e),t.pending!==0)return t.last_flush=-1,I}if(e.avail_in!==0||t.lookahead!==0||i!==W&&t.status!==we){let r=t.level===0?yi(t,i):t.strategy===Ne?Bn(t,i):t.strategy===mn?Hn(t,i):be[t.level].func(t,i);if((r===ie||r===ce)&&(t.status=we),r===O||r===ie)return e.avail_out===0&&(t.last_flush=-1),I;if(r===se&&(i===xn?pn(t):i!==Rt&&(ot(t,0,0,!1),i===vn&&(Y(t.head),t.lookahead===0&&(t.strstart=0,t.block_start=0,t.insert=0))),L(e),e.avail_out===0))return t.last_flush=-1,I}return i!==C?I:t.wrap<=0?Tt:(t.wrap===2?(z(t,e.adler&255),z(t,e.adler>>8&255),z(t,e.adler>>16&255),z(t,e.adler>>24&255),z(t,e.total_in&255),z(t,e.total_in>>8&255),z(t,e.total_in>>16&255),z(t,e.total_in>>24&255)):(ue(t,e.adler>>>16),ue(t,e.adler&65535)),L(e),t.wrap>0&&(t.wrap=-t.wrap),t.pending!==0?I:Tt)},jn=e=>{if(Te(e))return H;let i=e.state.status;return e.state=null,i===q?ee(e,kn):I},Wn=(e,i)=>{let t=i.length;if(Te(e))return H;let n=e.state,r=n.wrap;if(r===2||r===1&&n.status!==oe||n.lookahead)return H;if(r===1&&(e.adler=me(e.adler,i,t,0)),n.wrap=0,t>=n.w_size){r===0&&(Y(n.head),n.strstart=0,n.block_start=0,n.insert=0);let c=new Uint8Array(n.w_size);c.set(i.subarray(t-n.w_size,t),0),i=c,t=n.w_size}let a=e.avail_in,o=e.next_in,f=e.input;for(e.avail_in=t,e.next_in=0,e.input=i,_e(n);n.lookahead>=v;){let c=n.strstart,l=n.lookahead-(v-1);do n.ins_h=V(n,n.ins_h,n.window[c+v-1]),n.prev[c&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=c,c++;while(--l);n.strstart=c,n.lookahead=v-1,_e(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=v-1,n.match_available=0,e.next_in=o,e.input=f,e.avail_in=a,n.wrap=r,I},Vn=Yn,Jn=Si,Qn=zi,qn=mi,ea=Xn,ta=Gn,ia=jn,na=Wn,aa="pako deflate (from Nodeca project)",pe={deflateInit:Vn,deflateInit2:Jn,deflateReset:Qn,deflateResetKeep:qn,deflateSetHeader:ea,deflate:ta,deflateEnd:ia,deflateSetDictionary:na,deflateInfo:aa},ra=(e,i)=>Object.prototype.hasOwnProperty.call(e,i),la=function(e){let i=Array.prototype.slice.call(arguments,1);for(;i.length;){let t=i.shift();if(t){if(typeof t!="object")throw new TypeError(t+"must be non-object");for(let n in t)ra(t,n)&&(e[n]=t[n])}}return e},fa=e=>{let i=0;for(let n=0,r=e.length;n<r;n++)i+=e[n].length;let t=new Uint8Array(i);for(let n=0,r=0,a=e.length;n<a;n++){let o=e[n];t.set(o,r),r+=o.length}return t},Pe={assign:la,flattenChunks:fa},Ai=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){Ai=!1}var ze=new Uint8Array(256);for(let e=0;e<256;e++)ze[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;ze[254]=ze[254]=1;var oa=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let i,t,n,r,a,o=e.length,f=0;for(r=0;r<o;r++)t=e.charCodeAt(r),(t&64512)===55296&&r+1<o&&(n=e.charCodeAt(r+1),(n&64512)===56320&&(t=65536+(t-55296<<10)+(n-56320),r++)),f+=t<128?1:t<2048?2:t<65536?3:4;for(i=new Uint8Array(f),a=0,r=0;a<f;r++)t=e.charCodeAt(r),(t&64512)===55296&&r+1<o&&(n=e.charCodeAt(r+1),(n&64512)===56320&&(t=65536+(t-55296<<10)+(n-56320),r++)),t<128?i[a++]=t:t<2048?(i[a++]=192|t>>>6,i[a++]=128|t&63):t<65536?(i[a++]=224|t>>>12,i[a++]=128|t>>>6&63,i[a++]=128|t&63):(i[a++]=240|t>>>18,i[a++]=128|t>>>12&63,i[a++]=128|t>>>6&63,i[a++]=128|t&63);return i},_a=(e,i)=>{if(i<65534&&e.subarray&&Ai)return String.fromCharCode.apply(null,e.length===i?e:e.subarray(0,i));let t="";for(let n=0;n<i;n++)t+=String.fromCharCode(e[n]);return t},ha=(e,i)=>{let t=i||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,i));let n,r,a=new Array(t*2);for(r=0,n=0;n<t;){let o=e[n++];if(o<128){a[r++]=o;continue}let f=ze[o];if(f>4){a[r++]=65533,n+=f-1;continue}for(o&=f===2?31:f===3?15:7;f>1&&n<t;)o=o<<6|e[n++]&63,f--;if(f>1){a[r++]=65533;continue}o<65536?a[r++]=o:(o-=65536,a[r++]=55296|o>>10&1023,a[r++]=56320|o&1023)}return _a(a,r)},da=(e,i)=>{i=i||e.length,i>e.length&&(i=e.length);let t=i-1;for(;t>=0&&(e[t]&192)===128;)t--;return t<0||t===0?i:t+ze[e[t]]>i?t:i},Se={string2buf:oa,buf2string:ha,utf8border:da};function sa(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var Ri=sa,Ti=Object.prototype.toString,{Z_NO_FLUSH:ca,Z_SYNC_FLUSH:ua,Z_FULL_FLUSH:wa,Z_FINISH:ba,Z_OK:He,Z_STREAM_END:ga,Z_DEFAULT_COMPRESSION:pa,Z_DEFAULT_STRATEGY:xa,Z_DEFLATED:va}=de;function De(e){this.options=Pe.assign({level:pa,method:va,chunkSize:16384,windowBits:15,memLevel:8,strategy:xa},e||{});let i=this.options;i.raw&&i.windowBits>0?i.windowBits=-i.windowBits:i.gzip&&i.windowBits>0&&i.windowBits<16&&(i.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ri,this.strm.avail_out=0;let t=pe.deflateInit2(this.strm,i.level,i.method,i.windowBits,i.memLevel,i.strategy);if(t!==He)throw new Error(te[t]);if(i.header&&pe.deflateSetHeader(this.strm,i.header),i.dictionary){let n;if(typeof i.dictionary=="string"?n=Se.string2buf(i.dictionary):Ti.call(i.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(i.dictionary):n=i.dictionary,t=pe.deflateSetDictionary(this.strm,n),t!==He)throw new Error(te[t]);this._dict_set=!0}}De.prototype.push=function(e,i){let t=this.strm,n=this.options.chunkSize,r,a;if(this.ended)return!1;for(i===~~i?a=i:a=i===!0?ba:ca,typeof e=="string"?t.input=Se.string2buf(e):Ti.call(e)==="[object ArrayBuffer]"?t.input=new Uint8Array(e):t.input=e,t.next_in=0,t.avail_in=t.input.length;;){if(t.avail_out===0&&(t.output=new Uint8Array(n),t.next_out=0,t.avail_out=n),(a===ua||a===wa)&&t.avail_out<=6){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(r=pe.deflate(t,a),r===ga)return t.next_out>0&&this.onData(t.output.subarray(0,t.next_out)),r=pe.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===He;if(t.avail_out===0){this.onData(t.output);continue}if(a>0&&t.next_out>0){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(t.avail_in===0)break}return!0};De.prototype.onData=function(e){this.chunks.push(e)};De.prototype.onEnd=function(e){e===He&&(this.result=Pe.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function vt(e,i){let t=new De(i);if(t.push(e,!0),t.err)throw t.msg||te[t.err];return t.result}function ka(e,i){return i=i||{},i.raw=!0,vt(e,i)}function Ea(e,i){return i=i||{},i.gzip=!0,vt(e,i)}var ya=De,ma=vt,za=ka,Sa=Ea,Aa=de,Ra={Deflate:ya,deflate:ma,deflateRaw:za,gzip:Sa,constants:Aa},Le=16209,Ta=16191,Da=function(i,t){let n,r,a,o,f,c,l,_,y,s,h,u,T,k,g,S,p,d,m,D,w,A,E,b,x=i.state;n=i.next_in,E=i.input,r=n+(i.avail_in-5),a=i.next_out,b=i.output,o=a-(t-i.avail_out),f=a+(i.avail_out-257),c=x.dmax,l=x.wsize,_=x.whave,y=x.wnext,s=x.window,h=x.hold,u=x.bits,T=x.lencode,k=x.distcode,g=(1<<x.lenbits)-1,S=(1<<x.distbits)-1;e:do{u<15&&(h+=E[n++]<<u,u+=8,h+=E[n++]<<u,u+=8),p=T[h&g];t:for(;;){if(d=p>>>24,h>>>=d,u-=d,d=p>>>16&255,d===0)b[a++]=p&65535;else if(d&16){m=p&65535,d&=15,d&&(u<d&&(h+=E[n++]<<u,u+=8),m+=h&(1<<d)-1,h>>>=d,u-=d),u<15&&(h+=E[n++]<<u,u+=8,h+=E[n++]<<u,u+=8),p=k[h&S];i:for(;;){if(d=p>>>24,h>>>=d,u-=d,d=p>>>16&255,d&16){if(D=p&65535,d&=15,u<d&&(h+=E[n++]<<u,u+=8,u<d&&(h+=E[n++]<<u,u+=8)),D+=h&(1<<d)-1,D>c){i.msg="invalid distance too far back",x.mode=Le;break e}if(h>>>=d,u-=d,d=a-o,D>d){if(d=D-d,d>_&&x.sane){i.msg="invalid distance too far back",x.mode=Le;break e}if(w=0,A=s,y===0){if(w+=l-d,d<m){m-=d;do b[a++]=s[w++];while(--d);w=a-D,A=b}}else if(y<d){if(w+=l+y-d,d-=y,d<m){m-=d;do b[a++]=s[w++];while(--d);if(w=0,y<m){d=y,m-=d;do b[a++]=s[w++];while(--d);w=a-D,A=b}}}else if(w+=y-d,d<m){m-=d;do b[a++]=s[w++];while(--d);w=a-D,A=b}for(;m>2;)b[a++]=A[w++],b[a++]=A[w++],b[a++]=A[w++],m-=3;m&&(b[a++]=A[w++],m>1&&(b[a++]=A[w++]))}else{w=a-D;do b[a++]=b[w++],b[a++]=b[w++],b[a++]=b[w++],m-=3;while(m>2);m&&(b[a++]=b[w++],m>1&&(b[a++]=b[w++]))}}else if((d&64)===0){p=k[(p&65535)+(h&(1<<d)-1)];continue i}else{i.msg="invalid distance code",x.mode=Le;break e}break}}else if((d&64)===0){p=T[(p&65535)+(h&(1<<d)-1)];continue t}else if(d&32){x.mode=Ta;break e}else{i.msg="invalid literal/length code",x.mode=Le;break e}break}}while(n<r&&a<f);m=u>>3,n-=m,u-=m<<3,h&=(1<<u)-1,i.next_in=n,i.next_out=a,i.avail_in=n<r?5+(r-n):5-(n-r),i.avail_out=a<f?257+(f-a):257-(a-f),x.hold=h,x.bits=u},le=15,Zt=852,It=592,Ot=0,Qe=1,Nt=2,Za=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),Ia=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),Oa=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),Na=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),La=(e,i,t,n,r,a,o,f)=>{let c=f.bits,l=0,_=0,y=0,s=0,h=0,u=0,T=0,k=0,g=0,S=0,p,d,m,D,w,A=null,E,b=new Uint16Array(le+1),x=new Uint16Array(le+1),J=null,Et,Ie,Oe;for(l=0;l<=le;l++)b[l]=0;for(_=0;_<n;_++)b[i[t+_]]++;for(h=c,s=le;s>=1&&b[s]===0;s--);if(h>s&&(h=s),s===0)return r[a++]=1<<24|64<<16|0,r[a++]=1<<24|64<<16|0,f.bits=1,0;for(y=1;y<s&&b[y]===0;y++);for(h<y&&(h=y),k=1,l=1;l<=le;l++)if(k<<=1,k-=b[l],k<0)return-1;if(k>0&&(e===Ot||s!==1))return-1;for(x[1]=0,l=1;l<le;l++)x[l+1]=x[l]+b[l];for(_=0;_<n;_++)i[t+_]!==0&&(o[x[i[t+_]]++]=_);if(e===Ot?(A=J=o,E=20):e===Qe?(A=Za,J=Ia,E=257):(A=Oa,J=Na,E=0),S=0,_=0,l=y,w=a,u=h,T=0,m=-1,g=1<<h,D=g-1,e===Qe&&g>Zt||e===Nt&&g>It)return 1;for(;;){Et=l-T,o[_]+1<E?(Ie=0,Oe=o[_]):o[_]>=E?(Ie=J[o[_]-E],Oe=A[o[_]-E]):(Ie=96,Oe=0),p=1<<l-T,d=1<<u,y=d;do d-=p,r[w+(S>>T)+d]=Et<<24|Ie<<16|Oe|0;while(d!==0);for(p=1<<l-1;S&p;)p>>=1;if(p!==0?(S&=p-1,S+=p):S=0,_++,--b[l]===0){if(l===s)break;l=i[t+o[_]]}if(l>h&&(S&D)!==m){for(T===0&&(T=h),w+=y,u=l-T,k=1<<u;u+T<s&&(k-=b[u+T],!(k<=0));)u++,k<<=1;if(g+=1<<u,e===Qe&&g>Zt||e===Nt&&g>It)return 1;m=S&D,r[m]=h<<24|u<<16|w-a|0}}return S!==0&&(r[w+S]=l-T<<24|64<<16|0),f.bits=h,0},xe=La,Ua=0,Di=1,Zi=2,{Z_FINISH:Lt,Z_BLOCK:Ca,Z_TREES:Ue,Z_OK:ne,Z_STREAM_END:$a,Z_NEED_DICT:Fa,Z_STREAM_ERROR:$,Z_DATA_ERROR:Ii,Z_MEM_ERROR:Oi,Z_BUF_ERROR:Ma,Z_DEFLATED:Ut}=de,Xe=16180,Ct=16181,$t=16182,Ft=16183,Mt=16184,Ht=16185,Bt=16186,Kt=16187,Pt=16188,Xt=16189,Be=16190,K=16191,qe=16192,Yt=16193,et=16194,Gt=16195,jt=16196,Wt=16197,Vt=16198,Ce=16199,$e=16200,Jt=16201,Qt=16202,qt=16203,ei=16204,ti=16205,tt=16206,ii=16207,ni=16208,R=16209,Ni=16210,Li=16211,Ha=852,Ba=592,Ka=15,Pa=Ka,ai=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function Xa(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var ae=e=>{if(!e)return 1;let i=e.state;return!i||i.strm!==e||i.mode<Xe||i.mode>Li?1:0},Ui=e=>{if(ae(e))return $;let i=e.state;return e.total_in=e.total_out=i.total=0,e.msg="",i.wrap&&(e.adler=i.wrap&1),i.mode=Xe,i.last=0,i.havedict=0,i.flags=-1,i.dmax=32768,i.head=null,i.hold=0,i.bits=0,i.lencode=i.lendyn=new Int32Array(Ha),i.distcode=i.distdyn=new Int32Array(Ba),i.sane=1,i.back=-1,ne},Ci=e=>{if(ae(e))return $;let i=e.state;return i.wsize=0,i.whave=0,i.wnext=0,Ui(e)},$i=(e,i)=>{let t;if(ae(e))return $;let n=e.state;return i<0?(t=0,i=-i):(t=(i>>4)+5,i<48&&(i&=15)),i&&(i<8||i>15)?$:(n.window!==null&&n.wbits!==i&&(n.window=null),n.wrap=t,n.wbits=i,Ci(e))},Fi=(e,i)=>{if(!e)return $;let t=new Xa;e.state=t,t.strm=e,t.window=null,t.mode=Xe;let n=$i(e,i);return n!==ne&&(e.state=null),n},Ya=e=>Fi(e,Pa),ri=!0,it,nt,Ga=e=>{if(ri){it=new Int32Array(512),nt=new Int32Array(32);let i=0;for(;i<144;)e.lens[i++]=8;for(;i<256;)e.lens[i++]=9;for(;i<280;)e.lens[i++]=7;for(;i<288;)e.lens[i++]=8;for(xe(Di,e.lens,0,288,it,0,e.work,{bits:9}),i=0;i<32;)e.lens[i++]=5;xe(Zi,e.lens,0,32,nt,0,e.work,{bits:5}),ri=!1}e.lencode=it,e.lenbits=9,e.distcode=nt,e.distbits=5},Mi=(e,i,t,n)=>{let r,a=e.state;return a.window===null&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),n>=a.wsize?(a.window.set(i.subarray(t-a.wsize,t),0),a.wnext=0,a.whave=a.wsize):(r=a.wsize-a.wnext,r>n&&(r=n),a.window.set(i.subarray(t-n,t-n+r),a.wnext),n-=r,n?(a.window.set(i.subarray(t-n,t),0),a.wnext=n,a.whave=a.wsize):(a.wnext+=r,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=r))),0},ja=(e,i)=>{let t,n,r,a,o,f,c,l,_,y,s,h,u,T,k=0,g,S,p,d,m,D,w,A,E=new Uint8Array(4),b,x,J=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(ae(e)||!e.output||!e.input&&e.avail_in!==0)return $;t=e.state,t.mode===K&&(t.mode=qe),o=e.next_out,r=e.output,c=e.avail_out,a=e.next_in,n=e.input,f=e.avail_in,l=t.hold,_=t.bits,y=f,s=c,A=ne;e:for(;;)switch(t.mode){case Xe:if(t.wrap===0){t.mode=qe;break}for(;_<16;){if(f===0)break e;f--,l+=n[a++]<<_,_+=8}if(t.wrap&2&&l===35615){t.wbits===0&&(t.wbits=15),t.check=0,E[0]=l&255,E[1]=l>>>8&255,t.check=Z(t.check,E,2,0),l=0,_=0,t.mode=Ct;break}if(t.head&&(t.head.done=!1),!(t.wrap&1)||(((l&255)<<8)+(l>>8))%31){e.msg="incorrect header check",t.mode=R;break}if((l&15)!==Ut){e.msg="unknown compression method",t.mode=R;break}if(l>>>=4,_-=4,w=(l&15)+8,t.wbits===0&&(t.wbits=w),w>15||w>t.wbits){e.msg="invalid window size",t.mode=R;break}t.dmax=1<<t.wbits,t.flags=0,e.adler=t.check=1,t.mode=l&512?Xt:K,l=0,_=0;break;case Ct:for(;_<16;){if(f===0)break e;f--,l+=n[a++]<<_,_+=8}if(t.flags=l,(t.flags&255)!==Ut){e.msg="unknown compression method",t.mode=R;break}if(t.flags&57344){e.msg="unknown header flags set",t.mode=R;break}t.head&&(t.head.text=l>>8&1),t.flags&512&&t.wrap&4&&(E[0]=l&255,E[1]=l>>>8&255,t.check=Z(t.check,E,2,0)),l=0,_=0,t.mode=$t;case $t:for(;_<32;){if(f===0)break e;f--,l+=n[a++]<<_,_+=8}t.head&&(t.head.time=l),t.flags&512&&t.wrap&4&&(E[0]=l&255,E[1]=l>>>8&255,E[2]=l>>>16&255,E[3]=l>>>24&255,t.check=Z(t.check,E,4,0)),l=0,_=0,t.mode=Ft;case Ft:for(;_<16;){if(f===0)break e;f--,l+=n[a++]<<_,_+=8}t.head&&(t.head.xflags=l&255,t.head.os=l>>8),t.flags&512&&t.wrap&4&&(E[0]=l&255,E[1]=l>>>8&255,t.check=Z(t.check,E,2,0)),l=0,_=0,t.mode=Mt;case Mt:if(t.flags&1024){for(;_<16;){if(f===0)break e;f--,l+=n[a++]<<_,_+=8}t.length=l,t.head&&(t.head.extra_len=l),t.flags&512&&t.wrap&4&&(E[0]=l&255,E[1]=l>>>8&255,t.check=Z(t.check,E,2,0)),l=0,_=0}else t.head&&(t.head.extra=null);t.mode=Ht;case Ht:if(t.flags&1024&&(h=t.length,h>f&&(h=f),h&&(t.head&&(w=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(n.subarray(a,a+h),w)),t.flags&512&&t.wrap&4&&(t.check=Z(t.check,n,h,a)),f-=h,a+=h,t.length-=h),t.length))break e;t.length=0,t.mode=Bt;case Bt:if(t.flags&2048){if(f===0)break e;h=0;do w=n[a+h++],t.head&&w&&t.length<65536&&(t.head.name+=String.fromCharCode(w));while(w&&h<f);if(t.flags&512&&t.wrap&4&&(t.check=Z(t.check,n,h,a)),f-=h,a+=h,w)break e}else t.head&&(t.head.name=null);t.length=0,t.mode=Kt;case Kt:if(t.flags&4096){if(f===0)break e;h=0;do w=n[a+h++],t.head&&w&&t.length<65536&&(t.head.comment+=String.fromCharCode(w));while(w&&h<f);if(t.flags&512&&t.wrap&4&&(t.check=Z(t.check,n,h,a)),f-=h,a+=h,w)break e}else t.head&&(t.head.comment=null);t.mode=Pt;case Pt:if(t.flags&512){for(;_<16;){if(f===0)break e;f--,l+=n[a++]<<_,_+=8}if(t.wrap&4&&l!==(t.check&65535)){e.msg="header crc mismatch",t.mode=R;break}l=0,_=0}t.head&&(t.head.hcrc=t.flags>>9&1,t.head.done=!0),e.adler=t.check=0,t.mode=K;break;case Xt:for(;_<32;){if(f===0)break e;f--,l+=n[a++]<<_,_+=8}e.adler=t.check=ai(l),l=0,_=0,t.mode=Be;case Be:if(t.havedict===0)return e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=f,t.hold=l,t.bits=_,Fa;e.adler=t.check=1,t.mode=K;case K:if(i===Ca||i===Ue)break e;case qe:if(t.last){l>>>=_&7,_-=_&7,t.mode=tt;break}for(;_<3;){if(f===0)break e;f--,l+=n[a++]<<_,_+=8}switch(t.last=l&1,l>>>=1,_-=1,l&3){case 0:t.mode=Yt;break;case 1:if(Ga(t),t.mode=Ce,i===Ue){l>>>=2,_-=2;break e}break;case 2:t.mode=jt;break;case 3:e.msg="invalid block type",t.mode=R}l>>>=2,_-=2;break;case Yt:for(l>>>=_&7,_-=_&7;_<32;){if(f===0)break e;f--,l+=n[a++]<<_,_+=8}if((l&65535)!==(l>>>16^65535)){e.msg="invalid stored block lengths",t.mode=R;break}if(t.length=l&65535,l=0,_=0,t.mode=et,i===Ue)break e;case et:t.mode=Gt;case Gt:if(h=t.length,h){if(h>f&&(h=f),h>c&&(h=c),h===0)break e;r.set(n.subarray(a,a+h),o),f-=h,a+=h,c-=h,o+=h,t.length-=h;break}t.mode=K;break;case jt:for(;_<14;){if(f===0)break e;f--,l+=n[a++]<<_,_+=8}if(t.nlen=(l&31)+257,l>>>=5,_-=5,t.ndist=(l&31)+1,l>>>=5,_-=5,t.ncode=(l&15)+4,l>>>=4,_-=4,t.nlen>286||t.ndist>30){e.msg="too many length or distance symbols",t.mode=R;break}t.have=0,t.mode=Wt;case Wt:for(;t.have<t.ncode;){for(;_<3;){if(f===0)break e;f--,l+=n[a++]<<_,_+=8}t.lens[J[t.have++]]=l&7,l>>>=3,_-=3}for(;t.have<19;)t.lens[J[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,b={bits:t.lenbits},A=xe(Ua,t.lens,0,19,t.lencode,0,t.work,b),t.lenbits=b.bits,A){e.msg="invalid code lengths set",t.mode=R;break}t.have=0,t.mode=Vt;case Vt:for(;t.have<t.nlen+t.ndist;){for(;k=t.lencode[l&(1<<t.lenbits)-1],g=k>>>24,S=k>>>16&255,p=k&65535,!(g<=_);){if(f===0)break e;f--,l+=n[a++]<<_,_+=8}if(p<16)l>>>=g,_-=g,t.lens[t.have++]=p;else{if(p===16){for(x=g+2;_<x;){if(f===0)break e;f--,l+=n[a++]<<_,_+=8}if(l>>>=g,_-=g,t.have===0){e.msg="invalid bit length repeat",t.mode=R;break}w=t.lens[t.have-1],h=3+(l&3),l>>>=2,_-=2}else if(p===17){for(x=g+3;_<x;){if(f===0)break e;f--,l+=n[a++]<<_,_+=8}l>>>=g,_-=g,w=0,h=3+(l&7),l>>>=3,_-=3}else{for(x=g+7;_<x;){if(f===0)break e;f--,l+=n[a++]<<_,_+=8}l>>>=g,_-=g,w=0,h=11+(l&127),l>>>=7,_-=7}if(t.have+h>t.nlen+t.ndist){e.msg="invalid bit length repeat",t.mode=R;break}for(;h--;)t.lens[t.have++]=w}}if(t.mode===R)break;if(t.lens[256]===0){e.msg="invalid code -- missing end-of-block",t.mode=R;break}if(t.lenbits=9,b={bits:t.lenbits},A=xe(Di,t.lens,0,t.nlen,t.lencode,0,t.work,b),t.lenbits=b.bits,A){e.msg="invalid literal/lengths set",t.mode=R;break}if(t.distbits=6,t.distcode=t.distdyn,b={bits:t.distbits},A=xe(Zi,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,b),t.distbits=b.bits,A){e.msg="invalid distances set",t.mode=R;break}if(t.mode=Ce,i===Ue)break e;case Ce:t.mode=$e;case $e:if(f>=6&&c>=258){e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=f,t.hold=l,t.bits=_,Da(e,s),o=e.next_out,r=e.output,c=e.avail_out,a=e.next_in,n=e.input,f=e.avail_in,l=t.hold,_=t.bits,t.mode===K&&(t.back=-1);break}for(t.back=0;k=t.lencode[l&(1<<t.lenbits)-1],g=k>>>24,S=k>>>16&255,p=k&65535,!(g<=_);){if(f===0)break e;f--,l+=n[a++]<<_,_+=8}if(S&&(S&240)===0){for(d=g,m=S,D=p;k=t.lencode[D+((l&(1<<d+m)-1)>>d)],g=k>>>24,S=k>>>16&255,p=k&65535,!(d+g<=_);){if(f===0)break e;f--,l+=n[a++]<<_,_+=8}l>>>=d,_-=d,t.back+=d}if(l>>>=g,_-=g,t.back+=g,t.length=p,S===0){t.mode=ti;break}if(S&32){t.back=-1,t.mode=K;break}if(S&64){e.msg="invalid literal/length code",t.mode=R;break}t.extra=S&15,t.mode=Jt;case Jt:if(t.extra){for(x=t.extra;_<x;){if(f===0)break e;f--,l+=n[a++]<<_,_+=8}t.length+=l&(1<<t.extra)-1,l>>>=t.extra,_-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=Qt;case Qt:for(;k=t.distcode[l&(1<<t.distbits)-1],g=k>>>24,S=k>>>16&255,p=k&65535,!(g<=_);){if(f===0)break e;f--,l+=n[a++]<<_,_+=8}if((S&240)===0){for(d=g,m=S,D=p;k=t.distcode[D+((l&(1<<d+m)-1)>>d)],g=k>>>24,S=k>>>16&255,p=k&65535,!(d+g<=_);){if(f===0)break e;f--,l+=n[a++]<<_,_+=8}l>>>=d,_-=d,t.back+=d}if(l>>>=g,_-=g,t.back+=g,S&64){e.msg="invalid distance code",t.mode=R;break}t.offset=p,t.extra=S&15,t.mode=qt;case qt:if(t.extra){for(x=t.extra;_<x;){if(f===0)break e;f--,l+=n[a++]<<_,_+=8}t.offset+=l&(1<<t.extra)-1,l>>>=t.extra,_-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){e.msg="invalid distance too far back",t.mode=R;break}t.mode=ei;case ei:if(c===0)break e;if(h=s-c,t.offset>h){if(h=t.offset-h,h>t.whave&&t.sane){e.msg="invalid distance too far back",t.mode=R;break}h>t.wnext?(h-=t.wnext,u=t.wsize-h):u=t.wnext-h,h>t.length&&(h=t.length),T=t.window}else T=r,u=o-t.offset,h=t.length;h>c&&(h=c),c-=h,t.length-=h;do r[o++]=T[u++];while(--h);t.length===0&&(t.mode=$e);break;case ti:if(c===0)break e;r[o++]=t.length,c--,t.mode=$e;break;case tt:if(t.wrap){for(;_<32;){if(f===0)break e;f--,l|=n[a++]<<_,_+=8}if(s-=c,e.total_out+=s,t.total+=s,t.wrap&4&&s&&(e.adler=t.check=t.flags?Z(t.check,r,s,o-s):me(t.check,r,s,o-s)),s=c,t.wrap&4&&(t.flags?l:ai(l))!==t.check){e.msg="incorrect data check",t.mode=R;break}l=0,_=0}t.mode=ii;case ii:if(t.wrap&&t.flags){for(;_<32;){if(f===0)break e;f--,l+=n[a++]<<_,_+=8}if(t.wrap&4&&l!==(t.total&4294967295)){e.msg="incorrect length check",t.mode=R;break}l=0,_=0}t.mode=ni;case ni:A=$a;break e;case R:A=Ii;break e;case Ni:return Oi;case Li:default:return $}return e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=f,t.hold=l,t.bits=_,(t.wsize||s!==e.avail_out&&t.mode<R&&(t.mode<tt||i!==Lt))&&Mi(e,e.output,e.next_out,s-e.avail_out),y-=e.avail_in,s-=e.avail_out,e.total_in+=y,e.total_out+=s,t.total+=s,t.wrap&4&&s&&(e.adler=t.check=t.flags?Z(t.check,r,s,e.next_out-s):me(t.check,r,s,e.next_out-s)),e.data_type=t.bits+(t.last?64:0)+(t.mode===K?128:0)+(t.mode===Ce||t.mode===et?256:0),(y===0&&s===0||i===Lt)&&A===ne&&(A=Ma),A},Wa=e=>{if(ae(e))return $;let i=e.state;return i.window&&(i.window=null),e.state=null,ne},Va=(e,i)=>{if(ae(e))return $;let t=e.state;return(t.wrap&2)===0?$:(t.head=i,i.done=!1,ne)},Ja=(e,i)=>{let t=i.length,n,r,a;return ae(e)||(n=e.state,n.wrap!==0&&n.mode!==Be)?$:n.mode===Be&&(r=1,r=me(r,i,t,0),r!==n.check)?Ii:(a=Mi(e,i,t,t),a?(n.mode=Ni,Oi):(n.havedict=1,ne))},Qa=Ci,qa=$i,er=Ui,tr=Ya,ir=Fi,nr=ja,ar=Wa,rr=Va,lr=Ja,fr="pako inflate (from Nodeca project)",X={inflateReset:Qa,inflateReset2:qa,inflateResetKeep:er,inflateInit:tr,inflateInit2:ir,inflate:nr,inflateEnd:ar,inflateGetHeader:rr,inflateSetDictionary:lr,inflateInfo:fr};function or(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var _r=or,Hi=Object.prototype.toString,{Z_NO_FLUSH:hr,Z_FINISH:dr,Z_OK:Ae,Z_STREAM_END:at,Z_NEED_DICT:rt,Z_STREAM_ERROR:sr,Z_DATA_ERROR:li,Z_MEM_ERROR:cr}=de;function Ze(e){this.options=Pe.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});let i=this.options;i.raw&&i.windowBits>=0&&i.windowBits<16&&(i.windowBits=-i.windowBits,i.windowBits===0&&(i.windowBits=-15)),i.windowBits>=0&&i.windowBits<16&&!(e&&e.windowBits)&&(i.windowBits+=32),i.windowBits>15&&i.windowBits<48&&(i.windowBits&15)===0&&(i.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ri,this.strm.avail_out=0;let t=X.inflateInit2(this.strm,i.windowBits);if(t!==Ae)throw new Error(te[t]);if(this.header=new _r,X.inflateGetHeader(this.strm,this.header),i.dictionary&&(typeof i.dictionary=="string"?i.dictionary=Se.string2buf(i.dictionary):Hi.call(i.dictionary)==="[object ArrayBuffer]"&&(i.dictionary=new Uint8Array(i.dictionary)),i.raw&&(t=X.inflateSetDictionary(this.strm,i.dictionary),t!==Ae)))throw new Error(te[t])}Ze.prototype.push=function(e,i){let t=this.strm,n=this.options.chunkSize,r=this.options.dictionary,a,o,f;if(this.ended)return!1;for(i===~~i?o=i:o=i===!0?dr:hr,Hi.call(e)==="[object ArrayBuffer]"?t.input=new Uint8Array(e):t.input=e,t.next_in=0,t.avail_in=t.input.length;;){for(t.avail_out===0&&(t.output=new Uint8Array(n),t.next_out=0,t.avail_out=n),a=X.inflate(t,o),a===rt&&r&&(a=X.inflateSetDictionary(t,r),a===Ae?a=X.inflate(t,o):a===li&&(a=rt));t.avail_in>0&&a===at&&t.state.wrap>0&&e[t.next_in]!==0;)X.inflateReset(t),a=X.inflate(t,o);switch(a){case sr:case li:case rt:case cr:return this.onEnd(a),this.ended=!0,!1}if(f=t.avail_out,t.next_out&&(t.avail_out===0||a===at))if(this.options.to==="string"){let c=Se.utf8border(t.output,t.next_out),l=t.next_out-c,_=Se.buf2string(t.output,c);t.next_out=l,t.avail_out=n-l,l&&t.output.set(t.output.subarray(c,c+l),0),this.onData(_)}else this.onData(t.output.length===t.next_out?t.output:t.output.subarray(0,t.next_out));if(!(a===Ae&&f===0)){if(a===at)return a=X.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(t.avail_in===0)break}}return!0};Ze.prototype.onData=function(e){this.chunks.push(e)};Ze.prototype.onEnd=function(e){e===Ae&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Pe.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function kt(e,i){let t=new Ze(i);if(t.push(e),t.err)throw t.msg||te[t.err];return t.result}function ur(e,i){return i=i||{},i.raw=!0,kt(e,i)}var wr=Ze,br=kt,gr=ur,pr=kt,xr=de,vr={Inflate:wr,inflate:br,inflateRaw:gr,ungzip:pr,constants:xr},{Deflate:Er,deflate:yr,deflateRaw:mr,gzip:zr}=Ra,{Inflate:Sr,inflate:kr,inflateRaw:Ar,ungzip:Rr}=vr;var Tr=kr;export{Tr as a};
@@ -0,0 +1 @@
1
+ import{E as Z,Ja as $,m as N,u as Q,v as X,y as Y}from"./chunk-AFVK3UQJ.js";import{i as K,k as W}from"./chunk-LXUTMJYP.js";import{e as B,f as J,g as U,i as q}from"./chunk-FALIRPMH.js";import{Aa as g,Ca as C,Da as M,Ea as I,Fa as _,Fd as V,Ga as i,Ha as t,Hd as A,Ia as b,Kd as F,L as d,M as p,Md as O,Nd as j,Pa as h,Ra as f,Ta as c,de as L,ea as r,gb as n,hb as w,he as H,ib as v,ja as m,kb as D,lb as S,ma as y,mb as E,ne as z,sd as P,td as R,te as G,wd as k,yd as T,za as u}from"./chunk-NTIQMWPW.js";import"./chunk-EQVTEUXC.js";function te(o,a){if(o&1&&(i(0,"mat-option",10),n(1),t()),o&2){let e=a.$implicit;_("value",e),r(),w(e)}}function ie(o,a){if(o&1){let e=h();i(0,"div")(1,"ap-file-input",17),f("chosen",function(l){d(e);let x=c(2);return p(x.parseFile(l))}),i(2,"div",18)(3,"div",19),n(4," Click or Drop file "),t()()()()}o&2&&(r(),_("astext",!0))}function ne(o,a){if(o&1){let e=h();i(0,"div")(1,"div")(2,"b"),n(3,"Invalid Resource Data:"),t(),b(4,"br")(5,"br"),i(6,"i"),n(7,"Selected file does not contain valid data. "),t(),b(8,"br"),t(),i(9,"div",20)(10,"button",21),f("click",function(){d(e);let l=c(2);return p(l.app.showHelp("resource"))}),i(11,"mat-icon"),n(12,"help"),t(),n(13," Help "),t()()()}}function oe(o,a){o&1&&(i(0,"div",16),n(1," Note: Data will not be validated when uploaded to server! "),t())}function ae(o,a){if(o&1){let e=h();i(0,"div",7)(1,"div")(2,"mat-form-field",8)(3,"mat-label"),n(4,"Select Destination Path"),t(),i(5,"mat-select",9,0),E("valueChange",function(l){d(e);let x=c();return S(x.targetPath,l)||(x.targetPath=l),p(l)}),M(7,te,2,2,"mat-option",10,C),t()()(),u(9,ie,5,1,"div"),u(10,ne,14,0,"div"),i(11,"div")(12,"div",11)(13,"div",12)(14,"div")(15,"span",13),n(16,"Name:"),t(),n(17),t(),i(18,"div")(19,"span",13),n(20,"Type:"),t(),n(21),t()()(),i(22,"div",14)(23,"button",15),f("click",function(){d(e);let l=c();return p(l.load())}),i(24,"mat-icon"),n(25,"file_upload"),t(),n(26," \xA0Load\xA0 "),t(),b(27,"br"),n(28,"\xA0 "),u(29,oe,2,0,"div",16),t()()()}if(o&2){let e=c();r(5),_("disabled",!e.resPaths),D("value",e.targetPath),r(2),I(e.resPaths),r(2),g(e.source.name?-1:9),r(),g(e.display.notValid?10:-1),r(7),v(" ",e.source.name," "),r(4),v(" ",e.source.type," "),r(2),_("disabled",!e.targetPath||!e.source.name),r(6),g(e.targetPath&&e.source.name?29:-1)}}var ee=class o{constructor(a,e,s,l){this.app=a;this.skclient=e;this.dialogRef=s;this.data=l}resPaths=[];targetPath=null;source={type:null,name:null,data:null};display={notValid:!1};unsubscribe=[];ngOnInit(){this.skclient.api.get(this.app.skApiVersion,"/resources").subscribe(a=>{this.resPaths=[],this.targetPath=null,this.resPaths=Object.keys(a).filter(e=>!["routes","waypoints","notes","regions","charts","tracks"].includes(e))},()=>{this.resPaths=[],this.targetPath=null})}ngOnDestroy(){this.unsubscribe.forEach(a=>a.unsubscribe())}load(){this.dialogRef.close({path:this.targetPath,data:this.source.data})}parseFile(a){this.source=a,this.source.type="Unknown";try{let e=JSON.parse(a.data);this.source.type=e.type?e.type:this.source.type}catch(e){console.log("Error parsing resource file!")}}static \u0275fac=function(e){return new(e||o)(m(Z),m(Y),m(P),m(R))};static \u0275cmp=y({type:o,selectors:[["resource-upload-dialog"]],decls:13,vars:1,consts:[["respaths",""],[1,"resourceload-dialog"],[2,"background-color","transparent"],[2,"flex","1 1 auto","text-align","center"],[2,"text-align","right"],["mat-icon-button","",3,"click"],["mat-dialog-content",""],[1,"card-group"],["floatLabel","always",2,"width","100%"],["id","respaths",3,"valueChange","disabled","value"],[3,"value"],[2,"display","flex","flex-wrap","wrap"],[2,"flex","1 1 auto","padding","5px","font-size","smaller"],[2,"font-weight","bold"],[2,"text-align","center","padding-top","15px"],["mat-raised-button","","matTooltip","Load features","matTooltipPosition","below",3,"click","disabled"],[2,"padding","10px","border","gray 1px dashed","font-style","italic"],[3,"chosen","astext"],[2,"width","200px"],[2,"padding","25%","border","gray 1px dashed"],[2,"width","100%","text-align","center"],["mat-raised-button","",3,"click"]],template:function(e,s){e&1&&(i(0,"div",1)(1,"mat-toolbar",2)(2,"span")(3,"mat-icon"),n(4,"category"),t()(),i(5,"span",3),n(6,"Load Resource"),t(),i(7,"span",4)(8,"button",5),f("click",function(){return s.dialogRef.close()}),i(9,"mat-icon"),n(10,"close"),t()()()(),i(11,"div",6),u(12,ae,30,8,"div",7),t()()),e&2&&(r(12),g(s.display.notValid?-1:12))},dependencies:[L,G,z,H,q,U,J,N,B,j,O,K,F,A,V,X,Q,W,T,k,$],styles:[".resourceload-dialog[_ngcontent-%COMP%]{font-family:roboto;position:relative;width:100%}.card-group[_ngcontent-%COMP%]{padding:5px 5%}@media only screen and (min-width:800px){.card-group[_ngcontent-%COMP%]{padding:5px 5%}}"]})};export{ee as ResourceImportDialog};
@@ -0,0 +1 @@
1
+ import{a as e}from"./chunk-64QDJX7X.js";import{a as r}from"./chunk-4SHFYAXK.js";import"./chunk-EQVTEUXC.js";var o=class extends r{decodeBlock(t){return e(new Uint8Array(t)).buffer}};export{o as default};