PageSourceSearch

https://www.glitch.fun/static/js/10454.1ed6b684.chunk.js

js glitch.fun collected 2026-09-24 10:39:58 UTC 114,897 bytes, 1 lines download raw bytes

1(self.webpackChunkfrontend=self.webpackChunkfrontend||[]).push([[10339,10454,85476],{10339:function(e,t,n){"use strict";n.r(t);var s=n(79321),a=n(91212),r=n(24765),i=n(89379),o=n(60436),l=n(10467),c=n(5544),d=n(88094),h=n(45256),u=n(55713),m=n(47894),x=n(43930),f=n(15678);t.default=function(e){var t=e.titleId,n=e.gameName,p=e.headerTitle,g=void 0===p?"AI Data Assistant":p,b=e.description,j=void 0===b?"Ask questions about your game's data, performance, or strategy.":b,y=e.height,v=void 0===y?"400px":y,A=(0,d.useState)(!1),w=(0,c.A)(A,2),N=w[0],k=w[1],_=(0,d.useState)(!1),C=(0,c.A)(_,2),S=C[0],L=C[1],D=(0,d.useState)([]),B=(0,c.A)(D,2),T=B[0],M=B[1],R=(0,d.useState)(""),P=(0,c.A)(R,2),F=P[0],I=P[1],z=(0,d.useState)(!1),E=(0,c.A)(z,2),U=E[0],H=E[1],G=(0,d.useState)(null),W=(0,c.A)(G,2),O=W[0],q=W[1],V=(0,d.useState)(null),K=(0,c.A)(V,2),Y=K[0],J=K[1],X=(0,d.useState)(null),Q=(0,c.A)(X,2),Z=Q[0],$=Q[1],ee=(0,d.useState)(!1),te=(0,c.A)(ee,2),ne=te[0],se=te[1],ae=(0,d.useRef)(null),re=(0,d.useRef)(null),ie=(0,d.useRef)(null),oe=function(){var e;null===(e=ae.current)||void 0===e||e.scrollIntoView({behavior:"smooth"})};(0,d.useEffect)((function(){N&&ie.current&&ie.current.focus()}),[N]);var le=function(){var e=(0,l.A)((0,a.A)().m((function e(){var n,l,c,d,u,m,x,f,p,g,b,j,y,v,A,w,_,C,S,L,D,B,T,R,P;return(0,a.A)().w((function(e){for(;;)switch(e.p=e.n){case 0:if(F.trim()&&t){e.n=1;break}return e.a(2);case 1:return n=h.Ay.util.Session.getID(),l=Date.now(),c={sender:"user",text:F},M((function(e){return[].concat((0,o.A)(e),[c])})),I(""),H(!0),$(null),N||k(!0),setTimeout(oe,100),e.p=2,u=(0,i.A)({user_id:n,title_id:t,message:c.text},O&&{conversation_id:O}),M((function(e){return[].concat((0,o.A)(e),[{sender:"bot",text:"",id:l,isStreaming:!0}])})),e.n=3,fetch("https://chat.glitch.fun/api/game_chat",{method:"POST",headers:{"Content-Type":"application/json",Authorization:h.Ay.util.Session.getAuthToken()},body:JSON.stringify(u)});case 3:if((m=e.v).ok){e.n=5;break}return e.n=4,m.json();case 4:throw x=e.v,new Error(x.error||"HTTP error! status: ".concat(m.status));case 5:if(null===(d=m.headers.get("content-type"))||void 0===d?void 0:d.includes("text/event-stream")){e.n=7;break}return e.n=6,m.json();case 6:f=e.v,M((function(e){return e.map((function(e){return e.id===l?(0,i.A)((0,i.A)({},e),{},{text:f.response,isStreaming:!1}):e}))})),!O&&f.conversation_id&&q(f.conversation_id),e.n=20;break;case 7:p=m.body.getReader(),g=new TextDecoder,b="",j="",y=null;case 8:return e.n=9,p.read();case 9:if(v=e.v,A=v.done,w=v.value,!A){e.n=10;break}return e.a(3,20);case 10:_=g.decode(w,{stream:!0}),C=(j+=_).split("\n"),j=C.pop(),S=(0,r.A)(C),e.p=11,D=(0,a.A)().m((function e(){var t,n,s,r,o,c,d;return(0,a.A)().w((function(e){for(;;)switch(e.p=e.n){case 0:if(t=L.value,""!==(n=t.trim())){e.n=1;break}return e.a(2,0);case 1:if(!n.startsWith("event:")){e.n=2;break}return y=n.slice(6).trim(),e.a(2,0);case 2:if(!n.startsWith("id:")&&!n.startsWith("retry:")){e.n=3;break}return e.a(2,0);case 3:if(e.p=3,"[DONE]"!==(s=n.startsWith("data:")?n.slice(5).trim():n)){e.n=4;break}return M((function(e){return e.map((function(e){return e.id===l?(0,i.A)((0,i.A)({},e),{},{isStreaming:!1}):e}))})),e.a(2,0);case 4:!(r=JSON.parse(s)).event&&y&&(r.event=y),y=null,c=r.event,e.n="start"===c?5:"message"===c?6:"complete"===c?7:"error"===c?8:9;break;case 5:return r.conversation_id&&!O&&q(r.conversation_id),e.a(3,10);case 6:return b+=r.content,o=b,M((function(e){return e.map((function(e){return e.id===l?(0,i.A)((0,i.A)({},e),{},{text:o}):e}))})),e.a(3,10);case 7:return J(r.messages_left),M((function(e){return e.map((function(e){return e.id===l?(0,i.A)((0,i.A)({},e),{},{isStreaming:!1}):e}))})),e.a(3,10);case 8:return M((function(e){return e.map((function(e){return e.id===l?(0,i.A)((0,i.A)({},e),{},{text:r.error||"Unknown error during streaming",isStreaming:!1}):e}))})),H(!1),e.a(2,{v:void 0});case 9:return e.a(3,10);case 10:e.n=12;break;case 11:e.p=11,d=e.v,console.error("Parse error",d);case 12:return e.a(2)}}),e,null,[[3,11]])})),S.s();case 12:if((L=S.n()).done){e.n=16;break}return e.d((0,s.A)(D()),13);case 13:if(0!==(B=e.v)){e.n=14;break}return e.a(3,15);case 14:if(!B){e.n=15;break}return e.a(2,B.v);case 15:e.n=12;break;case 16:e.n=18;break;case 17:e.p=17,R=e.v,S.e(R);case 18:return e.p=18,S.f(),e.f(18);case 19:e.n=8;break;case 20:e.n=22;break;case 21:e.p=21,P=e.v,console.error("Chat error:",P),M((function(e){return e.filter((function(e){return e.id!==l}))})),T="Sorry, I encountered an error. Please try again.",P.message.includes("limit_exceeded")&&$(T="You have reached your message limit. Please upgrade your subscription."),M((function(e){return[].concat((0,o.A)(e),[{sender:"bot",text:T,isStreaming:!1,isError:!0}])}));case 22:return e.p=22,H(!1),e.f(22);case 23:return e.a(2)}}),e,null,[[11,17,18,19],[2,21,22,23]])})));return function(){return e.apply(this,arguments)}}(),ce=S?{position:"fixed",bottom:"20px",right:"20px",width:"400px",height:"600px",zIndex:1050,resize:"both",overflow:"hidden",boxShadow:"0 0 20px rgba(0,0,0,0.2)",display:"flex",flexDirection:"column",minWidth:"300px",minHeight:"400px",maxWidth:"90vw",maxHeight:"90vh"}:{marginBottom:"1.5rem",transition:"all 0.3s ease"};return(0,f.jsxs)("div",{className:"card shadow-sm border-0",style:ce,children:[(0,f.jsxs)("div",{className:"card-header bg-white border-bottom py-3 cursor-pointer d-flex justify-content-between align-items-center",onClick:function(){return!S&&k(!N)},style:{cursor:S?"default":"pointer",flexShrink:0},children:[(0,f.jsxs)("div",{className:"d-flex align-items-center overflow-hidden",children:[(0,f.jsx)("div",{className:"p-2 rounded-circle me-3 ".concat(N||S?"bg-primary text-white":"bg-light text-primary"),children:(0,f.jsx)(u.gc,{icon:m.UBk,size:"lg"})}),(0,f.jsxs)("div",{className:"text-truncate",children:[(0,f.jsx)("h5",{className:"mb-0 text-black text-truncate",children:g}),(0,f.jsx)("small",{className:"text-muted text-truncate d-block",children:j})]})]}),(0,f.jsxs)("div",{className:"d-flex align-items-center ms-2",children:[(0,f.jsx)("button",{className:"btn btn-link text-muted p-1 me-2",onClick:function(e){e.stopPropagation(),L(!S),S||k(!0)},title:S?"Dock chat":"Pop out chat",children:(0,f.jsx)(u.gc,{icon:S?m.gr3:m.oZK})}),!S&&(0,f.jsx)("div",{className:"text-muted",children:(0,f.jsx)(u.gc,{icon:N?m.w2A:m.Jt$})})]})]}),(0,f.jsx)("div",{className:"card-body p-0 d-flex flex-column",style:{flexGrow:1,overflow:"hidden"},children:N||S?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{className:"chat-messages p-3 position-relative",style:{flexGrow:1,overflowY:"auto",backgroundColor:"#f8f9fa",height:S?"100%":v},ref:re,onScroll:function(){if(re.current){var e=re.current,t=e.scrollTop,n=e.scrollHeight,s=e.clientHeight;se(!(n-t-s<50))}},children:[0===T.length?(0,f.jsxs)("div",{className:"text-center text-muted mt-5",children:[(0,f.jsx)(u.gc,{icon:m.UBk,size:"2x",className:"mb-3 opacity-25"}),(0,f.jsxs)("p",{children:["Start a conversation to analyze ",n,"'s data."]}),(0,f.jsxs)("div",{className:"d-flex justify-content-center gap-2 mt-3 flex-wrap",children:[(0,f.jsx)("button",{className:"btn btn-sm btn-outline-secondary bg-white",onClick:function(){I("Summarize my recent social performance")},children:"Summarize performance"}),(0,f.jsx)("button",{className:"btn btn-sm btn-outline-secondary bg-white",onClick:function(){I("Which platform has the best engagement?")},children:"Best platform?"}),(0,f.jsx)("button",{className:"btn btn-sm btn-outline-secondary bg-white",onClick:function(){I("How can I improve my reach?")},children:"Improve reach"})]})]}):T.map((function(e,t){return(0,f.jsx)("div",{className:"d-flex mb-3 ".concat("user"===e.sender?"justify-content-end":"justify-content-start"),children:(0,f.jsx)("div",{className:"p-3 rounded-3 shadow-sm ".concat("user"===e.sender?"bg-primary text-white":"bg-white text-black border ai-response-content"),style:{maxWidth:"85%",minWidth:"100px"},children:"bot"===e.sender?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("span",{dangerouslySetInnerHTML:{__html:e.text}}),e.isStreaming&&(0,f.jsxs)("span",{className:"typing-indicator ms-1",children:[(0,f.jsx)("span",{children:"."}),(0,f.jsx)("span",{children:"."}),(0,f.jsx)("span",{children:"."})]})]}):e.text})},t)})),(0,f.jsx)("div",{ref:ae}),ne&&(0,f.jsx)("button",{className:"btn btn-primary btn-sm rounded-circle shadow position-absolute",style:{bottom:"20px",right:"20px",width:"40px",height:"40px",zIndex:10},onClick:oe,children:(0,f.jsx)(u.gc,{icon:m.B0C})})]}),(0,f.jsxs)("div",{className:"p-3 bg-white border-top",style:{flexShrink:0},children:[Z&&(0,f.jsxs)("div",{className:"alert alert-warning py-2 small mb-2",children:[Z," ",(0,f.jsx)(x.N_,{to:"/communities",className:"fw-bold",children:"Upgrade Plan"})]}),(0,f.jsxs)("div",{className:"input-group",children:[(0,f.jsx)("input",{ref:ie,type:"text",className:"form-control",placeholder:"Ask a question about your reports...",value:F,onChange:function(e){return I(e.target.value)},onKeyDown:function(e){return"Enter"===e.key&&le()},disabled:U}),(0,f.jsx)("button",{className:"btn btn-primary",onClick:le,disabled:U||!F.trim(),children:(0,f.jsx)(u.gc,{icon:m.isI})})]}),null!==Y&&Y<5&&(0,f.jsx)("div",{className:"text-end mt-1",children:(0,f.jsxs)("small",{className:"text-muted",style:{fontSize:"0.7rem"},children:[Y," messages left"]})})]})]}):(0,f.jsx)("div",{className:"p-3 bg-light",onClick:function(){return k(!0)},style:{cursor:"text"},children:(0,f.jsxs)("div",{className:"input-group",children:[(0,f.jsx)("span",{className:"input-group-text bg-white border-end-0 text-muted",children:(0,f.jsx)(u.gc,{icon:m.MjD})}),(0,f.jsx)("input",{type:"text",className:"form-control border-start-0",placeholder:"Ask a question about ".concat(n,"'s data..."),readOnly:!0,style:{backgroundColor:"#fff",cursor:"text"}}),(0,f.jsx)("button",{className:"btn btn-primary",children:(0,f.jsx)(u.gc,{icon:m.isI})})]})})}),(0,f.jsx)("style",{children:"\n                .typing-indicator span { animation: blink 1.4s infinite both; margin: 0 1px; }\n                .typing-indicator span:nth-child(2) { animation-delay: 0.2s; }\n                .typing-indicator span:nth-child(3) { animation-delay: 0.4s; }\n                @keyframes blink { 0% { opacity: 0.2; } 20% { opacity: 1; } 100% { opacity: 0.2; } }\n                \n                /* AI Response Formatting */\n                .ai-response-content { font-size: 0.9rem; line-height: 1.5; }\n                .ai-response-content h1, .ai-response-content h2, .ai-response-content h3, .ai-response-content h4, .ai-response-content h5, .ai-response-content h6 { \n                    font-size: 1.1rem !important; font-weight: 700; margin-top: 10px; margin-bottom: 5px; color: #000;\n                }\n                .ai-response-content p { margin-bottom: 8px; color: #000; }\n                .ai-response-content ul, .ai-response-content ol { padding-left: 20px; margin-bottom: 8px; }\n                .ai-response-content li { margin-bottom: 4px; color: #000; }\n                .ai-response-content strong { font-weight: 600; color: #000; }\n                .ai-response-content table { width: 100%; font-size: 0.85rem; margin-bottom: 10px; border-collapse: collapse; }\n                .ai-response-content th { background: #f1f3f5; font-weight: 600; padding: 4px 8px; border: 1px solid #dee2e6; color: #000; }\n                .ai-response-content td { padding: 4px 8px; border: 1px solid #dee2e6; color: #000; }\n            "})]})}},49923:function(e,t,n){"use strict";n.r(t);var s=n(64467),a=n(89379),r=n(5544),i=n(88094),o=n(45256),l=n(59272),c=n(61656),d=n(58166),h=n(33841),u=n(33183),m=n(19307),x=n(70518),f=n(99763),p=n(95465),g=n(55197),b=n(30292),j=n(357),y=n(82566),v=n(93590),A=n(79114),w=n(14676),N=n(15678),k=function(e){return e instanceof Date?(0,w.GP)(e,"yyyy-MM-dd"):""},_=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=parseFloat(e);return isNaN(n)||!isFinite(n)?"0.0":n.toFixed(t)},C=function(e){var t=e.text;return(0,N.jsx)(f.A,{overlay:(0,N.jsx)(y.A,{children:t}),children:(0,N.jsx)("i",{className:"fas fa-info-circle text-white ms-2",style:{cursor:"help",fontSize:"0.9em"}})})},S=function(e){var t=e.platform,n=(null===t||void 0===t?void 0:t.toLowerCase())||"unknown",s="fas fa-bullhorn",a="#6c757d",r=t||"Unknown";return n.includes("facebook")?(s="fab fa-facebook",a="#1877F2",r="Facebook/Meta"):n.includes("google")?(s="fab fa-google",a="#4285F4",r="Google Ads"):n.includes("tiktok")?(s="fab fa-tiktok",a="#000000",r="TikTok"):n.includes("twitter")?(s="fab fa-twitter",a="#1DA1F2",r="Twitter/X"):n.includes("reddit")&&(s="fab fa-reddit-alien",a="#FF4500",r="Reddit"),(0,N.jsx)("i",{className:"".concat(s," me-2"),style:{color:a},title:r})};t.default=function(e){var t=e.titleId,n=e.startDate,f=e.endDate,y=(0,i.useState)(!0),w=(0,r.A)(y,2),L=w[0],D=w[1],B=(0,i.useState)(null),T=(0,r.A)(B,2),M=T[0],R=T[1],P=(0,i.useState)(null),F=(0,r.A)(P,2),I=F[0],z=F[1],E=(0,i.useState)({utm_source:"",utm_campaign:"",ad_platform:""}),U=(0,r.A)(E,2),H=U[0],G=U[1],W=(0,i.useCallback)((function(){if(!t||!n||!f)return R("Missing required parameters to generate the report."),void D(!1);var e=(0,a.A)({title_id:t,start_date:k(n),end_date:k(f)},Object.fromEntries(Object.entries(H).filter((function(e){var t=(0,r.A)(e,2),n=(t[0],t[1]);return""!==n&&null!==n}))));D(!0),R(null),o.Ay.api.Fingerprinting.adCampaignPerformanceReport(e).then((function(e){return z(e.data)})).catch((function(e){var t,n=(null===e||void 0===e||null===(t=e.response)||void 0===t||null===(t=t.data)||void 0===t?void 0:t.message)||(null===e||void 0===e?void 0:e.message)||"Failed to load campaign performance data.";console.error("[AdCampaignPerformanceReport]",n,e),R(n)})).finally((function(){return D(!1)}))}),[t,n,f,H]);(0,i.useEffect)(W,[W]);var O=I||{},q=O.summary,V=O.ad_platforms,K=O.utm_campaigns,Y=O.time_analysis,J=function(e){G((function(t){return(0,a.A)((0,a.A)({},t),{},(0,s.A)({},e.target.name,e.target.value))}))},X=(0,i.useMemo)((function(){return V&&0!==V.length?{backgroundColor:"transparent",tooltip:{trigger:"item",formatter:"{b}<br/>Installs: {c} ({d}%)"},legend:{top:"bottom",icon:"circle",textStyle:{color:"#fff"}}
1,series:[{name:"Installs by Ad Platform",type:"pie",radius:["40%","70%"],avoidLabelOverlap:!1,itemStyle:{borderRadius:5,borderColor:"#232a5c",borderWidth:2},label:{show:!1,position:"center"},emphasis:{label:{show:!0,fontSize:"20",fontWeight:"bold",color:"#fff"}},data:V.map((function(e){return{value:e.installs,name:e.platform}}))}]}:null}),[V]),Q=(0,i.useMemo)((function(){var e;return null!==Y&&void 0!==Y&&null!==(e=Y.conversion_windows)&&void 0!==e&&e.length?{backgroundColor:"transparent",tooltip:{trigger:"axis",axisPointer:{type:"shadow"}},xAxis:{type:"category",data:Y.conversion_windows.map((function(e){return e.window})),axisLabel:{color:"#ccc"},axisLine:{lineStyle:{color:"#555"}}},yAxis:{type:"value",name:"Installs",axisLabel:{color:"#ccc"},splitLine:{lineStyle:{color:"#333"}}},grid:{left:"10%",right:"4%",bottom:"15%",containLabel:!0},series:[{name:"Installs",type:"bar",data:Y.conversion_windows.map((function(e){return e.conversions})),itemStyle:{color:new A.graphic.LinearGradient(0,0,0,1,[{offset:0,color:"#28a745"},{offset:1,color:"#20c997"}]),borderRadius:[4,4,0,0]}}]}:null}),[Y]);return L?(0,N.jsx)(u.A,{className:"bg-transparent border-0",children:(0,N.jsxs)(u.A.Body,{className:"text-center py-5",children:[(0,N.jsx)(b.A,{animation:"border",variant:"primary"}),(0,N.jsx)("p",{className:"mt-3 text-white",children:"Analyzing ad performance..."})]})}):M?(0,N.jsxs)(c.A,{variant:"danger",children:[(0,N.jsx)("strong",{children:"Error:"})," ",M]}):q&&0!==q.total_ad_clicks?(0,N.jsxs)(i.Fragment,{children:[(0,N.jsx)(u.A,{className:"mb-4 shadow-sm border-0",style:{backgroundColor:"#1a2040"},children:(0,N.jsx)(u.A.Body,{className:"p-4",children:(0,N.jsxs)("div",{className:"d-flex align-items-start",children:[(0,N.jsx)("div",{className:"me-3 d-none d-md-block",children:(0,N.jsx)("div",{className:"rounded-circle bg-primary d-flex align-items-center justify-content-center",style:{width:"60px",height:"60px"},children:(0,N.jsx)("i",{className:"fas fa-ad text-white fs-3"})})}),(0,N.jsxs)("div",{children:[(0,N.jsx)("h4",{className:"text-white fw-bold mb-2",children:"Ad Campaign ROI"}),(0,N.jsx)("p",{className:"text-white mb-0",style:{maxWidth:"800px"},children:"Connect your ad spend to real players. This report tracks users from the moment they click an ad (on Facebook, Google, etc.) to the moment they install your game, even if they switch devices in between."})]})]})})}),(0,N.jsx)(l.A,{className:"mb-4 custom-accordion-dark",children:(0,N.jsxs)(l.A.Item,{eventKey:"0",style:{backgroundColor:"#232a5c",border:"1px solid rgba(255,255,255,0.1)"},children:[(0,N.jsx)(l.A.Header,{children:(0,N.jsxs)("span",{className:"text-white",children:[(0,N.jsx)("i",{className:"fas fa-filter me-2"}),"Filter Report Data"]})}),(0,N.jsx)(l.A.Body,{className:"bg-dark bg-opacity-25",children:(0,N.jsxs)(g.A,{className:"align-items-end g-3",children:[(0,N.jsx)(m.A,{md:3,children:(0,N.jsxs)(x.A.Group,{children:[(0,N.jsx)(x.A.Label,{className:"text-white small text-uppercase fw-bold",children:"UTM Source"}),(0,N.jsx)(x.A.Control,{type:"text",name:"utm_source",value:H.utm_source,onChange:J,placeholder:"e.g., facebook",className:"bg-dark text-white border-secondary"})]})}),(0,N.jsx)(m.A,{md:3,children:(0,N.jsxs)(x.A.Group,{children:[(0,N.jsx)(x.A.Label,{className:"text-white small text-uppercase fw-bold",children:"UTM Campaign"}),(0,N.jsx)(x.A.Control,{type:"text",name:"utm_campaign",value:H.utm_campaign,onChange:J,placeholder:"e.g., summer_sale",className:"bg-dark text-white border-secondary"})]})}),(0,N.jsx)(m.A,{md:3,children:(0,N.jsxs)(x.A.Group,{children:[(0,N.jsx)(x.A.Label,{className:"text-white small text-uppercase fw-bold",children:"Ad Platform"}),(0,N.jsxs)(x.A.Select,{name:"ad_platform",value:H.ad_platform,onChange:J,className:"bg-dark text-white border-secondary",children:[(0,N.jsx)("option",{value:"",children:"All Platforms"}),(0,N.jsx)("option",{value:"facebook",children:"Facebook"}),(0,N.jsx)("option",{value:"google",children:"Google"}),(0,N.jsx)("option",{value:"tiktok",children:"TikTok"}),(0,N.jsx)("option",{value:"twitter",children:"Twitter/X"}),(0,N.jsx)("option",{value:"reddit",children:"Reddit"})]})]})}),(0,N.jsxs)(m.A,{md:3,className:"d-flex justify-content-end",children:[(0,N.jsx)(h.A,{variant:"outline-light",onClick:function(){G({utm_source:"",utm_campaign:"",ad_platform:""})},className:"me-2",children:"Reset"}),(0,N.jsx)(h.A,{variant:"primary",onClick:W,children:"Apply Filters"})]})]})})]})}
1),(0,N.jsxs)(g.A,{className:"g-4 mb-4",children:[(0,N.jsx)(m.A,{md:3,children:(0,N.jsx)(u.A,{className:"h-100 border-0 shadow-sm",style:{backgroundColor:"#232a5c"},children:(0,N.jsxs)(u.A.Body,{className:"text-center",children:[(0,N.jsxs)("h6",{className:"text-uppercase text-white small fw-bold mb-2",children:["Tracked Ad Clicks",(0,N.jsx)(C,{text:"Total clicks from links with ad tracking IDs (like gclid, fbclid)."})]}),(0,N.jsx)("h2",{className:"text-white fw-bold mb-0",children:q.total_ad_clicks.toLocaleString()})]})})}),(0,N.jsx)(m.A,{md:3,children:(0,N.jsx)(u.A,{className:"h-100 border-0 shadow-sm",style:{backgroundColor:"#232a5c"},children:(0,N.jsxs)(u.A.Body,{className:"text-center",children:[(0,N.jsxs)("h6",{className:"text-uppercase text-white small fw-bold mb-2",children:["Attributed Installs",(0,N.jsx)(C,{text:"Total game installs that we could confidently link back to an ad click."})]}),(0,N.jsx)("h2",{className:"text-success fw-bold mb-0",children:q.total_installs.toLocaleString()})]})})}),(0,N.jsx)(m.A,{md:3,children:(0,N.jsx)(u.A,{className:"h-100 border-0 shadow-sm",style:{backgroundColor:"#232a5c"},children:(0,N.jsxs)(u.A.Body,{className:"text-center",children:[(0,N.jsxs)("h6",{className:"text-uppercase text-white small fw-bold mb-2",children:["Conversion Rate",(0,N.jsx)(C,{text:"The percentage of tracked ad clicks that resulted in a game install."})]}),(0,N.jsxs)("h2",{className:"text-primary fw-bold mb-0",children:[_(q.overall_conversion_rate),"%"]})]})})}),(0,N.jsx)(m.A,{md:3,children:(0,N.jsx)(u.A,{className:"h-100 border-0 shadow-sm",style:{backgroundColor:"#232a5c"},children:(0,N.jsxs)(u.A.Body,{className:"text-center",children:[(0,N.jsxs)("h6",{className:"text-uppercase text-white small fw-bold mb-2",children:["Cross-Device Rate",(0,N.jsx)(C,{text:"The percentage of installs that happened on a different device than the one the ad was clicked on."})]}),(0,N.jsxs)("h2",{className:"text-info fw-bold mb-0",children:[_(q.cross_device_rate),"%"]})]})})})]}),(0,N.jsxs)(g.A,{className:"g-4 mb-4",children:[(0,N.jsx)(m.A,{lg:7,children:(0,N.jsxs)(u.A,{className:"h-100 border-0 shadow-sm",style:{backgroundColor:"#232a5c"},children:[(0,N.jsx)(u.A.Header,{className:"bg-transparent border-bottom border-secondary py-3",children:(0,N.jsxs)("h6",{className:"mb-0 text-white",children:[(0,N.jsx)("i",{className:"fas fa-bullhorn me-2"}),"Installs by Ad Platform"]})}),(0,N.jsx)(u.A.Body,{children:X?(0,N.jsx)(v.A,{echarts:A,option:X||{},style:{height:300},notMerge:!0}):(0,N.jsx)(c.A,{variant:"light",className:"text-center",children:"No install data from ad platforms in this period."})})]})}),(0,N.jsx)(m.A,{lg:5,children:(0,N.jsxs)(u.A,{className:"h-100 border-0 shadow-sm",style:{backgroundColor:"#232a5c"},children:[(0,N.jsx)(u.A.Header,{className:"bg-transparent border-bottom border-secondary py-3",children:(0,N.jsxs)("h6",{className:"mb-0 text-white",children:[(0,N.jsx)("i",{className:"fas fa-hourglass-half me-2"}),"Time to Install"]})}),(0,N.jsxs)(u.A.Body,{children:[(0,N.jsx)("p",{className:"text-white small mb-3",children:"How long it takes for a user to install after clicking an ad."}),Q?(0,N.jsx)(v.A,{echarts:A,option:Q||{},style:{height:265},notMerge:!0}):(0,N.jsx)(c.A,{variant:"light",className:"text-center",children:"No conversion time data available."})]})]})})]}),(0,N.jsxs)(u.A,{className:"border-0 shadow-sm",style:{backgroundColor:"#232a5c"},children:[(0,N.jsx)(u.A.Header,{className:"bg-transparent border-bottom border-secondary py-3",children:(0,N.jsxs)("h5",{className:"mb-0 text-white",children:[(0,N.jsx)("i",{className:"fas fa-list me-2"}),"Campaign Performance Details"]})}),(0,N.jsx)(u.A.Body,{className:"p-0",children:(0,N.jsx)("div",{className:"table-responsive",children:(0,N.jsxs)(j.A,{hover:!0,variant:"dark",className:"mb-0 align-middle",children:[(0,N.jsx)("thead",{children:(0,N.jsxs)("tr",{children:[(0,N.jsx)("th",{children:"Campaign / Source"}),(0,N.jsx)("th",{className:"text-center",children:"Clicks"}),(0,N.jsx)("th",{className:"text-center",children:"Installs"}),(0,N.jsx)("th",{style:{minWidth:"150px"},children:"Conversion Rate"}),(0,N.jsx)("th",{className:"text-center",children:"Cross-Device"})]})}),(0,N.jsx)("tbody",{children:null===K||void 0===K?void 0:K.map((function(e,t){return(0,N.jsxs)("tr",{children:[(0,N.jsxs)("td",{children:[(0,N.jsx)("div",{className:"fw-bold text-white",children:e.utm_campaign||(0,N.jsx)("span",{className:"text-white fst-italic",children:"No Campaign Name"})}),(0,N.jsxs)("div",{className:"small text-white d-flex align-items-center mt-1",children:[(0,N.jsx)(S,{platform:e.utm_source}),e.utm_source||"direct"," / ",e.utm_medium||"organic"]})]}),(0,N.jsx)("td",{className:"text-center",children:e.clicks.toLocaleStr
1ing()}),(0,N.jsx)("td",{className:"text-center fw-bold text-success",children:e.installs.toLocaleString()}),(0,N.jsx)("td",{children:(0,N.jsxs)("div",{className:"d-flex align-items-center",children:[(0,N.jsx)("div",{className:"flex-grow-1 me-2",children:(0,N.jsx)(p.A,{now:e.conversion_rate,variant:"primary",style:{height:"6px",backgroundColor:"rgba(255,255,255,0.1)"}})}),(0,N.jsxs)("span",{className:"small text-white",children:[_(e.conversion_rate),"%"]})]})}),(0,N.jsx)("td",{className:"text-center",children:e.cross_device_installs>0?(0,N.jsxs)(d.A,{bg:"info",className:"fw-normal",children:[e.cross_device_installs,(0,N.jsx)(C,{text:"".concat(_(e.cross_device_installs/e.installs*100),"% of installs from this campaign were cross-device.")})]}):(0,N.jsx)("span",{className:"text-white",children:"-"})})]},t)}))})]})})})]}),(0,N.jsx)("style",{jsx:"true",children:"\n                .custom-accordion-dark .accordion-button {\n                    background-color: transparent;\n                    color: #fff;\n                    box-shadow: none;\n                }\n                .custom-accordion-dark .accordion-button:not(.collapsed) {\n                    background-color: rgba(255, 255, 255, 0.05);\n                    color: #fff;\n                }\n                .custom-accordion-dark .accordion-button::after {\n                    filter: invert(1);\n                }\n            "})]}):(0,N.jsx)(u.A,{className:"bg-transparent border-0",children:(0,N.jsx)(u.A.Body,{children:(0,N.jsx)(c.A,{variant:"info",children:"No ad clicks were tracked in this period. Make sure your marketing links include UTM or platform-specific click ID parameters (like gclid or fbclid)."})})})}},57233:function(e,t,n){"use strict";n.r(t);var s=n(60436),a=n(91212),r=n(10467),i=n(5544),o=n(88094),l=n(45256),c=n(61656),d=n(58166),h=n(33841),u=n(33183),m=n(19307),x=n(70518),f=n(99763),p=n(55197),g=n(30292),b=n(357),j=n(82566),y=n(79114),v=n(93590),A=n(14676),w=n(15678),N=function(e){return e instanceof Date?(0,A.GP)(e,"yyyy-MM-dd"):""},k=[{id:"first_touch",name:"First Touch",desc:"Gives 100% credit to the very first interaction a user had with your brand."},{id:"last_touch",name:"Last Touch",desc:"Gives 100% credit to the final interaction before the user converted."},{id:"linear",name:"Linear",desc:"Splits credit equally across every interaction in the user's journey."},{id:"time_decay",name:"Time Decay",desc:"Gives more credit to interactions that happened closer to the conversion."},{id:"position_based",name:"U-Shaped",desc:"Gives 40% credit to first and last interactions, splitting the rest among the middle."}],_=[{id:"game_install",name:"Game Install",icon:"fas fa-download"},{id:"game_purchase",name:"Purchase",icon:"fas fa-shopping-cart"},{id:"web_event",name:"Web Event",icon:"fas fa-mouse-pointer"}],C=function(e){var t=e.text;return(0,w.jsx)(f.A,{overlay:(0,w.jsx)(j.A,{children:t}),children:(0,w.jsx)("i",{className:"fas fa-info-circle text-white ms-2",style:{cursor:"help",fontSize:"0.9em"}})})};t.default=function(e){var t,n,A,S=e.titleId,L=e.startDate,D=e.endDate,B=(0,o.useState)(!0),T=(0,i.A)(B,2),M=T[0],R=T[1],P=(0,o.useState)(null),F=(0,i.A)(P,2),I=F[0],z=F[1],E=(0,o.useState)(null),U=(0,i.A)(E,2),H=U[0],G=U[1],W=(0,o.useState)("last_touch"),O=(0,i.A)(W,2),q=O[0],V=O[1],K=(0,o.useState)("game_install"),Y=(0,i.A)(K,2),J=Y[0],X=Y[1],Q=(0,o.useRef)(null),Z=(0,o.useCallback)((0,r.A)((0,a.A)().m((function e(){var t,n,s,r;return(0,a.A)().w((function(e){for(;;)switch(e.p=e.n){case 0:if(S){e.n=1;break}return e.a(2);case 1:return R(!0),G(null),e.p=2,t={title_id:S,start_date:N(L),end_date:N(D),min_confidence:60,attribution_model:q,conversion_event:J},e.n=3,l.Ay.api.Fingerprinting.attributionReport(t);case 3:n=e.v,z(n.data||{}),e.n=5;break;case 4:e.p=4,r=e.v,console.error("Error fetching attribution data:",r),G((null===(s=r.response)||void 0===s||null===(s=s.data)||void 0===s?void 0:s.message)||"Failed to load attribution data.");case 5:return e.p=5,R(!1),e.f(5);case 6:return e.a(2)}}),e,null,[[2,4,5,6]])}))),[S,L,D,q,J]);(0,o.useEffect)((function(){Z()}),[Z]);var $=(0,o.useMemo)((function(){var e;return null!==I&&void 0!==I&&null!==(e=I.attribution_breakdown)&&void 0!==e&&e.length?{backgroundColor:"transparent",tooltip:{trigger:"item",formatter:"{b}: {c} ({d}%)"},legend:{orient:"vertical",left:"left",textStyle:{color:"#fff"}}
1,series:[{name:"Source",type:"pie",radius:["40%","70%"],avoidLabelOverlap:!1,itemStyle:{borderRadius:5,borderColor:"#232a5c",borderWidth:2},label:{show:!1,position:"center"},emphasis:{label:{show:!0,fontSize:16,fontWeight:"bold",color:"#fff"}},data:I.attribution_breakdown.map((function(e){return{value:e.conversions,name:e.source}}))}]}:{}}),[I]),ee=(0,o.useMemo)((function(){var e;if(null===I||void 0===I||null===(e=I.common_paths)||void 0===e||!e.length)return{};var t=(0,s.A)(I.common_paths).sort((function(e,t){return t.count-e.count})).slice(0,5);return{backgroundColor:"transparent",tooltip:{trigger:"axis",axisPointer:{type:"shadow"}},grid:{left:"3%",right:"4%",bottom:"10%",containLabel:!0},xAxis:{type:"category",data:t.map((function(e){return e.path.join(" \u2192 ")})),axisLabel:{interval:0,rotate:20,color:"#ccc",width:100,overflow:"truncate"},axisLine:{lineStyle:{color:"#555"}}},yAxis:{type:"value",axisLabel:{color:"#ccc"},splitLine:{lineStyle:{color:"#333"}}},series:[{data:t.map((function(e){return e.count})),type:"bar",itemStyle:{color:new y.graphic.LinearGradient(0,0,0,1,[{offset:0,color:"#0d6efd"},{offset:1,color:"#0a58ca"}])},showBackground:!0,backgroundStyle:{color:"rgba(255,255,255,0.05)"}}]}}),[I]),te=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"fas fa-chart-bar",a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"text-primary";return(0,w.jsx)(u.A,{className:"h-100 border-0 shadow-sm",style:{backgroundColor:"#232a5c"},children:(0,w.jsxs)(u.A.Body,{className:"text-center",children:[(0,w.jsx)("h6",{className:"text-uppercase text-white small fw-bold mb-2",children:e}),(0,w.jsxs)("h2",{className:"fw-bold mb-0 ".concat(a),children:[t,n]}),(0,w.jsx)("i",{className:"".concat(s," position-absolute top-0 end-0 mt-3 me-3 text-white opacity-25 fs-4")})]})})};return M?(0,w.jsx)(u.A,{className:"bg-transparent border-0",children:(0,w.jsxs)(u.A.Body,{className:"text-center py-5",children:[(0,w.jsx)(g.A,{animation:"border",variant:"primary"}),(0,w.jsx)("p",{className:"mt-3 text-white",children:"Calculating attribution models..."})]})}):H?(0,w.jsx)(c.A,{variant:"danger",children:H}):I&&void 0!==I.total_conversions?(0,w.jsxs)(o.Fragment,{children:[(0,w.jsx)(u.A,{className:"mb-4 shadow-sm border-0",style:{backgroundColor:"#1a2040"},children:(0,w.jsx)(u.A.Body,{className:"p-4",children:(0,w.jsxs)("div",{className:"d-flex align-items-start",children:[(0,w.jsx)("div",{className:"me-3 d-none d-md-block",children:(0,w.jsx)("div",{className:"rounded-circle bg-success d-flex align-items-center justify-content-center",style:{width:"60px",height:"60px"},children:(0,w.jsx)("i",{className:"fas fa-project-diagram text-white fs-3"})})}),(0,w.jsxs)("div",{children:[(0,w.jsx)("h4",{className:"text-white fw-bold mb-2",children:"Marketing Attribution"}),(0,w.jsxs)("p",{className:"text-white mb-0",style:{maxWidth:"800px"},children:["Attribution helps you answer the question: ",(0,w.jsx)("strong",{children:'"Which marketing effort gets the credit?"'}),(0,w.jsx)("br",{}),'Since users often click multiple ads before installing, you can choose different "Models" below to decide how to split that credit.']})]})]})})}),(0,w.jsx)(u.A,{className:"mb-4 shadow-sm",style:{backgroundColor:"#232a5c",border:"1px solid rgba(255,255,255,0.1)"},children:(0,w.jsx)(u.A.Body,{children:(0,w.jsxs)(p.A,{className:"g-3",children:[(0,w.jsxs)(m.A,{md:6,children:[(0,w.jsxs)(x.A.Label,{className:"text-white fw-bold small text-uppercase",children:["Attribution Model ",(0,w.jsx)(C,{text:"Determines how credit is assigned to touchpoints in the user journey."})]}),(0,w.jsx)("div",{className:"d-flex flex-wrap gap-2",children:k.map((function(e){return(0,w.jsx)(f.A,{placement:"top",overlay:(0,w.jsx)(j.A,{children:e.desc}),children:(0,w.jsx)(h.A,{size:"sm",variant:q===e.id?"primary":"outline-light",onClick:function(){return V(e.id)},className:"flex-grow-1",children:e.name})},e.id)}))})]}),(0,w.jsxs)(m.A,{md:6,children:[(0,w.jsx)(x.A.Label,{className:"text-white fw-bold small text-uppercase",children:"Conversion Goal"}),(0,w.jsx)("div",{className:"d-flex flex-wrap gap-2",children:_.map((function(e){return(0,w.jsxs)(h.A,{size:"sm",variant:J===e.id?"success":"outline-light",onClick:function(){return X(e.id)},className:"flex-grow-1",children:[(0,w.jsx)("i",{className:"".concat(e.icon," me-2")}),e.name]},e.id)}))})]})]})})}
1),(0,w.jsxs)(p.A,{className:"g-4 mb-4",children:[(0,w.jsx)(m.A,{md:4,children:te("Total Conversions",I.total_conversions,"","fas fa-check-circle","text-success")}),(0,w.jsx)(m.A,{md:4,children:te("Conversion Rate",I.conversion_rate,"%","fas fa-percentage","text-info")}),(0,w.jsx)(m.A,{md:4,children:te("Avg Time to Convert",I.average_time_to_conversion," hrs","fas fa-clock","text-warning")})]}),(0,w.jsxs)(p.A,{className:"g-4 mb-4",children:[(0,w.jsx)(m.A,{lg:6,children:(0,w.jsxs)(u.A,{className:"h-100 border-0 shadow-sm",style:{backgroundColor:"#232a5c"},children:[(0,w.jsx)(u.A.Header,{className:"bg-transparent border-bottom border-secondary py-3",children:(0,w.jsx)("h6",{className:"mb-0 text-white",children:"Source Breakdown"})}),(0,w.jsx)(u.A.Body,{children:null!==(t=I.attribution_breakdown)&&void 0!==t&&t.length?(0,w.jsx)(v.A,{ref:Q,echarts:y,option:$||{},style:{height:300}}):(0,w.jsx)(c.A,{variant:"light",children:"No source data available."})})]})}),(0,w.jsx)(m.A,{lg:6,children:(0,w.jsxs)(u.A,{className:"h-100 border-0 shadow-sm",style:{backgroundColor:"#232a5c"},children:[(0,w.jsx)(u.A.Header,{className:"bg-transparent border-bottom border-secondary py-3",children:(0,w.jsx)("h6",{className:"mb-0 text-white",children:"Top Conversion Paths"})}),(0,w.jsx)(u.A.Body,{children:null!==(n=I.common_paths)&&void 0!==n&&n.length?(0,w.jsx)(v.A,{echarts:y,option:ee||{},style:{height:300}}):(0,w.jsx)(c.A,{variant:"light",children:"No path data available."})})]})})]}),(0,w.jsxs)(u.A,{className:"border-0 shadow-sm",style:{backgroundColor:"#232a5c"},children:[(0,w.jsx)(u.A.Header,{className:"bg-transparent border-bottom border-secondary py-3",children:(0,w.jsxs)("h5",{className:"mb-0 text-white",children:[(0,w.jsx)("i",{className:"fas fa-list me-2"}),"Common User Journeys"]})}),(0,w.jsx)(u.A.Body,{className:"p-0",children:null!==(A=I.common_paths)&&void 0!==A&&A.length?(0,w.jsx)("div",{className:"table-responsive",children:(0,w.jsxs)(b.A,{hover:!0,variant:"dark",className:"mb-0 align-middle",children:[(0,w.jsx)("thead",{children:(0,w.jsxs)("tr",{children:[(0,w.jsx)("th",{style:{minWidth:300},children:"Journey Path"}),(0,w.jsx)("th",{className:"text-center",children:"Conversions"}),(0,w.jsx)("th",{className:"text-center",children:"Rate"})]})}),(0,w.jsx)("tbody",{children:I.common_paths.slice(0,10).map((function(e,t){return(0,w.jsxs)("tr",{children:[(0,w.jsx)("td",{children:(0,w.jsx)("div",{className:"d-flex align-items-center flex-wrap gap-2",children:e.path.map((function(e,t){return(0,w.jsxs)(o.Fragment,{children:[t>0&&(0,w.jsx)("i",{className:"fas fa-chevron-right text-white small"}),(0,w.jsx)(d.A,{bg:"secondary",className:"fw-normal px-2 py-1",children:e})]},t)}))})}),(0,w.jsx)("td",{className:"text-center fw-bold text-success",children:e.count}),(0,w.jsxs)("td",{className:"text-center",children:[e.conversion_rate,"%"]})]},t)}))})]})}):(0,w.jsx)("div",{className:"p-4 text-center text-white",children:"No conversion paths found."})})]})]}):(0,w.jsx)(u.A,{className:"bg-transparent border-0",children:(0,w.jsx)(u.A.Body,{children:(0,w.jsx)(c.A,{variant:"info",children:"No attribution data found for this period."})})})}},51337:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return M}});var s={};n.r(s),n.d(s,{Axis:function(){return v._0},ChartView:function(){return v.OZ},ComponentModel:function(){return v.jT},ComponentView:function(){return v.bR},List:function(){return v.B8},Model:function(){return v.Kx},PRIORITY:function(){return v.FQ},SeriesModel:function(){return v.rP},color:function(){return v.yW},connect:function(){return v.Ng},dataTool:function(){return v.p5},dependencies:function(){return v.El},disConnect:function(){return v.zm},disconnect:function(){return v.Zf},dispose:function(){return v.AS},env:function(){return v._K},extendChartView:function(){return v.yX},extendComponentModel:function(){return v.rt},extendComponentView:function(){return v.NO},extendSeriesModel:function(){return v.NA},format:function(){return v.GP},getCoordinateSystemDimensions:function(){return v.Bo},getInstanceByDom:function(){return v.FP},getInstanceById:function(){return v.aQ},getMap:function(){return v.ZB},graphic:function(){return v.fA},helper:function(){return v.dw},init:function(){return v.Ts},innerDrawElementOnCanvas:function(){return v.UU},matrix:function(){return v.UP},number:function(){return v.ai},parseGeoJSON:function(){return v.l3},parseGeoJson:function(){return v.zI},registerAction:function(){return v.OH},registerCoordinateSystem:function(){return v.pX},registerLayout:function(){return v.Oh},registerLoading:function(){return v.Ej},registerLocale:function(){return v.E},registerMap:function(){return v.mz},registerPostInit:function(){return v.cf},registerPostUpdate:function(){return v.tb},registerPreprocessor:function(){return v.lP},registerProcessor:function(){return v.qg},registerTheme:function(){return v.bf},registerTransform:function(){return v.iY},registerUpdateLifecycle:function(){return v.xV},registerVisual:function(){return v.AF},setCanvasCreator:function(){return v.vV},setPlatformAPI:function(){return v.Gs},throttle:function(){return v.nF},time:function(){return v.kB},use:function(){return v.Yx},util:function(){return v.ZS},vector:function(){return v.i1},version:function(){return v.rE},zrUtil:function(){return v.F_},zrender:function(){return v.nd}});var a=n(64467),r=n(89379),i=n(5544),o=n(88094),l=n(45256),c=n(99763),d=n(82566),h=n(33183),u=n(30292),m=n(61656),x=n(55197),f=n(193
107),p=n(357),g=n(95465),b=n(58166),j=n(93590),y=n(57933),v=n(99528),A=n(93300),w=n(7104),N=n(53965),k=n(11315),_=n(70058),C=n(1308),S=n(14676),L=n(15678);y.Y([A.a,w.a,N.a,k.a,_.a,C.a]);var D=function(e){return e instanceof Date?(0,S.GP)(e,"yyyy-MM-dd"):""},B=[{key:"high",name:"High (\u226590%)",min:90,max:100,color:"#198754"},{key:"medium",name:"Medium (80\u201189%)",min:80,max:89,color:"#0dcaf0"},{key:"low",name:"Low (70\u201179%)",min:70,max:79,color:"#ffc107"},{key:"very_low",name:"Very\xa0Low (<70%)",min:0,max:69,color:"#dc3545"}],T=function(e){var t=e.text;return(0,L.jsx)(c.A,{overlay:(0,L.jsx)(d.A,{children:t}),children:(0,L.jsx)("i",{className:"fas fa-info-circle text-white ms-2",style:{cursor:"help",fontSize:"0.9em"}})})},M=function(e){var t,n,c,d,y=e.titleId,v=e.startDate,A=e.endDate,w=e.matchConfidence,N=(0,o.useState)({loading:!0,error:null,data:null}),k=(0,i.A)(N,2),_=k[0],C=k[1];(0,o.useEffect)((function(){if(y&&v&&A){var e={title_id:y,start_date:D(v),end_date:D(A),min_confidence:w};C({loading:!0,error:null,data:null}),l.Ay.api.Fingerprinting.deviceEnvironmentReport(e).then((function(e){var t;C({loading:!1,error:null,data:null!==(t=null===e||void 0===e?void 0:e.data)&&void 0!==t?t:null})})).catch((function(e){console.error("Confidence scoring fetch failed:",e),C({loading:!1,error:"Failed to load confidence\u2011scoring data.",data:null})}))}else C({loading:!1,error:"Missing required parameters.",data:null})}),[y,v,A,w]);var S=null!==(t=null===(n=_.data)||void 0===n?void 0:n.fingerprint_quality)&&void 0!==t?t:null,M=(0,o.useMemo)((function(){var e;if(null===S||void 0===S||null===(e=S.components_present)||void 0===e||!e.length)return[];var t=new Set;return S.components_present.filter((function(e){var n=(e.component||"").toLowerCase();return!t.has(n)&&(t.add(n),!0)}))}),[S]),R=(0,o.useMemo)((function(){var e=B.reduce((function(e,t){return(0,r.A)((0,r.A)({},e),{},(0,a.A)({},t.key,0))}),{});return M.forEach((function(t){var n,s=Math.max(0,Math.min(100,null!==(n=t.present_percentage)&&void 0!==n?n:0)),a=B.find((function(e){return s>=e.min&&s<=e.max}));a&&(e[a.key]+=1)})),e}),[M]),P=(0,o.useMemo)((function(){return M.length?{backgroundColor:"transparent",tooltip:{trigger:"item",formatter:"{b}: {c} components ({d}%)"},legend:{orient:"vertical",left:"left",top:"center",textStyle:{color:"#fff"}},series:[{type:"pie",radius:["50%","75%"],center:["60%","50%"],avoidLabelOverlap:!1,itemStyle:{borderRadius:5,borderColor:"#232a5c",borderWidth:2},label:{show:!1},data:B.map((function(e){return{value:R[e.key],name:e.name,itemStyle:{color:e.color}}})).filter((function(e){return e.value>0}))}]}:{}}),[R,M.length]),F=(0,o.useMemo)((function(){return M.length?{backgroundColor:"transparent",tooltip:{trigger:"axis",axisPointer:{type:"shadow"}},grid:{left:"3%",right:"4%",bottom:"3%",containLabel:!0},xAxis:{type:"category",data:M.map((function(e){var t;return null!==(t=e.component)&&void 0!==t?t:"unknown"})),axisLabel:{interval:0,rotate:30,color:"#ccc"},axisLine:{lineStyle:{color:"#555"}}},yAxis:{type:"value",max:100,axisLabel:{formatter:"{value}%",color:"#ccc"},splitLine:{lineStyle:{color:"#333"}}},series:[{type:"bar",showBackground:!0,backgroundStyle:{color:"rgba(255,255,255,0.05)"},data:M.map((function(e){var t,n,s=Math.max(0,Math.min(100,null!==(t=e.present_percentage)&&void 0!==t?t:0)),a=null!==(n=B.find((function(e){return s>=e.min&&s<=e.max})))&&void 0!==n?n:B[3];return{value:s,itemStyle:{color:a.color,borderRadius:[4,4,0,0]}}}))}]}:{}}),[M]),I=function(){return(0,L.jsx)(h.A,{className:"bg-transparent border-0",children:(0,L.jsxs)(h.A.Body,{className:"text-center py-5",children:[(0,L.jsx)(u.A,{animation:"border",variant:"primary"}),(0,L.jsx)("p",{className:"mt-3 text-white",children:"Analyzing data quality..."})]})})};return _.loading?(0,L.jsx)(I,{}):_.error?(0,L.jsx)(m.A,{variant:"danger",children:_.error}):S?(0,L.jsxs)(o.Fragment,{children:[(0,L.jsx)(h.A,{className:"mb-4 shadow-sm border-0",style:{backgroundColor:"#1a2040"},children:(0,L.jsx)(h.A.Body,{className:"p-4",children:(0,L.jsxs)("div",{className:"d-flex align-items-start",children:[(0,L.jsx)("div",{className:"me-3 d-none d-md-block",children:(0,L.jsx)("div",{className:"rounded-circle bg-info d-flex align-items-center justify-content-center",style:{width:"60px",height:"60px"},children:(0,L.jsx)("i",{className:"fas fa-check-double text-white fs-3"})})}),(0,L.jsxs)("div",{children:[(0,L.jsx)("h4",{className:"text-white fw-bold mb-2",children:"Data Confidence Score"}),(0,L.jsx)("p",{className:"text-white mb-0",style:{maxWidth:"800px"}
1,children:"How reliable is your data? This report analyzes the quality of the fingerprints we collect. A higher score means we have more data points (like screen resolution, audio context, etc.) to uniquely identify a user, leading to more accurate attribution."})]})]})})}),(0,L.jsxs)(x.A,{className:"g-4 mb-4",children:[(0,L.jsx)(f.A,{md:4,children:(0,L.jsx)(h.A,{className:"h-100 border-0 shadow-sm",style:{backgroundColor:"#232a5c"},children:(0,L.jsxs)(h.A.Body,{className:"text-center",children:[(0,L.jsxs)("h6",{className:"text-uppercase text-white small fw-bold mb-2",children:["Average Confidence",(0,L.jsx)(T,{text:"The average reliability score of all user profiles in this period."})]}),(0,L.jsx)("h2",{className:"fw-bold mb-0 ".concat(S.avg_confidence>=80?"text-success":"text-warning"),children:null!=S.avg_confidence?"".concat(S.avg_confidence,"%"):"N/A"})]})})}),(0,L.jsx)(f.A,{md:4,children:(0,L.jsx)(h.A,{className:"h-100 border-0 shadow-sm",style:{backgroundColor:"#232a5c"},children:(0,L.jsxs)(h.A.Body,{className:"text-center",children:[(0,L.jsxs)("h6",{className:"text-uppercase text-white small fw-bold mb-2",children:["High Quality Signals",(0,L.jsx)(T,{text:"Number of fingerprint components (like Canvas or WebGL) that are consistently available."})]}),(0,L.jsx)("h2",{className:"fw-bold mb-0 text-success",children:null!==(c=R.high)&&void 0!==c?c:0})]})})}),(0,L.jsx)(f.A,{md:4,children:(0,L.jsx)(h.A,{className:"h-100 border-0 shadow-sm",style:{backgroundColor:"#232a5c"},children:(0,L.jsxs)(h.A.Body,{className:"text-center",children:[(0,L.jsxs)("h6",{className:"text-uppercase text-white small fw-bold mb-2",children:["Low Quality Signals",(0,L.jsx)(T,{text:"Components that are frequently blocked or missing."})]}),(0,L.jsx)("h2",{className:"fw-bold mb-0 text-danger",children:null!==(d=R.very_low)&&void 0!==d?d:0})]})})})]}),(0,L.jsxs)(x.A,{className:"g-4 mb-4",children:[(0,L.jsx)(f.A,{lg:5,children:(0,L.jsxs)(h.A,{className:"h-100 border-0 shadow-sm",style:{backgroundColor:"#232a5c"},children:[(0,L.jsx)(h.A.Header,{className:"bg-transparent border-bottom border-secondary py-3",children:(0,L.jsx)("h6",{className:"mb-0 text-white",children:"Signal Quality Distribution"})}),(0,L.jsx)(h.A.Body,{children:Object.keys(P).length?(0,L.jsx)(j.A,{echarts:s,option:P||{},style:{height:300}}):(0,L.jsx)(m.A,{variant:"light",children:"No data."})})]})}),(0,L.jsx)(f.A,{lg:7,children:(0,L.jsxs)(h.A,{className:"h-100 border-0 shadow-sm",style:{backgroundColor:"#232a5c"},children:[(0,L.jsx)(h.A.Header,{className:"bg-transparent border-bottom border-secondary py-3",children:(0,L.jsx)("h6",{className:"mb-0 text-white",children:"Component Availability"})}),(0,L.jsx)(h.A.Body,{children:Object.keys(F).length?(0,L.jsx)(j.A,{echarts:s,option:F||{},style:{height:300}}):(0,L.jsx)(m.A,{variant:"light",children:"No data."})})]})})]}),(0,L.jsxs)(h.A,{className:"border-0 shadow-sm",style:{backgroundColor:"#232a5c"},children:[(0,L.jsx)(h.A.Header,{className:"bg-transparent border-bottom border-secondary py-3",children:(0,L.jsxs)("h5",{className:"mb-0 text-white",children:[(0,L.jsx)("i",{className:"fas fa-list me-2"}),"Signal Breakdown"]})}),(0,L.jsx)(h.A.Body,{className:"p-0",children:(0,L.jsx)("div",{className:"table-responsive",children:(0,L.jsxs)(p.A,{hover:!0,variant:"dark",className:"mb-0 align-middle",children:[(0,L.jsx)("thead",{children:(0,L.jsxs)("tr",{children:[(0,L.jsx)("th",{style:{width:"40%"},children:"Fingerprint Component"}),(0,L.jsx)("th",{style:{width:"30%"},children:"Availability"}),(0,L.jsx)("th",{style:{width:"30%"},className:"text-center",children:"Quality Rating"})]})}),(0,L.jsx)("tbody",{children:M.length?M.map((function(e){var t,n,s=Math.max(0,Math.min(100,null!==(t=e.present_percentage)&&void 0!==t?t:0)),a=null!==(n=B.find((function(e){return s>=e.min&&s<=e.max})))&&void 0!==n?n:B[3],r="high"===a.key?"High":"medium"===a.key?"Medium":"low"===a.key?"Low":"Very\xa0Low",i="high"===a.key?"success":"medium"===a.key?"info":"low"===a.key?"warning":"danger";return(0,L.jsxs)("tr",{children:[(0,L.jsx)("td",{className:"text-capitalize fw-bold",children:e.component.replace(/_/g," ")}),(0,L.jsx)("td",{children:(0,L.jsxs)("div",{className:"d-flex align-items-center",children:[(0,L.jsx)("div",{className:"flex-grow-1 me-2",children:(0,L.jsx)(g.A,{now:s,variant:i,style:{height:"6px",backgroundColor:"rgba(255,255,255,0.1)"}})}),(0,L.jsxs)("span",{className:"small text-white",children:[s,"%"]})]})}),(0,L.jsx)("td",{className:"text-center",children:(0,L.jsx)(b.A,{bg:i,className:"fw-normal px-3",children:r})})]},e.component)})):(0,L.jsx)("tr",{children:(0,L.jsx)("td",{colSpan:3,className:"text-center text-white py-4",children:"No component data available."})})})]})})})]})]}):(0,L.jsx)(h.A,{className:"bg-transparent border-0",children:(0,L.jsx)(h.A.Body,{children:(0,L.jsx)(m.A,{variant:"info",children:"No confidence data available."})})})}},34231:function(e,t,n){"use strict";n.r(t);var s=n(91212),a=n(10467),r=n(5544),i=n(88094),o=n(45256),l=n(61656),c=n(58166),d=n(33841),h=n(88962),u=n(33183),m=n(19307),x=n(99763),f=n(95465),p=n(55197),g=n(30292),b=n(357),j=n(82566),y=n(93590),v=n(79114),A=n(14676),w=n(15678),N=function(e){return e instanceof Date?(0,A.GP)(e,"yyyy-MM-dd"):""},k=[50,60,70,80,90],_=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:100;return Math.min(Math.max(e,t),n)},C={backgroundColor:"#232a5c",border:"1px solid rgba(255, 255, 255, 0.1)",borderRadius:"8px",padding:"30px",marginBottom:"30px",boxShadow:"0 4px 20px rgba(0,0,0,0.3)"},S=function(e){var t=e.text;return(0,w.jsx)(x.A,{overlay:(0,w.jsx)(j.A,{children:t}),children:(0,w.jsx)("i",{className:"fas fa-info-circle text-white ms-2",style:{cursor:"help",fontSize:"0.9em"}})})},L=function(e){var t,n=e.titleId,x=e.startDate,j=e.endDate,A=(0,i.useState)(!1),L=(0,r.A)(A,2),D=L[0],B=L[1],T=(0,i.useState)(null),M=(0,r.A)(T,2),R=M[0],P=M[1],F=(0,i.useState)(null),I=(0,r.A)(F,2),z=I[0],E=I[1],U=(0,i.useState)(80),H=(0,r.A)(U,2),G=H[0],W=H[1],O=(0,i.useState)(""),q=(0,r.A)(O,2),V=q[0],K=(q[1],(0,i.useCallback)((function(){return{title_id:n,start_date:N(x),end_date:N(j),min_confidence:_(Number(V||G))}}),[n,x,j,G,V])),Y=(0,i.useCallback)((0,a.A)((0,s.A)().m((function e(){var t,a,r;return(0,s.A)().w((function(e){for(;;)switch(e.p=e.n){case 0:if(n){e.n=1;break}return e.a(2);case 1:return B(!0),P(null),e.p=2,e.n=3,o.Ay.api.Fingerprinting.fraudDetectionReport(K());case 3:a=e.v,E(null!==(t=null===a||void 0===a?void 0:a.data)&&void 0!==t?t:null),e.n=5;break;case 4:e.p=4,r=e.v,console.error(r),P("Failed to load fraud detection data.");case 5:return e.p=5,B(!1),e.f(5);case 6:return e.a(2)}}),e,null,[[2,4,5,6]])}))),[K,n]);(0,i.useEffect)((function(){Y()}),[Y]);var J=(0,i.useMemo)((function(){return null!==z&&void 0!==z&&z.suspicious_devices?Array.isArray(z.suspicious_devices)?z.suspicious_devices:z.suspicious_devices.data||[]:[]}),[z]),X=(0,i.useMemo)((function(){var e={};
1return((null===z||void 0===z?void 0:z.indicators)||[]).forEach((function(t){var n;e[(n=t.indicator,n.toLowerCase().trim().replace(/[^a-z0-9]+/g,"_").replace(/^_|_$/g,""))]=t.count})),e}),[z]),Q=(0,i.useMemo)((function(){var e;return null!==z&&void 0!==z&&null!==(e=z.indicators)&&void 0!==e&&e.length?{backgroundColor:"transparent",tooltip:{trigger:"item",formatter:"{b}: {c} ({d}%)",backgroundColor:"rgba(0,0,0,0.8)",textStyle:{color:"#fff"}},legend:{top:"bottom",textStyle:{color:"#fff"}},series:[{name:"Fraud Indicators",type:"pie",radius:["40%","70%"],itemStyle:{borderRadius:5,borderColor:"#232a5c",borderWidth:2},label:{show:!1},data:z.indicators.map((function(e){return{value:e.count,name:e.indicator}}))}]}:{}}),[z]);if(D)return(0,w.jsx)(u.A,{className:"bg-transparent border-0",children:(0,w.jsxs)(u.A.Body,{className:"text-center py-5",children:[(0,w.jsx)(g.A,{animation:"border",variant:"primary"}),(0,w.jsx)("p",{className:"mt-3 text-white",children:"Scanning for suspicious activity..."})]})});if(R)return(0,w.jsx)(l.A,{variant:"danger",children:R});if(!z||!z.stats)return(0,w.jsx)(u.A,{className:"bg-transparent border-0",children:(0,w.jsx)(u.A.Body,{children:(0,w.jsx)(l.A,{variant:"info",children:"No fraud detection data available for the selected period."})})});var Z=z.stats;return(0,w.jsxs)(i.Fragment,{children:[(0,w.jsx)(u.A,{className:"mb-4 shadow-sm border-0",style:{backgroundColor:"#1a2040"},children:(0,w.jsx)(u.A.Body,{className:"p-4",children:(0,w.jsxs)("div",{className:"d-flex align-items-start",children:[(0,w.jsx)("div",{className:"me-3 d-none d-md-block",children:(0,w.jsx)("div",{className:"rounded-circle bg-danger d-flex align-items-center justify-content-center",style:{width:"60px",height:"60px"},children:(0,w.jsx)("i",{className:"fas fa-shield-alt text-white fs-3"})})}),(0,w.jsxs)("div",{children:[(0,w.jsx)("h4",{className:"text-white fw-bold mb-2",children:"Fraud & Bot Protection"}),(0,w.jsx)("p",{className:"text-white mb-0",style:{maxWidth:"800px"}
1,children:"Protect your ad spend. This report identifies non-human traffic (bots), users hiding behind VPNs, and device emulators. High rates of suspicious activity can indicate ad fraud or low-quality traffic sources."})]})]})})}),(0,w.jsxs)("div",{style:C,children:[(0,w.jsxs)(p.A,{className:"align-items-center gy-3 mb-4",children:[(0,w.jsx)(m.A,{xs:12,md:6,children:(0,w.jsxs)("h5",{className:"mb-0 text-white",children:[(0,w.jsx)("i",{className:"fas fa-sliders-h me-2"}),"Sensitivity Level",(0,w.jsx)(S,{text:"Adjust how strict the fraud detection is. Higher percentages mean we only flag devices we are absolutely certain are suspicious."})]})}),(0,w.jsxs)(m.A,{xs:12,md:6,className:"d-flex justify-content-md-end align-items-center",children:[(0,w.jsx)("span",{className:"text-white small me-2",children:"Min. Confidence:"}),(0,w.jsx)(h.A,{children:k.map((function(e){return(0,w.jsxs)(d.A,{size:"sm",variant:G===e?"primary":"outline-light",onClick:function(){return W(e)},children:[e,"%"]},e)}))})]})]}),(0,w.jsxs)(p.A,{className:"text-center g-3",children:[(0,w.jsx)(m.A,{xs:6,md:3,children:(0,w.jsxs)("div",{className:"p-3 rounded bg-dark bg-opacity-50 border border-secondary h-100",children:[(0,w.jsx)("h6",{className:"small text-uppercase fw-bold mb-1 text-white",children:"Total Sessions"}),(0,w.jsx)("span",{className:"fs-4 fw-bold text-white",children:Z.total_sessions.toLocaleString()})]})}),(0,w.jsx)(m.A,{xs:6,md:3,children:(0,w.jsxs)("div",{className:"p-3 rounded bg-dark bg-opacity-50 border border-secondary h-100",children:[(0,w.jsx)("h6",{className:"small text-uppercase fw-bold mb-1 text-white",children:"Suspicious Activity"}),(0,w.jsx)("span",{className:"fs-4 fw-bold text-warning",children:Z.suspicious_sessions.toLocaleString()})]})}),(0,w.jsx)(m.A,{xs:6,md:3,children:(0,w.jsxs)("div",{className:"p-3 rounded bg-dark bg-opacity-50 border border-secondary h-100",children:[(0,w.jsx)("h6",{className:"small text-uppercase fw-bold mb-1 text-white",children:"Confirmed Bots"}),(0,w.jsx)("span",{className:"fs-4 fw-bold text-danger",children:Z.bot_sessions.toLocaleString()})]})}),(0,w.jsx)(m.A,{xs:6,md:3,children:(0,w.jsxs)("div",{className:"p-3 rounded bg-dark bg-opacity-50 border border-secondary h-100",children:[(0,w.jsx)("h6",{className:"small text-uppercase fw-bold mb-1 text-white",children:"Risk Rate"}),(0,w.jsxs)("span",{className:"fs-4 fw-bold ".concat(Z.suspicious_percentage>10?"text-danger":"text-success"),children:[Z.suspicious_percentage,"%"]})]})})]})]}),(0,w.jsxs)(p.A,{className:"g-4 mb-4",children:[(0,w.jsx)(m.A,{lg:5,children:(0,w.jsxs)(u.A,{className:"h-100 border-0 shadow-sm",style:{backgroundColor:"#232a5c"},children:[(0,w.jsx)(u.A.Header,{className:"bg-transparent border-bottom border-secondary py-3",children:(0,w.jsx)("h6",{className:"mb-0 text-white",children:"Fraud Types"})}),(0,w.jsx)(u.A.Body,{children:null!==(t=z.indicators)&&void 0!==t&&t.length?(0,w.jsx)(y.A,{echarts:v,option:Q||{},style:{height:300}}):(0,w.jsx)(l.A,{variant:"light",children:"No specific fraud indicators found."})})]})}),(0,w.jsx)(m.A,{lg:7,children:(0,w.jsxs)(u.A,{className:"h-100 border-0 shadow-sm",style:{backgroundColor:"#232a5c"},children:[(0,w.jsx)(u.A.Header,{className:"bg-transparent border-bottom border-secondary py-3",children:(0,w.jsx)("h6",{className:"mb-0 text-white",children:"Risk Factors Breakdown"})}),(0,w.jsx)(u.A.Body,{children:(0,w.jsx)("div",{className:"d-flex flex-column gap-4",children:Object.entries({vpn_or_proxy_usage:{label:"VPN / Proxy",desc:"Users hiding their true location. Often used to bypass geo-blocks or fake ad impressions."},high_fingerprint_collisions:{label:"High Collisions",desc:"Multiple different users sharing the exact same device fingerprint. Strong indicator of a bot farm."},missing_fingerprint_components:{label:"Missing Data",desc:"Devices refusing to report standard hardware info (Canvas, WebGL). Typical of headless browsers/bots."},emulator_detected:{label:"Emulator",desc:"Game running inside software (like Bluestacks) rather than a physical device. Common in mobile ad fraud."}}).map((function(e){var t=(0,r.A)(e,2),n=t[0],s=t[1],a=X[n]||0,i=Z.suspicious_sessions?a/Z.suspicious_sessions*100:0;return(0,w.jsxs)("div",{children:[(0,w.jsxs)("div",{className:"d-flex justify-content-between mb-1",children:[(0,w.jsxs)("span",{className:"text-white fw-bold",children:[s.label,(0,w.jsx)(S,{text:s.desc})]}),(0,w.jsxs)("span",{className:"text-white",children:[a.toLocaleStr
1ing()," ",(0,w.jsxs)("small",{className:"text-white",children:["(",i.toFixed(1),"%)"]})]})]}),(0,w.jsx)(f.A,{now:i,variant:i>50?"danger":"warning",style:{height:"8px",backgroundColor:"rgba(255,255,255,0.1)"}})]},n)}))})})]})})]}),(0,w.jsxs)(u.A,{className:"border-0 shadow-sm",style:{backgroundColor:"#232a5c"},children:[(0,w.jsx)(u.A.Header,{className:"bg-transparent border-bottom border-secondary py-3",children:(0,w.jsxs)("h5",{className:"mb-0 text-white",children:[(0,w.jsx)("i",{className:"fas fa-list me-2"}),"Suspicious Device Log"]})}),(0,w.jsx)(u.A.Body,{className:"p-0",children:J.length?(0,w.jsx)("div",{className:"table-responsive",children:(0,w.jsxs)(b.A,{hover:!0,variant:"dark",className:"mb-0 align-middle",children:[(0,w.jsx)("thead",{children:(0,w.jsxs)("tr",{children:[(0,w.jsx)("th",{children:"Fingerprint ID"}),(0,w.jsx)("th",{children:"Risk Score"}),(0,w.jsx)("th",{children:"First Seen"}),(0,w.jsx)("th",{children:"Last Seen"}),(0,w.jsx)("th",{children:"Flags"})]})}),(0,w.jsx)("tbody",{children:J.slice(0,50).map((function(e){return(0,w.jsxs)("tr",{children:[(0,w.jsx)("td",{children:(0,w.jsxs)("code",{className:"text-light",children:[e.id.slice(0,12),"..."]})}),(0,w.jsx)("td",{children:(0,w.jsxs)(c.A,{bg:e.match_confidence>=90?"danger":"warning",children:[e.match_confidence,"% Match"]})}),(0,w.jsx)("td",{className:"text-white small",children:new Date(e.first_seen_at).toLocaleDateString()}),(0,w.jsx)("td",{className:"text-white small",children:new Date(e.last_seen_at).toLocaleDateString()}),(0,w.jsx)("td",{children:(0,w.jsxs)("div",{className:"d-flex gap-1 flex-wrap",children:[e.is_bot&&(0,w.jsx)(c.A,{bg:"danger",children:"Bot"}),!e.browser_fingerprint&&(0,w.jsx)(c.A,{bg:"info",children:"No Browser Data"}),!e.device_fingerprint&&(0,w.jsx)(c.A,{bg:"info",children:"No Device Data"})]})})]},e.id)}))})]})}):(0,w.jsxs)("div",{className:"p-5 text-center",children:[(0,w.jsx)("i",{className:"fas fa-check-circle fa-3x text-success mb-3"}),(0,w.jsx)("h6",{className:"text-white",children:"Clean Traffic"}),(0,w.jsx)("p",{className:"text-white",children:"No suspicious devices detected matching your criteria."})]})})]})]})};t.default=i.memo(L)},67071:function(e,t,n){"use strict";n.r(t);var s=n(60436),a=n(91212),r=n(10467),i=n(5544),o=n(88094),l=n(45256),c=n(61656),d=n(58166),h=n(33841),u=n(33183),m=n(19307),x=n(99763),f=n(95465),p=n(55197),g=n(30292),b=n(357),j=n(82566),y=n(8035),v=n(79114),A=n(93590),w=n(14676),N=n(68657),k=n(15678),_=function(e){return e&&(0,N.f)(e)?(0,w.GP)(e,"yyyy-MM-dd"):void 0},C=[{id:"country",name:"Country",icon:"fas fa-flag"},{id:"region",name:"Region",icon:"fas fa-map"},{id:"city",name:"City",icon:"fas fa-city"}],S=function(e){var t=e.text;return(0,k.jsx)(x.A,{overlay:(0,k.jsx)(j.A,{children:t}),children:(0,k.jsx)("i",{className:"fas fa-info-circle text-white ms-2",style:{cursor:"help",fontSize:"0.9em"}})})},L=function(e){var t=e.pct,n="success",s="Low Risk";return t>20?(n="danger",s="High Risk"):t>5&&(n="warning",s="Medium Risk"),(0,k.jsx)(x.A,{overlay:(0,k.jsxs)(j.A,{children:[t.toFixed(1),"% of traffic from this location is flagged as suspicious (e.g. VPN, Proxy, Bot)."]}),children:(0,k.jsxs)(d.A,{bg:n,pill:!0,className:"fw-normal",children:[s," (",t.toFixed(1),"%)"]})})};t.default=function(e){var t,d,x=e.titleId,j=e.startDate,w=e.endDate,N=e.matchConfidence,D=(0,o.useState)(!0),B=(0,i.A)(D,2),T=B[0],M=B[1],R=(0,o.useState)(null),P=(0,i.A)(R,2),F=P[0],I=P[1],z=(0,o.useState)(null),E=(0,i.A)(z,2),U=E[0],H=E[1],G=(0,o.useState)("country"),W=(0,i.A)(G,2),O=W[0],q=W[1],V=(0,o.useState)(!1),K=(0,i.A)(V,2),Y=K[0],J=K[1],X=(0,o.useCallback)((0,r.A)((0,a.A)().m((function e(){var t,n,s,r;return(0,a.A)().w((function(e){for(;;)switch(e.p=e.n){case 0:if(x){e.n=1;break}return I("Missing title_id \u2014 cannot load geolocation data."),M(!1),e.a(2);case 1:return M(!0),I(null),e.p=2,t={title_id:x,start_date:_(j),end_date:_(w),group_by:O,confidence_threshold:N},e.n=3,l.Ay.api.Fingerprinting.geolocationReport(t);case 3:n=e.v,H(n.data||null),e.n=5;break;case 4:e.p=4,r=e.v,console.error("Geolocation report error",r),I((null===r||void 0===r||null===(s=r.response)||void 0===s||null===(s=s.data)||void 0===s?void 0:s.message)||"Unable to load geolocation data. Please try again later."),H(null);case 5:return e.p=5,M(!1),e.f(5);case 6:return e.a(2)}}),e,null,[[2,4,5,6]])}))),[x,j,w,O,N]);(0,o.useEffect)((function(){X()}),[X]),(0,o.useEffect)((function(){n.e(10669).then(n.bind(n,10669)).then((function(e){v.registerMap("world",e.default||e),J(!0)})).catch((function(e){return console.warn("Map geojson failed to load",e)}))}),[]);var Q=(0,o.useMemo)((function(){var e;if(null===U||void 0===U||null===(e=U.locations)||void 0===e||!e.length)return{};var t=U.locations.slice(0,10),n="country"===O?t.map((function(e){return e.country_code})):"region"===O?t.map((function(e){return e.region||"N/A"})):t.map((function(e){return e.city||"N/A"})),a=Math.max.apply(Math,(0,s.A)(U.locations.map((function(e){return e.count}))));return"country"===O&&Y?{backgroundColor:"transparent",tooltip:{trigger:"item",formatter:"{b}: {c} Users"},visualMap:{min:0,max:a,left:"left",top:"bottom",text:["High","Low"],calculable:!0,inRange:{color:["#e0f3f8","#4575b4","#313695"]},textStyle:{color:"#fff"}},series:[{type:"map",map:"world",roam:!0,data:U.locations.map((function(e){return{name:e.country_code,value:e.count}})),nameProperty:"ISO_A2",itemStyle:{areaColor:"#323c48",borderColor:"#111"},emphasis:{itemStyle:{areaColor:"#2b6cb0"},label:{show:!0,color:"#fff"}}}]}:{backgroundColor:"transparent",tooltip:{trigger:"axis",axisPointer:{type:"shadow"}},grid:{left:"3%",right:"4%",bottom:"3%",containLabel:!0},xAxis:{type:"category",data:n,axisLabel:{interval:0,rotate:30,color:"#ccc"}
1,axisLine:{lineStyle:{color:"#555"}}},yAxis:{type:"value",axisLabel:{color:"#ccc"},splitLine:{lineStyle:{color:"#333"}}},series:[{name:"Users",type:"bar",data:t.map((function(e){return e.count})),itemStyle:{color:new v.graphic.LinearGradient(0,0,0,1,[{offset:0,color:"#0dcaf0"},{offset:1,color:"#0a58ca"}]),borderRadius:[4,4,0,0]}}]}}),[U,O,Y]);return T?(0,k.jsx)(u.A,{className:"bg-transparent border-0",children:(0,k.jsxs)(u.A.Body,{className:"text-center py-5",children:[(0,k.jsx)(g.A,{animation:"border",variant:"primary"}),(0,k.jsx)("p",{className:"mt-3 text-white",children:"Mapping user locations..."})]})}):F?(0,k.jsx)(c.A,{variant:"danger",children:F}):null!==U&&void 0!==U&&null!==(t=U.locations)&&void 0!==t&&t.length?(0,k.jsxs)(o.Fragment,{children:[(0,k.jsx)(u.A,{className:"mb-4 shadow-sm border-0",style:{backgroundColor:"#1a2040"},children:(0,k.jsx)(u.A.Body,{className:"p-4",children:(0,k.jsxs)("div",{className:"d-flex align-items-start",children:[(0,k.jsx)("div",{className:"me-3 d-none d-md-block",children:(0,k.jsx)("div",{className:"rounded-circle bg-success d-flex align-items-center justify-content-center",style:{width:"60px",height:"60px"},children:(0,k.jsx)("i",{className:"fas fa-map-marked-alt text-white fs-3"})})}),(0,k.jsxs)("div",{children:[(0,k.jsx)("h4",{className:"text-white fw-bold mb-2",children:"Global Audience Map"}),(0,k.jsx)("p",{className:"text-white mb-0",style:{maxWidth:"800px"},children:"See exactly where your players are coming from. This report breaks down traffic by Country, Region, and City, helping you identify your strongest markets and spot potential fraud hotspots."})]})]})})}),(0,k.jsx)(u.A,{className:"mb-4 border-0 shadow-sm",style:{backgroundColor:"#232a5c"},children:(0,k.jsxs)(u.A.Body,{children:[(0,k.jsxs)(p.A,{className:"align-items-center gy-3 mb-4",children:[(0,k.jsxs)(m.A,{md:6,children:[(0,k.jsx)("h6",{className:"text-white mb-2 small text-uppercase fw-bold",children:"View By"}),(0,k.jsx)("text-white",{children:C.map((function(e){return(0,k.jsxs)(h.A,{size:"sm",variant:O===e.id?"primary":"outline-light",onClick:function(){return q(e.id)},children:[(0,k.jsx)("i",{className:"".concat(e.icon," me-2")}),e.name]},e.id)}))})]}),(0,k.jsx)(m.A,{md:6,className:"text-md-end",children:(0,k.jsxs)(h.A,{variant:"outline-light",size:"sm",onClick:function(){var e;if(null!==U&&void 0!==U&&null!==(e=U.locations)&&void 0!==e&&e.length){var t=[["country"===O?"Country Code":"region"===O?"Region":"City","Users","Percentage","Suspicious %"].join(","),U.locations.map((function(e){return["country"===O?e.country_code:"region"===O?e.region||"N/A":e.city||"N/A",e.count,e.percentage,e.suspicious_percentage]})).map((function(e){return e.join(",")})).join("\n")].join("\n"),n=new Blob([t],{type:"text/csv;charset=utf-8"});(0,y.saveAs)(n,"geolocation_report_".concat(_(j),"_").concat(_(w),".csv"))}},children:[(0,k.jsx)("i",{className:"fas fa-download me-2"}),"Export CSV"]})})]}),(0,k.jsxs)(p.A,{className:"g-3",children:[(0,k.jsx)(m.A,{md:4,children:(0,k.jsxs)("div",{className:"p-3 rounded bg-dark bg-opacity-50 text-center h-100 border border-secondary",children:[(0,k.jsx)("h6",{className:"text-uppercase text-white small fw-bold mb-2",children:"Total Users"}),(0,k.jsx)("h2",{className:"text-white fw-bold mb-0",children:U.total_users.toLocaleString()})]})}),(0,k.jsx)(m.A,{md:4,children:(0,k.jsxs)("div",{className:"p-3 rounded bg-dark bg-opacity-50 text-center h-100 border border-secondary",children:[(0,k.jsx)("h6",{className:"text-uppercase text-white small fw-bold mb-2",children:"Top Location"}),(0,k.jsx)("h2",{className:"text-white fw-bold mb-0",children:"country"===O?U.locations[0].country_code:"region"===O?U.locations[0].region||"N/A":U.locations[0].city||"N/A"}),(0,k.jsxs)("small",{className:"text-success",children:[U.locations[0].percentage.toFixed(1),"% of traffic"]})]})}),(0,k.jsx)(m.A,{md:4,children:(0,k.jsxs)("div",{className:"p-3 rounded bg-dark bg-opacity-50 text-center h-100 border border-secondary",children:[(0,k.jsxs)("h6",{className:"text-uppercase text-white small fw-bold mb-2",children:["Suspicious Activity ",(0,k.jsx)(S,{text:"Percentage of users using VPNs, Proxies, or Data Center IPs."})]}),(0,k.jsxs)("h2",{className:"text-warning fw-bold mb-0",children:[(null===(d=U.suspicious_stats)||void 0===d||null===(d=d.vpn_proxy_usage)||void 0===d?void 0:d.toFixed(1))||0,"%"]})]})})]})]})}),(0,k.jsx)(u.A,{className:"mb-4 border-0 shadow-sm",style:{backgroundColor:"#232a5c"},children:(0,k.jsx)(u.A.Body,{children:(0,k.jsx)("div",{style:{height:400},children:(0,k.jsx)(A.A,{echarts:v,option:Q||{},style:{height:"100%"},notMerge:!0})})})}),(0,k.jsxs)(u.A,{className:"border-0 shadow-sm",style:{backgroundColor:"#232a5c"},children:[(0,k.jsx)(u.A.Header,{className:"bg-transparent border-bottom border-secondary py-3",children:(0,k.jsxs)("h5",{className:"mb-0 text-white",children:[(0,k.jsx)("i",{className:"fas fa-list me-2"}),"Location Breakdown"]})}),(0,k.jsx)(u.A.Body,{className:"p-0",children:(0,k.jsx)("div",{className:"table-responsive",children:(0,k.jsxs)(b.A,{hover:!0,variant:"dark",className:"mb-0 align-middle",children:[(0,k.jsx)("thead",{children:(0,k.jsxs)("tr",{children:[(0,k.jsx)("th",{style:{minWidth:150},children:"Location"}),(0,k.jsx)("th",{className:"text-end",children:"Users"}),(0,k.jsx)("th",{style:{width:"30%"},children:"Share"}),(0,k.jsx)("th",{className:"text-center",children:"Risk Level"})]})}),(0,k.jsx)("tbody",{children:U.locations.map((function(e,t){var n;return(0,k.jsxs)("tr",{children:[(0,k.jsx)("td",{children:"country"===O?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)("span",{className:"fi fi-".concat(null===(n=e.country_code)||void 0===n?void 0:n.toLowerCase()," me-2")})," ",e.country_name||e.country_code]}
1):"region"===O?e.region||"Unknown Region":e.city||"Unknown City"}),(0,k.jsx)("td",{className:"text-end",children:e.count.toLocaleString()}),(0,k.jsx)("td",{children:(0,k.jsxs)("div",{className:"d-flex align-items-center",children:[(0,k.jsx)("div",{className:"flex-grow-1 me-2",children:(0,k.jsx)(f.A,{now:e.percentage,variant:"info",style:{height:"6px"}})}),(0,k.jsxs)("small",{className:"text-white",style:{width:"40px",textAlign:"right"},children:[Math.round(e.percentage),"%"]})]})}),(0,k.jsx)("td",{className:"text-center",children:(0,k.jsx)(L,{pct:e.suspicious_percentage})})]},t)}))})]})})})]})]}):(0,k.jsx)(u.A,{className:"bg-transparent border-0",children:(0,k.jsx)(u.A.Body,{children:(0,k.jsx)(c.A,{variant:"info",children:"No geolocation data available for the selected period."})})})}},35001:function(e,t,n){"use strict";n.r(t);var s=n(5544),a=n(88094),r=n(45256),i=n(61656),o=n(58166),l=n(33183),c=n(19307),d=n(99763),h=n(95465),u=n(55197),m=n(30292),x=n(357),f=n(82566),p=n(93590),g=n(79114),b=n(14676),j=n(15678),y=function(e){return e instanceof Date?(0,b.GP)(e,"yyyy-MM-dd"):""},v=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=parseFloat(e);return isNaN(n)?"0.0":n.toFixed(t)},A=function(e){var t=e.text;return(0,j.jsx)(d.A,{overlay:(0,j.jsx)(f.A,{children:t}),children:(0,j.jsx)("i",{className:"fas fa-info-circle text-white ms-2",style:{cursor:"help",fontSize:"0.9em"}})})};t.default=function(e){var t,n,d,f=e.titleId,b=e.startDate,w=e.endDate,N=e.matchConfidence,k=(0,a.useState)(!0),_=(0,s.A)(k,2),C=_[0],S=_[1],L=(0,a.useState)(null),D=(0,s.A)(L,2),B=D[0],T=D[1],M=(0,a.useState)(null),R=(0,s.A)(M,2),P=R[0],F=R[1],I=(0,a.useCallback)((function(){if(!f||!b||!w)return T("Missing required parameters."),void S(!1);var e={title_id:f,start_date:y(b),end_date:y(w),confidence_threshold:N};S(!0),T(null),r.Ay.api.Fingerprinting.installJourneyReport(e).then((function(e){return F(e.data)})).catch((function(e){console.error("[InstallJourneyReport]",e),T("Failed to load install journey data.")})).finally((function(){return S(!1)}))}),[f,b,w,N]);(0,a.useEffect)(I,[I]);var z=P||{},E=z.summary,U=z.pre_install_activity,H=z.conversion_funnels,G=z.conversion_insights,W=function(e,t,n,s){if(!e||0===e.length)return null;var a=e.filter((function(e){return e&&"number"===typeof e[n]&&e[n]>0})).slice(0,5);return 0===a.length?null:{backgroundColor:"transparent",tooltip:{trigger:"axis",axisPointer:{type:"shadow"},formatter:"{b}: {c}%"},grid:{left:"3%",right:"10%",bottom:"3%",top:"10%",containLabel:!0},xAxis:{type:"value",show:!1},yAxis:{type:"category",data:a.map((function(e){var n=e[t]||"N/A",s=(e.page_title&&"PAX AUTOCRATICA"!==e.page_title?e.page_title:e.label)||n;return s.length>25?s.slice(0,22)+"...":s})),axisLabel:{color:"#fff"},axisLine:{show:!1},axisTick:{show:!1}},series:[{name:s,type:"bar",data:a.map((function(e){return e[n]})),label:{show:!0,position:"right",formatter:"{c}%",color:"#fff"},itemStyle:{borderRadius:[0,4,4,0],color:new g.graphic.LinearGradient(1,0,0,0,[{offset:0,color:"#0d6efd"},{offset:1,color:"#0a58ca"}])}}]}};return C?(0,j.jsx)(l.A,{className:"bg-transparent border-0",children:(0,j.jsxs)(l.A.Body,{className:"text-center py-5",children:[(0,j.jsx)(m.A,{animation:"border",variant:"primary"}),(0,j.jsx)("p",{className:"mt-3 text-white",children:"Tracing install paths..."})]})}):B?(0,j.jsx)(i.A,{variant:"danger",children:B}):E&&0!==E.total_installs?(0,j.jsxs)(a.Fragment,{children:[(0,j.jsx)(l.A,{className:"mb-4 shadow-sm border-0",style:{backgroundColor:"#1a2040"},children:(0,j.jsx)(l.A.Body,{className:"p-4",children:(0,j.jsxs)("div",{className:"d-flex align-items-start",children:[(0,j.jsx)("div",{className:"me-3 d-none d-md-block",children:(0,j.jsx)("div",{className:"rounded-circle bg-success d-flex align-items-center justify-content-center",style:{width:"60px",height:"60px"},children:(0,j.jsx)("i",{className:"fas fa-shoe-prints text-white fs-3"})})}),(0,j.jsxs)("div",{children:[(0,j.jsx)("h4",{className:"text-white fw-bold mb-2",children:"The Install Journey"}),(0,j.jsxs)("p",{className:"text-white mb-0",style:{maxWidth:"800px"},children:["How do players find your game? This report traces the steps users took ",(0,j.jsx)("em",{children:"before"})," they installed. It connects web visits, ad clicks, and social posts to the final download, showing you exactly what drives growth."]})]})]})})}
1),(0,j.jsxs)(u.A,{className:"g-4 mb-4",children:[(0,j.jsx)(c.A,{md:3,children:(0,j.jsx)(l.A,{className:"h-100 border-0 shadow-sm",style:{backgroundColor:"#232a5c"},children:(0,j.jsxs)(l.A.Body,{className:"text-center",children:[(0,j.jsxs)("h6",{className:"text-uppercase text-white small fw-bold mb-2",children:["Total Installs",(0,j.jsx)(A,{text:"Total game installs recorded in this period."})]}),(0,j.jsx)("h2",{className:"text-white fw-bold mb-0",children:E.total_installs.toLocaleString()})]})})}),(0,j.jsx)(c.A,{md:3,children:(0,j.jsx)(l.A,{className:"h-100 border-0 shadow-sm",style:{backgroundColor:"#232a5c"},children:(0,j.jsxs)(l.A.Body,{className:"text-center",children:[(0,j.jsxs)("h6",{className:"text-uppercase text-white small fw-bold mb-2",children:["Avg. Time to Install",(0,j.jsx)(A,{text:"Average time between the first tracked interaction (e.g. site visit) and the game install."})]}),(0,j.jsxs)("h2",{className:"text-white fw-bold mb-0",children:[v(E.avg_time_to_install)," ",(0,j.jsx)("span",{className:"fs-6 text-white",children:"hrs"})]})]})})}),(0,j.jsx)(c.A,{md:3,children:(0,j.jsx)(l.A,{className:"h-100 border-0 shadow-sm",style:{backgroundColor:"#232a5c"},children:(0,j.jsxs)(l.A.Body,{className:"text-center",children:[(0,j.jsxs)("h6",{className:"text-uppercase text-white small fw-bold mb-2",children:["Web Activity Lift",(0,j.jsx)(A,{text:"Percentage of installers who visited your website before downloading. A high number means your site is a key part of the journey."})]}),(0,j.jsxs)("h2",{className:"text-success fw-bold mb-0",children:["+",v(null===G||void 0===G?void 0:G.pre_activity_conversion_lift),"%"]})]})})}),(0,j.jsx)(c.A,{md:3,children:(0,j.jsx)(l.A,{className:"h-100 border-0 shadow-sm",style:{backgroundColor:"#232a5c"},children:(0,j.jsxs)(l.A.Body,{className:"text-center",children:[(0,j.jsxs)("h6",{className:"text-uppercase text-white small fw-bold mb-2",children:["Post-Install Engagement",(0,j.jsx)(A,{text:"Percentage of users who returned to your web properties AFTER installing the game."})]}),(0,j.jsxs)("h2",{className:"text-info fw-bold mb-0",children:[v(null===G||void 0===G?void 0:G.post_activity_engagement_rate),"%"]})]})})})]}),(0,j.jsxs)(l.A,{className:"mb-4 border-0 shadow-sm",style:{backgroundColor:"#232a5c"},children:[(0,j.jsx)(l.A.Header,{className:"bg-transparent border-bottom border-secondary py-3",children:(0,j.jsxs)("h5",{className:"mb-0 text-white",children:[(0,j.jsx)("i",{className:"fas fa-filter me-2"}),"Conversion Funnel"]})}),(0,j.jsxs)(l.A.Body,{children:[(0,j.jsx)("p",{className:"text-white small mb-4",children:"The most common path users take from discovery to installation."}),(null===H||void 0===H||null===(t=H.steps)||void 0===t?void 0:t.length)>0?(0,j.jsx)("div",{className:"d-flex flex-wrap justify-content-center align-items-center gap-3",children:H.steps.map((function(e,t){return(0,j.jsxs)(a.Fragment,{children:[(0,j.jsxs)("div",{className:"text-center p-3 rounded bg-dark bg-opacity-50 border border-secondary",style:{minWidth:"140px"},children:[(0,j.jsx)("div",{className:"text-uppercase text-white small fw-bold mb-1",children:e.replace(/_/g," ")}),(0,j.jsx)("div",{className:"fs-3 fw-bold text-white",children:H.counts[t].toLocaleString()}),(0,j.jsx)("div",{className:"small text-white",children:"Users"})]}),t<H.steps.length-1&&(0,j.jsxs)("div",{className:"text-center",children:[(0,j.jsx)("i",{className:"fas fa-chevron-right text-white fs-4 mb-1"}),void 0!==H.drop_off_rates[t]&&(0,j.jsxs)("div",{className:"badge bg-danger bg-opacity-25 text-danger border border-danger",children:["-",H.drop_off_rates[t],"% Drop"]})]})]},e)}))}):(0,j.jsx)(i.A,{variant:"light",children:"Not enough data to build a funnel."})]})]}),(0,j.jsxs)(u.A,{className:"g-4 mb-4",children:[(0,j.jsx)(c.A,{lg:6,children:(0,j.jsxs)(l.A,{className:"h-100 border-0 shadow-sm",style:{backgroundColor:"#232a5c"},children:[(0,j.jsx)(l.A.Header,{className:"bg-transparent border-bottom border-secondary py-3",children:(0,j.jsx)("h6",{className:"mb-0 text-white",children:"Top Converting Pages"})}),(0,j.jsx)(l.A.Body,{children:null!==U&&void 0!==U&&U.top_pages?(0,j.jsx)(p.A,{echarts:g,option:W(U.top_pages,"page_url","conversion_rate","Conversion Rate")||{},style:{height:250}}):(0,j.jsx)(i.A,{variant:"light",children:"No page data."})})]})}),(0,j.jsx)(c.A,{lg:6,children:(0,j.jsxs)(l.A,{className:"h-100 border-0 shadow-sm",style:{backgroundColor:"#232a5c"},children:[(0,j.jsx)(l.A.Header,{className:"bg-transparent border-bottom border-secondary py-3",children:(0,j.jsx)("h6",{className:"mb-0 text-white",children:"Top Convert
1ing Links"})}),(0,j.jsx)(l.A.Body,{children:null!==U&&void 0!==U&&U.top_short_links?(0,j.jsx)(p.A,{echarts:g,option:W(U.top_short_links,"label","conversion_rate","Conversion Rate")||{},style:{height:250}}):(0,j.jsx)(i.A,{variant:"light",children:"No link data."})})]})})]}),(0,j.jsxs)(l.A,{className:"border-0 shadow-sm",style:{backgroundColor:"#232a5c"},children:[(0,j.jsx)(l.A.Header,{className:"bg-transparent border-bottom border-secondary py-3",children:(0,j.jsxs)("h5",{className:"mb-0 text-white",children:[(0,j.jsx)("i",{className:"fas fa-list me-2"}),"Attribution Details"]})}),(0,j.jsx)(l.A.Body,{className:"p-0",children:(0,j.jsx)("div",{className:"table-responsive",children:(0,j.jsxs)(x.A,{hover:!0,variant:"dark",className:"mb-0 align-middle",children:[(0,j.jsx)("thead",{children:(0,j.jsxs)("tr",{children:[(0,j.jsx)("th",{children:"Type"}),(0,j.jsx)("th",{children:"Name / Source"}),(0,j.jsx)("th",{className:"text-center",children:"Reach"}),(0,j.jsx)("th",{className:"text-center",children:"Installs"}),(0,j.jsx)("th",{style:{width:"25%"},children:"Conversion Rate"})]})}),(0,j.jsxs)("tbody",{children:[null===U||void 0===U||null===(n=U.traffic_sources)||void 0===n?void 0:n.map((function(e){return(0,j.jsxs)("tr",{children:[(0,j.jsx)("td",{children:(0,j.jsx)(o.A,{bg:"primary",children:"Source"})}),(0,j.jsx)("td",{className:"fw-bold",children:e.source}),(0,j.jsx)("td",{className:"text-center",children:e.total_users.toLocaleString()}),(0,j.jsx)("td",{className:"text-center text-success fw-bold",children:e.converted_users.toLocaleString()}),(0,j.jsx)("td",{children:(0,j.jsxs)("div",{className:"d-flex align-items-center",children:[(0,j.jsx)("div",{className:"flex-grow-1 me-2",children:(0,j.jsx)(h.A,{now:e.conversion_rate,variant:"success",style:{height:"6px",backgroundColor:"rgba(255,255,255,0.1)"}})}),(0,j.jsxs)("span",{className:"small text-white",children:[v(e.conversion_rate),"%"]})]})})]},"source-".concat(e.source))})),null===U||void 0===U||null===(d=U.top_short_links)||void 0===d?void 0:d.map((function(e){return(0,j.jsxs)("tr",{children:[(0,j.jsx)("td",{children:(0,j.jsx)(o.A,{bg:"info",children:"Link"})}),(0,j.jsx)("td",{children:(0,j.jsx)("a",{href:e.original_url,target:"_blank",rel:"noreferrer",className:"text-light text-decoration-none",children:e.label||e.original_url.substring(0,40)+"..."})}),(0,j.jsx)("td",{className:"text-center",children:e.unique_clickers.toLocaleString()}),(0,j.jsx)("td",{className:"text-center text-success fw-bold",children:e.conversions.toLocaleString()}),(0,j.jsx)("td",{children:(0,j.jsxs)("div",{className:"d-flex align-items-center",children:[(0,j.jsx)("div",{className:"flex-grow-1 me-2",children:(0,j.jsx)(h.A,{now:e.conversion_rate,variant:"info",style:{height:"6px",backgroundColor:"rgba(255,255,255,0.1)"}})}),(0,j.jsxs)("span",{className:"small text-white",children:[v(e.conversion_rate),"%"]})]})})]},"link-".concat(e.short_link_id))}))]})]})})})]})]}):(0,j.jsx)(l.A,{className:"bg-transparent border-0",children:(0,j.jsx)(l.A.Body,{children:(0,j.jsx)(i.A,{variant:"info",children:"No game installs recorded in this period."})})})}},60931:function(e,t,n){"use strict";n.r(t);var s=n(91212),a=n(10467),r=n(5544),i=n(88094),o=n(45256),l=n(61656),c=n(58166),d=n(33841),h=n(33183),u=n(19307),m=n(55197),x=n(30292),f=n(357),p=n(8035),g=n(79114),b=n(93590),j=n(14676),y=n(15678),v=function(e){return e instanceof Date?(0,j.GP)(e,"yyyy-MM-dd"):""},A="#4caf50",w="#2196f3",N="#ff9800",k="#bdbdbd",_=function(e){var t=e.label,n=e.value,s=e.variant,a=void 0===s?"light":s;return(0,y.jsx)(h.A,{bg:a,text:"light"===a?"dark":"white",className:"mb-3",children:(0,y.jsxs)(h.A.Body,{className:"p-3 text-center",children:[(0,y.jsx)("h6",{className:"mb-1 text-black",children:t}),(0,y.jsx)("h3",{className:"mb-0 fw-bold text-black",children:n})]})})};t.default=function(e){var t,n=e.titleId,j=e.startDate,C=e.endDate,S=(e.matchConfidence,(0,i.useState)(!0)),L=(0,r.A)(S,2),D=L[0],B=L[1],T=(0,i.useState)(null),M=(0,r.A)(T,2),R=M[0],P=M[1],F=(0,i.useState)(null),I=(0,r.A)(F,2),z=I[0],E=I[1],U=(0,i.useState)(30),H=(0,r.A)(U,2),G=H[0],W=H[1],O=(0,i.useCallback)(function(){var e=(0,a.A)((0,s.A)().m((function e(t){var a,r,i,l,c,d;return(0,s.A)().w((function(e){for(;;)switch(e.p=e.n){case 0:if(n&&j&&C){e.n=1;break}return E("Missing required parameters."),B(!1),e.a(2);case 1:return e.p=1,B(!0),E(null),a={title_id:n,start_date:v(j),end_date:v(C),min_confidence:60,retention_period:G},e.n=2,o.Ay.api.Fingerprinting.uniqueReturningReport(a,{signal:t});
1case 2:r=e.v,i=r.data,console.log("Unique Return",i),P(null!==i&&void 0!==i?i:null),e.n=5;break;case 3:if(e.p=3,d=e.v,!t.aborted){e.n=4;break}return e.a(2);case 4:console.error("Retention API error",d),E(null!==(l=null===d||void 0===d||null===(c=d.response)||void 0===c||null===(c=c.data)||void 0===c?void 0:c.message)&&void 0!==l?l:"Failed to load retention data.");case 5:return e.p=5,B(!1),e.f(5);case 6:return e.a(2)}}),e,null,[[1,3,5,6]])})));return function(t){return e.apply(this,arguments)}}(),[n,j,C,G]);(0,i.useEffect)((function(){var e=new AbortController;return O(e.signal),function(){return e.abort()}}),[O]);var q=(0,i.useMemo)((function(){var e;if(null===R||void 0===R||null===(e=R.cohort_analysis)||void 0===e||!e.length)return{};var t=R.cohort_analysis.map((function(e){return e.cohort_date})),n=function(e,t,n){return{name:t,type:"line",smooth:!0,showSymbol:!1,itemStyle:{color:n},data:R.cohort_analysis.map((function(t){var n;return null!==(n=t[e])&&void 0!==n?n:0}))}};return{color:[A,w,N],tooltip:{trigger:"axis"},legend:{data:["Day 1","Day 7","Day 30"]},grid:{left:40,right:20,top:50,bottom:40},xAxis:{type:"category",boundaryGap:!1,data:t,axisLabel:{rotate:t.length>8?30:0}},yAxis:{type:"value",axisLabel:{formatter:"{value}%"},splitLine:{lineStyle:{color:k}}},series:[n("day_1","Day 1",A),n("day_7","Day 7",w),n("day_30","Day 30",N)]}}),[R]);return D?(0,y.jsx)(h.A,{children:(0,y.jsx)(h.A.Body,{className:"text-center py-5",children:(0,y.jsx)(x.A,{animation:"border",role:"status","aria-label":"Loading\u2026"})})}):z?(0,y.jsx)(h.A,{children:(0,y.jsx)(h.A.Body,{children:(0,y.jsx)(l.A,{variant:"danger",dismissible:!0,onClose:function(){return E(null)},children:z})})}):null!==R&&void 0!==R&&R.stats?(0,y.jsxs)(i.Fragment,{children:[(0,y.jsx)(h.A,{className:"mb-4",children:(0,y.jsxs)(h.A.Body,{children:[(0,y.jsxs)(m.A,{className:"mb-3",children:[(0,y.jsx)(u.A,{xs:"auto",children:(0,y.jsxs)("h5",{className:"card-title mb-0",children:[(0,y.jsx)("i",{className:"fas fa-user-clock me-2"}),"Unique / Returning Users"]})}),(0,y.jsxs)(u.A,{className:"d-flex justify-content-end gap-2",children:[(0,y.jsx)("div",{className:"btn-group btn-group-sm",children:[7,14,30,60,90].map((function(e){return(0,y.jsxs)(d.A,{variant:G===e?"primary":"outline-secondary",onClick:function(){return W(e)},"aria-pressed":G===e,"aria-label":"Retention period ".concat(e," days"),children:[e," d"]},e)}))}),(0,y.jsxs)(d.A,{variant:"outline-secondary",size:"sm",onClick:function(){var e;if(null!==R&&void 0!==R&&null!==(e=R.cohort_analysis)&&void 0!==e&&e.length){var t=R.cohort_analysis.map((function(e){return"".concat(e.cohort_date,",").concat(e.size,",").concat(e.day_1,",").concat(e.day_7,",").concat(e.day_30)})),n=new Blob([["cohort_date,size,day_1,day_7,day_30"].concat(t).join("\n")],{type:"text/csv;charset=utf-8"});(0,p.saveAs)(n,"retention_".concat(v(j),"_").concat(v(C),".csv"))}},disabled:!(null!==R&&void 0!==R&&null!==(t=R.cohort_analysis)&&void 0!==t&&t.length),children:[(0,y.jsx)("i",{className:"fas fa-download me-1"}),"CSV"]})]})]}),(0,y.jsxs)(m.A,{xs:2,md:4,children:[(0,y.jsx)(u.A,{children:(0,y.jsx)(_,{label:"Total Users",value:R.stats.total_users})}),(0,y.jsx)(u.A,{children:(0,y.jsx)(_,{label:"Unique Users",value:R.stats.unique_users})}),(0,y.jsx)(u.A,{children:(0,y.jsx)(_,{label:"Returning Users",value:R.stats.returning_users})}),(0,y.jsx)(u.A,{children:(0,y.jsx)(_,{label:"Retention Rate",value:"".concat(R.stats.retention_rate,"%")})})]}),(0,y.jsx)("div",{style:{height:400},className:"mt-4",children:(0,y.jsx)(b.A,{echarts:g,option:q,style:{height:"100%",width:"100%"}})})]})}),(0,y.jsx)(h.A,{children:(0,y.jsxs)(h.A.Body,{children:[(0,y.jsxs)(m.A,{className:"align-items-center mb-3",children:[(0,y.jsx)(u.A,{children:(0,y.jsxs)("h6",{className:"mb-0 text-black",children:[(0,y.jsx)("i",{className:"fas fa-layer-group me-2"}),"Cohort Analysis"]})}),(0,y.jsxs)(u.A,{xs:"auto",className:"text-muted small",children:[R.cohort_analysis.length," cohort",1===R.cohort_analysis.length?"":"s"]})]}),(0,y.jsx)("div",{className:"table-responsive",children:(0,y.jsxs)(f.A,{striped:!0,hover:!0,size:"sm",className:"align-middle",children:[(0,y.jsx)("thead",{children:(0,y.jsxs)("tr",{className:"text-nowrap",children:[(0,y.jsx)("th",{children:"Date"}),(0,y.jsx)("th",{className:"text-end",children:"Users"}),(0,y.jsx)("th",{className:"text-end",children:"Day 1"}),(0,y.jsx)("th",{className:"text-end",children:"Day 7"}),(0,y.jsx)("th",{className:"text-end",children:"Day 30"})]})}),(0,y.jsx)("tbody",{children:R.cohort_analysis.map((function(e){return(0,y.jsxs)("tr",{children:[(0,y.jsx)("td",{children:e.cohort_date}),(0,y.jsx)("td",{className:"text-end",children:e.size}),["day_1","day_7","day_30"].map((function(t){return(0,y.jsx)("td",{className:"text-end",children:(0,y.jsxs)(c.A,{bg:e[t]>=50?"success":e[t]>=25?"warning":"danger",children:[e[t],"%"]})},t)}))]},e.cohort_date)}))})]})})]})})]}):(0,y.jsx)(h.A,{children:(0,y.jsx)(h.A.Body,{children:(0,y.jsx)(l.A,{variant:"warning",children:"No retention data available for the selected period."})})})}},56233:function(e,t,n){"use strict";n.r(t);var s=n(91212),a=n(10467),r=n(5544),i=n(88094),o=n(45256),l=n(61656),c=n(33841),d=n(88962),h=n(33183),u=n(19307),m=n(99763),x=n(55197),f=n(30292),p=n(357),g=n(82566),b=n(8035),j=n(79114),y=n(93590),v=n(14676),A=n(156
178),w=function(e){return e instanceof Date?(0,v.GP)(e,"yyyy-MM-dd"):""},N="#00b67a",k="#0dcaf0",_="#ffc107",C=function(e){var t=e.text;return(0,A.jsx)(m.A,{overlay:(0,A.jsx)(g.A,{children:t}),children:(0,A.jsx)("i",{className:"fas fa-info-circle text-white ms-2",style:{cursor:"help",fontSize:"0.9em"}})})},S=function(e){var t=e.label,n=e.value,s=e.iconClass,a=e.tooltip;return(0,A.jsx)(h.A,{className:"h-100 border-0 shadow-sm",style:{backgroundColor:"#232a5c"},children:(0,A.jsxs)(h.A.Body,{className:"text-center",children:[(0,A.jsxs)("h6",{className:"text-uppercase text-white small fw-bold mb-2",children:[t,a&&(0,A.jsx)(C,{text:a})]}),(0,A.jsx)("h2",{className:"text-white fw-bold mb-0",children:n}),s&&(0,A.jsx)("i",{className:"".concat(s," position-absolute top-0 end-0 mt-3 me-3 text-white opacity-25 fs-4")})]})})};t.default=function(e){var t,n=e.titleId,m=e.startDate,g=e.endDate,v=e.matchConfidence,C=(0,i.useState)(!0),L=(0,r.A)(C,2),D=L[0],B=L[1],T=(0,i.useState)(null),M=(0,r.A)(T,2),R=M[0],P=M[1],F=(0,i.useState)(null),I=(0,r.A)(F,2),z=I[0],E=I[1],U=(0,i.useState)(30),H=(0,r.A)(U,2),G=H[0],W=H[1],O=(0,i.useCallback)(function(){var e=(0,a.A)((0,s.A)().m((function e(t){var a,r,i,l,c,d;return(0,s.A)().w((function(e){for(;;)switch(e.p=e.n){case 0:if(n&&m&&g){e.n=1;break}return E("Missing required parameters."),B(!1),e.a(2);case 1:return e.p=1,B(!0),E(null),a={title_id:n,start_date:w(m),end_date:w(g),min_confidence:v,retention_period:G},e.n=2,o.Ay.api.Fingerprinting.uniqueReturningReport(a,{signal:t});case 2:r=e.v,i=r.data,P(null!==i&&void 0!==i?i:null),e.n=5;break;case 3:if(e.p=3,d=e.v,null===t||void 0===t||!t.aborted){e.n=4;break}return e.a(2);case 4:console.error("Retention API error",d),E(null!==(l=null===d||void 0===d||null===(c=d.response)||void 0===c||null===(c=c.data)||void 0===c?void 0:c.message)&&void 0!==l?l:"Failed to load retention data.");case 5:return e.p=5,B(!1),e.f(5);case 6:return e.a(2)}}),e,null,[[1,3,5,6]])})));return function(t){return e.apply(this,arguments)}}(),[n,m,g,G,v]);(0,i.useEffect)((function(){var e=new AbortController;return O(e.signal),function(){return e.abort()}}),[O]);var q=(0,i.useMemo)((function(){var e;if(null===R||void 0===R||null===(e=R.cohort_analysis)||void 0===e||!e.length)return{};var t=R.cohort_analysis.map((function(e){return e.cohort_date})),n=function(e,t,n){return{name:t,type:"line",smooth:!0,showSymbol:!1,itemStyle:{color:n},areaStyle:{color:new j.graphic.LinearGradient(0,0,0,1,[{offset:0,color:n},{offset:1,color:"rgba(0,0,0,0)"}]),opacity:.2},data:R.cohort_analysis.map((function(t){var n;return null!==(n=t[e])&&void 0!==n?n:0}))}};return{backgroundColor:"transparent",tooltip:{trigger:"axis",backgroundColor:"rgba(0,0,0,0.8)",textStyle:{color:"#fff"}},legend:{data:["Day 1","Day 7","Day 30"],textStyle:{color:"#fff"},top:0},grid:{left:"3%",right:"4%",bottom:"3%",containLabel:!0},xAxis:{type:"category",boundaryGap:!1,data:t,axisLabel:{color:"#ccc",rotate:t.length>8?30:0},axisLine:{lineStyle:{color:"#555"}}},yAxis:{type:"value",axisLabel:{formatter:"{value}%",color:"#ccc"},splitLine:{lineStyle:{color:"#333"}},max:100},series:[n("day_1","Day 1",N),n("day_7","Day 7",k),n("day_30","Day 30",_)]}}),[R]),V=function(e){return e>=50?"rgba(25, 135, 84, 0.6)":e>=25?"rgba(255, 193, 7, 0.4)":e>0?"rgba(220, 53, 69, 0.4)":"transparent"};return D?(0,A.jsx)(h.A,{className:"bg-transparent border-0",children:(0,A.jsxs)(h.A.Body,{className:"text-center py-5",children:[(0,A.jsx)(f.A,{animation:"border",variant:"primary"}),(0,A.jsx)("p",{className:"mt-3 text-white",children:"Analyzing user retention..."})]})}):z?(0,A.jsx)(l.A,{variant:"danger",children:z}):null!==R&&void 0!==R&&R.stats?(0,A.jsxs)(i.Fragment,{children:[(0,A.jsx)(h.A,{className:"mb-4 shadow-sm border-0",style:{backgroundColor:"#1a2040"},children:(0,A.jsx)(h.A.Body,{className:"p-4",children:(0,A.jsxs)("div",{className:"d-flex align-items-start",children:[(0,A.jsx)("div",{className:"me-3 d-none d-md-block",children:(0,A.jsx)("div",{className:"rounded-circle bg-warning d-flex align-items-center justify-content-center",style:{width:"60px",height:"60px"},children:(0,A.jsx)("i",{className:"fas fa-magnet text-dark fs-3"})})}),(0,A.jsxs)("div",{children:[(0,A.jsx)("h4",{className:"text-white fw-bold mb-2",children:"User Retention & Loyalty"}),(0,A.jsx)("p",{className:"text-white mb-0",style:{maxWidth:"800px"},children:'Retention measures how many users come back after their first visit. High retention means your game or site is engaging. We track this by grouping users into "Cohorts" based on the day they first arrived.'})]})]})})}
1),(0,A.jsxs)(x.A,{className:"g-4 mb-4",children:[(0,A.jsx)(u.A,{md:3,children:(0,A.jsx)(S,{label:"Total Users",value:R.stats.total_users.toLocaleString(),iconClass:"fas fa-users",tooltip:"Total number of unique users seen in this period."})}),(0,A.jsx)(u.A,{md:3,children:(0,A.jsx)(S,{label:"New Users",value:R.stats.unique_users.toLocaleString(),iconClass:"fas fa-user-plus",tooltip:"Users who visited for the first time in this period."})}),(0,A.jsx)(u.A,{md:3,children:(0,A.jsx)(S,{label:"Returning Users",value:R.stats.returning_users.toLocaleString(),iconClass:"fas fa-undo",tooltip:"Users who visited before and came back in this period."})}),(0,A.jsx)(u.A,{md:3,children:(0,A.jsx)(S,{label:"Overall Retention",value:"".concat(R.stats.retention_rate,"%"),iconClass:"fas fa-chart-line",tooltip:"Percentage of users who returned at least once."})})]}),(0,A.jsxs)(h.A,{className:"mb-4 border-0 shadow-sm",style:{backgroundColor:"#232a5c"},children:[(0,A.jsxs)(h.A.Header,{className:"bg-transparent border-bottom border-secondary py-3 d-flex justify-content-between align-items-center",children:[(0,A.jsxs)("h5",{className:"mb-0 text-white",children:[(0,A.jsx)("i",{className:"fas fa-chart-area me-2"}),"Retention Trends"]}),(0,A.jsx)("div",{className:"d-flex gap-2",children:(0,A.jsx)(d.A,{size:"sm",children:[7,14,30,60,90].map((function(e){return(0,A.jsxs)(c.A,{variant:G===e?"primary":"outline-light",onClick:function(){return W(e)},children:[e," Days"]},e)}))})})]}),(0,A.jsx)(h.A.Body,{children:(0,A.jsx)("div",{style:{height:400},children:(0,A.jsx)(y.A,{echarts:j,option:q,style:{height:"100%",width:"100%"}})})})]}),(0,A.jsxs)(h.A,{className:"border-0 shadow-sm",style:{backgroundColor:"#232a5c"},children:[(0,A.jsxs)(h.A.Header,{className:"bg-transparent border-bottom border-secondary py-3 d-flex justify-content-between align-items-center",children:[(0,A.jsxs)("h5",{className:"mb-0 text-white",children:[(0,A.jsx)("i",{className:"fas fa-layer-group me-2"}),"Cohort Analysis"]}),(0,A.jsxs)(c.A,{variant:"outline-light",size:"sm",onClick:function(){var e;if(null!==R&&void 0!==R&&null!==(e=R.cohort_analysis)&&void 0!==e&&e.length){var t=R.cohort_analysis.map((function(e){return"".concat(e.cohort_date,",").concat(e.size,",").concat(e.day_1,",").concat(e.day_7,",").concat(e.day_30)})),n=new Blob([["Cohort Date,Users,Day 1 %,Day 7 %,Day 30 %"].concat(t).join("\n")],{type:"text/csv;charset=utf-8"});(0,b.saveAs)(n,"retention_cohorts_".concat(w(m),"_").concat(w(g),".csv"))}},disabled:!(null!==R&&void 0!==R&&null!==(t=R.cohort_analysis)&&void 0!==t&&t.length),children:[(0,A.jsx)("i",{className:"fas fa-download me-1"})," Export CSV"]})]}),(0,A.jsx)(h.A.Body,{className:"p-0",children:(0,A.jsx)("div",{className:"table-responsive",children:(0,A.jsxs)(p.A,{hover:!0,variant:"dark",className:"mb-0 align-middle text-center",children:[(0,A.jsx)("thead",{children:(0,A.jsxs)("tr",{children:[(0,A.jsx)("th",{className:"text-start ps-4",children:"Cohort Date"}),(0,A.jsx)("th",{children:"New Users"}),(0,A.jsx)("th",{children:"Day 1 Retention"}),(0,A.jsx)("th",{children:"Day 7 Retention"}),(0,A.jsx)("th",{children:"Day 30 Retention"})]})}),(0,A.jsx)("tbody",{children:R.cohort_analysis.map((function(e){return(0,A.jsxs)("tr",{children:[(0,A.jsx)("td",{className:"text-start ps-4 fw-bold",children:e.cohort_date}),(0,A.jsx)("td",{children:e.size.toLocaleString()}),(0,A.jsxs)("td",{style:{backgroundColor:V(e.day_1),color:"#fff"},children:[e.day_1,"%"]}),(0,A.jsxs)("td",{style:{backgroundColor:V(e.day_7),color:"#fff"},children:[e.day_7,"%"]}),(0,A.jsxs)("td",{style:{backgroundColor:V(e.day_30),color:"#fff"},children:[e.day_30,"%"]})]},e.cohort_date)}))})]})})})]})]}):(0,A.jsx)(h.A,{className:"bg-transparent border-0",children:(0,A.jsx)(h.A.Body,{children:(0,A.jsx)(l.A,{variant:"info",children:"No retention data available for the selected period."})})})}},85476:function(e,t,n){"use strict";n.r(t);var s=n(5544),a=n(88094),r=n(43930),i=n(23373),o=n(55713),l=n(47894),c=n(19393),d=n(77103),h=n(15678);t.default=function(e){var t=e.titleId,n=(0,i.zy)(),u=(0,a.useRef)(null),m=(0,a.useState)(!1),x=(0,s.A)(m,2),f=x[0],p=x[1],g=(0,a.useState)(!1),b=(0,s.A)(g,2),j=b[0],y=b[1],v=[{name:"Setup with AI",icon:l.UBk,link:d.default.reportsAiSetupTitlePage(t)},{name:"Funnel Reports",icon:l.gK3,link:d.default.reportsViewTitlePage(t)},{name:"Positioning",icon:l.pvD,link:d.default.reportsPositioningTitlePage(t)},{name:"Wishlists & Sales",icon:l.Vpi,link:d.default.reportsSalesTitlePage(t)},{name:"Web Analytics",icon:c.EKY,link:d.default.reportsWebTitlePage(t)},{name:"Cross Device",icon:l.XRN,link:d.default.reportsCrossDeviceTitlePage(t)},{name:"In-Game Analytics",icon:l.gdJ,link:d.default.reportsSessionsTitlePage(t)},{name:"Tracking Links",icon:l.CQO,link:d.default.reportsLinksTitlePage(t)},{name:"Upload",icon:l.rOd,link:d.default.reportsUploadTitlePage(t)},{name:"Code",icon:l.jTw,link:d.default.reportsCodeTitlePage(t)},{name:"Tokens",icon:l.bMg,link:d.default.reportsTokensTitlePage(t)}],A=function(){if(u.current){var e=u.current,t=e.scrollLeft,n=e.scrollWidth,s=e.clientWidth;p(t>0),y(t<n-s-1)}};(0,a.useEffect)((function(){var e=u.current;return e&&(e.addEventListener("scroll",A),A(),window.addEventListener("resize",A)),function(){e&&e.removeEventListener("scroll",A),window.removeEventListener("resize",A)}}),[]);var w=function(e){if(u.current){u.current.scrollBy({left:"left"===e?-200:200,behavior:"smooth"})}};return(0,h.jsxs)("div",{className:"reports-navbar-wrapper mb-4",children:[(0,h.jsxs)("div",{className:"position-relative",children:[(0,h.jsx)("div",{className:"scroll-btn-container start-0 ".concat(f?"visible":"invisible"),onClick:function(){return w("left")},children:(0,h.jsx)("button",{className:"btn btn-sm btn-light rounded-circle shadow-sm border",children:(0,h.jsx)(o.gc,{icon:l.Wzs,className:"text-muted"})})}),(0,h.jsx)("div",{className:"nav-scroller d-flex align-items-center",ref:u,children:v.map((function(e,t){var s,a=(s=e.link,n.pathname===s);return(0,h.jsxs)(r.N_,{to:e.link,className:"nav-item-link ".concat(a?"active":""),children:[(0,h.jsx)("div",{className:"icon-wrapper ".concat(a?"bg-primary text-white":"bg-light text-secondary"),children:(0,h.jsx)(o.gc,{icon:e.icon})}),(0,h.jsx)("span",{className:"nav-text",children:e.name}),a&&(0,h.jsx)("div",{className:"active-indicator"})]},t)}))}),(0,h.jsx)("div",{className:"scroll-btn-container end-0 ".concat(j?"visible":"invisible"),onClick:function(){return w("right")},children:(0,h.jsx)("button",{className:"btn btn-sm btn-light rounded-circle shadow-sm border",children:(0,h.jsx)(o.gc,{icon:l.XkK,className:"text-muted"})})})]}),(0,h.jsx)("style",{children:"\n                .reports-navbar-wrapper {\n                    background: #fff;\n                    border-radius: 12px;\n                    box-shadow: 0 2px 12px rgba(0,0,0,0.04);\n                    padding: 0.5rem;
1\n                    border: 1px solid #f0f0f0;\n                }\n\n                .nav-scroller {\n                    overflow-x: auto;\n                    white-space: nowrap;\n                    -ms-overflow-style: none;  /* IE and Edge */\n                    scrollbar-width: none;  /* Firefox */\n                    padding: 0.5rem;\n                    gap: 0.5rem;\n                    scroll-behavior: smooth;\n                }\n\n                .nav-scroller::-webkit-scrollbar {\n                    display: none;\n                }\n\n                .nav-item-link {\n                    display: flex;\n                    align-items: center;\n                    padding: 0.6rem 1rem;\n                    border-radius: 8px;\n                    text-decoration: none;\n                    color: #495057;\n                    transition: all 0.2s ease;\n                    position: relative;\n                    user-select: none;\n                    flex-shrink: 0;\n                }\n\n                .nav-item-link:hover {\n                    background-color: #f8f9fa;\n                    color: #0d6efd;\n                }\n\n                .nav-item-link.active {\n                    background-color: #f0f7ff;\n                    color: #0d6efd;\n                    font-weight: 600;\n                }\n\n                .icon-wrapper {\n                    width: 32px;\n                    height: 32px;\n                    border-radius: 8px;\n                    display: flex;\n                    align-items: center;\n                    justify-content: center;\n                    margin-right: 0.75rem;\n                    transition: all 0.2s ease;\n                    font-size: 0.9rem;\n                }\n\n                .nav-item-link:hover .icon-wrapper {\n                    background-color: #fff;\n                    color: #0d6efd;\n                    box-shadow: 0 2px 4px rgba(0,0,0,0.05);\n                }\n\n                .nav-item-link.active .icon-wrapper {\n                    background-color: #0d6efd;\n                    color: #fff;\n                    box-shadow: 0 4px 6px rgba(13, 110, 253, 0.2);\n                }\n\n                .nav-text {\n                    font-size: 0.95rem;\n                }\n\n                /* Scroll Buttons & Shadows */\n                .scroll-btn-container {\n                    position: absolute;\n                    top: 0;\n                    bottom: 0;\n                    width: 60px;\n                    display: flex;\n                    align-items: center;\n                    justify-content: center;\n                    z-index: 10;\n                    pointer-events: none;\n                }\n\n                .scroll-btn-container button {\n                    pointer-events: auto;\n                    width: 32px;\n                    height: 32px;\n                    display: flex;\n                    align-items: center;\n                    justify-content: center;\n                    opacity: 0.9;\n                    transition: opacity 0.2s;\n                }\n\n                .scroll-btn-container button:hover {\n                    opacity: 1;\n                    background-color: #fff;\n                }\n\n                .scroll-btn-container.start-0 {\n                    background: linear-gradient(to right, rgba(255,255,255,1) 40%, rgba(255,255,255,0));\n                    justify-content: flex-start;\n                    padding-left: 5px;\n                }\n\n                .scroll-btn-container.end-0 {\n                    background: linear-gradient(to left, rgba(255,255,255,1) 40%, rgba(255,255,255,0));\n                    justify-content: flex-end;\n                    padding-right: 5px;\n                }\n\n                .visible { opacity: 1; transition: opacity 0.3s; }\n                .invisible { opacity: 0; pointer-events: none; transition: opacity 0.3s; }\n\n                @media (max-width: 768px) {\n                    .nav-item-link {\n                        padding: 0.5rem 0.75rem;\n                    }\n                    .icon-wrapper {\n                        width: 28px;\n                        height: 28px;\n                        font-size: 0.8rem;\n                        margin-right: 0.5rem;\n                    }\n                    .nav-text {\n                        font-size: 0.85rem;\n                    }\n                }\n            "})]})}},10454:function(e,t,n){"use strict";n.r(t);var s=n(89379),a=n(5544),r=n(88094),i=n(45256),o=n(43930),l=n(23373),c=n(60692),d=n(77103),h=n(52580),u=n(87160),m=n(85476),x=n(58166),f=n(193
107),p=n(70518),g=n(68452),b=n(99763),j=n(55197),y=n(71209),v=n(82566),A=n(85948),w=n.n(A),N=(n(72360),n(74438)),k=n(47824),_=n(57233),C=n(56233),S=n(60931),L=n(25369),D=n(67071),B=n(34231),T=n(51337),M=n(35001),R=n(49923),P=n(10339),F=n(15678),I={backgroundColor:"#232a5c",border:"1px solid rgba(255, 255, 255, 0.1)",borderRadius:"12px",padding:"25px",marginBottom:"25px",boxShadow:"0 8px 32px rgba(0, 0, 0, 0.2)"},z={fontWeight:"600",color:"#e0e0e0",marginBottom:"8px",textTransform:"uppercase",fontSize:"0.75rem",letterSpacing:"0.5px",fontFamily:"Oswald, sans-serif"};t.default=function(){var e=(0,r.useState)(null),t=(0,a.A)(e,2),n=t[0],A=t[1],E=(0,r.useState)(!0),U=(0,a.A)(E,2),H=U[0],G=U[1],W=(0,r.useState)("identity"),O=(0,a.A)(W,2),q=O[0],V=O[1],K=(0,l.Zp)(),Y=(0,l.g)().id,J=new Date,X=new Date(J.getFullYear(),J.getMonth(),J.getDate()+1),Q=new Date(J.getFullYear(),J.getMonth(),J.getDate()-30),Z=(0,r.useState)(Q),$=(0,a.A)(Z,2),ee=$[0],te=$[1],ne=(0,r.useState)(X),se=(0,a.A)(ne,2),ae=se[0],re=se[1],ie=(0,r.useState)("30d"),oe=(0,a.A)(ie,2),le=oe[0],ce=oe[1],de=(0,r.useState)(60),he=(0,a.A)(de,2),ue=he[0],me=he[1];(0,r.useEffect)((function(){i.Ay.util.Session.isLoggedIn()||"undefined"===typeof window?i.Ay.api.Titles.view(Y).then((function(e){A(e.data.data)})).catch((function(e){console.error("Error fetching title",e)})).finally((function(){G(!1)})):K(d.default.authLogin())}),[Y,K]);return(0,F.jsxs)(r.Fragment,{children:[(0,F.jsx)(c.default,{position:"relative"}),(0,F.jsx)("div",{className:"container mt-4",children:(0,F.jsx)(u.default,{items:[{name:"Reports",link:d.default.reportsMainPage()},{name:(null===n||void 0===n?void 0:n.name)||"Loading...",link:d.default.reportsViewTitlePage(Y)},{name:"Cross Platform",link:d.default.reportsCrossDeviceTitlePage(Y)}]})}),(0,F.jsx)("section",{className:"pageheader-section-min",children:(0,F.jsx)("div",{className:"container",children:(0,F.jsxs)("div",{className:"section-wrapper text-center",children:[(0,F.jsx)("h2",{className:"pageheader-title",children:"Cross-Platform Intelligence"}),(0,F.jsx)("p",{className:"lead",children:"See the full picture. We connect the dots between your website visitors, ad clicks, and game players\u2014even when they switch devices."})]})})}),(0,F.jsx)("div",{className:"container mt-5 mb-5",children:H?(0,F.jsx)(h.default,{}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(m.default,{titleId:Y}),(0,F.jsxs)("div",{className:"alert alert-info mb-4",style:{backgroundColor:"rgba(13, 202, 240, 0.1)",border:"1px solid rgba(13, 202, 240, 0.2)",color:"#fff"},children:[(0,F.jsx)("i",{className:"fas fa-info-circle me-2"}),"To populate the reports on this page, make sure you have implemented the ",(0,F.jsx)(o.N_,{className:"text-info fw-bold",to:d.default.reportsCodeTitlePage(null===n||void 0===n?void 0:n.id),children:"fingerprinting"}),", the web analytics on your website, and you use the ",(0,F.jsx)(o.N_,{className:"text-info fw-bold",to:d.default.reportsLinksTitlePage(null===n||void 0===n?void 0:n.id),children:"tracking links"})," in ads, your website and socials."]}),(0,F.jsx)("div",{className:"mt-4 mb-4",children:(null===n||void 0===n?void 0:n.id)&&(0,F.jsx)(P.default,{titleId:null===n||void 0===n?void 0:n.id,gameName:null===n||void 0===n?void 0:n.name,headerTitle:"Cross Device Analysis Assistant",description:"Ask the AI to analyze ".concat(n.name,"'s cross device tracking data. Be precise in your ask.")})}),(0,F.jsxs)("div",{style:I,children:[(0,F.jsxs)("div",{className:"d-flex flex-wrap justify-content-between align-items-center mb-4",children:[(0,F.jsxs)("div",{children:[(0,F.jsxs)("h5",{className:"text-white mb-1",children:[(0,F.jsx)("i",{className:"fas fa-sliders-h me-2 text-primary"}),"Report Settings"]}),(0,F.jsx)("p",{className:"text-white small mb-0",children:"Customize the date range and accuracy level for your reports."})]}),(0,F.jsx)("div",{className:"d-flex gap-2 mt-3 mt-md-0",children:["7d","30d","90d","custom"].map((function(e){return(0,F.jsx)("button",{className:"default-button ".concat(le===e?"":"reverse-effect"),onClick:function(){return function(e){ce(e);var t=new Date;switch(e){case"7d":te(new Date(t.getFullYear(),t.getMonth(),t.getDate()-7));break;case"30d":te(new Date(t.getFullYear(),t.getMonth(),t.getDate()-30));break;case"90d":te(new Date(t.getFullYear(),t.getMonth(),t.getDate()-90))}}(e)},style:{lineHeight:"35px",height:"40px",fontSize:"13px",padding:"0 20px"},children:(0,F.jsx)("span",{children:"custom"===e?"Custom Range":"Last ".concat(e.replace("d"," Days"))})},e)}))})]}
1),(0,F.jsxs)(j.A,{className:"g-4",children:["custom"===le&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(f.A,{md:3,children:(0,F.jsxs)(p.A.Group,{children:[(0,F.jsx)(p.A.Label,{style:z,children:"Start Date"}),(0,F.jsx)(w(),{selected:ee,onChange:function(e){return te(e)},selectsStart:!0,startDate:ee,endDate:ae,maxDate:ae,dateFormat:"yyyy-MM-dd",className:"form-control bg-dark text-white border-secondary"})]})}),(0,F.jsx)(f.A,{md:3,children:(0,F.jsxs)(p.A.Group,{children:[(0,F.jsx)(p.A.Label,{style:z,children:"End Date"}),(0,F.jsx)(w(),{selected:ae,onChange:function(e){return re(e)},selectsEnd:!0,startDate:ee,endDate:ae,minDate:ee,maxDate:new Date(J.getFullYear(),J.getMonth(),J.getDate()+1),dateFormat:"yyyy-MM-dd",className:"form-control bg-dark text-white border-secondary"})]})})]}),(0,F.jsx)(f.A,{md:"custom"===le?6:12,children:(0,F.jsxs)(p.A.Group,{children:[(0,F.jsxs)("div",{className:"d-flex justify-content-between align-items-center mb-2",children:[(0,F.jsx)(p.A.Label,{style:(0,s.A)((0,s.A)({},z),{},{marginBottom:0}),children:"Match Confidence Threshold"}),(0,F.jsxs)(x.A,{bg:ue>=80?"success":ue>=60?"warning":"danger",children:[ue,"% Accuracy"]})]}),(0,F.jsxs)("div",{className:"d-flex align-items-center",children:[(0,F.jsx)(p.A.Range,{value:ue,onChange:function(e){return me(parseInt(e.target.value,10))},min:0,max:100,step:5,className:"me-3 custom-range"}),(0,F.jsx)(b.A,{placement:"top",overlay:(0,F.jsxs)(v.A,{children:[(0,F.jsx)("strong",{children:"Higher (80%+):"})," Only links users when we are very certain (e.g., same device ID). Fewer matches, but highly accurate.",(0,F.jsx)("br",{}),(0,F.jsx)("br",{}),(0,F.jsx)("strong",{children:"Lower (40-60%):"})," Links users based on shared traits (e.g., same IP + Browser). More matches, but potential for false positives."]}),children:(0,F.jsx)("i",{className:"fas fa-info-circle text-white",style:{cursor:"help"}})})]}),(0,F.jsx)(p.A.Text,{className:"text-white small",children:"Adjust how strict the system is when linking anonymous web visitors to game players."})]})})]})]}),(0,F.jsxs)(y.A.Container,{activeKey:q,onSelect:function(e){return V(e)},children:[(0,F.jsxs)(g.A,{variant:"pills",className:"mb-4 custom-nav-pills flex-column flex-lg-row gap-2",children:[(0,F.jsx)(g.A.Item,{className:"flex-fill text-center",children:(0,F.jsxs)(g.A.Link,{eventKey:"identity",className:"py-3",children:[(0,F.jsx)("i",{className:"fas fa-id-card me-2"}),"Identity Profiles"]})}),(0,F.jsx)(g.A.Item,{className:"flex-fill text-center",children:(0,F.jsxs)(g.A.Link,{eventKey:"install_journey",className:"py-3",children:[(0,F.jsx)("i",{className:"fas fa-shoe-prints me-2"}),"Install Journey"]})}),(0,F.jsx)(g.A.Item,{className:"flex-fill text-center",children:(0,F.jsxs)(g.A.Link,{eventKey:"ad_campaigns",className:"py-3",children:[(0,F.jsx)("i",{className:"fas fa-ad me-2"}),"Ad Performance"]})}),(0,F.jsx)(g.A.Item,{className:"flex-fill text-center",children:(0,F.jsxs)(g.A.Link,{eventKey:"attribution",className:"py-3",children:[(0,F.jsx)("i",{className:"fas fa-project-diagram me-2"}),"Attribution"]})}),(0,F.jsx)(g.A.Item,{className:"flex-fill text-center",children:(0,F.jsxs)(g.A.Link,{eventKey:"user_journey",className:"py-3",children:[(0,F.jsx)("i",{className:"fas fa-route me-2"}),"User Flow"]})}),(0,F.jsx)(g.A.Item,{className:"flex-fill text-center",children:(0,F.jsxs)(g.A.Link,{eventKey:"devices",className:"py-3",children:[(0,F.jsx)("i",{className:"fas fa-mobile-alt me-2"}),"Devices"]})}),(0,F.jsx)(g.A.Item,{className:"flex-fill text-center",children:(0,F.jsxs)(g.A.Link,{eventKey:"geolocation",className:"py-3",children:[(0,F.jsx)("i",{className:"fas fa-globe-americas me-2"}),"Geo"]})}),(0,F.jsx)(g.A.Item,{className:"flex-fill text-center",children:(0,F.jsxs)(g.A.Link,{eventKey:"fraud",className:"py-3",children:[(0,F.jsx)("i",{className:"fas fa-shield-alt me-2"}),"Fraud"]})})]}),(0,F.jsx)("div",{className:"report-content-wrapper",children:function(){var e={titleId:Y,startDate:ee,endDate:ae,matchConfidence:ue};switch(q){case"identity":return(0,F.jsx)(k.default,(0,s.A)({},e));case"install_journey":return(0,F.jsx)(M.default,(0,s.A)({},e));case"ad_campaigns":return(0,F.jsx)(R.default,(0,s.A)({},e));case"attribution":return(0,F.jsx)(_.default,(0,s.A)({},e));case"user_journey":return(0,F.jsx)(C.default,(0,s.A)({},e));case"devices":return(0,F.jsx)(L.default,(0,s.A)({},e));case"geolocation":return(0,F.jsx)(D.default,(0,s.A)({},e));case"retention":return(0,F.jsx)(S.default,(0,s.A)({},e));case"fraud":return(0,F.jsx)(B.default,(0,s.A)({},e));case"confidence":return(0,F.jsx)(T.default,(0,s.A)({},e));default:return null}}()})]}),(0,F.jsx)("div",{style:I,className:"mt-5",children:(0,F.jsxs)(j.A,{className:"align-items-center",children:[(0,F.jsxs)(f.A,{md:8,children:[(0,F.jsxs)("h5",{className:"text-white mb-2",children:[(0,F.jsx)("i",{className:"fas fa-code me-2 text-info"}),"Tracking Implementation"]}),(0,F.jsx)("p",{className:"text-white mb-0",children:"To get the most out of these reports, ensure the Glitch tracking code is installed on your website and the SDK is integrated into your game client. This allows us to connect the dots between web visits and game play."})]}),(0,F.jsx)(f.A,{md:4,className:"text-md-end mt-3 mt-md-0",children:(0,F.jsx)(o.N_,{to:d.default.reportsCodeTitlePage(Y),className:"default-button reverse-effect",style:{display:"inline-block",lineHeight:"45px",height:"45px",padding:"0 25px"},children:(0,F.jsx)("span",{children:"View Integration Guide"})})})]})})]})}),(0,F.jsx)(N.default,{})]})}},8035:function(e,t,n){var s,a,r;a=[],void 0===(r="function"===typeof(s=function(){"use strict";function t(e,t){return"undefined"==typeof t?t={autoBom:!1}:"object"!=typeof t&&(console.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e}function s(e,t,n){var s=new XMLHttpRequest;s.open("GET",e),s.responseType="blob",s.onload=function(){l(s.response,t,n
1)},s.onerror=function(){console.error("could not download file")},s.send()}function a(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return 200<=t.status&&299>=t.status}function r(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(s){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var i="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof n.g&&n.g.global===n.g?n.g:void 0,o=i.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=i.saveAs||("object"!=typeof window||window!==i?function(){}:"download"in HTMLAnchorElement.prototype&&!o?function(e,t,n){var o=i.URL||i.webkitURL,l=document.createElement("a");t=t||e.name||"download",l.download=t,l.rel="noopener","string"==typeof e?(l.href=e,l.origin===location.origin?r(l):a(l.href)?s(e,t,n):r(l,l.target="_blank")):(l.href=o.createObjectURL(e),setTimeout((function(){o.revokeObjectURL(l.href)}),4e4),setTimeout((function(){r(l)}),0))}:"msSaveOrOpenBlob"in navigator?function(e,n,i){if(n=n||e.name||"download","string"!=typeof e)navigator.msSaveOrOpenBlob(t(e,i),n);else if(a(e))s(e,n,i);else{var o=document.createElement("a");o.href=e,o.target="_blank",setTimeout((function(){r(o)}))}}:function(e,t,n,a){if((a=a||open("","_blank"))&&(a.document.title=a.document.body.innerText="downloading..."),"string"==typeof e)return s(e,t,n);var r="application/octet-stream"===e.type,l=/constructor/i.test(i.HTMLElement)||i.safari,c=/CriOS\/[\d]+/.test(navigator.userAgent);if((c||r&&l||o)&&"undefined"!=typeof FileReader){var d=new FileReader;d.onloadend=function(){var e=d.result;e=c?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),a?a.location.href=e:location=e,a=null},d.readAsDataURL(e)}else{var h=i.URL||i.webkitURL,u=h.createObjectURL(e);a?a.location=u:location.href=u,a=null,setTimeout((function(){h.revokeObjectURL(u)}),4e4)}});i.saveAs=l.saveAs=l,e.exports=l})?s.apply(t,a):s)||(e.exports=r)}}]);

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