gearboxdownloadmodal 6.0.17 → 6.0.18
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 +1 -1
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -47,7 +47,7 @@ Valid keys: `+JSON.stringify(Object.keys(Z),null," "));var K=V(R,G,j,S,D+"."+G,
|
|
|
47
47
|
`).forEach(function(a){o=a.indexOf(":"),n=a.substring(0,o).trim().toLowerCase(),r=a.substring(o+1).trim(),!(!n||t[n]&&Xa[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},no=Symbol("internals");function bt(e){return e&&String(e).trim().toLowerCase()}function Tt(e){return e===!1||e==null?e:b.isArray(e)?e.map(Tt):String(e)}function Pa(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 Va=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Sn(e,t,n,r,o){if(b.isFunction(r))return r.call(this,t,n);if(o&&(t=n),!!b.isString(t)){if(b.isString(r))return t.indexOf(r)!==-1;if(b.isRegExp(r))return r.test(t)}}function Ba(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function Ua(e,t){const n=b.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=b.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)=>b.forEach(A,(c,s)=>i(c,s,d));return b.isPlainObject(t)||t instanceof this.constructor?a(t,n):b.isString(t)&&(t=t.trim())&&!Va(t)?a(Qa(t),n):t!=null&&i(n,t,r),this}get(t,n){if(t=bt(t),t){const r=b.findKey(this,t);if(r){const o=this[r];if(!n)return o;if(n===!0)return Pa(o);if(b.isFunction(n))return n.call(this,o,r);if(b.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=b.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Sn(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=b.findKey(r,a);A&&(!n||Sn(r,r[A],A,n))&&(delete r[A],o=!0)}}return b.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||Sn(this,this[i],i,t,!0))&&(delete this[i],o=!0)}return o}normalize(t){const n=this,r={};return b.forEach(this,(o,i)=>{const a=b.findKey(r,i);if(a){n[a]=Tt(o),delete n[i];return}const A=t?Ba(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 b.forEach(this,(r,o)=>{r!=null&&r!==!1&&(n[o]=t&&b.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[no]=this[no]={accessors:{}}).accessors,o=this.prototype;function i(a){const A=bt(a);r[A]||(Ua(o,a),r[A]=!0)}return b.isArray(t)?t.forEach(i):i(t),this}}Ht.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),b.reduceDescriptors(Ht.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),b.freezeMethods(Ht);const Ge=Ht;function Mn(e,t){const n=this||Wn,r=t||n,o=Ge.from(r.headers);let i=r.data;return b.forEach(e,function(A){i=A.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function ro(e){return!!(e&&e.__CANCEL__)}function Ct(e,t,n){ne.call(this,e??"canceled",ne.ERR_CANCELED,t,n),this.name="CanceledError"}b.inherits(Ct,ne,{__CANCEL__:!0});function Fa(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new ne("Request failed with status code "+n.status,[ne.ERR_BAD_REQUEST,ne.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const _a=Ne.isStandardBrowserEnv?function(){return{write:function(n,r,o,i,a,A){const d=[];d.push(n+"="+encodeURIComponent(r)),b.isNumber(o)&&d.push("expires="+new Date(o).toGMTString()),b.isString(i)&&d.push("path="+i),b.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 $a(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function eA(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function oo(e,t){return e&&!$a(t)?eA(e,t):t}const tA=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=b.isString(a)?o(a):a;return A.protocol===r.protocol&&A.host===r.host}}():function(){return function(){return!0}}();function nA(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function rA(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,q=0;for(;m!==o;)q+=n[m++],m=m%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),c-a<t)return;const g=s&&c-s;return g?Math.round(q*1e3/g):void 0}}function io(e,t){let n=0;const r=rA(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 Ln={http:La,xhr:typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){let o=e.data;const i=Ge.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;b.isFormData(o)&&(Ne.isStandardBrowserEnv||Ne.isStandardBrowserWebWorkerEnv?i.setContentType(!1):i.getContentType(/^\s*multipart\/form-data/)?b.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||"",h=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(p+":"+h))}const m=oo(e.baseURL,e.url);s.open(e.method.toUpperCase(),_r(m,e.params,e.paramsSerializer),!0),s.timeout=e.timeout;function q(){if(!s)return;const p=Ge.from("getAllResponseHeaders"in s&&s.getAllResponseHeaders()),y={data:!a||a==="text"||a==="json"?s.responseText:s.response,status:s.status,statusText:s.statusText,headers:p,config:e,request:s};Fa(function(O){n(O),d()},function(O){r(O),d()},y),s=null}if("onloadend"in s?s.onloadend=q:s.onreadystatechange=function(){!s||s.readyState!==4||s.status===0&&!(s.responseURL&&s.responseURL.indexOf("file:")===0)||setTimeout(q)},s.onabort=function(){s&&(r(new ne("Request aborted",ne.ECONNABORTED,e,s)),s=null)},s.onerror=function(){r(new ne("Network Error",ne.ERR_NETWORK,e,s)),s=null},s.ontimeout=function(){let h=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const y=e.transitional||eo;e.timeoutErrorMessage&&(h=e.timeoutErrorMessage),r(new ne(h,y.clarifyTimeoutError?ne.ETIMEDOUT:ne.ECONNABORTED,e,s)),s=null},Ne.isStandardBrowserEnv){const p=(e.withCredentials||tA(m))&&e.xsrfCookieName&&_a.read(e.xsrfCookieName);p&&i.set(e.xsrfHeaderName,p)}o===void 0&&i.setContentType(null),"setRequestHeader"in s&&b.forEach(i.toJSON(),function(h,y){s.setRequestHeader(y,h)}),b.isUndefined(e.withCredentials)||(s.withCredentials=!!e.withCredentials),a&&a!=="json"&&(s.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&s.addEventListener("progress",io(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&s.upload&&s.upload.addEventListener("progress",io(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 g=nA(m);if(g&&Ne.protocols.indexOf(g)===-1){r(new ne("Unsupported protocol "+g+":",ne.ERR_BAD_REQUEST,e));return}s.send(o||null)})}};b.forEach(Ln,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const ao=e=>`- ${e}`,oA=e=>b.isFunction(e)||e===null||e===!1,Ao={getAdapter:e=>{e=b.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,!oA(n)&&(r=Ln[(a=String(n)).toLowerCase()],r===void 0))throw new ne(`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(ao).join(`
|
|
50
|
-
`):" "+ao(i[0]):"as no adapter specified";throw new ne("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return r},adapters:Ln};function En(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ct(null,e)}function so(e){return En(e),e.headers=Ge.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||Wn.adapter)(e).then(function(r){return En(e),r.data=Mn.call(e,e.transformResponse,r),r.headers=Ge.from(r.headers),r},function(r){return ro(r)||(En(e),r&&r.response&&(r.response.data=Mn.call(e,e.transformResponse,r.response),r.response.headers=Ge.from(r.response.headers))),Promise.reject(r)})}const lo=e=>e instanceof Ge?e.toJSON():e;function st(e,t){t=t||{};const n={};function r(c,s,m){return b.isPlainObject(c)&&b.isPlainObject(s)?b.merge.call({caseless:m},c,s):b.isPlainObject(s)?b.merge({},s):b.isArray(s)?s.slice():s}function o(c,s,m){if(b.isUndefined(s)){if(!b.isUndefined(c))return r(void 0,c,m)}else return r(c,s,m)}function i(c,s){if(!b.isUndefined(s))return r(void 0,s)}function a(c,s){if(b.isUndefined(s)){if(!b.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(lo(c),lo(s),!0)};return b.forEach(Object.keys(Object.assign({},e,t)),function(s){const m=d[s]||o,q=m(e[s],t[s],s);b.isUndefined(q)&&m!==A||(n[s]=q)}),n}const uo="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 co={};On.transitional=function(t,n,r){function o(i,a){return"[Axios v"+uo+"] Transitional option '"+i+"'"+a+(r?". "+r:"")}return(i,a,A)=>{if(t===!1)throw new ne(o(a," has been removed"+(n?" in "+n:"")),ne.ERR_DEPRECATED);return n&&!co[a]&&(co[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 iA(e,t,n){if(typeof e!="object")throw new ne("options must be an object",ne.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 ne("option "+i+" must be "+d,ne.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ne("Unknown option "+i,ne.ERR_BAD_OPTION)}}const kn={assertOptions:iA,validators:On},Ve=kn.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&&kn.assertOptions(r,{silentJSONParsing:Ve.transitional(Ve.boolean),forcedJSONParsing:Ve.transitional(Ve.boolean),clarifyTimeoutError:Ve.transitional(Ve.boolean)},!1),o!=null&&(b.isFunction(o)?n.paramsSerializer={serialize:o}:kn.assertOptions(o,{encode:Ve.function,serialize:Ve.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=i&&b.merge(i.common,i[n.method]);i&&b.forEach(["delete","get","head","post","put","patch","common"],p=>{delete i[p]}),n.headers=Ge.concat(a,i);const A=[];let d=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(n)===!1||(d=d&&h.synchronous,A.unshift(h.fulfilled,h.rejected))});const c=[];this.interceptors.response.forEach(function(h){c.push(h.fulfilled,h.rejected)});let s,m=0,q;if(!d){const p=[so.bind(this),void 0];for(p.unshift.apply(p,A),p.push.apply(p,c),q=p.length,s=Promise.resolve(n);m<q;)s=s.then(p[m++],p[m++]);return s}q=A.length;let g=n;for(m=0;m<q;){const p=A[m++],h=A[m++];try{g=p(g)}catch(y){h.call(this,y);break}}try{s=so.call(this,g)}catch(p){return Promise.reject(p)}for(m=0,q=c.length;m<q;)s=s.then(c[m++],c[m++]);return s}getUri(t){t=st(this.defaults,t);const n=oo(t.baseURL,t.url);return _r(n,t.params,t.paramsSerializer)}}b.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}))}}),b.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 zn{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 zn(function(o){t=o}),cancel:t}}}const aA=zn;function AA(e){return function(n){return e.apply(null,n)}}function sA(e){return b.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 lA=Yn;function mo(e){const t=new Qt(e),n=Yr(Qt.prototype.request,t);return b.extend(n,Qt.prototype,t,{allOwnKeys:!0}),b.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return mo(st(e,o))},n}const me=mo(Wn);me.Axios=Qt,me.CanceledError=Ct,me.CancelToken=aA,me.isCancel=ro,me.VERSION=uo,me.toFormData=Gt,me.AxiosError=ne,me.Cancel=me.CanceledError,me.all=function(t){return Promise.all(t)},me.spread=AA,me.isAxiosError=sA,me.mergeConfig=st,me.AxiosHeaders=Ge,me.formToJSON=e=>to(b.isHTMLForm(e)?new FormData(e):e),me.getAdapter=Ao.getAdapter,me.HttpStatusCode=lA,me.default=me;const uA=me;/*! typescript-cookie v1.0.6 | MIT */const po=e=>encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),fo=e=>encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent),jn=decodeURIComponent,Jn=e=>(e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent));function cA(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 ho(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 go=Object.freeze({decodeName:jn,decodeValue:Jn,encodeName:po,encodeValue:fo}),Nn=Object.freeze({path:"/"});function qo(e,t,n=Nn,{encodeValue:r=fo,encodeName:o=po}={}){return document.cookie=`${o(e)}=${r(t,e)}${cA(n)}`}function yo(e,{decodeValue:t=Jn,decodeName:n=jn}={}){return ho(e,t,n)}function dA({decodeValue:e=Jn,decodeName:t=jn}={}){return ho(void 0,e,t)}function mA(e,t=Nn){qo(e,"",Object.assign({},t,{expires:-1}))}function Dn(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 dA(this.converter.read);if(o!=null)return yo(o,this.converter.read)},remove:function(o,i){mA(o,Object.assign({},this.attributes,i))},withAttributes:function(o){return Dn(this.converter,Object.assign({},this.attributes,o))},withConverter:function(o){return Dn(Object.assign({},this.converter,o),this.attributes)}},r={attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}};return Object.create(n,r)}Dn({read:go.decodeValue,write:go.encodeValue},Nn);let vo;typeof window<"u"&&(vo=yo("token"));const fe=uA.create({headers:{Authorization:vo}});async function pA(e,t,n){return(await fe.post(n+"/createFlexVersionLinkMulti",{_id:e,networks:t})).data}async function fA(e,t){return e.network=="fb"&&(e.zip=1),(await fe.post(t+"/createFlexVersionLink",e||{})).data}async function hA(e,t,n){return(await fe.post(e+"/createImportedVersionLink",{_id:t,network:n})).data}async function gA(e,t,n,r,o){return(await fe.post(e+"/createPlayableVersionLink",{_id:t,network:n,isPfTest:r,extras:o})).data}async function qA(e,t,n){return(await fe.post(n+"/createPlayableVersionLinkMulti",{_id:e,networks:t})).data}async function yA(e,t,n,r,o){return(await fe.post(e+"/createReadyVersionLink",{_id:t,network:n,isPfTest:r,extras:o})).data}async function vA(e,t,n){return(await fe.post(n+"/createReadyVersionLinkMulti",{_id:e,networks:t})).data}async function bo(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 Co(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=Co(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function Be(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=Co(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,Rn=e=>C.isValidElement(e)||_e(e)||be(e)||Zt(e);function bA(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:q}=a;const g=r?`${t}--${d}`:t,p=r?`${n}--${d}`:n,h=C.useRef(0);return C.useLayoutEffect(()=>{const y=m.current,x=g.split(" "),O=J=>{J.target===m.current&&(y.dispatchEvent(new Event("d")),y.removeEventListener("animationend",O),y.removeEventListener("animationcancel",O),h.current===0&&J.type!=="animationcancel"&&y.classList.remove(...x))};y.classList.add(...x),y.addEventListener("animationend",O),y.addEventListener("animationcancel",O)},[]),C.useEffect(()=>{const y=m.current,x=()=>{y.removeEventListener("animationend",x),o?bA(y,s,i):s()};q||(c?x():(h.current=1,y.className+=` ${p}`,y.addEventListener("animationend",x)))},[q]),C.createElement(C.Fragment,null,A)}}function Zo(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 Se={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 C.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${n})`,...r})},Gn={info:function(e){return C.createElement(Ft,{...e},C.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 C.createElement(Ft,{...e},C.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 C.createElement(Ft,{...e},C.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 C.createElement(Ft,{...e},C.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 C.createElement("div",{className:"Toastify__spinner"})}};function CA(e){const[,t]=C.useReducer(g=>g+1,0),[n,r]=C.useState([]),o=C.useRef(null),i=C.useRef(new Map).current,a=g=>n.indexOf(g)!==-1,A=C.useRef({toastKey:1,displayedToast:0,count:0,queue:[],props:e,containerId:null,isToastActive:a,getToast:g=>i.get(g)}).current;function d(g){let{containerId:p}=g;const{limit:h}=A.props;!h||p&&A.containerId!==p||(A.count-=A.queue.length,A.queue=[])}function c(g){r(p=>g==null?[]:p.filter(h=>h!==g))}function s(){const{toastContent:g,toastProps:p,staleId:h}=A.queue.shift();q(g,p,h)}function m(g,p){let{delay:h,staleId:y,...x}=p;if(!Rn(g)||function(Q){return!o.current||A.props.enableMultiContainer&&Q.containerId!==A.props.containerId||i.has(Q.toastId)&&Q.updateId==null}(x))return;const{toastId:O,updateId:J,data:z}=x,{props:v}=A,_=()=>c(O),$=J==null;$&&A.count++;const F={...v,style:v.toastStyle,key:A.toastKey++,...Object.fromEntries(Object.entries(x).filter(Q=>{let[B,W]=Q;return W!=null})),toastId:O,updateId:J,data:z,closeToast:_,isIn:!1,className:Bt(x.className||v.toastClassName),bodyClassName:Bt(x.bodyClassName||v.bodyClassName),progressClassName:Bt(x.progressClassName||v.progressClassName),autoClose:!x.isLoading&&(le=x.autoClose,ee=v.autoClose,le===!1||Zt(le)&&le>0?le:ee),deleteToast(){const Q=Zo(i.get(O),"removed");i.delete(O),Se.emit(4,Q);const B=A.queue.length;if(A.count=O==null?A.count-A.displayedToast:A.count-1,A.count<0&&(A.count=0),B>0){const W=O==null?A.props.limit:1;if(B===1||W===1)A.displayedToast++,s();else{const Y=W>B?B:W;A.displayedToast=Y;for(let N=0;N<Y;N++)s()}}else t()}};var le,ee;F.iconOut=function(Q){let{theme:B,type:W,isLoading:Y,icon:N}=Q,f=null;const L={theme:B,type:W};return N===!1||(be(N)?f=N(L):C.isValidElement(N)?f=C.cloneElement(N,L):_e(N)||Zt(N)?f=N:Y?f=Gn.spinner():(T=>T in Gn)(W)&&(f=Gn[W](L))),f}(F),be(x.onOpen)&&(F.onOpen=x.onOpen),be(x.onClose)&&(F.onClose=x.onClose),F.closeButton=v.closeButton,x.closeButton===!1||Rn(x.closeButton)?F.closeButton=x.closeButton:x.closeButton===!0&&(F.closeButton=!Rn(v.closeButton)||v.closeButton);let Ae=g;C.isValidElement(g)&&!_e(g.type)?Ae=C.cloneElement(g,{closeToast:_,toastProps:F,data:z}):be(g)&&(Ae=g({closeToast:_,toastProps:F,data:z})),v.limit&&v.limit>0&&A.count>v.limit&&$?A.queue.push({toastContent:Ae,toastProps:F,staleId:y}):Zt(h)?setTimeout(()=>{q(Ae,F,y)},h):q(Ae,F,y)}function q(g,p,h){const{toastId:y}=p;h&&i.delete(h);const x={content:g,props:p};i.set(y,x),r(O=>[...O,y].filter(J=>J!==h)),Se.emit(4,Zo(x,x.props.updateId==null?"added":"updated"))}return C.useEffect(()=>(A.containerId=e.containerId,Se.cancelEmit(3).on(0,m).on(1,g=>o.current&&c(g)).on(5,d).emit(2,A),()=>{i.clear(),Se.emit(3,A)}),[]),C.useEffect(()=>{A.props=e,A.isToastActive=a,A.displayedToast=n.length}),{getToastToRender:function(g){const p=new Map,h=Array.from(i.values());return e.newestOnTop&&h.reverse(),h.forEach(y=>{const{position:x}=y.props;p.has(x)||p.set(x,[]),p.get(x).push(y)}),Array.from(p,y=>g(y[0],y[1]))},containerRef:o,isToastActive:a}}function Io(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientX:e.clientX}function wo(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientY:e.clientY}function ZA(e){const[t,n]=C.useState(!1),[r,o]=C.useState(!1),i=C.useRef(null),a=C.useRef({start:0,x:0,y:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,boundingRect:null,didMove:!1}).current,A=C.useRef(e),{autoClose:d,pauseOnHover:c,closeToast:s,onClick:m,closeOnClick:q}=e;function g(z){if(e.draggable){z.nativeEvent.type==="touchstart"&&z.nativeEvent.preventDefault(),a.didMove=!1,document.addEventListener("mousemove",x),document.addEventListener("mouseup",O),document.addEventListener("touchmove",x),document.addEventListener("touchend",O);const v=i.current;a.canCloseOnClick=!0,a.canDrag=!0,a.boundingRect=v.getBoundingClientRect(),v.style.transition="",a.x=Io(z.nativeEvent),a.y=wo(z.nativeEvent),e.draggableDirection==="x"?(a.start=a.x,a.removalDistance=v.offsetWidth*(e.draggablePercent/100)):(a.start=a.y,a.removalDistance=v.offsetHeight*(e.draggablePercent===80?1.5*e.draggablePercent:e.draggablePercent/100))}}function p(z){if(a.boundingRect){const{top:v,bottom:_,left:$,right:F}=a.boundingRect;z.nativeEvent.type!=="touchend"&&e.pauseOnHover&&a.x>=$&&a.x<=F&&a.y>=v&&a.y<=_?y():h()}}function h(){n(!0)}function y(){n(!1)}function x(z){const v=i.current;a.canDrag&&v&&(a.didMove=!0,t&&y(),a.x=Io(z),a.y=wo(z),a.delta=e.draggableDirection==="x"?a.x-a.start:a.y-a.start,a.start!==a.x&&(a.canCloseOnClick=!1),v.style.transform=`translate${e.draggableDirection}(${a.delta}px)`,v.style.opacity=""+(1-Math.abs(a.delta/a.removalDistance)))}function O(){document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",O),document.removeEventListener("touchmove",x),document.removeEventListener("touchend",O);const z=i.current;if(a.canDrag&&a.didMove&&z){if(a.canDrag=!1,Math.abs(a.delta)>a.removalDistance)return o(!0),void e.closeToast();z.style.transition="transform 0.2s, opacity 0.2s",z.style.transform=`translate${e.draggableDirection}(0)`,z.style.opacity="1"}}C.useEffect(()=>{A.current=e}),C.useEffect(()=>(i.current&&i.current.addEventListener("d",h,{once:!0}),be(e.onOpen)&&e.onOpen(C.isValidElement(e.children)&&e.children.props),()=>{const z=A.current;be(z.onClose)&&z.onClose(C.isValidElement(z.children)&&z.children.props)}),[]),C.useEffect(()=>(e.pauseOnFocusLoss&&(document.hasFocus()||y(),window.addEventListener("focus",h),window.addEventListener("blur",y)),()=>{e.pauseOnFocusLoss&&(window.removeEventListener("focus",h),window.removeEventListener("blur",y))}),[e.pauseOnFocusLoss]);const J={onMouseDown:g,onTouchStart:g,onMouseUp:p,onTouchEnd:p};return d&&c&&(J.onMouseEnter=y,J.onMouseLeave=h),q&&(J.onClick=z=>{m&&m(z),a.canCloseOnClick&&s()}),{playToast:h,pauseToast:y,isRunning:t,preventExitTransition:r,toastRef:i,eventHandlers:J}}function xo(e){let{closeToast:t,theme:n,ariaLabel:r="close"}=e;return C.createElement("button",{className:`Toastify__close-button Toastify__close-button--${n}`,type:"button",onClick:o=>{o.stopPropagation(),t(o)},"aria-label":r},C.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},C.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 IA(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:q}=e;const g=i||d&&c===0,p={...A,animationDuration:`${t}ms`,animationPlayState:n?"running":"paused",opacity:g?0:1};d&&(p.transform=`scaleX(${c})`);const h=Be("Toastify__progress-bar",d?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${q}`,`Toastify__progress-bar--${o}`,{"Toastify__progress-bar--rtl":s}),y=be(a)?a({rtl:s,type:o,defaultClassName:h}):Be(h,a);return C.createElement("div",{role:"progressbar","aria-hidden":g?"true":"false","aria-label":"notification timer",className:y,style:p,[d&&c>=1?"onTransitionEnd":"onAnimationEnd"]:d&&c<1?null:()=>{m&&r()}})}const wA=e=>{const{isRunning:t,preventExitTransition:n,toastRef:r,eventHandlers:o}=ZA(e),{closeButton:i,children:a,autoClose:A,onClick:d,type:c,hideProgressBar:s,closeToast:m,transition:q,position:g,className:p,style:h,bodyClassName:y,bodyStyle:x,progressClassName:O,progressStyle:J,updateId:z,role:v,progress:_,rtl:$,toastId:F,deleteToast:le,isIn:ee,isLoading:Ae,iconOut:Q,closeOnClick:B,theme:W}=e,Y=Be("Toastify__toast",`Toastify__toast-theme--${W}`,`Toastify__toast--${c}`,{"Toastify__toast--rtl":$},{"Toastify__toast--close-on-click":B}),N=be(p)?p({rtl:$,position:g,type:c,defaultClassName:Y}):Be(Y,p),f=!!_||!A,L={closeToast:m,type:c,theme:W};let T=null;return i===!1||(T=be(i)?i(L):C.isValidElement(i)?C.cloneElement(i,L):xo(L)),C.createElement(q,{isIn:ee,done:le,position:g,preventExitTransition:n,nodeRef:r},C.createElement("div",{id:F,onClick:d,className:N,...o,style:h,ref:r},C.createElement("div",{...ee&&{role:v},className:be(y)?y({type:c}):Be("Toastify__toast-body",y),style:x},Q!=null&&C.createElement("div",{className:Be("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!Ae})},Q),C.createElement("div",null,a)),T,C.createElement(IA,{...z&&!f?{key:`pb-${z}`}:{},rtl:$,theme:W,delay:A,isRunning:t,isIn:ee,closeToast:m,hide:s,type:c,style:J,className:O,controlledProgress:f,progress:_||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}},xA=Ut(_t("bounce",!0));Ut(_t("slide",!0)),Ut(_t("zoom")),Ut(_t("flip"));const Tn=C.forwardRef((e,t)=>{const{getToastToRender:n,containerRef:r,isToastActive:o}=CA(e),{className:i,style:a,rtl:A,containerId:d}=e;function c(s){const m=Be("Toastify__toast-container",`Toastify__toast-container--${s}`,{"Toastify__toast-container--rtl":A});return be(i)?i({position:s,rtl:A,defaultClassName:m}):Be(m,Bt(i))}return C.useEffect(()=>{t&&(t.current=r.current)},[]),C.createElement("div",{ref:r,className:"Toastify",id:d},n((s,m)=>{const q=m.length?{...a}:{...a,pointerEvents:"none"};return C.createElement("div",{className:c(s),style:q,key:`container-${s}`},m.map((g,p)=>{let{content:h,props:y}=g;return C.createElement(wA,{...y,isIn:o(y.toastId),style:{...y.style,"--nth":p+1,"--len":m.length},key:`toast-${y.key}`},h)}))}))});Tn.displayName="ToastContainer",Tn.defaultProps={position:"top-right",transition:xA,autoClose:5e3,closeButton:xo,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,draggable:!0,draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};let Hn,$e=new Map,It=[],KA=1;function Ko(){return""+KA++}function WA(e){return e&&(_e(e.toastId)||Zt(e.toastId))?e.toastId:Ko()}function wt(e,t){return $e.size>0?Se.emit(0,e,t):It.push({content:e,options:t}),t.toastId}function $t(e,t){return{...t,type:t&&t.type||e,toastId:WA(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,q)=>{if(m==null)return void ce.dismiss(r);const g={type:s,...A,...n,data:q},p=_e(m)?{render:m}:m;return r?ce.update(r,{...g,...p}):ce(p.render,{...g,...p}),q},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?Se.emit(1,e):It=It.filter(t=>e!=null&&t.options.toastId!==e)},ce.clearWaitingQueue=function(e){return e===void 0&&(e={}),Se.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||Hn);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:Ko()};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=>(Se.on(4,e),()=>{Se.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"},Se.on(2,e=>{Hn=e.containerId||e,$e.set(Hn,e),It.forEach(t=>{Se.emit(0,t.content,t.options)}),It=[]}).on(3,e=>{$e.delete(e.containerId||e),$e.size===0&&Se.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 Xn="",et="Playable",Ce=null,Wo=null;const tn=async e=>{let t=Xn+"/"+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)})},SA=(e,t)=>{let n=Xn+"/"+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"&&SA(c,Wo)};et==="Playable"?(n&&n.iosUrl!=="Loading..."&&n.googleUrl!=="Loading..."&&await Pt(e,{iosLink:n==null?void 0:n.iosUrl,androidLink:n==null?void 0:n.googleUrl},Ce),gA(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&&n.iosUrl!=="Loading..."&&n.googleUrl!=="Loading..."&&await bo({_id:e,iosLink:n==null?void 0:n.iosUrl,androidLink:n==null?void 0:n.googleUrl},Ce),fA({_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"?hA(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&&n.iosUrl!=="Loading..."&&n.googleUrl!=="Loading..."&&((i==null?void 0:i.urlType)==="single"&&(n.googleUrl=n.iosUrl),await Pt(e,{iosLink:n==null?void 0:n.iosUrl,androidLink:n==null?void 0:n.googleUrl},Ce)),yA(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 MA(e,t,n,r=null){return new Promise(async(o,i)=>{et==="Flex"?(await bo({_id:e,iosLink:t==null?void 0:t.iosUrl,androidLink:t==null?void 0:t.googleUrl},Ce),pA(e,n,Ce).then(async a=>{if(a.message){i(a);return}await tn(a.url),o(a.url)}).catch(a=>{let A=a.response.data.error.msg;i({message:A})})):et==="Ready"?(t&&t.iosUrl!=="Loading..."&&t.googleUrl!=="Loading..."&&((r==null?void 0:r.urlType)==="single"&&(t.googleUrl=t.iosUrl),await Pt(e,{iosLink:t==null?void 0:t.iosUrl,androidLink:t==null?void 0:t.googleUrl},Ce)),vA(e,n,Ce).then(async a=>{if(a.message){i(a);return}await tn(a.url),o(a.url)}).catch(a=>{console.log("err",a);let A=a.response.data.error.msg;i({message:A})})):(t&&t.iosUrl!=="Loading..."&&t.googleUrl!=="Loading..."&&await Pt(e,{iosLink:t==null?void 0:t.iosUrl,androidLink:t==null?void 0:t.googleUrl},Ce),qA(e,n,Ce).then(async a=>{await tn(a.url),o(a.url)}).catch(a=>{let A=a.response.data.error.msg;i({message:A})}))})}function LA(e,t,n,r){et=e,Ce=t,Wo=n,Xn=r}async function Qn(e,t){return(await fe.post(t+"/findPlayable",{_id:e})).data}const EA=({versionId:e,playableId:t,typeOfProduct:n,api:r,copyLinkUrl:o,setSafariCopyLink:i,qrUrl:a,iosLink:A,androidLink:d,urlType:c})=>{const[s,m]=C.useState(!1),q=async()=>{m(!0),nn(e,"default",{iosUrl:A,googleUrl:d},null,!1,{urlType:c}).then(async g=>{var x,O,J,z;let p="";if(t&&(n==="Playable"||n==="Ready")){const v=await Qn(t,r);console.log(v);const _=(O=(x=v==null?void 0:v.data)==null?void 0:x.globalProps)==null?void 0:O.defaultLandscape,$=(z=(J=v==null?void 0:v.data)==null?void 0:J.globalProps)==null?void 0:z.defaultPhoneIndex;console.log(_,$),_&&(p+="&landscape=true"),$!==void 0&&(p+=`&phoneIndex=${$}`)}Qn(t,r),m(!1);let h;n==="Flex"?h=`${o}/preview?versionId=${e}`:n==="Import"?h=`${o}/preview?versionId=${e}_`:n==="Ready"?h=`${o}/preview?versionId=${e}_&ready=true`:h=`${o}/preview?versionId=${e}_`,h+=p,Vt(h)?xt("Link copied"):i(h),m(!1)}).catch(g=>{m(!1)})};return 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:a?l.jsx(Fi,{bgColor:"#0F0F1E",fgColor:"#ffffff",style:{height:"auto",maxWidth:"100%",width:"100%"},value:a}):l.jsx("img",{style:{width:"50px",height:"50px"},src:Pe,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:()=>{s||q()},children:[l.jsx(zr,{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:s?l.jsx("img",{style:{height:"90%"},src:Pe,alt:"loading"}):l.jsx("button",{style:{fontSize:"1rem",color:"white",background:"rgba(0, 163, 255, 0)"},children:"Copy Link"})})]})]})]})},OA=({versionName:e,versionId:t,playableId:n,typeOfProduct:r,api:o,iframeUrl:i,fetchFileUrl:a,copyLinkUrl:A,setSafariCopyLink:d,iosLink:c,androidLink:s,urlType:m})=>{const[q,g]=C.useState(window.innerWidth);console.log("iosLink",c),C.useEffect(()=>{console.log("re add event listener");function h(y){console.log(y),y.data==="cta"&&(console.log("Received 'cta' message from iframe"),c&&window.open(c,"_blank"))}return window.addEventListener("message",h,!1),()=>{window.removeEventListener("message",h)}},[c,s]),C.useEffect(()=>{const h=()=>{g(window.innerWidth)};return window.addEventListener("resize",h),()=>{window.removeEventListener("resize",h)}},[]);const p=(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:q>1440?"680px":"620px",borderRadius:"0px 0px 0px 16px",marginTop:"20px"},children:[l.jsx(fi,{iframeUrl:i}),l.jsx(hi,{name:p}),l.jsx(EA,{versionId:t,playableId:n,typeOfProduct:r,api:o,copyLinkUrl:A,setSafariCopyLink:d,qrUrl:i,iosLink:c,androidLink:s,urlType:m})]})};var he=(e=>(e.Flex="#7101FF",e.Playable="#F9830B",e.Import="#00a3ff",e.Ready="#0060A5",e))(he||{});const So=({checked:e,typeOfProduct:t,id:n})=>{const[r,o]=C.useState(e);C.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"})})," "]})]})})},kA=({typeOfProduct:e,allNetworksSelected:t,setAllNetworksSelected:n})=>l.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",marginBottom:"0.5rem"},children:[l.jsxs("div",{style:{fontSize:"2xl",fontWeight:"bold",display:"flex"},children:[l.jsx("span",{style:{color:he[e]},children:"Select Network"}),l.jsx("span",{style:{whiteSpace:"pre"},children:" From List"})]}),l.jsxs("div",{onClick:()=>{n(!t)},style:{marginLeft:"auto",marginRight:"2rem",display:"flex",height:"24px",alignItems:"center",justifyContent:"flex-end",fontSize:"0.875rem",width:110},children:[l.jsx(So,{checked:t,typeOfProduct:e,id:"asd"}),l.jsx("span",{style:{marginLeft:"0.5rem",fontSize:"16px",fontWeight:"bold"},children:"Select All"})]})]});async function zA(e,t){return(await fe.post(t+"/buyRequest",{requestType:e})).data}const YA=()=>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)"})})})]}),jA=({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:()=>zA("Flex Credit",t).then(n=>xt("You will be contacted regarding your request.")),children:["Get more",l.jsx(YA,{})]})]})]}),Mo=({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",flexShrink:0},children:"App Store:"}),l.jsx("input",{style:{marginLeft:"1.25rem",display:"flex",height:"100%",width:"100%",alignItems:"center",borderRadius:"0.375rem",border:t.iosUrl?"1px solid lightgray":"1px solid red",paddingLeft:"0.5rem",color:"#000000",borderColor:he[e],marginRight:"2rem"},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",flexShrink:0},children:["Google Play:"," "]}),l.jsx("input",{style:{marginLeft:"1.25rem",display:"flex",height:"100%",width:"100%",alignItems:"center",borderRadius:"0.375rem",border:t.googleUrl?"1px solid lightgray":"1px solid red",paddingLeft:"0.5rem",color:"#000000",borderColor:he[e],marginRight:"2rem"},type:"text",value:t.googleUrl,onChange:a,placeholder:"Google Url",disabled:o})]})]})},JA=({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",flexShrink:0},children:"Redirection URL:"}),l.jsx("input",{style:{marginLeft:"1.25rem",display:"flex",height:"100%",width:"100%",alignItems:"center",borderRadius:"0.375rem",border:t.iosUrl?"1px solid lightgray":"1px solid red",paddingLeft:"0.5rem",color:"#000000",borderColor:he[e],marginRight:"2rem"},type:"text",value:t.iosUrl,onChange:i,placeholder:"Ios Url",disabled:o})]})})},NA=({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:q})=>{const g=()=>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(()=>{q("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(()=>{q("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(g,{}),e==="Ready"?l.jsxs(l.Fragment,{children:[l.jsx(p,{}),m==="game"&&l.jsx(Mo,{typeOfProduct:e,urls:n,handleIosChange:r,handleGoogleChange:o,disabled:i}),m==="single"&&l.jsx(JA,{typeOfProduct:e,urls:n,handleIosChange:r,handleGoogleChange:o,disabled:i})]}):l.jsx(l.Fragment,{children:l.jsx(Mo,{typeOfProduct:e,urls:n,handleIosChange:r,handleGoogleChange:o,disabled:i})}),(A==null?void 0:A.willSpendCredit)&&l.jsx(jA,{creditDownload:A,api:a})]})})},DA=({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"]})]}),RA=({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:q,setUrlType:g,allNetworksSelected:p,setAllNetworksSelected: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(DA,{typeOfProduct:e,title:r,fileSize:t}),l.jsx(NA,{typeOfProduct:e,fileSize:t,urls:n,handleIosChange:o,handleGoogleChange:i,disabled:a,creditDownload:A,api:d,user:c,isTest:s,setIsTest:m,urlType:q,setUrlType:g}),l.jsx(kA,{typeOfProduct:e,allNetworksSelected:p,setAllNetworksSelected:h})]}),Pn=({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}),jl="",GA=({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]}})]})}),Vn=({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:Pe,alt:"pf-logo-gif"})}),Lo=({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"})]}),TA=({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"})]})]})]})},Eo=({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"})]})]})]}),HA=({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:Pe,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:Pe,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:Pe,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 XA(e,t,n,r){return(await fe.post(e+"/createMolocoTestPage",{_id:t,network:n,typeOfProduct:r})).data}const QA=({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:q,urls:g,game:p,setIsConfirmActive:h,creditDownload:y,getDownloadCount:x,disabled:O,user:J,setSafariCopyLink:z,isTest:v,urlType:_})=>{const[$,F]=C.useState(!1),[le,ee]=C.useState(""),[Ae,Q]=C.useState(!1),[B,W]=C.useState(!1),[Y,N]=C.useState(!1),[f,L]=C.useState("download"),[T,Z]=C.useState(!1),[I,M]=C.useState(!1),[k,j]=C.useState(!1);let S={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",mraid:"copy,html"};const D=()=>{n(e)},R=async(V,K)=>(F(!0),new Promise((se,De)=>{nn(c,V,g,K,v,{urlType:_}).then(we=>{F(!1),se(we)}).catch(we=>{F(!1),m(we.message,we),De(we)})})),P=async(V=!1)=>{V?M(!0):Z(!0);const K={molocoGenerateHtml:!1};V&&(K.molocoGenerateHtml=!0),nn(c,o,g,"download",v,K).then(se=>{V?M(!1):Z(!1),N(!1)}).catch(se=>{m(se.message,se)})},U=async()=>{j(!0);const V=await XA(s,c,o,d);let K=`${q}/${V==null?void 0:V.url}`;Vt(K)?(xt("Link Copied"),j(!1)):z(K)},G=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:D,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(V=>V.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(GA,{typeOfProduct:d})}):i.map(V=>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:V.network===o?V.size.toString().slice(0,5)+"Mb":""},V.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(So,{checked:r,typeOfProduct:d,id:e})}),l.jsx("img",{onClick:D,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(Pn,{className:`${G?"w-1/2":"w-2/3"} border-hover-`+d,downloading:$,onClickDonwload:async V=>{if(V.stopPropagation(),G&&J.customer==="playableFactoryInternal"){N(!0);return}else{ee("download");const K=g.iosUrl,se=g.googleUrl;y&&y.willSpendCredit?(h(!0),L("download"),Q(!0)):["Playable","Flex"].includes(d)&&(!K||!se)||d==="Ready"&&_==="single"&&!K||d==="Ready"&&_==="multi"&&(!K||!se)?(h(!0),W(!0)):(W(!1),Q(!1),await R(o,"download"))}},children:[!$&&l.jsxs(l.Fragment,{children:[l.jsx(Lo,{style:{marginRight:"0.5rem",height:"1.5rem",width:"1rem",stroke:"dark-full"}}),G&&J.customer!=="playableFactoryInternal"?"TXT":"Download"]}),$&&l.jsx(Vn,{})]}),S[o]&&S[o].includes("copy")&&l.jsx(Pn,{className:"w-1/3 border-hover-"+d,onClickDonwload:async V=>{V.stopPropagation(),ee("copyLink");const K=g.iosUrl,se=g.googleUrl;y&&(y!=null&&y.willSpendCredit)?(L("copy"),h(!0),Q(!0)):d!=="Import"&&(!K||!se)?(h(!0),W(!0)):(Q(!1),W(!1),await R(o,"copy"))},disabled:O,children:l.jsx(zr,{className:"h-6 w-6 stroke-dark-full"})}),G&&J.customer!=="playableFactoryInternal"&&l.jsx(Pn,{className:"w-1/2 border-hover-"+d,onClickDonwload:async V=>{V.stopPropagation(),ee("download");const K=g.iosUrl,se=g.googleUrl;y&&(y!=null&&y.willSpendCredit)?(L("download"),h(!0),Q(!0)):d!=="Import"&&(!K||!se)?(h(!0),W(!0)):(Q(!1),W(!1),await P(!0))},disabled:O,children:l.jsxs(l.Fragment,{children:[l.jsx(Lo,{style:{marginRight:"0.5rem",height:"1.5rem",width:"1rem",stroke:"dark-full"}}),"HTML"]})})]})]}),Ae&&l.jsx(Eo,{creditConfirmType:f,handleCopyLink:async()=>{W(!1),h(!1),await R(o,"copy")},download:async()=>{W(!1),h(!1),await R(o,"download")},onClose:()=>{Q(!1),h(!1)},getDownloadCount:x}),B&&l.jsx(TA,{onClose:()=>{W(!1),h(!1)},iosLink:g.iosUrl,googleLink:g.googleUrl,buttonType:le,handleCopyLink:async()=>{W(!1),h(!1),await R(o,"copy")},download:async()=>{W(!1),h(!1),await R(o,"download")},typeOfProduct:d,urlType:_}),Y&&J.customer==="playableFactoryInternal"&&l.jsx(HA,{onClose:()=>{N(!1)},handleDownload:P,handleDownloadMolocoTest:U,downloadingMoloco:T,donwloadintMolocoTest:k,downloadingMolocoHtml:I})]})},rn=[{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"},{id:"50",name:"mraid",imageSrc:"https://gearbox.playablefactory.com/mraid.png"},{id:"51",name:"zynga",imageSrc:"https://gearbox.playablefactory.com/zynga.png"}],PA=({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})},VA=({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(Vn,{})}):l.jsx(PA,{typeOfProduct:t,onClick:n,children:l.jsx("span",{style:{fontSize:"1.25rem",padding:"0.5rem",color:"#fff"},children:"Download All"})})}),BA=({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:q,setSafariCopyLink:g,isTest:p,urlType:h,allNetworksSelected:y,setAllNetworksSelected:x})=>{const[O,J]=C.useState([]),[z,v]=C.useState([]),[_,$]=C.useState(!1),[F,le]=C.useState(""),[ee,Ae]=C.useState(!1),[Q,B]=C.useState(!1),[W,Y]=C.useState("download"),[N,f]=C.useState(!1),L=async I=>{const M=[...O];if(O.includes(I)){const k=M.findIndex(j=>j===I);M.splice(k,1),J(M)}else M.push(I),J([...O,I]);rn.filter(k=>[...M].includes(k.id)).map(k=>k.name)},T=async()=>new Promise(async(I,M)=>{const k=rn.filter(j=>[...O].includes(j.id)).map(j=>j.name);Ae(!0),MA(r,c,k,{urlType:h}).then(j=>{Ae(!1),I(j)}).catch(j=>{console.log("get multi download err"),Ae(!1),A(j.message,j),M(j)})}),Z=async()=>{c.iosUrl,c.googleUrl,t&&t.willSpendCredit?(B(!0),Y("download"),f(!0)):(f(!1),await T())};return C.useEffect(()=>{const I=rn.filter(M=>{var k;return t&&((k=t==null?void 0:t.networks)==null?void 0:k.length)>0?t==null?void 0:t.networks.includes(M.name):o==="Import"?e==null?void 0:e.networks.filter(j=>j.status==="paid").some(j=>j.name===M.name):e==null?void 0:e.networks.includes(M.name)}).filter(M=>M.name==="voodoo"?a.customer==="customer:20":!0).map(M=>M.id);J(y?I:[])},[y]),l.jsxs(l.Fragment,{children:[l.jsx("div",{style:{position:"relative",flex:1,overflowY:Q?"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&&rn.filter(I=>{var M;return t&&((M=t==null?void 0:t.networks)==null?void 0:M.length)>0?t==null?void 0:t.networks.includes(I.name):o==="Import"?e==null?void 0:e.networks.filter(k=>k.status==="paid").some(k=>k.name===I.name):e==null?void 0:e.networks.includes(I.name)}).filter(I=>I.name==="voodoo"?a.customer==="customer:20":!0).map(I=>{let M=I.imageSrc;if(I.name==="web"){let k="web_"+o.toLowerCase()+".png";M=M.replace("web.png",k)}return l.jsx(QA,{id:I.id,name:I.name,imageUrl:M,selected:O.includes(I.id),handleCardClick:L,networkVersionSize:z,fileSizeLoading:_,showCheckBox:!0,typeOfProduct:o,versionId:r,api:i,handleDownloadError:A,fetchFileUrl:d,urls:c,game:s,creditDownload:t,setIsConfirmActive:B,getDownloadCount:m,disabled:q,user:a,setSafariCopyLink:g,isTest:p,urlType:h},I.id)})})}),O.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(VA,{onClickMultiDownload:Z,networksVersionTotalSize:F,typeOfProduct:o,multiDownloading:ee})}),N&&l.jsx(Eo,{creditConfirmType:W,handleCopyLink:async()=>{},download:async()=>{f(!1),B(!1),await T()},onClose:()=>{f(!1),B(!1)},getDownloadCount:m})]})};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"],Oo=["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:q,iosLink:g,androidLink:p,setIosLink:h,setAndroidLink:y,urlType:x,setUrlType:O})=>{const[J,z]=C.useState(null),[v,_]=C.useState(null),[$,F]=C.useState(null),[le,ee]=C.useState(!1),[Ae,Q]=C.useState(!0),[B,W]=C.useState(window.innerWidth),[Y,N]=C.useState(!1),[f,L]=C.useState(!1);C.useEffect(()=>{},[f]),C.useEffect(()=>{const S=()=>{W(window.innerWidth)};return window.addEventListener("resize",S),()=>{window.removeEventListener("resize",S)}},[]);const T=async()=>{ee(!0);const S=await Qn(e,i);return S!=null&&S.networks||(S.networks=ns),z(S),S},Z=S=>{h(S)},I=S=>{y(S)},M=async(S,D)=>{var R,P;console.log("getIosAndAndroidLink");try{let U;if(r==="Playable"||r==="Ready"){const G=await _A(t,i);if(G){console.log("version",G),h(G.iosLink),y(G.androidLink),ee(!1);return}if(S&&(S.iosUrl||S.googleUrl)){h(S.iosUrl),y(S.googleUrl),ee(!1);return}if(D&&D.html){let V=await fetch(c+"/"+D.html).then(De=>De.text());const K=((R=V.match(/var\s+iosLink\s*=\s*['|"](https?[\w\d;,/?:@&=+$\-_.!~*'()#]+)['|"]/))==null?void 0:R.at(1))||"";h(K);const se=((P=V.match(/var\s+androidLink\s*=\s*['|"](https?[\w\d;,/?:@&=+$\-_.!~*'()#]+)['|"]/))==null?void 0:P.at(1))||"";y(se),ee(!1)}else y(""),h(""),ee(!1)}else if(r==="Flex"){const G=await $A(t,i);if(G.googleUrl||G.iosUrl){y(G.googleUrl),h(G.iosUrl),ee(!1);return}S&&(S.iosUrl||S.googleUrl)?(h(S.iosUrl),y(S.googleUrl),ee(!1)):(y(""),h(""),ee(!1))}}catch(U){d(U.response.data.error.msg)}},k=async()=>{ee(!0);let S;r==="Flex"?S=await UA({_id:t},i):r==="Ready"&&(S=await ts({_id:t},i)),S&&(["admin","pm","tester"].includes(a.role)?F({...S,networks:Oo}):r==="Ready"&&!S.canDownload?F({...S,networks:Oo}):F(S)),ee(!1)},j=async()=>await FA(n,i);return C.useEffect(()=>{o||(z(null),_(null),F(null),m(null)),o&&(r==="Playable"?(T().then(S=>{M(null,S)}),Q(!1)):r==="Ready"?k().then(S=>{T().then(D=>{M(null,D),Q(!1)})}):r==="Flex"?k().then(S=>{Q(!1),j().then(D=>{o&&(M(D,null),Q(!1),_(D))})}):r==="Import"&&es(t,i).then(S=>{console.log(S),z(S),h(S.iosUrl||""),y(S.googleUrl||""),ee(!1),Q(!1)}))},[n,e,t,o]),l.jsxs("div",{style:{display:"flex",height:B>1440?"700px":"650px",width:B>1440?"675px":"680px",flexDirection:"column",borderRadius:"rounded",backgroundColor:"#F7F7F8",paddingTop:"0px"},children:[l.jsx(RA,{title:A,typeOfProduct:r,fileSize:s,urls:{iosUrl:g,googleUrl:p},handleIosChange:Z,handleGoogleChange:I,disabled:Ae,api:i,creditDownload:$,user:a,isTest:Y,setIsTest:N,urlType:x,setUrlType:O,allNetworksSelected:f,setAllNetworksSelected:L}),le?l.jsx("div",{style:{height:"100%",width:"100%",display:"flex",justifyContent:"center"},children:l.jsx(Vn,{isNetworksLoading:!0})}):(J||$)&&(r==="Flex"?v:!0)&&!le&&g!=="Loading..."&&p!=="Loading..."&&l.jsx(BA,{playable:J,creditDownload:$,visible:o,versionId:t,typeOfProduct:r,api:i,user:a,handleDownloadError:d,fetchFileUrl:c,urls:{iosUrl:g,googleUrl:p},game:v,getDownloadCount:k,disabled:Ae,setSafariCopyLink:q,isTest:Y,urlType:x,allNetworksSelected:f,setAllNetworksSelected:L})]})},Jl="";var Bn={exports:{}},tt={},Un={exports:{}},Ee={},Fn={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;/*!
|
|
50
|
+
`):" "+ao(i[0]):"as no adapter specified";throw new ne("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return r},adapters:Ln};function En(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ct(null,e)}function so(e){return En(e),e.headers=Ge.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||Wn.adapter)(e).then(function(r){return En(e),r.data=Mn.call(e,e.transformResponse,r),r.headers=Ge.from(r.headers),r},function(r){return ro(r)||(En(e),r&&r.response&&(r.response.data=Mn.call(e,e.transformResponse,r.response),r.response.headers=Ge.from(r.response.headers))),Promise.reject(r)})}const lo=e=>e instanceof Ge?e.toJSON():e;function st(e,t){t=t||{};const n={};function r(c,s,m){return b.isPlainObject(c)&&b.isPlainObject(s)?b.merge.call({caseless:m},c,s):b.isPlainObject(s)?b.merge({},s):b.isArray(s)?s.slice():s}function o(c,s,m){if(b.isUndefined(s)){if(!b.isUndefined(c))return r(void 0,c,m)}else return r(c,s,m)}function i(c,s){if(!b.isUndefined(s))return r(void 0,s)}function a(c,s){if(b.isUndefined(s)){if(!b.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(lo(c),lo(s),!0)};return b.forEach(Object.keys(Object.assign({},e,t)),function(s){const m=d[s]||o,q=m(e[s],t[s],s);b.isUndefined(q)&&m!==A||(n[s]=q)}),n}const uo="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 co={};On.transitional=function(t,n,r){function o(i,a){return"[Axios v"+uo+"] Transitional option '"+i+"'"+a+(r?". "+r:"")}return(i,a,A)=>{if(t===!1)throw new ne(o(a," has been removed"+(n?" in "+n:"")),ne.ERR_DEPRECATED);return n&&!co[a]&&(co[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 iA(e,t,n){if(typeof e!="object")throw new ne("options must be an object",ne.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 ne("option "+i+" must be "+d,ne.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ne("Unknown option "+i,ne.ERR_BAD_OPTION)}}const kn={assertOptions:iA,validators:On},Ve=kn.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&&kn.assertOptions(r,{silentJSONParsing:Ve.transitional(Ve.boolean),forcedJSONParsing:Ve.transitional(Ve.boolean),clarifyTimeoutError:Ve.transitional(Ve.boolean)},!1),o!=null&&(b.isFunction(o)?n.paramsSerializer={serialize:o}:kn.assertOptions(o,{encode:Ve.function,serialize:Ve.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=i&&b.merge(i.common,i[n.method]);i&&b.forEach(["delete","get","head","post","put","patch","common"],p=>{delete i[p]}),n.headers=Ge.concat(a,i);const A=[];let d=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(n)===!1||(d=d&&h.synchronous,A.unshift(h.fulfilled,h.rejected))});const c=[];this.interceptors.response.forEach(function(h){c.push(h.fulfilled,h.rejected)});let s,m=0,q;if(!d){const p=[so.bind(this),void 0];for(p.unshift.apply(p,A),p.push.apply(p,c),q=p.length,s=Promise.resolve(n);m<q;)s=s.then(p[m++],p[m++]);return s}q=A.length;let g=n;for(m=0;m<q;){const p=A[m++],h=A[m++];try{g=p(g)}catch(y){h.call(this,y);break}}try{s=so.call(this,g)}catch(p){return Promise.reject(p)}for(m=0,q=c.length;m<q;)s=s.then(c[m++],c[m++]);return s}getUri(t){t=st(this.defaults,t);const n=oo(t.baseURL,t.url);return _r(n,t.params,t.paramsSerializer)}}b.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}))}}),b.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 zn{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 zn(function(o){t=o}),cancel:t}}}const aA=zn;function AA(e){return function(n){return e.apply(null,n)}}function sA(e){return b.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 lA=Yn;function mo(e){const t=new Qt(e),n=Yr(Qt.prototype.request,t);return b.extend(n,Qt.prototype,t,{allOwnKeys:!0}),b.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return mo(st(e,o))},n}const me=mo(Wn);me.Axios=Qt,me.CanceledError=Ct,me.CancelToken=aA,me.isCancel=ro,me.VERSION=uo,me.toFormData=Gt,me.AxiosError=ne,me.Cancel=me.CanceledError,me.all=function(t){return Promise.all(t)},me.spread=AA,me.isAxiosError=sA,me.mergeConfig=st,me.AxiosHeaders=Ge,me.formToJSON=e=>to(b.isHTMLForm(e)?new FormData(e):e),me.getAdapter=Ao.getAdapter,me.HttpStatusCode=lA,me.default=me;const uA=me;/*! typescript-cookie v1.0.6 | MIT */const po=e=>encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),fo=e=>encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent),jn=decodeURIComponent,Jn=e=>(e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent));function cA(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 ho(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 go=Object.freeze({decodeName:jn,decodeValue:Jn,encodeName:po,encodeValue:fo}),Nn=Object.freeze({path:"/"});function qo(e,t,n=Nn,{encodeValue:r=fo,encodeName:o=po}={}){return document.cookie=`${o(e)}=${r(t,e)}${cA(n)}`}function yo(e,{decodeValue:t=Jn,decodeName:n=jn}={}){return ho(e,t,n)}function dA({decodeValue:e=Jn,decodeName:t=jn}={}){return ho(void 0,e,t)}function mA(e,t=Nn){qo(e,"",Object.assign({},t,{expires:-1}))}function Dn(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 dA(this.converter.read);if(o!=null)return yo(o,this.converter.read)},remove:function(o,i){mA(o,Object.assign({},this.attributes,i))},withAttributes:function(o){return Dn(this.converter,Object.assign({},this.attributes,o))},withConverter:function(o){return Dn(Object.assign({},this.converter,o),this.attributes)}},r={attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}};return Object.create(n,r)}Dn({read:go.decodeValue,write:go.encodeValue},Nn);let vo;typeof window<"u"&&(vo=yo("token"));const fe=uA.create({headers:{Authorization:vo}});async function pA(e,t,n){return(await fe.post(n+"/createFlexVersionLinkMulti",{_id:e,networks:t})).data}async function fA(e,t){return e.network=="fb"&&(e.zip=1),(await fe.post(t+"/createFlexVersionLink",e||{})).data}async function hA(e,t,n){return(await fe.post(e+"/createImportedVersionLink",{_id:t,network:n})).data}async function gA(e,t,n,r,o){return(await fe.post(e+"/createPlayableVersionLink",{_id:t,network:n,isPfTest:r,extras:o})).data}async function qA(e,t,n){return(await fe.post(n+"/createPlayableVersionLinkMulti",{_id:e,networks:t})).data}async function yA(e,t,n,r,o){return(await fe.post(e+"/createReadyVersionLink",{_id:t,network:n,isPfTest:r,extras:o})).data}async function vA(e,t,n){return(await fe.post(n+"/createReadyVersionLinkMulti",{_id:e,networks:t})).data}async function bo(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 Co(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=Co(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function Be(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=Co(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,Rn=e=>C.isValidElement(e)||_e(e)||be(e)||Zt(e);function bA(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:q}=a;const g=r?`${t}--${d}`:t,p=r?`${n}--${d}`:n,h=C.useRef(0);return C.useLayoutEffect(()=>{const y=m.current,x=g.split(" "),O=J=>{J.target===m.current&&(y.dispatchEvent(new Event("d")),y.removeEventListener("animationend",O),y.removeEventListener("animationcancel",O),h.current===0&&J.type!=="animationcancel"&&y.classList.remove(...x))};y.classList.add(...x),y.addEventListener("animationend",O),y.addEventListener("animationcancel",O)},[]),C.useEffect(()=>{const y=m.current,x=()=>{y.removeEventListener("animationend",x),o?bA(y,s,i):s()};q||(c?x():(h.current=1,y.className+=` ${p}`,y.addEventListener("animationend",x)))},[q]),C.createElement(C.Fragment,null,A)}}function Zo(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 Se={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 C.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${n})`,...r})},Gn={info:function(e){return C.createElement(Ft,{...e},C.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 C.createElement(Ft,{...e},C.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 C.createElement(Ft,{...e},C.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 C.createElement(Ft,{...e},C.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 C.createElement("div",{className:"Toastify__spinner"})}};function CA(e){const[,t]=C.useReducer(g=>g+1,0),[n,r]=C.useState([]),o=C.useRef(null),i=C.useRef(new Map).current,a=g=>n.indexOf(g)!==-1,A=C.useRef({toastKey:1,displayedToast:0,count:0,queue:[],props:e,containerId:null,isToastActive:a,getToast:g=>i.get(g)}).current;function d(g){let{containerId:p}=g;const{limit:h}=A.props;!h||p&&A.containerId!==p||(A.count-=A.queue.length,A.queue=[])}function c(g){r(p=>g==null?[]:p.filter(h=>h!==g))}function s(){const{toastContent:g,toastProps:p,staleId:h}=A.queue.shift();q(g,p,h)}function m(g,p){let{delay:h,staleId:y,...x}=p;if(!Rn(g)||function(Q){return!o.current||A.props.enableMultiContainer&&Q.containerId!==A.props.containerId||i.has(Q.toastId)&&Q.updateId==null}(x))return;const{toastId:O,updateId:J,data:z}=x,{props:v}=A,_=()=>c(O),$=J==null;$&&A.count++;const F={...v,style:v.toastStyle,key:A.toastKey++,...Object.fromEntries(Object.entries(x).filter(Q=>{let[B,W]=Q;return W!=null})),toastId:O,updateId:J,data:z,closeToast:_,isIn:!1,className:Bt(x.className||v.toastClassName),bodyClassName:Bt(x.bodyClassName||v.bodyClassName),progressClassName:Bt(x.progressClassName||v.progressClassName),autoClose:!x.isLoading&&(le=x.autoClose,ee=v.autoClose,le===!1||Zt(le)&&le>0?le:ee),deleteToast(){const Q=Zo(i.get(O),"removed");i.delete(O),Se.emit(4,Q);const B=A.queue.length;if(A.count=O==null?A.count-A.displayedToast:A.count-1,A.count<0&&(A.count=0),B>0){const W=O==null?A.props.limit:1;if(B===1||W===1)A.displayedToast++,s();else{const Y=W>B?B:W;A.displayedToast=Y;for(let N=0;N<Y;N++)s()}}else t()}};var le,ee;F.iconOut=function(Q){let{theme:B,type:W,isLoading:Y,icon:N}=Q,f=null;const L={theme:B,type:W};return N===!1||(be(N)?f=N(L):C.isValidElement(N)?f=C.cloneElement(N,L):_e(N)||Zt(N)?f=N:Y?f=Gn.spinner():(T=>T in Gn)(W)&&(f=Gn[W](L))),f}(F),be(x.onOpen)&&(F.onOpen=x.onOpen),be(x.onClose)&&(F.onClose=x.onClose),F.closeButton=v.closeButton,x.closeButton===!1||Rn(x.closeButton)?F.closeButton=x.closeButton:x.closeButton===!0&&(F.closeButton=!Rn(v.closeButton)||v.closeButton);let Ae=g;C.isValidElement(g)&&!_e(g.type)?Ae=C.cloneElement(g,{closeToast:_,toastProps:F,data:z}):be(g)&&(Ae=g({closeToast:_,toastProps:F,data:z})),v.limit&&v.limit>0&&A.count>v.limit&&$?A.queue.push({toastContent:Ae,toastProps:F,staleId:y}):Zt(h)?setTimeout(()=>{q(Ae,F,y)},h):q(Ae,F,y)}function q(g,p,h){const{toastId:y}=p;h&&i.delete(h);const x={content:g,props:p};i.set(y,x),r(O=>[...O,y].filter(J=>J!==h)),Se.emit(4,Zo(x,x.props.updateId==null?"added":"updated"))}return C.useEffect(()=>(A.containerId=e.containerId,Se.cancelEmit(3).on(0,m).on(1,g=>o.current&&c(g)).on(5,d).emit(2,A),()=>{i.clear(),Se.emit(3,A)}),[]),C.useEffect(()=>{A.props=e,A.isToastActive=a,A.displayedToast=n.length}),{getToastToRender:function(g){const p=new Map,h=Array.from(i.values());return e.newestOnTop&&h.reverse(),h.forEach(y=>{const{position:x}=y.props;p.has(x)||p.set(x,[]),p.get(x).push(y)}),Array.from(p,y=>g(y[0],y[1]))},containerRef:o,isToastActive:a}}function Io(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientX:e.clientX}function wo(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientY:e.clientY}function ZA(e){const[t,n]=C.useState(!1),[r,o]=C.useState(!1),i=C.useRef(null),a=C.useRef({start:0,x:0,y:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,boundingRect:null,didMove:!1}).current,A=C.useRef(e),{autoClose:d,pauseOnHover:c,closeToast:s,onClick:m,closeOnClick:q}=e;function g(z){if(e.draggable){z.nativeEvent.type==="touchstart"&&z.nativeEvent.preventDefault(),a.didMove=!1,document.addEventListener("mousemove",x),document.addEventListener("mouseup",O),document.addEventListener("touchmove",x),document.addEventListener("touchend",O);const v=i.current;a.canCloseOnClick=!0,a.canDrag=!0,a.boundingRect=v.getBoundingClientRect(),v.style.transition="",a.x=Io(z.nativeEvent),a.y=wo(z.nativeEvent),e.draggableDirection==="x"?(a.start=a.x,a.removalDistance=v.offsetWidth*(e.draggablePercent/100)):(a.start=a.y,a.removalDistance=v.offsetHeight*(e.draggablePercent===80?1.5*e.draggablePercent:e.draggablePercent/100))}}function p(z){if(a.boundingRect){const{top:v,bottom:_,left:$,right:F}=a.boundingRect;z.nativeEvent.type!=="touchend"&&e.pauseOnHover&&a.x>=$&&a.x<=F&&a.y>=v&&a.y<=_?y():h()}}function h(){n(!0)}function y(){n(!1)}function x(z){const v=i.current;a.canDrag&&v&&(a.didMove=!0,t&&y(),a.x=Io(z),a.y=wo(z),a.delta=e.draggableDirection==="x"?a.x-a.start:a.y-a.start,a.start!==a.x&&(a.canCloseOnClick=!1),v.style.transform=`translate${e.draggableDirection}(${a.delta}px)`,v.style.opacity=""+(1-Math.abs(a.delta/a.removalDistance)))}function O(){document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",O),document.removeEventListener("touchmove",x),document.removeEventListener("touchend",O);const z=i.current;if(a.canDrag&&a.didMove&&z){if(a.canDrag=!1,Math.abs(a.delta)>a.removalDistance)return o(!0),void e.closeToast();z.style.transition="transform 0.2s, opacity 0.2s",z.style.transform=`translate${e.draggableDirection}(0)`,z.style.opacity="1"}}C.useEffect(()=>{A.current=e}),C.useEffect(()=>(i.current&&i.current.addEventListener("d",h,{once:!0}),be(e.onOpen)&&e.onOpen(C.isValidElement(e.children)&&e.children.props),()=>{const z=A.current;be(z.onClose)&&z.onClose(C.isValidElement(z.children)&&z.children.props)}),[]),C.useEffect(()=>(e.pauseOnFocusLoss&&(document.hasFocus()||y(),window.addEventListener("focus",h),window.addEventListener("blur",y)),()=>{e.pauseOnFocusLoss&&(window.removeEventListener("focus",h),window.removeEventListener("blur",y))}),[e.pauseOnFocusLoss]);const J={onMouseDown:g,onTouchStart:g,onMouseUp:p,onTouchEnd:p};return d&&c&&(J.onMouseEnter=y,J.onMouseLeave=h),q&&(J.onClick=z=>{m&&m(z),a.canCloseOnClick&&s()}),{playToast:h,pauseToast:y,isRunning:t,preventExitTransition:r,toastRef:i,eventHandlers:J}}function xo(e){let{closeToast:t,theme:n,ariaLabel:r="close"}=e;return C.createElement("button",{className:`Toastify__close-button Toastify__close-button--${n}`,type:"button",onClick:o=>{o.stopPropagation(),t(o)},"aria-label":r},C.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},C.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 IA(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:q}=e;const g=i||d&&c===0,p={...A,animationDuration:`${t}ms`,animationPlayState:n?"running":"paused",opacity:g?0:1};d&&(p.transform=`scaleX(${c})`);const h=Be("Toastify__progress-bar",d?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${q}`,`Toastify__progress-bar--${o}`,{"Toastify__progress-bar--rtl":s}),y=be(a)?a({rtl:s,type:o,defaultClassName:h}):Be(h,a);return C.createElement("div",{role:"progressbar","aria-hidden":g?"true":"false","aria-label":"notification timer",className:y,style:p,[d&&c>=1?"onTransitionEnd":"onAnimationEnd"]:d&&c<1?null:()=>{m&&r()}})}const wA=e=>{const{isRunning:t,preventExitTransition:n,toastRef:r,eventHandlers:o}=ZA(e),{closeButton:i,children:a,autoClose:A,onClick:d,type:c,hideProgressBar:s,closeToast:m,transition:q,position:g,className:p,style:h,bodyClassName:y,bodyStyle:x,progressClassName:O,progressStyle:J,updateId:z,role:v,progress:_,rtl:$,toastId:F,deleteToast:le,isIn:ee,isLoading:Ae,iconOut:Q,closeOnClick:B,theme:W}=e,Y=Be("Toastify__toast",`Toastify__toast-theme--${W}`,`Toastify__toast--${c}`,{"Toastify__toast--rtl":$},{"Toastify__toast--close-on-click":B}),N=be(p)?p({rtl:$,position:g,type:c,defaultClassName:Y}):Be(Y,p),f=!!_||!A,L={closeToast:m,type:c,theme:W};let T=null;return i===!1||(T=be(i)?i(L):C.isValidElement(i)?C.cloneElement(i,L):xo(L)),C.createElement(q,{isIn:ee,done:le,position:g,preventExitTransition:n,nodeRef:r},C.createElement("div",{id:F,onClick:d,className:N,...o,style:h,ref:r},C.createElement("div",{...ee&&{role:v},className:be(y)?y({type:c}):Be("Toastify__toast-body",y),style:x},Q!=null&&C.createElement("div",{className:Be("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!Ae})},Q),C.createElement("div",null,a)),T,C.createElement(IA,{...z&&!f?{key:`pb-${z}`}:{},rtl:$,theme:W,delay:A,isRunning:t,isIn:ee,closeToast:m,hide:s,type:c,style:J,className:O,controlledProgress:f,progress:_||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}},xA=Ut(_t("bounce",!0));Ut(_t("slide",!0)),Ut(_t("zoom")),Ut(_t("flip"));const Tn=C.forwardRef((e,t)=>{const{getToastToRender:n,containerRef:r,isToastActive:o}=CA(e),{className:i,style:a,rtl:A,containerId:d}=e;function c(s){const m=Be("Toastify__toast-container",`Toastify__toast-container--${s}`,{"Toastify__toast-container--rtl":A});return be(i)?i({position:s,rtl:A,defaultClassName:m}):Be(m,Bt(i))}return C.useEffect(()=>{t&&(t.current=r.current)},[]),C.createElement("div",{ref:r,className:"Toastify",id:d},n((s,m)=>{const q=m.length?{...a}:{...a,pointerEvents:"none"};return C.createElement("div",{className:c(s),style:q,key:`container-${s}`},m.map((g,p)=>{let{content:h,props:y}=g;return C.createElement(wA,{...y,isIn:o(y.toastId),style:{...y.style,"--nth":p+1,"--len":m.length},key:`toast-${y.key}`},h)}))}))});Tn.displayName="ToastContainer",Tn.defaultProps={position:"top-right",transition:xA,autoClose:5e3,closeButton:xo,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,draggable:!0,draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};let Hn,$e=new Map,It=[],KA=1;function Ko(){return""+KA++}function WA(e){return e&&(_e(e.toastId)||Zt(e.toastId))?e.toastId:Ko()}function wt(e,t){return $e.size>0?Se.emit(0,e,t):It.push({content:e,options:t}),t.toastId}function $t(e,t){return{...t,type:t&&t.type||e,toastId:WA(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,q)=>{if(m==null)return void ce.dismiss(r);const g={type:s,...A,...n,data:q},p=_e(m)?{render:m}:m;return r?ce.update(r,{...g,...p}):ce(p.render,{...g,...p}),q},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?Se.emit(1,e):It=It.filter(t=>e!=null&&t.options.toastId!==e)},ce.clearWaitingQueue=function(e){return e===void 0&&(e={}),Se.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||Hn);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:Ko()};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=>(Se.on(4,e),()=>{Se.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"},Se.on(2,e=>{Hn=e.containerId||e,$e.set(Hn,e),It.forEach(t=>{Se.emit(0,t.content,t.options)}),It=[]}).on(3,e=>{$e.delete(e.containerId||e),$e.size===0&&Se.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 Xn="",et="Playable",Ce=null,Wo=null;const tn=async e=>{let t=Xn+"/"+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)})},SA=(e,t)=>{let n=Xn+"/"+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"&&SA(c,Wo)};et==="Playable"?(n&&n.iosUrl!=="Loading..."&&n.googleUrl!=="Loading..."&&await Pt(e,{iosLink:n==null?void 0:n.iosUrl,androidLink:n==null?void 0:n.googleUrl},Ce),gA(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&&n.iosUrl!=="Loading..."&&n.googleUrl!=="Loading..."&&await bo({_id:e,iosLink:n==null?void 0:n.iosUrl,androidLink:n==null?void 0:n.googleUrl},Ce),fA({_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"?hA(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&&n.iosUrl!=="Loading..."&&n.googleUrl!=="Loading..."&&((i==null?void 0:i.urlType)==="single"&&(n.googleUrl=n.iosUrl),await Pt(e,{iosLink:n==null?void 0:n.iosUrl,androidLink:n==null?void 0:n.googleUrl},Ce)),yA(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 MA(e,t,n,r=null){return new Promise(async(o,i)=>{et==="Flex"?(await bo({_id:e,iosLink:t==null?void 0:t.iosUrl,androidLink:t==null?void 0:t.googleUrl},Ce),pA(e,n,Ce).then(async a=>{if(a.message){i(a);return}await tn(a.url),o(a.url)}).catch(a=>{let A=a.response.data.error.msg;i({message:A})})):et==="Ready"?(t&&t.iosUrl!=="Loading..."&&t.googleUrl!=="Loading..."&&((r==null?void 0:r.urlType)==="single"&&(t.googleUrl=t.iosUrl),await Pt(e,{iosLink:t==null?void 0:t.iosUrl,androidLink:t==null?void 0:t.googleUrl},Ce)),vA(e,n,Ce).then(async a=>{if(a.message){i(a);return}await tn(a.url),o(a.url)}).catch(a=>{console.log("err",a);let A=a.response.data.error.msg;i({message:A})})):(t&&t.iosUrl!=="Loading..."&&t.googleUrl!=="Loading..."&&await Pt(e,{iosLink:t==null?void 0:t.iosUrl,androidLink:t==null?void 0:t.googleUrl},Ce),qA(e,n,Ce).then(async a=>{await tn(a.url),o(a.url)}).catch(a=>{let A=a.response.data.error.msg;i({message:A})}))})}function LA(e,t,n,r){et=e,Ce=t,Wo=n,Xn=r}async function Qn(e,t){return(await fe.post(t+"/findPlayable",{_id:e})).data}const EA=({versionId:e,playableId:t,typeOfProduct:n,api:r,copyLinkUrl:o,setSafariCopyLink:i,qrUrl:a,iosLink:A,androidLink:d,urlType:c})=>{const[s,m]=C.useState(!1),q=async()=>{m(!0),nn(e,"default",{iosUrl:A,googleUrl:d},null,!1,{urlType:c}).then(async g=>{var x,O,J,z;let p="";if(t&&(n==="Playable"||n==="Ready")){const v=await Qn(t,r);console.log(v);const _=(O=(x=v==null?void 0:v.data)==null?void 0:x.globalProps)==null?void 0:O.defaultLandscape,$=(z=(J=v==null?void 0:v.data)==null?void 0:J.globalProps)==null?void 0:z.defaultPhoneIndex;console.log(_,$),_&&(p+="&landscape=true"),$!==void 0&&(p+=`&phoneIndex=${$}`)}Qn(t,r),m(!1);let h;n==="Flex"?h=`${o}/preview?versionId=${e}`:n==="Import"?h=`${o}/preview?versionId=${e}_`:n==="Ready"?h=`${o}/preview?versionId=${e}_&ready=true`:h=`${o}/preview?versionId=${e}_`,h+=p,Vt(h)?xt("Link copied"):i(h),m(!1)}).catch(g=>{m(!1)})};return 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:a?l.jsx(Fi,{bgColor:"#0F0F1E",fgColor:"#ffffff",style:{height:"auto",maxWidth:"100%",width:"100%"},value:a}):l.jsx("img",{style:{width:"50px",height:"50px"},src:Pe,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:()=>{s||q()},children:[l.jsx(zr,{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:s?l.jsx("img",{style:{height:"90%"},src:Pe,alt:"loading"}):l.jsx("button",{style:{fontSize:"1rem",color:"white",background:"rgba(0, 163, 255, 0)"},children:"Copy Link"})})]})]})]})},OA=({versionName:e,versionId:t,playableId:n,typeOfProduct:r,api:o,iframeUrl:i,fetchFileUrl:a,copyLinkUrl:A,setSafariCopyLink:d,iosLink:c,androidLink:s,urlType:m})=>{const[q,g]=C.useState(window.innerWidth);console.log("iosLink",c),C.useEffect(()=>{console.log("re add event listener");function h(y){console.log(y),y.data==="cta"&&(console.log("Received 'cta' message from iframe"),c&&window.open(c,"_blank"))}return window.addEventListener("message",h,!1),()=>{window.removeEventListener("message",h)}},[c,s]),C.useEffect(()=>{const h=()=>{g(window.innerWidth)};return window.addEventListener("resize",h),()=>{window.removeEventListener("resize",h)}},[]);const p=(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:q>1440?"680px":"620px",borderRadius:"0px 0px 0px 16px",marginTop:"20px"},children:[l.jsx(fi,{iframeUrl:i}),l.jsx(hi,{name:p}),l.jsx(EA,{versionId:t,playableId:n,typeOfProduct:r,api:o,copyLinkUrl:A,setSafariCopyLink:d,qrUrl:i,iosLink:c,androidLink:s,urlType:m})]})};var he=(e=>(e.Flex="#7101FF",e.Playable="#F9830B",e.Import="#00a3ff",e.Ready="#0060A5",e))(he||{});const So=({checked:e,typeOfProduct:t,id:n})=>{const[r,o]=C.useState(e);C.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"})})," "]})]})})},kA=({typeOfProduct:e,allNetworksSelected:t,setAllNetworksSelected:n})=>l.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",marginBottom:"0.5rem"},children:[l.jsxs("div",{style:{fontSize:"2xl",fontWeight:"bold",display:"flex"},children:[l.jsx("span",{style:{color:he[e]},children:"Select Network"}),l.jsx("span",{style:{whiteSpace:"pre"},children:" From List"})]}),l.jsxs("div",{onClick:()=>{n(!t)},style:{marginLeft:"auto",marginRight:"2rem",display:"flex",height:"24px",alignItems:"center",justifyContent:"flex-end",fontSize:"0.875rem",width:110},children:[l.jsx(So,{checked:t,typeOfProduct:e,id:"asd"}),l.jsx("span",{style:{marginLeft:"0.5rem",fontSize:"16px",fontWeight:"bold"},children:"Select All"})]})]});async function zA(e,t){return(await fe.post(t+"/buyRequest",{requestType:e})).data}const YA=()=>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)"})})})]}),jA=({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:()=>zA("Flex Credit",t).then(n=>xt("You will be contacted regarding your request.")),children:["Get more",l.jsx(YA,{})]})]})]}),Mo=({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",flexShrink:0},children:"App Store:"}),l.jsx("input",{style:{marginLeft:"1.25rem",display:"flex",height:"100%",width:"100%",alignItems:"center",borderRadius:"0.375rem",border:t.iosUrl?"1px solid lightgray":"1px solid red",paddingLeft:"0.5rem",color:"#000000",borderColor:he[e],marginRight:"2rem"},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",flexShrink:0},children:["Google Play:"," "]}),l.jsx("input",{style:{marginLeft:"1.25rem",display:"flex",height:"100%",width:"100%",alignItems:"center",borderRadius:"0.375rem",border:t.googleUrl?"1px solid lightgray":"1px solid red",paddingLeft:"0.5rem",color:"#000000",borderColor:he[e],marginRight:"2rem"},type:"text",value:t.googleUrl,onChange:a,placeholder:"Google Url",disabled:o})]})]})},JA=({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",flexShrink:0},children:"Redirection URL:"}),l.jsx("input",{style:{marginLeft:"1.25rem",display:"flex",height:"100%",width:"100%",alignItems:"center",borderRadius:"0.375rem",border:t.iosUrl?"1px solid lightgray":"1px solid red",paddingLeft:"0.5rem",color:"#000000",borderColor:he[e],marginRight:"2rem"},type:"text",value:t.iosUrl,onChange:i,placeholder:"Ios Url",disabled:o})]})})},NA=({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:q})=>{const g=()=>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(()=>{q("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(()=>{q("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(g,{}),e==="Ready"?l.jsxs(l.Fragment,{children:[l.jsx(p,{}),m==="game"&&l.jsx(Mo,{typeOfProduct:e,urls:n,handleIosChange:r,handleGoogleChange:o,disabled:i}),m==="single"&&l.jsx(JA,{typeOfProduct:e,urls:n,handleIosChange:r,handleGoogleChange:o,disabled:i})]}):l.jsx(l.Fragment,{children:l.jsx(Mo,{typeOfProduct:e,urls:n,handleIosChange:r,handleGoogleChange:o,disabled:i})}),(A==null?void 0:A.willSpendCredit)&&l.jsx(jA,{creditDownload:A,api:a})]})})},DA=({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"]})]}),RA=({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:q,setUrlType:g,allNetworksSelected:p,setAllNetworksSelected: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(DA,{typeOfProduct:e,title:r,fileSize:t}),l.jsx(NA,{typeOfProduct:e,fileSize:t,urls:n,handleIosChange:o,handleGoogleChange:i,disabled:a,creditDownload:A,api:d,user:c,isTest:s,setIsTest:m,urlType:q,setUrlType:g}),l.jsx(kA,{typeOfProduct:e,allNetworksSelected:p,setAllNetworksSelected:h})]}),Pn=({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}),jl="",GA=({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]}})]})}),Vn=({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:Pe,alt:"pf-logo-gif"})}),Lo=({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"})]}),TA=({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"})]})]})]})},Eo=({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"})]})]})]}),HA=({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:Pe,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:Pe,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:Pe,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 XA(e,t,n,r){return(await fe.post(e+"/createMolocoTestPage",{_id:t,network:n,typeOfProduct:r})).data}const QA=({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:q,urls:g,game:p,setIsConfirmActive:h,creditDownload:y,getDownloadCount:x,disabled:O,user:J,setSafariCopyLink:z,isTest:v,urlType:_})=>{const[$,F]=C.useState(!1),[le,ee]=C.useState(""),[Ae,Q]=C.useState(!1),[B,W]=C.useState(!1),[Y,N]=C.useState(!1),[f,L]=C.useState("download"),[T,Z]=C.useState(!1),[I,M]=C.useState(!1),[k,j]=C.useState(!1);let S={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",mraid:"copy,html"};const D=()=>{n(e)},R=async(V,K)=>(F(!0),new Promise((se,De)=>{nn(c,V,g,K,v,{urlType:_}).then(we=>{F(!1),se(we)}).catch(we=>{F(!1),m(we.message,we),De(we)})})),P=async(V=!1)=>{V?M(!0):Z(!0);const K={molocoGenerateHtml:!1};V&&(K.molocoGenerateHtml=!0),nn(c,o,g,"download",v,K).then(se=>{V?M(!1):Z(!1),N(!1)}).catch(se=>{m(se.message,se)})},U=async()=>{j(!0);const V=await XA(s,c,o,d);let K=`${q}/${V==null?void 0:V.url}`;Vt(K)?(xt("Link Copied"),j(!1)):z(K)},G=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:D,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(V=>V.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(GA,{typeOfProduct:d})}):i.map(V=>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:V.network===o?V.size.toString().slice(0,5)+"Mb":""},V.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(So,{checked:r,typeOfProduct:d,id:e})}),l.jsx("img",{onClick:D,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(Pn,{className:`${G?"w-1/2":"w-2/3"} border-hover-`+d,downloading:$,onClickDonwload:async V=>{if(V.stopPropagation(),G&&J.customer==="playableFactoryInternal"){N(!0);return}else{ee("download");const K=g.iosUrl,se=g.googleUrl;y&&y.willSpendCredit?(h(!0),L("download"),Q(!0)):["Playable","Flex"].includes(d)&&(!K||!se)||d==="Ready"&&_==="single"&&!K||d==="Ready"&&_==="multi"&&(!K||!se)?(h(!0),W(!0)):(W(!1),Q(!1),await R(o,"download"))}},children:[!$&&l.jsxs(l.Fragment,{children:[l.jsx(Lo,{style:{marginRight:"0.5rem",height:"1.5rem",width:"1rem",stroke:"dark-full"}}),G&&J.customer!=="playableFactoryInternal"?"TXT":"Download"]}),$&&l.jsx(Vn,{})]}),S[o]&&S[o].includes("copy")&&l.jsx(Pn,{className:"w-1/3 border-hover-"+d,onClickDonwload:async V=>{V.stopPropagation(),ee("copyLink");const K=g.iosUrl,se=g.googleUrl;y&&(y!=null&&y.willSpendCredit)?(L("copy"),h(!0),Q(!0)):d!=="Import"&&(!K||!se)?(h(!0),W(!0)):(Q(!1),W(!1),await R(o,"copy"))},disabled:O,children:l.jsx(zr,{className:"h-6 w-6 stroke-dark-full"})}),G&&J.customer!=="playableFactoryInternal"&&l.jsx(Pn,{className:"w-1/2 border-hover-"+d,onClickDonwload:async V=>{V.stopPropagation(),ee("download");const K=g.iosUrl,se=g.googleUrl;y&&(y!=null&&y.willSpendCredit)?(L("download"),h(!0),Q(!0)):d!=="Import"&&(!K||!se)?(h(!0),W(!0)):(Q(!1),W(!1),await P(!0))},disabled:O,children:l.jsxs(l.Fragment,{children:[l.jsx(Lo,{style:{marginRight:"0.5rem",height:"1.5rem",width:"1rem",stroke:"dark-full"}}),"HTML"]})})]})]}),Ae&&l.jsx(Eo,{creditConfirmType:f,handleCopyLink:async()=>{W(!1),h(!1),await R(o,"copy")},download:async()=>{W(!1),h(!1),await R(o,"download")},onClose:()=>{Q(!1),h(!1)},getDownloadCount:x}),B&&l.jsx(TA,{onClose:()=>{W(!1),h(!1)},iosLink:g.iosUrl,googleLink:g.googleUrl,buttonType:le,handleCopyLink:async()=>{W(!1),h(!1),await R(o,"copy")},download:async()=>{W(!1),h(!1),await R(o,"download")},typeOfProduct:d,urlType:_}),Y&&J.customer==="playableFactoryInternal"&&l.jsx(HA,{onClose:()=>{N(!1)},handleDownload:P,handleDownloadMolocoTest:U,downloadingMoloco:T,donwloadintMolocoTest:k,downloadingMolocoHtml:I})]})},rn=[{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"},{id:"50",name:"mraid",imageSrc:"https://gearbox.playablefactory.com/mraid.png"},{id:"51",name:"zynga",imageSrc:"https://gearbox.playablefactory.com/zynga.png"}],PA=({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})},VA=({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(Vn,{})}):l.jsx(PA,{typeOfProduct:t,onClick:n,children:l.jsx("span",{style:{fontSize:"1.25rem",padding:"0.5rem",color:"#fff"},children:"Download All"})})}),BA=({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:q,setSafariCopyLink:g,isTest:p,urlType:h,allNetworksSelected:y,setAllNetworksSelected:x})=>{const[O,J]=C.useState([]),[z,v]=C.useState([]),[_,$]=C.useState(!1),[F,le]=C.useState(""),[ee,Ae]=C.useState(!1),[Q,B]=C.useState(!1),[W,Y]=C.useState("download"),[N,f]=C.useState(!1),L=async I=>{const M=[...O];if(O.includes(I)){const k=M.findIndex(j=>j===I);M.splice(k,1),J(M)}else M.push(I),J([...O,I]);rn.filter(k=>[...M].includes(k.id)).map(k=>k.name)},T=async()=>new Promise(async(I,M)=>{const k=rn.filter(j=>[...O].includes(j.id)).map(j=>j.name);Ae(!0),MA(r,c,k,{urlType:h}).then(j=>{Ae(!1),I(j)}).catch(j=>{console.log("get multi download err"),Ae(!1),A(j.message,j),M(j)})}),Z=async()=>{c.iosUrl,c.googleUrl,t&&t.willSpendCredit?(B(!0),Y("download"),f(!0)):(f(!1),await T())};return C.useEffect(()=>{const I=rn.filter(M=>{var k;return t&&((k=t==null?void 0:t.networks)==null?void 0:k.length)>0?t==null?void 0:t.networks.includes(M.name):o==="Import"?e==null?void 0:e.networks.filter(j=>j.status==="paid").some(j=>j.name===M.name):e==null?void 0:e.networks.includes(M.name)}).filter(M=>M.name==="voodoo"?a.customer==="customer:20":!0).map(M=>M.id);J(y?I:[])},[y]),l.jsxs(l.Fragment,{children:[l.jsx("div",{style:{position:"relative",flex:1,overflowY:Q?"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&&rn.filter(I=>{var M;return t&&((M=t==null?void 0:t.networks)==null?void 0:M.length)>0?t==null?void 0:t.networks.includes(I.name):o==="Import"?e==null?void 0:e.networks.filter(k=>k.status==="paid").some(k=>k.name===I.name):e==null?void 0:e.networks.includes(I.name)}).filter(I=>I.name==="voodoo"?a.customer==="customer:20":!0).map(I=>{let M=I.imageSrc;if(I.name==="web"){let k="web_"+o.toLowerCase()+".png";M=M.replace("web.png",k)}return l.jsx(QA,{id:I.id,name:I.name,imageUrl:M,selected:O.includes(I.id),handleCardClick:L,networkVersionSize:z,fileSizeLoading:_,showCheckBox:!0,typeOfProduct:o,versionId:r,api:i,handleDownloadError:A,fetchFileUrl:d,urls:c,game:s,creditDownload:t,setIsConfirmActive:B,getDownloadCount:m,disabled:q,user:a,setSafariCopyLink:g,isTest:p,urlType:h},I.id)})})}),O.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(VA,{onClickMultiDownload:Z,networksVersionTotalSize:F,typeOfProduct:o,multiDownloading:ee})}),N&&l.jsx(Eo,{creditConfirmType:W,handleCopyLink:async()=>{},download:async()=>{f(!1),B(!1),await T()},onClose:()=>{f(!1),B(!1)},getDownloadCount:m})]})};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"],Oo=["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:q,iosLink:g,androidLink:p,setIosLink:h,setAndroidLink:y,urlType:x,setUrlType:O})=>{const[J,z]=C.useState(null),[v,_]=C.useState(null),[$,F]=C.useState(null),[le,ee]=C.useState(!1),[Ae,Q]=C.useState(!0),[B,W]=C.useState(window.innerWidth),[Y,N]=C.useState(!1),[f,L]=C.useState(!1);C.useEffect(()=>{},[f]),C.useEffect(()=>{const S=()=>{W(window.innerWidth)};return window.addEventListener("resize",S),()=>{window.removeEventListener("resize",S)}},[]);const T=async()=>{ee(!0);const S=await Qn(e,i);return S!=null&&S.networks||(S.networks=ns),z(S),S},Z=S=>{h(S)},I=S=>{y(S)},M=async(S,D)=>{var R,P;console.log("getIosAndAndroidLink");try{let U;if(r==="Playable"||r==="Ready"){const G=await _A(t,i);if(G){console.log("version",G),h(G.iosLink),y(G.androidLink),ee(!1);return}if(S&&(S.iosUrl||S.googleUrl)){h(S.iosUrl),y(S.googleUrl),ee(!1);return}if(D&&D.html){let V=await fetch(c+"/"+D.html).then(De=>De.text());const K=((R=V.match(/var\s+iosLink\s*=\s*['|"](https?[\w\d;,/?:@&=+$\-_.!~*'()#]+)['|"]/))==null?void 0:R.at(1))||"";h(K);const se=((P=V.match(/var\s+androidLink\s*=\s*['|"](https?[\w\d;,/?:@&=+$\-_.!~*'()#]+)['|"]/))==null?void 0:P.at(1))||"";y(se),ee(!1)}else y(""),h(""),ee(!1)}else if(r==="Flex"){const G=await $A(t,i);if(G.googleUrl||G.iosUrl){y(G.googleUrl),h(G.iosUrl),ee(!1);return}S&&(S.iosUrl||S.googleUrl)?(h(S.iosUrl),y(S.googleUrl),ee(!1)):(y(""),h(""),ee(!1))}}catch(U){d(U.response.data.error.msg)}},k=async()=>{ee(!0);let S;r==="Flex"?S=await UA({_id:t},i):r==="Ready"&&(S=await ts({_id:t},i)),S&&(["admin","pm","tester","sales"].includes(a.role)?F({...S,networks:Oo}):r==="Ready"&&!S.canDownload?F({...S,networks:Oo}):F(S)),ee(!1)},j=async()=>await FA(n,i);return C.useEffect(()=>{o||(z(null),_(null),F(null),m(null)),o&&(r==="Playable"?(T().then(S=>{M(null,S)}),Q(!1)):r==="Ready"?k().then(S=>{T().then(D=>{M(null,D),Q(!1)})}):r==="Flex"?k().then(S=>{Q(!1),j().then(D=>{o&&(M(D,null),Q(!1),_(D))})}):r==="Import"&&es(t,i).then(S=>{console.log(S),z(S),h(S.iosUrl||""),y(S.googleUrl||""),ee(!1),Q(!1)}))},[n,e,t,o]),l.jsxs("div",{style:{display:"flex",height:B>1440?"700px":"650px",width:B>1440?"675px":"680px",flexDirection:"column",borderRadius:"rounded",backgroundColor:"#F7F7F8",paddingTop:"0px"},children:[l.jsx(RA,{title:A,typeOfProduct:r,fileSize:s,urls:{iosUrl:g,googleUrl:p},handleIosChange:Z,handleGoogleChange:I,disabled:Ae,api:i,creditDownload:$,user:a,isTest:Y,setIsTest:N,urlType:x,setUrlType:O,allNetworksSelected:f,setAllNetworksSelected:L}),le?l.jsx("div",{style:{height:"100%",width:"100%",display:"flex",justifyContent:"center"},children:l.jsx(Vn,{isNetworksLoading:!0})}):(J||$)&&(r==="Flex"?v:!0)&&!le&&g!=="Loading..."&&p!=="Loading..."&&l.jsx(BA,{playable:J,creditDownload:$,visible:o,versionId:t,typeOfProduct:r,api:i,user:a,handleDownloadError:d,fetchFileUrl:c,urls:{iosUrl:g,googleUrl:p},game:v,getDownloadCount:k,disabled:Ae,setSafariCopyLink:q,isTest:Y,urlType:x,allNetworksSelected:f,setAllNetworksSelected:L})]})},Jl="";var Bn={exports:{}},tt={},Un={exports:{}},Ee={},Fn={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
|