1import{u as J,a as b,Q as g,b8 as ee,e,j as s,a4 as ae,$ as re,l as te,F as R,ax as ie,ay as se,aw as ce,k as le,P as oe,b9 as j,r as ne}from"./index-5fd2db9c.js";import{r as N}from"./agGrid-8b3b3b55.js";import{P}from"./usePriceBookmarks-0f371e6e.js";import{A as de,u as he,a as me}from"./useDatalab-8e507829.js";import{u as ue}from"./useAnchorTabs-788f89da.js";import{a as pe,C as d,P as _e}from"./PricesCard-829daeae.js";import{P as be,a as ge}from"./PrintIcon-e81adb12.js";import{P as Ne}from"./PricesChartBasic-00fd2940.js";import{A as ve}from"./ArticleStreamList-560671c1.js";const Pe=()=>new de(ee),ke=a=>{const r=parseInt(a),{makeRequest:i}=J(),t=c=>i(()=>c(r)),l=()=>i(()=>Pe().price.getPriceById(r));return{newsArticles:b([g.usePriceArticles,"getNewsArticles",a],()=>t(P.getPriceArticlesForNews),{staleTime:3e5}),analysisArticles:b([g.usePriceArticles,"getAnalysisArticles",a],()=>t(P.getPriceArticlesForAnalysis),{staleTime:3e5}),priceNoticeArticles:b([g.usePriceArticles,"getPriceNoticeArticles",a],()=>t(P.getPriceArticlesForPriceNotice),{staleTime:3e5}),monitorArticles:b([g.usePriceArticles,"getMonitorArticles",a],()=>t(P.getPriceArticlesForMonitor),{staleTime:3e5}),outlookArticles:b([g.usePriceArticles,"getOutlookArticles",a],()=>t(P.getPriceArticlesForOutlook),{staleTime:3e5}),price:b([g.usePrice,a],l,{useErrorBoundary:!0,staleTime:3e5})}},fe=a=>e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"30",height:"30",viewBox:"0 0 20 30",fill:"currentColor",...a,children:e("path",{id:"monitoring_FILL0_wght400_GRAD0_opsz24",d:"M120-826v-1.556l1.556-1.556V-826Zm3.111,0v-4.667l1.556-1.556V-826Zm3.111,0v-6.222l1.556,1.575V-826Zm3.111,0v-4.647l1.556-1.556v6.2Zm3.111,0v-7.778L134-835.333V-826ZM120-830.025v-2.2l5.444-5.444,3.111,3.111L134-840v2.2l-5.444,5.444-3.111-3.111Z",transform:"translate(-118 848)",fill:"#00519e"})}),Ae="https://www.crugroup.com/en/about-us/our-approach/our-methodology/",we="Please click here to view our Price Methodologies and Compliance Framework",ye="View our Price Methodologies and Compliance Framework (opens in new window)",Le=({testIdSuffix:a="",className:r="text-brand-azure-160 hover:text-cru-blue hover:underline"})=>{const i=a?`methodology-link-${a}`:"methodology-link";return s("a",{href:Ae,target:"_blank",rel:"noreferrer","data-testid":i,className:r,"aria-label":ye,children:[we,e("svg",{className:"ml-1 inline-block h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:e("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]})};const Ce=({dataTestId:a,colHeadings:r,rowData:i,isLayoutFixed:t=!1})=>{const l=ae("generic-table",{"generic-table--layout-fixed":t});return s("table",{"data-testid":a,className:l,children:[r&&e("thead",{children:e("tr",{children:r.map((c,n)=>e("th",{children:c},`${n}${c}`))})}),e("tbody",{children:i==null?void 0:i.map((c,n)=>e("tr",{children:c.map(o=>e("td",{children:o},`${n}${o}`))},`${n}${c[0]}`))})]})},xe=({dataTestId:a,prices:r,unit:i})=>{const t=r.some(o=>!!o.percentageChange),l=r==null?void 0:r.map((o,u)=>{const h=[o.value||"-",o.date];return t?[...h,e(pe,{changeValue:o.percentageChange??void 0,style:"table",testId:`${a}-prices-change`},u)]:[...h]}),c=[i,"Date"],n=t?[...c,"% Chg"]:[...c];return e(Ce,{dataTestId:a,colHeadings:n,rowData:l,isLayoutFixed:!0})},v=["Latest","Average"],Te=a=>{var r,i;return{pricesReversed:a.priceValues?[...a.priceValues].reverse():[],currentPriceValue:((r=a.currentPriceValue)==null?void 0:r.value)||"",footnoteDate:((i=a.currentPriceValue)==null?void 0:i.date)||"",footnoteFreq:a.frequency||"",footnoteAssessed:a.assessedLabel||"",priceValues:a.priceValues||[],priceName:a.priceName||"",priceUnit:a.unit||"",priceChangeValue:a.changeValue||void 0,priceChangeLabel:a.changeLabel||""}},$e=a=>a==="print"?"price-dashboard-charts-for-print hidden":"price-dashboard no-print",G=({price:a,idx:r,dispMode:i})=>{const{currentPriceValue:t,footnoteDate:l,footnoteFreq:c,footnoteAssessed:n,priceValues:o,priceName:u,priceUnit:h,priceChangeValue:A,priceChangeLabel:w,pricesReversed:y}=Te(a);return e("article",{className:$e(i),children:s("div",{className:"price-dashboard__row",children:[e("div",{className:"price-dashboard__col",children:s("section",{className:"price-dashboard-item",children:[e("header",{className:"price-dashboard-item__header sr-only",children:"Chart"}),e(d,{children:e("div",{className:"print-chart w-[18rem] sm:w-[30rem] md:w-[38rem] lg:w-[54rem] xl:w-[42rem]","data-testid":`${v[r]}-prices-chart-${i}`.toLowerCase(),children:e(Ne,{series:o,title:u,subtitle:`${v[r]} Prices`,unit:h,height:380,exportingEnabled:!0,dispMode:i}
1)})})]})}),s("div",{className:"price-dashboard__col",children:[s("section",{className:"price-dashboard-item",children:[e("header",{className:"price-dashboard-item__header sr-only",children:"Price card"}),e(_e,{priceName:`${v[r]} Price`,priceValue:t,priceUnit:h,changeValue:A,changeLabel:w,footnoteDate:l,footnoteFrequency:c,footnoteAssessed:n,testId:`${v[r]}-prices-card-${i}`.toLowerCase()})]}),s("section",{className:"price-dashboard-item",children:[e("header",{className:"price-dashboard-item__header sr-only",children:"Price table"}),e(d,{children:e(xe,{dataTestId:`${v[r]}-prices-table-${i}`.toLowerCase(),prices:y,unit:h})})]})]})]})},`cards_article_${i}_${v[r]}`)},Ve=Object.freeze(Object.defineProperty({__proto__:null,default:G},Symbol.toStringTag,{value:"Module"})),k=({content:a=[],context:r="stream",keyName:i,rudderstackContext:t,testIdSuffix:l,isLoading:c,hideTeaser:n=!0,hideWhenEmpty:o=!1})=>{const u=!c&&(!o||a.length>0),h=`price-detail-${l}`;return u?e("div",{"data-testid":h,children:e(ve,{content:a,context:r,keyName:i,hideTeaser:n,rudderstackContext:t,className:"[&>*]:!border-cru-neutral-100 [&>:first-child]:border-t-0 [&>:first-child]:pt-0 [&>:last-child]:!border-b-0 [&>:last-child]:pb-0"})}):null},De=({content:a,testIdSuffix:r})=>e(k,{content:a,isLoading:!a,context:"stream",keyName:"prices-detail-analysis",testIdSuffix:r,rudderstackContext:{link_click_group:"article_listing",link_click_subgroup:"price_detail_m_analysis"}}),Fe=({content:a,testIdSuffix:r})=>e(k,{content:a,isLoading:!a,context:"stream",keyName:"prices-detail-news",testIdSuffix:r,rudderstackContext:{link_click_group:"article_listing",link_click_subgroup:"price_detail_news"}}),Oe=({content:a,testIdSuffix:r})=>e(k,{content:a,isLoading:!a,context:"notifications",keyName:"prices-detail-price-notice",testIdSuffix:r,rudderstackContext:{link_click_group:"article_listing",link_click_subgroup:"price_detail_price_notice"}}),Me=({content:a,testIdSuffix:r})=>e(k,{content:a,isLoading:!a,context:"stream",keyName:"prices-detail-monitor",testIdSuffix:r,hideWhenEmpty:!0,rudderstackContext:{link_click_group:"article_listing",link_click_subgroup:"price_detail_monitor"}}),Se=({content:a,testIdSuffix:r})=>e(k,{content:a,isLoading:!a,context:"stream",keyName:"prices-detail-outlook",testIdSuffix:r,hideWhenEmpty:!0,rudderstackContext:{link_click_group:"article_listing",link_click_subgroup:"price_detail_outlook"}}),Ie=()=>{const a=he();return e(re,{onClick:a,title:"More",className:"rounded-md border border-cru-sky-blue p-1 pl-4 pr-4",children:e("span",{className:"font-sans text-sm text-cru-sky-blue",children:"More"})})};const _=s("div",{className:"space-y-4 [&>*]:animate-pulse [&>*]:rounded-md [&>*]:bg-neutral-200",children:[e("div",{className:"h-6 w-1/2"}),e("div",{className:"h-4"}),e("div",{className:"h-4"}),e("div",{className:"h-4"}),e("div",{className:"h-4 w-3/4"})]}),Be=()=>s("div",{className:"price-dashboard","aria-hidden":"true",children:[s("div",{className:"price-dashboard__row",children:[e("div",{className:"price-dashboard__col",children:e("div",{className:"price-dashboard-item",children:e(d,{children:s("div",{className:"space-y-4 [&>*]:animate-pulse [&>*]:rounded-md [&>*]:bg-neutral-200",children:[e("div",{className:"h-10 w-1/2"}),e("div",{className:"h-6 w-1/4"})]})})})}),s("div",{className:"price-dashboard__col",children:[e("div",{className:"price-dashboard-item",children:e(d,{children:_})}),e("div",{className:"price-dashboard-item",children:e(d,{children:_})})]})]}),s("div",{className:"price-dashboard__row",children:[e("div",{className:"price-dashboard__col",children:e("div",{className:"price-dashboard-item",children:e(d,{children:_})})}),e("div",{className:"price-dashboard__col",children:e("div",{className:"price-dashboard-item",children:e(d,{children:_})})})]}),s("div",{className:"price-dashboard__row",children:[e("div",{className:"price-dashboard__col",children:e("div",{className:"price-dashboard-item",children:e(d,{children:s("div",{className:"flex flex-col gap-x-12 gap-y-6 2xl:flex-row [&>*]:flex-1",children:[_,_]})})})}),e("div",{className:"price-dashboard__col",children:e("div",{className:"price-dashboard-item",children:e(d,{children:_})})})]})]}),C=["Latest","Average"],Ee=[{label:"Latest Prices",tab:"latest-prices"},{label:"Average Prices",tab:"average-prices"}],Re=(a,r,i,t)=>{const l=a?[r,i]:[i];return t&&l.unshift(t),l},je=()=>{var $,V,D,F,O,M,S,I,B;const[,a]=N.useTransition(),{priceId:r}=te(["priceId"]),{dataLabLink:i}=me(),{price:t,analysisArticles:l,outlookArticles:c,newsArticles:n,priceN
1oticeArticles:o,monitorArticles:u}=ke(r),[h,A]=N.useState(null),[w,y]=N.useState(null),m=(($=t==null?void 0:t.data)==null?void 0:$.prices)??[],L=((V=t==null?void 0:t.data)==null?void 0:V.priceName)??"",H=()=>{a(()=>{const f=j(()=>import("./ArticlesListPrintView-f2727ca2.js"),["assets/ArticlesListPrintView-f2727ca2.js","assets/index-5fd2db9c.js","assets/agGrid-8b3b3b55.js","assets/microsoft-9db30452.js","assets/index-720e6fa3.css","assets/usePriceBookmarks-0f371e6e.js","assets/Bookmark-0279452a.js","assets/useDatalab-8e507829.js","assets/useNotifications-64ce7dbb.js","assets/useAnchorTabs-788f89da.js","assets/PricesCard-829daeae.js","assets/PricesCard-3a39bf44.css","assets/PrintIcon-e81adb12.js","assets/schema-selectors-e55105f5.js","assets/pricesUtils-ed5bd38f.js","assets/PricesChartBasic-00fd2940.js","assets/offline-exporting-bf564d46.js","assets/accessibility-8b399009.js","assets/pdfjs-fb0fac03.js","assets/ArticleStreamList-560671c1.js","assets/PlatformTags-bb8e489f.js","assets/DownloadIcon-283e2cde.js","assets/PlatformTags-0f74b638.css","assets/ArticleStreamList-3c77f876.css"]),p=N.lazy(()=>f);A(e(p,{priceId:r}));const Y=j(()=>Promise.resolve().then(()=>Ve),void 0),K=N.lazy(()=>Y);y(m==null?void 0:m.map((X,E)=>e(K,{price:X,idx:E,dispMode:"print"},`cards_print_${C[E]}`))),ne.trackGenericControl({interaction_type:"print_price_dashboard",generic_url:location.pathname}),setTimeout(window.print,200)})},x=N.useMemo(()=>t.isLoading?[]:m.map((f,p)=>Ee[p]),[m]),q={aCodes:((D=t==null?void 0:t.data)==null?void 0:D.aCodes)??[],applicableACodes:((F=t==null?void 0:t.data)==null?void 0:F.applicableACodes)??[],path:location.pathname},{selectedTabIndx:T}=ue({tabs:x,trackingEnabled:!t.isLoading,pyramidTrackingPageViewData:q}
1),z=t.isLoading?null:e(be,{flatPriceView:m[T],iconStyle:"contentControls"},"price-detail-bookmark-icon"),Z=Re(i,{href:i,icon:e(fe,{height:30,width:30,"aria-hidden":!0}),text:"DataLab",target:"_blank"},{onClick:H,icon:e(ge,{height:30,width:30,"aria-hidden":!0}),text:"Print"},z),Q=e(oe,{title:L,showBackgroundImage:!0,tabItems:x,contentControls:Z}),U=s(R,{children:[s("div",{className:"price-dashboard no-print",children:[s("div",{className:"price-dashboard__row",children:[!!((O=l.data)!=null&&O.length)&&e("div",{className:"price-dashboard__col",children:s("section",{className:"price-dashboard-item",children:[e("header",{className:"price-dashboard-item__header",children:e("span",{children:"Market analysis and commentary"})}),e(d,{children:e("div",{className:"price-dashboard-item__overflow max-h-[34rem]",children:e(De,{content:l.data,testIdSuffix:"Analysis"})})})]})}),!!((M=n.data)!=null&&M.length)&&e("div",{className:"price-dashboard__col",children:s("section",{className:"price-dashboard-item price-dashboard-item--smaller price-dashboard-item--bookmark-only",children:[e("header",{className:"price-dashboard-item__header",children:e("span",{children:"News"})}),e(d,{children:e("div",{className:"price-dashboard-item__overflow max-h-[34rem]",children:e(Fe,{content:n.data,testIdSuffix:"News"})})})]})})]}),s("div",{className:"price-dashboard__row",children:[(!!((S=u.data)!=null&&S.length)||!!((I=c.data)!=null&&I.length))&&e("div",{className:"price-dashboard__col",children:s("section",{className:"price-dashboard-item",children:[e("header",{className:"price-dashboard-item__header",children:"Latest reports"}),e(d,{children:e("div",{className:"price-dashboard-item__overflow max-h-[24rem]",children:s("div",{className:"flex flex-col gap-x-12 gap-y-6 2xl:flex-row [&>*]:flex-1",children:[e(Me,{content:u.data,testIdSuffix:"Monitor"}),e(Se,{content:c.data,testIdSuffix:"Outlook"})]})})})]})}),!!((B=o.data)!=null&&B.length)&&e("div",{className:"price-dashboard__col",children:s("section",{className:"price-dashboard-item price-dashboard-item--smaller",children:[s("header",{className:"price-dashboard-item__header",children:[e("span",{children:"Price notices"}),e(Ie,{})]}),e(d,{children:e("div",{className:"price-dashboard-item__overflow max-h-[24rem]",children:e(Oe,{content:o.data,testIdSuffix:"PriceNotice"})})})]})})]}),e("div",{className:"price-dashboard__row",children:e("div",{className:"price-dashboard__col px-6",children:e("p",{children:e(Le,{})})})})]}),h]}),W=e(ie,{children:m==null?void 0:m.map((f,p)=>e(se,{children:e(G,{price:f,idx:p,dispMode:"page"},`cards_page_${C[p]}`)},`tab_${C[p]}`))});return e(ce,{selectedIndex:T,children:e(le,{showSpin:!1,headerContent:Q,bottomContent:U,pageName:"Price detail",pageViewData:L?{title:L}:void 0,customClass:"price-detail",children:t.isLoading?e(Be,{}):s(R,{children:[W,w]})})})},Je=Object.freeze(Object.defineProperty({__proto__:null,default:je},Symbol.toStringTag,{value:"Module"}));export{De as A,Me as M,Fe as N,Se as O,Oe as P,Le as a,Je as b,ke as u}; 2//# sourceMappingURL=PriceDetailPage-8536d130.js.map
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.