@guardian/support-dotcom-components 5.0.0 → 6.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dotcom/types.d.ts +1 -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/lib/geolocation.d.ts +11 -1
- package/dist/shared/lib/geolocation.d.ts.map +1 -1
- package/dist/shared/types/abTests/banner.d.ts +23 -5
- package/dist/shared/types/abTests/banner.d.ts.map +1 -1
- package/dist/shared/types/abTests/epic.d.ts +21 -3
- package/dist/shared/types/abTests/epic.d.ts.map +1 -1
- package/dist/shared/types/abTests/gutter.d.ts +21 -3
- package/dist/shared/types/abTests/gutter.d.ts.map +1 -1
- package/dist/shared/types/abTests/header.d.ts +21 -3
- package/dist/shared/types/abTests/header.d.ts.map +1 -1
- package/dist/shared/types/props/banner.d.ts +0 -5
- package/dist/shared/types/props/banner.d.ts.map +1 -1
- package/dist/shared/types/props/epic.d.ts +0 -5
- package/dist/shared/types/props/epic.d.ts.map +1 -1
- package/dist/shared/types/props/gutter.d.ts +0 -5
- package/dist/shared/types/props/gutter.d.ts.map +1 -1
- package/dist/shared/types/props/header.d.ts +0 -5
- package/dist/shared/types/props/header.d.ts.map +1 -1
- package/dist/shared/types/props/shared.d.ts +5 -4
- package/dist/shared/types/props/shared.d.ts.map +1 -1
- package/dist/shared/types/targeting/banner.d.ts +1 -2
- package/dist/shared/types/targeting/banner.d.ts.map +1 -1
- package/dist/shared/types/targeting/epic.d.ts +1 -2
- package/dist/shared/types/targeting/epic.d.ts.map +1 -1
- package/dist/shared/types/targeting/gutter.d.ts +0 -2
- package/dist/shared/types/targeting/gutter.d.ts.map +1 -1
- package/dist/shared/types/targeting/header.d.ts +1 -2
- package/dist/shared/types/targeting/header.d.ts.map +1 -1
- package/dist/shared/types/targeting/shared.d.ts +0 -6
- package/dist/shared/types/targeting/shared.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/dotcom/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { BannerPayload, EpicPayload, HeaderPayload, WeeklyArticleHistory, } from '../shared/types/targeting';
|
|
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
4
|
export * from '../shared/types/reminders';
|
|
@@ -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,
|
|
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,cAAc,2BAA2B,CAAC;AAC1C,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.contributions.views",t=e=>e.get(n)||void 0,a=e=>{const t=localStorage.getItem(n),a=t?JSON.parse(t).value:[];a.push({date:(new Date).getTime(),testId:e});const i={value:a.slice(-50)};localStorage.setItem(n,JSON.stringify(i))},i="gu.history.weeklyArticleCount",o="gu.history.articleCountsThisWeek",r=e=>{const n=e.getDay()||7;return Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()-(n-1))/864e5},s=e=>e.get(i)||void 0,l=new Set(["environment/climate-change","environment/climate-crisis","environment/environment","science/science","politics/politics","us-news/us-politics","australia-news/australian-politics","world/world","world/europe-news","world/russia","books/books","culture/culture","world/coronavirus-outbreak","world/race","inequality/inequality","technology/technology","business/business","tone/recipes","sport/sport","football/football","sport/olympic-games","sport/olympic-games-2024","tracking/commissioningdesk/uk-investigations"]),u=(e,n={})=>(e.forEach((e=>{l.has(e)&&(n[e]=(n[e]??0)+1)})),n),c=(e,n,t)=>{const a=((e,n)=>{const t=r(new Date),a=e.get(o);if(a&&a.week===t){const i=a.articles[n]||0;return e.set(o,{week:t,articles:{...a.articles,[n]:i+1}}),i>0}return e.set(o,{week:t,articles:{[n]:1}}),!1})(e,n);if(!a){const n=r(new Date),a=e.get(i)||[],o=a[0];if(o&&o.week&&o.week===n)o.count+=1,o.tags=u(t,o.tags),e.set(i,a);else{a.unshift({week:n,count:1,tags:u(t,{})});const o=n-365,r=a.filter((e=>e.week>=o));e.set(i,r)}}},d=["GBPCountries","UnitedStates","AUDCountries","EURCountries","International","NZDCountries","Canada"],g=e.enum(d),m={GBPCountries:{name:"United Kingdom",currency:"GBP",countries:["GB","FK","GI","GG","IM","JE","SH"],supportRegionId:"UK"},UnitedStates:{name:"United States",currency:"USD",countries:["US"],supportRegionId:"US"},AUDCountries:{name:"Australia",currency:"AUD",countries:["AU","KI","NR","NF","TV"],supportRegionId:"AU"},EURCountries:{name:"Europe",currency:"EUR",countries:["AD","AL","AT","BA","BE","BG","BL","CH","CY","CZ","DE","DK","EE","ES","FI","FO","FR","GF","GL","GP","GR","HR","HU","IE","IT","LI","LT","LU","LV","MC","ME","MF","IS","MQ","MT","NL","NO","PF","PL","PM","PT","RE","RO","RS","SE","SI","SJ","SK","SM","TF","TR","WF","YT","VA","AX","AZ","AM","GE","BY","MD","UA","MK"],supportRegionId:"EU"},International:{name:"International",currency:"USD",countries:["AE","AF","AG","AI","AO","AQ","AR","AS","AW","BB","BD","BF","BH","BI","BJ","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BZ","CC","CD","CF","CG","CI","CL","CM","CN","CO","CR","CU","CV","CW","CX","DJ","DM","DO","DZ","EC","EG","EH","ER","ET","FJ","FM","GA","GD","GH","GM","GN","GQ","GS","GT","GU","GW","GY","HK","HM","HN","HT","ID","IL","IN","IO","IQ","IR","JM","JO","JP","KE","KG","KH","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LK","LR","LS","LY","MA","MG","MH","ML","MM","MN","MO","MP","MR","MS","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NG","NI","NP","NU","OM","PA","PE","PG","PH","PK","PN","PR","PS","PW","PY","QA","RU","RW","SA","SB","SC","SD","SG","SL","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TG","TH","TJ","TK","TL","TM","TN","TO","TT","TW","TZ","UG","UM","UY","UZ","VC","VE","VG","VI","VN","VU","WS","YE","ZA","ZM","ZW"],supportRegionId:"INT"},NZDCountries:{name:"New Zealand",currency:"NZD",countries:["NZ","CK"],supportRegionId:"NZ"},Canada:{name:"Canada",currency:"CAD",countries:["CA"],supportRegionId:"CA"}},p={AD:"Andorra",AE:"the UAE",AF:"Afghanistan",AG:"Antigua and Barbuda",AI:"Anguilla",AL:"Albania",AM:"Armenia",AO:"Angola",AR:"Argentina",AS:"the US",AT:"Austria",AU:"Australia",AW:"Aruba",AX:"Åland Islands",AZ:"Azerbaijan",BA:"Bosnia and Herzegovina",BB:"Barbados",BD:"Bangladesh",BE:"Belgium",BF:"Burkina Faso",BG:"Bulgaria",BH:"Bahrain",BI:"Burundi",BJ:"Benin",BL:"Saint Barthélemy",BM:"Bermuda",BN:"Brunei Darussalam",BO:"Bolivia",BQ:"Bonaire, Sint Eustatius and Saba",BR:"Brazil",BS:"the Bahamas",BT:"Bhutan",BV:"Bouvet Island",BW:"Botswana",BY:"Belarus",BZ:"Belize",CA:"Canada",CD:"the Democratic Republic of the Congo",CF:"the Central Africa Republic",CG:"the Congo",CH:"Switzerland",CI:"Côte d'Ivoire",CK:"the Cook Islands",CL:"Chile",CM:"Cameroon",CN:"China",CO:"Colombia",CR:"Costa Rica",CU:"Cuba",CV:"Cabo Verde",CW:"Curaçao",CX:"Christmas Island",CY:"Cyprus",CZ:"the Czech Republic",DE:"Germany",DJ:"Djibouti",DK:"Denmark",DM:"Dominica",DO:"the Dominican Republic",DZ:"Algeria",EC:"Ecuador",EE:"Estonia",EG:"Egypt",EH:"the Western Sahara",ER:"Eritrea",ES:"Spain",ET:"Ethiopia",FI:"Finland",FJ:"Fiji",FK:"the UK",FO:"the UK",FR:"France",GA:"Gabon",GB:"the UK",GD:"Grenada",GE:"Georgia",GF:"French Guiana",GG:"Guernsey",GH:"Ghana",GI:"Gibraltar",GL:"Greenland",GM:"the Gambia",GN:"Guinea",GP:"Guadeloupe",GQ:"Equatorial Guinea",GR:"Greece",GT:"Guatemala",GU:"Guam",GW:"Guinea-Bissau",GY:"Guyana",HK:"Hong Kong",HN:"Honduras",HR:"Croatia",HT:"Haiti",HU:"Hungary",ID:"Indonesia",IE:"Ireland",IM:"the Isle of Man",IN:"India",IQ:"Iraq",IR:"Iran",IS:"Iceland",IT:"Italy",JE:"Jersey",JM:"Jamaica",JO:"Jordan",JP:"Japan",KE:"Kenya",KG:"Kyrgyzstan",KH:"Cambodia",KI:"Kiribati",KN:"Saint Kitts and Nevis",KP:"Korea",KR:"Korea",KW:"Kuwait",KY:"the Cayman Ialnds",KZ:"Kazakhstan",LB:"Lebanon",LC:"Saint Lucia",LI:"Liechtenstein",LK:"Sri Lanka",LR:"Liberia",LS:"Lesotho",LT:"Lithuania",LU:"Luxembourg",LV:"Latvia",LY:"Libya",MA:"Morocco",MC:"Monaco",MD:"Moldova",ME:"Montenegro",MG:"Madagascar",MK:"the Republic of North Macedonia",ML:"Mali",MM:"Myanmar",MN:"Mongolia",MO:"Macao",MQ:"Martinique",MR:"Mauritania",MS:"Montserrat",MT:"Malta",MU:"Mauritius",MV:"Maldives",MW:"Malawi",MX:"Mexico",MY:"Malaysia",MZ:"Mozambique",NA:"Namibia",NC:"New Caledonia",NE:"Niger",NF:"Norfolk Island",NG:"Nigeria",NI:"Nicaragua",NL:"the Netherlands",NO:"Norway",NP:"Nepal",NR:"Nauru",NU:"Niue",NZ:"New Zealand",OM:"Oman",PA:"Panama",PE:"Peru",PF:"French Polynesia",PG:"Papua New Guinea",PH:"the Philippines",PK:"Pakistan",PL:"Poland",PM:"Saint Pierre and Miquelon",PN:"Pitcairn",PR:"Puerto Rico",PT:"Portugal",PW:"Palau",PY:"Paraguay",QA:"Qatar",RE:"Réunion",RO:"Romania",RU:"Russia",RW:"Rwanda",SA:"Saudi Arabia",SB:"Solomon Islands",SC:"Seychelles",SD:"Sudan",SE:"Sweden",SG:"Singapore",SH:"Saint Helena",SI:"Slovenia",SJ:"Svalbard and Jan Mayen",SK:"Slovakia",SL:"Sierra Leone",SM:"San Marino",SN:"Senegal",SO:"Somalia",SR:"Suriname",SS:"South Sudan",ST:"Sao Tome and Principe",SV:"El Salvador",SY:"Syrian Arab Republic",SZ:"Eswatini",TD:"Chad",TG:"Togo",TH:"Thailand",TJ:"Tajikistan",TK:"Tokelau",TL:"Timor-Leste",TM:"Turkmenistan",TN:"Tunisia",TO:"Tonga",TR:"Turkey",TT:"Trinidad and Tobago",TV:"Tuvalu",TW:"Taiwan",TZ:"Tanzania ",UG:"Uganda",US:"the US",UY:"Uruguay",UZ:"Uzbekistan",VC:"Saint Vincent and the Grenadines",VE:"Venezuela",VG:"the Virgin Islands",VI:"the Virgin Islands",VN:"Vietnam",VU:"Vanuatu",WF:"Wallis and Futuna",WS:"Samoa",YE:"Yemen",YT:"Mayotte",ZA:"South Africa",ZM:"Zambia",ZW:"Zimbabwe"},b={GBPCountries:"£",UnitedStates:"$",AUDCountries:"$",Canada:"CA$",EURCountries:"€",NZDCountries:"NZ$",International:"$"},C=e=>Object.keys(m).find((n=>m[n].countries.includes(e??"")))||"International",S=(e,n=[])=>0===n.length||!!e&&n.includes(C(e.toUpperCase())),h=e=>{if(e){const n=C(e);return b[n]}return"£"},y=e=>{if(e)return p[e]},A=e=>/subscribe\/weekly\/checkout/.test(e),T=(e,n)=>{if(n){const t=(e=>m[C(e)]?.supportRegionId)(n);if(t&&!A(e))return e.replace(/(support\.theguardian\.com)\/(contribute-in-epic|contribute|subscribe|checkout)/,((e,n,a)=>`${n}/${t.toLowerCase()}/${a}`))}return e},I=(e,n,t,a)=>{if(a){const i=a[C(t)];if(i){return`${h(t)}${i[e][n].price}`}}},N={CURRENCY_SYMBOL:({countryCode:e})=>h(e),COUNTRY_NAME:({countryCode:e})=>y(e),PRICE_DIGISUB_MONTHLY:({countryCode:e,prices:n})=>I("Digisub","Monthly",e,n),PRICE_DIGISUB_ANNUAL:({countryCode:e,prices:n})=>I("Digisub","Annual",e,n),PRICE_GUARDIANWEEKLY_MONTHLY:({countryCode:e,prices:n})=>I("GuardianWeekly","Monthly",e,n),PRICE_GUARDIANWEEKLY_ANNUAL:({countryCode:e,prices:n})=>I("GuardianWeekly","Annual",e,n),DAY_OF_THE_WEEK:()=>((e=new Date)=>e.toLocaleString("en-GB",{weekday:"long"}))(),DATE:()=>((e=new Date)=>e.toLocaleString("en-GB",{day:"numeric",month:"long",year:"numeric"}))()},M=(e,n,t)=>e?e.replace(E,(e=>{const a=e.substring(2,e.length-2),i=N[a];if(i){const e=i({countryCode:n,prices:t});if(e)return e}return e})):"",E=/%%.*?%%/g,G=e=>{const n=e.match(E)?.filter((e=>"%%ARTICLE_COUNT%%"!==e));return!!n&&n.length>0},U=e=>{const n=(e=>{const n=new Date(e,10,1).getDay();return new Date(e,10,22+(11-n)%7)})(e);return n.setDate(n.getDate()+5),n},R=(e=new Date)=>{const n=(e=>{const n=e.getDate()<20?1:2;return e.setMonth(e.getMonth()+n),e})(e),t=(n.getMonth()+1).toString().padStart(2,"0"),a=n.toLocaleString("default",{month:"long"}),i=n.getFullYear();return{reminderCta:`Remind me in ${a}`,reminderPeriod:`${i}-${t}-01`,reminderLabel:`${a} ${i}`}},B=new Date("2023-12-31"),P=e=>e>=(e=>new Date(e.getFullYear(),9,20))(e)&&e<U(e.getFullYear()),L=(e,n=new Date)=>{return"US"===e&&P(n)?{reminderCta:"Remind me on Giving Tuesday",reminderPeriod:`${t=n.getFullYear()}-${(U(t).getMonth()+1).toString().padStart(0,"2")}-01`,reminderLabel:"on Giving Tuesday",reminderOption:`giving-tuesday-${t}`}:"US"===e&&(e=>e>=U(e.getFullYear())&&e<B)(n)?(e=>({reminderCta:"Remind me on New Years Eve",reminderPeriod:`${e}-12-01`,reminderLabel:"on New Years Eve",reminderOption:`new-years-eve-${e}`}))(n.getFullYear()):R(n);var t},D=e.object({text:e.string(),baseUrl:e.string()});let w=function(e){return e.Custom="CustomSecondaryCta",e.ContributionsReminder="ContributionsReminderSecondaryCta",e}({});e.nativeEnum(w);const O=e.object({type:e.literal(w.Custom),cta:D}),k=e.object({type:e.literal(w.ContributionsReminder)}),f=e.discriminatedUnion("type",[O,k]);let K=function(e){return e.unlimited="unlimited",e.hardstop="hardstop",e}({});const v=e.nativeEnum(K);let F=function(e){return e.money="money",e}({});const j=e.nativeEnum(F),H=e.object({countLabel:e.string(),goalReachedPrimary:e.string().optional(),goalReachedSecondary:e.string().optional()}),Y=e.object({total:e.number(),goal:e.number()}),V=e.enum(["US","AU"]),W=e.object({endType:v,countType:j,currencySymbol:e.string(),copy:H,name:V,tickerData:Y.optional()}),Z=e.object({for52Weeks:e.number(),forTargetedWeeks:e.number()}),$=e.enum(["for52Weeks","forTargetedWeeks"]),x=e.object({type:e.literal("above"),copy:e.string().optional(),countType:$.optional()}),_=e.enum(["CONTRIBUTION","MEMBERSHIP_SUPPORTER","DIGITAL_SUBSCRIPTION","PRINT_SUBSCRIPTION"]),J=e.enum(["ACQUISITIONS_EPIC","ACQUISITIONS_ENGAGEMENT_BANNER","ACQUISITIONS_SUBSCRIPTIONS_BANNER","ACQUISITIONS_HEADER","ACQUISITIONS_OTHER"]),Q=e.object({abTestName:e.string(),abTestVariant:e.string(),campaignCode:e.string(),componentType:J,products:e.array(_).nullish(),labels:e.array(e.string()).nullish(),ophanPageId:e.string(),platformId:e.string(),referrerUrl:e.string(),clientName:e.string()}),z=e.object({mainUrl:e.string(),mobileUrl:e.string().optional(),tabletUrl:e.string().optional(),desktopUrl:e.string().optional(),leftColUrl:e.string().optional(),wideUrl:e.string().optional(),altText:e.string()}),q=e.object({name:e.string(),description:e.string().optional(),headshot:z.optional()}),X=/^[0-9A-F]{2}$/,ee=e.string().refine((e=>X.test(e)),(e=>({message:`"${e}" is not a valid hex value`}))),ne=e.object({r:ee,g:ee,b:ee,kind:e.literal("hex")}),te=e.object({mobileUrl:e.string(),tabletUrl:e.string(),desktopUrl:e.string(),altText:e.string(),kind:e.literal("Image")}),ae=e.object({buttonColour:ne.nullish(),buttonTextColour:ne.nullish(),buttonBorderColour:ne.nullish(),buttonSelectColour:ne.nullish(),buttonSelectTextColour:ne.nullish(),buttonSelectBorderColour:ne.nullish(),kind:e.literal("ChoiceCards")}),ie=e.discriminatedUnion("kind",[te,ae]),oe=e.object({visual:ie.nullish(),colours:e.object({basic:e.object({background:ne,bodyText:ne})})}),re=e=>`#${e.r}${e.g}${e.b}`,se=e.enum(["Contribution","SupporterPlus","GuardianWeekly","Paper"]),le=e.enum(["new","guest","current"]),ue=e.enum(["Epic","EpicAMP","EpicAppleNews","EpicLiveblog","Banner1","Banner2","Header","GutterLiveblog"]),ce=e.enum(["Live","Draft","Archived"]),de=e.enum(["Mobile","Desktop","All","iOS","Android"]),ge=e.enum(["SignedIn","SignedOut","All"]),me=e.enum(["HasConsented","HasNotConsented","All"]),pe=e.object({name:e.literal("ABTest")}),be=e.object({name:e.literal("EpsilonGreedyBandit"),epsilon:e.number(),sampleCount:e.number().optional()}),Ce=e.object({name:e.literal("Roulette"),sampleCount:e.number().optional()}),Se=e.intersection(e.discriminatedUnion("name",[pe,be,Ce]),e.object({testName:e.string().optional()})),he=e.object({channel:ue,name:e.string(),status:ce,priority:e.number(),controlProportionSettings:e.object({proportion:e.number(),offset:e.number()}).optional(),deviceType:de.optional(),signedInStatus:ge.optional(),consentStatus:me.optional(),methodologies:Se.array().optional()}),ye=e.enum(["AllExistingSupporters","AllNonSupporters","Everyone","PostAskPauseSingleContributors"]),Ae=e.object({minViews:e.number(),maxViews:e.number().optional(),periodInWeeks:e.number(),tagIds:e.array(e.string()).optional()});e.object({userType:e.array(le),product:e.array(se)}),e.object({tagIds:e.array(e.string()),sectionIds:e.array(e.string()),excludedTagIds:e.array(e.string()),excludedSectionIds:e.array(e.string())});const Te=e.object({maxViewsCount:e.number(),maxViewsDays:e.number(),minDaysBetweenViews:e.number()}),Ie=e.object({reminderCta:e.string(),reminderLabel:e.string(),reminderPeriod:e.string()}),Ne=e.enum(["ONE_OFF","MONTHLY","ANNUAL"]),Me=e.object({testName:e.string(),variantName:e.string(),defaultContributionType:Ne,displayContributionType:Ne.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()})})}),Ee=e.object({newsletterId:e.string(),successDescription:e.string()}),Ge=e.object({name:e.string(),heading:e.string().optional(),paragraphs:e.array(e.string()),highlightedText:e.string().optional(),tickerSettings:W.optional(),cta:D.optional(),secondaryCta:f.optional(),newsletterSignup:Ee.optional(),image:z.optional(),showReminderFields:Ie.optional(),separateArticleCount:x.optional(),maxViews:Te.optional(),showSignInLink:e.boolean().optional(),bylineWithImage:q.optional(),showChoiceCards:e.boolean().optional(),choiceCardAmounts:Me.optional(),defaultChoiceCardFrequency:Ne.optional()}),Ue=e.object({variant:Ge,tracking:Q,countryCode:e.string().nullish(),articleCounts:Z,onReminderOpen:e.any().nullish(),fetchEmail:e.any().nullish(),submitComponentEvent:e.any().nullish(),openCmp:e.any().nullish(),hasConsentForArticleCount:e.boolean().nullish(),stage:e.string().nullish()}),Re=e.enum(["contributions","subscriptions","signIn","abandonedBasket"]),Be=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:D.optional(),secondaryCta:f.optional()}),Pe=e.object({tracking:Q,bannerChannel:Re,content:Be.nullish(),mobileContent:Be.nullish(),countryCode:e.string().nullish(),isSupporter:e.boolean().nullish(),tickerSettings:W.nullish(),submitComponentEvent:e.any(),articleCounts:Z,hasOptedOutOfArticleCount:e.boolean().nullish(),fetchEmail:e.any().nullish(),separateArticleCount:e.boolean().nullish(),design:oe.nullish()}),Le=e.object({heading:e.string(),subheading:e.string(),primaryCta:D.optional(),secondaryCta:D.optional(),benefits:e.array(e.string()).optional()}),De=e.object({content:Le,tracking:Q,mobileContent:Le.optional(),countryCode:e.string().optional(),submitComponentEvent:e.any(),numArticles:e.number().optional()}),we=e.object({image:z,bodyCopy:e.array(e.string()),cta:D.optional()});e.object({content:we,tracking:Q,countryCode:e.string().optional(),submitComponentEvent:e.any()});const Oe=e.object({maxViewsCount:e.number(),maxViewsDays:e.number(),minDaysBetweenViews:e.number()}),ke=["ONE_OFF","MONTHLY","ANNUAL"];he.extend({name:e.string(),status:ce,locations:e.array(g),tagIds:e.array(e.string()),sections:e.array(e.string()),excludedTagIds:e.array(e.string()),excludedSections:e.array(e.string()),alwaysAsk:e.boolean(),maxViews:Oe.optional(),userCohort:ye,hasCountryName:e.boolean(),highPriority:e.boolean(),useLocalViewLog:e.boolean(),articlesViewedSettings:Ae.optional(),priority:e.number(),variants:Ge.array()});const fe=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")])}),Ke=(e,n,t)=>{const a=(e=>{if(URLSearchParams){const n=new URLSearchParams(window.location.search).get(`force-${e}`);if(n)return n}return null})(e);return fetch(`${n}/${e}${a?`?force=${a}`:""}`,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then((n=>{if(!n.ok)throw Error(n.statusText||`Supporter Revenue ${e} | Api call returned HTTP status ${n.status}`);return n})).then((e=>e.json()))},ve=(e,n)=>Ke("epic",e,n),Fe=(e,n)=>Ke("liveblog-epic",e,n),je=(e,n)=>Ke("banner",e,n),He=(e,n)=>Ke("gutter-liveblog",e,n),Ye=(e,n)=>Ke("header",e,n);export{d as CountryGroupId,w as SecondaryCtaType,F as TickerCountType,K as TickerEndType,fe as abandonedBasketSchema,T as addRegionIdToSupportUrl,Pe as bannerSchema,R as buildReminderFields,G as containsNonArticleCountPlaceholder,ke as contributionTabFrequencies,C as countryCodeToCountryGroupId,g as countryGroupIdSchema,Ue as epicPropsSchema,je as getBanner,y as getCountryName,ve as getEpic,t as getEpicViewLog,He as getGutterLiveblog,Ye as getHeader,Fe as getLiveblogEpic,h as getLocalCurrencySymbol,L as getReminderFields,s as getWeeklyArticleHistory,De as headerPropsSchema,re as hexColourToString,S as inCountryGroups,c as incrementWeeklyArticleCount,A as isGWCheckoutUrl,a as logEpicView,M as replaceNonArticleCountPlaceholders};
|
|
1
|
+
import{z as e}from"zod";const n="gu.contributions.views",t=e=>e.get(n)||void 0,a=e=>{const t=localStorage.getItem(n),a=t?JSON.parse(t).value:[];a.push({date:(new Date).getTime(),testId:e});const i={value:a.slice(-50)};localStorage.setItem(n,JSON.stringify(i))},i="gu.history.weeklyArticleCount",o="gu.history.articleCountsThisWeek",r=e=>{const n=e.getDay()||7;return Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()-(n-1))/864e5},s=e=>e.get(i)||void 0,l=new Set(["environment/climate-change","environment/climate-crisis","environment/environment","science/science","politics/politics","us-news/us-politics","australia-news/australian-politics","world/world","world/europe-news","world/russia","books/books","culture/culture","world/coronavirus-outbreak","world/race","inequality/inequality","technology/technology","business/business","tone/recipes","sport/sport","football/football","sport/olympic-games","sport/olympic-games-2024","tracking/commissioningdesk/uk-investigations"]),u=(e,n={})=>(e.forEach((e=>{l.has(e)&&(n[e]=(n[e]??0)+1)})),n),c=(e,n,t)=>{const a=((e,n)=>{const t=r(new Date),a=e.get(o);if(a&&a.week===t){const i=a.articles[n]||0;return e.set(o,{week:t,articles:{...a.articles,[n]:i+1}}),i>0}return e.set(o,{week:t,articles:{[n]:1}}),!1})(e,n);if(!a){const n=r(new Date),a=e.get(i)||[],o=a[0];if(o&&o.week&&o.week===n)o.count+=1,o.tags=u(t,o.tags),e.set(i,a);else{a.unshift({week:n,count:1,tags:u(t,{})});const o=n-365,r=a.filter((e=>e.week>=o));e.set(i,r)}}},d=["GBPCountries","UnitedStates","AUDCountries","EURCountries","International","NZDCountries","Canada"],g=e.enum(d),m=e.object({targetedCountryGroups:e.array(g),targetedCountryCodes:e.array(e.string()).optional()}).optional(),p={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"}},b={AD:"Andorra",AE:"the UAE",AF:"Afghanistan",AG:"Antigua and Barbuda",AI:"Anguilla",AL:"Albania",AM:"Armenia",AO:"Angola",AR:"Argentina",AS:"the US",AT:"Austria",AU:"Australia",AW:"Aruba",AX:"Åland Islands",AZ:"Azerbaijan",BA:"Bosnia and Herzegovina",BB:"Barbados",BD:"Bangladesh",BE:"Belgium",BF:"Burkina Faso",BG:"Bulgaria",BH:"Bahrain",BI:"Burundi",BJ:"Benin",BL:"Saint Barthélemy",BM:"Bermuda",BN:"Brunei Darussalam",BO:"Bolivia",BQ:"Bonaire, Sint Eustatius and Saba",BR:"Brazil",BS:"the Bahamas",BT:"Bhutan",BV:"Bouvet Island",BW:"Botswana",BY:"Belarus",BZ:"Belize",CA:"Canada",CD:"the Democratic Republic of the Congo",CF:"the Central Africa Republic",CG:"the Congo",CH:"Switzerland",CI:"Côte d'Ivoire",CK:"the Cook Islands",CL:"Chile",CM:"Cameroon",CN:"China",CO:"Colombia",CR:"Costa Rica",CU:"Cuba",CV:"Cabo Verde",CW:"Curaçao",CX:"Christmas Island",CY:"Cyprus",CZ:"the Czech Republic",DE:"Germany",DJ:"Djibouti",DK:"Denmark",DM:"Dominica",DO:"the Dominican Republic",DZ:"Algeria",EC:"Ecuador",EE:"Estonia",EG:"Egypt",EH:"the Western Sahara",ER:"Eritrea",ES:"Spain",ET:"Ethiopia",FI:"Finland",FJ:"Fiji",FK:"the UK",FO:"the UK",FR:"France",GA:"Gabon",GB:"the UK",GD:"Grenada",GE:"Georgia",GF:"French Guiana",GG:"Guernsey",GH:"Ghana",GI:"Gibraltar",GL:"Greenland",GM:"the Gambia",GN:"Guinea",GP:"Guadeloupe",GQ:"Equatorial Guinea",GR:"Greece",GT:"Guatemala",GU:"Guam",GW:"Guinea-Bissau",GY:"Guyana",HK:"Hong Kong",HN:"Honduras",HR:"Croatia",HT:"Haiti",HU:"Hungary",ID:"Indonesia",IE:"Ireland",IM:"the Isle of Man",IN:"India",IQ:"Iraq",IR:"Iran",IS:"Iceland",IT:"Italy",JE:"Jersey",JM:"Jamaica",JO:"Jordan",JP:"Japan",KE:"Kenya",KG:"Kyrgyzstan",KH:"Cambodia",KI:"Kiribati",KN:"Saint Kitts and Nevis",KP:"Korea",KR:"Korea",KW:"Kuwait",KY:"the Cayman Ialnds",KZ:"Kazakhstan",LB:"Lebanon",LC:"Saint Lucia",LI:"Liechtenstein",LK:"Sri Lanka",LR:"Liberia",LS:"Lesotho",LT:"Lithuania",LU:"Luxembourg",LV:"Latvia",LY:"Libya",MA:"Morocco",MC:"Monaco",MD:"Moldova",ME:"Montenegro",MG:"Madagascar",MK:"the Republic of North Macedonia",ML:"Mali",MM:"Myanmar",MN:"Mongolia",MO:"Macao",MQ:"Martinique",MR:"Mauritania",MS:"Montserrat",MT:"Malta",MU:"Mauritius",MV:"Maldives",MW:"Malawi",MX:"Mexico",MY:"Malaysia",MZ:"Mozambique",NA:"Namibia",NC:"New Caledonia",NE:"Niger",NF:"Norfolk Island",NG:"Nigeria",NI:"Nicaragua",NL:"the Netherlands",NO:"Norway",NP:"Nepal",NR:"Nauru",NU:"Niue",NZ:"New Zealand",OM:"Oman",PA:"Panama",PE:"Peru",PF:"French Polynesia",PG:"Papua New Guinea",PH:"the Philippines",PK:"Pakistan",PL:"Poland",PM:"Saint Pierre and Miquelon",PN:"Pitcairn",PR:"Puerto Rico",PT:"Portugal",PW:"Palau",PY:"Paraguay",QA:"Qatar",RE:"Réunion",RO:"Romania",RU:"Russia",RW:"Rwanda",SA:"Saudi Arabia",SB:"Solomon Islands",SC:"Seychelles",SD:"Sudan",SE:"Sweden",SG:"Singapore",SH:"Saint Helena",SI:"Slovenia",SJ:"Svalbard and Jan Mayen",SK:"Slovakia",SL:"Sierra Leone",SM:"San Marino",SN:"Senegal",SO:"Somalia",SR:"Suriname",SS:"South Sudan",ST:"Sao Tome and Principe",SV:"El Salvador",SY:"Syrian Arab Republic",SZ:"Eswatini",TD:"Chad",TG:"Togo",TH:"Thailand",TJ:"Tajikistan",TK:"Tokelau",TL:"Timor-Leste",TM:"Turkmenistan",TN:"Tunisia",TO:"Tonga",TR:"Turkey",TT:"Trinidad and Tobago",TV:"Tuvalu",TW:"Taiwan",TZ:"Tanzania ",UG:"Uganda",US:"the US",UY:"Uruguay",UZ:"Uzbekistan",VC:"Saint Vincent and the Grenadines",VE:"Venezuela",VG:"the Virgin Islands",VI:"the Virgin Islands",VN:"Vietnam",VU:"Vanuatu",WF:"Wallis and Futuna",WS:"Samoa",YE:"Yemen",YT:"Mayotte",ZA:"South Africa",ZM:"Zambia",ZW:"Zimbabwe"},C={GBPCountries:"£",UnitedStates:"$",AUDCountries:"$",Canada:"CA$",EURCountries:"€",NZDCountries:"NZ$",International:"$"},S=e=>Object.keys(p).find((n=>p[n].countries.includes(e??"")))||"International",h=(e,n=[],t=[])=>0===n.length&&0===t.length||!!e&&(!!n.includes(S(e.toUpperCase()))||t.includes(e.toUpperCase())),y=e=>{if(e){const n=S(e);return C[n]}return"£"},A=e=>{if(e)return b[e]},T=e=>/subscribe\/weekly\/checkout/.test(e),I=(e,n)=>{if(n){const t=(e=>p[S(e)]?.supportRegionId)(n);if(t&&!T(e))return e.replace(/(support\.theguardian\.com)\/(contribute-in-epic|contribute|subscribe|checkout)/,((e,n,a)=>`${n}/${t.toLowerCase()}/${a}`))}return e},N=(e,n,t,a)=>{if(a){const i=a[S(t)];if(i){return`${y(t)}${i[e][n].price}`}}},M={CURRENCY_SYMBOL:({countryCode:e})=>y(e),COUNTRY_NAME:({countryCode:e})=>A(e),PRICE_DIGISUB_MONTHLY:({countryCode:e,prices:n})=>N("Digisub","Monthly",e,n),PRICE_DIGISUB_ANNUAL:({countryCode:e,prices:n})=>N("Digisub","Annual",e,n),PRICE_GUARDIANWEEKLY_MONTHLY:({countryCode:e,prices:n})=>N("GuardianWeekly","Monthly",e,n),PRICE_GUARDIANWEEKLY_ANNUAL:({countryCode:e,prices:n})=>N("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"}))()},E=(e,n,t)=>e?e.replace(G,(e=>{const a=e.substring(2,e.length-2),i=M[a];if(i){const e=i({countryCode:n,prices:t});if(e)return e}return e})):"",G=/%%.*?%%/g,U=e=>{const n=e.match(G)?.filter((e=>"%%ARTICLE_COUNT%%"!==e));return!!n&&n.length>0},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},B=(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()),D=(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()):B(n);var t},w=e.object({text:e.string(),baseUrl:e.string()});let O=function(e){return e.Custom="CustomSecondaryCta",e.ContributionsReminder="ContributionsReminderSecondaryCta",e}({});e.nativeEnum(O);const k=e.object({type:e.literal(O.Custom),cta:w}),f=e.object({type:e.literal(O.ContributionsReminder)}),K=e.discriminatedUnion("type",[k,f]);let v=function(e){return e.unlimited="unlimited",e.hardstop="hardstop",e}({});const F=e.nativeEnum(v);let j=function(e){return e.money="money",e}({});const H=e.nativeEnum(j),Y=e.object({countLabel:e.string(),goalReachedPrimary:e.string().optional(),goalReachedSecondary:e.string().optional()}),V=e.object({total:e.number(),goal:e.number()}),W=e.enum(["US","AU"]),Z=e.object({endType:F,countType:H,currencySymbol:e.string(),copy:Y,name:W,tickerData:V.optional()}),$=e.object({for52Weeks:e.number(),forTargetedWeeks:e.number()}),x=e.enum(["for52Weeks","forTargetedWeeks"]),_=e.object({type:e.literal("above"),copy:e.string().optional(),countType:x.optional()}),J=e.enum(["CONTRIBUTION","MEMBERSHIP_SUPPORTER","DIGITAL_SUBSCRIPTION","PRINT_SUBSCRIPTION"]),Q=e.enum(["ACQUISITIONS_EPIC","ACQUISITIONS_ENGAGEMENT_BANNER","ACQUISITIONS_SUBSCRIPTIONS_BANNER","ACQUISITIONS_HEADER","ACQUISITIONS_OTHER"]),z=e.object({abTestName:e.string(),abTestVariant:e.string(),campaignCode:e.string(),componentType:Q,products:e.array(J).nullish(),labels:e.array(e.string()).nullish(),ophanPageId:e.string(),platformId:e.string(),referrerUrl:e.string()}),q=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()}),X=e.object({name:e.string(),description:e.string().optional(),headshot:q.optional()}),ee=/^[0-9A-F]{2}$/,ne=e.string().refine((e=>ee.test(e)),(e=>({message:`"${e}" is not a valid hex value`}))),te=e.object({r:ne,g:ne,b:ne,kind:e.literal("hex")}),ae=e.object({mobileUrl:e.string(),tabletUrl:e.string(),desktopUrl:e.string(),altText:e.string(),kind:e.literal("Image")}),ie=e.object({buttonColour:te.nullish(),buttonTextColour:te.nullish(),buttonBorderColour:te.nullish(),buttonSelectColour:te.nullish(),buttonSelectTextColour:te.nullish(),buttonSelectBorderColour:te.nullish(),kind:e.literal("ChoiceCards")}),oe=e.discriminatedUnion("kind",[ae,ie]),re=e.object({visual:oe.nullish(),colours:e.object({basic:e.object({background:te,bodyText:te})})}),se=e=>`#${e.r}${e.g}${e.b}`,le=e.enum(["Contribution","SupporterPlus","GuardianWeekly","Paper"]),ue=e.enum(["new","guest","current"]),ce=e.enum(["Epic","EpicAMP","EpicAppleNews","EpicLiveblog","Banner1","Banner2","Header","GutterLiveblog"]),de=e.enum(["Live","Draft","Archived"]),ge=e.enum(["Mobile","Desktop","All","iOS","Android"]),me=e.enum(["SignedIn","SignedOut","All"]),pe=e.enum(["HasConsented","HasNotConsented","All"]),be=e.object({name:e.literal("ABTest")}),Ce=e.object({name:e.literal("EpsilonGreedyBandit"),epsilon:e.number(),sampleCount:e.number().optional()}),Se=e.object({name:e.literal("Roulette"),sampleCount:e.number().optional()}),he=e.intersection(e.discriminatedUnion("name",[be,Ce,Se]),e.object({testName:e.string().optional()})),ye=e.object({channel:ce,name:e.string(),status:de,priority:e.number(),controlProportionSettings:e.object({proportion:e.number(),offset:e.number()}).optional(),deviceType:ge.optional(),signedInStatus:me.optional(),consentStatus:pe.optional(),methodologies:he.array().optional()}),Ae=e.enum(["AllExistingSupporters","AllNonSupporters","Everyone","PostAskPauseSingleContributors"]),Te=e.object({minViews:e.number(),maxViews:e.number().optional(),periodInWeeks:e.number(),tagIds:e.array(e.string()).optional()});e.object({userType:e.array(ue),product:e.array(le)}),e.object({tagIds:e.array(e.string()),sectionIds:e.array(e.string()),excludedTagIds:e.array(e.string()),excludedSectionIds:e.array(e.string())});const Ie=e.object({maxViewsCount:e.number(),maxViewsDays:e.number(),minDaysBetweenViews:e.number()}),Ne=e.object({reminderCta:e.string(),reminderLabel:e.string(),reminderPeriod:e.string()}),Me=e.enum(["ONE_OFF","MONTHLY","ANNUAL"]),Ee=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()})})}),Ge=e.object({newsletterId:e.string(),successDescription:e.string()}),Ue=e.object({name:e.string(),heading:e.string().optional(),paragraphs:e.array(e.string()),highlightedText:e.string().optional(),tickerSettings:Z.optional(),cta:w.optional(),secondaryCta:K.optional(),newsletterSignup:Ge.optional(),image:q.optional(),showReminderFields:Ne.optional(),separateArticleCount:_.optional(),maxViews:Ie.optional(),showSignInLink:e.boolean().optional(),bylineWithImage:X.optional(),showChoiceCards:e.boolean().optional(),choiceCardAmounts:Ee.optional(),defaultChoiceCardFrequency:Me.optional()}),Re=e.object({variant:Ue,tracking:z,countryCode:e.string().nullish(),articleCounts:$,onReminderOpen:e.any().nullish(),fetchEmail:e.any().nullish(),submitComponentEvent:e.any().nullish(),openCmp:e.any().nullish(),hasConsentForArticleCount:e.boolean().nullish(),stage:e.string().nullish()}),Be=e.enum(["contributions","subscriptions","signIn","abandonedBasket"]),Pe=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:w.optional(),secondaryCta:K.optional()}),Le=e.object({tracking:z,bannerChannel:Be,content:Pe.nullish(),mobileContent:Pe.nullish(),countryCode:e.string().nullish(),isSupporter:e.boolean().nullish(),tickerSettings:Z.nullish(),submitComponentEvent:e.any(),articleCounts:$,hasOptedOutOfArticleCount:e.boolean().nullish(),fetchEmail:e.any().nullish(),separateArticleCount:e.boolean().nullish(),design:re.nullish()}),De=e.object({heading:e.string(),subheading:e.string(),primaryCta:w.optional(),secondaryCta:w.optional(),benefits:e.array(e.string()).optional()}),we=e.object({content:De,tracking:z,mobileContent:De.optional(),countryCode:e.string().optional(),submitComponentEvent:e.any(),numArticles:e.number().optional()}),Oe=e.object({image:q,bodyCopy:e.array(e.string()),cta:w.optional()});e.object({content:Oe,tracking:z,countryCode:e.string().optional(),submitComponentEvent:e.any()});const ke=e.object({maxViewsCount:e.number(),maxViewsDays:e.number(),minDaysBetweenViews:e.number()}),fe=["ONE_OFF","MONTHLY","ANNUAL"];ye.extend({name:e.string(),status:de,locations:e.array(g).optional(),regionTargeting:m.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:ke.optional(),userCohort:Ae,hasCountryName:e.boolean(),highPriority:e.boolean(),useLocalViewLog:e.boolean(),articlesViewedSettings:Te.optional(),priority:e.number(),variants:Ue.array()});const Ke=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")])}),ve=(e,n,t)=>{const a=(e=>{if(URLSearchParams){const n=new URLSearchParams(window.location.search).get(`force-${e}`);if(n)return n}return null})(e);return fetch(`${n}/${e}${a?`?force=${a}`:""}`,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then((n=>{if(!n.ok)throw Error(n.statusText||`Supporter Revenue ${e} | Api call returned HTTP status ${n.status}`);return n})).then((e=>e.json()))},Fe=(e,n)=>ve("epic",e,n),je=(e,n)=>ve("liveblog-epic",e,n),He=(e,n)=>ve("banner",e,n),Ye=(e,n)=>ve("gutter-liveblog",e,n),Ve=(e,n)=>ve("header",e,n);export{d as CountryGroupId,O as SecondaryCtaType,j as TickerCountType,v as TickerEndType,Ke as abandonedBasketSchema,I as addRegionIdToSupportUrl,Le as bannerSchema,B as buildReminderFields,U as containsNonArticleCountPlaceholder,fe as contributionTabFrequencies,S as countryCodeToCountryGroupId,g as countryGroupIdSchema,Re as epicPropsSchema,He as getBanner,A as getCountryName,Fe as getEpic,t as getEpicViewLog,Ye as getGutterLiveblog,Ve as getHeader,je as getLiveblogEpic,y as getLocalCurrencySymbol,D as getReminderFields,s as getWeeklyArticleHistory,we as headerPropsSchema,se as hexColourToString,h as inTargetedCountry,c as incrementWeeklyArticleCount,T as isGWCheckoutUrl,a as logEpicView,E as replaceNonArticleCountPlaceholders,m 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.contributions.views",n="gu.history.weeklyArticleCount",a="gu.history.articleCountsThisWeek",o=e=>{const t=e.getDay()||7;return Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()-(t-1))/864e5},r=new Set(["environment/climate-change","environment/climate-crisis","environment/environment","science/science","politics/politics","us-news/us-politics","australia-news/australian-politics","world/world","world/europe-news","world/russia","books/books","culture/culture","world/coronavirus-outbreak","world/race","inequality/inequality","technology/technology","business/business","tone/recipes","sport/sport","football/football","sport/olympic-games","sport/olympic-games-2024","tracking/commissioningdesk/uk-investigations"]),i=(e,t={})=>(e.forEach((e=>{r.has(e)&&(t[e]=(t[e]??0)+1)})),t),s=["GBPCountries","UnitedStates","AUDCountries","EURCountries","International","NZDCountries","Canada"],l=e.z.enum(s),u={GBPCountries:{name:"United Kingdom",currency:"GBP",countries:["GB","FK","GI","GG","IM","JE","SH"],supportRegionId:"UK"},UnitedStates:{name:"United States",currency:"USD",countries:["US"],supportRegionId:"US"},AUDCountries:{name:"Australia",currency:"AUD",countries:["AU","KI","NR","NF","TV"],supportRegionId:"AU"},EURCountries:{name:"Europe",currency:"EUR",countries:["AD","AL","AT","BA","BE","BG","BL","CH","CY","CZ","DE","DK","EE","ES","FI","FO","FR","GF","GL","GP","GR","HR","HU","IE","IT","LI","LT","LU","LV","MC","ME","MF","IS","MQ","MT","NL","NO","PF","PL","PM","PT","RE","RO","RS","SE","SI","SJ","SK","SM","TF","TR","WF","YT","VA","AX","AZ","AM","GE","BY","MD","UA","MK"],supportRegionId:"EU"},International:{name:"International",currency:"USD",countries:["AE","AF","AG","AI","AO","AQ","AR","AS","AW","BB","BD","BF","BH","BI","BJ","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BZ","CC","CD","CF","CG","CI","CL","CM","CN","CO","CR","CU","CV","CW","CX","DJ","DM","DO","DZ","EC","EG","EH","ER","ET","FJ","FM","GA","GD","GH","GM","GN","GQ","GS","GT","GU","GW","GY","HK","HM","HN","HT","ID","IL","IN","IO","IQ","IR","JM","JO","JP","KE","KG","KH","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LK","LR","LS","LY","MA","MG","MH","ML","MM","MN","MO","MP","MR","MS","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NG","NI","NP","NU","OM","PA","PE","PG","PH","PK","PN","PR","PS","PW","PY","QA","RU","RW","SA","SB","SC","SD","SG","SL","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TG","TH","TJ","TK","TL","TM","TN","TO","TT","TW","TZ","UG","UM","UY","UZ","VC","VE","VG","VI","VN","VU","WS","YE","ZA","ZM","ZW"],supportRegionId:"INT"},NZDCountries:{name:"New Zealand",currency:"NZD",countries:["NZ","CK"],supportRegionId:"NZ"},Canada:{name:"Canada",currency:"CAD",countries:["CA"],supportRegionId:"CA"}},c={AD:"Andorra",AE:"the UAE",AF:"Afghanistan",AG:"Antigua and Barbuda",AI:"Anguilla",AL:"Albania",AM:"Armenia",AO:"Angola",AR:"Argentina",AS:"the US",AT:"Austria",AU:"Australia",AW:"Aruba",AX:"Åland Islands",AZ:"Azerbaijan",BA:"Bosnia and Herzegovina",BB:"Barbados",BD:"Bangladesh",BE:"Belgium",BF:"Burkina Faso",BG:"Bulgaria",BH:"Bahrain",BI:"Burundi",BJ:"Benin",BL:"Saint Barthélemy",BM:"Bermuda",BN:"Brunei Darussalam",BO:"Bolivia",BQ:"Bonaire, Sint Eustatius and Saba",BR:"Brazil",BS:"the Bahamas",BT:"Bhutan",BV:"Bouvet Island",BW:"Botswana",BY:"Belarus",BZ:"Belize",CA:"Canada",CD:"the Democratic Republic of the Congo",CF:"the Central Africa Republic",CG:"the Congo",CH:"Switzerland",CI:"Côte d'Ivoire",CK:"the Cook Islands",CL:"Chile",CM:"Cameroon",CN:"China",CO:"Colombia",CR:"Costa Rica",CU:"Cuba",CV:"Cabo Verde",CW:"Curaçao",CX:"Christmas Island",CY:"Cyprus",CZ:"the Czech Republic",DE:"Germany",DJ:"Djibouti",DK:"Denmark",DM:"Dominica",DO:"the Dominican Republic",DZ:"Algeria",EC:"Ecuador",EE:"Estonia",EG:"Egypt",EH:"the Western Sahara",ER:"Eritrea",ES:"Spain",ET:"Ethiopia",FI:"Finland",FJ:"Fiji",FK:"the UK",FO:"the UK",FR:"France",GA:"Gabon",GB:"the UK",GD:"Grenada",GE:"Georgia",GF:"French Guiana",GG:"Guernsey",GH:"Ghana",GI:"Gibraltar",GL:"Greenland",GM:"the Gambia",GN:"Guinea",GP:"Guadeloupe",GQ:"Equatorial Guinea",GR:"Greece",GT:"Guatemala",GU:"Guam",GW:"Guinea-Bissau",GY:"Guyana",HK:"Hong Kong",HN:"Honduras",HR:"Croatia",HT:"Haiti",HU:"Hungary",ID:"Indonesia",IE:"Ireland",IM:"the Isle of Man",IN:"India",IQ:"Iraq",IR:"Iran",IS:"Iceland",IT:"Italy",JE:"Jersey",JM:"Jamaica",JO:"Jordan",JP:"Japan",KE:"Kenya",KG:"Kyrgyzstan",KH:"Cambodia",KI:"Kiribati",KN:"Saint Kitts and Nevis",KP:"Korea",KR:"Korea",KW:"Kuwait",KY:"the Cayman Ialnds",KZ:"Kazakhstan",LB:"Lebanon",LC:"Saint Lucia",LI:"Liechtenstein",LK:"Sri Lanka",LR:"Liberia",LS:"Lesotho",LT:"Lithuania",LU:"Luxembourg",LV:"Latvia",LY:"Libya",MA:"Morocco",MC:"Monaco",MD:"Moldova",ME:"Montenegro",MG:"Madagascar",MK:"the Republic of North Macedonia",ML:"Mali",MM:"Myanmar",MN:"Mongolia",MO:"Macao",MQ:"Martinique",MR:"Mauritania",MS:"Montserrat",MT:"Malta",MU:"Mauritius",MV:"Maldives",MW:"Malawi",MX:"Mexico",MY:"Malaysia",MZ:"Mozambique",NA:"Namibia",NC:"New Caledonia",NE:"Niger",NF:"Norfolk Island",NG:"Nigeria",NI:"Nicaragua",NL:"the Netherlands",NO:"Norway",NP:"Nepal",NR:"Nauru",NU:"Niue",NZ:"New Zealand",OM:"Oman",PA:"Panama",PE:"Peru",PF:"French Polynesia",PG:"Papua New Guinea",PH:"the Philippines",PK:"Pakistan",PL:"Poland",PM:"Saint Pierre and Miquelon",PN:"Pitcairn",PR:"Puerto Rico",PT:"Portugal",PW:"Palau",PY:"Paraguay",QA:"Qatar",RE:"Réunion",RO:"Romania",RU:"Russia",RW:"Rwanda",SA:"Saudi Arabia",SB:"Solomon Islands",SC:"Seychelles",SD:"Sudan",SE:"Sweden",SG:"Singapore",SH:"Saint Helena",SI:"Slovenia",SJ:"Svalbard and Jan Mayen",SK:"Slovakia",SL:"Sierra Leone",SM:"San Marino",SN:"Senegal",SO:"Somalia",SR:"Suriname",SS:"South Sudan",ST:"Sao Tome and Principe",SV:"El Salvador",SY:"Syrian Arab Republic",SZ:"Eswatini",TD:"Chad",TG:"Togo",TH:"Thailand",TJ:"Tajikistan",TK:"Tokelau",TL:"Timor-Leste",TM:"Turkmenistan",TN:"Tunisia",TO:"Tonga",TR:"Turkey",TT:"Trinidad and Tobago",TV:"Tuvalu",TW:"Taiwan",TZ:"Tanzania ",UG:"Uganda",US:"the US",UY:"Uruguay",UZ:"Uzbekistan",VC:"Saint Vincent and the Grenadines",VE:"Venezuela",VG:"the Virgin Islands",VI:"the Virgin Islands",VN:"Vietnam",VU:"Vanuatu",WF:"Wallis and Futuna",WS:"Samoa",YE:"Yemen",YT:"Mayotte",ZA:"South Africa",ZM:"Zambia",ZW:"Zimbabwe"},d={GBPCountries:"£",UnitedStates:"$",AUDCountries:"$",Canada:"CA$",EURCountries:"€",NZDCountries:"NZ$",International:"$"},p=e=>Object.keys(u).find((t=>u[t].countries.includes(e??"")))||"International",g=e=>{if(e){const t=p(e);return d[t]}return"£"},z=e=>{if(e)return c[e]},m=e=>/subscribe\/weekly\/checkout/.test(e),C=(e,t,n,a)=>{if(a){const o=a[p(n)];if(o){return`${g(n)}${o[e][t].price}`}}},b={CURRENCY_SYMBOL:({countryCode:e})=>g(e),COUNTRY_NAME:({countryCode:e})=>z(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"}))()},S=/%%.*?%%/g,h=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},y=(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}`}},A=new Date("2023-12-31"),T=e=>e>=(e=>new Date(e.getFullYear(),9,20))(e)&&e<h(e.getFullYear()),I=e.z.object({text:e.z.string(),baseUrl:e.z.string()});let N=function(e){return e.Custom="CustomSecondaryCta",e.ContributionsReminder="ContributionsReminderSecondaryCta",e}({});e.z.nativeEnum(N);const M=e.z.object({type:e.z.literal(N.Custom),cta:I}),E=e.z.object({type:e.z.literal(N.ContributionsReminder)}),G=e.z.discriminatedUnion("type",[M,E]);let U=function(e){return e.unlimited="unlimited",e.hardstop="hardstop",e}({});const R=e.z.nativeEnum(U);let B=function(e){return e.money="money",e}({});const P=e.z.nativeEnum(B),L=e.z.object({countLabel:e.z.string(),goalReachedPrimary:e.z.string().optional(),goalReachedSecondary:e.z.string().optional()}),D=e.z.object({total:e.z.number(),goal:e.z.number()}),w=e.z.enum(["US","AU"]),k=e.z.object({endType:R,countType:P,currencySymbol:e.z.string(),copy:L,name:w,tickerData:D.optional()}),O=e.z.object({for52Weeks:e.z.number(),forTargetedWeeks:e.z.number()}),x=e.z.enum(["for52Weeks","forTargetedWeeks"]),f=e.z.object({type:e.z.literal("above"),copy:e.z.string().optional(),countType:x.optional()}),v=e.z.enum(["CONTRIBUTION","MEMBERSHIP_SUPPORTER","DIGITAL_SUBSCRIPTION","PRINT_SUBSCRIPTION"]),F=e.z.enum(["ACQUISITIONS_EPIC","ACQUISITIONS_ENGAGEMENT_BANNER","ACQUISITIONS_SUBSCRIPTIONS_BANNER","ACQUISITIONS_HEADER","ACQUISITIONS_OTHER"]),K=e.z.object({abTestName:e.z.string(),abTestVariant:e.z.string(),campaignCode:e.z.string(),componentType:F,products:e.z.array(v).nullish(),labels:e.z.array(e.z.string()).nullish(),ophanPageId:e.z.string(),platformId:e.z.string(),referrerUrl:e.z.string(),clientName:e.z.string()}),j=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()}),H=e.z.object({name:e.z.string(),description:e.z.string().optional(),headshot:j.optional()}),V=/^[0-9A-F]{2}$/,Y=e.z.string().refine((e=>V.test(e)),(e=>({message:`"${e}" is not a valid hex value`}))),W=e.z.object({r:Y,g:Y,b:Y,kind:e.z.literal("hex")}),Z=e.z.object({mobileUrl:e.z.string(),tabletUrl:e.z.string(),desktopUrl:e.z.string(),altText:e.z.string(),kind:e.z.literal("Image")}),$=e.z.object({buttonColour:W.nullish(),buttonTextColour:W.nullish(),buttonBorderColour:W.nullish(),buttonSelectColour:W.nullish(),buttonSelectTextColour:W.nullish(),buttonSelectBorderColour:W.nullish(),kind:e.z.literal("ChoiceCards")}),_=e.z.discriminatedUnion("kind",[Z,$]),J=e.z.object({visual:_.nullish(),colours:e.z.object({basic:e.z.object({background:W,bodyText:W})})}),Q=e.z.enum(["Contribution","SupporterPlus","GuardianWeekly","Paper"]),q=e.z.enum(["new","guest","current"]),X=e.z.enum(["Epic","EpicAMP","EpicAppleNews","EpicLiveblog","Banner1","Banner2","Header","GutterLiveblog"]),ee=e.z.enum(["Live","Draft","Archived"]),te=e.z.enum(["Mobile","Desktop","All","iOS","Android"]),ne=e.z.enum(["SignedIn","SignedOut","All"]),ae=e.z.enum(["HasConsented","HasNotConsented","All"]),oe=e.z.object({name:e.z.literal("ABTest")}),re=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()}),se=e.z.intersection(e.z.discriminatedUnion("name",[oe,re,ie]),e.z.object({testName:e.z.string().optional()})),le=e.z.object({channel:X,name:e.z.string(),status:ee,priority:e.z.number(),controlProportionSettings:e.z.object({proportion:e.z.number(),offset:e.z.number()}).optional(),deviceType:te.optional(),signedInStatus:ne.optional(),consentStatus:ae.optional(),methodologies:se.array().optional()}),ue=e.z.enum(["AllExistingSupporters","AllNonSupporters","Everyone","PostAskPauseSingleContributors"]),ce=e.z.object({minViews:e.z.number(),maxViews:e.z.number().optional(),periodInWeeks:e.z.number(),tagIds:e.z.array(e.z.string()).optional()});e.z.object({userType:e.z.array(q),product:e.z.array(Q)}),e.z.object({tagIds:e.z.array(e.z.string()),sectionIds:e.z.array(e.z.string()),excludedTagIds:e.z.array(e.z.string()),excludedSectionIds:e.z.array(e.z.string())});const de=e.z.object({maxViewsCount:e.z.number(),maxViewsDays:e.z.number(),minDaysBetweenViews:e.z.number()}),pe=e.z.object({reminderCta:e.z.string(),reminderLabel:e.z.string(),reminderPeriod:e.z.string()}),ge=e.z.enum(["ONE_OFF","MONTHLY","ANNUAL"]),ze=e.z.object({testName:e.z.string(),variantName:e.z.string(),defaultContributionType:ge,displayContributionType:ge.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()})})}),me=e.z.object({newsletterId:e.z.string(),successDescription:e.z.string()}),Ce=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:k.optional(),cta:I.optional(),secondaryCta:G.optional(),newsletterSignup:me.optional(),image:j.optional(),showReminderFields:pe.optional(),separateArticleCount:f.optional(),maxViews:de.optional(),showSignInLink:e.z.boolean().optional(),bylineWithImage:H.optional(),showChoiceCards:e.z.boolean().optional(),choiceCardAmounts:ze.optional(),defaultChoiceCardFrequency:ge.optional()}),be=e.z.object({variant:Ce,tracking:K,countryCode:e.z.string().nullish(),articleCounts:O,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()}),Se=e.z.enum(["contributions","subscriptions","signIn","abandonedBasket"]),he=e.z.object({heading:e.z.string().optional(),messageText:e.z.string().optional(),paragraphs:e.z.array(e.z.string()).optional(),mobileMessageText:e.z.string().optional(),highlightedText:e.z.string().optional(),cta:I.optional(),secondaryCta:G.optional()}),ye=e.z.object({tracking:K,bannerChannel:Se,content:he.nullish(),mobileContent:he.nullish(),countryCode:e.z.string().nullish(),isSupporter:e.z.boolean().nullish(),tickerSettings:k.nullish(),submitComponentEvent:e.z.any(),articleCounts:O,hasOptedOutOfArticleCount:e.z.boolean().nullish(),fetchEmail:e.z.any().nullish(),separateArticleCount:e.z.boolean().nullish(),design:J.nullish()}),Ae=e.z.object({heading:e.z.string(),subheading:e.z.string(),primaryCta:I.optional(),secondaryCta:I.optional(),benefits:e.z.array(e.z.string()).optional()}),Te=e.z.object({content:Ae,tracking:K,mobileContent:Ae.optional(),countryCode:e.z.string().optional(),submitComponentEvent:e.z.any(),numArticles:e.z.number().optional()}),Ie=e.z.object({image:j,bodyCopy:e.z.array(e.z.string()),cta:I.optional()});e.z.object({content:Ie,tracking:K,countryCode:e.z.string().optional(),submitComponentEvent:e.z.any()});const Ne=e.z.object({maxViewsCount:e.z.number(),maxViewsDays:e.z.number(),minDaysBetweenViews:e.z.number()});le.extend({name:e.z.string(),status:ee,locations:e.z.array(l),tagIds:e.z.array(e.z.string()),sections:e.z.array(e.z.string()),excludedTagIds:e.z.array(e.z.string()),excludedSections:e.z.array(e.z.string()),alwaysAsk:e.z.boolean(),maxViews:Ne.optional(),userCohort:ue,hasCountryName:e.z.boolean(),highPriority:e.z.boolean(),useLocalViewLog:e.z.boolean(),articlesViewedSettings:ce.optional(),priority:e.z.number(),variants:Ce.array()});const Me=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")])}),Ee=(e,t,n)=>{const a=(e=>{if(URLSearchParams){const t=new URLSearchParams(window.location.search).get(`force-${e}`);if(t)return t}return null})(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=s,exports.SecondaryCtaType=N,exports.TickerCountType=B,exports.TickerEndType=U,exports.abandonedBasketSchema=Me,exports.addRegionIdToSupportUrl=(e,t)=>{if(t){const n=(e=>u[p(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=ye,exports.buildReminderFields=y,exports.containsNonArticleCountPlaceholder=e=>{const t=e.match(S)?.filter((e=>"%%ARTICLE_COUNT%%"!==e));return!!t&&t.length>0},exports.contributionTabFrequencies=["ONE_OFF","MONTHLY","ANNUAL"],exports.countryCodeToCountryGroupId=p,exports.countryGroupIdSchema=l,exports.epicPropsSchema=be,exports.getBanner=(e,t)=>Ee("banner",e,t),exports.getCountryName=z,exports.getEpic=(e,t)=>Ee("epic",e,t),exports.getEpicViewLog=e=>e.get(t)||void 0,exports.getGutterLiveblog=(e,t)=>Ee("gutter-liveblog",e,t),exports.getHeader=(e,t)=>Ee("header",e,t),exports.getLiveblogEpic=(e,t)=>Ee("liveblog-epic",e,t),exports.getLocalCurrencySymbol=g,exports.getReminderFields=(e,t=new Date)=>{return"US"===e&&T(t)?{reminderCta:"Remind me on Giving Tuesday",reminderPeriod:`${n=t.getFullYear()}-${(h(n).getMonth()+1).toString().padStart(0,"2")}-01`,reminderLabel:"on Giving Tuesday",reminderOption:`giving-tuesday-${n}`}:"US"===e&&(e=>e>=h(e.getFullYear())&&e<A)(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()):y(t);var n},exports.getWeeklyArticleHistory=e=>e.get(n)||void 0,exports.headerPropsSchema=Te,exports.hexColourToString=e=>`#${e.r}${e.g}${e.b}`,exports.inCountryGroups=(e,t=[])=>0===t.length||!!e&&t.includes(p(e.toUpperCase())),exports.incrementWeeklyArticleCount=(e,t,r)=>{const s=((e,t)=>{const n=o(new Date),r=e.get(a);if(r&&r.week===n){const o=r.articles[t]||0;return e.set(a,{week:n,articles:{...r.articles,[t]:o+1}}),o>0}return e.set(a,{week:n,articles:{[t]:1}}),!1})(e,t);if(!s){const t=o(new Date),a=e.get(n)||[],s=a[0];if(s&&s.week&&s.week===t)s.count+=1,s.tags=i(r,s.tags),e.set(n,a);else{a.unshift({week:t,count:1,tags:i(r,{})});const o=t-365,s=a.filter((e=>e.week>=o));e.set(n,s)}}},exports.isGWCheckoutUrl=m,exports.logEpicView=e=>{const n=localStorage.getItem(t),a=n?JSON.parse(n).value:[];a.push({date:(new Date).getTime(),testId:e});const o={value:a.slice(-50)};localStorage.setItem(t,JSON.stringify(o))},exports.replaceNonArticleCountPlaceholders=(e,t,n)=>e?e.replace(S,(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})):"";
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("zod");const t="gu.contributions.views",n="gu.history.weeklyArticleCount",a="gu.history.articleCountsThisWeek",o=e=>{const t=e.getDay()||7;return Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()-(t-1))/864e5},r=new Set(["environment/climate-change","environment/climate-crisis","environment/environment","science/science","politics/politics","us-news/us-politics","australia-news/australian-politics","world/world","world/europe-news","world/russia","books/books","culture/culture","world/coronavirus-outbreak","world/race","inequality/inequality","technology/technology","business/business","tone/recipes","sport/sport","football/football","sport/olympic-games","sport/olympic-games-2024","tracking/commissioningdesk/uk-investigations"]),i=(e,t={})=>(e.forEach((e=>{r.has(e)&&(t[e]=(t[e]??0)+1)})),t),s=["GBPCountries","UnitedStates","AUDCountries","EURCountries","International","NZDCountries","Canada"],l=e.z.enum(s),u=e.z.object({targetedCountryGroups:e.z.array(l),targetedCountryCodes:e.z.array(e.z.string()).optional()}).optional(),c={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"}},d={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:"$"},g=e=>Object.keys(c).find((t=>c[t].countries.includes(e??"")))||"International",z=e=>{if(e){const t=g(e);return p[t]}return"£"},m=e=>{if(e)return d[e]},C=e=>/subscribe\/weekly\/checkout/.test(e),b=(e,t,n,a)=>{if(a){const o=a[g(n)];if(o){return`${z(n)}${o[e][t].price}`}}},S={CURRENCY_SYMBOL:({countryCode:e})=>z(e),COUNTRY_NAME:({countryCode:e})=>m(e),PRICE_DIGISUB_MONTHLY:({countryCode:e,prices:t})=>b("Digisub","Monthly",e,t),PRICE_DIGISUB_ANNUAL:({countryCode:e,prices:t})=>b("Digisub","Annual",e,t),PRICE_GUARDIANWEEKLY_MONTHLY:({countryCode:e,prices:t})=>b("GuardianWeekly","Monthly",e,t),PRICE_GUARDIANWEEKLY_ANNUAL:({countryCode:e,prices:t})=>b("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,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]);let R=function(e){return e.unlimited="unlimited",e.hardstop="hardstop",e}({});const B=e.z.nativeEnum(R);let P=function(e){return e.money="money",e}({});const L=e.z.nativeEnum(P),D=e.z.object({countLabel:e.z.string(),goalReachedPrimary:e.z.string().optional(),goalReachedSecondary:e.z.string().optional()}),w=e.z.object({total:e.z.number(),goal:e.z.number()}),k=e.z.enum(["US","AU"]),O=e.z.object({endType:B,countType:L,currencySymbol:e.z.string(),copy:D,name:k,tickerData:w.optional()}),x=e.z.object({for52Weeks:e.z.number(),forTargetedWeeks:e.z.number()}),f=e.z.enum(["for52Weeks","forTargetedWeeks"]),v=e.z.object({type:e.z.literal("above"),copy:e.z.string().optional(),countType:f.optional()}),F=e.z.enum(["CONTRIBUTION","MEMBERSHIP_SUPPORTER","DIGITAL_SUBSCRIPTION","PRINT_SUBSCRIPTION"]),K=e.z.enum(["ACQUISITIONS_EPIC","ACQUISITIONS_ENGAGEMENT_BANNER","ACQUISITIONS_SUBSCRIPTIONS_BANNER","ACQUISITIONS_HEADER","ACQUISITIONS_OTHER"]),j=e.z.object({abTestName:e.z.string(),abTestVariant:e.z.string(),campaignCode:e.z.string(),componentType:K,products:e.z.array(F).nullish(),labels:e.z.array(e.z.string()).nullish(),ophanPageId:e.z.string(),platformId:e.z.string(),referrerUrl:e.z.string()}),H=e.z.object({mainUrl:e.z.string(),mobileUrl:e.z.string().optional(),tabletUrl:e.z.string().optional(),desktopUrl:e.z.string().optional(),leftColUrl:e.z.string().optional(),wideUrl:e.z.string().optional(),altText:e.z.string()}),V=e.z.object({name:e.z.string(),description:e.z.string().optional(),headshot:H.optional()}),Y=/^[0-9A-F]{2}$/,W=e.z.string().refine((e=>Y.test(e)),(e=>({message:`"${e}" is not a valid hex value`}))),Z=e.z.object({r:W,g:W,b:W,kind:e.z.literal("hex")}),$=e.z.object({mobileUrl:e.z.string(),tabletUrl:e.z.string(),desktopUrl:e.z.string(),altText:e.z.string(),kind:e.z.literal("Image")}),_=e.z.object({buttonColour:Z.nullish(),buttonTextColour:Z.nullish(),buttonBorderColour:Z.nullish(),buttonSelectColour:Z.nullish(),buttonSelectTextColour:Z.nullish(),buttonSelectBorderColour:Z.nullish(),kind:e.z.literal("ChoiceCards")}),J=e.z.discriminatedUnion("kind",[$,_]),Q=e.z.object({visual:J.nullish(),colours:e.z.object({basic:e.z.object({background:Z,bodyText:Z})})}),q=e.z.enum(["Contribution","SupporterPlus","GuardianWeekly","Paper"]),X=e.z.enum(["new","guest","current"]),ee=e.z.enum(["Epic","EpicAMP","EpicAppleNews","EpicLiveblog","Banner1","Banner2","Header","GutterLiveblog"]),te=e.z.enum(["Live","Draft","Archived"]),ne=e.z.enum(["Mobile","Desktop","All","iOS","Android"]),ae=e.z.enum(["SignedIn","SignedOut","All"]),oe=e.z.enum(["HasConsented","HasNotConsented","All"]),re=e.z.object({name:e.z.literal("ABTest")}),ie=e.z.object({name:e.z.literal("EpsilonGreedyBandit"),epsilon:e.z.number(),sampleCount:e.z.number().optional()}),se=e.z.object({name:e.z.literal("Roulette"),sampleCount:e.z.number().optional()}),le=e.z.intersection(e.z.discriminatedUnion("name",[re,ie,se]),e.z.object({testName:e.z.string().optional()})),ue=e.z.object({channel:ee,name:e.z.string(),status:te,priority:e.z.number(),controlProportionSettings:e.z.object({proportion:e.z.number(),offset:e.z.number()}).optional(),deviceType:ne.optional(),signedInStatus:ae.optional(),consentStatus:oe.optional(),methodologies:le.array().optional()}),ce=e.z.enum(["AllExistingSupporters","AllNonSupporters","Everyone","PostAskPauseSingleContributors"]),de=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(X),product:e.z.array(q)}),e.z.object({tagIds:e.z.array(e.z.string()),sectionIds:e.z.array(e.z.string()),excludedTagIds:e.z.array(e.z.string()),excludedSectionIds:e.z.array(e.z.string())});const pe=e.z.object({maxViewsCount:e.z.number(),maxViewsDays:e.z.number(),minDaysBetweenViews:e.z.number()}),ge=e.z.object({reminderCta:e.z.string(),reminderLabel:e.z.string(),reminderPeriod:e.z.string()}),ze=e.z.enum(["ONE_OFF","MONTHLY","ANNUAL"]),me=e.z.object({testName:e.z.string(),variantName:e.z.string(),defaultContributionType:ze,displayContributionType:ze.array(),amountsCardData:e.z.object({ONE_OFF:e.z.object({amounts:e.z.array(e.z.number()),defaultAmount:e.z.number(),hideChooseYourAmount:e.z.boolean().optional()}),MONTHLY:e.z.object({amounts:e.z.array(e.z.number()),defaultAmount:e.z.number(),hideChooseYourAmount:e.z.boolean().optional()}),ANNUAL:e.z.object({amounts:e.z.array(e.z.number()),defaultAmount:e.z.number(),hideChooseYourAmount:e.z.boolean().optional()})})}),Ce=e.z.object({newsletterId:e.z.string(),successDescription:e.z.string()}),be=e.z.object({name:e.z.string(),heading:e.z.string().optional(),paragraphs:e.z.array(e.z.string()),highlightedText:e.z.string().optional(),tickerSettings:O.optional(),cta:N.optional(),secondaryCta:U.optional(),newsletterSignup:Ce.optional(),image:H.optional(),showReminderFields:ge.optional(),separateArticleCount:v.optional(),maxViews:pe.optional(),showSignInLink:e.z.boolean().optional(),bylineWithImage:V.optional(),showChoiceCards:e.z.boolean().optional(),choiceCardAmounts:me.optional(),defaultChoiceCardFrequency:ze.optional()}),Se=e.z.object({variant:be,tracking:j,countryCode:e.z.string().nullish(),articleCounts:x,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()}),he=e.z.enum(["contributions","subscriptions","signIn","abandonedBasket"]),ye=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()}),Ae=e.z.object({tracking:j,bannerChannel:he,content:ye.nullish(),mobileContent:ye.nullish(),countryCode:e.z.string().nullish(),isSupporter:e.z.boolean().nullish(),tickerSettings:O.nullish(),submitComponentEvent:e.z.any(),articleCounts:x,hasOptedOutOfArticleCount:e.z.boolean().nullish(),fetchEmail:e.z.any().nullish(),separateArticleCount:e.z.boolean().nullish(),design:Q.nullish()}),Te=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()}),Ie=e.z.object({content:Te,tracking:j,mobileContent:Te.optional(),countryCode:e.z.string().optional(),submitComponentEvent:e.z.any(),numArticles:e.z.number().optional()}),Ne=e.z.object({image:H,bodyCopy:e.z.array(e.z.string()),cta:N.optional()});e.z.object({content:Ne,tracking:j,countryCode:e.z.string().optional(),submitComponentEvent:e.z.any()});const Me=e.z.object({maxViewsCount:e.z.number(),maxViewsDays:e.z.number(),minDaysBetweenViews:e.z.number()});ue.extend({name:e.z.string(),status:te,locations:e.z.array(l).optional(),regionTargeting:u.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:Me.optional(),userCohort:ce,hasCountryName:e.z.boolean(),highPriority:e.z.boolean(),useLocalViewLog:e.z.boolean(),articlesViewedSettings:de.optional(),priority:e.z.number(),variants:be.array()});const Ee=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")])}),Ge=(e,t,n)=>{const a=(e=>{if(URLSearchParams){const t=new URLSearchParams(window.location.search).get(`force-${e}`);if(t)return t}return null})(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=s,exports.SecondaryCtaType=M,exports.TickerCountType=P,exports.TickerEndType=R,exports.abandonedBasketSchema=Ee,exports.addRegionIdToSupportUrl=(e,t)=>{if(t){const n=(e=>c[g(e)]?.supportRegionId)(t);if(n&&!C(e))return e.replace(/(support\.theguardian\.com)\/(contribute-in-epic|contribute|subscribe|checkout)/,((e,t,a)=>`${t}/${n.toLowerCase()}/${a}`))}return e},exports.bannerSchema=Ae,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=g,exports.countryGroupIdSchema=l,exports.epicPropsSchema=Se,exports.getBanner=(e,t)=>Ge("banner",e,t),exports.getCountryName=m,exports.getEpic=(e,t)=>Ge("epic",e,t),exports.getEpicViewLog=e=>e.get(t)||void 0,exports.getGutterLiveblog=(e,t)=>Ge("gutter-liveblog",e,t),exports.getHeader=(e,t)=>Ge("header",e,t),exports.getLiveblogEpic=(e,t)=>Ge("liveblog-epic",e,t),exports.getLocalCurrencySymbol=z,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(n)||void 0,exports.headerPropsSchema=Ie,exports.hexColourToString=e=>`#${e.r}${e.g}${e.b}`,exports.inTargetedCountry=(e,t=[],n=[])=>0===t.length&&0===n.length||!!e&&(!!t.includes(g(e.toUpperCase()))||n.includes(e.toUpperCase())),exports.incrementWeeklyArticleCount=(e,t,r)=>{const s=((e,t)=>{const n=o(new Date),r=e.get(a);if(r&&r.week===n){const o=r.articles[t]||0;return e.set(a,{week:n,articles:{...r.articles,[t]:o+1}}),o>0}return e.set(a,{week:n,articles:{[t]:1}}),!1})(e,t);if(!s){const t=o(new Date),a=e.get(n)||[],s=a[0];if(s&&s.week&&s.week===t)s.count+=1,s.tags=i(r,s.tags),e.set(n,a);else{a.unshift({week:t,count:1,tags:i(r,{})});const o=t-365,s=a.filter((e=>e.week>=o));e.set(n,s)}}},exports.isGWCheckoutUrl=C,exports.logEpicView=e=>{const n=localStorage.getItem(t),a=n?JSON.parse(n).value:[];a.push({date:(new Date).getTime(),testId:e});const o={value:a.slice(-50)};localStorage.setItem(t,JSON.stringify(o))},exports.replaceNonArticleCountPlaceholders=(e,t,n)=>e?e.replace(h,(e=>{const a=e.substring(2,e.length-2),o=S[a];if(o){const e=o({countryCode:t,prices:n});if(e)return e}return e})):"",exports.targetedRegionsSchema=u;
|
|
@@ -2,6 +2,16 @@ import { z } from 'zod';
|
|
|
2
2
|
export declare const CountryGroupId: readonly ["GBPCountries", "UnitedStates", "AUDCountries", "EURCountries", "International", "NZDCountries", "Canada"];
|
|
3
3
|
export type CountryGroupId = (typeof CountryGroupId)[number];
|
|
4
4
|
export declare const countryGroupIdSchema: z.ZodEnum<["GBPCountries", "UnitedStates", "AUDCountries", "EURCountries", "International", "NZDCountries", "Canada"]>;
|
|
5
|
+
export declare const targetedRegionsSchema: z.ZodOptional<z.ZodObject<{
|
|
6
|
+
targetedCountryGroups: z.ZodArray<z.ZodEnum<["GBPCountries", "UnitedStates", "AUDCountries", "EURCountries", "International", "NZDCountries", "Canada"]>, "many">;
|
|
7
|
+
targetedCountryCodes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
targetedCountryGroups: ("GBPCountries" | "UnitedStates" | "AUDCountries" | "EURCountries" | "International" | "NZDCountries" | "Canada")[];
|
|
10
|
+
targetedCountryCodes?: string[] | undefined;
|
|
11
|
+
}, {
|
|
12
|
+
targetedCountryGroups: ("GBPCountries" | "UnitedStates" | "AUDCountries" | "EURCountries" | "International" | "NZDCountries" | "Canada")[];
|
|
13
|
+
targetedCountryCodes?: string[] | undefined;
|
|
14
|
+
}>>;
|
|
5
15
|
export type SupportRegionId = 'UK' | 'US' | 'AU' | 'EU' | 'INT' | 'NZ' | 'CA';
|
|
6
16
|
type IsoCurrency = 'GBP' | 'USD' | 'AUD' | 'EUR' | 'NZD' | 'CAD';
|
|
7
17
|
type CountryGroup = {
|
|
@@ -14,7 +24,7 @@ type CountryGroups = Record<CountryGroupId, CountryGroup>;
|
|
|
14
24
|
declare const countryGroups: CountryGroups;
|
|
15
25
|
export type Region = keyof typeof countryGroups;
|
|
16
26
|
export declare const countryCodeToCountryGroupId: (countryCode?: string) => CountryGroupId;
|
|
17
|
-
export declare const
|
|
27
|
+
export declare const inTargetedCountry: (countryCodeFromPayload?: string, countryGroups?: CountryGroupId[], countryCodes?: string[]) => boolean;
|
|
18
28
|
export declare const getLocalCurrencySymbol: (geolocation?: string) => string;
|
|
19
29
|
export declare const getCountryName: (geolocation?: string) => string | undefined;
|
|
20
30
|
export declare const isGWCheckoutUrl: (baseUrl: string) => boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geolocation.d.ts","sourceRoot":"","sources":["../../../src/shared/lib/geolocation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,cAAc,sHAQjB,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7D,eAAO,MAAM,oBAAoB,wHAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"geolocation.d.ts","sourceRoot":"","sources":["../../../src/shared/lib/geolocation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,cAAc,sHAQjB,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7D,eAAO,MAAM,oBAAoB,wHAAyB,CAAC;AAE3D,eAAO,MAAM,qBAAqB;;;;;;;;;GAKnB,CAAC;AAGhB,MAAM,MAAM,eAAe,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG,IAAI,GAAG,IAAI,CAAC;AAE9E,KAAK,WAAW,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;AAEjE,KAAK,YAAY,GAAG;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,WAAW,CAAC;IACtB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,eAAe,EAAE,eAAe,CAAC;CACpC,CAAC;AAEF,KAAK,aAAa,GAAG,MAAM,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC;AAE1D,QAAA,MAAM,aAAa,EAAE,aAsRpB,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG,MAAM,OAAO,aAAa,CAAC;AAsPhD,eAAO,MAAM,2BAA2B,iBAAkB,MAAM,KAAG,cAOlE,CAAC;AAEF,eAAO,MAAM,iBAAiB,4BACD,MAAM,kBAChB,cAAc,EAAE,iBACjB,MAAM,EAAE,KACvB,OAiBF,CAAC;AAQF,eAAO,MAAM,sBAAsB,iBAAkB,MAAM,KAAG,MAO7D,CAAC;AAEF,eAAO,MAAM,cAAc,iBAAkB,MAAM,KAAG,MAAM,GAAG,SAM9D,CAAC;AAKF,eAAO,MAAM,eAAe,YAAa,MAAM,KAAG,OACH,CAAC;AAEhD,eAAO,MAAM,uBAAuB,gBAAiB,MAAM,gBAAgB,MAAM,KAAG,MAYnF,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BannerChannel, ConfigurableDesign } from '../props';
|
|
2
2
|
import { TargetingAbTest } from './shared';
|
|
3
|
-
import { BannerTargeting
|
|
3
|
+
import { BannerTargeting } from '../targeting';
|
|
4
4
|
import { PurchaseInfoTest } from './shared';
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
import { OphanComponentType, OphanProduct } from '@guardian/libs';
|
|
@@ -416,7 +416,7 @@ export interface BannerVariant extends BannerVariantFromTool {
|
|
|
416
416
|
componentType: OphanComponentType;
|
|
417
417
|
products?: OphanProduct[];
|
|
418
418
|
}
|
|
419
|
-
export type CanRun = (targeting: BannerTargeting
|
|
419
|
+
export type CanRun = (targeting: BannerTargeting) => boolean;
|
|
420
420
|
export type BannerTestGenerator = () => Promise<BannerTest[]>;
|
|
421
421
|
export interface BannerTestSelection {
|
|
422
422
|
test: BannerTest;
|
|
@@ -484,7 +484,17 @@ export declare const bannerTestFromToolSchema: z.ZodObject<{
|
|
|
484
484
|
testName?: string | undefined;
|
|
485
485
|
}>>, "many">>;
|
|
486
486
|
userCohort: z.ZodEnum<["AllExistingSupporters", "AllNonSupporters", "Everyone", "PostAskPauseSingleContributors"]>;
|
|
487
|
-
locations: z.ZodArray<z.ZodEnum<["GBPCountries", "UnitedStates", "AUDCountries", "EURCountries", "International", "NZDCountries", "Canada"]>, "many"
|
|
487
|
+
locations: z.ZodOptional<z.ZodArray<z.ZodEnum<["GBPCountries", "UnitedStates", "AUDCountries", "EURCountries", "International", "NZDCountries", "Canada"]>, "many">>;
|
|
488
|
+
regionTargeting: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
489
|
+
targetedCountryGroups: z.ZodArray<z.ZodEnum<["GBPCountries", "UnitedStates", "AUDCountries", "EURCountries", "International", "NZDCountries", "Canada"]>, "many">;
|
|
490
|
+
targetedCountryCodes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
491
|
+
}, "strip", z.ZodTypeAny, {
|
|
492
|
+
targetedCountryGroups: ("GBPCountries" | "UnitedStates" | "AUDCountries" | "EURCountries" | "International" | "NZDCountries" | "Canada")[];
|
|
493
|
+
targetedCountryCodes?: string[] | undefined;
|
|
494
|
+
}, {
|
|
495
|
+
targetedCountryGroups: ("GBPCountries" | "UnitedStates" | "AUDCountries" | "EURCountries" | "International" | "NZDCountries" | "Canada")[];
|
|
496
|
+
targetedCountryCodes?: string[] | undefined;
|
|
497
|
+
}>>>;
|
|
488
498
|
contextTargeting: z.ZodObject<{
|
|
489
499
|
tagIds: z.ZodArray<z.ZodString, "many">;
|
|
490
500
|
sectionIds: z.ZodArray<z.ZodString, "many">;
|
|
@@ -918,7 +928,6 @@ export declare const bannerTestFromToolSchema: z.ZodObject<{
|
|
|
918
928
|
priority: number;
|
|
919
929
|
name: string;
|
|
920
930
|
status: "Live" | "Draft" | "Archived";
|
|
921
|
-
locations: ("GBPCountries" | "UnitedStates" | "AUDCountries" | "EURCountries" | "International" | "NZDCountries" | "Canada")[];
|
|
922
931
|
userCohort: "AllExistingSupporters" | "AllNonSupporters" | "Everyone" | "PostAskPauseSingleContributors";
|
|
923
932
|
variants: {
|
|
924
933
|
name: string;
|
|
@@ -1014,6 +1023,11 @@ export declare const bannerTestFromToolSchema: z.ZodObject<{
|
|
|
1014
1023
|
}) & {
|
|
1015
1024
|
testName?: string | undefined;
|
|
1016
1025
|
})[] | undefined;
|
|
1026
|
+
locations?: ("GBPCountries" | "UnitedStates" | "AUDCountries" | "EURCountries" | "International" | "NZDCountries" | "Canada")[] | undefined;
|
|
1027
|
+
regionTargeting?: {
|
|
1028
|
+
targetedCountryGroups: ("GBPCountries" | "UnitedStates" | "AUDCountries" | "EURCountries" | "International" | "NZDCountries" | "Canada")[];
|
|
1029
|
+
targetedCountryCodes?: string[] | undefined;
|
|
1030
|
+
} | undefined;
|
|
1017
1031
|
articlesViewedSettings?: {
|
|
1018
1032
|
minViews: number;
|
|
1019
1033
|
periodInWeeks: number;
|
|
@@ -1028,7 +1042,6 @@ export declare const bannerTestFromToolSchema: z.ZodObject<{
|
|
|
1028
1042
|
priority: number;
|
|
1029
1043
|
name: string;
|
|
1030
1044
|
status: "Live" | "Draft" | "Archived";
|
|
1031
|
-
locations: ("GBPCountries" | "UnitedStates" | "AUDCountries" | "EURCountries" | "International" | "NZDCountries" | "Canada")[];
|
|
1032
1045
|
userCohort: "AllExistingSupporters" | "AllNonSupporters" | "Everyone" | "PostAskPauseSingleContributors";
|
|
1033
1046
|
variants: {
|
|
1034
1047
|
name: string;
|
|
@@ -1124,6 +1137,11 @@ export declare const bannerTestFromToolSchema: z.ZodObject<{
|
|
|
1124
1137
|
}) & {
|
|
1125
1138
|
testName?: string | undefined;
|
|
1126
1139
|
})[] | undefined;
|
|
1140
|
+
locations?: ("GBPCountries" | "UnitedStates" | "AUDCountries" | "EURCountries" | "International" | "NZDCountries" | "Canada")[] | undefined;
|
|
1141
|
+
regionTargeting?: {
|
|
1142
|
+
targetedCountryGroups: ("GBPCountries" | "UnitedStates" | "AUDCountries" | "EURCountries" | "International" | "NZDCountries" | "Canada")[];
|
|
1143
|
+
targetedCountryCodes?: string[] | undefined;
|
|
1144
|
+
} | undefined;
|
|
1127
1145
|
articlesViewedSettings?: {
|
|
1128
1146
|
minViews: number;
|
|
1129
1147
|
periodInWeeks: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banner.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/abTests/banner.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,aAAa,EAEb,kBAAkB,EAGrB,MAAM,UAAU,CAAC;AAClB,OAAO,EAGH,eAAe,EAGlB,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,eAAe,EAAE,
|
|
1
|
+
{"version":3,"file":"banner.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/abTests/banner.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,aAAa,EAEb,kBAAkB,EAGrB,MAAM,UAAU,CAAC;AAClB,OAAO,EAGH,eAAe,EAGlB,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAElE;;;;;;;;;GASG;AAEH,oBAAY,cAAc;IACtB,kBAAkB,uBAAuB;CAC5C;AAED,MAAM,WAAW,gBAAgB;IAC7B,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,KAAK,QAAQ,GAAG,cAAc,GAAG,gBAAgB,CAAC;AAElD,wBAAgB,UAAU,CAAC,EAAE,EAAE,QAAQ,GAAG,EAAE,IAAI,gBAAgB,CAE/D;AAED,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYnC,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E,MAAM,MAAM,oBAAoB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,kBAAkB,CAAC"}
|
|
@@ -120,7 +120,17 @@ export declare const epicTestFromToolSchema: z.ZodObject<{
|
|
|
120
120
|
}>>, "many">>;
|
|
121
121
|
name: z.ZodString;
|
|
122
122
|
status: z.ZodEnum<["Live", "Draft", "Archived"]>;
|
|
123
|
-
locations: z.ZodArray<z.ZodEnum<["GBPCountries", "UnitedStates", "AUDCountries", "EURCountries", "International", "NZDCountries", "Canada"]>, "many"
|
|
123
|
+
locations: z.ZodOptional<z.ZodArray<z.ZodEnum<["GBPCountries", "UnitedStates", "AUDCountries", "EURCountries", "International", "NZDCountries", "Canada"]>, "many">>;
|
|
124
|
+
regionTargeting: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
125
|
+
targetedCountryGroups: z.ZodArray<z.ZodEnum<["GBPCountries", "UnitedStates", "AUDCountries", "EURCountries", "International", "NZDCountries", "Canada"]>, "many">;
|
|
126
|
+
targetedCountryCodes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
127
|
+
}, "strip", z.ZodTypeAny, {
|
|
128
|
+
targetedCountryGroups: ("GBPCountries" | "UnitedStates" | "AUDCountries" | "EURCountries" | "International" | "NZDCountries" | "Canada")[];
|
|
129
|
+
targetedCountryCodes?: string[] | undefined;
|
|
130
|
+
}, {
|
|
131
|
+
targetedCountryGroups: ("GBPCountries" | "UnitedStates" | "AUDCountries" | "EURCountries" | "International" | "NZDCountries" | "Canada")[];
|
|
132
|
+
targetedCountryCodes?: string[] | undefined;
|
|
133
|
+
}>>>;
|
|
124
134
|
tagIds: z.ZodArray<z.ZodString, "many">;
|
|
125
135
|
sections: z.ZodArray<z.ZodString, "many">;
|
|
126
136
|
excludedTagIds: z.ZodArray<z.ZodString, "many">;
|
|
@@ -724,7 +734,6 @@ export declare const epicTestFromToolSchema: z.ZodObject<{
|
|
|
724
734
|
status: "Live" | "Draft" | "Archived";
|
|
725
735
|
tagIds: string[];
|
|
726
736
|
excludedTagIds: string[];
|
|
727
|
-
locations: ("GBPCountries" | "UnitedStates" | "AUDCountries" | "EURCountries" | "International" | "NZDCountries" | "Canada")[];
|
|
728
737
|
sections: string[];
|
|
729
738
|
excludedSections: string[];
|
|
730
739
|
alwaysAsk: boolean;
|
|
@@ -852,6 +861,11 @@ export declare const epicTestFromToolSchema: z.ZodObject<{
|
|
|
852
861
|
}) & {
|
|
853
862
|
testName?: string | undefined;
|
|
854
863
|
})[] | undefined;
|
|
864
|
+
locations?: ("GBPCountries" | "UnitedStates" | "AUDCountries" | "EURCountries" | "International" | "NZDCountries" | "Canada")[] | undefined;
|
|
865
|
+
regionTargeting?: {
|
|
866
|
+
targetedCountryGroups: ("GBPCountries" | "UnitedStates" | "AUDCountries" | "EURCountries" | "International" | "NZDCountries" | "Canada")[];
|
|
867
|
+
targetedCountryCodes?: string[] | undefined;
|
|
868
|
+
} | undefined;
|
|
855
869
|
maxViews?: {
|
|
856
870
|
maxViewsCount: number;
|
|
857
871
|
maxViewsDays: number;
|
|
@@ -870,7 +884,6 @@ export declare const epicTestFromToolSchema: z.ZodObject<{
|
|
|
870
884
|
status: "Live" | "Draft" | "Archived";
|
|
871
885
|
tagIds: string[];
|
|
872
886
|
excludedTagIds: string[];
|
|
873
|
-
locations: ("GBPCountries" | "UnitedStates" | "AUDCountries" | "EURCountries" | "International" | "NZDCountries" | "Canada")[];
|
|
874
887
|
sections: string[];
|
|
875
888
|
excludedSections: string[];
|
|
876
889
|
alwaysAsk: boolean;
|
|
@@ -998,6 +1011,11 @@ export declare const epicTestFromToolSchema: z.ZodObject<{
|
|
|
998
1011
|
}) & {
|
|
999
1012
|
testName?: string | undefined;
|
|
1000
1013
|
})[] | undefined;
|
|
1014
|
+
locations?: ("GBPCountries" | "UnitedStates" | "AUDCountries" | "EURCountries" | "International" | "NZDCountries" | "Canada")[] | undefined;
|
|
1015
|
+
regionTargeting?: {
|
|
1016
|
+
targetedCountryGroups: ("GBPCountries" | "UnitedStates" | "AUDCountries" | "EURCountries" | "International" | "NZDCountries" | "Canada")[];
|
|
1017
|
+
targetedCountryCodes?: string[] | undefined;
|
|
1018
|
+
} | undefined;
|
|
1001
1019
|
maxViews?: {
|
|
1002
1020
|
maxViewsCount: number;
|
|
1003
1021
|
maxViewsDays: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"epic.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/abTests/epic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"epic.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/abTests/epic.ts"],"names":[],"mappings":"AAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkBjC,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC"}
|
|
@@ -162,7 +162,17 @@ export declare const gutterTestFromToolSchema: z.ZodObject<{
|
|
|
162
162
|
}, {
|
|
163
163
|
testName?: string | undefined;
|
|
164
164
|
}>>, "many">>;
|
|
165
|
-
locations: z.ZodArray<z.ZodEnum<["GBPCountries", "UnitedStates", "AUDCountries", "EURCountries", "International", "NZDCountries", "Canada"]>, "many"
|
|
165
|
+
locations: z.ZodOptional<z.ZodArray<z.ZodEnum<["GBPCountries", "UnitedStates", "AUDCountries", "EURCountries", "International", "NZDCountries", "Canada"]>, "many">>;
|
|
166
|
+
regionTargeting: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
167
|
+
targetedCountryGroups: z.ZodArray<z.ZodEnum<["GBPCountries", "UnitedStates", "AUDCountries", "EURCountries", "International", "NZDCountries", "Canada"]>, "many">;
|
|
168
|
+
targetedCountryCodes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
169
|
+
}, "strip", z.ZodTypeAny, {
|
|
170
|
+
targetedCountryGroups: ("GBPCountries" | "UnitedStates" | "AUDCountries" | "EURCountries" | "International" | "NZDCountries" | "Canada")[];
|
|
171
|
+
targetedCountryCodes?: string[] | undefined;
|
|
172
|
+
}, {
|
|
173
|
+
targetedCountryGroups: ("GBPCountries" | "UnitedStates" | "AUDCountries" | "EURCountries" | "International" | "NZDCountries" | "Canada")[];
|
|
174
|
+
targetedCountryCodes?: string[] | undefined;
|
|
175
|
+
}>>>;
|
|
166
176
|
userCohort: z.ZodEnum<["AllExistingSupporters", "AllNonSupporters", "Everyone", "PostAskPauseSingleContributors"]>;
|
|
167
177
|
contextTargeting: z.ZodObject<{
|
|
168
178
|
tagIds: z.ZodArray<z.ZodString, "many">;
|
|
@@ -292,7 +302,6 @@ export declare const gutterTestFromToolSchema: z.ZodObject<{
|
|
|
292
302
|
priority: number;
|
|
293
303
|
name: string;
|
|
294
304
|
status: "Live" | "Draft" | "Archived";
|
|
295
|
-
locations: ("GBPCountries" | "UnitedStates" | "AUDCountries" | "EURCountries" | "International" | "NZDCountries" | "Canada")[];
|
|
296
305
|
userCohort: "AllExistingSupporters" | "AllNonSupporters" | "Everyone" | "PostAskPauseSingleContributors";
|
|
297
306
|
variants: {
|
|
298
307
|
name: string;
|
|
@@ -338,12 +347,16 @@ export declare const gutterTestFromToolSchema: z.ZodObject<{
|
|
|
338
347
|
}) & {
|
|
339
348
|
testName?: string | undefined;
|
|
340
349
|
})[] | undefined;
|
|
350
|
+
locations?: ("GBPCountries" | "UnitedStates" | "AUDCountries" | "EURCountries" | "International" | "NZDCountries" | "Canada")[] | undefined;
|
|
351
|
+
regionTargeting?: {
|
|
352
|
+
targetedCountryGroups: ("GBPCountries" | "UnitedStates" | "AUDCountries" | "EURCountries" | "International" | "NZDCountries" | "Canada")[];
|
|
353
|
+
targetedCountryCodes?: string[] | undefined;
|
|
354
|
+
} | undefined;
|
|
341
355
|
}, {
|
|
342
356
|
channel: "Epic" | "EpicAMP" | "EpicAppleNews" | "EpicLiveblog" | "Banner1" | "Banner2" | "Header" | "GutterLiveblog";
|
|
343
357
|
priority: number;
|
|
344
358
|
name: string;
|
|
345
359
|
status: "Live" | "Draft" | "Archived";
|
|
346
|
-
locations: ("GBPCountries" | "UnitedStates" | "AUDCountries" | "EURCountries" | "International" | "NZDCountries" | "Canada")[];
|
|
347
360
|
userCohort: "AllExistingSupporters" | "AllNonSupporters" | "Everyone" | "PostAskPauseSingleContributors";
|
|
348
361
|
variants: {
|
|
349
362
|
name: string;
|
|
@@ -389,6 +402,11 @@ export declare const gutterTestFromToolSchema: z.ZodObject<{
|
|
|
389
402
|
}) & {
|
|
390
403
|
testName?: string | undefined;
|
|
391
404
|
})[] | undefined;
|
|
405
|
+
locations?: ("GBPCountries" | "UnitedStates" | "AUDCountries" | "EURCountries" | "International" | "NZDCountries" | "Canada")[] | undefined;
|
|
406
|
+
regionTargeting?: {
|
|
407
|
+
targetedCountryGroups: ("GBPCountries" | "UnitedStates" | "AUDCountries" | "EURCountries" | "International" | "NZDCountries" | "Canada")[];
|
|
408
|
+
targetedCountryCodes?: string[] | undefined;
|
|
409
|
+
} | undefined;
|
|
392
410
|
}>;
|
|
393
411
|
export type GutterTestFromTool = z.infer<typeof gutterTestFromToolSchema>;
|
|
394
412
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gutter.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/abTests/gutter.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,QAAA,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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C;CAC7B;AAED,MAAM,WAAW,mBAAmB;IAChC,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,EAAE,aAAa,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;CACtB"}
|
|
@@ -212,7 +212,17 @@ export declare const headerTestFromToolSchema: z.ZodObject<{
|
|
|
212
212
|
}, {
|
|
213
213
|
testName?: string | undefined;
|
|
214
214
|
}>>, "many">>;
|
|
215
|
-
locations: z.ZodArray<z.ZodEnum<["GBPCountries", "UnitedStates", "AUDCountries", "EURCountries", "International", "NZDCountries", "Canada"]>, "many"
|
|
215
|
+
locations: z.ZodOptional<z.ZodArray<z.ZodEnum<["GBPCountries", "UnitedStates", "AUDCountries", "EURCountries", "International", "NZDCountries", "Canada"]>, "many">>;
|
|
216
|
+
regionTargeting: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
217
|
+
targetedCountryGroups: z.ZodArray<z.ZodEnum<["GBPCountries", "UnitedStates", "AUDCountries", "EURCountries", "International", "NZDCountries", "Canada"]>, "many">;
|
|
218
|
+
targetedCountryCodes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
219
|
+
}, "strip", z.ZodTypeAny, {
|
|
220
|
+
targetedCountryGroups: ("GBPCountries" | "UnitedStates" | "AUDCountries" | "EURCountries" | "International" | "NZDCountries" | "Canada")[];
|
|
221
|
+
targetedCountryCodes?: string[] | undefined;
|
|
222
|
+
}, {
|
|
223
|
+
targetedCountryGroups: ("GBPCountries" | "UnitedStates" | "AUDCountries" | "EURCountries" | "International" | "NZDCountries" | "Canada")[];
|
|
224
|
+
targetedCountryCodes?: string[] | undefined;
|
|
225
|
+
}>>>;
|
|
216
226
|
userCohort: z.ZodEnum<["AllExistingSupporters", "AllNonSupporters", "Everyone", "PostAskPauseSingleContributors"]>;
|
|
217
227
|
purchaseInfo: z.ZodOptional<z.ZodObject<{
|
|
218
228
|
userType: z.ZodArray<z.ZodEnum<["new", "guest", "current"]>, "many">;
|
|
@@ -386,7 +396,6 @@ export declare const headerTestFromToolSchema: z.ZodObject<{
|
|
|
386
396
|
priority: number;
|
|
387
397
|
name: string;
|
|
388
398
|
status: "Live" | "Draft" | "Archived";
|
|
389
|
-
locations: ("GBPCountries" | "UnitedStates" | "AUDCountries" | "EURCountries" | "International" | "NZDCountries" | "Canada")[];
|
|
390
399
|
userCohort: "AllExistingSupporters" | "AllNonSupporters" | "Everyone" | "PostAskPauseSingleContributors";
|
|
391
400
|
variants: {
|
|
392
401
|
name: string;
|
|
@@ -436,6 +445,11 @@ export declare const headerTestFromToolSchema: z.ZodObject<{
|
|
|
436
445
|
}) & {
|
|
437
446
|
testName?: string | undefined;
|
|
438
447
|
})[] | undefined;
|
|
448
|
+
locations?: ("GBPCountries" | "UnitedStates" | "AUDCountries" | "EURCountries" | "International" | "NZDCountries" | "Canada")[] | undefined;
|
|
449
|
+
regionTargeting?: {
|
|
450
|
+
targetedCountryGroups: ("GBPCountries" | "UnitedStates" | "AUDCountries" | "EURCountries" | "International" | "NZDCountries" | "Canada")[];
|
|
451
|
+
targetedCountryCodes?: string[] | undefined;
|
|
452
|
+
} | undefined;
|
|
439
453
|
purchaseInfo?: {
|
|
440
454
|
product: ("Contribution" | "SupporterPlus" | "GuardianWeekly" | "Paper")[];
|
|
441
455
|
userType: ("new" | "guest" | "current")[];
|
|
@@ -445,7 +459,6 @@ export declare const headerTestFromToolSchema: z.ZodObject<{
|
|
|
445
459
|
priority: number;
|
|
446
460
|
name: string;
|
|
447
461
|
status: "Live" | "Draft" | "Archived";
|
|
448
|
-
locations: ("GBPCountries" | "UnitedStates" | "AUDCountries" | "EURCountries" | "International" | "NZDCountries" | "Canada")[];
|
|
449
462
|
userCohort: "AllExistingSupporters" | "AllNonSupporters" | "Everyone" | "PostAskPauseSingleContributors";
|
|
450
463
|
variants: {
|
|
451
464
|
name: string;
|
|
@@ -495,6 +508,11 @@ export declare const headerTestFromToolSchema: z.ZodObject<{
|
|
|
495
508
|
}) & {
|
|
496
509
|
testName?: string | undefined;
|
|
497
510
|
})[] | undefined;
|
|
511
|
+
locations?: ("GBPCountries" | "UnitedStates" | "AUDCountries" | "EURCountries" | "International" | "NZDCountries" | "Canada")[] | undefined;
|
|
512
|
+
regionTargeting?: {
|
|
513
|
+
targetedCountryGroups: ("GBPCountries" | "UnitedStates" | "AUDCountries" | "EURCountries" | "International" | "NZDCountries" | "Canada")[];
|
|
514
|
+
targetedCountryCodes?: string[] | undefined;
|
|
515
|
+
} | undefined;
|
|
498
516
|
purchaseInfo?: {
|
|
499
517
|
product: ("Contribution" | "SupporterPlus" | "GuardianWeekly" | "Paper")[];
|
|
500
518
|
userType: ("new" | "guest" | "current")[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/abTests/header.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,QAAA,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAI/B,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF,eAAO,MAAM,wBAAwB
|
|
1
|
+
{"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/abTests/header.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,QAAA,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAI/B,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E;;GAEG;AACH,MAAM,WAAW,aAAc,SAAQ,qBAAqB;IACxD,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,UAAW,SAAQ,kBAAkB;IAClD,QAAQ,EAAE,aAAa,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,mBAAmB;IAChC,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,EAAE,aAAa,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;CACtB"}
|
|
@@ -132,7 +132,6 @@ export declare const bannerSchema: z.ZodObject<{
|
|
|
132
132
|
ophanPageId: z.ZodString;
|
|
133
133
|
platformId: z.ZodString;
|
|
134
134
|
referrerUrl: z.ZodString;
|
|
135
|
-
clientName: z.ZodString;
|
|
136
135
|
}, "strip", z.ZodTypeAny, {
|
|
137
136
|
abTestName: string;
|
|
138
137
|
abTestVariant: string;
|
|
@@ -141,7 +140,6 @@ export declare const bannerSchema: z.ZodObject<{
|
|
|
141
140
|
ophanPageId: string;
|
|
142
141
|
platformId: string;
|
|
143
142
|
referrerUrl: string;
|
|
144
|
-
clientName: string;
|
|
145
143
|
products?: ("CONTRIBUTION" | "MEMBERSHIP_SUPPORTER" | "DIGITAL_SUBSCRIPTION" | "PRINT_SUBSCRIPTION")[] | null | undefined;
|
|
146
144
|
labels?: string[] | null | undefined;
|
|
147
145
|
}, {
|
|
@@ -152,7 +150,6 @@ export declare const bannerSchema: z.ZodObject<{
|
|
|
152
150
|
ophanPageId: string;
|
|
153
151
|
platformId: string;
|
|
154
152
|
referrerUrl: string;
|
|
155
|
-
clientName: string;
|
|
156
153
|
products?: ("CONTRIBUTION" | "MEMBERSHIP_SUPPORTER" | "DIGITAL_SUBSCRIPTION" | "PRINT_SUBSCRIPTION")[] | null | undefined;
|
|
157
154
|
labels?: string[] | null | undefined;
|
|
158
155
|
}>;
|
|
@@ -822,7 +819,6 @@ export declare const bannerSchema: z.ZodObject<{
|
|
|
822
819
|
ophanPageId: string;
|
|
823
820
|
platformId: string;
|
|
824
821
|
referrerUrl: string;
|
|
825
|
-
clientName: string;
|
|
826
822
|
products?: ("CONTRIBUTION" | "MEMBERSHIP_SUPPORTER" | "DIGITAL_SUBSCRIPTION" | "PRINT_SUBSCRIPTION")[] | null | undefined;
|
|
827
823
|
labels?: string[] | null | undefined;
|
|
828
824
|
};
|
|
@@ -964,7 +960,6 @@ export declare const bannerSchema: z.ZodObject<{
|
|
|
964
960
|
ophanPageId: string;
|
|
965
961
|
platformId: string;
|
|
966
962
|
referrerUrl: string;
|
|
967
|
-
clientName: string;
|
|
968
963
|
products?: ("CONTRIBUTION" | "MEMBERSHIP_SUPPORTER" | "DIGITAL_SUBSCRIPTION" | "PRINT_SUBSCRIPTION")[] | null | undefined;
|
|
969
964
|
labels?: string[] | null | undefined;
|
|
970
965
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
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;
|
|
1143
|
-
clientName: z.ZodString;
|
|
1144
1143
|
}, "strip", z.ZodTypeAny, {
|
|
1145
1144
|
abTestName: string;
|
|
1146
1145
|
abTestVariant: string;
|
|
@@ -1149,7 +1148,6 @@ export declare const epicPropsSchema: z.ZodObject<{
|
|
|
1149
1148
|
ophanPageId: string;
|
|
1150
1149
|
platformId: string;
|
|
1151
1150
|
referrerUrl: string;
|
|
1152
|
-
clientName: string;
|
|
1153
1151
|
products?: ("CONTRIBUTION" | "MEMBERSHIP_SUPPORTER" | "DIGITAL_SUBSCRIPTION" | "PRINT_SUBSCRIPTION")[] | null | undefined;
|
|
1154
1152
|
labels?: string[] | null | undefined;
|
|
1155
1153
|
}, {
|
|
@@ -1160,7 +1158,6 @@ export declare const epicPropsSchema: z.ZodObject<{
|
|
|
1160
1158
|
ophanPageId: string;
|
|
1161
1159
|
platformId: string;
|
|
1162
1160
|
referrerUrl: string;
|
|
1163
|
-
clientName: string;
|
|
1164
1161
|
products?: ("CONTRIBUTION" | "MEMBERSHIP_SUPPORTER" | "DIGITAL_SUBSCRIPTION" | "PRINT_SUBSCRIPTION")[] | null | undefined;
|
|
1165
1162
|
labels?: string[] | null | undefined;
|
|
1166
1163
|
}>;
|
|
@@ -1291,7 +1288,6 @@ export declare const epicPropsSchema: z.ZodObject<{
|
|
|
1291
1288
|
ophanPageId: string;
|
|
1292
1289
|
platformId: string;
|
|
1293
1290
|
referrerUrl: string;
|
|
1294
|
-
clientName: string;
|
|
1295
1291
|
products?: ("CONTRIBUTION" | "MEMBERSHIP_SUPPORTER" | "DIGITAL_SUBSCRIPTION" | "PRINT_SUBSCRIPTION")[] | null | undefined;
|
|
1296
1292
|
labels?: string[] | null | undefined;
|
|
1297
1293
|
};
|
|
@@ -1416,7 +1412,6 @@ export declare const epicPropsSchema: z.ZodObject<{
|
|
|
1416
1412
|
ophanPageId: string;
|
|
1417
1413
|
platformId: string;
|
|
1418
1414
|
referrerUrl: string;
|
|
1419
|
-
clientName: string;
|
|
1420
1415
|
products?: ("CONTRIBUTION" | "MEMBERSHIP_SUPPORTER" | "DIGITAL_SUBSCRIPTION" | "PRINT_SUBSCRIPTION")[] | null | undefined;
|
|
1421
1416
|
labels?: string[] | null | undefined;
|
|
1422
1417
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"epic.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/props/epic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAMH,KAAK,EAEL,QAAQ,EAGR,aAAa,EAChB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErD,MAAM,WAAW,SAAS;IACtB,OAAO,EAAE,WAAW,CAAC;IACrB,QAAQ,EAAE,QAAQ,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,aAAa,CAAC;IAE7B,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC1C,oBAAoB,CAAC,EAAE,CAAC,cAAc,EAAE,mBAAmB,KAAK,IAAI,CAAC;IACrE,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,KAAK,CAAC,EAAE,KAAK,CAAC;CACjB;AAkBD,eAAO,MAAM,2BAA2B,6CAA2C,CAAC;AA+BpF,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAW1B,CAAC"}
|
|
@@ -159,7 +159,6 @@ export declare const gutterPropsSchema: z.ZodObject<{
|
|
|
159
159
|
ophanPageId: z.ZodString;
|
|
160
160
|
platformId: z.ZodString;
|
|
161
161
|
referrerUrl: z.ZodString;
|
|
162
|
-
clientName: z.ZodString;
|
|
163
162
|
}, "strip", z.ZodTypeAny, {
|
|
164
163
|
abTestName: string;
|
|
165
164
|
abTestVariant: string;
|
|
@@ -168,7 +167,6 @@ export declare const gutterPropsSchema: z.ZodObject<{
|
|
|
168
167
|
ophanPageId: string;
|
|
169
168
|
platformId: string;
|
|
170
169
|
referrerUrl: string;
|
|
171
|
-
clientName: string;
|
|
172
170
|
products?: ("CONTRIBUTION" | "MEMBERSHIP_SUPPORTER" | "DIGITAL_SUBSCRIPTION" | "PRINT_SUBSCRIPTION")[] | null | undefined;
|
|
173
171
|
labels?: string[] | null | undefined;
|
|
174
172
|
}, {
|
|
@@ -179,7 +177,6 @@ export declare const gutterPropsSchema: z.ZodObject<{
|
|
|
179
177
|
ophanPageId: string;
|
|
180
178
|
platformId: string;
|
|
181
179
|
referrerUrl: string;
|
|
182
|
-
clientName: string;
|
|
183
180
|
products?: ("CONTRIBUTION" | "MEMBERSHIP_SUPPORTER" | "DIGITAL_SUBSCRIPTION" | "PRINT_SUBSCRIPTION")[] | null | undefined;
|
|
184
181
|
labels?: string[] | null | undefined;
|
|
185
182
|
}>;
|
|
@@ -210,7 +207,6 @@ export declare const gutterPropsSchema: z.ZodObject<{
|
|
|
210
207
|
ophanPageId: string;
|
|
211
208
|
platformId: string;
|
|
212
209
|
referrerUrl: string;
|
|
213
|
-
clientName: string;
|
|
214
210
|
products?: ("CONTRIBUTION" | "MEMBERSHIP_SUPPORTER" | "DIGITAL_SUBSCRIPTION" | "PRINT_SUBSCRIPTION")[] | null | undefined;
|
|
215
211
|
labels?: string[] | null | undefined;
|
|
216
212
|
};
|
|
@@ -241,7 +237,6 @@ export declare const gutterPropsSchema: z.ZodObject<{
|
|
|
241
237
|
ophanPageId: string;
|
|
242
238
|
platformId: string;
|
|
243
239
|
referrerUrl: string;
|
|
244
|
-
clientName: string;
|
|
245
240
|
products?: ("CONTRIBUTION" | "MEMBERSHIP_SUPPORTER" | "DIGITAL_SUBSCRIPTION" | "PRINT_SUBSCRIPTION")[] | null | undefined;
|
|
246
241
|
labels?: string[] | null | undefined;
|
|
247
242
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gutter.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/props/gutter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAkB,GAAG,EAAa,KAAK,EAAe,MAAM,UAAU,CAAC;AAExF,MAAM,WAAW,aAAa;IAC1B,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,GAAG,C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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAK5B,CAAC"}
|
|
@@ -125,7 +125,6 @@ export declare const headerPropsSchema: z.ZodObject<{
|
|
|
125
125
|
ophanPageId: z.ZodString;
|
|
126
126
|
platformId: z.ZodString;
|
|
127
127
|
referrerUrl: z.ZodString;
|
|
128
|
-
clientName: z.ZodString;
|
|
129
128
|
}, "strip", z.ZodTypeAny, {
|
|
130
129
|
abTestName: string;
|
|
131
130
|
abTestVariant: string;
|
|
@@ -134,7 +133,6 @@ export declare const headerPropsSchema: z.ZodObject<{
|
|
|
134
133
|
ophanPageId: string;
|
|
135
134
|
platformId: string;
|
|
136
135
|
referrerUrl: string;
|
|
137
|
-
clientName: string;
|
|
138
136
|
products?: ("CONTRIBUTION" | "MEMBERSHIP_SUPPORTER" | "DIGITAL_SUBSCRIPTION" | "PRINT_SUBSCRIPTION")[] | null | undefined;
|
|
139
137
|
labels?: string[] | null | undefined;
|
|
140
138
|
}, {
|
|
@@ -145,7 +143,6 @@ export declare const headerPropsSchema: z.ZodObject<{
|
|
|
145
143
|
ophanPageId: string;
|
|
146
144
|
platformId: string;
|
|
147
145
|
referrerUrl: string;
|
|
148
|
-
clientName: string;
|
|
149
146
|
products?: ("CONTRIBUTION" | "MEMBERSHIP_SUPPORTER" | "DIGITAL_SUBSCRIPTION" | "PRINT_SUBSCRIPTION")[] | null | undefined;
|
|
150
147
|
labels?: string[] | null | undefined;
|
|
151
148
|
}>;
|
|
@@ -223,7 +220,6 @@ export declare const headerPropsSchema: z.ZodObject<{
|
|
|
223
220
|
ophanPageId: string;
|
|
224
221
|
platformId: string;
|
|
225
222
|
referrerUrl: string;
|
|
226
|
-
clientName: string;
|
|
227
223
|
products?: ("CONTRIBUTION" | "MEMBERSHIP_SUPPORTER" | "DIGITAL_SUBSCRIPTION" | "PRINT_SUBSCRIPTION")[] | null | undefined;
|
|
228
224
|
labels?: string[] | null | undefined;
|
|
229
225
|
};
|
|
@@ -265,7 +261,6 @@ export declare const headerPropsSchema: z.ZodObject<{
|
|
|
265
261
|
ophanPageId: string;
|
|
266
262
|
platformId: string;
|
|
267
263
|
referrerUrl: string;
|
|
268
|
-
clientName: string;
|
|
269
264
|
products?: ("CONTRIBUTION" | "MEMBERSHIP_SUPPORTER" | "DIGITAL_SUBSCRIPTION" | "PRINT_SUBSCRIPTION")[] | null | undefined;
|
|
270
265
|
labels?: string[] | null | undefined;
|
|
271
266
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/props/header.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErD,OAAO,EAAE,QAAQ,EAAkB,GAAG,EAAa,MAAM,UAAU,CAAC;AAEpE,MAAM,WAAW,aAAa;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAM9B,CAAC;AAEH,MAAM,WAAW,WAAW;IACxB,OAAO,EAAE,aAAa,CAAC;IACvB,QAAQ,EAAE,QAAQ,CAAC;IACnB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oBAAoB,CAAC,EAAE,CAAC,cAAc,EAAE,mBAAmB,KAAK,IAAI,CAAC;IACrE,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,iBAAiB
|
|
1
|
+
{"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/props/header.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErD,OAAO,EAAE,QAAQ,EAAkB,GAAG,EAAa,MAAM,UAAU,CAAC;AAEpE,MAAM,WAAW,aAAa;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAM9B,CAAC;AAEH,MAAM,WAAW,WAAW;IACxB,OAAO,EAAE,aAAa,CAAC;IACvB,QAAQ,EAAE,QAAQ,CAAC;IACnB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oBAAoB,CAAC,EAAE,CAAC,cAAc,EAAE,mBAAmB,KAAK,IAAI,CAAC;IACrE,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAO5B,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { PageTracking } from '../targeting';
|
|
3
2
|
import { TestTracking } from '../abTests';
|
|
4
3
|
export type Stage = 'PROD' | 'CODE' | 'DEV';
|
|
5
4
|
export interface Cta {
|
|
@@ -233,6 +232,11 @@ export interface SeparateArticleCount {
|
|
|
233
232
|
}
|
|
234
233
|
export declare const ophanProductSchema: z.ZodEnum<["CONTRIBUTION", "MEMBERSHIP_SUPPORTER", "DIGITAL_SUBSCRIPTION", "PRINT_SUBSCRIPTION"]>;
|
|
235
234
|
export declare const ophanComponentTypeSchema: z.ZodEnum<["ACQUISITIONS_EPIC", "ACQUISITIONS_ENGAGEMENT_BANNER", "ACQUISITIONS_SUBSCRIPTIONS_BANNER", "ACQUISITIONS_HEADER", "ACQUISITIONS_OTHER"]>;
|
|
235
|
+
export type PageTracking = {
|
|
236
|
+
ophanPageId: string;
|
|
237
|
+
platformId: string;
|
|
238
|
+
referrerUrl: string;
|
|
239
|
+
};
|
|
236
240
|
export type Tracking = TestTracking & PageTracking;
|
|
237
241
|
export declare const trackingSchema: z.ZodObject<{
|
|
238
242
|
abTestName: z.ZodString;
|
|
@@ -244,7 +248,6 @@ export declare const trackingSchema: z.ZodObject<{
|
|
|
244
248
|
ophanPageId: z.ZodString;
|
|
245
249
|
platformId: z.ZodString;
|
|
246
250
|
referrerUrl: z.ZodString;
|
|
247
|
-
clientName: z.ZodString;
|
|
248
251
|
}, "strip", z.ZodTypeAny, {
|
|
249
252
|
abTestName: string;
|
|
250
253
|
abTestVariant: string;
|
|
@@ -253,7 +256,6 @@ export declare const trackingSchema: z.ZodObject<{
|
|
|
253
256
|
ophanPageId: string;
|
|
254
257
|
platformId: string;
|
|
255
258
|
referrerUrl: string;
|
|
256
|
-
clientName: string;
|
|
257
259
|
products?: ("CONTRIBUTION" | "MEMBERSHIP_SUPPORTER" | "DIGITAL_SUBSCRIPTION" | "PRINT_SUBSCRIPTION")[] | null | undefined;
|
|
258
260
|
labels?: string[] | null | undefined;
|
|
259
261
|
}, {
|
|
@@ -264,7 +266,6 @@ export declare const trackingSchema: z.ZodObject<{
|
|
|
264
266
|
ophanPageId: string;
|
|
265
267
|
platformId: string;
|
|
266
268
|
referrerUrl: string;
|
|
267
|
-
clientName: string;
|
|
268
269
|
products?: ("CONTRIBUTION" | "MEMBERSHIP_SUPPORTER" | "DIGITAL_SUBSCRIPTION" | "PRINT_SUBSCRIPTION")[] | null | undefined;
|
|
269
270
|
labels?: string[] | null | undefined;
|
|
270
271
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/props/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/props/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC;AAE5C,MAAM,WAAW,GAAG;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,SAAS;;;;;;;;;EAGpB,CAAC;AAEH,oBAAY,gBAAgB;IACxB,MAAM,uBAAuB;IAC7B,qBAAqB,sCAAsC;CAC9D;AAED,eAAO,MAAM,sBAAsB,0CAAiC,CAAC;AAErE,UAAU,kBAAkB;IACxB,IAAI,EAAE,gBAAgB,CAAC,MAAM,CAAC;IAC9B,GAAG,EAAE,GAAG,CAAC;CACZ;AAED,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;EAGnC,CAAC;AAEH,UAAU,iCAAiC;IACvC,IAAI,EAAE,gBAAgB,CAAC,qBAAqB,CAAC;CAChD;AAED,eAAO,MAAM,uCAAuC;;;;;;EAElD,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,kBAAkB,GAAG,iCAAiC,CAAC;AAElF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C,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,gBAAgB,CAAC;CAChC;AAED,eAAO,MAAM,kBAAkB,mGAK7B,CAAC;AAEH,eAAO,MAAM,wBAAwB,sJAMnC,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG,YAAY,GAAG,YAAY,CAAC;AAEnD,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWzB,CAAC;AAEH,MAAM,WAAW,KAAK;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;EAQtB,CAAC;AAEH,MAAM,WAAW,eAAe;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,KAAK,CAAC;CACpB;AAED,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIhC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { WeeklyArticleHistory, PurchaseInfo, AbandonedBasket } from './shared';
|
|
2
2
|
export type BannerTargeting = {
|
|
3
3
|
shouldHideReaderRevenue?: boolean;
|
|
4
4
|
isPaidContent?: boolean;
|
|
@@ -22,7 +22,6 @@ export type BannerTargeting = {
|
|
|
22
22
|
abandonedBasket?: AbandonedBasket;
|
|
23
23
|
};
|
|
24
24
|
export type BannerPayload = {
|
|
25
|
-
tracking: PageTracking;
|
|
26
25
|
targeting: BannerTargeting;
|
|
27
26
|
};
|
|
28
27
|
//# sourceMappingURL=banner.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banner.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/targeting/banner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"banner.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/targeting/banner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE/E,MAAM,MAAM,eAAe,GAAG;IAC1B,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,4BAA4B,CAAC,EAAE,MAAM,CAAC;IACtC,8BAA8B,CAAC,EAAE,MAAM,CAAC;IACxC,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,iCAAiC,CAAC,EAAE,MAAM,CAAC;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,yBAAyB,EAAE,OAAO,CAAC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,UAAU,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,CAAC,EAAE,eAAe,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IACxB,SAAS,EAAE,eAAe,CAAC;CAC9B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EpicViewLog } from '../../lib/viewLog';
|
|
2
|
-
import {
|
|
2
|
+
import { WeeklyArticleHistory } from './shared';
|
|
3
3
|
type Tag = {
|
|
4
4
|
id: string;
|
|
5
5
|
type: string;
|
|
@@ -23,7 +23,6 @@ export type EpicTargeting = {
|
|
|
23
23
|
isSignedIn?: boolean;
|
|
24
24
|
};
|
|
25
25
|
export type EpicPayload = {
|
|
26
|
-
tracking: PageTracking;
|
|
27
26
|
targeting: EpicTargeting;
|
|
28
27
|
};
|
|
29
28
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"epic.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/targeting/epic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"epic.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/targeting/epic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAEhD,KAAK,GAAG,GAAG;IACP,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uBAAuB,EAAE,OAAO,CAAC;IAEjC,eAAe,EAAE,OAAO,CAAC;IACzB,aAAa,EAAE,OAAO,CAAC;IAEvB,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,yBAAyB,EAAE,OAAO,CAAC;IACnC,oBAAoB,EAAE,OAAO,CAAC;IAC9B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACtB,SAAS,EAAE,aAAa,CAAC;CAC5B,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { PageTracking } from './shared';
|
|
2
1
|
export interface GutterTargeting {
|
|
3
2
|
showSupportMessaging: boolean;
|
|
4
3
|
countryCode: string;
|
|
@@ -8,7 +7,6 @@ export interface GutterTargeting {
|
|
|
8
7
|
sectionId?: string;
|
|
9
8
|
}
|
|
10
9
|
export type GutterPayload = {
|
|
11
|
-
tracking: PageTracking;
|
|
12
10
|
targeting: GutterTargeting;
|
|
13
11
|
};
|
|
14
12
|
//# sourceMappingURL=gutter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gutter.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/targeting/gutter.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"gutter.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/targeting/gutter.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC5B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,MAAM,aAAa,GAAG;IACxB,SAAS,EAAE,eAAe,CAAC;CAC9B,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PurchaseInfo } from './shared';
|
|
2
2
|
export interface HeaderTargeting {
|
|
3
3
|
showSupportMessaging: boolean;
|
|
4
4
|
countryCode: string;
|
|
@@ -8,7 +8,6 @@ export interface HeaderTargeting {
|
|
|
8
8
|
isSignedIn: boolean;
|
|
9
9
|
}
|
|
10
10
|
export type HeaderPayload = {
|
|
11
|
-
tracking: PageTracking;
|
|
12
11
|
targeting: HeaderTargeting;
|
|
13
12
|
};
|
|
14
13
|
//# sourceMappingURL=header.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/targeting/header.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/targeting/header.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,MAAM,WAAW,eAAe;IAC5B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,UAAU,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,MAAM,aAAa,GAAG;IACxB,SAAS,EAAE,eAAe,CAAC;CAC9B,CAAC"}
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { purchaseInfoProduct, purchaseInfoUser } from '../purchaseInfo';
|
|
3
|
-
export type PageTracking = {
|
|
4
|
-
ophanPageId: string;
|
|
5
|
-
platformId: string;
|
|
6
|
-
referrerUrl: string;
|
|
7
|
-
clientName: string;
|
|
8
|
-
};
|
|
9
3
|
export type TagCounts = {
|
|
10
4
|
[tag: string]: number;
|
|
11
5
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/targeting/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAExE,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/targeting/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAExE,MAAM,MAAM,SAAS,GAAG;IACpB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,SAAS,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,gBAAgB,EAAE,CAAC;AAEtD;;;GAGG;AACH,MAAM,WAAW,YAAY;IACzB,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;IAEvC,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACzB;AAED,MAAM,WAAW,YAAY;IACzB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,OAAO,EAAE,mBAAmB,CAAC;CAChC;AAED,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;EAuBhC,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
package/package.json
CHANGED