1/* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4"use strict";
5
6const TEST_ICON = "chrome://branding/content/icon64.png";
7const TEST_ICON_16 = "chrome://branding/content/icon16.png";
8const TEST_ICON_BW =
9  "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QA/4ePzL8AAAAHdElNRQfjBQ8QDifrKGc/AAABf0lEQVQoz4WRO08UUQCFvztzd1AgG9jRgGwkhEoMIYGSygYt+A00tpZGY0jYxAJKEwkNjX9AK2xACx4dhFiQQCiMMRr2kYXdnQcz7L0z91qAMVac6hTfSU7OgVsk/prtyfSNfRb7ge2cd7dmVucP/wM2lwqVqoyICahRx9Nz71+8AnAAvlTct+dSYDBYcgJ+Fj68XFu/AfamnIoWFoHFYrAUuYMSn55/fAIOxIs1t4MhQpNxRYsUD0ld7r8DCfZph4QecrqkhCREgMLSeISQkAy0UBgE0CYgIkeRA9HdsCQhpEGCxichpItHigEcPH4XJLRbTf8STY0iiiuu60Ifxexx04F0N+aCgJCAhPQmD/cp/RC5A79WvUyhUHSIidAIoESv9VfAhW9n8+XqTCoyMsz1cviMMrGz9BrjAuboYHZajyXCInEocI8yvccbC+0muABanR4/tONjQz3DzgNKtj9sfv66XD9B/3tT9g/akb7h0bJwzxqqmlRHLr4rLPwBlYWoYj77l2AAAAAldEVYdGRhdGU6Y3JlYXRlADIwMTktMDUtMTVUMTY6MTQ6MzkrMDA6MDD5/4XBAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDE5LTA1LTE1VDE2OjE0OjM5KzAwOjAwiKI9fQAAAABJRU5ErkJggg==";
10
11const MESSAGES = () => [
12  {
13    template: "simple_snippet",
14    template_version: "1.1.2",
15    content: {
16      text: "This is for <link0>preferences</link0> and <link1>about</link1>",
17      icon:
18        "https://snippets.cdn.mozilla.net/media/icons/1a8bb10e-8166-4e14-9e41-c1f85a41bcd2.png",
19      button_label: "Button Label",
20      section_title_icon:
21        "https://snippets.cdn.mozilla.net/media/icons/5878847e-a1fb-4204-aad9-09f6cf7f99ee.png",
22      section_title_text: "Messages from Firefox",
23      section_title_url:
24        "https://support.mozilla.org/kb/snippets-firefox-faq?utm_source=desktop-snippet&utm_medium=snippet&utm_campaign=&utm_term=&utm_content=",
25      tall: false,
26      block_button_text: "Remove this",
27      do_not_autoblock: true,
28      links: {
29        link0: {
30          action: "OPEN_PREFERENCES_PAGE",
31          entrypoint_value: "snippet",
32          args: "sync",
33        },
34        link1: {
35          action: "OPEN_ABOUT_PAGE",
36          args: "about",
37          entrypoint_name: "entryPoint",
38          entrypoint_value: "snippet",
39        },
40      },
41      button_action: "OPEN_PREFERENCES_PAGE",
42      button_entrypoint_value: "snippet",
43    },
44    id: "preview-13516_button_preferences",
45  },
46  {
47    template: "simple_snippet",
48    template_version: "1.1.2",
49    content: {
50      text: "This is for <link0>preferences</link0> and <link1>about</link1>",
51      icon:
52        "https://snippets.cdn.mozilla.net/media/icons/1a8bb10e-8166-4e14-9e41-c1f85a41bcd2.png",
53      button_label: "Button Label",
54      section_title_icon:
55        "https://snippets.cdn.mozilla.net/media/icons/5878847e-a1fb-4204-aad9-09f6cf7f99ee.png",
56      section_title_text: "Messages from Firefox",
57      section_title_url:
58        "https://support.mozilla.org/kb/snippets-firefox-faq?utm_source=desktop-snippet&utm_medium=snippet&utm_campaign=&utm_term=&utm_content=",
59      tall: false,
60      block_button_text: "Remove this",
61      do_not_autoblock: true,
62      links: {
63        link0: {
64          action: "OPEN_PREFERENCES_PAGE",
65          entrypoint_value: "snippet",
66        },
67        link1: {
68          action: "OPEN_ABOUT_PAGE",
69          args: "about",
70          entrypoint_name: "entryPoint",
71          entrypoint_value: "snippet",
72        },
73      },
74      button_action: "OPEN_ABOUT_PAGE",
75      button_action_args: "logins",
76      button_entrypoint_name: "entryPoint",
77      button_entrypoint_value: "snippet",
78    },
79    id: "preview-13517_button_about",
80  },
81  {
82    id: "SIMPLE_TEST_1",
83    template: "simple_snippet",
84    campaign: "test_campaign_blocking",
85    content: {
86      icon: TEST_ICON,
87      icon_dark_theme: TEST_ICON_BW,
88      title: "Firefox Account!",
89      title_icon: TEST_ICON_16,
90      title_icon_dark_theme: TEST_ICON_BW,
91      text:
92        "<syncLink>Sync it, link it, take it with you</syncLink>. All this and more with a Firefox Account.",
93      links: {
94        syncLink: { url: "https://www.mozilla.org/en-US/firefox/accounts" },
95      },
96      block_button_text: "Block",
97    },
98  },
99  {
100    id: "SIMPLE_TEST_1_NO_DARK_THEME",
101    template: "simple_snippet",
102    campaign: "test_campaign_blocking",
103    content: {
104      icon: TEST_ICON,
105      icon_dark_theme: "",
106      title: "Firefox Account!",
107      title_icon: TEST_ICON_16,
108      title_icon_dark_theme: "",
109      text:
110        "<syncLink>Sync it, link it, take it with you</syncLink>. All this and more with a Firefox Account.",
111      links: {
112        syncLink: { url: "https://www.mozilla.org/en-US/firefox/accounts" },
113      },
114      block_button_text: "Block",
115    },
116  },
117  {
118    id: "SIMPLE_TEST_1_SAME_CAMPAIGN",
119    template: "simple_snippet",
120    campaign: "test_campaign_blocking",
121    content: {
122      icon: TEST_ICON,
123      icon_dark_theme: TEST_ICON_BW,
124      text:
125        "<syncLink>Sync it, link it, take it with you</syncLink>. All this and more with a Firefox Account.",
126      links: {
127        syncLink: { url: "https://www.mozilla.org/en-US/firefox/accounts" },
128      },
129      block_button_text: "Block",
130    },
131  },
132  {
133    id: "SIMPLE_TEST_TALL",
134    template: "simple_snippet",
135    content: {
136      icon: TEST_ICON,
137      icon_dark_theme: TEST_ICON_BW,
138      text:
139        "<syncLink>Sync it, link it, take it with you</syncLink>. All this and more with a Firefox Account.",
140      links: {
141        syncLink: { url: "https://www.mozilla.org/en-US/firefox/accounts" },
142      },
143      button_label: "Get one now!",
144      button_url: "https://www.mozilla.org/en-US/firefox/accounts",
145      block_button_text: "Block",
146      tall: true,
147    },
148  },
149  {
150    id: "SIMPLE_TEST_BUTTON_URL_1",
151    template: "simple_snippet",
152    content: {
153      icon: TEST_ICON,
154      icon_dark_theme: TEST_ICON_BW,
155      button_label: "Get one now!",
156      button_url: "https://www.mozilla.org/en-US/firefox/accounts",
157      text:
158        "Sync it, link it, take it with you. All this and more with a Firefox Account.",
159      block_button_text: "Block",
160    },
161  },
162  {
163    id: "SIMPLE_TEST_BUTTON_ACTION_1",
164    template: "simple_snippet",
165    content: {
166      icon: TEST_ICON,
167      icon_dark_theme: TEST_ICON_BW,
168      button_label: "Open about:config",
169      button_action: "OPEN_ABOUT_PAGE",
170      button_action_args: "config",
171      text: "Testing the OPEN_ABOUT_PAGE action",
172      block_button_text: "Block",
173    },
174  },
175  {
176    id: "SIMPLE_WITH_TITLE_TEST_1",
177    template: "simple_snippet",
178    content: {
179      icon: TEST_ICON,
180      icon_dark_theme: TEST_ICON_BW,
181      title: "Ready to sync?",
182      text: "Get connected with a <syncLink>Firefox account</syncLink>.",
183      links: {
184        syncLink: { url: "https://www.mozilla.org/en-US/firefox/accounts" },
185      },
186      block_button_text: "Block",
187    },
188  },
189  {
190    id: "NEWSLETTER_TEST_DEFAULTS",
191    template: "newsletter_snippet",
192    content: {
193      scene1_icon: TEST_ICON,
194      scene1_icon_dark_theme: TEST_ICON_BW,
195      scene1_title: "Be a part of a movement.",
196      scene1_title_icon: TEST_ICON_16,
197      scene1_title_icon_dark_theme: TEST_ICON_BW,
198      scene1_text:
199        "Internet shutdowns, hackers, harassment &ndash; the health of the internet is on the line. Sign up and Mozilla will keep you updated on how you can help.",
200      scene1_button_label: "Continue",
201      scene1_button_color: "#712b00",
202      scene1_button_background_color: "#ff9400",
203      scene2_title: "Let's do this!",
204      locale: "en-CA",
205      scene2_dismiss_button_text: "Dismiss",
206      scene2_text:
207        "Sign up for the Mozilla newsletter and we will keep you updated on how you can help.",
208      scene2_privacy_html:
209        "I'm okay with Mozilla handling my info as explained in this <privacyLink>Privacy Notice</privacyLink>.",
210      scene2_newsletter: "mozilla-foundation",
211      success_text: "Check your inbox for the confirmation!",
212      error_text: "Error!",
213      retry_button_label: "Try again?",
214      links: {
215        privacyLink: {
216          url:
217            "https://www.mozilla.org/privacy/websites/?sample_rate=0.001&snippet_name=7894",
218        },
219      },
220    },
221  },
222  {
223    id: "NEWSLETTER_TEST_1",
224    template: "newsletter_snippet",
225    content: {
226      scene1_icon: TEST_ICON,
227      scene1_icon_dark_theme: TEST_ICON_BW,
228      scene1_title: "Be a part of a movement.",
229      scene1_title_icon: "",
230      scene1_text:
231        "Internet shutdowns, hackers, harassment &ndash; the health of the internet is on the line. Sign up and Mozilla will keep you updated on how you can help.",
232      scene1_button_label: "Continue",
233      scene1_button_color: "#712b00",
234      scene1_button_background_color: "#ff9400",
235      scene2_title: "Let's do this!",
236      locale: "en-CA",
237      scene2_dismiss_button_text: "Dismiss",
238      scene2_text:
239        "Sign up for the Mozilla newsletter and we will keep you updated on how you can help.",
240      scene2_privacy_html:
241        "I'm okay with Mozilla handling my info as explained in this <privacyLink>Privacy Notice</privacyLink>.",
242      scene2_button_label: "Sign Me up",
243      scene2_email_placeholder_text: "Your email here",
244      scene2_newsletter: "mozilla-foundation",
245      success_text: "Check your inbox for the confirmation!",
246      error_text: "Error!",
247      links: {
248        privacyLink: {
249          url:
250            "https://www.mozilla.org/privacy/websites/?sample_rate=0.001&snippet_name=7894",
251        },
252      },
253    },
254  },
255  {
256    id: "NEWSLETTER_TEST_SCENE1_SECTION_TITLE_ICON",
257    template: "newsletter_snippet",
258    content: {
259      scene1_icon: TEST_ICON,
260      scene1_icon_dark_theme: TEST_ICON_BW,
261      scene1_title: "Be a part of a movement.",
262      scene1_title_icon: "",
263      scene1_text:
264        "Internet shutdowns, hackers, harassment &ndash; the health of the internet is on the line. Sign up and Mozilla will keep you updated on how you can help.",
265      scene1_button_label: "Continue",
266      scene1_button_color: "#712b00",
267      scene1_button_background_color: "#ff9400",
268      scene1_section_title_icon: "chrome://global/skin/icons/pocket.svg",
269      scene1_section_title_text:
270        "All the Firefox news that's fit to Firefox print!",
271      scene2_title: "Let's do this!",
272      locale: "en-CA",
273      scene2_dismiss_button_text: "Dismiss",
274      scene2_text:
275        "Sign up for the Mozilla newsletter and we will keep you updated on how you can help.",
276      scene2_privacy_html:
277        "I'm okay with Mozilla handling my info as explained in this <privacyLink>Privacy Notice</privacyLink>.",
278      scene2_button_label: "Sign Me up",
279      scene2_email_placeholder_text: "Your email here",
280      scene2_newsletter: "mozilla-foundation",
281      success_text: "Check your inbox for the confirmation!",
282      error_text: "Error!",
283      links: {
284        privacyLink: {
285          url:
286            "https://www.mozilla.org/privacy/websites/?sample_rate=0.001&snippet_name=7894",
287        },
288      },
289    },
290  },
291  {
292    id: "FXA_SNIPPET_TEST_1",
293    template: "fxa_signup_snippet",
294    content: {
295      scene1_icon: TEST_ICON,
296      scene1_icon_dark_theme: TEST_ICON_BW,
297      scene1_button_label: "Get connected with sync!",
298      scene1_button_color: "#712b00",
299      scene1_button_background_color: "#ff9400",
300
301      scene1_text:
302        "Connect to Firefox by securely syncing passwords, bookmarks, and open tabs.",
303      scene1_title: "Browser better.",
304      scene1_title_icon: TEST_ICON_16,
305      scene1_title_icon_dark_theme: TEST_ICON_BW,
306
307      scene2_text:
308        "Connect to your Firefox account to securely sync passwords, bookmarks, and open tabs.",
309      scene2_title: "Title 123",
310      scene2_email_placeholder_text: "Your email",
311      scene2_button_label: "Continue",
312      scene2_dismiss_button_text: "Dismiss",
313    },
314  },
315  {
316    id: "FXA_SNIPPET_TEST_TITLE_ICON",
317    template: "fxa_signup_snippet",
318    content: {
319      scene1_icon: TEST_ICON,
320      scene1_icon_dark_theme: TEST_ICON_BW,
321      scene1_button_label: "Get connected with sync!",
322      scene1_button_color: "#712b00",
323      scene1_button_background_color: "#ff9400",
324
325      scene1_text:
326        "Connect to Firefox by securely syncing passwords, bookmarks, and open tabs.",
327      scene1_title: "Browser better.",
328      scene1_title_icon: TEST_ICON_16,
329      scene1_title_icon_dark_theme: TEST_ICON_BW,
330
331      scene1_section_title_icon: "chrome://global/skin/icons/pocket.svg",
332      scene1_section_title_text: "Firefox Accounts: Receivable benefits",
333
334      scene2_text:
335        "Connect to your Firefox account to securely sync passwords, bookmarks, and open tabs.",
336      scene2_title: "Title 123",
337      scene2_email_placeholder_text: "Your email",
338      scene2_button_label: "Continue",
339      scene2_dismiss_button_text: "Dismiss",
340    },
341  },
342  {
343    id: "SNIPPETS_SEND_TO_DEVICE_TEST",
344    template: "send_to_device_snippet",
345    content: {
346      include_sms: true,
347      locale: "en-CA",
348      country: "us",
349      message_id_sms: "ff-mobilesn-download",
350      message_id_email: "download-firefox-mobile",
351
352      scene1_button_background_color: "#6200a4",
353      scene1_button_color: "#FFFFFF",
354      scene1_button_label: "Install now",
355      scene1_icon: TEST_ICON,
356      scene1_icon_dark_theme: TEST_ICON_BW,
357      scene1_text: "Browse without compromise with Firefox Mobile.",
358      scene1_title: "Full-featured. Customizable. Lightning fast",
359      scene1_title_icon: TEST_ICON_16,
360      scene1_title_icon_dark_theme: TEST_ICON_BW,
361
362      scene2_button_label: "Send",
363      scene2_disclaimer_html:
364        "The intended recipient of the email must have consented. <privacyLink>Learn more</privacyLink>.",
365      scene2_dismiss_button_text: "Dismiss",
366      scene2_icon: TEST_ICON,
367      scene2_icon_dark_theme: TEST_ICON_BW,
368      scene2_input_placeholder: "Your email address or phone number",
369      scene2_text:
370        "Send Firefox to your phone and take a powerful independent browser with you.",
371      scene2_title: "Let's do this!",
372
373      error_text: "Oops, there was a problem.",
374      success_title: "Your download link was sent.",
375      success_text: "Check your device for the email message!",
376      links: {
377        privacyLink: {
378          url:
379            "https://www.mozilla.org/privacy/websites/?sample_rate=0.001&snippet_name=7894",
380        },
381      },
382    },
383  },
384  {
385    id: "SNIPPETS_SCENE2_SEND_TO_DEVICE_TEST",
386    template: "send_to_device_scene2_snippet",
387    content: {
388      include_sms: true,
389      locale: "en-CA",
390      country: "us",
391      message_id_sms: "ff-mobilesn-download",
392      message_id_email: "download-firefox-mobile",
393      scene2_icon: TEST_ICON,
394      section_title_icon:
395        "https://snippets.cdn.mozilla.net/media/icons/094b0707-ab65-4b2e-99a1-a84122b6ab26.png",
396      section_title_text: "Messages from Firefox",
397      section_title_url: "https://support.mozilla.org/kb",
398      scene2_button_label: "Send",
399      scene2_disclaimer_html:
400        "The intended recipient of the email must have consented. <privacyLink>Learn more</privacyLink>.",
401      scene2_input_placeholder: "Your email address or phone number",
402      scene2_text:
403        "Send Firefox to your phone and take a powerful independent browser with you.",
404      error_text: "Oops, there was a problem.",
405      success_title: "Your download link was sent.",
406      success_text: "Check your device for the email message!",
407      links: {
408        privacyLink: {
409          url:
410            "https://www.mozilla.org/privacy/websites/?sample_rate=0.001&snippet_name=7894",
411        },
412      },
413    },
414  },
415  {
416    id: "SNIPPETS_SEND_TO_DEVICE_TEST_NO_DARK_THEME",
417    template: "send_to_device_snippet",
418    content: {
419      include_sms: true,
420      locale: "en-CA",
421      country: "us",
422      message_id_sms: "ff-mobilesn-download",
423      message_id_email: "download-firefox-mobile",
424
425      scene1_button_background_color: "#6200a4",
426      scene1_button_color: "#FFFFFF",
427      scene1_button_label: "Install now",
428      scene1_icon: TEST_ICON,
429      scene1_icon_dark_theme: "",
430      scene1_text: "Browse without compromise with Firefox Mobile.",
431      scene1_title: "Full-featured. Customizable. Lightning fast",
432      scene1_title_icon: TEST_ICON_16,
433      scene1_title_icon_dark_theme: "",
434
435      scene2_button_label: "Send",
436      scene2_disclaimer_html:
437        "The intended recipient of the email must have consented. <privacyLink>Learn more</privacyLink>.",
438      scene2_dismiss_button_text: "Dismiss",
439      scene2_icon: TEST_ICON,
440      scene2_icon_dark_theme: "",
441      scene2_input_placeholder: "Your email address or phone number",
442      scene2_text:
443        "Send Firefox to your phone and take a powerful independent browser with you.",
444      scene2_title: "Let's do this!",
445
446      error_text: "Oops, there was a problem.",
447      success_title: "Your download link was sent.",
448      success_text: "Check your device for the email message!",
449      links: {
450        privacyLink: {
451          url:
452            "https://www.mozilla.org/privacy/websites/?sample_rate=0.001&snippet_name=7894",
453        },
454      },
455    },
456  },
457  {
458    id: "SNIPPETS_SEND_TO_DEVICE_TEST_SECTION_TITLE_ICON",
459    template: "send_to_device_snippet",
460    content: {
461      include_sms: true,
462      locale: "en-CA",
463      country: "us",
464      message_id_sms: "ff-mobilesn-download",
465      message_id_email: "download-firefox-mobile",
466
467      scene1_button_background_color: "#6200a4",
468      scene1_button_color: "#FFFFFF",
469      scene1_button_label: "Install now",
470      scene1_icon: TEST_ICON,
471      scene1_icon_dark_theme: TEST_ICON_BW,
472      scene1_text: "Browse without compromise with Firefox Mobile.",
473      scene1_title: "Full-featured. Customizable. Lightning fast",
474      scene1_title_icon: TEST_ICON_16,
475      scene1_title_icon_dark_theme: TEST_ICON_BW,
476      scene1_section_title_icon: "chrome://global/skin/icons/pocket.svg",
477      scene1_section_title_text: "Send Firefox to your mobile device!",
478
479      scene2_button_label: "Send",
480      scene2_disclaimer_html:
481        "The intended recipient of the email must have consented. <privacyLink>Learn more</privacyLink>.",
482      scene2_dismiss_button_text: "Dismiss",
483      scene2_icon: TEST_ICON,
484      scene2_icon_dark_theme: TEST_ICON_BW,
485      scene2_input_placeholder: "Your email address or phone number",
486      scene2_text:
487        "Send Firefox to your phone and take a powerful independent browser with you.",
488      scene2_title: "Let's do this!",
489
490      error_text: "Oops, there was a problem.",
491      success_title: "Your download link was sent.",
492      success_text: "Check your device for the email message!",
493      links: {
494        privacyLink: {
495          url:
496            "https://www.mozilla.org/privacy/websites/?sample_rate=0.001&snippet_name=7894",
497        },
498      },
499    },
500  },
501  {
502    id: "EOY_TEST_1",
503    template: "eoy_snippet",
504    content: {
505      highlight_color: "#f05",
506      background_color: "#ddd",
507      text_color: "yellow",
508      selected_button: "donation_amount_first",
509      icon: TEST_ICON,
510      icon_dark_theme: TEST_ICON_BW,
511      button_label: "Donate",
512      monthly_checkbox_label_text: "Make my donation monthly",
513      currency_code: "usd",
514      donation_amount_first: 50,
515      donation_amount_second: 25,
516      donation_amount_third: 10,
517      donation_amount_fourth: 5,
518      donation_form_url:
519        "https://donate.mozilla.org/pl/?utm_source=desktop-snippet&amp;utm_medium=snippet&amp;utm_campaign=donate&amp;utm_term=7556",
520      text:
521        "Big corporations want to restrict how we access the web. Fake news is making it harder for us to find the truth. Online bullies are silencing inspired voices. The <em>not-for-profit Mozilla Foundation</em> fights for a healthy internet with programs like our Tech Policy Fellowships and Internet Health Report; <b>will you donate today</b>?",
522    },
523  },
524  {
525    id: "EOY_BOLD_TEST_1",
526    template: "eoy_snippet",
527    content: {
528      icon: TEST_ICON,
529      icon_dark_theme: TEST_ICON_BW,
530      selected_button: "donation_amount_second",
531      button_label: "Donate",
532      monthly_checkbox_label_text: "Make my donation monthly",
533      currency_code: "usd",
534      donation_amount_first: 50,
535      donation_amount_second: 25,
536      donation_amount_third: 10,
537      donation_amount_fourth: 5,
538      donation_form_url: "https://donate.mozilla.org",
539      text:
540        "Big corporations want to restrict how we access the web. Fake news is making it harder for us to find the truth. Online bullies are silencing inspired voices. The <em>not-for-profit Mozilla Foundation</em> fights for a healthy internet with programs like our Tech Policy Fellowships and Internet Health Report; <b>will you donate today</b>?",
541      test: "bold",
542    },
543  },
544  {
545    id: "EOY_TAKEOVER_TEST_1",
546    template: "eoy_snippet",
547    content: {
548      icon: TEST_ICON,
549      icon_dark_theme: TEST_ICON_BW,
550      button_label: "Donate",
551      monthly_checkbox_label_text: "Make my donation monthly",
552      currency_code: "usd",
553      donation_amount_first: 50,
554      donation_amount_second: 25,
555      donation_amount_third: 10,
556      donation_amount_fourth: 5,
557      donation_form_url: "https://donate.mozilla.org",
558      text:
559        "Big corporations want to restrict how we access the web. Fake news is making it harder for us to find the truth. Online bullies are silencing inspired voices. The <em>not-for-profit Mozilla Foundation</em> fights for a healthy internet with programs like our Tech Policy Fellowships and Internet Health Report; <b>will you donate today</b>?",
560      test: "takeover",
561    },
562  },
563  {
564    id: "SIMPLE_TEST_WITH_SECTION_HEADING",
565    template: "simple_snippet",
566    content: {
567      button_label: "Get one now!",
568      button_url: "https://www.mozilla.org/en-US/firefox/accounts",
569      icon: TEST_ICON,
570      icon_dark_theme: TEST_ICON_BW,
571      title: "Firefox Account!",
572      text:
573        "<syncLink>Sync it, link it, take it with you</syncLink>. All this and more with a Firefox Account.",
574      links: {
575        syncLink: { url: "https://www.mozilla.org/en-US/firefox/accounts" },
576      },
577      block_button_text: "Block",
578      section_title_icon: "chrome://global/skin/icons/pocket.svg",
579      section_title_text: "Messages from Mozilla",
580    },
581  },
582  {
583    id: "SIMPLE_TEST_WITH_SECTION_HEADING_AND_LINK",
584    template: "simple_snippet",
585    content: {
586      icon: TEST_ICON,
587      icon_dark_theme: TEST_ICON_BW,
588      title: "Firefox Account!",
589      text:
590        "Sync it, link it, take it with you. All this and more with a Firefox Account.",
591      block_button_text: "Block",
592      section_title_icon: "chrome://global/skin/icons/pocket.svg",
593      section_title_text: "Messages from Mozilla (click for info)",
594      section_title_url: "https://www.mozilla.org/about",
595    },
596  },
597  {
598    id: "SIMPLE_BELOW_SEARCH_TEST_1",
599    template: "simple_below_search_snippet",
600    content: {
601      icon: TEST_ICON,
602      icon_dark_theme: TEST_ICON_BW,
603      text:
604        "Securely store passwords, bookmarks, and more with a Firefox Account. <syncLink>Sign up</syncLink>",
605      links: {
606        syncLink: { url: "https://www.mozilla.org/en-US/firefox/accounts" },
607      },
608      block_button_text: "Block",
609    },
610  },
611  {
612    id: "SIMPLE_BELOW_SEARCH_TEST_2",
613    template: "simple_below_search_snippet",
614    content: {
615      icon: TEST_ICON,
616      icon_dark_theme: TEST_ICON_BW,
617      text:
618        "<syncLink>Connect your Firefox Account to Sync</syncLink> your protected passwords, open tabs and bookmarks, and they'll always be available to you - on all of your devices.",
619      links: {
620        syncLink: { url: "https://www.mozilla.org/en-US/firefox/accounts" },
621      },
622      block_button_text: "Block",
623    },
624  },
625  {
626    id: "SIMPLE_BELOW_SEARCH_TEST_TITLE",
627    template: "simple_below_search_snippet",
628    content: {
629      icon: TEST_ICON,
630      icon_dark_theme: TEST_ICON_BW,
631      title: "See if you've been part of an online data breach.",
632      text:
633        "Securely store passwords, bookmarks, and more with a Firefox Account. <syncLink>Sign up</syncLink>",
634      links: {
635        syncLink: { url: "https://www.mozilla.org/en-US/firefox/accounts" },
636      },
637      block_button_text: "Block",
638    },
639  },
640  {
641    id: "SPECIAL_SNIPPET_BUTTON_1",
642    template: "simple_below_search_snippet",
643    content: {
644      icon: TEST_ICON,
645      icon_dark_theme: TEST_ICON_BW,
646      button_label: "Find Out Now",
647      button_url: "https://www.mozilla.org/en-US/firefox/accounts",
648      title: "See if you've been part of an online data breach.",
649      text: "Firefox Monitor tells you what hackers already know about you.",
650      block_button_text: "Block",
651    },
652  },
653  {
654    id: "SPECIAL_SNIPPET_LONG_CONTENT",
655    template: "simple_below_search_snippet",
656    content: {
657      icon: TEST_ICON,
658      icon_dark_theme: TEST_ICON_BW,
659      button_label: "Find Out Now",
660      button_url: "https://www.mozilla.org/en-US/firefox/accounts",
661      title: "See if you've been part of an online data breach.",
662      text:
663        "Firefox Monitor tells you what hackers already know about you. Here's some extra text to make the content really long.",
664      block_button_text: "Block",
665    },
666  },
667  {
668    id: "SPECIAL_SNIPPET_NO_TITLE",
669    template: "simple_below_search_snippet",
670    content: {
671      icon: TEST_ICON,
672      icon_dark_theme: TEST_ICON_BW,
673      button_label: "Find Out Now",
674      button_url: "https://www.mozilla.org/en-US/firefox/accounts",
675      text: "Firefox Monitor tells you what hackers already know about you.",
676      block_button_text: "Block",
677    },
678  },
679  {
680    id: "SPECIAL_SNIPPET_MONITOR",
681    template: "simple_below_search_snippet",
682    content: {
683      icon: TEST_ICON,
684      title: "See if you've been part of an online data breach.",
685      text: "Firefox Monitor tells you what hackers already know about you.",
686      button_label: "Get monitor",
687      button_action: "ENABLE_FIREFOX_MONITOR",
688      button_action_args: {
689        url:
690          "https://monitor.firefox.com/oauth/init?utm_source=snippets&utm_campaign=monitor-snippet-test&form_type=email&entrypoint=newtab",
691        flowRequestParams: {
692          entrypoint: "snippets",
693          utm_term: "monitor",
694          form_type: "email",
695        },
696      },
697      block_button_text: "Block",
698    },
699  },
700];
701
702const SnippetsTestMessageProvider = {
703  getMessages() {
704    return Promise.resolve(
705      MESSAGES()
706        // Ensures we never actually show test except when triggered by debug tools
707        .map(message => ({
708          ...message,
709          targeting: `providerCohorts.snippets_local_testing == "SHOW_TEST"`,
710        }))
711    );
712  },
713};
714this.SnippetsTestMessageProvider = SnippetsTestMessageProvider;
715
716const EXPORTED_SYMBOLS = ["SnippetsTestMessageProvider"];
717