From bc151fa2e814d1639fcb381c67625c70e1db1857 Mon Sep 17 00:00:00 2001 From: Rizky Date: Tue, 6 Aug 2024 06:57:45 +0700 Subject: [PATCH] fix --- app/srv/core/main.js | 2 +- app/web/src/nova/prod/base/route.tsx | 16 +++++++--------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/app/srv/core/main.js b/app/srv/core/main.js index 53891cef..41218b4f 100644 --- a/app/srv/core/main.js +++ b/app/srv/core/main.js @@ -14,7 +14,7 @@ Error generating stack: `+i.message+` `+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Sr(this.defaults,n);let{transitional:r,paramsSerializer:o,headers:i}=n;r!==void 0&&o1.assertOptions(r,{silentJSONParsing:ii.transitional(ii.boolean),forcedJSONParsing:ii.transitional(ii.boolean),clarifyTimeoutError:ii.transitional(ii.boolean)},!1),o!=null&&($.isFunction(o)?n.paramsSerializer={serialize:o}:o1.assertOptions(o,{encode:ii.function,serialize:ii.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=i&&$.merge(i.common,i[n.method]);i&&$.forEach(["delete","get","head","post","put","patch","common"],w=>{delete i[w]}),n.headers=Ot.concat(a,i);let l=[],u=!0;this.interceptors.request.forEach(function(T){typeof T.runWhen=="function"&&T.runWhen(n)===!1||(u=u&&T.synchronous,l.unshift(T.fulfilled,T.rejected))});let c=[];this.interceptors.response.forEach(function(T){c.push(T.fulfilled,T.rejected)});let p,y=0,d;if(!u){let w=[n1.bind(this),void 0];for(w.unshift.apply(w,l),w.push.apply(w,c),d=w.length,p=Promise.resolve(n);y{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](o);r._listeners=null}),this.promise.then=o=>{let i,a=new Promise(l=>{r.subscribe(l),i=l}).then(o);return a.cancel=function(){r.unsubscribe(i)},a},t(function(i,a,l){r.reason||(r.reason=new Mr(i,a,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;let n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new e(function(o){t=o}),cancel:t}}},ob=s0;h();g();m();function a0(e){return function(n){return e.apply(null,n)}}h();g();m();function l0(e){return $.isObject(e)&&e.isAxiosError===!0}h();g();m();var u0={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(u0).forEach(([e,t])=>{u0[t]=e});var ib=u0;function sb(e){let t=new Gl(e),n=jl(Gl.prototype.request,t);return $.extend(n,Gl.prototype,t,{allOwnKeys:!0}),$.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return sb(Sr(e,o))},n}var It=sb(oa);It.Axios=Gl;It.CanceledError=Mr;It.CancelToken=ob;It.isCancel=Wl;It.VERSION=r1;It.toFormData=oi;It.AxiosError=Te;It.Cancel=It.CanceledError;It.all=function(t){return Promise.all(t)};It.spread=a0;It.isAxiosError=l0;It.mergeConfig=Sr;It.AxiosHeaders=Ot;It.formToJSON=e=>Zf($.isHTMLForm(e)?new FormData(e):e);It.getAdapter=t1.getAdapter;It.HttpStatusCode=ib;It.default=It;var i1=It;var{Axios:GY,AxiosError:YY,CanceledError:XY,isCancel:ZY,CancelToken:KY,VERSION:QY,all:JY,Cancel:eX,isAxiosError:tX,spread:nX,toFormData:rX,AxiosHeaders:oX,HttpStatusCode:iX,formToJSON:sX,getAdapter:aX,mergeConfig:lX}=i1;BigInt.prototype.toJSON=function(){return"BigInt::"+this.toString()};var e3=typeof window<"u"?window:null,ab=typeof global<"u"?global:void 0,s1=async(e,t,n,r)=>{let o={...n},i=null,a=!1,l=null,u=[];if(Array.isArray(t))for(let d of t)d instanceof File&&(u.push(d),a=!0),typeof d=="function"&&(l=d);else t instanceof File&&(a=!0,u.push(t));if(!a)i=JSON.stringify(t),o["content-type"]="aplication/json";else{let d=new FormData;for(let x of u)d.append(x.name,x);i=d,delete o["content-type"],o.enctype="multipart/form-data;"}let c=new URL(e);if(e3!==null){let d=new URL(location.href),x="";if(c.host===d.host||ab&&typeof ab.server_hook=="function"?x=c.toString():x=`${d.protocol}//${d.host}/_proxy/${encodeURIComponent(c.toString())}`,x){if(l)return(await i1({method:t?"post":void 0,url:x,data:i,onUploadProgress:l})).data;{let T=await(await fetch(x,t?{method:"POST",body:i,headers:o}:void 0)).text();if(r===!1)return T;try{return JSON.parse(T,lb)}catch{return T}}}}let y=await(await fetch(c,t?{method:"POST",body:i,headers:o}:void 0)).text();try{return JSON.parse(y,lb)}catch{return y}},lb=(e,t)=>typeof t=="string"&&t.startsWith("BigInt::")?BigInt(t.substring(8)):t;h();g();m();var Tb=ye(Eb()),Ib=async(e,t)=>{let n=(0,Tb.default)(e,"/"),r=A3(n);await new Promise(o=>{let i=document,a=i.createElement("script");a.onload=async()=>{o()},localStorage.getItem("api-ts-"+n)||localStorage.setItem("api-ts-"+n,Date.now().toString());let l=localStorage.getItem("api-ts-"+n),u=new URL(n),c=new URL(location.href),p="";u.host!==c.host&&(p="&remote=1"),t?a.src=`/_prasi/load.js?url=${n}&v3&dev=1&ts=${l}${p}`:a.src=`/_prasi/load.js?url=${n}&v3&ts=${l}${p}`,a.onerror=()=>{o()},document.querySelector(`script[src="${a.src}"]`)?o():i.body.appendChild(a)})},A3=e=>{let t=new URL(e);return`${t.protocol}//${t.host}`};var Yl={},Ab=e=>{fn.prasiApi||(fn.prasiApi={});try{let t=new URL(e),n=`${t.protocol}//${t.host}`;return fn.prasiApi[n]||Yl[n]||(Yl[n]=Ib(n,location.hostname.includes("prasi"))),new Proxy({},{get:(r,o)=>{if(o==="_url")return(a,l)=>{let u=new URL(n);u.pathname=a.split("/").filter(y=>y).join("/");let c=new URL(location.href),p="";return u.host===c.host||l===!1?p=u.toString():p=`${c.protocol}//${c.host}/_proxy/${encodeURIComponent(u.toString())}`,p};let i=a=>function(...l){return new Promise(async(u,c)=>{try{let p=fn.prasiApi[n];if(!p&&Yl&&typeof Yl[n]=="object"&&(await Yl[n],p=fn.prasiApi[n]),p){if(a==="_raw"){let x=l[0],w=`${n}${x}`,T=await Cb(w,l.slice(1));u(T);return}if(p.apiEntry||(p.apiEntry={}),p.apiEntry&&!p.apiEntry[a]){c(`API ${a.toString()} not found, existing API: - ${Object.keys(p.apiEntry||{}).join(` - `)}`);return}let y=p.apiEntry[a].url,d=p.apiEntry[a].args;if(y&&d){if(l.length>0&&d.length>0)for(let[T,S]of Object.entries(l)){let _=d[parseInt(T)];d&&d.includes(_)&&S&&typeof S!="string"&&typeof S!="number"||(y=y.replace(`:${_}?`,S+""),y=y.replace(`:${_}`,S+""))}let x=`${n}${y}`,w=await Cb(x,l);u(w)}else console.error(`API Not Found: ${a.toString()}`)}else c("Failed to load API [Proxy]: "+n)}catch(p){c(p)}})};return o==="then"?new Proxy({},{get:(a,l)=>i(l)}):i(o)}})}catch{return null}},Cb=async(e,t)=>await s1(e,t,{"content-type":"application/json"});h();g();m();var JS=ye(Ob());h();g();m();function da(e){let t=e.length;for(;--t>=0;)e[t]=0}var D3=0,yS=1,L3=2,M3=3,F3=258,M0=29,uu=256,tu=uu+1+M0,ca=30,F0=19,xS=2*tu+1,Gi=15,d0=16,j3=7,j0=256,_S=16,wS=17,kS=18,I0=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]),p1=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]),B3=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),vS=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),U3=512,po=new Array((tu+2)*2);da(po);var Ql=new Array(ca*2);da(Ql);var nu=new Array(U3);da(nu);var ru=new Array(F3-M3+1);da(ru);var B0=new Array(M0);da(B0);var d1=new Array(ca);da(d1);function h0(e,t,n,r,o){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=o,this.has_stree=e&&e.length}var bS,SS,ES;function m0(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}var TS=e=>e<256?nu[e]:nu[256+(e>>>7)],ou=(e,t)=>{e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255},Sn=(e,t,n)=>{e.bi_valid>d0-n?(e.bi_buf|=t<>d0-e.bi_valid,e.bi_valid+=n-d0):(e.bi_buf|=t<{Sn(e,n[t*2],n[t*2+1])},IS=(e,t)=>{let n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1},$3=e=>{e.bi_valid===16?(ou(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)},z3=(e,t)=>{let n=t.dyn_tree,r=t.max_code,o=t.stat_desc.static_tree,i=t.stat_desc.has_stree,a=t.stat_desc.extra_bits,l=t.stat_desc.extra_base,u=t.stat_desc.max_length,c,p,y,d,x,w,T=0;for(d=0;d<=Gi;d++)e.bl_count[d]=0;for(n[e.heap[e.heap_max]*2+1]=0,c=e.heap_max+1;cu&&(d=u,T++),n[p*2+1]=d,!(p>r)&&(e.bl_count[d]++,x=0,p>=l&&(x=a[p-l]),w=n[p*2],e.opt_len+=w*(d+x),i&&(e.static_len+=w*(o[p*2+1]+x)));if(T!==0){do{for(d=u-1;e.bl_count[d]===0;)d--;e.bl_count[d]--,e.bl_count[d+1]+=2,e.bl_count[u]--,T-=2}while(T>0);for(d=u;d!==0;d--)for(p=e.bl_count[d];p!==0;)y=e.heap[--c],!(y>r)&&(n[y*2+1]!==d&&(e.opt_len+=(d-n[y*2+1])*n[y*2],n[y*2+1]=d),p--)}},CS=(e,t,n)=>{let r=new Array(Gi+1),o=0,i,a;for(i=1;i<=Gi;i++)o=o+n[i-1]<<1,r[i]=o;for(a=0;a<=t;a++){let l=e[a*2+1];l!==0&&(e[a*2]=IS(r[l]++,l))}},H3=()=>{let e,t,n,r,o,i=new Array(Gi+1);for(n=0,r=0;r>=7;r{let t;for(t=0;t{e.bi_valid>8?ou(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},Nb=(e,t,n,r)=>{let o=t*2,i=n*2;return e[o]{let r=e.heap[n],o=n<<1;for(;o<=e.heap_len&&(o{let r,o,i=0,a,l;if(e.sym_next!==0)do r=e.pending_buf[e.sym_buf+i++]&255,r+=(e.pending_buf[e.sym_buf+i++]&255)<<8,o=e.pending_buf[e.sym_buf+i++],r===0?jr(e,o,t):(a=ru[o],jr(e,a+uu+1,t),l=I0[a],l!==0&&(o-=B0[a],Sn(e,o,l)),r--,a=TS(r),jr(e,a,n),l=p1[a],l!==0&&(r-=d1[a],Sn(e,r,l)));while(i{let n=t.dyn_tree,r=t.stat_desc.static_tree,o=t.stat_desc.has_stree,i=t.stat_desc.elems,a,l,u=-1,c;for(e.heap_len=0,e.heap_max=xS,a=0;a>1;a>=1;a--)g0(e,n,a);c=i;do a=e.heap[1],e.heap[1]=e.heap[e.heap_len--],g0(e,n,1),l=e.heap[1],e.heap[--e.heap_max]=a,e.heap[--e.heap_max]=l,n[c*2]=n[a*2]+n[l*2],e.depth[c]=(e.depth[a]>=e.depth[l]?e.depth[a]:e.depth[l])+1,n[a*2+1]=n[l*2+1]=c,e.heap[1]=c++,g0(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],z3(e,t),CS(n,u,e.bl_count)},Lb=(e,t,n)=>{let r,o=-1,i,a=t[0*2+1],l=0,u=7,c=4;for(a===0&&(u=138,c=3),t[(n+1)*2+1]=65535,r=0;r<=n;r++)i=a,a=t[(r+1)*2+1],!(++l{let r,o=-1,i,a=t[0*2+1],l=0,u=7,c=4;for(a===0&&(u=138,c=3),r=0;r<=n;r++)if(i=a,a=t[(r+1)*2+1],!(++l{let t;for(Lb(e,e.dyn_ltree,e.l_desc.max_code),Lb(e,e.dyn_dtree,e.d_desc.max_code),C0(e,e.bl_desc),t=F0-1;t>=3&&e.bl_tree[vS[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t},q3=(e,t,n,r)=>{let o;for(Sn(e,t-257,5),Sn(e,n-1,5),Sn(e,r-4,4),o=0;o{let t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return 0;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return 1;for(n=32;n{Fb||(H3(),Fb=!0),e.l_desc=new m0(e.dyn_ltree,bS),e.d_desc=new m0(e.dyn_dtree,SS),e.bl_desc=new m0(e.bl_tree,ES),e.bi_buf=0,e.bi_valid=0,AS(e)},PS=(e,t,n,r)=>{Sn(e,(D3<<1)+(r?1:0),3),RS(e),ou(e,n),ou(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n},Y3=e=>{Sn(e,yS<<1,3),jr(e,j0,po),$3(e)},X3=(e,t,n,r)=>{let o,i,a=0;e.level>0?(e.strm.data_type===2&&(e.strm.data_type=V3(e)),C0(e,e.l_desc),C0(e,e.d_desc),a=W3(e),o=e.opt_len+3+7>>>3,i=e.static_len+3+7>>>3,i<=o&&(o=i)):o=i=n+5,n+4<=o&&t!==-1?PS(e,t,n,r):e.strategy===4||i===o?(Sn(e,(yS<<1)+(r?1:0),3),Db(e,po,Ql)):(Sn(e,(L3<<1)+(r?1:0),3),q3(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),Db(e,e.dyn_ltree,e.dyn_dtree)),AS(e),r&&RS(e)},Z3=(e,t,n)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=n,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(ru[n]+uu+1)*2]++,e.dyn_dtree[TS(t)*2]++),e.sym_next===e.sym_end),K3=G3,Q3=PS,J3=X3,eD=Z3,tD=Y3,nD={_tr_init:K3,_tr_stored_block:Q3,_tr_flush_block:J3,_tr_tally:eD,_tr_align:tD},rD=(e,t,n,r)=>{let o=e&65535|0,i=e>>>16&65535|0,a=0;for(;n!==0;){a=n>2e3?2e3:n,n-=a;do o=o+t[r++]|0,i=i+o|0;while(--a);o%=65521,i%=65521}return o|i<<16|0},iu=rD,oD=()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t},iD=new Uint32Array(oD()),sD=(e,t,n,r)=>{let o=iD,i=r+n;e^=-1;for(let a=r;a>>8^o[(e^t[a])&255];return e^-1},Bt=sD,Zi={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"},Ji={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:aD,_tr_stored_block:A0,_tr_flush_block:lD,_tr_tally:li,_tr_align:uD}=nD,{Z_NO_FLUSH:ui,Z_PARTIAL_FLUSH:cD,Z_FULL_FLUSH:fD,Z_FINISH:nr,Z_BLOCK:jb,Z_OK:qt,Z_STREAM_END:Bb,Z_STREAM_ERROR:Br,Z_DATA_ERROR:pD,Z_BUF_ERROR:y0,Z_DEFAULT_COMPRESSION:dD,Z_FILTERED:hD,Z_HUFFMAN_ONLY:a1,Z_RLE:mD,Z_FIXED:gD,Z_DEFAULT_STRATEGY:yD,Z_UNKNOWN:xD,Z_DEFLATED:g1}=Ji,_D=9,wD=15,kD=8,vD=29,bD=256,R0=bD+1+vD,SD=30,ED=19,TD=2*R0+1,ID=15,Le=3,ai=258,Ur=ai+Le+1,CD=32,fa=42,U0=57,P0=69,O0=73,N0=91,D0=103,Yi=113,Zl=666,pn=1,ha=2,Ki=3,ma=4,AD=3,Xi=(e,t)=>(e.msg=Zi[t],t),Ub=e=>e*2-(e>4?9:0),si=e=>{let t=e.length;for(;--t>=0;)e[t]=0},RD=e=>{let t,n,r,o=e.w_size;t=e.hash_size,r=t;do n=e.head[--r],e.head[r]=n>=o?n-o:0;while(--t);t=o,r=t;do n=e.prev[--r],e.prev[r]=n>=o?n-o:0;while(--t)},PD=(e,t,n)=>(t<{let t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))},Bn=(e,t)=>{lD(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,jn(e.strm)},He=(e,t)=>{e.pending_buf[e.pending++]=t},Xl=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255},L0=(e,t,n,r)=>{let o=e.avail_in;return o>r&&(o=r),o===0?0:(e.avail_in-=o,t.set(e.input.subarray(e.next_in,e.next_in+o),n),e.state.wrap===1?e.adler=iu(e.adler,t,o,n):e.state.wrap===2&&(e.adler=Bt(e.adler,t,o,n)),e.next_in+=o,e.total_in+=o,o)},OS=(e,t)=>{let n=e.max_chain_length,r=e.strstart,o,i,a=e.prev_length,l=e.nice_match,u=e.strstart>e.w_size-Ur?e.strstart-(e.w_size-Ur):0,c=e.window,p=e.w_mask,y=e.prev,d=e.strstart+ai,x=c[r+a-1],w=c[r+a];e.prev_length>=e.good_match&&(n>>=2),l>e.lookahead&&(l=e.lookahead);do if(o=t,!(c[o+a]!==w||c[o+a-1]!==x||c[o]!==c[r]||c[++o]!==c[r+1])){r+=2,o++;do;while(c[++r]===c[++o]&&c[++r]===c[++o]&&c[++r]===c[++o]&&c[++r]===c[++o]&&c[++r]===c[++o]&&c[++r]===c[++o]&&c[++r]===c[++o]&&c[++r]===c[++o]&&ra){if(e.match_start=t,a=i,i>=l)break;x=c[r+a-1],w=c[r+a]}}while((t=y[t&p])>u&&--n!==0);return a<=e.lookahead?a:e.lookahead},pa=e=>{let t=e.w_size,n,r,o;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-Ur)&&(e.window.set(e.window.subarray(t,t+t-r),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),RD(e),r+=t),e.strm.avail_in===0)break;if(n=L0(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=n,e.lookahead+e.insert>=Le)for(o=e.strstart-e.insert,e.ins_h=e.window[o],e.ins_h=ci(e,e.ins_h,e.window[o+1]);e.insert&&(e.ins_h=ci(e,e.ins_h,e.window[o+Le-1]),e.prev[o&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=o,o++,e.insert--,!(e.lookahead+e.insert{let n=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,r,o,i,a=0,l=e.strm.avail_in;do{if(r=65535,i=e.bi_valid+42>>3,e.strm.avail_outo+e.strm.avail_in&&(r=o+e.strm.avail_in),r>i&&(r=i),r>8,e.pending_buf[e.pending-2]=~r,e.pending_buf[e.pending-1]=~r>>8,jn(e.strm),o&&(o>r&&(o=r),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+o),e.strm.next_out),e.strm.next_out+=o,e.strm.avail_out-=o,e.strm.total_out+=o,e.block_start+=o,r-=o),r&&(L0(e.strm,e.strm.output,e.strm.next_out,r),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r)}while(a===0);return l-=e.strm.avail_in,l&&(l>=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<=l&&(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-l,e.strm.next_in),e.strstart),e.strstart+=l,e.insert+=l>e.w_size-e.insert?e.w_size-e.insert:l),e.block_start=e.strstart),e.high_wateri&&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++,i+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),i>e.strm.avail_in&&(i=e.strm.avail_in),i&&(L0(e.strm,e.window,e.strstart,i),e.strstart+=i,e.insert+=i>e.w_size-e.insert?e.w_size-e.insert:i),e.high_water>3,i=e.pending_buf_size-i>65535?65535:e.pending_buf_size-i,n=i>e.w_size?e.w_size:i,o=e.strstart-e.block_start,(o>=n||(o||t===nr)&&t!==ui&&e.strm.avail_in===0&&o<=i)&&(r=o>i?i:o,a=t===nr&&e.strm.avail_in===0&&r===o?1:0,A0(e,e.block_start,r,a),e.block_start+=r,jn(e.strm)),a?Ki:pn)},x0=(e,t)=>{let n,r;for(;;){if(e.lookahead=Le&&(e.ins_h=ci(e,e.ins_h,e.window[e.strstart+Le-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),n!==0&&e.strstart-n<=e.w_size-Ur&&(e.match_length=OS(e,n)),e.match_length>=Le)if(r=li(e,e.strstart-e.match_start,e.match_length-Le),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=Le){e.match_length--;do e.strstart++,e.ins_h=ci(e,e.ins_h,e.window[e.strstart+Le-1]),n=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=ci(e,e.ins_h,e.window[e.strstart+1]);else r=li(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(Bn(e,!1),e.strm.avail_out===0))return pn}return e.insert=e.strstart{let n,r,o;for(;;){if(e.lookahead=Le&&(e.ins_h=ci(e,e.ins_h,e.window[e.strstart+Le-1]),n=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=Le-1,n!==0&&e.prev_length4096)&&(e.match_length=Le-1)),e.prev_length>=Le&&e.match_length<=e.prev_length){o=e.strstart+e.lookahead-Le,r=li(e,e.strstart-1-e.prev_match,e.prev_length-Le),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=o&&(e.ins_h=ci(e,e.ins_h,e.window[e.strstart+Le-1]),n=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=Le-1,e.strstart++,r&&(Bn(e,!1),e.strm.avail_out===0))return pn}else if(e.match_available){if(r=li(e,0,e.window[e.strstart-1]),r&&Bn(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return pn}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=li(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart{let n,r,o,i,a=e.window;for(;;){if(e.lookahead<=ai){if(pa(e),e.lookahead<=ai&&t===ui)return pn;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=Le&&e.strstart>0&&(o=e.strstart-1,r=a[o],r===a[++o]&&r===a[++o]&&r===a[++o])){i=e.strstart+ai;do;while(r===a[++o]&&r===a[++o]&&r===a[++o]&&r===a[++o]&&r===a[++o]&&r===a[++o]&&r===a[++o]&&r===a[++o]&&oe.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=Le?(n=li(e,1,e.match_length-Le),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=li(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(Bn(e,!1),e.strm.avail_out===0))return pn}return e.insert=0,t===nr?(Bn(e,!0),e.strm.avail_out===0?Ki:ma):e.sym_next&&(Bn(e,!1),e.strm.avail_out===0)?pn:ha},ND=(e,t)=>{let n;for(;;){if(e.lookahead===0&&(pa(e),e.lookahead===0)){if(t===ui)return pn;break}if(e.match_length=0,n=li(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(Bn(e,!1),e.strm.avail_out===0))return pn}return e.insert=0,t===nr?(Bn(e,!0),e.strm.avail_out===0?Ki:ma):e.sym_next&&(Bn(e,!1),e.strm.avail_out===0)?pn:ha};function Fr(e,t,n,r,o){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=o}var Kl=[new Fr(0,0,0,0,NS),new Fr(4,4,8,4,x0),new Fr(4,5,16,8,x0),new Fr(4,6,32,32,x0),new Fr(4,4,16,16,la),new Fr(8,16,32,32,la),new Fr(8,16,128,128,la),new Fr(8,32,128,256,la),new Fr(32,128,258,1024,la),new Fr(32,258,258,4096,la)],DD=e=>{e.window_size=2*e.w_size,si(e.head),e.max_lazy_match=Kl[e.level].max_lazy,e.good_match=Kl[e.level].good_length,e.nice_match=Kl[e.level].nice_length,e.max_chain_length=Kl[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=Le-1,e.match_available=0,e.ins_h=0};function LD(){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=g1,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(TD*2),this.dyn_dtree=new Uint16Array((2*SD+1)*2),this.bl_tree=new Uint16Array((2*ED+1)*2),si(this.dyn_ltree),si(this.dyn_dtree),si(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(ID+1),this.heap=new Uint16Array(2*R0+1),si(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*R0+1),si(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 cu=e=>{if(!e)return 1;let t=e.state;return!t||t.strm!==e||t.status!==fa&&t.status!==U0&&t.status!==P0&&t.status!==O0&&t.status!==N0&&t.status!==D0&&t.status!==Yi&&t.status!==Zl?1:0},DS=e=>{if(cu(e))return Xi(e,Br);e.total_in=e.total_out=0,e.data_type=xD;let t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?U0:t.wrap?fa:Yi,e.adler=t.wrap===2?0:1,t.last_flush=-2,aD(t),qt},LS=e=>{let t=DS(e);return t===qt&&DD(e.state),t},MD=(e,t)=>cu(e)||e.state.wrap!==2?Br:(e.state.gzhead=t,qt),MS=(e,t,n,r,o,i)=>{if(!e)return Br;let a=1;if(t===dD&&(t=6),r<0?(a=0,r=-r):r>15&&(a=2,r-=16),o<1||o>_D||n!==g1||r<8||r>15||t<0||t>9||i<0||i>gD||r===8&&a!==1)return Xi(e,Br);r===8&&(r=9);let l=new LD;return e.state=l,l.strm=e,l.status=fa,l.wrap=a,l.gzhead=null,l.w_bits=r,l.w_size=1<MS(e,t,g1,wD,kD,yD),jD=(e,t)=>{if(cu(e)||t>jb||t<0)return e?Xi(e,Br):Br;let n=e.state;if(!e.output||e.avail_in!==0&&!e.input||n.status===Zl&&t!==nr)return Xi(e,e.avail_out===0?y0:Br);let r=n.last_flush;if(n.last_flush=t,n.pending!==0){if(jn(e),e.avail_out===0)return n.last_flush=-1,qt}else if(e.avail_in===0&&Ub(t)<=Ub(r)&&t!==nr)return Xi(e,y0);if(n.status===Zl&&e.avail_in!==0)return Xi(e,y0);if(n.status===fa&&n.wrap===0&&(n.status=Yi),n.status===fa){let o=g1+(n.w_bits-8<<4)<<8,i=-1;if(n.strategy>=a1||n.level<2?i=0:n.level<6?i=1:n.level===6?i=2:i=3,o|=i<<6,n.strstart!==0&&(o|=CD),o+=31-o%31,Xl(n,o),n.strstart!==0&&(Xl(n,e.adler>>>16),Xl(n,e.adler&65535)),e.adler=1,n.status=Yi,jn(e),n.pending!==0)return n.last_flush=-1,qt}if(n.status===U0){if(e.adler=0,He(n,31),He(n,139),He(n,8),n.gzhead)He(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),He(n,n.gzhead.time&255),He(n,n.gzhead.time>>8&255),He(n,n.gzhead.time>>16&255),He(n,n.gzhead.time>>24&255),He(n,n.level===9?2:n.strategy>=a1||n.level<2?4:0),He(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(He(n,n.gzhead.extra.length&255),He(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=Bt(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=P0;else if(He(n,0),He(n,0),He(n,0),He(n,0),He(n,0),He(n,n.level===9?2:n.strategy>=a1||n.level<2?4:0),He(n,AD),n.status=Yi,jn(e),n.pending!==0)return n.last_flush=-1,qt}if(n.status===P0){if(n.gzhead.extra){let o=n.pending,i=(n.gzhead.extra.length&65535)-n.gzindex;for(;n.pending+i>n.pending_buf_size;){let l=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+l),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>o&&(e.adler=Bt(e.adler,n.pending_buf,n.pending-o,o)),n.gzindex+=l,jn(e),n.pending!==0)return n.last_flush=-1,qt;o=0,i-=l}let a=new Uint8Array(n.gzhead.extra);n.pending_buf.set(a.subarray(n.gzindex,n.gzindex+i),n.pending),n.pending+=i,n.gzhead.hcrc&&n.pending>o&&(e.adler=Bt(e.adler,n.pending_buf,n.pending-o,o)),n.gzindex=0}n.status=O0}if(n.status===O0){if(n.gzhead.name){let o=n.pending,i;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>o&&(e.adler=Bt(e.adler,n.pending_buf,n.pending-o,o)),jn(e),n.pending!==0)return n.last_flush=-1,qt;o=0}n.gzindexo&&(e.adler=Bt(e.adler,n.pending_buf,n.pending-o,o)),n.gzindex=0}n.status=N0}if(n.status===N0){if(n.gzhead.comment){let o=n.pending,i;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>o&&(e.adler=Bt(e.adler,n.pending_buf,n.pending-o,o)),jn(e),n.pending!==0)return n.last_flush=-1,qt;o=0}n.gzindexo&&(e.adler=Bt(e.adler,n.pending_buf,n.pending-o,o))}n.status=D0}if(n.status===D0){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(jn(e),n.pending!==0))return n.last_flush=-1,qt;He(n,e.adler&255),He(n,e.adler>>8&255),e.adler=0}if(n.status=Yi,jn(e),n.pending!==0)return n.last_flush=-1,qt}if(e.avail_in!==0||n.lookahead!==0||t!==ui&&n.status!==Zl){let o=n.level===0?NS(n,t):n.strategy===a1?ND(n,t):n.strategy===mD?OD(n,t):Kl[n.level].func(n,t);if((o===Ki||o===ma)&&(n.status=Zl),o===pn||o===Ki)return e.avail_out===0&&(n.last_flush=-1),qt;if(o===ha&&(t===cD?uD(n):t!==jb&&(A0(n,0,0,!1),t===fD&&(si(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),jn(e),e.avail_out===0))return n.last_flush=-1,qt}return t!==nr?qt:n.wrap<=0?Bb:(n.wrap===2?(He(n,e.adler&255),He(n,e.adler>>8&255),He(n,e.adler>>16&255),He(n,e.adler>>24&255),He(n,e.total_in&255),He(n,e.total_in>>8&255),He(n,e.total_in>>16&255),He(n,e.total_in>>24&255)):(Xl(n,e.adler>>>16),Xl(n,e.adler&65535)),jn(e),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?qt:Bb)},BD=e=>{if(cu(e))return Br;let t=e.state.status;return e.state=null,t===Yi?Xi(e,pD):qt},UD=(e,t)=>{let n=t.length;if(cu(e))return Br;let r=e.state,o=r.wrap;if(o===2||o===1&&r.status!==fa||r.lookahead)return Br;if(o===1&&(e.adler=iu(e.adler,t,n,0)),r.wrap=0,n>=r.w_size){o===0&&(si(r.head),r.strstart=0,r.block_start=0,r.insert=0);let u=new Uint8Array(r.w_size);u.set(t.subarray(n-r.w_size,n),0),t=u,n=r.w_size}let i=e.avail_in,a=e.next_in,l=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,pa(r);r.lookahead>=Le;){let u=r.strstart,c=r.lookahead-(Le-1);do r.ins_h=ci(r,r.ins_h,r.window[u+Le-1]),r.prev[u&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=u,u++;while(--c);r.strstart=u,r.lookahead=Le-1,pa(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=Le-1,r.match_available=0,e.next_in=a,e.input=l,e.avail_in=i,r.wrap=o,qt},$D=FD,zD=MS,HD=LS,WD=DS,qD=MD,VD=jD,GD=BD,YD=UD,XD="pako deflate (from Nodeca project)",Jl={deflateInit:$D,deflateInit2:zD,deflateReset:HD,deflateResetKeep:WD,deflateSetHeader:qD,deflate:VD,deflateEnd:GD,deflateSetDictionary:YD,deflateInfo:XD},ZD=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),KD=function(e){let t=Array.prototype.slice.call(arguments,1);for(;t.length;){let n=t.shift();if(n){if(typeof n!="object")throw new TypeError(n+"must be non-object");for(let r in n)ZD(n,r)&&(e[r]=n[r])}}return e},QD=e=>{let t=0;for(let r=0,o=e.length;r=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;su[254]=su[254]=1;var JD=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let t,n,r,o,i,a=e.length,l=0;for(o=0;o>>6,t[i++]=128|n&63):n<65536?(t[i++]=224|n>>>12,t[i++]=128|n>>>6&63,t[i++]=128|n&63):(t[i++]=240|n>>>18,t[i++]=128|n>>>12&63,t[i++]=128|n>>>6&63,t[i++]=128|n&63);return t},eL=(e,t)=>{if(t<65534&&e.subarray&&FS)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let n="";for(let r=0;r{let n=t||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,t));let r,o,i=new Array(n*2);for(o=0,r=0;r4){i[o++]=65533,r+=l-1;continue}for(a&=l===2?31:l===3?15:7;l>1&&r1){i[o++]=65533;continue}a<65536?i[o++]=a:(a-=65536,i[o++]=55296|a>>10&1023,i[o++]=56320|a&1023)}return eL(i,o)},nL=(e,t)=>{t=t||e.length,t>e.length&&(t=e.length);let n=t-1;for(;n>=0&&(e[n]&192)===128;)n--;return n<0||n===0?t:n+su[e[n]]>t?n:t},au={string2buf:JD,buf2string:tL,utf8border:nL};function rL(){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 jS=rL,BS=Object.prototype.toString,{Z_NO_FLUSH:oL,Z_SYNC_FLUSH:iL,Z_FULL_FLUSH:sL,Z_FINISH:aL,Z_OK:h1,Z_STREAM_END:lL,Z_DEFAULT_COMPRESSION:uL,Z_DEFAULT_STRATEGY:cL,Z_DEFLATED:fL}=Ji;function fu(e){this.options=y1.assign({level:uL,method:fL,chunkSize:16384,windowBits:15,memLevel:8,strategy:cL},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new jS,this.strm.avail_out=0;let n=Jl.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==h1)throw new Error(Zi[n]);if(t.header&&Jl.deflateSetHeader(this.strm,t.header),t.dictionary){let r;if(typeof t.dictionary=="string"?r=au.string2buf(t.dictionary):BS.call(t.dictionary)==="[object ArrayBuffer]"?r=new Uint8Array(t.dictionary):r=t.dictionary,n=Jl.deflateSetDictionary(this.strm,r),n!==h1)throw new Error(Zi[n]);this._dict_set=!0}}fu.prototype.push=function(e,t){let n=this.strm,r=this.options.chunkSize,o,i;if(this.ended)return!1;for(t===~~t?i=t:i=t===!0?aL:oL,typeof e=="string"?n.input=au.string2buf(e):BS.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){if(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),(i===iL||i===sL)&&n.avail_out<=6){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(o=Jl.deflate(n,i),o===lL)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),o=Jl.deflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===h1;if(n.avail_out===0){this.onData(n.output);continue}if(i>0&&n.next_out>0){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(n.avail_in===0)break}return!0};fu.prototype.onData=function(e){this.chunks.push(e)};fu.prototype.onEnd=function(e){e===h1&&(this.result=y1.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function $0(e,t){let n=new fu(t);if(n.push(e,!0),n.err)throw n.msg||Zi[n.err];return n.result}function pL(e,t){return t=t||{},t.raw=!0,$0(e,t)}function dL(e,t){return t=t||{},t.gzip=!0,$0(e,t)}var hL=fu,mL=$0,gL=pL,yL=dL,xL=Ji,_L={Deflate:hL,deflate:mL,deflateRaw:gL,gzip:yL,constants:xL},l1=16209,wL=16191,kL=function(t,n){let r,o,i,a,l,u,c,p,y,d,x,w,T,S,_,k,v,E,P,W,D,Y,J,Z,ce=t.state;r=t.next_in,J=t.input,o=r+(t.avail_in-5),i=t.next_out,Z=t.output,a=i-(n-t.avail_out),l=i+(t.avail_out-257),u=ce.dmax,c=ce.wsize,p=ce.whave,y=ce.wnext,d=ce.window,x=ce.hold,w=ce.bits,T=ce.lencode,S=ce.distcode,_=(1<>>24,x>>>=E,w-=E,E=v>>>16&255,E===0)Z[i++]=v&65535;else if(E&16){P=v&65535,E&=15,E&&(w>>=E,w-=E),w<15&&(x+=J[r++]<>>24,x>>>=E,w-=E,E=v>>>16&255,E&16){if(W=v&65535,E&=15,wu){t.msg="invalid distance too far back",ce.mode=l1;break e}if(x>>>=E,w-=E,E=i-a,W>E){if(E=W-E,E>p&&ce.sane){t.msg="invalid distance too far back",ce.mode=l1;break e}if(D=0,Y=d,y===0){if(D+=c-E,E2;)Z[i++]=Y[D++],Z[i++]=Y[D++],Z[i++]=Y[D++],P-=3;P&&(Z[i++]=Y[D++],P>1&&(Z[i++]=Y[D++]))}else{D=i-W;do Z[i++]=Z[D++],Z[i++]=Z[D++],Z[i++]=Z[D++],P-=3;while(P>2);P&&(Z[i++]=Z[D++],P>1&&(Z[i++]=Z[D++]))}}else if(E&64){t.msg="invalid distance code",ce.mode=l1;break e}else{v=S[(v&65535)+(x&(1<>3,r-=P,w-=P<<3,x&=(1<{let u=l.bits,c=0,p=0,y=0,d=0,x=0,w=0,T=0,S=0,_=0,k=0,v,E,P,W,D,Y=null,J,Z=new Uint16Array(ua+1),ce=new Uint16Array(ua+1),Ue=null,Ct,M,B;for(c=0;c<=ua;c++)Z[c]=0;for(p=0;p=1&&Z[d]===0;d--);if(x>d&&(x=d),d===0)return o[i++]=1<<24|64<<16|0,o[i++]=1<<24|64<<16|0,l.bits=1,0;for(y=1;y0&&(e===Hb||d!==1))return-1;for(ce[1]=0,c=1;c$b||e===Wb&&_>zb)return 1;for(;;){Ct=c-T,a[p]+1=J?(M=Ue[a[p]-J],B=Y[a[p]-J]):(M=96,B=0),v=1<>T)+E]=Ct<<24|M<<16|B|0;while(E!==0);for(v=1<>=1;if(v!==0?(k&=v-1,k+=v):k=0,p++,--Z[c]===0){if(c===d)break;c=t[n+a[p]]}if(c>x&&(k&W)!==P){for(T===0&&(T=x),D+=y,w=c-T,S=1<$b||e===Wb&&_>zb)return 1;P=k&W,o[P]=x<<24|w<<16|D-i|0}}return k!==0&&(o[D+k]=c-T<<24|64<<16|0),l.bits=x,0},eu=TL,IL=0,US=1,$S=2,{Z_FINISH:qb,Z_BLOCK:CL,Z_TREES:u1,Z_OK:Qi,Z_STREAM_END:AL,Z_NEED_DICT:RL,Z_STREAM_ERROR:rr,Z_DATA_ERROR:zS,Z_MEM_ERROR:HS,Z_BUF_ERROR:PL,Z_DEFLATED:Vb}=Ji,x1=16180,Gb=16181,Yb=16182,Xb=16183,Zb=16184,Kb=16185,Qb=16186,Jb=16187,eS=16188,tS=16189,m1=16190,fo=16191,w0=16192,nS=16193,k0=16194,rS=16195,oS=16196,iS=16197,sS=16198,c1=16199,f1=16200,aS=16201,lS=16202,uS=16203,cS=16204,fS=16205,v0=16206,pS=16207,dS=16208,ft=16209,WS=16210,qS=16211,OL=852,NL=592,DL=15,LL=DL,hS=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function ML(){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 es=e=>{if(!e)return 1;let t=e.state;return!t||t.strm!==e||t.modeqS?1:0},VS=e=>{if(es(e))return rr;let t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=x1,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(OL),t.distcode=t.distdyn=new Int32Array(NL),t.sane=1,t.back=-1,Qi},GS=e=>{if(es(e))return rr;let t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,VS(e)},YS=(e,t)=>{let n;if(es(e))return rr;let r=e.state;return t<0?(n=0,t=-t):(n=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?rr:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,GS(e))},XS=(e,t)=>{if(!e)return rr;let n=new ML;e.state=n,n.strm=e,n.window=null,n.mode=x1;let r=YS(e,t);return r!==Qi&&(e.state=null),r},FL=e=>XS(e,LL),mS=!0,b0,S0,jL=e=>{if(mS){b0=new Int32Array(512),S0=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(eu(US,e.lens,0,288,b0,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;eu($S,e.lens,0,32,S0,0,e.work,{bits:5}),mS=!1}e.lencode=b0,e.lenbits=9,e.distcode=S0,e.distbits=5},ZS=(e,t,n,r)=>{let o,i=e.state;return i.window===null&&(i.wsize=1<=i.wsize?(i.window.set(t.subarray(n-i.wsize,n),0),i.wnext=0,i.whave=i.wsize):(o=i.wsize-i.wnext,o>r&&(o=r),i.window.set(t.subarray(n-r,n-r+o),i.wnext),r-=o,r?(i.window.set(t.subarray(n-r,n),0),i.wnext=r,i.whave=i.wsize):(i.wnext+=o,i.wnext===i.wsize&&(i.wnext=0),i.whave{let n,r,o,i,a,l,u,c,p,y,d,x,w,T,S=0,_,k,v,E,P,W,D,Y,J=new Uint8Array(4),Z,ce,Ue=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(es(e)||!e.output||!e.input&&e.avail_in!==0)return rr;n=e.state,n.mode===fo&&(n.mode=w0),a=e.next_out,o=e.output,u=e.avail_out,i=e.next_in,r=e.input,l=e.avail_in,c=n.hold,p=n.bits,y=l,d=u,Y=Qi;e:for(;;)switch(n.mode){case x1:if(n.wrap===0){n.mode=w0;break}for(;p<16;){if(l===0)break e;l--,c+=r[i++]<>>8&255,n.check=Bt(n.check,J,2,0),c=0,p=0,n.mode=Gb;break}if(n.head&&(n.head.done=!1),!(n.wrap&1)||(((c&255)<<8)+(c>>8))%31){e.msg="incorrect header check",n.mode=ft;break}if((c&15)!==Vb){e.msg="unknown compression method",n.mode=ft;break}if(c>>>=4,p-=4,D=(c&15)+8,n.wbits===0&&(n.wbits=D),D>15||D>n.wbits){e.msg="invalid window size",n.mode=ft;break}n.dmax=1<>8&1),n.flags&512&&n.wrap&4&&(J[0]=c&255,J[1]=c>>>8&255,n.check=Bt(n.check,J,2,0)),c=0,p=0,n.mode=Yb;case Yb:for(;p<32;){if(l===0)break e;l--,c+=r[i++]<>>8&255,J[2]=c>>>16&255,J[3]=c>>>24&255,n.check=Bt(n.check,J,4,0)),c=0,p=0,n.mode=Xb;case Xb:for(;p<16;){if(l===0)break e;l--,c+=r[i++]<>8),n.flags&512&&n.wrap&4&&(J[0]=c&255,J[1]=c>>>8&255,n.check=Bt(n.check,J,2,0)),c=0,p=0,n.mode=Zb;case Zb:if(n.flags&1024){for(;p<16;){if(l===0)break e;l--,c+=r[i++]<>>8&255,n.check=Bt(n.check,J,2,0)),c=0,p=0}else n.head&&(n.head.extra=null);n.mode=Kb;case Kb:if(n.flags&1024&&(x=n.length,x>l&&(x=l),x&&(n.head&&(D=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(i,i+x),D)),n.flags&512&&n.wrap&4&&(n.check=Bt(n.check,r,x,i)),l-=x,i+=x,n.length-=x),n.length))break e;n.length=0,n.mode=Qb;case Qb:if(n.flags&2048){if(l===0)break e;x=0;do D=r[i+x++],n.head&&D&&n.length<65536&&(n.head.name+=String.fromCharCode(D));while(D&&x>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=fo;break;case tS:for(;p<32;){if(l===0)break e;l--,c+=r[i++]<>>=p&7,p-=p&7,n.mode=v0;break}for(;p<3;){if(l===0)break e;l--,c+=r[i++]<>>=1,p-=1,c&3){case 0:n.mode=nS;break;case 1:if(jL(n),n.mode=c1,t===u1){c>>>=2,p-=2;break e}break;case 2:n.mode=oS;break;case 3:e.msg="invalid block type",n.mode=ft}c>>>=2,p-=2;break;case nS:for(c>>>=p&7,p-=p&7;p<32;){if(l===0)break e;l--,c+=r[i++]<>>16^65535)){e.msg="invalid stored block lengths",n.mode=ft;break}if(n.length=c&65535,c=0,p=0,n.mode=k0,t===u1)break e;case k0:n.mode=rS;case rS:if(x=n.length,x){if(x>l&&(x=l),x>u&&(x=u),x===0)break e;o.set(r.subarray(i,i+x),a),l-=x,i+=x,u-=x,a+=x,n.length-=x;break}n.mode=fo;break;case oS:for(;p<14;){if(l===0)break e;l--,c+=r[i++]<>>=5,p-=5,n.ndist=(c&31)+1,c>>>=5,p-=5,n.ncode=(c&15)+4,c>>>=4,p-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=ft;break}n.have=0,n.mode=iS;case iS:for(;n.have>>=3,p-=3}for(;n.have<19;)n.lens[Ue[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,Z={bits:n.lenbits},Y=eu(IL,n.lens,0,19,n.lencode,0,n.work,Z),n.lenbits=Z.bits,Y){e.msg="invalid code lengths set",n.mode=ft;break}n.have=0,n.mode=sS;case sS:for(;n.have>>24,k=S>>>16&255,v=S&65535,!(_<=p);){if(l===0)break e;l--,c+=r[i++]<>>=_,p-=_,n.lens[n.have++]=v;else{if(v===16){for(ce=_+2;p>>=_,p-=_,n.have===0){e.msg="invalid bit length repeat",n.mode=ft;break}D=n.lens[n.have-1],x=3+(c&3),c>>>=2,p-=2}else if(v===17){for(ce=_+3;p>>=_,p-=_,D=0,x=3+(c&7),c>>>=3,p-=3}else{for(ce=_+7;p>>=_,p-=_,D=0,x=11+(c&127),c>>>=7,p-=7}if(n.have+x>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=ft;break}for(;x--;)n.lens[n.have++]=D}}if(n.mode===ft)break;if(n.lens[256]===0){e.msg="invalid code -- missing end-of-block",n.mode=ft;break}if(n.lenbits=9,Z={bits:n.lenbits},Y=eu(US,n.lens,0,n.nlen,n.lencode,0,n.work,Z),n.lenbits=Z.bits,Y){e.msg="invalid literal/lengths set",n.mode=ft;break}if(n.distbits=6,n.distcode=n.distdyn,Z={bits:n.distbits},Y=eu($S,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,Z),n.distbits=Z.bits,Y){e.msg="invalid distances set",n.mode=ft;break}if(n.mode=c1,t===u1)break e;case c1:n.mode=f1;case f1:if(l>=6&&u>=258){e.next_out=a,e.avail_out=u,e.next_in=i,e.avail_in=l,n.hold=c,n.bits=p,kL(e,d),a=e.next_out,o=e.output,u=e.avail_out,i=e.next_in,r=e.input,l=e.avail_in,c=n.hold,p=n.bits,n.mode===fo&&(n.back=-1);break}for(n.back=0;S=n.lencode[c&(1<>>24,k=S>>>16&255,v=S&65535,!(_<=p);){if(l===0)break e;l--,c+=r[i++]<>E)],_=S>>>24,k=S>>>16&255,v=S&65535,!(E+_<=p);){if(l===0)break e;l--,c+=r[i++]<>>=E,p-=E,n.back+=E}if(c>>>=_,p-=_,n.back+=_,n.length=v,k===0){n.mode=fS;break}if(k&32){n.back=-1,n.mode=fo;break}if(k&64){e.msg="invalid literal/length code",n.mode=ft;break}n.extra=k&15,n.mode=aS;case aS:if(n.extra){for(ce=n.extra;p>>=n.extra,p-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=lS;case lS:for(;S=n.distcode[c&(1<>>24,k=S>>>16&255,v=S&65535,!(_<=p);){if(l===0)break e;l--,c+=r[i++]<>E)],_=S>>>24,k=S>>>16&255,v=S&65535,!(E+_<=p);){if(l===0)break e;l--,c+=r[i++]<>>=E,p-=E,n.back+=E}if(c>>>=_,p-=_,n.back+=_,k&64){e.msg="invalid distance code",n.mode=ft;break}n.offset=v,n.extra=k&15,n.mode=uS;case uS:if(n.extra){for(ce=n.extra;p>>=n.extra,p-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=ft;break}n.mode=cS;case cS:if(u===0)break e;if(x=d-u,n.offset>x){if(x=n.offset-x,x>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=ft;break}x>n.wnext?(x-=n.wnext,w=n.wsize-x):w=n.wnext-x,x>n.length&&(x=n.length),T=n.window}else T=o,w=a-n.offset,x=n.length;x>u&&(x=u),u-=x,n.length-=x;do o[a++]=T[w++];while(--x);n.length===0&&(n.mode=f1);break;case fS:if(u===0)break e;o[a++]=n.length,u--,n.mode=f1;break;case v0:if(n.wrap){for(;p<32;){if(l===0)break e;l--,c|=r[i++]<{if(es(e))return rr;let t=e.state;return t.window&&(t.window=null),e.state=null,Qi},$L=(e,t)=>{if(es(e))return rr;let n=e.state;return n.wrap&2?(n.head=t,t.done=!1,Qi):rr},zL=(e,t)=>{let n=t.length,r,o,i;return es(e)||(r=e.state,r.wrap!==0&&r.mode!==m1)?rr:r.mode===m1&&(o=1,o=iu(o,t,n,0),o!==r.check)?zS:(i=ZS(e,t,n,n),i?(r.mode=WS,HS):(r.havedict=1,Qi))},HL=GS,WL=YS,qL=VS,VL=FL,GL=XS,YL=BL,XL=UL,ZL=$L,KL=zL,QL="pako inflate (from Nodeca project)",ho={inflateReset:HL,inflateReset2:WL,inflateResetKeep:qL,inflateInit:VL,inflateInit2:GL,inflate:YL,inflateEnd:XL,inflateGetHeader:ZL,inflateSetDictionary:KL,inflateInfo:QL};function JL(){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 e4=JL,KS=Object.prototype.toString,{Z_NO_FLUSH:t4,Z_FINISH:n4,Z_OK:lu,Z_STREAM_END:E0,Z_NEED_DICT:T0,Z_STREAM_ERROR:r4,Z_DATA_ERROR:gS,Z_MEM_ERROR:o4}=Ji;function pu(e){this.options=y1.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});let t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new jS,this.strm.avail_out=0;let n=ho.inflateInit2(this.strm,t.windowBits);if(n!==lu)throw new Error(Zi[n]);if(this.header=new e4,ho.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=au.string2buf(t.dictionary):KS.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=ho.inflateSetDictionary(this.strm,t.dictionary),n!==lu)))throw new Error(Zi[n])}pu.prototype.push=function(e,t){let n=this.strm,r=this.options.chunkSize,o=this.options.dictionary,i,a,l;if(this.ended)return!1;for(t===~~t?a=t:a=t===!0?n4:t4,KS.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){for(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),i=ho.inflate(n,a),i===T0&&o&&(i=ho.inflateSetDictionary(n,o),i===lu?i=ho.inflate(n,a):i===gS&&(i=T0));n.avail_in>0&&i===E0&&n.state.wrap>0&&e[n.next_in]!==0;)ho.inflateReset(n),i=ho.inflate(n,a);switch(i){case r4:case gS:case T0:case o4:return this.onEnd(i),this.ended=!0,!1}if(l=n.avail_out,n.next_out&&(n.avail_out===0||i===E0))if(this.options.to==="string"){let u=au.utf8border(n.output,n.next_out),c=n.next_out-u,p=au.buf2string(n.output,u);n.next_out=c,n.avail_out=r-c,c&&n.output.set(n.output.subarray(u,u+c),0),this.onData(p)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(!(i===lu&&l===0)){if(i===E0)return i=ho.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,!0;if(n.avail_in===0)break}}return!0};pu.prototype.onData=function(e){this.chunks.push(e)};pu.prototype.onEnd=function(e){e===lu&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=y1.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function z0(e,t){let n=new pu(t);if(n.push(e),n.err)throw n.msg||Zi[n.err];return n.result}function i4(e,t){return t=t||{},t.raw=!0,z0(e,t)}var s4=pu,a4=z0,l4=i4,u4=z0,c4=Ji,f4={Inflate:s4,inflate:a4,inflateRaw:l4,ungzip:u4,constants:c4},{Deflate:p4,deflate:d4,deflateRaw:h4,gzip:m4}=_L,{Inflate:g4,inflate:y4,inflateRaw:x4,ungzip:_4}=f4,w4=p4,k4=d4,v4=h4,b4=m4,S4=g4,E4=y4,T4=x4,I4=_4,C4=Ji,QS={Deflate:w4,deflate:k4,deflateRaw:v4,gzip:b4,Inflate:S4,inflate:E4,inflateRaw:T4,ungzip:I4,constants:C4};var mo={tables:{},columns:{},rels:{}},eE=e=>{let t="";return new Proxy({},{get(n,r){return r==="_batch"?{update:async o=>ts({name:t,action:"batch_update",table:"",params:{batch:o}},e),upsert:async o=>ts({name:t,action:"batch_upsert",table:"",params:{arg:o}},e)}:r==="_schema"?{tables:async()=>(mo.tables[e]||(mo.tables[e]=ts({name:t,action:"schema_tables",table:"",params:[]},e)),await mo.tables[e]),columns:async o=>(mo.columns[e+"_"+o]||(mo.columns[e+"_"+o]=ts({name:t,action:"schema_columns",table:o,params:[]},e)),await mo.columns[e+"_"+o]),rels:async o=>(mo.rels[e+"_"+o]||(mo.rels[e+"_"+o]=ts({name:t,action:"schema_rels",table:o,params:[]},e)),await mo.rels[e+"_"+o])}:r.startsWith("$")?(...o)=>{let i=QS.gzip(JSON.stringify(o));return ts({name:t,action:"query",table:r,params:btoa(i.reduce((a,l)=>a+String.fromCharCode(l),""))},e)}:new Proxy({},{get(o,i){return async(...a)=>(r==="query"&&(r=i,i="query"),await ts({name:t,action:i,table:r,params:a},e))}})}})},ga={},ts=async(e,t)=>{let n=new URL(t);n.pathname="/_dbs",e.table&&(n.pathname+=`/${e.table}`);let r=n.toString();typeof localStorage<"u"&&localStorage.mlsid&&(e.mlsid=localStorage.mlsid);let o=(0,JS.default)(e),i=ga[o];if(!i||i&&Date.now()-i.timestamp>1e3){ga[o]={timestamp:Date.now(),promise:s1(r,e,{"content-type":"application/json"},!1),result:null};let l=await ga[o].promise;i=ga[o];try{return typeof l=="string"?(l=JSON.parse(l),ga[o].result=l,l):(ga[o].result=l,l)}catch{if(l)throw new Error(`DBQuery failed: -`+l);return null}}if(i.result)return i.result;let a=await i.promise;if(a)try{return typeof a=="string"&&(a=JSON.parse(a)),a}catch{console.error("DBQuery failed:",a)}return null};h();g();m();h();g();m();h();g();m();var YE=ye(b1());var XE=e=>{let{item:t,item_comp:n,ids:r}=e,o=Ks(n);if(ZE(o,r),t.id&&(o.id=t.id),o.hidden=t.hidden,o.component){if(o.component.props&&t.component&&t.component.props)for(let i of Object.keys(o.component.props)){let a=t.component.props[i],l=o.component.props[i];a&&(l.value=a.value,l.valueBuilt=a.valueBuilt,l.jsxCalledBy=a.jsxCalledBy,l.content=a.content)}o.component.instances=t.component?.instances,o.component.style=t.component?.style}for(let i of Object.keys(t))delete t[i];for(let[i,a]of Object.entries(o))t[i]=a},ZE=(e,t)=>{if(e.originalId=e.id,t[e.id]||(t[e.id]=(0,YE.createId)()),e.id=t[e.id],e.childs)for(let n of e.childs)ZE(n,t)};h();g();m();var KE=e=>{let t=Object.entries(e.item_comp.component?.props||{}).sort((n,r)=>n[1].idx-r[1].idx);for(let[n,r]of t){let o=Ks(r),i=e.item.component?.props;i&&i[n]&&(o.value=i[n].value,o.valueBuilt=i[n].valueBuilt,i[n].content&&(o.content=i[n].content)),o&&e.each(n,o)}};h();g();m();var S1=e=>{let t={};for(let[n,r]of Object.entries(e))if(n==="childs"){if(t.childs=[],r&&Array.isArray(r))for(let o of r)o.type==="item"&&o.component?t.childs.push(o):t.childs.push({name:o.name,id:o.id,originalId:o.originalId})}else t[n]=r;return t};var QE=(e,t)=>{let{item:n}=t;if(n.type==="item"&&n.component?.id&&t.parent?.item.id){let r=e.comps[n.component.id];if(e.on?.visit_component&&e.on.visit_component(n,t.root||t.item),!r)return;if(r){let o;if(e.mode==="page"?(n.component.instances||(n.component.instances={}),o=n.component.instances):o=t.parent?.root_instances,o){let a=o[n.id];o[n.id]||(o[n.id]={},a=o[n.id]),XE({item:n,item_comp:r,ids:a})}let i={item:S1(n),jsx_prop:t.jsx_prop,parent:{id:t.parent.item.id,comp_id:t.parent?.comp?.component?.id,instance_id:t.parent?.instance_id},instances:o};if(e.on?.visit&&e.on.visit(i,n,t.root||t.item),n.id&&e.set_meta!==!1&&(e.meta[n.id]=i),KE({item:n,item_comp:r,instance:o?o[n.id]:{},each(a,l){let u=n.component?.id;l.meta?.type==="content-element"&&u&&l.content&&(l.content.name=a,xa({...e},{item:l.content,root:t.root||l.content,is_root:!1,jsx_prop:{is_root:!0,comp_id:u,name:a},parent:{item:i.item,instance_id:n.id,comp:r,root_instances:o}}))}}),n.childs)for(let a of Object.values(n.childs))a?.name?.startsWith("jsx:")||a&&Object.keys(a).length>3&&xa({...e,mode:"comp"},{item:a,is_root:!1,root:t.root||t.item,parent:{item:n,instance_id:n.id,root_instances:o,comp:r}})}}};var xa=(e,t)=>{let n=t.item;if(n.type==="item"&&n.component?.id&&t.ignore_first_component!==!0){QE(e,t);return}let r={item:S1(n),parent:{id:t.parent?.item.id||"root",instance_id:t.parent?.instance_id,comp_id:t.parent?.comp?.component?.id}};if(t.jsx_prop&&(r.jsx_prop=t.jsx_prop),e.on?.visit&&e.on.visit(r,n,t.root||t.item),n.id&&e.set_meta!==!1&&(e.meta[r.item.id]=r),n.childs){for(let[o,i]of Object.entries(n.childs))if(i.id){let a={item:i,is_root:!1,root:t.root||t.item,parent:{item:r.item,instance_id:t.parent?.instance_id,comp:t.parent?.comp,root_instances:t.parent?.root_instances}};t.jsx_prop&&(a.jsx_prop={...t.jsx_prop,is_root:!1}),xa(e,a)}}};var ns={route:null,promise:null},dM=()=>{if(ns.promise)return ns.promise;ns.promise=new Promise(async e=>{ns.route&&e(ns.route);let t=!1,n=await fetch(re.url`_prasi/route`);t||(n.headers.get("content-encoding")||fetch(re.url`_prasi/compress/only-gz`),ns.route=await n.json(),e(ns.route))})},JE=async()=>{let e=zf(),t=[];try{let n=await dM();if(n&&n.site&&n.urls){n.layout&&(re.layout.id=n.layout.id,re.layout.root=n.layout.root,re.layout.meta={},re.layout.root&&(await uo(re.layout.root.childs),rs(re.layout.meta,re.layout.root))),re.site=n.site,re.site.code={mode:"vsc"},await hM(),re.site.api=Ab(re.site.api_url),re.site.db=eE(re.site.api_url);let r=window;r.serverurl=re.site.api_url,r.db=re.site.db,r.api=re.site.api;for(let o of n.urls)e.insert(o.url,o),t.push(o)}}catch{}return{router:e,pages:t}},hM=()=>new Promise(e=>{let t=document,n=t.createElement("script");n.onload=async()=>{e()};let r=re.site.api_url;r==="*"&&(r=`${location.protocol}//${location.host}`,re.site.api_url=r),localStorage.getItem("api-ts-"+r)||localStorage.setItem("api-ts-"+r,Date.now().toString());let o=localStorage.getItem("api-ts-"+r),i=new URL(location.href);if(i.pathname="",!["prasi.avolut.com"].includes(i.hostname)&&i.host!=="localhost:4550"){let a=i.toString();n.src=`${a.endsWith("/")?a:`${a}/`}_prasi/load.js?url=${a}&v3&ts=${o}`,re.site.api_url=`${i.protocol}//${i.host}`}else n.src=`${r}/_prasi/load.js?url=${r}&v3&ts=${o}`;n.onerror=()=>{e()},document.querySelector(`script[src="${n.src}"]`)?e():t.body.appendChild(n)}),rs=(e,t)=>{for(let n of t.childs)xa({set_meta:!0,comps:re.comp.list,meta:e,mode:"page"},{item:n})};var eT=new Vi({structuredClone:!0}),di={debug:!!localStorage.getItem("prasi-ws-debug"),reconnectTimeout:1e3,id_client:"",id_site:"",ws:null},tT=()=>{if(location.host==="localhost:4550"||location.host==="prasi.avolut.com"){let t=location.pathname.split("/")[2],n=()=>{let r=new URL(fn.basehost||location.href);r.pathname="/sync",r.protocol=r.protocol==="http:"?"ws:":"wss:";let o=new WebSocket(`${r.protocol}//${r.host}${r.pathname}`),i=setTimeout(()=>{clearTimeout(i),o.close(),n()},2e3);di.ws=o,di.id_site=t,o.onopen=()=>{clearTimeout(i),fn.offline=!1,fn.editorRender?.()},o.onmessage=async a=>{let l=a.data,u=eT.unpack(C.from(await l.arrayBuffer()));if(di.debug&&console.log("%c\u2B07","color:red",rT(l.size,0),u),u.type===0)di.id_client=u.client_id,nT(o,{type:"preview",mode:"init",data:{site_id:t,client_id:u.client_id}});else if(u.type===2){if(fn.pointer_active)return;if(console.clear(),u.event==="page_changed"){let c=u.data.map.id,p=re.page.cache[c],y=u.data.map.root;p.root=y;let d={id:p.id,url:p.url,root:y,meta:{}};await uo(y.childs,!0),rs(d.meta,y),re.page.cache[d.id]=d,console.log(`${Hi(Date.now(),"HH:mm:ss")} \u{1F6A7} Page [${p.id}] updated `),fn.prasiContext.render()}else if(u.event==="comp_changed"){let c=u.data.map.id;re.comp.list[c]=u.data.map.root;let p=re.page.cache[re.page.id];await uo([re.comp.list[c]]),rs(p.meta,p.root),console.log(`${Hi(Date.now(),"HH:mm:ss")} \u{1F6A7} Component [${u.data.map.root.name}] updated `),fn.prasiContext.render()}else if(u.event==="code_changes"){let{mode:c,ts:p,status:y}=u.data;if(c==="frontend")if(y==="ok"){console.clear(),console.log(`${Hi(Date.now(),"HH:mm:ss")} \u{1F6A7} Code updated from vscode `);let d=`/prod/${t}/_prasi/code/index.js?ts=${p}`,x=new Function("callback",` +`+l);return null}}if(i.result)return i.result;let a=await i.promise;if(a)try{return typeof a=="string"&&(a=JSON.parse(a)),a}catch{console.error("DBQuery failed:",a)}return null};h();g();m();h();g();m();h();g();m();var YE=ye(b1());var XE=e=>{let{item:t,item_comp:n,ids:r}=e,o=Ks(n);if(ZE(o,r),t.id&&(o.id=t.id),o.hidden=t.hidden,o.component){if(o.component.props&&t.component&&t.component.props)for(let i of Object.keys(o.component.props)){let a=t.component.props[i],l=o.component.props[i];a&&(l.value=a.value,l.valueBuilt=a.valueBuilt,l.jsxCalledBy=a.jsxCalledBy,l.content=a.content)}o.component.instances=t.component?.instances,o.component.style=t.component?.style}for(let i of Object.keys(t))delete t[i];for(let[i,a]of Object.entries(o))t[i]=a},ZE=(e,t)=>{if(e.originalId=e.id,t[e.id]||(t[e.id]=(0,YE.createId)()),e.id=t[e.id],e.childs)for(let n of e.childs)ZE(n,t)};h();g();m();var KE=e=>{let t=Object.entries(e.item_comp.component?.props||{}).sort((n,r)=>n[1].idx-r[1].idx);for(let[n,r]of t){let o=Ks(r),i=e.item.component?.props;i&&i[n]&&(o.value=i[n].value,o.valueBuilt=i[n].valueBuilt,i[n].content&&(o.content=i[n].content)),o&&e.each(n,o)}};h();g();m();var S1=e=>{let t={};for(let[n,r]of Object.entries(e))if(n==="childs"){if(t.childs=[],r&&Array.isArray(r))for(let o of r)o.type==="item"&&o.component?t.childs.push(o):t.childs.push({name:o.name,id:o.id,originalId:o.originalId})}else t[n]=r;return t};var QE=(e,t)=>{let{item:n}=t;if(n.type==="item"&&n.component?.id&&t.parent?.item.id){let r=e.comps[n.component.id];if(e.on?.visit_component&&e.on.visit_component(n,t.root||t.item),!r)return;if(r){let o;if(e.mode==="page"?(n.component.instances||(n.component.instances={}),o=n.component.instances):o=t.parent?.root_instances,o){let a=o[n.id];o[n.id]||(o[n.id]={},a=o[n.id]),XE({item:n,item_comp:r,ids:a})}let i={item:S1(n),jsx_prop:t.jsx_prop,parent:{id:t.parent.item.id,comp_id:t.parent?.comp?.component?.id,instance_id:t.parent?.instance_id},instances:o};if(e.on?.visit&&e.on.visit(i,n,t.root||t.item),n.id&&e.set_meta!==!1&&(e.meta[n.id]=i),KE({item:n,item_comp:r,instance:o?o[n.id]:{},each(a,l){let u=n.component?.id;l.meta?.type==="content-element"&&u&&l.content&&(l.content.name=a,xa({...e},{item:l.content,root:t.root||l.content,is_root:!1,jsx_prop:{is_root:!0,comp_id:u,name:a},parent:{item:i.item,instance_id:n.id,comp:r,root_instances:o}}))}}),n.childs)for(let a of Object.values(n.childs))a?.name?.startsWith("jsx:")||a&&Object.keys(a).length>3&&xa({...e,mode:"comp"},{item:a,is_root:!1,root:t.root||t.item,parent:{item:n,instance_id:n.id,root_instances:o,comp:r}})}}};var xa=(e,t)=>{let n=t.item;if(n.type==="item"&&n.component?.id&&t.ignore_first_component!==!0){QE(e,t);return}let r={item:S1(n),parent:{id:t.parent?.item.id||"root",instance_id:t.parent?.instance_id,comp_id:t.parent?.comp?.component?.id}};if(t.jsx_prop&&(r.jsx_prop=t.jsx_prop),e.on?.visit&&e.on.visit(r,n,t.root||t.item),n.id&&e.set_meta!==!1&&(e.meta[r.item.id]=r),n.childs){for(let[o,i]of Object.entries(n.childs))if(i.id){let a={item:i,is_root:!1,root:t.root||t.item,parent:{item:r.item,instance_id:t.parent?.instance_id,comp:t.parent?.comp,root_instances:t.parent?.root_instances}};t.jsx_prop&&(a.jsx_prop={...t.jsx_prop,is_root:!1}),xa(e,a)}}};var ns={route:null,promise:null},dM=()=>{if(ns.promise)return ns.promise;ns.promise=new Promise(async e=>{ns.route&&e(ns.route);let t=await fetch(re.url`_prasi/route`);t.headers.get("content-encoding")||fetch(re.url`_prasi/compress/only-gz`),ns.route=await t.json(),e(ns.route)})},JE=async()=>{let e=zf(),t=[];try{let n=await dM();if(n&&n.site&&n.urls){n.layout&&(re.layout.id=n.layout.id,re.layout.root=n.layout.root,re.layout.meta={},re.layout.root&&(await uo(re.layout.root.childs),rs(re.layout.meta,re.layout.root))),re.site=n.site,re.site.code={mode:"vsc"},await hM(),re.site.api=Ab(re.site.api_url),re.site.db=eE(re.site.api_url);let r=window;r.serverurl=re.site.api_url,r.db=re.site.db,r.api=re.site.api;for(let o of n.urls)e.insert(o.url,o),t.push(o)}}catch{}return{router:e,pages:t}},hM=()=>new Promise(e=>{let t=document,n=t.createElement("script");n.onload=async()=>{e()};let r=re.site.api_url;r==="*"&&(r=`${location.protocol}//${location.host}`,re.site.api_url=r),localStorage.getItem("api-ts-"+r)||localStorage.setItem("api-ts-"+r,Date.now().toString());let o=localStorage.getItem("api-ts-"+r),i=new URL(location.href);if(i.pathname="",!r||!["prasi.avolut.com"].includes(i.hostname)&&i.host!=="localhost:4550"){let a=i.toString();n.src=`${a.endsWith("/")?a:`${a}/`}_prasi/load.js?url=${a}&v3&ts=${o}`,re.site.api_url=`${i.protocol}//${i.host}`}else n.src=`${r}/_prasi/load.js?url=${r}&v3&ts=${o}`;n.onerror=()=>{e()},document.querySelector(`script[src="${n.src}"]`)?e():t.body.appendChild(n)}),rs=(e,t)=>{for(let n of t.childs)xa({set_meta:!0,comps:re.comp.list,meta:e,mode:"page"},{item:n})};var eT=new Vi({structuredClone:!0}),di={debug:!!localStorage.getItem("prasi-ws-debug"),reconnectTimeout:1e3,id_client:"",id_site:"",ws:null},tT=()=>{if(location.host==="localhost:4550"||location.host==="prasi.avolut.com"){let t=location.pathname.split("/")[2],n=()=>{let r=new URL(fn.basehost||location.href);r.pathname="/sync",r.protocol=r.protocol==="http:"?"ws:":"wss:";let o=new WebSocket(`${r.protocol}//${r.host}${r.pathname}`),i=setTimeout(()=>{clearTimeout(i),o.close(),n()},2e3);di.ws=o,di.id_site=t,o.onopen=()=>{clearTimeout(i),fn.offline=!1,fn.editorRender?.()},o.onmessage=async a=>{let l=a.data,u=eT.unpack(C.from(await l.arrayBuffer()));if(di.debug&&console.log("%c\u2B07","color:red",rT(l.size,0),u),u.type===0)di.id_client=u.client_id,nT(o,{type:"preview",mode:"init",data:{site_id:t,client_id:u.client_id}});else if(u.type===2){if(fn.pointer_active)return;if(console.clear(),u.event==="page_changed"){let c=u.data.map.id,p=re.page.cache[c],y=u.data.map.root;p.root=y;let d={id:p.id,url:p.url,root:y,meta:{}};await uo(y.childs,!0),rs(d.meta,y),re.page.cache[d.id]=d,console.log(`${Hi(Date.now(),"HH:mm:ss")} \u{1F6A7} Page [${p.id}] updated `),fn.prasiContext.render()}else if(u.event==="comp_changed"){let c=u.data.map.id;re.comp.list[c]=u.data.map.root;let p=re.page.cache[re.page.id];await uo([re.comp.list[c]]),rs(p.meta,p.root),console.log(`${Hi(Date.now(),"HH:mm:ss")} \u{1F6A7} Component [${u.data.map.root.name}] updated `),fn.prasiContext.render()}else if(u.event==="code_changes"){let{mode:c,ts:p,status:y}=u.data;if(c==="frontend")if(y==="ok"){console.clear(),console.log(`${Hi(Date.now(),"HH:mm:ss")} \u{1F6A7} Code updated from vscode `);let d=`/prod/${t}/_prasi/code/index.js?ts=${p}`,x=new Function("callback",` import("${d}") .catch((e) => console.error("Failed to load site code\\n\\n", e)) .then(callback)`);try{await new Promise(w=>{try{x(T=>{let S=window;for(let[_,k]of Object.entries(T))S[_]=k;w(T),S.prasiContext.render()})}catch(T){console.log("Failed to load site code",T)}})}catch{}}else y==="building"&&console.log(`${Hi(Date.now(),"HH:mm:ss")} \u23F3 Code changed from vscode, rebuilding...`)}}}};n()}},$f=e=>{di.ws&&nT(di.ws,{type:"preview",mode:"listen",data:{...e,client_id:di.id_client}})},nT=(e,t)=>{let n=eT.pack(t);di.debug&&console.log("%c\u2B06","color:blue",rT(n.length,0),t),e.send(n)};function rT(e,t){if(e==0)return"0 Bytes";var n=1024,r=t||2,o=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],i=Math.floor(Math.log(e)/Math.log(n));return parseFloat((e/Math.pow(n,i)).toFixed(r))+" "+o[i]}h();g();m();var EC=ye($t());h();g();m();h();g();m();h();g();m();var oT=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function mM(e){return typeof e=="string"&&oT.test(e)}var K0=mM;h();g();m();var xu=ye(Ze()),Q0=({children:e,back:t})=>(0,xu.jsxs)("div",{className:"flex items-center justify-center w-full h-full fixed inset-0 flex-col",children:[(0,xu.jsx)("div",{children:e}),(0,xu.jsxs)("div",{className:"border mt-2 rounded-md p-2 cursor-pointer",onClick:t||(()=>{history.back()}),children:[" ","Go Back"]})]});h();g();m();var sT=ye($t());var nn=ye(Ze()),iT=window,_u=({children:e,className:t,show:n,backdrop:r,note:o,alt:i,pointer:a})=>{let l=Ko({icon:(0,nn.jsx)("div",{className:"px-4 py-1",children:"Loading..."}),value:.111,ival:null},()=>{});return(0,sT.useEffect)(()=>(l.ival=setInterval(()=>{l.value+=.1333,l.value>=1.3&&(l.value=0),l.render()},200),iT.loadingIcon&&(l.icon=(0,nn.jsx)("img",{alt:"loading",src:iT.loadingIcon,className:css` diff --git a/app/web/src/nova/prod/base/route.tsx b/app/web/src/nova/prod/base/route.tsx index e0d0de96..b952374d 100644 --- a/app/web/src/nova/prod/base/route.tsx +++ b/app/web/src/nova/prod/base/route.tsx @@ -21,15 +21,12 @@ const getRoute = () => { }>(async (done) => { if (cached.route) done(cached.route); - let is_done = false; const res = await fetch(base.url`_prasi/route`); - if (!is_done) { - if (!res.headers.get("content-encoding")) { - fetch(base.url`_prasi/compress/only-gz`); - } - cached.route = await res.json(); - done(cached.route); + if (!res.headers.get("content-encoding")) { + fetch(base.url`_prasi/compress/only-gz`); } + cached.route = await res.json(); + done(cached.route); }); }; @@ -94,8 +91,9 @@ const injectSiteScript = () => { const cur = new URL(location.href); cur.pathname = ""; if ( - !["prasi.avolut.com"].includes(cur.hostname) && - cur.host !== "localhost:4550" + !base_url || + (!["prasi.avolut.com"].includes(cur.hostname) && + cur.host !== "localhost:4550") ) { const cur_url = cur.toString(); script.src = `${