@micromag/screen-urbania-article 0.4.70 → 0.4.74

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.
Files changed (3) hide show
  1. package/es/index.d.ts +6 -4
  2. package/es/index.js +2129 -912
  3. package/package.json +22 -21
package/es/index.js CHANGED
@@ -1,13 +1,10 @@
1
1
  import { FormattedMessage, defineMessage, useIntl } from 'react-intl';
2
- import _objectSpread from '@babel/runtime/helpers/objectSpread2';
3
- import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
4
- import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
2
+ import { c } from 'react/compiler-runtime';
5
3
  import { getJSON } from '@folklore/fetch';
6
- import React, { useMemo, useState, useEffect, useCallback } from 'react';
7
- import { isTextFilled, isHeaderFilled, isFooterFilled, getFooterProps, getStyleFromColor, isValidUrl } from '@micromag/core/utils';
8
- import _defineProperty from '@babel/runtime/helpers/defineProperty';
4
+ import React, { useState, useEffect } from 'react';
5
+ import { isTextFilled, isHeaderFilled, isFooterFilled, getFooterProps, getStyleFromColor, mergeRefs, isValidUrl } from '@micromag/core/utils';
9
6
  import classNames from 'classnames';
10
- import { ScreenElement, Empty, PlaceholderSubtitle, PlaceholderTitle, PlaceholderImage, PlaceholderText } from '@micromag/core/components';
7
+ import { ScreenElement, PlaceholderSubtitle, Empty, PlaceholderTitle, PlaceholderImage, PlaceholderText } from '@micromag/core/components';
11
8
  import { useScreenSize, useScreenRenderContext, useViewerWebView, useViewerContext, useViewerInteraction, usePlaybackContext, usePlaybackMediaRef } from '@micromag/core/contexts';
12
9
  import { useDimensionObserver, useResizeObserver } from '@micromag/core/hooks';
13
10
  import Background from '@micromag/element-background';
@@ -19,62 +16,78 @@ import Text from '@micromag/element-text';
19
16
  import UrbaniaAuthor from '@micromag/element-urbania-author';
20
17
  import Visual from '@micromag/element-visual';
21
18
  import { jsx, jsxs } from 'react/jsx-runtime';
22
- import { useSpring, easings, animated } from '@react-spring/web';
19
+ import { easings, useSpring, animated } from '@react-spring/web';
23
20
  import { useGesture } from '@use-gesture/react';
24
21
  import isString from 'lodash/isString';
25
22
  import queryString from 'query-string';
26
23
  import Layout from '@micromag/element-layout';
27
24
 
