khulnasoft.com
Version:
Development tools for Khulnasoft CMS integration
30 lines (29 loc) • 32.7 kB
JavaScript
"use strict";var Nt=Object.create;var Y=Object.defineProperty;var jt=Object.getOwnPropertyDescriptor;var xt=Object.getOwnPropertyNames;var kt=Object.getPrototypeOf,It=Object.prototype.hasOwnProperty;var Dt=(n,e,t)=>e in n?Y(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var j=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),Rt=(n,e)=>{for(var t in e)Y(n,t,{get:e[t],enumerable:!0})},ze=(n,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of xt(e))!It.call(n,i)&&i!==t&&Y(n,i,{get:()=>e[i],enumerable:!(s=jt(e,i))||s.enumerable});return n};var Lt=(n,e,t)=>(t=n!=null?Nt(kt(n)):{},ze(e||!n||!n.__esModule?Y(t,"default",{value:n,enumerable:!0}):t,n)),Ht=n=>ze(Y({},"__esModule",{value:!0}),n);var Ee=(n,e,t)=>Dt(n,typeof e!="symbol"?e+"":e,t);var G=j((Us,qe)=>{"use strict";var pe=class{source(){throw new Error("Abstract")}buffer(){let e=this.source();return Buffer.isBuffer(e)?e:Buffer.from(e,"utf-8")}size(){return this.buffer().length}map(e){return null}sourceAndMap(e){return{source:this.source(),map:this.map(e)}}updateHash(e){throw new Error("Abstract")}};qe.exports=pe});var ie=j((Fs,Ne)=>{"use strict";var Pt=n=>{if(n===void 0)return{};let e=n.lastIndexOf(`
`);if(e===-1)return{generatedLine:1,generatedColumn:n.length,source:n};let t=2;for(let s=0;s<e;s++)n.charCodeAt(s)===10&&t++;return{generatedLine:t,generatedColumn:n.length-e-1,source:n}};Ne.exports=Pt});var X=j((Js,je)=>{var Wt=n=>{let e=[],t=n.length,s=0;for(;s<t;)if(n.charCodeAt(s)===10)e.push(`
`),s++;else{let r=s+1;for(;r<t&&n.charCodeAt(r)!==10;)r++;e.push(n.slice(s,r+1)),s=r+1}return e};je.exports=Wt});var ue=j((Xs,xe)=>{"use strict";var Gt=ie(),Vt=X(),Ut=(n,e,t,s)=>{let i=1,r=Vt(n),f;for(f of r)e(f,i,0,-1,-1,-1,-1),i++;return r.length===0||f.endsWith(`
`)?{generatedLine:r.length+1,generatedColumn:0}:{generatedLine:r.length,generatedColumn:f.length}};xe.exports=(n,e,t,s,i)=>i?Gt(n):Ut(n,e,t,s)});var fe=j(($s,ke)=>{"use strict";var Ft=ue(),Jt=G(),_e=class extends Jt{constructor(e,t=!1){super();let s=Buffer.isBuffer(e);if(!s&&typeof e!="string")throw new TypeError("argument 'value' must be either string of Buffer");this._valueIsBuffer=!t&&s,this._value=t&&s?void 0:e,this._valueAsBuffer=s?e:void 0,this._valueAsString=s?void 0:e}isBuffer(){return this._valueIsBuffer}source(){return this._value===void 0&&(this._value=this._valueAsBuffer.toString("utf-8")),this._value}buffer(){return this._valueAsBuffer===void 0&&(this._valueAsBuffer=Buffer.from(this._value,"utf-8")),this._valueAsBuffer}map(e){return null}streamChunks(e,t,s,i){return this._value===void 0&&(this._value=Buffer.from(this._valueAsBuffer,"utf-8")),this._valueAsString===void 0&&(this._valueAsString=typeof this._value=="string"?this._value:this._value.toString("utf-8")),Ft(this._valueAsString,t,s,i,!!(e&&e.finalSource))}updateHash(e){this._valueAsBuffer===void 0&&(this._valueAsBuffer=Buffer.from(this._value,"utf-8")),e.update("RawSource"),e.update(this._valueAsBuffer)}};ke.exports=_e});var ge=j((Ks,De)=>{"use strict";var ce="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),Ie=32,Xt=n=>n&&n.columns===!1?Kt():$t(),$t=()=>{let n=1,e=0,t=0,s=1,i=0,r=0,f=!1,u=!1,h=!0;return(o,a,l,d,m,c)=>{if(f&&n===o){if(l===t&&d===s&&m===i&&!u&&c<0)return""}else if(l<0)return"";let _;n<o?(_=";".repeat(o-n),n=o,e=0,h=!1):h?(_="",h=!1):_=",";let g=A=>{let O=A>>>31&1,y=A>>31,E=(A+y^y)<<1|O;for(;;){let p=E&31;if(E>>=5,E===0){_+=ce[p];break}else _+=ce[p|Ie]}};return g(a-e),e=a,l>=0?(f=!0,l===t?_+="A":(g(l-t),t=l),g(d-s),s=d,m===i?_+="A":(g(m-i),i=m),c>=0?(g(c-r),r=c,u=!0):u=!1):f=!1,_}},Kt=()=>{let n=0,e=1,t=0,s=1;return(i,r,f,u,h,o)=>{if(f<0||n===i)return"";let a,l=d=>{let m=d>>>31&1,c=d>>31,g=(d+c^c)<<1|m;for(;;){let A=g&31;if(g>>=5,g===0){a+=ce[A];break}else a+=ce[A|Ie]}};return n=i,i===e+1?(e=i,f===t?(t=f,u===s+1?(s=u,";AACA"):(a=";AA",l(u-s),s=u,a+"A")):(a=";A",l(f-t),t=f,l(u-s),s=u,a+"A")):(a=";".repeat(i-e),e=i,f===t?(t=f,u===s+1?(s=u,a+"AACA"):(a+="AA",l(u-s),s=u,a+"A")):(a+="A",l(f-t),t=f,l(u-s),s=u,a+"A"))}};De.exports=Xt});var $=j(Se=>{"use strict";var Re=ge();Se.getSourceAndMap=(n,e)=>{let t="",s="",i=[],r=[],f=[],u=Re(e),{source:h}=n.streamChunks(Object.assign({},e,{finalSource:!0}),(o,a,l,d,m,c,_)=>{o!==void 0&&(t+=o),s+=u(a,l,d,m,c,_)},(o,a,l)=>{for(;i.length<o;)i.push(null);if(i[o]=a,l!==void 0){for(;r.length<o;)r.push(null);r[o]=l}},(o,a)=>{for(;f.length<o;)f.push(null);f[o]=a});return{source:h!==void 0?h:t,map:s.length>0?{version:3,file:"x",mappings:s,sources:i,sourcesContent:r.length>0?r:void 0,names:f}:null}};Se.getMap=(n,e)=>{let t="",s=[],i=[],r=[],f=Re(e);return n.streamChunks(Object.assign({},e,{source:!1,finalSource:!0}),(u,h,o,a,l,d,m)=>{t+=f(h,o,a,l,d,m)},(u,h,o)=>{for(;s.length<u;)s.push(null);if(s[u]=h,o!==void 0){for(;i.length<u;)i.push(null);i[u]=o}},(u,h)=>{for(;r.length<u;)r.push(null);r[u]=h}),t.length>0?{version:3,file:"x",mappings:t,sources:s,sourcesContent:i.length>0?i:void 0,names:r}:null}});var He=j((Ys,Le)=>{var Qt=n=>{let e=n.length;if(e===0)return null;let t=[],s=0;for(;s<e;){let i=s;e:{let r=n.charCodeAt(s);for(;r!==10&&r!==59&&r!==123&&r!==125;){if(++s>=e)break e;r=n.charCodeAt(s)}for(;r===59||r===32||r===123||r===125||r===13||r===9;){if(++s>=e)break e;r=n.charCodeAt(s)}r===10&&s++}t.push(n.slice(i,s))}return t};Le.exports=Qt});var We=j((Zs,Pe)=>{"use strict";var{getMap:Yt,getSourceAndMap:Zt}=$(),es=X(),ts=ie(),ss=G(),rs=He(),me=class extends ss{constructor(e,t){super();let s=Buffer.isBuffer(e);this._value=s?void 0:e,this._valueAsBuffer=s?e:void 0,this._name=t}getName(){return this._name}source(){return this._value===void 0&&(this._value=this._valueAsBuffer.toString("utf-8")),this._value}buffer(){return this._valueAsBuffer===void 0&&(this._valueAsBuffer=Buffer.from(this._value,"utf-8")),this._valueAsBuffer}map(e){return Yt(this,e)}sourceAndMap(e){return Zt(this,e)}streamChunks(e,t,s,i){this._value===void 0&&(this._value=this._valueAsBuffer.toString("utf-8")),s(0,this._name,this._value);let r=!!(e&&e.finalSource);if(!e||e.columns!==!1){let f=rs(this._value),u=1,h=0;if(f!==null)for(let o of f){let a=o.endsWith(`
`);a&&o.length===1?r||t(o,u,h,-1,-1,-1,-1):t(r?void 0:o,u,h,0,u,h,-1),a?(u++,h=0):h+=o.length}return{generatedLine:u,generatedColumn:h,source:r?this._value:void 0}}else if(r){let f=ts(this._value),{generatedLine:u,generatedColumn:h}=f;if(h===0)for(let o=1;o<u;o++)t(void 0,o,0,0,o,0,-1);else for(let o=1;o<=u;o++)t(void 0,o,0,0,o,0,-1);return f}else{let f=1,u=es(this._value),h;for(h of u)t(r?void 0:h,f,0,0,f,0,-1),f++;return u.length===0||h.endsWith(`
`)?{generatedLine:u.length+1,generatedColumn:0,source:r?this._value:void 0}:{generatedLine:u.length,generatedColumn:h.length,source:r?this._value:void 0}}}updateHash(e){this._valueAsBuffer===void 0&&(this._valueAsBuffer=Buffer.from(this._value,"utf-8")),e.update("OriginalSource"),e.update(this._valueAsBuffer),e.update(this._name||"")}};Pe.exports=me});var Ve=j((er,Ge)=>{"use strict";var ns=(n,e)=>{if(e<0)return null;let{sourceRoot:t,sources:s}=n,i=s[e];return t?t.endsWith("/")?t+i:t+"/"+i:i};Ge.exports=ns});var Je=j((tr,Fe)=>{"use strict";var Ue="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",K=new Uint8Array(123);{K.fill(66);for(let n=0;n<Ue.length;n++)K[Ue.charCodeAt(n)]=n;K[44]=64,K[59]=65}var is=K.length-1,us=(n,e)=>{let t=new Uint32Array([0,0,1,0,0]),s=0,i=0,r=0,f=1,u=-1;for(let h=0;h<n.length;h++){let o=n.charCodeAt(h);if(o>is)continue;let a=K[o];if(a&64)t[0]>u&&(s===1?e(f,t[0],-1,-1,-1,-1):s===4?e(f,t[0],t[1],t[2],t[3],-1):s===5&&e(f,t[0],t[1],t[2],t[3],t[4]),u=t[0]),s=0,a===65&&(f++,t[0]=0,u=-1);else if(a&32)i|=(a&31)<<r,r+=5;else{i|=a<<r;let l=i&1?-(i>>1):i>>1;t[s++]+=l,r=0,i=0}}s===1?e(f,t[0],-1,-1,-1,-1):s===4?e(f,t[0],t[1],t[2],t[3],-1):s===5&&e(f,t[0],t[1],t[2],t[3],t[4])};Fe.exports=us});var Z=j((sr,Ke)=>{"use strict";var Xe=ie(),oe=Ve(),le=Je(),$e=X(),fs=(n,e,t,s,i)=>{let r=$e(n);if(r.length===0)return{generatedLine:1,generatedColumn:0};let{sources:f,sourcesContent:u,names:h,mappings:o}=e;for(let p=0;p<f.length;p++)s(p,oe(e,p),u&&u[p]||void 0);if(h)for(let p=0;p<h.length;p++)i(p,h[p]);let a=r[r.length-1],l=a.endsWith(`
`),d=l?r.length+1:r.length,m=l?0:a.length,c=1,_=0,g=!1,A=-1,O=-1,y=-1,v=-1,E=(p,B,q,w,b,T)=>{if(g&&c<=r.length){let S,M=c,N=_,z=r[c-1];p!==c?(S=z.slice(_),c++,_=0):(S=z.slice(_,B),_=B),S&&t(S,M,N,A,O,y,v),g=!1}if(p>c&&_>0){if(c<=r.length){let S=r[c-1].slice(_);t(S,c,_,-1,-1,-1,-1)}c++,_=0}for(;p>c;)c<=r.length&&t(r[c-1],c,0,-1,-1,-1,-1),c++;if(B>_){if(c<=r.length){let S=r[c-1].slice(_,B);t(S,c,_,-1,-1,-1,-1)}_=B}q>=0&&(p<d||p===d&&B<m)&&(g=!0,A=q,O=w,y=b,v=T)};return le(o,E),E(d,m,-1,-1,-1,-1),{generatedLine:d,generatedColumn:m}},cs=(n,e,t,s,i)=>{let r=$e(n);if(r.length===0)return{generatedLine:1,generatedColumn:0};let{sources:f,sourcesContent:u,mappings:h}=e;for(let _=0;_<f.length;_++)s(_,oe(e,_),u&&u[_]||void 0);let o=1;for(le(h,(_,g,A,O,y,v)=>{if(!(A<0||_<o||_>r.length)){for(;_>o;)o<=r.length&&t(r[o-1],o,0,-1,-1,-1,-1),o++;_<=r.length&&(t(r[_-1],_,0,A,O,y,-1),o++)}});o<=r.length;o++)t(r[o-1],o,0,-1,-1,-1,-1);let l=r[r.length-1],d=l.endsWith(`
`),m=d?r.length+1:r.length,c=d?0:l.length;return{generatedLine:m,generatedColumn:c}},os=(n,e,t,s,i)=>{let r=Xe(n),{generatedLine:f,generatedColumn:u}=r;if(f===1&&u===0)return r;let{sources:h,sourcesContent:o,names:a,mappings:l}=e;for(let c=0;c<h.length;c++)s(c,oe(e,c),o&&o[c]||void 0);if(a)for(let c=0;c<a.length;c++)i(c,a[c]);let d=0;return le(l,(c,_,g,A,O,y)=>{c>=f&&(_>=u||c>f)||(g>=0?(t(void 0,c,_,g,A,O,y),d=c):d===c&&(t(void 0,c,_,-1,-1,-1,-1),d=0))}),r},ls=(n,e,t,s,i)=>{let r=Xe(n),{generatedLine:f,generatedColumn:u}=r;if(f===1&&u===0)return{generatedLine:1,generatedColumn:0};let{sources:h,sourcesContent:o,mappings:a}=e;for(let c=0;c<h.length;c++)s(c,oe(e,c),o&&o[c]||void 0);let l=u===0?f-1:f,d=1;return le(a,(c,_,g,A,O,y)=>{g>=0&&d<=c&&c<=l&&(t(void 0,c,0,g,A,O,-1),d=c+1)}),r};Ke.exports=(n,e,t,s,i,r,f)=>f?r?os(n,e,t,s,i):fs(n,e,t,s,i):r?ls(n,e,t,s,i):cs(n,e,t,s,i)});var et=j((rr,Ze)=>{"use strict";var Qe=Z(),Ye=X(),as=(n,e,t,s,i,r,f,u,h,o,a)=>{let l=new Map,d=new Map,m=[],c=[],_=[],g=-2,A=[],O=[],y=[],v=[],E=[],p=[],B=[],q=(w,b)=>{if(w>B.length)return-1;let{mappingsData:T}=B[w-1],S=0,M=T.length/5;for(;S<M;){let N=S+M>>1;T[N*5]<=b?S=N+1:M=N}return S===0?-1:S-1};return Qe(n,e,(w,b,T,S,M,N,z)=>{if(S===g){let R=q(M,N);if(R!==-1){let{chunks:L,mappingsData:I}=B[M-1],H=R*5,C=I[H+1],k=I[H+2],F=I[H+3],U=I[H+4];if(C>=0){let Et=L[R],qt=I[H],te=N-qt;if(te>0){let x=C<v.length?v[C]:null;if(x===void 0){let D=y[C];x=D?Ye(D):null,v[C]=x}if(x!==null){let D=k<=x.length?x[k-1].slice(F,F+te):"";Et.slice(0,te)===D&&(F+=te,U=-1)}}let se=C<A.length?A[C]:-2;if(se===-2){let[x,D]=C<O.length?O[C]:[null,void 0],J=l.get(x);J===void 0&&(l.set(x,J=l.size),u(J,x,D)),se=J,A[C]=se}let W=-1;if(U>=0){if(W=U<E.length?E[U]:-2,W===-2){let x=U<p.length?p[U]:void 0;if(x){let D=d.get(x);D===void 0&&(d.set(x,D=d.size),h(D,x)),W=D}else W=-1;E[U]=W}}else if(z>=0){let x=v[C];if(x===void 0){let D=y[C];x=D?Ye(D):null,v[C]=x}if(x!==null){let D=_[z],J=k<=x.length?x[k-1].slice(F,F+D.length):"";if(D===J&&(W=z<c.length?c[z]:-2,W===-2)){let re=_[z];if(re){let ne=d.get(re);ne===void 0&&(d.set(re,ne=d.size),h(ne,re)),W=ne}else W=-1;c[z]=W}}}f(w,b,T,se,k,F,W);return}}if(r){f(w,b,T,-1,-1,-1,-1);return}else if(m[S]===-2){let L=l.get(t);L===void 0&&(l.set(n,L=l.size),u(L,t,s)),m[S]=L}}let P=S<0||S>=m.length?-1:m[S];if(P<0)f(w,b,T,-1,-1,-1,-1);else{let R=-1;if(z>=0&&z<c.length&&(R=c[z],R===-2)){let L=_[z],I=d.get(L);I===void 0&&(d.set(L,I=d.size),h(I,L)),R=I,c[z]=R}f(w,b,T,P,M,N,R)}},(w,b,T)=>{if(b===t)g=w,s!==void 0?T=s:s=T,m[w]=-2,Qe(T,i,(S,M,N,z,P,R,L)=>{for(;B.length<M;)B.push({mappingsData:[],chunks:[]});let I=B[M-1];I.mappingsData.push(N,z,P,R,L),I.chunks.push(S)},(S,M,N)=>{y[S]=N,v[S]=void 0,A[S]=-2,O[S]=[M,N]},(S,M)=>{E[S]=-2,p[S]=M},!1,a);else{let S=l.get(b);S===void 0&&(l.set(b,S=l.size),u(S,b,T)),m[w]=S}},(w,b)=>{c[w]=-2,_[w]=b},o,a)};Ze.exports=as});var st=j((nr,tt)=>{"use strict";var hs=G(),ds=Z(),ps=et(),{getMap:_s,getSourceAndMap:gs}=$(),Ae=class extends hs{constructor(e,t,s,i,r,f){super();let u=Buffer.isBuffer(e);this._valueAsString=u?void 0:e,this._valueAsBuffer=u?e:void 0,this._name=t,this._hasSourceMap=!!s;let h=Buffer.isBuffer(s),o=typeof s=="string";this._sourceMapAsObject=h||o?void 0:s,this._sourceMapAsString=o?s:void 0,this._sourceMapAsBuffer=h?s:void 0,this._hasOriginalSource=!!i;let a=Buffer.isBuffer(i);this._originalSourceAsString=a?void 0:i,this._originalSourceAsBuffer=a?i:void 0,this._hasInnerSourceMap=!!r;let l=Buffer.isBuffer(r),d=typeof r=="string";this._innerSourceMapAsObject=l||d?void 0:r,this._innerSourceMapAsString=d?r:void 0,this._innerSourceMapAsBuffer=l?r:void 0,this._removeOriginalSource=f}_ensureValueBuffer(){this._valueAsBuffer===void 0&&(this._valueAsBuffer=Buffer.from(this._valueAsString,"utf-8"))}_ensureValueString(){this._valueAsString===void 0&&(this._valueAsString=this._valueAsBuffer.toString("utf-8"))}_ensureOriginalSourceBuffer(){this._originalSourceAsBuffer===void 0&&this._hasOriginalSource&&(this._originalSourceAsBuffer=Buffer.from(this._originalSourceAsString,"utf-8"))}_ensureOriginalSourceString(){this._originalSourceAsString===void 0&&this._hasOriginalSource&&(this._originalSourceAsString=this._originalSourceAsBuffer.toString("utf-8"))}_ensureInnerSourceMapObject(){this._innerSourceMapAsObject===void 0&&this._hasInnerSourceMap&&(this._ensureInnerSourceMapString(),this._innerSourceMapAsObject=JSON.parse(this._innerSourceMapAsString))}_ensureInnerSourceMapBuffer(){this._innerSourceMapAsBuffer===void 0&&this._hasInnerSourceMap&&(this._ensureInnerSourceMapString(),this._innerSourceMapAsBuffer=Buffer.from(this._innerSourceMapAsString,"utf-8"))}_ensureInnerSourceMapString(){this._innerSourceMapAsString===void 0&&this._hasInnerSourceMap&&(this._innerSourceMapAsBuffer!==void 0?this._innerSourceMapAsString=this._innerSourceMapAsBuffer.toString("utf-8"):this._innerSourceMapAsString=JSON.stringify(this._innerSourceMapAsObject))}_ensureSourceMapObject(){this._sourceMapAsObject===void 0&&(this._ensureSourceMapString(),this._sourceMapAsObject=JSON.parse(this._sourceMapAsString))}_ensureSourceMapBuffer(){this._sourceMapAsBuffer===void 0&&(this._ensureSourceMapString(),this._sourceMapAsBuffer=Buffer.from(this._sourceMapAsString,"utf-8"))}_ensureSourceMapString(){this._sourceMapAsString===void 0&&(this._sourceMapAsBuffer!==void 0?this._sourceMapAsString=this._sourceMapAsBuffer.toString("utf-8"):this._sourceMapAsString=JSON.stringify(this._sourceMapAsObject))}getArgsAsBuffers(){return this._ensureValueBuffer(),this._ensureSourceMapBuffer(),this._ensureOriginalSourceBuffer(),this._ensureInnerSourceMapBuffer(),[this._valueAsBuffer,this._name,this._sourceMapAsBuffer,this._originalSourceAsBuffer,this._innerSourceMapAsBuffer,this._removeOriginalSource]}buffer(){return this._ensureValueBuffer(),this._valueAsBuffer}source(){return this._ensureValueString(),this._valueAsString}map(e){return this._hasInnerSourceMap?_s(this,e):(this._ensureSourceMapObject(),this._sourceMapAsObject)}sourceAndMap(e){return this._hasInnerSourceMap?gs(this,e):(this._ensureValueString(),this._ensureSourceMapObject(),{source:this._valueAsString,map:this._sourceMapAsObject})}streamChunks(e,t,s,i){return this._ensureValueString(),this._ensureSourceMapObject(),this._ensureOriginalSourceString(),this._hasInnerSourceMap?(this._ensureInnerSourceMapObject(),ps(this._valueAsString,this._sourceMapAsObject,this._name,this._originalSourceAsString,this._innerSourceMapAsObject,this._removeOriginalSource,t,s,i,!!(e&&e.finalSource),!!(e&&e.columns!==!1))):ds(this._valueAsString,this._sourceMapAsObject,t,s,i,!!(e&&e.finalSource),!!(e&&e.columns!==!1))}updateHash(e){this._ensureValueBuffer(),this._ensureSourceMapBuffer(),this._ensureOriginalSourceBuffer(),this._ensureInnerSourceMapBuffer(),e.update("SourceMapSource"),e.update(this._valueAsBuffer),e.update(this._sourceMapAsBuffer),this._hasOriginalSource&&e.update(this._originalSourceAsBuffer),this._hasInnerSourceMap&&e.update(this._innerSourceMapAsBuffer),e.update(this._removeOriginalSource?"true":"false")}};tt.exports=Ae});var ee=j((ir,rt)=>{"use strict";var Ss=ue(),ms=Z();rt.exports=(n,e,t,s,i)=>{if(typeof n.streamChunks=="function")return n.streamChunks(e,t,s,i);{let r=n.sourceAndMap(e);return r.map?ms(r.source,r.map,t,s,i,!!(e&&e.finalSource),!!(e&&e.columns!==!1)):Ss(r.source,t,s,i,!!(e&&e.finalSource))}}});var it=j((ur,nt)=>{"use strict";var As=ge(),Ms=ee(),Bs=(n,e,t,s,i)=>{let r="",f="",u=[],h=[],o=[],a=As(Object.assign({},e,{columns:!0})),l=!!(e&&e.finalSource),{generatedLine:d,generatedColumn:m,source:c}=Ms(n,e,(g,A,O,y,v,E,p)=>(g!==void 0&&(r+=g),f+=a(A,O,y,v,E,p),t(l?void 0:g,A,O,y,v,E,p)),(g,A,O)=>{for(;u.length<g;)u.push(null);if(u[g]=A,O!==void 0){for(;h.length<g;)h.push(null);h[g]=O}return s(g,A,O)},(g,A)=>{for(;o.length<g;)o.push(null);return o[g]=A,i(g,A)}),_=c!==void 0?c:r;return{result:{generatedLine:d,generatedColumn:m,source:l?_:void 0},source:_,map:f.length>0?{version:3,file:"x",mappings:f,sources:u,sourcesContent:h.length>0?h:void 0,names:o}:null}};nt.exports=Bs});var ft=j((fr,ut)=>{"use strict";var vs=G(),bs=Z(),Os=ue(),ys=it(),ws=n=>{if(typeof n!="object"||!n)return n;let e=Object.assign({},n);return n.mappings&&(e.mappings=Buffer.from(n.mappings,"utf-8")),n.sourcesContent&&(e.sourcesContent=n.sourcesContent.map(t=>t&&Buffer.from(t,"utf-8"))),e},Ts=n=>{if(typeof n!="object"||!n)return n;let e=Object.assign({},n);return n.mappings&&(e.mappings=n.mappings.toString("utf-8")),n.sourcesContent&&(e.sourcesContent=n.sourcesContent.map(t=>t&&t.toString("utf-8"))),e},Me=class extends vs{constructor(e,t){super(),this._source=e,this._cachedSourceType=t?t.source:void 0,this._cachedSource=void 0,this._cachedBuffer=t?t.buffer:void 0,this._cachedSize=t?t.size:void 0,this._cachedMaps=t?t.maps:new Map,this._cachedHashUpdate=t?t.hash:void 0}getCachedData(){let e=new Map;for(let t of this._cachedMaps){let s=t[1];s.bufferedMap===void 0&&(s.bufferedMap=ws(this._getMapFromCacheEntry(s))),e.set(t[0],{map:void 0,bufferedMap:s.bufferedMap})}return this._cachedSource&&this.buffer(),{buffer:this._cachedBuffer,source:this._cachedSourceType!==void 0?this._cachedSourceType:typeof this._cachedSource=="string"?!0:Buffer.isBuffer(this._cachedSource)?!1:void 0,size:this._cachedSize,maps:e,hash:this._cachedHashUpdate}}originalLazy(){return this._source}original(){return typeof this._source=="function"&&(this._source=this._source()),this._source}source(){let e=this._getCachedSource();return e!==void 0?e:this._cachedSource=this.original().source()}_getMapFromCacheEntry(e){if(e.map!==void 0)return e.map;if(e.bufferedMap!==void 0)return e.map=Ts(e.bufferedMap)}_getCachedSource(){if(this._cachedSource!==void 0)return this._cachedSource;if(this._cachedBuffer&&this._cachedSourceType!==void 0)return this._cachedSource=this._cachedSourceType?this._cachedBuffer.toString("utf-8"):this._cachedBuffer}buffer(){if(this._cachedBuffer!==void 0)return this._cachedBuffer;if(this._cachedSource!==void 0)return Buffer.isBuffer(this._cachedSource)?this._cachedBuffer=this._cachedSource:this._cachedBuffer=Buffer.from(this._cachedSource,"utf-8");if(typeof this.original().buffer=="function")return this._cachedBuffer=this.original().buffer();let e=this.source();return Buffer.isBuffer(e)?this._cachedBuffer=e:this._cachedBuffer=Buffer.from(e,"utf-8")}size(){if(this._cachedSize!==void 0)return this._cachedSize;if(this._cachedBuffer!==void 0)return this._cachedSize=this._cachedBuffer.length;let e=this._getCachedSource();return e!==void 0?this._cachedSize=Buffer.byteLength(e):this._cachedSize=this.original().size()}sourceAndMap(e){let t=e?JSON.stringify(e):"{}",s=this._cachedMaps.get(t);if(s!==void 0){let f=this._getMapFromCacheEntry(s);return{source:this.source(),map:f}}let i=this._getCachedSource(),r;if(i!==void 0)r=this.original().map(e);else{let f=this.original().sourceAndMap(e);i=f.source,r=f.map,this._cachedSource=i}return this._cachedMaps.set(t,{map:r,bufferedMap:void 0}),{source:i,map:r}}streamChunks(e,t,s,i){let r=e?JSON.stringify(e):"{}";if(this._cachedMaps.has(r)&&(this._cachedBuffer!==void 0||this._cachedSource!==void 0)){let{source:o,map:a}=this.sourceAndMap(e);return a?bs(o,a,t,s,i,!!(e&&e.finalSource),!0):Os(o,t,s,i,!!(e&&e.finalSource))}let{result:f,source:u,map:h}=ys(this.original(),e,t,s,i);return this._cachedSource=u,this._cachedMaps.set(r,{map:h,bufferedMap:void 0}),f}map(e){let t=e?JSON.stringify(e):"{}",s=this._cachedMaps.get(t);if(s!==void 0)return this._getMapFromCacheEntry(s);let i=this.original().map(e);return this._cachedMaps.set(t,{map:i,bufferedMap:void 0}),i}updateHash(e){if(this._cachedHashUpdate!==void 0){for(let r of this._cachedHashUpdate)e.update(r);return}let t=[],s,i={update:r=>{typeof r=="string"&&r.length<10240?s===void 0?s=r:(s+=r,s.length>102400&&(t.push(Buffer.from(s)),s=void 0)):(s!==void 0&&(t.push(Buffer.from(s)),s=void 0),t.push(r))}};this.original().updateHash(i),s!==void 0&&t.push(Buffer.from(s));for(let r of t)e.update(r);this._cachedHashUpdate=t}};ut.exports=Me});var lt=j((cr,ot)=>{"use strict";var Cs=G(),ct=fe(),zs=ee(),{getMap:Es,getSourceAndMap:qs}=$(),Be=new WeakSet,ve=class n extends Cs{constructor(){super(),this._children=[];for(let e=0;e<arguments.length;e++){let t=arguments[e];if(t instanceof n)for(let s of t._children)this._children.push(s);else this._children.push(t)}this._isOptimized=arguments.length===0}getChildren(){return this._isOptimized||this._optimize(),this._children}add(e){if(e instanceof n)for(let t of e._children)this._children.push(t);else this._children.push(e);this._isOptimized=!1}addAllSkipOptimizing(e){for(let t of e)this._children.push(t)}buffer(){this._isOptimized||this._optimize();let e=[];for(let t of this._children)if(typeof t.buffer=="function")e.push(t.buffer());else{let s=t.source();Buffer.isBuffer(s)?e.push(s):e.push(Buffer.from(s,"utf-8"))}return Buffer.concat(e)}source(){this._isOptimized||this._optimize();let e="";for(let t of this._children)e+=t.source();return e}size(){this._isOptimized||this._optimize();let e=0;for(let t of this._children)e+=t.size();return e}map(e){return Es(this,e)}sourceAndMap(e){return qs(this,e)}streamChunks(e,t,s,i){if(this._isOptimized||this._optimize(),this._children.length===1)return this._children[0].streamChunks(e,t,s,i);let r=0,f=0,u=new Map,h=new Map,o=!!(e&&e.finalSource),a="",l=!1;for(let d of this._children){let m=[],c=[],_=0,{generatedLine:g,generatedColumn:A,source:O}=zs(d,e,(y,v,E,p,B,q,w)=>{let b=v+r,T=v===1?E+f:E;l&&((v!==1||E!==0)&&t(void 0,r+1,f,-1,-1,-1,-1),l=!1);let S=p<0||p>=m.length?-1:m[p],M=w<0||w>=c.length?-1:c[w];_=S<0?0:v,o?(y!==void 0&&(a+=y),S>=0&&t(void 0,b,T,S,B,q,M)):S<0?t(y,b,T,-1,-1,-1,-1):t(y,b,T,S,B,q,M)},(y,v,E)=>{let p=u.get(v);p===void 0&&(u.set(v,p=u.size),s(p,v,E)),m[y]=p},(y,v)=>{let E=h.get(v);E===void 0&&(h.set(v,E=h.size),i(E,v)),c[y]=E});O!==void 0&&(a+=O),l&&(g!==1||A!==0)&&(t(void 0,r+1,f,-1,-1,-1,-1),l=!1),g>1?f=A:f+=A,l=l||o&&_===g,r+=g-1}return{generatedLine:r+1,generatedColumn:f,source:o?a:void 0}}updateHash(e){this._isOptimized||this._optimize(),e.update("ConcatSource");for(let t of this._children)t.updateHash(e)}_optimize(){let e=[],t,s,i=u=>{s===void 0?s=u:Array.isArray(s)?s.push(u):s=[typeof s=="string"?s:s.source(),u]},r=u=>{s===void 0?s=u:Array.isArray(s)?s.push(u.source()):s=[typeof s=="string"?s:s.source(),u.source()]},f=()=>{if(Array.isArray(s)){let u=new ct(s.join(""));Be.add(u),e.push(u)}else if(typeof s=="string"){let u=new ct(s);Be.add(u),e.push(u)}else e.push(s)};for(let u of this._children)typeof u=="string"?t===void 0?t=u:t+=u:(t!==void 0&&(i(t),t=void 0),Be.has(u)?r(u):(s!==void 0&&(f(),s=void 0),e.push(u)));t!==void 0&&i(t),s!==void 0&&f(),this._children=e,this._isOptimized=!0}};ot.exports=ve});var pt=j((or,dt)=>{"use strict";var{getMap:Ns,getSourceAndMap:js}=$(),xs=ee(),ks=G(),be=X(),ht=typeof process=="object"&&process.versions&&typeof process.versions.v8=="string"&&!/^[0-6]\./.test(process.versions.v8),at=536870912,ae=class{constructor(e,t,s,i){this.start=e,this.end=t,this.content=s,this.name=i,ht||(this.index=-1)}},Oe=class extends ks{constructor(e,t){super(),this._source=e,this._name=t,this._replacements=[],this._isSorted=!0}getName(){return this._name}getReplacements(){return this._sortReplacements(),this._replacements}replace(e,t,s,i){if(typeof s!="string")throw new Error("insertion must be a string, but is a "+typeof s);this._replacements.push(new ae(e,t,s,i)),this._isSorted=!1}insert(e,t,s){if(typeof t!="string")throw new Error("insertion must be a string, but is a "+typeof t+": "+t);this._replacements.push(new ae(e,e-1,t,s)),this._isSorted=!1}source(){if(this._replacements.length===0)return this._source.source();let e=this._source.source(),t=0,s=[];this._sortReplacements();for(let i of this._replacements){let r=Math.floor(i.start),f=Math.floor(i.end+1);if(t<r){let u=r-t;s.push(e.slice(0,u)),e=e.slice(u),t=r}if(s.push(i.content),t<f){let u=f-t;e=e.slice(u),t=f}}return s.push(e),s.join("")}map(e){return this._replacements.length===0?this._source.map(e):Ns(this,e)}sourceAndMap(e){return this._replacements.length===0?this._source.sourceAndMap(e):js(this,e)}original(){return this._source}_sortReplacements(){this._isSorted||(ht?this._replacements.sort(function(e,t){let s=e.start-t.start;if(s!==0)return s;let i=e.end-t.end;return i!==0?i:0}):(this._replacements.forEach((e,t)=>e.index=t),this._replacements.sort(function(e,t){let s=e.start-t.start;if(s!==0)return s;let i=e.end-t.end;return i!==0?i:e.index-t.index})),this._isSorted=!0)}streamChunks(e,t,s,i){this._sortReplacements();let r=this._replacements,f=0,u=0,h=-1,o=u<r.length?Math.floor(r[u].start):at,a=0,l=0,d=0,m=[],c=new Map,_=[],g=(p,B,q,w)=>{let b=p<m.length?m[p]:void 0;if(b===void 0)return!1;typeof b=="string"&&(b=be(b),m[p]=b);let T=B<=b.length?b[B-1]:null;return T===null?!1:T.slice(q,q+w.length)===w},{generatedLine:A,generatedColumn:O}=xs(this._source,Object.assign({},e,{finalSource:!1}),(p,B,q,w,b,T,S)=>{let M=0,N=f+p.length;if(h>f){if(h>=N){let P=B+a;p.endsWith(`
`)?(a--,d===P&&(l+=q)):d===P?l-=p.length:(l=-p.length,d=P),f=N;return}M=h-f,g(w,b,T,p.slice(0,M))&&(T+=M),f+=M;let z=B+a;d===z?l-=M:(l=-M,d=z),q+=M}if(o<N)do{let z=B+a;if(o>f){let C=o-f,k=p.slice(M,M+C);t(k,z,q+(z===d?l:0),w,b,T,S<0||S>=_.length?-1:_[S]),q+=C,M+=C,f=o,g(w,b,T,k)&&(T+=k.length)}let{content:P,name:R}=r[u],L=be(P),I=S;if(w>=0&&R){let C=c.get(R);C===void 0&&(C=c.size,c.set(R,C),i(C,R)),I=C}for(let C=0;C<L.length;C++){let k=L[C];t(k,z,q+(z===d?l:0),w,b,T,I),I=-1,C===L.length-1&&!k.endsWith(`
`)?d===z?l+=k.length:(l=k.length,d=z):(a++,z++,l=-q,d=z)}h=Math.max(h,Math.floor(r[u].end+1)),u++,o=u<r.length?Math.floor(r[u].start):at;let H=p.length-N+h-M;if(H>0){if(h>=N){let k=B+a;p.endsWith(`
`)?(a--,d===k&&(l+=q)):d===k?l-=p.length-M:(l=M-p.length,d=k),f=N;return}let C=B+a;g(w,b,T,p.slice(M,M+H))&&(T+=H),M+=H,f+=H,d===C?l-=H:(l=-H,d=C),q+=H}}while(o<N);if(M<p.length){let z=M===0?p:p.slice(M),P=B+a;t(z,P,q+(P===d?l:0),w,b,T,S<0?-1:_[S])}f=N},(p,B,q)=>{for(;m.length<p;)m.push(void 0);m[p]=q,s(p,B,q)},(p,B)=>{let q=c.get(B);q===void 0&&(q=c.size,c.set(B,q),i(q,B)),_[p]=q}),y="";for(;u<r.length;u++)y+=r[u].content;let v=A+a,E=be(y);for(let p=0;p<E.length;p++){let B=E[p];t(B,v,O+(v===d?l:0),-1,-1,-1,-1),p===E.length-1&&!B.endsWith(`
`)?d===v?l+=B.length:(l=B.length,d=v):(a++,v++,l=-O,d=v)}return{generatedLine:v,generatedColumn:O+(v===d?l:0)}}updateHash(e){this._sortReplacements(),e.update("ReplaceSource"),this._source.updateHash(e),e.update(this._name||"");for(let t of this._replacements)e.update(`${t.start}${t.end}${t.content}${t.name}`)}};dt.exports=Oe});var St=j((lr,gt)=>{"use strict";var Is=G(),Ds=fe(),Rs=ee(),{getMap:Ls,getSourceAndMap:Hs}=$(),_t=/\n(?=.|\s)/g,ye=class extends Is{constructor(e,t){super(),this._source=typeof t=="string"||Buffer.isBuffer(t)?new Ds(t,!0):t,this._prefix=e}getPrefix(){return this._prefix}original(){return this._source}source(){let e=this._source.source(),t=this._prefix;return t+e.replace(_t,`
`+t)}map(e){return Ls(this,e)}sourceAndMap(e){return Hs(this,e)}streamChunks(e,t,s,i){let r=this._prefix,f=r.length,u=!!(e&&e.columns===!1),{generatedLine:h,generatedColumn:o,source:a}=Rs(this._source,e,(l,d,m,c,_,g,A)=>{m!==0?m+=f:l!==void 0?u||c<0?l=r+l:f>0&&(t(r,d,m,-1,-1,-1,-1),m+=f):u||(m+=f),t(l,d,m,c,_,g,A)},s,i);return{generatedLine:h,generatedColumn:o===0?0:f+o,source:a!==void 0?r+a.replace(_t,`
`+r):void 0}}updateHash(e){e.update("PrefixSource"),this._source.updateHash(e),e.update(this._prefix)}};gt.exports=ye});var At=j((ar,mt)=>{"use strict";var Ps=G(),we=class extends Ps{constructor(e){super(),this._size=e}_error(){return new Error("Content and Map of this Source is not available (only size() is supported)")}size(){return this._size}source(){throw this._error()}buffer(){throw this._error()}map(e){throw this._error()}updateHash(){throw this._error()}};mt.exports=we});var vt=j((hr,Bt)=>{"use strict";var Mt=G(),Te=class n extends Mt{static from(e){return e instanceof Mt?e:new n(e)}constructor(e){super(),this._sourceLike=e}source(){return this._sourceLike.source()}buffer(){return typeof this._sourceLike.buffer=="function"?this._sourceLike.buffer():super.buffer()}size(){return typeof this._sourceLike.size=="function"?this._sourceLike.size():super.size()}map(e){return typeof this._sourceLike.map=="function"?this._sourceLike.map(e):super.map(e)}sourceAndMap(e){return typeof this._sourceLike.sourceAndMap=="function"?this._sourceLike.sourceAndMap(e):super.sourceAndMap(e)}updateHash(e){if(typeof this._sourceLike.updateHash=="function")return this._sourceLike.updateHash(e);if(typeof this._sourceLike.map=="function")throw new Error("A Source-like object with a 'map' method must also provide an 'updateHash' method");e.update(this.buffer())}};Bt.exports=Te});var Ot=j(bt=>{var V=(n,e)=>{let t;Object.defineProperty(bt,n,{get:()=>(e!==void 0&&(t=e(),e=void 0),t),configurable:!0})};V("Source",()=>G());V("RawSource",()=>fe());V("OriginalSource",()=>We());V("SourceMapSource",()=>st());V("CachedSource",()=>ft());V("ConcatSource",()=>lt());V("ReplaceSource",()=>pt());V("PrefixSource",()=>St());V("SizeOnlySource",()=>At());V("CompatSource",()=>vt())});var Gs={};Rt(Gs,{KhulnasoftDevToolsPlugin:()=>Ce});module.exports=Ht(Gs);var wt=Lt(Ot(),1),de=require("node:path"),Q=require("node:fs"),Tt=require("../core/index.cjs"),Ct=require("../node/index.cjs"),zt=require("../server/index.cjs");var yt="KhulnasoftDevToolsPlugin",he=null;async function Ws(n){let e=await(0,Ct.createDevToolsNodeSys)({cwd:process.cwd()});e.debug("webpack setupDevTools init");let t=await(0,Tt.createDevTools)(e),s=await(0,zt.createDevToolsServer)({...t,getClientId:()=>"webpack-khulnasoft-dev-tools",closeAppServer:async()=>{},restartAppServer:async()=>{e.debug("restart server");let i=["next.config.js","next.config.ts","next.config.mjs","webpack.config.js","webpack.config.ts"].map(r=>(0,de.join)(e.getAppRootDir(),r));for(let r of i)if((0,Q.existsSync)(r)){e.debug(`restart server: ${r}`),(0,Q.writeFileSync)(r,(0,Q.readFileSync)(r)),await new Promise(f=>setTimeout(f,50));return}},enableAppWatch:async i=>i,...e,...n});return e.debug("webpack setupDevTools done"),{server:s,sys:e}}var Ce=class{constructor(e){Ee(this,"opts");this.opts=e||{},typeof this.opts.enabled!="boolean"&&(this.opts.enabled=process.env.NODE_ENV!=="production"),this.opts.enabled&&he==null&&(he=Ws(this.opts))}apply(e){if(this.opts.enabled===!1)return;let t=e,s=t.webpack.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS,i=new WeakMap;t.hooks.compilation.tap(yt,r=>{r.hooks.processAssets.tapAsync({name:yt,stage:s},async(f,u)=>{if(he!=null){for(let h of r.chunks)for(let o of h.files){let a=(0,de.basename)(o),{server:l,sys:d}=await he;if(d.getFrameworks().some(A=>A.name==="next")&&a!=="webpack.js")continue;d.getAppRootDir=()=>t.context;let m=new URL("/~khulnasoft-dev-tools.js",l.getUrl()),c=`
;
/* Khulnasoft Devtools (Webpack) */
`;c+=`(() => {
`,c+=` if (typeof document !== "undefined") {
`,c+=` let devToolsScript = document.head.querySelector("script[data-khulnasoft-dev-tools]");
`,c+=` if (!devToolsScript) {
`,c+=` devToolsScript = document.createElement("script");
`,c+=` devToolsScript.setAttribute("src", ${JSON.stringify(m)});
`,c+=` devToolsScript.setAttribute("data-khulnasoft-dev-tools", "");
`,c+=` devToolsScript.setAttribute("async", "");
`,c+=` document.head.appendChild(devToolsScript);
`,c+=` }
`,c+=` }
`,c+=`})();
`;let _={chunk:h,filename:o},g=r.getPath(c,_);r.updateAsset(o,A=>{let O=i.get(A);if(!O||O.inject!==g){let y=new wt.ConcatSource(A,g);return i.set(A,{source:y,inject:g}),y}return O.source})}u()}})})}};0&&(module.exports={KhulnasoftDevToolsPlugin});