1"use strict";(globalThis.webpackChunkv2||=[]).push([[8691],{5010(e,a,t){t.d(a,{N:()=>o});let o=function(e){return e.AREA="area",e.CANDLESTICK="candlestick",e.COLUMN="column",e.JUMPLINE="jumpline",e.LINE="line",e.MARKER="marker",e.OHLC="ohlc",e.SPLINE="spline",e.SPLINEAREA="splinearea",e.STEPAREA="steparea",e.STICK="stick",e.PIE="pie",e.DONUT="donut",e.TREEMAP="treemap",e.TREEMAPINDEX="treemapindex",e.PYRAMID="pyramid",e.BAR="bar",e.SANKEY="sankey",e.HIGHLOWAREA="highandlowarea",e.HIGHLOWLINE="highandlowline",e}({});t.d(a,["u",0,{rowSeparator:"\n",columnSeparator:",",ignoreHeader:!0,ignoreTrailing:!0}])},948691(e,a,t){var o=t(951609),r=t(114541),i=t(5010),l=t(941089),n=t(810790);const s=(0,o.lazy)(()=>t.e(4767).then(t.bind(t,67148))),c=(e,a,t)=>({width:"fit",items:a.map((e,a)=>({...e,isChecked:0===a})),name:e,onChange:e=>t(e.item.value)}),d=async(e,a,t,o)=>{const r={Page:1,Interval:a,Order:"Asc"};try{const a=await l.K.getDaily(e,r);return a?.result?.length?h(a.result,t,o):void 0}catch(e){return console.error("Erro ao buscar dados diários:",e),null}},u=async(e,a,t,o)=>{let r={Order:"Asc",Periodicity:"OneDay"===t?1:15,Interval:t,Page:1};try{const i=await l.K.getIntraday(e,r);return!i||i.intradayQuoteItems.length<=0?void console.warn("No data available for the selected date range."):m(i.intradayQuoteItems,a,t,o)}catch(e){return console.error("Error fetching intraday data:",e),null}},m=(e,a,t,o)=>({chartConfig:{type:a,title:"Gráfico de Preços",data:p(e,a,t),seriesMapping:[{name:"Preço"}],xAxisLabelFormat:a===i.N.CANDLESTICK||"FiveDays"===t?"{%Value}{dateTimeFormat:dd/MM/YY}":"{%value}{dateTimeFormat:HH:mm}",yAxisLabelFormat:"index"===o?"{%value}{thousandsSeparator:., decimalPoint:\\,, zeroFillDecimals: true, decimalsCount: 0}":"R$ {%value}{decimalPoint:\\,, zeroFillDecimals: true, decimalsCount: 2}",tooltipTitleFormat:"FiveDays"===t?"{%x}{dateTimeFormat:dd/MM/YY - HH:mm}":"{%x}{dateTimeFormat:HH:mm}",tooltipContentFormat:y(a,o)},animation:!1}),h=(e,a,t)=>({chartConfig:{type:a,title:"Gráfico de Preços",data:g(e,a),seriesMapping:[{name:"Preço"}],xAxisLabelFormat:"{%Value}{dateTimeFormat:dd/MM/YY}",yAxisLabelFormat:"index"===t?"{%value}{thousandsSeparator:., decimalPoint:\\,, zeroFillDecimals: true, decimalsCount: 0}":"R$ {%value}{decimalPoint:\\,, zeroFillDecimals: true, decimalsCount: 2}",tooltipTitleFormat:"{%x}{dateTimeFormat:dd/MM/YY}",tooltipContentFormat:y(a,t)},animation:!1}),g=(e,a)=>a===i.N.CANDLESTICK?e.map(e=>[e.tradeDate,e.open,e.high,e.low,e.close]):e.map(e=>[e.tradeDate,e.close]),p=(e,a,t)=>a===i.N.CANDLESTICK?e.map(e=>[e.tradeDate,e.open,e.high,e.low,e.close]):e.map(e=>[e.tradeDate,e.price]),y=(e,a)=>e===i.N.CANDLESTICK?"index"===a?"Abertura: {%open}{thousandsSeparator:., decimalPoint:\\,, zeroFillDecimals: true, decimalsCount: 0}\n Fechamento: {%close}{thousandsSeparator:., decimalPoint:\\,, zeroFillDecimals: true, decimalsCount: 0}\n Máximo: {%high}{thousandsSeparator:., decimalPoint:\\,, zeroFillDecimals: true, decimalsCount: 0}\n MÃnimo: {%low}{thousandsSeparator:., decimalPoint:\\,, zeroFillDecimals: true, decimalsCount: 0}":"Abertura: R$ {%open}{decimalPoint:\\,, zeroFillDecimals: true, decimalsCount: 2}\n Fechamento: R$ {%close}{decimalPoint:\\,, zeroFillDecimals: true, decimalsCount: 2}\n Máximo: R$ {%high}{decimalPoint:\\,, zeroFillDecimals: true, decimalsCount: 2}\n MÃnimo: R$ {%low}{decimalPoint:\\,, zeroFillDecimals: true, decimalsCount: 2}":"index"===a?"Pontos: {%value}{thousandsSeparator:., decimalPoint:\\,, zeroFillDecimals: true, decimalsCount: 0}":"{%seriesName}: R$ {%value}{decimalPoint:\\,, zeroFillDecimals: true, decimalsCount: 2}";t.d(a,["default",0,({symbol:e,title:a,assetType:t})=>{const[l,m]=(0,o.useState)("OneDay"),[h,g]=(0,o.useState)(i.N.HIGHLOWAREA),[p,b]=(0,o.useState)((e=>({chartConfig:{type:i.N.HIGHLOWAREA,title:"Gráfico de Preços",data:[],seriesMapping:[{name:"Preço"}],xAxisLabelFormat:"{%Value}{dateTimeFormat:HH:mm}",yAxisLabelFormat:"index"===e?"{%value}{thousandsSeparator:., decimalPoint:\\,, zeroFillDecimals: true, decimalsCount: 0}":"R$ {%value}{decimalPoint:\\,, zeroFillDecimals: true, decimalsCount: 2}",tooltipTitleFormat:"{%x}{dateTimeFormat:HH:mm}",tooltipContentFormat:y(i.N.HIGHLOWAREA,e)},animation:!1}))(t)),S=c("chart-intraday-range",[{value:"OneDay",label:"1d"},{value:"FiveDays",label:"5d"},{value:"OneMonth",label:"1m"},{value:"SixMonths",label:"6m"},{value:"OneYear",label:"1a"},{value:"FiveYears",label:"5a"}],m),f=c("chart-intraday-type",[{value:"highandlowarea",iconName:"DataTrending"},{value:"candlestick",iconName:"DataWhisker"}],e=>g(e));return(0,o.useEffect)(()=>{(async(e,a,t,o,r)=>{try{const i="OneDay"===a||"FiveDays"===a?await u(e,t,a,r):await d(e,a,t,r);i&&(i.chartConfig.type=t,o(i))}catch(e){console.error("Erro ao buscar dados do gráfico:",e)}})(e,l,h,b,t)},[e,l,h,t]),(0,n.jsxs)("div",{className:"content-width mx-auto flex flex-col gap-6",children:[(0,n.jsxs)("div",{className:"flex flex-col lg:flex-row gap-4 justify-start lg:justify-between lg:items-center",children:[a&&(0,n.jsx)("h2",{className:"im-mob-core-heading-3 lg:im-web-core-heading-3 text-content-pure",children:a}),(0,n.jsxs)("div",{className:"flex gap-6",children:[(0,n.jsx)(r.TagFilter,{...S}),(0,n.jsx)("div",{className:"hidden lg:block",children:(0,n.jsx)(r.TagFilter,{...f})})]})]}),(0,n.jsx)("div",{className:"flex w-full h-80",children:(0,n.jsx)(o.Suspense,{fallback:(0,n.jsx)("div",{children:"Carregando..."}),children:p.chartConfig.data.length?(0,n.jsx)(s,{...p},l):(0,n.jsx)("div",{className:"bg-surface-card-two w-full flex justify-center items-center rounded-lg im-web-core-description",children:"Não há dados de cotação neste perÃodo"})})})]})}])},75116(e,a,t){t.d(a,["A",0,class{static getConfig(){return{url:window.InfoMoneyPage?.api_marketdata.base_api_marketdata||"",subscriptionKey:window.InfoMoneyPage?.api_marketdata.ocp_apim_subscription_key||"",tickerBlobUrl:window.InfoMoneyPage?.api_marketdata.ticker_blob_url||"",highLowBlobUrl:window.InfoMoneyPage?.api_marketdata.high_low_blob_url||"",criptoBlobUrl:window.InfoMoneyPage?.api_marketdata.cripto_blob_url||"",currencyBlobUrl:window.InfoMoneyPage?.api_marketdata.currency_blob_url||"",ibovBlobUrl:window.InfoMoneyPage?.api_marketdata.ibov_blob_url||"",hostName:window.InfoMoneyPage?.host_name||""}}static getCacheConfig(){const e={enabled:!1,duration:3e5},a=window.InfoMoneyPage?.api_marketdata?.cache;return a?{enabled:void 0!==a.enabled?a.enabled:e.enabled,duration:void 0!==a.duration?a.duration:e.duration}:e}static getParams(e){return new URLSearchParams(Object.entries(e).filter(([e,a])=>void 0!==a).reduce((e,[a,t])=>(Array.isArray(t)?e[a]=t.join(","):e[a]=String(t),e),{})).toString()}}])},307531(e,a,t){t.d(a,{_:()=>
1o});class o{static CACHE_PREFIX="infomoney_market_data_";static _localStorageAvailable=null;static generateCacheKey(e,a){const t=a?JSON.stringify(a):"";return`${this.CACHE_PREFIX}${e}_${btoa(t)}`}static isLocalStorageAvailable(){if(null!==this._localStorageAvailable)return this._localStorageAvailable;try{const e="__localStorage_test__";return localStorage.setItem(e,e),localStorage.removeItem(e),this._localStorageAvailable=!0,!0}catch{return this._localStorageAvailable=!1,!1}}static recheckLocalStorageAvailability(){return this._localStorageAvailable=null,this.isLocalStorageAvailable()}static get(e,a){if(!this.isLocalStorageAvailable())return null;try{const t=this.generateCacheKey(e,a),o=localStorage.getItem(t);if(!o)return null;const r=JSON.parse(o);return Date.now()>r.expiresAt?(this.remove(e,a),null):r.data}catch(e){return console.warn("CacheService.get: Error reading from cache:",e),!0===this._localStorageAvailable&&this.recheckLocalStorageAvailability(),null}}static set(e,a,t,o){if(this.isLocalStorageAvailable())try{const r=this.generateCacheKey(e,o),i=Date.now(),l={data:a,timestamp:i,expiresAt:i+t};localStorage.setItem(r,JSON.stringify(l))}catch(e){console.warn("CacheService.set: Error writing to cache:",e),!0===this._localStorageAvailable&&this.recheckLocalStorageAvailability(),this.clearExpired()}}static remove(e,a){if(this.isLocalStorageAvailable())try{const t=this.generateCacheKey(e,a);localStorage.removeItem(t)}catch(e){console.warn("CacheService.remove: Error removing from cache:",e),!0===this._localStorageAvailable&&this.recheckLocalStorageAvailability()}}static clearExpired(){if(this.isLocalStorageAvailable())try{const e=Date.now(),a=[];for(let t=0;t<localStorage.length;t++){const o=localStorage.key(t);if(o&&o.startsWith(this.CACHE_PREFIX))try{const t=localStorage.getItem(o);t&&e>JSON.parse(t).expiresAt&&a.push(o)}catch{a.push(o)}}a.forEach(e=>localStorage.removeItem(e))}catch(e){console.warn("CacheService.clearExpired: Error clearing expired cache:",e),!0===this._localStorageAvailable&&this.recheckLocalStorageAvailability()}}static clearAll(){if(this.isLocalStorageAvailable())try{const e=[];for(let a=0;a<localStorage.length;a++){const t=localStorage.key(a);t&&t.startsWith(this.CACHE_PREFIX)&&e.push(t)}for(let a=0;a<e.length;a++)localStorage.removeItem(e[a])}catch(e){console.warn("CacheService.clearAll: Error clearing cache:",e),!0===this._localStorageAvailable&&this.recheckLocalStorageAvailability()}}static getStats(){if(!this.isLocalStorageAvailable())return{totalItems:0,expiredItems:0,totalSize:0};let e=0,a=0,t=0;const o=Date.now();try{for(let r=0;r<localStorage.length;r++){const i=localStorage.key(r);if(i&&i.startsWith(this.CACHE_PREFIX)){e++;const r=localStorage.getItem(i);if(r){t+=r.length;try{o>JSON.parse(r).expiresAt&&a++}catch{a++}}}}}catch(e){console.warn("CacheService.getStats: Error getting cache stats:",e),!0===this._localStorageAvailable&&this.recheckLocalStorageAvailability()}return{totalItems:e,expiredItems:a,totalSize:t}}static forceRecheckLocalStorage(){return this.recheckLocalStorageAvailability()}static getLocalStorageStatus(){return{available:this._localStorageAvailable,checked:null!==this._localStorageAvailable}}}},941089(e,a,t){t.d(a,{K:()=>i});var o=t(75116),r=t(307531);
1class i{static config=o.A.getConfig();static async getDaily(e,a,t){const l=`b3/quotes/daily/${e}`,n={symbol:e,...a};if(t?.enabled){const e=r._.get(l,n);if(e)return e}try{const e=o.A.getParams(a),s=`${i.config.url}${l}?${e}`,c=await fetch(s,{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json","Ocp-Apim-Subscription-Key":i.config.subscriptionKey}});if(!c.ok)throw new Error("Response was not ok. Status: "+c.status);const d=200!==c.status?null:await c.json();return t?.enabled&&d&&r._.set(l,d,t.duration,n),d}catch(e){return console.error("QuoteService.getDaily: Error in fetching data:",e),null}}static async getIntraday(e,a,t){const l=`b3/quotes/intraday/${e}`,n={symbol:e,...a};if(t?.enabled){const e=r._.get(l,n);if(e)return e}try{const e=o.A.getParams(a),s=`${i.config.url}${l}?${e}`,c=await fetch(s,{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json","Ocp-Apim-Subscription-Key":i.config.subscriptionKey}});if(!c.ok)throw new Error("Response was not ok. Status: "+c.status);const d=200!==c.status?null:await c.json();return t?.enabled&&d&&r._.set(l,d,t.duration,n),d}catch(e){return console.error("QuoteService.getIntraday: Error in fetching data:",e),null}}static async getIntradayLeaderboard(e,a){const t="b3/quotes/intraday/leaderboard",l={...e};if(a?.enabled){const e=r._.get(t,l);if(e)return e}try{const n=o.A.getParams(e),s=`${i.config.url}${t}?${n}`,c=await fetch(s,{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json","Ocp-Apim-Subscription-Key":i.config.subscriptionKey}});if(!c.ok)throw new Error("Response was not ok. Status: "+c.status);const d=200!==c.status?null:await c.json();return a?.enabled&&d&&r._.set(t,d,a.duration,l),d}catch(e){return console.error("QuoteService.getIntradayLeaderboard: Error in fetching data:",e),null}}static async getIntradayLastQuote(e,a){const t="b3/quotes/intraday/last",o={symbols:[...e.symbols].sort()};if(a?.enabled){const e=r._.get(t,o);if(e)return e}try{const l=`${i.config.url}${t}?symbols=${e.symbols.join(",")}`,n=await fetch(l,{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json","Ocp-Apim-Subscription-Key":i.config.subscriptionKey}});if(!n.ok)throw new Error("Response was not ok. Status: "+n.status);const s=200!==n.status?null:await n.json();return a?.enabled&&s&&r._.set(t,s,a.duration,o),s}catch(e){return console.error("QuoteService.getIntradayLastQuote: Error in fetching data:",e),null}}static async getIntradayChart(e,a){const t=`b3/quotes/intraday/chart/${e}`,o={symbol:e};if(a?.enabled){const e=r._.get(t,o);if(e)return e}try{const e=`${i.config.url}${t}`,l=await fetch(e,{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json","Ocp-Apim-Subscription-Key":i.config.subscriptionKey}});if(!l.ok)throw new Error("Response was not ok. Status: "+l.status);const n=200!==l.status?null:await l.json();return a?.enabled&&n&&r._.set(t,n,a.duration,o),n}catch(e){return console.error("QuoteService.getIntradayChart: Error in fetching data:",e),null}}static clearCache(){r._.clearAll()}static clearExpiredCache(){r._.clearExpired()}static getCacheStats(){return r._.getStats()}}}}]);
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.