28
- function Arrow(_ref) {
29
- var _ref$color = _ref.color,
30
- color = _ref$color === void 0 ? 'currentColor' : _ref$color,
31
- _ref$strokeWidth = _ref.strokeWidth,
32
- strokeWidth = _ref$strokeWidth === void 0 ? 3 : _ref$strokeWidth,
33
- _ref$className = _ref.className,
34
- className = _ref$className === void 0 ? null : _ref$className;
35
- return /*#__PURE__*/jsx("svg", {
36
- version: "1.1",
37
- xmlns: "http://www.w3.org/2000/svg",
38
- xmlnsXlink: "http://www.w3.org/1999/xlink",
39
- x: "0",
40
- y: "0px",
41
- width: "48.53px",
42
- height: "12.38px",
43
- viewBox: "0 0 48.53 12.38",
44
- className: className,
45
- xmlSpace: "preserve",
46
- children: /*#__PURE__*/jsx("g", {
25
+ function Arrow(t0) {
26
+ const $ = c(6);
27
+ const {
28
+ color: t1,
29
+ strokeWidth: t2,
30
+ className: t3
31
+ } = t0;
32
+ const color = t1 === undefined ? "currentColor" : t1;
33
+ const strokeWidth = t2 === undefined ? 3 : t2;
34
+ const className = t3 === undefined ? null : t3;
35
+ const t4 = `${strokeWidth}px`;
36
+ let t5;
37
+ if ($[0] !== color || $[1] !== t4) {
38
+ t5 = /*#__PURE__*/jsx("g", {
47
39
  transform: "matrix(1, 0, 0, 1, 0, 0)",
48
40
  children: /*#__PURE__*/jsx("path", {
49
41
  id: "b",
50
42
  fill: "none",
51
43
  stroke: color,
52
- strokeWidth: "".concat(strokeWidth, "px"),
44
+ strokeWidth: t4,
53
45
  strokeLinejoin: "round",
54
46
  strokeLinecap: "round",
55
47
  d: "M1.5,10.88L24.26,1.5l22.77,9.38"
56
48
  })
57
- })
58
- });
49
+ });
50
+ $[0] = color;
51
+ $[1] = t4;
52
+ $[2] = t5;
53
+ } else {
54
+ t5 = $[2];
55
+ }
56
+ let t6;
57
+ if ($[3] !== className || $[4] !== t5) {
58
+ t6 = /*#__PURE__*/jsx("svg", {
59
+ version: "1.1",
60
+ xmlns: "http://www.w3.org/2000/svg",
61
+ xmlnsXlink: "http://www.w3.org/1999/xlink",
62
+ x: "0",
63
+ y: "0px",
64
+ width: "48.53px",
65
+ height: "12.38px",
66
+ viewBox: "0 0 48.53 12.38",
67
+ className: className,
68
+ xmlSpace: "preserve",
69
+ children: t5
70
+ });
71
+ $[3] = className;
72
+ $[4] = t5;
73
+ $[5] = t6;
74
+ } else {
75
+ t6 = $[5];
76
+ }
77
+ return t6;
59
78
  }
60
79
 
61
- function WatchIcon(_ref) {
62
- var _ref$color = _ref.color,
63
- color = _ref$color === void 0 ? '#222' : _ref$color,
64
- _ref$className = _ref.className,
65
- className = _ref$className === void 0 ? null : _ref$className;
66
- return /*#__PURE__*/jsx("svg", {
67
- version: "1.1",
68
- xmlns: "http://www.w3.org/2000/svg",
69
- xmlnsXlink: "http://www.w3.org/1999/xlink",
70
- x: "0",
71
- y: "0px",
72
- width: "17.76px",
73
- height: "17.76px",
74
- viewBox: "0 0 17.76 17.76",
75
- className: className,
76
- xmlSpace: "preserve",
77
- children: /*#__PURE__*/jsxs("g", {
80
+ function WatchIcon(t0) {
81
+ const $ = c(5);
82
+ const {
83
+ color: t1,
84
+ className: t2
85
+ } = t0;
86
+ const color = t1 === undefined ? "#222" : t1;
87
+ const className = t2 === undefined ? null : t2;
88
+ let t3;
89
+ if ($[0] !== color) {
90
+ t3 = /*#__PURE__*/jsxs("g", {
78
91
  transform: "translate(0 0)",
79
92
  children: [/*#__PURE__*/jsx("path", {
80
93
  fill: color,
@@ -83,272 +96,632 @@ function WatchIcon(_ref) {
83
96
  fill: color,
84
97
  d: "M7.42,8.89v-2.61c-.02-.2,.09-.4,.28-.48,.15-.06,.32-.04,.44,.06,.39,.28,.78,.56,1.17,.85,.82,.59,1.63,1.19,2.45,1.78,.22,.11,.3,.38,.19,.59-.04,.08-.11,.15-.19,.19-.6,.45-1.21,.89-1.82,1.33-.59,.43-1.18,.86-1.78,1.29-.16,.17-.43,.17-.6,0-.02-.02-.03-.03-.04-.05-.07-.11-.1-.24-.1-.37,0-.86,0-1.72,0-2.58h0Z"
85
98
  })]
86
- })
87
- });
99
+ });
100
+ $[0] = color;
101
+ $[1] = t3;
102
+ } else {
103
+ t3 = $[1];
104
+ }
105
+ let t4;
106
+ if ($[2] !== className || $[3] !== t3) {
107
+ t4 = /*#__PURE__*/jsx("svg", {
108
+ version: "1.1",
109
+ xmlns: "http://www.w3.org/2000/svg",
110
+ xmlnsXlink: "http://www.w3.org/1999/xlink",
111
+ x: "0",
112
+ y: "0px",
113
+ width: "17.76px",
114
+ height: "17.76px",
115
+ viewBox: "0 0 17.76 17.76",
116
+ className: className,
117
+ xmlSpace: "preserve",
118
+ children: t3
119
+ });
120
+ $[2] = className;
121
+ $[3] = t3;
122
+ $[4] = t4;
123
+ } else {
124
+ t4 = $[4];
125
+ }
126
+ return t4;
88
127
  }
89
128
 
90
129
  var styles$1 = {"container":"micromag-screen-urbania-article-urbania-base-article-container","isPlaceholder":"micromag-screen-urbania-article-urbania-base-article-isPlaceholder","articleContent":"micromag-screen-urbania-article-urbania-base-article-articleContent","visual":"micromag-screen-urbania-article-urbania-base-article-visual","isVideo":"micromag-screen-urbania-article-urbania-base-article-isVideo","title":"micromag-screen-urbania-article-urbania-base-article-title","description":"micromag-screen-urbania-article-urbania-base-article-description","sponsors":"micromag-screen-urbania-article-urbania-base-article-sponsors","callToAction":"micromag-screen-urbania-article-urbania-base-article-callToAction","placeholder":"micromag-screen-urbania-article-urbania-base-article-placeholder","emptyContainer":"micromag-screen-urbania-article-urbania-base-article-emptyContainer","small":"micromag-screen-urbania-article-urbania-base-article-small","empty":"micromag-screen-urbania-article-urbania-base-article-empty","background":"micromag-screen-urbania-article-urbania-base-article-background","video":"micromag-screen-urbania-article-urbania-base-article-video","content":"micromag-screen-urbania-article-urbania-base-article-content","overTitle":"micromag-screen-urbania-article-urbania-base-article-overTitle","authors":"micromag-screen-urbania-article-urbania-base-article-authors","lede":"micromag-screen-urbania-article-urbania-base-article-lede","isAboveDescription":"micromag-screen-urbania-article-urbania-base-article-isAboveDescription","sponsor":"micromag-screen-urbania-article-urbania-base-article-sponsor","quatre95":"micromag-screen-urbania-article-urbania-base-article-quatre95","author":"micromag-screen-urbania-article-urbania-base-article-author","urbania":"micromag-screen-urbania-article-urbania-base-article-urbania","dehors":"micromag-screen-urbania-article-urbania-base-article-dehors","universities":"micromag-screen-urbania-article-urbania-base-article-universities","footerContainer":"micromag-screen-urbania-article-urbania-base-article-footerContainer","footer":"micromag-screen-urbania-article-urbania-base-article-footer","arrow":"micromag-screen-urbania-article-urbania-base-article-arrow","icon":"micromag-screen-urbania-article-urbania-base-article-icon","button":"micromag-screen-urbania-article-urbania-base-article-button","mediaControls":"micromag-screen-urbania-article-urbania-base-article-mediaControls","header":"micromag-screen-urbania-article-urbania-base-article-header","bottom":"micromag-screen-urbania-article-urbania-base-article-bottom","visible":"micromag-screen-urbania-article-urbania-base-article-visible","withGradient":"micromag-screen-urbania-article-urbania-base-article-withGradient","image":"micromag-screen-urbania-article-urbania-base-article-image","isCurrent":"micromag-screen-urbania-article-urbania-base-article-isCurrent","slowZoom":"micromag-screen-urbania-article-urbania-base-article-slowZoom","img":"micromag-screen-urbania-article-urbania-base-article-img"};
91
130
 
92
- var _excluded$1 = ["callToAction"];
93
- function UrbaniaArticle(_ref) {
94
- var _ref$hasArticle = _ref.hasArticle,
95
- hasArticle = _ref$hasArticle === void 0 ? false : _ref$hasArticle,
96
- _ref$type = _ref.type,
97
- type = _ref$type === void 0 ? null : _ref$type,
98
- _ref$image = _ref.image,
99
- image = _ref$image === void 0 ? null : _ref$image,
100
- _ref$title = _ref.title,
101
- title = _ref$title === void 0 ? null : _ref$title,
102
- _ref$description = _ref.description,
103
- description = _ref$description === void 0 ? null : _ref$description,
104
- _ref$overTitle = _ref.overTitle,
105
- overTitle = _ref$overTitle === void 0 ? null : _ref$overTitle,
106
- _ref$author = _ref.author,
107
- author = _ref$author === void 0 ? null : _ref$author,
108
- _ref$sponsors = _ref.sponsors,
109
- sponsors = _ref$sponsors === void 0 ? null : _ref$sponsors,
110
- _ref$sponsorPrefix = _ref.sponsorPrefix,
111
- sponsorPrefix = _ref$sponsorPrefix === void 0 ? null : _ref$sponsorPrefix,
112
- _ref$sponsorColor = _ref.sponsorColor,
113
- sponsorColor = _ref$sponsorColor === void 0 ? null : _ref$sponsorColor,
114
- _ref$site = _ref.site,
115
- site = _ref$site === void 0 ? null : _ref$site,
116
- _ref$header = _ref.header,
117
- header = _ref$header === void 0 ? null : _ref$header,
118
- _ref$footer = _ref.footer,
119
- footer = _ref$footer === void 0 ? null : _ref$footer,
120
- _ref$background = _ref.background,
121
- background = _ref$background === void 0 ? null : _ref$background,
122
- _ref$current = _ref.current,
123
- current = _ref$current === void 0 ? true : _ref$current,
124
- _ref$preload = _ref.preload,
125
- preload = _ref$preload === void 0 ? true : _ref$preload,
126
- _ref$spacing = _ref.spacing,
127
- spacing = _ref$spacing === void 0 ? 20 : _ref$spacing,
128
- _ref$className = _ref.className,
129
- className = _ref$className === void 0 ? null : _ref$className;
130
- var _useScreenSize = useScreenSize(),
131
- width = _useScreenSize.width,
132
- height = _useScreenSize.height,
133
- resolution = _useScreenSize.resolution;
134
- var _useScreenRenderConte = useScreenRenderContext(),
135
- isView = _useScreenRenderConte.isView,
136
- isPreview = _useScreenRenderConte.isPreview,
137
- isPlaceholder = _useScreenRenderConte.isPlaceholder,
138
- isEdit = _useScreenRenderConte.isEdit,
139
- isStatic = _useScreenRenderConte.isStatic,
140
- isCapture = _useScreenRenderConte.isCapture;
141
- var _ref2 = background || {},
142
- _ref2$color = _ref2.color,
143
- backgroundColor = _ref2$color === void 0 ? null : _ref2$color;
144
- var _useViewerWebView = useViewerWebView(),
145
- openedWebView = _useViewerWebView.opened,
146
- openWebView = _useViewerWebView.open;
147
- var _useViewerContext = useViewerContext(),
148
- viewerBottomSidesWidth = _useViewerContext.bottomSidesWidth,
149
- viewerTopHeight = _useViewerContext.topHeight;
150
- var _useViewerInteraction = useViewerInteraction(),
151
- enableInteraction = _useViewerInteraction.enableInteraction,
152
- disableInteraction = _useViewerInteraction.disableInteraction;
153
- var _usePlaybackContext = usePlaybackContext(),
154
- muted = _usePlaybackContext.muted,
155
- playing = _usePlaybackContext.playing;
156
- var _useDimensionObserver = useDimensionObserver(),
157
- contentRef = _useDimensionObserver.ref,
158
- contentRect = _useDimensionObserver.entry.contentRect,
159
- contentHeight = _useDimensionObserver.height;
160
- var _ref3 = contentRect || {},
161
- contentTop = _ref3.top;
162
- var _useMemo = useMemo(function () {
163
- // const defaultImageHeight = width * 0.8;
164
- var difference = height - contentHeight - contentTop + 1;
165
- return {
166
- imageHeight: difference
167
- };
168
- }, [contentTop, contentHeight, width, height]),
169
- _useMemo$minContentHe = _useMemo.minContentHeight,
170
- minContentHeight = _useMemo$minContentHe === void 0 ? null : _useMemo$minContentHe;
171
- var isVideo = type === 'video';
172
- var hasOverTitle = isTextFilled(overTitle);
173
- var hasTitle = isTextFilled(title);
174
- var hasDescription = isTextFilled(description);
175
- var hasSponsor = (sponsors || []).length > 0 && isTextFilled(sponsors[0]);
176
- var _ref4 = author || {},
177
- authorFullName = _ref4.name;
178
- var hasAuthor = isTextFilled(authorFullName);
179
- var _ref5 = image || {},
180
- _ref5$url = _ref5.url,
181
- url = _ref5$url === void 0 ? null : _ref5$url,
182
- _ref5$type = _ref5.type,
183
- imageType = _ref5$type === void 0 ? null : _ref5$type;
184
- var hasImage = url !== null;
185
- var hasHeader = isHeaderFilled(header);
186
- var hasFooter = isFooterFilled(footer) || hasArticle;
187
- var footerCta = {
188
- buttonClassName: styles$1.button,
189
- labelClassName: styles$1.label,
190
- arrowClassName: styles$1.arrow,
191
- arrow: /*#__PURE__*/jsx(Arrow, {}),
192
- icon: type === 'video' ? /*#__PURE__*/jsx(WatchIcon, {
131
+ function UrbaniaArticle(t0) {
132
+ const $ = c(173);
133
+ const {
134
+ hasArticle: t1,
135
+ type: t2,
136
+ image: t3,
137
+ title: t4,
138
+ description: t5,
139
+ overTitle: t6,
140
+ author: t7,
141
+ sponsors: t8,
142
+ sponsorPrefix: t9,
143
+ sponsorColor: t10,
144
+ site: t11,
145
+ header: t12,
146
+ footer: t13,
147
+ background: t14,
148
+ current: t15,
149
+ preload: t16,
150
+ spacing: t17,
151
+ mediaRef: t18,
152
+ className: t19
153
+ } = t0;
154
+ const hasArticle = t1 === undefined ? false : t1;
155
+ const type = t2 === undefined ? null : t2;
156
+ const image = t3 === undefined ? null : t3;
157
+ const title = t4 === undefined ? null : t4;
158
+ const description = t5 === undefined ? null : t5;
159
+ const overTitle = t6 === undefined ? null : t6;
160
+ const author = t7 === undefined ? null : t7;
161
+ const sponsors = t8 === undefined ? null : t8;
162
+ const sponsorPrefix = t9 === undefined ? null : t9;
163
+ const sponsorColor = t10 === undefined ? null : t10;
164
+ const site = t11 === undefined ? null : t11;
165
+ const header = t12 === undefined ? null : t12;
166
+ const footer = t13 === undefined ? null : t13;
167
+ const background = t14 === undefined ? null : t14;
168
+ const current = t15 === undefined ? true : t15;
169
+ const preload = t16 === undefined ? true : t16;
170
+ const spacing = t17 === undefined ? 20 : t17;
171
+ const customMediaRef = t18 === undefined ? null : t18;
172
+ const className = t19 === undefined ? null : t19;
173
+ const {
174
+ width,
175
+ height,
176
+ resolution
177
+ } = useScreenSize();
178
+ const {
179
+ isView,
180
+ isPreview,
181
+ isPlaceholder,
182
+ isEdit,
183
+ isStatic,
184
+ isCapture
185
+ } = useScreenRenderContext();
186
+ let t20;
187
+ if ($[0] !== background) {
188
+ t20 = background || {};
189
+ $[0] = background;
190
+ $[1] = t20;
191
+ } else {
192
+ t20 = $[1];
193
+ }
194
+ const {
195
+ color: t21
196
+ } = t20;
197
+ const backgroundColor = t21 === undefined ? null : t21;
198
+ const {
199
+ opened: openedWebView,
200
+ open: openWebView
201
+ } = useViewerWebView();
202
+ const {
203
+ bottomSidesWidth: viewerBottomSidesWidth,
204
+ topHeight: viewerTopHeight
205
+ } = useViewerContext();
206
+ const {
207
+ enableInteraction,
208
+ disableInteraction
209
+ } = useViewerInteraction();
210
+ const {
211
+ muted,
212
+ playing
213
+ } = usePlaybackContext();
214
+ const {
215
+ ref: contentRef,
216
+ entry: t22,
217
+ height: contentHeight
218
+ } = useDimensionObserver();
219
+ const {
220
+ contentRect
221
+ } = t22;
222
+ let t23;
223
+ if ($[2] !== contentRect) {
224
+ t23 = contentRect || {};
225
+ $[2] = contentRect;
226
+ $[3] = t23;
227
+ } else {
228
+ t23 = $[3];
229
+ }
230
+ const {
231
+ top: contentTop
232
+ } = t23;
233
+ const difference = height - contentHeight - contentTop + 1;
234
+ let t24;
235
+ if ($[4] !== difference) {
236
+ t24 = {
237
+ imageHeight: difference
238
+ };
239
+ $[4] = difference;
240
+ $[5] = t24;
241
+ } else {
242
+ t24 = $[5];
243
+ }
244
+ const {
245
+ minContentHeight: t25
246
+ } = t24;
247
+ const minContentHeight = t25 === undefined ? null : t25;
248
+ const isVideo = type === "video";
249
+ let t26;
250
+ if ($[6] !== overTitle) {
251
+ t26 = isTextFilled(overTitle);
252
+ $[6] = overTitle;
253
+ $[7] = t26;
254
+ } else {
255
+ t26 = $[7];
256
+ }
257
+ const hasOverTitle = t26;
258
+ let t27;
259
+ if ($[8] !== title) {
260
+ t27 = isTextFilled(title);
261
+ $[8] = title;
262
+ $[9] = t27;
263
+ } else {
264
+ t27 = $[9];
265
+ }
266
+ const hasTitle = t27;
267
+ const hasDescription = isTextFilled(description);
268
+ let t28;
269
+ if ($[10] !== sponsors) {
270
+ t28 = (sponsors || []).length > 0 && isTextFilled(sponsors[0]);
271
+ $[10] = sponsors;
272
+ $[11] = t28;
273
+ } else {
274
+ t28 = $[11];
275
+ }
276
+ const hasSponsor = t28;
277
+ let t29;
278
+ if ($[12] !== author) {
279
+ t29 = author || {};
280
+ $[12] = author;
281
+ $[13] = t29;
282
+ } else {
283
+ t29 = $[13];
284
+ }
285
+ const {
286
+ name: authorFullName
287
+ } = t29;
288
+ let t30;
289
+ if ($[14] !== authorFullName) {
290
+ t30 = isTextFilled(authorFullName);
291
+ $[14] = authorFullName;
292
+ $[15] = t30;
293
+ } else {
294
+ t30 = $[15];
295
+ }
296
+ const hasAuthor = t30;
297
+ let t31;
298
+ if ($[16] !== image) {
299
+ t31 = image || {};
300
+ $[16] = image;
301
+ $[17] = t31;
302
+ } else {
303
+ t31 = $[17];
304
+ }
305
+ const {
306
+ url: t32,
307
+ type: t33
308
+ } = t31;
309
+ const url = t32 === undefined ? null : t32;
310
+ const imageType = t33 === undefined ? null : t33;
311
+ const hasImage = url !== null;
312
+ let t34;
313
+ if ($[18] !== header) {
314
+ t34 = isHeaderFilled(header);
315
+ $[18] = header;
316
+ $[19] = t34;
317
+ } else {
318
+ t34 = $[19];
319
+ }
320
+ const hasHeader = t34;
321
+ let t35;
322
+ if ($[20] !== footer || $[21] !== hasArticle) {
323
+ t35 = isFooterFilled(footer) || hasArticle;
324
+ $[20] = footer;
325
+ $[21] = hasArticle;
326
+ $[22] = t35;
327
+ } else {
328
+ t35 = $[22];
329
+ }
330
+ const hasFooter = t35;
331
+ let t36;
332
+ if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
333
+ t36 = /*#__PURE__*/jsx(Arrow, {});
334
+ $[23] = t36;
335
+ } else {
336
+ t36 = $[23];
337
+ }
338
+ let t37;
339
+ if ($[24] !== type) {
340
+ t37 = type === "video" ? /*#__PURE__*/jsx(WatchIcon, {
193
341
  className: styles$1.icon
194
- }) : null
195
- };
196
- var _ref6 = footer || {},
197
- _ref6$callToAction = _ref6.callToAction,
198
- callToAction = _ref6$callToAction === void 0 ? null : _ref6$callToAction,
199
- otherFooterProps = _objectWithoutProperties(_ref6, _excluded$1);
200
- var footerProps = getFooterProps(_objectSpread(_objectSpread({}, otherFooterProps), {}, {
201
- callToAction: _objectSpread(_objectSpread({}, callToAction), footerCta)
202
- }), {
203
- isView: isView,
204
- current: current,
205
- openWebView: openWebView,
206
- isPreview: isPreview,
207
- animationDisabled: isPreview,
208
- focusable: current && isView,
209
- enableInteraction: enableInteraction,
210
- disableInteraction: disableInteraction
211
- });
212
- var _ref7 = background || {},
213
- _ref7$video = _ref7.video,
214
- backgroundVideo = _ref7$video === void 0 ? null : _ref7$video;
215
- var hasVideoBackground = backgroundVideo !== null;
216
- var mediaShouldLoad = current || preload;
217
- var finalPlaying = playing && current;
218
- var isVideoBackground = imageType !== 'video' && hasVideoBackground;
219
- var _usePlaybackMediaRef = usePlaybackMediaRef(current, isVideoBackground),
220
- mediaRef = _usePlaybackMediaRef.ref,
221
- _usePlaybackMediaRef$ = _usePlaybackMediaRef.isCurrent,
222
- isCurrentMedia = _usePlaybackMediaRef$ === void 0 ? false : _usePlaybackMediaRef$;
223
- var backgroundPlaying = current && !openedWebView && (isView || isEdit) && (isCurrentMedia || !isView);
224
- var items = [/*#__PURE__*/jsx(ScreenElement, {
225
- placeholder: /*#__PURE__*/jsx(PlaceholderSubtitle, {
342
+ }) : null;
343
+ $[24] = type;
344
+ $[25] = t37;
345
+ } else {
346
+ t37 = $[25];
347
+ }
348
+ let t38;
349
+ if ($[26] !== current || $[27] !== disableInteraction || $[28] !== enableInteraction || $[29] !== footer || $[30] !== isPreview || $[31] !== isView || $[32] !== openWebView || $[33] !== t37) {
350
+ const footerCta = {
351
+ buttonClassName: styles$1.button,
352
+ labelClassName: styles$1.label,
353
+ arrowClassName: styles$1.arrow,
354
+ arrow: t36,
355
+ icon: t37
356
+ };
357
+ const {
358
+ callToAction: t39,
359
+ ...otherFooterProps
360
+ } = footer || {};
361
+ const callToAction = t39 === undefined ? null : t39;
362
+ t38 = getFooterProps({
363
+ ...otherFooterProps,
364
+ callToAction: {
365
+ ...callToAction,
366
+ ...footerCta
367
+ }
368
+ }, {
369
+ isView,
370
+ current,
371
+ openWebView,
372
+ isPreview,
373
+ animationDisabled: isPreview,
374
+ focusable: current && isView,
375
+ enableInteraction,
376
+ disableInteraction
377
+ });
378
+ $[26] = current;
379
+ $[27] = disableInteraction;
380
+ $[28] = enableInteraction;
381
+ $[29] = footer;
382
+ $[30] = isPreview;
383
+ $[31] = isView;
384
+ $[32] = openWebView;
385
+ $[33] = t37;
386
+ $[34] = t38;
387
+ } else {
388
+ t38 = $[34];
389
+ }
390
+ const footerProps = t38;
391
+ let t39;
392
+ if ($[35] !== background) {
393
+ t39 = background || {};
394
+ $[35] = background;
395
+ $[36] = t39;
396
+ } else {
397
+ t39 = $[36];
398
+ }
399
+ const {
400
+ video: t40
401
+ } = t39;
402
+ const backgroundVideo = t40 === undefined ? null : t40;
403
+ const hasVideoBackground = backgroundVideo !== null;
404
+ const mediaShouldLoad = current || preload;
405
+ const finalPlaying = playing && current;
406
+ const isVideoBackground = imageType !== "video" && hasVideoBackground;
407
+ const {
408
+ ref: mediaRef,
409
+ isCurrent: t41
410
+ } = usePlaybackMediaRef(current, isVideoBackground);
411
+ const isCurrentMedia = t41 === undefined ? false : t41;
412
+ const backgroundPlaying = current && !openedWebView && (isView || isEdit) && (isCurrentMedia || !isView);
413
+ let t42;
414
+ let t43;
415
+ if ($[37] === Symbol.for("react.memo_cache_sentinel")) {
416
+ t42 = /*#__PURE__*/jsx(PlaceholderSubtitle, {
226
417
  className: styles$1.placeholder
227
- }),
228
- empty: /*#__PURE__*/jsx("div", {
229
- className: classNames([styles$1.emptyContainer, styles$1.small]),
418
+ });
419
+ t43 = classNames([styles$1.emptyContainer, styles$1.small]);
420
+ $[37] = t42;
421
+ $[38] = t43;
422
+ } else {
423
+ t42 = $[37];
424
+ t43 = $[38];
425
+ }
426
+ let t44;
427
+ if ($[39] === Symbol.for("react.memo_cache_sentinel")) {
428
+ t44 = /*#__PURE__*/jsx("div", {
429
+ className: t43,
230
430
  children: /*#__PURE__*/jsx(Empty, {
231
431
  className: styles$1.empty,
232
432
  children: /*#__PURE__*/jsx(FormattedMessage, {
233
433
  id: "pRzSQ7",
234
- defaultMessage: [{
235
- "type": 0,
236
- "value": "Overtitle"
237
- }]
434
+ defaultMessage: "Overtitle"
238
435
  })
239
436
  })
240
- }),
241
- isEmpty: !hasOverTitle,
242
- children: hasOverTitle ? /*#__PURE__*/jsx(Heading, _objectSpread({
243
- className: classNames([styles$1.overTitle])
244
- }, overTitle)) : null
245
- }, "overTitle"), /*#__PURE__*/jsx(ScreenElement, {
246
- placeholder: /*#__PURE__*/jsx(PlaceholderTitle, {
437
+ });
438
+ $[39] = t44;
439
+ } else {
440
+ t44 = $[39];
441
+ }
442
+ const t45 = !hasOverTitle;
443
+ let t46;
444
+ if ($[40] !== hasOverTitle || $[41] !== overTitle) {
445
+ t46 = hasOverTitle ? /*#__PURE__*/jsx(Heading, {
446
+ className: classNames([styles$1.overTitle]),
447
+ ...overTitle
448
+ }) : null;
449
+ $[40] = hasOverTitle;
450
+ $[41] = overTitle;
451
+ $[42] = t46;
452
+ } else {
453
+ t46 = $[42];
454
+ }
455
+ let t47;
456
+ if ($[43] !== t45 || $[44] !== t46) {
457
+ t47 = /*#__PURE__*/jsx(ScreenElement, {
458
+ placeholder: t42,
459
+ empty: t44,
460
+ isEmpty: t45,
461
+ children: t46
462
+ }, "overTitle");
463
+ $[43] = t45;
464
+ $[44] = t46;
465
+ $[45] = t47;
466
+ } else {
467
+ t47 = $[45];
468
+ }
469
+ let t48;
470
+ if ($[46] === Symbol.for("react.memo_cache_sentinel")) {
471
+ t48 = /*#__PURE__*/jsx(PlaceholderTitle, {
247
472
  className: styles$1.placeholder
248
- }),
249
- empty: /*#__PURE__*/jsx("div", {
473
+ });
474
+ $[46] = t48;
475
+ } else {
476
+ t48 = $[46];
477
+ }
478
+ let t49;
479
+ if ($[47] === Symbol.for("react.memo_cache_sentinel")) {
480
+ t49 = /*#__PURE__*/jsx("div", {
250
481
  className: styles$1.emptyContainer,
251
482
  children: /*#__PURE__*/jsx(Empty, {
252
483
  className: styles$1.empty,
253
484
  children: /*#__PURE__*/jsx(FormattedMessage, {
254
485
  id: "2ZOPe+",
255
- defaultMessage: [{
256
- "type": 0,
257
- "value": "Title"
258
- }]
486
+ defaultMessage: "Title"
259
487
  })
260
488
  })
261
- }),
262
- isEmpty: !hasTitle,
263
- children: hasTitle ? /*#__PURE__*/jsx(Heading, _objectSpread({
264
- className: classNames([styles$1.title])
265
- }, title)) : null
266
- }, "title"), /*#__PURE__*/jsx(ScreenElement, {
267
- empty: /*#__PURE__*/jsx("div", {
489
+ });
490
+ $[47] = t49;
491
+ } else {
492
+ t49 = $[47];
493
+ }
494
+ const t50 = !hasTitle;
495
+ let t51;
496
+ if ($[48] !== hasTitle || $[49] !== title) {
497
+ t51 = hasTitle ? /*#__PURE__*/jsx(Heading, {
498
+ className: classNames([styles$1.title]),
499
+ ...title
500
+ }) : null;
501
+ $[48] = hasTitle;
502
+ $[49] = title;
503
+ $[50] = t51;
504
+ } else {
505
+ t51 = $[50];
506
+ }
507
+ let t52;
508
+ if ($[51] !== t50 || $[52] !== t51) {
509
+ t52 = /*#__PURE__*/jsx(ScreenElement, {
510
+ placeholder: t48,
511
+ empty: t49,
512
+ isEmpty: t50,
513
+ children: t51
514
+ }, "title");
515
+ $[51] = t50;
516
+ $[52] = t51;
517
+ $[53] = t52;
518
+ } else {
519
+ t52 = $[53];
520
+ }
521
+ const T0 = ScreenElement;
522
+ const t53 = "authors";
523
+ let t54;
524
+ if ($[54] === Symbol.for("react.memo_cache_sentinel")) {
525
+ t54 = /*#__PURE__*/jsx("div", {
268
526
  className: styles$1.emptyContainer,
269
527
  children: /*#__PURE__*/jsx(Empty, {
270
528
  className: styles$1.empty,
271
529
  children: /*#__PURE__*/jsx(FormattedMessage, {
272
530
  id: "6jX5Tb",
273
- defaultMessage: [{
274
- "type": 0,
275
- "value": "Authors"
276
- }]
531
+ defaultMessage: "Authors"
277
532
  })
278
533
  })
279
- }),
280
- isEmpty: !hasAuthor,
281
- children: hasAuthor ? /*#__PURE__*/jsx("div", {
282
- className: classNames([styles$1.authors, _defineProperty({}, styles$1.isAboveDescription, hasDescription)]),
283
- children: /*#__PURE__*/jsx(UrbaniaAuthor, {
284
- author: author,
285
- shouldLoad: mediaShouldLoad
286
- })
287
- }) : null
288
- }, "authors"), /*#__PURE__*/jsx(ScreenElement, {
289
- empty: /*#__PURE__*/jsx("div", {
534
+ });
535
+ $[54] = t54;
536
+ } else {
537
+ t54 = $[54];
538
+ }
539
+ const t55 = !hasAuthor;
540
+ const t56 = hasAuthor ? /*#__PURE__*/jsx("div", {
541
+ className: classNames([styles$1.authors, {
542
+ [styles$1.isAboveDescription]: hasDescription
543
+ }]),
544
+ children: /*#__PURE__*/jsx(UrbaniaAuthor, {
545
+ author: author,
546
+ shouldLoad: mediaShouldLoad
547
+ })
548
+ }) : null;
549
+ let t57;
550
+ if ($[55] !== T0 || $[56] !== t54 || $[57] !== t55 || $[58] !== t56) {
551
+ t57 = /*#__PURE__*/jsx(T0, {
552
+ empty: t54,
553
+ isEmpty: t55,
554
+ children: t56
555
+ }, t53);
556
+ $[55] = T0;
557
+ $[56] = t54;
558
+ $[57] = t55;
559
+ $[58] = t56;
560
+ $[59] = t57;
561
+ } else {
562
+ t57 = $[59];
563
+ }
564
+ let t58;
565
+ if ($[60] === Symbol.for("react.memo_cache_sentinel")) {
566
+ t58 = /*#__PURE__*/jsx("div", {
290
567
  className: styles$1.emptyContainer,
291
568
  children: /*#__PURE__*/jsx(Empty, {
292
569
  className: styles$1.empty,
293
570
  children: /*#__PURE__*/jsx(FormattedMessage, {
294
571
  id: "zl6zsZ",
295
- defaultMessage: [{
296
- "type": 0,
297
- "value": "Lede"
298
- }]
572
+ defaultMessage: "Lede"
299
573
  })
300
574
  })
301
- }),
302
- isEmpty: !hasDescription && !hasArticle,
303
- children: hasDescription ? /*#__PURE__*/jsx("div", {
575
+ });
576
+ $[60] = t58;
577
+ } else {
578
+ t58 = $[60];
579
+ }
580
+ const t59 = !hasDescription && !hasArticle;
581
+ let t60;
582
+ if ($[61] !== description || $[62] !== hasDescription) {
583
+ t60 = hasDescription ? /*#__PURE__*/jsx("div", {
304
584
  className: classNames([styles$1.description]),
305
- children: /*#__PURE__*/jsx(Text, _objectSpread({
306
- className: classNames([styles$1.lede])
307
- }, description))
308
- }) : null
309
- }, "description"), /*#__PURE__*/jsx(ScreenElement, {
310
- empty: /*#__PURE__*/jsx("div", {
311
- className: classNames([styles$1.emptyContainer, styles$1.small]),
585
+ children: /*#__PURE__*/jsx(Text, {
586
+ className: classNames([styles$1.lede]),
587
+ ...description
588
+ })
589
+ }) : null;
590
+ $[61] = description;
591
+ $[62] = hasDescription;
592
+ $[63] = t60;
593
+ } else {
594
+ t60 = $[63];
595
+ }
596
+ let t61;
597
+ if ($[64] !== t59 || $[65] !== t60) {
598
+ t61 = /*#__PURE__*/jsx(ScreenElement, {
599
+ empty: t58,
600
+ isEmpty: t59,
601
+ children: t60
602
+ }, "description");
603
+ $[64] = t59;
604
+ $[65] = t60;
605
+ $[66] = t61;
606
+ } else {
607
+ t61 = $[66];
608
+ }
609
+ let t62;
610
+ if ($[67] === Symbol.for("react.memo_cache_sentinel")) {
611
+ t62 = classNames([styles$1.emptyContainer, styles$1.small]);
612
+ $[67] = t62;
613
+ } else {
614
+ t62 = $[67];
615
+ }
616
+ let t63;
617
+ if ($[68] === Symbol.for("react.memo_cache_sentinel")) {
618
+ t63 = /*#__PURE__*/jsx("div", {
619
+ className: t62,
312
620
  children: /*#__PURE__*/jsx(Empty, {
313
621
  className: styles$1.empty,
314
622
  children: /*#__PURE__*/jsx(FormattedMessage, {
315
623
  id: "zGIcdn",
316
- defaultMessage: [{
317
- "type": 0,
318
- "value": "Sponsors"
319
- }]
624
+ defaultMessage: "Sponsors"
320
625
  })
321
626
  })
322
- }),
323
- isEmpty: !hasSponsor && !hasArticle,
324
- children: hasSponsor ? /*#__PURE__*/jsx("div", {
627
+ });
628
+ $[68] = t63;
629
+ } else {
630
+ t63 = $[68];
631
+ }
632
+ const t64 = !hasSponsor && !hasArticle;
633
+ let t65;
634
+ if ($[69] !== hasSponsor || $[70] !== sponsorColor || $[71] !== sponsorPrefix || $[72] !== sponsors) {
635
+ t65 = hasSponsor ? /*#__PURE__*/jsx("div", {
325
636
  className: styles$1.sponsors,
326
- style: _objectSpread({}, getStyleFromColor(sponsorColor)),
327
- children: sponsors.map(function () {
328
- var sponsor = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
329
- var _ref9 = sponsor || {},
330
- _ref9$body = _ref9.body,
331
- body = _ref9$body === void 0 ? '' : _ref9$body;
637
+ style: {
638
+ ...getStyleFromColor(sponsorColor)
639
+ },
640
+ children: sponsors.map(t66 => {
641
+ const sponsor = t66 === undefined ? null : t66;
642
+ const {
643
+ body: t67
644
+ } = sponsor || {};
645
+ const body = t67 === undefined ? "" : t67;
332
646
  return /*#__PURE__*/jsxs(React.Fragment, {
333
647
  children: [sponsorPrefix !== null ? /*#__PURE__*/jsx("span", {
334
648
  className: styles$1.sponsor,
335
649
  children: sponsorPrefix
336
650
  }) : null, /*#__PURE__*/jsx("span", {
337
651
  children: "\xA0"
338
- }), /*#__PURE__*/jsx(Heading, _objectSpread({
652
+ }), /*#__PURE__*/jsx(Heading, {
339
653
  className: styles$1.sponsor,
340
- size: "6"
341
- }, sponsor))]
654
+ size: "6",
655
+ ...sponsor
656
+ })]
342
657
  }, body);
343
658
  })
344
- }) : null
345
- }, "sponsors")].filter(function (it) {
346
- return it !== null;
347
- });
348
- return /*#__PURE__*/jsxs("div", {
349
- className: classNames([styles$1.container, className, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, styles$1.isCurrent, current), styles$1.isVideo, isVideo), styles$1.hasVideoBackground, hasVideoBackground), styles$1.isPlaceholder, isPlaceholder)]),
350
- "data-screen-ready": isStatic || isCapture,
351
- children: [/*#__PURE__*/jsx(Background, {
659
+ }) : null;
660
+ $[69] = hasSponsor;
661
+ $[70] = sponsorColor;
662
+ $[71] = sponsorPrefix;
663
+ $[72] = sponsors;
664
+ $[73] = t65;
665
+ } else {
666
+ t65 = $[73];
667
+ }
668
+ let t66;
669
+ if ($[74] !== t64 || $[75] !== t65) {
670
+ t66 = /*#__PURE__*/jsx(ScreenElement, {
671
+ empty: t63,
672
+ isEmpty: t64,
673
+ children: t65
674
+ }, "sponsors");
675
+ $[74] = t64;
676
+ $[75] = t65;
677
+ $[76] = t66;
678
+ } else {
679
+ t66 = $[76];
680
+ }
681
+ let t67;
682
+ if ($[77] !== t47 || $[78] !== t52 || $[79] !== t57 || $[80] !== t61 || $[81] !== t66) {
683
+ t67 = [t47, t52, t57, t61, t66].filter(_temp$2);
684
+ $[77] = t47;
685
+ $[78] = t52;
686
+ $[79] = t57;
687
+ $[80] = t61;
688
+ $[81] = t66;
689
+ $[82] = t67;
690
+ } else {
691
+ t67 = $[82];
692
+ }
693
+ const items = t67;
694
+ let t68;
695
+ if ($[83] !== className || $[84] !== current || $[85] !== hasVideoBackground || $[86] !== isPlaceholder || $[87] !== isVideo) {
696
+ t68 = classNames([styles$1.container, className, {
697
+ [styles$1.isCurrent]: current,
698
+ [styles$1.isVideo]: isVideo,
699
+ [styles$1.hasVideoBackground]: hasVideoBackground,
700
+ [styles$1.isPlaceholder]: isPlaceholder
701
+ }]);
702
+ $[83] = className;
703
+ $[84] = current;
704
+ $[85] = hasVideoBackground;
705
+ $[86] = isPlaceholder;
706
+ $[87] = isVideo;
707
+ $[88] = t68;
708
+ } else {
709
+ t68 = $[88];
710
+ }
711
+ const t69 = isStatic || isCapture;
712
+ let t70;
713
+ if ($[89] !== customMediaRef || $[90] !== isVideoBackground || $[91] !== mediaRef) {
714
+ t70 = isVideoBackground ? mergeRefs(mediaRef, customMediaRef) : null;
715
+ $[89] = customMediaRef;
716
+ $[90] = isVideoBackground;
717
+ $[91] = mediaRef;
718
+ $[92] = t70;
719
+ } else {
720
+ t70 = $[92];
721
+ }
722
+ let t71;
723
+ if ($[93] !== background || $[94] !== backgroundPlaying || $[95] !== height || $[96] !== isPreview || $[97] !== mediaShouldLoad || $[98] !== muted || $[99] !== resolution || $[100] !== t70 || $[101] !== width) {
724
+ t71 = /*#__PURE__*/jsx(Background, {
352
725
  className: styles$1.background,
353
726
  background: background,
354
727
  width: width,
@@ -357,274 +730,755 @@ function UrbaniaArticle(_ref) {
357
730
  playing: backgroundPlaying,
358
731
  muted: muted,
359
732
  shouldLoad: mediaShouldLoad,
360
- mediaRef: isVideoBackground ? mediaRef : null,
733
+ mediaRef: t70,
361
734
  withoutVideo: isPreview
362
- }), /*#__PURE__*/jsxs(Container, {
735
+ });
736
+ $[93] = background;
737
+ $[94] = backgroundPlaying;
738
+ $[95] = height;
739
+ $[96] = isPreview;
740
+ $[97] = mediaShouldLoad;
741
+ $[98] = muted;
742
+ $[99] = resolution;
743
+ $[100] = t70;
744
+ $[101] = width;
745
+ $[102] = t71;
746
+ } else {
747
+ t71 = $[102];
748
+ }
749
+ let t72;
750
+ if ($[103] !== hasHeader || $[104] !== header || $[105] !== isPlaceholder || $[106] !== isPreview || $[107] !== spacing || $[108] !== viewerTopHeight) {
751
+ t72 = !isPlaceholder && hasHeader ? /*#__PURE__*/jsx("div", {
752
+ className: styles$1.header,
753
+ style: {
754
+ paddingTop: spacing / 2,
755
+ paddingLeft: spacing,
756
+ paddingRight: spacing,
757
+ transform: !isPreview ? `translate(0, ${viewerTopHeight}px)` : null
758
+ },
759
+ children: /*#__PURE__*/jsx(Header, {
760
+ ...header
761
+ })
762
+ }, "header") : null;
763
+ $[103] = hasHeader;
764
+ $[104] = header;
765
+ $[105] = isPlaceholder;
766
+ $[106] = isPreview;
767
+ $[107] = spacing;
768
+ $[108] = viewerTopHeight;
769
+ $[109] = t72;
770
+ } else {
771
+ t72 = $[109];
772
+ }
773
+ const t73 = styles$1[`${site}`];
774
+ const t74 = site !== null;
775
+ let t75;
776
+ if ($[110] !== t73 || $[111] !== t74) {
777
+ t75 = classNames([styles$1.articleContent, {
778
+ [t73]: t74
779
+ }]);
780
+ $[110] = t73;
781
+ $[111] = t74;
782
+ $[112] = t75;
783
+ } else {
784
+ t75 = $[112];
785
+ }
786
+ let t76;
787
+ if ($[113] !== backgroundColor || $[114] !== isVideo) {
788
+ t76 = !isVideo ? getStyleFromColor(backgroundColor, "backgroundColor") : null;
789
+ $[113] = backgroundColor;
790
+ $[114] = isVideo;
791
+ $[115] = t76;
792
+ } else {
793
+ t76 = $[115];
794
+ }
795
+ let t77;
796
+ if ($[116] !== minContentHeight || $[117] !== spacing || $[118] !== t76) {
797
+ t77 = {
798
+ paddingTop: spacing,
799
+ minHeight: minContentHeight,
800
+ ...t76
801
+ };
802
+ $[116] = minContentHeight;
803
+ $[117] = spacing;
804
+ $[118] = t76;
805
+ $[119] = t77;
806
+ } else {
807
+ t77 = $[119];
808
+ }
809
+ let t78;
810
+ if ($[120] !== contentRef || $[121] !== items || $[122] !== t75 || $[123] !== t77) {
811
+ t78 = /*#__PURE__*/jsx("div", {
812
+ className: t75,
813
+ style: t77,
814
+ ref: contentRef,
815
+ children: items
816
+ });
817
+ $[120] = contentRef;
818
+ $[121] = items;
819
+ $[122] = t75;
820
+ $[123] = t77;
821
+ $[124] = t78;
822
+ } else {
823
+ t78 = $[124];
824
+ }
825
+ let t79;
826
+ if ($[125] === Symbol.for("react.memo_cache_sentinel")) {
827
+ t79 = /*#__PURE__*/jsx(PlaceholderImage, {
828
+ className: styles$1.placeholder
829
+ });
830
+ $[125] = t79;
831
+ } else {
832
+ t79 = $[125];
833
+ }
834
+ let t80;
835
+ if ($[126] === Symbol.for("react.memo_cache_sentinel")) {
836
+ t80 = /*#__PURE__*/jsx("div", {
837
+ className: styles$1.emptyContainer,
838
+ children: /*#__PURE__*/jsx(Empty, {
839
+ className: styles$1.empty,
840
+ children: /*#__PURE__*/jsx(FormattedMessage, {
841
+ id: "ebsPd4",
842
+ defaultMessage: "Image"
843
+ })
844
+ })
845
+ });
846
+ $[126] = t80;
847
+ } else {
848
+ t80 = $[126];
849
+ }
850
+ const t81 = !hasImage && !hasArticle;
851
+ let t82;
852
+ if ($[127] !== hasImage || $[128] !== height || $[129] !== image || $[130] !== isVideo || $[131] !== mediaShouldLoad || $[132] !== resolution || $[133] !== width) {
853
+ t82 = hasImage && !isVideo ? /*#__PURE__*/jsx(Visual, {
854
+ className: styles$1.image,
855
+ imageClassName: styles$1.img,
856
+ media: image,
857
+ width: width,
858
+ height: height,
859
+ resolution: resolution,
860
+ objectFit: {
861
+ fit: "cover"
862
+ },
863
+ shouldLoad: mediaShouldLoad
864
+ }) : null;
865
+ $[127] = hasImage;
866
+ $[128] = height;
867
+ $[129] = image;
868
+ $[130] = isVideo;
869
+ $[131] = mediaShouldLoad;
870
+ $[132] = resolution;
871
+ $[133] = width;
872
+ $[134] = t82;
873
+ } else {
874
+ t82 = $[134];
875
+ }
876
+ let t83;
877
+ if ($[135] !== customMediaRef || $[136] !== finalPlaying || $[137] !== hasImage || $[138] !== hasVideoBackground || $[139] !== height || $[140] !== image || $[141] !== isPreview || $[142] !== isVideo || $[143] !== mediaRef || $[144] !== mediaShouldLoad || $[145] !== muted || $[146] !== resolution || $[147] !== width) {
878
+ t83 = hasImage && isVideo && !hasVideoBackground ? /*#__PURE__*/jsx(Visual, {
879
+ className: styles$1.video,
880
+ media: image,
881
+ width: width,
882
+ height: height,
883
+ resolution: resolution,
884
+ objectFit: {
885
+ fit: "cover"
886
+ },
887
+ shouldLoad: mediaShouldLoad,
888
+ playing: finalPlaying,
889
+ muted: muted,
890
+ withoutVideo: isPreview,
891
+ mediaRef: mergeRefs(mediaRef, customMediaRef),
892
+ autoPlay: true
893
+ }) : null;
894
+ $[135] = customMediaRef;
895
+ $[136] = finalPlaying;
896
+ $[137] = hasImage;
897
+ $[138] = hasVideoBackground;
898
+ $[139] = height;
899
+ $[140] = image;
900
+ $[141] = isPreview;
901
+ $[142] = isVideo;
902
+ $[143] = mediaRef;
903
+ $[144] = mediaShouldLoad;
904
+ $[145] = muted;
905
+ $[146] = resolution;
906
+ $[147] = width;
907
+ $[148] = t83;
908
+ } else {
909
+ t83 = $[148];
910
+ }
911
+ let t84;
912
+ if ($[149] !== t81 || $[150] !== t82 || $[151] !== t83) {
913
+ t84 = /*#__PURE__*/jsx("div", {
914
+ className: styles$1.visual,
915
+ children: /*#__PURE__*/jsxs(ScreenElement, {
916
+ placeholder: t79,
917
+ empty: t80,
918
+ isEmpty: t81,
919
+ children: [t82, t83]
920
+ }, "image")
921
+ });
922
+ $[149] = t81;
923
+ $[150] = t82;
924
+ $[151] = t83;
925
+ $[152] = t84;
926
+ } else {
927
+ t84 = $[152];
928
+ }
929
+ let t85;
930
+ if ($[153] !== footerProps || $[154] !== hasFooter || $[155] !== isPlaceholder || $[156] !== spacing || $[157] !== viewerBottomSidesWidth) {
931
+ t85 = !isPlaceholder && hasFooter ? /*#__PURE__*/jsx("div", {
932
+ style: {
933
+ paddingTop: spacing,
934
+ paddingLeft: Math.max(0, viewerBottomSidesWidth - spacing),
935
+ paddingRight: Math.max(0, viewerBottomSidesWidth - spacing)
936
+ },
937
+ className: styles$1.footer,
938
+ children: /*#__PURE__*/jsx(Footer, {
939
+ ...footerProps
940
+ })
941
+ }) : null;
942
+ $[153] = footerProps;
943
+ $[154] = hasFooter;
944
+ $[155] = isPlaceholder;
945
+ $[156] = spacing;
946
+ $[157] = viewerBottomSidesWidth;
947
+ $[158] = t85;
948
+ } else {
949
+ t85 = $[158];
950
+ }
951
+ let t86;
952
+ if ($[159] !== t85) {
953
+ t86 = /*#__PURE__*/jsx("div", {
954
+ className: styles$1.footerContainer,
955
+ children: t85
956
+ });
957
+ $[159] = t85;
958
+ $[160] = t86;
959
+ } else {
960
+ t86 = $[160];
961
+ }
962
+ let t87;
963
+ if ($[161] !== height || $[162] !== t72 || $[163] !== t78 || $[164] !== t84 || $[165] !== t86 || $[166] !== width) {
964
+ t87 = /*#__PURE__*/jsxs(Container, {
363
965
  className: styles$1.content,
364
966
  width: width,
365
967
  height: height,
366
- children: [!isPlaceholder && hasHeader ? /*#__PURE__*/jsx("div", {
367
- className: styles$1.header,
368
- style: {
369
- paddingTop: spacing / 2,
370
- paddingLeft: spacing,
371
- paddingRight: spacing,
372
- transform: !isPreview ? "translate(0, ".concat(viewerTopHeight, "px)") : null
373
- },
374
- children: /*#__PURE__*/jsx(Header, _objectSpread({}, header))
375
- }, "header") : null, /*#__PURE__*/jsx("div", {
376
- className: classNames([styles$1.articleContent, _defineProperty({}, styles$1["".concat(site)], site !== null)]),
377
- style: _objectSpread({
378
- paddingTop: spacing,
379
- minHeight: minContentHeight
380
- }, !isVideo ? getStyleFromColor(backgroundColor, 'backgroundColor') : null),
381
- ref: contentRef,
382
- children: items
383
- }), /*#__PURE__*/jsx("div", {
384
- className: styles$1.visual,
385
- children: /*#__PURE__*/jsxs(ScreenElement, {
386
- placeholder: /*#__PURE__*/jsx(PlaceholderImage, {
387
- className: styles$1.placeholder
388
- }),
389
- empty: /*#__PURE__*/jsx("div", {
390
- className: styles$1.emptyContainer,
391
- children: /*#__PURE__*/jsx(Empty, {
392
- className: styles$1.empty,
393
- children: /*#__PURE__*/jsx(FormattedMessage, {
394
- id: "ebsPd4",
395
- defaultMessage: [{
396
- "type": 0,
397
- "value": "Image"
398
- }]
399
- })
400
- })
401
- }),
402
- isEmpty: !hasImage && !hasArticle,
403
- children: [hasImage && !isVideo ? /*#__PURE__*/jsx(Visual, {
404
- className: styles$1.image,
405
- imageClassName: styles$1.img,
406
- media: image,
407
- width: width,
408
- height: height,
409
- resolution: resolution,
410
- objectFit: {
411
- fit: 'cover'
412
- },
413
- shouldLoad: mediaShouldLoad
414
- }) : null, hasImage && isVideo && !hasVideoBackground ? /*#__PURE__*/jsx(Visual, {
415
- className: styles$1.video,
416
- media: image,
417
- width: width,
418
- height: height,
419
- resolution: resolution,
420
- objectFit: {
421
- fit: 'cover'
422
- },
423
- shouldLoad: mediaShouldLoad,
424
- playing: finalPlaying,
425
- muted: muted,
426
- withoutVideo: isPreview,
427
- mediaRef: mediaRef,
428
- autoPlay: true
429
- }) : null]
430
- }, "image")
431
- }), /*#__PURE__*/jsx("div", {
432
- className: styles$1.footerContainer,
433
- children: !isPlaceholder && hasFooter ? /*#__PURE__*/jsx("div", {
434
- style: {
435
- paddingTop: spacing,
436
- paddingLeft: Math.max(0, viewerBottomSidesWidth - spacing),
437
- paddingRight: Math.max(0, viewerBottomSidesWidth - spacing)
438
- },
439
- className: styles$1.footer,
440
- children: /*#__PURE__*/jsx(Footer, _objectSpread({}, footerProps))
441
- }) : null
442
- })]
443
- })]
444
- });
968
+ children: [t72, t78, t84, t86]
969
+ });
970
+ $[161] = height;
971
+ $[162] = t72;
972
+ $[163] = t78;
973
+ $[164] = t84;
974
+ $[165] = t86;
975
+ $[166] = width;
976
+ $[167] = t87;
977
+ } else {
978
+ t87 = $[167];
979
+ }
980
+ let t88;
981
+ if ($[168] !== t68 || $[169] !== t69 || $[170] !== t71 || $[171] !== t87) {
982
+ t88 = /*#__PURE__*/jsxs("div", {
983
+ className: t68,
984
+ "data-screen-ready": t69,
985
+ children: [t71, t87]
986
+ });
987
+ $[168] = t68;
988
+ $[169] = t69;
989
+ $[170] = t71;
990
+ $[171] = t87;
991
+ $[172] = t88;
992
+ } else {
993
+ t88 = $[172];
994
+ }
995
+ return t88;
996
+ }
997
+ function _temp$2(it) {
998
+ return it !== null;
445
999
  }
