@shipstatic/ship 0.2.6 → 0.2.7-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/browser.js CHANGED
@@ -2,7 +2,7 @@ var _a=Object.create;var Z=Object.defineProperty;var qa=Object.getOwnPropertyDes
2
2
  `||e===`
3
3
  `&&s[a-1]!=="\r"?`\r
4
4
  `:e);oi=i=>new Proxy(i,{get:(e,a)=>sa(e,a),has:(e,a)=>sa(e,a)!==void 0}),si={enableAdditionalHeaders:!1},ne={writable:!1,configurable:!1},ti=class{constructor(i,e,a){if(_(this,V),_(this,D,`\r
5
- `),_(this,G),_(this,oe),_(this,W,"-".repeat(2)),_(this,L,new TextEncoder),_(this,J),_(this,Y),_(this,se),!ra(i))throw new TypeError("Expected first argument to be a FormData instance.");let s;if(oa(e)?a=e:s=e,s||(s=`form-data-encoder-${Za()}`),typeof s!="string")throw new TypeError("Expected boundary argument to be a string.");if(a&&!oa(a))throw new TypeError("Expected options argument to be an object.");H(this,Y,Array.from(i.entries())),H(this,se,{...si,...a}),H(this,G,w(this,L).encode(w(this,D))),H(this,oe,w(this,G).byteLength),this.boundary=s,this.contentType=`multipart/form-data; boundary=${this.boundary}`,H(this,J,w(this,L).encode(`${w(this,W)}${this.boundary}${w(this,W)}${w(this,D).repeat(2)}`));let r={"Content-Type":this.contentType},u=we(this,V,la).call(this);u&&(this.contentLength=u,r["Content-Length"]=u),this.headers=oi(Object.freeze(r)),Object.defineProperties(this,{boundary:ne,contentType:ne,contentLength:ne,headers:ne})}*values(){for(let[i,e]of w(this,Y)){let a=B(e)?e:w(this,L).encode(pa(e));yield we(this,V,je).call(this,i,a),yield a,yield w(this,G)}yield w(this,J)}async*encode(){for(let i of this.values())B(i)?yield*ii(i.stream()):yield*ca(i)}[Symbol.iterator](){return this.values()}[Symbol.asyncIterator](){return this.encode()}};D=new WeakMap;G=new WeakMap;oe=new WeakMap;W=new WeakMap;L=new WeakMap;J=new WeakMap;Y=new WeakMap;se=new WeakMap;V=new WeakSet;je=function(i,e){let a="";if(a+=`${w(this,W)}${this.boundary}${w(this,D)}`,a+=`Content-Disposition: form-data; name="${ia(i)}"`,B(e)&&(a+=`; filename="${ia(e.name)}"${w(this,D)}`,a+=`Content-Type: ${e.type||"application/octet-stream"}`),w(this,se).enableAdditionalHeaders===!0){let s=B(e)?e.size:e.byteLength;s!=null&&!isNaN(s)&&(a+=`${w(this,D)}Content-Length: ${s}`)}return w(this,L).encode(`${a}${w(this,D).repeat(2)}`)};la=function(){let i=0;for(let[e,a]of w(this,Y)){let s=B(a)?a:w(this,L).encode(pa(a)),r=B(s)?s.size:s.byteLength;if(r==null||isNaN(r))return;i+=we(this,V,je).call(this,e,s).byteLength,i+=r,i+=w(this,oe)}return String(i+w(this,J).byteLength)}});var ha=$((fa,ba)=>{"use strict";(function(i){if(typeof fa=="object")ba.exports=i();else if(typeof define=="function"&&define.amd)define(i);else{var e;try{e=window}catch{e=self}e.SparkMD5=i()}})(function(i){"use strict";var e=function(m,p){return m+p&4294967295},a=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function s(m,p,o,n,c,t){return p=e(e(p,m),e(n,t)),e(p<<c|p>>>32-c,o)}function r(m,p){var o=m[0],n=m[1],c=m[2],t=m[3];o+=(n&c|~n&t)+p[0]-680876936|0,o=(o<<7|o>>>25)+n|0,t+=(o&n|~o&c)+p[1]-389564586|0,t=(t<<12|t>>>20)+o|0,c+=(t&o|~t&n)+p[2]+606105819|0,c=(c<<17|c>>>15)+t|0,n+=(c&t|~c&o)+p[3]-1044525330|0,n=(n<<22|n>>>10)+c|0,o+=(n&c|~n&t)+p[4]-176418897|0,o=(o<<7|o>>>25)+n|0,t+=(o&n|~o&c)+p[5]+1200080426|0,t=(t<<12|t>>>20)+o|0,c+=(t&o|~t&n)+p[6]-1473231341|0,c=(c<<17|c>>>15)+t|0,n+=(c&t|~c&o)+p[7]-45705983|0,n=(n<<22|n>>>10)+c|0,o+=(n&c|~n&t)+p[8]+1770035416|0,o=(o<<7|o>>>25)+n|0,t+=(o&n|~o&c)+p[9]-1958414417|0,t=(t<<12|t>>>20)+o|0,c+=(t&o|~t&n)+p[10]-42063|0,c=(c<<17|c>>>15)+t|0,n+=(c&t|~c&o)+p[11]-1990404162|0,n=(n<<22|n>>>10)+c|0,o+=(n&c|~n&t)+p[12]+1804603682|0,o=(o<<7|o>>>25)+n|0,t+=(o&n|~o&c)+p[13]-40341101|0,t=(t<<12|t>>>20)+o|0,c+=(t&o|~t&n)+p[14]-1502002290|0,c=(c<<17|c>>>15)+t|0,n+=(c&t|~c&o)+p[15]+1236535329|0,n=(n<<22|n>>>10)+c|0,o+=(n&t|c&~t)+p[1]-165796510|0,o=(o<<5|o>>>27)+n|0,t+=(o&c|n&~c)+p[6]-1069501632|0,t=(t<<9|t>>>23)+o|0,c+=(t&n|o&~n)+p[11]+643717713|0,c=(c<<14|c>>>18)+t|0,n+=(c&o|t&~o)+p[0]-373897302|0,n=(n<<20|n>>>12)+c|0,o+=(n&t|c&~t)+p[5]-701558691|0,o=(o<<5|o>>>27)+n|0,t+=(o&c|n&~c)+p[10]+38016083|0,t=(t<<9|t>>>23)+o|0,c+=(t&n|o&~n)+p[15]-660478335|0,c=(c<<14|c>>>18)+t|0,n+=(c&o|t&~o)+p[4]-405537848|0,n=(n<<20|n>>>12)+c|0,o+=(n&t|c&~t)+p[9]+568446438|0,o=(o<<5|o>>>27)+n|0,t+=(o&c|n&~c)+p[14]-1019803690|0,t=(t<<9|t>>>23)+o|0,c+=(t&n|o&~n)+p[3]-187363961|0,c=(c<<14|c>>>18)+t|0,n+=(c&o|t&~o)+p[8]+1163531501|0,n=(n<<20|n>>>12)+c|0,o+=(n&t|c&~t)+p[13]-1444681467|0,o=(o<<5|o>>>27)+n|0,t+=(o&c|n&~c)+p[2]-51403784|0,t=(t<<9|t>>>23)+o|0,c+=(t&n|o&~n)+p[7]+1735328473|0,c=(c<<14|c>>>18)+t|0,n+=(c&o|t&~o)+p[12]-1926607734|0,n=(n<<20|n>>>12)+c|0,o+=(n^c^t)+p[5]-378558|0,o=(o<<4|o>>>28)+n|0,t+=(o^n^c)+p[8]-2022574463|0,t=(t<<11|t>>>21)+o|0,c+=(t^o^n)+p[11]+1839030562|0,c=(c<<16|c>>>16)+t|0,n+=(c^t^o)+p[14]-35309556|0,n=(n<<23|n>>>9)+c|0,o+=(n^c^t)+p[1]-1530992060|0,o=(o<<4|o>>>28)+n|0,t+=(o^n^c)+p[4]+1272893353|0,t=(t<<11|t>>>21)+o|0,c+=(t^o^n)+p[7]-155497632|0,c=(c<<16|c>>>16)+t|0,n+=(c^t^o)+p[10]-1094730640|0,n=(n<<23|n>>>9)+c|0,o+=(n^c^t)+p[13]+681279174|0,o=(o<<4|o>>>28)+n|0,t+=(o^n^c)+p[0]-358537222|0,t=(t<<11|t>>>21)+o|0,c+=(t^o^n)+p[3]-722521979|0,c=(c<<16|c>>>16)+t|0,n+=(c^t^o)+p[6]+76029189|0,n=(n<<23|n>>>9)+c|0,o+=(n^c^t)+p[9]-640364487|0,o=(o<<4|o>>>28)+n|0,t+=(o^n^c)+p[12]-421815835|0,t=(t<<11|t>>>21)+o|0,c+=(t^o^n)+p[15]+530742520|0,c=(c<<16|c>>>16)+t|0,n+=(c^t^o)+p[2]-995338651|0,n=(n<<23|n>>>9)+c|0,o+=(c^(n|~t))+p[0]-198630844|0,o=(o<<6|o>>>26)+n|0,t+=(n^(o|~c))+p[7]+1126891415|0,t=(t<<10|t>>>22)+o|0,c+=(o^(t|~n))+p[14]-1416354905|0,c=(c<<15|c>>>17)+t|0,n+=(t^(c|~o))+p[5]-57434055|0,n=(n<<21|n>>>11)+c|0,o+=(c^(n|~t))+p[12]+1700485571|0,o=(o<<6|o>>>26)+n|0,t+=(n^(o|~c))+p[3]-1894986606|0,t=(t<<10|t>>>22)+o|0,c+=(o^(t|~n))+p[10]-1051523|0,c=(c<<15|c>>>17)+t|0,n+=(t^(c|~o))+p[1]-2054922799|0,n=(n<<21|n>>>11)+c|0,o+=(c^(n|~t))+p[8]+1873313359|0,o=(o<<6|o>>>26)+n|0,t+=(n^(o|~c))+p[15]-30611744|0,t=(t<<10|t>>>22)+o|0,c+=(o^(t|~n))+p[6]-1560198380|0,c=(c<<15|c>>>17)+t|0,n+=(t^(c|~o))+p[13]+1309151649|0,n=(n<<21|n>>>11)+c|0,o+=(c^(n|~t))+p[4]-145523070|0,o=(o<<6|o>>>26)+n|0,t+=(n^(o|~c))+p[11]-1120210379|0,t=(t<<10|t>>>22)+o|0,c+=(o^(t|~n))+p[2]+718787259|0,c=(c<<15|c>>>17)+t|0,n+=(t^(c|~o))+p[9]-343485551|0,n=(n<<21|n>>>11)+c|0,m[0]=o+m[0]|0,m[1]=n+m[1]|0,m[2]=c+m[2]|0,m[3]=t+m[3]|0}function u(m){var p=[],o;for(o=0;o<64;o+=4)p[o>>2]=m.charCodeAt(o)+(m.charCodeAt(o+1)<<8)+(m.charCodeAt(o+2)<<16)+(m.charCodeAt(o+3)<<24);return p}function l(m){var p=[],o;for(o=0;o<64;o+=4)p[o>>2]=m[o]+(m[o+1]<<8)+(m[o+2]<<16)+(m[o+3]<<24);return p}function d(m){var p=m.length,o=[1732584193,-271733879,-1732584194,271733878],n,c,t,j,E,R;for(n=64;n<=p;n+=64)r(o,u(m.substring(n-64,n)));for(m=m.substring(n-64),c=m.length,t=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],n=0;n<c;n+=1)t[n>>2]|=m.charCodeAt(n)<<(n%4<<3);if(t[n>>2]|=128<<(n%4<<3),n>55)for(r(o,t),n=0;n<16;n+=1)t[n]=0;return j=p*8,j=j.toString(16).match(/(.*?)(.{0,8})$/),E=parseInt(j[2],16),R=parseInt(j[1],16)||0,t[14]=E,t[15]=R,r(o,t),o}function v(m){var p=m.length,o=[1732584193,-271733879,-1732584194,271733878],n,c,t,j,E,R;for(n=64;n<=p;n+=64)r(o,l(m.subarray(n-64,n)));for(m=n-64<p?m.subarray(n-64):new Uint8Array(0),c=m.length,t=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],n=0;n<c;n+=1)t[n>>2]|=m[n]<<(n%4<<3);if(t[n>>2]|=128<<(n%4<<3),n>55)for(r(o,t),n=0;n<16;n+=1)t[n]=0;return j=p*8,j=j.toString(16).match(/(.*?)(.{0,8})$/),E=parseInt(j[2],16),R=parseInt(j[1],16)||0,t[14]=E,t[15]=R,r(o,t),o}function y(m){var p="",o;for(o=0;o<4;o+=1)p+=a[m>>o*8+4&15]+a[m>>o*8&15];return p}function b(m){var p;for(p=0;p<m.length;p+=1)m[p]=y(m[p]);return m.join("")}b(d("hello"))!=="5d41402abc4b2a76b9719d911017c592"&&(e=function(m,p){var o=(m&65535)+(p&65535),n=(m>>16)+(p>>16)+(o>>16);return n<<16|o&65535}),typeof ArrayBuffer<"u"&&!ArrayBuffer.prototype.slice&&(function(){function m(p,o){return p=p|0||0,p<0?Math.max(p+o,0):Math.min(p,o)}ArrayBuffer.prototype.slice=function(p,o){var n=this.byteLength,c=m(p,n),t=n,j,E,R,_e;return o!==i&&(t=m(o,n)),c>t?new ArrayBuffer(0):(j=t-c,E=new ArrayBuffer(j),R=new Uint8Array(E),_e=new Uint8Array(this,c,j),R.set(_e),E)}})();function x(m){return/[\u0080-\uFFFF]/.test(m)&&(m=unescape(encodeURIComponent(m))),m}function A(m,p){var o=m.length,n=new ArrayBuffer(o),c=new Uint8Array(n),t;for(t=0;t<o;t+=1)c[t]=m.charCodeAt(t);return p?c:n}function S(m){return String.fromCharCode.apply(null,new Uint8Array(m))}function F(m,p,o){var n=new Uint8Array(m.byteLength+p.byteLength);return n.set(new Uint8Array(m)),n.set(new Uint8Array(p),m.byteLength),o?n:n.buffer}function X(m){var p=[],o=m.length,n;for(n=0;n<o-1;n+=2)p.push(parseInt(m.substr(n,2),16));return String.fromCharCode.apply(String,p)}function h(){this.reset()}return h.prototype.append=function(m){return this.appendBinary(x(m)),this},h.prototype.appendBinary=function(m){this._buff+=m,this._length+=m.length;var p=this._buff.length,o;for(o=64;o<=p;o+=64)r(this._hash,u(this._buff.substring(o-64,o)));return this._buff=this._buff.substring(o-64),this},h.prototype.end=function(m){var p=this._buff,o=p.length,n,c=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t;for(n=0;n<o;n+=1)c[n>>2]|=p.charCodeAt(n)<<(n%4<<3);return this._finish(c,o),t=b(this._hash),m&&(t=X(t)),this.reset(),t},h.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},h.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},h.prototype.setState=function(m){return this._buff=m.buff,this._length=m.length,this._hash=m.hash,this},h.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},h.prototype._finish=function(m,p){var o=p,n,c,t;if(m[o>>2]|=128<<(o%4<<3),o>55)for(r(this._hash,m),o=0;o<16;o+=1)m[o]=0;n=this._length*8,n=n.toString(16).match(/(.*?)(.{0,8})$/),c=parseInt(n[2],16),t=parseInt(n[1],16)||0,m[14]=c,m[15]=t,r(this._hash,m)},h.hash=function(m,p){return h.hashBinary(x(m),p)},h.hashBinary=function(m,p){var o=d(m),n=b(o);return p?X(n):n},h.ArrayBuffer=function(){this.reset()},h.ArrayBuffer.prototype.append=function(m){var p=F(this._buff.buffer,m,!0),o=p.length,n;for(this._length+=m.byteLength,n=64;n<=o;n+=64)r(this._hash,l(p.subarray(n-64,n)));return this._buff=n-64<o?new Uint8Array(p.buffer.slice(n-64)):new Uint8Array(0),this},h.ArrayBuffer.prototype.end=function(m){var p=this._buff,o=p.length,n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],c,t;for(c=0;c<o;c+=1)n[c>>2]|=p[c]<<(c%4<<3);return this._finish(n,o),t=b(this._hash),m&&(t=X(t)),this.reset(),t},h.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},h.ArrayBuffer.prototype.getState=function(){var m=h.prototype.getState.call(this);return m.buff=S(m.buff),m},h.ArrayBuffer.prototype.setState=function(m){return m.buff=A(m.buff,!0),h.prototype.setState.call(this,m)},h.ArrayBuffer.prototype.destroy=h.prototype.destroy,h.ArrayBuffer.prototype._finish=h.prototype._finish,h.ArrayBuffer.hash=function(m,p){var o=v(new Uint8Array(m)),n=b(o);return p?X(n):n},h})});var Ae=$((Hi,ga)=>{"use strict";ga.exports={}});async function li(i){let e=(await Promise.resolve().then(()=>Q(ha(),1))).default;return new Promise((a,s)=>{let u=Math.ceil(i.size/2097152),l=0,d=new e.ArrayBuffer,v=new FileReader,y=()=>{let b=l*2097152,x=Math.min(b+2097152,i.size);v.readAsArrayBuffer(i.slice(b,x))};v.onload=b=>{let x=b.target?.result;if(!x){s(f.business("Failed to read file chunk"));return}d.append(x),l++,l<u?y():a({md5:d.end()})},v.onerror=()=>{s(f.business("Failed to calculate MD5: FileReader error"))},y()})}async function ui(i){let e=await Promise.resolve().then(()=>Q(Ae(),1));if(Buffer.isBuffer(i)){let s=e.createHash("md5");return s.update(i),{md5:s.digest("hex")}}let a=await Promise.resolve().then(()=>Q(Ae(),1));return new Promise((s,r)=>{let u=e.createHash("md5"),l=a.createReadStream(i);l.on("error",d=>r(f.business(`Failed to read file for MD5: ${d.message}`))),l.on("data",d=>u.update(d)),l.on("end",()=>s({md5:u.digest("hex")}))})}async function pe(i){let e=M();if(e==="browser"){if(!(i instanceof Blob))throw f.business("Invalid input for browser MD5 calculation: Expected Blob or File.");return li(i)}if(e==="node"){if(!(Buffer.isBuffer(i)||typeof i=="string"))throw f.business("Invalid input for Node.js MD5 calculation: Expected Buffer or file path string.");return ui(i)}throw f.business("Unknown or unsupported execution environment for MD5 calculation.")}var le=T(()=>{"use strict";K();P()});function Aa(i){return vi.test(i)}var xi,vi,Sa=T(()=>{"use strict";xi=["^npm-debug\\.log$","^\\..*\\.swp$","^\\.DS_Store$","^\\.AppleDouble$","^\\.LSOverride$","^Icon\\r$","^\\._.*","^\\.Spotlight-V100(?:$|\\/)","\\.Trashes","^__MACOSX$","~$","^Thumbs\\.db$","^ehthumbs\\.db$","^[Dd]esktop\\.ini$","@eaDir$"],vi=new RegExp(xi.join("|"))});function za(i){return!i||i.length===0?[]:i.filter(e=>{if(!e)return!1;let a=e.replace(/\\/g,"/").split("/").filter(Boolean);if(a.length===0)return!0;let s=a[a.length-1];if(Aa(s))return!1;let r=a.slice(0,-1);for(let u of r)if(fi.some(l=>u.toLowerCase()===l.toLowerCase()))return!1;return!0})}var fi,Ce=T(()=>{"use strict";Sa();fi=["__MACOSX",".Trashes",".fseventsd",".Spotlight-V100"]});function me(i){return i.replace(/\\/g,"/").replace(/\/+/g,"/").replace(/^\/+/,"")}var Ca=T(()=>{"use strict"});function Fa(i,e={}){if(e.flatten===!1)return i.map(s=>({path:me(s),name:Fe(s)}));let a=bi(i);return i.map(s=>{let r=me(s);if(a){let u=a.endsWith("/")?a:`${a}/`;r.startsWith(u)&&(r=r.substring(u.length))}return r||(r=Fe(s)),{path:r,name:Fe(s)}})}function bi(i){if(!i.length)return"";let a=i.map(u=>me(u)).map(u=>u.split("/")),s=[],r=Math.min(...a.map(u=>u.length));for(let u=0;u<r-1;u++){let l=a[0][u];if(a.every(d=>d[u]===l))s.push(l);else break}return s.join("/")}function Fe(i){return i.split(/[/\\]/).pop()||i}var Ee=T(()=>{"use strict";Ca()});var Ta={};xe(Ta,{processFilesForBrowser:()=>Ea});async function Ea(i,e={}){let{getENV:a}=await Promise.resolve().then(()=>(K(),Qe));if(a()!=="browser")throw f.business("processFilesForBrowser can only be called in a browser environment.");let s=Array.isArray(i)?i:Array.from(i),r=s.map(x=>x.webkitRelativePath||x.name),u=Fa(r,{flatten:e.pathDetect!==!1}),l=[];for(let x=0;x<s.length;x++){let A=s[x],S=u[x].path;if(S.includes("..")||S.includes("\0"))throw f.business(`Security error: Unsafe file path "${S}" for file: ${A.name}`);l.push({file:A,relativePath:S})}let d=l.map(x=>x.relativePath),v=za(d),y=new Set(v),b=[];for(let x of l){if(!y.has(x.relativePath))continue;let{md5:A}=await pe(x.file);b.push({content:x.file,path:x.relativePath,size:x.file.size,md5:A})}return b}var Te=T(()=>{"use strict";le();P();Ce();Ee()});var ce=Q(Ve(),1);P();var ie=class{constructor(){this.handlers=new Map}on(e,a){this.handlers.has(e)||this.handlers.set(e,new Set),this.handlers.get(e).add(a)}off(e,a){let s=this.handlers.get(e);s&&(s.delete(a),s.size===0&&this.handlers.delete(e))}emit(e,...a){let s=this.handlers.get(e);if(!s)return;let r=Array.from(s);for(let u of r)try{u(...a)}catch(l){s.delete(u),e!=="error"&&setTimeout(()=>{l instanceof Error?this.emit("error",l,String(e)):this.emit("error",new Error(String(l)),String(e))},0)}}transfer(e){this.handlers.forEach((a,s)=>{a.forEach(r=>{e.on(s,r)})})}clear(){this.handlers.clear()}};K();var te="/deployments",da="/ping",z="/aliases",ci="/config",ri="/account",pi="/spa-check",re=class extends ie{constructor(e){super(),this.apiUrl=e.apiUrl||ae,this.apiKey=e.apiKey??"",this.deployToken=e.deployToken??""}transferEventsTo(e){this.transfer(e)}async request(e,a={},s){let r=this.getAuthHeaders(a.headers),u={...a,headers:r,credentials:this.needsCredentials(r)?"include":void 0};this.emit("request",e,u);try{let l=await fetch(e,u);l.ok||await this.handleResponseError(l,s);let d=this.safeClone(l),v=this.safeClone(l);return this.emit("response",d,e),await this.parseResponse(v)}catch(l){throw this.emit("error",l,e),this.handleFetchError(l,s),l}}getAuthHeaders(e={}){let a={...e};return this.deployToken?a.Authorization=`Bearer ${this.deployToken}`:this.apiKey&&(a.Authorization=`Bearer ${this.apiKey}`),a}needsCredentials(e){return!this.apiKey&&!this.deployToken&&!e.Authorization}safeClone(e){try{return e.clone()}catch{return e}}async parseResponse(e){if(!(e.headers.get("Content-Length")==="0"||e.status===204))return await e.json()}async handleResponseError(e,a){let s={};try{e.headers.get("content-type")?.includes("application/json")?s=await e.json():s={message:await e.text()}}catch{s={message:"Failed to parse error response"}}let r=s.message||s.error||`${a} failed due to API error`;throw e.status===401?f.authentication(r):f.api(r,e.status,s.code,s)}handleFetchError(e,a){throw e.name==="AbortError"?f.cancelled(`${a} operation was cancelled.`):e instanceof TypeError&&e.message.includes("fetch")?f.network(`${a} failed due to network error: ${e.message}`,e):e instanceof f?e:f.business(`An unexpected error occurred during ${a}: ${e.message||"Unknown error"}`)}async ping(){return(await this.request(`${this.apiUrl}${da}`,{method:"GET"},"Ping"))?.success||!1}async getPingResponse(){return await this.request(`${this.apiUrl}${da}`,{method:"GET"},"Ping")}async getConfig(){return await this.request(`${this.apiUrl}${ci}`,{method:"GET"},"Config")}async deploy(e,a={}){this.validateFiles(e);let{requestBody:s,requestHeaders:r}=await this.prepareRequestPayload(e,a.tags),u={};a.deployToken?u={Authorization:`Bearer ${a.deployToken}`}:a.apiKey&&(u={Authorization:`Bearer ${a.apiKey}`});let l={method:"POST",body:s,headers:{...r,...u},signal:a.signal||null};return await this.request(`${a.apiUrl||this.apiUrl}${te}`,l,"Deploy")}async listDeployments(){return await this.request(`${this.apiUrl}${te}`,{method:"GET"},"List Deployments")}async getDeployment(e){return await this.request(`${this.apiUrl}${te}/${e}`,{method:"GET"},"Get Deployment")}async removeDeployment(e){await this.request(`${this.apiUrl}${te}/${e}`,{method:"DELETE"},"Remove Deployment")}async setAlias(e,a,s){let r={deployment:a};s&&s.length>0&&(r.tags=s);let u={method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)},l=this.getAuthHeaders(u.headers),d={...u,headers:l,credentials:this.needsCredentials(l)?"include":void 0};this.emit("request",`${this.apiUrl}${z}/${encodeURIComponent(e)}`,d);try{let v=await fetch(`${this.apiUrl}${z}/${encodeURIComponent(e)}`,d);v.ok||await this.handleResponseError(v,"Set Alias");let y=this.safeClone(v),b=this.safeClone(v);return this.emit("response",y,`${this.apiUrl}${z}/${encodeURIComponent(e)}`),{...await this.parseResponse(b),isCreate:v.status===201}}catch(v){throw this.emit("error",v,`${this.apiUrl}${z}/${encodeURIComponent(e)}`),this.handleFetchError(v,"Set Alias"),v}}async getAlias(e){return await this.request(`${this.apiUrl}${z}/${encodeURIComponent(e)}`,{method:"GET"},"Get Alias")}async listAliases(){return await this.request(`${this.apiUrl}${z}`,{method:"GET"},"List Aliases")}async removeAlias(e){await this.request(`${this.apiUrl}${z}/${encodeURIComponent(e)}`,{method:"DELETE"},"Remove Alias")}async confirmAlias(e){return await this.request(`${this.apiUrl}${z}/${encodeURIComponent(e)}/confirm`,{method:"POST"},"Confirm Alias")}async getAliasDns(e){return await this.request(`${this.apiUrl}${z}/${encodeURIComponent(e)}/dns`,{method:"GET"},"Get Alias DNS")}async getAliasRecords(e){return await this.request(`${this.apiUrl}${z}/${encodeURIComponent(e)}/records`,{method:"GET"},"Get Alias Records")}async getAliasShare(e){return await this.request(`${this.apiUrl}${z}/${encodeURIComponent(e)}/share`,{method:"GET"},"Get Alias Share")}async getAccount(){return await this.request(`${this.apiUrl}${ri}`,{method:"GET"},"Get Account")}async checkSPA(e){let a=e.find(l=>l.path==="index.html"||l.path==="/index.html");if(!a||a.size>100*1024)return!1;let s;if(typeof Buffer<"u"&&Buffer.isBuffer(a.content))s=a.content.toString("utf-8");else if(typeof Blob<"u"&&a.content instanceof Blob)s=await a.content.text();else if(typeof File<"u"&&a.content instanceof File)s=await a.content.text();else return!1;let r={files:e.map(l=>l.path),index:s};return(await this.request(`${this.apiUrl}${pi}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)},"SPA Check")).isSPA}validateFiles(e){if(!e.length)throw f.business("No files to deploy.");for(let a of e)if(!a.md5)throw f.file(`MD5 checksum missing for file: ${a.path}`,a.path)}async prepareRequestPayload(e,a){if(M()==="browser")return{requestBody:this.createBrowserBody(e,a),requestHeaders:{}};if(M()==="node"){let{body:s,headers:r}=await this.createNodeBody(e,a);return{requestBody:s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength),requestHeaders:r}}else throw f.business("Unknown or unsupported execution environment")}createBrowserBody(e,a){let s=new FormData,r=[];for(let u of e){if(!(u.content instanceof File||u.content instanceof Blob))throw f.file(`Unsupported file.content type for browser FormData: ${u.path}`,u.path);let l=this.getBrowserContentType(u.content instanceof File?u.content:u.path),d=new File([u.content],u.path,{type:l});s.append("files[]",d),r.push(u.md5)}return s.append("checksums",JSON.stringify(r)),a&&a.length>0&&s.append("tags",JSON.stringify(a)),s}async createNodeBody(e,a){let{FormData:s,File:r}=await import("formdata-node"),{FormDataEncoder:u}=await Promise.resolve().then(()=>(ma(),ua)),l=new s,d=[];for(let x of e){let A=ce.lookup(x.path)||"application/octet-stream",S;if(Buffer.isBuffer(x.content))S=new r([x.content],x.path,{type:A});else if(typeof Blob<"u"&&x.content instanceof Blob)S=new r([x.content],x.path,{type:A});else throw f.file(`Unsupported file.content type for Node.js FormData: ${x.path}`,x.path);let F=x.path.startsWith("/")?x.path:"/"+x.path;l.append("files[]",S,F),d.push(x.md5)}l.append("checksums",JSON.stringify(d)),a&&a.length>0&&l.append("tags",JSON.stringify(a));let v=new u(l),y=[];for await(let x of v.encode())y.push(Buffer.from(x));let b=Buffer.concat(y);return{body:b,headers:{"Content-Type":v.contentType,"Content-Length":Buffer.byteLength(b).toString()}}}getBrowserContentType(e){return typeof e=="string"?ce.lookup(e)||"application/octet-stream":ce.lookup(e.name)||e.type||"application/octet-stream"}};P();function xa(i={},e={}){let a={apiUrl:i.apiUrl||e.apiUrl||ae,apiKey:i.apiKey!==void 0?i.apiKey:e.apiKey,deployToken:i.deployToken!==void 0?i.deployToken:e.deployToken},s={apiUrl:a.apiUrl};return a.apiKey!==void 0&&(s.apiKey=a.apiKey),a.deployToken!==void 0&&(s.deployToken=a.deployToken),s}function va(i,e){let a={...i};return a.apiUrl===void 0&&e.apiUrl!==void 0&&(a.apiUrl=e.apiUrl),a.apiKey===void 0&&e.apiKey!==void 0&&(a.apiKey=e.apiKey),a.deployToken===void 0&&e.deployToken!==void 0&&(a.deployToken=e.deployToken),a.timeout===void 0&&e.timeout!==void 0&&(a.timeout=e.timeout),a.maxConcurrency===void 0&&e.maxConcurrency!==void 0&&(a.maxConcurrency=e.maxConcurrency),a.onProgress===void 0&&e.onProgress!==void 0&&(a.onProgress=e.onProgress),a.onProgressStats===void 0&&e.onProgressStats!==void 0&&(a.onProgressStats=e.onProgressStats),a}P();le();async function mi(){let e=JSON.stringify({rewrites:[{source:"/(.*)",destination:"/index.html"}]},null,2),a;typeof Buffer<"u"?a=Buffer.from(e,"utf-8"):a=new Blob([e],{type:"application/json"});let{md5:s}=await pe(a);return{path:ge,content:a,size:e.length,md5:s}}async function ya(i,e,a){if(a.spaDetect===!1||i.some(s=>s.path===ge))return i;try{if(await e.checkSPA(i)){let r=await mi();return[...i,r]}}catch{}return i}function wa(i,e,a,s){return{create:async(r,u={})=>{a&&await a();let l=e?va(u,e):u,d=i();if(!s)throw new Error("processInput function is not provided.");let v=await s(r,l);return v=await ya(v,d,l),await d.deploy(v,l)},list:async()=>(a&&await a(),i().listDeployments()),remove:async r=>{a&&await a(),await i().removeDeployment(r)},get:async r=>(a&&await a(),i().getDeployment(r))}}function ka(i,e){return{set:async(a,s,r)=>(e&&await e(),i().setAlias(a,s,r)),get:async a=>(e&&await e(),i().getAlias(a)),list:async()=>(e&&await e(),i().listAliases()),remove:async a=>{e&&await e(),await i().removeAlias(a)},confirm:async a=>(e&&await e(),i().confirmAlias(a)),dns:async a=>(e&&await e(),i().getAliasDns(a)),records:async a=>(e&&await e(),i().getAliasRecords(a)),share:async a=>(e&&await e(),i().getAliasShare(a))}}function ja(i,e){return{get:async()=>(e&&await e(),i().getAccount())}}var ue=class{constructor(e={}){this.initPromise=null;this.clientOptions=e;let a=this.resolveInitialConfig(e);this.http=new re({...e,...a});let s=()=>this.ensureInitialized(),r=()=>this.http;this._deployments=wa(r,this.clientOptions,s,(u,l)=>this.processInput(u,l)),this._aliases=ka(r,s),this._account=ja(r,s)}async ensureInitialized(){return this.initPromise||(this.initPromise=this.loadFullConfig()),this.initPromise}async ping(){return await this.ensureInitialized(),this.http.ping()}async deploy(e,a){return this.deployments.create(e,a)}async whoami(){return this.account.get()}get deployments(){return this._deployments}get aliases(){return this._aliases}get account(){return this._account}on(e,a){this.http.on(e,a)}off(e,a){this.http.off(e,a)}replaceHttpClient(e){if(this.http?.transferEventsTo)try{this.http.transferEventsTo(e)}catch(a){console.warn("Event transfer failed during client replacement:",a)}this.http=e}};P();var Se=null;function ze(i){Se=i}function di(){if(Se===null)throw f.config("Platform configuration not initialized. The SDK must fetch configuration from the API before performing operations.");return Se}P();le();function cn(i,e,a,s=!0){let r=i===1?e:a;return s?`${i} ${r}`:r}Ce();Ee();K();P();async function hi(i){return{}}Te();var de,Pa,Pe=class extends ue{constructor(a={}){super(a);Re(this,de)}resolveInitialConfig(a){return xa(a,{})}async loadFullConfig(){try{let a=await this.http.getConfig();ze(a)}catch(a){throw this.initPromise=null,a}}async processInput(a,s){if(!De(this,de,Pa).call(this,a))throw f.business("Invalid input type for browser environment. Expected File[], FileList, or HTMLInputElement.");let r=a instanceof HTMLInputElement?Array.from(a.files):a,{processFilesForBrowser:u}=await Promise.resolve().then(()=>(Te(),Ta));return u(r,s)}};de=new WeakSet,Pa=function(a){return Array.isArray(a)?a.length===0||a.every(s=>s instanceof File):a&&typeof a=="object"&&"length"in a&&typeof a.length=="number"?"item"in a||a.constructor?.name==="FileList":!!(a&&typeof a=="object"&&"files"in a)};var $n=Pe;export{be as API_KEY_HEX_LENGTH,I as API_KEY_PREFIX,Xe as API_KEY_TOTAL_LENGTH,Ci as AccountPlan,zi as AliasStatus,re as ApiHttp,Fi as AuthMethod,ae as DEFAULT_API,ge as DEPLOYMENT_CONFIG_FILENAME,he as DEPLOY_TOKEN_HEX_LENGTH,N as DEPLOY_TOKEN_PREFIX,Ze as DEPLOY_TOKEN_TOTAL_LENGTH,Si as DeploymentStatus,g as ErrorType,fi as JUNK_DIRECTORIES,Pe as Ship,f as ShipError,Ya as ShipErrorType,Va as __setTestEnvironment,pe as calculateMD5,ja as createAccountResource,ka as createAliasResource,wa as createDeploymentResource,$n as default,za as filterJunk,Ri as generateAliasUrl,qi as generateDeploymentUrl,di as getCurrentConfig,M as getENV,hi as loadConfig,va as mergeDeployOptions,Fa as optimizeDeployPaths,cn as pluralize,Ea as processFilesForBrowser,xa as resolveConfig,ze as setPlatformConfig,Ei as validateApiKey,Pi as validateApiUrl,Ti as validateDeployToken,_i as validateSubdomain};
5
+ `),_(this,G),_(this,oe),_(this,W,"-".repeat(2)),_(this,L,new TextEncoder),_(this,J),_(this,Y),_(this,se),!ra(i))throw new TypeError("Expected first argument to be a FormData instance.");let s;if(oa(e)?a=e:s=e,s||(s=`form-data-encoder-${Za()}`),typeof s!="string")throw new TypeError("Expected boundary argument to be a string.");if(a&&!oa(a))throw new TypeError("Expected options argument to be an object.");H(this,Y,Array.from(i.entries())),H(this,se,{...si,...a}),H(this,G,w(this,L).encode(w(this,D))),H(this,oe,w(this,G).byteLength),this.boundary=s,this.contentType=`multipart/form-data; boundary=${this.boundary}`,H(this,J,w(this,L).encode(`${w(this,W)}${this.boundary}${w(this,W)}${w(this,D).repeat(2)}`));let r={"Content-Type":this.contentType},u=we(this,V,la).call(this);u&&(this.contentLength=u,r["Content-Length"]=u),this.headers=oi(Object.freeze(r)),Object.defineProperties(this,{boundary:ne,contentType:ne,contentLength:ne,headers:ne})}*values(){for(let[i,e]of w(this,Y)){let a=B(e)?e:w(this,L).encode(pa(e));yield we(this,V,je).call(this,i,a),yield a,yield w(this,G)}yield w(this,J)}async*encode(){for(let i of this.values())B(i)?yield*ii(i.stream()):yield*ca(i)}[Symbol.iterator](){return this.values()}[Symbol.asyncIterator](){return this.encode()}};D=new WeakMap;G=new WeakMap;oe=new WeakMap;W=new WeakMap;L=new WeakMap;J=new WeakMap;Y=new WeakMap;se=new WeakMap;V=new WeakSet;je=function(i,e){let a="";if(a+=`${w(this,W)}${this.boundary}${w(this,D)}`,a+=`Content-Disposition: form-data; name="${ia(i)}"`,B(e)&&(a+=`; filename="${ia(e.name)}"${w(this,D)}`,a+=`Content-Type: ${e.type||"application/octet-stream"}`),w(this,se).enableAdditionalHeaders===!0){let s=B(e)?e.size:e.byteLength;s!=null&&!isNaN(s)&&(a+=`${w(this,D)}Content-Length: ${s}`)}return w(this,L).encode(`${a}${w(this,D).repeat(2)}`)};la=function(){let i=0;for(let[e,a]of w(this,Y)){let s=B(a)?a:w(this,L).encode(pa(a)),r=B(s)?s.size:s.byteLength;if(r==null||isNaN(r))return;i+=we(this,V,je).call(this,e,s).byteLength,i+=r,i+=w(this,oe)}return String(i+w(this,J).byteLength)}});var ha=$((fa,ba)=>{"use strict";(function(i){if(typeof fa=="object")ba.exports=i();else if(typeof define=="function"&&define.amd)define(i);else{var e;try{e=window}catch{e=self}e.SparkMD5=i()}})(function(i){"use strict";var e=function(m,p){return m+p&4294967295},a=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function s(m,p,o,n,c,t){return p=e(e(p,m),e(n,t)),e(p<<c|p>>>32-c,o)}function r(m,p){var o=m[0],n=m[1],c=m[2],t=m[3];o+=(n&c|~n&t)+p[0]-680876936|0,o=(o<<7|o>>>25)+n|0,t+=(o&n|~o&c)+p[1]-389564586|0,t=(t<<12|t>>>20)+o|0,c+=(t&o|~t&n)+p[2]+606105819|0,c=(c<<17|c>>>15)+t|0,n+=(c&t|~c&o)+p[3]-1044525330|0,n=(n<<22|n>>>10)+c|0,o+=(n&c|~n&t)+p[4]-176418897|0,o=(o<<7|o>>>25)+n|0,t+=(o&n|~o&c)+p[5]+1200080426|0,t=(t<<12|t>>>20)+o|0,c+=(t&o|~t&n)+p[6]-1473231341|0,c=(c<<17|c>>>15)+t|0,n+=(c&t|~c&o)+p[7]-45705983|0,n=(n<<22|n>>>10)+c|0,o+=(n&c|~n&t)+p[8]+1770035416|0,o=(o<<7|o>>>25)+n|0,t+=(o&n|~o&c)+p[9]-1958414417|0,t=(t<<12|t>>>20)+o|0,c+=(t&o|~t&n)+p[10]-42063|0,c=(c<<17|c>>>15)+t|0,n+=(c&t|~c&o)+p[11]-1990404162|0,n=(n<<22|n>>>10)+c|0,o+=(n&c|~n&t)+p[12]+1804603682|0,o=(o<<7|o>>>25)+n|0,t+=(o&n|~o&c)+p[13]-40341101|0,t=(t<<12|t>>>20)+o|0,c+=(t&o|~t&n)+p[14]-1502002290|0,c=(c<<17|c>>>15)+t|0,n+=(c&t|~c&o)+p[15]+1236535329|0,n=(n<<22|n>>>10)+c|0,o+=(n&t|c&~t)+p[1]-165796510|0,o=(o<<5|o>>>27)+n|0,t+=(o&c|n&~c)+p[6]-1069501632|0,t=(t<<9|t>>>23)+o|0,c+=(t&n|o&~n)+p[11]+643717713|0,c=(c<<14|c>>>18)+t|0,n+=(c&o|t&~o)+p[0]-373897302|0,n=(n<<20|n>>>12)+c|0,o+=(n&t|c&~t)+p[5]-701558691|0,o=(o<<5|o>>>27)+n|0,t+=(o&c|n&~c)+p[10]+38016083|0,t=(t<<9|t>>>23)+o|0,c+=(t&n|o&~n)+p[15]-660478335|0,c=(c<<14|c>>>18)+t|0,n+=(c&o|t&~o)+p[4]-405537848|0,n=(n<<20|n>>>12)+c|0,o+=(n&t|c&~t)+p[9]+568446438|0,o=(o<<5|o>>>27)+n|0,t+=(o&c|n&~c)+p[14]-1019803690|0,t=(t<<9|t>>>23)+o|0,c+=(t&n|o&~n)+p[3]-187363961|0,c=(c<<14|c>>>18)+t|0,n+=(c&o|t&~o)+p[8]+1163531501|0,n=(n<<20|n>>>12)+c|0,o+=(n&t|c&~t)+p[13]-1444681467|0,o=(o<<5|o>>>27)+n|0,t+=(o&c|n&~c)+p[2]-51403784|0,t=(t<<9|t>>>23)+o|0,c+=(t&n|o&~n)+p[7]+1735328473|0,c=(c<<14|c>>>18)+t|0,n+=(c&o|t&~o)+p[12]-1926607734|0,n=(n<<20|n>>>12)+c|0,o+=(n^c^t)+p[5]-378558|0,o=(o<<4|o>>>28)+n|0,t+=(o^n^c)+p[8]-2022574463|0,t=(t<<11|t>>>21)+o|0,c+=(t^o^n)+p[11]+1839030562|0,c=(c<<16|c>>>16)+t|0,n+=(c^t^o)+p[14]-35309556|0,n=(n<<23|n>>>9)+c|0,o+=(n^c^t)+p[1]-1530992060|0,o=(o<<4|o>>>28)+n|0,t+=(o^n^c)+p[4]+1272893353|0,t=(t<<11|t>>>21)+o|0,c+=(t^o^n)+p[7]-155497632|0,c=(c<<16|c>>>16)+t|0,n+=(c^t^o)+p[10]-1094730640|0,n=(n<<23|n>>>9)+c|0,o+=(n^c^t)+p[13]+681279174|0,o=(o<<4|o>>>28)+n|0,t+=(o^n^c)+p[0]-358537222|0,t=(t<<11|t>>>21)+o|0,c+=(t^o^n)+p[3]-722521979|0,c=(c<<16|c>>>16)+t|0,n+=(c^t^o)+p[6]+76029189|0,n=(n<<23|n>>>9)+c|0,o+=(n^c^t)+p[9]-640364487|0,o=(o<<4|o>>>28)+n|0,t+=(o^n^c)+p[12]-421815835|0,t=(t<<11|t>>>21)+o|0,c+=(t^o^n)+p[15]+530742520|0,c=(c<<16|c>>>16)+t|0,n+=(c^t^o)+p[2]-995338651|0,n=(n<<23|n>>>9)+c|0,o+=(c^(n|~t))+p[0]-198630844|0,o=(o<<6|o>>>26)+n|0,t+=(n^(o|~c))+p[7]+1126891415|0,t=(t<<10|t>>>22)+o|0,c+=(o^(t|~n))+p[14]-1416354905|0,c=(c<<15|c>>>17)+t|0,n+=(t^(c|~o))+p[5]-57434055|0,n=(n<<21|n>>>11)+c|0,o+=(c^(n|~t))+p[12]+1700485571|0,o=(o<<6|o>>>26)+n|0,t+=(n^(o|~c))+p[3]-1894986606|0,t=(t<<10|t>>>22)+o|0,c+=(o^(t|~n))+p[10]-1051523|0,c=(c<<15|c>>>17)+t|0,n+=(t^(c|~o))+p[1]-2054922799|0,n=(n<<21|n>>>11)+c|0,o+=(c^(n|~t))+p[8]+1873313359|0,o=(o<<6|o>>>26)+n|0,t+=(n^(o|~c))+p[15]-30611744|0,t=(t<<10|t>>>22)+o|0,c+=(o^(t|~n))+p[6]-1560198380|0,c=(c<<15|c>>>17)+t|0,n+=(t^(c|~o))+p[13]+1309151649|0,n=(n<<21|n>>>11)+c|0,o+=(c^(n|~t))+p[4]-145523070|0,o=(o<<6|o>>>26)+n|0,t+=(n^(o|~c))+p[11]-1120210379|0,t=(t<<10|t>>>22)+o|0,c+=(o^(t|~n))+p[2]+718787259|0,c=(c<<15|c>>>17)+t|0,n+=(t^(c|~o))+p[9]-343485551|0,n=(n<<21|n>>>11)+c|0,m[0]=o+m[0]|0,m[1]=n+m[1]|0,m[2]=c+m[2]|0,m[3]=t+m[3]|0}function u(m){var p=[],o;for(o=0;o<64;o+=4)p[o>>2]=m.charCodeAt(o)+(m.charCodeAt(o+1)<<8)+(m.charCodeAt(o+2)<<16)+(m.charCodeAt(o+3)<<24);return p}function l(m){var p=[],o;for(o=0;o<64;o+=4)p[o>>2]=m[o]+(m[o+1]<<8)+(m[o+2]<<16)+(m[o+3]<<24);return p}function d(m){var p=m.length,o=[1732584193,-271733879,-1732584194,271733878],n,c,t,j,E,R;for(n=64;n<=p;n+=64)r(o,u(m.substring(n-64,n)));for(m=m.substring(n-64),c=m.length,t=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],n=0;n<c;n+=1)t[n>>2]|=m.charCodeAt(n)<<(n%4<<3);if(t[n>>2]|=128<<(n%4<<3),n>55)for(r(o,t),n=0;n<16;n+=1)t[n]=0;return j=p*8,j=j.toString(16).match(/(.*?)(.{0,8})$/),E=parseInt(j[2],16),R=parseInt(j[1],16)||0,t[14]=E,t[15]=R,r(o,t),o}function v(m){var p=m.length,o=[1732584193,-271733879,-1732584194,271733878],n,c,t,j,E,R;for(n=64;n<=p;n+=64)r(o,l(m.subarray(n-64,n)));for(m=n-64<p?m.subarray(n-64):new Uint8Array(0),c=m.length,t=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],n=0;n<c;n+=1)t[n>>2]|=m[n]<<(n%4<<3);if(t[n>>2]|=128<<(n%4<<3),n>55)for(r(o,t),n=0;n<16;n+=1)t[n]=0;return j=p*8,j=j.toString(16).match(/(.*?)(.{0,8})$/),E=parseInt(j[2],16),R=parseInt(j[1],16)||0,t[14]=E,t[15]=R,r(o,t),o}function y(m){var p="",o;for(o=0;o<4;o+=1)p+=a[m>>o*8+4&15]+a[m>>o*8&15];return p}function b(m){var p;for(p=0;p<m.length;p+=1)m[p]=y(m[p]);return m.join("")}b(d("hello"))!=="5d41402abc4b2a76b9719d911017c592"&&(e=function(m,p){var o=(m&65535)+(p&65535),n=(m>>16)+(p>>16)+(o>>16);return n<<16|o&65535}),typeof ArrayBuffer<"u"&&!ArrayBuffer.prototype.slice&&(function(){function m(p,o){return p=p|0||0,p<0?Math.max(p+o,0):Math.min(p,o)}ArrayBuffer.prototype.slice=function(p,o){var n=this.byteLength,c=m(p,n),t=n,j,E,R,_e;return o!==i&&(t=m(o,n)),c>t?new ArrayBuffer(0):(j=t-c,E=new ArrayBuffer(j),R=new Uint8Array(E),_e=new Uint8Array(this,c,j),R.set(_e),E)}})();function x(m){return/[\u0080-\uFFFF]/.test(m)&&(m=unescape(encodeURIComponent(m))),m}function A(m,p){var o=m.length,n=new ArrayBuffer(o),c=new Uint8Array(n),t;for(t=0;t<o;t+=1)c[t]=m.charCodeAt(t);return p?c:n}function S(m){return String.fromCharCode.apply(null,new Uint8Array(m))}function F(m,p,o){var n=new Uint8Array(m.byteLength+p.byteLength);return n.set(new Uint8Array(m)),n.set(new Uint8Array(p),m.byteLength),o?n:n.buffer}function X(m){var p=[],o=m.length,n;for(n=0;n<o-1;n+=2)p.push(parseInt(m.substr(n,2),16));return String.fromCharCode.apply(String,p)}function h(){this.reset()}return h.prototype.append=function(m){return this.appendBinary(x(m)),this},h.prototype.appendBinary=function(m){this._buff+=m,this._length+=m.length;var p=this._buff.length,o;for(o=64;o<=p;o+=64)r(this._hash,u(this._buff.substring(o-64,o)));return this._buff=this._buff.substring(o-64),this},h.prototype.end=function(m){var p=this._buff,o=p.length,n,c=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t;for(n=0;n<o;n+=1)c[n>>2]|=p.charCodeAt(n)<<(n%4<<3);return this._finish(c,o),t=b(this._hash),m&&(t=X(t)),this.reset(),t},h.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},h.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},h.prototype.setState=function(m){return this._buff=m.buff,this._length=m.length,this._hash=m.hash,this},h.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},h.prototype._finish=function(m,p){var o=p,n,c,t;if(m[o>>2]|=128<<(o%4<<3),o>55)for(r(this._hash,m),o=0;o<16;o+=1)m[o]=0;n=this._length*8,n=n.toString(16).match(/(.*?)(.{0,8})$/),c=parseInt(n[2],16),t=parseInt(n[1],16)||0,m[14]=c,m[15]=t,r(this._hash,m)},h.hash=function(m,p){return h.hashBinary(x(m),p)},h.hashBinary=function(m,p){var o=d(m),n=b(o);return p?X(n):n},h.ArrayBuffer=function(){this.reset()},h.ArrayBuffer.prototype.append=function(m){var p=F(this._buff.buffer,m,!0),o=p.length,n;for(this._length+=m.byteLength,n=64;n<=o;n+=64)r(this._hash,l(p.subarray(n-64,n)));return this._buff=n-64<o?new Uint8Array(p.buffer.slice(n-64)):new Uint8Array(0),this},h.ArrayBuffer.prototype.end=function(m){var p=this._buff,o=p.length,n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],c,t;for(c=0;c<o;c+=1)n[c>>2]|=p[c]<<(c%4<<3);return this._finish(n,o),t=b(this._hash),m&&(t=X(t)),this.reset(),t},h.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},h.ArrayBuffer.prototype.getState=function(){var m=h.prototype.getState.call(this);return m.buff=S(m.buff),m},h.ArrayBuffer.prototype.setState=function(m){return m.buff=A(m.buff,!0),h.prototype.setState.call(this,m)},h.ArrayBuffer.prototype.destroy=h.prototype.destroy,h.ArrayBuffer.prototype._finish=h.prototype._finish,h.ArrayBuffer.hash=function(m,p){var o=v(new Uint8Array(m)),n=b(o);return p?X(n):n},h})});var Ae=$((Hi,ga)=>{"use strict";ga.exports={}});async function li(i){let e=(await Promise.resolve().then(()=>Q(ha(),1))).default;return new Promise((a,s)=>{let u=Math.ceil(i.size/2097152),l=0,d=new e.ArrayBuffer,v=new FileReader,y=()=>{let b=l*2097152,x=Math.min(b+2097152,i.size);v.readAsArrayBuffer(i.slice(b,x))};v.onload=b=>{let x=b.target?.result;if(!x){s(f.business("Failed to read file chunk"));return}d.append(x),l++,l<u?y():a({md5:d.end()})},v.onerror=()=>{s(f.business("Failed to calculate MD5: FileReader error"))},y()})}async function ui(i){let e=await Promise.resolve().then(()=>Q(Ae(),1));if(Buffer.isBuffer(i)){let s=e.createHash("md5");return s.update(i),{md5:s.digest("hex")}}let a=await Promise.resolve().then(()=>Q(Ae(),1));return new Promise((s,r)=>{let u=e.createHash("md5"),l=a.createReadStream(i);l.on("error",d=>r(f.business(`Failed to read file for MD5: ${d.message}`))),l.on("data",d=>u.update(d)),l.on("end",()=>s({md5:u.digest("hex")}))})}async function pe(i){let e=M();if(e==="browser"){if(!(i instanceof Blob))throw f.business("Invalid input for browser MD5 calculation: Expected Blob or File.");return li(i)}if(e==="node"){if(!(Buffer.isBuffer(i)||typeof i=="string"))throw f.business("Invalid input for Node.js MD5 calculation: Expected Buffer or file path string.");return ui(i)}throw f.business("Unknown or unsupported execution environment for MD5 calculation.")}var le=T(()=>{"use strict";K();P()});function Aa(i){return vi.test(i)}var xi,vi,Sa=T(()=>{"use strict";xi=["^npm-debug\\.log$","^\\..*\\.swp$","^\\.DS_Store$","^\\.AppleDouble$","^\\.LSOverride$","^Icon\\r$","^\\._.*","^\\.Spotlight-V100(?:$|\\/)","\\.Trashes","^__MACOSX$","~$","^Thumbs\\.db$","^ehthumbs\\.db$","^[Dd]esktop\\.ini$","@eaDir$"],vi=new RegExp(xi.join("|"))});function za(i){return!i||i.length===0?[]:i.filter(e=>{if(!e)return!1;let a=e.replace(/\\/g,"/").split("/").filter(Boolean);if(a.length===0)return!0;let s=a[a.length-1];if(Aa(s))return!1;let r=a.slice(0,-1);for(let u of r)if(fi.some(l=>u.toLowerCase()===l.toLowerCase()))return!1;return!0})}var fi,Ce=T(()=>{"use strict";Sa();fi=["__MACOSX",".Trashes",".fseventsd",".Spotlight-V100"]});function me(i){return i.replace(/\\/g,"/").replace(/\/+/g,"/").replace(/^\/+/,"")}var Ca=T(()=>{"use strict"});function Fa(i,e={}){if(e.flatten===!1)return i.map(s=>({path:me(s),name:Fe(s)}));let a=bi(i);return i.map(s=>{let r=me(s);if(a){let u=a.endsWith("/")?a:`${a}/`;r.startsWith(u)&&(r=r.substring(u.length))}return r||(r=Fe(s)),{path:r,name:Fe(s)}})}function bi(i){if(!i.length)return"";let a=i.map(u=>me(u)).map(u=>u.split("/")),s=[],r=Math.min(...a.map(u=>u.length));for(let u=0;u<r-1;u++){let l=a[0][u];if(a.every(d=>d[u]===l))s.push(l);else break}return s.join("/")}function Fe(i){return i.split(/[/\\]/).pop()||i}var Ee=T(()=>{"use strict";Ca()});var Ta={};xe(Ta,{processFilesForBrowser:()=>Ea});async function Ea(i,e={}){let{getENV:a}=await Promise.resolve().then(()=>(K(),Qe));if(a()!=="browser")throw f.business("processFilesForBrowser can only be called in a browser environment.");let s=Array.isArray(i)?i:Array.from(i),r=s.map(x=>x.webkitRelativePath||x.name),u=Fa(r,{flatten:e.pathDetect!==!1}),l=[];for(let x=0;x<s.length;x++){let A=s[x],S=u[x].path;if(S.includes("..")||S.includes("\0"))throw f.business(`Security error: Unsafe file path "${S}" for file: ${A.name}`);l.push({file:A,relativePath:S})}let d=l.map(x=>x.relativePath),v=za(d),y=new Set(v),b=[];for(let x of l){if(!y.has(x.relativePath))continue;let{md5:A}=await pe(x.file);b.push({content:x.file,path:x.relativePath,size:x.file.size,md5:A})}return b}var Te=T(()=>{"use strict";le();P();Ce();Ee()});var ce=Q(Ve(),1);P();var ie=class{constructor(){this.handlers=new Map}on(e,a){this.handlers.has(e)||this.handlers.set(e,new Set),this.handlers.get(e).add(a)}off(e,a){let s=this.handlers.get(e);s&&(s.delete(a),s.size===0&&this.handlers.delete(e))}emit(e,...a){let s=this.handlers.get(e);if(!s)return;let r=Array.from(s);for(let u of r)try{u(...a)}catch(l){s.delete(u),e!=="error"&&setTimeout(()=>{l instanceof Error?this.emit("error",l,String(e)):this.emit("error",new Error(String(l)),String(e))},0)}}transfer(e){this.handlers.forEach((a,s)=>{a.forEach(r=>{e.on(s,r)})})}clear(){this.handlers.clear()}};K();var te="/deployments",da="/ping",z="/aliases",ci="/config",ri="/account",pi="/spa-check",re=class extends ie{constructor(e){super(),this.apiUrl=e.apiUrl||ae,this.apiKey=e.apiKey??"",this.deployToken=e.deployToken??""}transferEventsTo(e){this.transfer(e)}async request(e,a={},s){let r=this.getAuthHeaders(a.headers),u={...a,headers:r,credentials:this.needsCredentials(r)?"include":void 0};this.emit("request",e,u);try{let l=await fetch(e,u);l.ok||await this.handleResponseError(l,s);let d=this.safeClone(l),v=this.safeClone(l);return this.emit("response",d,e),await this.parseResponse(v)}catch(l){throw this.emit("error",l,e),this.handleFetchError(l,s),l}}getAuthHeaders(e={}){let a={...e};return this.deployToken?a.Authorization=`Bearer ${this.deployToken}`:this.apiKey&&(a.Authorization=`Bearer ${this.apiKey}`),a}needsCredentials(e){return!this.apiKey&&!this.deployToken&&!e.Authorization}safeClone(e){try{return e.clone()}catch{return e}}async parseResponse(e){if(!(e.headers.get("Content-Length")==="0"||e.status===204))return await e.json()}async handleResponseError(e,a){let s={};try{e.headers.get("content-type")?.includes("application/json")?s=await e.json():s={message:await e.text()}}catch{s={message:"Failed to parse error response"}}let r=s.message||s.error||`${a} failed due to API error`;throw e.status===401?f.authentication(r):f.api(r,e.status,s.code,s)}handleFetchError(e,a){throw e.name==="AbortError"?f.cancelled(`${a} operation was cancelled.`):e instanceof TypeError&&e.message.includes("fetch")?f.network(`${a} failed due to network error: ${e.message}`,e):e instanceof f?e:f.business(`An unexpected error occurred during ${a}: ${e.message||"Unknown error"}`)}async ping(){return(await this.request(`${this.apiUrl}${da}`,{method:"GET"},"Ping"))?.success||!1}async getPingResponse(){return await this.request(`${this.apiUrl}${da}`,{method:"GET"},"Ping")}async getConfig(){return await this.request(`${this.apiUrl}${ci}`,{method:"GET"},"Config")}async deploy(e,a={}){console.log("\u{1F6A2} [HTTP] deploy() called with options:",a),console.log("\u{1F6A2} [HTTP] tags from options:",a.tags),this.validateFiles(e);let{requestBody:s,requestHeaders:r}=await this.prepareRequestPayload(e,a.tags),u={};a.deployToken?u={Authorization:`Bearer ${a.deployToken}`}:a.apiKey&&(u={Authorization:`Bearer ${a.apiKey}`});let l={method:"POST",body:s,headers:{...r,...u},signal:a.signal||null};return await this.request(`${a.apiUrl||this.apiUrl}${te}`,l,"Deploy")}async listDeployments(){return await this.request(`${this.apiUrl}${te}`,{method:"GET"},"List Deployments")}async getDeployment(e){return await this.request(`${this.apiUrl}${te}/${e}`,{method:"GET"},"Get Deployment")}async removeDeployment(e){await this.request(`${this.apiUrl}${te}/${e}`,{method:"DELETE"},"Remove Deployment")}async setAlias(e,a,s){let r={deployment:a};s&&s.length>0&&(r.tags=s);let u={method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)},l=this.getAuthHeaders(u.headers),d={...u,headers:l,credentials:this.needsCredentials(l)?"include":void 0};this.emit("request",`${this.apiUrl}${z}/${encodeURIComponent(e)}`,d);try{let v=await fetch(`${this.apiUrl}${z}/${encodeURIComponent(e)}`,d);v.ok||await this.handleResponseError(v,"Set Alias");let y=this.safeClone(v),b=this.safeClone(v);return this.emit("response",y,`${this.apiUrl}${z}/${encodeURIComponent(e)}`),{...await this.parseResponse(b),isCreate:v.status===201}}catch(v){throw this.emit("error",v,`${this.apiUrl}${z}/${encodeURIComponent(e)}`),this.handleFetchError(v,"Set Alias"),v}}async getAlias(e){return await this.request(`${this.apiUrl}${z}/${encodeURIComponent(e)}`,{method:"GET"},"Get Alias")}async listAliases(){return await this.request(`${this.apiUrl}${z}`,{method:"GET"},"List Aliases")}async removeAlias(e){await this.request(`${this.apiUrl}${z}/${encodeURIComponent(e)}`,{method:"DELETE"},"Remove Alias")}async confirmAlias(e){return await this.request(`${this.apiUrl}${z}/${encodeURIComponent(e)}/confirm`,{method:"POST"},"Confirm Alias")}async getAliasDns(e){return await this.request(`${this.apiUrl}${z}/${encodeURIComponent(e)}/dns`,{method:"GET"},"Get Alias DNS")}async getAliasRecords(e){return await this.request(`${this.apiUrl}${z}/${encodeURIComponent(e)}/records`,{method:"GET"},"Get Alias Records")}async getAliasShare(e){return await this.request(`${this.apiUrl}${z}/${encodeURIComponent(e)}/share`,{method:"GET"},"Get Alias Share")}async getAccount(){return await this.request(`${this.apiUrl}${ri}`,{method:"GET"},"Get Account")}async checkSPA(e){let a=e.find(l=>l.path==="index.html"||l.path==="/index.html");if(!a||a.size>100*1024)return!1;let s;if(typeof Buffer<"u"&&Buffer.isBuffer(a.content))s=a.content.toString("utf-8");else if(typeof Blob<"u"&&a.content instanceof Blob)s=await a.content.text();else if(typeof File<"u"&&a.content instanceof File)s=await a.content.text();else return!1;let r={files:e.map(l=>l.path),index:s};return(await this.request(`${this.apiUrl}${pi}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)},"SPA Check")).isSPA}validateFiles(e){if(!e.length)throw f.business("No files to deploy.");for(let a of e)if(!a.md5)throw f.file(`MD5 checksum missing for file: ${a.path}`,a.path)}async prepareRequestPayload(e,a){if(M()==="browser")return{requestBody:this.createBrowserBody(e,a),requestHeaders:{}};if(M()==="node"){let{body:s,headers:r}=await this.createNodeBody(e,a);return{requestBody:s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength),requestHeaders:r}}else throw f.business("Unknown or unsupported execution environment")}createBrowserBody(e,a){console.log("\u{1F6A2} [HTTP] createBrowserBody() called with tags:",a);let s=new FormData,r=[];for(let u of e){if(!(u.content instanceof File||u.content instanceof Blob))throw f.file(`Unsupported file.content type for browser FormData: ${u.path}`,u.path);let l=this.getBrowserContentType(u.content instanceof File?u.content:u.path),d=new File([u.content],u.path,{type:l});s.append("files[]",d),r.push(u.md5)}return s.append("checksums",JSON.stringify(r)),a&&a.length>0?(console.log("\u{1F6A2} [HTTP] Adding tags to FormData:",a),s.append("tags",JSON.stringify(a))):console.log("\u{1F6A2} [HTTP] No tags to add (tags is empty or undefined)"),s}async createNodeBody(e,a){let{FormData:s,File:r}=await import("formdata-node"),{FormDataEncoder:u}=await Promise.resolve().then(()=>(ma(),ua)),l=new s,d=[];for(let x of e){let A=ce.lookup(x.path)||"application/octet-stream",S;if(Buffer.isBuffer(x.content))S=new r([x.content],x.path,{type:A});else if(typeof Blob<"u"&&x.content instanceof Blob)S=new r([x.content],x.path,{type:A});else throw f.file(`Unsupported file.content type for Node.js FormData: ${x.path}`,x.path);let F=x.path.startsWith("/")?x.path:"/"+x.path;l.append("files[]",S,F),d.push(x.md5)}l.append("checksums",JSON.stringify(d)),a&&a.length>0&&l.append("tags",JSON.stringify(a));let v=new u(l),y=[];for await(let x of v.encode())y.push(Buffer.from(x));let b=Buffer.concat(y);return{body:b,headers:{"Content-Type":v.contentType,"Content-Length":Buffer.byteLength(b).toString()}}}getBrowserContentType(e){return typeof e=="string"?ce.lookup(e)||"application/octet-stream":ce.lookup(e.name)||e.type||"application/octet-stream"}};P();function xa(i={},e={}){let a={apiUrl:i.apiUrl||e.apiUrl||ae,apiKey:i.apiKey!==void 0?i.apiKey:e.apiKey,deployToken:i.deployToken!==void 0?i.deployToken:e.deployToken},s={apiUrl:a.apiUrl};return a.apiKey!==void 0&&(s.apiKey=a.apiKey),a.deployToken!==void 0&&(s.deployToken=a.deployToken),s}function va(i,e){let a={...i};return a.apiUrl===void 0&&e.apiUrl!==void 0&&(a.apiUrl=e.apiUrl),a.apiKey===void 0&&e.apiKey!==void 0&&(a.apiKey=e.apiKey),a.deployToken===void 0&&e.deployToken!==void 0&&(a.deployToken=e.deployToken),a.timeout===void 0&&e.timeout!==void 0&&(a.timeout=e.timeout),a.maxConcurrency===void 0&&e.maxConcurrency!==void 0&&(a.maxConcurrency=e.maxConcurrency),a.onProgress===void 0&&e.onProgress!==void 0&&(a.onProgress=e.onProgress),a.onProgressStats===void 0&&e.onProgressStats!==void 0&&(a.onProgressStats=e.onProgressStats),a}P();le();async function mi(){let e=JSON.stringify({rewrites:[{source:"/(.*)",destination:"/index.html"}]},null,2),a;typeof Buffer<"u"?a=Buffer.from(e,"utf-8"):a=new Blob([e],{type:"application/json"});let{md5:s}=await pe(a);return{path:ge,content:a,size:e.length,md5:s}}async function ya(i,e,a){if(a.spaDetect===!1||i.some(s=>s.path===ge))return i;try{if(await e.checkSPA(i)){let r=await mi();return[...i,r]}}catch{}return i}function wa(i,e,a,s){return{create:async(r,u={})=>{a&&await a();let l=e?va(u,e):u,d=i();if(!s)throw new Error("processInput function is not provided.");let v=await s(r,l);return v=await ya(v,d,l),await d.deploy(v,l)},list:async()=>(a&&await a(),i().listDeployments()),remove:async r=>{a&&await a(),await i().removeDeployment(r)},get:async r=>(a&&await a(),i().getDeployment(r))}}function ka(i,e){return{set:async(a,s,r)=>(e&&await e(),i().setAlias(a,s,r)),get:async a=>(e&&await e(),i().getAlias(a)),list:async()=>(e&&await e(),i().listAliases()),remove:async a=>{e&&await e(),await i().removeAlias(a)},confirm:async a=>(e&&await e(),i().confirmAlias(a)),dns:async a=>(e&&await e(),i().getAliasDns(a)),records:async a=>(e&&await e(),i().getAliasRecords(a)),share:async a=>(e&&await e(),i().getAliasShare(a))}}function ja(i,e){return{get:async()=>(e&&await e(),i().getAccount())}}var ue=class{constructor(e={}){this.initPromise=null;this.clientOptions=e;let a=this.resolveInitialConfig(e);this.http=new re({...e,...a});let s=()=>this.ensureInitialized(),r=()=>this.http;this._deployments=wa(r,this.clientOptions,s,(u,l)=>this.processInput(u,l)),this._aliases=ka(r,s),this._account=ja(r,s)}async ensureInitialized(){return this.initPromise||(this.initPromise=this.loadFullConfig()),this.initPromise}async ping(){return await this.ensureInitialized(),this.http.ping()}async deploy(e,a){return this.deployments.create(e,a)}async whoami(){return this.account.get()}get deployments(){return this._deployments}get aliases(){return this._aliases}get account(){return this._account}on(e,a){this.http.on(e,a)}off(e,a){this.http.off(e,a)}replaceHttpClient(e){if(this.http?.transferEventsTo)try{this.http.transferEventsTo(e)}catch(a){console.warn("Event transfer failed during client replacement:",a)}this.http=e}};P();var Se=null;function ze(i){Se=i}function di(){if(Se===null)throw f.config("Platform configuration not initialized. The SDK must fetch configuration from the API before performing operations.");return Se}P();le();function cn(i,e,a,s=!0){let r=i===1?e:a;return s?`${i} ${r}`:r}Ce();Ee();K();P();async function hi(i){return{}}Te();var de,Pa,Pe=class extends ue{constructor(a={}){super(a);Re(this,de)}resolveInitialConfig(a){return xa(a,{})}async loadFullConfig(){try{let a=await this.http.getConfig();ze(a)}catch(a){throw this.initPromise=null,a}}async processInput(a,s){if(!De(this,de,Pa).call(this,a))throw f.business("Invalid input type for browser environment. Expected File[], FileList, or HTMLInputElement.");let r=a instanceof HTMLInputElement?Array.from(a.files):a,{processFilesForBrowser:u}=await Promise.resolve().then(()=>(Te(),Ta));return u(r,s)}};de=new WeakSet,Pa=function(a){return Array.isArray(a)?a.length===0||a.every(s=>s instanceof File):a&&typeof a=="object"&&"length"in a&&typeof a.length=="number"?"item"in a||a.constructor?.name==="FileList":!!(a&&typeof a=="object"&&"files"in a)};var $n=Pe;export{be as API_KEY_HEX_LENGTH,I as API_KEY_PREFIX,Xe as API_KEY_TOTAL_LENGTH,Ci as AccountPlan,zi as AliasStatus,re as ApiHttp,Fi as AuthMethod,ae as DEFAULT_API,ge as DEPLOYMENT_CONFIG_FILENAME,he as DEPLOY_TOKEN_HEX_LENGTH,N as DEPLOY_TOKEN_PREFIX,Ze as DEPLOY_TOKEN_TOTAL_LENGTH,Si as DeploymentStatus,g as ErrorType,fi as JUNK_DIRECTORIES,Pe as Ship,f as ShipError,Ya as ShipErrorType,Va as __setTestEnvironment,pe as calculateMD5,ja as createAccountResource,ka as createAliasResource,wa as createDeploymentResource,$n as default,za as filterJunk,Ri as generateAliasUrl,qi as generateDeploymentUrl,di as getCurrentConfig,M as getENV,hi as loadConfig,va as mergeDeployOptions,Fa as optimizeDeployPaths,cn as pluralize,Ea as processFilesForBrowser,xa as resolveConfig,ze as setPlatformConfig,Ei as validateApiKey,Pi as validateApiUrl,Ti as validateDeployToken,_i as validateSubdomain};
6
6
  /*! Bundled license information:
7
7
 
8
8
  mime-db/index.js: