PageSourceSearch

https://app.renfluence.ai/_next/static/chunks/866.d76c86d8d5d7dbb3.js

js renfluence.ai collected 2026-10-05 12:30:49 UTC 23,244 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[866],{90866:function(e,t,o){o.d(t,{generatePPTX:function(){return k}});var l=o(18100),a=o(76272),n=o(51381),r=o(59750);let i="0051FD",c={dark:"111827",gray:"6b7280",lightGray:"f3f4f6",white:"ffffff",brand:i,accent:"00d9e6",blue:i,darkBlue:i,green:"10b981",red:"ef4444",yellow:"eab308",pink:"ec4899",purple:"8b5cf6",headerBg:i},d=[i,"00d9e6","10b981","f59e0b","ef4444","8b5cf6","ec4899","f97316"];function s(e){let t=e.replace("#","");c={...c,brand:t,blue:t,darkBlue:t,headerBg:t},d=[t,"00d9e6","10b981","f59e0b","ef4444","8b5cf6","ec4899","f97316"]}let f={views:u('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#6b7280" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/></svg>'),likes:u('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#6b7280" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"/></svg>'),comments:u('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#6b7280" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/></svg>'),shares:u('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#6b7280" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="18" cy="5" r="3"/><circle cx="6" cy="12" r="3"/><circle cx="18" cy="19" r="3"/><line x1="8.59" y1="13.51" x2="15.42" y2="17.49"/><line x1="15.41" y1="6.51" x2="8.59" y2="10.49"/></svg>'),saves:u('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#6b7280" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M19 21l-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z"/></svg>')};function u(e){return"data:image/svg+xml;base64,".concat(btoa(e))}let h={instagram:u('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#E4405F"><path d="M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838c-3.403 0-6.162 2.759-6.162 6.162s2.759 6.163 6.162 6.163 6.162-2.759 6.162-6.163c0-3.403-2.759-6.162-6.162-6.162zm0 10.162c-2.209 0-4-1.79-4-4 0-2.209 1.791-4 4-4s4 1.791 4 4c0 2.21-1.791 4-4 4zm6.406-11.845c-.796 0-1.441.645-1.441 1.44s.645 1.44 1.441 1.44c.795 0 1.439-.645 1.439-1.44s-.644-1.44-1.439-1.44z"/></svg>'),tiktok:u('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#000000"><path d="M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z"/></svg>'),youtube:u('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#FF0000"><path d="M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"/></svg>'),facebook:u('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#1877F2"><path d="M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"/></svg>'),twitter:u('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#1DA1F2"><path d="M23.953 4.57a10 10 0 01-2.825.775 4.958 4.958 0 002.163-2.723c-.951.555-2.005.959-3.127 1.184a4.92 4.92 0 00-8.384 4.482C7.69 8.095 4.067 6.13 1.64 3.162a4.822 4.822 0 00-.666 2.475c0 1.71.87 3.213 2.188 4.096a4.904 4.904 0 01-2.228-.616v.06a4.923 4.923 0 003.946 4.827 4.996 4.996 0 01-2.212.085 4.936 4.936 0 004.604 3.417 9.867 9.867 0 01-6.102 2.105c-.39 0-.779-.023-1.17-.067a13.995 13.995 0 007.557 2.209c9.053 0 13.998-7.496 13.998-13.985 0-.21 0-.42-.015-.63A9.935 9.935 0 0024 4.59z"/></svg>')};function g(e,t,o,l){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.22,n=h[t.toLowerCase()]||null;n&&e.addImage({data:n,x:o,y:l,w:a,h:a})}function p(e,t){if(!e)return"Unknown";try{return(0,n.WU)(new Date(e),t)}catch(t){return e}}let w={instagram:"Instagram",tiktok:"TikTok",youtube:"YouTube",facebook:"Facebook",twitter:"Twitter",x:"X"};function m(e,t){if(!e||"object"!=typeof e)return null;for(let o of t){let t=e[o];if("string"==typeof t&&t.trim())return t.trim()}return null}
1function b(e){return e.split(/[_\s-]+/).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ")}function y(e,t,o,a,n){let r=a.map(e=>{var t;return{label:"string"==typeof(t=e.label)&&t.trim()?t.trim():"number"==typeof t&&Number.isFinite(t)?String(t):m(t,["label","name","title","username","platform_name"])||"Unknown",value:Number(e.value)}}).filter(e=>Number.isFinite(e.value)&&e.value>0);if(0===r.length)return;let i=n.colors||d.slice(0,r.length),s=n.title?.35:0,f=r.length>6?.55:.45,u=n.x+.65,h=n.y+s,g=n.w-.65-.12,p=n.h-s-f-.12,w=function(e){if(e<=0)return 1;let t=e/4,o=Math.pow(10,Math.floor(Math.log10(t||1))),l=t/o;return(l<=1?1:l<=2?2:l<=2.5?2.5:l<=5?5:10)*o*4}(Math.max(...r.map(e=>e.value))),b=g/r.length,y=Math.min(.42,.62*b),v=r.length>6?6:7;n.title&&e.addText(n.title,{x:n.x,y:n.y,w:n.w,h:.25,fontSize:13,color:c.dark,bold:!0}),e.addShape(t.ShapeType.rect,{x:u,y:h,w:g,h:p,fill:{color:c.white,transparency:100},line:{color:c.white,transparency:100}});for(let o=0;o<=4;o++){let a=h+p/4*o,r=w-w/4*o;e.addShape(t.ShapeType.line,{x:u,y:a,w:g,h:0,line:{color:4===o?"d1d5db":"e5e7eb",width:4===o?1:.5,dashType:4===o?"solid":"dash"}}),e.addText((0,l.D)(Math.round(r)),{x:n.x,y:a-.08,w:.65-.08,h:.16,fontSize:7,color:c.gray,align:"right"})}r.forEach((o,l)=>{let a=Math.max(o.value/w*p,.04),n=i[l%i.length];e.addShape(t.ShapeType.roundRect,{x:u+b*l+(b-y)/2,y:h+p-a,w:y,h:a,fill:{color:n},line:{color:n,transparency:100},rectRadius:.03}),e.addText(function(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2;if(e.length<=t)return e;let l=e.split(/\s+/),a=[],n="";for(let e of l){let l=n?"".concat(n," ").concat(e):e;if(l.length<=t){n=l;continue}if(n&&a.push(n),n=e,a.length===o-1)break}a.length<o&&n&&a.push(n);let r=a.slice(0,o);if(r.join(" ").length<e.length&&r.length>0){let e=r[r.length-1];r[r.length-1]="".concat(e.slice(0,Math.max(0,t-1)).trimEnd(),"...")}return r.join("\n")}(o.label,r.length>6?10:16),{x:u+b*l,y:h+p+.08,w:b,h:f-.08,fontSize:v,color:c.dark,align:"center",valign:"top"})})}function v(e,t,o,l){e.addShape(t.ShapeType.rect,{x:0,y:0,w:13.33,h:.7,fill:{color:c.brand}}),e.addText(o,{x:.5,y:.1,w:12.33,h:.5,fontSize:24,color:c.white,bold:!0});let a=.85;return l&&(e.addText(l,{x:.5,y:a,w:12.33,h:.3,fontSize:11,color:c.gray}),a+=.35),a}function x(e,t,o,l){let a=t.map(e=>({text:e,options:{bold:!0,fontSize:9,color:c.white,fill:{color:c.headerBg},align:e===t[0]?"left":"right"}})),n=o.map(e=>e.cells.map((t,o)=>({text:t.text,options:{fontSize:9,color:t.color||c.dark,fill:{color:e.bg},bold:t.bold||!1,align:0===o?"left":"right",...t.hyperlink?{hyperlink:{url:t.hyperlink}}:{}}})));e.addTable([a,...n],{x:l.x,y:l.y,w:l.w,colW:l.colW,rowH:.4,border:{type:"solid",pt:.5,color:"e5e7eb"},autoPage:!1})}function S(e,t,o,a,n,r,i){let d=Math.ceil(a.length/12),s="average"===r?"Average":"Total",f=!!i,u=f?["","Name","Content","Views","Engagement","Likes","Comments","Shares","Saves"]:["Name","Content","Views","Engagement","Likes","Comments","Shares","Saves"],h=f?[.6,2.93,1.1,1.3,1.4,1.2,1.2,1.1,1.1]:[3.13,1.2,1.5,1.5,1.3,1.3,1.2,1.2];for(let p=0;p<d;p++){let d=e.addSlide(),w=a.slice(12*p,(p+1)*12),m=.4;if(0===p){m=v(d,e,"".concat(t," (").concat(s,")"),o)+.1;let l=(e,t)=>{var o,l;return null!==(l=null===(o="average"===r?e.average_stats:e.total_stats)||void 0===o?void 0:o[t])&&void 0!==l?l:0},i=a.slice(0,8),c=i.map(e=>({label:n(e),value:l(e,"views")})).filter(e=>e.value>0),f=i.map(e=>({label:n(e),value:l(e,"engagement")})).filter(e=>e.value>0);c.length>0&&y(d,e,"Views",c,{x:.5,y:m,w:5.965,h:2.8,title:"Views Distribution"}),f.length>0&&y(d,e,"Engagement",f,{x:6.865,y:m,w:5.965,h:2.8,title:"Engagement Distribution"}),m+=3}x(d,u,w.map((e,t)=>{let o="average"===r?e.average_stats:e.total_stats,a=[{text:n(e),bold:!0},{text:(0,l.uf)(e.total_media||0)},{text:(0,l.uf)((null==o?void 0:o.views)||0)},{text:(0,l.uf)((null==o?void 0:o.engagement)||0)},{text:(0,l.uf)((null==o?void 0:o.likes)||0)},{text:(0,l.uf)((null==o?void 0:o.comments)||0)},{text:0===((null==o?void 0:o.shares)||0)?"-":(0,l.uf)(o.shares)},{text:0===((null==o?void 0:o.saves)||0)?"-":(0,l.uf)(o.saves)}];return f&&a.unshift({text:""}),{cells:a,bg:t%2==0?c.lightGray:c.white}}),{x:.5,y:m,w:12.33,colW:h}
1),f&&w.forEach((e,t)=>{let o=i(e);o&&g(d,o,.5+(h[0]-.2)/2,m+(t+1)*.4+.1,.2)})}}async function k(e){var t,d,u;let h=new(await Promise.all([o.e(8169),o.e(7635)]).then(o.bind(o,22036))).default;h.layout="LAYOUT_WIDE",h.author="Renfluence",h.subject="Campaign Report: ".concat(e.campaign.title),h.title="".concat(e.campaign.title," - Campaign Report"),e.customColor?s(e.customColor):s(i);let y=e.customLogo;if(!y)try{let e=new window.Image;e.crossOrigin="anonymous",y=await new Promise(t=>{e.onload=()=>{var o;let l=document.createElement("canvas");l.width=e.width,l.height=e.height,null===(o=l.getContext("2d"))||void 0===o||o.drawImage(e,0,0),t(l.toDataURL("image/png"))},e.onerror=()=>t(void 0),e.src="/images/logos/logo_full.png"})}catch(e){}!function(e,t,o,l){let a=e.addSlide();a.background={color:c.white},l&&a.addImage({data:l,x:5.165,y:.6,w:3,h:1.2,sizing:{type:"contain",w:3,h:1.2}}),a.addText("Campaign Report",{x:.5,y:l?2.2:1.2,w:12.33,h:.8,fontSize:36,fontFace:"Arial",color:c.dark,bold:!0,align:"center"}),a.addShape(e.ShapeType.rect,{x:0,y:3.75,w:13.33,h:3.75,fill:{color:c.brand}}),a.addText(t.title,{x:.5,y:4.25,w:12.33,h:.7,fontSize:26,fontFace:"Arial",color:c.white,bold:!0,align:"center"}),function(e,t,o){let l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:c.gray,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:c.dark,n=12.33/t.length;t.forEach((t,r)=>{let i=.5+r*n;e.addText(t.label.toUpperCase(),{x:i,y:o,w:n,h:.3,fontSize:12,color:l,align:"center",bold:!0,letterSpacing:1}),e.addText(t.value,{x:i,y:o+.35,w:n,h:.4,fontSize:18,color:a,bold:!0,align:"center"})})}(a,[{label:"Status",value:t.status||"Active"},{label:"Created",value:p(t.created_at,"MMM dd, yyyy")},{label:"Influencers",value:String(o)},{label:"Generated",value:(0,n.WU)(new Date,"MMM dd, yyyy")}],5.35,c.accent,c.white)}(h,e.campaign,e.totalInfluencers,y),e.sectionOptions.executiveSummary&&function(e,t,o){var a;let n=e.addSlide();v(n,e,"Executive Summary"),function(e,t,o,l){let a=(12.33-.3*(o.length-1))/o.length;o.forEach((o,l)=>{let n=.5+l*(a+.3);e.addShape(t.ShapeType.roundRect,{x:n,y:1,w:a,h:1,fill:{color:o.bg},line:{color:o.border,width:1.5},rectRadius:.1}),e.addText(o.label,{x:n,y:1.08,w:a,h:.35,fontSize:10,color:o.border,align:"center",bold:!0}),e.addText(o.value,{x:n,y:1.4,w:a,h:.5,fontSize:20,color:o.textColor,align:"center",bold:!0})})}(n,e,[{label:"Total Views",value:(0,l.uf)(t.totalViews),bg:"e8f0fe",border:c.brand,textColor:"002a85"},{label:"Engagement",value:(0,l.uf)(t.totalEngagement),bg:"e0faf9",border:c.accent,textColor:"006b6b"},{label:"Total Media",value:String(o),bg:"fef9c3",border:c.yellow,textColor:"713f12"},{label:"Engage Rate",value:"".concat((null===(a=t.engagementRate)||void 0===a?void 0:a.toFixed(1))||"0.0","%"),bg:"fce7f3",border:c.pink,textColor:"831843"}],1),n.addText("Engagement Breakdown",{x:.5,y:2.3,w:12.33,h:.4,fontSize:16,color:c.dark,bold:!0}),[{label:"LIKES",value:(0,l.uf)(t.totalLikes),bg:"e8f0fe",color:"002a85",border:c.brand,iconKey:"likes"},{label:"COMMENTS",value:(0,l.uf)(t.totalComments),bg:"fef2f2",color:"991b1b",border:"f87171",iconKey:"comments"},{label:"SHARES",value:(0,l.uf)(t.totalShares),bg:"e0faf9",color:"006b6b",border:c.accent,iconKey:"shares"},{label:"SAVES",value:(0,l.uf)(t.totalSaves),bg:"fef9c3",color:"713f12",border:c.yellow,iconKey:"saves"}].forEach((t,o)=>{let l=.5+o%2*6.3149999999999995,a=2.9+2.35*Math.floor(o/2);n.addShape(e.ShapeType.roundRect,{x:l,y:a,w:6.015,h:2.0500000000000003,fill:{color:t.bg},line:{color:t.border,width:1.5},rectRadius:.12}),f[t.iconKey]&&n.addImage({data:f[t.iconKey],x:l+2.8325,y:a+.25,w:.35,h:.35}),n.addText(t.label,{x:l,y:a+.7,w:6.015,h:.3,fontSize:11,color:t.border,align:"center",bold:!0}),n.addText(t.value,{x:l,y:a+1,w:6.015,h:.6,fontSize:28,color:t.color,align:"center",bold:!0})})}(h,e.totalStats,e.totalMedia),e.sectionOptions.campaignRoster&&e.roster.length>0&&function(e,t){let o=Math.ceil(t.length/12),a=["Name","","Status","Followers","Avg Views","Avg Engagement"],n=[3.93,.6,1.5,1.8,1.8,2.32];for(let i=0;i<o;i++){let o=e.addSlide(),d=t.slice(12*i,(i+1)*12),s=.4;0===i&&(s=v(o,e,"Campaign Roster","Influencers and content creators")+.1);let f=d.filter(e=>e.profile_info);x(o,a,f.map((e,t)=>{var o;let a=e.profile_info,n="CLIENT_PENDING"===e.status,i=a.firstname&&a.lastname?"".concat(a.firstname," ").concat(a.lastname):a.username||"Unknown",d=a.platform||"unknown",s=null===(o=a.aggregated_stats)||void 0===o?void 0:o.find(e=>"normal"===e.stat_type),f=function(e,t){if(!t)return null;switch(e.toLowerCase()){case"instagram":return"https://www.instagram.com/".concat(t,"/");case"tiktok":return"https://www.tiktok.com/@".concat(t);case"youtube":return"https://www.youtube.com/@".concat(t);case"facebook":return"https://www.facebook.com/".concat(t);case"twitter":return"https://twitter.com/".concat(t);default:return null}}(d,a.username)||void 0;return{cells:[{text:i,bold:!0,color:f?c.brand:void 0,hyperlink:f},{text:""},{text:n?"PENDING":"APPROVED",bold:!0,color:n?"92400e":"065f46"}
1,{text:(0,l.qX)(a.follower_count||0),bold:!0,color:"059669"},{text:(0,l.D)((0,r.z5)(s)),bold:!0,color:"2563eb"},{text:(0,l.D)((0,r.Lo)(s)),bold:!0,color:"7c3aed"}],bg:n?"fef3c7":t%2==0?c.lightGray:c.white}}),{x:.5,y:s,w:12.33,colW:n});let u=.5+n[0];f.forEach((e,t)=>{var l;g(o,(null===(l=e.profile_info)||void 0===l?void 0:l.platform)||"unknown",u+(n[1]-.2)/2,s+(t+1)*.4+.1,.2)})}}(h,e.roster),e.sectionOptions.sentimentAnalysis&&e.sentimentMetrics&&function(e,t,o){let{totalPositive:a,totalNegative:n,positiveBrand:r,negativeBrand:i,positiveCompetitor:d,negativeCompetitor:s,mediaAnalyzed:f}=t,u=a+n,h=u>0?a/u*100:0,g=u>0?n/u*100:0,p=e.addSlide();v(p,e,"Sentiment Analysis");let w=[{label:"Brand Positive",value:(0,l.uf)(r),bg:"e8f0fe",border:c.brand,color:"002a85"},{label:"Brand Negative",value:(0,l.uf)(i),bg:"fee2e2",border:c.red,color:"991b1b"},{label:"Competitor Positive",value:(0,l.uf)(d),bg:"e0faf9",border:c.accent,color:"006b6b"},{label:"Competitor Negative",value:(0,l.uf)(s),bg:"fef9c3",border:c.yellow,color:"713f12"}],m=(4.3999999999999995-.2*(w.length-1))/w.length;p.addText("MENTION BREAKDOWN",{x:6.7,y:1,w:6.13,h:.3,fontSize:10,color:c.gray,bold:!0}),w.forEach((t,o)=>{let l=1.4+o*(m+.2);p.addShape(e.ShapeType.roundRect,{x:6.7,y:l,w:6.13,h:m,fill:{color:t.bg},line:{color:t.border,width:1.5},rectRadius:.1}),p.addText(t.label,{x:6.9,y:l+.1,w:5.7299999999999995,h:.25,fontSize:9,color:t.border,bold:!0}),p.addText(t.value,{x:6.9,y:l+.4,w:5.7299999999999995,h:.5,fontSize:22,color:t.color,bold:!0})});let b=1+(4.8-(1.6+.3+1.8))/2;p.addShape(e.ShapeType.roundRect,{x:.5,y:b,w:5.8,h:1.6,fill:{color:"f8fafc"},line:{color:"e2e8f0",width:1},rectRadius:.12}),p.addText("TOTAL ANALYZED COMMENTS",{x:.8,y:b+.15,w:5.2,h:.3,fontSize:10,color:c.gray,bold:!0}),p.addText((0,l.uf)(u),{x:.8,y:b+.45,w:3,h:.8,fontSize:40,color:c.dark,bold:!0}),p.addText("from ".concat(f," media"),{x:.8,y:b+1.2,w:5.2,h:.25,fontSize:10,color:c.gray});let y=b+1.6+.3;if(p.addShape(e.ShapeType.roundRect,{x:.5,y:y,w:2.8,h:1.8,fill:{color:"f0fdf4"},line:{color:c.green,width:2},rectRadius:.12}),p.addText("POSITIVE",{x:.7,y:y+.15,w:2.4,h:.25,fontSize:10,color:"059669",bold:!0}),p.addText((0,l.uf)(a),{x:.7,y:y+.5,w:2.4,h:.6,fontSize:30,color:"064e3b",bold:!0}),p.addText("".concat(h.toFixed(1),"%"),{x:.7,y:y+1.2,w:2.4,h:.35,fontSize:18,color:"059669",bold:!0}),p.addShape(e.ShapeType.roundRect,{x:3.5,y:y,w:2.8,h:1.8,fill:{color:"fef2f2"},line:{color:c.red,width:2},rectRadius:.12}),p.addText("NEGATIVE",{x:3.6999999999999997,y:y+.15,w:2.4,h:.25,fontSize:10,color:"dc2626",bold:!0}),p.addText((0,l.uf)(n),{x:3.6999999999999997,y:y+.5,w:2.4,h:.6,fontSize:30,color:"991b1b",bold:!0}),p.addText("".concat(g.toFixed(1),"%"),{x:3.6999999999999997,y:y+1.2,w:2.4,h:.35,fontSize:18,color:"dc2626",bold:!0}),o){let t=o.split("\n").filter(e=>e.trim().length>0),l=e=>{let t=[];for(let o of e){let e=o.trim(),l=e.match(/^(#{1,3})\s+(.+)$/);if(l){let e=l[1].length,o=l[2].replace(/\*\*([^*]+)\*\*/g,"$1").replace(/\*([^*]+)\*/g,"$1");t.push({text:o+"\n",options:{fontSize:1===e?14:2===e?12:11,bold:!0,color:c.dark,breakType:t.length>0?"none":void 0}});continue}if(/^\s*[-*+]\s+/.test(e)){let o=e.replace(/^\s*[-*+]\s+/,"").replace(/\*\*([^*]+)\*\*/g,"$1").replace(/\*([^*]+)\*/g,"$1");t.push({text:"•  "+o+"\n",options:{fontSize:10,color:"374151",indentLevel:1}});continue}if(/^\s*\d+\.\s+/.test(e)){let o=e.replace(/\*\*([^*]+)\*\*/g,"$1").replace(/\*([^*]+)\*/g,"$1");t.push({text:o+"\n",options:{fontSize:10,color:"374151",indentLevel:1}});continue}let a=e.replace(/\*\*([^*]+)\*\*/g,"$1").replace(/\*([^*]+)\*/g,"$1");t.push({text:a+"\n",options:{fontSize:10,color:"374151"}})}return t},a=[],n=[],r=0;for(let e of t){let t=Math.max(1,Math.ceil(e.length/130));r+t>28&&n.length>0?(a.push(n),n=[e],r=t):(n.push(e),r+=t)}n.length>0&&a.push(n),0===a.length&&a.push(t),a.forEach((t,o)=>{let n=e.addSlide(),r=a.length>1?" (".concat(o+1,"/").concat(a.length,")"):"";v(n,e,"AI Insights".concat(r));let i=l(t);n.addText(i,{x:.7,y:.85,w:11.93,h:6.3,valign:"top",lineSpacingMultiple:1.15})})}}(h,e.sentimentMetrics,e.sentimentSummary);let k=(e,t,o,l,a,n,r)=>
1{e&&o.length>0&&S(h,l,a,o,n,"total",r),t&&o.length>0&&S(h,l,a,o,n,"average",r)},T=e.sectionOptions;k(T.platformPerformanceTotal,T.platformPerformanceAverage,(null===(t=e.allStats)||void 0===t?void 0:t.platform)||[],"Platform Performance","Breakdown by social platform",e=>(function(e){let t="string"==typeof e?e.trim():m(e,["platform_name","platform","label","name"]);return t?w[t.toLowerCase()]||b(t):"Unknown"})(e.key),e=>{var t,o;let l="string"==typeof e.key?e.key:(null===(t=e.key)||void 0===t?void 0:t.platform)||(null===(o=e.key)||void 0===o?void 0:o.platform_name)||null;return"string"==typeof l?l:null}),k(T.influencerPerformanceTotal,T.influencerPerformanceAverage,(null===(d=e.allStats)||void 0===d?void 0:d.influencer)||[],"Influencer Performance","Individual creator breakdown",e=>(function(e){if(e&&"object"==typeof e){let t=[m(e,["firstname","first_name"]),m(e,["lastname","last_name"])].filter(Boolean).join(" ").trim();if(t)return t;let o=m(e,["display_name","name","username","platform_name"]);if(o)return o}return"string"==typeof e&&e.trim()?e.trim():"Unknown"})(e.key)),k(T.profilePerformanceTotal,T.profilePerformanceAverage,(null===(u=e.allStats)||void 0===u?void 0:u.profile)||[],"Profile Performance","Individual profile performance",e=>(function(e){if(e&&"object"==typeof e){let t=m(e,["username"]);if(t)return t.startsWith("@")?t:"@".concat(t);let o=m(e,["platform_name","display_name","name"]);if(o)return o}return"string"==typeof e&&e.trim()?e.startsWith("@")?e.trim():"@".concat(e.trim()):"Unknown"})(e.key),e=>{var t;return(null===(t=e.key)||void 0===t?void 0:t.platform)||null}),k(T.mediaTypePerformanceTotal,T.mediaTypePerformanceAverage,e.effectiveMediaTypeStats||[],"Media Type Performance","Performance by content type",e=>(function(e){let t=(0,a._m)(e);if("Unknown Media"!==t)return t;let o="string"==typeof e?e.trim():m(e,["label","name","type","type_name"]);return o?b(o):"Unknown Media"})(e.key),e=>{var t;return(null===(t=e.key)||void 0===t?void 0:t.platform)||null}),T.mediaGallery&&e.transformedMediaItems.length>0&&function(e,t){let o=Math.ceil(t.length/8);for(let a=0;a<o;a++){let o=e.addSlide(),n=t.slice(8*a,(a+1)*8),r=.3;0===a&&(r=v(o,e,"Campaign Media Gallery","Key campaign posts with performance snapshots")+.1);let i=(7.5-r-.2-.25)/2;n.forEach((t,a)=>{let n=.5+a%4*3.145,d=r+Math.floor(a/4)*(i+.25),s=function(e,t,o){if(!t)return null;switch(e.toLowerCase()){case"instagram":return"https://www.instagram.com/p/".concat(t,"/");case"tiktok":return o?"https://www.tiktok.com/@".concat(o,"/video/").concat(t):"https://www.tiktok.com/video/".concat(t);case"youtube":return"https://www.youtube.com/watch?v=".concat(t);default:return null}}(t.platform,t.platformId,t.profileDisplayName);o.addShape(e.ShapeType.roundRect,{x:n,y:d,w:2.895,h:i,fill:{color:c.lightGray},line:{color:"e5e7eb",width:1},rectRadius:.1});let f=.6*i;t.imageBase64?o.addImage({data:t.imageBase64,x:n+.05,y:d+.05,w:2.795,h:f,rounding:!1}):(o.addShape(e.ShapeType.roundRect,{x:n+.05,y:d+.05,w:2.795,h:f,fill:{color:"e5e7eb"},rectRadius:.05}),o.addText("Preview unavailable",{x:n+.05,y:d+.05,w:2.795,h:f,fontSize:7,color:c.gray,align:"center",valign:"middle"}));let u=d+f+.08;g(o,t.platform,n+.1,u,.14);let h="".concat(t.platformLabel," | ").concat(t.typeLabel);o.addText(h,{x:n+.28,y:u-.02,w:2.495,h:.18,fontSize:7,color:s?c.brand:c.gray,bold:!0,...s?{hyperlink:{url:s}}:{}});let w=[t.profileHandle,p(t.postedAt,"MMM d, yyyy")].filter(Boolean).join("  •  ");o.addText(w,{x:n+.1,y:u+.17,w:2.695,h:.16,fontSize:6,color:c.gray});let m=t.metrics||[],b=u+.36,y=2.695/m.length;m.forEach((e,t)=>{let a=n+.1+t*y;o.addText(e.label,{x:a,y:b,w:y,h:.13,fontSize:5,color:c.gray}),o.addText((0,l.D)(e.value),{x:a,y:b+.12,w:y,h:.2,fontSize:9,color:c.dark,bold:!0})})})}}(h,e.transformedMediaItems);let z="".concat(e.campaign.title.replace(/[^a-z0-9]/gi,"_").toLowerCase(),"_campaign_report");await h.writeFile({fileName:z})}}}]);

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.