446
1000
 
447
- var _excluded = ["component", "title", "articleType", "overTitle", "sponsorLabel", "author", "image", "header", "footer", "url", "article"];
448
- function UrbaniaLoader(_ref) {
449
- var _ref$component = _ref.component,
450
- Component = _ref$component === void 0 ? UrbaniaArticle : _ref$component,
451
- _ref$title = _ref.title,
452
- title = _ref$title === void 0 ? null : _ref$title,
453
- _ref$articleType = _ref.articleType,
454
- articleType = _ref$articleType === void 0 ? null : _ref$articleType,
455
- _ref$overTitle = _ref.overTitle,
456
- overTitle = _ref$overTitle === void 0 ? null : _ref$overTitle,
457
- _ref$sponsorLabel = _ref.sponsorLabel,
458
- sponsorLabel = _ref$sponsorLabel === void 0 ? null : _ref$sponsorLabel,
459
- _ref$author = _ref.author,
460
- author = _ref$author === void 0 ? null : _ref$author,
461
- _ref$image = _ref.image,
462
- image = _ref$image === void 0 ? null : _ref$image,
463
- _ref$header = _ref.header,
464
- header = _ref$header === void 0 ? null : _ref$header,
465
- _ref$footer = _ref.footer,
466
- footer = _ref$footer === void 0 ? null : _ref$footer,
467
- _ref$url = _ref.url,
468
- url = _ref$url === void 0 ? null : _ref$url,
469
- _ref$article = _ref.article,
470
- initialArticle = _ref$article === void 0 ? null : _ref$article,
471
- props = _objectWithoutProperties(_ref, _excluded);
472
- var _useState = useState(initialArticle),
473
- _useState2 = _slicedToArray(_useState, 2),
474
- article = _useState2[0],
475
- setArticle = _useState2[1];
476
- var finalUrl = url !== null && isValidUrl(url) ? url.replace(/^https?:\/\/([^.]+\.)?urbania\.(ca|ƒr)\//, 'https://urbania.$2/') : null;
477
- useEffect(function () {
478
- if (finalUrl !== null) {
479
- getJSON("https://api.urbania.ca/documents?uri=".concat(finalUrl), {
480
- mode: 'cors'
481
- }).then(function (art) {
482
- // console.log('art loaded', art);
483
- setArticle(art || null);
484
- })["catch"](function (_e) {
485
- // console.log('art error', e);
486
- setArticle(null);
487
- });
488
- }
489
- }, [url, finalUrl, setArticle]);
490
- var values = useMemo(function () {
491
- var _ref2 = image || {},
492
- _ref2$url = _ref2.url,
493
- imageUrl = _ref2$url === void 0 ? null : _ref2$url;
494
- var _ref3 = footer || {},
495
- _ref3$callToAction = _ref3.callToAction,
496
- callToAction = _ref3$callToAction === void 0 ? null : _ref3$callToAction;
497
- var _ref4 = callToAction || {},
498
- _ref4$url = _ref4.url,
499
- ctaUrl = _ref4$url === void 0 ? null : _ref4$url;
500
-
501
- // Straight from article
502
- var _ref5 = article || {},
503
- _ref5$type = _ref5.type,
504
- type = _ref5$type === void 0 ? null : _ref5$type,
505
- _ref5$title = _ref5.title,
506
- articleTitle = _ref5$title === void 0 ? null : _ref5$title,
507
- _ref5$image = _ref5.image,
508
- articleImage = _ref5$image === void 0 ? null : _ref5$image,
509
- _ref5$metadata = _ref5.metadata,
510
- metadata = _ref5$metadata === void 0 ? {} : _ref5$metadata;
511
- var hasArticle = article !== null;
512
- var _ref6 = metadata || {},
513
- _ref6$authors = _ref6.authors,
514
- authors = _ref6$authors === void 0 ? [] : _ref6$authors,
515
- _ref6$sponsors = _ref6.sponsors,
516
- sponsors = _ref6$sponsors === void 0 ? [] : _ref6$sponsors,
517
- _ref6$brands = _ref6.brands,
518
- brands = _ref6$brands === void 0 ? [] : _ref6$brands;
519
- var _ref7 = authors || [],
520
- _ref8 = _slicedToArray(_ref7, 1),
521
- _ref8$ = _ref8[0],
522
- creditAuthor = _ref8$ === void 0 ? null : _ref8$;
523
- var _ref9 = brands || [],
524
- _ref0 = _slicedToArray(_ref9, 1),
525
- _ref0$ = _ref0[0],
526
- _ref0$2 = _ref0$ === void 0 ? {} : _ref0$,
527
- _ref0$2$handle = _ref0$2.handle,
528
- site = _ref0$2$handle === void 0 ? null : _ref0$2$handle;
529
- var _ref1 = articleImage || {},
530
- _ref1$sizes = _ref1.sizes,
531
- sizes = _ref1$sizes === void 0 ? {} : _ref1$sizes;
532
- var _ref10 = sizes || {},
533
- _ref10$medium = _ref10.medium,
534
- medium = _ref10$medium === void 0 ? {} : _ref10$medium,
535
- _ref10$large = _ref10.large,
536
- large = _ref10$large === void 0 ? {} : _ref10$large;
537
- var _ref11 = creditAuthor || {},
538
- _ref11$name = _ref11.name,
539
- authorName = _ref11$name === void 0 ? null : _ref11$name,
540
- _ref11$image = _ref11.image,
541
- authorImage = _ref11$image === void 0 ? null : _ref11$image;
542
- var hasCreditAuthorName = authorName !== null && authorName !== '';
543
- var finalArticleAuthor = _objectSpread(_objectSpread({}, hasCreditAuthorName ? {
544
- name: {
545
- body: "<p>".concat(authorName, "</p>")
1001
+ function UrbaniaLoader(t0) {
1002
+ const $ = c(101);
1003
+ let props;
1004
+ let t1;
1005
+ let t10;
1006
+ let t11;
1007
+ let t2;
1008
+ let t3;
1009
+ let t4;
1010
+ let t5;
1011
+ let t6;
1012
+ let t7;
1013
+ let t8;
1014
+ let t9;
1015
+ if ($[0] !== t0) {
1016
+ ({
1017
+ component: t1,
1018
+ title: t2,
1019
+ articleType: t3,
1020
+ overTitle: t4,
1021
+ sponsorLabel: t5,
1022
+ author: t6,
1023
+ image: t7,
1024
+ header: t8,
1025
+ footer: t9,
1026
+ url: t10,
1027
+ article: t11,
1028
+ ...props
1029
+ } = t0);
1030
+ $[0] = t0;
1031
+ $[1] = props;
1032
+ $[2] = t1;
1033
+ $[3] = t10;
1034
+ $[4] = t11;
1035
+ $[5] = t2;
1036
+ $[6] = t3;
1037
+ $[7] = t4;
1038
+ $[8] = t5;
1039
+ $[9] = t6;
1040
+ $[10] = t7;
1041
+ $[11] = t8;
1042
+ $[12] = t9;
1043
+ } else {
1044
+ props = $[1];
1045
+ t1 = $[2];
1046
+ t10 = $[3];
1047
+ t11 = $[4];
1048
+ t2 = $[5];
1049
+ t3 = $[6];
1050
+ t4 = $[7];
1051
+ t5 = $[8];
1052
+ t6 = $[9];
1053
+ t7 = $[10];
1054
+ t8 = $[11];
1055
+ t9 = $[12];
1056
+ }
1057
+ const Component = t1 === undefined ? UrbaniaArticle : t1;
1058
+ const title = t2 === undefined ? null : t2;
1059
+ const articleType = t3 === undefined ? null : t3;
1060
+ const overTitle = t4 === undefined ? null : t4;
1061
+ const sponsorLabel = t5 === undefined ? null : t5;
1062
+ const author = t6 === undefined ? null : t6;
1063
+ const image = t7 === undefined ? null : t7;
1064
+ const header = t8 === undefined ? null : t8;
1065
+ const footer = t9 === undefined ? null : t9;
1066
+ const url = t10 === undefined ? null : t10;
1067
+ const initialArticle = t11 === undefined ? null : t11;
1068
+ const [article, setArticle] = useState(initialArticle);
1069
+ let t12;
1070
+ if ($[13] !== url) {
1071
+ t12 = url !== null && isValidUrl(url) ? url.replace(/^https?:\/\/([^.]+\.)?urbania\.(ca|ƒr)\//, "https://urbania.$2/") : null;
1072
+ $[13] = url;
1073
+ $[14] = t12;
1074
+ } else {
1075
+ t12 = $[14];
1076
+ }
1077
+ const finalUrl = t12;
1078
+ let t13;
1079
+ if ($[15] !== finalUrl) {
1080
+ t13 = () => {
1081
+ if (finalUrl !== null) {
1082
+ getJSON(`https://api.urbania.ca/documents?uri=${finalUrl}`, {
1083
+ mode: "cors"
1084
+ }).then(art => {
1085
+ setArticle(art || null);
1086
+ }).catch(_e => {
1087
+ setArticle(null);
1088
+ });
546
1089
  }
547
- } : null), authorImage !== null ? {
548
- image: authorImage
549
- } : null);
550
-
551
- // Type
552
- var defaultType = articleType || type;
553
-
554
- // Sponsors
555
- var defaultSponsor = (sponsors || []).length > 0 ? (sponsors || []).map(function (_ref12) {
556
- var _ref12$organisation = _ref12.organisation,
557
- _ref12$organisation2 = _ref12$organisation === void 0 ? {} : _ref12$organisation,
558
- _ref12$organisation2$ = _ref12$organisation2.name,
559
- name = _ref12$organisation2$ === void 0 ? null : _ref12$organisation2$;
560
- return name;
561
- }).filter(function (name) {
562
- return name !== null;
563
- }).join(', ').trim() : null;
564
-
565
- // Content
566
- var hasTitle = isTextFilled(title);
567
- var hasOverTitle = isTextFilled(overTitle);
568
- var hasSponsorProps = isTextFilled(sponsorLabel);
569
- var hasAuthorProps = author !== null && author.name !== null && isTextFilled(author.name);
570
- var sponsorPrefix = !hasSponsorProps && defaultSponsor !== null ? /*#__PURE__*/jsx(FormattedMessage, {
1090
+ };
1091
+ $[15] = finalUrl;
1092
+ $[16] = t13;
1093
+ } else {
1094
+ t13 = $[16];
1095
+ }
1096
+ let t14;
1097
+ if ($[17] !== finalUrl || $[18] !== url) {
1098
+ t14 = [url, finalUrl, setArticle];
1099
+ $[17] = finalUrl;
1100
+ $[18] = url;
1101
+ $[19] = t14;
1102
+ } else {
1103
+ t14 = $[19];
1104
+ }
1105
+ useEffect(t13, t14);
1106
+ let t15;
1107
+ if ($[20] !== image) {
1108
+ t15 = image || {};
1109
+ $[20] = image;
1110
+ $[21] = t15;
1111
+ } else {
1112
+ t15 = $[21];
1113
+ }
1114
+ const {
1115
+ url: t16
1116
+ } = t15;
1117
+ const imageUrl = t16 === undefined ? null : t16;
1118
+ let t17;
1119
+ if ($[22] !== footer) {
1120
+ t17 = footer || {};
1121
+ $[22] = footer;
1122
+ $[23] = t17;
1123
+ } else {
1124
+ t17 = $[23];
1125
+ }
1126
+ const {
1127
+ callToAction: t18
1128
+ } = t17;
1129
+ const callToAction = t18 === undefined ? null : t18;
1130
+ let t19;
1131
+ if ($[24] !== callToAction) {
1132
+ t19 = callToAction || {};
1133
+ $[24] = callToAction;
1134
+ $[25] = t19;
1135
+ } else {
1136
+ t19 = $[25];
1137
+ }
1138
+ const {
1139
+ url: t20
1140
+ } = t19;
1141
+ const ctaUrl = t20 === undefined ? null : t20;
1142
+ let articleImage;
1143
+ let articleTitle;
1144
+ let defaultType;
1145
+ let finalArticleAuthor;
1146
+ let hasArticle;
1147
+ let large;
1148
+ let medium;
1149
+ let site;
1150
+ let t21;
1151
+ if ($[26] !== article || $[27] !== articleType) {
1152
+ const {
1153
+ type: t22,
1154
+ title: t23,
1155
+ image: t24,
1156
+ metadata: t25
1157
+ } = article || {};
1158
+ const type = t22 === undefined ? null : t22;
1159
+ articleTitle = t23 === undefined ? null : t23;
1160
+ articleImage = t24 === undefined ? null : t24;
1161
+ const metadata = t25 === undefined ? {} : t25;
1162
+ hasArticle = article !== null;
1163
+ const {
1164
+ authors: t26,
1165
+ sponsors: t27,
1166
+ brands: t28
1167
+ } = metadata || {};
1168
+ const authors = t26 === undefined ? [] : t26;
1169
+ const sponsors = t27 === undefined ? [] : t27;
1170
+ const brands = t28 === undefined ? [] : t28;
1171
+ const [t29] = authors || [];
1172
+ const creditAuthor = t29 === undefined ? null : t29;
1173
+ const [t30] = brands || [];
1174
+ const {
1175
+ handle: t31
1176
+ } = t30 === undefined ? {} : t30;
1177
+ site = t31 === undefined ? null : t31;
1178
+ const {
1179
+ sizes: t32
1180
+ } = articleImage || {};
1181
+ const sizes = t32 === undefined ? {} : t32;
1182
+ const {
1183
+ medium: t33,
1184
+ large: t34
1185
+ } = sizes || {};
1186
+ medium = t33 === undefined ? {} : t33;
1187
+ large = t34 === undefined ? {} : t34;
1188
+ const {
1189
+ name: t35,
1190
+ image: t36
1191
+ } = creditAuthor || {};
1192
+ const authorName = t35 === undefined ? null : t35;
1193
+ const authorImage = t36 === undefined ? null : t36;
1194
+ const hasCreditAuthorName = authorName !== null && authorName !== "";
1195
+ finalArticleAuthor = {
1196
+ ...(hasCreditAuthorName ? {
1197
+ name: {
1198
+ body: `<p>${authorName}</p>`
1199
+ }
1200
+ } : null),
1201
+ ...(authorImage !== null ? {
1202
+ image: authorImage
1203
+ } : null)
1204
+ };
1205
+ defaultType = articleType || type;
1206
+ t21 = (sponsors || []).length > 0 ? (sponsors || []).map(_temp$1).filter(_temp2$1).join(", ").trim() : null;
1207
+ $[26] = article;
1208
+ $[27] = articleType;
1209
+ $[28] = articleImage;
1210
+ $[29] = articleTitle;
1211
+ $[30] = defaultType;
1212
+ $[31] = finalArticleAuthor;
1213
+ $[32] = hasArticle;
1214
+ $[33] = large;
1215
+ $[34] = medium;
1216
+ $[35] = site;
1217
+ $[36] = t21;
1218
+ } else {
1219
+ articleImage = $[28];
1220
+ articleTitle = $[29];
1221
+ defaultType = $[30];
1222
+ finalArticleAuthor = $[31];
1223
+ hasArticle = $[32];
1224
+ large = $[33];
1225
+ medium = $[34];
1226
+ site = $[35];
1227
+ t21 = $[36];
1228
+ }
1229
+ const defaultSponsor = t21;
1230
+ let t22;
1231
+ if ($[37] !== title) {
1232
+ t22 = isTextFilled(title);
1233
+ $[37] = title;
1234
+ $[38] = t22;
1235
+ } else {
1236
+ t22 = $[38];
1237
+ }
1238
+ const hasTitle = t22;
1239
+ let t23;
1240
+ if ($[39] !== overTitle) {
1241
+ t23 = isTextFilled(overTitle);
1242
+ $[39] = overTitle;
1243
+ $[40] = t23;
1244
+ } else {
1245
+ t23 = $[40];
1246
+ }
1247
+ const hasOverTitle = t23;
1248
+ let t24;
1249
+ if ($[41] !== sponsorLabel) {
1250
+ t24 = isTextFilled(sponsorLabel);
1251
+ $[41] = sponsorLabel;
1252
+ $[42] = t24;
1253
+ } else {
1254
+ t24 = $[42];
1255
+ }
1256
+ const hasSponsorProps = t24;
1257
+ const hasAuthorProps = author !== null && author.name !== null && isTextFilled(author.name);
1258
+ let t25;
1259
+ if ($[43] !== defaultSponsor || $[44] !== hasSponsorProps) {
1260
+ t25 = !hasSponsorProps && defaultSponsor !== null ? /*#__PURE__*/jsx(FormattedMessage, {
571
1261
  id: "+TPjd4",
572
- defaultMessage: [{
573
- "type": 0,
574
- "value": "Presented by"
575
- }]
1262
+ defaultMessage: "Presented by"
576
1263
  }) : null;
577
- return {
1264
+ $[43] = defaultSponsor;
1265
+ $[44] = hasSponsorProps;
1266
+ $[45] = t25;
1267
+ } else {
1268
+ t25 = $[45];
1269
+ }
1270
+ const sponsorPrefix = t25;
1271
+ let t26;
1272
+ if ($[46] !== articleTitle || $[47] !== hasTitle || $[48] !== title) {
1273
+ t26 = hasTitle ? title : {
1274
+ ...title,
1275
+ body: articleTitle
1276
+ };
1277
+ $[46] = articleTitle;
1278
+ $[47] = hasTitle;
1279
+ $[48] = title;
1280
+ $[49] = t26;
1281
+ } else {
1282
+ t26 = $[49];
1283
+ }
1284
+ let t27;
1285
+ if ($[50] !== hasOverTitle || $[51] !== overTitle) {
1286
+ t27 = hasOverTitle ? overTitle : {
1287
+ ...overTitle,
1288
+ body: "En vedette"
1289
+ };
1290
+ $[50] = hasOverTitle;
1291
+ $[51] = overTitle;
1292
+ $[52] = t27;
1293
+ } else {
1294
+ t27 = $[52];
1295
+ }
1296
+ const t28 = hasAuthorProps ? author : null;
1297
+ let t29;
1298
+ if ($[53] !== finalArticleAuthor || $[54] !== t28) {
1299
+ t29 = {
1300
+ ...finalArticleAuthor,
1301
+ ...t28
1302
+ };
1303
+ $[53] = finalArticleAuthor;
1304
+ $[54] = t28;
1305
+ $[55] = t29;
1306
+ } else {
1307
+ t29 = $[55];
1308
+ }
1309
+ let t30;
1310
+ if ($[56] !== defaultSponsor || $[57] !== hasSponsorProps || $[58] !== sponsorLabel) {
1311
+ t30 = defaultSponsor !== null && !hasSponsorProps ? [{
1312
+ ...sponsorLabel,
1313
+ body: `<strong>${defaultSponsor}</strong>`
1314
+ }] : [sponsorLabel];
1315
+ $[56] = defaultSponsor;
1316
+ $[57] = hasSponsorProps;
1317
+ $[58] = sponsorLabel;
1318
+ $[59] = t30;
1319
+ } else {
1320
+ t30 = $[59];
1321
+ }
1322
+ let t31;
1323
+ if ($[60] !== articleImage || $[61] !== image || $[62] !== imageUrl || $[63] !== large || $[64] !== medium) {
1324
+ t31 = imageUrl !== null && image !== null ? image : {
1325
+ type: "image",
1326
+ ...articleImage,
1327
+ sizes: {
1328
+ medium,
1329
+ large
1330
+ }
1331
+ };
1332
+ $[60] = articleImage;
1333
+ $[61] = image;
1334
+ $[62] = imageUrl;
1335
+ $[63] = large;
1336
+ $[64] = medium;
1337
+ $[65] = t31;
1338
+ } else {
1339
+ t31 = $[65];
1340
+ }
1341
+ let t32;
1342
+ if ($[66] !== defaultType) {
1343
+ t32 = defaultType === "video" ? {
1344
+ body: "Regarder"
1345
+ } : {
1346
+ body: "Lire"
1347
+ };
1348
+ $[66] = defaultType;
1349
+ $[67] = t32;
1350
+ } else {
1351
+ t32 = $[67];
1352
+ }
1353
+ let t33;
1354
+ if ($[68] !== finalUrl || $[69] !== hasArticle) {
1355
+ t33 = hasArticle ? {
1356
+ active: finalUrl !== null
1357
+ } : null;
1358
+ $[68] = finalUrl;
1359
+ $[69] = hasArticle;
1360
+ $[70] = t33;
1361
+ } else {
1362
+ t33 = $[70];
1363
+ }
1364
+ const t34 = ctaUrl || finalUrl;
1365
+ let t35;
1366
+ if ($[71] !== callToAction || $[72] !== t32 || $[73] !== t33 || $[74] !== t34) {
1367
+ t35 = {
1368
+ type: "swipe-up",
1369
+ label: t32,
1370
+ inWebView: true,
1371
+ ...callToAction,
1372
+ ...t33,
1373
+ url: t34
1374
+ };
1375
+ $[71] = callToAction;
1376
+ $[72] = t32;
1377
+ $[73] = t33;
1378
+ $[74] = t34;
1379
+ $[75] = t35;
1380
+ } else {
1381
+ t35 = $[75];
1382
+ }
1383
+ let t36;
1384
+ if ($[76] !== footer || $[77] !== t35) {
1385
+ t36 = {
1386
+ ...footer,
1387
+ callToAction: t35
1388
+ };
1389
+ $[76] = footer;
1390
+ $[77] = t35;
1391
+ $[78] = t36;
1392
+ } else {
1393
+ t36 = $[78];
1394
+ }
1395
+ let t37;
1396
+ if ($[79] !== articleTitle || $[80] !== defaultType || $[81] !== finalUrl || $[82] !== header || $[83] !== site || $[84] !== sponsorPrefix || $[85] !== t26 || $[86] !== t27 || $[87] !== t29 || $[88] !== t30 || $[89] !== t31 || $[90] !== t36) {
1397
+ t37 = {
578
1398
  type: defaultType,
579
- title: hasTitle ? title : _objectSpread(_objectSpread({}, title), {}, {
580
- body: articleTitle
581
- }),
582
- articleTitle: articleTitle,
583
- overTitle: hasOverTitle ? overTitle : _objectSpread(_objectSpread({}, overTitle), {}, {
584
- body: 'En vedette'
585
- }),
586
- author: _objectSpread(_objectSpread({}, finalArticleAuthor), hasAuthorProps ? author : null),
587
- sponsors: defaultSponsor !== null && !hasSponsorProps ? [_objectSpread(_objectSpread({}, sponsorLabel), {}, {
588
- body: "<strong>".concat(defaultSponsor, "</strong>")
589
- })] : [sponsorLabel],
590
- sponsorPrefix: sponsorPrefix,
591
- site: site,
592
- image: imageUrl !== null && image !== null ? image : _objectSpread(_objectSpread({
593
- type: 'image'
594
- }, articleImage), {}, {
595
- sizes: {
596
- medium: medium,
597
- large: large
598
- }
599
- }),
1399
+ title: t26,
1400
+ articleTitle,
1401
+ overTitle: t27,
1402
+ author: t29,
1403
+ sponsors: t30,
1404
+ sponsorPrefix,
1405
+ site,
1406
+ image: t31,
600
1407
  url: finalUrl,
601
- header: header,
602
- footer: _objectSpread(_objectSpread({}, footer), {}, {
603
- callToAction: _objectSpread(_objectSpread(_objectSpread({
604
- type: 'swipe-up',
605
- label: defaultType === 'video' ? {
606
- body: 'Regarder'
607
- } : {
608
- body: 'Lire'
609
- },
610
- inWebView: true
611
- }, callToAction), hasArticle ? {
612
- active: finalUrl !== null
613
- } : null), {}, {
614
- url: ctaUrl || finalUrl
615
- })
616
- })
1408
+ header,
1409
+ footer: t36
617
1410
  };
618
- }, [article, url, title, finalUrl, props, articleType, overTitle, sponsorLabel, author, image, header, footer]);
619
- var _ref13 = values || {},
620
- _ref13$title = _ref13.title,
621
- articleTitle = _ref13$title === void 0 ? null : _ref13$title;
622
- var _ref14 = articleTitle || {},
623
- _ref14$body = _ref14.body,
624
- titleBody = _ref14$body === void 0 ? null : _ref14$body;
625
- return /*#__PURE__*/jsx(Component, _objectSpread(_objectSpread(_objectSpread({}, props), values), {}, {
626
- hasArticle: titleBody !== null
627
- }));
1411
+ $[79] = articleTitle;
1412
+ $[80] = defaultType;
1413
+ $[81] = finalUrl;
1414
+ $[82] = header;
1415
+ $[83] = site;
1416
+ $[84] = sponsorPrefix;
1417
+ $[85] = t26;
1418
+ $[86] = t27;
1419
+ $[87] = t29;
1420
+ $[88] = t30;
1421
+ $[89] = t31;
1422
+ $[90] = t36;
1423
+ $[91] = t37;
1424
+ } else {
1425
+ t37 = $[91];
1426
+ }
1427
+ const values = t37;
1428
+ let t38;
1429
+ if ($[92] !== values) {
1430
+ t38 = values || {};
1431
+ $[92] = values;
1432
+ $[93] = t38;
1433
+ } else {
1434
+ t38 = $[93];
1435
+ }
1436
+ const {
1437
+ title: t39
1438
+ } = t38;
1439
+ const articleTitle_0 = t39 === undefined ? null : t39;
1440
+ let t40;
1441
+ if ($[94] !== articleTitle_0) {
1442
+ t40 = articleTitle_0 || {};
1443
+ $[94] = articleTitle_0;
1444
+ $[95] = t40;
1445
+ } else {
1446
+ t40 = $[95];
1447
+ }
1448
+ const {
1449
+ body: t41
1450
+ } = t40;
1451
+ const titleBody = t41 === undefined ? null : t41;
1452
+ const t42 = titleBody !== null;
1453
+ let t43;
1454
+ if ($[96] !== Component || $[97] !== props || $[98] !== t42 || $[99] !== values) {
1455
+ t43 = /*#__PURE__*/jsx(Component, {
1456
+ ...props,
1457
+ ...values,
1458
+ hasArticle: t42
1459
+ });
1460
+ $[96] = Component;
1461
+ $[97] = props;
1462
+ $[98] = t42;
1463
+ $[99] = values;
1464
+ $[100] = t43;
1465
+ } else {
1466
+ t43 = $[100];
1467
+ }
1468
+ return t43;
1469
+ }
1470
+ function _temp2$1(name_0) {
1471
+ return name_0 !== null;
1472
+ }
1473
+ function _temp$1(t0) {
1474
+ const {
1475
+ organisation: t1
1476
+ } = t0;
1477
+ const {
1478
+ name: t2
1479
+ } = t1 === undefined ? {} : t1;
1480
+ const name = t2 === undefined ? null : t2;
1481
+ return name;
628
1482
  }
629
1483
 
630
1484
  // import * as transforms from './transforms/index';
@@ -636,19 +1490,13 @@ var definition = {
636
1490
  group: {
637
1491
  label: defineMessage({
638
1492
  id: "oPjl8f",
639
- defaultMessage: [{
640
- "type": 0,
641
- "value": "Urbania"
642
- }]
1493
+ defaultMessage: "Urbania"
643
1494
  }),
644
1495
  order: 10
645
1496
  },
646
1497
  title: defineMessage({
647
1498
  id: "nJgzwC",
648
- defaultMessage: [{
649
- "type": 0,
650
- "value": "Urbania article"
651
- }]
1499
+ defaultMessage: "Urbania article"
652
1500
  }),
653
1501
  component: UrbaniaLoader,
654
1502
  fields: [{
@@ -656,38 +1504,26 @@ var definition = {
656
1504
  type: 'url',
657
1505
  label: defineMessage({
658
1506
  id: "2pO2Cj",
659
- defaultMessage: [{
660
- "type": 0,
661
- "value": "Url"
662
- }]
1507
+ defaultMessage: "Url"
663
1508
  })
664
1509
  }, {
665
1510
  name: 'articleType',
666
1511
  type: 'select',
667
1512
  label: defineMessage({
668
1513
  id: "ppq6CK",
669
- defaultMessage: [{
670
- "type": 0,
671
- "value": "Type"
672
- }]
1514
+ defaultMessage: "Type"
673
1515
  }),
674
1516
  options: [{
675
1517
  value: 'article',
676
1518
  label: defineMessage({
677
1519
  id: "pE7UhY",
678
- defaultMessage: [{
679
- "type": 0,
680
- "value": "Article"
681
- }]
1520
+ defaultMessage: "Article"
682
1521
  })
683
1522
  }, {
684
1523
  value: 'video',
685
1524
  label: defineMessage({
686
1525
  id: "J9e9Qb",
687
- defaultMessage: [{
688
- "type": 0,
689
- "value": "Video"
690
- }]
1526
+ defaultMessage: "Video"
691
1527
  })
692
1528
  }]
693
1529
  }, {
@@ -698,90 +1534,63 @@ var definition = {
698
1534
  },
699
1535
  label: defineMessage({
700
1536
  id: "z2I2bJ",
701
- defaultMessage: [{
702
- "type": 0,
703
- "value": "Overtitle"
704
- }]
1537
+ defaultMessage: "Overtitle"
705
1538
  })
706
1539
  }, {
707
1540
  name: 'title',
708
1541
  type: 'heading-element',
709
1542
  label: defineMessage({
710
1543
  id: "N25iDO",
711
- defaultMessage: [{
712
- "type": 0,
713
- "value": "Title"
714
- }]
1544
+ defaultMessage: "Title"
715
1545
  })
716
1546
  }, {
717
1547
  name: 'description',
718
1548
  type: 'text-element',
719
1549
  label: defineMessage({
720
1550
  id: "cuKSQz",
721
- defaultMessage: [{
722
- "type": 0,
723
- "value": "Lede"
724
- }]
1551
+ defaultMessage: "Lede"
725
1552
  })
726
1553
  }, {
727
1554
  name: 'author',
728
1555
  type: 'author-element',
729
1556
  label: defineMessage({
730
1557
  id: "73hxYw",
731
- defaultMessage: [{
732
- "type": 0,
733
- "value": "Author"
734
- }]
1558
+ defaultMessage: "Author"
735
1559
  })
736
1560
  }, {
737
1561
  name: 'sponsorLabel',
738
1562
  type: 'heading-element',
739
1563
  label: defineMessage({
740
1564
  id: "hzvEim",
741
- defaultMessage: [{
742
- "type": 0,
743
- "value": "Sponsor Label"
744
- }]
1565
+ defaultMessage: "Sponsor Label"
745
1566
  })
746
1567
  }, {
747
1568
  name: 'sponsorColor',
748
1569
  type: 'color',
749
1570
  label: defineMessage({
750
1571
  id: "Qw8cb5",
751
- defaultMessage: [{
752
- "type": 0,
753
- "value": "Sponsor color"
754
- }]
1572
+ defaultMessage: "Sponsor color"
755
1573
  })
756
1574
  }, {
757
1575
  name: 'image',
758
1576
  type: 'visual',
759
1577
  label: defineMessage({
760
1578
  id: "k+coTi",
761
- defaultMessage: [{
762
- "type": 0,
763
- "value": "Image"
764
- }]
1579
+ defaultMessage: "Image"
765
1580
  })
766
1581
  }, {
767
1582
  name: 'background',
768
1583
  type: 'background',
769
1584
  label: defineMessage({
770
1585
  id: "+MPZRu",
771
- defaultMessage: [{
772
- "type": 0,
773
- "value": "Background"
774
- }]
1586
+ defaultMessage: "Background"
775
1587
  })
776
1588
  }, {
777
1589
  name: 'header',
778
1590
  type: 'header',
779
1591
  label: defineMessage({
780
1592
  id: "rhuDxI",
781
- defaultMessage: [{
782
- "type": 0,
783
- "value": "Header"
784
- }]
1593
+ defaultMessage: "Header"
785
1594
  }),
786
1595
  theme: {
787
1596
  badge: {
@@ -796,10 +1605,7 @@ var definition = {
796
1605
  type: 'footer',
797
1606
  label: defineMessage({
798
1607
  id: "g4nybp",
799
- defaultMessage: [{
800
- "type": 0,
801
- "value": "Footer"
802
- }]
1608
+ defaultMessage: "Footer"
803
1609
  }),
804
1610
  theme: {
805
1611
  callToAction: {
@@ -814,325 +1620,763 @@ var definition = {
814
1620
 
815
1621
  var styles = {"container":"micromag-screen-urbania-article-urbania-base-article-card-container","background":"micromag-screen-urbania-article-urbania-base-article-card-background","content":"micromag-screen-urbania-article-urbania-base-article-card-content","layout":"micromag-screen-urbania-article-urbania-base-article-card-layout","text":"micromag-screen-urbania-article-urbania-base-article-card-text","cardContainer":"micromag-screen-urbania-article-urbania-base-article-card-cardContainer","isPlaceholder":"micromag-screen-urbania-article-urbania-base-article-card-isPlaceholder","card":"micromag-screen-urbania-article-urbania-base-article-card-card","callToAction":"micromag-screen-urbania-article-urbania-base-article-card-callToAction","arrow":"micromag-screen-urbania-article-urbania-base-article-card-arrow","ctaText":"micromag-screen-urbania-article-urbania-base-article-card-ctaText","cardInner":"micromag-screen-urbania-article-urbania-base-article-card-cardInner","pulse":"micromag-screen-urbania-article-urbania-base-article-card-pulse","dragHandle":"micromag-screen-urbania-article-urbania-base-article-card-dragHandle","articlePreview":"micromag-screen-urbania-article-urbania-base-article-card-articlePreview","articlePreviewInner":"micromag-screen-urbania-article-urbania-base-article-card-articlePreviewInner","articleTitle":"micromag-screen-urbania-article-urbania-base-article-card-articleTitle","placeholder":"micromag-screen-urbania-article-urbania-base-article-card-placeholder","empty":"micromag-screen-urbania-article-urbania-base-article-card-empty","header":"micromag-screen-urbania-article-urbania-base-article-card-header"};
816
1622
 
817
- function UrbaniaArticleCard(_ref) {
818
- var _ref$hasArticle = _ref.hasArticle,
819
- hasArticle = _ref$hasArticle === void 0 ? false : _ref$hasArticle,
820
- _ref$url = _ref.url,
821
- url = _ref$url === void 0 ? null : _ref$url,
822
- _ref$title = _ref.title,
823
- title = _ref$title === void 0 ? null : _ref$title,
824
- _ref$author = _ref.author,
825
- author = _ref$author === void 0 ? null : _ref$author,
826
- _ref$text = _ref.text,
827
- text = _ref$text === void 0 ? null : _ref$text,
828
- _ref$image = _ref.image,
829
- image = _ref$image === void 0 ? null : _ref$image,
830
- _ref$header = _ref.header,
831
- header = _ref$header === void 0 ? null : _ref$header,
832
- _ref$background = _ref.background,
833
- background = _ref$background === void 0 ? null : _ref$background,
834
- _ref$callToAction = _ref.callToAction,
835
- callToAction = _ref$callToAction === void 0 ? null : _ref$callToAction,
836
- _ref$current = _ref.current,
837
- current = _ref$current === void 0 ? true : _ref$current,
838
- _ref$preload = _ref.preload,
839
- preload = _ref$preload === void 0 ? true : _ref$preload,
840
- _ref$spacing = _ref.spacing,
841
- spacing = _ref$spacing === void 0 ? 20 : _ref$spacing,
842
- _ref$className = _ref.className,
843
- className = _ref$className === void 0 ? null : _ref$className;
844
- var intl = useIntl();
845
- var finalBackground = background !== null && (typeof background.color !== 'undefined' && background.color !== null || typeof background.image !== 'undefined' && background.image !== null || typeof background.video !== 'undefined' && background.video !== null) ? background : {
846
- image: image
847
- };
848
- var _ref2 = finalBackground || {},
849
- _ref2$video = _ref2.video,
850
- backgroundVideo = _ref2$video === void 0 ? null : _ref2$video;
851
- var isBackgroundVideo = backgroundVideo !== null;
852
- var _useScreenSize = useScreenSize(),
853
- width = _useScreenSize.width,
854
- height = _useScreenSize.height,
855
- resolution = _useScreenSize.resolution;
856
- var _useScreenRenderConte = useScreenRenderContext(),
857
- isView = _useScreenRenderConte.isView,
858
- isPreview = _useScreenRenderConte.isPreview,
859
- isPlaceholder = _useScreenRenderConte.isPlaceholder,
860
- isEdit = _useScreenRenderConte.isEdit,
861
- isStatic = _useScreenRenderConte.isStatic,
862
- isCapture = _useScreenRenderConte.isCapture;
863
- var _useViewerWebView = useViewerWebView(),
864
- openWebView = _useViewerWebView.open,
865
- _useViewerWebView$ope = _useViewerWebView.opened,
866
- webviewOpened = _useViewerWebView$ope === void 0 ? false : _useViewerWebView$ope,
867
- _useViewerWebView$clo = _useViewerWebView.close,
868
- closeWebView = _useViewerWebView$clo === void 0 ? null : _useViewerWebView$clo;
869
- var _useViewerContext = useViewerContext(),
870
- viewerTopHeight = _useViewerContext.topHeight,
871
- viewerBottomHeight = _useViewerContext.bottomHeight;
872
- var _useViewerInteraction = useViewerInteraction(),
873
- enableInteraction = _useViewerInteraction.enableInteraction,
874
- disableInteraction = _useViewerInteraction.disableInteraction;
875
- var _usePlaybackContext = usePlaybackContext(),
876
- playing = _usePlaybackContext.playing,
877
- muted = _usePlaybackContext.muted,
878
- setControls = _usePlaybackContext.setControls,
879
- setControlsTheme = _usePlaybackContext.setControlsTheme,
880
- setControlsSuggestPlay = _usePlaybackContext.setControlsSuggestPlay,
881
- setPlaying = _usePlaybackContext.setPlaying;
882
- var _ref3 = author || {},
883
- _ref3$name = _ref3.name,
884
- authorName = _ref3$name === void 0 ? null : _ref3$name;
885
- var hasUrl = url !== null && isString(url) && url.length > 0;
886
- var hasHeader = isHeaderFilled(header);
887
- var hasText = isTextFilled(text);
888
- var hasTitle = isTextFilled(title);
889
- var hasAuthorName = isTextFilled(authorName);
890
- var hasCta = isTextFilled(callToAction);
891
-
892
- // const isSimple = hasUrl && url.indexOf('simple.urbania.ca') !== -1;
893
- var finalUrl = useMemo(function () {
894
- var cleanedUrl = hasUrl ? url.replace(/^https?:\/\/([^.]+\.)?urbania\.(fr|ca)\//, 'https://urbania.$2/') : url;
895
- var currentQueryString = queryString.parse(cleanedUrl !== null && cleanedUrl.indexOf('?') !== -1 ? cleanedUrl.split('?')[1] : '');
896
- return cleanedUrl !== null ? "".concat(cleanedUrl.split('?')[0], "?").concat(queryString.stringify(_objectSpread({
1623
+ function UrbaniaArticleCard(t0) {
1624
+ const $ = c(148);
1625
+ const {
1626
+ hasArticle: t1,
1627
+ url: t2,
1628
+ title: t3,
1629
+ author: t4,
1630
+ text: t5,
1631
+ image: t6,
1632
+ header: t7,
1633
+ background: t8,
1634
+ callToAction: t9,
1635
+ current: t10,
1636
+ preload: t11,
1637
+ spacing: t12,
1638
+ mediaRef: t13,
1639
+ className: t14
1640
+ } = t0;
1641
+ const hasArticle = t1 === undefined ? false : t1;
1642
+ const url = t2 === undefined ? null : t2;
1643
+ const title = t3 === undefined ? null : t3;
1644
+ const author = t4 === undefined ? null : t4;
1645
+ const text = t5 === undefined ? null : t5;
1646
+ const image = t6 === undefined ? null : t6;
1647
+ const header = t7 === undefined ? null : t7;
1648
+ const background = t8 === undefined ? null : t8;
1649
+ const callToAction = t9 === undefined ? null : t9;
1650
+ const current = t10 === undefined ? true : t10;
1651
+ const preload = t11 === undefined ? true : t11;
1652
+ const spacing = t12 === undefined ? 20 : t12;
1653
+ const customMediaRef = t13 === undefined ? null : t13;
1654
+ const className = t14 === undefined ? null : t14;
1655
+ const intl = useIntl();
1656
+ let t15;
1657
+ if ($[0] !== background || $[1] !== image) {
1658
+ t15 = background !== null && (typeof background.color !== "undefined" && background.color !== null || typeof background.image !== "undefined" && background.image !== null || typeof background.video !== "undefined" && background.video !== null) ? background : {
1659
+ image
1660
+ };
1661
+ $[0] = background;
1662
+ $[1] = image;
1663
+ $[2] = t15;
1664
+ } else {
1665
+ t15 = $[2];
1666
+ }
1667
+ const finalBackground = t15;
1668
+ let t16;
1669
+ if ($[3] !== finalBackground) {
1670
+ t16 = finalBackground || {};
1671
+ $[3] = finalBackground;
1672
+ $[4] = t16;
1673
+ } else {
1674
+ t16 = $[4];
1675
+ }
1676
+ const {
1677
+ video: t17
1678
+ } = t16;
1679
+ const backgroundVideo = t17 === undefined ? null : t17;
1680
+ const isBackgroundVideo = backgroundVideo !== null;
1681
+ const {
1682
+ width,
1683
+ height,
1684
+ resolution
1685
+ } = useScreenSize();
1686
+ const {
1687
+ isView,
1688
+ isPreview,
1689
+ isPlaceholder,
1690
+ isEdit,
1691
+ isStatic,
1692
+ isCapture
1693
+ } = useScreenRenderContext();
1694
+ const {
1695
+ open: openWebView,
1696
+ opened: t18,
1697
+ close: t19
1698
+ } = useViewerWebView();
1699
+ const webviewOpened = t18 === undefined ? false : t18;
1700
+ const closeWebView = t19 === undefined ? null : t19;
1701
+ const {
1702
+ topHeight: viewerTopHeight,
1703
+ bottomHeight: viewerBottomHeight
1704
+ } = useViewerContext();
1705
+ const {
1706
+ enableInteraction,
1707
+ disableInteraction
1708
+ } = useViewerInteraction();
1709
+ const {
1710
+ playing,
1711
+ muted,
1712
+ setControls,
1713
+ setControlsTheme,
1714
+ setControlsSuggestPlay,
1715
+ setPlaying
1716
+ } = usePlaybackContext();
1717
+ let t20;
1718
+ if ($[5] !== author) {
1719
+ t20 = author || {};
1720
+ $[5] = author;
1721
+ $[6] = t20;
1722
+ } else {
1723
+ t20 = $[6];
1724
+ }
1725
+ const {
1726
+ name: t21
1727
+ } = t20;
1728
+ const authorName = t21 === undefined ? null : t21;
1729
+ let t22;
1730
+ if ($[7] !== url) {
1731
+ t22 = url !== null && isString(url) && url.length > 0;
1732
+ $[7] = url;
1733
+ $[8] = t22;
1734
+ } else {
1735
+ t22 = $[8];
1736
+ }
1737
+ const hasUrl = t22;
1738
+ let t23;
1739
+ if ($[9] !== header) {
1740
+ t23 = isHeaderFilled(header);
1741
+ $[9] = header;
1742
+ $[10] = t23;
1743
+ } else {
1744
+ t23 = $[10];
1745
+ }
1746
+ const hasHeader = t23;
1747
+ let t24;
1748
+ if ($[11] !== text) {
1749
+ t24 = isTextFilled(text);
1750
+ $[11] = text;
1751
+ $[12] = t24;
1752
+ } else {
1753
+ t24 = $[12];
1754
+ }
1755
+ const hasText = t24;
1756
+ let t25;
1757
+ if ($[13] !== title) {
1758
+ t25 = isTextFilled(title);
1759
+ $[13] = title;
1760
+ $[14] = t25;
1761
+ } else {
1762
+ t25 = $[14];
1763
+ }
1764
+ const hasTitle = t25;
1765
+ let t26;
1766
+ if ($[15] !== authorName) {
1767
+ t26 = isTextFilled(authorName);
1768
+ $[15] = authorName;
1769
+ $[16] = t26;
1770
+ } else {
1771
+ t26 = $[16];
1772
+ }
1773
+ const hasAuthorName = t26;
1774
+ let t27;
1775
+ if ($[17] !== callToAction) {
1776
+ t27 = isTextFilled(callToAction);
1777
+ $[17] = callToAction;
1778
+ $[18] = t27;
1779
+ } else {
1780
+ t27 = $[18];
1781
+ }
1782
+ const hasCta = t27;
1783
+ let t28;
1784
+ if ($[19] !== hasUrl || $[20] !== url) {
1785
+ const cleanedUrl = hasUrl ? url.replace(/^https?:\/\/([^.]+\.)?urbania\.(fr|ca)\//, "https://urbania.$2/") : url;
1786
+ const currentQueryString = queryString.parse(cleanedUrl !== null && cleanedUrl.indexOf("?") !== -1 ? cleanedUrl.split("?")[1] : "");
1787
+ t28 = cleanedUrl !== null ? `${cleanedUrl.split("?")[0]}?${queryString.stringify({
897
1788
  reader: true,
898
- _ref: 'micromag'
899
- }, currentQueryString))) : url;
900
- }, [hasUrl, url]);
901
- var mediaShouldLoad = current || preload;
902
- var _usePlaybackMediaRef = usePlaybackMediaRef(current && !webviewOpened, true),
903
- mediaRef = _usePlaybackMediaRef.ref,
904
- _usePlaybackMediaRef$ = _usePlaybackMediaRef.isCurrent,
905
- isCurrentMedia = _usePlaybackMediaRef$ === void 0 ? false : _usePlaybackMediaRef$;
906
- var backgroundPlaying = current && (isView || isEdit) && (isCurrentMedia || !isView);
907
-
908
- // card animations
909
- var withCardAnimation = !isPlaceholder && !isPreview && !isStatic;
910
- var slideInDelay = withCardAnimation && isBackgroundVideo && backgroundPlaying;
911
- var withCardBounce = withCardAnimation && current;
912
- useEffect(function () {
913
- if (!current) {
914
- return function () {};
915
- }
916
- setControlsTheme({
917
- seekBarOnly: true
918
- });
919
- if (isBackgroundVideo && !webviewOpened) {
920
- setControls(true);
921
- } else {
922
- setControls(false);
923
- }
924
- return function () {
1789
+ _ref: "micromag",
1790
+ ...currentQueryString
1791
+ })}` : url;
1792
+ $[19] = hasUrl;
1793
+ $[20] = url;
1794
+ $[21] = t28;
1795
+ } else {
1796
+ t28 = $[21];
1797
+ }
1798
+ const finalUrl = t28;
1799
+ const mediaShouldLoad = current || preload;
1800
+ const {
1801
+ ref: mediaRef,
1802
+ isCurrent: t29
1803
+ } = usePlaybackMediaRef(current && !webviewOpened, true);
1804
+ const isCurrentMedia = t29 === undefined ? false : t29;
1805
+ const backgroundPlaying = current && (isView || isEdit) && (isCurrentMedia || !isView);
1806
+ const withCardAnimation = !isPlaceholder && !isPreview && !isStatic;
1807
+ const slideInDelay = withCardAnimation && isBackgroundVideo && backgroundPlaying;
1808
+ const withCardBounce = withCardAnimation && current;
1809
+ let t30;
1810
+ let t31;
1811
+ if ($[22] !== current || $[23] !== isBackgroundVideo || $[24] !== setControls || $[25] !== setControlsTheme || $[26] !== webviewOpened) {
1812
+ t30 = () => {
1813
+ if (!current) {
1814
+ return _temp;
1815
+ }
1816
+ setControlsTheme({
1817
+ seekBarOnly: true
1818
+ });
925
1819
  if (isBackgroundVideo && !webviewOpened) {
1820
+ setControls(true);
1821
+ } else {
926
1822
  setControls(false);
927
1823
  }
1824
+ return () => {
1825
+ if (isBackgroundVideo && !webviewOpened) {
1826
+ setControls(false);
1827
+ }
1828
+ };
928
1829
  };
929
- }, [current, setControls, isBackgroundVideo, webviewOpened, setControls, setControlsTheme]);
930
- var toggleCard = useCallback(function () {
931
- var newOpened = !webviewOpened;
932
- if (newOpened) {
933
- openWebView(finalUrl);
934
- // console.log('web open');
935
- disableInteraction();
936
- } else {
937
- enableInteraction();
938
- // console.log('web not open');
939
- }
940
- }, [webviewOpened, disableInteraction, enableInteraction, openWebView, finalUrl]);
941
- var bindGesture = useGesture({
942
- onDrag: function onDrag(_ref4) {
943
- var _ref4$movement = _slicedToArray(_ref4.movement, 2),
944
- my = _ref4$movement[1];
945
- if (!webviewOpened && my < 0 || webviewOpened && my > 0) {
946
- toggleCard();
1830
+ t31 = [current, setControls, isBackgroundVideo, webviewOpened, setControls, setControlsTheme];
1831
+ $[22] = current;
1832
+ $[23] = isBackgroundVideo;
1833
+ $[24] = setControls;
1834
+ $[25] = setControlsTheme;
1835
+ $[26] = webviewOpened;
1836
+ $[27] = t30;
1837
+ $[28] = t31;
1838
+ } else {
1839
+ t30 = $[27];
1840
+ t31 = $[28];
1841
+ }
1842
+ useEffect(t30, t31);
1843
+ let t32;
1844
+ if ($[29] !== disableInteraction || $[30] !== enableInteraction || $[31] !== finalUrl || $[32] !== openWebView || $[33] !== webviewOpened) {
1845
+ t32 = () => {
1846
+ const newOpened = !webviewOpened;
1847
+ if (newOpened) {
1848
+ openWebView(finalUrl);
1849
+ disableInteraction();
1850
+ } else {
1851
+ enableInteraction();
947
1852
  }
948
- },
949
- onWheel: function onWheel(_ref5) {
950
- var _ref5$movement = _slicedToArray(_ref5.movement, 2),
951
- my = _ref5$movement[1];
952
- if (!webviewOpened && my > 0 || webviewOpened && my < 0) {
953
- toggleCard();
1853
+ };
1854
+ $[29] = disableInteraction;
1855
+ $[30] = enableInteraction;
1856
+ $[31] = finalUrl;
1857
+ $[32] = openWebView;
1858
+ $[33] = webviewOpened;
1859
+ $[34] = t32;
1860
+ } else {
1861
+ t32 = $[34];
1862
+ }
1863
+ const toggleCard = t32;
1864
+ let t33;
1865
+ if ($[35] !== toggleCard || $[36] !== webviewOpened) {
1866
+ t33 = {
1867
+ onDrag: t34 => {
1868
+ const {
1869
+ movement: t35
1870
+ } = t34;
1871
+ const [, my] = t35;
1872
+ if (!webviewOpened && my < 0 || webviewOpened && my > 0) {
1873
+ toggleCard();
1874
+ }
1875
+ },
1876
+ onWheel: t36 => {
1877
+ const {
1878
+ movement: t37
1879
+ } = t36;
1880
+ const [, my_0] = t37;
1881
+ if (!webviewOpened && my_0 > 0 || webviewOpened && my_0 < 0) {
1882
+ toggleCard();
1883
+ }
954
1884
  }
955
- }
956
- }, {
957
- drag: {
958
- axis: 'y',
959
- filterTaps: true,
960
- preventDefault: true
961
- },
962
- wheel: {
963
- axis: 'y'
964
- }
965
- });
966
- var _useResizeObserver = useResizeObserver({
967
- disabled: !webviewOpened
968
- }),
969
- articlePreviewRef = _useResizeObserver.ref,
970
- _useResizeObserver$en = _useResizeObserver.entry.contentRect,
971
- articlePreviewContentRect = _useResizeObserver$en === void 0 ? null : _useResizeObserver$en;
972
- var _ref6 = articlePreviewContentRect || {},
973
- _ref6$height = _ref6.height,
974
- articlePreviewHeight = _ref6$height === void 0 ? 0 : _ref6$height;
975
-
976
- // Think about this
977
- var minimumVisibility = 20;
978
- var y = 100;
1885
+ };
1886
+ $[35] = toggleCard;
1887
+ $[36] = webviewOpened;
1888
+ $[37] = t33;
1889
+ } else {
1890
+ t33 = $[37];
1891
+ }
1892
+ let t34;
1893
+ if ($[38] === Symbol.for("react.memo_cache_sentinel")) {
1894
+ t34 = {
1895
+ drag: {
1896
+ axis: "y",
1897
+ filterTaps: true,
1898
+ preventDefault: true
1899
+ },
1900
+ wheel: {
1901
+ axis: "y"
1902
+ }
1903
+ };
1904
+ $[38] = t34;
1905
+ } else {
1906
+ t34 = $[38];
1907
+ }
1908
+ const bindGesture = useGesture(t33, t34);
1909
+ const t35 = !webviewOpened;
1910
+ let t36;
1911
+ if ($[39] !== t35) {
1912
+ t36 = {
1913
+ disabled: t35
1914
+ };
1915
+ $[39] = t35;
1916
+ $[40] = t36;
1917
+ } else {
1918
+ t36 = $[40];
1919
+ }
1920
+ const {
1921
+ ref: articlePreviewRef,
1922
+ entry: t37
1923
+ } = useResizeObserver(t36);
1924
+ const {
1925
+ contentRect: t38
1926
+ } = t37;
1927
+ const articlePreviewContentRect = t38 === undefined ? null : t38;
1928
+ let t39;
1929
+ if ($[41] !== articlePreviewContentRect) {
1930
+ t39 = articlePreviewContentRect || {};
1931
+ $[41] = articlePreviewContentRect;
1932
+ $[42] = t39;
1933
+ } else {
1934
+ t39 = $[42];
1935
+ }
1936
+ const {
1937
+ height: t40
1938
+ } = t39;
1939
+ const articlePreviewHeight = t40 === undefined ? 0 : t40;
1940
+ let y = 100;
979
1941
  if (current) {
980
- y = 100 - Math.max(articlePreviewHeight / height * 100, minimumVisibility);
1942
+ y = 100 - Math.max(articlePreviewHeight / height * 100, 20);
981
1943
  }
982
- var springStyle = useSpring({
983
- from: {
984
- y: isPreview ? y : 100
985
- },
986
- to: {
987
- y: y
988
- },
989
- delay: slideInDelay ? 1500 : 0,
990
- config: {
1944
+ const t41 = isPreview ? y : 100;
1945
+ let t42;
1946
+ if ($[43] !== t41) {
1947
+ t42 = {
1948
+ y: t41
1949
+ };
1950
+ $[43] = t41;
1951
+ $[44] = t42;
1952
+ } else {
1953
+ t42 = $[44];
1954
+ }
1955
+ let t43;
1956
+ if ($[45] !== y) {
1957
+ t43 = {
1958
+ y
1959
+ };
1960
+ $[45] = y;
1961
+ $[46] = t43;
1962
+ } else {
1963
+ t43 = $[46];
1964
+ }
1965
+ const t44 = slideInDelay ? 1500 : 0;
1966
+ const t45 = y === 100 ? 1000 : 400;
1967
+ let t46;
1968
+ if ($[47] !== t45) {
1969
+ t46 = {
991
1970
  easing: easings.easeInOutSine,
992
- duration: y === 100 ? 1000 : 400
993
- }
994
- });
995
-
996
- // TODIO: current switches on/off for a split second and fucks this up
997
- useEffect(function () {
998
- }, [current, webviewOpened, closeWebView, enableInteraction]);
999
- var onPlayError = useCallback(function () {
1000
- if (isView && playing && current && isBackgroundVideo) {
1001
- setPlaying(false);
1002
- setControlsSuggestPlay(true);
1003
- }
1004
- }, [isView, current, playing, isBackgroundVideo, setPlaying, setControlsSuggestPlay]);
1005
- return /*#__PURE__*/jsxs("div", {
1006
- className: classNames([styles.container, className, _defineProperty(_defineProperty({}, styles.isCurrent, current), styles.isPlaceholder, isPlaceholder)]),
1007
- "data-screen-ready": isStatic || isCapture,
1008
- children: [/*#__PURE__*/jsx(Background, {
1971
+ duration: t45
1972
+ };
1973
+ $[47] = t45;
1974
+ $[48] = t46;
1975
+ } else {
1976
+ t46 = $[48];
1977
+ }
1978
+ let t47;
1979
+ if ($[49] !== t42 || $[50] !== t43 || $[51] !== t44 || $[52] !== t46) {
1980
+ t47 = {
1981
+ from: t42,
1982
+ to: t43,
1983
+ delay: t44,
1984
+ config: t46
1985
+ };
1986
+ $[49] = t42;
1987
+ $[50] = t43;
1988
+ $[51] = t44;
1989
+ $[52] = t46;
1990
+ $[53] = t47;
1991
+ } else {
1992
+ t47 = $[53];
1993
+ }
1994
+ const springStyle = useSpring(t47);
1995
+ let t48;
1996
+ if ($[54] !== closeWebView || $[55] !== current || $[56] !== webviewOpened) {
1997
+ t48 = () => {
1998
+ };
1999
+ $[54] = closeWebView;
2000
+ $[55] = current;
2001
+ $[56] = webviewOpened;
2002
+ $[57] = t48;
2003
+ } else {
2004
+ t48 = $[57];
2005
+ }
2006
+ let t49;
2007
+ if ($[58] !== closeWebView || $[59] !== current || $[60] !== enableInteraction || $[61] !== webviewOpened) {
2008
+ t49 = [current, webviewOpened, closeWebView, enableInteraction];
2009
+ $[58] = closeWebView;
2010
+ $[59] = current;
2011
+ $[60] = enableInteraction;
2012
+ $[61] = webviewOpened;
2013
+ $[62] = t49;
2014
+ } else {
2015
+ t49 = $[62];
2016
+ }
2017
+ useEffect(t48, t49);
2018
+ let t50;
2019
+ if ($[63] !== current || $[64] !== isBackgroundVideo || $[65] !== isView || $[66] !== playing || $[67] !== setControlsSuggestPlay || $[68] !== setPlaying) {
2020
+ t50 = () => {
2021
+ if (isView && playing && current && isBackgroundVideo) {
2022
+ setPlaying(false);
2023
+ setControlsSuggestPlay(true);
2024
+ }
2025
+ };
2026
+ $[63] = current;
2027
+ $[64] = isBackgroundVideo;
2028
+ $[65] = isView;
2029
+ $[66] = playing;
2030
+ $[67] = setControlsSuggestPlay;
2031
+ $[68] = setPlaying;
2032
+ $[69] = t50;
2033
+ } else {
2034
+ t50 = $[69];
2035
+ }
2036
+ const onPlayError = t50;
2037
+ let t51;
2038
+ if ($[70] !== className || $[71] !== current || $[72] !== isPlaceholder) {
2039
+ t51 = classNames([styles.container, className, {
2040
+ [styles.isCurrent]: current,
2041
+ [styles.isPlaceholder]: isPlaceholder
2042
+ }]);
2043
+ $[70] = className;
2044
+ $[71] = current;
2045
+ $[72] = isPlaceholder;
2046
+ $[73] = t51;
2047
+ } else {
2048
+ t51 = $[73];
2049
+ }
2050
+ const t52 = isStatic || isCapture;
2051
+ const t53 = backgroundPlaying && !webviewOpened;
2052
+ let t54;
2053
+ if ($[74] !== customMediaRef || $[75] !== mediaRef) {
2054
+ t54 = mergeRefs(mediaRef, customMediaRef);
2055
+ $[74] = customMediaRef;
2056
+ $[75] = mediaRef;
2057
+ $[76] = t54;
2058
+ } else {
2059
+ t54 = $[76];
2060
+ }
2061
+ let t55;
2062
+ if ($[77] !== finalBackground || $[78] !== height || $[79] !== isPreview || $[80] !== mediaShouldLoad || $[81] !== muted || $[82] !== onPlayError || $[83] !== resolution || $[84] !== t53 || $[85] !== t54 || $[86] !== width) {
2063
+ t55 = /*#__PURE__*/jsx(Background, {
1009
2064
  className: styles.background,
1010
2065
  background: finalBackground,
1011
2066
  width: width,
1012
2067
  height: height,
1013
2068
  resolution: resolution,
1014
- playing: backgroundPlaying && !webviewOpened,
2069
+ playing: t53,
1015
2070
  muted: muted,
1016
- mediaRef: mediaRef,
2071
+ mediaRef: t54,
1017
2072
  onPlayError: onPlayError,
1018
2073
  shouldLoad: mediaShouldLoad,
1019
2074
  withoutVideo: isPreview
1020
- }), /*#__PURE__*/jsxs(Container, {
1021
- className: styles.content,
1022
- width: width,
1023
- height: height,
1024
- children: [!isPlaceholder && hasHeader ? /*#__PURE__*/jsx("div", {
1025
- className: styles.header,
1026
- style: {
1027
- paddingTop: spacing / 2,
1028
- paddingLeft: spacing,
1029
- paddingRight: spacing,
1030
- transform: !isPreview ? "translate(0, ".concat(viewerTopHeight, "px)") : null
1031
- },
1032
- children: /*#__PURE__*/jsx(Header, _objectSpread({}, header))
1033
- }, "header") : null, /*#__PURE__*/jsx(Layout, {
1034
- className: styles.layout,
1035
- height: height * 0.65,
1036
- children: /*#__PURE__*/jsx(ScreenElement, {
1037
- empty: /*#__PURE__*/jsx(Empty, {
1038
- className: styles.emptyText,
1039
- children: /*#__PURE__*/jsx(FormattedMessage, {
1040
- id: "z4CiV1",
1041
- defaultMessage: [{
1042
- "type": 0,
1043
- "value": "Text"
1044
- }]
1045
- })
1046
- }),
1047
- placeholder: /*#__PURE__*/jsx(PlaceholderText, {
1048
- className: styles.placeholderText
1049
- }),
1050
- children: hasText ? /*#__PURE__*/jsx(Text, _objectSpread({
1051
- className: styles.text
1052
- }, text)) : null
1053
- }, "text")
1054
- }), /*#__PURE__*/jsx(Container, {
1055
- className: classNames([styles.cardContainer, _defineProperty({}, styles.isPlaceholder, isPlaceholder)]),
1056
- children: /*#__PURE__*/jsx(ScreenElement, {
1057
- placeholderProps: {
1058
- className: styles.placeholder
1059
- },
1060
- emptyLabel: /*#__PURE__*/jsx(FormattedMessage, {
1061
- id: "yMpGIc",
1062
- defaultMessage: [{
1063
- "type": 0,
1064
- "value": "Article"
1065
- }]
1066
- }),
1067
- emptyClassName: styles.empty,
1068
- isEmpty: !hasUrl || !hasArticle,
1069
- children: !isPlaceholder && hasArticle ? /*#__PURE__*/jsxs(animated.div, {
1070
- className: styles.card,
2075
+ });
2076
+ $[77] = finalBackground;
2077
+ $[78] = height;
2078
+ $[79] = isPreview;
2079
+ $[80] = mediaShouldLoad;
2080
+ $[81] = muted;
2081
+ $[82] = onPlayError;
2082
+ $[83] = resolution;
2083
+ $[84] = t53;
2084
+ $[85] = t54;
2085
+ $[86] = width;
2086
+ $[87] = t55;
2087
+ } else {
2088
+ t55 = $[87];
2089
+ }
2090
+ let t56;
2091
+ if ($[88] !== hasHeader || $[89] !== header || $[90] !== isPlaceholder || $[91] !== isPreview || $[92] !== spacing || $[93] !== viewerTopHeight) {
2092
+ t56 = !isPlaceholder && hasHeader ? /*#__PURE__*/jsx("div", {
2093
+ className: styles.header,
2094
+ style: {
2095
+ paddingTop: spacing / 2,
2096
+ paddingLeft: spacing,
2097
+ paddingRight: spacing,
2098
+ transform: !isPreview ? `translate(0, ${viewerTopHeight}px)` : null
2099
+ },
2100
+ children: /*#__PURE__*/jsx(Header, {
2101
+ ...header
2102
+ })
2103
+ }, "header") : null;
2104
+ $[88] = hasHeader;
2105
+ $[89] = header;
2106
+ $[90] = isPlaceholder;
2107
+ $[91] = isPreview;
2108
+ $[92] = spacing;
2109
+ $[93] = viewerTopHeight;
2110
+ $[94] = t56;
2111
+ } else {
2112
+ t56 = $[94];
2113
+ }
2114
+ const t57 = height * 0.65;
2115
+ let t58;
2116
+ let t59;
2117
+ if ($[95] === Symbol.for("react.memo_cache_sentinel")) {
2118
+ t58 = /*#__PURE__*/jsx(Empty, {
2119
+ className: styles.emptyText,
2120
+ children: /*#__PURE__*/jsx(FormattedMessage, {
2121
+ id: "z4CiV1",
2122
+ defaultMessage: "Text"
2123
+ })
2124
+ });
2125
+ t59 = /*#__PURE__*/jsx(PlaceholderText, {
2126
+ className: styles.placeholderText
2127
+ });
2128
+ $[95] = t58;
2129
+ $[96] = t59;
2130
+ } else {
2131
+ t58 = $[95];
2132
+ t59 = $[96];
2133
+ }
2134
+ let t60;
2135
+ if ($[97] !== hasText || $[98] !== text) {
2136
+ t60 = hasText ? /*#__PURE__*/jsx(Text, {
2137
+ className: styles.text,
2138
+ ...text
2139
+ }) : null;
2140
+ $[97] = hasText;
2141
+ $[98] = text;
2142
+ $[99] = t60;
2143
+ } else {
2144
+ t60 = $[99];
2145
+ }
2146
+ let t61;
2147
+ if ($[100] !== t60) {
2148
+ t61 = /*#__PURE__*/jsx(ScreenElement, {
2149
+ empty: t58,
2150
+ placeholder: t59,
2151
+ children: t60
2152
+ }, "text");
2153
+ $[100] = t60;
2154
+ $[101] = t61;
2155
+ } else {
2156
+ t61 = $[101];
2157
+ }
2158
+ let t62;
2159
+ if ($[102] !== t57 || $[103] !== t61) {
2160
+ t62 = /*#__PURE__*/jsx(Layout, {
2161
+ className: styles.layout,
2162
+ height: t57,
2163
+ children: t61
2164
+ });
2165
+ $[102] = t57;
2166
+ $[103] = t61;
2167
+ $[104] = t62;
2168
+ } else {
2169
+ t62 = $[104];
2170
+ }
2171
+ let t63;
2172
+ if ($[105] !== isPlaceholder) {
2173
+ t63 = classNames([styles.cardContainer, {
2174
+ [styles.isPlaceholder]: isPlaceholder
2175
+ }]);
2176
+ $[105] = isPlaceholder;
2177
+ $[106] = t63;
2178
+ } else {
2179
+ t63 = $[106];
2180
+ }
2181
+ let t64;
2182
+ let t65;
2183
+ if ($[107] === Symbol.for("react.memo_cache_sentinel")) {
2184
+ t64 = {
2185
+ className: styles.placeholder
2186
+ };
2187
+ t65 = /*#__PURE__*/jsx(FormattedMessage, {
2188
+ id: "yMpGIc",
2189
+ defaultMessage: "Article"
2190
+ });
2191
+ $[107] = t64;
2192
+ $[108] = t65;
2193
+ } else {
2194
+ t64 = $[107];
2195
+ t65 = $[108];
2196
+ }
2197
+ const t66 = !hasUrl || !hasArticle;
2198
+ let t67;
2199
+ if ($[109] !== articlePreviewRef || $[110] !== author || $[111] !== bindGesture || $[112] !== callToAction || $[113] !== current || $[114] !== hasArticle || $[115] !== hasAuthorName || $[116] !== hasCta || $[117] !== hasTitle || $[118] !== height || $[119] !== intl || $[120] !== isPlaceholder || $[121] !== isPreview || $[122] !== mediaShouldLoad || $[123] !== springStyle || $[124] !== title || $[125] !== toggleCard || $[126] !== viewerBottomHeight || $[127] !== webviewOpened || $[128] !== width || $[129] !== withCardBounce) {
2200
+ t67 = !isPlaceholder && hasArticle ? /*#__PURE__*/jsxs(animated.div, {
2201
+ className: styles.card,
2202
+ style: {
2203
+ height,
2204
+ width,
2205
+ transform: !isPreview ? springStyle.y.to(_temp2) : "translateY(80%)"
2206
+ },
2207
+ children: [/*#__PURE__*/jsx("button", {
2208
+ type: "button",
2209
+ onClick: toggleCard,
2210
+ className: styles.dragHandle,
2211
+ tabIndex: !current ? -1 : 0,
2212
+ "aria-label": intl.formatMessage({
2213
+ id: "IoMJgw",
2214
+ defaultMessage: "Toggle article"
2215
+ }),
2216
+ "aria-pressed": webviewOpened,
2217
+ ...(current ? bindGesture() : null)
2218
+ }), /*#__PURE__*/jsxs("div", {
2219
+ className: classNames([styles.cardInner, {
2220
+ [styles.pulse]: withCardBounce
2221
+ }]),
2222
+ children: [hasCta ? /*#__PURE__*/jsxs("div", {
2223
+ className: styles.callToAction,
2224
+ children: [/*#__PURE__*/jsx(Arrow, {
2225
+ strokeWidth: 1,
2226
+ className: styles.arrow
2227
+ }), /*#__PURE__*/jsx(Text, {
2228
+ className: styles.ctaText,
2229
+ ...callToAction
2230
+ })]
2231
+ }) : null, /*#__PURE__*/jsx("div", {
2232
+ className: styles.articlePreview,
2233
+ ref: articlePreviewRef,
2234
+ children: /*#__PURE__*/jsxs("div", {
2235
+ className: styles.articlePreviewInner,
1071
2236
  style: {
1072
- height: height,
1073
- width: width,
1074
- transform: !isPreview ? springStyle.y.to(function (value) {
1075
- return "translateY(".concat(value, "%");
1076
- }) : "translateY(".concat(100 - minimumVisibility, "%)")
2237
+ paddingBottom: current && !isPreview ? Math.max(viewerBottomHeight, 20) : null
1077
2238
  },
1078
- children: [/*#__PURE__*/jsx("button", _objectSpread({
1079
- type: "button",
1080
- onClick: toggleCard,
1081
- className: styles.dragHandle,
1082
- tabIndex: !current ? -1 : 0,
1083
- "aria-label": intl.formatMessage({
1084
- id: "IoMJgw",
1085
- defaultMessage: [{
1086
- "type": 0,
1087
- "value": "Toggle article"
1088
- }]
1089
- }),
1090
- "aria-pressed": webviewOpened
1091
- }, current ? bindGesture() : null)), /*#__PURE__*/jsxs("div", {
1092
- className: classNames([styles.cardInner, _defineProperty({}, styles.pulse, withCardBounce)]),
1093
- children: [hasCta ? /*#__PURE__*/jsxs("div", {
1094
- className: styles.callToAction,
1095
- children: [/*#__PURE__*/jsx(Arrow, {
1096
- strokeWidth: 1,
1097
- className: styles.arrow
1098
- }), /*#__PURE__*/jsx(Text, _objectSpread({
1099
- className: styles.ctaText
1100
- }, callToAction))]
1101
- }) : null, /*#__PURE__*/jsx("div", {
1102
- className: styles.articlePreview,
1103
- ref: articlePreviewRef,
1104
- children: /*#__PURE__*/jsxs("div", {
1105
- className: styles.articlePreviewInner,
1106
- style: {
1107
- paddingBottom: current && !isPreview ? Math.max(viewerBottomHeight, 20) : null
1108
- },
1109
- children: [hasTitle ? /*#__PURE__*/jsx(Heading, _objectSpread({
1110
- className: classNames([styles.articleTitle])
1111
- }, title)) : null, hasAuthorName ? /*#__PURE__*/jsx(UrbaniaAuthor, {
1112
- isSmall: true,
1113
- withoutBackground: true,
1114
- author: author,
1115
- shouldLoad: mediaShouldLoad,
1116
- className: styles.author
1117
- }) : null]
1118
- })
1119
- })]
1120
- })]
1121
- }) : null
1122
- })
2239
+ children: [hasTitle ? /*#__PURE__*/jsx(Heading, {
2240
+ className: classNames([styles.articleTitle]),
2241
+ ...title
2242
+ }) : null, hasAuthorName ? /*#__PURE__*/jsx(UrbaniaAuthor, {
2243
+ isSmall: true,
2244
+ withoutBackground: true,
2245
+ author: author,
2246
+ shouldLoad: mediaShouldLoad,
2247
+ className: styles.author
2248
+ }) : null]
2249
+ })
2250
+ })]
1123
2251
  })]
1124
- })]
1125
- });
2252
+ }) : null;
2253
+ $[109] = articlePreviewRef;
2254
+ $[110] = author;
2255
+ $[111] = bindGesture;
2256
+ $[112] = callToAction;
2257
+ $[113] = current;
2258
+ $[114] = hasArticle;
2259
+ $[115] = hasAuthorName;
2260
+ $[116] = hasCta;
2261
+ $[117] = hasTitle;
2262
+ $[118] = height;
2263
+ $[119] = intl;
2264
+ $[120] = isPlaceholder;
2265
+ $[121] = isPreview;
2266
+ $[122] = mediaShouldLoad;
2267
+ $[123] = springStyle;
2268
+ $[124] = title;
2269
+ $[125] = toggleCard;
2270
+ $[126] = viewerBottomHeight;
2271
+ $[127] = webviewOpened;
2272
+ $[128] = width;
2273
+ $[129] = withCardBounce;
2274
+ $[130] = t67;
2275
+ } else {
2276
+ t67 = $[130];
2277
+ }
2278
+ let t68;
2279
+ if ($[131] !== t66 || $[132] !== t67) {
2280
+ t68 = /*#__PURE__*/jsx(ScreenElement, {
2281
+ placeholderProps: t64,
2282
+ emptyLabel: t65,
2283
+ emptyClassName: styles.empty,
2284
+ isEmpty: t66,
2285
+ children: t67
2286
+ });
2287
+ $[131] = t66;
2288
+ $[132] = t67;
2289
+ $[133] = t68;
2290
+ } else {
2291
+ t68 = $[133];
2292
+ }
2293
+ let t69;
2294
+ if ($[134] !== t63 || $[135] !== t68) {
2295
+ t69 = /*#__PURE__*/jsx(Container, {
2296
+ className: t63,
2297
+ children: t68
2298
+ });
2299
+ $[134] = t63;
2300
+ $[135] = t68;
2301
+ $[136] = t69;
2302
+ } else {
2303
+ t69 = $[136];
2304
+ }
2305
+ let t70;
2306
+ if ($[137] !== height || $[138] !== t56 || $[139] !== t62 || $[140] !== t69 || $[141] !== width) {
2307
+ t70 = /*#__PURE__*/jsxs(Container, {
2308
+ className: styles.content,
2309
+ width: width,
2310
+ height: height,
2311
+ children: [t56, t62, t69]
2312
+ });
2313
+ $[137] = height;
2314
+ $[138] = t56;
2315
+ $[139] = t62;
2316
+ $[140] = t69;
2317
+ $[141] = width;
2318
+ $[142] = t70;
2319
+ } else {
2320
+ t70 = $[142];
2321
+ }
2322
+ let t71;
2323
+ if ($[143] !== t51 || $[144] !== t52 || $[145] !== t55 || $[146] !== t70) {
2324
+ t71 = /*#__PURE__*/jsxs("div", {
2325
+ className: t51,
2326
+ "data-screen-ready": t52,
2327
+ children: [t55, t70]
2328
+ });
2329
+ $[143] = t51;
2330
+ $[144] = t52;
2331
+ $[145] = t55;
2332
+ $[146] = t70;
2333
+ $[147] = t71;
2334
+ } else {
2335
+ t71 = $[147];
2336
+ }
2337
+ return t71;
1126
2338
  }
2339
+ function _temp2(value) {
2340
+ return `translateY(${value}%`;
2341
+ }
2342
+ function _temp() {}
1127
2343
 
1128
2344
  function UrbaniaCardLoader(props) {
1129
- var _ref = props || {},
1130
- _ref$cardCallToAction = _ref.cardCallToAction,
1131
- cardCallToAction = _ref$cardCallToAction === void 0 ? {} : _ref$cardCallToAction;
1132
- return /*#__PURE__*/jsx(UrbaniaLoader, _objectSpread({
1133
- component: UrbaniaArticleCard,
1134
- callToAction: cardCallToAction
1135
- }, props));
2345
+ const $ = c(7);
2346
+ let t0;
2347
+ if ($[0] !== props) {
2348
+ t0 = props || {};
2349
+ $[0] = props;
2350
+ $[1] = t0;
2351
+ } else {
2352
+ t0 = $[1];
2353
+ }
2354
+ const {
2355
+ cardCallToAction: t1
2356
+ } = t0;
2357
+ let t2;
2358
+ if ($[2] !== t1) {
2359
+ t2 = t1 === undefined ? {} : t1;
2360
+ $[2] = t1;
2361
+ $[3] = t2;
2362
+ } else {
2363
+ t2 = $[3];
2364
+ }
2365
+ const cardCallToAction = t2;
2366
+ let t3;
2367
+ if ($[4] !== cardCallToAction || $[5] !== props) {
2368
+ t3 = /*#__PURE__*/jsx(UrbaniaLoader, {
2369
+ component: UrbaniaArticleCard,
2370
+ callToAction: cardCallToAction,
2371
+ ...props
2372
+ });
2373
+ $[4] = cardCallToAction;
2374
+ $[5] = props;
2375
+ $[6] = t3;
2376
+ } else {
2377
+ t3 = $[6];
2378
+ }
2379
+ return t3;
1136
2380
  }
1137
2381
 
1138
2382
  var definitionCard = {
@@ -1142,19 +2386,13 @@ var definitionCard = {
1142
2386
  group: {
1143
2387
  label: defineMessage({
1144
2388
  id: "oPjl8f",
1145
- defaultMessage: [{
1146
- "type": 0,
1147
- "value": "Urbania"
1148
- }]
2389
+ defaultMessage: "Urbania"
1149
2390
  }),
1150
2391
  order: 10
1151
2392
  },
1152
2393
  title: defineMessage({
1153
2394
  id: "nJgzwC",
1154
- defaultMessage: [{
1155
- "type": 0,
1156
- "value": "Urbania article"
1157
- }]
2395
+ defaultMessage: "Urbania article"
1158
2396
  }),
1159
2397
  component: UrbaniaCardLoader,
1160
2398
  fields: [{
@@ -1162,30 +2400,21 @@ var definitionCard = {
1162
2400
  type: 'url',
1163
2401
  label: defineMessage({
1164
2402
  id: "2pO2Cj",
1165
- defaultMessage: [{
1166
- "type": 0,
1167
- "value": "Url"
1168
- }]
2403
+ defaultMessage: "Url"
1169
2404
  })
1170
2405
  }, {
1171
2406
  name: 'title',
1172
2407
  type: 'heading-element',
1173
2408
  label: defineMessage({
1174
2409
  id: "N25iDO",
1175
- defaultMessage: [{
1176
- "type": 0,
1177
- "value": "Title"
1178
- }]
2410
+ defaultMessage: "Title"
1179
2411
  })
1180
2412
  }, {
1181
2413
  name: 'author',
1182
2414
  type: 'author-element',
1183
2415
  label: defineMessage({
1184
2416
  id: "73hxYw",
1185
- defaultMessage: [{
1186
- "type": 0,
1187
- "value": "Author"
1188
- }]
2417
+ defaultMessage: "Author"
1189
2418
  })
1190
2419
  }, {
1191
2420
  name: 'text',
@@ -1197,20 +2426,14 @@ var definitionCard = {
1197
2426
  },
1198
2427
  label: defineMessage({
1199
2428
  id: "4E2gbX",
1200
- defaultMessage: [{
1201
- "type": 0,
1202
- "value": "Text"
1203
- }]
2429
+ defaultMessage: "Text"
1204
2430
  })
1205
2431
  }, {
1206
2432
  name: 'background',
1207
2433
  type: 'background',
1208
2434
  label: defineMessage({
1209
2435
  id: "+MPZRu",
1210
- defaultMessage: [{
1211
- "type": 0,
1212
- "value": "Background"
1213
- }]
2436
+ defaultMessage: "Background"
1214
2437
  })
1215
2438
  }, {
1216
2439
  name: 'cardCallToAction',
@@ -1222,20 +2445,14 @@ var definitionCard = {
1222
2445
  },
1223
2446
  label: defineMessage({
1224
2447
  id: "eBFxNl",
1225
- defaultMessage: [{
1226
- "type": 0,
1227
- "value": "Call to Action"
1228
- }]
2448
+ defaultMessage: "Call to Action"
1229
2449
  })
1230
2450
  }, {
1231
2451
  name: 'header',
1232
2452
  type: 'header',
1233
2453
  label: defineMessage({
1234
2454
  id: "rhuDxI",
1235
- defaultMessage: [{
1236
- "type": 0,
1237
- "value": "Header"
1238
- }]
2455
+ defaultMessage: "Header"
1239
2456
  }),
1240
2457
  theme: {
1241
2458
  badge: {