@datawheel/bespoke 0.8.0-rc.21 → 0.8.0-rc.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/report.js CHANGED
@@ -44,7 +44,7 @@ import { saveElement } from 'd3plus-export';
44
44
  import { FacebookShareButton, FacebookIcon, TwitterShareButton, TwitterIcon, TelegramShareButton, TelegramIcon, WhatsappShareButton, WhatsappIcon, LinkedinShareButton, LinkedinIcon, RedditShareButton, RedditIcon, EmailShareButton, EmailIcon } from 'react-share';
45
45
  import * as Do from 'xlsx';
46
46
 
47
- var cg=Object.defineProperty;var b=(e,t)=>()=>(e&&(t=e(e=0)),t);var Na=(e,t)=>{for(var r in t)cg(e,r,{get:t[r],enumerable:!0});};var c=b(()=>{});var ug,we,Ct=b(()=>{c();ug=()=>{let e=process.env.NEXT_PUBLIC_REPORTS_LOCALE_DEFAULT||"en",t=process.env.NEXT_PUBLIC_REPORTS_LOCALES?.split(",")||[e];return t.includes(e)||t.push(e),{localeDefault:e,locales:t}},we=ug;});function Da(e,t){return +(e<t)-+(e>t)}function Ke(e,t,r="ordering"){return Da(t[r],e[r])}var io=b(()=>{c();});function Fa(e){let t=1+76.18009173/e-86.50532033/(e+1)+24.01409822/(e+2)-1.231739516/(e+3)+.00120858003/(e+4)-536382e-11/(e+5);return (e-.5)*Math.log(e+4.5)-(e+4.5)+Math.log(t*2.50662827465)}function vl(e,t,r){let o=0,n=1,a=1,s=1,i=0,l=0,u;for(;Math.abs((a-l)/a)>1e-5;)l=a,u=-(t+i)*(t+r+i)*e/(t+2*i)/(t+2*i+1),o=a+u*o,n=s+u*n,i+=1,u=i*(r-i)*e/(t+2*i-1)/(t+2*i),a=o+u*a,s=n+u*s,o/=s,n/=s,a/=s,s=1;return a/t}function pg(e,t,r){let o,n;if(e<0)n=0;else if(e>=t)n=1;else {e=Math.floor(e);let a=r,s=e+1,i=t-e,l=s+i,u=Math.exp(Fa(l)-Fa(i)-Fa(s)+s*Math.log(a)+i*Math.log(1-a));a<(s+1)/(l+2)?o=u*vl(a,s,i):o=1-u*vl(1-a,i,s),n=1-o;}return Math.round(n*1e5)/1e5}function dg(e){return {.99999:15.137,.99:6.635,.95:3.841,.9:2.706}[e]}function Fo(e,t,r,o){let n=t/(1-t),a=0,s=1,i=0,l=0;for(;a<=e;)l+=s,a>=r&a<=o&&(i+=s),l>1e30&&(i/=1e30,l/=1e30,s/=1e30),a+=1,s=s*n*(e+1-a)/a;return i/l}function mg(e,t,r){let o=e/t,a=(100-r*100)/2,s,i;if(e===0)s=0;else {let l=o/2,u=0,p=o,m=a/100;for(;p-u>1e-5;)Fo(t,l,e,e)*.5+Fo(t,l,e+1,t)>m?(p=l,l=(u+l)/2):(u=l,l=(p+l)/2);s=l;}if(e===t)i=0;else {let l=(1+o)/2,u=o,p=1,m=a/100;for(;p-u>1e-5;)Fo(t,l,e,e)*.5+Fo(t,l,0,e-1)<m?(p=l,l=(u+l)/2):(u=l,l=(p+l)/2);i=l;}return {lci:s,uci:i}}function fg(e,t){let r=e,o=t,n=r,a=o,s=95,i=.5,l=.5,p=(100-s)/2/100,m=n;for(;l>1e-5;)l/=2,kn((1+m)*i/(1-i),m+1,1e10)+.5*kn((1+m)*i/(1-i),m,m)>p?i-=l:i+=l;let d=(1+m)*i/(1-i)/a;for(i=.5,l=.5,p=(100-s)/2/100;l>1e-5;)l/=2,kn((1+m)*i/(1-i),0,m-1)+.5*kn((1+m)*i/(1-i),m,m)<p?i-=l:i+=l;let g=(1+m)*i/(1-i)/a;return {lci:d,uci:g}}function kn(e,t,r){let o=1,n=0,a=0,s=0;for(;s<e||o>n*1e-10;)n+=o,s>=t&s<=r&&(a+=o),n>1e30&&(a/=1e30,n/=1e30,o/=1e30),s+=1,o=o*e/s;return a/n}var Sl,Tl=b(()=>{c();Sl={binomialCdf:pg,binP:Fo,computeMidP:mg,criticalValue:dg,smr:fg};});function G(e){let t=e.logicFactory(sr);return Cg[e.name]={description:e.description,inputType:e.inputType,logic:Ag(t),testValue:e.testValue,type:e.type||"formatter"},t}function Ag(e){let t=e.toString().trim();if(t.startsWith("function"))return t.replace(/^function(?:\s\w+)?\([^)]\)/,"").trim().replace(/^{([\s\S]+)\}$/,"$1");let r=t.replace(/^.+?=>/,"").trim();return r.startsWith("{")?r.replace(/^{([\s\S]+)\}$/,"$1"):`return ${r}`}var sr,Cg,ae=b(()=>{c();Tl();sr={d3:{...gg,...hg,...yg,...bg},d3plus:{assign:assign,closest:closest,date:date,formatAbbreviate:formatAbbreviate,merge:merge,strip:strip,titleCase:titleCase},stats:Sl},Cg={};});var xl,Rl=b(()=>{c();xl={jwt:wg};});var An,El,wn=b(()=>{c();ae();Rl();An=(e,t={},r="en",o={},n={})=>{let a={setVariables:o.onSetVariables?o.onSetVariables:l=>l,openModal:o.onOpenModal?o.onOpenModal:l=>l,formatters:t,libs:sr,locale:r,...n};function s(l){return Function("globals",...l.vars,`with (globals) { ${l.logic} }`).bind(a,a)}function i(l){if(l.vars&&l.logic)return s(l);for(let u in l)Array.isArray(l[u])?l[u]=l[u].map(p=>isObject(p)?i(p):p):isObject(l[u])&&(l[u]=i(l[u]));return l}return i(e)},El=(e,t={})=>{let r={libs:xl,...t};function o(a){return Function("globals",...a.vars,`with (globals) { ${a.logic} }`).bind(r,r)}function n(a){if(a.vars&&a.logic)return o(a);for(let s in a)Array.isArray(a[s])?a[s]=a[s].map(i=>isObject(i)?n(i):i):isObject(a[s])&&(a[s]=n(a[s]));return a}return n(e)};});function Pn(e,t){let r=Bg[e];if(!r)throw new Error(`Invalid entity type: ${e}`);let{entities:o}=normalize(t,[r]);return {report:wr(o,"report"),dimension:wr(o,"dimension"),section:wr(o,"section"),block:wr(o,"block"),variant:wr(o,"variant"),formatter:wr(o,"formatter"),datasource:wr(o,"datasource")}}function wr(e,t){return Object.prototype.hasOwnProperty.call(e,t)?e[t]:{}}var Ig,Vo,kl,Cl,Al,Lg,Og,_g,Bg,wl,At,ir=b(()=>{c();io();wn();Ct();(({localeDefault:Ig}=we())),Vo=new schema.Entity("block",{},{mergeStrategy(e,t){return t.block_input?e||{}:{...e,...t}}});Vo.define({consumers:[Vo],inputs:[Vo]});kl=new schema.Entity("variant"),Cl=new schema.Entity("dimension",{variants:[kl]},{processStrategy(e){return {...e,variants:"variants"in e?e.variants:[]}}}),Al=new schema.Entity("section",{blocks:[Vo]}),Lg=new schema.Entity("report",{dimensions:[Cl],sections:[Al]},{processStrategy(e){return {...e,sections:"sections"in e?e.sections.sort(Ke):[]}}}),Og=new schema.Entity("formatter"),_g=new schema.Entity("datasource"),Bg={report:Lg,section:Al,block:Vo,dimension:Cl,variant:kl,formatter:Og,datasource:_g};wl=(e,t=void 0)=>{let{sid:r,bid:o,previews:n=[],query:a={}}=t||{},s,i,l={};return r?(s=r,l.activeSection=s):s=e.activeSection,n.length>0?(i=n,l.previews=i.filter(Boolean)):i=e.previews,{parsedParams:{sid:s,bid:o,previews:i,query:a},statusPayload:l}},At=(e=[],t=Ig)=>e.reduce((r,o)=>{let n=An({vars:["n"],logic:o.content.logic},{},t,{});return r[o.name]=n,r},{});});function gt(e,t){return e.request(t).then(r=>{let{status:o,data:n}=r;return "error"in n?{ok:!1,status:o,error:n.error}:{ok:!0,status:o,data:n.data}},r=>{if("isAxiosError"in r){let{status:o,data:n}=r.response||{status:500};return {ok:!1,status:o,error:n?.error??r.message}}return {ok:!1,status:500,error:r.message}})}function Se(e,t,r){let o=typeof t=="string"?{url:t}:t;return n=>gt(e,{...o,method:"GET",params:r?r(n):n})}function Te(e,t,r){let o=typeof t=="string"?{url:t}:t;return n=>gt(e,{...o,method:"POST",data:r?r(n):n})}function lr(e,t,r){let o=typeof t=="string"?{url:t}:t;return n=>gt(e,{...o,method:"DELETE",params:r?r(n):n})}var lo=b(()=>{c();});function co(e,t){return r=>gt(e,{method:"POST",url:`images/save/${t}`,params:{prompt:r.prompt,provider:t}})}var Pl=b(()=>{c();lo();});function $o(e,t){return r=>gt(e,{method:"GET",url:`images/search/${t}`,params:{prompt:r.prompt,page:r.page,provider:t}})}var Il=b(()=>{c();lo();});function Ll(e,t){return ()=>gt(e,{method:"GET",url:`list/icons/${t}`,params:{provider:t}})}var Ol=b(()=>{c();lo();});function _l(e,t){return r=>gt(e,{method:"GET",url:`read/icons/${t}/icon.svg`,params:{name:r.name}})}var Bl=b(()=>{c();lo();});function zo(e){let t=Nn.create({baseURL:e});return {createBulkBlock:Te(t,"create/bulk/block"),createBlock:Te(t,"create/block"),createDimension:Te(t,"create/dimension"),createFormatter:Te(t,"create/formatter"),createReport:Te(t,"create/report"),createSection:Te(t,"create/section"),createVariant:Te(t,"create/variant"),createDatasource:Te(t,"create/datasource"),deleteBlock:lr(t,"delete/block",Ir),deleteDimension:lr(t,"delete/dimension",Ir),deleteFormatter:lr(t,"delete/formatter",Ir),deleteReport:lr(t,"delete/report",Ir),deleteSection:lr(t,"delete/section",Ir),deleteVariant:lr(t,"delete/variant",Ir),deleteDatasource:lr(t,"delete/datasource",Ir),readBlock:Se(t,"read/block"),readDimension:Se(t,"read/dimension"),readFormatter:Se(t,"read/formatter"),readReport:Se(t,"read/report"),readSection:Se(t,"read/section"),readVariant:Se(t,"read/variant"),readDatasource:Se(t,"read/datasource"),updateBulkBlock:Te(t,"update/bulk/block"),updateBlock:Te(t,"update/block"),updateDimension:Te(t,"update/dimension"),updateFormatter:Te(t,"update/formatter"),updateReport:Te(t,"update/report"),updateSection:Te(t,"update/section"),updateVariant:Te(t,"update/variant"),updateDatasource:Te(t,"update/datasource"),searchReport:Se(t,"search/reports"),validateVariantSlug:Se(t,"validate/variant"),readMember:Se(t,"read/members",Ng),readMemberImage:Se(t,{url:"member/image",responseType:"blob"}),searchMember:Se(t,"search/members"),updateMember:Se(t,"update/members"),imageLocalSearch:$o(t,"local"),imageLocalSave:co(t,"local"),imageFlickrSearch:$o(t,"flickr"),imageFlickrSave:co(t,"flickr"),imageUnsplashSearch:$o(t,"unsplash"),imageUnsplashSave:co(t,"unsplash"),imageUploadSave:co(t,"upload"),imageAdobeSearch:$o(t,"adobe"),imageAdobeSave:co(t,"adobe"),readMetadata:Se(t,"read/metadata"),regenerateSearch:Te(t,"search/regenerate"),urlProxy:Se(t,"url/proxy"),searchRole:Se(t,"auth/search/roles"),searchUser:Se(t,"auth/search/users"),readUser:Se(t,"auth/read/user"),updateUser:Te(t,"auth/update/user"),updateMyData:Te(t,"auth/update/me"),revalidateReport:Se(t,"revalidate/report"),revalidateUrl:Se(t,"revalidate/url"),readPrivateBlocks:Te(t,"read/blocks/private"),listTablerIcons:Ll(t,"tabler"),readTablerIcon:_l(t,"tabler"),readEnvSecrets:Se(t,"read/secrets")}}var Ir,Ng,Ml=b(()=>{c();Pl();Il();lo();Ol();Bl();Ir=e=>({id:e}),Ng=e=>{if(e.mode==="slugs"){let t=e.slugs.map(r=>[r.variantSlug,r.memberSlug].join("/")).join(",");return {...e,slugs:t}}return ["related","whole"].includes(e.mode)?{...e}:{...e,[e.mode]:e[e.mode].join(",")}};});var Va=b(()=>{c();Ml();});var Nl=b(()=>{c();});var Dl=b(()=>{c();Nl();});function ct(e){return {variables:e.variables||{},query:e.query||{},locale:e.locale||Vg}}var Vg,uo=b(()=>{c();Dl();Ct();({localeDefault:Vg}=we());});var Lr,Fl,Ce,Ln,Vl,$a,$g,zg,Ug,za,Ua,h,fe,xe,$l,In,he=b(()=>{c();Lr={REPORT:"report",SECTION:"section",BLOCK:"block",INPUT:"block_input",FORMATTER:"formatter",DATASOURCE:"datasource",DIMENSION:"report_dimension",VARIANT:"report_dimension_variant",SEARCH:"search"},[Lr.BLOCK,Lr.SEARCH],{[Lr.SECTION]:"report_id",[Lr.DIMENSION]:"report_id",[Lr.VARIANT]:"dimension_id",[Lr.BLOCK]:"section_id",[Lr.INPUT]:"block_id"},Fl={REPORT:"report",STORY:"story"},Ce={SINGLE:"single",MULTI:"multi"},Ln={SEGMENTED_CONTROL:"segmented control",SELECTOR:"selector"},Vl={TITLE:"title",SUBTITLE:"subtitle",LABEL:"label"},{[Fl.REPORT]:Object.values(Vl),[Fl.STORY]:Object.values(Vl)},$a={ALLOWED:"allowed",ALLOWED_LOGIC:"allowedLogic",IGNORE_CASCADE:"ignoreCascade"},$g={ACCESS:"access",ACCESS_LOGIC:"accessLogic"},zg={FALLBACK:"fallback"},{...$a},{POSITION:"position",ICON:"icon",...$a},Ug={IMAGE:"image",PARAGRAPH:"paragraph",SELECTOR:"selector",STAT:"stat",SUBTITLE:"subtitle",TITLE:"title",NAV:"nav",RESET_BUTTON:"reset_button",COMPARISON_BUTTON:"comparison_button",TABLE:"table",BUTTON:"button",MULTIHIERARCHY_SELECTOR:"multihierarchy_selector",FALLBACK:"fallback"},za={GENERATOR:"generator",RELATED:"related",VIZ:"visualization",SECTION_FLAG:"section_flag"},Ua="logic",h={...Ug,...za},[h.GENERATOR,h.SECTION_FLAG,h.SELECTOR,h.VIZ,h.IMAGE,h.TABLE,h.MULTIHIERARCHY_SELECTOR],fe={ALT:"alt",AUTHOR:"author",DESC:"desc",FOOTNOTE:"footnote",BIO:"bio",IMAGE:"image",LABEL:"label",LOGIC:"logic",MULTIHIERARCHY_SELECTOR:"multihierarchySelector",MULTIHIERARCHY_SELECTOR_ALL_LABEL:"multihierarchySelectorAllLabel",MULTIHIERARCHY_SELECTOR_NAME:"multihierarchySelectorName",MULTIHIERARCHY_SELECTOR_PLACEHOLDER:"multihierarchySelectorPlaceholder",SIMPLE:"simple",SIMPLE_ENABLED:"simpleEnabled",PARAGRAPH:"paragraph",SELECTOR_DEFAULT:"selectorDefault",SELECTOR_DYNAMIC:"selectorDynamic",SELECTOR_NAME:"selectorName",SELECTOR_TYPE:"selectorType",SRC:"src",SLUG:"slug",SUBTITLE:"subtitle",TABLE:"table",TITLE:"title",TOOLTIP:"tooltip",TWITTER:"twitter",URL:"url",VALUE:"value"},[fe.LOGIC,fe.SIMPLE,fe.SIMPLE_ENABLED],xe={ENABLE_ALL:{bubbleMenu:!0,toolbarOptions:{history:!0,alignment:!1,format:!0}},DISABLE_ALL:{bubbleMenu:!1,toolbarOptions:{history:!1,alignment:!1,format:!1}},ENABLE_FORMAT:{bubbleMenu:!0,toolbarOptions:{history:!0,alignment:!1,format:!0}}},{[h.IMAGE]:[{field:fe.TITLE,editorConfig:xe.ENABLE_ALL},{field:fe.SRC,editorConfig:xe.DISABLE_ALL},{field:fe.ALT,editorConfig:xe.DISABLE_ALL},{field:fe.DESC,editorConfig:xe.ENABLE_ALL}],[h.PARAGRAPH]:[{field:h.PARAGRAPH,editorConfig:xe.ENABLE_ALL},{field:fe.TOOLTIP,editorConfig:xe.ENABLE_FORMAT}],[h.SELECTOR]:[{field:fe.SELECTOR_DEFAULT},{field:fe.SELECTOR_DYNAMIC},{field:fe.SELECTOR_NAME,editorConfig:xe.ENABLE_FORMAT},{field:fe.SELECTOR_TYPE}],[h.STAT]:[{field:fe.TITLE,editorConfig:xe.ENABLE_FORMAT},{field:fe.SUBTITLE,editorConfig:xe.ENABLE_FORMAT},{field:fe.VALUE,editorConfig:xe.ENABLE_FORMAT},{field:fe.TOOLTIP,editorConfig:xe.ENABLE_FORMAT}],[h.SUBTITLE]:[{field:fe.SUBTITLE,editorConfig:xe.ENABLE_FORMAT},{field:fe.TOOLTIP,editorConfig:xe.ENABLE_FORMAT}],[h.TITLE]:[{field:fe.TITLE,editorConfig:xe.ENABLE_FORMAT},{field:fe.SLUG,editorConfig:xe.DISABLE_ALL},{field:fe.TOOLTIP,editorConfig:xe.ENABLE_FORMAT}],[h.BUTTON]:[{field:fe.LABEL,editorConfig:xe.ENABLE_FORMAT},{field:fe.URL,editorConfig:xe.ENABLE_FORMAT}],[h.GENERATOR]:[],[h.SECTION_FLAG]:[],[h.VIZ]:[],[h.TABLE]:[],[h.MULTIHIERARCHY_SELECTOR]:[{field:fe.MULTIHIERARCHY_SELECTOR_NAME,editorConfig:xe.ENABLE_FORMAT},{field:fe.MULTIHIERARCHY_SELECTOR_PLACEHOLDER,editorConfig:xe.DISABLE_ALL},{field:fe.MULTIHIERARCHY_SELECTOR_ALL_LABEL,editorConfig:xe.DISABLE_ALL}]},{NAME:"name",DESCRIPTION:"description",...$a,...$g,...zg},$l={FORMATTER:"formatter",FUNCTION:"function"},{[$l.FORMATTER]:"Formatter",[$l.FUNCTION]:"Function"},In={STRING:"string",NUMBER:"number",OBJECT:"object",DATE:"date"},{[In.STRING]:"String",[In.NUMBER]:"Number",[In.OBJECT]:"Object/Array",[In.DATE]:"Date"};});function Wg(e,t,r,o,n=void 0,a){let s={},i=[],{locale:l}=ct(a);try{if(t){let u=new Proxy(console,{get(m,d){return Kg(d,"log","debug","info","warn","error")?(...f)=>{i.push(`${d} ${Date.now()} - ${f.map(g=>format(g)).join(" ")}`),jg&&m[d](...f);}:m[d]}}),p;return n?p=new Function(e,"console","libs","formatters","locale","variables",r)(t,u,sr,o,l,n):p=new Function(e,"console","libs","formatters","locale",r)(t,u,sr,o,l),typeof p=="object"&&Object.keys(p).length>0&&Object.assign(s,p),{vars:s,error:null,log:i,output:p}}return {vars:s,error:"Invalid API Link",log:i}}catch(u){return {vars:s,error:u.message,log:i}}}function Kg(e,...t){return t.includes(e)}var jg,wt,Uo=b(()=>{c();uo();ae();jg=qg(process.env.REPORTS_LOGGING),wt=Wg;});function Ga(e){return e.reduce((t,r,o)=>(o?o===e.length-1&&o===1?t+=` and ${r}`:o===e.length-1?t+=`, and ${r}`:t+=`, ${r}`:t+=r,t),"")}var zl=b(()=>{c();});function Yg(e,t,r,o=!1){let{variables:n}=ct(r);if(!e)return e;let a=/([A-z0-9]*)\{\{([^\}]+)\}\}/g;return e.replace(a,(i,l,u)=>{let p=d=>d;if(l){let d=l.replace(/^\w/g,f=>f.toLowerCase());d in t?p=t[d]:p=f=>`${l}${f}`;}let m=Array.isArray(n[u])?Ga(n[u]):n[u];if(m===void 0)return o?i:"N/A";try{return p(m,sr,t)}catch(d){return console.error(`Error using formatter ${p.name}
47
+ var cg=Object.defineProperty;var b=(e,t)=>()=>(e&&(t=e(e=0)),t);var Na=(e,t)=>{for(var r in t)cg(e,r,{get:t[r],enumerable:!0});};var c=b(()=>{});var ug,we,Ct=b(()=>{c();ug=()=>{let e=process.env.NEXT_PUBLIC_REPORTS_LOCALE_DEFAULT||"en",t=process.env.NEXT_PUBLIC_REPORTS_LOCALES?.split(",")||[e];return t.includes(e)||t.push(e),{localeDefault:e,locales:t}},we=ug;});function Da(e,t){return +(e<t)-+(e>t)}function Ke(e,t,r="ordering"){return Da(t[r],e[r])}var io=b(()=>{c();});function Fa(e){let t=1+76.18009173/e-86.50532033/(e+1)+24.01409822/(e+2)-1.231739516/(e+3)+.00120858003/(e+4)-536382e-11/(e+5);return (e-.5)*Math.log(e+4.5)-(e+4.5)+Math.log(t*2.50662827465)}function vl(e,t,r){let o=0,n=1,a=1,s=1,i=0,l=0,u;for(;Math.abs((a-l)/a)>1e-5;)l=a,u=-(t+i)*(t+r+i)*e/(t+2*i)/(t+2*i+1),o=a+u*o,n=s+u*n,i+=1,u=i*(r-i)*e/(t+2*i-1)/(t+2*i),a=o+u*a,s=n+u*s,o/=s,n/=s,a/=s,s=1;return a/t}function pg(e,t,r){let o,n;if(e<0)n=0;else if(e>=t)n=1;else {e=Math.floor(e);let a=r,s=e+1,i=t-e,l=s+i,u=Math.exp(Fa(l)-Fa(i)-Fa(s)+s*Math.log(a)+i*Math.log(1-a));a<(s+1)/(l+2)?o=u*vl(a,s,i):o=1-u*vl(1-a,i,s),n=1-o;}return Math.round(n*1e5)/1e5}function dg(e){return {.99999:15.137,.99:6.635,.95:3.841,.9:2.706}[e]}function Fo(e,t,r,o){let n=t/(1-t),a=0,s=1,i=0,l=0;for(;a<=e;)l+=s,a>=r&a<=o&&(i+=s),l>1e30&&(i/=1e30,l/=1e30,s/=1e30),a+=1,s=s*n*(e+1-a)/a;return i/l}function mg(e,t,r){let o=e/t,a=(100-r*100)/2,s,i;if(e===0)s=0;else {let l=o/2,u=0,p=o,m=a/100;for(;p-u>1e-5;)Fo(t,l,e,e)*.5+Fo(t,l,e+1,t)>m?(p=l,l=(u+l)/2):(u=l,l=(p+l)/2);s=l;}if(e===t)i=0;else {let l=(1+o)/2,u=o,p=1,m=a/100;for(;p-u>1e-5;)Fo(t,l,e,e)*.5+Fo(t,l,0,e-1)<m?(p=l,l=(u+l)/2):(u=l,l=(p+l)/2);i=l;}return {lci:s,uci:i}}function fg(e,t){let r=e,o=t,n=r,a=o,s=95,i=.5,l=.5,p=(100-s)/2/100,m=n;for(;l>1e-5;)l/=2,kn((1+m)*i/(1-i),m+1,1e10)+.5*kn((1+m)*i/(1-i),m,m)>p?i-=l:i+=l;let d=(1+m)*i/(1-i)/a;for(i=.5,l=.5,p=(100-s)/2/100;l>1e-5;)l/=2,kn((1+m)*i/(1-i),0,m-1)+.5*kn((1+m)*i/(1-i),m,m)<p?i-=l:i+=l;let g=(1+m)*i/(1-i)/a;return {lci:d,uci:g}}function kn(e,t,r){let o=1,n=0,a=0,s=0;for(;s<e||o>n*1e-10;)n+=o,s>=t&s<=r&&(a+=o),n>1e30&&(a/=1e30,n/=1e30,o/=1e30),s+=1,o=o*e/s;return a/n}var Sl,Tl=b(()=>{c();Sl={binomialCdf:pg,binP:Fo,computeMidP:mg,criticalValue:dg,smr:fg};});function G(e){let t=e.logicFactory(sr);return Cg[e.name]={description:e.description,inputType:e.inputType,logic:Ag(t),testValue:e.testValue,type:e.type||"formatter"},t}function Ag(e){let t=e.toString().trim();if(t.startsWith("function"))return t.replace(/^function(?:\s\w+)?\([^)]\)/,"").trim().replace(/^{([\s\S]+)\}$/,"$1");let r=t.replace(/^.+?=>/,"").trim();return r.startsWith("{")?r.replace(/^{([\s\S]+)\}$/,"$1"):`return ${r}`}var sr,Cg,ae=b(()=>{c();Tl();sr={d3:{...gg,...hg,...yg,...bg},d3plus:{assign:assign,closest:closest,date:date,formatAbbreviate:formatAbbreviate,merge:merge,strip:strip,titleCase:titleCase},stats:Sl},Cg={};});var xl,Rl=b(()=>{c();xl={jwt:wg};});var An,El,wn=b(()=>{c();ae();Rl();An=(e,t={},r="en",o={},n={})=>{let a={setVariables:o.onSetVariables?o.onSetVariables:l=>l,openModal:o.onOpenModal?o.onOpenModal:l=>l,formatters:t,libs:sr,locale:r,...n};function s(l){return Function("globals",...l.vars,`with (globals) { ${l.logic} }`).bind(a,a)}function i(l){if(l.vars&&l.logic)return s(l);for(let u in l)Array.isArray(l[u])?l[u]=l[u].map(p=>isObject(p)?i(p):p):isObject(l[u])&&(l[u]=i(l[u]));return l}return i(e)},El=(e,t={})=>{let r={libs:xl,...t};function o(a){return Function("globals",...a.vars,`with (globals) { ${a.logic} }`).bind(r,r)}function n(a){if(a.vars&&a.logic)return o(a);for(let s in a)Array.isArray(a[s])?a[s]=a[s].map(i=>isObject(i)?n(i):i):isObject(a[s])&&(a[s]=n(a[s]));return a}return n(e)};});function Pn(e,t){let r=Bg[e];if(!r)throw new Error(`Invalid entity type: ${e}`);let{entities:o}=normalize(t,[r]);return {report:wr(o,"report"),dimension:wr(o,"dimension"),section:wr(o,"section"),block:wr(o,"block"),variant:wr(o,"variant"),formatter:wr(o,"formatter"),datasource:wr(o,"datasource")}}function wr(e,t){return Object.prototype.hasOwnProperty.call(e,t)?e[t]:{}}var Ig,Vo,kl,Cl,Al,Lg,Og,_g,Bg,wl,At,ir=b(()=>{c();io();wn();Ct();(({localeDefault:Ig}=we())),Vo=new schema.Entity("block",{},{mergeStrategy(e,t){return t.block_input?e||{}:{...e,...t}}});Vo.define({consumers:[Vo],inputs:[Vo]});kl=new schema.Entity("variant"),Cl=new schema.Entity("dimension",{variants:[kl]},{processStrategy(e){return {...e,variants:"variants"in e?e.variants:[]}}}),Al=new schema.Entity("section",{blocks:[Vo]}),Lg=new schema.Entity("report",{dimensions:[Cl],sections:[Al]},{processStrategy(e){return {...e,sections:"sections"in e?e.sections.sort(Ke):[]}}}),Og=new schema.Entity("formatter"),_g=new schema.Entity("datasource"),Bg={report:Lg,section:Al,block:Vo,dimension:Cl,variant:kl,formatter:Og,datasource:_g};wl=(e,t=void 0)=>{let{sid:r,bid:o,previews:n=[],query:a={}}=t||{},s,i,l={};return r?(s=r,l.activeSection=s):s=e.activeSection,n.length>0?(i=n,l.previews=i.filter(Boolean)):i=e.previews,{parsedParams:{sid:s,bid:o,previews:i,query:a},statusPayload:l}},At=(e=[],t=Ig)=>e.reduce((r,o)=>{let n=An({vars:["n"],logic:o.content.logic},{},t,{});return r[o.name]=n,r},{});});function gt(e,t){return e.request(t).then(r=>{let{status:o,data:n}=r;return "error"in n?{ok:!1,status:o,error:n.error}:{ok:!0,status:o,wrapper:n.wrapper,data:n.data}},r=>{if("isAxiosError"in r){let{status:o,data:n}=r.response||{status:500};return {ok:!1,status:o,error:n?.error??r.message}}return {ok:!1,status:500,error:r.message}})}function Se(e,t,r){let o=typeof t=="string"?{url:t}:t;return n=>gt(e,{...o,method:"GET",params:r?r(n):n})}function Te(e,t,r){let o=typeof t=="string"?{url:t}:t;return n=>gt(e,{...o,method:"POST",data:r?r(n):n})}function lr(e,t,r){let o=typeof t=="string"?{url:t}:t;return n=>gt(e,{...o,method:"DELETE",params:r?r(n):n})}var lo=b(()=>{c();});function co(e,t){return r=>gt(e,{method:"POST",url:`images/save/${t}`,params:{prompt:r.prompt,provider:t}})}var Pl=b(()=>{c();lo();});function $o(e,t){return r=>gt(e,{method:"GET",url:`images/search/${t}`,params:{prompt:r.prompt,page:r.page,provider:t}})}var Il=b(()=>{c();lo();});function Ll(e,t){return ()=>gt(e,{method:"GET",url:`list/icons/${t}`,params:{provider:t}})}var Ol=b(()=>{c();lo();});function _l(e,t){return r=>gt(e,{method:"GET",url:`read/icons/${t}/icon.svg`,params:{name:r.name}})}var Bl=b(()=>{c();lo();});function zo(e){let t=Nn.create({baseURL:e});return {createBulkBlock:Te(t,"create/bulk/block"),createBlock:Te(t,"create/block"),createDimension:Te(t,"create/dimension"),createFormatter:Te(t,"create/formatter"),createReport:Te(t,"create/report"),createSection:Te(t,"create/section"),createVariant:Te(t,"create/variant"),createDatasource:Te(t,"create/datasource"),deleteBlock:lr(t,"delete/block",Ir),deleteDimension:lr(t,"delete/dimension",Ir),deleteFormatter:lr(t,"delete/formatter",Ir),deleteReport:lr(t,"delete/report",Ir),deleteSection:lr(t,"delete/section",Ir),deleteVariant:lr(t,"delete/variant",Ir),deleteDatasource:lr(t,"delete/datasource",Ir),readBlock:Se(t,"read/block"),readDimension:Se(t,"read/dimension"),readFormatter:Se(t,"read/formatter"),readReport:Se(t,"read/report"),readSection:Se(t,"read/section"),readVariant:Se(t,"read/variant"),readDatasource:Se(t,"read/datasource"),updateBulkBlock:Te(t,"update/bulk/block"),updateBlock:Te(t,"update/block"),updateDimension:Te(t,"update/dimension"),updateFormatter:Te(t,"update/formatter"),updateReport:Te(t,"update/report"),updateSection:Te(t,"update/section"),updateVariant:Te(t,"update/variant"),updateDatasource:Te(t,"update/datasource"),searchReport:Se(t,"search/reports"),validateVariantSlug:Se(t,"validate/variant"),readMember:Se(t,"read/members",Ng),readMemberImage:Se(t,{url:"member/image",responseType:"blob"}),searchMember:Se(t,"search/members"),updateMember:Se(t,"update/members"),imageLocalSearch:$o(t,"local"),imageLocalSave:co(t,"local"),imageFlickrSearch:$o(t,"flickr"),imageFlickrSave:co(t,"flickr"),imageUnsplashSearch:$o(t,"unsplash"),imageUnsplashSave:co(t,"unsplash"),imageUploadSave:co(t,"upload"),imageAdobeSearch:$o(t,"adobe"),imageAdobeSave:co(t,"adobe"),readMetadata:Se(t,"read/metadata"),regenerateSearch:Te(t,"search/regenerate"),urlProxy:Se(t,"url/proxy"),searchRole:Se(t,"auth/search/roles"),searchUser:Se(t,"auth/search/users"),readUser:Se(t,"auth/read/user"),updateUser:Te(t,"auth/update/user"),updateMyData:Te(t,"auth/update/me"),revalidateReport:Se(t,"revalidate/report"),revalidateUrl:Se(t,"revalidate/url"),readPrivateBlocks:Te(t,"read/blocks/private"),listTablerIcons:Ll(t,"tabler"),readTablerIcon:_l(t,"tabler"),readEnvSecrets:Se(t,"read/secrets")}}var Ir,Ng,Ml=b(()=>{c();Pl();Il();lo();Ol();Bl();Ir=e=>({id:e}),Ng=e=>{if(e.mode==="slugs"){let t=e.slugs.map(r=>[r.variantSlug,r.memberSlug].join("/")).join(",");return {...e,slugs:t}}return ["related","whole"].includes(e.mode)?{...e}:{...e,[e.mode]:e[e.mode].join(",")}};});var Va=b(()=>{c();Ml();});var Nl=b(()=>{c();});var Dl=b(()=>{c();Nl();});function ct(e){return {variables:e.variables||{},query:e.query||{},locale:e.locale||Vg}}var Vg,uo=b(()=>{c();Dl();Ct();({localeDefault:Vg}=we());});var Lr,Fl,Ce,Ln,Vl,$a,$g,zg,Ug,za,Ua,h,fe,xe,$l,In,he=b(()=>{c();Lr={REPORT:"report",SECTION:"section",BLOCK:"block",INPUT:"block_input",FORMATTER:"formatter",DATASOURCE:"datasource",DIMENSION:"report_dimension",VARIANT:"report_dimension_variant",SEARCH:"search"},[Lr.BLOCK,Lr.SEARCH],{[Lr.SECTION]:"report_id",[Lr.DIMENSION]:"report_id",[Lr.VARIANT]:"dimension_id",[Lr.BLOCK]:"section_id",[Lr.INPUT]:"block_id"},Fl={REPORT:"report",STORY:"story"},Ce={SINGLE:"single",MULTI:"multi"},Ln={SEGMENTED_CONTROL:"segmented control",SELECTOR:"selector"},Vl={TITLE:"title",SUBTITLE:"subtitle",LABEL:"label"},{[Fl.REPORT]:Object.values(Vl),[Fl.STORY]:Object.values(Vl)},$a={ALLOWED:"allowed",ALLOWED_LOGIC:"allowedLogic",IGNORE_CASCADE:"ignoreCascade"},$g={ACCESS:"access",ACCESS_LOGIC:"accessLogic"},zg={FALLBACK:"fallback"},{...$a},{POSITION:"position",ICON:"icon",...$a},Ug={IMAGE:"image",PARAGRAPH:"paragraph",SELECTOR:"selector",STAT:"stat",SUBTITLE:"subtitle",TITLE:"title",NAV:"nav",RESET_BUTTON:"reset_button",COMPARISON_BUTTON:"comparison_button",TABLE:"table",BUTTON:"button",MULTIHIERARCHY_SELECTOR:"multihierarchy_selector",FALLBACK:"fallback"},za={GENERATOR:"generator",RELATED:"related",VIZ:"visualization",SECTION_FLAG:"section_flag"},Ua="logic",h={...Ug,...za},[h.GENERATOR,h.SECTION_FLAG,h.SELECTOR,h.VIZ,h.IMAGE,h.TABLE,h.MULTIHIERARCHY_SELECTOR],fe={ALT:"alt",AUTHOR:"author",DESC:"desc",FOOTNOTE:"footnote",BIO:"bio",IMAGE:"image",LABEL:"label",LOGIC:"logic",MULTIHIERARCHY_SELECTOR:"multihierarchySelector",MULTIHIERARCHY_SELECTOR_ALL_LABEL:"multihierarchySelectorAllLabel",MULTIHIERARCHY_SELECTOR_NAME:"multihierarchySelectorName",MULTIHIERARCHY_SELECTOR_PLACEHOLDER:"multihierarchySelectorPlaceholder",SIMPLE:"simple",SIMPLE_ENABLED:"simpleEnabled",PARAGRAPH:"paragraph",SELECTOR_DEFAULT:"selectorDefault",SELECTOR_DYNAMIC:"selectorDynamic",SELECTOR_NAME:"selectorName",SELECTOR_TYPE:"selectorType",SRC:"src",SLUG:"slug",SUBTITLE:"subtitle",TABLE:"table",TITLE:"title",TOOLTIP:"tooltip",TWITTER:"twitter",URL:"url",VALUE:"value"},[fe.LOGIC,fe.SIMPLE,fe.SIMPLE_ENABLED],xe={ENABLE_ALL:{bubbleMenu:!0,toolbarOptions:{history:!0,alignment:!1,format:!0}},DISABLE_ALL:{bubbleMenu:!1,toolbarOptions:{history:!1,alignment:!1,format:!1}},ENABLE_FORMAT:{bubbleMenu:!0,toolbarOptions:{history:!0,alignment:!1,format:!0}}},{[h.IMAGE]:[{field:fe.TITLE,editorConfig:xe.ENABLE_ALL},{field:fe.SRC,editorConfig:xe.DISABLE_ALL},{field:fe.ALT,editorConfig:xe.DISABLE_ALL},{field:fe.DESC,editorConfig:xe.ENABLE_ALL}],[h.PARAGRAPH]:[{field:h.PARAGRAPH,editorConfig:xe.ENABLE_ALL},{field:fe.TOOLTIP,editorConfig:xe.ENABLE_FORMAT}],[h.SELECTOR]:[{field:fe.SELECTOR_DEFAULT},{field:fe.SELECTOR_DYNAMIC},{field:fe.SELECTOR_NAME,editorConfig:xe.ENABLE_FORMAT},{field:fe.SELECTOR_TYPE}],[h.STAT]:[{field:fe.TITLE,editorConfig:xe.ENABLE_FORMAT},{field:fe.SUBTITLE,editorConfig:xe.ENABLE_FORMAT},{field:fe.VALUE,editorConfig:xe.ENABLE_FORMAT},{field:fe.TOOLTIP,editorConfig:xe.ENABLE_FORMAT}],[h.SUBTITLE]:[{field:fe.SUBTITLE,editorConfig:xe.ENABLE_FORMAT},{field:fe.TOOLTIP,editorConfig:xe.ENABLE_FORMAT}],[h.TITLE]:[{field:fe.TITLE,editorConfig:xe.ENABLE_FORMAT},{field:fe.SLUG,editorConfig:xe.DISABLE_ALL},{field:fe.TOOLTIP,editorConfig:xe.ENABLE_FORMAT}],[h.BUTTON]:[{field:fe.LABEL,editorConfig:xe.ENABLE_FORMAT},{field:fe.URL,editorConfig:xe.ENABLE_FORMAT}],[h.GENERATOR]:[],[h.SECTION_FLAG]:[],[h.VIZ]:[],[h.TABLE]:[],[h.MULTIHIERARCHY_SELECTOR]:[{field:fe.MULTIHIERARCHY_SELECTOR_NAME,editorConfig:xe.ENABLE_FORMAT},{field:fe.MULTIHIERARCHY_SELECTOR_PLACEHOLDER,editorConfig:xe.DISABLE_ALL},{field:fe.MULTIHIERARCHY_SELECTOR_ALL_LABEL,editorConfig:xe.DISABLE_ALL}]},{NAME:"name",DESCRIPTION:"description",...$a,...$g,...zg},$l={FORMATTER:"formatter",FUNCTION:"function"},{[$l.FORMATTER]:"Formatter",[$l.FUNCTION]:"Function"},In={STRING:"string",NUMBER:"number",OBJECT:"object",DATE:"date"},{[In.STRING]:"String",[In.NUMBER]:"Number",[In.OBJECT]:"Object/Array",[In.DATE]:"Date"};});function Wg(e,t,r,o,n=void 0,a){let s={},i=[],{locale:l}=ct(a);try{if(t){let u=new Proxy(console,{get(m,d){return Kg(d,"log","debug","info","warn","error")?(...f)=>{i.push(`${d} ${Date.now()} - ${f.map(g=>format(g)).join(" ")}`),jg&&m[d](...f);}:m[d]}}),p;return n?p=new Function(e,"console","libs","formatters","locale","variables",r)(t,u,sr,o,l,n):p=new Function(e,"console","libs","formatters","locale",r)(t,u,sr,o,l),typeof p=="object"&&Object.keys(p).length>0&&Object.assign(s,p),{vars:s,error:null,log:i,output:p}}return {vars:s,error:"Invalid API Link",log:i}}catch(u){return {vars:s,error:u.message,log:i}}}function Kg(e,...t){return t.includes(e)}var jg,wt,Uo=b(()=>{c();uo();ae();jg=qg(process.env.REPORTS_LOGGING),wt=Wg;});function Ga(e){return e.reduce((t,r,o)=>(o?o===e.length-1&&o===1?t+=` and ${r}`:o===e.length-1?t+=`, and ${r}`:t+=`, ${r}`:t+=r,t),"")}var zl=b(()=>{c();});function Yg(e,t,r,o=!1){let{variables:n}=ct(r);if(!e)return e;let a=/([A-z0-9]*)\{\{([^\}]+)\}\}/g;return e.replace(a,(i,l,u)=>{let p=d=>d;if(l){let d=l.replace(/^\w/g,f=>f.toLowerCase());d in t?p=t[d]:p=f=>`${l}${f}`;}let m=Array.isArray(n[u])?Ga(n[u]):n[u];if(m===void 0)return o?i:"N/A";try{return p(m,sr,t)}catch(d){return console.error(`Error using formatter ${p.name}
48
48
  `,`Error message: ${d.message}`),"N/A"}})}var tt,po=b(()=>{c();uo();zl();ae();tt=Yg;});var qa,ut,Or=b(()=>{c();po();qa=(e,t,r)=>{let{variables:o}=r,n=s=>s.allowed==="never"?!1:!s.allowed||s.allowed==="always"||o[s.allowed],a={...e};return Object.keys(a).forEach(s=>{typeof a[s]=="string"?a[s]=tt(a[s],t,r):Array.isArray(a[s])?a[s]=a[s].filter(n).map(i=>typeof i=="object"?qa(i,t,r):typeof i=="string"?tt(i,t,r):i):typeof a[s]=="object"&&a[s]!==null&&!(a[s]instanceof Date)&&(a[s]=qa(a[s],t,r));}),a},ut=qa;});var Ul,Gl=b(()=>{c();Ul=e=>Array.isArray(e)?e.map(t=>typeof t=="string"?{allowed:"always",label:t,id:t}:{allowed:"always",label:t.id,...t}):[];});var Xg,_r,On=b(()=>{c();he();Xg=(e,t,r)=>{if(!r)return !1;if(e===Ce.SINGLE)return r.find(n=>n.id===t);let o=Array.isArray(t)?t:t.split(",");return Array.isArray(o)&&o.every(n=>r.map(a=>a.id).includes(n))},_r=Xg;});function mo(e,t,r,o,n=!1){let{variables:a}=ct(o),s=ut({logic:t},r,o).logic,i=wt("variables",a,s,r,void 0,o),{vars:l,log:u,error:p}=i,m=l.type||Ce.SINGLE,d=l.component||"Selector",f=l.hideLabel||"false",g=l.resetSectionVars||"false",y=l.name||"Unlabeled Selector",T=Ul(l.options||[]),C=z=>m===Ce.MULTI&&!Array.isArray(z)?[z]:z,N=l.defaultValue,R;if(N&&(N=C(N),_r(m,N,T)&&(R=N)),!R){let z=T&&T[0]&&T[0].id||T[0]||"";R=C(z);}if(n&&typeof window<"u"){let z=`selector${e}id`,q=new URLSearchParams(window.location.search),_=Object.fromEntries(q)[z];_&&!_r(m,_,T)&&_!==void 0&&(q.delete(z),window.history.replaceState(null,null,`?${q.toString()}`));}return {config:{name:y,type:m,options:T,defaultValue:R,component:d,hideLabel:f,resetSectionVars:g},log:u,error:p}}var Ha=b(()=>{c();uo();he();Uo();Or();Gl();On();});function ja(e,t,r){if(!e)return !1;let o=Array.isArray(r)?r:r.split(",");return Array.isArray(o)&&o.every(n=>e.map(a=>`${a[`${t} ID`]}`).includes(n))}var ql=b(()=>{c();});function fo(e,t,r,o,n=!1){let{variables:a}=ct(o),s=ut({logic:t},r,o).logic,i=wt("variables",a,s,r,void 0,o),{vars:l,log:u,error:p}=i;if(n&&typeof window<"u"){let d=`multihierarchySelector${e}-value`,f=`multihierarchySelector${e}-type`,g=new URLSearchParams(window.location.search),y=Object.fromEntries(g),T=y[d],C=y[f];T&&T!==void 0&&C&&C!==void 0&&!ja(l.data,C,T)&&(g.delete(d),g.delete(f),window.history.replaceState(null,null,`?${g.toString()}`));}return {config:l,log:u,error:p}}var Wa=b(()=>{c();ql();uo();Uo();Or();});var Qg,Hl,jl=b(()=>{c();he();Qg=(e,t,r)=>{let o=`selector${e}id`,n=new URLSearchParams(typeof location<"u"&&location?.search?location.search:"").get(o),a=new URLSearchParams(t).get(o),s=n||a;if(r.type===Ce.MULTI){let u=s?s.split(","):r.defaultValue,p=r.options.filter(m=>u.includes(m.id));return {[`selector${e}id`]:u,[`selector${e}label`]:(p||[]).map(m=>m.label)}}let i=s&&r.options.find(u=>u.id===s)?s:r.defaultValue,l=r.options.find(u=>u.id===i);return {[`selector${e}id`]:i,[`selector${e}label`]:l&&l.label||void 0}},Hl=Qg;});var Zg,Wl,Kl=b(()=>{c();Zg=(e,t,r)=>{let o=`multihierarchySelector${e}-value`,n=`multihierarchySelector${e}-type`,a=new URLSearchParams(typeof location<"u"&&location?.search?location.search:"").get(o),s=new URLSearchParams(typeof location<"u"&&location?.search?location.search:"").get(n),i=new URLSearchParams(t).get(o),l=new URLSearchParams(t).get(n),u=a||i,p=s||l,m=u?u.split(","):r.defaultValue||[],d=p||r.defaultValueType||"",f=r.data?.filter(g=>m.includes(`${g[`${d} ID`]}`))||[];return {[`multihierarchySelector${e}id`]:m,[`multihierarchySelector${e}label`]:[...new Set((f||[]).map(g=>g[d]))],[`multihierarchySelector${e}type`]:d}},Wl=Zg;});var Yl,Jg,eh,th,Be,Br=b(()=>{c();he();Ct();(({localeDefault:Yl,locales:Jg}=we())),eh=Object.values(za),th=(e,t=Yl)=>e&&eh.includes(e.type)?{locale:Ua,locales:[Ua]}:{locale:t,locales:Jg},Be=(e,t=Yl)=>{if(!e)return {};let{locale:r}=th(e,t);return e.contentByLocale?.[r]?.content};});function rh(e,t){let r=Object.values(t),o=r.filter(n=>n.shared&&n.section_id!==e).map(n=>n.id);return Object.fromEntries(r.filter(n=>n.section_id===e&&(n.inputs.length===0||n.inputs.some(a=>o.includes(a)))).map(n=>[n.id,n]))}var Xl,Ql=b(()=>{c();Xl=rh;});var Zl,Jl=b(()=>{c();Zl=(e,t)=>t&&typeof t=="string"?t.split(".").reduce((r,o)=>r[o],e):e;});var _n,ec,Ka=b(()=>{c();_n="|||",ec="SECTION_ALLOWED";});function Ya(e){return e.type===h.SECTION_FLAG&&e.inputs.length===0&&e.consumers.length===0}var tc=b(()=>{c();he();});function nh(){let{publicRuntimeConfig:e}=oh(),t=e.bespoke_report_env_vars||{};return {...Object.keys(t).reduce((r,o)=>(r[`ENV_${o}`]=t[o]||"N/A",r),{})}}var cr,Go=b(()=>{c();cr=nh;});function ah(){return typeof process>"u"?{}:Object.entries(process.env).filter(([e])=>e.startsWith("BESPOKE_SECRET_")).reduce((e,[t,r])=>({...e,[t.replace("BESPOKE_SECRET_","ENV_SECRET_")]:r}),{})}var rc,oc=b(()=>{c();rc=ah;});function Mn(e){return e.ok!==void 0}function Bn(e){this.message=e,this.name="ApiFetchException";}async function Xa(e,t,r="en",o,n){let a=Date.now(),s=e,i,l=cr(),u=rc(),p={envs:{...l,...u}},d=new URL(e).searchParams;if(d.has("bespoke_slugs")){let N=new RegExp(`[?&]bespoke_slugs=${d.get("bespoke_slugs")}`,"g");s=s.replace(N,"");}let f={datasource:void 0};o.find(N=>{if(!N.content?.pattern)return !1;try{let R=new RegExp(N.content.pattern,"gm");return R.test(s)?(f.datasource=N,!0):R.test(s)}catch{return !1}});let g=n?n.settings:{},y=!!(g&&g.useProxy&&g.useProxy==="true"),T=f.datasource&&typeof f.datasource.content.useProxy=="boolean"?f.datasource.content.useProxy:!1,C=`${process.env.NEXT_PUBLIC_REPORTS_BASE_URL}/api/cms/url/proxy?url=${encodeURIComponent(s)}`;if(typeof window=="object"&&(y||T)){let N=await ph({url:s,timeout:ac});if(N.ok===!0)i=N.data;else throw new Bn(N?.error)}else try{let R={url:s,timeout:ac};if(f.datasource){let q=await El({vars:["url","libs"],logic:f.datasource.content.logic},p)(s);if(q.axiosConfig)R=q.axiosConfig;else throw new Bn(`AxiosConfig is missing in Data Source ${f.datasource.name} (ID: ${f.datasource.id}).`)}let M=await Nn(R);if(M.status===200)M.headers["content-type"]==="text/csv"?i=csvParse(M.data):i=M.data;else throw new Bn("No response for: "+s)}catch(N){throw new Bn(N.message)}if(d.has("bespoke_slugs")){let N=d.get("bespoke_slugs");if(N){let R=N.split(",");if(R.length===3){let[M,z,q]=R,w=Zl(i,q);if(w&&Array.isArray(w)){let _=Array.from(new Set(w.map(A=>`${A[z]}`).filter(A=>!["","undefined"].includes(A))));if(_.length>0){let A=_.join("").length>2e3,O=await t({mode:A?"whole":"ids",ids:A?void 0:_,all:!1,locale:r,variant:[parseInt(M,10)],output:"lite",limit:_.length+1}).then(E=>{let k=[];return Mn(E)?E.ok&&(k=E.data.results):k=E.results,k&&Array.isArray(k)?k:[]}).catch(E=>(console.error(`Error hydrating slugs for Variant: ${M}, Key: ${z}, Accessor: ${q}`),console.error(` Url ${e}`),n&&console.error(` From Section ${n.section_id} and Block ${n.id}`),console.error(E),[]));if(O){let E=Object.fromEntries(O.map(k=>[k.id,`/${k.variant_slug}/${k.slug}`]));w.map(k=>(k.bespoke_slug=E[k[z]]?E[k[z]]:null,k));}}}}}}return {data:i,requestDuration:Date.now()-a,finalUrl:T||y?C:s,apiDataSource:f.datasource?f.datasource:!1}}function dh(e){this.name="BlockException",this.message=e;}async function sc(e,t,r,o,n){let{locale:a,variables:s,query:i}=ct(r),l=mh(e,r,s,t),u=null,p=e.contentByLocale?.logic?.content?.api,m=null,d=null,f=null,g=null,y=null;if(!l)return {outputVariables:{},renderVariables:{},status:{allowed:!1,hiddenByCascade:e.id}};if(e.type===h.FALLBACK)return {outputVariables:{},renderVariables:{},status:{allowed:l,hiddenByCascade:e.id}};if(p){f=uh(p,t,r);let w=f.split(_n).filter(O=>O!==""),_=[];for(let O=0;O<w.length;O++){let E=w[O];new RegExp("^(?:[a-z+]+:)?//","i").test(f)||(E=`${process.env.NEXT_PUBLIC_REPORTS_BASE_URL}/${E}`.replace(/([^:]\/)\/+/g,"$1")),_.push(Xa(E,o,a,n,e).catch(D=>{throw new dh(` Excecution of ${e.type}-${e.id} in section ${e.section_id} in report ${s.report_name} (${s.report_id}) failed.
49
49
  Error fetching ${E}.
50
50
  Message: ${D.message}.
@@ -53,7 +53,7 @@ var cg=Object.defineProperty;var b=(e,t)=>()=>(e&&(t=e(e=0)),t);var Na=(e,t)=>{f
53
53
  font-weight: bold;
54
54
  color: hsl(`+Math.max(0,Math.min(120-120*d,120))+"deg 100% 31%);",r?.key);}return r==null||r.onChange==null||r.onChange(a),a}}function ra(e,t){if(e===void 0)throw new Error("Unexpected undefined"+(t?": "+t:""));return e}var ap,sp=b(()=>{c();ap=function(t,r){return Math.abs(t-r)<1};});function Kv(e){for(var t=e.measurements,r=e.outerSize,o=e.scrollOffset,n=t.length-1,a=function(u){return t[u].start},s=pp(0,n,a,o),i=s;i<n&&t[i].end<o+r;)i++;return {startIndex:s,endIndex:i}}var jv,cn,ip,lp,Wv,cp,up,pp,Ys=b(()=>{c();np();sp();jv=function(t){return t},cn=function(t){for(var r=Math.max(t.startIndex-t.overscan,0),o=Math.min(t.endIndex+t.overscan,t.count-1),n=[],a=r;a<=o;a++)n.push(a);return n},ip=function(t,r){var o=t.scrollElement;if(o){var n=function(i){var l=i.width,u=i.height;r({width:Math.round(l),height:Math.round(u)});};n(o.getBoundingClientRect());var a=new ResizeObserver(function(s){var i=s[0];if(i!=null&&i.borderBoxSize){var l=i.borderBoxSize[0];if(l){n({width:l.inlineSize,height:l.blockSize});return}}n(o.getBoundingClientRect());});return a.observe(o,{box:"border-box"}),function(){a.unobserve(o);}}},lp=function(t,r){var o=t.scrollElement;if(o){var n=function(){r(o[t.options.horizontal?"scrollLeft":"scrollTop"]);};return n(),o.addEventListener("scroll",n,{passive:!0}),function(){o.removeEventListener("scroll",n);}}},Wv=function(t,r,o){if(r!=null&&r.borderBoxSize){var n=r.borderBoxSize[0];if(n){var a=Math.round(n[o.options.horizontal?"inlineSize":"blockSize"]);return a}}return Math.round(t.getBoundingClientRect()[o.options.horizontal?"width":"height"])},cp=function(t,r,o){var n,a,s=r.adjustments,i=s===void 0?0:s,l=r.behavior,u=t+i;(n=o.scrollElement)==null||n.scrollTo==null||n.scrollTo((a={},a[o.options.horizontal?"left":"top"]=u,a.behavior=l,a));},up=function(t){var r=this;this.unsubs=[],this.scrollElement=null,this.isScrolling=!1,this.isScrollingTimeoutId=null,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollDirection=null,this.scrollAdjustments=0,this.measureElementCache=new Map,this.observer=function(){var o=null,n=function(){return o||(typeof ResizeObserver<"u"?o=new ResizeObserver(function(s){s.forEach(function(i){r._measureElement(i.target,i);});}):null)};return {disconnect:function(){var s;return (s=n())==null?void 0:s.disconnect()},observe:function(s){var i;return (i=n())==null?void 0:i.observe(s,{box:"border-box"})},unobserve:function(s){var i;return (i=n())==null?void 0:i.unobserve(s)}}}(),this.range={startIndex:0,endIndex:0},this.setOptions=function(o){Object.entries(o).forEach(function(n){var a=n[0],s=n[1];typeof s>"u"&&delete o[a];}),r.options=ln({debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:jv,rangeExtractor:cn,onChange:function(){},measureElement:Wv,initialRect:{width:0,height:0},scrollMargin:0,scrollingDelay:150,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1},o);},this.notify=function(){r.options.onChange==null||r.options.onChange(r);},this.cleanup=function(){r.unsubs.filter(Boolean).forEach(function(o){return o()}),r.unsubs=[],r.scrollElement=null;},this._didMount=function(){return r.measureElementCache.forEach(r.observer.observe),function(){r.observer.disconnect(),r.cleanup();}},this._willUpdate=function(){var o=r.options.getScrollElement();r.scrollElement!==o&&(r.cleanup(),r.scrollElement=o,r._scrollToOffset(r.scrollOffset,{adjustments:void 0,behavior:void 0}),r.unsubs.push(r.options.observeElementRect(r,function(n){var a=r.scrollRect;r.scrollRect=n,(r.options.horizontal?n.width!==a.width:n.height!==a.height)&&r.maybeNotify();})),r.unsubs.push(r.options.observeElementOffset(r,function(n){r.scrollAdjustments=0,r.scrollOffset!==n&&(r.isScrollingTimeoutId!==null&&(clearTimeout(r.isScrollingTimeoutId),r.isScrollingTimeoutId=null),r.isScrolling=!0,r.scrollDirection=r.scrollOffset<n?"forward":"backward",r.scrollOffset=n,r.maybeNotify(),r.isScrollingTimeoutId=setTimeout(function(){r.isScrollingTimeoutId=null,r.isScrolling=!1,r.scrollDirection=null,r.maybeNotify();},r.options.scrollingDelay));})));},this.getSize=function(){return r.scrollRect[r.options.horizontal?"width":"height"]},this.memoOptions=Zr(function(){return [r.options.count,r.options.paddingStart,r.options.scrollMargin,r.options.getItemKey]},function(o,n,a,s){return r.pendingMeasuredCacheIndexes=[],{count:o,paddingStart:n,scrollMargin:a,getItemKey:s}},{key:!1}),this.getFurthestMeasurement=function(o,n){for(var a=new Map,s=new Map,i=n-1;i>=0;i--){var l=o[i];if(!a.has(l.lane)){var u=s.get(l.lane);if(u==null||l.end>u.end?s.set(l.lane,l):l.end<u.end&&a.set(l.lane,!0),a.size===r.options.lanes)break}}return s.size===r.options.lanes?Array.from(s.values()).sort(function(p,m){return p.end-m.end})[0]:void 0},this.getMeasurements=Zr(function(){return [r.memoOptions(),r.itemSizeCache]},function(o,n){var a=o.count,s=o.paddingStart,i=o.scrollMargin,l=o.getItemKey,u=r.pendingMeasuredCacheIndexes.length>0?Math.min.apply(Math,r.pendingMeasuredCacheIndexes):0;r.pendingMeasuredCacheIndexes=[];for(var p=r.measurementsCache.slice(0,u),m=u;m<a;m++){var d=l(m),f=r.options.lanes===1?p[m-1]:r.getFurthestMeasurement(p,m),g=f?f.end:s+i,y=n.get(d),T=typeof y=="number"?y:r.options.estimateSize(m),C=g+T,N=f?f.lane:m%r.options.lanes;p[m]={index:m,start:g,size:T,end:C,key:d,lane:N};}return r.measurementsCache=p,p},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:function(){return r.options.debug}}),this.calculateRange=Zr(function(){return [r.getMeasurements(),r.getSize(),r.scrollOffset]},function(o,n,a){return r.range=Kv({measurements:o,outerSize:n,scrollOffset:a})},{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:function(){return r.options.debug}}),this.maybeNotify=Zr(function(){var o=r.calculateRange();return [o.startIndex,o.endIndex,r.isScrolling]},function(){r.notify();},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:function(){return r.options.debug},initialDeps:[this.range.startIndex,this.range.endIndex,this.isScrolling]}),this.getIndexes=Zr(function(){return [r.options.rangeExtractor,r.calculateRange(),r.options.overscan,r.options.count,r.getSize()]},function(o,n,a,s,i){return i===0?[]:o(ln({},n,{overscan:a,count:s}))},{key:process.env.NODE_ENV!=="production"&&"getIndexes",debug:function(){return r.options.debug}}),this.indexFromElement=function(o){var n=r.options.indexAttribute,a=o.getAttribute(n);return a?parseInt(a,10):(console.warn("Missing attribute name '"+n+"={index}' on measured element."),-1)},this._measureElement=function(o,n){var a=r.measurementsCache[r.indexFromElement(o)];if(!a||!o.isConnected){r.measureElementCache.forEach(function(l,u){l===o&&(r.observer.unobserve(o),r.measureElementCache.delete(u));});return}var s=r.measureElementCache.get(a.key);s!==o&&(s&&r.observer.unobserve(s),r.observer.observe(o),r.measureElementCache.set(a.key,o));var i=r.options.measureElement(o,n,r);r.resizeItem(a,i);},this.resizeItem=function(o,n){var a,s=(a=r.itemSizeCache.get(o.key))!=null?a:o.size,i=n-s;i!==0&&(o.start<r.scrollOffset&&(process.env.NODE_ENV!=="production"&&r.options.debug&&console.info("correction",i),r._scrollToOffset(r.scrollOffset,{adjustments:r.scrollAdjustments+=i,behavior:void 0})),r.pendingMeasuredCacheIndexes.push(o.index),r.itemSizeCache=new Map(r.itemSizeCache.set(o.key,n)),r.notify());},this.measureElement=function(o){o&&r._measureElement(o,void 0);},this.getVirtualItems=Zr(function(){return [r.getIndexes(),r.getMeasurements()]},function(o,n){for(var a=[],s=0,i=o.length;s<i;s++){var l=o[s],u=n[l];a.push(u);}return a},{key:process.env.NODE_ENV!=="production"&&"getIndexes",debug:function(){return r.options.debug}}),this.getVirtualItemForOffset=function(o){var n=r.getMeasurements();return ra(n[pp(0,n.length-1,function(a){return ra(n[a]).start},o)])},this.getOffsetForAlignment=function(o,n){var a=r.getSize();n==="auto"&&(o<=r.scrollOffset?n="start":o>=r.scrollOffset+a?n="end":n="start"),n==="start"?o=o:n==="end"?o=o-a:n==="center"&&(o=o-a/2);var s=r.options.horizontal?"scrollWidth":"scrollHeight",i=r.scrollElement?"document"in r.scrollElement?r.scrollElement.document.documentElement[s]:r.scrollElement[s]:0,l=i-r.getSize();return Math.max(Math.min(l,o),0)},this.getOffsetForIndex=function(o,n){n===void 0&&(n="auto"),o=Math.max(0,Math.min(o,r.options.count-1));var a=ra(r.getMeasurements()[o]);if(n==="auto")if(a.end>=r.scrollOffset+r.getSize()-r.options.scrollPaddingEnd)n="end";else if(a.start<=r.scrollOffset+r.options.scrollPaddingStart)n="start";else return [r.scrollOffset,n];var s=n==="end"?a.end+r.options.scrollPaddingEnd:a.start-r.options.scrollPaddingStart;return [r.getOffsetForAlignment(s,n),n]},this.isDynamicMode=function(){return r.measureElementCache.size>0},this.cancelScrollToIndex=function(){r.scrollToIndexTimeoutId!==null&&(clearTimeout(r.scrollToIndexTimeoutId),r.scrollToIndexTimeoutId=null);},this.scrollToOffset=function(o,n){var a=n===void 0?{}:n,s=a.align,i=s===void 0?"start":s,l=a.behavior;r.cancelScrollToIndex(),l==="smooth"&&r.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),r._scrollToOffset(r.getOffsetForAlignment(o,i),{adjustments:void 0,behavior:l});},this.scrollToIndex=function(o,n){var a=n===void 0?{}:n,s=a.align,i=s===void 0?"auto":s,l=a.behavior;o=Math.max(0,Math.min(o,r.options.count-1)),r.cancelScrollToIndex(),l==="smooth"&&r.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");var u=r.getOffsetForIndex(o,i),p=u[0],m=u[1];r._scrollToOffset(p,{adjustments:void 0,behavior:l}),l!=="smooth"&&r.isDynamicMode()&&(r.scrollToIndexTimeoutId=setTimeout(function(){r.scrollToIndexTimeoutId=null;var d=r.measureElementCache.has(r.options.getItemKey(o));if(d){var f=r.getOffsetForIndex(o,m),g=f[0];ap(g,r.scrollOffset)||r.scrollToIndex(o,{align:m,behavior:l});}else r.scrollToIndex(o,{align:m,behavior:l});}));},this.scrollBy=function(o,n){var a=n===void 0?{}:n,s=a.behavior;r.cancelScrollToIndex(),s==="smooth"&&r.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),r._scrollToOffset(r.scrollOffset+o,{adjustments:void 0,behavior:s});},this.getTotalSize=function(){var o;return (((o=r.getMeasurements()[r.options.count-1])==null?void 0:o.end)||r.options.paddingStart)-r.options.scrollMargin+r.options.paddingEnd},this._scrollToOffset=function(o,n){var a=n.adjustments,s=n.behavior;r.options.scrollToFn(o,{behavior:s,adjustments:a},r);},this.measure=function(){r.itemSizeCache=new Map,r.notify();},this.setOptions(t),this.scrollRect=this.options.initialRect,this.scrollOffset=this.options.initialOffset,this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(function(o){r.itemSizeCache.set(o.key,o.size);}),this.maybeNotify();},pp=function(t,r,o,n){for(;t<=r;){var a=(t+r)/2|0,s=o(a);if(s<n)t=a+1;else if(s>n)r=a-1;else return a}return t>0?t-1:0};});function Xv(e){var t=Jt.useReducer(function(){return {}},{})[1],r=sn({},e,{onChange:function(s){t(),e.onChange==null||e.onChange(s);}}),o=Jt.useState(function(){return new up(r)}),n=o[0];return n.setOptions(r),Jt.useEffect(function(){return n._didMount()},[]),Yv(function(){return n._willUpdate()}),n}function oa(e){return Xv(sn({observeElementRect:ip,observeElementOffset:lp,scrollToFn:cp},e))}var Yv,Xs=b(()=>{c();op();Ys();Ys();Yv=typeof document<"u"?Jt.useLayoutEffect:Jt.useEffect;});function Qs(e,t,r,o,n=!1){let a=useRouter(),{query:s,locale:i}=a,l=X(k=>k),u=useDispatch(),p=Qe(),m=X(k=>o&&p.variables?p?.variables?.attributes:k.variables.attributes),d=Mt(l),f=fr(l),g=gr(l),y=At(f,i),T=So(e,o&&p.active?p?.variables.variables:void 0,o&&p.active?p?.variables.attributes:void 0),C=X(k=>o?p.variables.variables:k.variables.variables),N=X(k=>o?p.variables.status:k.variables.status),R=Vt(),{sectionVariables:M,resetSectionVariables:z}=Pe(t),{addRunConsumersRunning:q,removeRunConsumersRunning:w}=To(),_=o&&p.active?`${r}-valueCompare`:`${r}-value`,A=o&&p.active?`${r}-typeCompare`:`${r}-type`,O=o&&p.active?Object.fromEntries(Object.entries(s).filter(([k])=>k.match(eS)).map(([k,D])=>[k.replace("Compare",""),D])):Object.fromEntries(Object.entries(s).filter(([k])=>k.match(tS)).map(([k,D])=>[k.replace("Compare",""),D]));return useCallback((k,D)=>{let V={locale:i,query:{...O,[`${r}-type`]:D,[`${r}-value`]:k},variables:T},P=new URLSearchParams(window.location.search);k&&D?(P.set(_,k.join(",")),P.set(A,D)):(P.delete(_),P.delete(A)),window.history.replaceState(null,null,`?${P.toString()}`),q([t]),Pt(d,void 0,e,y,V,{variables:C,status:N},R,"report",g).then(U=>{n&&M&&z(),p.active&&o?p.setComparisonVariables({attributes:m,variables:U.variables,status:U.status}):u(ur.setVariableChange({attributes:m,variables:U.variables,status:U.status})),w([t]);});},[o,m,e,d,p,u,y,N,C,i,O,R,r,A,_,T,M,n,z])}var eS,tS,dp=b(()=>{c();Zt();Co();Nr();ge();Ee();ir();hr();ho();eS=/\w*Compare\b/,tS=/multihierarchySelector\d+(id|-(type|value))/;});function ei(e){let{allLabel:t,asComparison:r,colorKey:o,data:n,defaultValue:a,defaultValueType:s,hideLabel:i,resetSectionVars:l,iconKey:u,id:p,levels:m,limit:d,placeholder:f,searchIndexKey:g,searchIndexSeparator:y,section:T,settings:C}=e,{print:N}=qe(),R=gS(p),M=Qs(p,T,R,r,l==="true"),z=r?`${R}-valueCompare`:`${R}-value`,q=r?`${R}-typeCompare`:`${R}-type`,w=useMantineTheme(),[_,A]=useState(!1),[O,E]=useState(!0),[k,D]=useState(""),[V,P]=useState(!1),[U,ee]=useState([""].slice(1)),[L,Q]=useState([]),[H,ie]=useState(""),j=useMemo(()=>N?Array.from(new Set(n.filter(ne=>L.includes(ne[`${H} ID`])))).map(ne=>ne?.[H]).join(", "):"",[N]),oe=i==="true"||!e.label?jsx(Fragment,{}):jsx(se,{component:"div",html:e.label,size:"sm",style:C}),J=useRef(null),K=useRef(!1),$=useRef(!!d&&d<L.length),x=U.length,I=m[x],W=U.filter(Boolean);U.length>0&&W.length===0&&W.push(`${t} ${I?.label}`),useEffect(()=>{let B=new URLSearchParams(window.location.search),ne=B.get(z)||a,re=B.get(q)||s;ne&&re?(Q(hS(ne,a)),ie(re)):(Q([]),ie(""));},[window.location.search,a,s]),useEffect(()=>{let B=()=>{E(!0);};return window.addEventListener("touchmove",B),()=>{window.removeEventListener("touchmove",B);}},[]);let te=useMemo(()=>dS(n,m,o,u,g,y),[o,n,u,m,g,y]),Y=useMemo(()=>{let B=mS(k),ne=Array.from(fS(te,B)).reverse();return V?ne:U.reduce((re,We)=>re.filter(be=>!We||be.searchindex.indexOf(We)>-1),ne.filter(re=>re.type===I?.value))},[I,te,k,V,U]),le=useRef(null),de=oa({count:_?Y.length:0,estimateSize:()=>30,getScrollElement:useCallback(()=>le.current,[]),overscan:10,rangeExtractor:useCallback(B=>cn(B),[])}),[ze,ye]=useState(-1),ve=Math.min(ze,Y.length-1),Je=useCallback(B=>{let ne=U.concat(B);V&&P(!1),ee(ne);},[V,U]),et=useCallback(()=>{let B=U.slice(0,x-1);V&&P(!1),ee(B);},[V,U,x]),it=useCallback(B=>{D(B.currentTarget.value),!$.current&&n.length>0&&A(!0);},[n,D,$,A]),Cr=useCallback(()=>{D(""),M([],""),J.current?.focus(),d&&($.current=!1);},[D,M,J,d,$]),Ht=useCallback(B=>{let ne=L.filter(re=>re!==B);ne.length>0?M(ne,H):M([],""),d&&ne.length<d&&($.current=!1);},[L,H,M,d,$]),lt=useCallback(B=>{H!==B.type?M([B.value],B.type):L.includes(B.value)?Ht(B.value):d?(L.length<d&&M([...L,B.value],H),L.length===d&&M([...L.slice(1),B.value],H)):M([...L,B.value],H),D("");},[M,H,L,Ht,d]),or=useCallback(()=>{L.length>0&&k.length===0&&(M(L.slice(0,-1),H),A(!0),d&&($.current=!1)),k.length>0&&D(k.slice(0,-1));},[M,L,H,k,D,A,d,$]),nr=useCallback(()=>{E(B=>B&&(K.current=B,!B)),ye(B=>B+1>=Y.length?B:B+1);},[ye,Y]),Ar=useCallback(()=>{let B=Y[ve];B&&lt(B);},[Y,ve,lt]),no=useCallback(()=>{A(!1);},[A]),_e=useCallback(()=>{et(),ye(0);},[ye,et]),ao=useCallback(()=>{let B=Y[ve];!V&&B&&B.type!==m[m.length-1]?.value&&(Je(B.name),ye(0));},[Y,ve,V,m,ye,Je]),so=useCallback(()=>{E(B=>B&&(K.current=B,!B)),ye(B=>B-1<0?0:B-1);},[ye]),ar=({label:B,onRemove:ne,...re})=>jsxs("div",{style:{alignItems:"center",backgroundColor:w.colorScheme==="dark"?w.colors.dark[7]:w.colors.gray[1],borderRadius:w.radius.sm,cursor:"default",color:w.colorScheme==="dark"?w.colors.dark[0]:w.colors.gray[7],display:"flex",fontSize:rem(12),fontWeight:500,height:rem(22),margin:`calc(${w.spacing.xs} / 2 - ${rem(2)}) calc(${w.spacing.xs} / 2)`,maxWidth:`calc(100% - ${rem(10)})`,paddingLeft:`calc(${w.spacing.sm} / 1.5)`,paddingRight:0,userSelect:"none"},...re,children:[jsx("span",{style:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:B}),jsx(CloseButton,{"aria-hidden":!0,iconSize:"70%",onMouseDown:ne,radius:2,size:"sm",sx:{color:w.colorScheme==="dark"?w.colors.dark[0]:w.colors.gray[7],marginLeft:`calc(${w.spacing.sm} / 6)`},tabIndex:-1})]}),F=useMemo(()=>L.map(B=>te.find(ne=>ne.value===B)).filter(B=>!!B).map((B,ne)=>createElement(ar,{...B,index:ne,label:B.label,key:B.value,onRemove:re=>{re.preventDefault(),re.stopPropagation(),Ht(B.value);}})),[L]),ce=forwardRef(function({color:ne,icon:re,label:We,value:be,...Ma},lg){return jsx("div",{ref:lg,style:{cursor:"pointer",width:"100%"},...Ma,children:jsxs(Group,{align:"center",noWrap:!0,spacing:"xs",w:"100%",children:[re&&jsx(Box,{bg:ne??"transparent",component:"img",w:20,h:20,src:re}),jsx(Text,{lineClamp:1,size:"sm",children:We||be})]})})});return jsxs(Fragment,{children:[jsx(MediaQuery,{query:"print",styles:{display:"none"},children:jsx(Input.Wrapper,{label:oe,children:jsxs(Popover,{closeOnClickOutside:!0,keepMounted:!0,opened:_,onChange:A,onClose:()=>{ye(0),D("");},onOpen:()=>{Y.length>0&&de.scrollToIndex(0);},shadow:"sm",width:"target",withinPortal:!0,children:[jsx(Popover.Target,{children:jsxs(Box,{"aria-haspopup":"listbox",component:"div",onMouseLeave:()=>ye(0),sx:{position:"relative","& .defaultValue":{backgroundColor:w.colorScheme==="dark"?w.colors.dark[5]:w.colors.gray[3],color:w.colorScheme==="dark"?w.colors.dark[1]:w.colors.gray[7]}},tabIndex:-1,children:[jsx("input",{type:"hidden",value:L.join(",")}),jsx(Input,{component:"div",multiline:!0,onMouseDown:B=>{B.preventDefault(),!$.current&&n.length>0&&A(!_),J.current?.focus();},rightSection:L.length>0?jsx(CloseButton,{onClick:Cr,onMouseDown:B=>B.preventDefault(),variant:"transparent"}):jsx(IconSelector,{color:w.colors.gray[6],size:18,stroke:1.5}),style:{overflow:"hidden"},w:"100%",children:jsxs(Box,{component:"div","data-clearable":!0,sx:{alignItems:"center",boxSizing:"border-box",display:"flex",flexWrap:"wrap",marginLeft:`calc(-${w.spacing.xs} / 2)`,minHeight:`calc(${rem(36)} - ${rem(2)})`,"&[data-clearable]":{marginRight:rem(36)},"&::placeholder":{color:w.colorScheme==="dark"?w.colors.dark[3]:w.colors.gray[5],opacity:1}},children:[F,jsx("input",{autoComplete:"off","data-mantine-stop-propagation":_,onChange:it,onKeyDown:getHotkeyHandler([["ArrowDown",nr],["ArrowLeft",_e],["ArrowRight",ao],["ArrowUp",so],["Backspace",or],["Enter",Ar],["Escape",no]]),placeholder:L.length===0&&f||"",ref:J,readOnly:$.current,style:{appearance:"none",backgroundColor:"transparent",border:0,color:"inherit",flex:1,fontSize:w.fontSizes.sm,marginLeft:`calc(${w.spacing.xs} / 2)`,maxHeight:rem(22),minWidth:rem(60),outline:0,padding:0},type:"search",value:k})]})})]})}),jsx(Popover.Dropdown,{onMouseDown:B=>B.preventDefault(),p:0,children:jsx("div",{style:{display:"flex",maxHeight:rem(300)},children:jsx(Box,{component:"div","data-combobox-popover":!0,onMouseDown:B=>B.preventDefault(),role:"listbox",sx:{width:"100%"},tabIndex:-1,children:jsxs(Stack,{h:"100%",py:"xs",spacing:"xs",w:"100%",children:[m.length>1&&jsxs(Stack,{spacing:"xs",children:[jsxs(Group,{onClick:B=>{B.stopPropagation();},px:"xs",position:"center",spacing:"xs",children:[jsx(Button,{onClick:()=>{ye(0),P(!0),ee([]),Y.length>0&&de.scrollToIndex(0);},size:"xs",variant:V?"filled":"outline",children:t}),m.map((B,ne)=>jsx(Button,{onClick:()=>{V&&P(!1);let re=[""].slice(1),We=ne;for(;We--;)re[We]=U[We]||"";ye(0),ee(re),Y.length>0&&de.scrollToIndex(0);},size:"xs",variant:!V&&U.length===m.findIndex(re=>re.value===B?.value)?"filled":"outline",children:B?.label},B?.value))]}),jsx(Divider,{})]}),x>0&&jsxs(Group,{align:"center",noWrap:!0,px:"xs",children:[jsx(ActionIcon,{onClick:et,size:"sm",children:jsx(IconChevronLeft,{})}),jsx("div",{children:W.map(B=>jsx(Text,{lineClamp:1,size:"xs",children:B},`${B}`))})]}),jsx(ScrollArea,{mah:250,onWheel:()=>E(!0),px:"xs",style:{overflow:"auto",width:"100%"},viewportRef:le,viewportProps:{tabIndex:-1},w:"100%",children:jsx("div",{style:{height:`${de.getTotalSize()}px`,position:"relative",width:"100%"},children:de.getVirtualItems().map(B=>{let ne=Y[B.index],re=ve===B.index,We=L.includes(ne.value);return Y.length>0&&re&&!O&&de.scrollToIndex(ve),jsxs(Group,{"aria-selected":re,align:"center","data-hovered":re||void 0,"data-index":B.index,"data-selected":We,id:ne.vale,noWrap:!0,onMouseEnter:be=>{be.preventDefault(),be.stopPropagation(),O&&(ye(B.index),E(!1));},onMouseMove:be=>{be.preventDefault(),be.stopPropagation(),E(!0);},onMouseDown:be=>{be.preventDefault(),lt(ne);},position:"apart",ref:de.measureElement,role:"option",spacing:"xs",sx:be=>({borderRadius:be.radius.xs,padding:"15px 5px 15px",paddingLeft:V&&10*m.findIndex(Ma=>Ma?.value===ne.type)||5,position:"absolute",top:0,left:0,height:`${B.size}px`,transform:`translateY(${B.start}px)`,width:"100%","&[data-hovered]":{backgroundColor:be.colorScheme==="dark"?be.colors.dark[4]:be.colors.gray[1]},"&:hover":{backgroundColor:be.colorScheme==="dark"?be.colors.dark[4]:be.colors.gray[1]}}),tabIndex:-1,children:[jsx(ce,{index:B.index,...ne}),!V&&ne.type!==m[m.length-1]?.value&&jsx(ActionIcon,{onMouseDown:be=>{be.preventDefault(),be.stopPropagation(),Je(ne.name);},size:"sm",tabIndex:-1,children:jsx(IconChevronRight,{})})]},ne.value)})})})]})})})})]})})}),N&&jsxs(Text,{children:[oe,": ",j]})]})}var dS,mS,fS,gS,hS,Sp=b(()=>{c();Xs();Ie();Qt();dp();dS=(e=[],t=[],r="",o="",n="",a="|")=>{let s=t.map(y=>y.value).slice(),i=`${s.pop()}`,l=y=>y[r],u=y=>y[o],p=y=>{if(y[n])return typeof y[n]=="string"?y[n].split(a):y[n]},m=new Set,d=[],f=[],g=nest().rollup(y=>{let T=y[0],C=A=>A&&A.value&&!m.has(A.value),N=s.map(A=>T[`${A} ID`]),R=s.map(A=>T[A]),M=s.map((A,O)=>{if(f[O]!==R[O]){f[O]=R[O];let E=l[O]||l[l.length-1]||l,k=u[O]||u[u.length-1]||u,D=p[O]||p[p.length-1]||p;return {color:E(T,A)||void 0,icon:k(T,A)||void 0,value:`${N[O]}`,label:R[O],name:R[O],type:A,searchindex:R.slice(0,O+1).concat(D(T,A)).join("|")}}return {}}).filter(C);M.forEach(A=>m.add(A.value));let z=l[l.length-1]||l,q=u[u.length-1]||u,w=p[p.length-1]||p,_=y.map(A=>({color:z(A,i)||void 0,icon:q(A,i)||void 0,value:`${A[`${i} ID`]}`,label:A[i],name:A[i],type:i,searchindex:R.concat(A[i]).concat(w(A,i)).join("|")}));d.push(...M.concat(_));});return s.forEach(y=>{g.key(T=>`${T[`${y} ID`]}|${T[y]}`);}),g.entries(e),d},mS=e=>{if(!e)return /./i;let t=e.normalize("NFD").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g,"[^|]+");return RegExp(t,"i")},fS=(e,t)=>{let r=e.length,o,n=i=>o&&o.searchindex.includes(i.searchindex),s={next:()=>{for(let i=r-1;i>-1;i--){let l=e[i];if(t.test(`${l.value} ${l.label} ${l.searchindex}`)||n(l))return o=l,r=i,{done:!1,value:l}}return {done:!0,value:void 0}},[Symbol.iterator]:()=>s};return s},gS=e=>`multihierarchySelector${e}`,hS=(e,t)=>e&&typeof e=="string"?e.split(","):t;});function vS(e={required:!1}){let{update:t,data:r,status:o}=useSession(e);return {update:t,user:r?.user,status:o,isLoading:o==="loading"}}var Tp,xp=b(()=>{c();Tp=vS;});function la(e){let{asPath:t,locale:r,defaultLocale:o}=useRouter(),[n,a]=useState(!0),{user:s,isLoading:i}=Tp(),[l,u]=useState({resolved:!1,blocks:[]}),p=Ye(),[,m]=t.split("?"),d=m?Object.fromEntries(new URLSearchParams(`?${m}`)):{},f=X(E=>E),g=xs().data,y=g&&g[0].id,T=X(E=>E.variables.attributes),C=Mt(f),N=fr(f),R=gr(f),M=At(N,r),z=X(E=>E.variables.variables),q=X(E=>E.variables.status),w=Vt(),{addRunConsumersRunning:_,removeRunConsumersRunning:A}=To(),O=useMemo(()=>Object.keys(T).filter(E=>E.startsWith("id")).map(E=>T[E]).join("-"),[T]);return useEffect(()=>{if(l.blocks.length>0&&p(nt.removeBlocksFromState(l.blocks)).then(()=>{u({resolved:!1,blocks:[]});}),l.blocks.length>0&&u({resolved:!1,blocks:[]}),!i&&s&&y){let E=Object.keys(Object.values(C).reduce((k,D)=>(D.type!=="fallback"?k[D.section_id]=!0:k[D.section_id]=!1,k),{})).map(k=>parseInt(k,10));p(nt.readPrivateBlocks({report_id:y,locale:r||o||"en",section_id:E})).then(k=>{if(k.data&&k.data.length){let D=k.data.reduce((V,P)=>({...V,[P.id]:P}),[]);p(nt.addBlockToState(D)).then(()=>{u({resolved:!0,blocks:k.data.map(V=>V.id)});});}u({resolved:!0,blocks:[]}),a(!1);}).catch(()=>{u({resolved:!0,blocks:[]}),a(!1);});}!i&&!s&&(u({resolved:!0,blocks:[]}),a(!1));},[O,s,i,y]),useEffect(()=>{if((Object.keys(d).some(k=>k!==e)||l.blocks.length>0)&&l.resolved){let k=Object.keys(d).map(H=>Number(H.match(/\d+/))).filter(H=>C[H]),D=Array.from(new Set(k.filter(H=>H!==0).concat(l.blocks))),V={...f.variables},P=[],U=[];D.forEach(H=>{let ie=C[H];Dn(ie,C,H,P,!0,!0,U);});let ee={},L=D.filter(H=>(ee[C[H].section_id]=!0,!U.includes(H))),Q=Object.keys(ee).map(H=>parseInt(H,10));_(Q),Promise.all(L.map(H=>{let j=C[H].consumers.reduce((J,K)=>({...J,...z[K]}),{}),oe={locale:ht,query:d,variables:{...j,...T}};return Pt(C,void 0,H,M,oe,{variables:z,status:q},w,"report",R)})).then(H=>(H.forEach((ie,j)=>{let oe=L[j],J=C[oe],K=[],$=[];Dn(J,C,oe,K,!0,!0,$);let x={},I={};$.forEach(W=>{x[W]=ie.status[W],I[W]=ie.variables[W];}),V.status={...V.status,...x,[oe]:{...ie.status[oe]}},V.variables={...V.variables,...I,[oe]:{...ie.variables[oe]}};}),V)).then(H=>{p(ur.setVariableChange({...H,attributes:T})),A(Q);});}},[l.resolved]),n||!l.resolved}var kp=b(()=>{c();ge();hr();hr();ir();Vn();Nr();xp();ge();ho();Co();Ee();});function ca(){let e=useRouter(),t=useRef(!1),r=500;useEffect(()=>{let o=()=>{let{asPath:a}=e;if(!t.current&&a.includes("#")){let s=a.split("#")[1],i=document.getElementById(s);i&&(t.current=!0,setTimeout(()=>{i.scrollIntoView({behavior:"smooth"}),t.current=!1;},r));}};o();let n=()=>{o();};return e.events.on("hashChangeComplete",n),()=>{e.events.off("hashChangeComplete",n);}},[e]);}var ti=b(()=>{c();});function CS(e,t){let r=[],o={},n=1/0;for(let a of e){let s=parseInt(a.settings.order);s<n&&(n=s);}for(let a of e){let{id:s,settings:i}=a,l=parseInt(i.order),u=t[s]?t[s]:!1,p=kS(u,s),m={id:s,order:l,label:t[s]?t[s][`title${s}title`]:`Title ${s}`,iconProps:p,children:[]};if(o[s]=m,l===n)r.push(m);else {let d=l-1,f;for(let g=e.indexOf(a)-1;g>=0;g--){let y=e[g],T=parseInt(y.settings.order);if(T===d){f=o[y.id];break}else if(T<d){f=o[y.id];break}}f?f.children.push(m):r.push(m);}}return r}function Ao(e=1,t=6,r=[]){let o=X(d=>d),n=X(d=>d.variables.variables),a=X(d=>d.variables.status),s=Jo(),i=jc(o).filter(d=>d.type===h.TITLE&&r.includes(d.id)),l=Object.fromEntries(i.map(d=>[d.id,d])),u=Object.fromEntries(i.map(d=>[d.id,n[d.id]])),p=Object.fromEntries(i.map(d=>[d.id,a[d.id]])),m=useMemo(()=>{if(s.isSuccess&&l){let d=[];return s.data.sort(Ke).forEach(f=>{let g=f.blocks.reduce((y,T)=>l[T]&&l[T].type===h.TITLE?y.concat([l[T]]):y,[]);d=d.concat(g.sort((y,T)=>Ke(y,T,"blockrow")));}),Object.keys(a).length?d.filter(f=>{let g=parseInt(f.settings.order||"1",10);return g>=e&&g<=t&&p[f.id]?.allowed&&!p[f.id]?.hiddenByCascade}):[]}},[r,s,l,p]);return useMemo(()=>m&&m?.length>0?CS(m,u):[],[m,u])}var kS,ri=b(()=>{c();ge();hr();io();he();kS=(e,t)=>({iconType:e[`title${t}_iconType`],icon:e[`title${t}_icon`],iconSize:e[`title${t}_iconSize`],iconVariant:e[`title${t}_iconVariant`],iconRadius:e[`title${t}_iconRadius`]});});var oi=b(()=>{c();kp();Gs();ti();ri();});function un(){let e=useContext(Ap);if(e===void 0)throw new Error("usePdf must be used within a PdfProvider");return e}function ni({children:e}){let{query:t}=useRouter(),o=X(a=>Object.values(a.records.entities.report)[0]).settings,n=qg(t.print)??!1;return jsx(Ap.Provider,{value:{active:o.pdf||!1,pdfParam:n,position:o.position||"DEFAULT",XlsxVizActive:o.XlsxViz||!1},children:e})}var LS,Ap,ua=b(()=>{c();ge();LS={active:!1,pdfParam:!1,position:"DEFAULT",XlsxVizActive:!1},Ap=createContext(LS);});var ai=b(()=>{c();ge();});var wp=b(()=>{c();});var si=b(()=>{c();Wt();});var Ip=b(()=>{c();ge();si();});var ii=b(()=>{c();si();Ip();ri();});function pa(e,t){return e===t}var li=b(()=>{c();Ee();ai();wp();ii();});var _p,ma,Bp,fa=b(()=>{c();_p=(e,t,r,o=null)=>{let[n,a]=useState(!1),[s,i]=useState(null);return {print:u=>{a(!0),i(null);let p=process.env.NEXT_PUBLIC_REPORTS_BASE_URL,m=new URLSearchParams(window.location.search),d=u?"&transparent=true":"",f=o?`/embeds/${t}/${r}?section=${e}&block=${o}${m.toString()?"&"+m.toString():""}`:`/embeds/${t}/${r}?section=${e}${m.toString()?"&"+m.toString():""}`,g=encodeURIComponent(`${p}${f}&print=true`);Nn.get(`${process.env.NEXT_PUBLIC_PDF_API_URL}/screenshot?url=${g}${d}`,{responseType:"blob"}).then(y=>{let T=o?`section${e}_block${o}.png`:`section${e}.png`;saveAs(y.data,T);}).catch(y=>{i(y.response?.data?.message||"Failed to download image. Please try again.");}).finally(()=>{a(!1);});},downloadLoading:n,error:s}},ma=()=>{let{asPath:e}=useRouter(),[t,r]=useState(!1),[o,n]=useState(null);return {printReport:()=>{r(!0),n(null);let s=process.env.NEXT_PUBLIC_REPORTS_BASE_URL,i=e.replace(/[&?]printBtn=[^&]+/,""),l=i.includes("?")?"&":"?",u=encodeURIComponent(`${s}${i}${l}print=true`);return Nn.get(`${process.env.NEXT_PUBLIC_PDF_API_URL}/pdf?url=${u}`,{responseType:"blob"}).then(p=>{let d=p.headers["content-disposition"]?.match(/filename[^;=\n]*=(['"]?)(.*?)\1/),f=d&&d[2]?d[2]:"report.pdf";saveAs(p.data,f);}).catch(p=>{n(p.response?.data?.message||"Failed to generate PDF. Please try again.");}).finally(()=>{r(!1);})},error:o,setError:n,downloadLoading:t}},Bp=()=>!!process.env.NEXT_PUBLIC_PDF_API_URL;});function Vp({contentOutline:e=[]}){return jsx(Menu,{children:$p(e)})}function $p(e,t=!0){return e.map((r,o)=>t?jsxs(Fragment$1,{children:[jsx(Menu.Item,{children:jsx(Anchor,{href:`#bespoke-title-${r.id}`,children:jsx(Group,{children:jsx(Text,{dangerouslySetInnerHTML:{__html:r.label}})})})}),r.children.length?jsx(Box,{ml:"md",children:$p(r.children,!1)}):null]},o):jsx(Menu.Item,{children:jsx(Anchor,{href:`#bespoke-title-${r.id}`,children:jsx(Text,{dangerouslySetInnerHTML:{__html:r.label}})})},o))}function ui({headings:e,settings:t,type:r}){let{min:o="1",max:n="6",icons:a="yes"}=t||{},s=Ao(parseInt(o,10),parseInt(n,10),e),i=a==="yes",u=`(max-width: ${useMantineTheme().breakpoints.md})`,p=useMediaQuery(u),m=Ro(t&&t.align?String(t.align):"left");return p?jsx(GS,{contentOutline:s,showIcons:i}):r==="multilevel"?jsx(qS,{contentOutline:s,showIcons:i,align:m}):jsx(US,{contentOutline:s,showIcons:i,align:m})}var Np,US,zp,GS,qS,Up=b(()=>{c();oi();Yr();Ge();ua();li();fa();Np=e=>t=>({display:"flex",gap:t.spacing.md,justifyContent:e,listStyleType:"none"});US=({contentOutline:e,showIcons:t,align:r})=>{let{active:o,position:n,pdfParam:a}=un(),{downloadLoading:s,printReport:i}=ma(),[l,u]=useState(null);if(useEffect(()=>{let m=()=>{let d=document.querySelector(".bespoke-nav");if(!d)return;let f=d.getBoundingClientRect(),g=!1;e.forEach(y=>{let T=document.getElementById(`bespoke-title-${y.id}`);T&&T.getBoundingClientRect().top<=f.bottom&&(u(y.id),g=!0);}),g||u(null);};return window.addEventListener("scroll",m),()=>{window.removeEventListener("scroll",m);}},[e]),o&&a)return jsx(Vp,{contentOutline:e});let p=m=>!m||!m?.length?null:jsx(Fragment,{children:m.map(d=>jsxs(Fragment$1,{children:[jsx(Menu.Item,{children:jsx(Anchor,{href:`#bespoke-title-${d.id}`,children:jsxs(Group,{spacing:"sm",children:[t&&jsx(ke,{...d.iconProps,iconSize:"sm"}),jsx(Text,{dangerouslySetInnerHTML:{__html:d.label}})]})})}),jsx(Box,{pl:"xs",children:p(d.children)})]},d.id))});return jsxs(Box,{component:"nav",className:"bespoke-nav",children:[jsx(List,{sx:m=>({display:"flex",gap:m.spacing.md,justifyContent:r,listStyleType:"none"}),children:e?.map(m=>jsx(List.Item,{children:jsxs(Menu,{trigger:"hover",openDelay:100,closeDelay:200,children:[jsx(Menu.Target,{children:jsx(Anchor,{href:`#bespoke-title-${m.id}`,"data-active":m.id===l,children:jsxs(Group,{spacing:"sm",children:[t&&jsx(ke,{...m.iconProps,iconSize:"sm"}),jsx(Text,{dangerouslySetInnerHTML:{__html:m.label}})]})})}),m?.children?.length?jsx(Menu.Dropdown,{children:p(m.children)}):null]})},m.id))}),pa(n,"NAV")&&o&&e.length>=1&&jsx(List.Item,{children:jsx(Button,{variant:"outline",onClick:i,children:s?"Downloading":"Download PDF"})})]})},zp=({contentOutline:e,closeNav:t,showIcons:r})=>{let[o,n]=useState(null);return jsx(Stack,{children:e.map(a=>a.children.length?jsxs(Fragment,{children:[jsxs(Group,{spacing:0,noWrap:!0,children:[jsx(UnstyledButton,{w:"100%",component:"a",onClick:t,href:`#bespoke-title-${a.id}`,children:jsxs(Group,{spacing:"sm",noWrap:!0,children:[r&&jsx(ke,{...a.iconProps,iconSize:"sm",iconPadding:"2"}),jsx(Text,{dangerouslySetInnerHTML:{__html:a.label}})]})},a.id),jsx(ActionIcon,{component:"a",size:"lg",onClick:()=>n(s=>s===a.id?null:a.id),children:jsx(IconChevronDown,{style:{transition:"transform 0.2s",transform:o===a.id?"rotate(-180deg)":"none"},stroke:1})})]},a.id),jsx(Collapse,{in:o===a.id,pl:"sm",transitionTimingFunction:"linear",transitionDuration:200,children:jsx(zp,{contentOutline:a.children,closeNav:t,showIcons:r})})]}):jsx(Group,{noWrap:!0,children:jsx(UnstyledButton,{display:"flex",w:"100%",component:"a",href:`#bespoke-title-${a.id}`,children:jsxs(Group,{spacing:"sm",children:[r&&jsx(ke,{...a.iconProps,iconSize:"sm"}),jsx(Text,{dangerouslySetInnerHTML:{__html:a.label}})]})},a.id)},a.id))})},GS=({contentOutline:e,showIcons:t})=>{let[r,{toggle:o}]=useDisclosure(!1),n=r?"Close content outline":"Open content outline",{active:a,pdfParam:s}=un();return a&&s?jsx(Vp,{contentOutline:e}):jsxs(Box,{component:"nav",children:[jsx(Group,{children:jsx(Burger,{opened:r,onClick:o,"aria-label":n,size:"md"})}),jsx(Collapse,{in:r,mt:"md",children:jsx(zp,{contentOutline:e,closeNav:o,showIcons:t})})]})},qS=({contentOutline:e,showIcons:t,align:r})=>{let[o,n]=useState(null),[a,s]=useState(null);useEffect(()=>{let l=()=>{let u=document.querySelector(".bespoke-nav");if(!u)return;let p=u.getBoundingClientRect(),m=!1;e.forEach(d=>{let f=document.getElementById(`bespoke-title-${d.id}`);f&&(f.getBoundingClientRect().top<=p.bottom&&(n(d.id),s(null),m=!0),d.children.forEach(y=>{let T=document.getElementById(`bespoke-title-${y.id}`);T&&T.getBoundingClientRect().top<=p.bottom&&(s(y.id),n(d.id),m=!0);}));}),m||(n(null),s(null));};return window.addEventListener("scroll",l),()=>{window.removeEventListener("scroll",l);}},[e]);let i=l=>!l||!l?.length?null:jsx(Fragment,{children:l.map(u=>jsxs(Fragment$1,{children:[jsx(Menu.Item,{children:jsx(Anchor,{href:`#bespoke-title-${u.id}`,children:jsxs(Group,{spacing:"sm",children:[t&&jsx(ke,{...u.iconProps,iconSize:"sm"}),jsx(Text,{dangerouslySetInnerHTML:{__html:u.label}})]})})}),jsx(Box,{pl:"xs",children:i(u.children)})]},u.id))});return jsxs(Box,{component:"nav",className:"bespoke-nav",children:[jsx(List,{className:"bespoke-nav-level1",sx:Np(r),children:e?.map(l=>jsx(List.Item,{children:jsx(Anchor,{href:`#bespoke-title-${l.id}`,"data-active":o===l.id,onClick:()=>n(l.id),children:jsxs(Group,{spacing:"sm",children:[t&&jsx(ke,{...l.iconProps,iconSize:"sm"}),jsx(Text,{dangerouslySetInnerHTML:{__html:l.label}})]})})},l.id))}),o&&e.find(l=>l.id===o)?.children.length>0&&jsx(List,{className:"bespoke-nav-level2",sx:Np(r),children:e.find(l=>l.id===o)?.children.map(l=>jsx(List.Item,{children:jsxs(Menu,{trigger:"hover",openDelay:100,closeDelay:200,children:[jsx(Menu.Target,{children:jsx(Anchor,{href:`#bespoke-title-${l.id}`,"data-active":l.id===a,children:jsxs(Group,{spacing:"sm",children:[t&&jsx(ke,{...l.iconProps,iconSize:"sm"}),jsx(Text,{dangerouslySetInnerHTML:{__html:l.label}})]})})}),l?.children?.length?jsx(Menu.Dropdown,{children:i(l.children)}):null]})},l.id))})]})};});function mi(e){let{related_reports:t,settings:r}=e,o=X(d=>d.status.currentLocale),n=X(d=>d.status.localeDefault),a=Xn(),s=useRouter(),{components:i}=st();if(!t?.length)return;let l=o===n?"":`/${o}`,u=d=>{s.push(`${d}`);},p=i?.ReportTile?i.ReportTile:_s,m=Nt(r&&r.align?String(r.align):"center");return jsx(Grid,{justify:m,children:t.map(d=>{let f=`${l}${a}${d.link}`,g=d.entities.map(R=>({original_id:R.id,name:R.name,id:R.content_id,variant:R.variant_name,variant_id:R.variant_id,dimension:R.dimension_name,dimension_id:R.dimension_id,image:{src:`/api/cms/member/image?member=${R.content_id}&size=thumb`,alt:R.name}})),y=d.entities.map(R=>R.id).join("-"),T=d.entities.map(R=>R.name).join(" & "),C=d.entities[0]?d.entities[0].report_id:null,N=R=>{R.preventDefault(),u(f);};return jsx(Grid.Col,{xs:12,sm:6,md:4,lg:4,xl:3,children:jsx(p,{reportId:C,reportName:T,members:g,href:f,onClick:N})},y)})})}var qp=b(()=>{c();ge();Ee();Bs();Xr();Ge();});function fi({id:e,label:t,settings:r,showIcon:o,fullWidth:n,showWhenDisabled:a}){let s=bt(e).data,{sectionVariables:i,resetSectionVariables:l}=Pe(s?.section_id),u=!!Object.keys(i).length,p=Nt(r&&r.align?r.align:"left");return !u&&!a?null:jsx(Button,{onClick:()=>l(),disabled:!u,fullWidth:n,sx:{justifySelf:p},children:jsxs(Group,{align:"center",children:[t,o&&jsx(IconRefresh,{})]})})}var jp=b(()=>{c();Ee();Ee();Ge();});function gi({settings:e,label:t,removeLabel:r,showIcon:o,position:n="center",asComparison:a=!1}){let s=X(R=>R.records.entities.report),i=X(R=>R.variables.attributes),l=e&&e.search?e.search:"inline",u=Object.values(s)[0].settings,p=useRouter(),{comparisonLoaded:m,loading:d}=Qe(),f=Object.keys(p.query).includes("compare"),y=m&&f?jsx(Button,{onClick:()=>{let R={...p.query};delete R.compare,p.push({pathname:p.pathname,query:R},void 0,{shallow:!0});},rightIcon:jsx(IconX,{}),children:r||"Remove Comparison"}):jsx(Button,{loading:d,children:jsxs(Group,{align:"center",children:[t||"Add Comparison",o&&jsx(IconPlus,{})]})}),T={searchReportParams:{report:[Number(Object.keys(s)[0])],variant:u.compareLevels?[]:[i.variant_id1]}},N=on(y,l,R=>{p.push({pathname:p.pathname,query:{...p.query,compare:R.reportPath}});},T);return a?null:jsx(Group,{position:n,children:f?y:N})}var Yp=b(()=>{c();Fs();ge();Zt();});function yi({columns:e=[],data:t=[],tableProps:r={},sectionId:o=null}){let[n,a]=useState(!1),[s,i]=useState({}),l=useMemo(()=>e.map(d=>d.accessorKey),[e]),u=useMemo(()=>t.filter(d=>typeof d=="object"&&d!==null&&!Array.isArray(d)&&Object.keys(d).some(f=>l.includes(f))),[l,t]),p=useMemo(()=>e.map(d=>({...d,Cell:({renderedCellValue:f})=>jsx(se,{html:`${f}`}),filterFn:"contains"})),[e]),{locale:m}=useRouter();return useEffect(()=>{(async()=>{try{let f=m||"en",g=`${f.toUpperCase()}`,y=await import(`mantine-react-table/locales/${f}.js`);i(y[`MRT_Localization_${g}`]);}catch(f){console.error("Error loading translations:",f);}})();},[m]),jsx(MantineReactTable,{...r,autoResetPageIndex:!1,columns:p,data:u,enableColumnFilterModes:!0,enableFilterMatchHighlighting:!1,globalFilterFn:"contains",layoutMode:"grid",localization:s,onIsFullScreenChange:d=>{let f=document.getElementById(`section-${o}`);f&&(d?f.style.zIndex="10":f.style.zIndex="1"),a(d);},state:{...r.state,isFullScreen:n}})}var Zp=b(()=>{c();Ie();});function bi({label:e,url:t,settings:r}){let{align:o}=r;return e?jsx(Group,{position:o,grow:o==="justify",children:jsx(Button,{component:"a",target:"_blank",href:t||"",children:e||"Button"})}):null}var ed=b(()=>{c();});function cT({block:e}){let{id:t}=e;return jsxs(Stack,{align:"center",spacing:"sm",children:[jsx(ThemeIcon,{radius:"md",size:100,children:jsx(IconCircleKey,{size:100})}),jsxs(Title,{order:5,children:["Private content (Block ",t,")"]}),jsx(Text,{children:"Sorry, you do not have sufficient permissions to view this block."}),jsx(Text,{children:"Contact your account manager to check your access role."})]})}function vi(e){let t=uT();return jsx(t,{block:e})}var uT,od=b(()=>{c();Xr();uT=()=>{let{components:e}=st(),t=cT;return e?.CustomFallback&&(t=e.CustomFallback),t};});var dT,mT,nd,ad,ha,fT,Sr,mn=b(()=>{c();wn();dT=process.env.NEXT_PUBLIC_REPORTS_LOCALE_DEFAULT||"en",mT="Error Rendering Visualization",nd={data:[],dataFormat:e=>e,type:"Treemap",noDataHTML:`<p style="font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;">
55
55
  <strong>${mT}</strong>
56
- </p>`},ad=(e,t)=>t.find(o=>{let n=o.content?.pattern;if(!n||!o.content?.useProxy)return !1;try{return new RegExp(n).test(e)}catch{return !1}})?`${process.env.NEXT_PUBLIC_REPORTS_BASE_URL}/api/cms/url/proxy?url=${encodeURIComponent(e)}`:e,ha=(e,t)=>typeof e=="string"?ad(e,t):Array.isArray(e)?e.map(r=>typeof r=="string"?ad(r,t):r):e,fT=(e,t,r={},o=dT,n=null,a={},s={},i=[])=>{let l;try{l=An({vars:["variables"],logic:e},t,o,a,s)(r),l.data=ha(l.data,i),l._downloadUrl&&(l.__downloadUrl=ha(l.__downloadUrl,i));}catch(f){return console.error(`Parsing Error in propify (ID: ${n})`),console.error(`Error message: ${f.message}`),{error:`${f}`,config:nd}}if(typeof l!="object")return {error:"Visualization JS code must return an object",config:nd};let u=l.dataFormat?l.dataFormat:f=>{let y=Array.isArray(l.data)&&l.data.length>1&&l.data.some(T=>typeof T=="string")?f:[f];return dataConcat(y,"data")};delete l.dataFormat;let p=l.linksFormat||void 0;delete l.linksFormat;let m=l.nodesFormat||void 0;delete l.nodesFormat;let d=l.topojsonFormat||void 0;return delete l.topojsonFormat,{config:l,dataFormat:u,linksFormat:p,nodesFormat:m,topojsonFormat:d}},Sr=fT;});var to,Si=b(()=>{c();to=class extends Jt__default.Component{constructor(t){super(t),this.state={hasError:!1};}static getDerivedStateFromError(t){return console.info("getDerivedStateFromError",t),{hasError:!0}}componentDidCatch(t,r){console.error("Error information:",r.componentStack),notifications.show({autoClose:!1,color:"red",id:"revalidate-error",message:"Check the console for more details",title:t.message});}render(){return this.state.hasError?this.props.fallback:this.props.children}};});function fn({config:e}){return !e||!e.html?null:jsx("div",{className:"bespoke-html",dangerouslySetInnerHTML:{__html:e.html}})}var Ti=b(()=>{c();});var ld={};Na(ld,{default:()=>id});function id(e){let{print:t}=qe(),{block:r,active:o,locale:n,variables:a,configOverride:s={}}=e,i=Be(r),l=_t(n),u={variables:a},p=useRouter(),{sectionVariables:m,setSectionVariables:d,resetSectionVariables:f}=Pe(r.section_id),g=mr(),y=JSON.stringify(m),T=useMemo(()=>{if(!i?.logic)return {error:"Add a Configuration"};let q=ut({logic:i.logic},l,u).logic,w={router:p,section:{variables:m,setVariables:d,resetVariables:f}};return Sr(q,l,a,n,r.id,{},w,g)},[r,o,a,y]),{type:C}=T.config||{},N=C&&xi[C]?C:"Treemap";xi[C]||(T.config={error:`"${C}" is not a valid Visualization Type`});let R=xi[N],M=useMemo(()=>{let{_data:q,...w}=T.config;return ST(w,t)},[T,t]),z={locale:n,variables:a,...M,...s};return jsx("div",{className:"bespoke-Viz","data-ignore-print":z._printIgnore?"true":void 0,children:jsx("div",{style:{display:"flex",flex:"1 1 100%",minHeight:C==="HTML"?void 0:400},children:jsx(to,{fallback:jsx("p",{children:"Error in d3plus viz config."}),children:jsx(R,{style:{flex:1},dataFormat:q=>{let w;try{w=T.dataFormat(q);}catch(_){console.error("Error in dataFormat: ",_),w=[];}return w},linksFormat:T.linksFormat,nodesFormat:T.nodesFormat,topojsonFormat:T.topojsonFormat,config:{...z,sectionVariables:y}},"viz-key")})})})}var xi,ST,cd=b(()=>{c();Br();mn();Or();Ee();Si();Qt();Ti();xi={...bT,HTML:fn},ST=(e,t)=>{let r={...e};return t&&(r.detectResize=!1,r.detectResizeDelay=0,r.detectVisible=!1,r.detectVisibleInterval=0,r.duration=0,r.shapeConfig={...r.shapeConfig,duration:0}),r};});var xT,RT,ud,pd=b(()=>{c();he();Xc();ru();nu();Xu();ep();tp();rp();Sp();Up();qp();jp();Yp();Zp();ed();od();xT=TT(()=>Promise.resolve().then(()=>(cd(),ld)),{ssr:!1}),RT={[h.PARAGRAPH]:Cs,[h.STAT]:ws,[h.SUBTITLE]:Ps,[h.TITLE]:Us,[h.SELECTOR]:Ws,[h.VIZ]:xT,[h.GENERATOR]:ta,[h.SECTION_FLAG]:ta,[h.IMAGE]:Ks,[h.NAV]:ui,[h.RELATED]:mi,[h.RESET_BUTTON]:fi,[h.COMPARISON_BUTTON]:gi,[h.TABLE]:yi,[h.BUTTON]:bi,[h.MULTIHIERARCHY_SELECTOR]:ei,[h.FALLBACK]:vi},ud=RT;});var ET,dd,md=b(()=>{c();ET=(e,t)=>{let r=e.allLabel||"All",o=e.colorKey||"",n=e.data||[],a=e.hideLabel||"false",s=e.resetSectionVars||"false",i=e.iconKey||"",l=e.label||"Unlabeled Multihierarchy Selector",u=e.levels||[],p=e.limit||void 0,m=e.placeholder||"",d=e.searchIndexKey||"",f=e.searchIndexSeparator||"",g,y;return e.defaultValue&&e.defaultValueType&&(g=e.defaultValue,y=e.defaultValueType),(!g||!y)&&(g=[],y=""),{allLabel:r,colorKey:o,data:n,defaultValue:g,defaultValueType:y,hideLabel:a,resetSectionVars:s,iconKey:i,id:t,label:l,levels:u,limit:p,placeholder:m,searchIndexKey:d,searchIndexSeparator:f}},dd=ET;});var kT,fd,CT,gd,hd=b(()=>{c();he();On();kT=e=>Array.isArray(e)?e.map(t=>typeof t=="string"?{id:t,label:t}:t):[],fd=(e,t)=>t===Ce.MULTI&&!Array.isArray(e)?[e]:e,CT=(e,t)=>{let r=e.type||Ce.SINGLE,o=e.component||"Selector",n=e.hideLabel||"false",a=e.resetSectionVars||"false",s=e.name||"Unlabeled Selector",i=kT(e.options||[]),l;if(e.defaultValue){let u=fd(e.defaultValue,r);_r(r,u,i)&&(l=u);}if(!l){let u=i&&i[0]&&i[0].id||i[0]||"";l=fd(u,r);}return {id:t,name:s,type:r,options:i,component:o,defaultValue:l,hideLabel:n,resetSectionVars:a}},gd=CT;});var AT,hn,yd=b(()=>{c();he();md();hd();AT={[h.SELECTOR]:gd,[h.MULTIHIERARCHY_SELECTOR]:dd},hn=AT;});function Ei({paragraph:e,tooltip:t,settings:r}){return jsx(se,{component:"p",html:e||`Lorem ipsum dolor sit amet,
56
+ </p>`},ad=(e,t)=>t.find(o=>{let n=o.content?.pattern;if(!n||!o.content?.useProxy)return !1;try{return new RegExp(n).test(e)}catch{return !1}})?`${process.env.NEXT_PUBLIC_REPORTS_BASE_URL}/api/cms/url/proxy?url=${encodeURIComponent(e)}&wrapper=false`:e,ha=(e,t)=>typeof e=="string"?ad(e,t):Array.isArray(e)?e.map(r=>typeof r=="string"?ad(r,t):r):e,fT=(e,t,r={},o=dT,n=null,a={},s={},i=[])=>{let l;try{l=An({vars:["variables"],logic:e},t,o,a,s)(r),l.data=ha(l.data,i),l._downloadUrl&&(l.__downloadUrl=ha(l.__downloadUrl,i));}catch(f){return console.error(`Parsing Error in propify (ID: ${n})`),console.error(`Error message: ${f.message}`),{error:`${f}`,config:nd}}if(typeof l!="object")return {error:"Visualization JS code must return an object",config:nd};let u=l.dataFormat?l.dataFormat:f=>{let y=Array.isArray(l.data)&&l.data.length>1&&l.data.some(T=>typeof T=="string")?f:[f];return dataConcat(y,"data")};delete l.dataFormat;let p=l.linksFormat||void 0;delete l.linksFormat;let m=l.nodesFormat||void 0;delete l.nodesFormat;let d=l.topojsonFormat||void 0;return delete l.topojsonFormat,{config:l,dataFormat:u,linksFormat:p,nodesFormat:m,topojsonFormat:d}},Sr=fT;});var to,Si=b(()=>{c();to=class extends Jt__default.Component{constructor(t){super(t),this.state={hasError:!1};}static getDerivedStateFromError(t){return console.info("getDerivedStateFromError",t),{hasError:!0}}componentDidCatch(t,r){console.error("Error information:",r.componentStack),notifications.show({autoClose:!1,color:"red",id:"revalidate-error",message:"Check the console for more details",title:t.message});}render(){return this.state.hasError?this.props.fallback:this.props.children}};});function fn({config:e}){return !e||!e.html?null:jsx("div",{className:"bespoke-html",dangerouslySetInnerHTML:{__html:e.html}})}var Ti=b(()=>{c();});var ld={};Na(ld,{default:()=>id});function id(e){let{print:t}=qe(),{block:r,active:o,locale:n,variables:a,configOverride:s={}}=e,i=Be(r),l=_t(n),u={variables:a},p=useRouter(),{sectionVariables:m,setSectionVariables:d,resetSectionVariables:f}=Pe(r.section_id),g=mr(),y=JSON.stringify(m),T=useMemo(()=>{if(!i?.logic)return {error:"Add a Configuration"};let q=ut({logic:i.logic},l,u).logic,w={router:p,section:{variables:m,setVariables:d,resetVariables:f}};return Sr(q,l,a,n,r.id,{},w,g)},[r,o,a,y]),{type:C}=T.config||{},N=C&&xi[C]?C:"Treemap";xi[C]||(T.config={error:`"${C}" is not a valid Visualization Type`});let R=xi[N],M=useMemo(()=>{let{_data:q,...w}=T.config;return ST(w,t)},[T,t]),z={locale:n,variables:a,...M,...s};return jsx("div",{className:"bespoke-Viz","data-ignore-print":z._printIgnore?"true":void 0,children:jsx("div",{style:{display:"flex",flex:"1 1 100%",minHeight:C==="HTML"?void 0:400},children:jsx(to,{fallback:jsx("p",{children:"Error in d3plus viz config."}),children:jsx(R,{style:{flex:1},dataFormat:q=>{let w;try{w=T.dataFormat(q);}catch(_){console.error("Error in dataFormat: ",_),w=[];}return w},linksFormat:T.linksFormat,nodesFormat:T.nodesFormat,topojsonFormat:T.topojsonFormat,config:{...z,sectionVariables:y}},"viz-key")})})})}var xi,ST,cd=b(()=>{c();Br();mn();Or();Ee();Si();Qt();Ti();xi={...bT,HTML:fn},ST=(e,t)=>{let r={...e};return t&&(r.detectResize=!1,r.detectResizeDelay=0,r.detectVisible=!1,r.detectVisibleInterval=0,r.duration=0,r.shapeConfig={...r.shapeConfig,duration:0}),r};});var xT,RT,ud,pd=b(()=>{c();he();Xc();ru();nu();Xu();ep();tp();rp();Sp();Up();qp();jp();Yp();Zp();ed();od();xT=TT(()=>Promise.resolve().then(()=>(cd(),ld)),{ssr:!1}),RT={[h.PARAGRAPH]:Cs,[h.STAT]:ws,[h.SUBTITLE]:Ps,[h.TITLE]:Us,[h.SELECTOR]:Ws,[h.VIZ]:xT,[h.GENERATOR]:ta,[h.SECTION_FLAG]:ta,[h.IMAGE]:Ks,[h.NAV]:ui,[h.RELATED]:mi,[h.RESET_BUTTON]:fi,[h.COMPARISON_BUTTON]:gi,[h.TABLE]:yi,[h.BUTTON]:bi,[h.MULTIHIERARCHY_SELECTOR]:ei,[h.FALLBACK]:vi},ud=RT;});var ET,dd,md=b(()=>{c();ET=(e,t)=>{let r=e.allLabel||"All",o=e.colorKey||"",n=e.data||[],a=e.hideLabel||"false",s=e.resetSectionVars||"false",i=e.iconKey||"",l=e.label||"Unlabeled Multihierarchy Selector",u=e.levels||[],p=e.limit||void 0,m=e.placeholder||"",d=e.searchIndexKey||"",f=e.searchIndexSeparator||"",g,y;return e.defaultValue&&e.defaultValueType&&(g=e.defaultValue,y=e.defaultValueType),(!g||!y)&&(g=[],y=""),{allLabel:r,colorKey:o,data:n,defaultValue:g,defaultValueType:y,hideLabel:a,resetSectionVars:s,iconKey:i,id:t,label:l,levels:u,limit:p,placeholder:m,searchIndexKey:d,searchIndexSeparator:f}},dd=ET;});var kT,fd,CT,gd,hd=b(()=>{c();he();On();kT=e=>Array.isArray(e)?e.map(t=>typeof t=="string"?{id:t,label:t}:t):[],fd=(e,t)=>t===Ce.MULTI&&!Array.isArray(e)?[e]:e,CT=(e,t)=>{let r=e.type||Ce.SINGLE,o=e.component||"Selector",n=e.hideLabel||"false",a=e.resetSectionVars||"false",s=e.name||"Unlabeled Selector",i=kT(e.options||[]),l;if(e.defaultValue){let u=fd(e.defaultValue,r);_r(r,u,i)&&(l=u);}if(!l){let u=i&&i[0]&&i[0].id||i[0]||"";l=fd(u,r);}return {id:t,name:s,type:r,options:i,component:o,defaultValue:l,hideLabel:n,resetSectionVars:a}},gd=CT;});var AT,hn,yd=b(()=>{c();he();md();hd();AT={[h.SELECTOR]:gd,[h.MULTIHIERARCHY_SELECTOR]:dd},hn=AT;});function Ei({paragraph:e,tooltip:t,settings:r}){return jsx(se,{component:"p",html:e||`Lorem ipsum dolor sit amet,
57
57
  consectetur adipiscing elit. Etiam justo purus, placerat ac turpis at,
58
58
  dignissim interdum eros. Curabitur non tincidunt libero.
59
59
  Suspendisse quis nibh in massa tincidunt feugiat sit amet vitae nisl.