gearboxdownloadmodal 6.0.8 → 6.0.9
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/index.es.js +7 -4
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/insights.svg +14 -14
- package/dist/src/services/createReadyLink.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -47,7 +47,7 @@ Valid keys: `+JSON.stringify(Object.keys(g),null," "));var W=B(D,Q,z,V,R+"."+Q,
|
|
|
47
47
|
`).forEach(function(a){o=a.indexOf(":"),n=a.substring(0,o).trim().toLowerCase(),r=a.substring(o+1).trim(),!(!n||t[n]&&Ta[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},to=Symbol("internals");function bt(e){return e&&String(e).trim().toLowerCase()}function Tt(e){return e===!1||e==null?e:v.isArray(e)?e.map(Tt):String(e)}function Xa(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const Qa=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Wn(e,t,n,r,o){if(v.isFunction(r))return r.call(this,t,n);if(o&&(t=n),!!v.isString(t)){if(v.isString(r))return t.indexOf(r)!==-1;if(v.isRegExp(r))return r.test(t)}}function Pa(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function Va(e,t){const n=v.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(o,i,a){return this[r].call(this,t,o,i,a)},configurable:!0})})}class Ht{constructor(t){t&&this.set(t)}set(t,n,r){const o=this;function i(A,d,c){const s=bt(d);if(!s)throw new Error("header name must be a non-empty string");const m=v.findKey(o,s);(!m||o[m]===void 0||c===!0||c===void 0&&o[m]!==!1)&&(o[m||d]=Tt(A))}const a=(A,d)=>v.forEach(A,(c,s)=>i(c,s,d));return v.isPlainObject(t)||t instanceof this.constructor?a(t,n):v.isString(t)&&(t=t.trim())&&!Qa(t)?a(Ha(t),n):t!=null&&i(n,t,r),this}get(t,n){if(t=bt(t),t){const r=v.findKey(this,t);if(r){const o=this[r];if(!n)return o;if(n===!0)return Xa(o);if(v.isFunction(n))return n.call(this,o,r);if(v.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=bt(t),t){const r=v.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Wn(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let o=!1;function i(a){if(a=bt(a),a){const A=v.findKey(r,a);A&&(!n||Wn(r,r[A],A,n))&&(delete r[A],o=!0)}}return v.isArray(t)?t.forEach(i):i(t),o}clear(t){const n=Object.keys(this);let r=n.length,o=!1;for(;r--;){const i=n[r];(!t||Wn(this,this[i],i,t,!0))&&(delete this[i],o=!0)}return o}normalize(t){const n=this,r={};return v.forEach(this,(o,i)=>{const a=v.findKey(r,i);if(a){n[a]=Tt(o),delete n[i];return}const A=t?Pa(i):String(i).trim();A!==i&&delete n[i],n[A]=Tt(o),r[A]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return v.forEach(this,(r,o)=>{r!=null&&r!==!1&&(n[o]=t&&v.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
|
48
48
|
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(o=>r.set(o)),r}static accessor(t){const r=(this[to]=this[to]={accessors:{}}).accessors,o=this.prototype;function i(a){const A=bt(a);r[A]||(Va(o,a),r[A]=!0)}return v.isArray(t)?t.forEach(i):i(t),this}}Ht.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),v.reduceDescriptors(Ht.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),v.freezeMethods(Ht);const Re=Ht;function Mn(e,t){const n=this||Kn,r=t||n,o=Re.from(r.headers);let i=r.data;return v.forEach(e,function(A){i=A.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function no(e){return!!(e&&e.__CANCEL__)}function Ct(e,t,n){ee.call(this,e??"canceled",ee.ERR_CANCELED,t,n),this.name="CanceledError"}v.inherits(Ct,ee,{__CANCEL__:!0});function Ba(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new ee("Request failed with status code "+n.status,[ee.ERR_BAD_REQUEST,ee.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const Ua=Ne.isStandardBrowserEnv?function(){return{write:function(n,r,o,i,a,A){const d=[];d.push(n+"="+encodeURIComponent(r)),v.isNumber(o)&&d.push("expires="+new Date(o).toGMTString()),v.isString(i)&&d.push("path="+i),v.isString(a)&&d.push("domain="+a),A===!0&&d.push("secure"),document.cookie=d.join("; ")},read:function(n){const r=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return r?decodeURIComponent(r[3]):null},remove:function(n){this.write(n,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function Fa(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function _a(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function ro(e,t){return e&&!Fa(t)?_a(e,t):t}const $a=Ne.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function o(i){let a=i;return t&&(n.setAttribute("href",a),a=n.href),n.setAttribute("href",a),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=o(window.location.href),function(a){const A=v.isString(a)?o(a):a;return A.protocol===r.protocol&&A.host===r.host}}():function(){return function(){return!0}}();function eA(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function tA(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o=0,i=0,a;return t=t!==void 0?t:1e3,function(d){const c=Date.now(),s=r[i];a||(a=c),n[o]=d,r[o]=c;let m=i,y=0;for(;m!==o;)y+=n[m++],m=m%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),c-a<t)return;const h=s&&c-s;return h?Math.round(y*1e3/h):void 0}}function oo(e,t){let n=0;const r=tA(50,250);return o=>{const i=o.loaded,a=o.lengthComputable?o.total:void 0,A=i-n,d=r(A),c=i<=a;n=i;const s={loaded:i,total:a,progress:a?i/a:void 0,bytes:A,rate:d||void 0,estimated:d&&a&&c?(a-i)/d:void 0,event:o};s[t?"download":"upload"]=!0,e(s)}}const Sn={http:Ma,xhr:typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){let o=e.data;const i=Re.from(e.headers).normalize(),a=e.responseType;let A;function d(){e.cancelToken&&e.cancelToken.unsubscribe(A),e.signal&&e.signal.removeEventListener("abort",A)}let c;v.isFormData(o)&&(Ne.isStandardBrowserEnv||Ne.isStandardBrowserWebWorkerEnv?i.setContentType(!1):i.getContentType(/^\s*multipart\/form-data/)?v.isString(c=i.getContentType())&&i.setContentType(c.replace(/^\s*(multipart\/form-data);+/,"$1")):i.setContentType("multipart/form-data"));let s=new XMLHttpRequest;if(e.auth){const p=e.auth.username||"",q=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(p+":"+q))}const m=ro(e.baseURL,e.url);s.open(e.method.toUpperCase(),Fr(m,e.params,e.paramsSerializer),!0),s.timeout=e.timeout;function y(){if(!s)return;const p=Re.from("getAllResponseHeaders"in s&&s.getAllResponseHeaders()),b={data:!a||a==="text"||a==="json"?s.responseText:s.response,status:s.status,statusText:s.statusText,headers:p,config:e,request:s};Ba(function(k){n(k),d()},function(k){r(k),d()},b),s=null}if("onloadend"in s?s.onloadend=y:s.onreadystatechange=function(){!s||s.readyState!==4||s.status===0&&!(s.responseURL&&s.responseURL.indexOf("file:")===0)||setTimeout(y)},s.onabort=function(){s&&(r(new ee("Request aborted",ee.ECONNABORTED,e,s)),s=null)},s.onerror=function(){r(new ee("Network Error",ee.ERR_NETWORK,e,s)),s=null},s.ontimeout=function(){let q=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const b=e.transitional||$r;e.timeoutErrorMessage&&(q=e.timeoutErrorMessage),r(new ee(q,b.clarifyTimeoutError?ee.ETIMEDOUT:ee.ECONNABORTED,e,s)),s=null},Ne.isStandardBrowserEnv){const p=(e.withCredentials||$a(m))&&e.xsrfCookieName&&Ua.read(e.xsrfCookieName);p&&i.set(e.xsrfHeaderName,p)}o===void 0&&i.setContentType(null),"setRequestHeader"in s&&v.forEach(i.toJSON(),function(q,b){s.setRequestHeader(b,q)}),v.isUndefined(e.withCredentials)||(s.withCredentials=!!e.withCredentials),a&&a!=="json"&&(s.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&s.addEventListener("progress",oo(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&s.upload&&s.upload.addEventListener("progress",oo(e.onUploadProgress)),(e.cancelToken||e.signal)&&(A=p=>{s&&(r(!p||p.type?new Ct(null,e,s):p),s.abort(),s=null)},e.cancelToken&&e.cancelToken.subscribe(A),e.signal&&(e.signal.aborted?A():e.signal.addEventListener("abort",A)));const h=eA(m);if(h&&Ne.protocols.indexOf(h)===-1){r(new ee("Unsupported protocol "+h+":",ee.ERR_BAD_REQUEST,e));return}s.send(o||null)})}};v.forEach(Sn,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const io=e=>`- ${e}`,nA=e=>v.isFunction(e)||e===null||e===!1,ao={getAdapter:e=>{e=v.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let i=0;i<t;i++){n=e[i];let a;if(r=n,!nA(n)&&(r=Sn[(a=String(n)).toLowerCase()],r===void 0))throw new ee(`Unknown adapter '${a}'`);if(r)break;o[a||"#"+i]=r}if(!r){const i=Object.entries(o).map(([A,d])=>`adapter ${A} `+(d===!1?"is not supported by the environment":"is not available in the build"));let a=t?i.length>1?`since :
|
|
49
49
|
`+i.map(io).join(`
|
|
50
|
-
`):" "+io(i[0]):"as no adapter specified";throw new ee("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return r},adapters:Sn};function Ln(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ct(null,e)}function Ao(e){return Ln(e),e.headers=Re.from(e.headers),e.data=Mn.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),ao.getAdapter(e.adapter||Kn.adapter)(e).then(function(r){return Ln(e),r.data=Mn.call(e,e.transformResponse,r),r.headers=Re.from(r.headers),r},function(r){return no(r)||(Ln(e),r&&r.response&&(r.response.data=Mn.call(e,e.transformResponse,r.response),r.response.headers=Re.from(r.response.headers))),Promise.reject(r)})}const so=e=>e instanceof Re?e.toJSON():e;function st(e,t){t=t||{};const n={};function r(c,s,m){return v.isPlainObject(c)&&v.isPlainObject(s)?v.merge.call({caseless:m},c,s):v.isPlainObject(s)?v.merge({},s):v.isArray(s)?s.slice():s}function o(c,s,m){if(v.isUndefined(s)){if(!v.isUndefined(c))return r(void 0,c,m)}else return r(c,s,m)}function i(c,s){if(!v.isUndefined(s))return r(void 0,s)}function a(c,s){if(v.isUndefined(s)){if(!v.isUndefined(c))return r(void 0,c)}else return r(void 0,s)}function A(c,s,m){if(m in t)return r(c,s);if(m in e)return r(void 0,c)}const d={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:A,headers:(c,s)=>o(so(c),so(s),!0)};return v.forEach(Object.keys(Object.assign({},e,t)),function(s){const m=d[s]||o,y=m(e[s],t[s],s);v.isUndefined(y)&&m!==A||(n[s]=y)}),n}const lo="1.5.1",On={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{On[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const uo={};On.transitional=function(t,n,r){function o(i,a){return"[Axios v"+lo+"] Transitional option '"+i+"'"+a+(r?". "+r:"")}return(i,a,A)=>{if(t===!1)throw new ee(o(a," has been removed"+(n?" in "+n:"")),ee.ERR_DEPRECATED);return n&&!uo[a]&&(uo[a]=!0,console.warn(o(a," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,a,A):!0}};function rA(e,t,n){if(typeof e!="object")throw new ee("options must be an object",ee.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],a=t[i];if(a){const A=e[i],d=A===void 0||a(A,i,e);if(d!==!0)throw new ee("option "+i+" must be "+d,ee.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ee("Unknown option "+i,ee.ERR_BAD_OPTION)}}const En={assertOptions:rA,validators:On},Pe=En.validators;class Xt{constructor(t){this.defaults=t,this.interceptors={request:new _r,response:new _r}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=st(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:i}=n;r!==void 0&&En.assertOptions(r,{silentJSONParsing:Pe.transitional(Pe.boolean),forcedJSONParsing:Pe.transitional(Pe.boolean),clarifyTimeoutError:Pe.transitional(Pe.boolean)},!1),o!=null&&(v.isFunction(o)?n.paramsSerializer={serialize:o}:En.assertOptions(o,{encode:Pe.function,serialize:Pe.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=i&&v.merge(i.common,i[n.method]);i&&v.forEach(["delete","get","head","post","put","patch","common"],p=>{delete i[p]}),n.headers=Re.concat(a,i);const A=[];let d=!0;this.interceptors.request.forEach(function(q){typeof q.runWhen=="function"&&q.runWhen(n)===!1||(d=d&&q.synchronous,A.unshift(q.fulfilled,q.rejected))});const c=[];this.interceptors.response.forEach(function(q){c.push(q.fulfilled,q.rejected)});let s,m=0,y;if(!d){const p=[Ao.bind(this),void 0];for(p.unshift.apply(p,A),p.push.apply(p,c),y=p.length,s=Promise.resolve(n);m<y;)s=s.then(p[m++],p[m++]);return s}y=A.length;let h=n;for(m=0;m<y;){const p=A[m++],q=A[m++];try{h=p(h)}catch(b){q.call(this,b);break}}try{s=Ao.call(this,h)}catch(p){return Promise.reject(p)}for(m=0,y=c.length;m<y;)s=s.then(c[m++],c[m++]);return s}getUri(t){t=st(this.defaults,t);const n=ro(t.baseURL,t.url);return Fr(n,t.params,t.paramsSerializer)}}v.forEach(["delete","get","head","options"],function(t){Xt.prototype[t]=function(n,r){return this.request(st(r||{},{method:t,url:n,data:(r||{}).data}))}}),v.forEach(["post","put","patch"],function(t){function n(r){return function(i,a,A){return this.request(st(A||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:a}))}}Xt.prototype[t]=n(),Xt.prototype[t+"Form"]=n(!0)});const Qt=Xt;class kn{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(o=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](o);r._listeners=null}),this.promise.then=o=>{let i;const a=new Promise(A=>{r.subscribe(A),i=A}).then(o);return a.cancel=function(){r.unsubscribe(i)},a},t(function(i,a,A){r.reason||(r.reason=new Ct(i,a,A),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new kn(function(o){t=o}),cancel:t}}}const oA=kn;function iA(e){return function(n){return e.apply(null,n)}}function aA(e){return v.isObject(e)&&e.isAxiosError===!0}const Yn={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Yn).forEach(([e,t])=>{Yn[t]=e});const AA=Yn;function co(e){const t=new Qt(e),n=Yr(Qt.prototype.request,t);return v.extend(n,Qt.prototype,t,{allOwnKeys:!0}),v.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return co(st(e,o))},n}const me=co(Kn);me.Axios=Qt,me.CanceledError=Ct,me.CancelToken=oA,me.isCancel=no,me.VERSION=lo,me.toFormData=Gt,me.AxiosError=ee,me.Cancel=me.CanceledError,me.all=function(t){return Promise.all(t)},me.spread=iA,me.isAxiosError=aA,me.mergeConfig=st,me.AxiosHeaders=Re,me.formToJSON=e=>eo(v.isHTMLForm(e)?new FormData(e):e),me.getAdapter=ao.getAdapter,me.HttpStatusCode=AA,me.default=me;const sA=me;/*! typescript-cookie v1.0.6 | MIT */const mo=e=>encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),po=e=>encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent),zn=decodeURIComponent,jn=e=>(e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent));function lA(e){return e=Object.assign({},e),typeof e.expires=="number"&&(e.expires=new Date(Date.now()+e.expires*864e5)),e.expires!=null&&(e.expires=e.expires.toUTCString()),Object.entries(e).filter(([t,n])=>n!=null&&n!==!1).map(([t,n])=>n===!0?`; ${t}`:`; ${t}=${n.split(";")[0]}`).join("")}function fo(e,t,n){const r=/(?:^|; )([^=]*)=([^;]*)/g,o={};let i;for(;(i=r.exec(document.cookie))!=null;)try{const a=n(i[1]);if(o[a]=t(i[2],a),e===a)break}catch{}return e!=null?o[e]:o}const ho=Object.freeze({decodeName:zn,decodeValue:jn,encodeName:mo,encodeValue:po}),Jn=Object.freeze({path:"/"});function qo(e,t,n=Jn,{encodeValue:r=po,encodeName:o=mo}={}){return document.cookie=`${o(e)}=${r(t,e)}${lA(n)}`}function go(e,{decodeValue:t=jn,decodeName:n=zn}={}){return fo(e,t,n)}function uA({decodeValue:e=jn,decodeName:t=zn}={}){return fo(void 0,e,t)}function cA(e,t=Jn){qo(e,"",Object.assign({},t,{expires:-1}))}function Nn(e,t){const n={set:function(o,i,a){return qo(o,i,Object.assign({},this.attributes,a),{encodeValue:this.converter.write})},get:function(o){if(arguments.length===0)return uA(this.converter.read);if(o!=null)return go(o,this.converter.read)},remove:function(o,i){cA(o,Object.assign({},this.attributes,i))},withAttributes:function(o){return Nn(this.converter,Object.assign({},this.attributes,o))},withConverter:function(o){return Nn(Object.assign({},this.converter,o),this.attributes)}},r={attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}};return Object.create(n,r)}Nn({read:ho.decodeValue,write:ho.encodeValue},Jn);let yo;typeof window<"u"&&(yo=go("token"));const fe=sA.create({headers:{Authorization:yo}});async function dA(e,t,n){return(await fe.post(n+"/createFlexVersionLinkMulti",{_id:e,networks:t})).data}async function mA(e,t){return e.network=="fb"&&(e.zip=1),(await fe.post(t+"/createFlexVersionLink",e||{})).data}async function pA(e,t,n){return(await fe.post(e+"/createImportedVersionLink",{_id:t,network:n})).data}async function fA(e,t,n,r,o){return console.log(r),(await fe.post(e+"/createPlayableVersionLink",{_id:t,network:n,isPfTest:r,extras:o})).data}async function hA(e,t,n){return(await fe.post(n+"/createPlayableVersionLinkMulti",{_id:e,networks:t})).data}async function qA(e,t,n){return(await fe.post(e+"/createReadyVersionLink",{_id:t,network:n})).data}async function gA(e,t,n){return(await fe.post(n+"/createReadyVersionLinkMulti",{_id:e,networks:t})).data}async function vo(e,t){return(await fe.post(t+"/updateFlexUrl",e||{})).data}async function Pt(e,t,n){return(await fe.post(n+"/updatePlayableVersion",{...t,_id:e})).data}function Vt(e){const t=document.createElement("input");t.value=e,document.body.appendChild(t),t.select();try{return document.execCommand("copy")?(document.body.removeChild(t),!0):(document.body.removeChild(t),!1)}catch{return document.body.removeChild(t),!1}}function bo(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=bo(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function Ve(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=bo(e))&&(r&&(r+=" "),r+=t);return r}const Zt=e=>typeof e=="number"&&!isNaN(e),_e=e=>typeof e=="string",be=e=>typeof e=="function",Bt=e=>_e(e)||be(e)?e:null,Dn=e=>Z.isValidElement(e)||_e(e)||be(e)||Zt(e);function yA(e,t,n){n===void 0&&(n=300);const{scrollHeight:r,style:o}=e;requestAnimationFrame(()=>{o.minHeight="initial",o.height=r+"px",o.transition=`all ${n}ms`,requestAnimationFrame(()=>{o.height="0",o.padding="0",o.margin="0",setTimeout(t,n)})})}function Ut(e){let{enter:t,exit:n,appendPosition:r=!1,collapse:o=!0,collapseDuration:i=300}=e;return function(a){let{children:A,position:d,preventExitTransition:c,done:s,nodeRef:m,isIn:y}=a;const h=r?`${t}--${d}`:t,p=r?`${n}--${d}`:n,q=Z.useRef(0);return Z.useLayoutEffect(()=>{const b=m.current,K=h.split(" "),k=J=>{J.target===m.current&&(b.dispatchEvent(new Event("d")),b.removeEventListener("animationend",k),b.removeEventListener("animationcancel",k),q.current===0&&J.type!=="animationcancel"&&b.classList.remove(...K))};b.classList.add(...K),b.addEventListener("animationend",k),b.addEventListener("animationcancel",k)},[]),Z.useEffect(()=>{const b=m.current,K=()=>{b.removeEventListener("animationend",K),o?yA(b,s,i):s()};y||(c?K():(q.current=1,b.className+=` ${p}`,b.addEventListener("animationend",K)))},[y]),Z.createElement(Z.Fragment,null,A)}}function Co(e,t){return e!=null?{content:e.content,containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon,status:t}:{}}const Me={list:new Map,emitQueue:new Map,on(e,t){return this.list.has(e)||this.list.set(e,[]),this.list.get(e).push(t),this},off(e,t){if(t){const n=this.list.get(e).filter(r=>r!==t);return this.list.set(e,n),this}return this.list.delete(e),this},cancelEmit(e){const t=this.emitQueue.get(e);return t&&(t.forEach(clearTimeout),this.emitQueue.delete(e)),this},emit(e){this.list.has(e)&&this.list.get(e).forEach(t=>{const n=setTimeout(()=>{t(...[].slice.call(arguments,1))},0);this.emitQueue.has(e)||this.emitQueue.set(e,[]),this.emitQueue.get(e).push(n)})}},Ft=e=>{let{theme:t,type:n,...r}=e;return Z.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${n})`,...r})},Rn={info:function(e){return Z.createElement(Ft,{...e},Z.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(e){return Z.createElement(Ft,{...e},Z.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(e){return Z.createElement(Ft,{...e},Z.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(e){return Z.createElement(Ft,{...e},Z.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return Z.createElement("div",{className:"Toastify__spinner"})}};function vA(e){const[,t]=Z.useReducer(h=>h+1,0),[n,r]=Z.useState([]),o=Z.useRef(null),i=Z.useRef(new Map).current,a=h=>n.indexOf(h)!==-1,A=Z.useRef({toastKey:1,displayedToast:0,count:0,queue:[],props:e,containerId:null,isToastActive:a,getToast:h=>i.get(h)}).current;function d(h){let{containerId:p}=h;const{limit:q}=A.props;!q||p&&A.containerId!==p||(A.count-=A.queue.length,A.queue=[])}function c(h){r(p=>h==null?[]:p.filter(q=>q!==h))}function s(){const{toastContent:h,toastProps:p,staleId:q}=A.queue.shift();y(h,p,q)}function m(h,p){let{delay:q,staleId:b,...K}=p;if(!Dn(h)||function(F){return!o.current||A.props.enableMultiContainer&&F.containerId!==A.props.containerId||i.has(F.toastId)&&F.updateId==null}(K))return;const{toastId:k,updateId:J,data:S}=K,{props:C}=A,U=()=>c(k),ne=J==null;ne&&A.count++;const P={...C,style:C.toastStyle,key:A.toastKey++,...Object.fromEntries(Object.entries(K).filter(F=>{let[H,M]=F;return M!=null})),toastId:k,updateId:J,data:S,closeToast:U,isIn:!1,className:Bt(K.className||C.toastClassName),bodyClassName:Bt(K.bodyClassName||C.bodyClassName),progressClassName:Bt(K.progressClassName||C.progressClassName),autoClose:!K.isLoading&&(Ae=K.autoClose,se=C.autoClose,Ae===!1||Zt(Ae)&&Ae>0?Ae:se),deleteToast(){const F=Co(i.get(k),"removed");i.delete(k),Me.emit(4,F);const H=A.queue.length;if(A.count=k==null?A.count-A.displayedToast:A.count-1,A.count<0&&(A.count=0),H>0){const M=k==null?A.props.limit:1;if(H===1||M===1)A.displayedToast++,s();else{const O=M>H?H:M;A.displayedToast=O;for(let j=0;j<O;j++)s()}}else t()}};var Ae,se;P.iconOut=function(F){let{theme:H,type:M,isLoading:O,icon:j}=F,f=null;const E={theme:H,type:M};return j===!1||(be(j)?f=j(E):Z.isValidElement(j)?f=Z.cloneElement(j,E):_e(j)||Zt(j)?f=j:O?f=Rn.spinner():(N=>N in Rn)(M)&&(f=Rn[M](E))),f}(P),be(K.onOpen)&&(P.onOpen=K.onOpen),be(K.onClose)&&(P.onClose=K.onClose),P.closeButton=C.closeButton,K.closeButton===!1||Dn(K.closeButton)?P.closeButton=K.closeButton:K.closeButton===!0&&(P.closeButton=!Dn(C.closeButton)||C.closeButton);let re=h;Z.isValidElement(h)&&!_e(h.type)?re=Z.cloneElement(h,{closeToast:U,toastProps:P,data:S}):be(h)&&(re=h({closeToast:U,toastProps:P,data:S})),C.limit&&C.limit>0&&A.count>C.limit&&ne?A.queue.push({toastContent:re,toastProps:P,staleId:b}):Zt(q)?setTimeout(()=>{y(re,P,b)},q):y(re,P,b)}function y(h,p,q){const{toastId:b}=p;q&&i.delete(q);const K={content:h,props:p};i.set(b,K),r(k=>[...k,b].filter(J=>J!==q)),Me.emit(4,Co(K,K.props.updateId==null?"added":"updated"))}return Z.useEffect(()=>(A.containerId=e.containerId,Me.cancelEmit(3).on(0,m).on(1,h=>o.current&&c(h)).on(5,d).emit(2,A),()=>{i.clear(),Me.emit(3,A)}),[]),Z.useEffect(()=>{A.props=e,A.isToastActive=a,A.displayedToast=n.length}),{getToastToRender:function(h){const p=new Map,q=Array.from(i.values());return e.newestOnTop&&q.reverse(),q.forEach(b=>{const{position:K}=b.props;p.has(K)||p.set(K,[]),p.get(K).push(b)}),Array.from(p,b=>h(b[0],b[1]))},containerRef:o,isToastActive:a}}function Zo(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientX:e.clientX}function Io(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientY:e.clientY}function bA(e){const[t,n]=Z.useState(!1),[r,o]=Z.useState(!1),i=Z.useRef(null),a=Z.useRef({start:0,x:0,y:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,boundingRect:null,didMove:!1}).current,A=Z.useRef(e),{autoClose:d,pauseOnHover:c,closeToast:s,onClick:m,closeOnClick:y}=e;function h(S){if(e.draggable){S.nativeEvent.type==="touchstart"&&S.nativeEvent.preventDefault(),a.didMove=!1,document.addEventListener("mousemove",K),document.addEventListener("mouseup",k),document.addEventListener("touchmove",K),document.addEventListener("touchend",k);const C=i.current;a.canCloseOnClick=!0,a.canDrag=!0,a.boundingRect=C.getBoundingClientRect(),C.style.transition="",a.x=Zo(S.nativeEvent),a.y=Io(S.nativeEvent),e.draggableDirection==="x"?(a.start=a.x,a.removalDistance=C.offsetWidth*(e.draggablePercent/100)):(a.start=a.y,a.removalDistance=C.offsetHeight*(e.draggablePercent===80?1.5*e.draggablePercent:e.draggablePercent/100))}}function p(S){if(a.boundingRect){const{top:C,bottom:U,left:ne,right:P}=a.boundingRect;S.nativeEvent.type!=="touchend"&&e.pauseOnHover&&a.x>=ne&&a.x<=P&&a.y>=C&&a.y<=U?b():q()}}function q(){n(!0)}function b(){n(!1)}function K(S){const C=i.current;a.canDrag&&C&&(a.didMove=!0,t&&b(),a.x=Zo(S),a.y=Io(S),a.delta=e.draggableDirection==="x"?a.x-a.start:a.y-a.start,a.start!==a.x&&(a.canCloseOnClick=!1),C.style.transform=`translate${e.draggableDirection}(${a.delta}px)`,C.style.opacity=""+(1-Math.abs(a.delta/a.removalDistance)))}function k(){document.removeEventListener("mousemove",K),document.removeEventListener("mouseup",k),document.removeEventListener("touchmove",K),document.removeEventListener("touchend",k);const S=i.current;if(a.canDrag&&a.didMove&&S){if(a.canDrag=!1,Math.abs(a.delta)>a.removalDistance)return o(!0),void e.closeToast();S.style.transition="transform 0.2s, opacity 0.2s",S.style.transform=`translate${e.draggableDirection}(0)`,S.style.opacity="1"}}Z.useEffect(()=>{A.current=e}),Z.useEffect(()=>(i.current&&i.current.addEventListener("d",q,{once:!0}),be(e.onOpen)&&e.onOpen(Z.isValidElement(e.children)&&e.children.props),()=>{const S=A.current;be(S.onClose)&&S.onClose(Z.isValidElement(S.children)&&S.children.props)}),[]),Z.useEffect(()=>(e.pauseOnFocusLoss&&(document.hasFocus()||b(),window.addEventListener("focus",q),window.addEventListener("blur",b)),()=>{e.pauseOnFocusLoss&&(window.removeEventListener("focus",q),window.removeEventListener("blur",b))}),[e.pauseOnFocusLoss]);const J={onMouseDown:h,onTouchStart:h,onMouseUp:p,onTouchEnd:p};return d&&c&&(J.onMouseEnter=b,J.onMouseLeave=q),y&&(J.onClick=S=>{m&&m(S),a.canCloseOnClick&&s()}),{playToast:q,pauseToast:b,isRunning:t,preventExitTransition:r,toastRef:i,eventHandlers:J}}function wo(e){let{closeToast:t,theme:n,ariaLabel:r="close"}=e;return Z.createElement("button",{className:`Toastify__close-button Toastify__close-button--${n}`,type:"button",onClick:o=>{o.stopPropagation(),t(o)},"aria-label":r},Z.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},Z.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}function CA(e){let{delay:t,isRunning:n,closeToast:r,type:o="default",hide:i,className:a,style:A,controlledProgress:d,progress:c,rtl:s,isIn:m,theme:y}=e;const h=i||d&&c===0,p={...A,animationDuration:`${t}ms`,animationPlayState:n?"running":"paused",opacity:h?0:1};d&&(p.transform=`scaleX(${c})`);const q=Ve("Toastify__progress-bar",d?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${y}`,`Toastify__progress-bar--${o}`,{"Toastify__progress-bar--rtl":s}),b=be(a)?a({rtl:s,type:o,defaultClassName:q}):Ve(q,a);return Z.createElement("div",{role:"progressbar","aria-hidden":h?"true":"false","aria-label":"notification timer",className:b,style:p,[d&&c>=1?"onTransitionEnd":"onAnimationEnd"]:d&&c<1?null:()=>{m&&r()}})}const ZA=e=>{const{isRunning:t,preventExitTransition:n,toastRef:r,eventHandlers:o}=bA(e),{closeButton:i,children:a,autoClose:A,onClick:d,type:c,hideProgressBar:s,closeToast:m,transition:y,position:h,className:p,style:q,bodyClassName:b,bodyStyle:K,progressClassName:k,progressStyle:J,updateId:S,role:C,progress:U,rtl:ne,toastId:P,deleteToast:Ae,isIn:se,isLoading:re,iconOut:F,closeOnClick:H,theme:M}=e,O=Ve("Toastify__toast",`Toastify__toast-theme--${M}`,`Toastify__toast--${c}`,{"Toastify__toast--rtl":ne},{"Toastify__toast--close-on-click":H}),j=be(p)?p({rtl:ne,position:h,type:c,defaultClassName:O}):Ve(O,p),f=!!U||!A,E={closeToast:m,type:c,theme:M};let N=null;return i===!1||(N=be(i)?i(E):Z.isValidElement(i)?Z.cloneElement(i,E):wo(E)),Z.createElement(y,{isIn:se,done:Ae,position:h,preventExitTransition:n,nodeRef:r},Z.createElement("div",{id:P,onClick:d,className:j,...o,style:q,ref:r},Z.createElement("div",{...se&&{role:C},className:be(b)?b({type:c}):Ve("Toastify__toast-body",b),style:K},F!=null&&Z.createElement("div",{className:Ve("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!re})},F),Z.createElement("div",null,a)),N,Z.createElement(CA,{...S&&!f?{key:`pb-${S}`}:{},rtl:ne,theme:M,delay:A,isRunning:t,isIn:se,closeToast:m,hide:s,type:c,style:J,className:k,controlledProgress:f,progress:U||0})))},_t=function(e,t){return t===void 0&&(t=!1),{enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}},IA=Ut(_t("bounce",!0));Ut(_t("slide",!0)),Ut(_t("zoom")),Ut(_t("flip"));const Gn=Z.forwardRef((e,t)=>{const{getToastToRender:n,containerRef:r,isToastActive:o}=vA(e),{className:i,style:a,rtl:A,containerId:d}=e;function c(s){const m=Ve("Toastify__toast-container",`Toastify__toast-container--${s}`,{"Toastify__toast-container--rtl":A});return be(i)?i({position:s,rtl:A,defaultClassName:m}):Ve(m,Bt(i))}return Z.useEffect(()=>{t&&(t.current=r.current)},[]),Z.createElement("div",{ref:r,className:"Toastify",id:d},n((s,m)=>{const y=m.length?{...a}:{...a,pointerEvents:"none"};return Z.createElement("div",{className:c(s),style:y,key:`container-${s}`},m.map((h,p)=>{let{content:q,props:b}=h;return Z.createElement(ZA,{...b,isIn:o(b.toastId),style:{...b.style,"--nth":p+1,"--len":m.length},key:`toast-${b.key}`},q)}))}))});Gn.displayName="ToastContainer",Gn.defaultProps={position:"top-right",transition:IA,autoClose:5e3,closeButton:wo,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,draggable:!0,draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};let Tn,$e=new Map,It=[],wA=1;function xo(){return""+wA++}function xA(e){return e&&(_e(e.toastId)||Zt(e.toastId))?e.toastId:xo()}function wt(e,t){return $e.size>0?Me.emit(0,e,t):It.push({content:e,options:t}),t.toastId}function $t(e,t){return{...t,type:t&&t.type||e,toastId:xA(t)}}function en(e){return(t,n)=>wt(t,$t(e,n))}function ce(e,t){return wt(e,$t("default",t))}ce.loading=(e,t)=>wt(e,$t("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),ce.promise=function(e,t,n){let r,{pending:o,error:i,success:a}=t;o&&(r=_e(o)?ce.loading(o,n):ce.loading(o.render,{...n,...o}));const A={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},d=(s,m,y)=>{if(m==null)return void ce.dismiss(r);const h={type:s,...A,...n,data:y},p=_e(m)?{render:m}:m;return r?ce.update(r,{...h,...p}):ce(p.render,{...h,...p}),y},c=be(e)?e():e;return c.then(s=>d("success",a,s)).catch(s=>d("error",i,s)),c},ce.success=en("success"),ce.info=en("info"),ce.error=en("error"),ce.warning=en("warning"),ce.warn=ce.warning,ce.dark=(e,t)=>wt(e,$t("default",{theme:"dark",...t})),ce.dismiss=e=>{$e.size>0?Me.emit(1,e):It=It.filter(t=>e!=null&&t.options.toastId!==e)},ce.clearWaitingQueue=function(e){return e===void 0&&(e={}),Me.emit(5,e)},ce.isActive=e=>{let t=!1;return $e.forEach(n=>{n.isToastActive&&n.isToastActive(e)&&(t=!0)}),t},ce.update=function(e,t){t===void 0&&(t={}),setTimeout(()=>{const n=function(r,o){let{containerId:i}=o;const a=$e.get(i||Tn);return a&&a.getToast(r)}(e,t);if(n){const{props:r,content:o}=n,i={delay:100,...r,...t,toastId:t.toastId||e,updateId:xo()};i.toastId!==e&&(i.staleId=e);const a=i.render||o;delete i.render,wt(a,i)}},0)},ce.done=e=>{ce.update(e,{progress:1})},ce.onChange=e=>(Me.on(4,e),()=>{Me.off(4,e)}),ce.POSITION={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},ce.TYPE={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},Me.on(2,e=>{Tn=e.containerId||e,$e.set(Tn,e),It.forEach(t=>{Me.emit(0,t.content,t.options)}),It=[]}).on(3,e=>{$e.delete(e.containerId||e),$e.size===0&&Me.off(0).off(1).off(5)});function xt(e){ce.success(e,{position:"top-center",autoClose:650,hideProgressBar:!0,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0,theme:"light"})}let Hn="",et="Playable",Ce=null,Ko=null;const tn=async e=>{let t=Hn+"/"+e,n=e;fetch(t).then(r=>r.blob()).then(r=>{const o=window.URL.createObjectURL(r),i=document.createElement("a");i.href=o,i.download=n.split("/").reduce((a,A)=>A,""),document.body.appendChild(i),i.click(),window.URL.revokeObjectURL(o),xt("Download successfully")}).catch(r=>{console.error("File error:",r)})},KA=(e,t)=>{let n=Hn+"/"+e;Vt(n)?xt("Link Copied"):t(n)};async function nn(e,t,n,r="download",o=!1,i=null){return new Promise(async(a,A)=>{let d=async c=>{r==="download"?await tn(c):r==="copy"&&KA(c,Ko)};et==="Playable"?(n&&await Pt(e,{iosLink:n==null?void 0:n.iosUrl,androidLink:n==null?void 0:n.googleUrl},Ce),fA(Ce,e,t,o,i).then(async c=>{let{url:s}=c;await d(s),a(c)}).catch(c=>{let s=c.response.data.error.msg;A({message:s})})):et==="Flex"?(n&&await vo({_id:e,iosLink:n==null?void 0:n.iosUrl,androidLink:n==null?void 0:n.googleUrl},Ce),mA({_id:e,network:t},Ce).then(async c=>{if(c.message){A(c);return}let{url:s}=c;await d(s),a(c)}).catch(c=>{let s=c.response.data.error.msg;A({message:s})})):et==="Import"?pA(Ce,e,t).then(async c=>{let s=c.url;await d(s),a(c)}).catch(c=>{let s=c.response.data.error.msg;A({message:s})}):et==="Ready"&&(n&&await Pt(e,{iosLink:n==null?void 0:n.iosUrl,androidLink:n==null?void 0:n.googleUrl},Ce),qA(Ce,e,t).then(async c=>{if(c.message){A(c);return}let s=c.url;await d(s),a(c)}).catch(c=>{let s=c.response.data.error.msg;A({message:s})}))})}async function WA(e,t,n){return new Promise(async(r,o)=>{console.log("get multi download"),et==="Flex"?(await vo({_id:e,iosLink:t==null?void 0:t.iosUrl,androidLink:t==null?void 0:t.googleUrl},Ce),dA(e,n,Ce).then(async i=>{if(i.message){o(i);return}await tn(i.url),r(i.url)}).catch(i=>{let a=i.response.data.error.msg;o({message:a})})):et==="Ready"?(console.log("ready"),await Pt(e,{iosLink:t==null?void 0:t.iosUrl,androidLink:t==null?void 0:t.googleUrl},Ce),console.log("ready link multi"),gA(e,n,Ce).then(async i=>{if(console.log("res",i),i.message){o(i);return}await tn(i.url),r(i.url)}).catch(i=>{console.log("err",i);let a=i.response.data.error.msg;o({message:a})})):(await Pt(e,{iosLink:t==null?void 0:t.iosUrl,androidLink:t==null?void 0:t.googleUrl},Ce),hA(e,n,Ce).then(async i=>{await tn(i.url),r(i.url)}).catch(i=>{let a=i.response.data.error.msg;o({message:a})}))})}function MA(e,t,n,r){et=e,Ce=t,Ko=n,Hn=r}const SA=({versionId:e,typeOfProduct:t,copyLinkUrl:n,setSafariCopyLink:r,qrUrl:o})=>{const[i,a]=Z.useState(!1),A=async()=>{a(!0),nn(e,"default",null,null,!1).then(d=>{a(!1);let c;t==="Flex"?c=`${n}/preview?versionId=${e}`:t==="Import"?c=`${n}/preview?versionId=${e}_`:t==="Ready"?c=`${n}/preview?versionId=${e}_&ready=true`:c=`${n}/preview?versionId=${e}_`,Vt(c)?xt("Link copied"):r(c),a(!1)}).catch(d=>{a(!1)})};return console.log(o),l.jsxs("div",{style:{display:"flex",height:"125px",width:"100%",borderRadius:"10px",backgroundColor:"#000000",padding:"10px"},children:[l.jsx("div",{style:{marginRight:"0.75rem",width:"50%",display:"flex",justifyContent:"center",alignItems:"center"},children:o?l.jsx(Bi,{bgColor:"#0F0F1E",fgColor:"#ffffff",style:{height:"auto",maxWidth:"100%",width:"100%"},value:o}):l.jsx("img",{style:{width:"50px",height:"50px"},src:Qe,alt:"pf-logo-gif"})}),l.jsxs("div",{children:[l.jsx("div",{style:{marginBottom:"0.25rem",fontSize:"0.875rem",fontWeight:"bold",color:"white"},children:"Mobile testing"}),l.jsx("div",{style:{marginBottom:"1rem",fontSize:"0.75rem",color:"gray"},children:"Scan QR Code to test in any browser"}),l.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"0.375rem",backgroundColor:"#00a3ff57",color:"secondary-blue",cursor:"pointer"},onClick:()=>{i||A()},children:[l.jsx(kr,{style:{height:"1.5rem",width:"1.5rem",stroke:"secondary-blue",color:"white"}}),l.jsx("div",{style:{height:"24px",display:"flex",alignItems:"center",justifyContent:"center",width:"80px"},children:i?l.jsx("img",{style:{height:"90%"},src:Qe,alt:"loading"}):l.jsx("button",{style:{fontSize:"1rem",color:"white",background:"rgba(0, 163, 255, 0)"},children:"Copy Link"})})]})]})]})},LA=({versionName:e,versionId:t,typeOfProduct:n,api:r,iframeUrl:o,fetchFileUrl:i,copyLinkUrl:a,setSafariCopyLink:A})=>{const[d,c]=Z.useState(window.innerWidth);Z.useEffect(()=>{const m=()=>{c(window.innerWidth)};return window.addEventListener("resize",m),()=>{window.removeEventListener("resize",m)}},[]);const s=(e==null?void 0:e.length)>25?e.slice(0,25)+"...":e;return l.jsxs("div",{style:{display:"flex",width:"300px",flexDirection:"column",justifyContent:"space-between",padding:"5px",height:d>1440?"680px":"620px",borderRadius:"0px 0px 0px 16px",marginTop:"20px"},children:[l.jsx(mi,{iframeUrl:o}),l.jsx(pi,{name:s}),l.jsx(SA,{versionId:t,typeOfProduct:n,copyLinkUrl:a,setSafariCopyLink:A,qrUrl:o})]})};var he=(e=>(e.Flex="#7101FF",e.Playable="#F9830B",e.Import="#00a3ff",e.Ready="#0060A5",e))(he||{});const OA=({typeOfProduct:e})=>l.jsxs("div",{style:{fontSize:"2xl",fontWeight:"bold"},children:[l.jsx("span",{style:{color:he[e]},children:"Select a Network"}),l.jsx("span",{style:{whiteSpace:"pre"},children:" From List"})]});async function EA(e,t){return(await fe.post(t+"/buyRequest",{requestType:e})).data}const kA=()=>l.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[l.jsxs("g",{"clip-path":"url(#clip0_518_12094)",children:[l.jsx("path",{d:"M4.50977 11.99L19.4898 11.99",stroke:"#7101FF","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),l.jsx("path",{d:"M13.5068 17.977L19.4828 12L13.5068 6.02299",stroke:"#7101FF","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})]}),l.jsx("defs",{children:l.jsx("clipPath",{id:"clip0_518_12094",children:l.jsx("rect",{width:"24",height:"24",fill:"white",transform:"translate(0 24) rotate(-90)"})})})]}),YA=({creditDownload:e,api:t})=>l.jsxs(l.Fragment,{children:[l.jsx("div",{style:{marginTop:"0.5rem",paddingLeft:"1.5rem",paddingRight:"1.5rem",fontWeight:100},children:"If you continue to export, you will spend 1 credit."}),l.jsxs("div",{style:{display:"flex",alignItems:"center",width:"100%",paddingLeft:"1.5rem",paddingRight:"1.5rem",paddingTop:"0.25rem",fontSize:"12px",fontWeight:100},children:["You have"," ",l.jsx("span",{style:{paddingLeft:"0.25rem",paddingRight:"0.25rem",fontWeight:"bold",color:"#yourColorHere"},children:(e==null?void 0:e.downloadLimit)-(e==null?void 0:e.downloadLimitUsed)<0?0:(e==null?void 0:e.downloadLimit)-(e==null?void 0:e.downloadLimitUsed)})," ","credits remaining.",l.jsxs("button",{style:{marginLeft:"0.5rem",display:"flex",alignItems:"center",fontSize:"12px",fontWeight:"bold",textDecoration:"underline",color:"#yourColorHere"},onClick:()=>EA("Flex Credit",t).then(n=>xt("You will be contacted regarding your request.")),children:["Get more",l.jsx(kA,{})]})]})]}),Wo=({typeOfProduct:e,urls:t,handleIosChange:n,handleGoogleChange:r,disabled:o})=>{const i=A=>{n(A.target.value)},a=A=>{r(A.target.value)};return l.jsxs(l.Fragment,{children:[l.jsxs("div",{style:{display:"flex",height:"2rem",width:"100%",alignItems:"center",fontSize:"12px",fontWeight:"200"},children:[l.jsx("span",{style:{width:"5rem",fontWeight:"bold"},children:"App Store:"}),l.jsx("input",{style:{marginLeft:"1.25rem",display:"flex",height:"100%",width:"70%",alignItems:"center",borderRadius:"0.375rem",border:t.iosUrl?"1px solid lightgray":"1px solid red",paddingLeft:"0.5rem",color:"#000000",borderColor:he[e]},type:"text",value:t.iosUrl,onChange:i,placeholder:"Ios Url",disabled:o})]}),l.jsxs("div",{style:{marginTop:"0.5rem",display:"flex",height:"2rem",width:"100%",alignItems:"center",fontSize:"12px",fontWeight:"100"},children:[l.jsxs("span",{style:{width:"5rem",fontWeight:"bold"},children:["Google Play:"," "]}),l.jsx("input",{style:{marginLeft:"1.25rem",display:"flex",height:"100%",width:"70%",alignItems:"center",borderRadius:"0.375rem",border:t.googleUrl?"1px solid lightgray":"1px solid red",paddingLeft:"0.5rem",color:"#000000",borderColor:he[e]},type:"text",value:t.googleUrl,onChange:a,placeholder:"Google Url",disabled:o})]})]})},zA=({typeOfProduct:e,urls:t,handleIosChange:n,handleGoogleChange:r,disabled:o})=>{const i=a=>{n(a.target.value)};return l.jsx(l.Fragment,{children:l.jsxs("div",{style:{display:"flex",height:"2rem",width:"100%",alignItems:"center",fontSize:"12px",fontWeight:"200"},children:[l.jsx("span",{style:{width:"5rem",fontWeight:"bold"},children:"Redirection URL:"}),l.jsx("input",{style:{marginLeft:"1.25rem",display:"flex",height:"100%",width:"70%",alignItems:"center",borderRadius:"0.375rem",border:t.iosUrl?"1px solid lightgray":"1px solid red",paddingLeft:"0.5rem",color:"#000000",borderColor:he[e]},type:"text",value:t.iosUrl,onChange:i,placeholder:"Ios Url",disabled:o})]})})},jA=({typeOfProduct:e,fileSize:t,urls:n,handleIosChange:r,handleGoogleChange:o,disabled:i,api:a,creditDownload:A,user:d,isTest:c,setIsTest:s,urlType:m,setUrlType:y})=>{const h=()=>l.jsxs("div",{style:{display:"flex",height:"24px",width:"100%",alignItems:"center",fontSize:"12px",fontWeight:"100"},children:[l.jsxs("span",{style:{width:"5rem",fontWeight:"bold"},children:["Enable Test:"," "]}),l.jsx("input",{style:{marginLeft:"1.25rem",display:"flex",height:"100%",width:"20px",alignItems:"center",borderRadius:"0.375rem",border:n.googleUrl?"1px solid lightgray":"1px solid red",paddingLeft:"0.5rem",color:"#000000",borderColor:he[e]},type:"checkbox",checked:c,onChange:()=>{s(!c)},placeholder:"Google Url",disabled:i})]}),p=()=>l.jsx(l.Fragment,{children:l.jsxs("div",{style:{display:"flex",width:"400px",height:"30px",flexDirection:"row",justifyContent:"space-between",alignItems:"center",borderBottom:"1px solid #eaeaec",marginBottom:"10px",position:"relative"},className:"tab-switch",children:[l.jsx("div",{style:{position:"absolute",bottom:"-3px",left:m==="single"?"50%":"0%",width:"50%",height:"3px",borderRadius:"2px",backgroundColor:"#12a9fe",transition:"all 0.2s ease-in-out"},id:"tab-switch-background"}),l.jsx("div",{style:{width:"50%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",position:"relative"},onClick:()=>{document.getElementById("tab-switch-background").style.left="0%",document.getElementById("single-tab").style.color="#a3a3a3",document.getElementById("game-tab").style.color="#000",document.getElementById("single-tab").style.fontWeight="normal",document.getElementById("game-tab").style.fontWeight="bold",setTimeout(()=>{y("game")},200)},children:l.jsx("span",{style:{position:"relative",color:m==="game"?"#000":"#a3a3a3",fontWeight:m==="game"?"bold":"normal",transition:"all 0.2s ease-in-out"},id:"game-tab",children:"App"})},"gameTab"),l.jsx("div",{style:{width:"50%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",position:"relative"},onClick:()=>{document.getElementById("tab-switch-background").style.left="50%",document.getElementById("single-tab").style.color="#000",document.getElementById("game-tab").style.color="#a3a3a3",document.getElementById("single-tab").style.fontWeight="bold",document.getElementById("game-tab").style.fontWeight="normal",setTimeout(()=>{y("single")},200)},children:l.jsx("span",{style:{position:"relative",color:m==="single"?"#000":"#a3a3a3",fontWeight:m==="single"?"bold":"normal",transition:"all 0.2s ease-in-out"},id:"single-tab",children:"Website"})},"singleTab")]})});return l.jsx(l.Fragment,{children:e!=="Import"&&l.jsxs("div",{style:{display:"flex",width:"100%",flexDirection:"column"},children:[d.customer=="playableFactoryInternal"&&e==="Playable"&&l.jsx(h,{}),e==="Ready"?l.jsxs(l.Fragment,{children:[l.jsx(p,{}),m==="game"&&l.jsx(Wo,{typeOfProduct:e,urls:n,handleIosChange:r,handleGoogleChange:o,disabled:i}),m==="single"&&l.jsx(zA,{typeOfProduct:e,urls:n,handleIosChange:r,handleGoogleChange:o,disabled:i})]}):l.jsx(l.Fragment,{children:l.jsx(Wo,{typeOfProduct:e,urls:n,handleIosChange:r,handleGoogleChange:o,disabled:i})}),(A==null?void 0:A.willSpendCredit)&&l.jsx(YA,{creditDownload:A,api:a})]})})},JA=({typeOfProduct:e,title:t,fileSize:n})=>l.jsxs("div",{style:{fontSize:"1.5rem",fontWeight:"bold",paddingTop:"20px"},children:[l.jsx("span",{style:{color:he[e]},children:t}),n&&l.jsxs("span",{style:{fontSize:"14px",fontWeight:"bold",marginLeft:"30px",color:"#87878E"},children:["File size: ",parseFloat(n).toFixed(2)," mb"]})]}),NA=({typeOfProduct:e,fileSize:t,urls:n,title:r,handleIosChange:o,handleGoogleChange:i,disabled:a,creditDownload:A,api:d,user:c,isTest:s,setIsTest:m,urlType:y,setUrlType:h})=>l.jsxs("div",{style:{display:"flex",flexDirection:"column",width:"100%",justifyContent:"space-between",alignItems:"flex-start",borderBottom:"1px solid #D1D5DB",paddingLeft:"1.25rem",paddingRight:"1.25rem",gap:"0.5rem"},children:[l.jsx(JA,{typeOfProduct:e,title:r,fileSize:t}),l.jsx(jA,{typeOfProduct:e,fileSize:t,urls:n,handleIosChange:o,handleGoogleChange:i,disabled:a,creditDownload:A,api:d,user:c,isTest:s,setIsTest:m,urlType:y,setUrlType:h}),l.jsx(OA,{typeOfProduct:e})]}),Xn=({children:e,className:t,onClickDonwload:n,downloading:r,disabled:o})=>l.jsx("button",{onClick:n,className:t,style:{display:"flex",height:"40px",alignItems:"center",justifyContent:"center",borderRadius:"0.375rem",border:"1px solid lightgray",padding:"0.25rem",fontSize:"0.875rem",width:200,backgroundColor:"#FFFFFF"},disabled:r||o,children:e}),DA=({checked:e,typeOfProduct:t,id:n})=>{const[r,o]=Z.useState(e);Z.useEffect(()=>{o(e)},[e]);const i=()=>{o(!r)};return l.jsx("div",{style:{display:"inline-flex",alignItems:"center"},children:l.jsxs("label",{onClick:i,style:{position:"relative",display:"flex",cursor:"pointer",alignItems:"center"},htmlFor:n,children:[l.jsx("input",{type:"checkbox",style:{position:"relative",height:"20px",width:"20px",cursor:"pointer",appearance:"none",borderRadius:"0.25rem",transition:"all ease-in-out",border:"1px solid lightgray",opacity:1},id:n,checked:r,onChange:i}),l.jsxs("div",{style:{pointerEvents:"none",position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:"white",opacity:r?1:0,transition:"opacity ease-in-out"},children:[l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",style:{height:"14px",width:"14px"},viewBox:"0 0 20 20",fill:he[t],stroke:he[t],strokeWidth:"1",children:l.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})," "]})]})})},jl="",RA=({typeOfProduct:e})=>l.jsx("div",{style:{backgroundColor:"transparent",display:"flex",alignItems:"center",flexDirection:"column"},children:l.jsxs("div",{style:{position:"relative",width:"64px",height:"16px",marginTop:"8px"},children:[l.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:he[e]}}),l.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:he[e]}}),l.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:he[e]}}),l.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:he[e]}})]})}),Qn=({isNetworksLoading:e=!1})=>l.jsx("div",{style:{display:"flex",height:"100%",width:"90px",alignItems:"center",justifyContent:"center"},children:l.jsx("img",{width:e?"100px":"25px",height:e?"100px":"25px",src:Qe,alt:"pf-logo-gif"})}),Mo=({title:e,titleId:t,...n})=>l.jsxs("svg",{viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em","aria-labelledby":t,...n,children:[e?l.jsx("title",{id:t,children:e}):null,l.jsx("path",{stroke:"currentColor",d:"m15.985 11.111-3.556 3.556-3.556-3.556M12.429 4v10.667M20.429 16.444A3.556 3.556 0 0 1 16.873 20H7.985a3.556 3.556 0 0 1-3.556-3.556",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round"})]}),GA=({onClose:e,iosLink:t,googleLink:n,buttonType:r,handleCopyLink:o,download:i,typeOfProduct:a,urlType:A})=>{let d="";return a==="Ready"&&A==="single"?d="Redirection url is empty. Are you sure you want to continue?":!t&&!n?d="Both links are empty. Are you sure you want to continue?":t?n||(d="Google link is empty. Are you sure you want to continue?"):d="iOS link is empty. Are you sure you want to continue?",l.jsxs("div",{style:{position:"fixed",top:0,left:0,zIndex:50,display:"flex",height:"120%",width:"130%",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0, 0, 0, 0.2)"},children:[l.jsx("div",{onClick:e,style:{position:"absolute",zIndex:30,height:"100%",width:"100%",pointerEvents:"none"}}),l.jsxs("div",{style:{position:"absolute",zIndex:50,display:"flex",flexDirection:"column",gap:"5px",maxWidth:"350px",borderRadius:"0.375rem",backgroundColor:"white",padding:"1rem",pointerEvents:"auto"},children:[l.jsx("h1",{style:{textAlign:"center",fontSize:"18px",lineHeight:"24px"},children:d}),l.jsxs("div",{style:{display:"flex",gap:"5px"},children:[l.jsx("button",{onClick:()=>{e(!1)},style:{flex:1,cursor:"pointer",borderRadius:"0.375rem",border:"1px solid #666666",padding:"0.5rem",fontWeight:"bold",transition:"all 0.15s ease-linear"},children:"No"}),l.jsx("button",{onClick:async c=>{r==="download"?await i():r==="copyLink"&&await o(),e()},style:{flex:1,cursor:"pointer",borderRadius:"0.375rem",border:"1px solid red",backgroundColor:"darkorange",padding:"0.5rem",fontWeight:"bold",color:"white",transition:"all 0.15s ease-linear"},children:"Yes"})]})]})]})},So=({onClose:e,handleCopyLink:t,download:n,creditConfirmType:r,getDownloadCount:o})=>l.jsxs("div",{style:{position:"fixed",top:0,left:0,zIndex:50,display:"flex",height:"120%",width:"130%",alignItems:"center",justifyContent:"center",backgroundColor:"#00000080"},children:[l.jsx("div",{onClick:e,style:{position:"absolute",zIndex:30,height:"100%",width:"100%"}}),l.jsxs("div",{style:{position:"absolute",zIndex:50,display:"flex",height:"max-content",width:350,flexDirection:"column",gap:"5px",borderRadius:"8px",backgroundColor:"white",padding:"20px"},children:[l.jsx("h1",{style:{textAlign:"center",fontSize:"18px",lineHeight:"24px"},children:"You are going to spend 1 credit for this download, do you want to continue?"}),l.jsxs("div",{style:{display:"flex",gap:"5px"},children:[l.jsx("button",{onClick:e,style:{flex:1,cursor:"pointer",borderRadius:"4px",borderWidth:"1px",borderColor:"dark-50",padding:"2px",fontWeight:"bold"},children:"No"}),l.jsx("button",{style:{flex:1,cursor:"pointer",borderRadius:"4px",borderWidth:"1px",borderColor:"#F9830B",backgroundColor:"#F9830B",padding:"2px",fontWeight:"bold",color:"white"},onClick:async i=>{i.preventDefault(),i.stopPropagation(),r==="download"?(await n(),await o()):r==="copy"&&(await t(),await o()),e()},children:"Yes"})]})]})]}),TA=({onClose:e,handleDownload:t,handleDownloadMolocoTest:n,downloadingMoloco:r,downloadingMolocoTest:o,downloadingMolocoHtml:i})=>l.jsxs("div",{style:{position:"fixed",top:0,left:0,zIndex:50,display:"flex",height:"100%",width:"100%",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0, 0, 0, 0.2)"},onClick:e,children:[l.jsx("div",{onClick:e,style:{position:"absolute",zIndex:30,height:"100%",width:"100%",pointerEvents:"none"}}),l.jsx("div",{style:{position:"absolute",zIndex:50,display:"flex",flexDirection:"column",gap:"5px",minWidth:"500px",borderRadius:"0.375rem",backgroundColor:"white",padding:"1rem",pointerEvents:"auto"},onClick:a=>{a.stopPropagation()},children:l.jsxs("div",{style:{display:"flex",gap:"5px",flexDirection:"column"},children:[l.jsxs("div",{style:{display:"flex",justifyContent:"center"},children:[r?l.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",borderRadius:"0.375rem",border:"1px solid darkorange",backgroundColor:"darkorange",color:"white",transition:"all 0.15s ease-linear",width:"200px",marginRight:"10px"},children:l.jsx("img",{width:"25px",height:"25px",src:Qe,alt:"pf-logo-gif"})}):l.jsx("button",{onClick:()=>{t(!1)},style:{cursor:"pointer",borderRadius:"0.375rem",border:"1px solid darkorange",backgroundColor:"darkorange",color:"white",transition:"all 0.15s ease-linear",width:"200px",marginRight:"10px"},children:"Download"}),i?l.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",borderRadius:"0.375rem",border:"1px solid darkorange",backgroundColor:"darkorange",color:"white",transition:"all 0.15s ease-linear",width:"200px",marginLeft:"10px"},children:l.jsx("img",{width:"25px",height:"25px",src:Qe,alt:"pf-logo-gif"})}):l.jsx("button",{onClick:()=>{t(!0)},style:{cursor:"pointer",borderRadius:"0.375rem",border:"1px solid darkorange",backgroundColor:"darkorange",color:"white",transition:"all 0.15s ease-linear",width:"200px",marginLeft:"10px"},children:"Download HTML"})]}),l.jsx("div",{style:{display:"flex",justifyContent:"center"},children:o?l.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",borderRadius:"0.375rem",border:"1px solid darkorange",backgroundColor:"darkorange",color:"white",transition:"all 0.15s ease-linear",width:"200px"},children:l.jsx("img",{width:"25px",height:"25px",src:Qe,alt:"pf-logo-gif"})}):l.jsx("button",{onClick:n,style:{cursor:"pointer",borderRadius:"0.375rem",border:"1px solid darkorange",backgroundColor:"darkorange",color:"white",transition:"all 0.15s ease-linear",width:"200px"},children:"Download Moloco Test"})})]})})]});async function HA(e,t,n,r){return(await fe.post(e+"/createMolocoTestPage",{_id:t,network:n,typeOfProduct:r})).data}const XA=({id:e,imageUrl:t,handleCardClick:n,selected:r,name:o,networkVersionSize:i,fileSizeLoading:a,showCheckBox:A,typeOfProduct:d,versionId:c,api:s,handleDownloadError:m,fetchFileUrl:y,urls:h,game:p,setIsConfirmActive:q,creditDownload:b,getDownloadCount:K,disabled:k,user:J,setSafariCopyLink:S,isTest:C,urlType:U})=>{const[ne,P]=Z.useState(!1),[Ae,se]=Z.useState(""),[re,F]=Z.useState(!1),[H,M]=Z.useState(!1),[O,j]=Z.useState(!1),[f,E]=Z.useState("download"),[N,g]=Z.useState(!1),[I,Y]=Z.useState(!1),[x,z]=Z.useState(!1);let V={aarki:"html,copy",adcolony:"copy,html",adjoe:"copy,html",applovin:"copy,html",appreciate:"zip",chartboost:"copy,html",criteo:"zip",crossinstall:"copy,html",default:"copy",fb:"zip",fyber:"copy,html",google:"zip",google360:"zip",ironsource:"copy,html",kayzen:"apikey",kaden:"html",kidoz:"html",lifestreet:"copy,html",liftoff:"copy,zip",mobvista:"html",moloco:"html,molocotest",molocoV2:"html,molocotest",nucleo:"copy,html",oceanengine:"copy,zip",pointblank:"html",smadex:"zip",snapchat:"zip",tapjoy:"copy,html",tencent:"zip",toutiao:"copy,zip",toutiao_cn:"copy,zip",unity:"copy,html",vungle:"html",web:"copy,html",yandex:"zip",zucks:"copy,html",luna:"zip",inmobi:"copy,html,",nend:"html",adikteev:"html",jammp:"copy,html"};const R=()=>{n(e)},D=async(B,W)=>(P(!0),new Promise((ue,Ue)=>{nn(c,B,h,W,C).then(we=>{P(!1),ue(we)}).catch(we=>{P(!1),m(we.message,we),Ue(we)})})),G=async(B=!1)=>{B?Y(!0):g(!0);const W={molocoGenerateHtml:!1};B&&(W.molocoGenerateHtml=!0),nn(c,o,h,"download",C,W).then(ue=>{B?Y(!1):g(!1),j(!1)}).catch(ue=>{m(ue.message,ue)})},_=async()=>{z(!0);const B=await HA(s,c,o,d);let W=`${y}/${B==null?void 0:B.url}`;Vt(W)?(xt("Link Copied"),z(!1)):S(W)},Q=o==="moloco"||o==="molocoV2";return l.jsxs(l.Fragment,{children:[l.jsxs("div",{style:{position:"relative",display:"flex",flexDirection:"column",gap:"20px",padding:"16px",borderColor:r?he[d]:"lightgray",borderWidth:"1px",borderStyle:"solid",backgroundColor:"white",width:"100%",height:"175px",borderRadius:"16px",cursor:"pointer"},className:"border-hover-"+d,onClick:R,children:[l.jsxs("div",{style:{marginTop:o=="web"?"10px":"40px",display:"flex",justifyContent:"center"},children:[l.jsx("div",{style:{position:"absolute",right:"0",top:"0",padding:"8px"},children:l.jsx("div",{children:i&&i.map(B=>B.network).includes(o)?a?l.jsx("div",{style:{position:"absolute",right:"0",top:"0.5rem",padding:"0.5rem",height:"1.5rem",display:"flex",justifyContent:"center",alignItems:"center",marginRight:"2rem"},children:l.jsx(RA,{typeOfProduct:d})}):i.map(B=>l.jsx("div",{style:{position:"absolute",right:"0",top:"0.5rem",padding:"0.5rem",marginRight:"2rem",fontSize:"1rem",height:"1.5rem",display:"flex",justifyContent:"center",alignItems:"center"},children:B.network===o?B.size.toString().slice(0,5)+"Mb":""},B.network)):null})}),l.jsx("div",{style:{position:"absolute",top:"0",left:"0",padding:"0.5rem"},children:(d==="Playable"||d==="Ready"||d==="Flex")&&A&&l.jsx(DA,{checked:r,typeOfProduct:d,id:e})}),l.jsx("img",{onClick:R,style:{width:"30rem",height:o=="web"?"80px":"50px",objectFit:"contain"},src:t})]}),l.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"0.25rem"},children:[l.jsxs(Xn,{className:`${Q?"w-1/2":"w-2/3"} border-hover-`+d,downloading:ne,onClickDonwload:async B=>{if(B.stopPropagation(),Q&&J.customer==="playableFactoryInternal"){j(!0);return}else{se("download");const W=h.iosUrl,ue=h.googleUrl;b&&b.willSpendCredit?(q(!0),E("download"),F(!0)):["Playable","Flex"].includes(d)&&(!W||!ue)||d==="Ready"&&U==="single"&&!W||d==="Ready"&&U==="multi"&&(!W||!ue)?(q(!0),M(!0)):(M(!1),F(!1),await D(o,"download"))}},children:[!ne&&l.jsxs(l.Fragment,{children:[l.jsx(Mo,{style:{marginRight:"0.5rem",height:"1.5rem",width:"1rem",stroke:"dark-full"}}),Q&&J.customer!=="playableFactoryInternal"?"TXT":"Download"]}),ne&&l.jsx(Qn,{})]}),V[o]&&V[o].includes("copy")&&l.jsx(Xn,{className:"w-1/3 border-hover-"+d,onClickDonwload:async B=>{B.stopPropagation(),se("copyLink");const W=h.iosUrl,ue=h.googleUrl;b&&(b!=null&&b.willSpendCredit)?(E("copy"),q(!0),F(!0)):d!=="Import"&&(!W||!ue)?(q(!0),M(!0)):(F(!1),M(!1),await D(o,"copy"))},disabled:k,children:l.jsx(kr,{className:"h-6 w-6 stroke-dark-full"})}),Q&&J.customer!=="playableFactoryInternal"&&l.jsx(Xn,{className:"w-1/2 border-hover-"+d,onClickDonwload:async B=>{B.stopPropagation(),se("download");const W=h.iosUrl,ue=h.googleUrl;b&&(b!=null&&b.willSpendCredit)?(E("download"),q(!0),F(!0)):d!=="Import"&&(!W||!ue)?(q(!0),M(!0)):(F(!1),M(!1),await G(!0))},disabled:k,children:l.jsxs(l.Fragment,{children:[l.jsx(Mo,{style:{marginRight:"0.5rem",height:"1.5rem",width:"1rem",stroke:"dark-full"}}),"HTML"]})})]})]}),re&&l.jsx(So,{creditConfirmType:f,handleCopyLink:async()=>{M(!1),q(!1),await D(o,"copy")},download:async()=>{M(!1),q(!1),await D(o,"download")},onClose:()=>{F(!1),q(!1)},getDownloadCount:K}),H&&l.jsx(GA,{onClose:()=>{M(!1),q(!1)},iosLink:h.iosUrl,googleLink:h.googleUrl,buttonType:Ae,handleCopyLink:async()=>{M(!1),q(!1),await D(o,"copy")},download:async()=>{M(!1),q(!1),await D(o,"download")},typeOfProduct:d,urlType:U}),O&&J.customer==="playableFactoryInternal"&&l.jsx(TA,{onClose:()=>{j(!1)},handleDownload:G,handleDownloadMolocoTest:_,downloadingMoloco:N,donwloadintMolocoTest:x,downloadingMolocoHtml:I})]})},Pn=[{id:"33",name:"web",imageSrc:"https://gearbox.playablefactory.com/files/network_icons/web.png"},{id:"1",name:"unity",imageSrc:"https://gearbox.playablefactory.com/unity.png"},{id:"2",name:"applovin",imageSrc:"https://gearbox.playablefactory.com/applovin.png"},{id:"3",name:"ironsource",imageSrc:"https://gearbox.playablefactory.com/ironsource.png"},{id:"4",name:"vungle",imageSrc:"https://gearbox.playablefactory.com/vungle.png"},{id:"5",name:"mobvista",imageSrc:"https://gearbox.playablefactory.com/mobvista.png"},{id:"6",name:"fb",imageSrc:"https://gearbox.playablefactory.com/fb.png"},{id:"7",name:"toutiao",imageSrc:"https://gearbox.playablefactory.com/toutiao.png"},{id:"8",name:"toutiao_cn",imageSrc:"https://gearbox.playablefactory.com/toutiao_cn.png"},{id:"9",name:"adcolony",imageSrc:"https://gearbox.playablefactory.com/adcolony.png"},{id:"10",name:"criteo",imageSrc:"https://gearbox.playablefactory.com/criteo.png"},{id:"11",name:"chartboost",imageSrc:"https://gearbox.playablefactory.com/chartboost.png"},{id:"12",name:"kayzen",imageSrc:"https://gearbox.playablefactory.com/kayzen.png"},{id:"13",name:"crossinstall",imageSrc:"https://gearbox.playablefactory.com/crossinstall.png"},{id:"14",name:"default",imageSrc:"https://gearbox.playablefactory.com/default.png"},{id:"15",name:"fyber",imageSrc:"https://gearbox.playablefactory.com/fyber.png"},{id:"16",name:"appreciate",imageSrc:"https://gearbox.playablefactory.com/appreciate.png"},{id:"17",name:"google360",imageSrc:"https://gearbox.playablefactory.com/google360.png"},{id:"18",name:"kaden",imageSrc:"https://gearbox.playablefactory.com/kaden.png"},{id:"19",name:"kidoz",imageSrc:"https://gearbox.playablefactory.com/kidoz.png"},{id:"20",name:"lifestreet",imageSrc:"https://gearbox.playablefactory.com/lifestreet.png"},{id:"21",name:"liftoff",imageSrc:"https://gearbox.playablefactory.com/liftoff.png"},{id:"22",name:"moloco",imageSrc:"https://gearbox.playablefactory.com/moloco.png"},{id:"23",name:"nucleo",imageSrc:"https://gearbox.playablefactory.com/nucleo.png"},{id:"24",name:"oceanengine",imageSrc:"https://gearbox.playablefactory.com/oceanengine.png"},{id:"25",name:"pointblank",imageSrc:"https://gearbox.playablefactory.com/pointblank.png"},{id:"26",name:"snapchat",imageSrc:"https://gearbox.playablefactory.com/snapchat.png"},{id:"27",name:"tapjoy",imageSrc:"https://gearbox.playablefactory.com/tapjoy.png"},{id:"28",name:"tencent",imageSrc:"https://gearbox.playablefactory.com/tencent.png"},{id:"31",name:"aarki",imageSrc:"https://gearbox.playablefactory.com/aarki.png"},{id:"32",name:"yandex",imageSrc:"https://gearbox.playablefactory.com/yandex.png"},{id:"34",name:"zucks",imageSrc:"https://gearbox.playablefactory.com/zucks.png"},{id:"35",name:"google",imageSrc:"https://gearbox.playablefactory.com/google.png"},{id:"36",name:"inmobi",imageSrc:"https://gearbox.playablefactory.com/inmobi.png"},{id:"38",name:"smadex",imageSrc:"https://gearbox.playablefactory.com/smadex.png"},{id:"39",name:"instantGame",imageSrc:"https://gearbox.playablefactory.com/instantGame.png"},{id:"40",name:"luna",imageSrc:"https://gearbox.playablefactory.com/luna.png"},{id:"41",name:"nend",imageSrc:"https://gearbox.playablefactory.com/nend.png"},{id:"42",name:"jammp",imageSrc:"https://gearbox.playablefactory.com/nend.png"},{id:"43",name:"adjoe",imageSrc:"https://gearbox.playablefactory.com/adjoe.png"},{id:"44",name:"molocoV2",imageSrc:"https://gearbox.playablefactory.com/molocoV2.png"},{id:"45",name:"adikteev",imageSrc:"https://gearbox.playablefactory.com/adikteev.png"},{id:"46",name:"appier",imageSrc:"https://gearbox.playablefactory.com/appier.png"},{id:"47",name:"remerge",imageSrc:"https://gearbox.playablefactory.com/remerge.png"},{id:"48",name:"persona",imageSrc:"https://gearbox.playablefactory.com/persona.png"},{id:"49",name:"bidease",imageSrc:"https://gearbox.playablefactory.com/bidease.png"}],QA=({children:e,typeOfProduct:t,className:n,onClick:r})=>{const o={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"0.5rem",width:"12rem",height:"2.5rem",backgroundColor:he[t],color:"white",fontSize:"0.875rem",borderRadius:"0.875rem"};return l.jsx("button",{onClick:r,className:n,style:o,children:e})},PA=({networksVersionTotalSize:e,typeOfProduct:t,onClickMultiDownload:n,multiDownloading:r})=>l.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"8px"},children:r?l.jsx("div",{style:{display:"flex",width:"12rem",height:"2.5rem",borderRadius:"0.875rem",alignItems:"center",justifyContent:"center",backgroundColor:he[t]},children:l.jsx(Qn,{})}):l.jsx(QA,{typeOfProduct:t,onClick:n,children:l.jsx("span",{style:{fontSize:"1.25rem",padding:"0.5rem",color:"#fff"},children:"Download All"})})}),VA=({playable:e,creditDownload:t,visible:n,versionId:r,typeOfProduct:o,api:i,user:a,handleDownloadError:A,fetchFileUrl:d,urls:c,game:s,getDownloadCount:m,disabled:y,setSafariCopyLink:h,isTest:p,urlType:q})=>{const[b,K]=Z.useState([]),[k,J]=Z.useState([]),[S,C]=Z.useState(!1),[U,ne]=Z.useState(""),[P,Ae]=Z.useState(!1),[se,re]=Z.useState(!1),[F,H]=Z.useState("download"),[M,O]=Z.useState(!1),j=async N=>{const g=[...b];if(b.includes(N)){const I=g.findIndex(Y=>Y===N);g.splice(I,1),K(g)}else g.push(N),K([...b,N]);Pn.filter(I=>[...g].includes(I.id)).map(I=>I.name)},f=async()=>(console.log("multi download"),new Promise(async(N,g)=>{const I=Pn.filter(Y=>[...b].includes(Y.id)).map(Y=>Y.name);Ae(!0),console.log("get multi download"),WA(r,c,I).then(Y=>{console.log("get multi download res"),Ae(!1),N(Y)}).catch(Y=>{console.log("get multi download err"),Ae(!1),A(Y.message,Y),g(Y)})})),E=async()=>{c.iosUrl,c.googleUrl,t&&t.willSpendCredit?(re(!0),H("download"),O(!0)):(O(!1),await f())};return l.jsxs(l.Fragment,{children:[l.jsx("div",{style:{position:"relative",flex:1,overflowY:se?"hidden":"auto",padding:"1.5rem",paddingTop:"0"},children:l.jsx("div",{style:{display:"grid",gridTemplateColumns:"180px 180px 180px",gap:"1rem",overflowY:"auto",padding:"0.75rem"},children:n&&Pn.filter(N=>{var g;return t&&((g=t==null?void 0:t.networks)==null?void 0:g.length)>0?t==null?void 0:t.networks.includes(N.name):o==="Import"?e==null?void 0:e.networks.filter(I=>I.status==="paid").some(I=>I.name===N.name):e==null?void 0:e.networks.includes(N.name)}).filter(N=>N.name==="voodoo"?a.customer==="customer:20":!0).map(N=>{let g=N.imageSrc;if(N.name==="web"){let I="web_"+o.toLowerCase()+".png";g=g.replace("web.png",I)}return l.jsx(XA,{id:N.id,name:N.name,imageUrl:g,selected:b.includes(N.id),handleCardClick:j,networkVersionSize:k,fileSizeLoading:S,showCheckBox:!0,typeOfProduct:o,versionId:r,api:i,handleDownloadError:A,fetchFileUrl:d,urls:c,game:s,creditDownload:t,setIsConfirmActive:re,getDownloadCount:m,disabled:y,user:a,setSafariCopyLink:h,isTest:p,urlType:q},N.id)})})}),b.length>1&&(o==="Playable"||o==="Ready"||o==="Flex")&&l.jsx("div",{style:{position:"fixed",bottom:"0",left:"65%",zIndex:20,transform:"translateX(-50%)",display:"flex",flexDirection:"column",paddingTop:"5px"},children:l.jsx(PA,{onClickMultiDownload:E,networksVersionTotalSize:U,typeOfProduct:o,multiDownloading:P})}),M&&l.jsx(So,{creditConfirmType:F,handleCopyLink:async()=>{},download:async()=>{O(!1),re(!1),await f()},onClose:()=>{O(!1),re(!1)},getDownloadCount:m})]})};async function BA(e,t){return(await fe.post(t+"/findPlayable",{_id:e})).data}async function UA(e,t){return(await fe.post(t+"/getFlexDownloadCount",e)).data}async function FA(e,t){try{return(await fe.post(t+"/findGame",{_id:e})).data}catch{}}async function _A(e,t){return(await fe.post(t+"/getPlayableVersionMarketLink",{_id:e})).data}async function $A(e,t){return(await fe.post(t+"/getFlexData",{_id:e})).data}async function es(e,t){return(await fe.post(t+"/getImportedPlayable",{id:e})).data}async function ts(e,t){return(await fe.post(t+"/getReadyDownloadCount",e)).data}const ns=["adcolony","ironsource","applovin","unity","mobvista","criteo","kayzen","vungle","moloco","inmobi"],Lo=["web","adcolony","applovin","chartboost","crossinstall","fb","google","ironsource","lifestreet","liftoff","mobvista","nucleo","tapjoy","toutiao","unity","vungle","moloco"],rs=({playableId:e,versionId:t,gameId:n,typeOfProduct:r,visible:o,api:i,user:a,title:A,handleDownloadError:d,fetchFileUrl:c,fileSize:s,setFileSize:m,setSafariCopyLink:y})=>{const[h,p]=Z.useState(null),[q,b]=Z.useState(null),[K,k]=Z.useState(null),[J,S]=Z.useState(!1),[C,U]=Z.useState("Loading..."),[ne,P]=Z.useState("Loading..."),[Ae,se]=Z.useState(!0),[re,F]=Z.useState(window.innerWidth),[H,M]=Z.useState(!1),[O,j]=Z.useState("game");Z.useEffect(()=>{const x=()=>{F(window.innerWidth)};return window.addEventListener("resize",x),()=>{window.removeEventListener("resize",x)}},[]);const f=async()=>{S(!0);const x=await BA(e,i);return x!=null&&x.networks||(x.networks=ns),p(x),x},E=x=>{U(x)},N=x=>{P(x)},g=async(x,z)=>{var V,R;try{let D;if(r==="Playable"||r==="Ready"){const G=await _A(t,i);if(G){U(G.iosLink),P(G.androidLink),S(!1);return}if(x&&(x.iosUrl||x.googleUrl)){U(x.iosUrl),P(x.googleUrl),S(!1);return}if(z&&z.html){let _=await fetch(c+"/"+z.html).then(W=>W.text());const Q=((V=_.match(/var\s+iosLink\s*=\s*['|"](https?[\w\d;,/?:@&=+$\-_.!~*'()#]+)['|"]/))==null?void 0:V.at(1))||"";U(Q);const B=((R=_.match(/var\s+androidLink\s*=\s*['|"](https?[\w\d;,/?:@&=+$\-_.!~*'()#]+)['|"]/))==null?void 0:R.at(1))||"";P(B),S(!1)}else P(""),U(""),S(!1)}else if(r==="Flex"){const G=await $A(t,i);if(G.googleUrl||G.iosUrl){P(G.googleUrl),U(G.iosUrl),S(!1);return}x&&(x.iosUrl||x.googleUrl)?(U(x.iosUrl),P(x.googleUrl),S(!1)):(P(""),U(""),S(!1))}}catch(D){d(D.response.data.error.msg)}},I=async()=>{S(!0);let x;r==="Flex"?x=await UA({_id:t},i):r==="Ready"&&(x=await ts({_id:t},i)),x&&(["admin","pm","tester"].includes(a.role)?k({...x,networks:Lo}):r==="Ready"&&!x.canDownload?k({...x,networks:Lo}):k(x)),S(!1)},Y=async()=>await FA(n,i);return Z.useEffect(()=>{o||(p(null),b(null),k(null),m(null)),o&&(r==="Playable"?(f().then(x=>{g(null,x)}),se(!1)):r==="Ready"?I().then(x=>{f().then(z=>{g(null,z),se(!1)})}):r==="Flex"?I().then(x=>{se(!1),Y().then(z=>{o&&(g(z,null),se(!1),b(z))})}):r==="Import"&&es(t,i).then(x=>{console.log(x),p(x),U(x.iosUrl||""),P(x.googleUrl||""),S(!1),se(!1)}))},[n,e,t,o]),l.jsxs("div",{style:{display:"flex",height:re>1440?"700px":"650px",width:re>1440?"675px":"680px",flexDirection:"column",borderRadius:"rounded",backgroundColor:"#F7F7F8",paddingTop:"0px"},children:[l.jsx(NA,{title:A,typeOfProduct:r,fileSize:s,urls:{iosUrl:C,googleUrl:ne},handleIosChange:E,handleGoogleChange:N,disabled:Ae,api:i,creditDownload:K,user:a,isTest:H,setIsTest:M,urlType:O,setUrlType:j}),J?l.jsx("div",{style:{height:"100%",width:"100%",display:"flex",justifyContent:"center"},children:l.jsx(Qn,{isNetworksLoading:!0})}):(h||K)&&(r==="Flex"?q:!0)&&!J&&C!=="Loading..."&&ne!=="Loading..."&&l.jsx(VA,{playable:h,creditDownload:K,visible:o,versionId:t,typeOfProduct:r,api:i,user:a,handleDownloadError:d,fetchFileUrl:c,urls:{iosUrl:C,googleUrl:ne},game:q,getDownloadCount:I,disabled:Ae,setSafariCopyLink:y,isTest:H,urlType:O})]})},Jl="";var Vn={exports:{}},tt={},Bn={exports:{}},Oe={},Un={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;/*!
|
|
50
|
+
`):" "+io(i[0]):"as no adapter specified";throw new ee("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return r},adapters:Sn};function Ln(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ct(null,e)}function Ao(e){return Ln(e),e.headers=Re.from(e.headers),e.data=Mn.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),ao.getAdapter(e.adapter||Kn.adapter)(e).then(function(r){return Ln(e),r.data=Mn.call(e,e.transformResponse,r),r.headers=Re.from(r.headers),r},function(r){return no(r)||(Ln(e),r&&r.response&&(r.response.data=Mn.call(e,e.transformResponse,r.response),r.response.headers=Re.from(r.response.headers))),Promise.reject(r)})}const so=e=>e instanceof Re?e.toJSON():e;function st(e,t){t=t||{};const n={};function r(c,s,m){return v.isPlainObject(c)&&v.isPlainObject(s)?v.merge.call({caseless:m},c,s):v.isPlainObject(s)?v.merge({},s):v.isArray(s)?s.slice():s}function o(c,s,m){if(v.isUndefined(s)){if(!v.isUndefined(c))return r(void 0,c,m)}else return r(c,s,m)}function i(c,s){if(!v.isUndefined(s))return r(void 0,s)}function a(c,s){if(v.isUndefined(s)){if(!v.isUndefined(c))return r(void 0,c)}else return r(void 0,s)}function A(c,s,m){if(m in t)return r(c,s);if(m in e)return r(void 0,c)}const d={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:A,headers:(c,s)=>o(so(c),so(s),!0)};return v.forEach(Object.keys(Object.assign({},e,t)),function(s){const m=d[s]||o,y=m(e[s],t[s],s);v.isUndefined(y)&&m!==A||(n[s]=y)}),n}const lo="1.5.1",On={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{On[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const uo={};On.transitional=function(t,n,r){function o(i,a){return"[Axios v"+lo+"] Transitional option '"+i+"'"+a+(r?". "+r:"")}return(i,a,A)=>{if(t===!1)throw new ee(o(a," has been removed"+(n?" in "+n:"")),ee.ERR_DEPRECATED);return n&&!uo[a]&&(uo[a]=!0,console.warn(o(a," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,a,A):!0}};function rA(e,t,n){if(typeof e!="object")throw new ee("options must be an object",ee.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],a=t[i];if(a){const A=e[i],d=A===void 0||a(A,i,e);if(d!==!0)throw new ee("option "+i+" must be "+d,ee.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ee("Unknown option "+i,ee.ERR_BAD_OPTION)}}const En={assertOptions:rA,validators:On},Pe=En.validators;class Xt{constructor(t){this.defaults=t,this.interceptors={request:new _r,response:new _r}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=st(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:i}=n;r!==void 0&&En.assertOptions(r,{silentJSONParsing:Pe.transitional(Pe.boolean),forcedJSONParsing:Pe.transitional(Pe.boolean),clarifyTimeoutError:Pe.transitional(Pe.boolean)},!1),o!=null&&(v.isFunction(o)?n.paramsSerializer={serialize:o}:En.assertOptions(o,{encode:Pe.function,serialize:Pe.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=i&&v.merge(i.common,i[n.method]);i&&v.forEach(["delete","get","head","post","put","patch","common"],p=>{delete i[p]}),n.headers=Re.concat(a,i);const A=[];let d=!0;this.interceptors.request.forEach(function(q){typeof q.runWhen=="function"&&q.runWhen(n)===!1||(d=d&&q.synchronous,A.unshift(q.fulfilled,q.rejected))});const c=[];this.interceptors.response.forEach(function(q){c.push(q.fulfilled,q.rejected)});let s,m=0,y;if(!d){const p=[Ao.bind(this),void 0];for(p.unshift.apply(p,A),p.push.apply(p,c),y=p.length,s=Promise.resolve(n);m<y;)s=s.then(p[m++],p[m++]);return s}y=A.length;let h=n;for(m=0;m<y;){const p=A[m++],q=A[m++];try{h=p(h)}catch(b){q.call(this,b);break}}try{s=Ao.call(this,h)}catch(p){return Promise.reject(p)}for(m=0,y=c.length;m<y;)s=s.then(c[m++],c[m++]);return s}getUri(t){t=st(this.defaults,t);const n=ro(t.baseURL,t.url);return Fr(n,t.params,t.paramsSerializer)}}v.forEach(["delete","get","head","options"],function(t){Xt.prototype[t]=function(n,r){return this.request(st(r||{},{method:t,url:n,data:(r||{}).data}))}}),v.forEach(["post","put","patch"],function(t){function n(r){return function(i,a,A){return this.request(st(A||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:a}))}}Xt.prototype[t]=n(),Xt.prototype[t+"Form"]=n(!0)});const Qt=Xt;class kn{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(o=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](o);r._listeners=null}),this.promise.then=o=>{let i;const a=new Promise(A=>{r.subscribe(A),i=A}).then(o);return a.cancel=function(){r.unsubscribe(i)},a},t(function(i,a,A){r.reason||(r.reason=new Ct(i,a,A),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new kn(function(o){t=o}),cancel:t}}}const oA=kn;function iA(e){return function(n){return e.apply(null,n)}}function aA(e){return v.isObject(e)&&e.isAxiosError===!0}const Yn={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Yn).forEach(([e,t])=>{Yn[t]=e});const AA=Yn;function co(e){const t=new Qt(e),n=Yr(Qt.prototype.request,t);return v.extend(n,Qt.prototype,t,{allOwnKeys:!0}),v.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return co(st(e,o))},n}const me=co(Kn);me.Axios=Qt,me.CanceledError=Ct,me.CancelToken=oA,me.isCancel=no,me.VERSION=lo,me.toFormData=Gt,me.AxiosError=ee,me.Cancel=me.CanceledError,me.all=function(t){return Promise.all(t)},me.spread=iA,me.isAxiosError=aA,me.mergeConfig=st,me.AxiosHeaders=Re,me.formToJSON=e=>eo(v.isHTMLForm(e)?new FormData(e):e),me.getAdapter=ao.getAdapter,me.HttpStatusCode=AA,me.default=me;const sA=me;/*! typescript-cookie v1.0.6 | MIT */const mo=e=>encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),po=e=>encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent),zn=decodeURIComponent,jn=e=>(e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent));function lA(e){return e=Object.assign({},e),typeof e.expires=="number"&&(e.expires=new Date(Date.now()+e.expires*864e5)),e.expires!=null&&(e.expires=e.expires.toUTCString()),Object.entries(e).filter(([t,n])=>n!=null&&n!==!1).map(([t,n])=>n===!0?`; ${t}`:`; ${t}=${n.split(";")[0]}`).join("")}function fo(e,t,n){const r=/(?:^|; )([^=]*)=([^;]*)/g,o={};let i;for(;(i=r.exec(document.cookie))!=null;)try{const a=n(i[1]);if(o[a]=t(i[2],a),e===a)break}catch{}return e!=null?o[e]:o}const ho=Object.freeze({decodeName:zn,decodeValue:jn,encodeName:mo,encodeValue:po}),Jn=Object.freeze({path:"/"});function qo(e,t,n=Jn,{encodeValue:r=po,encodeName:o=mo}={}){return document.cookie=`${o(e)}=${r(t,e)}${lA(n)}`}function go(e,{decodeValue:t=jn,decodeName:n=zn}={}){return fo(e,t,n)}function uA({decodeValue:e=jn,decodeName:t=zn}={}){return fo(void 0,e,t)}function cA(e,t=Jn){qo(e,"",Object.assign({},t,{expires:-1}))}function Nn(e,t){const n={set:function(o,i,a){return qo(o,i,Object.assign({},this.attributes,a),{encodeValue:this.converter.write})},get:function(o){if(arguments.length===0)return uA(this.converter.read);if(o!=null)return go(o,this.converter.read)},remove:function(o,i){cA(o,Object.assign({},this.attributes,i))},withAttributes:function(o){return Nn(this.converter,Object.assign({},this.attributes,o))},withConverter:function(o){return Nn(Object.assign({},this.converter,o),this.attributes)}},r={attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}};return Object.create(n,r)}Nn({read:ho.decodeValue,write:ho.encodeValue},Jn);let yo;typeof window<"u"&&(yo=go("token"));const fe=sA.create({headers:{Authorization:yo}});async function dA(e,t,n){return(await fe.post(n+"/createFlexVersionLinkMulti",{_id:e,networks:t})).data}async function mA(e,t){return e.network=="fb"&&(e.zip=1),(await fe.post(t+"/createFlexVersionLink",e||{})).data}async function pA(e,t,n){return(await fe.post(e+"/createImportedVersionLink",{_id:t,network:n})).data}async function fA(e,t,n,r,o){return console.log(r),(await fe.post(e+"/createPlayableVersionLink",{_id:t,network:n,isPfTest:r,extras:o})).data}async function hA(e,t,n){return(await fe.post(n+"/createPlayableVersionLinkMulti",{_id:e,networks:t})).data}async function qA(e,t,n,r,o){return(await fe.post(e+"/createReadyVersionLink",{_id:t,network:n,isPfTest:r,extras:o})).data}async function gA(e,t,n){return(await fe.post(n+"/createReadyVersionLinkMulti",{_id:e,networks:t})).data}async function vo(e,t){return(await fe.post(t+"/updateFlexUrl",e||{})).data}async function Pt(e,t,n){return(await fe.post(n+"/updatePlayableVersion",{...t,_id:e})).data}function Vt(e){const t=document.createElement("input");t.value=e,document.body.appendChild(t),t.select();try{return document.execCommand("copy")?(document.body.removeChild(t),!0):(document.body.removeChild(t),!1)}catch{return document.body.removeChild(t),!1}}function bo(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=bo(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function Ve(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=bo(e))&&(r&&(r+=" "),r+=t);return r}const Zt=e=>typeof e=="number"&&!isNaN(e),_e=e=>typeof e=="string",be=e=>typeof e=="function",Bt=e=>_e(e)||be(e)?e:null,Dn=e=>Z.isValidElement(e)||_e(e)||be(e)||Zt(e);function yA(e,t,n){n===void 0&&(n=300);const{scrollHeight:r,style:o}=e;requestAnimationFrame(()=>{o.minHeight="initial",o.height=r+"px",o.transition=`all ${n}ms`,requestAnimationFrame(()=>{o.height="0",o.padding="0",o.margin="0",setTimeout(t,n)})})}function Ut(e){let{enter:t,exit:n,appendPosition:r=!1,collapse:o=!0,collapseDuration:i=300}=e;return function(a){let{children:A,position:d,preventExitTransition:c,done:s,nodeRef:m,isIn:y}=a;const h=r?`${t}--${d}`:t,p=r?`${n}--${d}`:n,q=Z.useRef(0);return Z.useLayoutEffect(()=>{const b=m.current,K=h.split(" "),k=J=>{J.target===m.current&&(b.dispatchEvent(new Event("d")),b.removeEventListener("animationend",k),b.removeEventListener("animationcancel",k),q.current===0&&J.type!=="animationcancel"&&b.classList.remove(...K))};b.classList.add(...K),b.addEventListener("animationend",k),b.addEventListener("animationcancel",k)},[]),Z.useEffect(()=>{const b=m.current,K=()=>{b.removeEventListener("animationend",K),o?yA(b,s,i):s()};y||(c?K():(q.current=1,b.className+=` ${p}`,b.addEventListener("animationend",K)))},[y]),Z.createElement(Z.Fragment,null,A)}}function Co(e,t){return e!=null?{content:e.content,containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon,status:t}:{}}const Me={list:new Map,emitQueue:new Map,on(e,t){return this.list.has(e)||this.list.set(e,[]),this.list.get(e).push(t),this},off(e,t){if(t){const n=this.list.get(e).filter(r=>r!==t);return this.list.set(e,n),this}return this.list.delete(e),this},cancelEmit(e){const t=this.emitQueue.get(e);return t&&(t.forEach(clearTimeout),this.emitQueue.delete(e)),this},emit(e){this.list.has(e)&&this.list.get(e).forEach(t=>{const n=setTimeout(()=>{t(...[].slice.call(arguments,1))},0);this.emitQueue.has(e)||this.emitQueue.set(e,[]),this.emitQueue.get(e).push(n)})}},Ft=e=>{let{theme:t,type:n,...r}=e;return Z.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${n})`,...r})},Rn={info:function(e){return Z.createElement(Ft,{...e},Z.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(e){return Z.createElement(Ft,{...e},Z.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(e){return Z.createElement(Ft,{...e},Z.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(e){return Z.createElement(Ft,{...e},Z.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return Z.createElement("div",{className:"Toastify__spinner"})}};function vA(e){const[,t]=Z.useReducer(h=>h+1,0),[n,r]=Z.useState([]),o=Z.useRef(null),i=Z.useRef(new Map).current,a=h=>n.indexOf(h)!==-1,A=Z.useRef({toastKey:1,displayedToast:0,count:0,queue:[],props:e,containerId:null,isToastActive:a,getToast:h=>i.get(h)}).current;function d(h){let{containerId:p}=h;const{limit:q}=A.props;!q||p&&A.containerId!==p||(A.count-=A.queue.length,A.queue=[])}function c(h){r(p=>h==null?[]:p.filter(q=>q!==h))}function s(){const{toastContent:h,toastProps:p,staleId:q}=A.queue.shift();y(h,p,q)}function m(h,p){let{delay:q,staleId:b,...K}=p;if(!Dn(h)||function(F){return!o.current||A.props.enableMultiContainer&&F.containerId!==A.props.containerId||i.has(F.toastId)&&F.updateId==null}(K))return;const{toastId:k,updateId:J,data:S}=K,{props:C}=A,U=()=>c(k),ne=J==null;ne&&A.count++;const P={...C,style:C.toastStyle,key:A.toastKey++,...Object.fromEntries(Object.entries(K).filter(F=>{let[H,M]=F;return M!=null})),toastId:k,updateId:J,data:S,closeToast:U,isIn:!1,className:Bt(K.className||C.toastClassName),bodyClassName:Bt(K.bodyClassName||C.bodyClassName),progressClassName:Bt(K.progressClassName||C.progressClassName),autoClose:!K.isLoading&&(Ae=K.autoClose,se=C.autoClose,Ae===!1||Zt(Ae)&&Ae>0?Ae:se),deleteToast(){const F=Co(i.get(k),"removed");i.delete(k),Me.emit(4,F);const H=A.queue.length;if(A.count=k==null?A.count-A.displayedToast:A.count-1,A.count<0&&(A.count=0),H>0){const M=k==null?A.props.limit:1;if(H===1||M===1)A.displayedToast++,s();else{const O=M>H?H:M;A.displayedToast=O;for(let j=0;j<O;j++)s()}}else t()}};var Ae,se;P.iconOut=function(F){let{theme:H,type:M,isLoading:O,icon:j}=F,f=null;const E={theme:H,type:M};return j===!1||(be(j)?f=j(E):Z.isValidElement(j)?f=Z.cloneElement(j,E):_e(j)||Zt(j)?f=j:O?f=Rn.spinner():(N=>N in Rn)(M)&&(f=Rn[M](E))),f}(P),be(K.onOpen)&&(P.onOpen=K.onOpen),be(K.onClose)&&(P.onClose=K.onClose),P.closeButton=C.closeButton,K.closeButton===!1||Dn(K.closeButton)?P.closeButton=K.closeButton:K.closeButton===!0&&(P.closeButton=!Dn(C.closeButton)||C.closeButton);let re=h;Z.isValidElement(h)&&!_e(h.type)?re=Z.cloneElement(h,{closeToast:U,toastProps:P,data:S}):be(h)&&(re=h({closeToast:U,toastProps:P,data:S})),C.limit&&C.limit>0&&A.count>C.limit&&ne?A.queue.push({toastContent:re,toastProps:P,staleId:b}):Zt(q)?setTimeout(()=>{y(re,P,b)},q):y(re,P,b)}function y(h,p,q){const{toastId:b}=p;q&&i.delete(q);const K={content:h,props:p};i.set(b,K),r(k=>[...k,b].filter(J=>J!==q)),Me.emit(4,Co(K,K.props.updateId==null?"added":"updated"))}return Z.useEffect(()=>(A.containerId=e.containerId,Me.cancelEmit(3).on(0,m).on(1,h=>o.current&&c(h)).on(5,d).emit(2,A),()=>{i.clear(),Me.emit(3,A)}),[]),Z.useEffect(()=>{A.props=e,A.isToastActive=a,A.displayedToast=n.length}),{getToastToRender:function(h){const p=new Map,q=Array.from(i.values());return e.newestOnTop&&q.reverse(),q.forEach(b=>{const{position:K}=b.props;p.has(K)||p.set(K,[]),p.get(K).push(b)}),Array.from(p,b=>h(b[0],b[1]))},containerRef:o,isToastActive:a}}function Zo(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientX:e.clientX}function Io(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientY:e.clientY}function bA(e){const[t,n]=Z.useState(!1),[r,o]=Z.useState(!1),i=Z.useRef(null),a=Z.useRef({start:0,x:0,y:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,boundingRect:null,didMove:!1}).current,A=Z.useRef(e),{autoClose:d,pauseOnHover:c,closeToast:s,onClick:m,closeOnClick:y}=e;function h(S){if(e.draggable){S.nativeEvent.type==="touchstart"&&S.nativeEvent.preventDefault(),a.didMove=!1,document.addEventListener("mousemove",K),document.addEventListener("mouseup",k),document.addEventListener("touchmove",K),document.addEventListener("touchend",k);const C=i.current;a.canCloseOnClick=!0,a.canDrag=!0,a.boundingRect=C.getBoundingClientRect(),C.style.transition="",a.x=Zo(S.nativeEvent),a.y=Io(S.nativeEvent),e.draggableDirection==="x"?(a.start=a.x,a.removalDistance=C.offsetWidth*(e.draggablePercent/100)):(a.start=a.y,a.removalDistance=C.offsetHeight*(e.draggablePercent===80?1.5*e.draggablePercent:e.draggablePercent/100))}}function p(S){if(a.boundingRect){const{top:C,bottom:U,left:ne,right:P}=a.boundingRect;S.nativeEvent.type!=="touchend"&&e.pauseOnHover&&a.x>=ne&&a.x<=P&&a.y>=C&&a.y<=U?b():q()}}function q(){n(!0)}function b(){n(!1)}function K(S){const C=i.current;a.canDrag&&C&&(a.didMove=!0,t&&b(),a.x=Zo(S),a.y=Io(S),a.delta=e.draggableDirection==="x"?a.x-a.start:a.y-a.start,a.start!==a.x&&(a.canCloseOnClick=!1),C.style.transform=`translate${e.draggableDirection}(${a.delta}px)`,C.style.opacity=""+(1-Math.abs(a.delta/a.removalDistance)))}function k(){document.removeEventListener("mousemove",K),document.removeEventListener("mouseup",k),document.removeEventListener("touchmove",K),document.removeEventListener("touchend",k);const S=i.current;if(a.canDrag&&a.didMove&&S){if(a.canDrag=!1,Math.abs(a.delta)>a.removalDistance)return o(!0),void e.closeToast();S.style.transition="transform 0.2s, opacity 0.2s",S.style.transform=`translate${e.draggableDirection}(0)`,S.style.opacity="1"}}Z.useEffect(()=>{A.current=e}),Z.useEffect(()=>(i.current&&i.current.addEventListener("d",q,{once:!0}),be(e.onOpen)&&e.onOpen(Z.isValidElement(e.children)&&e.children.props),()=>{const S=A.current;be(S.onClose)&&S.onClose(Z.isValidElement(S.children)&&S.children.props)}),[]),Z.useEffect(()=>(e.pauseOnFocusLoss&&(document.hasFocus()||b(),window.addEventListener("focus",q),window.addEventListener("blur",b)),()=>{e.pauseOnFocusLoss&&(window.removeEventListener("focus",q),window.removeEventListener("blur",b))}),[e.pauseOnFocusLoss]);const J={onMouseDown:h,onTouchStart:h,onMouseUp:p,onTouchEnd:p};return d&&c&&(J.onMouseEnter=b,J.onMouseLeave=q),y&&(J.onClick=S=>{m&&m(S),a.canCloseOnClick&&s()}),{playToast:q,pauseToast:b,isRunning:t,preventExitTransition:r,toastRef:i,eventHandlers:J}}function wo(e){let{closeToast:t,theme:n,ariaLabel:r="close"}=e;return Z.createElement("button",{className:`Toastify__close-button Toastify__close-button--${n}`,type:"button",onClick:o=>{o.stopPropagation(),t(o)},"aria-label":r},Z.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},Z.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}function CA(e){let{delay:t,isRunning:n,closeToast:r,type:o="default",hide:i,className:a,style:A,controlledProgress:d,progress:c,rtl:s,isIn:m,theme:y}=e;const h=i||d&&c===0,p={...A,animationDuration:`${t}ms`,animationPlayState:n?"running":"paused",opacity:h?0:1};d&&(p.transform=`scaleX(${c})`);const q=Ve("Toastify__progress-bar",d?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${y}`,`Toastify__progress-bar--${o}`,{"Toastify__progress-bar--rtl":s}),b=be(a)?a({rtl:s,type:o,defaultClassName:q}):Ve(q,a);return Z.createElement("div",{role:"progressbar","aria-hidden":h?"true":"false","aria-label":"notification timer",className:b,style:p,[d&&c>=1?"onTransitionEnd":"onAnimationEnd"]:d&&c<1?null:()=>{m&&r()}})}const ZA=e=>{const{isRunning:t,preventExitTransition:n,toastRef:r,eventHandlers:o}=bA(e),{closeButton:i,children:a,autoClose:A,onClick:d,type:c,hideProgressBar:s,closeToast:m,transition:y,position:h,className:p,style:q,bodyClassName:b,bodyStyle:K,progressClassName:k,progressStyle:J,updateId:S,role:C,progress:U,rtl:ne,toastId:P,deleteToast:Ae,isIn:se,isLoading:re,iconOut:F,closeOnClick:H,theme:M}=e,O=Ve("Toastify__toast",`Toastify__toast-theme--${M}`,`Toastify__toast--${c}`,{"Toastify__toast--rtl":ne},{"Toastify__toast--close-on-click":H}),j=be(p)?p({rtl:ne,position:h,type:c,defaultClassName:O}):Ve(O,p),f=!!U||!A,E={closeToast:m,type:c,theme:M};let N=null;return i===!1||(N=be(i)?i(E):Z.isValidElement(i)?Z.cloneElement(i,E):wo(E)),Z.createElement(y,{isIn:se,done:Ae,position:h,preventExitTransition:n,nodeRef:r},Z.createElement("div",{id:P,onClick:d,className:j,...o,style:q,ref:r},Z.createElement("div",{...se&&{role:C},className:be(b)?b({type:c}):Ve("Toastify__toast-body",b),style:K},F!=null&&Z.createElement("div",{className:Ve("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!re})},F),Z.createElement("div",null,a)),N,Z.createElement(CA,{...S&&!f?{key:`pb-${S}`}:{},rtl:ne,theme:M,delay:A,isRunning:t,isIn:se,closeToast:m,hide:s,type:c,style:J,className:k,controlledProgress:f,progress:U||0})))},_t=function(e,t){return t===void 0&&(t=!1),{enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}},IA=Ut(_t("bounce",!0));Ut(_t("slide",!0)),Ut(_t("zoom")),Ut(_t("flip"));const Gn=Z.forwardRef((e,t)=>{const{getToastToRender:n,containerRef:r,isToastActive:o}=vA(e),{className:i,style:a,rtl:A,containerId:d}=e;function c(s){const m=Ve("Toastify__toast-container",`Toastify__toast-container--${s}`,{"Toastify__toast-container--rtl":A});return be(i)?i({position:s,rtl:A,defaultClassName:m}):Ve(m,Bt(i))}return Z.useEffect(()=>{t&&(t.current=r.current)},[]),Z.createElement("div",{ref:r,className:"Toastify",id:d},n((s,m)=>{const y=m.length?{...a}:{...a,pointerEvents:"none"};return Z.createElement("div",{className:c(s),style:y,key:`container-${s}`},m.map((h,p)=>{let{content:q,props:b}=h;return Z.createElement(ZA,{...b,isIn:o(b.toastId),style:{...b.style,"--nth":p+1,"--len":m.length},key:`toast-${b.key}`},q)}))}))});Gn.displayName="ToastContainer",Gn.defaultProps={position:"top-right",transition:IA,autoClose:5e3,closeButton:wo,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,draggable:!0,draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};let Tn,$e=new Map,It=[],wA=1;function xo(){return""+wA++}function xA(e){return e&&(_e(e.toastId)||Zt(e.toastId))?e.toastId:xo()}function wt(e,t){return $e.size>0?Me.emit(0,e,t):It.push({content:e,options:t}),t.toastId}function $t(e,t){return{...t,type:t&&t.type||e,toastId:xA(t)}}function en(e){return(t,n)=>wt(t,$t(e,n))}function ce(e,t){return wt(e,$t("default",t))}ce.loading=(e,t)=>wt(e,$t("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),ce.promise=function(e,t,n){let r,{pending:o,error:i,success:a}=t;o&&(r=_e(o)?ce.loading(o,n):ce.loading(o.render,{...n,...o}));const A={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},d=(s,m,y)=>{if(m==null)return void ce.dismiss(r);const h={type:s,...A,...n,data:y},p=_e(m)?{render:m}:m;return r?ce.update(r,{...h,...p}):ce(p.render,{...h,...p}),y},c=be(e)?e():e;return c.then(s=>d("success",a,s)).catch(s=>d("error",i,s)),c},ce.success=en("success"),ce.info=en("info"),ce.error=en("error"),ce.warning=en("warning"),ce.warn=ce.warning,ce.dark=(e,t)=>wt(e,$t("default",{theme:"dark",...t})),ce.dismiss=e=>{$e.size>0?Me.emit(1,e):It=It.filter(t=>e!=null&&t.options.toastId!==e)},ce.clearWaitingQueue=function(e){return e===void 0&&(e={}),Me.emit(5,e)},ce.isActive=e=>{let t=!1;return $e.forEach(n=>{n.isToastActive&&n.isToastActive(e)&&(t=!0)}),t},ce.update=function(e,t){t===void 0&&(t={}),setTimeout(()=>{const n=function(r,o){let{containerId:i}=o;const a=$e.get(i||Tn);return a&&a.getToast(r)}(e,t);if(n){const{props:r,content:o}=n,i={delay:100,...r,...t,toastId:t.toastId||e,updateId:xo()};i.toastId!==e&&(i.staleId=e);const a=i.render||o;delete i.render,wt(a,i)}},0)},ce.done=e=>{ce.update(e,{progress:1})},ce.onChange=e=>(Me.on(4,e),()=>{Me.off(4,e)}),ce.POSITION={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},ce.TYPE={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},Me.on(2,e=>{Tn=e.containerId||e,$e.set(Tn,e),It.forEach(t=>{Me.emit(0,t.content,t.options)}),It=[]}).on(3,e=>{$e.delete(e.containerId||e),$e.size===0&&Me.off(0).off(1).off(5)});function xt(e){ce.success(e,{position:"top-center",autoClose:650,hideProgressBar:!0,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0,theme:"light"})}let Hn="",et="Playable",Ce=null,Ko=null;const tn=async e=>{let t=Hn+"/"+e,n=e;fetch(t).then(r=>r.blob()).then(r=>{const o=window.URL.createObjectURL(r),i=document.createElement("a");i.href=o,i.download=n.split("/").reduce((a,A)=>A,""),document.body.appendChild(i),i.click(),window.URL.revokeObjectURL(o),xt("Download successfully")}).catch(r=>{console.error("File error:",r)})},KA=(e,t)=>{let n=Hn+"/"+e;Vt(n)?xt("Link Copied"):t(n)};async function nn(e,t,n,r="download",o=!1,i=null){return new Promise(async(a,A)=>{let d=async c=>{r==="download"?await tn(c):r==="copy"&&KA(c,Ko)};et==="Playable"?(n&&await Pt(e,{iosLink:n==null?void 0:n.iosUrl,androidLink:n==null?void 0:n.googleUrl},Ce),fA(Ce,e,t,o,i).then(async c=>{let{url:s}=c;await d(s),a(c)}).catch(c=>{let s=c.response.data.error.msg;A({message:s})})):et==="Flex"?(n&&await vo({_id:e,iosLink:n==null?void 0:n.iosUrl,androidLink:n==null?void 0:n.googleUrl},Ce),mA({_id:e,network:t,extras:i},Ce).then(async c=>{if(c.message){A(c);return}let{url:s}=c;await d(s),a(c)}).catch(c=>{let s=c.response.data.error.msg;A({message:s})})):et==="Import"?pA(Ce,e,t).then(async c=>{let s=c.url;await d(s),a(c)}).catch(c=>{let s=c.response.data.error.msg;A({message:s})}):et==="Ready"&&(n&&await Pt(e,{iosLink:n==null?void 0:n.iosUrl,androidLink:n==null?void 0:n.googleUrl},Ce),qA(Ce,e,t,o,i).then(async c=>{if(c.message){A(c);return}let s=c.url;await d(s),a(c)}).catch(c=>{let s=c.response.data.error.msg;A({message:s})}))})}async function WA(e,t,n){return new Promise(async(r,o)=>{console.log("get multi download"),et==="Flex"?(await vo({_id:e,iosLink:t==null?void 0:t.iosUrl,androidLink:t==null?void 0:t.googleUrl},Ce),dA(e,n,Ce).then(async i=>{if(i.message){o(i);return}await tn(i.url),r(i.url)}).catch(i=>{let a=i.response.data.error.msg;o({message:a})})):et==="Ready"?(console.log("ready"),await Pt(e,{iosLink:t==null?void 0:t.iosUrl,androidLink:t==null?void 0:t.googleUrl},Ce),console.log("ready link multi"),gA(e,n,Ce).then(async i=>{if(console.log("res",i),i.message){o(i);return}await tn(i.url),r(i.url)}).catch(i=>{console.log("err",i);let a=i.response.data.error.msg;o({message:a})})):(await Pt(e,{iosLink:t==null?void 0:t.iosUrl,androidLink:t==null?void 0:t.googleUrl},Ce),hA(e,n,Ce).then(async i=>{await tn(i.url),r(i.url)}).catch(i=>{let a=i.response.data.error.msg;o({message:a})}))})}function MA(e,t,n,r){et=e,Ce=t,Ko=n,Hn=r}const SA=({versionId:e,typeOfProduct:t,copyLinkUrl:n,setSafariCopyLink:r,qrUrl:o})=>{const[i,a]=Z.useState(!1),A=async()=>{a(!0),nn(e,"default",null,null,!1).then(d=>{a(!1);let c;t==="Flex"?c=`${n}/preview?versionId=${e}`:t==="Import"?c=`${n}/preview?versionId=${e}_`:t==="Ready"?c=`${n}/preview?versionId=${e}_&ready=true`:c=`${n}/preview?versionId=${e}_`,Vt(c)?xt("Link copied"):r(c),a(!1)}).catch(d=>{a(!1)})};return console.log(o),l.jsxs("div",{style:{display:"flex",height:"125px",width:"100%",borderRadius:"10px",backgroundColor:"#000000",padding:"10px"},children:[l.jsx("div",{style:{marginRight:"0.75rem",width:"50%",display:"flex",justifyContent:"center",alignItems:"center"},children:o?l.jsx(Bi,{bgColor:"#0F0F1E",fgColor:"#ffffff",style:{height:"auto",maxWidth:"100%",width:"100%"},value:o}):l.jsx("img",{style:{width:"50px",height:"50px"},src:Qe,alt:"pf-logo-gif"})}),l.jsxs("div",{children:[l.jsx("div",{style:{marginBottom:"0.25rem",fontSize:"0.875rem",fontWeight:"bold",color:"white"},children:"Mobile testing"}),l.jsx("div",{style:{marginBottom:"1rem",fontSize:"0.75rem",color:"gray"},children:"Scan QR Code to test in any browser"}),l.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"0.375rem",backgroundColor:"#00a3ff57",color:"secondary-blue",cursor:"pointer"},onClick:()=>{i||A()},children:[l.jsx(kr,{style:{height:"1.5rem",width:"1.5rem",stroke:"secondary-blue",color:"white"}}),l.jsx("div",{style:{height:"24px",display:"flex",alignItems:"center",justifyContent:"center",width:"80px"},children:i?l.jsx("img",{style:{height:"90%"},src:Qe,alt:"loading"}):l.jsx("button",{style:{fontSize:"1rem",color:"white",background:"rgba(0, 163, 255, 0)"},children:"Copy Link"})})]})]})]})},LA=({versionName:e,versionId:t,typeOfProduct:n,api:r,iframeUrl:o,fetchFileUrl:i,copyLinkUrl:a,setSafariCopyLink:A})=>{const[d,c]=Z.useState(window.innerWidth);Z.useEffect(()=>{const m=()=>{c(window.innerWidth)};return window.addEventListener("resize",m),()=>{window.removeEventListener("resize",m)}},[]);const s=(e==null?void 0:e.length)>25?e.slice(0,25)+"...":e;return l.jsxs("div",{style:{display:"flex",width:"300px",flexDirection:"column",justifyContent:"space-between",padding:"5px",height:d>1440?"680px":"620px",borderRadius:"0px 0px 0px 16px",marginTop:"20px"},children:[l.jsx(mi,{iframeUrl:o}),l.jsx(pi,{name:s}),l.jsx(SA,{versionId:t,typeOfProduct:n,copyLinkUrl:a,setSafariCopyLink:A,qrUrl:o})]})};var he=(e=>(e.Flex="#7101FF",e.Playable="#F9830B",e.Import="#00a3ff",e.Ready="#0060A5",e))(he||{});const OA=({typeOfProduct:e})=>l.jsxs("div",{style:{fontSize:"2xl",fontWeight:"bold"},children:[l.jsx("span",{style:{color:he[e]},children:"Select a Network"}),l.jsx("span",{style:{whiteSpace:"pre"},children:" From List"})]});async function EA(e,t){return(await fe.post(t+"/buyRequest",{requestType:e})).data}const kA=()=>l.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[l.jsxs("g",{"clip-path":"url(#clip0_518_12094)",children:[l.jsx("path",{d:"M4.50977 11.99L19.4898 11.99",stroke:"#7101FF","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),l.jsx("path",{d:"M13.5068 17.977L19.4828 12L13.5068 6.02299",stroke:"#7101FF","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})]}),l.jsx("defs",{children:l.jsx("clipPath",{id:"clip0_518_12094",children:l.jsx("rect",{width:"24",height:"24",fill:"white",transform:"translate(0 24) rotate(-90)"})})})]}),YA=({creditDownload:e,api:t})=>l.jsxs(l.Fragment,{children:[l.jsx("div",{style:{marginTop:"0.5rem",paddingLeft:"1.5rem",paddingRight:"1.5rem",fontWeight:100},children:"If you continue to export, you will spend 1 credit."}),l.jsxs("div",{style:{display:"flex",alignItems:"center",width:"100%",paddingLeft:"1.5rem",paddingRight:"1.5rem",paddingTop:"0.25rem",fontSize:"12px",fontWeight:100},children:["You have"," ",l.jsx("span",{style:{paddingLeft:"0.25rem",paddingRight:"0.25rem",fontWeight:"bold",color:"#yourColorHere"},children:(e==null?void 0:e.downloadLimit)-(e==null?void 0:e.downloadLimitUsed)<0?0:(e==null?void 0:e.downloadLimit)-(e==null?void 0:e.downloadLimitUsed)})," ","credits remaining.",l.jsxs("button",{style:{marginLeft:"0.5rem",display:"flex",alignItems:"center",fontSize:"12px",fontWeight:"bold",textDecoration:"underline",color:"#yourColorHere"},onClick:()=>EA("Flex Credit",t).then(n=>xt("You will be contacted regarding your request.")),children:["Get more",l.jsx(kA,{})]})]})]}),Wo=({typeOfProduct:e,urls:t,handleIosChange:n,handleGoogleChange:r,disabled:o})=>{const i=A=>{n(A.target.value)},a=A=>{r(A.target.value)};return l.jsxs(l.Fragment,{children:[l.jsxs("div",{style:{display:"flex",height:"2rem",width:"100%",alignItems:"center",fontSize:"12px",fontWeight:"200"},children:[l.jsx("span",{style:{width:"5rem",fontWeight:"bold"},children:"App Store:"}),l.jsx("input",{style:{marginLeft:"1.25rem",display:"flex",height:"100%",width:"70%",alignItems:"center",borderRadius:"0.375rem",border:t.iosUrl?"1px solid lightgray":"1px solid red",paddingLeft:"0.5rem",color:"#000000",borderColor:he[e]},type:"text",value:t.iosUrl,onChange:i,placeholder:"Ios Url",disabled:o})]}),l.jsxs("div",{style:{marginTop:"0.5rem",display:"flex",height:"2rem",width:"100%",alignItems:"center",fontSize:"12px",fontWeight:"100"},children:[l.jsxs("span",{style:{width:"5rem",fontWeight:"bold"},children:["Google Play:"," "]}),l.jsx("input",{style:{marginLeft:"1.25rem",display:"flex",height:"100%",width:"70%",alignItems:"center",borderRadius:"0.375rem",border:t.googleUrl?"1px solid lightgray":"1px solid red",paddingLeft:"0.5rem",color:"#000000",borderColor:he[e]},type:"text",value:t.googleUrl,onChange:a,placeholder:"Google Url",disabled:o})]})]})},zA=({typeOfProduct:e,urls:t,handleIosChange:n,handleGoogleChange:r,disabled:o})=>{const i=a=>{n(a.target.value)};return l.jsx(l.Fragment,{children:l.jsxs("div",{style:{display:"flex",height:"2rem",width:"100%",alignItems:"center",fontSize:"12px",fontWeight:"200"},children:[l.jsx("span",{style:{width:"5rem",fontWeight:"bold"},children:"Redirection URL:"}),l.jsx("input",{style:{marginLeft:"1.25rem",display:"flex",height:"100%",width:"70%",alignItems:"center",borderRadius:"0.375rem",border:t.iosUrl?"1px solid lightgray":"1px solid red",paddingLeft:"0.5rem",color:"#000000",borderColor:he[e]},type:"text",value:t.iosUrl,onChange:i,placeholder:"Ios Url",disabled:o})]})})},jA=({typeOfProduct:e,fileSize:t,urls:n,handleIosChange:r,handleGoogleChange:o,disabled:i,api:a,creditDownload:A,user:d,isTest:c,setIsTest:s,urlType:m,setUrlType:y})=>{const h=()=>l.jsxs("div",{style:{display:"flex",height:"24px",width:"100%",alignItems:"center",fontSize:"12px",fontWeight:"100"},children:[l.jsxs("span",{style:{width:"5rem",fontWeight:"bold"},children:["Enable Test:"," "]}),l.jsx("input",{style:{marginLeft:"1.25rem",display:"flex",height:"100%",width:"20px",alignItems:"center",borderRadius:"0.375rem",border:n.googleUrl?"1px solid lightgray":"1px solid red",paddingLeft:"0.5rem",color:"#000000",borderColor:he[e]},type:"checkbox",checked:c,onChange:()=>{s(!c)},placeholder:"Google Url",disabled:i})]}),p=()=>l.jsx(l.Fragment,{children:l.jsxs("div",{style:{display:"flex",width:"400px",height:"30px",flexDirection:"row",justifyContent:"space-between",alignItems:"center",borderBottom:"1px solid #eaeaec",marginBottom:"10px",position:"relative"},className:"tab-switch",children:[l.jsx("div",{style:{position:"absolute",bottom:"-3px",left:m==="single"?"50%":"0%",width:"50%",height:"3px",borderRadius:"2px",backgroundColor:"#12a9fe",transition:"all 0.2s ease-in-out"},id:"tab-switch-background"}),l.jsx("div",{style:{width:"50%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",position:"relative"},onClick:()=>{document.getElementById("tab-switch-background").style.left="0%",document.getElementById("single-tab").style.color="#a3a3a3",document.getElementById("game-tab").style.color="#000",document.getElementById("single-tab").style.fontWeight="normal",document.getElementById("game-tab").style.fontWeight="bold",setTimeout(()=>{y("game")},200)},children:l.jsx("span",{style:{position:"relative",color:m==="game"?"#000":"#a3a3a3",fontWeight:m==="game"?"bold":"normal",transition:"all 0.2s ease-in-out"},id:"game-tab",children:"App"})},"gameTab"),l.jsx("div",{style:{width:"50%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",position:"relative"},onClick:()=>{document.getElementById("tab-switch-background").style.left="50%",document.getElementById("single-tab").style.color="#000",document.getElementById("game-tab").style.color="#a3a3a3",document.getElementById("single-tab").style.fontWeight="bold",document.getElementById("game-tab").style.fontWeight="normal",setTimeout(()=>{y("single")},200)},children:l.jsx("span",{style:{position:"relative",color:m==="single"?"#000":"#a3a3a3",fontWeight:m==="single"?"bold":"normal",transition:"all 0.2s ease-in-out"},id:"single-tab",children:"Website"})},"singleTab")]})});return l.jsx(l.Fragment,{children:e!=="Import"&&l.jsxs("div",{style:{display:"flex",width:"100%",flexDirection:"column"},children:[d.customer=="playableFactoryInternal"&&e==="Playable"&&l.jsx(h,{}),e==="Ready"?l.jsxs(l.Fragment,{children:[l.jsx(p,{}),m==="game"&&l.jsx(Wo,{typeOfProduct:e,urls:n,handleIosChange:r,handleGoogleChange:o,disabled:i}),m==="single"&&l.jsx(zA,{typeOfProduct:e,urls:n,handleIosChange:r,handleGoogleChange:o,disabled:i})]}):l.jsx(l.Fragment,{children:l.jsx(Wo,{typeOfProduct:e,urls:n,handleIosChange:r,handleGoogleChange:o,disabled:i})}),(A==null?void 0:A.willSpendCredit)&&l.jsx(YA,{creditDownload:A,api:a})]})})},JA=({typeOfProduct:e,title:t,fileSize:n})=>l.jsxs("div",{style:{fontSize:"1.5rem",fontWeight:"bold",paddingTop:"20px"},children:[l.jsx("span",{style:{color:he[e]},children:t}),n&&l.jsxs("span",{style:{fontSize:"14px",fontWeight:"bold",marginLeft:"30px",color:"#87878E"},children:["File size: ",parseFloat(n).toFixed(2)," mb"]})]}),NA=({typeOfProduct:e,fileSize:t,urls:n,title:r,handleIosChange:o,handleGoogleChange:i,disabled:a,creditDownload:A,api:d,user:c,isTest:s,setIsTest:m,urlType:y,setUrlType:h})=>l.jsxs("div",{style:{display:"flex",flexDirection:"column",width:"100%",justifyContent:"space-between",alignItems:"flex-start",borderBottom:"1px solid #D1D5DB",paddingLeft:"1.25rem",paddingRight:"1.25rem",gap:"0.5rem"},children:[l.jsx(JA,{typeOfProduct:e,title:r,fileSize:t}),l.jsx(jA,{typeOfProduct:e,fileSize:t,urls:n,handleIosChange:o,handleGoogleChange:i,disabled:a,creditDownload:A,api:d,user:c,isTest:s,setIsTest:m,urlType:y,setUrlType:h}),l.jsx(OA,{typeOfProduct:e})]}),Xn=({children:e,className:t,onClickDonwload:n,downloading:r,disabled:o})=>l.jsx("button",{onClick:n,className:t,style:{display:"flex",height:"40px",alignItems:"center",justifyContent:"center",borderRadius:"0.375rem",border:"1px solid lightgray",padding:"0.25rem",fontSize:"0.875rem",width:200,backgroundColor:"#FFFFFF"},disabled:r||o,children:e}),DA=({checked:e,typeOfProduct:t,id:n})=>{const[r,o]=Z.useState(e);Z.useEffect(()=>{o(e)},[e]);const i=()=>{o(!r)};return l.jsx("div",{style:{display:"inline-flex",alignItems:"center"},children:l.jsxs("label",{onClick:i,style:{position:"relative",display:"flex",cursor:"pointer",alignItems:"center"},htmlFor:n,children:[l.jsx("input",{type:"checkbox",style:{position:"relative",height:"20px",width:"20px",cursor:"pointer",appearance:"none",borderRadius:"0.25rem",transition:"all ease-in-out",border:"1px solid lightgray",opacity:1},id:n,checked:r,onChange:i}),l.jsxs("div",{style:{pointerEvents:"none",position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:"white",opacity:r?1:0,transition:"opacity ease-in-out"},children:[l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",style:{height:"14px",width:"14px"},viewBox:"0 0 20 20",fill:he[t],stroke:he[t],strokeWidth:"1",children:l.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})," "]})]})})},jl="",RA=({typeOfProduct:e})=>l.jsx("div",{style:{backgroundColor:"transparent",display:"flex",alignItems:"center",flexDirection:"column"},children:l.jsxs("div",{style:{position:"relative",width:"64px",height:"16px",marginTop:"8px"},children:[l.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:he[e]}}),l.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:he[e]}}),l.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:he[e]}}),l.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:he[e]}})]})}),Qn=({isNetworksLoading:e=!1})=>l.jsx("div",{style:{display:"flex",height:"100%",width:"90px",alignItems:"center",justifyContent:"center"},children:l.jsx("img",{width:e?"100px":"25px",height:e?"100px":"25px",src:Qe,alt:"pf-logo-gif"})}),Mo=({title:e,titleId:t,...n})=>l.jsxs("svg",{viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em","aria-labelledby":t,...n,children:[e?l.jsx("title",{id:t,children:e}):null,l.jsx("path",{stroke:"currentColor",d:"m15.985 11.111-3.556 3.556-3.556-3.556M12.429 4v10.667M20.429 16.444A3.556 3.556 0 0 1 16.873 20H7.985a3.556 3.556 0 0 1-3.556-3.556",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round"})]}),GA=({onClose:e,iosLink:t,googleLink:n,buttonType:r,handleCopyLink:o,download:i,typeOfProduct:a,urlType:A})=>{let d="";return a==="Ready"&&A==="single"?d="Redirection url is empty. Are you sure you want to continue?":!t&&!n?d="Both links are empty. Are you sure you want to continue?":t?n||(d="Google link is empty. Are you sure you want to continue?"):d="iOS link is empty. Are you sure you want to continue?",l.jsxs("div",{style:{position:"fixed",top:0,left:0,zIndex:50,display:"flex",height:"120%",width:"130%",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0, 0, 0, 0.2)"},children:[l.jsx("div",{onClick:e,style:{position:"absolute",zIndex:30,height:"100%",width:"100%",pointerEvents:"none"}}),l.jsxs("div",{style:{position:"absolute",zIndex:50,display:"flex",flexDirection:"column",gap:"5px",maxWidth:"350px",borderRadius:"0.375rem",backgroundColor:"white",padding:"1rem",pointerEvents:"auto"},children:[l.jsx("h1",{style:{textAlign:"center",fontSize:"18px",lineHeight:"24px"},children:d}),l.jsxs("div",{style:{display:"flex",gap:"5px"},children:[l.jsx("button",{onClick:()=>{e(!1)},style:{flex:1,cursor:"pointer",borderRadius:"0.375rem",border:"1px solid #666666",padding:"0.5rem",fontWeight:"bold",transition:"all 0.15s ease-linear"},children:"No"}),l.jsx("button",{onClick:async c=>{r==="download"?await i():r==="copyLink"&&await o(),e()},style:{flex:1,cursor:"pointer",borderRadius:"0.375rem",border:"1px solid red",backgroundColor:"darkorange",padding:"0.5rem",fontWeight:"bold",color:"white",transition:"all 0.15s ease-linear"},children:"Yes"})]})]})]})},So=({onClose:e,handleCopyLink:t,download:n,creditConfirmType:r,getDownloadCount:o})=>l.jsxs("div",{style:{position:"fixed",top:0,left:0,zIndex:50,display:"flex",height:"120%",width:"130%",alignItems:"center",justifyContent:"center",backgroundColor:"#00000080"},children:[l.jsx("div",{onClick:e,style:{position:"absolute",zIndex:30,height:"100%",width:"100%"}}),l.jsxs("div",{style:{position:"absolute",zIndex:50,display:"flex",height:"max-content",width:350,flexDirection:"column",gap:"5px",borderRadius:"8px",backgroundColor:"white",padding:"20px"},children:[l.jsx("h1",{style:{textAlign:"center",fontSize:"18px",lineHeight:"24px"},children:"You are going to spend 1 credit for this download, do you want to continue?"}),l.jsxs("div",{style:{display:"flex",gap:"5px"},children:[l.jsx("button",{onClick:e,style:{flex:1,cursor:"pointer",borderRadius:"4px",borderWidth:"1px",borderColor:"dark-50",padding:"2px",fontWeight:"bold"},children:"No"}),l.jsx("button",{style:{flex:1,cursor:"pointer",borderRadius:"4px",borderWidth:"1px",borderColor:"#F9830B",backgroundColor:"#F9830B",padding:"2px",fontWeight:"bold",color:"white"},onClick:async i=>{i.preventDefault(),i.stopPropagation(),r==="download"?(await n(),await o()):r==="copy"&&(await t(),await o()),e()},children:"Yes"})]})]})]}),TA=({onClose:e,handleDownload:t,handleDownloadMolocoTest:n,downloadingMoloco:r,downloadingMolocoTest:o,downloadingMolocoHtml:i})=>l.jsxs("div",{style:{position:"fixed",top:0,left:0,zIndex:50,display:"flex",height:"100%",width:"100%",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0, 0, 0, 0.2)"},onClick:e,children:[l.jsx("div",{onClick:e,style:{position:"absolute",zIndex:30,height:"100%",width:"100%",pointerEvents:"none"}}),l.jsx("div",{style:{position:"absolute",zIndex:50,display:"flex",flexDirection:"column",gap:"5px",minWidth:"500px",borderRadius:"0.375rem",backgroundColor:"white",padding:"1rem",pointerEvents:"auto"},onClick:a=>{a.stopPropagation()},children:l.jsxs("div",{style:{display:"flex",gap:"5px",flexDirection:"column"},children:[l.jsxs("div",{style:{display:"flex",justifyContent:"center"},children:[r?l.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",borderRadius:"0.375rem",border:"1px solid darkorange",backgroundColor:"darkorange",color:"white",transition:"all 0.15s ease-linear",width:"200px",marginRight:"10px"},children:l.jsx("img",{width:"25px",height:"25px",src:Qe,alt:"pf-logo-gif"})}):l.jsx("button",{onClick:()=>{t(!1)},style:{cursor:"pointer",borderRadius:"0.375rem",border:"1px solid darkorange",backgroundColor:"darkorange",color:"white",transition:"all 0.15s ease-linear",width:"200px",marginRight:"10px"},children:"Download"}),i?l.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",borderRadius:"0.375rem",border:"1px solid darkorange",backgroundColor:"darkorange",color:"white",transition:"all 0.15s ease-linear",width:"200px",marginLeft:"10px"},children:l.jsx("img",{width:"25px",height:"25px",src:Qe,alt:"pf-logo-gif"})}):l.jsx("button",{onClick:()=>{t(!0)},style:{cursor:"pointer",borderRadius:"0.375rem",border:"1px solid darkorange",backgroundColor:"darkorange",color:"white",transition:"all 0.15s ease-linear",width:"200px",marginLeft:"10px"},children:"Download HTML"})]}),l.jsx("div",{style:{display:"flex",justifyContent:"center"},children:o?l.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",borderRadius:"0.375rem",border:"1px solid darkorange",backgroundColor:"darkorange",color:"white",transition:"all 0.15s ease-linear",width:"200px"},children:l.jsx("img",{width:"25px",height:"25px",src:Qe,alt:"pf-logo-gif"})}):l.jsx("button",{onClick:n,style:{cursor:"pointer",borderRadius:"0.375rem",border:"1px solid darkorange",backgroundColor:"darkorange",color:"white",transition:"all 0.15s ease-linear",width:"200px"},children:"Download Moloco Test"})})]})})]});async function HA(e,t,n,r){return(await fe.post(e+"/createMolocoTestPage",{_id:t,network:n,typeOfProduct:r})).data}const XA=({id:e,imageUrl:t,handleCardClick:n,selected:r,name:o,networkVersionSize:i,fileSizeLoading:a,showCheckBox:A,typeOfProduct:d,versionId:c,api:s,handleDownloadError:m,fetchFileUrl:y,urls:h,game:p,setIsConfirmActive:q,creditDownload:b,getDownloadCount:K,disabled:k,user:J,setSafariCopyLink:S,isTest:C,urlType:U})=>{const[ne,P]=Z.useState(!1),[Ae,se]=Z.useState(""),[re,F]=Z.useState(!1),[H,M]=Z.useState(!1),[O,j]=Z.useState(!1),[f,E]=Z.useState("download"),[N,g]=Z.useState(!1),[I,Y]=Z.useState(!1),[x,z]=Z.useState(!1);let V={aarki:"html,copy",adcolony:"copy,html",adjoe:"copy,html",applovin:"copy,html",appreciate:"zip",chartboost:"copy,html",criteo:"zip",crossinstall:"copy,html",default:"copy",fb:"zip",fyber:"copy,html",google:"zip",google360:"zip",ironsource:"copy,html",kayzen:"apikey",kaden:"html",kidoz:"html",lifestreet:"copy,html",liftoff:"copy,zip",mobvista:"html",moloco:"html,molocotest",molocoV2:"html,molocotest",nucleo:"copy,html",oceanengine:"copy,zip",pointblank:"html",smadex:"zip",snapchat:"zip",tapjoy:"copy,html",tencent:"zip",toutiao:"copy,zip",toutiao_cn:"copy,zip",unity:"copy,html",vungle:"html",web:"copy,html",yandex:"zip",zucks:"copy,html",luna:"zip",inmobi:"copy,html,",nend:"html",adikteev:"html",jammp:"copy,html"};const R=()=>{n(e)},D=async(B,W)=>(P(!0),new Promise((ue,Ue)=>{nn(c,B,h,W,C).then(we=>{P(!1),ue(we)}).catch(we=>{P(!1),m(we.message,we),Ue(we)})})),G=async(B=!1)=>{B?Y(!0):g(!0);const W={molocoGenerateHtml:!1};B&&(W.molocoGenerateHtml=!0),nn(c,o,h,"download",C,W).then(ue=>{B?Y(!1):g(!1),j(!1)}).catch(ue=>{m(ue.message,ue)})},_=async()=>{z(!0);const B=await HA(s,c,o,d);let W=`${y}/${B==null?void 0:B.url}`;Vt(W)?(xt("Link Copied"),z(!1)):S(W)},Q=o==="moloco"||o==="molocoV2";return l.jsxs(l.Fragment,{children:[l.jsxs("div",{style:{position:"relative",display:"flex",flexDirection:"column",gap:"20px",padding:"16px",borderColor:r?he[d]:"lightgray",borderWidth:"1px",borderStyle:"solid",backgroundColor:"white",width:"100%",height:"175px",borderRadius:"16px",cursor:"pointer"},className:"border-hover-"+d,onClick:R,children:[l.jsxs("div",{style:{marginTop:o=="web"?"10px":"40px",display:"flex",justifyContent:"center"},children:[l.jsx("div",{style:{position:"absolute",right:"0",top:"0",padding:"8px"},children:l.jsx("div",{children:i&&i.map(B=>B.network).includes(o)?a?l.jsx("div",{style:{position:"absolute",right:"0",top:"0.5rem",padding:"0.5rem",height:"1.5rem",display:"flex",justifyContent:"center",alignItems:"center",marginRight:"2rem"},children:l.jsx(RA,{typeOfProduct:d})}):i.map(B=>l.jsx("div",{style:{position:"absolute",right:"0",top:"0.5rem",padding:"0.5rem",marginRight:"2rem",fontSize:"1rem",height:"1.5rem",display:"flex",justifyContent:"center",alignItems:"center"},children:B.network===o?B.size.toString().slice(0,5)+"Mb":""},B.network)):null})}),l.jsx("div",{style:{position:"absolute",top:"0",left:"0",padding:"0.5rem"},children:(d==="Playable"||d==="Ready"||d==="Flex")&&A&&l.jsx(DA,{checked:r,typeOfProduct:d,id:e})}),l.jsx("img",{onClick:R,style:{width:"30rem",height:o=="web"?"80px":"50px",objectFit:"contain"},src:t})]}),l.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"0.25rem"},children:[l.jsxs(Xn,{className:`${Q?"w-1/2":"w-2/3"} border-hover-`+d,downloading:ne,onClickDonwload:async B=>{if(B.stopPropagation(),Q&&J.customer==="playableFactoryInternal"){j(!0);return}else{se("download");const W=h.iosUrl,ue=h.googleUrl;b&&b.willSpendCredit?(q(!0),E("download"),F(!0)):["Playable","Flex"].includes(d)&&(!W||!ue)||d==="Ready"&&U==="single"&&!W||d==="Ready"&&U==="multi"&&(!W||!ue)?(q(!0),M(!0)):(M(!1),F(!1),await D(o,"download"))}},children:[!ne&&l.jsxs(l.Fragment,{children:[l.jsx(Mo,{style:{marginRight:"0.5rem",height:"1.5rem",width:"1rem",stroke:"dark-full"}}),Q&&J.customer!=="playableFactoryInternal"?"TXT":"Download"]}),ne&&l.jsx(Qn,{})]}),V[o]&&V[o].includes("copy")&&l.jsx(Xn,{className:"w-1/3 border-hover-"+d,onClickDonwload:async B=>{B.stopPropagation(),se("copyLink");const W=h.iosUrl,ue=h.googleUrl;b&&(b!=null&&b.willSpendCredit)?(E("copy"),q(!0),F(!0)):d!=="Import"&&(!W||!ue)?(q(!0),M(!0)):(F(!1),M(!1),await D(o,"copy"))},disabled:k,children:l.jsx(kr,{className:"h-6 w-6 stroke-dark-full"})}),Q&&J.customer!=="playableFactoryInternal"&&l.jsx(Xn,{className:"w-1/2 border-hover-"+d,onClickDonwload:async B=>{B.stopPropagation(),se("download");const W=h.iosUrl,ue=h.googleUrl;b&&(b!=null&&b.willSpendCredit)?(E("download"),q(!0),F(!0)):d!=="Import"&&(!W||!ue)?(q(!0),M(!0)):(F(!1),M(!1),await G(!0))},disabled:k,children:l.jsxs(l.Fragment,{children:[l.jsx(Mo,{style:{marginRight:"0.5rem",height:"1.5rem",width:"1rem",stroke:"dark-full"}}),"HTML"]})})]})]}),re&&l.jsx(So,{creditConfirmType:f,handleCopyLink:async()=>{M(!1),q(!1),await D(o,"copy")},download:async()=>{M(!1),q(!1),await D(o,"download")},onClose:()=>{F(!1),q(!1)},getDownloadCount:K}),H&&l.jsx(GA,{onClose:()=>{M(!1),q(!1)},iosLink:h.iosUrl,googleLink:h.googleUrl,buttonType:Ae,handleCopyLink:async()=>{M(!1),q(!1),await D(o,"copy")},download:async()=>{M(!1),q(!1),await D(o,"download")},typeOfProduct:d,urlType:U}),O&&J.customer==="playableFactoryInternal"&&l.jsx(TA,{onClose:()=>{j(!1)},handleDownload:G,handleDownloadMolocoTest:_,downloadingMoloco:N,donwloadintMolocoTest:x,downloadingMolocoHtml:I})]})},Pn=[{id:"33",name:"web",imageSrc:"https://gearbox.playablefactory.com/files/network_icons/web.png"},{id:"1",name:"unity",imageSrc:"https://gearbox.playablefactory.com/unity.png"},{id:"2",name:"applovin",imageSrc:"https://gearbox.playablefactory.com/applovin.png"},{id:"3",name:"ironsource",imageSrc:"https://gearbox.playablefactory.com/ironsource.png"},{id:"4",name:"vungle",imageSrc:"https://gearbox.playablefactory.com/vungle.png"},{id:"5",name:"mobvista",imageSrc:"https://gearbox.playablefactory.com/mobvista.png"},{id:"6",name:"fb",imageSrc:"https://gearbox.playablefactory.com/fb.png"},{id:"7",name:"toutiao",imageSrc:"https://gearbox.playablefactory.com/toutiao.png"},{id:"8",name:"toutiao_cn",imageSrc:"https://gearbox.playablefactory.com/toutiao_cn.png"},{id:"9",name:"adcolony",imageSrc:"https://gearbox.playablefactory.com/adcolony.png"},{id:"10",name:"criteo",imageSrc:"https://gearbox.playablefactory.com/criteo.png"},{id:"11",name:"chartboost",imageSrc:"https://gearbox.playablefactory.com/chartboost.png"},{id:"12",name:"kayzen",imageSrc:"https://gearbox.playablefactory.com/kayzen.png"},{id:"13",name:"crossinstall",imageSrc:"https://gearbox.playablefactory.com/crossinstall.png"},{id:"14",name:"default",imageSrc:"https://gearbox.playablefactory.com/default.png"},{id:"15",name:"fyber",imageSrc:"https://gearbox.playablefactory.com/fyber.png"},{id:"16",name:"appreciate",imageSrc:"https://gearbox.playablefactory.com/appreciate.png"},{id:"17",name:"google360",imageSrc:"https://gearbox.playablefactory.com/google360.png"},{id:"18",name:"kaden",imageSrc:"https://gearbox.playablefactory.com/kaden.png"},{id:"19",name:"kidoz",imageSrc:"https://gearbox.playablefactory.com/kidoz.png"},{id:"20",name:"lifestreet",imageSrc:"https://gearbox.playablefactory.com/lifestreet.png"},{id:"21",name:"liftoff",imageSrc:"https://gearbox.playablefactory.com/liftoff.png"},{id:"22",name:"moloco",imageSrc:"https://gearbox.playablefactory.com/moloco.png"},{id:"23",name:"nucleo",imageSrc:"https://gearbox.playablefactory.com/nucleo.png"},{id:"24",name:"oceanengine",imageSrc:"https://gearbox.playablefactory.com/oceanengine.png"},{id:"25",name:"pointblank",imageSrc:"https://gearbox.playablefactory.com/pointblank.png"},{id:"26",name:"snapchat",imageSrc:"https://gearbox.playablefactory.com/snapchat.png"},{id:"27",name:"tapjoy",imageSrc:"https://gearbox.playablefactory.com/tapjoy.png"},{id:"28",name:"tencent",imageSrc:"https://gearbox.playablefactory.com/tencent.png"},{id:"31",name:"aarki",imageSrc:"https://gearbox.playablefactory.com/aarki.png"},{id:"32",name:"yandex",imageSrc:"https://gearbox.playablefactory.com/yandex.png"},{id:"34",name:"zucks",imageSrc:"https://gearbox.playablefactory.com/zucks.png"},{id:"35",name:"google",imageSrc:"https://gearbox.playablefactory.com/google.png"},{id:"36",name:"inmobi",imageSrc:"https://gearbox.playablefactory.com/inmobi.png"},{id:"38",name:"smadex",imageSrc:"https://gearbox.playablefactory.com/smadex.png"},{id:"39",name:"instantGame",imageSrc:"https://gearbox.playablefactory.com/instantGame.png"},{id:"40",name:"luna",imageSrc:"https://gearbox.playablefactory.com/luna.png"},{id:"41",name:"nend",imageSrc:"https://gearbox.playablefactory.com/nend.png"},{id:"42",name:"jammp",imageSrc:"https://gearbox.playablefactory.com/nend.png"},{id:"43",name:"adjoe",imageSrc:"https://gearbox.playablefactory.com/adjoe.png"},{id:"44",name:"molocoV2",imageSrc:"https://gearbox.playablefactory.com/molocoV2.png"},{id:"45",name:"adikteev",imageSrc:"https://gearbox.playablefactory.com/adikteev.png"},{id:"46",name:"appier",imageSrc:"https://gearbox.playablefactory.com/appier.png"},{id:"47",name:"remerge",imageSrc:"https://gearbox.playablefactory.com/remerge.png"},{id:"48",name:"persona",imageSrc:"https://gearbox.playablefactory.com/persona.png"},{id:"49",name:"bidease",imageSrc:"https://gearbox.playablefactory.com/bidease.png"}],QA=({children:e,typeOfProduct:t,className:n,onClick:r})=>{const o={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"0.5rem",width:"12rem",height:"2.5rem",backgroundColor:he[t],color:"white",fontSize:"0.875rem",borderRadius:"0.875rem"};return l.jsx("button",{onClick:r,className:n,style:o,children:e})},PA=({networksVersionTotalSize:e,typeOfProduct:t,onClickMultiDownload:n,multiDownloading:r})=>l.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"8px"},children:r?l.jsx("div",{style:{display:"flex",width:"12rem",height:"2.5rem",borderRadius:"0.875rem",alignItems:"center",justifyContent:"center",backgroundColor:he[t]},children:l.jsx(Qn,{})}):l.jsx(QA,{typeOfProduct:t,onClick:n,children:l.jsx("span",{style:{fontSize:"1.25rem",padding:"0.5rem",color:"#fff"},children:"Download All"})})}),VA=({playable:e,creditDownload:t,visible:n,versionId:r,typeOfProduct:o,api:i,user:a,handleDownloadError:A,fetchFileUrl:d,urls:c,game:s,getDownloadCount:m,disabled:y,setSafariCopyLink:h,isTest:p,urlType:q})=>{const[b,K]=Z.useState([]),[k,J]=Z.useState([]),[S,C]=Z.useState(!1),[U,ne]=Z.useState(""),[P,Ae]=Z.useState(!1),[se,re]=Z.useState(!1),[F,H]=Z.useState("download"),[M,O]=Z.useState(!1),j=async N=>{const g=[...b];if(b.includes(N)){const I=g.findIndex(Y=>Y===N);g.splice(I,1),K(g)}else g.push(N),K([...b,N]);Pn.filter(I=>[...g].includes(I.id)).map(I=>I.name)},f=async()=>(console.log("multi download"),new Promise(async(N,g)=>{const I=Pn.filter(Y=>[...b].includes(Y.id)).map(Y=>Y.name);Ae(!0),console.log("get multi download"),WA(r,c,I).then(Y=>{console.log("get multi download res"),Ae(!1),N(Y)}).catch(Y=>{console.log("get multi download err"),Ae(!1),A(Y.message,Y),g(Y)})})),E=async()=>{c.iosUrl,c.googleUrl,t&&t.willSpendCredit?(re(!0),H("download"),O(!0)):(O(!1),await f())};return l.jsxs(l.Fragment,{children:[l.jsx("div",{style:{position:"relative",flex:1,overflowY:se?"hidden":"auto",padding:"1.5rem",paddingTop:"0"},children:l.jsx("div",{style:{display:"grid",gridTemplateColumns:"180px 180px 180px",gap:"1rem",overflowY:"auto",padding:"0.75rem"},children:n&&Pn.filter(N=>{var g;return t&&((g=t==null?void 0:t.networks)==null?void 0:g.length)>0?t==null?void 0:t.networks.includes(N.name):o==="Import"?e==null?void 0:e.networks.filter(I=>I.status==="paid").some(I=>I.name===N.name):e==null?void 0:e.networks.includes(N.name)}).filter(N=>N.name==="voodoo"?a.customer==="customer:20":!0).map(N=>{let g=N.imageSrc;if(N.name==="web"){let I="web_"+o.toLowerCase()+".png";g=g.replace("web.png",I)}return l.jsx(XA,{id:N.id,name:N.name,imageUrl:g,selected:b.includes(N.id),handleCardClick:j,networkVersionSize:k,fileSizeLoading:S,showCheckBox:!0,typeOfProduct:o,versionId:r,api:i,handleDownloadError:A,fetchFileUrl:d,urls:c,game:s,creditDownload:t,setIsConfirmActive:re,getDownloadCount:m,disabled:y,user:a,setSafariCopyLink:h,isTest:p,urlType:q},N.id)})})}),b.length>1&&(o==="Playable"||o==="Ready"||o==="Flex")&&l.jsx("div",{style:{position:"fixed",bottom:"0",left:"65%",zIndex:20,transform:"translateX(-50%)",display:"flex",flexDirection:"column",paddingTop:"5px"},children:l.jsx(PA,{onClickMultiDownload:E,networksVersionTotalSize:U,typeOfProduct:o,multiDownloading:P})}),M&&l.jsx(So,{creditConfirmType:F,handleCopyLink:async()=>{},download:async()=>{O(!1),re(!1),await f()},onClose:()=>{O(!1),re(!1)},getDownloadCount:m})]})};async function BA(e,t){return(await fe.post(t+"/findPlayable",{_id:e})).data}async function UA(e,t){return(await fe.post(t+"/getFlexDownloadCount",e)).data}async function FA(e,t){try{return(await fe.post(t+"/findGame",{_id:e})).data}catch{}}async function _A(e,t){return(await fe.post(t+"/getPlayableVersionMarketLink",{_id:e})).data}async function $A(e,t){return(await fe.post(t+"/getFlexData",{_id:e})).data}async function es(e,t){return(await fe.post(t+"/getImportedPlayable",{id:e})).data}async function ts(e,t){return(await fe.post(t+"/getReadyDownloadCount",e)).data}const ns=["adcolony","ironsource","applovin","unity","mobvista","criteo","kayzen","vungle","moloco","inmobi"],Lo=["web","adcolony","applovin","chartboost","crossinstall","fb","google","ironsource","lifestreet","liftoff","mobvista","nucleo","tapjoy","toutiao","unity","vungle","moloco"],rs=({playableId:e,versionId:t,gameId:n,typeOfProduct:r,visible:o,api:i,user:a,title:A,handleDownloadError:d,fetchFileUrl:c,fileSize:s,setFileSize:m,setSafariCopyLink:y})=>{const[h,p]=Z.useState(null),[q,b]=Z.useState(null),[K,k]=Z.useState(null),[J,S]=Z.useState(!1),[C,U]=Z.useState("Loading..."),[ne,P]=Z.useState("Loading..."),[Ae,se]=Z.useState(!0),[re,F]=Z.useState(window.innerWidth),[H,M]=Z.useState(!1),[O,j]=Z.useState("game");Z.useEffect(()=>{const x=()=>{F(window.innerWidth)};return window.addEventListener("resize",x),()=>{window.removeEventListener("resize",x)}},[]);const f=async()=>{S(!0);const x=await BA(e,i);return x!=null&&x.networks||(x.networks=ns),p(x),x},E=x=>{U(x)},N=x=>{P(x)},g=async(x,z)=>{var V,R;try{let D;if(r==="Playable"||r==="Ready"){const G=await _A(t,i);if(G){U(G.iosLink),P(G.androidLink),S(!1);return}if(x&&(x.iosUrl||x.googleUrl)){U(x.iosUrl),P(x.googleUrl),S(!1);return}if(z&&z.html){let _=await fetch(c+"/"+z.html).then(W=>W.text());const Q=((V=_.match(/var\s+iosLink\s*=\s*['|"](https?[\w\d;,/?:@&=+$\-_.!~*'()#]+)['|"]/))==null?void 0:V.at(1))||"";U(Q);const B=((R=_.match(/var\s+androidLink\s*=\s*['|"](https?[\w\d;,/?:@&=+$\-_.!~*'()#]+)['|"]/))==null?void 0:R.at(1))||"";P(B),S(!1)}else P(""),U(""),S(!1)}else if(r==="Flex"){const G=await $A(t,i);if(G.googleUrl||G.iosUrl){P(G.googleUrl),U(G.iosUrl),S(!1);return}x&&(x.iosUrl||x.googleUrl)?(U(x.iosUrl),P(x.googleUrl),S(!1)):(P(""),U(""),S(!1))}}catch(D){d(D.response.data.error.msg)}},I=async()=>{S(!0);let x;r==="Flex"?x=await UA({_id:t},i):r==="Ready"&&(x=await ts({_id:t},i)),x&&(["admin","pm","tester"].includes(a.role)?k({...x,networks:Lo}):r==="Ready"&&!x.canDownload?k({...x,networks:Lo}):k(x)),S(!1)},Y=async()=>await FA(n,i);return Z.useEffect(()=>{o||(p(null),b(null),k(null),m(null)),o&&(r==="Playable"?(f().then(x=>{g(null,x)}),se(!1)):r==="Ready"?I().then(x=>{f().then(z=>{g(null,z),se(!1)})}):r==="Flex"?I().then(x=>{se(!1),Y().then(z=>{o&&(g(z,null),se(!1),b(z))})}):r==="Import"&&es(t,i).then(x=>{console.log(x),p(x),U(x.iosUrl||""),P(x.googleUrl||""),S(!1),se(!1)}))},[n,e,t,o]),l.jsxs("div",{style:{display:"flex",height:re>1440?"700px":"650px",width:re>1440?"675px":"680px",flexDirection:"column",borderRadius:"rounded",backgroundColor:"#F7F7F8",paddingTop:"0px"},children:[l.jsx(NA,{title:A,typeOfProduct:r,fileSize:s,urls:{iosUrl:C,googleUrl:ne},handleIosChange:E,handleGoogleChange:N,disabled:Ae,api:i,creditDownload:K,user:a,isTest:H,setIsTest:M,urlType:O,setUrlType:j}),J?l.jsx("div",{style:{height:"100%",width:"100%",display:"flex",justifyContent:"center"},children:l.jsx(Qn,{isNetworksLoading:!0})}):(h||K)&&(r==="Flex"?q:!0)&&!J&&C!=="Loading..."&&ne!=="Loading..."&&l.jsx(VA,{playable:h,creditDownload:K,visible:o,versionId:t,typeOfProduct:r,api:i,user:a,handleDownloadError:d,fetchFileUrl:c,urls:{iosUrl:C,googleUrl:ne},game:q,getDownloadCount:I,disabled:Ae,setSafariCopyLink:y,isTest:H,urlType:O})]})},Jl="";var Vn={exports:{}},tt={},Bn={exports:{}},Oe={},Un={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;/*!
|
|
51
51
|
* Adapted from jQuery UI core
|
|
52
52
|
*
|
|
53
53
|
* http://jqueryui.com
|