gearboxdownloadmodal 8.5.3 → 8.5.4
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.umd.js
CHANGED
|
@@ -84,7 +84,7 @@ doc.body (`+e+`):
|
|
|
84
84
|
`+o:"")+`
|
|
85
85
|
|
|
86
86
|
The above lifecycles should be removed. Learn more about this warning here:
|
|
87
|
-
https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof e.getDerivedStateFromProps=="function"&&(i.componentWillMount=tn,i.componentWillReceiveProps=an),typeof i.getSnapshotBeforeUpdate=="function"){if(typeof i.componentDidUpdate!="function")throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");i.componentWillUpdate=on;var n=i.componentDidUpdate;i.componentDidUpdate=function(A,q,p){var u=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:p;n.call(this,A,q,u)}}return e}const Sp=$n(Object.freeze(Object.defineProperty({__proto__:null,polyfill:Zp},Symbol.toStringTag,{value:"Module"})));Object.defineProperty(be,"__esModule",{value:!0}),be.bodyOpenClassName=be.portalClassName=void 0;var rn=Object.assign||function(e){for(var i=1;i<arguments.length;i++){var t=arguments[i];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},hp=function(){function e(i,t){for(var a=0;a<t.length;a++){var o=t[a];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(i,o.key,o)}}return function(i,t,a){return t&&e(i.prototype,t),a&&e(i,a),i}}(),sn=y,qa=ht(sn),Cp=Pn,ma=ht(Cp),yp=Bt,ai=ht(yp),gp=dp,nn=ht(gp),Vp=ne,Jp=Wp(Vp),Me=le,ln=ht(Me),kp=Sp;function Wp(e){if(e&&e.__esModule)return e;var i={};if(e!=null)for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(i[t]=e[t]);return i.default=e,i}function ht(e){return e&&e.__esModule?e:{default:e}}function Mp(e,i){if(!(e instanceof i))throw new TypeError("Cannot call a class as a function")}function An(e,i){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i&&(typeof i=="object"||typeof i=="function")?i:e}function Ep(e,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof i);e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),i&&(Object.setPrototypeOf?Object.setPrototypeOf(e,i):e.__proto__=i)}var Rp=be.portalClassName="ReactModalPortal",Up=be.bodyOpenClassName="ReactModal__Body--open",xe=Me.canUseDOM&&ma.default.createPortal!==void 0,ko=function(i){return document.createElement(i)},qn=function(){return xe?ma.default.createPortal:ma.default.unstable_renderSubtreeIntoContainer};function pa(e){return e()}var et=function(e){Ep(i,e);function i(){var t,a,o,r;Mp(this,i);for(var s=arguments.length,n=Array(s),l=0;l<s;l++)n[l]=arguments[l];return r=(a=(o=An(this,(t=i.__proto__||Object.getPrototypeOf(i)).call.apply(t,[this].concat(n))),o),o.removePortal=function(){!xe&&ma.default.unmountComponentAtNode(o.node);var A=pa(o.props.parentSelector);A&&A.contains(o.node)?A.removeChild(o.node):console.warn('React-Modal: "parentSelector" prop did not returned any DOM element. Make sure that the parent element is unmounted to avoid any memory leaks.')},o.portalRef=function(A){o.portal=A},o.renderPortal=function(A){var q=qn(),p=q(o,qa.default.createElement(nn.default,rn({defaultStyles:i.defaultStyles},A)),o.node);o.portalRef(p)},a),An(o,r)}return hp(i,[{key:"componentDidMount",value:function(){if(Me.canUseDOM){xe||(this.node=ko("div")),this.node.className=this.props.portalClassName;var a=pa(this.props.parentSelector);a.appendChild(this.node),!xe&&this.renderPortal(this.props)}}},{key:"getSnapshotBeforeUpdate",value:function(a){var o=pa(a.parentSelector),r=pa(this.props.parentSelector);return{prevParent:o,nextParent:r}}},{key:"componentDidUpdate",value:function(a,o,r){if(Me.canUseDOM){var s=this.props,n=s.isOpen,l=s.portalClassName;a.portalClassName!==l&&(this.node.className=l);var A=r.prevParent,q=r.nextParent;q!==A&&(A.removeChild(this.node),q.appendChild(this.node)),!(!a.isOpen&&!n)&&!xe&&this.renderPortal(this.props)}}},{key:"componentWillUnmount",value:function(){if(!(!Me.canUseDOM||!this.node||!this.portal)){var a=this.portal.state,o=Date.now(),r=a.isOpen&&this.props.closeTimeoutMS&&(a.closesAt||o+this.props.closeTimeoutMS);r?(a.beforeClose||this.portal.closeWithTimeout(),setTimeout(this.removePortal,r-o)):this.removePortal()}}},{key:"render",value:function(){if(!Me.canUseDOM||!xe)return null;!this.node&&xe&&(this.node=ko("div"));var a=qn();return a(qa.default.createElement(nn.default,rn({ref:this.portalRef,defaultStyles:i.defaultStyles},this.props)),this.node)}}],[{key:"setAppElement",value:function(a){Jp.setElement(a)}}]),i}(sn.Component);et.propTypes={isOpen:ai.default.bool.isRequired,style:ai.default.shape({content:ai.default.object,overlay:ai.default.object}),portalClassName:ai.default.string,bodyOpenClassName:ai.default.string,htmlOpenClassName:ai.default.string,className:ai.default.oneOfType([ai.default.string,ai.default.shape({base:ai.default.string.isRequired,afterOpen:ai.default.string.isRequired,beforeClose:ai.default.string.isRequired})]),overlayClassName:ai.default.oneOfType([ai.default.string,ai.default.shape({base:ai.default.string.isRequired,afterOpen:ai.default.string.isRequired,beforeClose:ai.default.string.isRequired})]),appElement:ai.default.oneOfType([ai.default.instanceOf(ln.default),ai.default.instanceOf(Me.SafeHTMLCollection),ai.default.instanceOf(Me.SafeNodeList),ai.default.arrayOf(ai.default.instanceOf(ln.default))]),onAfterOpen:ai.default.func,onRequestClose:ai.default.func,closeTimeoutMS:ai.default.number,ariaHideApp:ai.default.bool,shouldFocusAfterRender:ai.default.bool,shouldCloseOnOverlayClick:ai.default.bool,shouldReturnFocusAfterClose:ai.default.bool,preventScroll:ai.default.bool,parentSelector:ai.default.func,aria:ai.default.object,data:ai.default.object,role:ai.default.string,contentLabel:ai.default.string,shouldCloseOnEsc:ai.default.bool,overlayRef:ai.default.func,contentRef:ai.default.func,id:ai.default.string,overlayElement:ai.default.func,contentElement:ai.default.func},et.defaultProps={isOpen:!1,portalClassName:Rp,bodyOpenClassName:Up,role:"dialog",ariaHideApp:!0,closeTimeoutMS:0,shouldFocusAfterRender:!0,shouldCloseOnEsc:!0,shouldCloseOnOverlayClick:!0,shouldReturnFocusAfterClose:!0,preventScroll:!1,parentSelector:function(){return document.body},overlayElement:function(i,t){return qa.default.createElement("div",i,t)},contentElement:function(i,t){return qa.default.createElement("div",i,t)}},et.defaultStyles={overlay:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(255, 255, 255, 0.75)"},content:{position:"absolute",top:"40px",left:"40px",right:"40px",bottom:"40px",border:"1px solid #ccc",background:"#fff",overflow:"auto",WebkitOverflowScrolling:"touch",borderRadius:"4px",outline:"none",padding:"20px"}},(0,kp.polyfill)(et),process.env.NODE_ENV!=="production"&&(et.setCreateHTMLElement=function(e){return ko=e}),be.default=et,function(e,i){Object.defineProperty(i,"__esModule",{value:!0});var t=be,a=o(t);function o(r){return r&&r.__esModule?r:{default:r}}i.default=a.default,e.exports=i.default}(So,So.exports);var Lp=So.exports;const ua=_n(Lp);async function mn(e,i){return(await Ki.post(`${i}/getCompanyAllSubs`,{customer:e})).data}async function Yp(e,i,t,a){return(await Ki.post(a+"/updateSub",{sub:e,updates:i,product:t})).data}function pn(e){var i,t,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e))for(i=0;i<e.length;i++)e[i]&&(t=pn(e[i]))&&(a&&(a+=" "),a+=t);else for(i in e)e[i]&&(a&&(a+=" "),a+=i);return a}function Ee(){for(var e,i,t=0,a="";t<arguments.length;)(e=arguments[t++])&&(i=pn(e))&&(a&&(a+=" "),a+=i);return a}const Ct=e=>typeof e=="number"&&!isNaN(e),Oe=e=>typeof e=="string",Ti=e=>typeof e=="function",Ia=e=>Oe(e)||Ti(e)?e:null,Wo=e=>y.isValidElement(e)||Oe(e)||Ti(e)||Ct(e);function Gp(e,i,t){t===void 0&&(t=300);const{scrollHeight:a,style:o}=e;requestAnimationFrame(()=>{o.minHeight="initial",o.height=a+"px",o.transition=`all ${t}ms`,requestAnimationFrame(()=>{o.height="0",o.padding="0",o.margin="0",setTimeout(i,t)})})}function Ka(e){let{enter:i,exit:t,appendPosition:a=!1,collapse:o=!0,collapseDuration:r=300}=e;return function(s){let{children:n,position:l,preventExitTransition:A,done:q,nodeRef:p,isIn:u}=s;const I=a?`${i}--${l}`:i,c=a?`${t}--${l}`:t,Z=y.useRef(0);return y.useLayoutEffect(()=>{const K=p.current,S=I.split(" "),W=U=>{U.target===p.current&&(K.dispatchEvent(new Event("d")),K.removeEventListener("animationend",W),K.removeEventListener("animationcancel",W),Z.current===0&&U.type!=="animationcancel"&&K.classList.remove(...S))};K.classList.add(...S),K.addEventListener("animationend",W),K.addEventListener("animationcancel",W)},[]),y.useEffect(()=>{const K=p.current,S=()=>{K.removeEventListener("animationend",S),o?Gp(K,q,r):q()};u||(A?S():(Z.current=1,K.className+=` ${c}`,K.addEventListener("animationend",S)))},[u]),y.createElement(y.Fragment,null,n)}}function un(e,i){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:i}:{}}const Pi={list:new Map,emitQueue:new Map,on(e,i){return this.list.has(e)||this.list.set(e,[]),this.list.get(e).push(i),this},off(e,i){if(i){const t=this.list.get(e).filter(a=>a!==i);return this.list.set(e,t),this}return this.list.delete(e),this},cancelEmit(e){const i=this.emitQueue.get(e);return i&&(i.forEach(clearTimeout),this.emitQueue.delete(e)),this},emit(e){this.list.has(e)&&this.list.get(e).forEach(i=>{const t=setTimeout(()=>{i(...[].slice.call(arguments,1))},0);this.emitQueue.has(e)||this.emitQueue.set(e,[]),this.emitQueue.get(e).push(t)})}},ca=e=>{let{theme:i,type:t,...a}=e;return y.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:i==="colored"?"currentColor":`var(--toastify-icon-color-${t})`,...a})},Mo={info:function(e){return y.createElement(ca,{...e},y.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 y.createElement(ca,{...e},y.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 y.createElement(ca,{...e},y.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 y.createElement(ca,{...e},y.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 y.createElement("div",{className:"Toastify__spinner"})}};function bp(e){const[,i]=y.useReducer(I=>I+1,0),[t,a]=y.useState([]),o=y.useRef(null),r=y.useRef(new Map).current,s=I=>t.indexOf(I)!==-1,n=y.useRef({toastKey:1,displayedToast:0,count:0,queue:[],props:e,containerId:null,isToastActive:s,getToast:I=>r.get(I)}).current;function l(I){let{containerId:c}=I;const{limit:Z}=n.props;!Z||c&&n.containerId!==c||(n.count-=n.queue.length,n.queue=[])}function A(I){a(c=>I==null?[]:c.filter(Z=>Z!==I))}function q(){const{toastContent:I,toastProps:c,staleId:Z}=n.queue.shift();u(I,c,Z)}function p(I,c){let{delay:Z,staleId:K,...S}=c;if(!Wo(I)||function(H){return!o.current||n.props.enableMultiContainer&&H.containerId!==n.props.containerId||r.has(H.toastId)&&H.updateId==null}(S))return;const{toastId:W,updateId:U,data:k}=S,{props:h}=n,b=()=>A(W),F=U==null;F&&n.count++;const N={...h,style:h.toastStyle,key:n.toastKey++,...Object.fromEntries(Object.entries(S).filter(H=>{let[f,g]=H;return g!=null})),toastId:W,updateId:U,data:k,closeToast:b,isIn:!1,className:Ia(S.className||h.toastClassName),bodyClassName:Ia(S.bodyClassName||h.bodyClassName),progressClassName:Ia(S.progressClassName||h.progressClassName),autoClose:!S.isLoading&&(v=S.autoClose,_=h.autoClose,v===!1||Ct(v)&&v>0?v:_),deleteToast(){const H=un(r.get(W),"removed");r.delete(W),Pi.emit(4,H);const f=n.queue.length;if(n.count=W==null?n.count-n.displayedToast:n.count-1,n.count<0&&(n.count=0),f>0){const g=W==null?n.props.limit:1;if(f===1||g===1)n.displayedToast++,q();else{const L=g>f?f:g;n.displayedToast=L;for(let Y=0;Y<L;Y++)q()}}else i()}};var v,_;N.iconOut=function(H){let{theme:f,type:g,isLoading:L,icon:Y}=H,C=null;const M={theme:f,type:g};return Y===!1||(Ti(Y)?C=Y(M):y.isValidElement(Y)?C=y.cloneElement(Y,M):Oe(Y)||Ct(Y)?C=Y:L?C=Mo.spinner():(D=>D in Mo)(g)&&(C=Mo[g](M))),C}(N),Ti(S.onOpen)&&(N.onOpen=S.onOpen),Ti(S.onClose)&&(N.onClose=S.onClose),N.closeButton=h.closeButton,S.closeButton===!1||Wo(S.closeButton)?N.closeButton=S.closeButton:S.closeButton===!0&&(N.closeButton=!Wo(h.closeButton)||h.closeButton);let X=I;y.isValidElement(I)&&!Oe(I.type)?X=y.cloneElement(I,{closeToast:b,toastProps:N,data:k}):Ti(I)&&(X=I({closeToast:b,toastProps:N,data:k})),h.limit&&h.limit>0&&n.count>h.limit&&F?n.queue.push({toastContent:X,toastProps:N,staleId:K}):Ct(Z)?setTimeout(()=>{u(X,N,K)},Z):u(X,N,K)}function u(I,c,Z){const{toastId:K}=c;Z&&r.delete(Z);const S={content:I,props:c};r.set(K,S),a(W=>[...W,K].filter(U=>U!==Z)),Pi.emit(4,un(S,S.props.updateId==null?"added":"updated"))}return y.useEffect(()=>(n.containerId=e.containerId,Pi.cancelEmit(3).on(0,p).on(1,I=>o.current&&A(I)).on(5,l).emit(2,n),()=>{r.clear(),Pi.emit(3,n)}),[]),y.useEffect(()=>{n.props=e,n.isToastActive=s,n.displayedToast=t.length}),{getToastToRender:function(I){const c=new Map,Z=Array.from(r.values());return e.newestOnTop&&Z.reverse(),Z.forEach(K=>{const{position:S}=K.props;c.has(S)||c.set(S,[]),c.get(S).push(K)}),Array.from(c,K=>I(K[0],K[1]))},containerRef:o,isToastActive:s}}function In(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientX:e.clientX}function Kn(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientY:e.clientY}function Qp(e){const[i,t]=y.useState(!1),[a,o]=y.useState(!1),r=y.useRef(null),s=y.useRef({start:0,x:0,y:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,boundingRect:null,didMove:!1}).current,n=y.useRef(e),{autoClose:l,pauseOnHover:A,closeToast:q,onClick:p,closeOnClick:u}=e;function I(k){if(e.draggable){k.nativeEvent.type==="touchstart"&&k.nativeEvent.preventDefault(),s.didMove=!1,document.addEventListener("mousemove",S),document.addEventListener("mouseup",W),document.addEventListener("touchmove",S),document.addEventListener("touchend",W);const h=r.current;s.canCloseOnClick=!0,s.canDrag=!0,s.boundingRect=h.getBoundingClientRect(),h.style.transition="",s.x=In(k.nativeEvent),s.y=Kn(k.nativeEvent),e.draggableDirection==="x"?(s.start=s.x,s.removalDistance=h.offsetWidth*(e.draggablePercent/100)):(s.start=s.y,s.removalDistance=h.offsetHeight*(e.draggablePercent===80?1.5*e.draggablePercent:e.draggablePercent/100))}}function c(k){if(s.boundingRect){const{top:h,bottom:b,left:F,right:N}=s.boundingRect;k.nativeEvent.type!=="touchend"&&e.pauseOnHover&&s.x>=F&&s.x<=N&&s.y>=h&&s.y<=b?K():Z()}}function Z(){t(!0)}function K(){t(!1)}function S(k){const h=r.current;s.canDrag&&h&&(s.didMove=!0,i&&K(),s.x=In(k),s.y=Kn(k),s.delta=e.draggableDirection==="x"?s.x-s.start:s.y-s.start,s.start!==s.x&&(s.canCloseOnClick=!1),h.style.transform=`translate${e.draggableDirection}(${s.delta}px)`,h.style.opacity=""+(1-Math.abs(s.delta/s.removalDistance)))}function W(){document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",W),document.removeEventListener("touchmove",S),document.removeEventListener("touchend",W);const k=r.current;if(s.canDrag&&s.didMove&&k){if(s.canDrag=!1,Math.abs(s.delta)>s.removalDistance)return o(!0),void e.closeToast();k.style.transition="transform 0.2s, opacity 0.2s",k.style.transform=`translate${e.draggableDirection}(0)`,k.style.opacity="1"}}y.useEffect(()=>{n.current=e}),y.useEffect(()=>(r.current&&r.current.addEventListener("d",Z,{once:!0}),Ti(e.onOpen)&&e.onOpen(y.isValidElement(e.children)&&e.children.props),()=>{const k=n.current;Ti(k.onClose)&&k.onClose(y.isValidElement(k.children)&&k.children.props)}),[]),y.useEffect(()=>(e.pauseOnFocusLoss&&(document.hasFocus()||K(),window.addEventListener("focus",Z),window.addEventListener("blur",K)),()=>{e.pauseOnFocusLoss&&(window.removeEventListener("focus",Z),window.removeEventListener("blur",K))}),[e.pauseOnFocusLoss]);const U={onMouseDown:I,onTouchStart:I,onMouseUp:c,onTouchEnd:c};return l&&A&&(U.onMouseEnter=K,U.onMouseLeave=Z),u&&(U.onClick=k=>{p&&p(k),s.canCloseOnClick&&q()}),{playToast:Z,pauseToast:K,isRunning:i,preventExitTransition:a,toastRef:r,eventHandlers:U}}function cn(e){let{closeToast:i,theme:t,ariaLabel:a="close"}=e;return y.createElement("button",{className:`Toastify__close-button Toastify__close-button--${t}`,type:"button",onClick:o=>{o.stopPropagation(),i(o)},"aria-label":a},y.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},y.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 jp(e){let{delay:i,isRunning:t,closeToast:a,type:o="default",hide:r,className:s,style:n,controlledProgress:l,progress:A,rtl:q,isIn:p,theme:u}=e;const I=r||l&&A===0,c={...n,animationDuration:`${i}ms`,animationPlayState:t?"running":"paused",opacity:I?0:1};l&&(c.transform=`scaleX(${A})`);const Z=Ee("Toastify__progress-bar",l?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${u}`,`Toastify__progress-bar--${o}`,{"Toastify__progress-bar--rtl":q}),K=Ti(s)?s({rtl:q,type:o,defaultClassName:Z}):Ee(Z,s);return y.createElement("div",{role:"progressbar","aria-hidden":I?"true":"false","aria-label":"notification timer",className:K,style:c,[l&&A>=1?"onTransitionEnd":"onAnimationEnd"]:l&&A<1?null:()=>{p&&a()}})}const Fp=e=>{const{isRunning:i,preventExitTransition:t,toastRef:a,eventHandlers:o}=Qp(e),{closeButton:r,children:s,autoClose:n,onClick:l,type:A,hideProgressBar:q,closeToast:p,transition:u,position:I,className:c,style:Z,bodyClassName:K,bodyStyle:S,progressClassName:W,progressStyle:U,updateId:k,role:h,progress:b,rtl:F,toastId:N,deleteToast:v,isIn:_,isLoading:X,iconOut:H,closeOnClick:f,theme:g}=e,L=Ee("Toastify__toast",`Toastify__toast-theme--${g}`,`Toastify__toast--${A}`,{"Toastify__toast--rtl":F},{"Toastify__toast--close-on-click":f}),Y=Ti(c)?c({rtl:F,position:I,type:A,defaultClassName:L}):Ee(L,c),C=!!b||!n,M={closeToast:p,type:A,theme:g};let D=null;return r===!1||(D=Ti(r)?r(M):y.isValidElement(r)?y.cloneElement(r,M):cn(M)),y.createElement(u,{isIn:_,done:v,position:I,preventExitTransition:t,nodeRef:a},y.createElement("div",{id:N,onClick:l,className:Y,...o,style:Z,ref:a},y.createElement("div",{..._&&{role:h},className:Ti(K)?K({type:A}):Ee("Toastify__toast-body",K),style:S},H!=null&&y.createElement("div",{className:Ee("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!X})},H),y.createElement("div",null,s)),D,y.createElement(jp,{...k&&!C?{key:`pb-${k}`}:{},rtl:F,theme:g,delay:n,isRunning:i,isIn:_,closeToast:p,hide:q,type:A,style:U,className:W,controlledProgress:C,progress:b||0})))},da=function(e,i){return i===void 0&&(i=!1),{enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:i}},Np=Ka(da("bounce",!0));Ka(da("slide",!0)),Ka(da("zoom")),Ka(da("flip"));const Eo=y.forwardRef((e,i)=>{const{getToastToRender:t,containerRef:a,isToastActive:o}=bp(e),{className:r,style:s,rtl:n,containerId:l}=e;function A(q){const p=Ee("Toastify__toast-container",`Toastify__toast-container--${q}`,{"Toastify__toast-container--rtl":n});return Ti(r)?r({position:q,rtl:n,defaultClassName:p}):Ee(p,Ia(r))}return y.useEffect(()=>{i&&(i.current=a.current)},[]),y.createElement("div",{ref:a,className:"Toastify",id:l},t((q,p)=>{const u=p.length?{...s}:{...s,pointerEvents:"none"};return y.createElement("div",{className:A(q),style:u,key:`container-${q}`},p.map((I,c)=>{let{content:Z,props:K}=I;return y.createElement(Fp,{...K,isIn:o(K.toastId),style:{...K.style,"--nth":c+1,"--len":p.length},key:`toast-${K.key}`},Z)}))}))});Eo.displayName="ToastContainer",Eo.defaultProps={position:"top-right",transition:Np,autoClose:5e3,closeButton:cn,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,draggable:!0,draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};let Ro,ze=new Map,yt=[],xp=1;function dn(){return""+xp++}function Op(e){return e&&(Oe(e.toastId)||Ct(e.toastId))?e.toastId:dn()}function gt(e,i){return ze.size>0?Pi.emit(0,e,i):yt.push({content:e,options:i}),i.toastId}function Za(e,i){return{...i,type:i&&i.type||e,toastId:Op(i)}}function Sa(e){return(i,t)=>gt(i,Za(e,t))}function hi(e,i){return gt(e,Za("default",i))}hi.loading=(e,i)=>gt(e,Za("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...i})),hi.promise=function(e,i,t){let a,{pending:o,error:r,success:s}=i;o&&(a=Oe(o)?hi.loading(o,t):hi.loading(o.render,{...t,...o}));const n={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},l=(q,p,u)=>{if(p==null)return void hi.dismiss(a);const I={type:q,...n,...t,data:u},c=Oe(p)?{render:p}:p;return a?hi.update(a,{...I,...c}):hi(c.render,{...I,...c}),u},A=Ti(e)?e():e;return A.then(q=>l("success",s,q)).catch(q=>l("error",r,q)),A},hi.success=Sa("success"),hi.info=Sa("info"),hi.error=Sa("error"),hi.warning=Sa("warning"),hi.warn=hi.warning,hi.dark=(e,i)=>gt(e,Za("default",{theme:"dark",...i})),hi.dismiss=e=>{ze.size>0?Pi.emit(1,e):yt=yt.filter(i=>e!=null&&i.options.toastId!==e)},hi.clearWaitingQueue=function(e){return e===void 0&&(e={}),Pi.emit(5,e)},hi.isActive=e=>{let i=!1;return ze.forEach(t=>{t.isToastActive&&t.isToastActive(e)&&(i=!0)}),i},hi.update=function(e,i){i===void 0&&(i={}),setTimeout(()=>{const t=function(a,o){let{containerId:r}=o;const s=ze.get(r||Ro);return s&&s.getToast(a)}(e,i);if(t){const{props:a,content:o}=t,r={delay:100,...a,...i,toastId:i.toastId||e,updateId:dn()};r.toastId!==e&&(r.staleId=e);const s=r.render||o;delete r.render,gt(s,r)}},0)},hi.done=e=>{hi.update(e,{progress:1})},hi.onChange=e=>(Pi.on(4,e),()=>{Pi.off(4,e)}),hi.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"},hi.TYPE={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},Pi.on(2,e=>{Ro=e.containerId||e,ze.set(Ro,e),yt.forEach(i=>{Pi.emit(0,i.content,i.options)}),yt=[]}).on(3,e=>{ze.delete(e.containerId||e),ze.size===0&&Pi.off(0).off(1).off(5)});function ha(e){hi.error(e,{position:"top-center",autoClose:650,hideProgressBar:!0,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0,theme:"light"})}function Zn(e){hi.success(e,{position:"top-center",autoClose:650,hideProgressBar:!0,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0,theme:"light"})}async function Sn(e,i,t){return(await Ki.post(e+"/getNetworks",{typeOfProduct:i,versionId:t})).data}async function zp(e){return(await Ki.post(e+"/getNetworks",{allNetworks:!0})).data}const Uo="#f97316",hn="#ea580c",Lo="#AD1BFF",Cn="#9200e7",Yo="#2563eb",yn="#0031FF";var qi=(e=>(e[e.Flex=Lo]="Flex",e[e.Playable=Uo]="Playable",e.Import="#00a3ff",e[e.Ready=Yo]="Ready",e.Fusion="#171717",e))(qi||{}),Vt=(e=>(e[e.Flex=Cn]="Flex",e[e.Ready=yn]="Ready",e[e.Playable=hn]="Playable",e.Import="#0082CC",e.Fusion="#0A0A0A",e))(Vt||{}),Tp=(e=>(e[e.Flex=`bg-[${Lo}]`]="Flex",e[e.Playable=`bg-[${Uo}]`]="Playable",e.Import="bg-[#00a3ff]",e[e.Ready=`bg-[${Yo}]`]="Ready",e.Fusion="bg-[#171717]",e))(Tp||{}),gn=(e=>(e.Fusion="linear-gradient(to right, #651FFF, #5018CC)",e[e.Ready=`linear-gradient(to right, ${Yo}, ${yn})`]="Ready",e[e.Playable=`linear-gradient(to right, ${Uo}, ${hn})`]="Playable",e[e.Flex=`linear-gradient(to right, ${Lo}, ${Cn})`]="Flex",e))(gn||{});const wp={applovin:"Mobile marketing platform for user acquisition",unity:"Unity Ads monetization platform",mobvista:"AI-powered mobile advertising platform",ironsource:"Mobile monetization and marketing platform",moloco:"Machine learning-powered performance marketing",vungle:"In-app video ad platform",facebook:"Facebook Audience Network",google:"Google Ads platform",liftoff:"Mobile app marketing and retargeting",tencent:"Tencent advertising platform",aarki:"Mobile advertising platform",adform:"Digital advertising platform"},Bp=({visible:e,onClose:i,api:t,user:a,typeOfProduct:o,versionId:r,customerId:s})=>{const[n,l]=y.useState([]),[A,q]=y.useState([]),[p,u]=y.useState(!1),[I,c]=y.useState(!1),[Z,K]=y.useState(null),[S,W]=ji(na),U=()=>qi[o]||qi.Playable,k=()=>Vt[o]||"red",h=()=>({Ready:"#E0F2FE",Playable:"#FFF7ED",Import:"#E0F2FE",Flex:"#F3E8FF",Fusion:"#F5F5F5"})[o]||"#FFF7ED",b=U(),F=k(),N=h();y.useEffect(()=>{e&&v()},[e]);const v=async()=>{u(!0);try{const g=await mn(s,t);let L=[];o==="Playable"?L=g.playableSubs||[]:o==="Ready"?L=g.readySubs||[]:o==="Flex"&&(L=g.flexSubs||[]);const Y=L.find(C=>C.isActive&&new Date(C.endsAt)>new Date);if(Y){K(Y),l(Array.isArray(Y.networks)?Y.networks:[]);const M=(await zp(t)).filter(D=>D.name!=="web"&&D.name!=="cdn"&&D.name!=="default").map(D=>({id:D.id,name:D.name,imageSrc:D.imageSrc,description:wp[D.name]||""}));q(M)}}catch(g){console.error("Error fetching subscription data:",g),ha("Failed to load subscription data")}finally{u(!1)}},_=g=>{l(L=>L.includes(g)?L.filter(Y=>Y!==g):[...L,g])},X=()=>{l(A.map(g=>g.id))},H=()=>{l([])},f=async()=>{if(!Z){ha("No active subscription found");return}c(!0);try{let g="playable";o==="Ready"?g="ready":o==="Flex"&&(g="flex"),await Yp(Z,{downloadLimit:Z.downloadLimit,seatLimit:Z.seatLimit,endsAt:Z.endsAt,isUnlimited:Z.isUnlimited,packageId:Z.packageId,networks:n},g,t);const L=await Sn(t,o,r);if(L){const Y=L.map(C=>(C.name=C.id,C));W(Y)}Zn("Networks updated successfully"),i()}catch(g){console.error("Error updating networks:",g),ha("Failed to update networks")}finally{c(!1)}};return m.jsx(ua,{isOpen:e,ariaHideApp:!1,onRequestClose:i,style:{content:{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",borderRadius:"0.75rem",backgroundColor:"white",zIndex:60,height:"600px",width:"900px",maxWidth:"95vw",maxHeight:"95vh",overflow:"hidden",padding:"0"},overlay:{position:"fixed",backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:60,top:0,left:0,right:0,bottom:0}},contentLabel:"Edit Visible Networks Modal",shouldCloseOnOverlayClick:!0,children:m.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%"},children:[m.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"1.5rem",borderBottom:"1px solid #E5E7EB"},children:[m.jsx("h2",{style:{fontSize:"1.5rem",fontWeight:"600",color:"#111827",margin:0},children:"Edit Visible Networks"}),m.jsx("button",{onClick:i,style:{padding:"0.5rem",borderRadius:"9999px",border:"none",backgroundColor:"transparent",cursor:"pointer",transition:"background-color 0.2s"},onMouseEnter:g=>{g.currentTarget.style.backgroundColor="#F3F4F6"},onMouseLeave:g=>{g.currentTarget.style.backgroundColor="transparent"},children:m.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[m.jsx("path",{d:"M18 6 6 18"}),m.jsx("path",{d:"m6 6 12 12"})]})})]}),m.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"1.5rem",borderBottom:"1px solid #E5E7EB"},children:[m.jsxs("div",{style:{display:"flex",gap:"1rem"},children:[m.jsx("button",{onClick:X,style:{padding:"0.5rem 1rem",backgroundColor:N,border:"none",borderRadius:"0.5rem",fontSize:"0.875rem",fontWeight:"500",color:b,cursor:"pointer",transition:"background-color 0.2s"},children:"Select All"}),m.jsx("button",{onClick:H,style:{padding:"0.5rem 1rem",backgroundColor:"transparent",border:"none",borderRadius:"0.5rem",fontSize:"0.875rem",fontWeight:"500",color:"#6B7280",cursor:"pointer",transition:"background-color 0.2s"},onMouseEnter:g=>{g.currentTarget.style.backgroundColor="#F3F4F6"},onMouseLeave:g=>{g.currentTarget.style.backgroundColor="transparent"},children:"Select None"})]}),m.jsxs("div",{style:{fontSize:"0.875rem",color:"#6B7280"},children:[n.length," of ",A.length," selected"]})]}),m.jsx("div",{style:{flex:1,overflowY:"auto",padding:"1.5rem"},children:p?m.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"},children:m.jsx("div",{children:"Loading..."})}):m.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:"1rem"},children:[A.length===0&&m.jsx("div",{style:{gridColumn:"1 / -1",textAlign:"center",color:"#6B7280",fontSize:"0.875rem"},children:"No subscription for customer, add in networks from the admin panel."}),A.map(g=>{const L=n.includes(g.id);return m.jsxs("div",{onClick:()=>_(g.id),style:{position:"relative",display:"flex",flexDirection:"column",gap:"0.75rem",padding:"1.5rem",border:`2px solid ${L?b:"#E5E7EB"}`,borderRadius:"0.75rem",backgroundColor:L?N:"white",cursor:"pointer",transition:"all 0.2s"},children:[m.jsx("div",{style:{position:"absolute",top:"1rem",right:"1rem",width:"1.5rem",height:"1.5rem",borderRadius:"9999px",backgroundColor:L?b:"white",border:`2px solid ${L?b:"#D1D5DB"}`,display:"flex",alignItems:"center",justifyContent:"center"},children:L&&m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:m.jsx("path",{d:"M20 6 9 17l-5-5"})})}),m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"1rem"},children:[m.jsx("img",{src:g.imageSrc,alt:g.name,style:{width:"60px",height:"40px",objectFit:"contain"}}),m.jsxs("div",{children:[m.jsx("h3",{style:{fontSize:"1rem",fontWeight:"600",color:"#111827",margin:0,textTransform:"capitalize"},children:g.name==="mobvista"?"Mintegral":g.name}),g.description&&m.jsx("p",{style:{fontSize:"0.75rem",color:"#6B7280",margin:"0.25rem 0 0 0"},children:g.description})]})]})]},g.id)})]})}),m.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"0.75rem",padding:"1.5rem",borderTop:"1px solid #E5E7EB"},children:[m.jsx("button",{onClick:i,style:{padding:"0.5rem 1.5rem",backgroundColor:"white",border:"1px solid #D1D5DB",borderRadius:"0.5rem",fontSize:"0.875rem",fontWeight:"500",color:"#374151",cursor:"pointer",transition:"background-color 0.2s"},onMouseEnter:g=>{g.currentTarget.style.backgroundColor="#F9FAFB"},onMouseLeave:g=>{g.currentTarget.style.backgroundColor="white"},children:"Cancel"}),m.jsx("button",{onClick:f,disabled:I,style:{padding:"0.5rem 1.5rem",backgroundColor:I?"#D1D5DB":b,border:"none",borderRadius:"0.5rem",fontSize:"0.875rem",fontWeight:"500",color:"white",cursor:I?"not-allowed":"pointer",transition:"background-color 0.2s"},onMouseEnter:g=>{I||(g.currentTarget.style.backgroundColor=F)},onMouseLeave:g=>{I||(g.currentTarget.style.backgroundColor=b)},children:I?"Saving...":"Save Changes"})]})]})})},Dp=({typeOfProduct:e,allNetworksSelected:i,setAllNetworksSelected:t,api:a,user:o,versionId:r,customerId:s})=>{const[n,l]=y.useState(!1),[A,q]=y.useState(!1);return y.useEffect(()=>{(async()=>{try{const u=await mn(s,a);let I=[];e==="Playable"?I=u.playableSubs||[]:e==="Ready"?I=u.readySubs||[]:e==="Flex"&&(I=u.flexSubs||[]),q(I.length>0)}catch(u){console.error("Error checking subscriptions:",u),q(!1)}})()},[e,s,a]),m.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",marginBottom:"0",marginTop:"0",paddingRight:"1rem"},children:[m.jsx("h3",{style:{fontSize:"1rem",fontWeight:"600",color:"#111827",margin:0},children:"Ad Networks"}),m.jsxs("div",{style:{display:"flex",gap:"0.5rem",alignItems:"center"},children:[A&&["pm","admin"].includes(o.role)&&m.jsxs("button",{onClick:()=>l(!0),style:{display:"flex",alignItems:"center",gap:"0.375rem",paddingLeft:"0.75rem",paddingRight:"0.75rem",paddingTop:"0.375rem",paddingBottom:"0.375rem",backgroundColor:"#F3F4F6",border:"none",borderRadius:"0.5rem",fontSize:"0.75rem",fontWeight:"500",color:"#374151",cursor:"pointer",transition:"background-color 0.2s ease"},onMouseEnter:p=>{p.currentTarget.style.backgroundColor="#E5E7EB"},onMouseLeave:p=>{p.currentTarget.style.backgroundColor="#F3F4F6"},children:[m.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[m.jsx("path",{d:"M12 20h9"}),m.jsx("path",{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"})]}),"Edit Networks"]}),m.jsxs("button",{onClick:()=>t(!i),style:{display:"flex",alignItems:"center",gap:"0.375rem",paddingLeft:"0.75rem",paddingRight:"0.75rem",paddingTop:"0.375rem",paddingBottom:"0.375rem",backgroundColor:"#F3F4F6",border:"none",borderRadius:"0.5rem",fontSize:"0.75rem",fontWeight:"500",color:"#374151",cursor:"pointer",transition:"background-color 0.2s ease"},onMouseEnter:p=>{p.currentTarget.style.backgroundColor="#E5E7EB"},onMouseLeave:p=>{p.currentTarget.style.backgroundColor="#F3F4F6"},children:[m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:i?m.jsxs(m.Fragment,{children:[m.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),m.jsx("path",{d:"M9 13l2 2 4-6"})]}):m.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"})}),i?"Deselect All":"Select All"]})]}),["pm","admin"].includes(o.role)&&m.jsx(Bp,{visible:n,onClose:()=>l(!1),api:a,user:o,typeOfProduct:e,versionId:r,customerId:s})]})};async function Xp(e,i){return(await Ki.post(i+"/buyRequest",{requestType:e})).data}const fp=()=>m.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[m.jsxs("g",{"clip-path":"url(#clip0_518_12094)",children:[m.jsx("path",{d:"M4.50977 11.99L19.4898 11.99",stroke:"#7101FF","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),m.jsx("path",{d:"M13.5068 17.977L19.4828 12L13.5068 6.02299",stroke:"#7101FF","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"clip0_518_12094",children:m.jsx("rect",{width:"24",height:"24",fill:"white",transform:"translate(0 24) rotate(-90)"})})})]}),vp=({creditDownload:e,api:i})=>m.jsxs(m.Fragment,{children:[m.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."}),m.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"," ",m.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.",m.jsxs("button",{style:{marginLeft:"0.5rem",display:"flex",alignItems:"center",fontSize:"12px",fontWeight:"bold",textDecoration:"underline",color:"#yourColorHere"},onClick:()=>Xp("Flex Credit",i).then(t=>Zn("You will be contacted regarding your request.")),children:["Get more",m.jsx(fp,{})]})]})]}),Hp=({typeOfProduct:e,urls:i,handleIosChange:t,handleGoogleChange:a,disabled:o})=>{const r=q=>{t(q.target.value)},s=q=>{a(q.target.value)},[n,l]=ji(dt);let A=o;return e==="Playable"&&!o&&!n&&(A=!0),m.jsxs(m.Fragment,{children:[e==="Playable"&&m.jsxs("div",{style:{display:"none",height:"2rem",width:"100%",alignItems:"center",fontSize:"12px",fontWeight:"200"},children:[m.jsx("span",{style:{width:"6.5rem",fontWeight:"bold",flexShrink:0},children:"Use Custom Url"}),m.jsx("input",{type:"checkbox",checked:n,onChange:q=>l(q.target.checked)})]}),m.jsxs("div",{style:{display:"flex",flexDirection:"column",width:"100%",marginBottom:"0.75rem",paddingRight:"1rem"},children:[m.jsx("label",{style:{fontSize:"0.75rem",fontWeight:"500",color:"#374151",marginBottom:"0.25rem"},children:"App Store Link"}),m.jsx("input",{style:{display:"flex",height:"1.75rem",width:"100%",alignItems:"center",borderRadius:"0.5rem",border:"1px solid #D1D5DB",paddingLeft:"0.625rem",paddingRight:"0.625rem",fontSize:"0.75rem",color:"#000000",outline:"none",transition:"all 0.2s ease"},type:"text",value:i.iosUrl,onChange:r,placeholder:"https://apps.apple.com/app/...",disabled:A,onFocus:q=>{q.currentTarget.style.borderColor="#3B82F6",q.currentTarget.style.boxShadow="0 0 0 3px rgba(59, 130, 246, 0.1)"},onBlur:q=>{q.currentTarget.style.borderColor="#D1D5DB",q.currentTarget.style.boxShadow="none"}})]}),m.jsxs("div",{style:{display:"flex",flexDirection:"column",width:"100%",marginBottom:"0.75rem",paddingRight:"1rem"},children:[m.jsx("label",{style:{fontSize:"0.75rem",fontWeight:"500",color:"#374151",marginBottom:"0.25rem"},children:"Google Play Link"}),m.jsx("input",{style:{display:"flex",height:"1.75rem",width:"100%",alignItems:"center",borderRadius:"0.5rem",border:"1px solid #D1D5DB",paddingLeft:"0.625rem",paddingRight:"0.625rem",fontSize:"0.75rem",color:"#000000",outline:"none",transition:"all 0.2s ease"},type:"text",value:i.googleUrl,onChange:s,placeholder:"https://play.google.com/store/apps/details?id=...",disabled:A,onFocus:q=>{q.currentTarget.style.borderColor="#3B82F6",q.currentTarget.style.boxShadow="0 0 0 3px rgba(59, 130, 246, 0.1)"},onBlur:q=>{q.currentTarget.style.borderColor="#D1D5DB",q.currentTarget.style.boxShadow="none"}})]})]})},Pp=({typeOfProduct:e,fileSize:i,urls:t,handleIosChange:a,handleGoogleChange:o,disabled:r,api:s,creditDownload:n,user:l,isTest:A,setIsTest:q,urlType:p,setUrlType:u})=>m.jsx(m.Fragment,{children:e!=="Import"&&m.jsxs("div",{style:{display:"flex",width:"100%",flexDirection:"column"},children:[m.jsx(Hp,{typeOfProduct:e,urls:t,handleIosChange:a,handleGoogleChange:o,disabled:r}),(n==null?void 0:n.willSpendCredit)&&m.jsx(vp,{creditDownload:n,api:s})]})}),_p=({typeOfProduct:e,title:i,fileSize:t})=>{const a=gn[e],o=e!=="Flex";return m.jsxs("div",{children:[m.jsx("h2",{className:"text-xl font-bold",style:{backgroundImage:a,WebkitBackgroundClip:"text",backgroundClip:"text",WebkitTextFillColor:"transparent",marginBottom:o?"0.75rem":"0.25rem",marginTop:"2.5rem",lineHeight:"1.2",margin:0},children:i}),t?m.jsxs("p",{style:{fontSize:"0.75rem",fontWeight:"400",color:"#6B7280",marginTop:"0.25rem",marginBottom:0},children:["File size: ",parseFloat(t).toFixed(2)," MB"]}):null]})},$p=({typeOfProduct:e,fileSize:i,urls:t,title:a,handleIosChange:o,handleGoogleChange:r,disabled:s,creditDownload:n,api:l,user:A,isTest:q,setIsTest:p,urlType:u,setUrlType:I,allNetworksSelected:c,setAllNetworksSelected:Z,versionId:K,customerId:S})=>m.jsxs("div",{style:{display:"flex",flexDirection:"column",width:"100%",justifyContent:"space-between",alignItems:"flex-start",paddingLeft:"1.25rem",paddingRight:"1.25rem",paddingTop:"1.5rem",paddingBottom:"0.75rem",gap:"0.5rem"},children:[m.jsx(_p,{typeOfProduct:e,title:a,fileSize:i}),m.jsx(Pp,{typeOfProduct:e,fileSize:i,urls:t,handleIosChange:o,handleGoogleChange:r,disabled:s,creditDownload:n,api:l,user:A,isTest:q,setIsTest:p,urlType:u,setUrlType:I}),m.jsx(Dp,{typeOfProduct:e,allNetworksSelected:c,setAllNetworksSelected:Z,api:l,user:A,versionId:K,customerId:S})]}),Go=({children:e,className:i,onClickDonwload:t,downloading:a,disabled:o,variant:r="primary",typeOfProduct:s,isCopied:n=!1})=>{const l=r==="primary",A=()=>l?s&&qi[s]?qi[s]:"red":"#E5E7EB",q=()=>l?s&&Vt[s]?Vt[s]:"red":"#D1D5DB",p=()=>"none",u=n?"#16A34A":A(),I=n?"#15803D":q();return m.jsx("button",{onClick:t,className:i,style:{display:"flex",height:"30px",alignItems:"center",justifyContent:"center",borderRadius:"0.5rem",border:"none",padding:l?"0.25rem 0.5rem":"0.25rem",fontSize:"0.75rem",fontWeight:"500",width:l?"auto":"26px",minWidth:l?"90px":"26px",flex:l?1:"0 0 auto",backgroundColor:u,color:l||n?"#FFFFFF":"#374151",cursor:o||a||n?"not-allowed":"pointer",opacity:o||a?.6:1,transition:"all 0.2s ease",boxShadow:p()},disabled:a||o,onMouseEnter:c=>{!o&&!a&&!n&&(c.currentTarget.style.backgroundColor=I)},onMouseLeave:c=>{!o&&!a&&(c.currentTarget.style.backgroundColor=u)},children:n?m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:m.jsx("polyline",{points:"20 6 9 17 4 12"})}):e})},iu=({checked:e,typeOfProduct:i,id:t})=>{const[a,o]=y.useState(e),r=qi[i];y.useEffect(()=>{o(e)},[e]);const s=()=>{o(!a)};return m.jsx("div",{style:{display:"inline-flex",alignItems:"center"},children:m.jsxs("label",{onClick:s,style:{position:"relative",display:"flex",cursor:"pointer",alignItems:"center"},htmlFor:t,children:[m.jsx("input",{type:"checkbox",style:{position:"relative",height:"20px",width:"20px",cursor:"pointer",appearance:"none",borderRadius:"0.25rem",transition:"all 200ms ease-in-out",border:a?"none":"1px solid lightgray",backgroundColor:a?r:"transparent",opacity:1},id:t,checked:a,onChange:s}),m.jsxs("div",{style:{pointerEvents:"none",position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:"white",opacity:a?1:0,transition:"opacity ease-in-out"},children:[m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",style:{height:"14px",width:"14px"},viewBox:"0 0 20 20",fill:"white",stroke:"white",strokeWidth:"1",children:m.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"})})," "]})]})})},JK="",eu=({typeOfProduct:e})=>m.jsx("div",{style:{backgroundColor:"transparent",display:"flex",alignItems:"center",flexDirection:"column"},children:m.jsxs("div",{style:{position:"relative",width:"64px",height:"16px",marginTop:"8px"},children:[m.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:qi[e]}}),m.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:qi[e]}}),m.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:qi[e]}}),m.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:qi[e]}})]})}),Jt=({isNetworksLoading:e=!1,isLight:i=!0})=>m.jsx("div",{style:{display:"flex",height:"100%",width:"90px",alignItems:"center",justifyContent:"center"},children:m.jsx("img",{width:e?"100px":"25px",height:e?"100px":"25px",src:i?We:Xe,alt:"pf-logo-gif"})}),bo=({title:e,titleId:i,...t})=>m.jsxs("svg",{viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em","aria-labelledby":i,...t,children:[e?m.jsx("title",{id:i,children:e}):null,m.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"})]}),tu=({onClose:e,iosLink:i,googleLink:t,buttonType:a,handleCopyLink:o,download:r,typeOfProduct:s})=>{const n=s&&qi[s]?qi[s]:qi.Playable;let l="";return!i&&!t?l=pi.t("common:both_links_are_empty_are_you_sure_want_to_continue"):i?t||(l=pi.t("common:google_play_link_is_empty_are_you_sure_want_to_continue")):l=pi.t("common:ios_link_is_empty_are_you_sure_want_to_continue"),m.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:[m.jsx("div",{onClick:e,style:{position:"absolute",zIndex:30,height:"100%",width:"100%",pointerEvents:"none"}}),m.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:[m.jsx("h1",{style:{textAlign:"center",fontSize:"18px",lineHeight:"24px"},children:l}),m.jsxs("div",{style:{display:"flex",gap:"5px"},children:[m.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:pi.t("common:no")}),m.jsx("button",{onClick:async A=>{a==="download"?await r():a==="copyLink"&&await o(),e()},style:{flex:1,cursor:"pointer",borderRadius:"0.375rem",border:`1px solid ${n}`,backgroundColor:n,padding:"0.5rem",fontWeight:"bold",color:"white",transition:"all 0.15s ease-linear"},children:pi.t("common:yes")})]})]})]})},Qo=({onClose:e,handleCopyLink:i,download:t,creditConfirmType:a,getDownloadCount:o,width:r="130%",height:s="120%",typeOfProduct:n="Playable"})=>{const l=n&&qi[n]?qi[n]:qi.Playable;return m.jsxs("div",{style:{position:"fixed",top:0,left:0,zIndex:50,display:"flex",height:s,width:r,alignItems:"center",justifyContent:"center",backgroundColor:"#00000080"},children:[m.jsx("div",{onClick:e,style:{position:"absolute",zIndex:30,height:"100%",width:"100%"}}),m.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:[m.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?"}),m.jsxs("div",{style:{display:"flex",gap:"5px"},children:[m.jsx("button",{onClick:e,style:{flex:1,cursor:"pointer",borderRadius:"4px",borderWidth:"1px",borderColor:"#666666",padding:"2px",fontWeight:"bold"},children:"No"}),m.jsx("button",{style:{flex:1,cursor:"pointer",borderRadius:"4px",borderWidth:"1px",borderColor:l,backgroundColor:l,padding:"2px",fontWeight:"bold",color:"white"},onClick:async A=>{A.preventDefault(),A.stopPropagation(),a==="download"?(await t(),await o()):a==="copy"&&(await i(),await o()),e()},children:"Yes"})]})]})]})},au=({onClose:e,handleDownload:i,handleDownloadMolocoTest:t,downloadingMoloco:a,downloadingMolocoTest:o,downloadingMolocoHtml:r,isCopiedMolocoTest:s,typeOfProduct:n="Playable"})=>{const l=n&&qi[n]?qi[n]:qi.Playable;return m.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:[m.jsx("div",{onClick:e,style:{position:"absolute",zIndex:30,height:"100%",width:"100%",pointerEvents:"none"}}),m.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:m.jsxs("div",{style:{display:"flex",gap:"5px",flexDirection:"column"},children:[m.jsxs("div",{style:{display:"flex",justifyContent:"center"},children:[a?m.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",borderRadius:"0.375rem",border:`1px solid ${l}`,backgroundColor:l,color:"white",transition:"all 0.15s ease-linear",width:"200px",marginRight:"10px"},children:m.jsx("img",{width:"25px",height:"25px",src:We,alt:"pf-logo-gif"})}):m.jsx("button",{onClick:()=>{i(!1)},style:{cursor:"pointer",borderRadius:"0.375rem",border:`1px solid ${l}`,backgroundColor:l,color:"white",transition:"all 0.15s ease-linear",width:"200px",marginRight:"10px"},children:"Download"}),r?m.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",borderRadius:"0.375rem",border:`1px solid ${l}`,backgroundColor:l,color:"white",transition:"all 0.15s ease-linear",width:"200px",marginLeft:"10px"},children:m.jsx("img",{width:"25px",height:"25px",src:We,alt:"pf-logo-gif"})}):m.jsx("button",{onClick:()=>{i(!0)},style:{cursor:"pointer",borderRadius:"0.375rem",border:`1px solid ${l}`,backgroundColor:l,color:"white",transition:"all 0.15s ease-linear",width:"200px",marginLeft:"10px"},children:"Download HTML"})]}),m.jsx("div",{style:{display:"flex",justifyContent:"center"},children:o?m.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",borderRadius:"0.375rem",border:`1px solid ${l}`,backgroundColor:l,color:"white",transition:"all 0.15s ease-linear",width:"200px"},children:m.jsx("img",{width:"25px",height:"25px",src:We,alt:"pf-logo-gif"})}):m.jsx("button",{onClick:t,disabled:s,style:{cursor:s?"default":"pointer",borderRadius:"0.375rem",border:s?"1px solid #16A34A":`1px solid ${l}`,backgroundColor:s?"#16A34A":l,color:"white",transition:"all 0.15s ease-linear",width:"200px"},children:s?"Link Copied!":"Download Moloco Test"})})]})})]})};async function ou(e,i,t,a){return(await Ki.post(e+"/createMolocoTestPage",{_id:i,network:t,typeOfProduct:a})).data}const ru=({onClose:e,handleDownload:i,downloadingPortrait:t,downloadingLandscape:a,downloadingResponsive:o,typeOfProduct:r="Playable"})=>{const s=r&&qi[r]?qi[r]:qi.Playable;return m.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:[m.jsx("div",{onClick:e,style:{position:"absolute",zIndex:30,height:"100%",width:"100%",pointerEvents:"none"}}),m.jsx("div",{style:{position:"absolute",zIndex:50,display:"flex",flexDirection:"column",gap:"15px",minWidth:"500px",borderRadius:"0.375rem",backgroundColor:"white",padding:"1.5rem",pointerEvents:"auto"},onClick:n=>{n.stopPropagation()},children:m.jsx("div",{style:{display:"flex",gap:"10px",flexDirection:"column"},children:m.jsxs("div",{style:{display:"flex",justifyContent:"center",gap:"10px"},children:[t?m.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",borderRadius:"0.375rem",border:`1px solid ${s}`,backgroundColor:s,color:"white",transition:"all 0.15s ease-linear",width:"140px",padding:"10px"},children:m.jsx("img",{width:"20px",height:"20px",src:We,alt:"loading-gif"})}):m.jsx("button",{onClick:()=>i("portrait"),style:{cursor:"pointer",borderRadius:"0.375rem",border:`1px solid ${s}`,backgroundColor:s,color:"white",transition:"all 0.15s ease-linear",width:"140px",padding:"10px",fontSize:"14px"},children:"Portrait"}),a?m.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",borderRadius:"0.375rem",border:`1px solid ${s}`,backgroundColor:s,color:"white",transition:"all 0.15s ease-linear",width:"140px",padding:"10px"},children:m.jsx("img",{width:"20px",height:"20px",src:We,alt:"loading-gif"})}):m.jsx("button",{onClick:()=>i("landscape"),style:{cursor:"pointer",borderRadius:"0.375rem",border:`1px solid ${s}`,backgroundColor:s,color:"white",transition:"all 0.15s ease-linear",width:"140px",padding:"10px",fontSize:"14px"},children:"Landscape"}),o?m.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",borderRadius:"0.375rem",border:`1px solid ${s}`,backgroundColor:s,color:"white",transition:"all 0.15s ease-linear",width:"140px",padding:"10px"},children:m.jsx("img",{width:"20px",height:"20px",src:We,alt:"loading-gif"})}):m.jsx("button",{onClick:()=>i("responsive"),style:{cursor:"pointer",borderRadius:"0.375rem",border:`1px solid ${s}`,backgroundColor:s,color:"white",transition:"all 0.15s ease-linear",width:"140px",padding:"10px",fontSize:"14px"},children:"Responsive"})]})})})]})};async function jo(e,i,t){return(await Ki.post(e+"/createPlayableVersionABTestLink",{_id:i,networks:t.networks,versions:t.versions,interactions:t.interactions||["0 click"]})).data}const su=({id:e,imageUrl:i,handleCardClick:t,selected:a,name:o,networkVersionSize:r,fileSizeLoading:s,showCheckBox:n,typeOfProduct:l,versionId:A,api:q,handleDownloadError:p,fetchFileUrl:u,urls:I,game:c,setIsConfirmActive:Z,creditDownload:K,getDownloadCount:S,disabled:W,user:U,setSafariCopyLink:k,isTest:h,urlType:b,setCdnModal:F,generateCDN:N,cdnUrl:v,selectedVersionIds:_})=>{const[X,H]=y.useState(!1),[f,g]=y.useState(""),[L,Y]=y.useState(!1),[C,M]=y.useState(!1),[D,J]=y.useState(!1),[E,O]=y.useState("download"),[B,z]=y.useState(!1),[P,Q]=y.useState(!1),[w,ti]=y.useState(!1),[si,oi]=y.useState(!1),[Zi,G]=y.useState(!1),[Mi,Fi]=y.useState(!1),[Ei,bi]=y.useState(!1),[$i,j]=y.useState(!1),[T,$]=y.useState(!1),[Ci,ui]=ji(na),[wi,Mt]=ji(dt),Ze=l==="Playable"?wi:!0,he={cdn:"Generate Link",adikteev:"Copy CDN"},Qi=()=>{t(e)},me=async(ni,ki,yi)=>{if(H(!0),l==="Flex"&&U.flex===!1&&U.customer!=="playableFactoryInternal"){p("|ACCESS|"),H(!1);return}if(_&&_.length>0&&ki==="download")try{if(!c||!c._id)throw new Error("Game data is required for multi-version download");const ie=await jo(q,c._id,{networks:[ni],versions:_}),ye=u+"/"+ie.url,Bi=await(await fetch(ye)).blob(),at=window.URL.createObjectURL(Bi),ge=document.createElement("a");return ge.href=at,ge.download=ie.url.split("/").pop()||"download.zip",document.body.appendChild(ge),ge.click(),window.URL.revokeObjectURL(at),document.body.removeChild(ge),H(!1),ie.url}catch(ie){console.log("multi-version single network download error",ie),H(!1),p(ie.message,ie);return}const Ue={molocoGenerateHtml:!1,urlType:b,responsiveType:"responsive"};if(Ce?ki==="copy"?(Q(!0),ki="download",Ue.molocoGenerateHtml=!0):z(!0):Ua&&(Ue.responsiveType=yi),console.log("getVersion",ni,ki,Ue),ni==="cdn"){F(!0),await N(!0),H(!1);return}return ni==="adikteev"&&(ki="copy"),new Promise((ie,ye)=>{ve(A,ni,Ze?I:null,ki,h,Ue).then(ee=>{H(!1),ie(ee),Q(!1),z(!1)}).catch(ee=>{H(!1),p(ee.message,ee),ye(ee),Q(!1),z(!1)})})},Et=async(ni=!1)=>{ni?Q(!0):z(!0);const ki={molocoGenerateHtml:!1};if(ni&&(ki.molocoGenerateHtml=!0),_&&_.length>0)try{if(!c||!c._id)throw new Error("Game data is required for multi-version download");const yi=await jo(q,c._id,{networks:["moloco"],versions:_}),Ue=u+"/"+yi.url,ye=await(await fetch(Ue)).blob(),ee=window.URL.createObjectURL(ye),Bi=document.createElement("a");return Bi.href=ee,Bi.download=yi.url.split("/").pop()||"download.zip",document.body.appendChild(Bi),Bi.click(),window.URL.revokeObjectURL(ee),document.body.removeChild(Bi),H(!1),ni?Q(!1):z(!1),J(!1),yi.url}catch(yi){console.log("multi-version single network download error",yi),H(!1),p(yi.message,yi);return}ve(A,o,Ze?I:null,"download",h,ki).then(yi=>{ni?Q(!1):z(!1),J(!1)}).catch(yi=>{p(yi.message,yi)})},Ra=async()=>{ti(!0);const ni=await ou(q,A,o,l);let ki=`${u}/${ni==null?void 0:ni.url}`;fe(ki)?(oi(!0),setTimeout(()=>oi(!1),2e3),ti(!1)):(k(ki),ti(!1))},Ce=o==="moloco"||o==="molocoV2",Ua=o==="google",La=Ci.find(ni=>ni.name===o);return m.jsxs(m.Fragment,{children:[m.jsxs("div",{style:{position:"relative",display:"flex",flexDirection:"column",gap:"20px",padding:"16px",borderColor:a?qi[l]:"lightgray",borderWidth:"1px",borderStyle:"solid",backgroundColor:"white",width:"100%",height:"175px",borderRadius:"8px",cursor:"pointer"},className:"border-hover-"+l,onClick:Qi,children:[m.jsxs("div",{style:{marginTop:o=="web"?"10px":"40px",display:"flex",justifyContent:"center"},children:[m.jsx("div",{style:{position:"absolute",right:"0",top:"0",padding:"8px"},children:m.jsx("div",{children:r&&r.map(ni=>ni.network).includes(o)?s?m.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:m.jsx(eu,{typeOfProduct:l})}):r.map(ni=>m.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:ni.network===o?ni.size.toString().slice(0,5)+"Mb":""},ni.network)):null})}),m.jsx("div",{style:{position:"absolute",top:"0",left:"0",padding:"0.5rem"},children:(l==="Playable"||l==="Ready"||l==="Flex")&&n&&m.jsx(iu,{checked:a,typeOfProduct:l,id:e})}),m.jsx("img",{onClick:Qi,style:{width:"30rem",height:o=="web"?"80px":"50px",objectFit:"contain"},src:i})]}),m.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"0.25rem"},children:[m.jsx(Go,{className:`${Ce?"w-1/2":"w-2/3"} border-hover-`+l,downloading:X,typeOfProduct:l,onClickDonwload:async ni=>{if(ni.stopPropagation(),console.log("user in onclickdownload",U),Ce&&U.customer==="playableFactoryInternal"){J(!0);return}else if(Ua)Fi(!0);else{g("download");const ki=I.iosUrl,yi=I.googleUrl;o==="cdn"&&K&&K.willSpendCredit&&!v||o!=="cdn"&&K&&K.willSpendCredit?(Z(!0),O("download"),Y(!0)):["Playable","Flex","Ready"].includes(l)&&(!ki||!yi)?(Z(!0),M(!0)):(M(!1),Y(!1),await me(o,"download"))}},children:Ce?m.jsxs(m.Fragment,{children:[!B&&m.jsxs(m.Fragment,{children:[m.jsx(bo,{style:{marginRight:"0.5rem",height:"1.5rem",width:"1rem",stroke:"dark-full"}}),U.customer!=="playableFactoryInternal"?pi.t("common:txt"):pi.t("common:download")]}),B&&m.jsx(Jt,{})]}):m.jsxs(m.Fragment,{children:[!X&&m.jsxs(m.Fragment,{children:[m.jsx(bo,{style:{marginRight:"0.5rem",height:"1.5rem",width:"1rem",stroke:"dark-full"}}),he[o]||pi.t("common:download")]}),X&&m.jsx(Jt,{})]})}),La&&La.downloadType.includes("copy")&&m.jsx(Go,{className:"w-1/3 border-hover-"+l,variant:"secondary",typeOfProduct:l,onClickDonwload:async ni=>{if(ni.stopPropagation(),Zi)return;g("copyLink");const ki=I.iosUrl,yi=I.googleUrl;K&&(K!=null&&K.willSpendCredit)?(O("copy"),Z(!0),Y(!0)):l!=="Import"&&(!ki||!yi)?(Z(!0),M(!0)):(Y(!1),M(!1),await me(o,"copy"),G(!0),setTimeout(()=>G(!1),2e3))},disabled:W,isCopied:Zi,children:m.jsx(ds,{className:"h-4 w-4 stroke-dark-full"})}),Ce&&U.customer!=="playableFactoryInternal"&&m.jsxs(Go,{className:"w-1/2 border-hover-"+l,typeOfProduct:l,onClickDonwload:async ni=>{ni.stopPropagation(),g("copyLink");const ki=I.iosUrl,yi=I.googleUrl;K&&(K!=null&&K.willSpendCredit)?(O("download"),Z(!0),Y(!0)):l!=="Import"&&(!ki||!yi)?(Z(!0),M(!0)):(Y(!1),M(!1),await Et(!0))},disabled:W,children:[!P&&m.jsxs(m.Fragment,{children:[m.jsx(bo,{style:{marginRight:"0.5rem",height:"1.5rem",width:"1rem",stroke:"dark-full"}}),pi.t("common:html")]}),P&&m.jsx(Jt,{})]})]})]}),L&&m.jsx(Qo,{creditConfirmType:E,handleCopyLink:async()=>{M(!1),Z(!1),await me(o,"copy")},download:async()=>{M(!1),Z(!1),await me(o,"download")},onClose:()=>{Y(!1),Z(!1)},getDownloadCount:S,typeOfProduct:l}),C&&m.jsx(tu,{onClose:()=>{M(!1),Z(!1)},iosLink:I.iosUrl,googleLink:I.googleUrl,buttonType:f,typeOfProduct:l,handleCopyLink:async()=>{M(!1),Z(!1),await me(o,"copy")},download:async()=>{M(!1),Z(!1),await me(o,"download")}}),D&&U.customer==="playableFactoryInternal"&&m.jsx(au,{onClose:()=>{J(!1)},handleDownload:Et,handleDownloadMolocoTest:Ra,downloadingMoloco:B,donwloadintMolocoTest:w,downloadingMolocoHtml:P,isCopiedMolocoTest:si,typeOfProduct:l}),Mi&&m.jsx(ru,{onClose:()=>{Fi(!1)},handleDownload:async ni=>{ni==="portrait"?bi(!0):ni==="landscape"?j(!0):$(!0),await me(o,"download",ni),ni==="portrait"?bi(!1):ni==="landscape"?j(!1):$(!1)},downloadingPortrait:Ei,downloadingLandscape:$i,downloadingResponsive:T,typeOfProduct:l})]})},nu=({networksVersionTotalSize:e,typeOfProduct:i,onClickMultiDownload:t,multiDownloading:a,selectedCount:o=0})=>{const r=qi[i]||"#EA580C",n=(()=>{const l={Flex:"#5A00CC",Ready:"#004A7F",Playable:"#C2410C",Import:"#0082CC",Fusion:"#0A0A0A"};return i&&l[i]?l[i]:"#C2410C"})();return m.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"8px"},children:a?m.jsx("div",{style:{display:"flex",width:"auto",minWidth:"12rem",height:"2.5rem",borderRadius:"0.5rem",alignItems:"center",justifyContent:"center",backgroundColor:r,padding:"0 1.5rem"},children:m.jsx(Jt,{})}):m.jsxs("button",{onClick:t,style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",padding:"0.625rem 1.5rem",minWidth:"12rem",height:"2.5rem",backgroundColor:r,color:"white",fontSize:"0.875rem",fontWeight:"500",borderRadius:"0.5rem",border:`2px solid ${r}`,boxShadow:`0 0 0 2px white, 0 0 0 4px ${r}, 0 10px 15px -3px ${r}4D, 0 4px 6px -4px ${r}4D`,cursor:"pointer",transition:"all 0.2s ease",whiteSpace:"nowrap"},onMouseEnter:l=>{l.currentTarget.style.backgroundColor=n,l.currentTarget.style.boxShadow=`0 0 0 2px white, 0 0 0 4px ${r}, 0 20px 25px -5px ${r}66, 0 8px 10px -6px ${r}66`},onMouseLeave:l=>{l.currentTarget.style.backgroundColor=r,l.currentTarget.style.boxShadow=`0 0 0 2px white, 0 0 0 4px ${r}, 0 10px 15px -3px ${r}4D, 0 4px 6px -4px ${r}4D`},children:[m.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{marginRight:"0.5rem"},children:[m.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),m.jsx("polyline",{points:"7 10 12 15 17 10"}),m.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]}),m.jsxs("span",{children:["Download Selected (",o,")"]})]})})},Vn=({title:e,titleId:i})=>m.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[m.jsx("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),m.jsx("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]}),lu=({onClose:e,cdnUrl:i,generateCDN:t,cdnUploading:a,typeOfProduct:o="Playable"})=>{const[r,s]=y.useState(!1),n=o&&qi[o]?qi[o]:qi.Playable;return m.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:[m.jsx("div",{onClick:e,style:{position:"absolute",zIndex:30,height:"100%",width:"100%",pointerEvents:"none"}}),m.jsx("div",{style:{position:"absolute",zIndex:50,display:"flex",flexDirection:"column",gap:"5px",minWidth:"500px",maxWidth:"728px",width:"90%",minHeight:"150px",borderRadius:"10px",backgroundColor:"white",padding:"40px 30px 50px",pointerEvents:"auto"},onClick:l=>{l.stopPropagation()},children:m.jsxs("div",{style:{display:"flex",gap:"5px",flexDirection:"column"},children:[m.jsxs("p",{style:{fontSize:"1.1rem",fontWeight:500,textAlign:"left",marginBottom:"10px",color:"#00a3ff",textDecoration:"underline",cursor:"pointer",width:"150px",display:"flex",gap:"10px",alignItems:"center",height:"28px"},onClick:()=>{a||t()},children:["Update Link",a&&m.jsx("div",{style:{width:"20px",height:"20px",border:"3px solid #f3f3f3",borderTop:"3px solid #00a3ff",borderRadius:"50%",animation:"spin 1s linear infinite"}})]}),m.jsx("style",{children:`
|
|
87
|
+
https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof e.getDerivedStateFromProps=="function"&&(i.componentWillMount=tn,i.componentWillReceiveProps=an),typeof i.getSnapshotBeforeUpdate=="function"){if(typeof i.componentDidUpdate!="function")throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");i.componentWillUpdate=on;var n=i.componentDidUpdate;i.componentDidUpdate=function(A,q,p){var u=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:p;n.call(this,A,q,u)}}return e}const Sp=$n(Object.freeze(Object.defineProperty({__proto__:null,polyfill:Zp},Symbol.toStringTag,{value:"Module"})));Object.defineProperty(be,"__esModule",{value:!0}),be.bodyOpenClassName=be.portalClassName=void 0;var rn=Object.assign||function(e){for(var i=1;i<arguments.length;i++){var t=arguments[i];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},hp=function(){function e(i,t){for(var a=0;a<t.length;a++){var o=t[a];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(i,o.key,o)}}return function(i,t,a){return t&&e(i.prototype,t),a&&e(i,a),i}}(),sn=y,qa=ht(sn),Cp=Pn,ma=ht(Cp),yp=Bt,ai=ht(yp),gp=dp,nn=ht(gp),Vp=ne,Jp=Wp(Vp),Me=le,ln=ht(Me),kp=Sp;function Wp(e){if(e&&e.__esModule)return e;var i={};if(e!=null)for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(i[t]=e[t]);return i.default=e,i}function ht(e){return e&&e.__esModule?e:{default:e}}function Mp(e,i){if(!(e instanceof i))throw new TypeError("Cannot call a class as a function")}function An(e,i){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i&&(typeof i=="object"||typeof i=="function")?i:e}function Ep(e,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof i);e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),i&&(Object.setPrototypeOf?Object.setPrototypeOf(e,i):e.__proto__=i)}var Rp=be.portalClassName="ReactModalPortal",Up=be.bodyOpenClassName="ReactModal__Body--open",xe=Me.canUseDOM&&ma.default.createPortal!==void 0,ko=function(i){return document.createElement(i)},qn=function(){return xe?ma.default.createPortal:ma.default.unstable_renderSubtreeIntoContainer};function pa(e){return e()}var et=function(e){Ep(i,e);function i(){var t,a,o,r;Mp(this,i);for(var s=arguments.length,n=Array(s),l=0;l<s;l++)n[l]=arguments[l];return r=(a=(o=An(this,(t=i.__proto__||Object.getPrototypeOf(i)).call.apply(t,[this].concat(n))),o),o.removePortal=function(){!xe&&ma.default.unmountComponentAtNode(o.node);var A=pa(o.props.parentSelector);A&&A.contains(o.node)?A.removeChild(o.node):console.warn('React-Modal: "parentSelector" prop did not returned any DOM element. Make sure that the parent element is unmounted to avoid any memory leaks.')},o.portalRef=function(A){o.portal=A},o.renderPortal=function(A){var q=qn(),p=q(o,qa.default.createElement(nn.default,rn({defaultStyles:i.defaultStyles},A)),o.node);o.portalRef(p)},a),An(o,r)}return hp(i,[{key:"componentDidMount",value:function(){if(Me.canUseDOM){xe||(this.node=ko("div")),this.node.className=this.props.portalClassName;var a=pa(this.props.parentSelector);a.appendChild(this.node),!xe&&this.renderPortal(this.props)}}},{key:"getSnapshotBeforeUpdate",value:function(a){var o=pa(a.parentSelector),r=pa(this.props.parentSelector);return{prevParent:o,nextParent:r}}},{key:"componentDidUpdate",value:function(a,o,r){if(Me.canUseDOM){var s=this.props,n=s.isOpen,l=s.portalClassName;a.portalClassName!==l&&(this.node.className=l);var A=r.prevParent,q=r.nextParent;q!==A&&(A.removeChild(this.node),q.appendChild(this.node)),!(!a.isOpen&&!n)&&!xe&&this.renderPortal(this.props)}}},{key:"componentWillUnmount",value:function(){if(!(!Me.canUseDOM||!this.node||!this.portal)){var a=this.portal.state,o=Date.now(),r=a.isOpen&&this.props.closeTimeoutMS&&(a.closesAt||o+this.props.closeTimeoutMS);r?(a.beforeClose||this.portal.closeWithTimeout(),setTimeout(this.removePortal,r-o)):this.removePortal()}}},{key:"render",value:function(){if(!Me.canUseDOM||!xe)return null;!this.node&&xe&&(this.node=ko("div"));var a=qn();return a(qa.default.createElement(nn.default,rn({ref:this.portalRef,defaultStyles:i.defaultStyles},this.props)),this.node)}}],[{key:"setAppElement",value:function(a){Jp.setElement(a)}}]),i}(sn.Component);et.propTypes={isOpen:ai.default.bool.isRequired,style:ai.default.shape({content:ai.default.object,overlay:ai.default.object}),portalClassName:ai.default.string,bodyOpenClassName:ai.default.string,htmlOpenClassName:ai.default.string,className:ai.default.oneOfType([ai.default.string,ai.default.shape({base:ai.default.string.isRequired,afterOpen:ai.default.string.isRequired,beforeClose:ai.default.string.isRequired})]),overlayClassName:ai.default.oneOfType([ai.default.string,ai.default.shape({base:ai.default.string.isRequired,afterOpen:ai.default.string.isRequired,beforeClose:ai.default.string.isRequired})]),appElement:ai.default.oneOfType([ai.default.instanceOf(ln.default),ai.default.instanceOf(Me.SafeHTMLCollection),ai.default.instanceOf(Me.SafeNodeList),ai.default.arrayOf(ai.default.instanceOf(ln.default))]),onAfterOpen:ai.default.func,onRequestClose:ai.default.func,closeTimeoutMS:ai.default.number,ariaHideApp:ai.default.bool,shouldFocusAfterRender:ai.default.bool,shouldCloseOnOverlayClick:ai.default.bool,shouldReturnFocusAfterClose:ai.default.bool,preventScroll:ai.default.bool,parentSelector:ai.default.func,aria:ai.default.object,data:ai.default.object,role:ai.default.string,contentLabel:ai.default.string,shouldCloseOnEsc:ai.default.bool,overlayRef:ai.default.func,contentRef:ai.default.func,id:ai.default.string,overlayElement:ai.default.func,contentElement:ai.default.func},et.defaultProps={isOpen:!1,portalClassName:Rp,bodyOpenClassName:Up,role:"dialog",ariaHideApp:!0,closeTimeoutMS:0,shouldFocusAfterRender:!0,shouldCloseOnEsc:!0,shouldCloseOnOverlayClick:!0,shouldReturnFocusAfterClose:!0,preventScroll:!1,parentSelector:function(){return document.body},overlayElement:function(i,t){return qa.default.createElement("div",i,t)},contentElement:function(i,t){return qa.default.createElement("div",i,t)}},et.defaultStyles={overlay:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(255, 255, 255, 0.75)"},content:{position:"absolute",top:"40px",left:"40px",right:"40px",bottom:"40px",border:"1px solid #ccc",background:"#fff",overflow:"auto",WebkitOverflowScrolling:"touch",borderRadius:"4px",outline:"none",padding:"20px"}},(0,kp.polyfill)(et),process.env.NODE_ENV!=="production"&&(et.setCreateHTMLElement=function(e){return ko=e}),be.default=et,function(e,i){Object.defineProperty(i,"__esModule",{value:!0});var t=be,a=o(t);function o(r){return r&&r.__esModule?r:{default:r}}i.default=a.default,e.exports=i.default}(So,So.exports);var Lp=So.exports;const ua=_n(Lp);async function mn(e,i){return(await Ki.post(`${i}/getCompanyAllSubs`,{customer:e})).data}async function Yp(e,i,t,a){return(await Ki.post(a+"/updateSub",{sub:e,updates:i,product:t})).data}function pn(e){var i,t,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e))for(i=0;i<e.length;i++)e[i]&&(t=pn(e[i]))&&(a&&(a+=" "),a+=t);else for(i in e)e[i]&&(a&&(a+=" "),a+=i);return a}function Ee(){for(var e,i,t=0,a="";t<arguments.length;)(e=arguments[t++])&&(i=pn(e))&&(a&&(a+=" "),a+=i);return a}const Ct=e=>typeof e=="number"&&!isNaN(e),Oe=e=>typeof e=="string",Ti=e=>typeof e=="function",Ia=e=>Oe(e)||Ti(e)?e:null,Wo=e=>y.isValidElement(e)||Oe(e)||Ti(e)||Ct(e);function Gp(e,i,t){t===void 0&&(t=300);const{scrollHeight:a,style:o}=e;requestAnimationFrame(()=>{o.minHeight="initial",o.height=a+"px",o.transition=`all ${t}ms`,requestAnimationFrame(()=>{o.height="0",o.padding="0",o.margin="0",setTimeout(i,t)})})}function Ka(e){let{enter:i,exit:t,appendPosition:a=!1,collapse:o=!0,collapseDuration:r=300}=e;return function(s){let{children:n,position:l,preventExitTransition:A,done:q,nodeRef:p,isIn:u}=s;const I=a?`${i}--${l}`:i,c=a?`${t}--${l}`:t,Z=y.useRef(0);return y.useLayoutEffect(()=>{const K=p.current,S=I.split(" "),W=U=>{U.target===p.current&&(K.dispatchEvent(new Event("d")),K.removeEventListener("animationend",W),K.removeEventListener("animationcancel",W),Z.current===0&&U.type!=="animationcancel"&&K.classList.remove(...S))};K.classList.add(...S),K.addEventListener("animationend",W),K.addEventListener("animationcancel",W)},[]),y.useEffect(()=>{const K=p.current,S=()=>{K.removeEventListener("animationend",S),o?Gp(K,q,r):q()};u||(A?S():(Z.current=1,K.className+=` ${c}`,K.addEventListener("animationend",S)))},[u]),y.createElement(y.Fragment,null,n)}}function un(e,i){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:i}:{}}const Pi={list:new Map,emitQueue:new Map,on(e,i){return this.list.has(e)||this.list.set(e,[]),this.list.get(e).push(i),this},off(e,i){if(i){const t=this.list.get(e).filter(a=>a!==i);return this.list.set(e,t),this}return this.list.delete(e),this},cancelEmit(e){const i=this.emitQueue.get(e);return i&&(i.forEach(clearTimeout),this.emitQueue.delete(e)),this},emit(e){this.list.has(e)&&this.list.get(e).forEach(i=>{const t=setTimeout(()=>{i(...[].slice.call(arguments,1))},0);this.emitQueue.has(e)||this.emitQueue.set(e,[]),this.emitQueue.get(e).push(t)})}},ca=e=>{let{theme:i,type:t,...a}=e;return y.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:i==="colored"?"currentColor":`var(--toastify-icon-color-${t})`,...a})},Mo={info:function(e){return y.createElement(ca,{...e},y.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 y.createElement(ca,{...e},y.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 y.createElement(ca,{...e},y.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 y.createElement(ca,{...e},y.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 y.createElement("div",{className:"Toastify__spinner"})}};function bp(e){const[,i]=y.useReducer(I=>I+1,0),[t,a]=y.useState([]),o=y.useRef(null),r=y.useRef(new Map).current,s=I=>t.indexOf(I)!==-1,n=y.useRef({toastKey:1,displayedToast:0,count:0,queue:[],props:e,containerId:null,isToastActive:s,getToast:I=>r.get(I)}).current;function l(I){let{containerId:c}=I;const{limit:Z}=n.props;!Z||c&&n.containerId!==c||(n.count-=n.queue.length,n.queue=[])}function A(I){a(c=>I==null?[]:c.filter(Z=>Z!==I))}function q(){const{toastContent:I,toastProps:c,staleId:Z}=n.queue.shift();u(I,c,Z)}function p(I,c){let{delay:Z,staleId:K,...S}=c;if(!Wo(I)||function(H){return!o.current||n.props.enableMultiContainer&&H.containerId!==n.props.containerId||r.has(H.toastId)&&H.updateId==null}(S))return;const{toastId:W,updateId:U,data:k}=S,{props:h}=n,b=()=>A(W),F=U==null;F&&n.count++;const N={...h,style:h.toastStyle,key:n.toastKey++,...Object.fromEntries(Object.entries(S).filter(H=>{let[f,g]=H;return g!=null})),toastId:W,updateId:U,data:k,closeToast:b,isIn:!1,className:Ia(S.className||h.toastClassName),bodyClassName:Ia(S.bodyClassName||h.bodyClassName),progressClassName:Ia(S.progressClassName||h.progressClassName),autoClose:!S.isLoading&&(v=S.autoClose,_=h.autoClose,v===!1||Ct(v)&&v>0?v:_),deleteToast(){const H=un(r.get(W),"removed");r.delete(W),Pi.emit(4,H);const f=n.queue.length;if(n.count=W==null?n.count-n.displayedToast:n.count-1,n.count<0&&(n.count=0),f>0){const g=W==null?n.props.limit:1;if(f===1||g===1)n.displayedToast++,q();else{const L=g>f?f:g;n.displayedToast=L;for(let Y=0;Y<L;Y++)q()}}else i()}};var v,_;N.iconOut=function(H){let{theme:f,type:g,isLoading:L,icon:Y}=H,C=null;const M={theme:f,type:g};return Y===!1||(Ti(Y)?C=Y(M):y.isValidElement(Y)?C=y.cloneElement(Y,M):Oe(Y)||Ct(Y)?C=Y:L?C=Mo.spinner():(D=>D in Mo)(g)&&(C=Mo[g](M))),C}(N),Ti(S.onOpen)&&(N.onOpen=S.onOpen),Ti(S.onClose)&&(N.onClose=S.onClose),N.closeButton=h.closeButton,S.closeButton===!1||Wo(S.closeButton)?N.closeButton=S.closeButton:S.closeButton===!0&&(N.closeButton=!Wo(h.closeButton)||h.closeButton);let X=I;y.isValidElement(I)&&!Oe(I.type)?X=y.cloneElement(I,{closeToast:b,toastProps:N,data:k}):Ti(I)&&(X=I({closeToast:b,toastProps:N,data:k})),h.limit&&h.limit>0&&n.count>h.limit&&F?n.queue.push({toastContent:X,toastProps:N,staleId:K}):Ct(Z)?setTimeout(()=>{u(X,N,K)},Z):u(X,N,K)}function u(I,c,Z){const{toastId:K}=c;Z&&r.delete(Z);const S={content:I,props:c};r.set(K,S),a(W=>[...W,K].filter(U=>U!==Z)),Pi.emit(4,un(S,S.props.updateId==null?"added":"updated"))}return y.useEffect(()=>(n.containerId=e.containerId,Pi.cancelEmit(3).on(0,p).on(1,I=>o.current&&A(I)).on(5,l).emit(2,n),()=>{r.clear(),Pi.emit(3,n)}),[]),y.useEffect(()=>{n.props=e,n.isToastActive=s,n.displayedToast=t.length}),{getToastToRender:function(I){const c=new Map,Z=Array.from(r.values());return e.newestOnTop&&Z.reverse(),Z.forEach(K=>{const{position:S}=K.props;c.has(S)||c.set(S,[]),c.get(S).push(K)}),Array.from(c,K=>I(K[0],K[1]))},containerRef:o,isToastActive:s}}function In(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientX:e.clientX}function Kn(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientY:e.clientY}function Qp(e){const[i,t]=y.useState(!1),[a,o]=y.useState(!1),r=y.useRef(null),s=y.useRef({start:0,x:0,y:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,boundingRect:null,didMove:!1}).current,n=y.useRef(e),{autoClose:l,pauseOnHover:A,closeToast:q,onClick:p,closeOnClick:u}=e;function I(k){if(e.draggable){k.nativeEvent.type==="touchstart"&&k.nativeEvent.preventDefault(),s.didMove=!1,document.addEventListener("mousemove",S),document.addEventListener("mouseup",W),document.addEventListener("touchmove",S),document.addEventListener("touchend",W);const h=r.current;s.canCloseOnClick=!0,s.canDrag=!0,s.boundingRect=h.getBoundingClientRect(),h.style.transition="",s.x=In(k.nativeEvent),s.y=Kn(k.nativeEvent),e.draggableDirection==="x"?(s.start=s.x,s.removalDistance=h.offsetWidth*(e.draggablePercent/100)):(s.start=s.y,s.removalDistance=h.offsetHeight*(e.draggablePercent===80?1.5*e.draggablePercent:e.draggablePercent/100))}}function c(k){if(s.boundingRect){const{top:h,bottom:b,left:F,right:N}=s.boundingRect;k.nativeEvent.type!=="touchend"&&e.pauseOnHover&&s.x>=F&&s.x<=N&&s.y>=h&&s.y<=b?K():Z()}}function Z(){t(!0)}function K(){t(!1)}function S(k){const h=r.current;s.canDrag&&h&&(s.didMove=!0,i&&K(),s.x=In(k),s.y=Kn(k),s.delta=e.draggableDirection==="x"?s.x-s.start:s.y-s.start,s.start!==s.x&&(s.canCloseOnClick=!1),h.style.transform=`translate${e.draggableDirection}(${s.delta}px)`,h.style.opacity=""+(1-Math.abs(s.delta/s.removalDistance)))}function W(){document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",W),document.removeEventListener("touchmove",S),document.removeEventListener("touchend",W);const k=r.current;if(s.canDrag&&s.didMove&&k){if(s.canDrag=!1,Math.abs(s.delta)>s.removalDistance)return o(!0),void e.closeToast();k.style.transition="transform 0.2s, opacity 0.2s",k.style.transform=`translate${e.draggableDirection}(0)`,k.style.opacity="1"}}y.useEffect(()=>{n.current=e}),y.useEffect(()=>(r.current&&r.current.addEventListener("d",Z,{once:!0}),Ti(e.onOpen)&&e.onOpen(y.isValidElement(e.children)&&e.children.props),()=>{const k=n.current;Ti(k.onClose)&&k.onClose(y.isValidElement(k.children)&&k.children.props)}),[]),y.useEffect(()=>(e.pauseOnFocusLoss&&(document.hasFocus()||K(),window.addEventListener("focus",Z),window.addEventListener("blur",K)),()=>{e.pauseOnFocusLoss&&(window.removeEventListener("focus",Z),window.removeEventListener("blur",K))}),[e.pauseOnFocusLoss]);const U={onMouseDown:I,onTouchStart:I,onMouseUp:c,onTouchEnd:c};return l&&A&&(U.onMouseEnter=K,U.onMouseLeave=Z),u&&(U.onClick=k=>{p&&p(k),s.canCloseOnClick&&q()}),{playToast:Z,pauseToast:K,isRunning:i,preventExitTransition:a,toastRef:r,eventHandlers:U}}function cn(e){let{closeToast:i,theme:t,ariaLabel:a="close"}=e;return y.createElement("button",{className:`Toastify__close-button Toastify__close-button--${t}`,type:"button",onClick:o=>{o.stopPropagation(),i(o)},"aria-label":a},y.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},y.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 jp(e){let{delay:i,isRunning:t,closeToast:a,type:o="default",hide:r,className:s,style:n,controlledProgress:l,progress:A,rtl:q,isIn:p,theme:u}=e;const I=r||l&&A===0,c={...n,animationDuration:`${i}ms`,animationPlayState:t?"running":"paused",opacity:I?0:1};l&&(c.transform=`scaleX(${A})`);const Z=Ee("Toastify__progress-bar",l?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${u}`,`Toastify__progress-bar--${o}`,{"Toastify__progress-bar--rtl":q}),K=Ti(s)?s({rtl:q,type:o,defaultClassName:Z}):Ee(Z,s);return y.createElement("div",{role:"progressbar","aria-hidden":I?"true":"false","aria-label":"notification timer",className:K,style:c,[l&&A>=1?"onTransitionEnd":"onAnimationEnd"]:l&&A<1?null:()=>{p&&a()}})}const Fp=e=>{const{isRunning:i,preventExitTransition:t,toastRef:a,eventHandlers:o}=Qp(e),{closeButton:r,children:s,autoClose:n,onClick:l,type:A,hideProgressBar:q,closeToast:p,transition:u,position:I,className:c,style:Z,bodyClassName:K,bodyStyle:S,progressClassName:W,progressStyle:U,updateId:k,role:h,progress:b,rtl:F,toastId:N,deleteToast:v,isIn:_,isLoading:X,iconOut:H,closeOnClick:f,theme:g}=e,L=Ee("Toastify__toast",`Toastify__toast-theme--${g}`,`Toastify__toast--${A}`,{"Toastify__toast--rtl":F},{"Toastify__toast--close-on-click":f}),Y=Ti(c)?c({rtl:F,position:I,type:A,defaultClassName:L}):Ee(L,c),C=!!b||!n,M={closeToast:p,type:A,theme:g};let D=null;return r===!1||(D=Ti(r)?r(M):y.isValidElement(r)?y.cloneElement(r,M):cn(M)),y.createElement(u,{isIn:_,done:v,position:I,preventExitTransition:t,nodeRef:a},y.createElement("div",{id:N,onClick:l,className:Y,...o,style:Z,ref:a},y.createElement("div",{..._&&{role:h},className:Ti(K)?K({type:A}):Ee("Toastify__toast-body",K),style:S},H!=null&&y.createElement("div",{className:Ee("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!X})},H),y.createElement("div",null,s)),D,y.createElement(jp,{...k&&!C?{key:`pb-${k}`}:{},rtl:F,theme:g,delay:n,isRunning:i,isIn:_,closeToast:p,hide:q,type:A,style:U,className:W,controlledProgress:C,progress:b||0})))},da=function(e,i){return i===void 0&&(i=!1),{enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:i}},Np=Ka(da("bounce",!0));Ka(da("slide",!0)),Ka(da("zoom")),Ka(da("flip"));const Eo=y.forwardRef((e,i)=>{const{getToastToRender:t,containerRef:a,isToastActive:o}=bp(e),{className:r,style:s,rtl:n,containerId:l}=e;function A(q){const p=Ee("Toastify__toast-container",`Toastify__toast-container--${q}`,{"Toastify__toast-container--rtl":n});return Ti(r)?r({position:q,rtl:n,defaultClassName:p}):Ee(p,Ia(r))}return y.useEffect(()=>{i&&(i.current=a.current)},[]),y.createElement("div",{ref:a,className:"Toastify",id:l},t((q,p)=>{const u=p.length?{...s}:{...s,pointerEvents:"none"};return y.createElement("div",{className:A(q),style:u,key:`container-${q}`},p.map((I,c)=>{let{content:Z,props:K}=I;return y.createElement(Fp,{...K,isIn:o(K.toastId),style:{...K.style,"--nth":c+1,"--len":p.length},key:`toast-${K.key}`},Z)}))}))});Eo.displayName="ToastContainer",Eo.defaultProps={position:"top-right",transition:Np,autoClose:5e3,closeButton:cn,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,draggable:!0,draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};let Ro,ze=new Map,yt=[],xp=1;function dn(){return""+xp++}function Op(e){return e&&(Oe(e.toastId)||Ct(e.toastId))?e.toastId:dn()}function gt(e,i){return ze.size>0?Pi.emit(0,e,i):yt.push({content:e,options:i}),i.toastId}function Za(e,i){return{...i,type:i&&i.type||e,toastId:Op(i)}}function Sa(e){return(i,t)=>gt(i,Za(e,t))}function hi(e,i){return gt(e,Za("default",i))}hi.loading=(e,i)=>gt(e,Za("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...i})),hi.promise=function(e,i,t){let a,{pending:o,error:r,success:s}=i;o&&(a=Oe(o)?hi.loading(o,t):hi.loading(o.render,{...t,...o}));const n={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},l=(q,p,u)=>{if(p==null)return void hi.dismiss(a);const I={type:q,...n,...t,data:u},c=Oe(p)?{render:p}:p;return a?hi.update(a,{...I,...c}):hi(c.render,{...I,...c}),u},A=Ti(e)?e():e;return A.then(q=>l("success",s,q)).catch(q=>l("error",r,q)),A},hi.success=Sa("success"),hi.info=Sa("info"),hi.error=Sa("error"),hi.warning=Sa("warning"),hi.warn=hi.warning,hi.dark=(e,i)=>gt(e,Za("default",{theme:"dark",...i})),hi.dismiss=e=>{ze.size>0?Pi.emit(1,e):yt=yt.filter(i=>e!=null&&i.options.toastId!==e)},hi.clearWaitingQueue=function(e){return e===void 0&&(e={}),Pi.emit(5,e)},hi.isActive=e=>{let i=!1;return ze.forEach(t=>{t.isToastActive&&t.isToastActive(e)&&(i=!0)}),i},hi.update=function(e,i){i===void 0&&(i={}),setTimeout(()=>{const t=function(a,o){let{containerId:r}=o;const s=ze.get(r||Ro);return s&&s.getToast(a)}(e,i);if(t){const{props:a,content:o}=t,r={delay:100,...a,...i,toastId:i.toastId||e,updateId:dn()};r.toastId!==e&&(r.staleId=e);const s=r.render||o;delete r.render,gt(s,r)}},0)},hi.done=e=>{hi.update(e,{progress:1})},hi.onChange=e=>(Pi.on(4,e),()=>{Pi.off(4,e)}),hi.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"},hi.TYPE={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},Pi.on(2,e=>{Ro=e.containerId||e,ze.set(Ro,e),yt.forEach(i=>{Pi.emit(0,i.content,i.options)}),yt=[]}).on(3,e=>{ze.delete(e.containerId||e),ze.size===0&&Pi.off(0).off(1).off(5)});function ha(e){hi.error(e,{position:"top-center",autoClose:650,hideProgressBar:!0,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0,theme:"light"})}function Zn(e){hi.success(e,{position:"top-center",autoClose:650,hideProgressBar:!0,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0,theme:"light"})}async function Sn(e,i,t){return(await Ki.post(e+"/getNetworks",{typeOfProduct:i,versionId:t})).data}async function zp(e){return(await Ki.post(e+"/getNetworks",{allNetworks:!0})).data}const Uo="#f97316",hn="#ea580c",Lo="#AD1BFF",Cn="#9200e7",Yo="#2563eb",yn="#0031FF";var qi=(e=>(e[e.Flex=Lo]="Flex",e[e.Playable=Uo]="Playable",e.Import="#00a3ff",e[e.Ready=Yo]="Ready",e.Fusion="#171717",e))(qi||{}),Vt=(e=>(e[e.Flex=Cn]="Flex",e[e.Ready=yn]="Ready",e[e.Playable=hn]="Playable",e.Import="#0082CC",e.Fusion="#0A0A0A",e))(Vt||{}),Tp=(e=>(e[e.Flex=`bg-[${Lo}]`]="Flex",e[e.Playable=`bg-[${Uo}]`]="Playable",e.Import="bg-[#00a3ff]",e[e.Ready=`bg-[${Yo}]`]="Ready",e.Fusion="bg-[#171717]",e))(Tp||{}),gn=(e=>(e.Fusion="linear-gradient(to right, #651FFF, #5018CC)",e[e.Ready=`linear-gradient(to right, ${Yo}, ${yn})`]="Ready",e[e.Playable=`linear-gradient(to right, ${Uo}, ${hn})`]="Playable",e[e.Flex=`linear-gradient(to right, ${Lo}, ${Cn})`]="Flex",e))(gn||{});const wp={applovin:"Mobile marketing platform for user acquisition",unity:"Unity Ads monetization platform",mobvista:"AI-powered mobile advertising platform",ironsource:"Mobile monetization and marketing platform",moloco:"Machine learning-powered performance marketing",vungle:"In-app video ad platform",facebook:"Facebook Audience Network",google:"Google Ads platform",liftoff:"Mobile app marketing and retargeting",tencent:"Tencent advertising platform",aarki:"Mobile advertising platform",adform:"Digital advertising platform"},Bp=({visible:e,onClose:i,api:t,user:a,typeOfProduct:o,versionId:r,customerId:s})=>{const[n,l]=y.useState([]),[A,q]=y.useState([]),[p,u]=y.useState(!1),[I,c]=y.useState(!1),[Z,K]=y.useState(null),[S,W]=ji(na),U=()=>qi[o]||qi.Playable,k=()=>Vt[o]||"red",h=()=>({Ready:"#E0F2FE",Playable:"#FFF7ED",Import:"#E0F2FE",Flex:"#F3E8FF",Fusion:"#F5F5F5"})[o]||"#FFF7ED",b=U(),F=k(),N=h();y.useEffect(()=>{e&&v()},[e]);const v=async()=>{u(!0);try{const g=await mn(s,t);let L=[];o==="Playable"?L=g.playableSubs||[]:o==="Ready"?L=g.readySubs||[]:o==="Flex"&&(L=g.flexSubs||[]);const Y=L.find(C=>C.isActive&&new Date(C.endsAt)>new Date);if(Y){K(Y),l(Array.isArray(Y.networks)?Y.networks:[]);const M=(await zp(t)).filter(D=>D.name!=="web"&&D.name!=="cdn"&&D.name!=="default").map(D=>({id:D.id,name:D.name,imageSrc:D.imageSrc,description:wp[D.name]||""}));q(M)}}catch(g){console.error("Error fetching subscription data:",g),ha("Failed to load subscription data")}finally{u(!1)}},_=g=>{l(L=>L.includes(g)?L.filter(Y=>Y!==g):[...L,g])},X=()=>{l(A.map(g=>g.id))},H=()=>{l([])},f=async()=>{if(!Z){ha("No active subscription found");return}c(!0);try{let g="playable";o==="Ready"?g="ready":o==="Flex"&&(g="flex"),await Yp(Z,{downloadLimit:Z.downloadLimit,seatLimit:Z.seatLimit,endsAt:Z.endsAt,isUnlimited:Z.isUnlimited,packageId:Z.packageId,networks:n},g,t);const L=await Sn(t,o,r);if(L){const Y=L.map(C=>(C.name=C.id,C));W(Y)}Zn("Networks updated successfully"),i()}catch(g){console.error("Error updating networks:",g),ha("Failed to update networks")}finally{c(!1)}};return m.jsx(ua,{isOpen:e,ariaHideApp:!1,onRequestClose:i,style:{content:{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",borderRadius:"0.75rem",backgroundColor:"white",zIndex:60,height:"600px",width:"900px",maxWidth:"95vw",maxHeight:"95vh",overflow:"hidden",padding:"0"},overlay:{position:"fixed",backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:60,top:0,left:0,right:0,bottom:0}},contentLabel:"Edit Visible Networks Modal",shouldCloseOnOverlayClick:!0,children:m.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%"},children:[m.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"1.5rem",borderBottom:"1px solid #E5E7EB"},children:[m.jsx("h2",{style:{fontSize:"1.5rem",fontWeight:"600",color:"#111827",margin:0},children:"Edit Visible Networks"}),m.jsx("button",{onClick:i,style:{padding:"0.5rem",borderRadius:"9999px",border:"none",backgroundColor:"transparent",cursor:"pointer",transition:"background-color 0.2s"},onMouseEnter:g=>{g.currentTarget.style.backgroundColor="#F3F4F6"},onMouseLeave:g=>{g.currentTarget.style.backgroundColor="transparent"},children:m.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[m.jsx("path",{d:"M18 6 6 18"}),m.jsx("path",{d:"m6 6 12 12"})]})})]}),m.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"1.5rem",borderBottom:"1px solid #E5E7EB"},children:[m.jsxs("div",{style:{display:"flex",gap:"1rem"},children:[m.jsx("button",{onClick:X,style:{padding:"0.5rem 1rem",backgroundColor:N,border:"none",borderRadius:"0.5rem",fontSize:"0.875rem",fontWeight:"500",color:b,cursor:"pointer",transition:"background-color 0.2s"},children:"Select All"}),m.jsx("button",{onClick:H,style:{padding:"0.5rem 1rem",backgroundColor:"transparent",border:"none",borderRadius:"0.5rem",fontSize:"0.875rem",fontWeight:"500",color:"#6B7280",cursor:"pointer",transition:"background-color 0.2s"},onMouseEnter:g=>{g.currentTarget.style.backgroundColor="#F3F4F6"},onMouseLeave:g=>{g.currentTarget.style.backgroundColor="transparent"},children:"Select None"})]}),m.jsxs("div",{style:{fontSize:"0.875rem",color:"#6B7280"},children:[n.length," of ",A.length," selected"]})]}),m.jsx("div",{style:{flex:1,overflowY:"auto",padding:"1.5rem"},children:p?m.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"},children:m.jsx("div",{children:"Loading..."})}):m.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:"1rem"},children:[A.length===0&&m.jsx("div",{style:{gridColumn:"1 / -1",textAlign:"center",color:"#6B7280",fontSize:"0.875rem"},children:"No subscription for customer, add in networks from the admin panel."}),A.map(g=>{const L=n.includes(g.id);return m.jsxs("div",{onClick:()=>_(g.id),style:{position:"relative",display:"flex",flexDirection:"column",gap:"0.75rem",padding:"1.5rem",border:`2px solid ${L?b:"#E5E7EB"}`,borderRadius:"0.75rem",backgroundColor:L?N:"white",cursor:"pointer",transition:"all 0.2s"},children:[m.jsx("div",{style:{position:"absolute",top:"1rem",right:"1rem",width:"1.5rem",height:"1.5rem",borderRadius:"9999px",backgroundColor:L?b:"white",border:`2px solid ${L?b:"#D1D5DB"}`,display:"flex",alignItems:"center",justifyContent:"center"},children:L&&m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:m.jsx("path",{d:"M20 6 9 17l-5-5"})})}),m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"1rem"},children:[m.jsx("img",{src:g.imageSrc,alt:g.name,style:{width:"60px",height:"40px",objectFit:"contain"}}),m.jsxs("div",{children:[m.jsx("h3",{style:{fontSize:"1rem",fontWeight:"600",color:"#111827",margin:0,textTransform:"capitalize"},children:g.name==="mobvista"?"Mintegral":g.name}),g.description&&m.jsx("p",{style:{fontSize:"0.75rem",color:"#6B7280",margin:"0.25rem 0 0 0"},children:g.description})]})]})]},g.id)})]})}),m.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"0.75rem",padding:"1.5rem",borderTop:"1px solid #E5E7EB"},children:[m.jsx("button",{onClick:i,style:{padding:"0.5rem 1.5rem",backgroundColor:"white",border:"1px solid #D1D5DB",borderRadius:"0.5rem",fontSize:"0.875rem",fontWeight:"500",color:"#374151",cursor:"pointer",transition:"background-color 0.2s"},onMouseEnter:g=>{g.currentTarget.style.backgroundColor="#F9FAFB"},onMouseLeave:g=>{g.currentTarget.style.backgroundColor="white"},children:"Cancel"}),m.jsx("button",{onClick:f,disabled:I,style:{padding:"0.5rem 1.5rem",backgroundColor:I?"#D1D5DB":b,border:"none",borderRadius:"0.5rem",fontSize:"0.875rem",fontWeight:"500",color:"white",cursor:I?"not-allowed":"pointer",transition:"background-color 0.2s"},onMouseEnter:g=>{I||(g.currentTarget.style.backgroundColor=F)},onMouseLeave:g=>{I||(g.currentTarget.style.backgroundColor=b)},children:I?"Saving...":"Save Changes"})]})]})})},Dp=({typeOfProduct:e,allNetworksSelected:i,setAllNetworksSelected:t,api:a,user:o,versionId:r,customerId:s})=>{const[n,l]=y.useState(!1),[A,q]=y.useState(!1);return y.useEffect(()=>{(async()=>{try{const u=await mn(s,a);let I=[];e==="Playable"?I=u.playableSubs||[]:e==="Ready"?I=u.readySubs||[]:e==="Flex"&&(I=u.flexSubs||[]),q(I.length>0)}catch(u){console.error("Error checking subscriptions:",u),q(!1)}})()},[e,s,a]),m.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",marginBottom:"0",marginTop:"0",paddingRight:"1rem"},children:[m.jsx("h3",{style:{fontSize:"1rem",fontWeight:"600",color:"#111827",margin:0},children:"Ad Networks"}),m.jsxs("div",{style:{display:"flex",gap:"0.5rem",alignItems:"center"},children:[A&&["pm","admin"].includes(o.role)&&m.jsxs("button",{onClick:()=>l(!0),style:{display:"flex",alignItems:"center",gap:"0.375rem",paddingLeft:"0.75rem",paddingRight:"0.75rem",paddingTop:"0.375rem",paddingBottom:"0.375rem",backgroundColor:"#F3F4F6",border:"none",borderRadius:"0.5rem",fontSize:"0.75rem",fontWeight:"500",color:"#374151",cursor:"pointer",transition:"background-color 0.2s ease"},onMouseEnter:p=>{p.currentTarget.style.backgroundColor="#E5E7EB"},onMouseLeave:p=>{p.currentTarget.style.backgroundColor="#F3F4F6"},children:[m.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[m.jsx("path",{d:"M12 20h9"}),m.jsx("path",{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"})]}),"Edit Networks"]}),m.jsxs("button",{onClick:()=>t(!i),style:{display:"flex",alignItems:"center",gap:"0.375rem",paddingLeft:"0.75rem",paddingRight:"0.75rem",paddingTop:"0.375rem",paddingBottom:"0.375rem",backgroundColor:"#F3F4F6",border:"none",borderRadius:"0.5rem",fontSize:"0.75rem",fontWeight:"500",color:"#374151",cursor:"pointer",transition:"background-color 0.2s ease"},onMouseEnter:p=>{p.currentTarget.style.backgroundColor="#E5E7EB"},onMouseLeave:p=>{p.currentTarget.style.backgroundColor="#F3F4F6"},children:[m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:i?m.jsxs(m.Fragment,{children:[m.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),m.jsx("path",{d:"M9 13l2 2 4-6"})]}):m.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"})}),i?"Deselect All":"Select All"]})]}),["pm","admin"].includes(o.role)&&m.jsx(Bp,{visible:n,onClose:()=>l(!1),api:a,user:o,typeOfProduct:e,versionId:r,customerId:s})]})};async function Xp(e,i){return(await Ki.post(i+"/buyRequest",{requestType:e})).data}const fp=()=>m.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[m.jsxs("g",{"clip-path":"url(#clip0_518_12094)",children:[m.jsx("path",{d:"M4.50977 11.99L19.4898 11.99",stroke:"#7101FF","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),m.jsx("path",{d:"M13.5068 17.977L19.4828 12L13.5068 6.02299",stroke:"#7101FF","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"clip0_518_12094",children:m.jsx("rect",{width:"24",height:"24",fill:"white",transform:"translate(0 24) rotate(-90)"})})})]}),vp=({creditDownload:e,api:i})=>m.jsxs(m.Fragment,{children:[m.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."}),m.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"," ",m.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.",m.jsxs("button",{style:{marginLeft:"0.5rem",display:"flex",alignItems:"center",fontSize:"12px",fontWeight:"bold",textDecoration:"underline",color:"#yourColorHere"},onClick:()=>Xp("Flex Credit",i).then(t=>Zn("You will be contacted regarding your request.")),children:["Get more",m.jsx(fp,{})]})]})]}),Hp=({typeOfProduct:e,urls:i,handleIosChange:t,handleGoogleChange:a,disabled:o})=>{const r=q=>{t(q.target.value)},s=q=>{a(q.target.value)},[n,l]=ji(dt);let A=o;return e==="Playable"&&!o&&!n&&(A=!0),m.jsxs(m.Fragment,{children:[e==="Playable"&&m.jsxs("div",{style:{display:"none",height:"2rem",width:"100%",alignItems:"center",fontSize:"12px",fontWeight:"200"},children:[m.jsx("span",{style:{width:"6.5rem",fontWeight:"bold",flexShrink:0},children:"Use Custom Url"}),m.jsx("input",{type:"checkbox",checked:n,onChange:q=>l(q.target.checked)})]}),m.jsxs("div",{style:{display:"flex",flexDirection:"column",width:"100%",marginBottom:"0.75rem",paddingRight:"1rem"},children:[m.jsx("label",{style:{fontSize:"0.75rem",fontWeight:"500",color:"#374151",marginBottom:"0.25rem"},children:"App Store Link"}),m.jsx("input",{style:{display:"flex",height:"1.75rem",width:"100%",alignItems:"center",borderRadius:"0.5rem",border:"1px solid #D1D5DB",paddingLeft:"0.625rem",paddingRight:"0.625rem",fontSize:"0.75rem",color:"#000000",outline:"none",transition:"all 0.2s ease"},type:"text",value:i.iosUrl,onChange:r,placeholder:"https://apps.apple.com/app/...",disabled:A,onFocus:q=>{q.currentTarget.style.borderColor="#3B82F6",q.currentTarget.style.boxShadow="0 0 0 3px rgba(59, 130, 246, 0.1)"},onBlur:q=>{q.currentTarget.style.borderColor="#D1D5DB",q.currentTarget.style.boxShadow="none"}})]}),m.jsxs("div",{style:{display:"flex",flexDirection:"column",width:"100%",marginBottom:"0.75rem",paddingRight:"1rem"},children:[m.jsx("label",{style:{fontSize:"0.75rem",fontWeight:"500",color:"#374151",marginBottom:"0.25rem"},children:"Google Play Link"}),m.jsx("input",{style:{display:"flex",height:"1.75rem",width:"100%",alignItems:"center",borderRadius:"0.5rem",border:"1px solid #D1D5DB",paddingLeft:"0.625rem",paddingRight:"0.625rem",fontSize:"0.75rem",color:"#000000",outline:"none",transition:"all 0.2s ease"},type:"text",value:i.googleUrl,onChange:s,placeholder:"https://play.google.com/store/apps/details?id=...",disabled:A,onFocus:q=>{q.currentTarget.style.borderColor="#3B82F6",q.currentTarget.style.boxShadow="0 0 0 3px rgba(59, 130, 246, 0.1)"},onBlur:q=>{q.currentTarget.style.borderColor="#D1D5DB",q.currentTarget.style.boxShadow="none"}})]})]})},Pp=({typeOfProduct:e,fileSize:i,urls:t,handleIosChange:a,handleGoogleChange:o,disabled:r,api:s,creditDownload:n,user:l,isTest:A,setIsTest:q,urlType:p,setUrlType:u})=>m.jsx(m.Fragment,{children:e!=="Import"&&m.jsxs("div",{style:{display:"flex",width:"100%",flexDirection:"column"},children:[m.jsx(Hp,{typeOfProduct:e,urls:t,handleIosChange:a,handleGoogleChange:o,disabled:r}),(n==null?void 0:n.willSpendCredit)&&m.jsx(vp,{creditDownload:n,api:s})]})}),_p=({typeOfProduct:e,title:i,fileSize:t})=>{const a=gn[e],o=e!=="Flex";return m.jsxs("div",{children:[m.jsx("h2",{className:"text-xl font-bold",style:{backgroundImage:a,WebkitBackgroundClip:"text",backgroundClip:"text",WebkitTextFillColor:"transparent",marginBottom:o?"0.75rem":"0.25rem",marginTop:"2.5rem",lineHeight:"1.2",margin:0},children:i}),t?m.jsxs("p",{style:{fontSize:"0.75rem",fontWeight:"400",color:"#6B7280",marginTop:"0.25rem",marginBottom:0},children:["File size: ",parseFloat(t).toFixed(2)," MB"]}):null]})},$p=({typeOfProduct:e,fileSize:i,urls:t,title:a,handleIosChange:o,handleGoogleChange:r,disabled:s,creditDownload:n,api:l,user:A,isTest:q,setIsTest:p,urlType:u,setUrlType:I,allNetworksSelected:c,setAllNetworksSelected:Z,versionId:K,customerId:S})=>m.jsxs("div",{style:{display:"flex",flexDirection:"column",width:"100%",justifyContent:"space-between",alignItems:"flex-start",paddingLeft:"1.25rem",paddingRight:"1.25rem",paddingTop:"1.5rem",paddingBottom:"0.75rem",gap:"0.5rem"},children:[m.jsx(_p,{typeOfProduct:e,title:a,fileSize:i}),m.jsx(Pp,{typeOfProduct:e,fileSize:i,urls:t,handleIosChange:o,handleGoogleChange:r,disabled:s,creditDownload:n,api:l,user:A,isTest:q,setIsTest:p,urlType:u,setUrlType:I}),m.jsx(Dp,{typeOfProduct:e,allNetworksSelected:c,setAllNetworksSelected:Z,api:l,user:A,versionId:K,customerId:S})]}),Go=({children:e,className:i,onClickDonwload:t,downloading:a,disabled:o,variant:r="primary",typeOfProduct:s,isCopied:n=!1})=>{const l=r==="primary",A=()=>l?s&&qi[s]?qi[s]:"red":"#E5E7EB",q=()=>l?s&&Vt[s]?Vt[s]:"red":"#D1D5DB",p=()=>"none",u=n?"#16A34A":A(),I=n?"#15803D":q();return m.jsx("button",{onClick:t,className:i,style:{display:"flex",height:"30px",alignItems:"center",justifyContent:"center",borderRadius:"0.5rem",border:"none",padding:l?"0.25rem 0.5rem":"0.25rem",fontSize:"0.75rem",fontWeight:"500",width:l?"auto":"26px",minWidth:l?"90px":"26px",flex:l?1:"0 0 auto",backgroundColor:u,color:l||n?"#FFFFFF":"#374151",cursor:o||a||n?"not-allowed":"pointer",opacity:o||a?.6:1,transition:"all 0.2s ease",boxShadow:p()},disabled:a||o,onMouseEnter:c=>{!o&&!a&&!n&&(c.currentTarget.style.backgroundColor=I)},onMouseLeave:c=>{!o&&!a&&(c.currentTarget.style.backgroundColor=u)},children:n?m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:m.jsx("polyline",{points:"20 6 9 17 4 12"})}):e})},iu=({checked:e,typeOfProduct:i,id:t})=>{const[a,o]=y.useState(e),r=qi[i];y.useEffect(()=>{o(e)},[e]);const s=()=>{o(!a)};return m.jsx("div",{style:{display:"inline-flex",alignItems:"center"},children:m.jsxs("label",{onClick:s,style:{position:"relative",display:"flex",cursor:"pointer",alignItems:"center"},htmlFor:t,children:[m.jsx("input",{type:"checkbox",style:{position:"relative",height:"20px",width:"20px",cursor:"pointer",appearance:"none",borderRadius:"0.25rem",transition:"all 200ms ease-in-out",border:a?"none":"1px solid lightgray",backgroundColor:a?r:"transparent",opacity:1},id:t,checked:a,onChange:s}),m.jsxs("div",{style:{pointerEvents:"none",position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:"white",opacity:a?1:0,transition:"opacity ease-in-out"},children:[m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",style:{height:"14px",width:"14px"},viewBox:"0 0 20 20",fill:"white",stroke:"white",strokeWidth:"1",children:m.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"})})," "]})]})})},JK="",eu=({typeOfProduct:e})=>m.jsx("div",{style:{backgroundColor:"transparent",display:"flex",alignItems:"center",flexDirection:"column"},children:m.jsxs("div",{style:{position:"relative",width:"64px",height:"16px",marginTop:"8px"},children:[m.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:qi[e]}}),m.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:qi[e]}}),m.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:qi[e]}}),m.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:qi[e]}})]})}),Jt=({isNetworksLoading:e=!1,isLight:i=!0})=>m.jsx("div",{style:{display:"flex",height:"100%",width:"90px",alignItems:"center",justifyContent:"center"},children:m.jsx("img",{width:e?"100px":"25px",height:e?"100px":"25px",src:i?We:Xe,alt:"pf-logo-gif"})}),bo=({title:e,titleId:i,...t})=>m.jsxs("svg",{viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em","aria-labelledby":i,...t,children:[e?m.jsx("title",{id:i,children:e}):null,m.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"})]}),tu=({onClose:e,iosLink:i,googleLink:t,buttonType:a,handleCopyLink:o,download:r,typeOfProduct:s})=>{const n=s&&qi[s]?qi[s]:qi.Playable;let l="";return!i&&!t?l=pi.t("common:both_links_are_empty_are_you_sure_want_to_continue"):i?t||(l=pi.t("common:google_play_link_is_empty_are_you_sure_want_to_continue")):l=pi.t("common:ios_link_is_empty_are_you_sure_want_to_continue"),m.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:[m.jsx("div",{onClick:e,style:{position:"absolute",zIndex:30,height:"100%",width:"100%",pointerEvents:"none"}}),m.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:[m.jsx("h1",{style:{textAlign:"center",fontSize:"18px",lineHeight:"24px"},children:l}),m.jsxs("div",{style:{display:"flex",gap:"5px"},children:[m.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:pi.t("common:no")}),m.jsx("button",{onClick:async A=>{a==="download"?await r():a==="copyLink"&&await o(),e()},style:{flex:1,cursor:"pointer",borderRadius:"0.375rem",border:`1px solid ${n}`,backgroundColor:n,padding:"0.5rem",fontWeight:"bold",color:"white",transition:"all 0.15s ease-linear"},children:pi.t("common:yes")})]})]})]})},Qo=({onClose:e,handleCopyLink:i,download:t,creditConfirmType:a,getDownloadCount:o,width:r="130%",height:s="120%",typeOfProduct:n="Playable"})=>{const l=n&&qi[n]?qi[n]:qi.Playable;return m.jsxs("div",{style:{position:"fixed",top:0,left:0,zIndex:50,display:"flex",height:s,width:r,alignItems:"center",justifyContent:"center",backgroundColor:"#00000080"},children:[m.jsx("div",{onClick:e,style:{position:"absolute",zIndex:30,height:"100%",width:"100%"}}),m.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:[m.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?"}),m.jsxs("div",{style:{display:"flex",gap:"5px"},children:[m.jsx("button",{onClick:e,style:{flex:1,cursor:"pointer",borderRadius:"4px",borderWidth:"1px",borderColor:"#666666",padding:"2px",fontWeight:"bold"},children:"No"}),m.jsx("button",{style:{flex:1,cursor:"pointer",borderRadius:"4px",borderWidth:"1px",borderColor:l,backgroundColor:l,padding:"2px",fontWeight:"bold",color:"white"},onClick:async A=>{A.preventDefault(),A.stopPropagation(),a==="download"?(await t(),await o()):a==="copy"&&(await i(),await o()),e()},children:"Yes"})]})]})]})},au=({onClose:e,handleDownload:i,handleDownloadMolocoTest:t,downloadingMoloco:a,downloadingMolocoTest:o,downloadingMolocoHtml:r,isCopiedMolocoTest:s,typeOfProduct:n="Playable"})=>{const l=n&&qi[n]?qi[n]:qi.Playable;return m.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:[m.jsx("div",{onClick:e,style:{position:"absolute",zIndex:30,height:"100%",width:"100%",pointerEvents:"none"}}),m.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:m.jsxs("div",{style:{display:"flex",gap:"5px",flexDirection:"column"},children:[m.jsxs("div",{style:{display:"flex",justifyContent:"center"},children:[a?m.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",borderRadius:"0.375rem",border:`1px solid ${l}`,backgroundColor:l,color:"white",transition:"all 0.15s ease-linear",width:"200px",marginRight:"10px"},children:m.jsx("img",{width:"25px",height:"25px",src:We,alt:"pf-logo-gif"})}):m.jsx("button",{onClick:()=>{i(!1)},style:{cursor:"pointer",borderRadius:"0.375rem",border:`1px solid ${l}`,backgroundColor:l,color:"white",transition:"all 0.15s ease-linear",width:"200px",marginRight:"10px"},children:"Download"}),r?m.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",borderRadius:"0.375rem",border:`1px solid ${l}`,backgroundColor:l,color:"white",transition:"all 0.15s ease-linear",width:"200px",marginLeft:"10px"},children:m.jsx("img",{width:"25px",height:"25px",src:We,alt:"pf-logo-gif"})}):m.jsx("button",{onClick:()=>{i(!0)},style:{cursor:"pointer",borderRadius:"0.375rem",border:`1px solid ${l}`,backgroundColor:l,color:"white",transition:"all 0.15s ease-linear",width:"200px",marginLeft:"10px"},children:"Download HTML"})]}),m.jsx("div",{style:{display:"flex",justifyContent:"center"},children:o?m.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",borderRadius:"0.375rem",border:`1px solid ${l}`,backgroundColor:l,color:"white",transition:"all 0.15s ease-linear",width:"200px"},children:m.jsx("img",{width:"25px",height:"25px",src:We,alt:"pf-logo-gif"})}):m.jsx("button",{onClick:t,disabled:s,style:{cursor:s?"default":"pointer",borderRadius:"0.375rem",border:s?"1px solid #16A34A":`1px solid ${l}`,backgroundColor:s?"#16A34A":l,color:"white",transition:"all 0.15s ease-linear",width:"200px"},children:s?"Link Copied!":"Download Moloco Test"})})]})})]})};async function ou(e,i,t,a){return(await Ki.post(e+"/createMolocoTestPage",{_id:i,network:t,typeOfProduct:a})).data}const ru=({onClose:e,handleDownload:i,downloadingPortrait:t,downloadingLandscape:a,downloadingResponsive:o,typeOfProduct:r="Playable"})=>{const s=r&&qi[r]?qi[r]:qi.Playable;return m.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:[m.jsx("div",{onClick:e,style:{position:"absolute",zIndex:30,height:"100%",width:"100%",pointerEvents:"none"}}),m.jsx("div",{style:{position:"absolute",zIndex:50,display:"flex",flexDirection:"column",gap:"15px",minWidth:"500px",borderRadius:"0.375rem",backgroundColor:"white",padding:"1.5rem",pointerEvents:"auto"},onClick:n=>{n.stopPropagation()},children:m.jsx("div",{style:{display:"flex",gap:"10px",flexDirection:"column"},children:m.jsxs("div",{style:{display:"flex",justifyContent:"center",gap:"10px"},children:[t?m.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",borderRadius:"0.375rem",border:`1px solid ${s}`,backgroundColor:s,color:"white",transition:"all 0.15s ease-linear",width:"140px",padding:"10px"},children:m.jsx("img",{width:"20px",height:"20px",src:We,alt:"loading-gif"})}):m.jsx("button",{onClick:()=>i("portrait"),style:{cursor:"pointer",borderRadius:"0.375rem",border:`1px solid ${s}`,backgroundColor:s,color:"white",transition:"all 0.15s ease-linear",width:"140px",padding:"10px",fontSize:"14px"},children:"Portrait"}),a?m.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",borderRadius:"0.375rem",border:`1px solid ${s}`,backgroundColor:s,color:"white",transition:"all 0.15s ease-linear",width:"140px",padding:"10px"},children:m.jsx("img",{width:"20px",height:"20px",src:We,alt:"loading-gif"})}):m.jsx("button",{onClick:()=>i("landscape"),style:{cursor:"pointer",borderRadius:"0.375rem",border:`1px solid ${s}`,backgroundColor:s,color:"white",transition:"all 0.15s ease-linear",width:"140px",padding:"10px",fontSize:"14px"},children:"Landscape"}),o?m.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",borderRadius:"0.375rem",border:`1px solid ${s}`,backgroundColor:s,color:"white",transition:"all 0.15s ease-linear",width:"140px",padding:"10px"},children:m.jsx("img",{width:"20px",height:"20px",src:We,alt:"loading-gif"})}):m.jsx("button",{onClick:()=>i("responsive"),style:{cursor:"pointer",borderRadius:"0.375rem",border:`1px solid ${s}`,backgroundColor:s,color:"white",transition:"all 0.15s ease-linear",width:"140px",padding:"10px",fontSize:"14px"},children:"Responsive"})]})})})]})};async function jo(e,i,t){return(await Ki.post(e+"/createPlayableVersionABTestLink",{_id:i,networks:t.networks,versions:t.versions,interactions:t.interactions||["0 click"]})).data}const su=({id:e,imageUrl:i,handleCardClick:t,selected:a,name:o,networkVersionSize:r,fileSizeLoading:s,showCheckBox:n,typeOfProduct:l,versionId:A,api:q,handleDownloadError:p,fetchFileUrl:u,urls:I,game:c,setIsConfirmActive:Z,creditDownload:K,getDownloadCount:S,disabled:W,user:U,setSafariCopyLink:k,isTest:h,urlType:b,setCdnModal:F,generateCDN:N,cdnUrl:v,selectedVersionIds:_})=>{const[X,H]=y.useState(!1),[f,g]=y.useState(""),[L,Y]=y.useState(!1),[C,M]=y.useState(!1),[D,J]=y.useState(!1),[E,O]=y.useState("download"),[B,z]=y.useState(!1),[P,Q]=y.useState(!1),[w,ti]=y.useState(!1),[si,oi]=y.useState(!1),[Zi,G]=y.useState(!1),[Mi,Fi]=y.useState(!1),[Ei,bi]=y.useState(!1),[$i,j]=y.useState(!1),[T,$]=y.useState(!1),[Ci,ui]=ji(na),[wi,Mt]=ji(dt),Ze=l==="Playable"?wi:!0,he={cdn:"Generate Link",adikteev:"Copy CDN"},Qi=()=>{t(e)},me=async(ni,ki,yi)=>{if(H(!0),l==="Flex"&&U.flex===!1&&U.customer!=="playableFactoryInternal"){p("|ACCESS|"),H(!1);return}if(_&&_.length>0&&ki==="download")try{if(!c||!c._id)throw new Error("Game data is required for multi-version download");const ie=await jo(q,c._id,{networks:[ni],versions:_}),ye=u+"/"+ie.url,Bi=await(await fetch(ye)).blob(),at=window.URL.createObjectURL(Bi),ge=document.createElement("a");return ge.href=at,ge.download=ie.url.split("/").pop()||"download.zip",document.body.appendChild(ge),ge.click(),window.URL.revokeObjectURL(at),document.body.removeChild(ge),H(!1),ie.url}catch(ie){console.log("multi-version single network download error",ie),H(!1),p(ie.message,ie);return}const Ue={molocoGenerateHtml:!1,urlType:b,responsiveType:"responsive"};if(Ce?ki==="copy"?(Q(!0),ki="download",Ue.molocoGenerateHtml=!0):z(!0):Ua&&(Ue.responsiveType=yi),console.log("getVersion",ni,ki,Ue),ni==="cdn"){F(!0),await N(!0),H(!1);return}return ni==="adikteev"&&(ki="copy"),new Promise((ie,ye)=>{ve(A,ni,Ze?I:null,ki,h,Ue).then(ee=>{H(!1),ie(ee),Q(!1),z(!1)}).catch(ee=>{H(!1),p(ee.message,ee),ye(ee),Q(!1),z(!1)})})},Et=async(ni=!1)=>{ni?Q(!0):z(!0);const ki={molocoGenerateHtml:!1};if(ni&&(ki.molocoGenerateHtml=!0),_&&_.length>0)try{if(!c||!c._id)throw new Error("Game data is required for multi-version download");const yi=await jo(q,c._id,{networks:["moloco"],versions:_,extras:{molocoGenerateHtml:ni}}),Ue=u+"/"+yi.url,ye=await(await fetch(Ue)).blob(),ee=window.URL.createObjectURL(ye),Bi=document.createElement("a");return Bi.href=ee,Bi.download=yi.url.split("/").pop()||"download.zip",document.body.appendChild(Bi),Bi.click(),window.URL.revokeObjectURL(ee),document.body.removeChild(Bi),H(!1),ni?Q(!1):z(!1),J(!1),yi.url}catch(yi){console.log("multi-version single network download error",yi),H(!1),p(yi.message,yi);return}ve(A,o,Ze?I:null,"download",h,ki).then(yi=>{ni?Q(!1):z(!1),J(!1)}).catch(yi=>{p(yi.message,yi)})},Ra=async()=>{ti(!0);const ni=await ou(q,A,o,l);let ki=`${u}/${ni==null?void 0:ni.url}`;fe(ki)?(oi(!0),setTimeout(()=>oi(!1),2e3),ti(!1)):(k(ki),ti(!1))},Ce=o==="moloco"||o==="molocoV2",Ua=o==="google",La=Ci.find(ni=>ni.name===o);return m.jsxs(m.Fragment,{children:[m.jsxs("div",{style:{position:"relative",display:"flex",flexDirection:"column",gap:"20px",padding:"16px",borderColor:a?qi[l]:"lightgray",borderWidth:"1px",borderStyle:"solid",backgroundColor:"white",width:"100%",height:"175px",borderRadius:"8px",cursor:"pointer"},className:"border-hover-"+l,onClick:Qi,children:[m.jsxs("div",{style:{marginTop:o=="web"?"10px":"40px",display:"flex",justifyContent:"center"},children:[m.jsx("div",{style:{position:"absolute",right:"0",top:"0",padding:"8px"},children:m.jsx("div",{children:r&&r.map(ni=>ni.network).includes(o)?s?m.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:m.jsx(eu,{typeOfProduct:l})}):r.map(ni=>m.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:ni.network===o?ni.size.toString().slice(0,5)+"Mb":""},ni.network)):null})}),m.jsx("div",{style:{position:"absolute",top:"0",left:"0",padding:"0.5rem"},children:(l==="Playable"||l==="Ready"||l==="Flex")&&n&&m.jsx(iu,{checked:a,typeOfProduct:l,id:e})}),m.jsx("img",{onClick:Qi,style:{width:"30rem",height:o=="web"?"80px":"50px",objectFit:"contain"},src:i})]}),m.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"0.25rem"},children:[m.jsx(Go,{className:`${Ce?"w-1/2":"w-2/3"} border-hover-`+l,downloading:X,typeOfProduct:l,onClickDonwload:async ni=>{if(ni.stopPropagation(),console.log("user in onclickdownload",U),Ce&&U.customer==="playableFactoryInternal"){J(!0);return}else if(Ua)Fi(!0);else{g("download");const ki=I.iosUrl,yi=I.googleUrl;o==="cdn"&&K&&K.willSpendCredit&&!v||o!=="cdn"&&K&&K.willSpendCredit?(Z(!0),O("download"),Y(!0)):["Playable","Flex","Ready"].includes(l)&&(!ki||!yi)?(Z(!0),M(!0)):(M(!1),Y(!1),await me(o,"download"))}},children:Ce?m.jsxs(m.Fragment,{children:[!B&&m.jsxs(m.Fragment,{children:[m.jsx(bo,{style:{marginRight:"0.5rem",height:"1.5rem",width:"1rem",stroke:"dark-full"}}),U.customer!=="playableFactoryInternal"?pi.t("common:txt"):pi.t("common:download")]}),B&&m.jsx(Jt,{})]}):m.jsxs(m.Fragment,{children:[!X&&m.jsxs(m.Fragment,{children:[m.jsx(bo,{style:{marginRight:"0.5rem",height:"1.5rem",width:"1rem",stroke:"dark-full"}}),he[o]||pi.t("common:download")]}),X&&m.jsx(Jt,{})]})}),La&&La.downloadType.includes("copy")&&m.jsx(Go,{className:"w-1/3 border-hover-"+l,variant:"secondary",typeOfProduct:l,onClickDonwload:async ni=>{if(ni.stopPropagation(),Zi)return;g("copyLink");const ki=I.iosUrl,yi=I.googleUrl;K&&(K!=null&&K.willSpendCredit)?(O("copy"),Z(!0),Y(!0)):l!=="Import"&&(!ki||!yi)?(Z(!0),M(!0)):(Y(!1),M(!1),await me(o,"copy"),G(!0),setTimeout(()=>G(!1),2e3))},disabled:W,isCopied:Zi,children:m.jsx(ds,{className:"h-4 w-4 stroke-dark-full"})}),Ce&&U.customer!=="playableFactoryInternal"&&m.jsxs(Go,{className:"w-1/2 border-hover-"+l,typeOfProduct:l,onClickDonwload:async ni=>{ni.stopPropagation(),g("copyLink");const ki=I.iosUrl,yi=I.googleUrl;K&&(K!=null&&K.willSpendCredit)?(O("download"),Z(!0),Y(!0)):l!=="Import"&&(!ki||!yi)?(Z(!0),M(!0)):(Y(!1),M(!1),await Et(!0))},disabled:W,children:[!P&&m.jsxs(m.Fragment,{children:[m.jsx(bo,{style:{marginRight:"0.5rem",height:"1.5rem",width:"1rem",stroke:"dark-full"}}),pi.t("common:html")]}),P&&m.jsx(Jt,{})]})]})]}),L&&m.jsx(Qo,{creditConfirmType:E,handleCopyLink:async()=>{M(!1),Z(!1),await me(o,"copy")},download:async()=>{M(!1),Z(!1),await me(o,"download")},onClose:()=>{Y(!1),Z(!1)},getDownloadCount:S,typeOfProduct:l}),C&&m.jsx(tu,{onClose:()=>{M(!1),Z(!1)},iosLink:I.iosUrl,googleLink:I.googleUrl,buttonType:f,typeOfProduct:l,handleCopyLink:async()=>{M(!1),Z(!1),await me(o,"copy")},download:async()=>{M(!1),Z(!1),await me(o,"download")}}),D&&U.customer==="playableFactoryInternal"&&m.jsx(au,{onClose:()=>{J(!1)},handleDownload:Et,handleDownloadMolocoTest:Ra,downloadingMoloco:B,donwloadintMolocoTest:w,downloadingMolocoHtml:P,isCopiedMolocoTest:si,typeOfProduct:l}),Mi&&m.jsx(ru,{onClose:()=>{Fi(!1)},handleDownload:async ni=>{ni==="portrait"?bi(!0):ni==="landscape"?j(!0):$(!0),await me(o,"download",ni),ni==="portrait"?bi(!1):ni==="landscape"?j(!1):$(!1)},downloadingPortrait:Ei,downloadingLandscape:$i,downloadingResponsive:T,typeOfProduct:l})]})},nu=({networksVersionTotalSize:e,typeOfProduct:i,onClickMultiDownload:t,multiDownloading:a,selectedCount:o=0})=>{const r=qi[i]||"#EA580C",n=(()=>{const l={Flex:"#5A00CC",Ready:"#004A7F",Playable:"#C2410C",Import:"#0082CC",Fusion:"#0A0A0A"};return i&&l[i]?l[i]:"#C2410C"})();return m.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"8px"},children:a?m.jsx("div",{style:{display:"flex",width:"auto",minWidth:"12rem",height:"2.5rem",borderRadius:"0.5rem",alignItems:"center",justifyContent:"center",backgroundColor:r,padding:"0 1.5rem"},children:m.jsx(Jt,{})}):m.jsxs("button",{onClick:t,style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",padding:"0.625rem 1.5rem",minWidth:"12rem",height:"2.5rem",backgroundColor:r,color:"white",fontSize:"0.875rem",fontWeight:"500",borderRadius:"0.5rem",border:`2px solid ${r}`,boxShadow:`0 0 0 2px white, 0 0 0 4px ${r}, 0 10px 15px -3px ${r}4D, 0 4px 6px -4px ${r}4D`,cursor:"pointer",transition:"all 0.2s ease",whiteSpace:"nowrap"},onMouseEnter:l=>{l.currentTarget.style.backgroundColor=n,l.currentTarget.style.boxShadow=`0 0 0 2px white, 0 0 0 4px ${r}, 0 20px 25px -5px ${r}66, 0 8px 10px -6px ${r}66`},onMouseLeave:l=>{l.currentTarget.style.backgroundColor=r,l.currentTarget.style.boxShadow=`0 0 0 2px white, 0 0 0 4px ${r}, 0 10px 15px -3px ${r}4D, 0 4px 6px -4px ${r}4D`},children:[m.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{marginRight:"0.5rem"},children:[m.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),m.jsx("polyline",{points:"7 10 12 15 17 10"}),m.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]}),m.jsxs("span",{children:["Download Selected (",o,")"]})]})})},Vn=({title:e,titleId:i})=>m.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[m.jsx("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),m.jsx("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]}),lu=({onClose:e,cdnUrl:i,generateCDN:t,cdnUploading:a,typeOfProduct:o="Playable"})=>{const[r,s]=y.useState(!1),n=o&&qi[o]?qi[o]:qi.Playable;return m.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:[m.jsx("div",{onClick:e,style:{position:"absolute",zIndex:30,height:"100%",width:"100%",pointerEvents:"none"}}),m.jsx("div",{style:{position:"absolute",zIndex:50,display:"flex",flexDirection:"column",gap:"5px",minWidth:"500px",maxWidth:"728px",width:"90%",minHeight:"150px",borderRadius:"10px",backgroundColor:"white",padding:"40px 30px 50px",pointerEvents:"auto"},onClick:l=>{l.stopPropagation()},children:m.jsxs("div",{style:{display:"flex",gap:"5px",flexDirection:"column"},children:[m.jsxs("p",{style:{fontSize:"1.1rem",fontWeight:500,textAlign:"left",marginBottom:"10px",color:"#00a3ff",textDecoration:"underline",cursor:"pointer",width:"150px",display:"flex",gap:"10px",alignItems:"center",height:"28px"},onClick:()=>{a||t()},children:["Update Link",a&&m.jsx("div",{style:{width:"20px",height:"20px",border:"3px solid #f3f3f3",borderTop:"3px solid #00a3ff",borderRadius:"50%",animation:"spin 1s linear infinite"}})]}),m.jsx("style",{children:`
|
|
88
88
|
@keyframes spin {
|
|
89
89
|
0% { transform: rotate(0deg); }
|
|
90
90
|
100% { transform: rotate(360deg); }
|