@guardian/support-dotcom-components 7.9.0 → 7.10.0
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/dotcom/types.d.ts +0 -1
- package/dist/dotcom/types.d.ts.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/shared/types/abTests/banner.d.ts +3 -3
- package/dist/shared/types/abTests/epic.d.ts +3 -3
- package/dist/shared/types/abTests/gutter.d.ts +3 -3
- package/dist/shared/types/abTests/header.d.ts +3 -3
- package/dist/shared/types/abTests/shared.d.ts +4 -4
- package/dist/shared/types/abTests/shared.d.ts.map +1 -1
- package/dist/shared/types/index.d.ts +0 -1
- package/dist/shared/types/index.d.ts.map +1 -1
- package/dist/shared/types/props/banner.d.ts +156 -0
- package/dist/shared/types/props/banner.d.ts.map +1 -1
- package/dist/shared/types/props/design.d.ts +123 -2
- package/dist/shared/types/props/design.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/shared/types/reminders.d.ts +0 -16
- package/dist/shared/types/reminders.d.ts.map +0 -1
package/dist/dotcom/types.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export { BannerPayload, EpicPayload, HeaderPayload, WeeklyArticleHistory, GutterPayload, } from '../shared/types/targeting';
|
|
2
2
|
export * from '../shared/types/prices';
|
|
3
3
|
export { EpicProps } from '../shared/types/props/epic';
|
|
4
|
-
export * from '../shared/types/reminders';
|
|
5
4
|
export { ModuleDataResponse, ModuleData } from './requests';
|
|
6
5
|
export { Image } from '../shared/types/props/shared';
|
|
7
6
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/dotcom/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,aAAa,EACb,WAAW,EACX,aAAa,EACb,oBAAoB,EACpB,aAAa,GAChB,MAAM,2BAA2B,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/dotcom/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,aAAa,EACb,WAAW,EACX,aAAa,EACb,oBAAoB,EACpB,aAAa,GAChB,MAAM,2BAA2B,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC"}
|
package/dist/index.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z as e}from"zod";const n="gu.history.weeklyArticleCount",t="gu.history.articleCountsThisWeek",a=e=>{const n=e.getDay()||7;return Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()-(n-1))/864e5},i=e=>e.get(n)||void 0,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"]),r=(e,n={})=>(e.forEach((e=>{o.has(e)&&(n[e]=(n[e]??0)+1)})),n),s=(e,i,o)=>{const s=((e,n)=>{const i=a(new Date),o=e.get(t);if(o&&o.week===i){const a=o.articles[n]||0;return e.set(t,{week:i,articles:{...o.articles,[n]:a+1}}),a>0}return e.set(t,{week:i,articles:{[n]:1}}),!1})(e,i);if(!s){const t=a(new Date),i=e.get(n)||[],s=i[0];if(s?.week&&s.week===t)s.count+=1,s.tags=r(o,s.tags),e.set(n,i);else{i.unshift({week:t,count:1,tags:r(o,{})});const a=t-365,s=i.filter((e=>e.week>=a));e.set(n,s)}}},l=["GBPCountries","UnitedStates","AUDCountries","EURCountries","International","NZDCountries","Canada"],u=e.enum(l),c=e.object({targetedCountryGroups:e.array(u),targetedCountryCodes:e.array(e.string()).optional()}).optional(),d={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"}},g={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"},p={GBPCountries:"£",UnitedStates:"$",AUDCountries:"$",Canada:"CA$",EURCountries:"€",NZDCountries:"NZ$",International:"$"},m={GBP:"£",USD:"$",AUD:"$",EUR:"€",NZD:"NZ$",CAD:"CA$"},b=e=>Object.keys(d).find((n=>d[n].countries.includes(e??"")))||"International",C=(e,n=[],t=[])=>0===n.length&&0===t.length||!!e&&(!!n.includes(b(e.toUpperCase()))||t.includes(e.toUpperCase())),h=e=>{if(e){const n=b(e);return p[n]}return"£"},S=e=>{if(e)return g[e]},y=e=>e.includes("subscribe/weekly/checkout"),A=(e,n)=>{if(n){const t=(e=>d[b(e)].supportRegionId)(n);if(t&&!y(e))return e.replace(/(support\.theguardian\.com)\/(contribute-in-epic|contribute|subscribe|checkout)/,((e,n,a)=>`${n}/${t.toLowerCase()}/${a}`))}return e},T=(e,n,t,a)=>{if(a){const i=a[b(t)];if(i){return`${h(t)}${i[e][n].price}`}}},I={CURRENCY_SYMBOL:({countryCode:e})=>h(e),COUNTRY_NAME:({countryCode:e})=>S(e),PRICE_DIGISUB_MONTHLY:({countryCode:e,prices:n})=>T("Digisub","Monthly",e,n),PRICE_DIGISUB_ANNUAL:({countryCode:e,prices:n})=>T("Digisub","Annual",e,n),PRICE_GUARDIANWEEKLY_MONTHLY:({countryCode:e,prices:n})=>T("GuardianWeekly","Monthly",e,n),PRICE_GUARDIANWEEKLY_ANNUAL:({countryCode:e,prices:n})=>T("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"}))()},N=(e,n,t)=>e?e.replace(M,(e=>{const a=e.substring(2,e.length-2),i=I[a];if(i){const e=i({countryCode:n,prices:t});if(e)return e}return e})):"",M=/%%.*?%%/g,E=e=>{const n=e.match(M)?.filter((e=>"%%ARTICLE_COUNT%%"!==e));return!!n&&n.length>0},G="gu.contributions.views",U=e=>e.get(G)??void 0,B=e=>{const n=localStorage.getItem(G),t=n?JSON.parse(n).value:[];t.push({date:(new Date).getTime(),testId:e});const a={value:t.slice(-50)};localStorage.setItem(G,JSON.stringify(a))},R=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},P=(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}`}},D=new Date("2023-12-31"),L=e=>e>=(e=>new Date(e.getFullYear(),9,20))(e)&&e<R(e.getFullYear()),w=(e,n=new Date)=>{return"US"===e&&L(n)?{reminderCta:"Remind me on Giving Tuesday",reminderPeriod:`${t=n.getFullYear()}-${(R(t).getMonth()+1).toString().padStart(0,"2")}-01`,reminderLabel:"on Giving Tuesday",reminderOption:`giving-tuesday-${t}`}:"US"===e&&(e=>e>=R(e.getFullYear())&&e<D)(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()):P(n);var t},O=e.object({text:e.string(),baseUrl:e.string()});let k=function(e){return e.Custom="CustomSecondaryCta",e.ContributionsReminder="ContributionsReminderSecondaryCta",e}({});e.nativeEnum(k);const f=e.object({type:e.literal(k.Custom),cta:O}),j=e.object({type:e.literal(k.ContributionsReminder)}),K=e.discriminatedUnion("type",[f,j]),F=e.object({countLabel:e.string(),goalCopy:e.string().optional()}),v=e.object({total:e.number(),goal:e.number()}),H=e.enum(["US","AU","global"]),Y=e.object({currencySymbol:e.string(),copy:F,name:H,tickerData:v.optional()}),V=e.object({for52Weeks:e.number(),forTargetedWeeks:e.number()}),W=e.enum(["for52Weeks","forTargetedWeeks"]),Z=e.object({type:e.literal("above"),copy:e.string().optional(),countType:W.optional()}),$=e.enum(["CONTRIBUTION","MEMBERSHIP_SUPPORTER","DIGITAL_SUBSCRIPTION","PRINT_SUBSCRIPTION"]),x=e.enum(["ACQUISITIONS_EPIC","ACQUISITIONS_ENGAGEMENT_BANNER","ACQUISITIONS_SUBSCRIPTIONS_BANNER","ACQUISITIONS_HEADER","ACQUISITIONS_OTHER"]),_=e.object({abTestName:e.string(),abTestVariant:e.string(),campaignCode:e.string(),componentType:x,products:e.array($).nullish(),labels:e.array(e.string()).nullish(),ophanPageId:e.string(),platformId:e.string(),referrerUrl:e.string()}),J=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:J.optional()}),z=/^[0-9A-F]{2}$/,q=e.string().refine((e=>z.test(e)),(e=>({message:`"${e}" is not a valid hex value`}))),X=e.object({r:q,g:q,b:q,kind:e.literal("hex")}),ee=e.object({mobileUrl:e.string(),tabletUrl:e.string(),desktopUrl:e.string(),altText:e.string(),kind:e.literal("Image")}),ne=e.object({buttonColour:X.nullish(),buttonTextColour:X.nullish(),buttonBorderColour:X.nullish(),buttonSelectColour:X.nullish(),buttonSelectTextColour:X.nullish(),buttonSelectBorderColour:X.nullish(),kind:e.literal("ChoiceCards")}),te=e.discriminatedUnion("kind",[ee,ne]),ae=e.object({visual:te.nullish(),colours:e.object({basic:e.object({background:X,bodyText:X})})}),ie=e=>`#${e.r}${e.g}${e.b}`,oe=e.object({copy:e.string()}),re=e.union([e.literal("Monthly"),e.literal("Annual")]),se=e.discriminatedUnion("supportTier",[e.object({supportTier:e.literal("Contribution"),ratePlan:re}),e.object({supportTier:e.literal("SupporterPlus"),ratePlan:re}),e.object({supportTier:e.literal("OneOff")})]),le=e.object({copy:e.string(),textColour:X.nullish(),backgroundColour:X.nullish()}),ue=e.union([e.literal("LandingPage"),e.literal("Checkout")]),ce=e.object({product:se,label:e.string(),isDefault:e.boolean(),benefitsLabel:e.string().nullish(),benefits:e.array(oe),pill:le.nullish(),destination:ue.nullish()}),de=e.object({choiceCards:e.array(ce),mobileChoiceCards:e.array(ce).nullish()}),ge=e.object({maxViewsCount:e.number(),maxViewsDays:e.number(),minDaysBetweenViews:e.number()}),pe=e.object({reminderCta:e.string(),reminderLabel:e.string(),reminderPeriod:e.string()}),me=e.enum(["ONE_OFF","MONTHLY","ANNUAL"]),be=e.object({testName:e.string(),variantName:e.string(),defaultContributionType:me,displayContributionType:me.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()})})}),Ce=e.object({newsletterId:e.string(),successDescription:e.string()}),he=e.object({name:e.string(),heading:e.string().optional(),paragraphs:e.array(e.string()),highlightedText:e.string().optional(),tickerSettings:Y.optional(),cta:O.optional(),secondaryCta:K.optional(),newsletterSignup:Ce.optional(),image:J.optional(),showReminderFields:pe.optional(),separateArticleCount:Z.optional(),promoCodes:e.array(e.string()).nullish(),maxViews:ge.optional(),showSignInLink:e.boolean().optional(),bylineWithImage:Q.optional(),showChoiceCards:e.boolean().optional(),choiceCardsSettings:de.nullish(),choiceCardAmounts:be.optional(),defaultChoiceCardFrequency:me.optional()}),Se=e.object({variant:he,tracking:_,countryCode:e.string().nullish(),articleCounts:V,onReminderOpen:e.any().nullish(),fetchEmail:e.any().nullish(),submitComponentEvent:e.any().nullish(),openCmp:e.any().nullish(),hasConsentForArticleCount:e.boolean().nullish(),stage:e.string().nullish()}),ye=e.enum(["contributions","subscriptions","signIn","abandonedBasket"]),Ae=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:O.optional(),secondaryCta:K.optional()}),Te=e.object({tracking:_,bannerChannel:ye,content:Ae.nullish(),mobileContent:Ae.nullish(),countryCode:e.string().nullish(),isSupporter:e.boolean().nullish(),tickerSettings:Y.nullish(),submitComponentEvent:e.any(),articleCounts:V,hasOptedOutOfArticleCount:e.boolean().nullish(),fetchEmail:e.any().nullish(),separateArticleCount:e.boolean().nullish(),design:ae.nullish(),choiceCardsSettings:de.nullish(),promoCodes:e.array(e.string()).nullish()}),Ie=e.object({heading:e.string(),subheading:e.string(),primaryCta:O.optional(),secondaryCta:O.optional(),benefits:e.array(e.string()).optional()}),Ne=e.object({content:Ie,tracking:_,mobileContent:Ie.optional(),countryCode:e.string().optional(),submitComponentEvent:e.any(),numArticles:e.number().optional(),promoCodes:e.array(e.string()).nullish()}),Me=e.object({image:J,bodyCopy:e.array(e.string()),cta:O.optional()});e.object({content:Me,tracking:_,countryCode:e.string().optional(),submitComponentEvent:e.any(),promoCodes:e.array(e.string()).nullish()});const Ee=e.enum(["Contribution","SupporterPlus","GuardianWeekly","Paper"]),Ge=e.enum(["new","guest","current"]),Ue=e.enum(["Epic","EpicAMP","EpicAppleNews","EpicLiveblog","Banner1","Banner2","Header","GutterLiveblog"]),Be=e.enum(["Live","Draft","Archived"]),Re=e.enum(["Mobile","Desktop","All","iOS","Android"]),Pe=e.enum(["SignedIn","SignedOut","All"]),De=e.enum(["HasConsented","HasNotConsented","All"]),Le=e.object({name:e.literal("ABTest")}),we=e.object({name:e.literal("EpsilonGreedyBandit"),epsilon:e.number(),sampleCount:e.number().optional()}),Oe=e.object({name:e.literal("Roulette"),sampleCount:e.number().optional()}),ke=e.intersection(e.discriminatedUnion("name",[Le,we,Oe]),e.object({testName:e.string().optional()})),fe=e.object({channel:Ue,name:e.string(),status:Be,priority:e.number(),controlProportionSettings:e.object({proportion:e.number(),offset:e.number()}).optional(),deviceType:Re.optional(),signedInStatus:Pe.optional(),consentStatus:De.optional(),methodologies:ke.array().optional()}),je=e.enum(["AllExistingSupporters","AllNonSupporters","Everyone","PostAskPauseSingleContributors"]),Ke=e.object({minViews:e.number(),maxViews:e.number().optional(),periodInWeeks:e.number(),tagIds:e.array(e.string()).optional()});e.object({userType:e.array(Ge),product:e.array(Ee)}),e.object({tagIds:e.array(e.string()),sectionIds:e.array(e.string()),excludedTagIds:e.array(e.string()),excludedSectionIds:e.array(e.string())});const Fe=e.object({maxViewsCount:e.number(),maxViewsDays:e.number(),minDaysBetweenViews:e.number()}),ve=["ONE_OFF","MONTHLY","ANNUAL"];fe.extend({name:e.string(),status:Be,locations:e.array(u).optional(),regionTargeting:c.optional(),tagIds:e.array(e.string()),sections:e.array(e.string()),excludedTagIds:e.array(e.string()),excludedSections:e.array(e.string()),alwaysAsk:e.boolean(),maxViews:Fe.optional(),userCohort:je,hasCountryName:e.boolean(),highPriority:e.boolean(),useLocalViewLog:e.boolean(),articlesViewedSettings:Ke.optional(),priority:e.number(),variants:he.array()});const He=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")])}),Ye=(e,n,t)=>{const a=(e=>new URLSearchParams(window.location.search).get(`force-${e}`))(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()))},Ve=(e,n)=>Ye("epic",e,n),We=(e,n)=>Ye("liveblog-epic",e,n),Ze=(e,n)=>Ye("banner",e,n),$e=(e,n)=>Ye("gutter-liveblog",e,n),xe=(e,n)=>Ye("header",e,n);export{l as CountryGroupId,k as SecondaryCtaType,He as abandonedBasketSchema,A as addRegionIdToSupportUrl,Te as bannerSchema,P as buildReminderFields,E as containsNonArticleCountPlaceholder,ve as contributionTabFrequencies,b as countryCodeToCountryGroupId,u as countryGroupIdSchema,d as countryGroups,Se as epicPropsSchema,Ze as getBanner,S as getCountryName,Ve as getEpic,U as getEpicViewLog,$e as getGutterLiveblog,xe as getHeader,We as getLiveblogEpic,h as getLocalCurrencySymbol,w as getReminderFields,i as getWeeklyArticleHistory,Ne as headerPropsSchema,ie as hexColourToString,C as inTargetedCountry,s as incrementWeeklyArticleCount,y as isGWCheckoutUrl,m as isoCurrencyToCurrencySymbol,B as logEpicView,N as replaceNonArticleCountPlaceholders,c as targetedRegionsSchema};
|
|
1
|
+
import{z as e}from"zod";const n="gu.history.weeklyArticleCount",t="gu.history.articleCountsThisWeek",a=e=>{const n=e.getDay()||7;return Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()-(n-1))/864e5},i=e=>e.get(n)||void 0,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"]),r=(e,n={})=>(e.forEach((e=>{o.has(e)&&(n[e]=(n[e]??0)+1)})),n),l=(e,i,o)=>{const l=((e,n)=>{const i=a(new Date),o=e.get(t);if(o&&o.week===i){const a=o.articles[n]||0;return e.set(t,{week:i,articles:{...o.articles,[n]:a+1}}),a>0}return e.set(t,{week:i,articles:{[n]:1}}),!1})(e,i);if(!l){const t=a(new Date),i=e.get(n)||[],l=i[0];if(l?.week&&l.week===t)l.count+=1,l.tags=r(o,l.tags),e.set(n,i);else{i.unshift({week:t,count:1,tags:r(o,{})});const a=t-365,l=i.filter((e=>e.week>=a));e.set(n,l)}}},s=["GBPCountries","UnitedStates","AUDCountries","EURCountries","International","NZDCountries","Canada"],u=e.enum(s),c=e.object({targetedCountryGroups:e.array(u),targetedCountryCodes:e.array(e.string()).optional()}).optional(),d={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"}},g={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"},p={GBPCountries:"£",UnitedStates:"$",AUDCountries:"$",Canada:"CA$",EURCountries:"€",NZDCountries:"NZ$",International:"$"},m={GBP:"£",USD:"$",AUD:"$",EUR:"€",NZD:"NZ$",CAD:"CA$"},C=e=>Object.keys(d).find((n=>d[n].countries.includes(e??"")))||"International",b=(e,n=[],t=[])=>0===n.length&&0===t.length||!!e&&(!!n.includes(C(e.toUpperCase()))||t.includes(e.toUpperCase())),h=e=>{if(e){const n=C(e);return p[n]}return"£"},S=e=>{if(e)return g[e]},y=e=>e.includes("subscribe/weekly/checkout"),A=(e,n)=>{if(n){const t=(e=>d[C(e)].supportRegionId)(n);if(t&&!y(e))return e.replace(/(support\.theguardian\.com)\/(contribute-in-epic|contribute|subscribe|checkout)/,((e,n,a)=>`${n}/${t.toLowerCase()}/${a}`))}return e},T=(e,n,t,a)=>{if(a){const i=a[C(t)];if(i){return`${h(t)}${i[e][n].price}`}}},I={CURRENCY_SYMBOL:({countryCode:e})=>h(e),COUNTRY_NAME:({countryCode:e})=>S(e),PRICE_DIGISUB_MONTHLY:({countryCode:e,prices:n})=>T("Digisub","Monthly",e,n),PRICE_DIGISUB_ANNUAL:({countryCode:e,prices:n})=>T("Digisub","Annual",e,n),PRICE_GUARDIANWEEKLY_MONTHLY:({countryCode:e,prices:n})=>T("GuardianWeekly","Monthly",e,n),PRICE_GUARDIANWEEKLY_ANNUAL:({countryCode:e,prices:n})=>T("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"}))()},N=(e,n,t)=>e?e.replace(M,(e=>{const a=e.substring(2,e.length-2),i=I[a];if(i){const e=i({countryCode:n,prices:t});if(e)return e}return e})):"",M=/%%.*?%%/g,E=e=>{const n=e.match(M)?.filter((e=>"%%ARTICLE_COUNT%%"!==e));return!!n&&n.length>0},G="gu.contributions.views",U=e=>e.get(G)??void 0,B=e=>{const n=localStorage.getItem(G),t=n?JSON.parse(n).value:[];t.push({date:(new Date).getTime(),testId:e});const a={value:t.slice(-50)};localStorage.setItem(G,JSON.stringify(a))},R=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},D=(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}`}},P=new Date("2023-12-31"),L=e=>e>=(e=>new Date(e.getFullYear(),9,20))(e)&&e<R(e.getFullYear()),w=(e,n=new Date)=>{return"US"===e&&L(n)?{reminderCta:"Remind me on Giving Tuesday",reminderPeriod:`${t=n.getFullYear()}-${(R(t).getMonth()+1).toString().padStart(0,"2")}-01`,reminderLabel:"on Giving Tuesday",reminderOption:`giving-tuesday-${t}`}:"US"===e&&(e=>e>=R(e.getFullYear())&&e<P)(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()):D(n);var t},O=e.object({text:e.string(),baseUrl:e.string()});let k=function(e){return e.Custom="CustomSecondaryCta",e.ContributionsReminder="ContributionsReminderSecondaryCta",e}({});e.nativeEnum(k);const f=e.object({type:e.literal(k.Custom),cta:O}),j=e.object({type:e.literal(k.ContributionsReminder)}),K=e.discriminatedUnion("type",[f,j]),F=e.object({countLabel:e.string(),goalCopy:e.string().optional()}),v=e.object({total:e.number(),goal:e.number()}),H=e.enum(["US","AU","global"]),Y=e.object({currencySymbol:e.string(),copy:F,name:H,tickerData:v.optional()}),V=e.object({for52Weeks:e.number(),forTargetedWeeks:e.number()}),W=e.enum(["for52Weeks","forTargetedWeeks"]),Z=e.object({type:e.literal("above"),copy:e.string().optional(),countType:W.optional()}),$=e.enum(["CONTRIBUTION","MEMBERSHIP_SUPPORTER","DIGITAL_SUBSCRIPTION","PRINT_SUBSCRIPTION"]),x=e.enum(["ACQUISITIONS_EPIC","ACQUISITIONS_ENGAGEMENT_BANNER","ACQUISITIONS_SUBSCRIPTIONS_BANNER","ACQUISITIONS_HEADER","ACQUISITIONS_OTHER"]),_=e.object({abTestName:e.string(),abTestVariant:e.string(),campaignCode:e.string(),componentType:x,products:e.array($).nullish(),labels:e.array(e.string()).nullish(),ophanPageId:e.string(),platformId:e.string(),referrerUrl:e.string()}),J=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:J.optional()}),z=/^[0-9A-F]{2}$/,q=e.string().refine((e=>z.test(e)),(e=>({message:`"${e}" is not a valid hex value`}))),X=e.object({r:q,g:q,b:q,kind:e.literal("hex")}),ee=e.object({mobileUrl:e.string(),tabletUrl:e.string(),desktopUrl:e.string(),altText:e.string(),kind:e.literal("Image")}),ne=e.object({buttonColour:X.nullish(),buttonTextColour:X.nullish(),buttonBorderColour:X.nullish(),buttonSelectColour:X.nullish(),buttonSelectTextColour:X.nullish(),buttonSelectBorderColour:X.nullish(),buttonSelectMarkerColour:X.nullish(),pillTextColour:X.nullish(),pillBackgroundColour:X.nullish(),kind:e.literal("ChoiceCards")}),te=e.discriminatedUnion("kind",[ee,ne]),ae=e.object({visual:te.nullish(),colours:e.object({basic:e.object({background:X,bodyText:X})})}),ie=e=>`#${e.r}${e.g}${e.b}`,oe=e.object({copy:e.string()}),re=e.union([e.literal("Monthly"),e.literal("Annual")]),le=e.discriminatedUnion("supportTier",[e.object({supportTier:e.literal("Contribution"),ratePlan:re}),e.object({supportTier:e.literal("SupporterPlus"),ratePlan:re}),e.object({supportTier:e.literal("OneOff")})]),se=e.object({copy:e.string(),textColour:X.nullish(),backgroundColour:X.nullish()}),ue=e.union([e.literal("LandingPage"),e.literal("Checkout")]),ce=e.object({product:le,label:e.string(),isDefault:e.boolean(),benefitsLabel:e.string().nullish(),benefits:e.array(oe),pill:se.nullish(),destination:ue.nullish()}),de=e.object({choiceCards:e.array(ce),mobileChoiceCards:e.array(ce).nullish()}),ge=e.object({maxViewsCount:e.number(),maxViewsDays:e.number(),minDaysBetweenViews:e.number()}),pe=e.object({reminderCta:e.string(),reminderLabel:e.string(),reminderPeriod:e.string()}),me=e.enum(["ONE_OFF","MONTHLY","ANNUAL"]),Ce=e.object({testName:e.string(),variantName:e.string(),defaultContributionType:me,displayContributionType:me.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()})})}),be=e.object({newsletterId:e.string(),successDescription:e.string()}),he=e.object({name:e.string(),heading:e.string().optional(),paragraphs:e.array(e.string()),highlightedText:e.string().optional(),tickerSettings:Y.optional(),cta:O.optional(),secondaryCta:K.optional(),newsletterSignup:be.optional(),image:J.optional(),showReminderFields:pe.optional(),separateArticleCount:Z.optional(),promoCodes:e.array(e.string()).nullish(),maxViews:ge.optional(),showSignInLink:e.boolean().optional(),bylineWithImage:Q.optional(),showChoiceCards:e.boolean().optional(),choiceCardsSettings:de.nullish(),choiceCardAmounts:Ce.optional(),defaultChoiceCardFrequency:me.optional()}),Se=e.object({variant:he,tracking:_,countryCode:e.string().nullish(),articleCounts:V,onReminderOpen:e.any().nullish(),fetchEmail:e.any().nullish(),submitComponentEvent:e.any().nullish(),openCmp:e.any().nullish(),hasConsentForArticleCount:e.boolean().nullish(),stage:e.string().nullish()}),ye=e.enum(["contributions","subscriptions","signIn","abandonedBasket"]),Ae=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:O.optional(),secondaryCta:K.optional()}),Te=e.object({tracking:_,bannerChannel:ye,content:Ae.nullish(),mobileContent:Ae.nullish(),countryCode:e.string().nullish(),isSupporter:e.boolean().nullish(),tickerSettings:Y.nullish(),submitComponentEvent:e.any(),articleCounts:V,hasOptedOutOfArticleCount:e.boolean().nullish(),fetchEmail:e.any().nullish(),separateArticleCount:e.boolean().nullish(),design:ae.nullish(),choiceCardsSettings:de.nullish(),promoCodes:e.array(e.string()).nullish()}),Ie=e.object({heading:e.string(),subheading:e.string(),primaryCta:O.optional(),secondaryCta:O.optional(),benefits:e.array(e.string()).optional()}),Ne=e.object({content:Ie,tracking:_,mobileContent:Ie.optional(),countryCode:e.string().optional(),submitComponentEvent:e.any(),numArticles:e.number().optional(),promoCodes:e.array(e.string()).nullish()}),Me=e.object({image:J,bodyCopy:e.array(e.string()),cta:O.optional()});e.object({content:Me,tracking:_,countryCode:e.string().optional(),submitComponentEvent:e.any(),promoCodes:e.array(e.string()).nullish()});const Ee=e.enum(["Contribution","SupporterPlus","GuardianWeekly","Paper"]),Ge=e.enum(["new","guest","current"]),Ue=e.enum(["Epic","EpicAppleNews","EpicLiveblog","Banner1","Banner2","Header","GutterLiveblog"]),Be=e.enum(["Live","Draft","Archived"]),Re=e.enum(["Mobile","Desktop","All","iOS","Android"]),De=e.enum(["SignedIn","SignedOut","All"]),Pe=e.enum(["HasConsented","HasNotConsented","All"]),Le=e.object({name:e.literal("ABTest")}),we=e.object({name:e.literal("EpsilonGreedyBandit"),epsilon:e.number(),sampleCount:e.number().optional()}),Oe=e.object({name:e.literal("Roulette"),sampleCount:e.number().optional()}),ke=e.intersection(e.discriminatedUnion("name",[Le,we,Oe]),e.object({testName:e.string().optional()})),fe=e.object({channel:Ue,name:e.string(),status:Be,priority:e.number(),controlProportionSettings:e.object({proportion:e.number(),offset:e.number()}).optional(),deviceType:Re.optional(),signedInStatus:De.optional(),consentStatus:Pe.optional(),methodologies:ke.array().optional()}),je=e.enum(["AllExistingSupporters","AllNonSupporters","Everyone","PostAskPauseSingleContributors"]),Ke=e.object({minViews:e.number(),maxViews:e.number().optional(),periodInWeeks:e.number(),tagIds:e.array(e.string()).optional()});e.object({userType:e.array(Ge),product:e.array(Ee)}),e.object({tagIds:e.array(e.string()),sectionIds:e.array(e.string()),excludedTagIds:e.array(e.string()),excludedSectionIds:e.array(e.string())});const Fe=e.object({maxViewsCount:e.number(),maxViewsDays:e.number(),minDaysBetweenViews:e.number()}),ve=["ONE_OFF","MONTHLY","ANNUAL"];fe.extend({name:e.string(),status:Be,locations:e.array(u).optional(),regionTargeting:c.optional(),tagIds:e.array(e.string()),sections:e.array(e.string()),excludedTagIds:e.array(e.string()),excludedSections:e.array(e.string()),alwaysAsk:e.boolean(),maxViews:Fe.optional(),userCohort:je,hasCountryName:e.boolean(),highPriority:e.boolean(),useLocalViewLog:e.boolean(),articlesViewedSettings:Ke.optional(),priority:e.number(),variants:he.array()});const He=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")])}),Ye=(e,n,t)=>{const a=(e=>new URLSearchParams(window.location.search).get(`force-${e}`))(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()))},Ve=(e,n)=>Ye("epic",e,n),We=(e,n)=>Ye("liveblog-epic",e,n),Ze=(e,n)=>Ye("banner",e,n),$e=(e,n)=>Ye("gutter-liveblog",e,n),xe=(e,n)=>Ye("header",e,n);export{s as CountryGroupId,k as SecondaryCtaType,He as abandonedBasketSchema,A as addRegionIdToSupportUrl,Te as bannerSchema,D as buildReminderFields,E as containsNonArticleCountPlaceholder,ve as contributionTabFrequencies,C as countryCodeToCountryGroupId,u as countryGroupIdSchema,d as countryGroups,Se as epicPropsSchema,Ze as getBanner,S as getCountryName,Ve as getEpic,U as getEpicViewLog,$e as getGutterLiveblog,xe as getHeader,We as getLiveblogEpic,h as getLocalCurrencySymbol,w as getReminderFields,i as getWeeklyArticleHistory,Ne as headerPropsSchema,ie as hexColourToString,b as inTargetedCountry,l as incrementWeeklyArticleCount,y as isGWCheckoutUrl,m as isoCurrencyToCurrencySymbol,B as logEpicView,N as replaceNonArticleCountPlaceholders,c as targetedRegionsSchema};
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("zod");const t="gu.history.weeklyArticleCount",n="gu.history.articleCountsThisWeek",a=e=>{const t=e.getDay()||7;return Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()-(t-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"]),r=(e,t={})=>(e.forEach((e=>{o.has(e)&&(t[e]=(t[e]??0)+1)})),t),i=["GBPCountries","UnitedStates","AUDCountries","EURCountries","International","NZDCountries","Canada"],s=e.z.enum(i),l=e.z.object({targetedCountryGroups:e.z.array(s),targetedCountryCodes:e.z.array(e.z.string()).optional()}).optional(),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:"$"},z=e=>Object.keys(u).find((t=>u[t].countries.includes(e??"")))||"International",p=e=>{if(e){const t=z(e);return d[t]}return"£"},g=e=>{if(e)return c[e]},m=e=>e.includes("subscribe/weekly/checkout"),C=(e,t,n,a)=>{if(a){const o=a[z(n)];if(o){return`${p(n)}${o[e][t].price}`}}},b={CURRENCY_SYMBOL:({countryCode:e})=>p(e),COUNTRY_NAME:({countryCode:e})=>g(e),PRICE_DIGISUB_MONTHLY:({countryCode:e,prices:t})=>C("Digisub","Monthly",e,t),PRICE_DIGISUB_ANNUAL:({countryCode:e,prices:t})=>C("Digisub","Annual",e,t),PRICE_GUARDIANWEEKLY_MONTHLY:({countryCode:e,prices:t})=>C("GuardianWeekly","Monthly",e,t),PRICE_GUARDIANWEEKLY_ANNUAL:({countryCode:e,prices:t})=>C("GuardianWeekly","Annual",e,t),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"}))()},h=/%%.*?%%/g,S="gu.contributions.views",y=e=>{const t=(e=>{const t=new Date(e,10,1).getDay();return new Date(e,10,22+(11-t)%7)})(e);return t.setDate(t.getDate()+5),t},A=(e=new Date)=>{const t=(e=>{const t=e.getDate()<20?1:2;return e.setMonth(e.getMonth()+t),e})(e),n=(t.getMonth()+1).toString().padStart(2,"0"),a=t.toLocaleString("default",{month:"long"}),o=t.getFullYear();return{reminderCta:`Remind me in ${a}`,reminderPeriod:`${o}-${n}-01`,reminderLabel:`${a} ${o}`}},T=new Date("2023-12-31"),I=e=>e>=(e=>new Date(e.getFullYear(),9,20))(e)&&e<y(e.getFullYear()),N=e.z.object({text:e.z.string(),baseUrl:e.z.string()});let M=function(e){return e.Custom="CustomSecondaryCta",e.ContributionsReminder="ContributionsReminderSecondaryCta",e}({});e.z.nativeEnum(M);const E=e.z.object({type:e.z.literal(M.Custom),cta:N}),G=e.z.object({type:e.z.literal(M.ContributionsReminder)}),U=e.z.discriminatedUnion("type",[E,G]),B=e.z.object({countLabel:e.z.string(),goalCopy:e.z.string().optional()}),R=e.z.object({total:e.z.number(),goal:e.z.number()}),P=e.z.enum(["US","AU","global"]),L=e.z.object({currencySymbol:e.z.string(),copy:B,name:P,tickerData:R.optional()}),D=e.z.object({for52Weeks:e.z.number(),forTargetedWeeks:e.z.number()}),w=e.z.enum(["for52Weeks","forTargetedWeeks"]),O=e.z.object({type:e.z.literal("above"),copy:e.z.string().optional(),countType:w.optional()}),k=e.z.enum(["CONTRIBUTION","MEMBERSHIP_SUPPORTER","DIGITAL_SUBSCRIPTION","PRINT_SUBSCRIPTION"]),x=e.z.enum(["ACQUISITIONS_EPIC","ACQUISITIONS_ENGAGEMENT_BANNER","ACQUISITIONS_SUBSCRIPTIONS_BANNER","ACQUISITIONS_HEADER","ACQUISITIONS_OTHER"]),j=e.z.object({abTestName:e.z.string(),abTestVariant:e.z.string(),campaignCode:e.z.string(),componentType:x,products:e.z.array(k).nullish(),labels:e.z.array(e.z.string()).nullish(),ophanPageId:e.z.string(),platformId:e.z.string(),referrerUrl:e.z.string()}),f=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()}),F=e.z.object({name:e.z.string(),description:e.z.string().optional(),headshot:f.optional()}),v=/^[0-9A-F]{2}$/,K=e.z.string().refine((e=>v.test(e)),(e=>({message:`"${e}" is not a valid hex value`}))),H=e.z.object({r:K,g:K,b:K,kind:e.z.literal("hex")}),V=e.z.object({mobileUrl:e.z.string(),tabletUrl:e.z.string(),desktopUrl:e.z.string(),altText:e.z.string(),kind:e.z.literal("Image")}),Y=e.z.object({buttonColour:H.nullish(),buttonTextColour:H.nullish(),buttonBorderColour:H.nullish(),buttonSelectColour:H.nullish(),buttonSelectTextColour:H.nullish(),buttonSelectBorderColour:H.nullish(),kind:e.z.literal("ChoiceCards")}),W=e.z.discriminatedUnion("kind",[V,Y]),Z=e.z.object({visual:W.nullish(),colours:e.z.object({basic:e.z.object({background:H,bodyText:H})})}),$=e.z.object({copy:e.z.string()}),_=e.z.union([e.z.literal("Monthly"),e.z.literal("Annual")]),J=e.z.discriminatedUnion("supportTier",[e.z.object({supportTier:e.z.literal("Contribution"),ratePlan:_}),e.z.object({supportTier:e.z.literal("SupporterPlus"),ratePlan:_}),e.z.object({supportTier:e.z.literal("OneOff")})]),Q=e.z.object({copy:e.z.string(),textColour:H.nullish(),backgroundColour:H.nullish()}),q=e.z.union([e.z.literal("LandingPage"),e.z.literal("Checkout")]),X=e.z.object({product:J,label:e.z.string(),isDefault:e.z.boolean(),benefitsLabel:e.z.string().nullish(),benefits:e.z.array($),pill:Q.nullish(),destination:q.nullish()}),ee=e.z.object({choiceCards:e.z.array(X),mobileChoiceCards:e.z.array(X).nullish()}),te=e.z.object({maxViewsCount:e.z.number(),maxViewsDays:e.z.number(),minDaysBetweenViews:e.z.number()}),ne=e.z.object({reminderCta:e.z.string(),reminderLabel:e.z.string(),reminderPeriod:e.z.string()}),ae=e.z.enum(["ONE_OFF","MONTHLY","ANNUAL"]),oe=e.z.object({testName:e.z.string(),variantName:e.z.string(),defaultContributionType:ae,displayContributionType:ae.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()})})}),re=e.z.object({newsletterId:e.z.string(),successDescription:e.z.string()}),ie=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:L.optional(),cta:N.optional(),secondaryCta:U.optional(),newsletterSignup:re.optional(),image:f.optional(),showReminderFields:ne.optional(),separateArticleCount:O.optional(),promoCodes:e.z.array(e.z.string()).nullish(),maxViews:te.optional(),showSignInLink:e.z.boolean().optional(),bylineWithImage:F.optional(),showChoiceCards:e.z.boolean().optional(),choiceCardsSettings:ee.nullish(),choiceCardAmounts:oe.optional(),defaultChoiceCardFrequency:ae.optional()}),se=e.z.object({variant:ie,tracking:j,countryCode:e.z.string().nullish(),articleCounts:D,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()}),le=e.z.enum(["contributions","subscriptions","signIn","abandonedBasket"]),ue=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:N.optional(),secondaryCta:U.optional()}),ce=e.z.object({tracking:j,bannerChannel:le,content:ue.nullish(),mobileContent:ue.nullish(),countryCode:e.z.string().nullish(),isSupporter:e.z.boolean().nullish(),tickerSettings:L.nullish(),submitComponentEvent:e.z.any(),articleCounts:D,hasOptedOutOfArticleCount:e.z.boolean().nullish(),fetchEmail:e.z.any().nullish(),separateArticleCount:e.z.boolean().nullish(),design:Z.nullish(),choiceCardsSettings:ee.nullish(),promoCodes:e.z.array(e.z.string()).nullish()}),de=e.z.object({heading:e.z.string(),subheading:e.z.string(),primaryCta:N.optional(),secondaryCta:N.optional(),benefits:e.z.array(e.z.string()).optional()}),ze=e.z.object({content:de,tracking:j,mobileContent:de.optional(),countryCode:e.z.string().optional(),submitComponentEvent:e.z.any(),numArticles:e.z.number().optional(),promoCodes:e.z.array(e.z.string()).nullish()}),pe=e.z.object({image:f,bodyCopy:e.z.array(e.z.string()),cta:N.optional()});e.z.object({content:pe,tracking:j,countryCode:e.z.string().optional(),submitComponentEvent:e.z.any(),promoCodes:e.z.array(e.z.string()).nullish()});const ge=e.z.enum(["Contribution","SupporterPlus","GuardianWeekly","Paper"]),me=e.z.enum(["new","guest","current"]),Ce=e.z.enum(["Epic","EpicAMP","EpicAppleNews","EpicLiveblog","Banner1","Banner2","Header","GutterLiveblog"]),be=e.z.enum(["Live","Draft","Archived"]),he=e.z.enum(["Mobile","Desktop","All","iOS","Android"]),Se=e.z.enum(["SignedIn","SignedOut","All"]),ye=e.z.enum(["HasConsented","HasNotConsented","All"]),Ae=e.z.object({name:e.z.literal("ABTest")}),Te=e.z.object({name:e.z.literal("EpsilonGreedyBandit"),epsilon:e.z.number(),sampleCount:e.z.number().optional()}),Ie=e.z.object({name:e.z.literal("Roulette"),sampleCount:e.z.number().optional()}),Ne=e.z.intersection(e.z.discriminatedUnion("name",[Ae,Te,Ie]),e.z.object({testName:e.z.string().optional()})),Me=e.z.object({channel:Ce,name:e.z.string(),status:be,priority:e.z.number(),controlProportionSettings:e.z.object({proportion:e.z.number(),offset:e.z.number()}).optional(),deviceType:he.optional(),signedInStatus:Se.optional(),consentStatus:ye.optional(),methodologies:Ne.array().optional()}),Ee=e.z.enum(["AllExistingSupporters","AllNonSupporters","Everyone","PostAskPauseSingleContributors"]),Ge=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(me),product:e.z.array(ge)}),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 Ue=e.z.object({maxViewsCount:e.z.number(),maxViewsDays:e.z.number(),minDaysBetweenViews:e.z.number()});Me.extend({name:e.z.string(),status:be,locations:e.z.array(s).optional(),regionTargeting:l.optional(),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:Ue.optional(),userCohort:Ee,hasCountryName:e.z.boolean(),highPriority:e.z.boolean(),useLocalViewLog:e.z.boolean(),articlesViewedSettings:Ge.optional(),priority:e.z.number(),variants:ie.array()});const Be=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")])}),Re=(e,t,n)=>{const a=(e=>new URLSearchParams(window.location.search).get(`force-${e}`))(e);return fetch(`${t}/${e}${a?`?force=${a}`:""}`,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}).then((t=>{if(!t.ok)throw Error(t.statusText||`Supporter Revenue ${e} | Api call returned HTTP status ${t.status}`);return t})).then((e=>e.json()))};exports.CountryGroupId=i,exports.SecondaryCtaType=M,exports.abandonedBasketSchema=Be,exports.addRegionIdToSupportUrl=(e,t)=>{if(t){const n=(e=>u[z(e)].supportRegionId)(t);if(n&&!m(e))return e.replace(/(support\.theguardian\.com)\/(contribute-in-epic|contribute|subscribe|checkout)/,((e,t,a)=>`${t}/${n.toLowerCase()}/${a}`))}return e},exports.bannerSchema=ce,exports.buildReminderFields=A,exports.containsNonArticleCountPlaceholder=e=>{const t=e.match(h)?.filter((e=>"%%ARTICLE_COUNT%%"!==e));return!!t&&t.length>0},exports.contributionTabFrequencies=["ONE_OFF","MONTHLY","ANNUAL"],exports.countryCodeToCountryGroupId=z,exports.countryGroupIdSchema=s,exports.countryGroups=u,exports.epicPropsSchema=se,exports.getBanner=(e,t)=>Re("banner",e,t),exports.getCountryName=g,exports.getEpic=(e,t)=>Re("epic",e,t),exports.getEpicViewLog=e=>e.get(S)??void 0,exports.getGutterLiveblog=(e,t)=>Re("gutter-liveblog",e,t),exports.getHeader=(e,t)=>Re("header",e,t),exports.getLiveblogEpic=(e,t)=>Re("liveblog-epic",e,t),exports.getLocalCurrencySymbol=p,exports.getReminderFields=(e,t=new Date)=>{return"US"===e&&I(t)?{reminderCta:"Remind me on Giving Tuesday",reminderPeriod:`${n=t.getFullYear()}-${(y(n).getMonth()+1).toString().padStart(0,"2")}-01`,reminderLabel:"on Giving Tuesday",reminderOption:`giving-tuesday-${n}`}:"US"===e&&(e=>e>=y(e.getFullYear())&&e<T)(t)?(e=>({reminderCta:"Remind me on New Years Eve",reminderPeriod:`${e}-12-01`,reminderLabel:"on New Years Eve",reminderOption:`new-years-eve-${e}`}))(t.getFullYear()):A(t);var n},exports.getWeeklyArticleHistory=e=>e.get(t)||void 0,exports.headerPropsSchema=ze,exports.hexColourToString=e=>`#${e.r}${e.g}${e.b}`,exports.inTargetedCountry=(e,t=[],n=[])=>0===t.length&&0===n.length||!!e&&(!!t.includes(z(e.toUpperCase()))||n.includes(e.toUpperCase())),exports.incrementWeeklyArticleCount=(e,o,i)=>{const s=((e,t)=>{const o=a(new Date),r=e.get(n);if(r&&r.week===o){const a=r.articles[t]||0;return e.set(n,{week:o,articles:{...r.articles,[t]:a+1}}),a>0}return e.set(n,{week:o,articles:{[t]:1}}),!1})(e,o);if(!s){const n=a(new Date),o=e.get(t)||[],s=o[0];if(s?.week&&s.week===n)s.count+=1,s.tags=r(i,s.tags),e.set(t,o);else{o.unshift({week:n,count:1,tags:r(i,{})});const a=n-365,s=o.filter((e=>e.week>=a));e.set(t,s)}}},exports.isGWCheckoutUrl=m,exports.isoCurrencyToCurrencySymbol={GBP:"£",USD:"$",AUD:"$",EUR:"€",NZD:"NZ$",CAD:"CA$"},exports.logEpicView=e=>{const t=localStorage.getItem(S),n=t?JSON.parse(t).value:[];n.push({date:(new Date).getTime(),testId:e});const a={value:n.slice(-50)};localStorage.setItem(S,JSON.stringify(a))},exports.replaceNonArticleCountPlaceholders=(e,t,n)=>e?e.replace(h,(e=>{const a=e.substring(2,e.length-2),o=b[a];if(o){const e=o({countryCode:t,prices:n});if(e)return e}return e})):"",exports.targetedRegionsSchema=l;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("zod");const t="gu.history.weeklyArticleCount",n="gu.history.articleCountsThisWeek",a=e=>{const t=e.getDay()||7;return Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()-(t-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"]),r=(e,t={})=>(e.forEach((e=>{o.has(e)&&(t[e]=(t[e]??0)+1)})),t),i=["GBPCountries","UnitedStates","AUDCountries","EURCountries","International","NZDCountries","Canada"],s=e.z.enum(i),l=e.z.object({targetedCountryGroups:e.z.array(s),targetedCountryCodes:e.z.array(e.z.string()).optional()}).optional(),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:"$"},z=e=>Object.keys(u).find((t=>u[t].countries.includes(e??"")))||"International",p=e=>{if(e){const t=z(e);return d[t]}return"£"},g=e=>{if(e)return c[e]},m=e=>e.includes("subscribe/weekly/checkout"),C=(e,t,n,a)=>{if(a){const o=a[z(n)];if(o){return`${p(n)}${o[e][t].price}`}}},b={CURRENCY_SYMBOL:({countryCode:e})=>p(e),COUNTRY_NAME:({countryCode:e})=>g(e),PRICE_DIGISUB_MONTHLY:({countryCode:e,prices:t})=>C("Digisub","Monthly",e,t),PRICE_DIGISUB_ANNUAL:({countryCode:e,prices:t})=>C("Digisub","Annual",e,t),PRICE_GUARDIANWEEKLY_MONTHLY:({countryCode:e,prices:t})=>C("GuardianWeekly","Monthly",e,t),PRICE_GUARDIANWEEKLY_ANNUAL:({countryCode:e,prices:t})=>C("GuardianWeekly","Annual",e,t),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"}))()},h=/%%.*?%%/g,S="gu.contributions.views",y=e=>{const t=(e=>{const t=new Date(e,10,1).getDay();return new Date(e,10,22+(11-t)%7)})(e);return t.setDate(t.getDate()+5),t},A=(e=new Date)=>{const t=(e=>{const t=e.getDate()<20?1:2;return e.setMonth(e.getMonth()+t),e})(e),n=(t.getMonth()+1).toString().padStart(2,"0"),a=t.toLocaleString("default",{month:"long"}),o=t.getFullYear();return{reminderCta:`Remind me in ${a}`,reminderPeriod:`${o}-${n}-01`,reminderLabel:`${a} ${o}`}},T=new Date("2023-12-31"),I=e=>e>=(e=>new Date(e.getFullYear(),9,20))(e)&&e<y(e.getFullYear()),N=e.z.object({text:e.z.string(),baseUrl:e.z.string()});let M=function(e){return e.Custom="CustomSecondaryCta",e.ContributionsReminder="ContributionsReminderSecondaryCta",e}({});e.z.nativeEnum(M);const E=e.z.object({type:e.z.literal(M.Custom),cta:N}),G=e.z.object({type:e.z.literal(M.ContributionsReminder)}),U=e.z.discriminatedUnion("type",[E,G]),B=e.z.object({countLabel:e.z.string(),goalCopy:e.z.string().optional()}),R=e.z.object({total:e.z.number(),goal:e.z.number()}),P=e.z.enum(["US","AU","global"]),L=e.z.object({currencySymbol:e.z.string(),copy:B,name:P,tickerData:R.optional()}),D=e.z.object({for52Weeks:e.z.number(),forTargetedWeeks:e.z.number()}),w=e.z.enum(["for52Weeks","forTargetedWeeks"]),k=e.z.object({type:e.z.literal("above"),copy:e.z.string().optional(),countType:w.optional()}),O=e.z.enum(["CONTRIBUTION","MEMBERSHIP_SUPPORTER","DIGITAL_SUBSCRIPTION","PRINT_SUBSCRIPTION"]),x=e.z.enum(["ACQUISITIONS_EPIC","ACQUISITIONS_ENGAGEMENT_BANNER","ACQUISITIONS_SUBSCRIPTIONS_BANNER","ACQUISITIONS_HEADER","ACQUISITIONS_OTHER"]),j=e.z.object({abTestName:e.z.string(),abTestVariant:e.z.string(),campaignCode:e.z.string(),componentType:x,products:e.z.array(O).nullish(),labels:e.z.array(e.z.string()).nullish(),ophanPageId:e.z.string(),platformId:e.z.string(),referrerUrl:e.z.string()}),f=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()}),F=e.z.object({name:e.z.string(),description:e.z.string().optional(),headshot:f.optional()}),v=/^[0-9A-F]{2}$/,K=e.z.string().refine((e=>v.test(e)),(e=>({message:`"${e}" is not a valid hex value`}))),H=e.z.object({r:K,g:K,b:K,kind:e.z.literal("hex")}),V=e.z.object({mobileUrl:e.z.string(),tabletUrl:e.z.string(),desktopUrl:e.z.string(),altText:e.z.string(),kind:e.z.literal("Image")}),Y=e.z.object({buttonColour:H.nullish(),buttonTextColour:H.nullish(),buttonBorderColour:H.nullish(),buttonSelectColour:H.nullish(),buttonSelectTextColour:H.nullish(),buttonSelectBorderColour:H.nullish(),buttonSelectMarkerColour:H.nullish(),pillTextColour:H.nullish(),pillBackgroundColour:H.nullish(),kind:e.z.literal("ChoiceCards")}),W=e.z.discriminatedUnion("kind",[V,Y]),Z=e.z.object({visual:W.nullish(),colours:e.z.object({basic:e.z.object({background:H,bodyText:H})})}),$=e.z.object({copy:e.z.string()}),_=e.z.union([e.z.literal("Monthly"),e.z.literal("Annual")]),J=e.z.discriminatedUnion("supportTier",[e.z.object({supportTier:e.z.literal("Contribution"),ratePlan:_}),e.z.object({supportTier:e.z.literal("SupporterPlus"),ratePlan:_}),e.z.object({supportTier:e.z.literal("OneOff")})]),Q=e.z.object({copy:e.z.string(),textColour:H.nullish(),backgroundColour:H.nullish()}),q=e.z.union([e.z.literal("LandingPage"),e.z.literal("Checkout")]),X=e.z.object({product:J,label:e.z.string(),isDefault:e.z.boolean(),benefitsLabel:e.z.string().nullish(),benefits:e.z.array($),pill:Q.nullish(),destination:q.nullish()}),ee=e.z.object({choiceCards:e.z.array(X),mobileChoiceCards:e.z.array(X).nullish()}),te=e.z.object({maxViewsCount:e.z.number(),maxViewsDays:e.z.number(),minDaysBetweenViews:e.z.number()}),ne=e.z.object({reminderCta:e.z.string(),reminderLabel:e.z.string(),reminderPeriod:e.z.string()}),ae=e.z.enum(["ONE_OFF","MONTHLY","ANNUAL"]),oe=e.z.object({testName:e.z.string(),variantName:e.z.string(),defaultContributionType:ae,displayContributionType:ae.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()})})}),re=e.z.object({newsletterId:e.z.string(),successDescription:e.z.string()}),ie=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:L.optional(),cta:N.optional(),secondaryCta:U.optional(),newsletterSignup:re.optional(),image:f.optional(),showReminderFields:ne.optional(),separateArticleCount:k.optional(),promoCodes:e.z.array(e.z.string()).nullish(),maxViews:te.optional(),showSignInLink:e.z.boolean().optional(),bylineWithImage:F.optional(),showChoiceCards:e.z.boolean().optional(),choiceCardsSettings:ee.nullish(),choiceCardAmounts:oe.optional(),defaultChoiceCardFrequency:ae.optional()}),se=e.z.object({variant:ie,tracking:j,countryCode:e.z.string().nullish(),articleCounts:D,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()}),le=e.z.enum(["contributions","subscriptions","signIn","abandonedBasket"]),ue=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:N.optional(),secondaryCta:U.optional()}),ce=e.z.object({tracking:j,bannerChannel:le,content:ue.nullish(),mobileContent:ue.nullish(),countryCode:e.z.string().nullish(),isSupporter:e.z.boolean().nullish(),tickerSettings:L.nullish(),submitComponentEvent:e.z.any(),articleCounts:D,hasOptedOutOfArticleCount:e.z.boolean().nullish(),fetchEmail:e.z.any().nullish(),separateArticleCount:e.z.boolean().nullish(),design:Z.nullish(),choiceCardsSettings:ee.nullish(),promoCodes:e.z.array(e.z.string()).nullish()}),de=e.z.object({heading:e.z.string(),subheading:e.z.string(),primaryCta:N.optional(),secondaryCta:N.optional(),benefits:e.z.array(e.z.string()).optional()}),ze=e.z.object({content:de,tracking:j,mobileContent:de.optional(),countryCode:e.z.string().optional(),submitComponentEvent:e.z.any(),numArticles:e.z.number().optional(),promoCodes:e.z.array(e.z.string()).nullish()}),pe=e.z.object({image:f,bodyCopy:e.z.array(e.z.string()),cta:N.optional()});e.z.object({content:pe,tracking:j,countryCode:e.z.string().optional(),submitComponentEvent:e.z.any(),promoCodes:e.z.array(e.z.string()).nullish()});const ge=e.z.enum(["Contribution","SupporterPlus","GuardianWeekly","Paper"]),me=e.z.enum(["new","guest","current"]),Ce=e.z.enum(["Epic","EpicAppleNews","EpicLiveblog","Banner1","Banner2","Header","GutterLiveblog"]),be=e.z.enum(["Live","Draft","Archived"]),he=e.z.enum(["Mobile","Desktop","All","iOS","Android"]),Se=e.z.enum(["SignedIn","SignedOut","All"]),ye=e.z.enum(["HasConsented","HasNotConsented","All"]),Ae=e.z.object({name:e.z.literal("ABTest")}),Te=e.z.object({name:e.z.literal("EpsilonGreedyBandit"),epsilon:e.z.number(),sampleCount:e.z.number().optional()}),Ie=e.z.object({name:e.z.literal("Roulette"),sampleCount:e.z.number().optional()}),Ne=e.z.intersection(e.z.discriminatedUnion("name",[Ae,Te,Ie]),e.z.object({testName:e.z.string().optional()})),Me=e.z.object({channel:Ce,name:e.z.string(),status:be,priority:e.z.number(),controlProportionSettings:e.z.object({proportion:e.z.number(),offset:e.z.number()}).optional(),deviceType:he.optional(),signedInStatus:Se.optional(),consentStatus:ye.optional(),methodologies:Ne.array().optional()}),Ee=e.z.enum(["AllExistingSupporters","AllNonSupporters","Everyone","PostAskPauseSingleContributors"]),Ge=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(me),product:e.z.array(ge)}),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 Ue=e.z.object({maxViewsCount:e.z.number(),maxViewsDays:e.z.number(),minDaysBetweenViews:e.z.number()});Me.extend({name:e.z.string(),status:be,locations:e.z.array(s).optional(),regionTargeting:l.optional(),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:Ue.optional(),userCohort:Ee,hasCountryName:e.z.boolean(),highPriority:e.z.boolean(),useLocalViewLog:e.z.boolean(),articlesViewedSettings:Ge.optional(),priority:e.z.number(),variants:ie.array()});const Be=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")])}),Re=(e,t,n)=>{const a=(e=>new URLSearchParams(window.location.search).get(`force-${e}`))(e);return fetch(`${t}/${e}${a?`?force=${a}`:""}`,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}).then((t=>{if(!t.ok)throw Error(t.statusText||`Supporter Revenue ${e} | Api call returned HTTP status ${t.status}`);return t})).then((e=>e.json()))};exports.CountryGroupId=i,exports.SecondaryCtaType=M,exports.abandonedBasketSchema=Be,exports.addRegionIdToSupportUrl=(e,t)=>{if(t){const n=(e=>u[z(e)].supportRegionId)(t);if(n&&!m(e))return e.replace(/(support\.theguardian\.com)\/(contribute-in-epic|contribute|subscribe|checkout)/,((e,t,a)=>`${t}/${n.toLowerCase()}/${a}`))}return e},exports.bannerSchema=ce,exports.buildReminderFields=A,exports.containsNonArticleCountPlaceholder=e=>{const t=e.match(h)?.filter((e=>"%%ARTICLE_COUNT%%"!==e));return!!t&&t.length>0},exports.contributionTabFrequencies=["ONE_OFF","MONTHLY","ANNUAL"],exports.countryCodeToCountryGroupId=z,exports.countryGroupIdSchema=s,exports.countryGroups=u,exports.epicPropsSchema=se,exports.getBanner=(e,t)=>Re("banner",e,t),exports.getCountryName=g,exports.getEpic=(e,t)=>Re("epic",e,t),exports.getEpicViewLog=e=>e.get(S)??void 0,exports.getGutterLiveblog=(e,t)=>Re("gutter-liveblog",e,t),exports.getHeader=(e,t)=>Re("header",e,t),exports.getLiveblogEpic=(e,t)=>Re("liveblog-epic",e,t),exports.getLocalCurrencySymbol=p,exports.getReminderFields=(e,t=new Date)=>{return"US"===e&&I(t)?{reminderCta:"Remind me on Giving Tuesday",reminderPeriod:`${n=t.getFullYear()}-${(y(n).getMonth()+1).toString().padStart(0,"2")}-01`,reminderLabel:"on Giving Tuesday",reminderOption:`giving-tuesday-${n}`}:"US"===e&&(e=>e>=y(e.getFullYear())&&e<T)(t)?(e=>({reminderCta:"Remind me on New Years Eve",reminderPeriod:`${e}-12-01`,reminderLabel:"on New Years Eve",reminderOption:`new-years-eve-${e}`}))(t.getFullYear()):A(t);var n},exports.getWeeklyArticleHistory=e=>e.get(t)||void 0,exports.headerPropsSchema=ze,exports.hexColourToString=e=>`#${e.r}${e.g}${e.b}`,exports.inTargetedCountry=(e,t=[],n=[])=>0===t.length&&0===n.length||!!e&&(!!t.includes(z(e.toUpperCase()))||n.includes(e.toUpperCase())),exports.incrementWeeklyArticleCount=(e,o,i)=>{const s=((e,t)=>{const o=a(new Date),r=e.get(n);if(r&&r.week===o){const a=r.articles[t]||0;return e.set(n,{week:o,articles:{...r.articles,[t]:a+1}}),a>0}return e.set(n,{week:o,articles:{[t]:1}}),!1})(e,o);if(!s){const n=a(new Date),o=e.get(t)||[],s=o[0];if(s?.week&&s.week===n)s.count+=1,s.tags=r(i,s.tags),e.set(t,o);else{o.unshift({week:n,count:1,tags:r(i,{})});const a=n-365,s=o.filter((e=>e.week>=a));e.set(t,s)}}},exports.isGWCheckoutUrl=m,exports.isoCurrencyToCurrencySymbol={GBP:"£",USD:"$",AUD:"$",EUR:"€",NZD:"NZ$",CAD:"CA$"},exports.logEpicView=e=>{const t=localStorage.getItem(S),n=t?JSON.parse(t).value:[];n.push({date:(new Date).getTime(),testId:e});const a={value:n.slice(-50)};localStorage.setItem(S,JSON.stringify(a))},exports.replaceNonArticleCountPlaceholders=(e,t,n)=>e?e.replace(h,(e=>{const a=e.substring(2,e.length-2),o=b[a];if(o){const e=o({countryCode:t,prices:n});if(e)return e}return e})):"",exports.targetedRegionsSchema=l;
|
|
@@ -1021,7 +1021,7 @@ export interface BannerTest extends BannerTestFromTool {
|
|
|
1021
1021
|
}
|
|
1022
1022
|
export declare const bannerTestFromToolSchema: z.ZodObject<{
|
|
1023
1023
|
name: z.ZodString;
|
|
1024
|
-
channel: z.ZodEnum<["Epic", "
|
|
1024
|
+
channel: z.ZodEnum<["Epic", "EpicAppleNews", "EpicLiveblog", "Banner1", "Banner2", "Header", "GutterLiveblog"]>;
|
|
1025
1025
|
priority: z.ZodNumber;
|
|
1026
1026
|
status: z.ZodEnum<["Live", "Draft", "Archived"]>;
|
|
1027
1027
|
controlProportionSettings: z.ZodOptional<z.ZodObject<{
|
|
@@ -2101,7 +2101,7 @@ export declare const bannerTestFromToolSchema: z.ZodObject<{
|
|
|
2101
2101
|
}>>;
|
|
2102
2102
|
}, "strip", z.ZodTypeAny, {
|
|
2103
2103
|
name: string;
|
|
2104
|
-
channel: "Epic" | "
|
|
2104
|
+
channel: "Epic" | "EpicAppleNews" | "EpicLiveblog" | "Banner1" | "Banner2" | "Header" | "GutterLiveblog";
|
|
2105
2105
|
priority: number;
|
|
2106
2106
|
status: "Live" | "Draft" | "Archived";
|
|
2107
2107
|
userCohort: "AllExistingSupporters" | "AllNonSupporters" | "Everyone" | "PostAskPauseSingleContributors";
|
|
@@ -2281,7 +2281,7 @@ export declare const bannerTestFromToolSchema: z.ZodObject<{
|
|
|
2281
2281
|
} | undefined;
|
|
2282
2282
|
}, {
|
|
2283
2283
|
name: string;
|
|
2284
|
-
channel: "Epic" | "
|
|
2284
|
+
channel: "Epic" | "EpicAppleNews" | "EpicLiveblog" | "Banner1" | "Banner2" | "Header" | "GutterLiveblog";
|
|
2285
2285
|
priority: number;
|
|
2286
2286
|
status: "Live" | "Draft" | "Archived";
|
|
2287
2287
|
userCohort: "AllExistingSupporters" | "AllNonSupporters" | "Everyone" | "PostAskPauseSingleContributors";
|
|
@@ -66,7 +66,7 @@ export interface EpicTest extends EpicTestFromTool {
|
|
|
66
66
|
expiry?: string;
|
|
67
67
|
}
|
|
68
68
|
export declare const epicTestFromToolSchema: z.ZodObject<{
|
|
69
|
-
channel: z.ZodEnum<["Epic", "
|
|
69
|
+
channel: z.ZodEnum<["Epic", "EpicAppleNews", "EpicLiveblog", "Banner1", "Banner2", "Header", "GutterLiveblog"]>;
|
|
70
70
|
controlProportionSettings: z.ZodOptional<z.ZodObject<{
|
|
71
71
|
proportion: z.ZodNumber;
|
|
72
72
|
offset: z.ZodNumber;
|
|
@@ -1313,7 +1313,7 @@ export declare const epicTestFromToolSchema: z.ZodObject<{
|
|
|
1313
1313
|
}>, "many">;
|
|
1314
1314
|
}, "strip", z.ZodTypeAny, {
|
|
1315
1315
|
name: string;
|
|
1316
|
-
channel: "Epic" | "
|
|
1316
|
+
channel: "Epic" | "EpicAppleNews" | "EpicLiveblog" | "Banner1" | "Banner2" | "Header" | "GutterLiveblog";
|
|
1317
1317
|
priority: number;
|
|
1318
1318
|
status: "Live" | "Draft" | "Archived";
|
|
1319
1319
|
tagIds: string[];
|
|
@@ -1529,7 +1529,7 @@ export declare const epicTestFromToolSchema: z.ZodObject<{
|
|
|
1529
1529
|
} | undefined;
|
|
1530
1530
|
}, {
|
|
1531
1531
|
name: string;
|
|
1532
|
-
channel: "Epic" | "
|
|
1532
|
+
channel: "Epic" | "EpicAppleNews" | "EpicLiveblog" | "Banner1" | "Banner2" | "Header" | "GutterLiveblog";
|
|
1533
1533
|
priority: number;
|
|
1534
1534
|
status: "Live" | "Draft" | "Archived";
|
|
1535
1535
|
tagIds: string[];
|
|
@@ -115,7 +115,7 @@ declare const gutterVariantFromToolSchema: z.ZodObject<{
|
|
|
115
115
|
export type GutterVariantFromTool = z.infer<typeof gutterVariantFromToolSchema>;
|
|
116
116
|
export declare const gutterTestFromToolSchema: z.ZodObject<{
|
|
117
117
|
name: z.ZodString;
|
|
118
|
-
channel: z.ZodEnum<["Epic", "
|
|
118
|
+
channel: z.ZodEnum<["Epic", "EpicAppleNews", "EpicLiveblog", "Banner1", "Banner2", "Header", "GutterLiveblog"]>;
|
|
119
119
|
priority: z.ZodNumber;
|
|
120
120
|
status: z.ZodEnum<["Live", "Draft", "Archived"]>;
|
|
121
121
|
controlProportionSettings: z.ZodOptional<z.ZodObject<{
|
|
@@ -305,7 +305,7 @@ export declare const gutterTestFromToolSchema: z.ZodObject<{
|
|
|
305
305
|
}>, "many">;
|
|
306
306
|
}, "strip", z.ZodTypeAny, {
|
|
307
307
|
name: string;
|
|
308
|
-
channel: "Epic" | "
|
|
308
|
+
channel: "Epic" | "EpicAppleNews" | "EpicLiveblog" | "Banner1" | "Banner2" | "Header" | "GutterLiveblog";
|
|
309
309
|
priority: number;
|
|
310
310
|
status: "Live" | "Draft" | "Archived";
|
|
311
311
|
userCohort: "AllExistingSupporters" | "AllNonSupporters" | "Everyone" | "PostAskPauseSingleContributors";
|
|
@@ -361,7 +361,7 @@ export declare const gutterTestFromToolSchema: z.ZodObject<{
|
|
|
361
361
|
} | undefined;
|
|
362
362
|
}, {
|
|
363
363
|
name: string;
|
|
364
|
-
channel: "Epic" | "
|
|
364
|
+
channel: "Epic" | "EpicAppleNews" | "EpicLiveblog" | "Banner1" | "Banner2" | "Header" | "GutterLiveblog";
|
|
365
365
|
priority: number;
|
|
366
366
|
status: "Live" | "Draft" | "Archived";
|
|
367
367
|
userCohort: "AllExistingSupporters" | "AllNonSupporters" | "Everyone" | "PostAskPauseSingleContributors";
|
|
@@ -165,7 +165,7 @@ declare const headerVariantFromToolSchema: z.ZodObject<{
|
|
|
165
165
|
export type HeaderVariantFromTool = z.infer<typeof headerVariantFromToolSchema>;
|
|
166
166
|
export declare const headerTestFromToolSchema: z.ZodObject<{
|
|
167
167
|
name: z.ZodString;
|
|
168
|
-
channel: z.ZodEnum<["Epic", "
|
|
168
|
+
channel: z.ZodEnum<["Epic", "EpicAppleNews", "EpicLiveblog", "Banner1", "Banner2", "Header", "GutterLiveblog"]>;
|
|
169
169
|
priority: z.ZodNumber;
|
|
170
170
|
status: z.ZodEnum<["Live", "Draft", "Archived"]>;
|
|
171
171
|
controlProportionSettings: z.ZodOptional<z.ZodObject<{
|
|
@@ -399,7 +399,7 @@ export declare const headerTestFromToolSchema: z.ZodObject<{
|
|
|
399
399
|
}>, "many">;
|
|
400
400
|
}, "strip", z.ZodTypeAny, {
|
|
401
401
|
name: string;
|
|
402
|
-
channel: "Epic" | "
|
|
402
|
+
channel: "Epic" | "EpicAppleNews" | "EpicLiveblog" | "Banner1" | "Banner2" | "Header" | "GutterLiveblog";
|
|
403
403
|
priority: number;
|
|
404
404
|
status: "Live" | "Draft" | "Archived";
|
|
405
405
|
userCohort: "AllExistingSupporters" | "AllNonSupporters" | "Everyone" | "PostAskPauseSingleContributors";
|
|
@@ -463,7 +463,7 @@ export declare const headerTestFromToolSchema: z.ZodObject<{
|
|
|
463
463
|
} | undefined;
|
|
464
464
|
}, {
|
|
465
465
|
name: string;
|
|
466
|
-
channel: "Epic" | "
|
|
466
|
+
channel: "Epic" | "EpicAppleNews" | "EpicLiveblog" | "Banner1" | "Banner2" | "Header" | "GutterLiveblog";
|
|
467
467
|
priority: number;
|
|
468
468
|
status: "Live" | "Draft" | "Archived";
|
|
469
469
|
userCohort: "AllExistingSupporters" | "AllNonSupporters" | "Everyone" | "PostAskPauseSingleContributors";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { OphanComponentType, OphanProduct } from '@guardian/libs';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import type { purchaseInfoProduct, purchaseInfoUser } from '../purchaseInfo';
|
|
4
|
-
declare const Channel: readonly ["Epic", "
|
|
4
|
+
declare const Channel: readonly ["Epic", "EpicAppleNews", "EpicLiveblog", "Banner1", "Banner2", "Header", "GutterLiveblog"];
|
|
5
5
|
export type Channel = (typeof Channel)[number];
|
|
6
6
|
declare const TestStatus: readonly ["Live", "Draft", "Archived"];
|
|
7
7
|
export type TestStatus = (typeof TestStatus)[number];
|
|
@@ -70,7 +70,7 @@ export interface Test<V extends Variant> {
|
|
|
70
70
|
methodologies?: Methodology[];
|
|
71
71
|
}
|
|
72
72
|
export declare const testSchema: z.ZodObject<{
|
|
73
|
-
channel: z.ZodEnum<["Epic", "
|
|
73
|
+
channel: z.ZodEnum<["Epic", "EpicAppleNews", "EpicLiveblog", "Banner1", "Banner2", "Header", "GutterLiveblog"]>;
|
|
74
74
|
name: z.ZodString;
|
|
75
75
|
status: z.ZodEnum<["Live", "Draft", "Archived"]>;
|
|
76
76
|
priority: z.ZodNumber;
|
|
@@ -123,7 +123,7 @@ export declare const testSchema: z.ZodObject<{
|
|
|
123
123
|
}>>, "many">>;
|
|
124
124
|
}, "strip", z.ZodTypeAny, {
|
|
125
125
|
name: string;
|
|
126
|
-
channel: "Epic" | "
|
|
126
|
+
channel: "Epic" | "EpicAppleNews" | "EpicLiveblog" | "Banner1" | "Banner2" | "Header" | "GutterLiveblog";
|
|
127
127
|
priority: number;
|
|
128
128
|
status: "Live" | "Draft" | "Archived";
|
|
129
129
|
controlProportionSettings?: {
|
|
@@ -147,7 +147,7 @@ export declare const testSchema: z.ZodObject<{
|
|
|
147
147
|
})[] | undefined;
|
|
148
148
|
}, {
|
|
149
149
|
name: string;
|
|
150
|
-
channel: "Epic" | "
|
|
150
|
+
channel: "Epic" | "EpicAppleNews" | "EpicLiveblog" | "Banner1" | "Banner2" | "Header" | "GutterLiveblog";
|
|
151
151
|
priority: number;
|
|
152
152
|
status: "Live" | "Draft" | "Archived";
|
|
153
153
|
controlProportionSettings?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/abTests/shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAG7E,QAAA,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/abTests/shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAG7E,QAAA,MAAM,OAAO,sGAQH,CAAC;AACX,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;AAG/C,QAAA,MAAM,UAAU,wCAAyC,CAAC;AAC1D,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AAErD,eAAO,MAAM,gBAAgB,0CAAqB,CAAC;AAEnD,QAAA,MAAM,UAAU,yDAA0D,CAAC;AAC3E,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AACrD,MAAM,MAAM,cAAc,GAAG,OAAO,C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,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shared/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shared/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -508,6 +508,54 @@ export declare const bannerSchema: z.ZodObject<{
|
|
|
508
508
|
g: string;
|
|
509
509
|
kind: "hex";
|
|
510
510
|
}>>>;
|
|
511
|
+
buttonSelectMarkerColour: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
512
|
+
r: z.ZodEffects<z.ZodString, string, string>;
|
|
513
|
+
g: z.ZodEffects<z.ZodString, string, string>;
|
|
514
|
+
b: z.ZodEffects<z.ZodString, string, string>;
|
|
515
|
+
kind: z.ZodLiteral<"hex">;
|
|
516
|
+
}, "strip", z.ZodTypeAny, {
|
|
517
|
+
r: string;
|
|
518
|
+
b: string;
|
|
519
|
+
g: string;
|
|
520
|
+
kind: "hex";
|
|
521
|
+
}, {
|
|
522
|
+
r: string;
|
|
523
|
+
b: string;
|
|
524
|
+
g: string;
|
|
525
|
+
kind: "hex";
|
|
526
|
+
}>>>;
|
|
527
|
+
pillTextColour: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
528
|
+
r: z.ZodEffects<z.ZodString, string, string>;
|
|
529
|
+
g: z.ZodEffects<z.ZodString, string, string>;
|
|
530
|
+
b: z.ZodEffects<z.ZodString, string, string>;
|
|
531
|
+
kind: z.ZodLiteral<"hex">;
|
|
532
|
+
}, "strip", z.ZodTypeAny, {
|
|
533
|
+
r: string;
|
|
534
|
+
b: string;
|
|
535
|
+
g: string;
|
|
536
|
+
kind: "hex";
|
|
537
|
+
}, {
|
|
538
|
+
r: string;
|
|
539
|
+
b: string;
|
|
540
|
+
g: string;
|
|
541
|
+
kind: "hex";
|
|
542
|
+
}>>>;
|
|
543
|
+
pillBackgroundColour: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
544
|
+
r: z.ZodEffects<z.ZodString, string, string>;
|
|
545
|
+
g: z.ZodEffects<z.ZodString, string, string>;
|
|
546
|
+
b: z.ZodEffects<z.ZodString, string, string>;
|
|
547
|
+
kind: z.ZodLiteral<"hex">;
|
|
548
|
+
}, "strip", z.ZodTypeAny, {
|
|
549
|
+
r: string;
|
|
550
|
+
b: string;
|
|
551
|
+
g: string;
|
|
552
|
+
kind: "hex";
|
|
553
|
+
}, {
|
|
554
|
+
r: string;
|
|
555
|
+
b: string;
|
|
556
|
+
g: string;
|
|
557
|
+
kind: "hex";
|
|
558
|
+
}>>>;
|
|
511
559
|
kind: z.ZodLiteral<"ChoiceCards">;
|
|
512
560
|
}, "strip", z.ZodTypeAny, {
|
|
513
561
|
kind: "ChoiceCards";
|
|
@@ -547,6 +595,24 @@ export declare const bannerSchema: z.ZodObject<{
|
|
|
547
595
|
g: string;
|
|
548
596
|
kind: "hex";
|
|
549
597
|
} | null | undefined;
|
|
598
|
+
buttonSelectMarkerColour?: {
|
|
599
|
+
r: string;
|
|
600
|
+
b: string;
|
|
601
|
+
g: string;
|
|
602
|
+
kind: "hex";
|
|
603
|
+
} | null | undefined;
|
|
604
|
+
pillTextColour?: {
|
|
605
|
+
r: string;
|
|
606
|
+
b: string;
|
|
607
|
+
g: string;
|
|
608
|
+
kind: "hex";
|
|
609
|
+
} | null | undefined;
|
|
610
|
+
pillBackgroundColour?: {
|
|
611
|
+
r: string;
|
|
612
|
+
b: string;
|
|
613
|
+
g: string;
|
|
614
|
+
kind: "hex";
|
|
615
|
+
} | null | undefined;
|
|
550
616
|
}, {
|
|
551
617
|
kind: "ChoiceCards";
|
|
552
618
|
buttonColour?: {
|
|
@@ -585,6 +651,24 @@ export declare const bannerSchema: z.ZodObject<{
|
|
|
585
651
|
g: string;
|
|
586
652
|
kind: "hex";
|
|
587
653
|
} | null | undefined;
|
|
654
|
+
buttonSelectMarkerColour?: {
|
|
655
|
+
r: string;
|
|
656
|
+
b: string;
|
|
657
|
+
g: string;
|
|
658
|
+
kind: "hex";
|
|
659
|
+
} | null | undefined;
|
|
660
|
+
pillTextColour?: {
|
|
661
|
+
r: string;
|
|
662
|
+
b: string;
|
|
663
|
+
g: string;
|
|
664
|
+
kind: "hex";
|
|
665
|
+
} | null | undefined;
|
|
666
|
+
pillBackgroundColour?: {
|
|
667
|
+
r: string;
|
|
668
|
+
b: string;
|
|
669
|
+
g: string;
|
|
670
|
+
kind: "hex";
|
|
671
|
+
} | null | undefined;
|
|
588
672
|
}>]>>>;
|
|
589
673
|
colours: z.ZodObject<{
|
|
590
674
|
basic: z.ZodObject<{
|
|
@@ -739,6 +823,24 @@ export declare const bannerSchema: z.ZodObject<{
|
|
|
739
823
|
g: string;
|
|
740
824
|
kind: "hex";
|
|
741
825
|
} | null | undefined;
|
|
826
|
+
buttonSelectMarkerColour?: {
|
|
827
|
+
r: string;
|
|
828
|
+
b: string;
|
|
829
|
+
g: string;
|
|
830
|
+
kind: "hex";
|
|
831
|
+
} | null | undefined;
|
|
832
|
+
pillTextColour?: {
|
|
833
|
+
r: string;
|
|
834
|
+
b: string;
|
|
835
|
+
g: string;
|
|
836
|
+
kind: "hex";
|
|
837
|
+
} | null | undefined;
|
|
838
|
+
pillBackgroundColour?: {
|
|
839
|
+
r: string;
|
|
840
|
+
b: string;
|
|
841
|
+
g: string;
|
|
842
|
+
kind: "hex";
|
|
843
|
+
} | null | undefined;
|
|
742
844
|
} | null | undefined;
|
|
743
845
|
}, {
|
|
744
846
|
colours: {
|
|
@@ -801,6 +903,24 @@ export declare const bannerSchema: z.ZodObject<{
|
|
|
801
903
|
g: string;
|
|
802
904
|
kind: "hex";
|
|
803
905
|
} | null | undefined;
|
|
906
|
+
buttonSelectMarkerColour?: {
|
|
907
|
+
r: string;
|
|
908
|
+
b: string;
|
|
909
|
+
g: string;
|
|
910
|
+
kind: "hex";
|
|
911
|
+
} | null | undefined;
|
|
912
|
+
pillTextColour?: {
|
|
913
|
+
r: string;
|
|
914
|
+
b: string;
|
|
915
|
+
g: string;
|
|
916
|
+
kind: "hex";
|
|
917
|
+
} | null | undefined;
|
|
918
|
+
pillBackgroundColour?: {
|
|
919
|
+
r: string;
|
|
920
|
+
b: string;
|
|
921
|
+
g: string;
|
|
922
|
+
kind: "hex";
|
|
923
|
+
} | null | undefined;
|
|
804
924
|
} | null | undefined;
|
|
805
925
|
}>>>;
|
|
806
926
|
choiceCardsSettings: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
@@ -1406,6 +1526,24 @@ export declare const bannerSchema: z.ZodObject<{
|
|
|
1406
1526
|
g: string;
|
|
1407
1527
|
kind: "hex";
|
|
1408
1528
|
} | null | undefined;
|
|
1529
|
+
buttonSelectMarkerColour?: {
|
|
1530
|
+
r: string;
|
|
1531
|
+
b: string;
|
|
1532
|
+
g: string;
|
|
1533
|
+
kind: "hex";
|
|
1534
|
+
} | null | undefined;
|
|
1535
|
+
pillTextColour?: {
|
|
1536
|
+
r: string;
|
|
1537
|
+
b: string;
|
|
1538
|
+
g: string;
|
|
1539
|
+
kind: "hex";
|
|
1540
|
+
} | null | undefined;
|
|
1541
|
+
pillBackgroundColour?: {
|
|
1542
|
+
r: string;
|
|
1543
|
+
b: string;
|
|
1544
|
+
g: string;
|
|
1545
|
+
kind: "hex";
|
|
1546
|
+
} | null | undefined;
|
|
1409
1547
|
} | null | undefined;
|
|
1410
1548
|
} | null | undefined;
|
|
1411
1549
|
choiceCardsSettings?: {
|
|
@@ -1613,6 +1751,24 @@ export declare const bannerSchema: z.ZodObject<{
|
|
|
1613
1751
|
g: string;
|
|
1614
1752
|
kind: "hex";
|
|
1615
1753
|
} | null | undefined;
|
|
1754
|
+
buttonSelectMarkerColour?: {
|
|
1755
|
+
r: string;
|
|
1756
|
+
b: string;
|
|
1757
|
+
g: string;
|
|
1758
|
+
kind: "hex";
|
|
1759
|
+
} | null | undefined;
|
|
1760
|
+
pillTextColour?: {
|
|
1761
|
+
r: string;
|
|
1762
|
+
b: string;
|
|
1763
|
+
g: string;
|
|
1764
|
+
kind: "hex";
|
|
1765
|
+
} | null | undefined;
|
|
1766
|
+
pillBackgroundColour?: {
|
|
1767
|
+
r: string;
|
|
1768
|
+
b: string;
|
|
1769
|
+
g: string;
|
|
1770
|
+
kind: "hex";
|
|
1771
|
+
} | null | undefined;
|
|
1616
1772
|
} | null | undefined;
|
|
1617
1773
|
} | null | undefined;
|
|
1618
1774
|
choiceCardsSettings?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banner.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/props/banner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAClE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAEnD,OAAO,KAAK,EACR,aAAa,EACb,GAAG,EACH,YAAY,EACZ,oBAAoB,EACpB,cAAc,EACd,QAAQ,EACX,MAAM,UAAU,CAAC;AASlB,eAAO,MAAM,mBAAmB,4EAK9B,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,eAAO,MAAM,wBAAwB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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgBvB,CAAC"}
|
|
@@ -131,6 +131,54 @@ export declare const configurableDesignSchema: z.ZodObject<{
|
|
|
131
131
|
g: string;
|
|
132
132
|
kind: "hex";
|
|
133
133
|
}>>>;
|
|
134
|
+
buttonSelectMarkerColour: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
135
|
+
r: z.ZodEffects<z.ZodString, string, string>;
|
|
136
|
+
g: z.ZodEffects<z.ZodString, string, string>;
|
|
137
|
+
b: z.ZodEffects<z.ZodString, string, string>;
|
|
138
|
+
kind: z.ZodLiteral<"hex">;
|
|
139
|
+
}, "strip", z.ZodTypeAny, {
|
|
140
|
+
r: string;
|
|
141
|
+
b: string;
|
|
142
|
+
g: string;
|
|
143
|
+
kind: "hex";
|
|
144
|
+
}, {
|
|
145
|
+
r: string;
|
|
146
|
+
b: string;
|
|
147
|
+
g: string;
|
|
148
|
+
kind: "hex";
|
|
149
|
+
}>>>;
|
|
150
|
+
pillTextColour: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
151
|
+
r: z.ZodEffects<z.ZodString, string, string>;
|
|
152
|
+
g: z.ZodEffects<z.ZodString, string, string>;
|
|
153
|
+
b: z.ZodEffects<z.ZodString, string, string>;
|
|
154
|
+
kind: z.ZodLiteral<"hex">;
|
|
155
|
+
}, "strip", z.ZodTypeAny, {
|
|
156
|
+
r: string;
|
|
157
|
+
b: string;
|
|
158
|
+
g: string;
|
|
159
|
+
kind: "hex";
|
|
160
|
+
}, {
|
|
161
|
+
r: string;
|
|
162
|
+
b: string;
|
|
163
|
+
g: string;
|
|
164
|
+
kind: "hex";
|
|
165
|
+
}>>>;
|
|
166
|
+
pillBackgroundColour: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
167
|
+
r: z.ZodEffects<z.ZodString, string, string>;
|
|
168
|
+
g: z.ZodEffects<z.ZodString, string, string>;
|
|
169
|
+
b: z.ZodEffects<z.ZodString, string, string>;
|
|
170
|
+
kind: z.ZodLiteral<"hex">;
|
|
171
|
+
}, "strip", z.ZodTypeAny, {
|
|
172
|
+
r: string;
|
|
173
|
+
b: string;
|
|
174
|
+
g: string;
|
|
175
|
+
kind: "hex";
|
|
176
|
+
}, {
|
|
177
|
+
r: string;
|
|
178
|
+
b: string;
|
|
179
|
+
g: string;
|
|
180
|
+
kind: "hex";
|
|
181
|
+
}>>>;
|
|
134
182
|
kind: z.ZodLiteral<"ChoiceCards">;
|
|
135
183
|
}, "strip", z.ZodTypeAny, {
|
|
136
184
|
kind: "ChoiceCards";
|
|
@@ -170,6 +218,24 @@ export declare const configurableDesignSchema: z.ZodObject<{
|
|
|
170
218
|
g: string;
|
|
171
219
|
kind: "hex";
|
|
172
220
|
} | null | undefined;
|
|
221
|
+
buttonSelectMarkerColour?: {
|
|
222
|
+
r: string;
|
|
223
|
+
b: string;
|
|
224
|
+
g: string;
|
|
225
|
+
kind: "hex";
|
|
226
|
+
} | null | undefined;
|
|
227
|
+
pillTextColour?: {
|
|
228
|
+
r: string;
|
|
229
|
+
b: string;
|
|
230
|
+
g: string;
|
|
231
|
+
kind: "hex";
|
|
232
|
+
} | null | undefined;
|
|
233
|
+
pillBackgroundColour?: {
|
|
234
|
+
r: string;
|
|
235
|
+
b: string;
|
|
236
|
+
g: string;
|
|
237
|
+
kind: "hex";
|
|
238
|
+
} | null | undefined;
|
|
173
239
|
}, {
|
|
174
240
|
kind: "ChoiceCards";
|
|
175
241
|
buttonColour?: {
|
|
@@ -208,6 +274,24 @@ export declare const configurableDesignSchema: z.ZodObject<{
|
|
|
208
274
|
g: string;
|
|
209
275
|
kind: "hex";
|
|
210
276
|
} | null | undefined;
|
|
277
|
+
buttonSelectMarkerColour?: {
|
|
278
|
+
r: string;
|
|
279
|
+
b: string;
|
|
280
|
+
g: string;
|
|
281
|
+
kind: "hex";
|
|
282
|
+
} | null | undefined;
|
|
283
|
+
pillTextColour?: {
|
|
284
|
+
r: string;
|
|
285
|
+
b: string;
|
|
286
|
+
g: string;
|
|
287
|
+
kind: "hex";
|
|
288
|
+
} | null | undefined;
|
|
289
|
+
pillBackgroundColour?: {
|
|
290
|
+
r: string;
|
|
291
|
+
b: string;
|
|
292
|
+
g: string;
|
|
293
|
+
kind: "hex";
|
|
294
|
+
} | null | undefined;
|
|
211
295
|
}>]>>>;
|
|
212
296
|
colours: z.ZodObject<{
|
|
213
297
|
basic: z.ZodObject<{
|
|
@@ -362,6 +446,24 @@ export declare const configurableDesignSchema: z.ZodObject<{
|
|
|
362
446
|
g: string;
|
|
363
447
|
kind: "hex";
|
|
364
448
|
} | null | undefined;
|
|
449
|
+
buttonSelectMarkerColour?: {
|
|
450
|
+
r: string;
|
|
451
|
+
b: string;
|
|
452
|
+
g: string;
|
|
453
|
+
kind: "hex";
|
|
454
|
+
} | null | undefined;
|
|
455
|
+
pillTextColour?: {
|
|
456
|
+
r: string;
|
|
457
|
+
b: string;
|
|
458
|
+
g: string;
|
|
459
|
+
kind: "hex";
|
|
460
|
+
} | null | undefined;
|
|
461
|
+
pillBackgroundColour?: {
|
|
462
|
+
r: string;
|
|
463
|
+
b: string;
|
|
464
|
+
g: string;
|
|
465
|
+
kind: "hex";
|
|
466
|
+
} | null | undefined;
|
|
365
467
|
} | null | undefined;
|
|
366
468
|
}, {
|
|
367
469
|
colours: {
|
|
@@ -424,6 +526,24 @@ export declare const configurableDesignSchema: z.ZodObject<{
|
|
|
424
526
|
g: string;
|
|
425
527
|
kind: "hex";
|
|
426
528
|
} | null | undefined;
|
|
529
|
+
buttonSelectMarkerColour?: {
|
|
530
|
+
r: string;
|
|
531
|
+
b: string;
|
|
532
|
+
g: string;
|
|
533
|
+
kind: "hex";
|
|
534
|
+
} | null | undefined;
|
|
535
|
+
pillTextColour?: {
|
|
536
|
+
r: string;
|
|
537
|
+
b: string;
|
|
538
|
+
g: string;
|
|
539
|
+
kind: "hex";
|
|
540
|
+
} | null | undefined;
|
|
541
|
+
pillBackgroundColour?: {
|
|
542
|
+
r: string;
|
|
543
|
+
b: string;
|
|
544
|
+
g: string;
|
|
545
|
+
kind: "hex";
|
|
546
|
+
} | null | undefined;
|
|
427
547
|
} | null | undefined;
|
|
428
548
|
}>;
|
|
429
549
|
type HexChar = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | 'A' | 'B' | 'C' | 'D' | 'E' | 'F';
|
|
@@ -444,10 +564,8 @@ export interface CtaDesign {
|
|
|
444
564
|
default: CtaStateDesign;
|
|
445
565
|
}
|
|
446
566
|
interface TickerDesign {
|
|
447
|
-
text: HexColour;
|
|
448
567
|
filledProgress: HexColour;
|
|
449
568
|
progressBarBackground: HexColour;
|
|
450
|
-
goalMarker: HexColour;
|
|
451
569
|
headlineColour: HexColour;
|
|
452
570
|
totalColour: HexColour;
|
|
453
571
|
goalColour: HexColour;
|
|
@@ -469,6 +587,9 @@ interface ChoiceCardsDesign {
|
|
|
469
587
|
buttonSelectColour?: HexColour;
|
|
470
588
|
buttonSelectTextColour?: HexColour;
|
|
471
589
|
buttonSelectBorderColour?: HexColour;
|
|
590
|
+
buttonSelectMarkerColour?: HexColour;
|
|
591
|
+
pillTextColour?: HexColour;
|
|
592
|
+
pillBackgroundColour?: HexColour;
|
|
472
593
|
}
|
|
473
594
|
type Visual = BannerDesignImage | ChoiceCardsDesign;
|
|
474
595
|
type FontSize = 'small' | 'medium' | 'large';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"design.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/props/design.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAaxB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;EAK1B,CAAC;
|
|
1
|
+
{"version":3,"file":"design.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/props/design.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAaxB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;EAK1B,CAAC;AAyBH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASnC,CAAC;AAEH,KAAK,OAAO,GACN,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAA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IACnC,wBAAwB,CAAC,EAAE,SAAS,CAAC;IACrC,wBAAwB,CAAC,EAAE,SAAS,CAAC;IACrC,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,oBAAoB,CAAC,EAAE,SAAS,CAAC;CACpC;AACD,KAAK,MAAM,GAAG,iBAAiB,GAAG,iBAAiB,CAAC;AAEpD,KAAK,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE7C,UAAU,IAAI;IACV,IAAI,EAAE,QAAQ,CAAC;CAClB;AAED,MAAM,WAAW,kBAAkB;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,uBAAuB,CAAC;IACtC,KAAK,CAAC,EAAE;QACJ,OAAO,EAAE,IAAI,CAAC;KACjB,CAAC;IACF,OAAO,EAAE;QACL,KAAK,EAAE;YACH,UAAU,EAAE,SAAS,CAAC;YACtB,QAAQ,EAAE,SAAS,CAAC;YACpB,UAAU,EAAE,SAAS,CAAC;YACtB,gBAAgB,EAAE,SAAS,CAAC;YAC5B,IAAI,EAAE,SAAS,CAAC;SACnB,CAAC;QACF,eAAe,EAAE;YACb,IAAI,EAAE,SAAS,CAAC;YAChB,SAAS,EAAE,SAAS,CAAC;SACxB,CAAC;QACF,UAAU,EAAE,SAAS,CAAC;QACtB,YAAY,EAAE,SAAS,CAAC;QACxB,WAAW,EAAE,SAAS,CAAC;QACvB,MAAM,EAAE,YAAY,CAAC;KACxB,CAAC;CACL"}
|
package/package.json
CHANGED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export type ReminderPlatform = 'WEB' | 'AMP';
|
|
2
|
-
export type ReminderComponent = 'EPIC' | 'BANNER';
|
|
3
|
-
export type ReminderStage = 'PRE' | 'POST';
|
|
4
|
-
interface BaseSignupRequest {
|
|
5
|
-
email: string;
|
|
6
|
-
reminderPlatform: ReminderPlatform;
|
|
7
|
-
reminderComponent: ReminderComponent;
|
|
8
|
-
reminderStage: ReminderStage;
|
|
9
|
-
country?: string;
|
|
10
|
-
reminderOption?: string;
|
|
11
|
-
}
|
|
12
|
-
export interface OneOffSignupRequest extends BaseSignupRequest {
|
|
13
|
-
reminderPeriod: string;
|
|
14
|
-
}
|
|
15
|
-
export {};
|
|
16
|
-
//# sourceMappingURL=reminders.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reminders.d.ts","sourceRoot":"","sources":["../../../src/shared/types/reminders.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,KAAK,CAAC;AAE7C,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,QAAQ,CAAC;AAElD,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,MAAM,CAAC;AAE3C,UAAU,iBAAiB;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,aAAa,EAAE,aAAa,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,mBAAoB,SAAQ,iBAAiB;IAC1D,cAAc,EAAE,MAAM,CAAC;CAC1B"}
|