1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1331],{27031:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/content/sentiment/[channel]",function(){return n(83825)}])},597:function(e,t,n){var i=n(83454);n(91479);var r=n(67294),s=r&&"object"==typeof r&&"default"in r?r:{default:r};function _defineProperties(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var a=void 0!==i&&i.env&&!0,isString=function(e){return"[object String]"===Object.prototype.toString.call(e)},o=function(){function StyleSheet(e){var t=void 0===e?{}:e,n=t.name,i=void 0===n?"stylesheet":n,r=t.optimizeForSpeed,s=void 0===r?a:r;invariant$1(isString(i),"`name` must be a string"),this._name=i,this._deletedRulePlaceholder="#"+i+"-deleted-rule____{}",invariant$1("boolean"==typeof s,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=s,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0;var o=document.querySelector('meta[property="csp-nonce"]');this._nonce=o?o.getAttribute("content"):null}var e,t=StyleSheet.prototype;return t.setOptimizeForSpeed=function(e){invariant$1("boolean"==typeof e,"`setOptimizeForSpeed` accepts a boolean"),invariant$1(0===this._rulesCount,"optimizeForSpeed cannot be when rules have already been inserted"),this.flush(),this._optimizeForSpeed=e,this.inject()},t.isOptimizeForSpeed=function(){return this._optimizeForSpeed},t.inject=function(){var e=this;if(invariant$1(!this._injected,"sheet already injected"),this._injected=!0,this._optimizeForSpeed){this._tags[0]=this.makeStyleTag(this._name),this._optimizeForSpeed="insertRule"in this.getSheet(),this._optimizeForSpeed||(a||console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode."),this.flush(),this._injected=!0);return}this._serverSheet={cssRules:[],insertRule:function(t,n){return"number"==typeof n?e._serverSheet.cssRules[n]={cssText:t}:e._serverSheet.cssRules.push({cssText:t}),n},deleteRule:function(t){e._serverSheet.cssRules[t]=null}}},t.getSheetForTag=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]},t.getSheet=function(){return this.getSheetForTag(this._tags[this._tags.length-1])},t.insertRule=function(e,t){if(invariant$1(isString(e),"`insertRule` accepts only strings"),this._optimizeForSpeed){var n=this.getSheet();"number"!=typeof t&&(t=n.cssRules.length);try{n.insertRule(e,t)}catch(t){return a||console.warn("StyleSheet: illegal rule: \n\n"+e+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),-1}}else{var i=this._tags[t];this._tags.push(this.makeStyleTag(this._name,e,i))}return this._rulesCount++},t.replaceRule=function(e,t){if(this._optimizeForSpeed){var n=this.getSheet();if(t.trim()||(t=this._deletedRulePlaceholder),!n.cssRules[e])return e;n.deleteRule(e);try{n.insertRule(t,e)}catch(i){a||console.warn("StyleSheet: illegal rule: \n\n"+t+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),n.insertRule(this._deletedRulePlaceholder,e)}}else{var i=this._tags[e];invariant$1(i,"old rule at index `"+e+"` not found"),i.textContent=t}return e},t.deleteRule=function(e){if(this._optimizeForSpeed)this.replaceRule(e,"");else{var t=this._tags[e];invariant$1(t,"rule at index `"+e+"` not found"),t.parentNode.removeChild(t),this._tags[e]=null}},t.flush=function(){this._injected=!1,this._rulesCount=0,this._tags.forEac
1h(function(e){return e&&e.parentNode.removeChild(e)}),this._tags=[]},t.cssRules=function(){var e=this;return this._tags.reduce(function(t,n){return n?t=t.concat(Array.prototype.map.call(e.getSheetForTag(n).cssRules,function(t){return t.cssText===e._deletedRulePlaceholder?null:t})):t.push(null),t},[])},t.makeStyleTag=function(e,t,n){t&&invariant$1(isString(t),"makeStyleTag accepts only strings as second parameter");var i=document.createElement("style");this._nonce&&i.setAttribute("nonce",this._nonce),i.type="text/css",i.setAttribute("data-"+e,""),t&&i.appendChild(document.createTextNode(t));var r=document.head||document.getElementsByTagName("head")[0];return n?r.insertBefore(i,n):r.appendChild(i),i},_defineProperties(StyleSheet.prototype,[{key:"length",get:function(){return this._rulesCount}}]),e&&_defineProperties(StyleSheet,e),StyleSheet}();function invariant$1(e,t){if(!e)throw Error("StyleSheet: "+t+".")}var stringHash=function(e){for(var t=5381,n=e.length;n;)t=33*t^e.charCodeAt(--n);return t>>>0},l={};function computeId(e,t){if(!t)return"jsx-"+e;var n=String(t),i=e+n;return l[i]||(l[i]="jsx-"+stringHash(e+"-"+n)),l[i]}function computeSelector(e,t){var n=e+t;return l[n]||(l[n]=t.replace(/__jsx-style-dynamic-selector/g,e)),l[n]}var c=function(){function StyleSheetRegistry(e){var t=void 0===e?{}:e,n=t.styleSheet,i=void 0===n?null:n,r=t.optimizeForSpeed,s=void 0!==r&&r;this._sheet=i||new o({name:"styled-jsx",optimizeForSpeed:s}),this._sheet.inject(),i&&"boolean"==typeof s&&(this._sheet.setOptimizeForSpeed(s),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer=void 0,this._indices={},this._instancesCounts={}}var e=StyleSheetRegistry.prototype;return e.add=function(e){var t=this;void 0===this._optimizeForSpeed&&(this._optimizeForSpeed=Array.isArray(e.children),this._sheet.setOptimizeForSpeed(this._optimizeForSpeed),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer||(this._fromServer=this.selectFromServer(),this._instancesCounts=Object.keys(this._fromServer).reduce(function(e,t){return e[t]=0,e},{}));var n=this.getIdAndRules(e),i=n.styleId,r=n.rules;if(i in this._instancesCounts){this._instancesCounts[i]+=1;return}var s=r.map(function(e){return t._sheet.insertRule(e)}).filter(function(e){return -1!==e});this._indices[i]=s,this._instancesCounts[i]=1},e.remove=function(e){var t=this,n=this.getIdAndRules(e).styleId;if(function(e,t){if(!e)throw Error("StyleSheetRegistry: "+t+".")}(n in this._instancesCounts,"styleId: `"+n+"` not found"),this._instancesCounts[n]-=1,this._instancesCounts[n]<1){var i=this._fromServer&&this._fromServer[n];i?(i.parentNode.removeChild(i),delete this._fromServer[n]):(this._indices[n].forEach(function(e){return t._sheet.deleteRule(e)}),delete this._indices[n]),delete this._instancesCounts[n]}},e.update=function(e,t){this.add(t),this.remove(e)},e.flush=function(){this._sheet.flush(),this._sheet.inject(),this._fromServer=void 0,this._indices={},this._instancesCounts={}},e.cssRules=function(){var e=this,t=this._fromServer?Object.keys(this._fromServer).map(function(t){return[t,e._fromServer[t]]}):[],n=this._sheet.cssRules();return t.concat(Object.keys(this._indices).map(function(t){return[t,e._indices[t].map(function(e){return n[e].cssText}).join(e._optimizeForSpeed?"":"\n")]}).filter(function(e){return!!e[1]}))},e.styles=function(e){var t,n;return t=this.cssRules(),void 0===(n=e)&&(n={}),t.map(function(e){var t=e[0],i=e[1];return s.default.createElement("style",{id:"__"+t,key:"__"+t,nonce:n.nonce?n.nonce:void 0,dangerouslySetInnerHTML:{__html:i}})})},e.getIdAndRules=function(e){var t=e.children,n=e.dynamic,i=e.id;if(n){var r=computeId(i,n);return{styleId:r,rules:Array.isArray(t)?t.map(function(e){return computeSelector(r,e)}):[computeSelector(r,t)]}}return{styleId:computeId(i),rules:Array.isArray(t)?t:[t]}},e.selectFromServer=function(){return Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]')).reduce(function(e,t){return e[t.id.slice(2)]=t,e},{})},StyleSheetRegistry}(),d=r.createContext(null);d.displayName="StyleSheetContext";var u=s.default.useInsertionEffect||s.default.useLayoutEffect,f=new c;function JSXStyle(e){var t=f||r.useContext(d);return t&&u(function(){return t.add(e),function(){t.remove(e)}},[e.id,String(e.dynamic)]),null}JSXStyle.dynamic=function(e){return e.map(function(e){return computeId(e[0],e[1])}).join(" ")},t.style=JSXStyle},5379:function(e,t,n){"use strict";e.exports=n(597).style},53953:function(e,t,n){"use strict";n.d(t,{X:function(){return PdfViewer}});var i=n(85893);n(67294);var r=n(54141),s=n(10492);n(39050),n(85986);let PdfViewer=e=>{let{fileUrl:t,fileName:n="document.pdf"}=e,a=(0,s.defaultLayoutPlugin)({sidebarTabs:()=>[],toolbarPlugin:{getFilePlugin:{fileNameGenerator:()=>n}}});return(0,i.jsx)("div",{style:{height:"100%",width:"100%"},children:(0,i.jsx)(r.Worker,{workerUrl:"/pdf.worker.min.js",children:(0,i.jsx)(r.Vie
1wer,{fileUrl:t,plugins:[a],defaultScale:r.SpecialZoomLevel.PageWidth})})})}},83825:function(e,t,n){"use strict";n.r(t);var i=n(85893),r=n(5379),s=n.n(r),a=n(67294),o=n(11163),l=n(53953),c=n(93555),d=n(90181);let buildFilename=(e,t)=>"".concat(e,"-CEO_Analytics-").concat(t,"_Month.pdf");t.default=()=>{let e=(0,o.useRouter)(),{channel:t}=e.query,{user:n,loading:r}=(0,d.a)(),u=Array.isArray(t)?t[0]:t,f=(null==n?void 0:n.prouser)===!0,h=(0,a.useRef)(!1),[p,m]=(0,a.useState)(4),[x,b]=(0,a.useState)(!0),[g,y]=(0,a.useState)(!1),[v,S]=(0,a.useState)(null),[_,j]=(0,a.useState)(null),[w,k]=(0,a.useState)(null),[z,R]=(0,a.useState)(null),[C,N]=(0,a.useState)(""),[F,E]=(0,a.useState)(null),[A,P]=(0,a.useState)(!1);(0,a.useEffect)(()=>{if(!u)return;let fetchInfo=async()=>{try{let e=await c.Z.getStockSymbol(u);if(null==e?void 0:e.ok){let t=(e.symbol||u).toUpperCase(),n=t.split(".")[0];k(n),R(t),N(e.company||"")}else{let e=u.toUpperCase(),t=e.split(".")[0];k(t),R(e)}}catch(n){console.error("Error fetching company info",n);let e=u.toUpperCase(),t=e.split(".")[0];k(t),R(e)}};fetchInfo()},[u]),(0,a.useEffect)(()=>{if(!u||!f)return;let fetchAccess=async()=>{try{S(null),h.current=!1;let e=await fetch("/api/sentiment/access/".concat(encodeURIComponent(u))),t=await e.json();if(!e.ok||!t.ok)throw Error(t.message||"Unable to check sentiment report access");E(t)}catch(e){console.error("Error fetching sentiment access",e),S("Unable to check sentiment report access"),b(!1)}};fetchAccess()},[u,f]);let T=(0,a.useMemo)(()=>w?{four:buildFilename(w,4),twelve:buildFilename(w,12)}:{four:"",twelve:""},[w]),fetchPdf=async e=>{if(!w||!u)return!1;let t=4===p?T.four:T.twelve;try{b(!0),y(!1),S(null);let n=new URLSearchParams({channel:u});e&&n.set("confirm","1");let i=await fetch("/api/sentiment/".concat(t,"?").concat(n.toString()));if(!i.ok){let e=await i.json().catch(()=>null);throw Error((null==e?void 0:e.message)||"Network response was not ok")}let r=await i.blob(),s=URL.createObjectURL(r);return j(e=>(e&&URL.revokeObjectURL(e),s)),!0}catch(e){return console.error("Error fetching the PDF",e),y(!0),!1}finally{b(!1)}};(0,a.useEffect)(()=>{if(f&&w&&F){if(F.already_viewed){if(h.current){h.current=!1;return}fetchPdf(!1);return}if(null!==F.remaining&&F.remaining<=0){S("You have used all ".concat(F.limit," Sentiment report views for this month.")),b(!1);return}P(!0),b(!1)}},[p,w,F,f]),(0,a.useEffect)(()=>()=>{_&&URL.revokeObjectURL(_)},[_]);let handleTabChange=e=>{m(0===e?4:12)},O=4===p?0:1,I=(null==F?void 0:F.next_reset_at)?new Intl.DateTimeFormat(void 0,{month:"long",day:"numeric",year:"numeric"}).format(new Date(F.next_reset_at)):"",handleConfirmView=async()=>{h.current=!0,P(!1);let e=await fetchPdf(!0);e&&F&&E({...F,already_viewed:!0,will_consume:!1,views_used:F.views_used+1,remaining:null===F.remaining?null:Math.max(F.remaining-1,0)})};return r?(0,i.jsxs)("div",{className:"jsx-f43c3a0b78a1ea0b sentiment-page",children:[(0,i.jsx)("div",{className:"jsx-f43c3a0b78a1ea0b title",children:(0,i.jsx)("h2",{className:"jsx-f43c3a0b78a1ea0b headline",children:"Loading..."})}),(0,i.jsx)(s(),{id:"f43c3a0b78a1ea0b",children:".title.jsx-f43c3a0b78a1ea0b{padding:16px}.headline.jsx-f43c3a0b78a1ea0b{margin:0;font-size:20px;font-weight:600;line-height:25px}"})]}):(0,i.jsxs)("div",{className:"jsx-45428f966a49a33d sentiment-page",children:[(0,i.jsxs)("div",{className:"jsx-45428f966a49a33d title",children:[(0,i.jsxs)("h2",{className:"jsx-45428f966a49a33d headline",children:[z&&(0,i.jsx)("span",{onClick:()=>e.push("/".concat(u)),className:"jsx-45428f966a49a33d symbol",children:z}),C]}),(0,i.jsx)("p",{className:"jsx-45428f966a49a33d subtitle",children:"Sentiment analysis"}),!f&&(0,i.jsxs)("div",{className:"jsx-45428f966a49a33d permission-error",children:[(0,i.jsx)("p",{className:"jsx-45428f966a49a33d",children:"Sentiment report access is restricted to Pro users only."}),(0,i.jsx)("p",{style:{marginTop:10},className:"jsx-45428f966a49a33d",children:(0,i.jsx)("a",{href:"/about/market-depth",target:"_blank",rel:"noopener noreferrer",className:"jsx-45428f966a49a33d",children:"Subscribe to CEO.CA Pro"})})]})]}),f&&(0,i.jsx)("div",{className:"jsx-45428f966a49a33d tabs",children:["4 Month","12 Month"].map((e,t)=>(0,i.jsx)("button",{onClick:()=>handleTabChange(t),className:"jsx-45428f966a49a33d "+"tab ".concat(O===t?"active":""),children:e},e))}),(0,i.jsx)("div",{className:"jsx-45428f966a49a33d viewer",children:f&&(0,i.jsxs)(i.Fragment,{children:[x&&(0,i.jsx)("span",{className:"jsx-45428f966a49a33d",children:"Loadingâ¦"}),v&&(0,i.jsx)("span",{className:"jsx-45428f966a49a33d",children:v}),g&&(0,i.jsx)("span",{className:"jsx-45428f966a49a33d",children:"Document not available"}
1),_&&(0,i.jsx)(l.X,{fileUrl:_,fileName:T[4===p?"four":"twelve"]})]})}),A&&F&&(0,i.jsx)("div",{role:"presentation",className:"jsx-45428f966a49a33d confirm-backdrop",children:(0,i.jsxs)("div",{role:"dialog","aria-modal":"true","aria-labelledby":"sentiment-confirm-title",className:"jsx-45428f966a49a33d confirm-dialog",children:[(0,i.jsx)("h3",{id:"sentiment-confirm-title",className:"jsx-45428f966a49a33d",children:"View Sentiment report?"}),(0,i.jsxs)("p",{className:"jsx-45428f966a49a33d",children:["This will use 1 of your ",F.limit," monthly Sentiment report views. You have ",F.remaining," ",1===F.remaining?"view":"views"," remaining this month."]}),(0,i.jsxs)("p",{className:"jsx-45428f966a49a33d confirm-note",children:["After opening this company's report, you can keep viewing it until your monthly access resets on ",I,"."]}),(0,i.jsxs)("div",{className:"jsx-45428f966a49a33d confirm-actions",children:[(0,i.jsx)("button",{onClick:()=>e.push("/".concat(u)),className:"jsx-45428f966a49a33d cancel-button",children:"Cancel"}),(0,i.jsx)("button",{onClick:handleConfirmView,className:"jsx-45428f966a49a33d confirm-button",children:"View report"})]})]})}),(0,i.jsx)(s(),{id:"45428f966a49a33d",children:".title.jsx-45428f966a49a33d{padding:16px}.headline.jsx-45428f966a49a33d{margin:0;font-size:20px;font-weight:600;line-height:25px}.symbol.jsx-45428f966a49a33d{font-size:14px;font-weight:bold;color:#666;margin-right:4px;text-transform:uppercase;padding:0 4px;line-height:25px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;background-color:rgba(33,47,82,.13);color:rgb(43,78,139);cursor:pointer;-webkit-transition:background-color.2s ease;-moz-transition:background-color.2s ease;-o-transition:background-color.2s ease;transition:background-color.2s ease}.symbol.jsx-45428f966a49a33d:hover{background-color:rgba(33,47,82,.2)}.subtitle.jsx-45428f966a49a33d{margin:4px 0 0 0;font-size:14px;color:#888}.permission-error.jsx-45428f966a49a33d{margin-top:8px;padding:20px;background-color:#dfdfdf;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:0 0px 20px rgb(0 0 0/20%);-moz-box-shadow:0 0px 20px rgb(0 0 0/20%);box-shadow:0 0px 20px rgb(0 0 0/20%);font-size:18px}.permission-error.jsx-45428f966a49a33d a.jsx-45428f966a49a33d{color:#c00;text-decoration:underline}.tabs.jsx-45428f966a49a33d{padding:0 16px;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;gap:16px;border-bottom:1px solid#eee}.tab.jsx-45428f966a49a33d{background:none;border:none;padding:8px 0;font-size:14px;cursor:pointer;color:#555}.tab.active.jsx-45428f966a49a33d{border-bottom:2px solid#c00;color:#c00;font-weight:600}.viewer.jsx-45428f966a49a33d{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-moz-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center;height:-webkit-calc(100vh - 200px);height:-moz-calc(100vh - 200px);height:calc(100vh - 200px);padding:16px}.confirm-backdrop.jsx-45428f966a49a33d{position:fixed;inset:0;z-index:1000;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-moz-box-pack:center;-ms-flex-pack:center;justify-content:center;background:rgba(0,0,0,.45);padding:16px}.confirm-dialog.jsx-45428f966a49a33d{width:min(420px,100%);-webkit-border-radius:8px;-moz-border-radius:8px;border-radius:8px;background:#fff;padding:20px;-webkit-box-shadow:0 16px 50px rgba(0,0,0,.24);-moz-box-shadow:0 16px 50px rgba(0,0,0,.24);box-shadow:0 16px 50px rgba(0,0,0,.24)}.confirm-dialog.jsx-45428f966a49a33d h3.jsx-45428f966a49a33d{margin:0 0 12px;font-size:18px}.confirm-dialog.jsx-45428f966a49a33d p.jsx-45428f966a49a33d{margin:0 0 12px;color:#333;line-height:1.4}.confirm-note.jsx-45428f966a49a33d{color:#666;font-size:13px}
1.confirm-actions.jsx-45428f966a49a33d{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-pack:end;-webkit-justify-content:flex-end;-moz-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;gap:10px;margin-top:18px}.cancel-button.jsx-45428f966a49a33d,.confirm-button.jsx-45428f966a49a33d{border:none;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;padding:8px 14px;cursor:pointer;font-size:14px}.cancel-button.jsx-45428f966a49a33d{background:#eee;color:#333}.confirm-button.jsx-45428f966a49a33d{background:#c00;color:#fff;font-weight:600}"})]})}},91479:function(){},93414:function(){},70172:function(){},2001:function(){},33779:function(){},82258:function(){}},function(e){e.O(0,[4577,9846,9774,2888,179],function(){return e(e.s=27031)}),_N_E=e.O()}]);
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.