hypnagaga/docs/assets/SiteHeadline.stories-54d1e987.js
2023-06-10 20:17:38 +01:00

62 lines
21 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{S as ne,i as ie,s as le,j as I,m as H,b as z,t as C,n as Y,w,D as E,M as y,x as g,a as p,z as k,d as h,Y as T,E as se,e as ae,a5 as oe,p as j,k as P,l as Z}from"./index-25af778d.js";import{p as ue,M as fe,T as ce,S as M}from"./collect-stories-cce06d4a.js";import{B as de}from"./Block-9c89ee1a.js";import{c as me,g as pe}from"./_commonjsHelpers-725317a4.js";import{r as G}from"./journalize-07958dc6.js";import{w as J,a as q}from"./withParams-90715500.js";const B=`A simplified Reuters Graphics headline, loosely modelled off our dotcom site.
Styles for this headline are intentionally restricted. It is meant to serve as a unifying style for quick-turnaround, usually shorter breaking news pages.
\`\`\`html
<script>
import { SiteHeadline } from '@reuters-graphics/graphics-components';
<\/script>
<SiteHeadline
hed="Ukraine makes suprising gains in swift counteroffensive"
authors="{[
'Dea Bankova',
'Michael Ovaska',
'Samuel Granados',
'Prasanta Kumar Dutta',
]}"
publishTime="2021-09-12T00:00:00.000Z"
updateTime="2021-09-12T12:57:00.000Z"
/>
\`\`\`
`,L=`Setup your Google Doc to work with the \`SiteHeadline\` component.
\`\`\`yaml
# Beginning of your Google doc
Section: Global News
SectionUrl:
Hed: A beautiful page
Authors: Samuel Granados, Dea Bankova
Published: 2022-09-12T08:30:00.000Z
Updated:
\`\`\`
\`\`\`html
<!-- App.svelte -->
<script>
import { SiteHeadline } from '@reuters-graphics/graphics-components';
// These should be already imported for you.
import content from '$locales/en/content.json';
<\/script>
<SiteHeadline
section="{content.Section}"
sectionUrl="{content.SectionUrl}"
hed="{content.Hed}"
authors="{content.Authors.split(',')}"
publishTime="{content.Published}"
updateTime="{content.Updated}"
/>
\`\`\`
`;var re={exports:{}};(function(s,e){(function(n,t,i){s.exports=i(),s.exports.default=i()})("slugify",me,function(){var n=JSON.parse(`{"$":"dollar","%":"percent","&":"and","<":"less",">":"greater","|":"or","¢":"cent","£":"pound","¤":"currency","¥":"yen","©":"(c)","ª":"a","®":"(r)","º":"o","À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Æ":"AE","Ç":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ý":"Y","Þ":"TH","ß":"ss","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","æ":"ae","ç":"c","è":"e","é":"e","ê":"e","ë":"e","ì":"i","í":"i","î":"i","ï":"i","ð":"d","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","ù":"u","ú":"u","û":"u","ü":"u","ý":"y","þ":"th","ÿ":"y","Ā":"A","ā":"a","Ă":"A","ă":"a","Ą":"A","ą":"a","Ć":"C","ć":"c","Č":"C","č":"c","Ď":"D","ď":"d","Đ":"DJ","đ":"dj","Ē":"E","ē":"e","Ė":"E","ė":"e","Ę":"e","ę":"e","Ě":"E","ě":"e","Ğ":"G","ğ":"g","Ģ":"G","ģ":"g","Ĩ":"I","ĩ":"i","Ī":"i","ī":"i","Į":"I","į":"i","İ":"I","ı":"i","Ķ":"k","ķ":"k","Ļ":"L","ļ":"l","Ľ":"L","ľ":"l","Ł":"L","ł":"l","Ń":"N","ń":"n","Ņ":"N","ņ":"n","Ň":"N","ň":"n","Ō":"O","ō":"o","Ő":"O","ő":"o","Œ":"OE","œ":"oe","Ŕ":"R","ŕ":"r","Ř":"R","ř":"r","Ś":"S","ś":"s","Ş":"S","ş":"s","Š":"S","š":"s","Ţ":"T","ţ":"t","Ť":"T","ť":"t","Ũ":"U","ũ":"u","Ū":"u","ū":"u","Ů":"U","ů":"u","Ű":"U","ű":"u","Ų":"U","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","ź":"z","Ż":"Z","ż":"z","Ž":"Z","ž":"z","Ə":"E","ƒ":"f","Ơ":"O","ơ":"o","Ư":"U","ư":"u","Lj":"LJ","lj":"lj","Nj":"NJ","nj":"nj","Ș":"S","ș":"s","Ț":"T","ț":"t","ə":"e","˚":"o","Ά":"A","Έ":"E","Ή":"H","Ί":"I","Ό":"O","Ύ":"Y","Ώ":"W","ΐ":"i","Α":"A","Β":"B","Γ":"G","Δ":"D","Ε":"E","Ζ":"Z","Η":"H","Θ":"8","Ι":"I","Κ":"K","Λ":"L","Μ":"M","Ν":"N","Ξ":"3","Ο":"O","Π":"P","Ρ":"R","Σ":"S","Τ":"T","Υ":"Y","Φ":"F","Χ":"X","Ψ":"PS","Ω":"W","Ϊ":"I","Ϋ":"Y","ά":"a","έ":"e","ή":"h","ί":"i","ΰ":"y","α":"a","β":"b","γ":"g","δ":"d","ε":"e","ζ":"z","η":"h","θ":"8","ι":"i","κ":"k","λ":"l","μ":"m","ν":"n","ξ":"3","ο":"o","π":"p","ρ":"r","ς":"s","σ":"s","τ":"t","υ":"y","φ":"f","χ":"x","ψ":"ps","ω":"w","ϊ":"i","ϋ":"y","ό":"o","ύ":"y","ώ":"w","Ё":"Yo","Ђ":"DJ","Є":"Ye","І":"I","Ї":"Yi","Ј":"J","Љ":"LJ","Њ":"NJ","Ћ":"C","Џ":"DZ","А":"A","Б":"B","В":"V","Г":"G","Д":"D","Е":"E","Ж":"Zh","З":"Z","И":"I","Й":"J","К":"K","Л":"L","М":"M","Н":"N","О":"O","П":"P","Р":"R","С":"S","Т":"T","У":"U","Ф":"F","Х":"H","Ц":"C","Ч":"Ch","Ш":"Sh","Щ":"Sh","Ъ":"U","Ы":"Y","Ь":"","Э":"E","Ю":"Yu","Я":"Ya","а":"a","б":"b","в":"v","г":"g","д":"d","е":"e","ж":"zh","з":"z","и":"i","й":"j","к":"k","л":"l","м":"m","н":"n","о":"o","п":"p","р":"r","с":"s","т":"t","у":"u","ф":"f","х":"h","ц":"c","ч":"ch","ш":"sh","щ":"sh","ъ":"u","ы":"y","ь":"","э":"e","ю":"yu","я":"ya","ё":"yo","ђ":"dj","є":"ye","і":"i","ї":"yi","ј":"j","љ":"lj","њ":"nj","ћ":"c","ѝ":"u","џ":"dz","Ґ":"G","ґ":"g","Ғ":"GH","ғ":"gh","Қ":"KH","қ":"kh","Ң":"NG","ң":"ng","Ү":"UE","ү":"ue","Ұ":"U","ұ":"u","Һ":"H","һ":"h","Ә":"AE","ә":"ae","Ө":"OE","ө":"oe","Ա":"A","Բ":"B","Գ":"G","Դ":"D","Ե":"E","Զ":"Z","Է":"E'","Ը":"Y'","Թ":"T'","Ժ":"JH","Ի":"I","Լ":"L","Խ":"X","Ծ":"C'","Կ":"K","Հ":"H","Ձ":"D'","Ղ":"GH","Ճ":"TW","Մ":"M","Յ":"Y","Ն":"N","Շ":"SH","Չ":"CH","Պ":"P","Ջ":"J","Ռ":"R'","Ս":"S","Վ":"V","Տ":"T","Ր":"R","Ց":"C","Փ":"P'","Ք":"Q'","Օ":"O''","Ֆ":"F","և":"EV","ء":"a","آ":"aa","أ":"a","ؤ":"u","إ":"i","ئ":"e","ا":"a","ب":"b","ة":"h","ت":"t","ث":"th","ج":"j","ح":"h","خ":"kh","د":"d","ذ":"th","ر":"r","ز":"z","س":"s","ش":"sh","ص":"s","ض":"dh","ط":"t","ظ":"z","ع":"a","غ":"gh","ف":"f","ق":"q","ك":"k","ل":"l","م":"m","ن":"n","ه":"h","و":"w","ى":"a","ي":"y","ً":"an","ٌ":"on","ٍ":"en","َ":"a","ُ":"u","ِ":"e","ْ":"","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","پ":"p","چ":"ch","ژ":"zh","ک":"k","گ":"g","ی":"y","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","฿":"baht","ა":"a","ბ":"b","გ":"g","დ":"d","ე":"e","ვ":"v","ზ":"z","თ":"t","ი":"i","კ":"k","ლ":"l","მ":"m","ნ":"n","ო":"o","პ":"p","ჟ":"zh","რ":"r","ს":"s","ტ":"t","უ":"u","ფ":"f","ქ":"k","ღ":"gh","":"q","შ":"sh","ჩ":"ch","ც":"ts","ძ":"dz","წ":"ts","ჭ":"ch","ხ":"kh","ჯ":"j","ჰ":"h","Ṣ":"S","ṣ":"s","Ẁ":"W","ẁ":"w","Ẃ":"W","ẃ":"w","Ẅ":"W","ẅ":"w","ẞ":"SS","Ạ":"A","ạ":"a","Ả":"A","ả":"a","Ấ":"A","ấ":"a","Ầ":"A","ầ":"a","Ẩ":"A","ẩ":"a","Ẫ":"A","ẫ":"a","Ậ":"A","ậ":"a","Ắ":"A","ắ":"a","Ằ":"A","ằ":"a","Ẳ":"A","ẳ":"a","Ẵ":"A","ẵ":"a","Ặ":"A","ặ":"a","Ẹ":"E","ẹ":"e","Ẻ":"E","ẻ":"e","Ẽ":"E","ẽ":"e","Ế":"E","ế":"e","Ề":"E","ề":"e","Ể":"E","ể":"e","Ễ":"E","ễ":"e","Ệ":"E","ệ":"e","Ỉ":"I","ỉ":"i","Ị":"I","ị":"i","Ọ":"O","ọ":"o","Ỏ":"O","ỏ":"o","Ố":"O","ố":"o","Ồ":"O","ồ":"o","Ổ":"O","ổ":"o","Ỗ":"O","ỗ":"o","Ộ":"O","ộ":"o","Ớ":"O","ớ":"o","Ờ":"O","ờ":"o","Ở":"O","ở":"o","Ỡ":"O","ỡ":"o","Ợ":"O","ợ":"o","Ụ":"U","ụ":"u","Ủ":"U","ủ":"u","Ứ":"U","ứ":"u","Ừ":"U","ừ":"u","Ử":"U","ử":"u","Ữ":"U","ữ":"u","Ự":"U","ự":"u","Ỳ":"Y","ỳ":"y","Ỵ":"Y","ỵ":"y","Ỷ":"Y","ỷ":"y","Ỹ":"Y","ỹ":"y","":"-","":"'","":"'","“":"\\"","”":"\\"","„":"\\"","†":"+","•":"*","…":"...","₠":"ecu","₢":"cruzeiro","₣":"french franc","₤":"lira","₥":"mill","₦":"naira","₧":"peseta","₨":"rupee","₩":"won","₪":"new shequel","₫":"dong","€":"euro","₭":"kip","₮":"tugrik","₯":"drachma","₰":"penny","₱":"peso","₲":"guarani","₳":"austral","₴":"hryvnia","₵":"cedi","₸":"kazakhstani tenge","₹":"indian rupee","₺":"turkish lira","₽":"russian ruble","₿":"bitcoin","℠":"sm","™":"tm","∂":"d","∆":"delta","∑":"sum","∞":"infinity","♥":"love","元":"yuan","円":"yen","﷼":"rial","ﻵ":"laa","ﻷ":"laa","ﻹ":"lai","ﻻ":"la"}`),t=JSON.parse('{"bg":{"Й":"Y","Ц":"Ts","Щ":"Sht","Ъ":"A","Ь":"Y","й":"y","ц":"ts","щ":"sht","ъ":"a","ь":"y"},"de":{"Ä":"AE","ä":"ae","Ö":"OE","ö":"oe","Ü":"UE","ü":"ue","ß":"ss","%":"prozent","&":"und","|":"oder","∑":"summe","∞":"unendlich","♥":"liebe"},"es":{"%":"por ciento","&":"y","<":"menor que",">":"mayor que","|":"o","¢":"centavos","£":"libras","¤":"moneda","₣":"francos","∑":"suma","∞":"infinito","♥":"amor"},"fr":{"%":"pourcent","&":"et","<":"plus petit",">":"plus grand","|":"ou","¢":"centime","£":"livre","¤":"devise","₣":"franc","∑":"somme","∞":"infini","♥":"amour"},"pt":{"%":"porcento","&":"e","<":"menor",">":"maior","|":"ou","¢":"centavo","∑":"soma","£":"libra","∞":"infinito","♥":"amor"},"uk":{"И":"Y","и":"y","Й":"Y","й":"y","Ц":"Ts","ц":"ts","Х":"Kh","х":"kh","Щ":"Shch","щ":"shch","Г":"H","г":"h"},"vi":{"Đ":"D","đ":"d"},"da":{"Ø":"OE","ø":"oe","Å":"AA","å":"aa","%":"procent","&":"og","|":"eller","$":"dollar","<":"mindre end",">":"større end"},"nb":{"&":"og","Å":"AA","Æ":"AE","Ø":"OE","å":"aa","æ":"ae","ø":"oe"},"it":{"&":"e"},"nl":{"&":"en"},"sv":{"&":"och","Å":"AA","Ä":"AE","Ö":"OE","å":"aa","ä":"ae","ö":"oe"}}');function i(a,l){if(typeof a!="string")throw new Error("slugify: string argument expected");l=typeof l=="string"?{replacement:l}:l||{};var r=t[l.locale]||{},f=l.replacement===void 0?"-":l.replacement,c=l.trim===void 0?!0:l.trim,d=a.normalize().split("").reduce(function(A,S){var u=r[S];return u===void 0&&(u=n[S]),u===void 0&&(u=S),u===f&&(u=" "),A+u.replace(l.remove||/[^\w\s$*_+~.()'"!\-:@]+/g,"")},"");return l.strict&&(d=d.replace(/[^A-Za-z0-9\s]/g,"")),c&&(d=d.trim()),d=d.replace(/\s+/g,f),l.lower&&(d=d.toLowerCase()),d}return i.extend=function(a){Object.assign(n,a)},i})})(re);var he=re.exports;const R=pe(he);function V(s,e,n){const t=s.slice();return t[11]=e[n],t[13]=n,t}function Q(s){let e;function n(a,l){return a[2]?ge:_e}let t=n(s),i=t(s);return{c(){e=w("p"),i.c(),g(e,"class","section-title svelte-1t4mozu")},m(a,l){p(a,e,l),i.m(e,null)},p(a,l){t===(t=n(a))&&i?i.p(a,l):(i.d(1),i=t(a),i&&(i.c(),i.m(e,null)))},d(a){a&&h(e),i.d()}}}function _e(s){let e;return{c(){e=y(s[1])},m(n,t){p(n,e,t)},p(n,t){t&2&&T(e,n[1])},d(n){n&&h(e)}}}function ge(s){let e,n;return{c(){e=w("a"),n=y(s[1]),g(e,"href",s[2]),g(e,"class","svelte-1t4mozu")},m(t,i){p(t,e,i),k(e,n)},p(t,i){i&2&&T(n,t[1]),i&4&&g(e,"href",t[2])},d(t){t&&h(e)}}}function W(s){let e,n;return{c(){e=w("h1"),n=y(s[0]),g(e,"class","svelte-1t4mozu")},m(t,i){p(t,e,i),k(e,n)},p(t,i){i&1&&T(n,t[0])},d(t){t&&h(e)}}}function ye(s){let e;return{c(){e=y("Reuters")},m(n,t){p(n,e,t)},p:se,d(n){n&&h(e)}}}function ke(s){let e,n=s[3],t=[];for(let i=0;i<n.length;i+=1)t[i]=x(V(s,n,i));return{c(){for(let i=0;i<t.length;i+=1)t[i].c();e=ae()},m(i,a){for(let l=0;l<t.length;l+=1)t[l]&&t[l].m(i,a);p(i,e,a)},p(i,a){if(a&8){n=i[3];let l;for(l=0;l<n.length;l+=1){const r=V(i,n,l);t[l]?t[l].p(r,a):(t[l]=x(r),t[l].c(),t[l].m(e.parentNode,e))}for(;l<t.length;l+=1)t[l].d(1);t.length=n.length}},d(i){oe(t,i),i&&h(e)}}}function F(s){let e;return{c(){e=y(",")},m(n,t){p(n,e,t)},d(n){n&&h(e)}}}function X(s){let e;return{c(){e=y("and ")},m(n,t){p(n,e,t)},d(n){n&&h(e)}}}function x(s){let e,n=s[11].trim()+"",t,i,a,l,r=s[3].length>1&&s[13]<s[3].length-2&&F(),f=s[3].length>1&&s[13]===s[3].length-2&&X();return{c(){e=w("a"),t=y(n),r&&r.c(),a=E(),f&&f.c(),l=ae(),g(e,"href",i="https://www.reuters.com/authors/"+R(s[11].trim(),{lower:!0})+"/"),g(e,"rel","author"),g(e,"class","svelte-1t4mozu")},m(c,d){p(c,e,d),k(e,t),r&&r.m(c,d),p(c,a,d),f&&f.m(c,d),p(c,l,d)},p(c,d){d&8&&n!==(n=c[11].trim()+"")&&T(t,n),d&8&&i!==(i="https://www.reuters.com/authors/"+R(c[11].trim(),{lower:!0})+"/")&&g(e,"href",i),c[3].length>1&&c[13]<c[3].length-2?r||(r=F(),r.c(),r.m(a.parentNode,a)):r&&(r.d(1),r=null),c[3].length>1&&c[13]===c[3].length-2?f||(f=X(),f.c(),f.m(l.parentNode,l)):f&&(f.d(1),f=null)},d(c){c&&h(e),r&&r.d(c),c&&h(a),f&&f.d(c),c&&h(l)}}}function ee(s){let e,n,t,i;function a(f,c){return c&32&&(i=null),i==null&&(i=!!f[8](f[5])),i?ve:be}let l=a(s,-1),r=l(s);return{c(){e=w("div"),n=y(`Published
`),t=w("time"),r.c(),g(t,"datetime",s[4])},m(f,c){p(f,e,c),k(e,n),k(e,t),r.m(t,null)},p(f,c){l===(l=a(f,c))&&r?r.p(f,c):(r.d(1),r=l(f),r&&(r.c(),r.m(t,null))),c&16&&g(t,"datetime",f[4])},d(f){f&&h(e),r.d()}}}function be(s){let e=G(new Date(s[4]))+"",n,t,i=s[9](s[4])+"",a;return{c(){n=y(e),t=y("  "),a=y(i)},m(l,r){p(l,n,r),p(l,t,r),p(l,a,r)},p(l,r){r&16&&e!==(e=G(new Date(l[4]))+"")&&T(n,e),r&16&&i!==(i=l[9](l[4])+"")&&T(a,i)},d(l){l&&h(n),l&&h(t),l&&h(a)}}}function ve(s){let e=G(new Date(s[4]))+"",n;return{c(){n=y(e)},m(t,i){p(t,n,i)},p(t,i){i&16&&e!==(e=G(new Date(t[4]))+"")&&T(n,e)},d(t){t&&h(n)}}}function te(s){let e,n,t,i;function a(f,c){return c&48&&(i=null),i==null&&(i=!!f[10](new Date(f[4]),new Date(f[5]))),i?Se:we}let l=a(s,-1),r=l(s);return{c(){e=w("div"),n=y(`Last updated
`),t=w("time"),r.c(),g(t,"datetime",s[5])},m(f,c){p(f,e,c),k(e,n),k(e,t),r.m(t,null)},p(f,c){l===(l=a(f,c))&&r?r.p(f,c):(r.d(1),r=l(f),r&&(r.c(),r.m(t,null))),c&32&&g(t,"datetime",f[5])},d(f){f&&h(e),r.d()}}}function we(s){let e=G(new Date(s[5]))+"",n,t,i=s[9](s[5])+"",a;return{c(){n=y(e),t=y("  "),a=y(i)},m(l,r){p(l,n,r),p(l,t,r),p(l,a,r)},p(l,r){r&32&&e!==(e=G(new Date(l[5]))+"")&&T(n,e),r&32&&i!==(i=l[9](l[5])+"")&&T(a,i)},d(l){l&&h(n),l&&h(t),l&&h(a)}}}function Se(s){let e=s[9](s[5])+"",n;return{c(){n=y(e)},m(t,i){p(t,n,i)},p(t,i){i&32&&e!==(e=t[9](t[5])+"")&&T(n,e)},d(t){t&&h(n)}}}function Ae(s){let e,n,t,i,a,l,r,f,c,d,A=s[8](s[4]),S,u=s[8](s[4])&&s[8](s[5]),o=s[1]&&Q(s),_=s[0]&&W(s);function $(m,U){return m[3].length>0?ke:ye}let O=$(s),D=O(s),b=A&&ee(s),v=u&&te(s);return{c(){e=w("header"),n=w("div"),o&&o.c(),t=E(),_&&_.c(),i=E(),a=w("aside"),l=w("div"),r=w("div"),f=y(`By
`),D.c(),c=E(),d=w("div"),b&&b.c(),S=E(),v&&v.c(),g(n,"class","title"),g(r,"class","byline svelte-1t4mozu"),g(l,"class","byline-container svelte-1t4mozu"),g(d,"class","dateline-container svelte-1t4mozu"),g(a,"class","article-metadata svelte-1t4mozu"),g(e,"class","headline svelte-1t4mozu")},m(m,U){p(m,e,U),k(e,n),o&&o.m(n,null),k(n,t),_&&_.m(n,null),k(e,i),k(e,a),k(a,l),k(l,r),k(r,f),D.m(r,null),k(a,c),k(a,d),b&&b.m(d,null),k(d,S),v&&v.m(d,null)},p(m,U){m[1]?o?o.p(m,U):(o=Q(m),o.c(),o.m(n,t)):o&&(o.d(1),o=null),m[0]?_?_.p(m,U):(_=W(m),_.c(),_.m(n,null)):_&&(_.d(1),_=null),O===(O=$(m))&&D?D.p(m,U):(D.d(1),D=O(m),D&&(D.c(),D.m(r,null))),U&16&&(A=m[8](m[4])),A?b?b.p(m,U):(b=ee(m),b.c(),b.m(d,S)):b&&(b.d(1),b=null),U&48&&(u=m[8](m[4])&&m[8](m[5])),u?v?v.p(m,U):(v=te(m),v.c(),v.m(d,null)):v&&(v.d(1),v=null)},d(m){m&&h(e),o&&o.d(),_&&_.d(),D.d(),b&&b.d(),v&&v.d()}}}function De(s){let e,n;return e=new de({props:{id:s[6],cls:"headline-container "+s[7],width:"normal",$$slots:{default:[Ae]},$$scope:{ctx:s}}}),{c(){I(e.$$.fragment)},m(t,i){H(e,t,i),n=!0},p(t,[i]){const a={};i&64&&(a.id=t[6]),i&128&&(a.cls="headline-container "+t[7]),i&16447&&(a.$$scope={dirty:i,ctx:t}),e.$set(a)},i(t){n||(z(e.$$.fragment,t),n=!0)},o(t){C(e.$$.fragment,t),n=!1},d(t){Y(e,t)}}}function Ue(s,e,n){let{hed:t="Reuters Graphics Interactive"}=e,{section:i="Graphics"}=e,{sectionUrl:a="https://graphics.reuters.com"}=e,{authors:l=[]}=e,{publishTime:r=""}=e,{updateTime:f=""}=e,{id:c=""}=e,{cls:d=""}=e;const A=o=>!(!o||!Date.parse(o)),S=o=>new Date(o).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",timeZoneName:"short"}),u=(o,_)=>o.getFullYear()===_.getFullYear()&&o.getMonth()===_.getMonth()&&o.getDate()===_.getDate();return s.$$set=o=>{"hed"in o&&n(0,t=o.hed),"section"in o&&n(1,i=o.section),"sectionUrl"in o&&n(2,a=o.sectionUrl),"authors"in o&&n(3,l=o.authors),"publishTime"in o&&n(4,r=o.publishTime),"updateTime"in o&&n(5,f=o.updateTime),"id"in o&&n(6,c=o.id),"cls"in o&&n(7,d=o.cls)},[t,i,a,l,r,f,c,d,A,S,u]}class N extends ne{constructor(e){super(),ie(this,e,Ue,De,le,{hed:0,section:1,sectionUrl:2,authors:3,publishTime:4,updateTime:5,id:6,cls:7})}}N.__docgen={version:3,name:"SiteHeadline.svelte",data:[{keywords:[{name:"type",description:"{string}"},{name:"required",description:""}],visibility:"public",description:"Headline",name:"hed",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:"Reuters Graphics Interactive"},{keywords:[{name:"type",description:"{string}"}],visibility:"public",description:"Section title.",name:"section",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:"Graphics"},{keywords:[{name:"type",description:"{string}"}],visibility:"public",description:"Section url, parsed as a string. Set to blank to remove link.",name:"sectionUrl",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:"https://graphics.reuters.com"},{keywords:[],visibility:"public",description:"Array of author names, which will be slugified to create links to Reuters author pages",name:"authors",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"array",type:"array"}},{keywords:[{name:"type",description:"{string}"}],visibility:"public",description:"Publish time as a datetime string.",name:"publishTime",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:""},{keywords:[{name:"type",description:"{string}"}],visibility:"public",description:"Update time as a datetime string.",name:"updateTime",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:""},{keywords:[{name:"type",description:"{string}"}],visibility:"public",description:"Add an id to to target with custom CSS.",name:"id",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:""},{keywords:[{name:"type",description:"{string}"}],visibility:"public",description:"Add extra classes to target with custom CSS.",name:"cls",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:""}],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[],refs:[]};function Te(s){let e,n;const t=[s[1]];let i={};for(let a=0;a<t.length;a+=1)i=j(i,t[a]);return e=new N({props:i}),{c(){I(e.$$.fragment)},m(a,l){H(e,a,l),n=!0},p(a,l){const r=l&2?P(t,[Z(a[1])]):{};e.$set(r)},i(a){n||(z(e.$$.fragment,a),n=!0)},o(a){C(e.$$.fragment,a),n=!1},d(a){Y(e,a)}}}function Ee(s){let e,n;return e=new N({props:{hed:s[0].Hed,section:s[0].Section,sectionUrl:s[0].SectionUrl,authors:s[0].Authors.split(","),publishTime:s[0].Published}}),{c(){I(e.$$.fragment)},m(t,i){H(e,t,i),n=!0},p:se,i(t){n||(z(e.$$.fragment,t),n=!0)},o(t){C(e.$$.fragment,t),n=!1},d(t){Y(e,t)}}}function Oe(s){let e,n,t,i,a,l,r,f;const c=[{title:"Components/SiteHeadline"},{component:N},J(B)];let d={};for(let u=0;u<c.length;u+=1)d=j(d,c[u]);e=new fe({props:d}),t=new ce({props:{$$slots:{default:[Te,({args:u})=>({1:u}),({args:u})=>u?2:0]},$$scope:{ctx:s}}}),a=new M({props:{name:"Default",args:{section:"Graphics",sectionUrl:"https://graphics.reuters.com",hed:"Ukraine makes surprising gains in swift counteroffensive",authors:["Dea Bankova","Michael Ovaska","Samuel Granados","Prasanta Kumar Dutta"],publishTime:new Date("2021-09-12").toISOString(),updateTime:new Date("2021-09-12T13:57:00").toISOString()}}});const A=[{name:"🚀 QUICKIT"},q(L)];let S={$$slots:{default:[Ee]},$$scope:{ctx:s}};for(let u=0;u<A.length;u+=1)S=j(S,A[u]);return r=new M({props:S}),{c(){I(e.$$.fragment),n=E(),I(t.$$.fragment),i=E(),I(a.$$.fragment),l=E(),I(r.$$.fragment)},m(u,o){H(e,u,o),p(u,n,o),H(t,u,o),p(u,i,o),H(a,u,o),p(u,l,o),H(r,u,o),f=!0},p(u,[o]){const _=o&0?P(c,[c[0],o&0&&{component:N},o&0&&Z(J(B))]):{};e.$set(_);const $={};o&6&&($.$$scope={dirty:o,ctx:u}),t.$set($);const O=o&0?P(A,[A[0],Z(q(L))]):{};o&4&&(O.$$scope={dirty:o,ctx:u}),r.$set(O)},i(u){f||(z(e.$$.fragment,u),z(t.$$.fragment,u),z(a.$$.fragment,u),z(r.$$.fragment,u),f=!0)},o(u){C(e.$$.fragment,u),C(t.$$.fragment,u),C(a.$$.fragment,u),C(r.$$.fragment,u),f=!1},d(u){Y(e,u),u&&h(n),Y(t,u),u&&h(i),Y(a,u),u&&h(l),Y(r,u)}}}function Ie(s){return[{Section:"Global News",SectionUrl:"",Hed:"A beautiful page",Authors:"Samuel Granados, Dea Bankova",Published:"2022-09-12T08:30:00.000Z",Updated:""}]}class He extends ne{constructor(e){super(),ie(this,e,Ie,Oe,le,{})}}const K=ue(He,{meta:{title:"Components/SiteHeadline"},stories:{"tpl:default":{storyId:"components-siteheadline--default",name:"default",template:!0,source:"<SiteHeadline {...args} />",hasArgs:!0},Default:{storyId:"components-siteheadline--default",name:"Default",template:!1,hasArgs:!1},QUICKIT:{storyId:"components-siteheadline--quickit",name:"🚀 QUICKIT",template:!1,source:`<SiteHeadline
hed="{content.Hed}"
section="{content.Section}"
sectionUrl="{content.SectionUrl}"
authors="{content.Authors.split(',')}"
publishTime="{content.Published}"
/>`,hasArgs:!1}},allocatedIds:["default","Meta","Template","Story","componentDocs","quickitDocs","SiteHeadline","withComponentDocs","withStoryDocs"]}),je=K.meta,Pe=["Default","QUICKIT"],Ze=K.stories.Default,Ke=K.stories.QUICKIT;export{Ze as Default,Ke as QUICKIT,Pe as __namedExportsOrder,je as default};
//# sourceMappingURL=SiteHeadline.stories-54d1e987.js.map