PageSourceSearch

https://www.skribit.ai/_next/static/chunks/07fe0859c595a8c4.js

js skribit.ai collected 2026-10-05 13:32:26 UTC 65,035 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,72244,t=>{"use strict";class e extends Error{status;data;constructor(t,e,r){super(t),this.status=e,this.data=r,this.name="ApiError"}}async function r(t,s={}){let{timeout:n=3e4,...i}=s,o=new AbortController,a=setTimeout(()=>o.abort(),n);for(let r=0;r<=3;r++)try{let s=await fetch(`/api/proxy${t}`,{...i,signal:o.signal,credentials:"include",headers:{"Content-Type":"application/json",...i.headers}});if(clearTimeout(a),s.status>=500&&r<3){await new Promise(t=>setTimeout(t,2e3));continue}if(!s.ok){let t=await s.json().catch(()=>({}));throw new e(t.message||`Request failed with status ${s.status}`,s.status,t)}let n=await s.text();return n?JSON.parse(n):{}}catch(t){if(clearTimeout(a),t instanceof e)throw t;if(t instanceof Error&&"AbortError"===t.name)throw new e("Request timed out",408);if(r<3){await new Promise(t=>setTimeout(t,2e3));continue}throw new e(t instanceof Error?t.message:"Network error",0)}throw new e("Network error",0)}function s(){localStorage.removeItem("auth_token")}t.s(["ApiError",()=>e,"apiClient",()=>r,"clearAuthToken",()=>s])},18148,t=>{"use strict";var e=t.i(26145),r=t.i(61224),s=t.i(72244),n=t.i(21140);let i=(0,r.createContext)(null);function o({children:t}){let{data:o,isPending:a,refetch:c}=(0,n.useSession)(),h=o?.user?{id:o.user.id,email:o.user.email,name:o.user.name||o.user.email,image:o.user.image??void 0,role:o.user.role}:null,l=h?.role==="ADMIN",u=(0,r.useCallback)(async()=>{await c()},[c]),p=(0,r.useCallback)(async()=>{try{await (0,n.signOut)()}catch{}(0,s.clearAuthToken)()},[]);return(0,e.jsx)(i.Provider,{value:{user:h,isLoading:a,isAuthenticated:!!h,isAdmin:!!l,logout:p,refreshSession:u},children:t})}function a(){let t=(0,r.useContext)(i);if(!t)throw Error("useAuth must be used within an AuthProvider");return t}t.s(["AuthProvider",()=>o,"useAuth",()=>a])},39041,2045,t=>{"use strict";var e,r=((e={}).Json="application/json",e.JsonApi="application/vnd.api+json",e.FormData="multipart/form-data",e.UrlEncoded="application/x-www-form-urlencoded",e.Text="text/plain",e);class s{baseUrl="";securityData=null;securityWorker;abortControllers=new Map;customFetch=(...t)=>fetch(...t);baseApiParams={credentials:"same-origin",headers:{},redirect:"follow",referrerPolicy:"no-referrer"};constructor(t={}){Object.assign(this,t)}setSecurityData=t=>{this.securityData=t};encodeQueryParam(t,e){let r=encodeURIComponent(t);return`${r}=${encodeURIComponent("number"==typeof e?e:`${e}`)}`}addQueryParam(t,e){return this.encodeQueryParam(e,t[e])}addArrayQueryParam(t,e){return t[e].map(t=>this.encodeQueryParam(e,t)).join("&")}toQueryString(t){let e=t||{};return Object.keys(e).filter(t=>void 0!==e[t]).map(t=>Array.isArray(e[t])?this.addArrayQueryParam(e,t):this.addQueryParam(e,t)).join("&")}addQueryParams(t){let e=this.toQueryString(t);return e?`?${e}`:""}contentFormatters={"application/json":t=>null!==t&&("object"==typeof t||"string"==typeof t)?JSON.stringify(t):t,"application/vnd.api+json":t=>null!==t&&("object"==typeof t||"string"==typeof t)?JSON.stringify(t):t,"text/plain":t=>null!==t&&"string"!=typeof t?JSON.stringify(t):t,"multipart/form-data":t=>t instanceof FormData?t:Object.keys(t||{}).reduce((e,r)=>{let s=t[r];return e.append(r,s instanceof Blob?s:"object"==typeof s&&null!==s?JSON.stringify(s):`${s}`),e},new FormData),"application/x-www-form-urlencoded":t=>this.toQueryString(t)};
1mergeRequestParams(t,e){return{...this.baseApiParams,...t,...e||{},headers:{...this.baseApiParams.headers||{},...t.headers||{},...e&&e.headers||{}}}}createAbortSignal=t=>{if(this.abortControllers.has(t)){let e=this.abortControllers.get(t);return e?e.signal:void 0}let e=new AbortController;return this.abortControllers.set(t,e),e.signal};abortRequest=t=>{let e=this.abortControllers.get(t);e&&(e.abort(),this.abortControllers.delete(t))};request=async({body:t,secure:e,path:r,type:s,query:n,format:i,baseUrl:o,cancelToken:a,...c})=>{let h=("boolean"==typeof e?e:this.baseApiParams.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},l=this.mergeRequestParams(c,h),u=n&&this.toQueryString(n),p=this.contentFormatters[s||"application/json"],d=i||l.format;return this.customFetch(`${o||this.baseUrl||""}${r}${u?`?${u}`:""}`,{...l,headers:{...l.headers||{},...s&&"multipart/form-data"!==s?{"Content-Type":s}:{}},signal:(a?this.createAbortSignal(a):l.signal)||null,body:null==t?null:p(t)}).then(async t=>{t.data=null,t.error=null;let e=d?t.clone():t,r=d?await e[d]().then(e=>(t.ok?t.data=e:t.error=e,t)).catch(e=>(t.error=e,t)):t;if(a&&this.abortControllers.delete(a),!t.ok)throw r;return r})}}class n{http;constructor(t){this.http=t}projectsControllerCreate=(t,e={})=>this.http.request({path:"/projects",method:"POST",body:t,secure:!0,type:r.Json,format:"json",...e});projectsControllerFindAll=(t={})=>this.http.request({path:"/projects",method:"GET",secure:!0,format:"json",...t});projectsControllerFindOne=({id:t,...e},r={})=>this.http.request({path:`/projects/${t}`,method:"GET",secure:!0,format:"json",...r});projectsControllerUpdate=({id:t,...e},s,n={})=>this.http.request({path:`/projects/${t}`,method:"PATCH",body:s,secure:!0,type:r.Json,format:"json",...n});projectsControllerRemove=({id:t,...e},r={})=>this.http.request({path:`/projects/${t}`,method:"DELETE",secure:!0,...r});generationsControllerCreate=({projectId:t,...e},s,n={})=>this.http.request({path:`/projects/${t}/generations`,method:"POST",body:s,secure:!0,type:r.Json,format:"json",...n});generationsControllerFindByProject=({projectId:t,...e},r={})=>this.http.request({path:`/projects/${t}/generations`,method:"GET",secure:!0,format:"json",...r})}class i{http;constructor(t){this.http=t}contentControllerFindByGeneration=({generationId:t,...e},r={})=>this.http.request({path:`/content/generation/${t}`,method:"GET",secure:!0,format:"json",...r});contentControllerFindOne=({id:t,...e},r={})=>this.http.request({path:`/content/${t}`,method:"GET",secure:!0,format:"json",...r})}class o{http;constructor(t){this.http=t}landingPagesControllerCreate=(t,e={})=>this.http.request({path:"/landing-pages",method:"POST",body:t,secure:!0,type:r.Json,...e});landingPagesControllerFindAll=(t={})=>this.http.request({path:"/landing-pages",method:"GET",secure:!0,...t});landingPagesControllerCheckSlugAvailability=({slug:t,...e},r={})=>this.http.request({path:`/landing-pages/slug/check/${t}`,method:"GET",secure:!0,...r});landingPagesControllerFindOne=({id:t,...e},r={})=>this.http.request({path:`/landing-pages/${t}`,method:"GET",secure:!0,...r});landingPagesControllerRemove=({id:t,...e},r={})=>this.http.request({path:`/landing-pages/${t}`,method:"DELETE",secure:!0,...r});landingPagesControllerUpdateSlug=({id:t,...e},s,n={})=>this.http.request({path:`/landing-pages/${t}/slug`,method:"PATCH",body:s,secure:!0,type:r.Json,...n});landingPagesControllerPublish=({id:t,...e},s,n={})=>this.http.request({path:`/landing-pages/${t}/publish`,method:"POST",body:s,secure:!0,type:r.Json,...n});landingPagesControllerUnpublish=({id:t,...e},r={})=>this.http.request({path:`/landing-pages/${t}/unpublish`,method:"POST",secure:!0,...r});landingPagesControllerListVersions=({id:t,...e},r={})=>this.http.request({path:`/landing-pages/${t}/versions`,method:"GET",secure:!0,...r});landingPagesControllerCreateVersion=({id:t,...e},s,n={})=>this.http.request({path:`/landing-pages/${t}/versions`,method:"POST",body:s,secure:!0,type:r.Json,...n});landingPagesControllerRollbackToVersion=({id:t,versionId:e,...r},s={})=>this.http.request({path:`/landing-pages/${t}/versions/${e}/rollback`,method:"POST",secure:!0,...s});customDomainsControllerAddCustomDomain=({id:t,...e},s,n={})=>this.http.request({path:`/landing-pages/${t}/custom-domain`,method:"POST",body:s,secure:!0,type:r.Json,...n});customDomainsControllerGetCustomDomain=({id:t,...e},r={})=>this.http.request({path:`/landing-pages/${t}/custom-domain`,method:"GET",secure:!0,...r});customDomainsControllerRemoveCustomDomain=({id:t,...e},r={})=>this.http.request({path:`/landing-pages/${t}/custom-domain`,method:"DELETE",secure:!0,...r});customDomainsControllerVerifyDns=({id:t,...e},r={})=>this.http.request({path:`/landing-pages/${t}/custom-domain/verify`,method:"POST",secure:!0,...r})}class a{http;constructor(t){this.http=t}promoCodesControllerValidate=({code:t,...e},r={})=>this.http.request({path:`/promo-codes/validate/${t}`,method:"GET",secure:!0,format:"json",...r});promoCodesControllerRedeem=(t,e={})=>this.http.request({path:"/promo-codes/redeem",method:"POST",body:t,secure:!0,type:r.Json,format:"json",...e})}class c{http;constructor(t){this.http=t}checkoutControllerGetPricing=(t={})=>this.http.request({path:"/checkout/pricing",method:"GET",format:"json",...t});checkoutControllerCreateSession=(t,e={})=>this.http.request({path:"/checkout/create-session",method:"POST",body:t,secure:!0,type:r.Json,format:"json",...e});checkoutControllerVerifyPurchase=({sessionId:t,...e},r={})=>this.http.request({path:`/checkout/verify/${t}`,method:"GET",secure:!0,format:"json",...r});checkoutControllerGetPurchaseStatus=(t={})=>this.http.request({path:"/checkout/status",method:"GET",secure:!0,format:"json",...t});checkoutControllerGetBillingHistory=(t={})=>this.http.request({path:"/checkout/billing",method:"GET",secure:!0,format:"json",...t});checkoutControllerHandleWebhook=(t={})=>this.http.request({path:"/checkout/webhook",method:"POST",...t})}let h=null;function l(){return h||(h=new s({baseUrl:"/api/proxy",baseApiParams:{credentials:"include",headers:{"Content-Type":"application/json"}}})),h}let u=null,p=null,d=null,f=null,g=null;function m(){return u||(u=new n(l())),u}function y(){return p||(p=new i(l())),p}function b(){return d||(d=new o(l())),d}function w(){return f||(f=new a(l())),f}
1function _(){return g||(g=new c(l())),g}t.s(["getCheckoutApi",()=>_,"getContentApi",()=>y,"getLandingPagesApi",()=>b,"getProjectsApi",()=>m,"getPromoCodesApi",()=>w],39041);var k=t.i(72244);async function C(t,e=3e4){let r=new AbortController,s=setTimeout(()=>r.abort(),e);try{let r=new Promise((t,r)=>{setTimeout(()=>r(Error("Request timed out")),e)}),n=await Promise.race([t(),r]);return clearTimeout(s),n.data}catch(t){var n;if(clearTimeout(s),t instanceof k.ApiError)throw t;if(t instanceof Error&&"Request timed out"===t.message||t instanceof Error&&"AbortError"===t.name)throw new k.ApiError("Request timed out",408);if("object"==typeof(n=t)&&null!==n&&"status"in n&&"number"==typeof n.status&&"ok"in n){let e=t.error||{};throw new k.ApiError(e.message||`Request failed with status ${t.status}`,t.status,e)}throw new k.ApiError(t instanceof Error?t.message:"Network error",0)}}async function v(t){return C(t,3e5)}t.s(["withErrorHandling",()=>C,"withGenerationTimeout",()=>v],2045)},16537,t=>{"use strict";function e(t){return{id:t.id,name:t.name,description:t.description||"",status:t.status,totalTokensUsed:t.totalTokensUsed,totalCostUsd:t.totalCostUsd,brief:t.structuredData,briefContent:t.briefContent||null,completedGenerations:t.completedGenerations,createdAt:new Date(t.createdAt),updatedAt:new Date(t.updatedAt)}}t.s(["toProject",()=>e])},86325,t=>{"use strict";let e,r,s,n=Object.create(null);n.open="0",n.close="1",n.ping="2",n.pong="3",n.message="4",n.upgrade="5",n.noop="6";let i=Object.create(null);Object.keys(n).forEach(t=>{i[n[t]]=t});let o={type:"error",data:"parser error"},a="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),c="function"==typeof ArrayBuffer,h=t=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,l=({type:t,data:e},r,s)=>{if(a&&e instanceof Blob)if(r)return s(e);else return u(e,s);if(c&&(e instanceof ArrayBuffer||h(e)))if(r)return s(e);else return u(new Blob([e]),s);return s(n[t]+(e||""))},u=(t,e)=>{let r=new FileReader;return r.onload=function(){e("b"+(r.result.split(",")[1]||""))},r.readAsDataURL(t)};function p(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}let d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f="undefined"==typeof Uint8Array?[]:new Uint8Array(256);for(let t=0;t<d.length;t++)f[d.charCodeAt(t)]=t;let g="function"==typeof ArrayBuffer,m=(t,e)=>{if("string"!=typeof t)return{type:"message",data:b(t,e)};let r=t.charAt(0);return"b"===r?{type:"message",data:y(t.substring(1),e)}:i[r]?t.length>1?{type:i[r],data:t.substring(1)}:{type:i[r]}:o},y=(t,e)=>g?b((t=>{let e=.75*t.length,r=t.length,s,n=0,i,o,a,c;"="===t[t.length-1]&&(e--,"="===t[t.length-2]&&e--);let h=new ArrayBuffer(e),l=new Uint8Array(h);for(s=0;s<r;s+=4)i=f[t.charCodeAt(s)],o=f[t.charCodeAt(s+1)],a=f[t.charCodeAt(s+2)],c=f[t.charCodeAt(s+3)],l[n++]=i<<2|o>>4,l[n++]=(15&o)<<4|a>>2,l[n++]=(3&a)<<6|63&c;return h})(t),e):{base64:!0,data:t},b=(t,e)=>"blob"===e?t instanceof Blob?t:new Blob([t]):t instanceof ArrayBuffer?t:t.buffer;function w(t){return t.reduce((t,e)=>t+e.length,0)}function _(t,e){if(t[0].length===e)return t.shift();let r=new Uint8Array(e),s=0;for(let n=0;n<e;n++)r[n]=t[0][s++],s===t[0].length&&(t.shift(),s=0);return t.length&&s<t[0].length&&(t[0]=t[0].slice(s)),r}function k(t){if(t){var e=t;for(var r in k.prototype)e[r]=k.prototype[r];return e}}k.prototype.on=k.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},k.prototype.once=function(t,e){function r(){this.off(t,r),e.apply(this,arguments)}return r.fn=e,this.on(t,r),this},k.prototype.off=k.prototype.removeListener=k.prototype.removeAllListeners=k.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,s=this._callbacks["$"+t];if(!s)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var n=0;n<s.length;n++)if((r=s[n])===e||r.fn===e){s.splice(n,1);break}return 0===s.length&&delete this._callbacks["$"+t],this},k.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=Array(arguments.length-1),r=this._callbacks["$"+t],s=1;s<arguments.length;s++)e[s-1]=arguments[s];if(r){r=r.slice(0);for(var s=0,n=r.length;s<n;++s)r[s].apply(this,e)}return this},k.prototype.emitReserved=k.prototype.emit,k.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},k.prototype.hasListeners=function(t){return!!this.listeners(t).length};let C="function"==typeof Promise&&"function"==typeof Promise.resolve?t=>Promise.resolve().then(t):(t,e)=>e(t,0),v="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")();function E(t,...e){return e.reduce((e,r)=>(t.hasOwnProperty(r)&&(e[r]=t[r]),e),{})}let A=v.setTimeout,T=v.clearTimeout;function P(t,e){e.useNativeTimers?(t.setTimeoutFn=A.bind(v),t.clearTimeoutFn=T.bind(v)):(t.setTimeoutFn=v.setTimeout.bind(v),t.clearTimeoutFn=v.clearTimeout.bind(v))}function S(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}
1class O extends Error{constructor(t,e,r){super(t),this.description=e,this.context=r,this.type="TransportError"}}class j extends k{constructor(t){super(),this.writable=!1,P(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,e,r){return super.emitReserved("error",new O(t,e,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return("opening"===this.readyState||"open"===this.readyState)&&(this.doClose(),this.onClose()),this}send(t){"open"===this.readyState&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){let e=m(t,this.socket.binaryType);this.onPacket(e)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,e={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(e)}_hostname(){let t=this.opts.hostname;return -1===t.indexOf(":")?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&443!==Number(this.opts.port)||!this.opts.secure&&80!==Number(this.opts.port))?":"+this.opts.port:""}_query(t){let e=function(t){let e="";for(let r in t)t.hasOwnProperty(r)&&(e.length&&(e+="&"),e+=encodeURIComponent(r)+"="+encodeURIComponent(t[r]));return e}(t);return e.length?"?"+e:""}}class R extends j{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";let e=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let t=0;this._polling&&(t++,this.once("pollComplete",function(){--t||e()})),this.writable||(t++,this.once("drain",function(){--t||e()}))}else e()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){let e=t=>{if("opening"===this.readyState&&"open"===t.type&&this.onOpen(),"close"===t.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(t)};((t,e)=>{let r=t.split("\x1e"),s=[];for(let t=0;t<r.length;t++){let n=m(r[t],e);if(s.push(n),"error"===n.type)break}return s})(t,this.socket.binaryType).forEach(e),"closed"!==this.readyState&&(this._polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this._poll())}doClose(){let t=()=>{this.write([{type:"close"}])};"open"===this.readyState?t():this.once("open",t)}write(t){var e;let r,s,n;this.writable=!1,e=t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})},s=Array(r=t.length),n=0,t.forEach((t,i)=>{l(t,!1,t=>{s[i]=t,++n===r&&e(s.join("\x1e"))})})}uri(){let t=this.opts.secure?"https":"http",e=this.query||{};return!1!==this.opts.timestampRequests&&(e[this.opts.timestampParam]=S()),this.supportsBinary||e.sid||(e.b64=1),this.createUri(t,e)}}let B=!1;try{B="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(t){}let q=B;function L(){}class N extends R{constructor(t){if(super(t),"undefined"!=typeof location){const e="https:"===location.protocol;let r=location.port;r||(r=e?"443":"80"),this.xd="undefined"!=typeof location&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,e){let r=this.request({method:"POST",data:t});r.on("success",e),r.on("error",(t,e)=>{this.onError("xhr post error",t,e)})}doPoll(){let t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(t,e)=>{this.onError("xhr poll error",t,e)}),this.pollXhr=t}}class x extends k{constructor(t,e,r){super(),this.createRequest=t,P(this,r),this._opts=r,this._method=r.method||"GET",this._uri=e,this._data=void 0!==r.data?r.data:null,this._create()}_create(){var t;let e=E(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this._opts.xd;let r=this._xhr=this.createRequest(e);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders)for(let t in r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0),this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(t)&&r.setRequestHeader(t,this._opts.extraHeaders[t])}catch(t){}if("POST"===this._method)try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(t){}try{r.setRequestHeader("Accept","*/*")}catch(t){}null==(t=this._opts.cookieJar)||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var t;3===r.readyState&&(null==(t=this._opts.cookieJar)||t.parseCookies(r.getResponseHeader("set-cookie"))),4===r.readyState&&(200===r.
1status||1223===r.status?this._onLoad():this.setTimeoutFn(()=>{this._onError("number"==typeof r.status?r.status:0)},0))},r.send(this._data)}catch(t){this.setTimeoutFn(()=>{this._onError(t)},0);return}"undefined"!=typeof document&&(this._index=x.requestsCount++,x.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(void 0!==this._xhr&&null!==this._xhr){if(this._xhr.onreadystatechange=L,t)try{this._xhr.abort()}catch(t){}"undefined"!=typeof document&&delete x.requests[this._index],this._xhr=null}}_onLoad(){let t=this._xhr.responseText;null!==t&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}function D(){for(let t in x.requests)x.requests.hasOwnProperty(t)&&x.requests[t].abort()}x.requestsCount=0,x.requests={},"undefined"!=typeof document&&("function"==typeof attachEvent?attachEvent("onunload",D):"function"==typeof addEventListener&&addEventListener("onpagehide"in v?"pagehide":"unload",D,!1));let I=(s=U({xdomain:!1}))&&null!==s.responseType;function U(t){let e=t.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!e||q))return new XMLHttpRequest}catch(t){}if(!e)try{return new v[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch(t){}}let F="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();class $ extends j{get name(){return"websocket"}doOpen(){let t=this.uri(),e=this.opts.protocols,r=F?{}:E(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,e,r)}catch(t){return this.emitReserved("error",t)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let e=0;e<t.length;e++){let r=t[e],s=e===t.length-1;l(r,this.supportsBinary,t=>{try{this.doWrite(r,t)}catch(t){}s&&C(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){void 0!==this.ws&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){let t=this.opts.secure?"wss":"ws",e=this.query||{};return this.opts.timestampRequests&&(e[this.opts.timestampParam]=S()),this.supportsBinary||(e.b64=1),this.createUri(t,e)}}let H=v.WebSocket||v.MozWebSocket,M={websocket:class extends ${createSocket(t,e,r){return F?new H(t,e,r):e?new H(t,e):new H(t)}doWrite(t,e){this.ws.send(e)}},webtransport:class extends j{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{var s,n;let i,u,d,f,g=(s=Number.MAX_SAFE_INTEGER,n=this.socket.binaryType,r||(r=new TextDecoder),i=[],u=0,d=-1,f=!1,new TransformStream({transform(t,e){for(i.push(t);;){if(0===u){if(1>w(i))break;let t=_(i,1);f=(128&t[0])==128,u=(d=127&t[0])<126?3:126===d?1:2}else if(1===u){if(2>w(i))break;let t=_(i,2);d=new DataView(t.buffer,t.byteOffset,t.length).getUint16(0),u=3}else if(2===u){if(8>w(i))break;let t=_(i,8),r=new DataView(t.buffer,t.byteOffset,t.length),s=r.getUint32(0);if(s>2097151){e.enqueue(o);break}d=0x100000000*s+r.getUint32(4),u=3}else{if(w(i)<d)break;let t=_(i,d);e.enqueue(m(f?t:r.decode(t),n)),u=0}if(0===d||d>s){e.enqueue(o);break}}}})),y=t.readable.pipeThrough(g).getReader(),b=new TransformStream({transform(t,r){var s;s=e=>{let s,n=e.length;if(n<126)new DataView((s=new Uint8Array(1)).buffer).setUint8(0,n);else if(n<65536){let t=new DataView((s=new Uint8Array(3)).buffer);t.setUint8(0,126),t.setUint16(1,n)}else{let t=new DataView((s=new Uint8Array(9)).buffer);t.setUint8(0,127),t.setBigUint64(1,BigInt(n))}t.data&&"string"!=typeof t.data&&(s[0]|=128),r.enqueue(s),r.enqueue(e)},a&&t.data instanceof Blob?t.data.arrayBuffer().then(p).then(s):c&&(t.data instanceof ArrayBuffer||h(t.data))?s(p(t.data)):l(t,!1,t=>{e||(e=new TextEncoder),s(e.encode(t))})}});b.readable.pipeTo(t.writable),this._writer=b.writable.getWriter();let k=()=>{y.read().then(({done:t,value:e})=>{t||(this.onPacket(e),k())}).catch(t=>{})};k();let C={type:"open"};this.query.sid&&(C.data=`{"sid":"${this.query.sid}"}`),this._writer.write(C).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let e=0;e<t.length;e++){let r=t[e],s=e===t.length-1;this._writer.write(r).then(()=>{s&&C(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;null==(t=this._transport)||t.close()}},polling:class extends N{constructor(t){super(t);const e=t&&t.forceBase64;this.supportsBinary=I&&!e}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new x(U,this.uri(),t)}}},V=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,G=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function W(t){var e,r;let s,n;if(t.length>8e3)throw"URI too long";let i=t,o=t.indexOf("["),a=t.indexOf("]");-1!=o&&-1!=a&&(t=t.substring(0,o)+t.substring(o,a).replace(/:/g,";")+t.substring(a,t.length));let c=V.exec(t||""),h={},l=14;for(;l--;)h[G[l]]=c[l]||"";return -1!=o&&-1!=a&&(h.source=i,h.host=h.host.substring(1,h.host.length-1).replace(/;/g,":"),h.authority=h.authority.replace("[","").replace("]","").replace(/;/g,":"),h.ipv6uri=!0),s=(e=h.path).replace(/\/{2,9}/g,"/").split("/"),("/"==e.slice(0,1)||0===e.length)&&s.splice(0,1),"/"==e.slice(-1)&&s.splice(s.length-1,1),h.pathNames=s,r=h.query,n={},r.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(t,e,r){e&&(n[e]=r)}),h.queryKey=n,h}let J="function"==typeof addEventListener&&"function"==typeof removeEventListener,K=[];J&&addEventListener("offline",()=>
vendor: 7,305 bytes, line 1
1{K.forEach(t=>t())},!1);class Q extends k{constructor(t,e){if(super(),this.binaryType="arraybuffer",this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&"object"==typeof t&&(e=t,t=null),t){const r=W(t);e.hostname=r.host,e.secure="https"===r.protocol||"wss"===r.protocol,e.port=r.port,r.query&&(e.query=r.query)}else e.host&&(e.hostname=W(e.host).host);P(this,e),this.secure=null!=e.secure?e.secure:"undefined"!=typeof location&&"https:"===location.protocol,e.hostname&&!e.port&&(e.port=this.secure?"443":"80"),this.hostname=e.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=e.port||("undefined"!=typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},e.transports.forEach(t=>{let e=t.prototype.name;this.transports.push(e),this._transportsByName[e]=t}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},e),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),"string"==typeof this.opts.query&&(this.opts.query=function(t){let e={},r=t.split("&");for(let t=0,s=r.length;t<s;t++){let s=r[t].split("=");e[decodeURIComponent(s[0])]=decodeURIComponent(s[1])}return e}(this.opts.query)),J&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),"localhost"!==this.hostname&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},K.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){let e=Object.assign({},this.opts.query);e.EIO=4,e.transport=t,this.id&&(e.sid=this.id);let r=Object.assign({},this.opts,{query:e,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(0===this.transports.length)return void this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);let t=this.opts.rememberUpgrade&&Q.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket")?"websocket":this.transports[0];this.readyState="opening";let e=this.createTransport(t);e.open(),this.setTransport(e)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",t=>this._onClose("transport close",t))}onOpen(){this.readyState="open",Q.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush()}_onPacket(t){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":let e=Error("server error");e.code=t.data,this._onError(e);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data)}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),"closed"!==this.readyState&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);let t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){let t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;let t=1;for(let e=0;e<this.writeBuffer.length;e++){let r=this.writeBuffer[e].data;if(r&&(t+="string"==typeof r?function(t){let e=0,r=0;for(let s=0,n=t.length;s<n;s++)(e=t.charCodeAt(s))<128?r+=1:e<2048?r+=2:e<55296||e>=57344?r+=3:(s++,r+=4);return r}(r):Math.ceil(1.33*(r.byteLength||r.size))),e>0&&t>this._maxPayload)return this.writeBuffer.slice(0,e);t+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;let t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,C(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,e,r){return this._sendPacket("message",t,e,r),this}send(t,e,r){return this._sendPacket("message",t,e,r),this}_sendPacket(t,e,r,s){if("function"==typeof e&&(s=e,e=void 0),"function"==typeof r&&(s=r,r=null),"closing"===this.readyState||"closed"===this.readyState)return;(r=r||{}).compress=!1!==r.compress;let n={type:t,data:e,options:r};this.emitReserved("packetCreate",n),this.writeBuffer.push(n),s&&this.once("flush",s),this.flush()}close(){let t=()=>{this._onClose("forced close"),this.transport.close()},e=()=>{this.off("upgrade",e),this.off("upgradeError",e),t()},r=()=>{this.once("upgrade",e),this.once("upgradeError",e)};return("opening"===this.readyState||"open"===this.readyState)&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(Q.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&"opening"===this.readyState)return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),J&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){let t=K.indexOf(this._offlineEventListener);-1!==t&&K.splice(t,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,e),this.writeBuffer=[],this._prevBufferLen=0}}}Q.protocol=4;class Y extends Q{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),"open"===this.readyState&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let e=this.createTransport(t),r=!1;Q.priorWebsocketSuccess=!1;let s=()=>{r||(e.send([{type:"ping",data:"probe"}]),e.once("packet",t=>{if(!r)if("pong"===t.type&&"probe"===t.data){if(this.upgrading=!0,this.emitReserved("upgrading",e),!e)return;Q.priorWebsocketSuccess="websocket"===e.name,this.transport.pause(()=>{r||"closed"!==this.readyState&&(h(),this.setTransport(e),e.send([{type:"upgrade"}
1]),this.emitReserved("upgrade",e),e=null,this.upgrading=!1,this.flush())})}else{let t=Error("probe error");t.transport=e.name,this.emitReserved("upgradeError",t)}}))};function n(){r||(r=!0,h(),e.close(),e=null)}let i=t=>{let r=Error("probe error: "+t);r.transport=e.name,n(),this.emitReserved("upgradeError",r)};function o(){i("transport closed")}function a(){i("socket closed")}function c(t){e&&t.name!==e.name&&n()}let h=()=>{e.removeListener("open",s),e.removeListener("error",i),e.removeListener("close",o),this.off("close",a),this.off("upgrading",c)};e.once("open",s),e.once("error",i),e.once("close",o),this.once("close",a),this.once("upgrading",c),-1!==this._upgrades.indexOf("webtransport")&&"webtransport"!==t?this.setTimeoutFn(()=>{r||e.open()},200):e.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){let e=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&e.push(t[r]);return e}}class z extends Y{constructor(t,e={}){const r="object"==typeof t?t:e;(!r.transports||r.transports&&"string"==typeof r.transports[0])&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(t=>M[t]).filter(t=>!!t)),super(t,r)}}z.protocol;let X="function"==typeof ArrayBuffer,Z=Object.prototype.toString,tt="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Z.call(Blob),te="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===Z.call(File);function tr(t){return X&&(t instanceof ArrayBuffer||("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer))||tt&&t instanceof Blob||te&&t instanceof File}let ts=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];(td=tf||(tf={}))[td.CONNECT=0]="CONNECT",td[td.DISCONNECT=1]="DISCONNECT",td[td.EVENT=2]="EVENT",td[td.ACK=3]="ACK",td[td.CONNECT_ERROR=4]="CONNECT_ERROR",td[td.BINARY_EVENT=5]="BINARY_EVENT",td[td.BINARY_ACK=6]="BINARY_ACK";class tn{constructor(t){this.replacer=t}encode(t){return(t.type===tf.EVENT||t.type===tf.ACK)&&function t(e,r){if(!e||"object"!=typeof e)return!1;if(Array.isArray(e)){for(let r=0,s=e.length;r<s;r++)if(t(e[r]))return!0;return!1}if(tr(e))return!0;if(e.toJSON&&"function"==typeof e.toJSON&&1==arguments.length)return t(e.toJSON(),!0);for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return!0;return!1}(t)?this.encodeAsBinary({type:t.type===tf.EVENT?tf.BINARY_EVENT:tf.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let e=""+t.type;return(t.type===tf.BINARY_EVENT||t.type===tf.BINARY_ACK)&&(e+=t.attachments+"-"),t.nsp&&"/"!==t.nsp&&(e+=t.nsp+","),null!=t.id&&(e+=t.id),null!=t.data&&(e+=JSON.stringify(t.data,this.replacer)),e}encodeAsBinary(t){let e,r,s=(e=[],r=t.data,t.data=function t(e,r){if(!e)return e;if(tr(e)){let t={_placeholder:!0,num:r.length};return r.push(e),t}if(Array.isArray(e)){let s=Array(e.length);for(let n=0;n<e.length;n++)s[n]=t(e[n],r);return s}if("object"==typeof e&&!(e instanceof Date)){let s={};for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(s[n]=t(e[n],r));return s}return e}(r,e),t.attachments=e.length,{packet:t,buffers:e}),n=this.encodeAsString(s.packet),i=s.buffers;return i.unshift(n),i}}class ti extends k{constructor(t){super(),this.reviver=t}add(t){let e;if("string"==typeof t){if(this.reconstructor)throw Error("got plaintext data when reconstructing a packet");let r=(e=this.decodeString(t)).type===tf.BINARY_EVENT;r||e.type===tf.BINARY_ACK?(e.type=r?tf.EVENT:tf.ACK,this.reconstructor=new to(e),0===e.attachments&&super.emitReserved("decoded",e)):super.emitReserved("decoded",e)}else if(tr(t)||t.base64)if(this.reconstructor)(e=this.reconstructor.takeBinaryData(t))&&(this.reconstructor=null,super.emitReserved("decoded",e));else throw Error("got binary data when not reconstructing a packet");else throw Error("Unknown type: "+t)}decodeString(t){let e=0,r={type:Number(t.charAt(0))};if(void 0===tf[r.type])throw Error("unknown packet type "+r.type);if(r.type===tf.BINARY_EVENT||r.type===tf.BINARY_ACK){let s=e+1;for(;"-"!==t.charAt(++e)&&e!=t.length;);let n=t.substring(s,e);if(n!=Number(n)||"-"!==t.charAt(e))throw Error("Illegal attachments");r.attachments=Number(n)}if("/"===t.charAt(e+1)){let s=e+1;for(;++e&&","!==t.charAt(e)&&e!==t.length;);r.nsp=t.substring(s,e)}else r.nsp="/";let s=t.charAt(e+1);if(""!==s&&Number(s)==s){let s=e+1;for(;++e;){let r=t.charAt(e);if(null==r||Number(r)!=r){--e;break}if(e===t.length)break}r.id=Number(t.substring(s,e+1))}
1if(t.charAt(++e)){let s=this.tryParse(t.substr(e));if(ti.isPayloadValid(r.type,s))r.data=s;else throw Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch(t){return!1}}static isPayloadValid(t,e){switch(t){case tf.CONNECT:return tc(e);case tf.DISCONNECT:return void 0===e;case tf.CONNECT_ERROR:return"string"==typeof e||tc(e);case tf.EVENT:case tf.BINARY_EVENT:return Array.isArray(e)&&("number"==typeof e[0]||"string"==typeof e[0]&&-1===ts.indexOf(e[0]));case tf.ACK:case tf.BINARY_ACK:return Array.isArray(e)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class to{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){var e,r;let t=(e=this.reconPack,r=this.buffers,e.data=function t(e,r){if(!e)return e;if(e&&!0===e._placeholder){if("number"==typeof e.num&&e.num>=0&&e.num<r.length)return r[e.num];throw Error("illegal attachments")}if(Array.isArray(e))for(let s=0;s<e.length;s++)e[s]=t(e[s],r);else if("object"==typeof e)for(let s in e)Object.prototype.hasOwnProperty.call(e,s)&&(e[s]=t(e[s],r));return e}(e.data,r),delete e.attachments,e);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}let ta=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t};function tc(t){return"[object Object]"===Object.prototype.toString.call(t)}function th(t){var e;return"string"==typeof t.nsp&&(void 0===(e=t.id)||ta(e))&&function(t,e){switch(t){case tf.CONNECT:return void 0===e||tc(e);case tf.DISCONNECT:return void 0===e;case tf.EVENT:return Array.isArray(e)&&("number"==typeof e[0]||"string"==typeof e[0]&&-1===ts.indexOf(e[0]));case tf.ACK:return Array.isArray(e);case tf.CONNECT_ERROR:return"string"==typeof e||tc(e);default:return!1}}(t.type,t.data)}function tl(t,e,r){return t.on(e,r),function(){t.off(e,r)}}t.s(["Decoder",()=>ti,"Encoder",()=>tn,"PacketType",()=>tf,"isPacketValid",()=>th,"protocol",0,5],46262);let tu=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class tp extends k{constructor(t,e,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=e,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;let t=this.io;this.subs=[tl(t,"open",this.onopen.bind(this)),tl(t,"packet",this.onpacket.bind(this)),tl(t,"error",this.onerror.bind(this)),tl(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...e){var r,s,n;if(tu.hasOwnProperty(t))throw Error('"'+t.toString()+'" is a reserved event name');if(e.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(e),this;let i={type:tf.EVENT,data:e};if(i.options={},i.options.compress=!1!==this.flags.compress,"function"==typeof e[e.length-1]){let t=this.ids++,r=e.pop();this._registerAckCallback(t,r),i.id=t}let o=null==(s=null==(r=this.io.engine)?void 0:r.transport)?void 0:s.writable,a=this.connected&&!(null==(n=this.io.engine)?void 0:n._hasPingExpired());return this.flags.volatile&&!o||(a?(this.notifyOutgoingListeners(i),this.packet(i)):this.sendBuffer.push(i)),this.flags={},this}_registerAckCallback(t,e){var r;let s=null!=(r=this.flags.timeout)?r:this._opts.ackTimeout;if(void 0===s){this.acks[t]=e;return}let n=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let e=0;e<this.sendBuffer.length;e++)this.sendBuffer[e].id===t&&this.sendBuffer.splice(e,1);e.call(this,Error("operation has timed out"))},s),i=(...t)=>{this.io.clearTimeoutFn(n),e.apply(this,t)};i.withError=!0,this.acks[t]=i}emitWithAck(t,...e){return new Promise((r,s)=>{let n=(t,e)=>t?s(t):r(e);
1n.withError=!0,e.push(n),this.emit(t,...e)})}_addToQueue(t){let e;"function"==typeof t[t.length-1]&&(e=t.pop());let r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((t,...s)=>(this._queue[0],null!==t?r.tryCount>this._opts.retries&&(this._queue.shift(),e&&e(t)):(this._queue.shift(),e&&e(null,...s)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||0===this._queue.length)return;let e=this._queue[0];(!e.pending||t)&&(e.pending=!0,e.tryCount++,this.flags=e.flags,this.emit.apply(this,e.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){"function"==typeof this.auth?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:tf.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,e){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,e),this._clearAcks()}
1_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(e=>String(e.id)===t)){let e=this.acks[t];delete this.acks[t],e.withError&&e.call(this,Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case tf.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case tf.EVENT:case tf.BINARY_EVENT:this.onevent(t);break;case tf.ACK:case tf.BINARY_ACK:this.onack(t);break;case tf.DISCONNECT:this.ondisconnect();break;case tf.CONNECT_ERROR:this.destroy();let e=Error(t.data.message);e.data=t.data.data,this.emitReserved("connect_error",e)}}onevent(t){let e=t.data||[];null!=t.id&&e.push(this.ack(t.id)),this.connected?this.emitEvent(e):this.receiveBuffer.push(Object.freeze(e))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length)for(let e of this._anyListeners.slice())e.apply(this,t);super.emit.apply(this,t),this._pid&&t.length&&"string"==typeof t[t.length-1]&&(this._lastOffset=t[t.length-1])}ack(t){let e=this,r=!1;return function(...s){r||(r=!0,e.packet({type:tf.ACK,id:t,data:s}))}}onack(t){let e=this.acks[t.id];"function"==typeof e&&(delete this.acks[t.id],e.withError&&t.data.unshift(null),e.apply(this,t.data))}onconnect(t,e){this.id=t,this.recovered=e&&this._pid===e,this._pid=e,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:tf.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){let e=this._anyListeners;for(let r=0;r<e.length;r++)if(t===e[r]){e.splice(r,1);break}}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){let e=this._anyOutgoingListeners;for(let r=0;r<e.length;r++)if(t===e[r]){e.splice(r,1);break}}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length)for(let e of this._anyOutgoingListeners.slice())e.apply(this,t.data)}}var td,tf,tg=t.i(46262);function tm(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}tm.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),r=Math.floor(e*this.jitter*t);t=(1&Math.floor(10*e))==0?t-r:t+r}return 0|Math.min(t,this.max)},tm.prototype.reset=function(){this.attempts=0},tm.prototype.setMin=function(t){this.ms=t},tm.prototype.setMax=function(t){this.max=t},tm.prototype.setJitter=function(t){this.jitter=t};class ty extends k{constructor(t,e){var r;super(),this.nsps={},this.subs=[],t&&"object"==typeof t&&(e=t,t=void 0),(e=e||{}).path=e.path||"/socket.io",this.opts=e,P(this,e),this.reconnection(!1!==e.reconnection),this.reconnectionAttempts(e.reconnectionAttempts||1/0),this.reconnectionDelay(e.reconnectionDelay||1e3),this.reconnectionDelayMax(e.reconnectionDelayMax||5e3),this.randomizationFactor(null!=(r=e.randomizationFactor)?r:.5),this.backoff=new tm({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==e.timeout?2e4:e.timeout),this._readyState="closed",this.uri=t;const s=e.parser||tg;this.encoder=new s.Encoder,this.decoder=new s.Decoder,this._autoConnect=!1!==e.autoConnect,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return void 0===t?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var e;return void 0===t?this._reconnectionDelay:(this._reconnectionDelay=t,null==(e=this.backoff)||e.setMin(t),this)}randomizationFactor(t){var e;return void 0===t?this._randomizationFactor:(this._randomizationFactor=t,null==(e=this.backoff)||e.setJitter(t),this)}reconnectionDelayMax(t){var e;return void 0===t?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,null==(e=this.backoff)||e.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new z(this.uri,this.opts);let e=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;let s=tl(e,"open",function(){r.onopen(),t&&t()}),n=e=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",e),t?t(e):this.maybeReconnectOnOpen()},i=tl(e,"error",n);if(!1!==this._timeout){let t=this._timeout,r=this.setTimeoutFn(()=>{s(),n(Error("timeout")),e.close()},t);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}return this.subs.push(s),this.subs.push(i),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");let t=this.engine;this.subs.push(tl(t,"ping",this.onping.bind(this)),tl(t,"data",this.ondata.bind(this)),tl(t,"error",this.onerror.bind(this)),tl(t,"close",this.onclose.bind(this)),tl(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(t){this.onclose("parse error",t)}}ondecoded(t){C(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,e){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new tp(this,t,e),this.nsps[t]=r),r}_destroy(t){for(let t of Object.keys(this.nsps))if(this.nsps[t].active)return;this._close()}_packet(t){let e=this.encoder.encode(t);for(let r=0;r<e.length;r++)this.engine.write(e[r],t.options)}
1cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,e){var r;this.cleanup(),null==(r=this.engine)||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,e),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;let t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{let e=this.backoff.duration();this._reconnecting=!0;let r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),t.skipReconnect||t.open(e=>{e?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",e)):t.onreconnect()}))},e);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){let t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}let tb={};function tw(t,e){let r;"object"==typeof t&&(e=t,t=void 0);let s=function(t,e="",r){let s=t;r=r||"undefined"!=typeof location&&location,null==t&&(t=r.protocol+"//"+r.host),"string"==typeof t&&("/"===t.charAt(0)&&(t="/"===t.charAt(1)?r.protocol+t:r.host+t),/^(https?|wss?):\/\//.test(t)||(t=void 0!==r?r.protocol+"//"+t:"https://"+t),s=W(t)),!s.port&&(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";let n=-1!==s.host.indexOf(":")?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+n+":"+s.port+e,s.href=s.protocol+"://"+n+(r&&r.port===s.port?"":":"+s.port),s}(t,(e=e||{}).path||"/socket.io"),n=s.source,i=s.id,o=s.path,a=tb[i]&&o in tb[i].nsps;return e.forceNew||e["force new connection"]||!1===e.multiplex||a?r=new ty(n,e):(tb[i]||(tb[i]=new ty(n,e)),r=tb[i]),s.query&&!e.query&&(e.query=s.queryKey),r.socket(s.path,e)}Object.assign(tw,{Manager:ty,Socket:tp,io:tw,connect:tw}),t.s(["io",()=>tw],86325)},13748,t=>{"use strict";var e=t.i(26145),r=t.i(61224),s=t.i(86325),n=t.i(18148),i=t.i(27883);let o={competitors:"Competitor Analysis",audience:"User Personas",pricing:"Pricing Strategy",brand:"Brand Identity",sales:"Sales Materials",product:"Product Specs",pitch:"Investor Pitch"},a=(0,r.createContext)(null),c="wss://backend-production-61d7.up.railway.app";function h({children:t}){let{user:h,isAuthenticated:l}=(0,n.useAuth)(),[u,p]=(0,r.useState)(null),[d,f]=(0,r.useState)(null),[g,m]=(0,r.useState)(!1),[y,b]=(0,r.useState)(null),[w,_]=(0,r.useState)(null),[k,C]=(0,r.useState)(new Map),[v,E]=(0,r.useState)(null);(0,r.useEffect)(()=>{if(!l||!h)return;let t=(0,s.io)(`${c}/generations`,{transports:["websocket","polling"],reconnection:!0,reconnectionAttempts:5,reconnectionDelay:1e3});t.on("connect",()=>{m(!0),C(new Map),t.emit("join-user",{userId:h.id})}),t.on("disconnect",()=>{m(!1)}),t.on("connect_error",()=>{}),t.on("generation-update",t=>{b(t),C(e=>{let r=new Map(e);if("pending"===t.status||"processing"===t.status){var s;r.set(t.generationId,{...t,deliverableTitle:(s=t.workflowType,o[i.WORKFLOW_TYPE_REVERSE_MAP[s]]||s)})}
1else("completed"===t.status||"failed"===t.status)&&r.delete(t.generationId);return r})}),t.on("generation-progress",t=>{b(e=>e&&e.generationId===t.generationId?{...e,...t}:e),C(e=>{let r=e.get(t.generationId);if(r){let s=new Map(e);return s.set(t.generationId,{...r,...t}),s}return e})}),p(t);let e=(0,s.io)(`${c}/batches`,{transports:["websocket","polling"],reconnection:!0,reconnectionAttempts:5,reconnectionDelay:1e3});return e.on("connect",()=>{e.emit("join-user",{userId:h.id})}),e.on("disconnect",()=>{}),e.on("batch-update",t=>{_(t),"PENDING"===t.status||"PROCESSING"===t.status?E(t):E(null)}),f(e),()=>{t.disconnect(),e.disconnect()}},[l,h?.id]);let A=(0,r.useCallback)(t=>{u&&g&&u.emit("join-project",{projectId:t})},[u,g]),T=(0,r.useCallback)(t=>{u&&g&&u.emit("leave-project",{projectId:t})},[u,g]),P=(0,r.useCallback)(t=>{d&&g&&d.emit("join-batch",{batchId:t})},[d,g]),S=(0,r.useCallback)(t=>{d&&g&&d.emit("leave-batch",{batchId:t})},[d,g]);return(0,e.jsx)(a.Provider,{value:{isConnected:g,lastUpdate:y,lastBatchUpdate:w,activeGenerations:k,activeBatch:v,subscribeToProject:A,unsubscribeFromProject:T,subscribeToBatch:P,unsubscribeFromBatch:S},children:t})}function l(){let t=(0,r.useContext)(a);if(!t)throw Error("useWebSocket must be used within a WebSocketProvider");return t}t.s(["WebSocketProvider",()=>h,"useWebSocket",()=>l])},70502,t=>{"use strict";t.s(["PurchaseRequiredError",()=>c,"useProject",()=>h]);var e=t.i(61224);t.i(69137);var r=t.i(52555),s=t.i(72244),n=t.i(16537),i=t.i(60603),o=t.i(27883),a=t.i(13748);class c extends Error{constructor(){super("Purchase required to generate deliverables"),this.name="PurchaseRequiredError"}}function h(t){let[c,h]=(0,e.useState)(null),[l,u]=(0,e.useState)([]),[p,d]=(0,e.useState)(!0),[f,g]=(0,e.useState)(null),{lastUpdate:m,subscribeToProject:y,isConnected:b}=(0,a.useWebSocket)();(0,e.useEffect)(()=>{t&&b&&y(t)},[t,y,b]),(0,e.useEffect)(()=>{m&&m.projectId===t&&u(t=>{let e=t.findIndex(t=>t.id===m.generationId);if(!(e>=0))return[...t,{id:m.generationId,projectId:m.projectId,workflowType:m.workflowType,status:m.status.toUpperCase(),progress:m.progress??0,currentStep:m.currentStep??null,errorMessage:m.errorMessage??null,contentLength:m.contentLength??null,inputTokens:null,outputTokens:null,totalTokens:null,model:null,costUsd:null,webhookUrl:null,startedAt:m.timestamp??null,completedAt:null,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}];{let r=[...t];return r[e]={...r[e],status:m.status.toUpperCase(),progress:m.progress??r[e].progress,currentStep:m.currentStep??r[e].currentStep,errorMessage:m.errorMessage??r[e].errorMessage},r}})},[m,t]);let w=(0,e.useCallback)(async()=>{if(t)try{d(!0),g(null);let[e,s]=await Promise.all([(0,r.getProject)(t),(0,r.getGenerations)(t)]);h((0,n.toProject)(e)),u(s)}catch(t){g(t instanceof s.ApiError?t.message:"Failed to load project"),console.error("Failed to fetch project:",t)}finally{d(!1)}},[t]);(0,e.useEffect)(()=>{w()},[w]);let _=Object.keys(o.WORKFLOW_TYPE_MAP).map(t=>{let e=o.WORKFLOW_TYPE_MAP[t],r=l.find(t=>t.workflowType===e),s=r?.completedAt,n=r?.currentStep,i=r?.errorMessage;return{id:r?.id||`del-${t}`,type:t,status:r?o.STATUS_MAP[r.status]:"pending",generationId:r?.id,generatedAt:s?new Date(s):void 0,progress:r?.progress,currentStep:n||void 0,errorMessage:i||void 0}});return{project:c,deliverables:_,isLoading:p,error:f,refetch:w,generateDeliverable:(0,e.useCallback)(async(e,s)=>{let n=(0,o.toWorkflowType)(e);try{let e=await (0,r.createGeneration)(t,{workflowType:n,context:s});u(t=>[...t,e])}catch(t){throw console.error("Failed to create generation:",t),t}},[t]),getDeliverableContent:(0,e.useCallback)(async t=>{let e=(0,o.toWorkflowType)(t),s=l.find(t=>t.workflowType===e);if(!s||"COMPLETED"!==s.status)return null;try{let t=await (0,r.getContentByGeneration)(s.id);if(0===t.length)return null;return(0,i.getContentText)(t[0])}catch(t){return console.error("Failed to fetch content:",t),null}},[l])}}},52555,t=>{"use strict";t.s(["createCheckoutSession",()=>f,"createGeneration",()=>u,"createProject",()=>a,"deleteProject",()=>h,"getBillingHistory",()=>y,"getContentByGeneration",()=>p,"getGenerations",()=>l,"getProject",()=>o,"getProjects",()=>i,"getPurchaseStatus",()=>m,"landingPagesApi",()=>b,"updateProject",()=>c,"validatePromoCode",()=>d,"verifyPurchase",()=>g]);var e=t.i(39041),r=t.i(2045),s=t.i(72244),n=t.i(70502);async function i(){let t=(0,e.getProjectsApi)();return(0,r.withErrorHandling)(()=>t.projectsControllerFindAll())}async function o(t){let s=(0,e.getProjectsApi)();return(0,r.withErrorHandling)(()=>s.projectsControllerFindOne({id:t}))}async function a(t){let s=(0,e.getProjectsApi)();return(0,r.withErrorHandling)(()=>s.projectsControllerCreate(t))}async function c(t,s){let n=(0,e.getProjectsApi)();return(0,r.withErrorHandling)(()=>n.projectsControllerUpdate({id:t},s))}async function h(t){let s=(0,e.getProjectsApi)();return(0,r.withErrorHandling)(()=>s.projectsControllerRemove({id:t}))}async function l(t){let s=(0,e.getProjectsApi)();return(0,r.withErrorHandling)(()=>s.generationsControllerFindByProject({projectId:t}))}async function u(t,i){let o=(0,e.getProjectsApi)();try{return await (0,r.withGenerationTimeout)(()=>o.generationsControllerCreate({projectId:t},i))}catch(t){if(t instanceof s.ApiError&&403===t.status)throw new n.PurchaseRequiredError;throw t}}async function p(t){let s=(0,e.getContentApi)();return(0,r.withErrorHandling)(()=>s.contentControllerFindByGeneration({generationId:t}))}async function d(t){let s=(0,e.getPromoCodesApi)();return(0,r.withErrorHandling)(()=>s.promoCodesControllerValidate({code:encodeURIComponent(t)}))}async function f(t){let s=(0,e.getCheckoutApi)();return(0,r.withErrorHandling)(()=>s.checkoutControllerCreateSession(t))}async function g(t){let s=(0,e.getCheckoutApi)();return(0,r.withErrorHandling)(()=>s.checkoutControllerVerifyPurchase({sessionId:encodeURIComponent(t)}))}async function m(){let t=(0,e.getCheckoutApi)();return(0,r.withErrorHandling)(()=>t.checkoutControllerGetPurchaseStatus())}async function y(){let t=(0,e.getCheckoutApi)();return(0,r.withErrorHandling)(()=>t.checkoutControllerGetBillingHistory())}let b={create:async(t,s)=>{let n=(0,e.getLandingPagesApi)();return(0,r.withErrorHandling)(()=>n.landingPagesControllerCreate({projectId:t,slug:s}))},getAll:async()=>{let t=(0,e.getLandingPagesApi)();return(0,r.withErrorHandling)(()=>t.landingPagesControllerFindAll())},getById:async t=>{let s=(0,e.getLandingPagesApi)();return(0,r.withErrorHandling)(()=>s.landingPagesControllerFindOne({id:t}))},delete:async t=>{let s=(0,e.getLandingPagesApi)();await (0,r.withErrorHandling)(()=>s.landingPagesControllerRemove({id:t}))},checkSlugAvailability:async t=>{let s=(0,e.getLandingPagesApi)();return(0,r.withErrorHandling)(()=>s.landingPagesControllerCheckSlugAvailability({slug:t}))},updateSlug:async(t,s)=>{let n=(0,e.getLandingPagesApi)();return(0,r.withErrorHandling)(()=>n.landingPagesControllerUpdateSlug({id:t},{slug:s}))},publish:async(t,s)=>{let n=(0,e.getLandingPagesApi)();return(0,r.withErrorHandling)(()=>n.landingPagesControllerPublish({id:t},{versionId:s}))},unpublish:async t=>{let s=(0,e.getLandingPagesApi)();await (0,r.withErrorHandling)(()=>s.landingPagesControllerUnpublish({id:t}))},getVersions:async t=>{let s=(0,e.getLandingPagesApi)();return(0,r.withErrorHandling)(()=>s.landingPagesControllerListVersions({id:t}))},createVersion:async(t,s,n,i)=>{let o=(0,e.getLandingPagesApi)();return(0,r.withErrorHandling)(()=>o.landingPagesControllerCreateVersion({id:t},{htmlContent:s,title:n,description:i}))},rollbackToVersion:async(t,s)=>{let n=(0,e.getLandingPagesApi)();return(0,r.withErrorHandling)(()=>n.landingPagesControllerRollbackToVersion({id:t,versionId:s}))},customDomain:{add:async(t,s)=>{let n=(0,e.getLandingPagesApi)();return(0,r.withErrorHandling)(()=>n.customDomainsControllerAddCustomDomain({id:t},{domain:s}))},get:async t=>{let s=(0,e.getLandingPagesApi)();return(0,r.withErrorHandling)(()=>s.customDomainsControllerGetCustomDomain({id:t}))},verify:async t=>{let s=(0,e.getLandingPagesApi)();return(0,r.withErrorHandling)(()=>s.customDomainsControllerVerifyDns({id:t}))},remove:async t=>{let s=(0,e.getLandingPagesApi)();await (0,r.withErrorHandling)(()=>s.customDomainsControllerRemoveCustomDomain({id:t}))}}}},30420,t=>{"use strict";var e=t.i(86325),r=t.i(72244);async function s(t,e){return(0,r.apiClient)(`/projects/${t}/agent/skills/run`,{method:"POST",body:JSON.stringify(e)})}async function n(t,e){return(0,r.apiClient)(`/projects/${t}/agent/message`,{method:"POST",body:JSON.stringify(e)})}async function i(t){return(0,r.apiClient)(`/projects/${t}/agent/workflow/status`)}class o{socket=null;projectId;eventHandlers=[];connectionPromise=null;connectionTimeoutId=null;isDisconnected=!1;constructor(t){this.projectId=t}connect(){return this.connectionPromise?this.connectionPromise:this.socket?.connected?Promise.resolve():(this.isDisconnected=!1,this.connectionPromise=new Promise((t,r)=>{this.socket=(0,e.io)("wss://backend-production-61d7.up.railway.app/
1agent",{withCredentials:!0,transports:["websocket","polling"],reconnection:!0,reconnectionAttempts:3,reconnectionDelay:1e3,timeout:1e4});let s=!1,n=()=>{this.connectionPromise=null,this.connectionTimeoutId=null};this.connectionTimeoutId=setTimeout(()=>{!this.isDisconnected&&(s||this.socket?.connected||(s=!0,n(),r(Error("Connection timeout"))))},1e4),this.socket.on("connect",()=>{!this.isDisconnected&&(s||(s=!0,this.connectionTimeoutId&&clearTimeout(this.connectionTimeoutId),this.socket?.emit("join_project",{projectId:this.projectId}),n(),t()))}),this.socket.on("agent_event",t=>{this.eventHandlers.forEach(e=>e(t))}),this.socket.on("connect_error",t=>{!this.isDisconnected&&(s||(s=!0,this.connectionTimeoutId&&clearTimeout(this.connectionTimeoutId),n(),r(Error(`Failed to connect: ${t.message}`))))}),this.socket.on("disconnect",()=>{}),this.socket.on("reconnect",()=>{}),this.socket.on("reconnect_error",()=>{})}),this.connectionPromise)}disconnect(){this.isDisconnected=!0,this.connectionTimeoutId&&(clearTimeout(this.connectionTimeoutId),this.connectionTimeoutId=null),this.connectionPromise=null,this.socket&&(this.socket.removeAllListeners(),this.socket.disconnect(),this.socket=null)}onEvent(t){this.eventHandlers.push(t)}offEvent(t){this.eventHandlers=this.eventHandlers.filter(e=>e!==t)}async runSkill(t){if(!this.socket?.connected)throw Error("Not connected to agent");this.socket.emit("run_skill",{projectId:this.projectId,dto:t})}async sendMessage(t){if(!this.socket?.connected)throw Error("Not connected to agent");this.socket.emit("send_message",{projectId:this.projectId,dto:t})}isConnected(){return this.socket?.connected??!1}}t.s(["AgentWebSocket",()=>o,"getWorkflowStatus",()=>i,"runSkill",()=>s,"sendMessage",()=>n])},87485,t=>{"use strict";var e=t.i(72244);async function r(t){return(0,e.apiClient)(`/projects/${t}/campaigns`)}async function s(t,r){return(0,e.apiClient)(`/projects/${t}/campaigns`,{method:"POST",body:JSON.stringify(r)})}async function n(t,r,s){return(0,e.apiClient)(`/projects/${t}/campaigns/${r}`,{method:"PATCH",body:JSON.stringify(s)})}async function i(t,r){return(0,e.apiClient)(`/projects/${t}/campaigns/${r}`,{method:"DELETE"})}async function o(t,r){return(0,e.apiClient)(`/projects/${t}/campaigns/${r}/publish`,{method:"POST"})}async function a(t){return(0,e.apiClient)(`/projects/${t}/campaigns/scheduled`)}async function c(t,r){return(0,e.apiClient)(`/projects/${t}/campaigns/scheduled/${r}`,{method:"DELETE"})}t.s(["cancelScheduledPost",()=>c,"createCampaign",()=>s,"deleteCampaign",()=>i,"getCampaigns",()=>r,"getScheduledPosts",()=>a,"publishCampaign",()=>o,"updateCampaign",()=>n])},69137,t=>{"use strict";t.s([],69137),t.i(72244),t.i(52555),t.i(30420),t.i(87485),t.i(27883)}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.