@guardian/support-dotcom-components 2.8.0 → 2.9.1

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/index.esm.js CHANGED
@@ -1 +1 @@
1
- import{z as e}from"zod";const n="gu.contributions.views",t=e=>e.get(n)||void 0,a=e=>{const t=localStorage.getItem(n),a=t?JSON.parse(t).value:[];a.push({date:(new Date).getTime(),testId:e});const i={value:a.slice(-50)};localStorage.setItem(n,JSON.stringify(i))},i="gu.history.weeklyArticleCount",o="gu.history.articleCountsThisWeek",r=e=>{const n=e.getDay()||7;return Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()-(n-1))/864e5},s=e=>e.get(i)||void 0,l=new Set(["environment/climate-change","environment/climate-crisis","environment/environment","science/science","politics/politics","us-news/us-politics","australia-news/australian-politics","world/world","world/europe-news","world/russia","books/books","culture/culture","world/coronavirus-outbreak","world/race","inequality/inequality","technology/technology","business/business","tone/recipes","sport/sport","football/football","sport/olympic-games","sport/olympic-games-2024","tracking/commissioningdesk/uk-investigations"]),u=(e,n={})=>(e.forEach((e=>{l.has(e)&&(n[e]=(n[e]??0)+1)})),n),c=(e,n,t)=>{const a=((e,n)=>{const t=r(new Date),a=e.get(o);if(a&&a.week===t){const i=a.articles[n]||0;return e.set(o,{week:t,articles:{...a.articles,[n]:i+1}}),i>0}return e.set(o,{week:t,articles:{[n]:1}}),!1})(e,n);if(!a){const n=r(new Date),a=e.get(i)||[],o=a[0];if(o&&o.week&&o.week===n)o.count+=1,o.tags=u(t,o.tags),e.set(i,a);else{a.unshift({week:n,count:1,tags:u(t,{})});const o=n-365,r=a.filter((e=>e.week>=o));e.set(i,r)}}},d=["GBPCountries","UnitedStates","AUDCountries","EURCountries","International","NZDCountries","Canada"],g=e.enum(d),m={GBPCountries:{name:"United Kingdom",currency:"GBP",countries:["GB","FK","GI","GG","IM","JE","SH"],supportRegionId:"UK"},UnitedStates:{name:"United States",currency:"USD",countries:["US"],supportRegionId:"US"},AUDCountries:{name:"Australia",currency:"AUD",countries:["AU","KI","NR","NF","TV"],supportRegionId:"AU"},EURCountries:{name:"Europe",currency:"EUR",countries:["AD","AL","AT","BA","BE","BG","BL","CH","CY","CZ","DE","DK","EE","ES","FI","FO","FR","GF","GL","GP","GR","HR","HU","IE","IT","LI","LT","LU","LV","MC","ME","MF","IS","MQ","MT","NL","NO","PF","PL","PM","PT","RE","RO","RS","SE","SI","SJ","SK","SM","TF","TR","WF","YT","VA","AX","AZ","AM","GE","BY","MD","UA","MK"],supportRegionId:"EU"},International:{name:"International",currency:"USD",countries:["AE","AF","AG","AI","AO","AQ","AR","AS","AW","BB","BD","BF","BH","BI","BJ","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BZ","CC","CD","CF","CG","CI","CL","CM","CN","CO","CR","CU","CV","CW","CX","DJ","DM","DO","DZ","EC","EG","EH","ER","ET","FJ","FM","GA","GD","GH","GM","GN","GQ","GS","GT","GU","GW","GY","HK","HM","HN","HT","ID","IL","IN","IO","IQ","IR","JM","JO","JP","KE","KG","KH","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LK","LR","LS","LY","MA","MG","MH","ML","MM","MN","MO","MP","MR","MS","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NG","NI","NP","NU","OM","PA","PE","PG","PH","PK","PN","PR","PS","PW","PY","QA","RU","RW","SA","SB","SC","SD","SG","SL","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TG","TH","TJ","TK","TL","TM","TN","TO","TT","TW","TZ","UG","UM","UY","UZ","VC","VE","VG","VI","VN","VU","WS","YE","ZA","ZM","ZW"],supportRegionId:"INT"},NZDCountries:{name:"New Zealand",currency:"NZD",countries:["NZ","CK"],supportRegionId:"NZ"},Canada:{name:"Canada",currency:"CAD",countries:["CA"],supportRegionId:"CA"}},p={AD:"Andorra",AE:"the UAE",AF:"Afghanistan",AG:"Antigua and Barbuda",AI:"Anguilla",AL:"Albania",AM:"Armenia",AO:"Angola",AR:"Argentina",AS:"the US",AT:"Austria",AU:"Australia",AW:"Aruba",AX:"Åland Islands",AZ:"Azerbaijan",BA:"Bosnia and Herzegovina",BB:"Barbados",BD:"Bangladesh",BE:"Belgium",BF:"Burkina Faso",BG:"Bulgaria",BH:"Bahrain",BI:"Burundi",BJ:"Benin",BL:"Saint Barthélemy",BM:"Bermuda",BN:"Brunei Darussalam",BO:"Bolivia",BQ:"Bonaire, Sint Eustatius and Saba",BR:"Brazil",BS:"the Bahamas",BT:"Bhutan",BV:"Bouvet Island",BW:"Botswana",BY:"Belarus",BZ:"Belize",CA:"Canada",CD:"the Democratic Republic of the Congo",CF:"the Central Africa Republic",CG:"the Congo",CH:"Switzerland",CI:"Côte d'Ivoire",CK:"the Cook Islands",CL:"Chile",CM:"Cameroon",CN:"China",CO:"Colombia",CR:"Costa Rica",CU:"Cuba",CV:"Cabo Verde",CW:"Curaçao",CX:"Christmas Island",CY:"Cyprus",CZ:"the Czech Republic",DE:"Germany",DJ:"Djibouti",DK:"Denmark",DM:"Dominica",DO:"the Dominican Republic",DZ:"Algeria",EC:"Ecuador",EE:"Estonia",EG:"Egypt",EH:"the Western Sahara",ER:"Eritrea",ES:"Spain",ET:"Ethiopia",FI:"Finland",FJ:"Fiji",FK:"the UK",FO:"the UK",FR:"France",GA:"Gabon",GB:"the UK",GD:"Grenada",GE:"Georgia",GF:"French Guiana",GG:"Guernsey",GH:"Ghana",GI:"Gibraltar",GL:"Greenland",GM:"the Gambia",GN:"Guinea",GP:"Guadeloupe",GQ:"Equatorial Guinea",GR:"Greece",GT:"Guatemala",GU:"Guam",GW:"Guinea-Bissau",GY:"Guyana",HK:"Hong Kong",HN:"Honduras",HR:"Croatia",HT:"Haiti",HU:"Hungary",ID:"Indonesia",IE:"Ireland",IM:"the Isle of Man",IN:"India",IQ:"Iraq",IR:"Iran",IS:"Iceland",IT:"Italy",JE:"Jersey",JM:"Jamaica",JO:"Jordan",JP:"Japan",KE:"Kenya",KG:"Kyrgyzstan",KH:"Cambodia",KI:"Kiribati",KN:"Saint Kitts and Nevis",KP:"Korea",KR:"Korea",KW:"Kuwait",KY:"the Cayman Ialnds",KZ:"Kazakhstan",LB:"Lebanon",LC:"Saint Lucia",LI:"Liechtenstein",LK:"Sri Lanka",LR:"Liberia",LS:"Lesotho",LT:"Lithuania",LU:"Luxembourg",LV:"Latvia",LY:"Libya",MA:"Morocco",MC:"Monaco",MD:"Moldova",ME:"Montenegro",MG:"Madagascar",MK:"the Republic of North Macedonia",ML:"Mali",MM:"Myanmar",MN:"Mongolia",MO:"Macao",MQ:"Martinique",MR:"Mauritania",MS:"Montserrat",MT:"Malta",MU:"Mauritius",MV:"Maldives",MW:"Malawi",MX:"Mexico",MY:"Malaysia",MZ:"Mozambique",NA:"Namibia",NC:"New Caledonia",NE:"Niger",NF:"Norfolk Island",NG:"Nigeria",NI:"Nicaragua",NL:"the Netherlands",NO:"Norway",NP:"Nepal",NR:"Nauru",NU:"Niue",NZ:"New Zealand",OM:"Oman",PA:"Panama",PE:"Peru",PF:"French Polynesia",PG:"Papua New Guinea",PH:"the Philippines",PK:"Pakistan",PL:"Poland",PM:"Saint Pierre and Miquelon",PN:"Pitcairn",PR:"Puerto Rico",PT:"Portugal",PW:"Palau",PY:"Paraguay",QA:"Qatar",RE:"Réunion",RO:"Romania",RU:"Russia",RW:"Rwanda",SA:"Saudi Arabia",SB:"Solomon Islands",SC:"Seychelles",SD:"Sudan",SE:"Sweden",SG:"Singapore",SH:"Saint Helena",SI:"Slovenia",SJ:"Svalbard and Jan Mayen",SK:"Slovakia",SL:"Sierra Leone",SM:"San Marino",SN:"Senegal",SO:"Somalia",SR:"Suriname",SS:"South Sudan",ST:"Sao Tome and Principe",SV:"El Salvador",SY:"Syrian Arab Republic",SZ:"Eswatini",TD:"Chad",TG:"Togo",TH:"Thailand",TJ:"Tajikistan",TK:"Tokelau",TL:"Timor-Leste",TM:"Turkmenistan",TN:"Tunisia",TO:"Tonga",TR:"Turkey",TT:"Trinidad and Tobago",TV:"Tuvalu",TW:"Taiwan",TZ:"Tanzania ",UG:"Uganda",US:"the US",UY:"Uruguay",UZ:"Uzbekistan",VC:"Saint Vincent and the Grenadines",VE:"Venezuela",VG:"the Virgin Islands",VI:"the Virgin Islands",VN:"Vietnam",VU:"Vanuatu",WF:"Wallis and Futuna",WS:"Samoa",YE:"Yemen",YT:"Mayotte",ZA:"South Africa",ZM:"Zambia",ZW:"Zimbabwe"},C={GBPCountries:"£",UnitedStates:"$",AUDCountries:"$",Canada:"CA$",EURCountries:"€",NZDCountries:"NZ$",International:"$"},b=e=>Object.keys(m).find((n=>m[n].countries.includes(e??"")))||"International",S=(e,n=[])=>0===n.length||!!e&&n.includes(b(e.toUpperCase())),h=e=>{if(e){const n=b(e);return C[n]}return"£"},y=e=>{if(e)return p[e]},A=e=>/subscribe\/weekly\/checkout/.test(e),T=(e,n)=>{if(n){const t=(e=>m[b(e)]?.supportRegionId)(n);if(t&&!A(e))return e.replace(/(support.theguardian.com)\/(contribute-in-epic|contribute|subscribe)/,((e,n,a)=>`${n}/${t.toLowerCase()}/${a}`))}return e},I=(e,n,t,a)=>{if(a){const i=a[b(t)];if(i){return`${h(t)}${i[e][n].price}`}}},N={CURRENCY_SYMBOL:({countryCode:e})=>h(e),COUNTRY_NAME:({countryCode:e})=>y(e),PRICE_DIGISUB_MONTHLY:({countryCode:e,prices:n})=>I("Digisub","Monthly",e,n),PRICE_DIGISUB_ANNUAL:({countryCode:e,prices:n})=>I("Digisub","Annual",e,n),PRICE_GUARDIANWEEKLY_MONTHLY:({countryCode:e,prices:n})=>I("GuardianWeekly","Monthly",e,n),PRICE_GUARDIANWEEKLY_ANNUAL:({countryCode:e,prices:n})=>I("GuardianWeekly","Annual",e,n),DAY_OF_THE_WEEK:()=>((e=new Date)=>e.toLocaleString("en-GB",{weekday:"long"}))(),DATE:()=>((e=new Date)=>e.toLocaleString("en-GB",{day:"numeric",month:"long",year:"numeric"}))()},M=(e,n,t)=>e?e.replace(E,(e=>{const a=e.substring(2,e.length-2),i=N[a];if(i){const e=i({countryCode:n,prices:t});if(e)return e}return e})):"",E=/%%.*?%%/g,G=e=>{const n=e.match(E)?.filter((e=>"%%ARTICLE_COUNT%%"!==e));return!!n&&n.length>0},U=e=>{const n=(e=>{const n=new Date(e,10,1).getDay();return new Date(e,10,22+(11-n)%7)})(e);return n.setDate(n.getDate()+5),n},R=(e=new Date)=>{const n=(e=>{const n=e.getDate()<20?1:2;return e.setMonth(e.getMonth()+n),e})(e),t=(n.getMonth()+1).toString().padStart(2,"0"),a=n.toLocaleString("default",{month:"long"}),i=n.getFullYear();return{reminderCta:`Remind me in ${a}`,reminderPeriod:`${i}-${t}-01`,reminderLabel:`${a} ${i}`}},B=new Date("2023-12-31"),P=e=>e>=(e=>new Date(e.getFullYear(),9,20))(e)&&e<U(e.getFullYear()),D=(e,n=new Date)=>{return"US"===e&&P(n)?{reminderCta:"Remind me on Giving Tuesday",reminderPeriod:`${t=n.getFullYear()}-${(U(t).getMonth()+1).toString().padStart(0,"2")}-01`,reminderLabel:"on Giving Tuesday",reminderOption:`giving-tuesday-${t}`}:"US"===e&&(e=>e>=U(e.getFullYear())&&e<B)(n)?(e=>({reminderCta:"Remind me on New Years Eve",reminderPeriod:`${e}-12-01`,reminderLabel:"on New Years Eve",reminderOption:`new-years-eve-${e}`}))(n.getFullYear()):R(n);var t},L=e.object({text:e.string(),baseUrl:e.string()});let w=function(e){return e.Custom="CustomSecondaryCta",e.ContributionsReminder="ContributionsReminderSecondaryCta",e}({});e.nativeEnum(w);const O=e.object({type:e.literal(w.Custom),cta:L}),k=e.object({type:e.literal(w.ContributionsReminder)}),f=e.discriminatedUnion("type",[O,k]);let K=function(e){return e.unlimited="unlimited",e.hardstop="hardstop",e}({});const F=e.nativeEnum(K);let v=function(e){return e.money="money",e}({});const H=e.nativeEnum(v),Y=e.object({countLabel:e.string(),goalReachedPrimary:e.string(),goalReachedSecondary:e.string()}),j=e.object({total:e.number(),goal:e.number()}),V=e.enum(["US","AU"]),W=e.object({endType:F,countType:H,currencySymbol:e.string(),copy:Y,name:V,tickerData:j.optional()}),Z=e.object({for52Weeks:e.number(),forTargetedWeeks:e.number()}),$=e.enum(["for52Weeks","forTargetedWeeks"]),x=e.object({type:e.literal("above"),copy:e.string().optional(),countType:$.optional()}),_=e.enum(["CONTRIBUTION","MEMBERSHIP_SUPPORTER","DIGITAL_SUBSCRIPTION","PRINT_SUBSCRIPTION"]),J=e.enum(["ACQUISITIONS_EPIC","ACQUISITIONS_ENGAGEMENT_BANNER","ACQUISITIONS_SUBSCRIPTIONS_BANNER","ACQUISITIONS_HEADER","ACQUISITIONS_OTHER"]),Q=e.object({abTestName:e.string(),abTestVariant:e.string(),campaignCode:e.string(),componentType:J,products:e.array(_).nullish(),labels:e.array(e.string()).nullish(),ophanPageId:e.string(),platformId:e.string(),referrerUrl:e.string(),clientName:e.string()}),z=e.object({mainUrl:e.string(),mobileUrl:e.string().optional(),tabletUrl:e.string().optional(),desktopUrl:e.string().optional(),leftColUrl:e.string().optional(),wideUrl:e.string().optional(),altText:e.string()}),q=e.object({name:e.string(),description:e.string().optional(),headshot:z.optional()}),X=/^[0-9A-F]{2}$/,ee=e.string().refine((e=>X.test(e)),(e=>({message:`"${e}" is not a valid hex value`}))),ne=e.object({r:ee,g:ee,b:ee,kind:e.literal("hex")}),te=e.object({mobileUrl:e.string(),tabletUrl:e.string(),desktopUrl:e.string(),altText:e.string(),kind:e.literal("Image")}),ae=e.object({buttonColour:ne.nullish(),buttonTextColour:ne.nullish(),buttonBorderColour:ne.nullish(),buttonSelectColour:ne.nullish(),buttonSelectTextColour:ne.nullish(),buttonSelectBorderColour:ne.nullish(),kind:e.literal("ChoiceCards")}),ie=e.discriminatedUnion("kind",[te,ae]),oe=e.object({visual:ie.nullish(),colours:e.object({basic:e.object({background:ne,bodyText:ne})})}),re=e=>`#${e.r}${e.g}${e.b}`,se=e.enum(["Contribution","SupporterPlus","GuardianWeekly","Paper"]),le=e.enum(["new","guest","current"]),ue=e.enum(["Live","Draft","Archived"]),ce=e.enum(["Mobile","Desktop","All","iOS","Android"]),de=e.enum(["SignedIn","SignedOut","All"]),ge=e.enum(["HasConsented","HasNotConsented","All"]),me=e.object({name:e.string(),status:ue,priority:e.number(),controlProportionSettings:e.object({proportion:e.number(),offset:e.number()}).optional(),deviceType:ce.optional(),signedInStatus:de.optional(),consentStatus:ge.optional()}),pe=e.enum(["AllExistingSupporters","AllNonSupporters","Everyone","PostAskPauseSingleContributors"]),Ce=e.object({minViews:e.number(),maxViews:e.number().optional(),periodInWeeks:e.number(),tagIds:e.array(e.string()).optional()});e.object({userType:e.array(le),product:e.array(se)}),e.object({tagIds:e.array(e.string()),sectionIds:e.array(e.string()),excludedTagIds:e.array(e.string()),excludedSectionIds:e.array(e.string())});const be=e.object({maxViewsCount:e.number(),maxViewsDays:e.number(),minDaysBetweenViews:e.number()}),Se=e.object({reminderCta:e.string(),reminderLabel:e.string(),reminderPeriod:e.string()}),he=e.enum(["ONE_OFF","MONTHLY","ANNUAL"]),ye=e.object({testName:e.string(),variantName:e.string(),defaultContributionType:he,displayContributionType:he.array(),amountsCardData:e.object({ONE_OFF:e.object({amounts:e.array(e.number()),defaultAmount:e.number(),hideChooseYourAmount:e.boolean().optional()}),MONTHLY:e.object({amounts:e.array(e.number()),defaultAmount:e.number(),hideChooseYourAmount:e.boolean().optional()}),ANNUAL:e.object({amounts:e.array(e.number()),defaultAmount:e.number(),hideChooseYourAmount:e.boolean().optional()})})}),Ae=e.object({newsletterId:e.string(),successDescription:e.string()}),Te=e.object({name:e.string(),heading:e.string().optional(),paragraphs:e.array(e.string()),highlightedText:e.string().optional(),tickerSettings:W.optional(),cta:L.optional(),secondaryCta:f.optional(),newsletterSignup:Ae.optional(),image:z.optional(),showReminderFields:Se.optional(),separateArticleCount:x.optional(),maxViews:be.optional(),showSignInLink:e.boolean().optional(),bylineWithImage:q.optional(),showChoiceCards:e.boolean().optional(),choiceCardAmounts:ye.optional(),defaultChoiceCardFrequency:he.optional()}),Ie=e.object({variant:Te,tracking:Q,countryCode:e.string().nullish(),articleCounts:Z,onReminderOpen:e.any().nullish(),fetchEmail:e.any().nullish(),submitComponentEvent:e.any().nullish(),openCmp:e.any().nullish(),hasConsentForArticleCount:e.boolean().nullish(),stage:e.string().nullish()}),Ne=e.enum(["contributions","subscriptions","signIn","abandonedBasket"]),Me=e.object({heading:e.string().optional(),messageText:e.string().optional(),paragraphs:e.array(e.string()).optional(),mobileMessageText:e.string().optional(),highlightedText:e.string().optional(),cta:L.optional(),secondaryCta:f.optional()}),Ee=e.object({tracking:Q,bannerChannel:Ne,content:Me.nullish(),mobileContent:Me.nullish(),countryCode:e.string().nullish(),isSupporter:e.boolean().nullish(),tickerSettings:W.nullish(),submitComponentEvent:e.any(),articleCounts:Z,hasOptedOutOfArticleCount:e.boolean().nullish(),fetchEmail:e.any().nullish(),separateArticleCount:e.boolean().nullish(),design:oe.nullish()}),Ge=e.object({heading:e.string(),subheading:e.string(),primaryCta:L.optional(),secondaryCta:L.optional(),benefits:e.array(e.string()).optional()}),Ue=e.object({content:Ge,tracking:Q,mobileContent:Ge.optional(),countryCode:e.string().optional(),submitComponentEvent:e.any(),numArticles:e.number().optional()}),Re=e.object({maxViewsCount:e.number(),maxViewsDays:e.number(),minDaysBetweenViews:e.number()}),Be=["ONE_OFF","MONTHLY","ANNUAL"];me.extend({name:e.string(),status:ue,locations:e.array(g),tagIds:e.array(e.string()),sections:e.array(e.string()),excludedTagIds:e.array(e.string()),excludedSections:e.array(e.string()),alwaysAsk:e.boolean(),maxViews:Re.optional(),userCohort:pe,hasCountryName:e.boolean(),highPriority:e.boolean(),useLocalViewLog:e.boolean(),articlesViewedSettings:Ce.optional(),priority:e.number(),variants:Te.array(),isBanditTest:e.boolean().optional()});const Pe=e.object({amount:e.union([e.number(),e.literal("other")]),billingPeriod:e.union([e.literal("ONE_OFF"),e.literal("MONTHLY"),e.literal("ANNUAL")]),product:e.union([e.literal("Contribution"),e.literal("SupporterPlus"),e.literal("PremiumTier"),e.literal("DailyEdition"),e.literal("GuardianWeekly"),e.literal("Paper"),e.literal("PaperAndDigital")]),region:e.union([e.literal("uk"),e.literal("us"),e.literal("au"),e.literal("eu"),e.literal("int"),e.literal("nz"),e.literal("ca")])}),De=(e,n,t)=>{const a=(e=>{if(URLSearchParams){const n=new URLSearchParams(window.location.search).get(`force-${e}`);if(n)return n}return null})(e);return fetch(`${n}/${e}${a?`?force=${a}`:""}`,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then((n=>{if(!n.ok)throw Error(n.statusText||`Supporter Revenue ${e} | Api call returned HTTP status ${n.status}`);return n})).then((e=>e.json()))},Le=(e,n)=>De("epic",e,n),we=(e,n)=>De("liveblog-epic",e,n),Oe=(e,n)=>De("banner",e,n),ke=(e,n)=>De("header",e,n);export{d as CountryGroupId,w as SecondaryCtaType,v as TickerCountType,K as TickerEndType,Pe as abandonedBasketSchema,T as addRegionIdToSupportUrl,Ee as bannerSchema,R as buildReminderFields,G as containsNonArticleCountPlaceholder,Be as contributionTabFrequencies,b as countryCodeToCountryGroupId,g as countryGroupIdSchema,Ie as epicPropsSchema,Oe as getBanner,y as getCountryName,Le as getEpic,t as getEpicViewLog,ke as getHeader,we as getLiveblogEpic,h as getLocalCurrencySymbol,D as getReminderFields,s as getWeeklyArticleHistory,Ue as headerPropsSchema,re as hexColourToString,S as inCountryGroups,c as incrementWeeklyArticleCount,A as isGWCheckoutUrl,a as logEpicView,M as replaceNonArticleCountPlaceholders};
1
+ import{z as e}from"zod";const n="gu.contributions.views",t=e=>e.get(n)||void 0,a=e=>{const t=localStorage.getItem(n),a=t?JSON.parse(t).value:[];a.push({date:(new Date).getTime(),testId:e});const i={value:a.slice(-50)};localStorage.setItem(n,JSON.stringify(i))},i="gu.history.weeklyArticleCount",o="gu.history.articleCountsThisWeek",r=e=>{const n=e.getDay()||7;return Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()-(n-1))/864e5},s=e=>e.get(i)||void 0,l=new Set(["environment/climate-change","environment/climate-crisis","environment/environment","science/science","politics/politics","us-news/us-politics","australia-news/australian-politics","world/world","world/europe-news","world/russia","books/books","culture/culture","world/coronavirus-outbreak","world/race","inequality/inequality","technology/technology","business/business","tone/recipes","sport/sport","football/football","sport/olympic-games","sport/olympic-games-2024","tracking/commissioningdesk/uk-investigations"]),u=(e,n={})=>(e.forEach((e=>{l.has(e)&&(n[e]=(n[e]??0)+1)})),n),c=(e,n,t)=>{const a=((e,n)=>{const t=r(new Date),a=e.get(o);if(a&&a.week===t){const i=a.articles[n]||0;return e.set(o,{week:t,articles:{...a.articles,[n]:i+1}}),i>0}return e.set(o,{week:t,articles:{[n]:1}}),!1})(e,n);if(!a){const n=r(new Date),a=e.get(i)||[],o=a[0];if(o&&o.week&&o.week===n)o.count+=1,o.tags=u(t,o.tags),e.set(i,a);else{a.unshift({week:n,count:1,tags:u(t,{})});const o=n-365,r=a.filter((e=>e.week>=o));e.set(i,r)}}},d=["GBPCountries","UnitedStates","AUDCountries","EURCountries","International","NZDCountries","Canada"],g=e.enum(d),m={GBPCountries:{name:"United Kingdom",currency:"GBP",countries:["GB","FK","GI","GG","IM","JE","SH"],supportRegionId:"UK"},UnitedStates:{name:"United States",currency:"USD",countries:["US"],supportRegionId:"US"},AUDCountries:{name:"Australia",currency:"AUD",countries:["AU","KI","NR","NF","TV"],supportRegionId:"AU"},EURCountries:{name:"Europe",currency:"EUR",countries:["AD","AL","AT","BA","BE","BG","BL","CH","CY","CZ","DE","DK","EE","ES","FI","FO","FR","GF","GL","GP","GR","HR","HU","IE","IT","LI","LT","LU","LV","MC","ME","MF","IS","MQ","MT","NL","NO","PF","PL","PM","PT","RE","RO","RS","SE","SI","SJ","SK","SM","TF","TR","WF","YT","VA","AX","AZ","AM","GE","BY","MD","UA","MK"],supportRegionId:"EU"},International:{name:"International",currency:"USD",countries:["AE","AF","AG","AI","AO","AQ","AR","AS","AW","BB","BD","BF","BH","BI","BJ","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BZ","CC","CD","CF","CG","CI","CL","CM","CN","CO","CR","CU","CV","CW","CX","DJ","DM","DO","DZ","EC","EG","EH","ER","ET","FJ","FM","GA","GD","GH","GM","GN","GQ","GS","GT","GU","GW","GY","HK","HM","HN","HT","ID","IL","IN","IO","IQ","IR","JM","JO","JP","KE","KG","KH","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LK","LR","LS","LY","MA","MG","MH","ML","MM","MN","MO","MP","MR","MS","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NG","NI","NP","NU","OM","PA","PE","PG","PH","PK","PN","PR","PS","PW","PY","QA","RU","RW","SA","SB","SC","SD","SG","SL","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TG","TH","TJ","TK","TL","TM","TN","TO","TT","TW","TZ","UG","UM","UY","UZ","VC","VE","VG","VI","VN","VU","WS","YE","ZA","ZM","ZW"],supportRegionId:"INT"},NZDCountries:{name:"New Zealand",currency:"NZD",countries:["NZ","CK"],supportRegionId:"NZ"},Canada:{name:"Canada",currency:"CAD",countries:["CA"],supportRegionId:"CA"}},p={AD:"Andorra",AE:"the UAE",AF:"Afghanistan",AG:"Antigua and Barbuda",AI:"Anguilla",AL:"Albania",AM:"Armenia",AO:"Angola",AR:"Argentina",AS:"the US",AT:"Austria",AU:"Australia",AW:"Aruba",AX:"Åland Islands",AZ:"Azerbaijan",BA:"Bosnia and Herzegovina",BB:"Barbados",BD:"Bangladesh",BE:"Belgium",BF:"Burkina Faso",BG:"Bulgaria",BH:"Bahrain",BI:"Burundi",BJ:"Benin",BL:"Saint Barthélemy",BM:"Bermuda",BN:"Brunei Darussalam",BO:"Bolivia",BQ:"Bonaire, Sint Eustatius and Saba",BR:"Brazil",BS:"the Bahamas",BT:"Bhutan",BV:"Bouvet Island",BW:"Botswana",BY:"Belarus",BZ:"Belize",CA:"Canada",CD:"the Democratic Republic of the Congo",CF:"the Central Africa Republic",CG:"the Congo",CH:"Switzerland",CI:"Côte d'Ivoire",CK:"the Cook Islands",CL:"Chile",CM:"Cameroon",CN:"China",CO:"Colombia",CR:"Costa Rica",CU:"Cuba",CV:"Cabo Verde",CW:"Curaçao",CX:"Christmas Island",CY:"Cyprus",CZ:"the Czech Republic",DE:"Germany",DJ:"Djibouti",DK:"Denmark",DM:"Dominica",DO:"the Dominican Republic",DZ:"Algeria",EC:"Ecuador",EE:"Estonia",EG:"Egypt",EH:"the Western Sahara",ER:"Eritrea",ES:"Spain",ET:"Ethiopia",FI:"Finland",FJ:"Fiji",FK:"the UK",FO:"the UK",FR:"France",GA:"Gabon",GB:"the UK",GD:"Grenada",GE:"Georgia",GF:"French Guiana",GG:"Guernsey",GH:"Ghana",GI:"Gibraltar",GL:"Greenland",GM:"the Gambia",GN:"Guinea",GP:"Guadeloupe",GQ:"Equatorial Guinea",GR:"Greece",GT:"Guatemala",GU:"Guam",GW:"Guinea-Bissau",GY:"Guyana",HK:"Hong Kong",HN:"Honduras",HR:"Croatia",HT:"Haiti",HU:"Hungary",ID:"Indonesia",IE:"Ireland",IM:"the Isle of Man",IN:"India",IQ:"Iraq",IR:"Iran",IS:"Iceland",IT:"Italy",JE:"Jersey",JM:"Jamaica",JO:"Jordan",JP:"Japan",KE:"Kenya",KG:"Kyrgyzstan",KH:"Cambodia",KI:"Kiribati",KN:"Saint Kitts and Nevis",KP:"Korea",KR:"Korea",KW:"Kuwait",KY:"the Cayman Ialnds",KZ:"Kazakhstan",LB:"Lebanon",LC:"Saint Lucia",LI:"Liechtenstein",LK:"Sri Lanka",LR:"Liberia",LS:"Lesotho",LT:"Lithuania",LU:"Luxembourg",LV:"Latvia",LY:"Libya",MA:"Morocco",MC:"Monaco",MD:"Moldova",ME:"Montenegro",MG:"Madagascar",MK:"the Republic of North Macedonia",ML:"Mali",MM:"Myanmar",MN:"Mongolia",MO:"Macao",MQ:"Martinique",MR:"Mauritania",MS:"Montserrat",MT:"Malta",MU:"Mauritius",MV:"Maldives",MW:"Malawi",MX:"Mexico",MY:"Malaysia",MZ:"Mozambique",NA:"Namibia",NC:"New Caledonia",NE:"Niger",NF:"Norfolk Island",NG:"Nigeria",NI:"Nicaragua",NL:"the Netherlands",NO:"Norway",NP:"Nepal",NR:"Nauru",NU:"Niue",NZ:"New Zealand",OM:"Oman",PA:"Panama",PE:"Peru",PF:"French Polynesia",PG:"Papua New Guinea",PH:"the Philippines",PK:"Pakistan",PL:"Poland",PM:"Saint Pierre and Miquelon",PN:"Pitcairn",PR:"Puerto Rico",PT:"Portugal",PW:"Palau",PY:"Paraguay",QA:"Qatar",RE:"Réunion",RO:"Romania",RU:"Russia",RW:"Rwanda",SA:"Saudi Arabia",SB:"Solomon Islands",SC:"Seychelles",SD:"Sudan",SE:"Sweden",SG:"Singapore",SH:"Saint Helena",SI:"Slovenia",SJ:"Svalbard and Jan Mayen",SK:"Slovakia",SL:"Sierra Leone",SM:"San Marino",SN:"Senegal",SO:"Somalia",SR:"Suriname",SS:"South Sudan",ST:"Sao Tome and Principe",SV:"El Salvador",SY:"Syrian Arab Republic",SZ:"Eswatini",TD:"Chad",TG:"Togo",TH:"Thailand",TJ:"Tajikistan",TK:"Tokelau",TL:"Timor-Leste",TM:"Turkmenistan",TN:"Tunisia",TO:"Tonga",TR:"Turkey",TT:"Trinidad and Tobago",TV:"Tuvalu",TW:"Taiwan",TZ:"Tanzania ",UG:"Uganda",US:"the US",UY:"Uruguay",UZ:"Uzbekistan",VC:"Saint Vincent and the Grenadines",VE:"Venezuela",VG:"the Virgin Islands",VI:"the Virgin Islands",VN:"Vietnam",VU:"Vanuatu",WF:"Wallis and Futuna",WS:"Samoa",YE:"Yemen",YT:"Mayotte",ZA:"South Africa",ZM:"Zambia",ZW:"Zimbabwe"},C={GBPCountries:"£",UnitedStates:"$",AUDCountries:"$",Canada:"CA$",EURCountries:"€",NZDCountries:"NZ$",International:"$"},b=e=>Object.keys(m).find((n=>m[n].countries.includes(e??"")))||"International",S=(e,n=[])=>0===n.length||!!e&&n.includes(b(e.toUpperCase())),h=e=>{if(e){const n=b(e);return C[n]}return"£"},y=e=>{if(e)return p[e]},A=e=>/subscribe\/weekly\/checkout/.test(e),T=(e,n)=>{if(n){const t=(e=>m[b(e)]?.supportRegionId)(n);if(t&&!A(e))return e.replace(/(support\.theguardian\.com)\/(contribute-in-epic|contribute|subscribe|checkout)/,((e,n,a)=>`${n}/${t.toLowerCase()}/${a}`))}return e},I=(e,n,t,a)=>{if(a){const i=a[b(t)];if(i){return`${h(t)}${i[e][n].price}`}}},N={CURRENCY_SYMBOL:({countryCode:e})=>h(e),COUNTRY_NAME:({countryCode:e})=>y(e),PRICE_DIGISUB_MONTHLY:({countryCode:e,prices:n})=>I("Digisub","Monthly",e,n),PRICE_DIGISUB_ANNUAL:({countryCode:e,prices:n})=>I("Digisub","Annual",e,n),PRICE_GUARDIANWEEKLY_MONTHLY:({countryCode:e,prices:n})=>I("GuardianWeekly","Monthly",e,n),PRICE_GUARDIANWEEKLY_ANNUAL:({countryCode:e,prices:n})=>I("GuardianWeekly","Annual",e,n),DAY_OF_THE_WEEK:()=>((e=new Date)=>e.toLocaleString("en-GB",{weekday:"long"}))(),DATE:()=>((e=new Date)=>e.toLocaleString("en-GB",{day:"numeric",month:"long",year:"numeric"}))()},M=(e,n,t)=>e?e.replace(E,(e=>{const a=e.substring(2,e.length-2),i=N[a];if(i){const e=i({countryCode:n,prices:t});if(e)return e}return e})):"",E=/%%.*?%%/g,G=e=>{const n=e.match(E)?.filter((e=>"%%ARTICLE_COUNT%%"!==e));return!!n&&n.length>0},U=e=>{const n=(e=>{const n=new Date(e,10,1).getDay();return new Date(e,10,22+(11-n)%7)})(e);return n.setDate(n.getDate()+5),n},R=(e=new Date)=>{const n=(e=>{const n=e.getDate()<20?1:2;return e.setMonth(e.getMonth()+n),e})(e),t=(n.getMonth()+1).toString().padStart(2,"0"),a=n.toLocaleString("default",{month:"long"}),i=n.getFullYear();return{reminderCta:`Remind me in ${a}`,reminderPeriod:`${i}-${t}-01`,reminderLabel:`${a} ${i}`}},B=new Date("2023-12-31"),P=e=>e>=(e=>new Date(e.getFullYear(),9,20))(e)&&e<U(e.getFullYear()),D=(e,n=new Date)=>{return"US"===e&&P(n)?{reminderCta:"Remind me on Giving Tuesday",reminderPeriod:`${t=n.getFullYear()}-${(U(t).getMonth()+1).toString().padStart(0,"2")}-01`,reminderLabel:"on Giving Tuesday",reminderOption:`giving-tuesday-${t}`}:"US"===e&&(e=>e>=U(e.getFullYear())&&e<B)(n)?(e=>({reminderCta:"Remind me on New Years Eve",reminderPeriod:`${e}-12-01`,reminderLabel:"on New Years Eve",reminderOption:`new-years-eve-${e}`}))(n.getFullYear()):R(n);var t},L=e.object({text:e.string(),baseUrl:e.string()});let w=function(e){return e.Custom="CustomSecondaryCta",e.ContributionsReminder="ContributionsReminderSecondaryCta",e}({});e.nativeEnum(w);const O=e.object({type:e.literal(w.Custom),cta:L}),k=e.object({type:e.literal(w.ContributionsReminder)}),f=e.discriminatedUnion("type",[O,k]);let K=function(e){return e.unlimited="unlimited",e.hardstop="hardstop",e}({});const F=e.nativeEnum(K);let v=function(e){return e.money="money",e}({});const H=e.nativeEnum(v),Y=e.object({countLabel:e.string(),goalReachedPrimary:e.string().optional(),goalReachedSecondary:e.string().optional()}),j=e.object({total:e.number(),goal:e.number()}),V=e.enum(["US","AU"]),W=e.object({endType:F,countType:H,currencySymbol:e.string(),copy:Y,name:V,tickerData:j.optional()}),Z=e.object({for52Weeks:e.number(),forTargetedWeeks:e.number()}),$=e.enum(["for52Weeks","forTargetedWeeks"]),x=e.object({type:e.literal("above"),copy:e.string().optional(),countType:$.optional()}),_=e.enum(["CONTRIBUTION","MEMBERSHIP_SUPPORTER","DIGITAL_SUBSCRIPTION","PRINT_SUBSCRIPTION"]),J=e.enum(["ACQUISITIONS_EPIC","ACQUISITIONS_ENGAGEMENT_BANNER","ACQUISITIONS_SUBSCRIPTIONS_BANNER","ACQUISITIONS_HEADER","ACQUISITIONS_OTHER"]),Q=e.object({abTestName:e.string(),abTestVariant:e.string(),campaignCode:e.string(),componentType:J,products:e.array(_).nullish(),labels:e.array(e.string()).nullish(),ophanPageId:e.string(),platformId:e.string(),referrerUrl:e.string(),clientName:e.string()}),z=e.object({mainUrl:e.string(),mobileUrl:e.string().optional(),tabletUrl:e.string().optional(),desktopUrl:e.string().optional(),leftColUrl:e.string().optional(),wideUrl:e.string().optional(),altText:e.string()}),q=e.object({name:e.string(),description:e.string().optional(),headshot:z.optional()}),X=/^[0-9A-F]{2}$/,ee=e.string().refine((e=>X.test(e)),(e=>({message:`"${e}" is not a valid hex value`}))),ne=e.object({r:ee,g:ee,b:ee,kind:e.literal("hex")}),te=e.object({mobileUrl:e.string(),tabletUrl:e.string(),desktopUrl:e.string(),altText:e.string(),kind:e.literal("Image")}),ae=e.object({buttonColour:ne.nullish(),buttonTextColour:ne.nullish(),buttonBorderColour:ne.nullish(),buttonSelectColour:ne.nullish(),buttonSelectTextColour:ne.nullish(),buttonSelectBorderColour:ne.nullish(),kind:e.literal("ChoiceCards")}),ie=e.discriminatedUnion("kind",[te,ae]),oe=e.object({visual:ie.nullish(),colours:e.object({basic:e.object({background:ne,bodyText:ne})})}),re=e=>`#${e.r}${e.g}${e.b}`,se=e.enum(["Contribution","SupporterPlus","GuardianWeekly","Paper"]),le=e.enum(["new","guest","current"]),ue=e.enum(["Live","Draft","Archived"]),ce=e.enum(["Mobile","Desktop","All","iOS","Android"]),de=e.enum(["SignedIn","SignedOut","All"]),ge=e.enum(["HasConsented","HasNotConsented","All"]),me=e.object({name:e.string(),status:ue,priority:e.number(),controlProportionSettings:e.object({proportion:e.number(),offset:e.number()}).optional(),deviceType:ce.optional(),signedInStatus:de.optional(),consentStatus:ge.optional()}),pe=e.enum(["AllExistingSupporters","AllNonSupporters","Everyone","PostAskPauseSingleContributors"]),Ce=e.object({minViews:e.number(),maxViews:e.number().optional(),periodInWeeks:e.number(),tagIds:e.array(e.string()).optional()});e.object({userType:e.array(le),product:e.array(se)}),e.object({tagIds:e.array(e.string()),sectionIds:e.array(e.string()),excludedTagIds:e.array(e.string()),excludedSectionIds:e.array(e.string())});const be=e.object({maxViewsCount:e.number(),maxViewsDays:e.number(),minDaysBetweenViews:e.number()}),Se=e.object({reminderCta:e.string(),reminderLabel:e.string(),reminderPeriod:e.string()}),he=e.enum(["ONE_OFF","MONTHLY","ANNUAL"]),ye=e.object({testName:e.string(),variantName:e.string(),defaultContributionType:he,displayContributionType:he.array(),amountsCardData:e.object({ONE_OFF:e.object({amounts:e.array(e.number()),defaultAmount:e.number(),hideChooseYourAmount:e.boolean().optional()}),MONTHLY:e.object({amounts:e.array(e.number()),defaultAmount:e.number(),hideChooseYourAmount:e.boolean().optional()}),ANNUAL:e.object({amounts:e.array(e.number()),defaultAmount:e.number(),hideChooseYourAmount:e.boolean().optional()})})}),Ae=e.object({newsletterId:e.string(),successDescription:e.string()}),Te=e.object({name:e.string(),heading:e.string().optional(),paragraphs:e.array(e.string()),highlightedText:e.string().optional(),tickerSettings:W.optional(),cta:L.optional(),secondaryCta:f.optional(),newsletterSignup:Ae.optional(),image:z.optional(),showReminderFields:Se.optional(),separateArticleCount:x.optional(),maxViews:be.optional(),showSignInLink:e.boolean().optional(),bylineWithImage:q.optional(),showChoiceCards:e.boolean().optional(),choiceCardAmounts:ye.optional(),defaultChoiceCardFrequency:he.optional()}),Ie=e.object({variant:Te,tracking:Q,countryCode:e.string().nullish(),articleCounts:Z,onReminderOpen:e.any().nullish(),fetchEmail:e.any().nullish(),submitComponentEvent:e.any().nullish(),openCmp:e.any().nullish(),hasConsentForArticleCount:e.boolean().nullish(),stage:e.string().nullish()}),Ne=e.enum(["contributions","subscriptions","signIn","abandonedBasket"]),Me=e.object({heading:e.string().optional(),messageText:e.string().optional(),paragraphs:e.array(e.string()).optional(),mobileMessageText:e.string().optional(),highlightedText:e.string().optional(),cta:L.optional(),secondaryCta:f.optional()}),Ee=e.object({tracking:Q,bannerChannel:Ne,content:Me.nullish(),mobileContent:Me.nullish(),countryCode:e.string().nullish(),isSupporter:e.boolean().nullish(),tickerSettings:W.nullish(),submitComponentEvent:e.any(),articleCounts:Z,hasOptedOutOfArticleCount:e.boolean().nullish(),fetchEmail:e.any().nullish(),separateArticleCount:e.boolean().nullish(),design:oe.nullish()}),Ge=e.object({heading:e.string(),subheading:e.string(),primaryCta:L.optional(),secondaryCta:L.optional(),benefits:e.array(e.string()).optional()}),Ue=e.object({content:Ge,tracking:Q,mobileContent:Ge.optional(),countryCode:e.string().optional(),submitComponentEvent:e.any(),numArticles:e.number().optional()}),Re=e.object({maxViewsCount:e.number(),maxViewsDays:e.number(),minDaysBetweenViews:e.number()}),Be=["ONE_OFF","MONTHLY","ANNUAL"];me.extend({name:e.string(),status:ue,locations:e.array(g),tagIds:e.array(e.string()),sections:e.array(e.string()),excludedTagIds:e.array(e.string()),excludedSections:e.array(e.string()),alwaysAsk:e.boolean(),maxViews:Re.optional(),userCohort:pe,hasCountryName:e.boolean(),highPriority:e.boolean(),useLocalViewLog:e.boolean(),articlesViewedSettings:Ce.optional(),priority:e.number(),variants:Te.array(),isBanditTest:e.boolean().optional()});const Pe=e.object({amount:e.union([e.number(),e.literal("other")]),billingPeriod:e.union([e.literal("ONE_OFF"),e.literal("MONTHLY"),e.literal("ANNUAL")]),product:e.union([e.literal("Contribution"),e.literal("SupporterPlus"),e.literal("PremiumTier"),e.literal("DailyEdition"),e.literal("GuardianWeekly"),e.literal("Paper"),e.literal("PaperAndDigital")]),region:e.union([e.literal("uk"),e.literal("us"),e.literal("au"),e.literal("eu"),e.literal("int"),e.literal("nz"),e.literal("ca")])}),De=(e,n,t)=>{const a=(e=>{if(URLSearchParams){const n=new URLSearchParams(window.location.search).get(`force-${e}`);if(n)return n}return null})(e);return fetch(`${n}/${e}${a?`?force=${a}`:""}`,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then((n=>{if(!n.ok)throw Error(n.statusText||`Supporter Revenue ${e} | Api call returned HTTP status ${n.status}`);return n})).then((e=>e.json()))},Le=(e,n)=>De("epic",e,n),we=(e,n)=>De("liveblog-epic",e,n),Oe=(e,n)=>De("banner",e,n),ke=(e,n)=>De("header",e,n);export{d as CountryGroupId,w as SecondaryCtaType,v as TickerCountType,K as TickerEndType,Pe as abandonedBasketSchema,T as addRegionIdToSupportUrl,Ee as bannerSchema,R as buildReminderFields,G as containsNonArticleCountPlaceholder,Be as contributionTabFrequencies,b as countryCodeToCountryGroupId,g as countryGroupIdSchema,Ie as epicPropsSchema,Oe as getBanner,y as getCountryName,Le as getEpic,t as getEpicViewLog,ke as getHeader,we as getLiveblogEpic,h as getLocalCurrencySymbol,D as getReminderFields,s as getWeeklyArticleHistory,Ue as headerPropsSchema,re as hexColourToString,S as inCountryGroups,c as incrementWeeklyArticleCount,A as isGWCheckoutUrl,a as logEpicView,M as replaceNonArticleCountPlaceholders};
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("zod");const n="gu.contributions.views",t="gu.history.weeklyArticleCount",a="gu.history.articleCountsThisWeek",r=e=>{const n=e.getDay()||7;return Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()-(n-1))/864e5},o=new Set(["environment/climate-change","environment/climate-crisis","environment/environment","science/science","politics/politics","us-news/us-politics","australia-news/australian-politics","world/world","world/europe-news","world/russia","books/books","culture/culture","world/coronavirus-outbreak","world/race","inequality/inequality","technology/technology","business/business","tone/recipes","sport/sport","football/football","sport/olympic-games","sport/olympic-games-2024","tracking/commissioningdesk/uk-investigations"]),i=(e,n={})=>(e.forEach((e=>{o.has(e)&&(n[e]=(n[e]??0)+1)})),n),s=["GBPCountries","UnitedStates","AUDCountries","EURCountries","International","NZDCountries","Canada"],l=e.z.enum(s),u={GBPCountries:{name:"United Kingdom",currency:"GBP",countries:["GB","FK","GI","GG","IM","JE","SH"],supportRegionId:"UK"},UnitedStates:{name:"United States",currency:"USD",countries:["US"],supportRegionId:"US"},AUDCountries:{name:"Australia",currency:"AUD",countries:["AU","KI","NR","NF","TV"],supportRegionId:"AU"},EURCountries:{name:"Europe",currency:"EUR",countries:["AD","AL","AT","BA","BE","BG","BL","CH","CY","CZ","DE","DK","EE","ES","FI","FO","FR","GF","GL","GP","GR","HR","HU","IE","IT","LI","LT","LU","LV","MC","ME","MF","IS","MQ","MT","NL","NO","PF","PL","PM","PT","RE","RO","RS","SE","SI","SJ","SK","SM","TF","TR","WF","YT","VA","AX","AZ","AM","GE","BY","MD","UA","MK"],supportRegionId:"EU"},International:{name:"International",currency:"USD",countries:["AE","AF","AG","AI","AO","AQ","AR","AS","AW","BB","BD","BF","BH","BI","BJ","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BZ","CC","CD","CF","CG","CI","CL","CM","CN","CO","CR","CU","CV","CW","CX","DJ","DM","DO","DZ","EC","EG","EH","ER","ET","FJ","FM","GA","GD","GH","GM","GN","GQ","GS","GT","GU","GW","GY","HK","HM","HN","HT","ID","IL","IN","IO","IQ","IR","JM","JO","JP","KE","KG","KH","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LK","LR","LS","LY","MA","MG","MH","ML","MM","MN","MO","MP","MR","MS","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NG","NI","NP","NU","OM","PA","PE","PG","PH","PK","PN","PR","PS","PW","PY","QA","RU","RW","SA","SB","SC","SD","SG","SL","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TG","TH","TJ","TK","TL","TM","TN","TO","TT","TW","TZ","UG","UM","UY","UZ","VC","VE","VG","VI","VN","VU","WS","YE","ZA","ZM","ZW"],supportRegionId:"INT"},NZDCountries:{name:"New Zealand",currency:"NZD",countries:["NZ","CK"],supportRegionId:"NZ"},Canada:{name:"Canada",currency:"CAD",countries:["CA"],supportRegionId:"CA"}},c={AD:"Andorra",AE:"the UAE",AF:"Afghanistan",AG:"Antigua and Barbuda",AI:"Anguilla",AL:"Albania",AM:"Armenia",AO:"Angola",AR:"Argentina",AS:"the US",AT:"Austria",AU:"Australia",AW:"Aruba",AX:"Åland Islands",AZ:"Azerbaijan",BA:"Bosnia and Herzegovina",BB:"Barbados",BD:"Bangladesh",BE:"Belgium",BF:"Burkina Faso",BG:"Bulgaria",BH:"Bahrain",BI:"Burundi",BJ:"Benin",BL:"Saint Barthélemy",BM:"Bermuda",BN:"Brunei Darussalam",BO:"Bolivia",BQ:"Bonaire, Sint Eustatius and Saba",BR:"Brazil",BS:"the Bahamas",BT:"Bhutan",BV:"Bouvet Island",BW:"Botswana",BY:"Belarus",BZ:"Belize",CA:"Canada",CD:"the Democratic Republic of the Congo",CF:"the Central Africa Republic",CG:"the Congo",CH:"Switzerland",CI:"Côte d'Ivoire",CK:"the Cook Islands",CL:"Chile",CM:"Cameroon",CN:"China",CO:"Colombia",CR:"Costa Rica",CU:"Cuba",CV:"Cabo Verde",CW:"Curaçao",CX:"Christmas Island",CY:"Cyprus",CZ:"the Czech Republic",DE:"Germany",DJ:"Djibouti",DK:"Denmark",DM:"Dominica",DO:"the Dominican Republic",DZ:"Algeria",EC:"Ecuador",EE:"Estonia",EG:"Egypt",EH:"the Western Sahara",ER:"Eritrea",ES:"Spain",ET:"Ethiopia",FI:"Finland",FJ:"Fiji",FK:"the UK",FO:"the UK",FR:"France",GA:"Gabon",GB:"the UK",GD:"Grenada",GE:"Georgia",GF:"French Guiana",GG:"Guernsey",GH:"Ghana",GI:"Gibraltar",GL:"Greenland",GM:"the Gambia",GN:"Guinea",GP:"Guadeloupe",GQ:"Equatorial Guinea",GR:"Greece",GT:"Guatemala",GU:"Guam",GW:"Guinea-Bissau",GY:"Guyana",HK:"Hong Kong",HN:"Honduras",HR:"Croatia",HT:"Haiti",HU:"Hungary",ID:"Indonesia",IE:"Ireland",IM:"the Isle of Man",IN:"India",IQ:"Iraq",IR:"Iran",IS:"Iceland",IT:"Italy",JE:"Jersey",JM:"Jamaica",JO:"Jordan",JP:"Japan",KE:"Kenya",KG:"Kyrgyzstan",KH:"Cambodia",KI:"Kiribati",KN:"Saint Kitts and Nevis",KP:"Korea",KR:"Korea",KW:"Kuwait",KY:"the Cayman Ialnds",KZ:"Kazakhstan",LB:"Lebanon",LC:"Saint Lucia",LI:"Liechtenstein",LK:"Sri Lanka",LR:"Liberia",LS:"Lesotho",LT:"Lithuania",LU:"Luxembourg",LV:"Latvia",LY:"Libya",MA:"Morocco",MC:"Monaco",MD:"Moldova",ME:"Montenegro",MG:"Madagascar",MK:"the Republic of North Macedonia",ML:"Mali",MM:"Myanmar",MN:"Mongolia",MO:"Macao",MQ:"Martinique",MR:"Mauritania",MS:"Montserrat",MT:"Malta",MU:"Mauritius",MV:"Maldives",MW:"Malawi",MX:"Mexico",MY:"Malaysia",MZ:"Mozambique",NA:"Namibia",NC:"New Caledonia",NE:"Niger",NF:"Norfolk Island",NG:"Nigeria",NI:"Nicaragua",NL:"the Netherlands",NO:"Norway",NP:"Nepal",NR:"Nauru",NU:"Niue",NZ:"New Zealand",OM:"Oman",PA:"Panama",PE:"Peru",PF:"French Polynesia",PG:"Papua New Guinea",PH:"the Philippines",PK:"Pakistan",PL:"Poland",PM:"Saint Pierre and Miquelon",PN:"Pitcairn",PR:"Puerto Rico",PT:"Portugal",PW:"Palau",PY:"Paraguay",QA:"Qatar",RE:"Réunion",RO:"Romania",RU:"Russia",RW:"Rwanda",SA:"Saudi Arabia",SB:"Solomon Islands",SC:"Seychelles",SD:"Sudan",SE:"Sweden",SG:"Singapore",SH:"Saint Helena",SI:"Slovenia",SJ:"Svalbard and Jan Mayen",SK:"Slovakia",SL:"Sierra Leone",SM:"San Marino",SN:"Senegal",SO:"Somalia",SR:"Suriname",SS:"South Sudan",ST:"Sao Tome and Principe",SV:"El Salvador",SY:"Syrian Arab Republic",SZ:"Eswatini",TD:"Chad",TG:"Togo",TH:"Thailand",TJ:"Tajikistan",TK:"Tokelau",TL:"Timor-Leste",TM:"Turkmenistan",TN:"Tunisia",TO:"Tonga",TR:"Turkey",TT:"Trinidad and Tobago",TV:"Tuvalu",TW:"Taiwan",TZ:"Tanzania ",UG:"Uganda",US:"the US",UY:"Uruguay",UZ:"Uzbekistan",VC:"Saint Vincent and the Grenadines",VE:"Venezuela",VG:"the Virgin Islands",VI:"the Virgin Islands",VN:"Vietnam",VU:"Vanuatu",WF:"Wallis and Futuna",WS:"Samoa",YE:"Yemen",YT:"Mayotte",ZA:"South Africa",ZM:"Zambia",ZW:"Zimbabwe"},d={GBPCountries:"£",UnitedStates:"$",AUDCountries:"$",Canada:"CA$",EURCountries:"€",NZDCountries:"NZ$",International:"$"},g=e=>Object.keys(u).find((n=>u[n].countries.includes(e??"")))||"International",p=e=>{if(e){const n=g(e);return d[n]}return"£"},z=e=>{if(e)return c[e]},m=e=>/subscribe\/weekly\/checkout/.test(e),C=(e,n,t,a)=>{if(a){const r=a[g(t)];if(r){return`${p(t)}${r[e][n].price}`}}},b={CURRENCY_SYMBOL:({countryCode:e})=>p(e),COUNTRY_NAME:({countryCode:e})=>z(e),PRICE_DIGISUB_MONTHLY:({countryCode:e,prices:n})=>C("Digisub","Monthly",e,n),PRICE_DIGISUB_ANNUAL:({countryCode:e,prices:n})=>C("Digisub","Annual",e,n),PRICE_GUARDIANWEEKLY_MONTHLY:({countryCode:e,prices:n})=>C("GuardianWeekly","Monthly",e,n),PRICE_GUARDIANWEEKLY_ANNUAL:({countryCode:e,prices:n})=>C("GuardianWeekly","Annual",e,n),DAY_OF_THE_WEEK:()=>((e=new Date)=>e.toLocaleString("en-GB",{weekday:"long"}))(),DATE:()=>((e=new Date)=>e.toLocaleString("en-GB",{day:"numeric",month:"long",year:"numeric"}))()},S=/%%.*?%%/g,h=e=>{const n=(e=>{const n=new Date(e,10,1).getDay();return new Date(e,10,22+(11-n)%7)})(e);return n.setDate(n.getDate()+5),n},y=(e=new Date)=>{const n=(e=>{const n=e.getDate()<20?1:2;return e.setMonth(e.getMonth()+n),e})(e),t=(n.getMonth()+1).toString().padStart(2,"0"),a=n.toLocaleString("default",{month:"long"}),r=n.getFullYear();return{reminderCta:`Remind me in ${a}`,reminderPeriod:`${r}-${t}-01`,reminderLabel:`${a} ${r}`}},A=new Date("2023-12-31"),T=e=>e>=(e=>new Date(e.getFullYear(),9,20))(e)&&e<h(e.getFullYear()),I=e.z.object({text:e.z.string(),baseUrl:e.z.string()});let N=function(e){return e.Custom="CustomSecondaryCta",e.ContributionsReminder="ContributionsReminderSecondaryCta",e}({});e.z.nativeEnum(N);const M=e.z.object({type:e.z.literal(N.Custom),cta:I}),E=e.z.object({type:e.z.literal(N.ContributionsReminder)}),G=e.z.discriminatedUnion("type",[M,E]);let U=function(e){return e.unlimited="unlimited",e.hardstop="hardstop",e}({});const R=e.z.nativeEnum(U);let B=function(e){return e.money="money",e}({});const P=e.z.nativeEnum(B),L=e.z.object({countLabel:e.z.string(),goalReachedPrimary:e.z.string(),goalReachedSecondary:e.z.string()}),D=e.z.object({total:e.z.number(),goal:e.z.number()}),w=e.z.enum(["US","AU"]),O=e.z.object({endType:R,countType:P,currencySymbol:e.z.string(),copy:L,name:w,tickerData:D.optional()}),k=e.z.object({for52Weeks:e.z.number(),forTargetedWeeks:e.z.number()}),x=e.z.enum(["for52Weeks","forTargetedWeeks"]),f=e.z.object({type:e.z.literal("above"),copy:e.z.string().optional(),countType:x.optional()}),F=e.z.enum(["CONTRIBUTION","MEMBERSHIP_SUPPORTER","DIGITAL_SUBSCRIPTION","PRINT_SUBSCRIPTION"]),K=e.z.enum(["ACQUISITIONS_EPIC","ACQUISITIONS_ENGAGEMENT_BANNER","ACQUISITIONS_SUBSCRIPTIONS_BANNER","ACQUISITIONS_HEADER","ACQUISITIONS_OTHER"]),v=e.z.object({abTestName:e.z.string(),abTestVariant:e.z.string(),campaignCode:e.z.string(),componentType:K,products:e.z.array(F).nullish(),labels:e.z.array(e.z.string()).nullish(),ophanPageId:e.z.string(),platformId:e.z.string(),referrerUrl:e.z.string(),clientName:e.z.string()}),H=e.z.object({mainUrl:e.z.string(),mobileUrl:e.z.string().optional(),tabletUrl:e.z.string().optional(),desktopUrl:e.z.string().optional(),leftColUrl:e.z.string().optional(),wideUrl:e.z.string().optional(),altText:e.z.string()}),V=e.z.object({name:e.z.string(),description:e.z.string().optional(),headshot:H.optional()}),Y=/^[0-9A-F]{2}$/,j=e.z.string().refine((e=>Y.test(e)),(e=>({message:`"${e}" is not a valid hex value`}))),W=e.z.object({r:j,g:j,b:j,kind:e.z.literal("hex")}),Z=e.z.object({mobileUrl:e.z.string(),tabletUrl:e.z.string(),desktopUrl:e.z.string(),altText:e.z.string(),kind:e.z.literal("Image")}),$=e.z.object({buttonColour:W.nullish(),buttonTextColour:W.nullish(),buttonBorderColour:W.nullish(),buttonSelectColour:W.nullish(),buttonSelectTextColour:W.nullish(),buttonSelectBorderColour:W.nullish(),kind:e.z.literal("ChoiceCards")}),_=e.z.discriminatedUnion("kind",[Z,$]),J=e.z.object({visual:_.nullish(),colours:e.z.object({basic:e.z.object({background:W,bodyText:W})})}),Q=e.z.enum(["Contribution","SupporterPlus","GuardianWeekly","Paper"]),q=e.z.enum(["new","guest","current"]),X=e.z.enum(["Live","Draft","Archived"]),ee=e.z.enum(["Mobile","Desktop","All","iOS","Android"]),ne=e.z.enum(["SignedIn","SignedOut","All"]),te=e.z.enum(["HasConsented","HasNotConsented","All"]),ae=e.z.object({name:e.z.string(),status:X,priority:e.z.number(),controlProportionSettings:e.z.object({proportion:e.z.number(),offset:e.z.number()}).optional(),deviceType:ee.optional(),signedInStatus:ne.optional(),consentStatus:te.optional()}),re=e.z.enum(["AllExistingSupporters","AllNonSupporters","Everyone","PostAskPauseSingleContributors"]),oe=e.z.object({minViews:e.z.number(),maxViews:e.z.number().optional(),periodInWeeks:e.z.number(),tagIds:e.z.array(e.z.string()).optional()});e.z.object({userType:e.z.array(q),product:e.z.array(Q)}),e.z.object({tagIds:e.z.array(e.z.string()),sectionIds:e.z.array(e.z.string()),excludedTagIds:e.z.array(e.z.string()),excludedSectionIds:e.z.array(e.z.string())});const ie=e.z.object({maxViewsCount:e.z.number(),maxViewsDays:e.z.number(),minDaysBetweenViews:e.z.number()}),se=e.z.object({reminderCta:e.z.string(),reminderLabel:e.z.string(),reminderPeriod:e.z.string()}),le=e.z.enum(["ONE_OFF","MONTHLY","ANNUAL"]),ue=e.z.object({testName:e.z.string(),variantName:e.z.string(),defaultContributionType:le,displayContributionType:le.array(),amountsCardData:e.z.object({ONE_OFF:e.z.object({amounts:e.z.array(e.z.number()),defaultAmount:e.z.number(),hideChooseYourAmount:e.z.boolean().optional()}),MONTHLY:e.z.object({amounts:e.z.array(e.z.number()),defaultAmount:e.z.number(),hideChooseYourAmount:e.z.boolean().optional()}),ANNUAL:e.z.object({amounts:e.z.array(e.z.number()),defaultAmount:e.z.number(),hideChooseYourAmount:e.z.boolean().optional()})})}),ce=e.z.object({newsletterId:e.z.string(),successDescription:e.z.string()}),de=e.z.object({name:e.z.string(),heading:e.z.string().optional(),paragraphs:e.z.array(e.z.string()),highlightedText:e.z.string().optional(),tickerSettings:O.optional(),cta:I.optional(),secondaryCta:G.optional(),newsletterSignup:ce.optional(),image:H.optional(),showReminderFields:se.optional(),separateArticleCount:f.optional(),maxViews:ie.optional(),showSignInLink:e.z.boolean().optional(),bylineWithImage:V.optional(),showChoiceCards:e.z.boolean().optional(),choiceCardAmounts:ue.optional(),defaultChoiceCardFrequency:le.optional()}),ge=e.z.object({variant:de,tracking:v,countryCode:e.z.string().nullish(),articleCounts:k,onReminderOpen:e.z.any().nullish(),fetchEmail:e.z.any().nullish(),submitComponentEvent:e.z.any().nullish(),openCmp:e.z.any().nullish(),hasConsentForArticleCount:e.z.boolean().nullish(),stage:e.z.string().nullish()}),pe=e.z.enum(["contributions","subscriptions","signIn","abandonedBasket"]),ze=e.z.object({heading:e.z.string().optional(),messageText:e.z.string().optional(),paragraphs:e.z.array(e.z.string()).optional(),mobileMessageText:e.z.string().optional(),highlightedText:e.z.string().optional(),cta:I.optional(),secondaryCta:G.optional()}),me=e.z.object({tracking:v,bannerChannel:pe,content:ze.nullish(),mobileContent:ze.nullish(),countryCode:e.z.string().nullish(),isSupporter:e.z.boolean().nullish(),tickerSettings:O.nullish(),submitComponentEvent:e.z.any(),articleCounts:k,hasOptedOutOfArticleCount:e.z.boolean().nullish(),fetchEmail:e.z.any().nullish(),separateArticleCount:e.z.boolean().nullish(),design:J.nullish()}),Ce=e.z.object({heading:e.z.string(),subheading:e.z.string(),primaryCta:I.optional(),secondaryCta:I.optional(),benefits:e.z.array(e.z.string()).optional()}),be=e.z.object({content:Ce,tracking:v,mobileContent:Ce.optional(),countryCode:e.z.string().optional(),submitComponentEvent:e.z.any(),numArticles:e.z.number().optional()}),Se=e.z.object({maxViewsCount:e.z.number(),maxViewsDays:e.z.number(),minDaysBetweenViews:e.z.number()});ae.extend({name:e.z.string(),status:X,locations:e.z.array(l),tagIds:e.z.array(e.z.string()),sections:e.z.array(e.z.string()),excludedTagIds:e.z.array(e.z.string()),excludedSections:e.z.array(e.z.string()),alwaysAsk:e.z.boolean(),maxViews:Se.optional(),userCohort:re,hasCountryName:e.z.boolean(),highPriority:e.z.boolean(),useLocalViewLog:e.z.boolean(),articlesViewedSettings:oe.optional(),priority:e.z.number(),variants:de.array(),isBanditTest:e.z.boolean().optional()});const he=e.z.object({amount:e.z.union([e.z.number(),e.z.literal("other")]),billingPeriod:e.z.union([e.z.literal("ONE_OFF"),e.z.literal("MONTHLY"),e.z.literal("ANNUAL")]),product:e.z.union([e.z.literal("Contribution"),e.z.literal("SupporterPlus"),e.z.literal("PremiumTier"),e.z.literal("DailyEdition"),e.z.literal("GuardianWeekly"),e.z.literal("Paper"),e.z.literal("PaperAndDigital")]),region:e.z.union([e.z.literal("uk"),e.z.literal("us"),e.z.literal("au"),e.z.literal("eu"),e.z.literal("int"),e.z.literal("nz"),e.z.literal("ca")])}),ye=(e,n,t)=>{const a=(e=>{if(URLSearchParams){const n=new URLSearchParams(window.location.search).get(`force-${e}`);if(n)return n}return null})(e);return fetch(`${n}/${e}${a?`?force=${a}`:""}`,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then((n=>{if(!n.ok)throw Error(n.statusText||`Supporter Revenue ${e} | Api call returned HTTP status ${n.status}`);return n})).then((e=>e.json()))};exports.CountryGroupId=s,exports.SecondaryCtaType=N,exports.TickerCountType=B,exports.TickerEndType=U,exports.abandonedBasketSchema=he,exports.addRegionIdToSupportUrl=(e,n)=>{if(n){const t=(e=>u[g(e)]?.supportRegionId)(n);if(t&&!m(e))return e.replace(/(support.theguardian.com)\/(contribute-in-epic|contribute|subscribe)/,((e,n,a)=>`${n}/${t.toLowerCase()}/${a}`))}return e},exports.bannerSchema=me,exports.buildReminderFields=y,exports.containsNonArticleCountPlaceholder=e=>{const n=e.match(S)?.filter((e=>"%%ARTICLE_COUNT%%"!==e));return!!n&&n.length>0},exports.contributionTabFrequencies=["ONE_OFF","MONTHLY","ANNUAL"],exports.countryCodeToCountryGroupId=g,exports.countryGroupIdSchema=l,exports.epicPropsSchema=ge,exports.getBanner=(e,n)=>ye("banner",e,n),exports.getCountryName=z,exports.getEpic=(e,n)=>ye("epic",e,n),exports.getEpicViewLog=e=>e.get(n)||void 0,exports.getHeader=(e,n)=>ye("header",e,n),exports.getLiveblogEpic=(e,n)=>ye("liveblog-epic",e,n),exports.getLocalCurrencySymbol=p,exports.getReminderFields=(e,n=new Date)=>{return"US"===e&&T(n)?{reminderCta:"Remind me on Giving Tuesday",reminderPeriod:`${t=n.getFullYear()}-${(h(t).getMonth()+1).toString().padStart(0,"2")}-01`,reminderLabel:"on Giving Tuesday",reminderOption:`giving-tuesday-${t}`}:"US"===e&&(e=>e>=h(e.getFullYear())&&e<A)(n)?(e=>({reminderCta:"Remind me on New Years Eve",reminderPeriod:`${e}-12-01`,reminderLabel:"on New Years Eve",reminderOption:`new-years-eve-${e}`}))(n.getFullYear()):y(n);var t},exports.getWeeklyArticleHistory=e=>e.get(t)||void 0,exports.headerPropsSchema=be,exports.hexColourToString=e=>`#${e.r}${e.g}${e.b}`,exports.inCountryGroups=(e,n=[])=>0===n.length||!!e&&n.includes(g(e.toUpperCase())),exports.incrementWeeklyArticleCount=(e,n,o)=>{const s=((e,n)=>{const t=r(new Date),o=e.get(a);if(o&&o.week===t){const r=o.articles[n]||0;return e.set(a,{week:t,articles:{...o.articles,[n]:r+1}}),r>0}return e.set(a,{week:t,articles:{[n]:1}}),!1})(e,n);if(!s){const n=r(new Date),a=e.get(t)||[],s=a[0];if(s&&s.week&&s.week===n)s.count+=1,s.tags=i(o,s.tags),e.set(t,a);else{a.unshift({week:n,count:1,tags:i(o,{})});const r=n-365,s=a.filter((e=>e.week>=r));e.set(t,s)}}},exports.isGWCheckoutUrl=m,exports.logEpicView=e=>{const t=localStorage.getItem(n),a=t?JSON.parse(t).value:[];a.push({date:(new Date).getTime(),testId:e});const r={value:a.slice(-50)};localStorage.setItem(n,JSON.stringify(r))},exports.replaceNonArticleCountPlaceholders=(e,n,t)=>e?e.replace(S,(e=>{const a=e.substring(2,e.length-2),r=b[a];if(r){const e=r({countryCode:n,prices:t});if(e)return e}return e})):"";
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("zod");const n="gu.contributions.views",t="gu.history.weeklyArticleCount",a="gu.history.articleCountsThisWeek",o=e=>{const n=e.getDay()||7;return Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()-(n-1))/864e5},r=new Set(["environment/climate-change","environment/climate-crisis","environment/environment","science/science","politics/politics","us-news/us-politics","australia-news/australian-politics","world/world","world/europe-news","world/russia","books/books","culture/culture","world/coronavirus-outbreak","world/race","inequality/inequality","technology/technology","business/business","tone/recipes","sport/sport","football/football","sport/olympic-games","sport/olympic-games-2024","tracking/commissioningdesk/uk-investigations"]),i=(e,n={})=>(e.forEach((e=>{r.has(e)&&(n[e]=(n[e]??0)+1)})),n),s=["GBPCountries","UnitedStates","AUDCountries","EURCountries","International","NZDCountries","Canada"],l=e.z.enum(s),u={GBPCountries:{name:"United Kingdom",currency:"GBP",countries:["GB","FK","GI","GG","IM","JE","SH"],supportRegionId:"UK"},UnitedStates:{name:"United States",currency:"USD",countries:["US"],supportRegionId:"US"},AUDCountries:{name:"Australia",currency:"AUD",countries:["AU","KI","NR","NF","TV"],supportRegionId:"AU"},EURCountries:{name:"Europe",currency:"EUR",countries:["AD","AL","AT","BA","BE","BG","BL","CH","CY","CZ","DE","DK","EE","ES","FI","FO","FR","GF","GL","GP","GR","HR","HU","IE","IT","LI","LT","LU","LV","MC","ME","MF","IS","MQ","MT","NL","NO","PF","PL","PM","PT","RE","RO","RS","SE","SI","SJ","SK","SM","TF","TR","WF","YT","VA","AX","AZ","AM","GE","BY","MD","UA","MK"],supportRegionId:"EU"},International:{name:"International",currency:"USD",countries:["AE","AF","AG","AI","AO","AQ","AR","AS","AW","BB","BD","BF","BH","BI","BJ","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BZ","CC","CD","CF","CG","CI","CL","CM","CN","CO","CR","CU","CV","CW","CX","DJ","DM","DO","DZ","EC","EG","EH","ER","ET","FJ","FM","GA","GD","GH","GM","GN","GQ","GS","GT","GU","GW","GY","HK","HM","HN","HT","ID","IL","IN","IO","IQ","IR","JM","JO","JP","KE","KG","KH","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LK","LR","LS","LY","MA","MG","MH","ML","MM","MN","MO","MP","MR","MS","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NG","NI","NP","NU","OM","PA","PE","PG","PH","PK","PN","PR","PS","PW","PY","QA","RU","RW","SA","SB","SC","SD","SG","SL","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TG","TH","TJ","TK","TL","TM","TN","TO","TT","TW","TZ","UG","UM","UY","UZ","VC","VE","VG","VI","VN","VU","WS","YE","ZA","ZM","ZW"],supportRegionId:"INT"},NZDCountries:{name:"New Zealand",currency:"NZD",countries:["NZ","CK"],supportRegionId:"NZ"},Canada:{name:"Canada",currency:"CAD",countries:["CA"],supportRegionId:"CA"}},c={AD:"Andorra",AE:"the UAE",AF:"Afghanistan",AG:"Antigua and Barbuda",AI:"Anguilla",AL:"Albania",AM:"Armenia",AO:"Angola",AR:"Argentina",AS:"the US",AT:"Austria",AU:"Australia",AW:"Aruba",AX:"Åland Islands",AZ:"Azerbaijan",BA:"Bosnia and Herzegovina",BB:"Barbados",BD:"Bangladesh",BE:"Belgium",BF:"Burkina Faso",BG:"Bulgaria",BH:"Bahrain",BI:"Burundi",BJ:"Benin",BL:"Saint Barthélemy",BM:"Bermuda",BN:"Brunei Darussalam",BO:"Bolivia",BQ:"Bonaire, Sint Eustatius and Saba",BR:"Brazil",BS:"the Bahamas",BT:"Bhutan",BV:"Bouvet Island",BW:"Botswana",BY:"Belarus",BZ:"Belize",CA:"Canada",CD:"the Democratic Republic of the Congo",CF:"the Central Africa Republic",CG:"the Congo",CH:"Switzerland",CI:"Côte d'Ivoire",CK:"the Cook Islands",CL:"Chile",CM:"Cameroon",CN:"China",CO:"Colombia",CR:"Costa Rica",CU:"Cuba",CV:"Cabo Verde",CW:"Curaçao",CX:"Christmas Island",CY:"Cyprus",CZ:"the Czech Republic",DE:"Germany",DJ:"Djibouti",DK:"Denmark",DM:"Dominica",DO:"the Dominican Republic",DZ:"Algeria",EC:"Ecuador",EE:"Estonia",EG:"Egypt",EH:"the Western Sahara",ER:"Eritrea",ES:"Spain",ET:"Ethiopia",FI:"Finland",FJ:"Fiji",FK:"the UK",FO:"the UK",FR:"France",GA:"Gabon",GB:"the UK",GD:"Grenada",GE:"Georgia",GF:"French Guiana",GG:"Guernsey",GH:"Ghana",GI:"Gibraltar",GL:"Greenland",GM:"the Gambia",GN:"Guinea",GP:"Guadeloupe",GQ:"Equatorial Guinea",GR:"Greece",GT:"Guatemala",GU:"Guam",GW:"Guinea-Bissau",GY:"Guyana",HK:"Hong Kong",HN:"Honduras",HR:"Croatia",HT:"Haiti",HU:"Hungary",ID:"Indonesia",IE:"Ireland",IM:"the Isle of Man",IN:"India",IQ:"Iraq",IR:"Iran",IS:"Iceland",IT:"Italy",JE:"Jersey",JM:"Jamaica",JO:"Jordan",JP:"Japan",KE:"Kenya",KG:"Kyrgyzstan",KH:"Cambodia",KI:"Kiribati",KN:"Saint Kitts and Nevis",KP:"Korea",KR:"Korea",KW:"Kuwait",KY:"the Cayman Ialnds",KZ:"Kazakhstan",LB:"Lebanon",LC:"Saint Lucia",LI:"Liechtenstein",LK:"Sri Lanka",LR:"Liberia",LS:"Lesotho",LT:"Lithuania",LU:"Luxembourg",LV:"Latvia",LY:"Libya",MA:"Morocco",MC:"Monaco",MD:"Moldova",ME:"Montenegro",MG:"Madagascar",MK:"the Republic of North Macedonia",ML:"Mali",MM:"Myanmar",MN:"Mongolia",MO:"Macao",MQ:"Martinique",MR:"Mauritania",MS:"Montserrat",MT:"Malta",MU:"Mauritius",MV:"Maldives",MW:"Malawi",MX:"Mexico",MY:"Malaysia",MZ:"Mozambique",NA:"Namibia",NC:"New Caledonia",NE:"Niger",NF:"Norfolk Island",NG:"Nigeria",NI:"Nicaragua",NL:"the Netherlands",NO:"Norway",NP:"Nepal",NR:"Nauru",NU:"Niue",NZ:"New Zealand",OM:"Oman",PA:"Panama",PE:"Peru",PF:"French Polynesia",PG:"Papua New Guinea",PH:"the Philippines",PK:"Pakistan",PL:"Poland",PM:"Saint Pierre and Miquelon",PN:"Pitcairn",PR:"Puerto Rico",PT:"Portugal",PW:"Palau",PY:"Paraguay",QA:"Qatar",RE:"Réunion",RO:"Romania",RU:"Russia",RW:"Rwanda",SA:"Saudi Arabia",SB:"Solomon Islands",SC:"Seychelles",SD:"Sudan",SE:"Sweden",SG:"Singapore",SH:"Saint Helena",SI:"Slovenia",SJ:"Svalbard and Jan Mayen",SK:"Slovakia",SL:"Sierra Leone",SM:"San Marino",SN:"Senegal",SO:"Somalia",SR:"Suriname",SS:"South Sudan",ST:"Sao Tome and Principe",SV:"El Salvador",SY:"Syrian Arab Republic",SZ:"Eswatini",TD:"Chad",TG:"Togo",TH:"Thailand",TJ:"Tajikistan",TK:"Tokelau",TL:"Timor-Leste",TM:"Turkmenistan",TN:"Tunisia",TO:"Tonga",TR:"Turkey",TT:"Trinidad and Tobago",TV:"Tuvalu",TW:"Taiwan",TZ:"Tanzania ",UG:"Uganda",US:"the US",UY:"Uruguay",UZ:"Uzbekistan",VC:"Saint Vincent and the Grenadines",VE:"Venezuela",VG:"the Virgin Islands",VI:"the Virgin Islands",VN:"Vietnam",VU:"Vanuatu",WF:"Wallis and Futuna",WS:"Samoa",YE:"Yemen",YT:"Mayotte",ZA:"South Africa",ZM:"Zambia",ZW:"Zimbabwe"},d={GBPCountries:"£",UnitedStates:"$",AUDCountries:"$",Canada:"CA$",EURCountries:"€",NZDCountries:"NZ$",International:"$"},p=e=>Object.keys(u).find((n=>u[n].countries.includes(e??"")))||"International",g=e=>{if(e){const n=p(e);return d[n]}return"£"},z=e=>{if(e)return c[e]},m=e=>/subscribe\/weekly\/checkout/.test(e),C=(e,n,t,a)=>{if(a){const o=a[p(t)];if(o){return`${g(t)}${o[e][n].price}`}}},b={CURRENCY_SYMBOL:({countryCode:e})=>g(e),COUNTRY_NAME:({countryCode:e})=>z(e),PRICE_DIGISUB_MONTHLY:({countryCode:e,prices:n})=>C("Digisub","Monthly",e,n),PRICE_DIGISUB_ANNUAL:({countryCode:e,prices:n})=>C("Digisub","Annual",e,n),PRICE_GUARDIANWEEKLY_MONTHLY:({countryCode:e,prices:n})=>C("GuardianWeekly","Monthly",e,n),PRICE_GUARDIANWEEKLY_ANNUAL:({countryCode:e,prices:n})=>C("GuardianWeekly","Annual",e,n),DAY_OF_THE_WEEK:()=>((e=new Date)=>e.toLocaleString("en-GB",{weekday:"long"}))(),DATE:()=>((e=new Date)=>e.toLocaleString("en-GB",{day:"numeric",month:"long",year:"numeric"}))()},S=/%%.*?%%/g,h=e=>{const n=(e=>{const n=new Date(e,10,1).getDay();return new Date(e,10,22+(11-n)%7)})(e);return n.setDate(n.getDate()+5),n},y=(e=new Date)=>{const n=(e=>{const n=e.getDate()<20?1:2;return e.setMonth(e.getMonth()+n),e})(e),t=(n.getMonth()+1).toString().padStart(2,"0"),a=n.toLocaleString("default",{month:"long"}),o=n.getFullYear();return{reminderCta:`Remind me in ${a}`,reminderPeriod:`${o}-${t}-01`,reminderLabel:`${a} ${o}`}},A=new Date("2023-12-31"),T=e=>e>=(e=>new Date(e.getFullYear(),9,20))(e)&&e<h(e.getFullYear()),I=e.z.object({text:e.z.string(),baseUrl:e.z.string()});let N=function(e){return e.Custom="CustomSecondaryCta",e.ContributionsReminder="ContributionsReminderSecondaryCta",e}({});e.z.nativeEnum(N);const M=e.z.object({type:e.z.literal(N.Custom),cta:I}),E=e.z.object({type:e.z.literal(N.ContributionsReminder)}),G=e.z.discriminatedUnion("type",[M,E]);let U=function(e){return e.unlimited="unlimited",e.hardstop="hardstop",e}({});const R=e.z.nativeEnum(U);let B=function(e){return e.money="money",e}({});const P=e.z.nativeEnum(B),L=e.z.object({countLabel:e.z.string(),goalReachedPrimary:e.z.string().optional(),goalReachedSecondary:e.z.string().optional()}),D=e.z.object({total:e.z.number(),goal:e.z.number()}),w=e.z.enum(["US","AU"]),O=e.z.object({endType:R,countType:P,currencySymbol:e.z.string(),copy:L,name:w,tickerData:D.optional()}),k=e.z.object({for52Weeks:e.z.number(),forTargetedWeeks:e.z.number()}),x=e.z.enum(["for52Weeks","forTargetedWeeks"]),f=e.z.object({type:e.z.literal("above"),copy:e.z.string().optional(),countType:x.optional()}),F=e.z.enum(["CONTRIBUTION","MEMBERSHIP_SUPPORTER","DIGITAL_SUBSCRIPTION","PRINT_SUBSCRIPTION"]),K=e.z.enum(["ACQUISITIONS_EPIC","ACQUISITIONS_ENGAGEMENT_BANNER","ACQUISITIONS_SUBSCRIPTIONS_BANNER","ACQUISITIONS_HEADER","ACQUISITIONS_OTHER"]),v=e.z.object({abTestName:e.z.string(),abTestVariant:e.z.string(),campaignCode:e.z.string(),componentType:K,products:e.z.array(F).nullish(),labels:e.z.array(e.z.string()).nullish(),ophanPageId:e.z.string(),platformId:e.z.string(),referrerUrl:e.z.string(),clientName:e.z.string()}),H=e.z.object({mainUrl:e.z.string(),mobileUrl:e.z.string().optional(),tabletUrl:e.z.string().optional(),desktopUrl:e.z.string().optional(),leftColUrl:e.z.string().optional(),wideUrl:e.z.string().optional(),altText:e.z.string()}),V=e.z.object({name:e.z.string(),description:e.z.string().optional(),headshot:H.optional()}),Y=/^[0-9A-F]{2}$/,j=e.z.string().refine((e=>Y.test(e)),(e=>({message:`"${e}" is not a valid hex value`}))),W=e.z.object({r:j,g:j,b:j,kind:e.z.literal("hex")}),Z=e.z.object({mobileUrl:e.z.string(),tabletUrl:e.z.string(),desktopUrl:e.z.string(),altText:e.z.string(),kind:e.z.literal("Image")}),$=e.z.object({buttonColour:W.nullish(),buttonTextColour:W.nullish(),buttonBorderColour:W.nullish(),buttonSelectColour:W.nullish(),buttonSelectTextColour:W.nullish(),buttonSelectBorderColour:W.nullish(),kind:e.z.literal("ChoiceCards")}),_=e.z.discriminatedUnion("kind",[Z,$]),J=e.z.object({visual:_.nullish(),colours:e.z.object({basic:e.z.object({background:W,bodyText:W})})}),Q=e.z.enum(["Contribution","SupporterPlus","GuardianWeekly","Paper"]),q=e.z.enum(["new","guest","current"]),X=e.z.enum(["Live","Draft","Archived"]),ee=e.z.enum(["Mobile","Desktop","All","iOS","Android"]),ne=e.z.enum(["SignedIn","SignedOut","All"]),te=e.z.enum(["HasConsented","HasNotConsented","All"]),ae=e.z.object({name:e.z.string(),status:X,priority:e.z.number(),controlProportionSettings:e.z.object({proportion:e.z.number(),offset:e.z.number()}).optional(),deviceType:ee.optional(),signedInStatus:ne.optional(),consentStatus:te.optional()}),oe=e.z.enum(["AllExistingSupporters","AllNonSupporters","Everyone","PostAskPauseSingleContributors"]),re=e.z.object({minViews:e.z.number(),maxViews:e.z.number().optional(),periodInWeeks:e.z.number(),tagIds:e.z.array(e.z.string()).optional()});e.z.object({userType:e.z.array(q),product:e.z.array(Q)}),e.z.object({tagIds:e.z.array(e.z.string()),sectionIds:e.z.array(e.z.string()),excludedTagIds:e.z.array(e.z.string()),excludedSectionIds:e.z.array(e.z.string())});const ie=e.z.object({maxViewsCount:e.z.number(),maxViewsDays:e.z.number(),minDaysBetweenViews:e.z.number()}),se=e.z.object({reminderCta:e.z.string(),reminderLabel:e.z.string(),reminderPeriod:e.z.string()}),le=e.z.enum(["ONE_OFF","MONTHLY","ANNUAL"]),ue=e.z.object({testName:e.z.string(),variantName:e.z.string(),defaultContributionType:le,displayContributionType:le.array(),amountsCardData:e.z.object({ONE_OFF:e.z.object({amounts:e.z.array(e.z.number()),defaultAmount:e.z.number(),hideChooseYourAmount:e.z.boolean().optional()}),MONTHLY:e.z.object({amounts:e.z.array(e.z.number()),defaultAmount:e.z.number(),hideChooseYourAmount:e.z.boolean().optional()}),ANNUAL:e.z.object({amounts:e.z.array(e.z.number()),defaultAmount:e.z.number(),hideChooseYourAmount:e.z.boolean().optional()})})}),ce=e.z.object({newsletterId:e.z.string(),successDescription:e.z.string()}),de=e.z.object({name:e.z.string(),heading:e.z.string().optional(),paragraphs:e.z.array(e.z.string()),highlightedText:e.z.string().optional(),tickerSettings:O.optional(),cta:I.optional(),secondaryCta:G.optional(),newsletterSignup:ce.optional(),image:H.optional(),showReminderFields:se.optional(),separateArticleCount:f.optional(),maxViews:ie.optional(),showSignInLink:e.z.boolean().optional(),bylineWithImage:V.optional(),showChoiceCards:e.z.boolean().optional(),choiceCardAmounts:ue.optional(),defaultChoiceCardFrequency:le.optional()}),pe=e.z.object({variant:de,tracking:v,countryCode:e.z.string().nullish(),articleCounts:k,onReminderOpen:e.z.any().nullish(),fetchEmail:e.z.any().nullish(),submitComponentEvent:e.z.any().nullish(),openCmp:e.z.any().nullish(),hasConsentForArticleCount:e.z.boolean().nullish(),stage:e.z.string().nullish()}),ge=e.z.enum(["contributions","subscriptions","signIn","abandonedBasket"]),ze=e.z.object({heading:e.z.string().optional(),messageText:e.z.string().optional(),paragraphs:e.z.array(e.z.string()).optional(),mobileMessageText:e.z.string().optional(),highlightedText:e.z.string().optional(),cta:I.optional(),secondaryCta:G.optional()}),me=e.z.object({tracking:v,bannerChannel:ge,content:ze.nullish(),mobileContent:ze.nullish(),countryCode:e.z.string().nullish(),isSupporter:e.z.boolean().nullish(),tickerSettings:O.nullish(),submitComponentEvent:e.z.any(),articleCounts:k,hasOptedOutOfArticleCount:e.z.boolean().nullish(),fetchEmail:e.z.any().nullish(),separateArticleCount:e.z.boolean().nullish(),design:J.nullish()}),Ce=e.z.object({heading:e.z.string(),subheading:e.z.string(),primaryCta:I.optional(),secondaryCta:I.optional(),benefits:e.z.array(e.z.string()).optional()}),be=e.z.object({content:Ce,tracking:v,mobileContent:Ce.optional(),countryCode:e.z.string().optional(),submitComponentEvent:e.z.any(),numArticles:e.z.number().optional()}),Se=e.z.object({maxViewsCount:e.z.number(),maxViewsDays:e.z.number(),minDaysBetweenViews:e.z.number()});ae.extend({name:e.z.string(),status:X,locations:e.z.array(l),tagIds:e.z.array(e.z.string()),sections:e.z.array(e.z.string()),excludedTagIds:e.z.array(e.z.string()),excludedSections:e.z.array(e.z.string()),alwaysAsk:e.z.boolean(),maxViews:Se.optional(),userCohort:oe,hasCountryName:e.z.boolean(),highPriority:e.z.boolean(),useLocalViewLog:e.z.boolean(),articlesViewedSettings:re.optional(),priority:e.z.number(),variants:de.array(),isBanditTest:e.z.boolean().optional()});const he=e.z.object({amount:e.z.union([e.z.number(),e.z.literal("other")]),billingPeriod:e.z.union([e.z.literal("ONE_OFF"),e.z.literal("MONTHLY"),e.z.literal("ANNUAL")]),product:e.z.union([e.z.literal("Contribution"),e.z.literal("SupporterPlus"),e.z.literal("PremiumTier"),e.z.literal("DailyEdition"),e.z.literal("GuardianWeekly"),e.z.literal("Paper"),e.z.literal("PaperAndDigital")]),region:e.z.union([e.z.literal("uk"),e.z.literal("us"),e.z.literal("au"),e.z.literal("eu"),e.z.literal("int"),e.z.literal("nz"),e.z.literal("ca")])}),ye=(e,n,t)=>{const a=(e=>{if(URLSearchParams){const n=new URLSearchParams(window.location.search).get(`force-${e}`);if(n)return n}return null})(e);return fetch(`${n}/${e}${a?`?force=${a}`:""}`,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then((n=>{if(!n.ok)throw Error(n.statusText||`Supporter Revenue ${e} | Api call returned HTTP status ${n.status}`);return n})).then((e=>e.json()))};exports.CountryGroupId=s,exports.SecondaryCtaType=N,exports.TickerCountType=B,exports.TickerEndType=U,exports.abandonedBasketSchema=he,exports.addRegionIdToSupportUrl=(e,n)=>{if(n){const t=(e=>u[p(e)]?.supportRegionId)(n);if(t&&!m(e))return e.replace(/(support\.theguardian\.com)\/(contribute-in-epic|contribute|subscribe|checkout)/,((e,n,a)=>`${n}/${t.toLowerCase()}/${a}`))}return e},exports.bannerSchema=me,exports.buildReminderFields=y,exports.containsNonArticleCountPlaceholder=e=>{const n=e.match(S)?.filter((e=>"%%ARTICLE_COUNT%%"!==e));return!!n&&n.length>0},exports.contributionTabFrequencies=["ONE_OFF","MONTHLY","ANNUAL"],exports.countryCodeToCountryGroupId=p,exports.countryGroupIdSchema=l,exports.epicPropsSchema=pe,exports.getBanner=(e,n)=>ye("banner",e,n),exports.getCountryName=z,exports.getEpic=(e,n)=>ye("epic",e,n),exports.getEpicViewLog=e=>e.get(n)||void 0,exports.getHeader=(e,n)=>ye("header",e,n),exports.getLiveblogEpic=(e,n)=>ye("liveblog-epic",e,n),exports.getLocalCurrencySymbol=g,exports.getReminderFields=(e,n=new Date)=>{return"US"===e&&T(n)?{reminderCta:"Remind me on Giving Tuesday",reminderPeriod:`${t=n.getFullYear()}-${(h(t).getMonth()+1).toString().padStart(0,"2")}-01`,reminderLabel:"on Giving Tuesday",reminderOption:`giving-tuesday-${t}`}:"US"===e&&(e=>e>=h(e.getFullYear())&&e<A)(n)?(e=>({reminderCta:"Remind me on New Years Eve",reminderPeriod:`${e}-12-01`,reminderLabel:"on New Years Eve",reminderOption:`new-years-eve-${e}`}))(n.getFullYear()):y(n);var t},exports.getWeeklyArticleHistory=e=>e.get(t)||void 0,exports.headerPropsSchema=be,exports.hexColourToString=e=>`#${e.r}${e.g}${e.b}`,exports.inCountryGroups=(e,n=[])=>0===n.length||!!e&&n.includes(p(e.toUpperCase())),exports.incrementWeeklyArticleCount=(e,n,r)=>{const s=((e,n)=>{const t=o(new Date),r=e.get(a);if(r&&r.week===t){const o=r.articles[n]||0;return e.set(a,{week:t,articles:{...r.articles,[n]:o+1}}),o>0}return e.set(a,{week:t,articles:{[n]:1}}),!1})(e,n);if(!s){const n=o(new Date),a=e.get(t)||[],s=a[0];if(s&&s.week&&s.week===n)s.count+=1,s.tags=i(r,s.tags),e.set(t,a);else{a.unshift({week:n,count:1,tags:i(r,{})});const o=n-365,s=a.filter((e=>e.week>=o));e.set(t,s)}}},exports.isGWCheckoutUrl=m,exports.logEpicView=e=>{const t=localStorage.getItem(n),a=t?JSON.parse(t).value:[];a.push({date:(new Date).getTime(),testId:e});const o={value:a.slice(-50)};localStorage.setItem(n,JSON.stringify(o))},exports.replaceNonArticleCountPlaceholders=(e,n,t)=>e?e.replace(S,(e=>{const a=e.substring(2,e.length-2),o=b[a];if(o){const e=o({countryCode:n,prices:t});if(e)return e}return e})):"";
@@ -30,16 +30,16 @@ export declare const bannerVariantFromToolSchema: z.ZodObject<{
30
30
  currencySymbol: z.ZodString;
31
31
  copy: z.ZodObject<{
32
32
  countLabel: z.ZodString;
33
- goalReachedPrimary: z.ZodString;
34
- goalReachedSecondary: z.ZodString;
33
+ goalReachedPrimary: z.ZodOptional<z.ZodString>;
34
+ goalReachedSecondary: z.ZodOptional<z.ZodString>;
35
35
  }, "strip", z.ZodTypeAny, {
36
36
  countLabel: string;
37
- goalReachedPrimary: string;
38
- goalReachedSecondary: string;
37
+ goalReachedPrimary?: string | undefined;
38
+ goalReachedSecondary?: string | undefined;
39
39
  }, {
40
40
  countLabel: string;
41
- goalReachedPrimary: string;
42
- goalReachedSecondary: string;
41
+ goalReachedPrimary?: string | undefined;
42
+ goalReachedSecondary?: string | undefined;
43
43
  }>;
44
44
  name: z.ZodEnum<["US", "AU"]>;
45
45
  tickerData: z.ZodOptional<z.ZodObject<{
@@ -56,8 +56,8 @@ export declare const bannerVariantFromToolSchema: z.ZodObject<{
56
56
  name: "US" | "AU";
57
57
  copy: {
58
58
  countLabel: string;
59
- goalReachedPrimary: string;
60
- goalReachedSecondary: string;
59
+ goalReachedPrimary?: string | undefined;
60
+ goalReachedSecondary?: string | undefined;
61
61
  };
62
62
  endType: import("../props").TickerEndType;
63
63
  countType: import("../props").TickerCountType;
@@ -70,8 +70,8 @@ export declare const bannerVariantFromToolSchema: z.ZodObject<{
70
70
  name: "US" | "AU";
71
71
  copy: {
72
72
  countLabel: string;
73
- goalReachedPrimary: string;
74
- goalReachedSecondary: string;
73
+ goalReachedPrimary?: string | undefined;
74
+ goalReachedSecondary?: string | undefined;
75
75
  };
76
76
  endType: import("../props").TickerEndType;
77
77
  countType: import("../props").TickerCountType;
@@ -285,8 +285,8 @@ export declare const bannerVariantFromToolSchema: z.ZodObject<{
285
285
  name: "US" | "AU";
286
286
  copy: {
287
287
  countLabel: string;
288
- goalReachedPrimary: string;
289
- goalReachedSecondary: string;
288
+ goalReachedPrimary?: string | undefined;
289
+ goalReachedSecondary?: string | undefined;
290
290
  };
291
291
  endType: import("../props").TickerEndType;
292
292
  countType: import("../props").TickerCountType;
@@ -353,8 +353,8 @@ export declare const bannerVariantFromToolSchema: z.ZodObject<{
353
353
  name: "US" | "AU";
354
354
  copy: {
355
355
  countLabel: string;
356
- goalReachedPrimary: string;
357
- goalReachedSecondary: string;
356
+ goalReachedPrimary?: string | undefined;
357
+ goalReachedSecondary?: string | undefined;
358
358
  };
359
359
  endType: import("../props").TickerEndType;
360
360
  countType: import("../props").TickerCountType;
@@ -474,16 +474,16 @@ export declare const bannerTestFromToolSchema: z.ZodObject<{
474
474
  currencySymbol: z.ZodString;
475
475
  copy: z.ZodObject<{
476
476
  countLabel: z.ZodString;
477
- goalReachedPrimary: z.ZodString;
478
- goalReachedSecondary: z.ZodString;
477
+ goalReachedPrimary: z.ZodOptional<z.ZodString>;
478
+ goalReachedSecondary: z.ZodOptional<z.ZodString>;
479
479
  }, "strip", z.ZodTypeAny, {
480
480
  countLabel: string;
481
- goalReachedPrimary: string;
482
- goalReachedSecondary: string;
481
+ goalReachedPrimary?: string | undefined;
482
+ goalReachedSecondary?: string | undefined;
483
483
  }, {
484
484
  countLabel: string;
485
- goalReachedPrimary: string;
486
- goalReachedSecondary: string;
485
+ goalReachedPrimary?: string | undefined;
486
+ goalReachedSecondary?: string | undefined;
487
487
  }>;
488
488
  name: z.ZodEnum<["US", "AU"]>;
489
489
  tickerData: z.ZodOptional<z.ZodObject<{
@@ -500,8 +500,8 @@ export declare const bannerTestFromToolSchema: z.ZodObject<{
500
500
  name: "US" | "AU";
501
501
  copy: {
502
502
  countLabel: string;
503
- goalReachedPrimary: string;
504
- goalReachedSecondary: string;
503
+ goalReachedPrimary?: string | undefined;
504
+ goalReachedSecondary?: string | undefined;
505
505
  };
506
506
  endType: import("../props").TickerEndType;
507
507
  countType: import("../props").TickerCountType;
@@ -514,8 +514,8 @@ export declare const bannerTestFromToolSchema: z.ZodObject<{
514
514
  name: "US" | "AU";
515
515
  copy: {
516
516
  countLabel: string;
517
- goalReachedPrimary: string;
518
- goalReachedSecondary: string;
517
+ goalReachedPrimary?: string | undefined;
518
+ goalReachedSecondary?: string | undefined;
519
519
  };
520
520
  endType: import("../props").TickerEndType;
521
521
  countType: import("../props").TickerCountType;
@@ -729,8 +729,8 @@ export declare const bannerTestFromToolSchema: z.ZodObject<{
729
729
  name: "US" | "AU";
730
730
  copy: {
731
731
  countLabel: string;
732
- goalReachedPrimary: string;
733
- goalReachedSecondary: string;
732
+ goalReachedPrimary?: string | undefined;
733
+ goalReachedSecondary?: string | undefined;
734
734
  };
735
735
  endType: import("../props").TickerEndType;
736
736
  countType: import("../props").TickerCountType;
@@ -797,8 +797,8 @@ export declare const bannerTestFromToolSchema: z.ZodObject<{
797
797
  name: "US" | "AU";
798
798
  copy: {
799
799
  countLabel: string;
800
- goalReachedPrimary: string;
801
- goalReachedSecondary: string;
800
+ goalReachedPrimary?: string | undefined;
801
+ goalReachedSecondary?: string | undefined;
802
802
  };
803
803
  endType: import("../props").TickerEndType;
804
804
  countType: import("../props").TickerCountType;
@@ -888,8 +888,8 @@ export declare const bannerTestFromToolSchema: z.ZodObject<{
888
888
  name: "US" | "AU";
889
889
  copy: {
890
890
  countLabel: string;
891
- goalReachedPrimary: string;
892
- goalReachedSecondary: string;
891
+ goalReachedPrimary?: string | undefined;
892
+ goalReachedSecondary?: string | undefined;
893
893
  };
894
894
  endType: import("../props").TickerEndType;
895
895
  countType: import("../props").TickerCountType;
@@ -982,8 +982,8 @@ export declare const bannerTestFromToolSchema: z.ZodObject<{
982
982
  name: "US" | "AU";
983
983
  copy: {
984
984
  countLabel: string;
985
- goalReachedPrimary: string;
986
- goalReachedSecondary: string;
985
+ goalReachedPrimary?: string | undefined;
986
+ goalReachedSecondary?: string | undefined;
987
987
  };
988
988
  endType: import("../props").TickerEndType;
989
989
  countType: import("../props").TickerCountType;
@@ -136,16 +136,16 @@ export declare const epicTestFromToolSchema: z.ZodObject<{
136
136
  currencySymbol: z.ZodString;
137
137
  copy: z.ZodObject<{
138
138
  countLabel: z.ZodString;
139
- goalReachedPrimary: z.ZodString;
140
- goalReachedSecondary: z.ZodString;
139
+ goalReachedPrimary: z.ZodOptional<z.ZodString>;
140
+ goalReachedSecondary: z.ZodOptional<z.ZodString>;
141
141
  }, "strip", z.ZodTypeAny, {
142
142
  countLabel: string;
143
- goalReachedPrimary: string;
144
- goalReachedSecondary: string;
143
+ goalReachedPrimary?: string | undefined;
144
+ goalReachedSecondary?: string | undefined;
145
145
  }, {
146
146
  countLabel: string;
147
- goalReachedPrimary: string;
148
- goalReachedSecondary: string;
147
+ goalReachedPrimary?: string | undefined;
148
+ goalReachedSecondary?: string | undefined;
149
149
  }>;
150
150
  name: z.ZodEnum<["US", "AU"]>;
151
151
  tickerData: z.ZodOptional<z.ZodObject<{
@@ -162,8 +162,8 @@ export declare const epicTestFromToolSchema: z.ZodObject<{
162
162
  name: "US" | "AU";
163
163
  copy: {
164
164
  countLabel: string;
165
- goalReachedPrimary: string;
166
- goalReachedSecondary: string;
165
+ goalReachedPrimary?: string | undefined;
166
+ goalReachedSecondary?: string | undefined;
167
167
  };
168
168
  endType: import("../props").TickerEndType;
169
169
  countType: import("../props").TickerCountType;
@@ -176,8 +176,8 @@ export declare const epicTestFromToolSchema: z.ZodObject<{
176
176
  name: "US" | "AU";
177
177
  copy: {
178
178
  countLabel: string;
179
- goalReachedPrimary: string;
180
- goalReachedSecondary: string;
179
+ goalReachedPrimary?: string | undefined;
180
+ goalReachedSecondary?: string | undefined;
181
181
  };
182
182
  endType: import("../props").TickerEndType;
183
183
  countType: import("../props").TickerCountType;
@@ -490,8 +490,8 @@ export declare const epicTestFromToolSchema: z.ZodObject<{
490
490
  name: "US" | "AU";
491
491
  copy: {
492
492
  countLabel: string;
493
- goalReachedPrimary: string;
494
- goalReachedSecondary: string;
493
+ goalReachedPrimary?: string | undefined;
494
+ goalReachedSecondary?: string | undefined;
495
495
  };
496
496
  endType: import("../props").TickerEndType;
497
497
  countType: import("../props").TickerCountType;
@@ -590,8 +590,8 @@ export declare const epicTestFromToolSchema: z.ZodObject<{
590
590
  name: "US" | "AU";
591
591
  copy: {
592
592
  countLabel: string;
593
- goalReachedPrimary: string;
594
- goalReachedSecondary: string;
593
+ goalReachedPrimary?: string | undefined;
594
+ goalReachedSecondary?: string | undefined;
595
595
  };
596
596
  endType: import("../props").TickerEndType;
597
597
  countType: import("../props").TickerCountType;
@@ -706,8 +706,8 @@ export declare const epicTestFromToolSchema: z.ZodObject<{
706
706
  name: "US" | "AU";
707
707
  copy: {
708
708
  countLabel: string;
709
- goalReachedPrimary: string;
710
- goalReachedSecondary: string;
709
+ goalReachedPrimary?: string | undefined;
710
+ goalReachedSecondary?: string | undefined;
711
711
  };
712
712
  endType: import("../props").TickerEndType;
713
713
  countType: import("../props").TickerCountType;
@@ -840,8 +840,8 @@ export declare const epicTestFromToolSchema: z.ZodObject<{
840
840
  name: "US" | "AU";
841
841
  copy: {
842
842
  countLabel: string;
843
- goalReachedPrimary: string;
844
- goalReachedSecondary: string;
843
+ goalReachedPrimary?: string | undefined;
844
+ goalReachedSecondary?: string | undefined;
845
845
  };
846
846
  endType: import("../props").TickerEndType;
847
847
  countType: import("../props").TickerCountType;
@@ -338,16 +338,16 @@ export declare const bannerSchema: z.ZodObject<{
338
338
  currencySymbol: z.ZodString;
339
339
  copy: z.ZodObject<{
340
340
  countLabel: z.ZodString;
341
- goalReachedPrimary: z.ZodString;
342
- goalReachedSecondary: z.ZodString;
341
+ goalReachedPrimary: z.ZodOptional<z.ZodString>;
342
+ goalReachedSecondary: z.ZodOptional<z.ZodString>;
343
343
  }, "strip", z.ZodTypeAny, {
344
344
  countLabel: string;
345
- goalReachedPrimary: string;
346
- goalReachedSecondary: string;
345
+ goalReachedPrimary?: string | undefined;
346
+ goalReachedSecondary?: string | undefined;
347
347
  }, {
348
348
  countLabel: string;
349
- goalReachedPrimary: string;
350
- goalReachedSecondary: string;
349
+ goalReachedPrimary?: string | undefined;
350
+ goalReachedSecondary?: string | undefined;
351
351
  }>;
352
352
  name: z.ZodEnum<["US", "AU"]>;
353
353
  tickerData: z.ZodOptional<z.ZodObject<{
@@ -364,8 +364,8 @@ export declare const bannerSchema: z.ZodObject<{
364
364
  name: "US" | "AU";
365
365
  copy: {
366
366
  countLabel: string;
367
- goalReachedPrimary: string;
368
- goalReachedSecondary: string;
367
+ goalReachedPrimary?: string | undefined;
368
+ goalReachedSecondary?: string | undefined;
369
369
  };
370
370
  endType: import("./shared").TickerEndType;
371
371
  countType: import("./shared").TickerCountType;
@@ -378,8 +378,8 @@ export declare const bannerSchema: z.ZodObject<{
378
378
  name: "US" | "AU";
379
379
  copy: {
380
380
  countLabel: string;
381
- goalReachedPrimary: string;
382
- goalReachedSecondary: string;
381
+ goalReachedPrimary?: string | undefined;
382
+ goalReachedSecondary?: string | undefined;
383
383
  };
384
384
  endType: import("./shared").TickerEndType;
385
385
  countType: import("./shared").TickerCountType;
@@ -878,8 +878,8 @@ export declare const bannerSchema: z.ZodObject<{
878
878
  name: "US" | "AU";
879
879
  copy: {
880
880
  countLabel: string;
881
- goalReachedPrimary: string;
882
- goalReachedSecondary: string;
881
+ goalReachedPrimary?: string | undefined;
882
+ goalReachedSecondary?: string | undefined;
883
883
  };
884
884
  endType: import("./shared").TickerEndType;
885
885
  countType: import("./shared").TickerCountType;
@@ -1020,8 +1020,8 @@ export declare const bannerSchema: z.ZodObject<{
1020
1020
  name: "US" | "AU";
1021
1021
  copy: {
1022
1022
  countLabel: string;
1023
- goalReachedPrimary: string;
1024
- goalReachedSecondary: string;
1023
+ goalReachedPrimary?: string | undefined;
1024
+ goalReachedSecondary?: string | undefined;
1025
1025
  };
1026
1026
  endType: import("./shared").TickerEndType;
1027
1027
  countType: import("./shared").TickerCountType;
@@ -27,16 +27,16 @@ export declare const variantSchema: z.ZodObject<{
27
27
  currencySymbol: z.ZodString;
28
28
  copy: z.ZodObject<{
29
29
  countLabel: z.ZodString;
30
- goalReachedPrimary: z.ZodString;
31
- goalReachedSecondary: z.ZodString;
30
+ goalReachedPrimary: z.ZodOptional<z.ZodString>;
31
+ goalReachedSecondary: z.ZodOptional<z.ZodString>;
32
32
  }, "strip", z.ZodTypeAny, {
33
33
  countLabel: string;
34
- goalReachedPrimary: string;
35
- goalReachedSecondary: string;
34
+ goalReachedPrimary?: string | undefined;
35
+ goalReachedSecondary?: string | undefined;
36
36
  }, {
37
37
  countLabel: string;
38
- goalReachedPrimary: string;
39
- goalReachedSecondary: string;
38
+ goalReachedPrimary?: string | undefined;
39
+ goalReachedSecondary?: string | undefined;
40
40
  }>;
41
41
  name: z.ZodEnum<["US", "AU"]>;
42
42
  tickerData: z.ZodOptional<z.ZodObject<{
@@ -53,8 +53,8 @@ export declare const variantSchema: z.ZodObject<{
53
53
  name: "US" | "AU";
54
54
  copy: {
55
55
  countLabel: string;
56
- goalReachedPrimary: string;
57
- goalReachedSecondary: string;
56
+ goalReachedPrimary?: string | undefined;
57
+ goalReachedSecondary?: string | undefined;
58
58
  };
59
59
  endType: import("./shared").TickerEndType;
60
60
  countType: import("./shared").TickerCountType;
@@ -67,8 +67,8 @@ export declare const variantSchema: z.ZodObject<{
67
67
  name: "US" | "AU";
68
68
  copy: {
69
69
  countLabel: string;
70
- goalReachedPrimary: string;
71
- goalReachedSecondary: string;
70
+ goalReachedPrimary?: string | undefined;
71
+ goalReachedSecondary?: string | undefined;
72
72
  };
73
73
  endType: import("./shared").TickerEndType;
74
74
  countType: import("./shared").TickerCountType;
@@ -381,8 +381,8 @@ export declare const variantSchema: z.ZodObject<{
381
381
  name: "US" | "AU";
382
382
  copy: {
383
383
  countLabel: string;
384
- goalReachedPrimary: string;
385
- goalReachedSecondary: string;
384
+ goalReachedPrimary?: string | undefined;
385
+ goalReachedSecondary?: string | undefined;
386
386
  };
387
387
  endType: import("./shared").TickerEndType;
388
388
  countType: import("./shared").TickerCountType;
@@ -481,8 +481,8 @@ export declare const variantSchema: z.ZodObject<{
481
481
  name: "US" | "AU";
482
482
  copy: {
483
483
  countLabel: string;
484
- goalReachedPrimary: string;
485
- goalReachedSecondary: string;
484
+ goalReachedPrimary?: string | undefined;
485
+ goalReachedSecondary?: string | undefined;
486
486
  };
487
487
  endType: import("./shared").TickerEndType;
488
488
  countType: import("./shared").TickerCountType;
@@ -585,16 +585,16 @@ export declare const epicPropsSchema: z.ZodObject<{
585
585
  currencySymbol: z.ZodString;
586
586
  copy: z.ZodObject<{
587
587
  countLabel: z.ZodString;
588
- goalReachedPrimary: z.ZodString;
589
- goalReachedSecondary: z.ZodString;
588
+ goalReachedPrimary: z.ZodOptional<z.ZodString>;
589
+ goalReachedSecondary: z.ZodOptional<z.ZodString>;
590
590
  }, "strip", z.ZodTypeAny, {
591
591
  countLabel: string;
592
- goalReachedPrimary: string;
593
- goalReachedSecondary: string;
592
+ goalReachedPrimary?: string | undefined;
593
+ goalReachedSecondary?: string | undefined;
594
594
  }, {
595
595
  countLabel: string;
596
- goalReachedPrimary: string;
597
- goalReachedSecondary: string;
596
+ goalReachedPrimary?: string | undefined;
597
+ goalReachedSecondary?: string | undefined;
598
598
  }>;
599
599
  name: z.ZodEnum<["US", "AU"]>;
600
600
  tickerData: z.ZodOptional<z.ZodObject<{
@@ -611,8 +611,8 @@ export declare const epicPropsSchema: z.ZodObject<{
611
611
  name: "US" | "AU";
612
612
  copy: {
613
613
  countLabel: string;
614
- goalReachedPrimary: string;
615
- goalReachedSecondary: string;
614
+ goalReachedPrimary?: string | undefined;
615
+ goalReachedSecondary?: string | undefined;
616
616
  };
617
617
  endType: import("./shared").TickerEndType;
618
618
  countType: import("./shared").TickerCountType;
@@ -625,8 +625,8 @@ export declare const epicPropsSchema: z.ZodObject<{
625
625
  name: "US" | "AU";
626
626
  copy: {
627
627
  countLabel: string;
628
- goalReachedPrimary: string;
629
- goalReachedSecondary: string;
628
+ goalReachedPrimary?: string | undefined;
629
+ goalReachedSecondary?: string | undefined;
630
630
  };
631
631
  endType: import("./shared").TickerEndType;
632
632
  countType: import("./shared").TickerCountType;
@@ -939,8 +939,8 @@ export declare const epicPropsSchema: z.ZodObject<{
939
939
  name: "US" | "AU";
940
940
  copy: {
941
941
  countLabel: string;
942
- goalReachedPrimary: string;
943
- goalReachedSecondary: string;
942
+ goalReachedPrimary?: string | undefined;
943
+ goalReachedSecondary?: string | undefined;
944
944
  };
945
945
  endType: import("./shared").TickerEndType;
946
946
  countType: import("./shared").TickerCountType;
@@ -1039,8 +1039,8 @@ export declare const epicPropsSchema: z.ZodObject<{
1039
1039
  name: "US" | "AU";
1040
1040
  copy: {
1041
1041
  countLabel: string;
1042
- goalReachedPrimary: string;
1043
- goalReachedSecondary: string;
1042
+ goalReachedPrimary?: string | undefined;
1043
+ goalReachedSecondary?: string | undefined;
1044
1044
  };
1045
1045
  endType: import("./shared").TickerEndType;
1046
1046
  countType: import("./shared").TickerCountType;
@@ -1192,8 +1192,8 @@ export declare const epicPropsSchema: z.ZodObject<{
1192
1192
  name: "US" | "AU";
1193
1193
  copy: {
1194
1194
  countLabel: string;
1195
- goalReachedPrimary: string;
1196
- goalReachedSecondary: string;
1195
+ goalReachedPrimary?: string | undefined;
1196
+ goalReachedSecondary?: string | undefined;
1197
1197
  };
1198
1198
  endType: import("./shared").TickerEndType;
1199
1199
  countType: import("./shared").TickerCountType;
@@ -1317,8 +1317,8 @@ export declare const epicPropsSchema: z.ZodObject<{
1317
1317
  name: "US" | "AU";
1318
1318
  copy: {
1319
1319
  countLabel: string;
1320
- goalReachedPrimary: string;
1321
- goalReachedSecondary: string;
1320
+ goalReachedPrimary?: string | undefined;
1321
+ goalReachedSecondary?: string | undefined;
1322
1322
  };
1323
1323
  endType: import("./shared").TickerEndType;
1324
1324
  countType: import("./shared").TickerCountType;
@@ -103,21 +103,21 @@ export declare enum TickerCountType {
103
103
  export declare const tickerCountTypeSchema: z.ZodNativeEnum<typeof TickerCountType>;
104
104
  interface TickerCopy {
105
105
  countLabel: string;
106
- goalReachedPrimary: string;
107
- goalReachedSecondary: string;
106
+ goalReachedPrimary?: string;
107
+ goalReachedSecondary?: string;
108
108
  }
109
109
  export declare const tickerCopySchema: z.ZodObject<{
110
110
  countLabel: z.ZodString;
111
- goalReachedPrimary: z.ZodString;
112
- goalReachedSecondary: z.ZodString;
111
+ goalReachedPrimary: z.ZodOptional<z.ZodString>;
112
+ goalReachedSecondary: z.ZodOptional<z.ZodString>;
113
113
  }, "strip", z.ZodTypeAny, {
114
114
  countLabel: string;
115
- goalReachedPrimary: string;
116
- goalReachedSecondary: string;
115
+ goalReachedPrimary?: string | undefined;
116
+ goalReachedSecondary?: string | undefined;
117
117
  }, {
118
118
  countLabel: string;
119
- goalReachedPrimary: string;
120
- goalReachedSecondary: string;
119
+ goalReachedPrimary?: string | undefined;
120
+ goalReachedSecondary?: string | undefined;
121
121
  }>;
122
122
  export interface TickerData {
123
123
  total: number;
@@ -148,16 +148,16 @@ export declare const tickerSettingsSchema: z.ZodObject<{
148
148
  currencySymbol: z.ZodString;
149
149
  copy: z.ZodObject<{
150
150
  countLabel: z.ZodString;
151
- goalReachedPrimary: z.ZodString;
152
- goalReachedSecondary: z.ZodString;
151
+ goalReachedPrimary: z.ZodOptional<z.ZodString>;
152
+ goalReachedSecondary: z.ZodOptional<z.ZodString>;
153
153
  }, "strip", z.ZodTypeAny, {
154
154
  countLabel: string;
155
- goalReachedPrimary: string;
156
- goalReachedSecondary: string;
155
+ goalReachedPrimary?: string | undefined;
156
+ goalReachedSecondary?: string | undefined;
157
157
  }, {
158
158
  countLabel: string;
159
- goalReachedPrimary: string;
160
- goalReachedSecondary: string;
159
+ goalReachedPrimary?: string | undefined;
160
+ goalReachedSecondary?: string | undefined;
161
161
  }>;
162
162
  name: z.ZodEnum<["US", "AU"]>;
163
163
  tickerData: z.ZodOptional<z.ZodObject<{
@@ -174,8 +174,8 @@ export declare const tickerSettingsSchema: z.ZodObject<{
174
174
  name: "US" | "AU";
175
175
  copy: {
176
176
  countLabel: string;
177
- goalReachedPrimary: string;
178
- goalReachedSecondary: string;
177
+ goalReachedPrimary?: string | undefined;
178
+ goalReachedSecondary?: string | undefined;
179
179
  };
180
180
  endType: TickerEndType;
181
181
  countType: TickerCountType;
@@ -188,8 +188,8 @@ export declare const tickerSettingsSchema: z.ZodObject<{
188
188
  name: "US" | "AU";
189
189
  copy: {
190
190
  countLabel: string;
191
- goalReachedPrimary: string;
192
- goalReachedSecondary: string;
191
+ goalReachedPrimary?: string | undefined;
192
+ goalReachedSecondary?: string | undefined;
193
193
  };
194
194
  endType: TickerEndType;
195
195
  countType: TickerCountType;
@@ -1 +1 @@
1
- {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../../../shared/src/types/props/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC;AAE5C,MAAM,WAAW,GAAG;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,SAAS;;;;;;;;;EAGpB,CAAC;AAEH,oBAAY,gBAAgB;IACxB,MAAM,uBAAuB;IAC7B,qBAAqB,sCAAsC;CAC9D;AAED,eAAO,MAAM,sBAAsB,0CAAiC,CAAC;AAErE,UAAU,kBAAkB;IACxB,IAAI,EAAE,gBAAgB,CAAC,MAAM,CAAC;IAC9B,GAAG,EAAE,GAAG,CAAC;CACZ;AAED,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;EAGnC,CAAC;AAEH,UAAU,iCAAiC;IACvC,IAAI,EAAE,gBAAgB,CAAC,qBAAqB,CAAC;CAChD;AAED,eAAO,MAAM,uCAAuC;;;;;;EAElD,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,kBAAkB,GAAG,iCAAiC,CAAC;AAElF,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAG7B,CAAC;AAEH,oBAAY,aAAa;IACrB,SAAS,cAAc;IACvB,QAAQ,aAAa;CACxB;AAED,eAAO,MAAM,mBAAmB,uCAA8B,CAAC;AAE/D,oBAAY,eAAe;IACvB,KAAK,UAAU;CAClB;AAED,eAAO,MAAM,qBAAqB,yCAAgC,CAAC;AAEnE,UAAU,UAAU;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,oBAAoB,EAAE,MAAM,CAAC;CAChC;AAED,eAAO,MAAM,gBAAgB;;;;;;;;;;;;EAI3B,CAAC;AAEH,MAAM,WAAW,UAAU;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,gBAAgB;;;;;;;;;EAG3B,CAAC;AAGH,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,CAAC;AAIrC,MAAM,WAAW,cAAc;IAC3B,OAAO,EAAE,aAAa,CAAC;IACvB,SAAS,EAAE,eAAe,CAAC;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,EAAE,UAAU,CAAC;IACjB,UAAU,CAAC,EAAE,UAAU,CAAC;CAC3B;AAED,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAO/B,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;EAG9B,CAAC;AAEH,MAAM,MAAM,gBAAgB,GACtB,YAAY,GACZ,kBAAkB,CAAC;AAIzB,MAAM,MAAM,aAAa,GAAG;KACvB,IAAI,IAAI,gBAAgB,GAAG,MAAM;CACrC,CAAC;AAEF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;EAIrC,CAAC;AAEH,MAAM,WAAW,oBAAoB;IACjC,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,gBAAgB,CAAC;CAChC;AAED,eAAO,MAAM,kBAAkB,mGAK7B,CAAC;AAEH,eAAO,MAAM,wBAAwB,sJAMnC,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,YAAY,GAAG,YAAY,CAAC;AAEnD,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWzB,CAAC;AAEH,MAAM,WAAW,KAAK;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;EAQtB,CAAC;AAEH,MAAM,WAAW,eAAe;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,KAAK,CAAC;CACpB;AAED,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIhC,CAAC"}
1
+ {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../../../shared/src/types/props/shared.ts"],"names":[],"mappings":"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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guardian/support-dotcom-components",
3
- "version": "2.8.0",
3
+ "version": "2.9.1",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",