@flourish/sdk 4.1.0 → 4.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/RELEASE_NOTES.md CHANGED
@@ -1,3 +1,6 @@
1
+ # 4.1.1
2
+ * Fixes the reporting of server errors by the CLI
3
+
1
4
  # 4.1.0
2
5
  * Allow SDK CLI token based authentication.
3
6
 
package/lib/sdk.js CHANGED
@@ -149,10 +149,10 @@ async function request(server_opts, method, data) {
149
149
  }
150
150
 
151
151
  if (body.error) {
152
- log.die("Error from server", res.status, body.error);
152
+ log.die("Error from server", res.status, body.error.message);
153
153
  }
154
154
 
155
- log.die("Server error", res.status, body);
155
+ log.die("Server error", res.status, JSON.stringify(body));
156
156
  }
157
157
 
158
158
  function runBuildCommand(template_dir, command, node_env) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flourish/sdk",
3
- "version": "4.1.0",
3
+ "version": "4.1.1",
4
4
  "description": "The Flourish SDK",
5
5
  "module": "src/index.js",
6
6
  "scripts": {
@@ -16,7 +16,7 @@
16
16
  "license": "SEE LICENSE IN LICENSE.md",
17
17
  "repository": "kiln/flourish-sdk",
18
18
  "dependencies": {
19
- "@flourish/interpreter": "^8.0.0",
19
+ "@flourish/interpreter": "^8.4.0",
20
20
  "@flourish/semver": "^1.0.1",
21
21
  "@flourish/transform-data": "^2.1.0",
22
22
  "@handlebars/allow-prototype-access": "^1.0.3",
package/server/columns.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /* * * * * * GENERATED FILE - DO NOT EDIT * * * * * *
2
2
  * * * * * * GENERATED FILE - DO NOT EDIT * * * * * *
3
3
  * * * * * * GENERATED FILE - DO NOT EDIT * * * * * */
4
-
4
+
5
5
  'use strict';
6
6
 
7
7
  Object.defineProperty(exports, '__esModule', { value: true });
package/server/data.js CHANGED
@@ -232,12 +232,37 @@ function dropReturnCharacters(data) {
232
232
  return data;
233
233
  }
234
234
 
235
- function trimWhitespace(data) {
236
- data.forEach(function(row) {
237
- for (var i=0; i < row.length; i++) {
238
- if (row[i] && typeof row[i] == "string") row[i] = row[i].trim();
235
+ /**
236
+ * Takes an array of arrays (typically tabular data) and rewrites
237
+ * it so that:
238
+ * - Any trailing empty rows are removed
239
+ * - Any cell that was not a string is stringified
240
+ * - Any leading or trailing whitespace of a cell is removed
241
+ *
242
+ * (The potentially modified table is returned to match the convention
243
+ * used by functions this is replacing, although (TODO) I think it
244
+ * would be more obvious that this function has side-effects if it
245
+ * did not return the table and the calling code was changed.)
246
+ *
247
+ * @param {any[][]} data
248
+ * @returns {string[][]}
249
+ */
250
+ function tidyTable(data) {
251
+ trimTrailingEmptyRows(data);
252
+ for (let row of data) {
253
+ for (let i = 0; i < row.length; i++) {
254
+ let value = row[i];
255
+ // Convert null or undefined values to the empty string
256
+ if (value == null) value = "";
257
+ // If the value is not a string, convert it to one
258
+ if (typeof value !== "string") {
259
+ value = "" + value;
260
+ }
261
+ // Now value is a definitely a string, strip any leading
262
+ // or trailing whitespace.
263
+ row[i] = value.trim();
239
264
  }
240
- });
265
+ }
241
266
  return data;
242
267
  }
243
268
 
@@ -297,6 +322,6 @@ exports.getSlicedData = getSlicedData;
297
322
  exports.interpretColumn = interpretColumn;
298
323
  exports.mulberry32 = mulberry32;
299
324
  exports.stripCommonFixes = stripCommonFixes;
325
+ exports.tidyTable = tidyTable;
300
326
  exports.transposeNestedArray = transposeNestedArray;
301
327
  exports.trimTrailingEmptyRows = trimTrailingEmptyRows;
302
- exports.trimWhitespace = trimWhitespace;
package/server/json.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /* * * * * * GENERATED FILE - DO NOT EDIT * * * * * *
2
2
  * * * * * * GENERATED FILE - DO NOT EDIT * * * * * *
3
3
  * * * * * * GENERATED FILE - DO NOT EDIT * * * * * */
4
-
4
+
5
5
  'use strict';
6
6
 
7
7
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -78,7 +78,7 @@
78
78
  <div class="current-template popup" data-popup-head="Template details" data-popup-body="Add or edit thumbnail.jpg and template.yml to change">
79
79
  <div class="current-template-title">
80
80
  <div class="current-template-thumbnail"></div>
81
- <h1>Selected template <span class="template-name">{{ template_name }}</span></h1>
81
+ <h1>Current template <span class="template-name">{{ template_name }}</span></h1>
82
82
  </div>
83
83
  </div>
84
84
 
package/site/embedded.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(){"use strict";var e,t,i=!1;function n(e){if(i&&window.top!==window.self){var t=window;"srcdoc"===t.location.pathname&&(t=t.parent);var n,o=(n={},window._Flourish_template_id&&(n.template_id=window._Flourish_template_id),window.Flourish&&window.Flourish.app&&window.Flourish.app.loaded_template_id&&(n.template_id=window.Flourish.app.loaded_template_id),window._Flourish_visualisation_id&&(n.visualisation_id=window._Flourish_visualisation_id),window.Flourish&&window.Flourish.app&&window.Flourish.app.loaded_visualisation&&(n.visualisation_id=window.Flourish.app.loaded_visualisation.id),window.Flourish&&window.Flourish.app&&window.Flourish.app.story&&(n.story_id=window.Flourish.app.story.id,n.slide_count=window.Flourish.app.story.slides.length),window.Flourish&&window.Flourish.app&&window.Flourish.app.current_slide&&(n.slide_index=window.Flourish.app.current_slide.index+1),n),r={sender:"Flourish",method:"customerAnalytics"};for(var a in o)o.hasOwnProperty(a)&&(r[a]=o[a]);for(var a in e)e.hasOwnProperty(a)&&(r[a]=e[a]);t.parent.postMessage(JSON.stringify(r),"*")}}function o(e){if("function"!=typeof e)throw new Error("Analytics callback is not a function");window.Flourish._analytics_listeners.push(e)}function r(){i=!0;[{event_name:"click",action_name:"click",use_capture:!0},{event_name:"keydown",action_name:"key_down",use_capture:!0},{event_name:"mouseenter",action_name:"mouse_enter",use_capture:!1},{event_name:"mouseleave",action_name:"mouse_leave",use_capture:!1}].forEach((function(e){document.body.addEventListener(e.event_name,(function(){n({action:e.action_name})}),e.use_capture)}))}function a(){if(null==e){var t=function(){var e=window.location;"about:srcdoc"==e.href&&(e=window.parent.location);var t={};return function(e,i,n){for(;n=i.exec(e);)t[decodeURIComponent(n[1])]=decodeURIComponent(n[2])}(e.search.substring(1).replace(/\+/g,"%20"),/([^&=]+)=?([^&]*)/g),t}();e="referrer"in t?/^https:\/\/medium.com\//.test(t.referrer):!("auto"in t)}return e}function s(e){var t=e||window.innerWidth;return t>999?650:t>599?575:400}function l(e){if(e&&window.top!==window.self){var t=window;"srcdoc"==t.location.pathname&&(t=t.parent);var i={sender:"Flourish",method:"scrolly"};if(e)for(var n in e)i[n]=e[n];t.parent.postMessage(JSON.stringify(i),"*")}}function d(e,i){if(window.top!==window.self){var n=window;if("srcdoc"==n.location.pathname&&(n=n.parent),t)return e=parseInt(e,10),void n.parent.postMessage({sentinel:"amp",type:"embed-size",height:e},"*");var o={sender:"Flourish",context:"iframe.resize",method:"resize",height:e,src:n.location.toString()};if(i)for(var r in i)o[r]=i[r];n.parent.postMessage(JSON.stringify(o),"*")}}function u(){return(-1!==navigator.userAgent.indexOf("Safari")||-1!==navigator.userAgent.indexOf("iPhone"))&&-1==navigator.userAgent.indexOf("Chrome")}function c(e){return"string"==typeof e||e instanceof String}function h(e){return"warn"!==e.method?(console.warn("BUG: validateWarnMessage called for method"+e.method),!1):!(null!=e.message&&!c(e.message))&&!(null!=e.explanation&&!c(e.explanation))}function f(e){return"resize"!==e.method?(console.warn("BUG: validateResizeMessage called for method"+e.method),!1):!!c(e.src)&&(!!c(e.context)&&!!("number"==typeof(t=e.height)?!isNaN(t)&&t>=0:c(t)&&/\d/.test(t)&&/^[0-9]*(\.[0-9]*)?(cm|mm|Q|in|pc|pt|px|em|ex|ch|rem|lh|vw|vh|vmin|vmax|%)?$/i.test(t)));var t}function p(e){throw new Error("Validation for setSetting is not implemented yet; see issue #4328")}function m(e){return"scrolly"!==e.method?(console.warn("BUG: validateScrolly called for method"+e.method),!1):!!Array.isArray(e.slides)}function w(e){return"customerAnalytics"===e.method||(console.warn("BUG: validateCustomerAnalyticsMessage called for method"+e.method),!1)}function g(e){return"request-upload"!==e.method?(console.warn("BUG: validateResizeMessage called for method"+e.method),!1):!!c(e.name)&&!(null!=e.accept&&!c(e.accept))}function y(e,t){var i=function(e){for(var t={warn:h,resize:f,setSetting:p,customerAnalytics:w,"request-upload":g,scrolly:m},i={},n=0;n<e.length;n++){var o=e[n];if(!t[o])throw new Error("No validator found for method "+o);i[o]=t[o]}return i}(t);window.addEventListener("message",(function(t){if(null!=t.source&&(t.origin===document.location.origin||t.origin.match(/\/\/localhost:\d+$|\/\/(?:public|app)\.flourish.devlocal$|\/\/flourish-api\.com$|\.flourish\.(?:local(:\d+)?|net|rocks|studio)$|\.uri\.sh$|\/\/flourish-user-templates\.com$/))){var n;try{n=JSON.parse(t.data)}catch(e){return void console.warn("Unexpected non-JSON message: "+JSON.stringify(t.data))}if("Flourish"===n.sender)if(n.method)if(Object.prototype.hasOwnProperty.call(i,n.method))if(i[n.method](n)){for(var o=document.querySelectorAll("iframe"),r=0;r<o.length;r++)if(o[r].contentWindow==t.source||o[r].contentWindow==t.source.parent)return void e(n,o[r]);console.warn("could not find frame",n)}else console.warn("Validation failed for the message",n);else console.warn("No validator implemented for message",n);else console.warn("The 'method' property was missing from message",n)}})),u()&&(window.addEventListener("resize",v),v())}function v(){for(var e=document.querySelectorAll(".flourish-embed"),t=0;t<e.length;t++){var i=e[t];if(!i.getAttribute("data-width")){var n=i.querySelector("iframe");if(n){var o=window.getComputedStyle(i),r=i.offsetWidth-parseFloat(o.paddingLeft)-parseFloat(o.paddingRight);n.style.width=r+"px"}}}}function _(e,t){var i=e.parentNode;if(i.classList.contains("fl-scrolly-wrapper"))console.warn("createScrolly is being called more than once per story. This should not happen.");else{i.classList.add("fl-scrolly-wrapper"),i.style.position="relative",i.style.paddingBottom="1px",i.style.transform="translate3d(0, 0, 0)",e.style.position="sticky";var n=i.getAttribute("data-height")||null;n||(n="80vh",e.style.height=n),e.style.top="calc(50vh - "+n+"/2)";var o=i.querySelector(".flourish-credit");o&&(o.style.position="sticky",o.style.top="calc(50vh + "+n+"/2)"),t.forEach((function(e,t){var n=document.createElement("div");n.setAttribute("data-slide",t),n.classList.add("fl-scrolly-caption"),n.style.position="relative",n.style.transform="translate3d(0,0,0)",n.style.textAlign="center",n.style.maxWidth="500px",n.style.height="auto",n.style.marginTop="0",n.style.marginBottom="100vh",n.style.marginLeft="auto",n.style.marginRight="auto";var o=document.createElement("div");o.innerHTML=e,o.style.display="inline-block",o.style.paddingTop="1.25em",o.style.paddingRight="1.25em",o.style.paddingBottom="1.25em",o.style.paddingLeft="1.25em",o.style.background="rgba(255,255,255,0.9)",o.style.boxShadow="0px 0px 10px rgba(0,0,0,0.2)",o.style.borderRadius="10px",o.style.textAlign="center",o.style.maxWidth="100%",o.style.margin="0 20px",o.style.overflowX="hidden",n.appendChild(o),i.appendChild(n)})),function(e){for(var t=new IntersectionObserver((function(t){t.forEach((function(t){if(t.isIntersecting){var i=e.querySelector("iframe");i&&(i.src=i.src.replace(/#slide-.*/,"")+"#slide-"+t.target.getAttribute("data-slide"))}}))}),{rootMargin:"0px 0px -0% 0px"}),i=e.querySelectorAll(".fl-scrolly-caption"),n=0;n<i.length;n++)t.observe(i[n]);e.querySelectorAll(".fl-scrolly-caption img").forEach((function(e){e.style.maxWidth="100%"}))}(i)}}function F(e,t,i,n,o){var r=document.createElement("iframe");if(r.setAttribute("scrolling","no"),r.setAttribute("frameborder","0"),r.setAttribute("title","Interactive or visual content"),r.setAttribute("sandbox","allow-same-origin allow-forms allow-scripts allow-downloads allow-popups allow-popups-to-escape-sandbox allow-top-navigation-by-user-activation"),t.appendChild(r),r.offsetParent||"fixed"===getComputedStyle(r).position)x(e,t,r,i,n,o);else{var a={embed_url:e,container:t,iframe:r,width:i,height:n,play_on_load:o};if(window._flourish_poll_items?window._flourish_poll_items.push(a):window._flourish_poll_items=[a],window._flourish_poll_items.length>1)return r;var s=setInterval((function(){window._flourish_poll_items=window._flourish_poll_items.filter((function(e){return!e.iframe.offsetParent||(x(e.embed_url,e.container,e.iframe,e.width,e.height,e.play_on_load),!1)})),window._flourish_poll_items.length||clearInterval(s)}),500)}return r}function x(e,t,i,n,o,r){var a;return n&&"number"==typeof n?(a=n,n+="px"):n&&n.match(/^[ \t\r\n\f]*([+-]?\d+|\d*\.\d+(?:[eE][+-]?\d+)?)(?:\\?[Pp]|\\0{0,4}[57]0(?:\r\n|[ \t\r\n\f])?)(?:\\?[Xx]|\\0{0,4}[57]8(?:\r\n|[ \t\r\n\f])?)[ \t\r\n\f]*$/)&&(a=parseFloat(n)),o&&"number"==typeof o&&(o+="px"),n?i.style.width=n:u()?i.style.width=t.offsetWidth+"px":i.style.width="100%",!!o||(e.match(/\?/)?e+="&auto=1":e+="?auto=1",o=s(a||i.offsetWidth)+"px"),o&&("%"===o.charAt(o.length-1)&&(o=parseFloat(o)/100*t.parentNode.offsetHeight+"px"),i.style.height=o),i.setAttribute("src",e+(r?"#play-on-load":"")),i}function b(e){return!Array.isArray(e)&&"object"==typeof e&&null!=e}function A(e,t){for(var i in t)b(e[i])&&b(t[i])?A(e[i],t[i]):e[i]=t[i];return e}!function(){var e,i=window.top===window.self,c=i?null:(t="#amp=1"==window.location.hash,{createEmbedIframe:F,isFixedHeight:a,getHeightForBreakpoint:s,startEventListeners:y,notifyParentWindow:d,initScrolly:l,createScrolly:_,isSafari:u,initCustomerAnalytics:r,addAnalyticsListener:o,sendCustomerAnalyticsMessage:n}),h=!0;function f(){var t;Flourish.fixed_height||(null!=e?t=e:h&&(t=c.getHeightForBreakpoint()),t!==window.innerHeight&&c.notifyParentWindow(t))}function p(){-1!==window.location.search.indexOf("enable_customer_analytics=1")&&Flourish.enableCustomerAnalytics(),f(),window.addEventListener("resize",f)}Flourish.warn=function(e){if("string"==typeof e&&(e={message:e}),i||"editor"!==Flourish.environment)console.warn(e.message);else{var t={sender:"Flourish",method:"warn",message:e.message,explanation:e.explanation};window.parent.postMessage(JSON.stringify(t),"*")}},Flourish.uploadImage=function(e){if(i||"story_editor"!==Flourish.environment)throw"Invalid upload request";var t={sender:"Flourish",method:"request-upload",name:e.name,accept:e.accept};window.parent.postMessage(JSON.stringify(t),"*")},Flourish.setSetting=function(e,t){if("editor"===Flourish.environment||"sdk"===Flourish.environment){var i={sender:"Flourish",method:"setSetting",name:e,value:t};window.parent.postMessage(JSON.stringify(i),"*")}else if("story_editor"===Flourish.environment){var n={};n[e]=t,A(window.template.state,function(e){var t={};for(var i in e){for(var n=t,o=i.indexOf("."),r=0;o>=0;o=i.indexOf(".",r=o+1)){var a=i.substring(r,o);a in n||(n[a]={}),n=n[a]}n[i.substring(r)]=e[i]}return t}(n))}},Flourish.setHeight=function(t){Flourish.fixed_height||(e=t,h=null==t,f())},Flourish.checkHeight=function(){if(!i){var e=Flourish.__container_height;null!=e?(Flourish.fixed_height=!0,c.notifyParentWindow(e)):c.isFixedHeight()?Flourish.fixed_height=!0:(Flourish.fixed_height=!1,f())}},Flourish.fixed_height=i||c.isFixedHeight(),Flourish.enableCustomerAnalytics=function(){c&&c.initCustomerAnalytics()},"loading"===document.readyState?document.addEventListener("DOMContentLoaded",p):p()}()}();
1
+ !function(){"use strict";var e,t,i=!1;function n(e){if(i&&window.top!==window.self){var t=window;"srcdoc"===t.location.pathname&&(t=t.parent);var n,o=(n={},window._Flourish_template_id&&(n.template_id=window._Flourish_template_id),window.Flourish&&window.Flourish.app&&window.Flourish.app.loaded_template_id&&(n.template_id=window.Flourish.app.loaded_template_id),window._Flourish_visualisation_id&&(n.visualisation_id=window._Flourish_visualisation_id),window.Flourish&&window.Flourish.app&&window.Flourish.app.loaded_visualisation&&(n.visualisation_id=window.Flourish.app.loaded_visualisation.id),window.Flourish&&window.Flourish.app&&window.Flourish.app.story&&(n.story_id=window.Flourish.app.story.id,n.slide_count=window.Flourish.app.story.slides.length),window.Flourish&&window.Flourish.app&&window.Flourish.app.current_slide&&(n.slide_index=window.Flourish.app.current_slide.index+1),n),r={sender:"Flourish",method:"customerAnalytics"};for(var a in o)o.hasOwnProperty(a)&&(r[a]=o[a]);for(var a in e)e.hasOwnProperty(a)&&(r[a]=e[a]);t.parent.postMessage(JSON.stringify(r),"*")}}function o(e){if("function"!=typeof e)throw new Error("Analytics callback is not a function");window.Flourish._analytics_listeners.push(e)}function r(){i=!0;[{event_name:"click",action_name:"click",use_capture:!0},{event_name:"keydown",action_name:"key_down",use_capture:!0},{event_name:"mouseenter",action_name:"mouse_enter",use_capture:!1},{event_name:"mouseleave",action_name:"mouse_leave",use_capture:!1}].forEach((function(e){document.body.addEventListener(e.event_name,(function(){n({action:e.action_name})}),e.use_capture)}))}function a(){if(null==e){var t=function(){var e=window.location;"about:srcdoc"==e.href&&(e=window.parent.location);var t={};return function(e,i,n){for(;n=i.exec(e);)t[decodeURIComponent(n[1])]=decodeURIComponent(n[2])}(e.search.substring(1).replace(/\+/g,"%20"),/([^&=]+)=?([^&]*)/g),t}();e="referrer"in t?/^https:\/\/medium.com\//.test(t.referrer):!("auto"in t)}return e}function s(e){var t=e||window.innerWidth;return t>999?650:t>599?575:400}function l(e){if(e&&window.top!==window.self){var t=window;"srcdoc"==t.location.pathname&&(t=t.parent);var i={sender:"Flourish",method:"scrolly"};if(e)for(var n in e)i[n]=e[n];t.parent.postMessage(JSON.stringify(i),"*")}}function d(e,i){if(window.top!==window.self){var n=window;if("srcdoc"==n.location.pathname&&(n=n.parent),t)return e=parseInt(e,10),void n.parent.postMessage({sentinel:"amp",type:"embed-size",height:e},"*");var o={sender:"Flourish",context:"iframe.resize",method:"resize",height:e,src:n.location.toString()};if(i)for(var r in i)o[r]=i[r];n.parent.postMessage(JSON.stringify(o),"*")}}function u(){return(-1!==navigator.userAgent.indexOf("Safari")||-1!==navigator.userAgent.indexOf("iPhone"))&&-1==navigator.userAgent.indexOf("Chrome")}function c(e){return"string"==typeof e||e instanceof String}function h(e){return"warn"!==e.method?(console.warn("BUG: validateWarnMessage called for method"+e.method),!1):!(null!=e.message&&!c(e.message))&&!(null!=e.explanation&&!c(e.explanation))}function f(e){return"resize"!==e.method?(console.warn("BUG: validateResizeMessage called for method"+e.method),!1):!!c(e.src)&&(!!c(e.context)&&!!("number"==typeof(t=e.height)?!isNaN(t)&&t>=0:c(t)&&/\d/.test(t)&&/^[0-9]*(\.[0-9]*)?(cm|mm|Q|in|pc|pt|px|em|ex|ch|rem|lh|vw|vh|vmin|vmax|%)?$/i.test(t)));var t}function p(e){throw new Error("Validation for setSetting is not implemented yet; see issue #4328")}function m(e){return"scrolly"!==e.method?(console.warn("BUG: validateScrolly called for method"+e.method),!1):!!Array.isArray(e.slides)}function w(e){return"customerAnalytics"===e.method||(console.warn("BUG: validateCustomerAnalyticsMessage called for method"+e.method),!1)}function g(e){return"request-upload"!==e.method?(console.warn("BUG: validateResizeMessage called for method"+e.method),!1):!!c(e.name)&&!(null!=e.accept&&!c(e.accept))}function y(e,t,i){var n=function(e){for(var t={warn:h,resize:f,setSetting:p,customerAnalytics:w,"request-upload":g,scrolly:m},i={},n=0;n<e.length;n++){var o=e[n];if(!t[o])throw new Error("No validator found for method "+o);i[o]=t[o]}return i}(t);window.addEventListener("message",(function(t){var o=function(){if(t.origin==document.location.origin)return!0;if(i){const e=t.origin.toLowerCase();if(i=i.toLowerCase(),e.endsWith("//"+i))return!0;if(e.endsWith("."+i))return!0}return!!t.origin.match(/\/\/localhost:\d+$|\/\/(?:public|app)\.flourish.devlocal$|\/\/flourish-api\.com$|\.flourish\.(?:local(:\d+)?|net|rocks|studio)$|\.uri\.sh$|\/\/flourish-user-templates\.com$/)}();if(null!=t.source&&o){var r;try{r=JSON.parse(t.data)}catch(e){return void console.warn("Unexpected non-JSON message: "+JSON.stringify(t.data))}if("Flourish"===r.sender)if(r.method)if(Object.prototype.hasOwnProperty.call(n,r.method))if(n[r.method](r)){for(var a=document.querySelectorAll("iframe"),s=0;s<a.length;s++)if(a[s].contentWindow==t.source||a[s].contentWindow==t.source.parent)return void e(r,a[s]);console.warn("could not find frame",r)}else console.warn("Validation failed for the message",r);else console.warn("No validator implemented for message",r);else console.warn("The 'method' property was missing from message",r)}})),u()&&(window.addEventListener("resize",v),v())}function v(){for(var e=document.querySelectorAll(".flourish-embed"),t=0;t<e.length;t++){var i=e[t];if(!i.getAttribute("data-width")){var n=i.querySelector("iframe");if(n){var o=window.getComputedStyle(i),r=i.offsetWidth-parseFloat(o.paddingLeft)-parseFloat(o.paddingRight);n.style.width=r+"px"}}}}function _(e,t){var i=e.parentNode;if(i.classList.contains("fl-scrolly-wrapper"))console.warn("createScrolly is being called more than once per story. This should not happen.");else{i.classList.add("fl-scrolly-wrapper"),i.style.position="relative",i.style.paddingBottom="1px",i.style.transform="translate3d(0, 0, 0)",e.style.position="sticky";var n=i.getAttribute("data-height")||null;n||(n="80vh",e.style.height=n),e.style.top="calc(50vh - "+n+"/2)";var o=i.querySelector(".flourish-credit");o&&(o.style.position="sticky",o.style.top="calc(50vh + "+n+"/2)"),t.forEach((function(e,t){var n="string"==typeof e&&""!=e.trim(),o=document.createElement("div");o.setAttribute("data-slide",t),o.classList.add("fl-scrolly-caption"),o.style.position="relative",o.style.transform="translate3d(0,0,0)",o.style.textAlign="center",o.style.maxWidth="500px",o.style.height="auto",o.style.marginTop="0",o.style.marginBottom=n?"100vh":"50vh",o.style.marginLeft="auto",o.style.marginRight="auto";var r=document.createElement("div");r.innerHTML=e,r.style.visibility=n?"":"hidden",r.style.display="inline-block",r.style.paddingTop="1.25em",r.style.paddingRight="1.25em",r.style.paddingBottom="1.25em",r.style.paddingLeft="1.25em",r.style.background="rgba(255,255,255,0.9)",r.style.boxShadow="0px 0px 10px rgba(0,0,0,0.2)",r.style.borderRadius="10px",r.style.textAlign="center",r.style.maxWidth="100%",r.style.margin="0 20px",r.style.overflowX="hidden",o.appendChild(r),i.appendChild(o)})),function(e){for(var t=new IntersectionObserver((function(t){t.forEach((function(t){if(t.isIntersecting){var i=e.querySelector("iframe");i&&(i.src=i.src.replace(/#slide-.*/,"")+"#slide-"+t.target.getAttribute("data-slide"))}}))}),{rootMargin:"0px 0px -0% 0px"}),i=e.querySelectorAll(".fl-scrolly-caption"),n=0;n<i.length;n++)t.observe(i[n]);e.querySelectorAll(".fl-scrolly-caption img").forEach((function(e){e.style.maxWidth="100%"}))}(i)}}function F(e,t,i,n,o){var r=document.createElement("iframe");if(r.setAttribute("scrolling","no"),r.setAttribute("frameborder","0"),r.setAttribute("title","Interactive or visual content"),r.setAttribute("sandbox","allow-same-origin allow-forms allow-scripts allow-downloads allow-popups allow-popups-to-escape-sandbox allow-top-navigation-by-user-activation"),t.appendChild(r),r.offsetParent||"fixed"===getComputedStyle(r).position)x(e,t,r,i,n,o);else{var a={embed_url:e,container:t,iframe:r,width:i,height:n,play_on_load:o};if(window._flourish_poll_items?window._flourish_poll_items.push(a):window._flourish_poll_items=[a],window._flourish_poll_items.length>1)return r;var s=setInterval((function(){window._flourish_poll_items=window._flourish_poll_items.filter((function(e){return!e.iframe.offsetParent||(x(e.embed_url,e.container,e.iframe,e.width,e.height,e.play_on_load),!1)})),window._flourish_poll_items.length||clearInterval(s)}),500)}return r}function x(e,t,i,n,o,r){var a;return n&&"number"==typeof n?(a=n,n+="px"):n&&n.match(/^[ \t\r\n\f]*([+-]?\d+|\d*\.\d+(?:[eE][+-]?\d+)?)(?:\\?[Pp]|\\0{0,4}[57]0(?:\r\n|[ \t\r\n\f])?)(?:\\?[Xx]|\\0{0,4}[57]8(?:\r\n|[ \t\r\n\f])?)[ \t\r\n\f]*$/)&&(a=parseFloat(n)),o&&"number"==typeof o&&(o+="px"),n?i.style.width=n:u()?i.style.width=t.offsetWidth+"px":i.style.width="100%",!!o||(e.match(/\?/)?e+="&auto=1":e+="?auto=1",o=s(a||i.offsetWidth)+"px"),o&&("%"===o.charAt(o.length-1)&&(o=parseFloat(o)/100*t.parentNode.offsetHeight+"px"),i.style.height=o),i.setAttribute("src",e+(r?"#play-on-load":"")),i}function b(e){return!Array.isArray(e)&&"object"==typeof e&&null!=e}function A(e,t){for(var i in t)b(e[i])&&b(t[i])?A(e[i],t[i]):e[i]=t[i];return e}!function(){var e,i=window.top===window.self,c=i?null:(t="#amp=1"==window.location.hash,{createEmbedIframe:F,isFixedHeight:a,getHeightForBreakpoint:s,startEventListeners:y,notifyParentWindow:d,initScrolly:l,createScrolly:_,isSafari:u,initCustomerAnalytics:r,addAnalyticsListener:o,sendCustomerAnalyticsMessage:n}),h=!0;function f(){var t;Flourish.fixed_height||(null!=e?t=e:h&&(t=c.getHeightForBreakpoint()),t!==window.innerHeight&&c.notifyParentWindow(t))}function p(){-1!==window.location.search.indexOf("enable_customer_analytics=1")&&Flourish.enableCustomerAnalytics(),f(),window.addEventListener("resize",f)}Flourish.warn=function(e){if("string"==typeof e&&(e={message:e}),i||"editor"!==Flourish.environment)console.warn(e.message);else{var t={sender:"Flourish",method:"warn",message:e.message,explanation:e.explanation};window.parent.postMessage(JSON.stringify(t),"*")}},Flourish.uploadImage=function(e){if(i||"story_editor"!==Flourish.environment)throw"Invalid upload request";var t={sender:"Flourish",method:"request-upload",name:e.name,accept:e.accept};window.parent.postMessage(JSON.stringify(t),"*")},Flourish.setSetting=function(e,t){if("editor"===Flourish.environment||"sdk"===Flourish.environment){var i={sender:"Flourish",method:"setSetting",name:e,value:t};window.parent.postMessage(JSON.stringify(i),"*")}else if("story_editor"===Flourish.environment){var n={};n[e]=t,A(window.template.state,function(e){var t={};for(var i in e){for(var n=t,o=i.indexOf("."),r=0;o>=0;o=i.indexOf(".",r=o+1)){var a=i.substring(r,o);a in n||(n[a]={}),n=n[a]}n[i.substring(r)]=e[i]}return t}(n))}},Flourish.setHeight=function(t){Flourish.fixed_height||(e=t,h=null==t,f())},Flourish.checkHeight=function(){if(!i){var e=Flourish.__container_height;null!=e?(Flourish.fixed_height=!0,c.notifyParentWindow(e)):c.isFixedHeight()?Flourish.fixed_height=!0:(Flourish.fixed_height=!1,f())}},Flourish.fixed_height=i||c.isFixedHeight(),Flourish.enableCustomerAnalytics=function(){c&&c.initCustomerAnalytics()},"loading"===document.readyState?document.addEventListener("DOMContentLoaded",p):p()}()}();
2
2
  //# sourceMappingURL=embedded.js.map
@@ -0,0 +1,10 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g clip-path="url(#clip0_611_573)">
3
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M23.3995 4.96806C24.4046 3.96297 24.2697 2.19842 23.0981 1.02685C21.9265 -0.144721 20.162 -0.279675 19.1569 0.725423L10.3922 9.49014C9.87008 10.0123 9.48501 10.6592 9.26312 11.387L8.1623 14.998C8.11582 15.1504 8.12903 15.3232 8.19951 15.4846C8.36145 15.8554 8.77669 16.0695 9.12698 15.9627L12.7379 14.8619C13.4658 14.64 14.1127 14.2549 14.6348 13.7328L23.3995 4.96806ZM13.5736 12.6725C13.182 13.0641 12.6968 13.3529 12.1509 13.5193L11.5389 13.7059L10.4188 12.5859L10.6054 11.9739C10.7718 11.428 11.0606 10.9428 11.4522 10.5512L12.0098 9.99362L14.1311 12.1149L13.5736 12.6725ZM15.1918 11.0543L19.9877 6.25841L17.8663 4.13709L13.0705 8.93296L15.1918 11.0543ZM22.3383 3.9078L21.0483 5.19775L18.927 3.07643L20.2169 1.78648C20.7195 1.28393 21.6018 1.3514 22.1876 1.93719C22.7733 2.52298 22.8408 3.40525 22.3383 3.9078ZM6 4.00001H10.5V5.50001H6C5.72386 5.50001 5.5 5.72387 5.5 6.00001V18C5.5 18.2762 5.72386 18.5 6 18.5H16C16.2761 18.5 16.5 18.2762 16.5 18V14.875H18V18C18 19.1046 17.1046 20 16 20H6C4.89543 20 4 19.1046 4 18V6.00001C4 4.89544 4.89543 4.00001 6 4.00001Z" fill="#333333"/>
4
+ </g>
5
+ <defs>
6
+ <clipPath id="clip0_611_573">
7
+ <rect width="24" height="24" fill="white"/>
8
+ </clipPath>
9
+ </defs>
10
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M12 2C12.4142 2 12.75 2.33579 12.75 2.75V4H20C21.1046 4 22 4.89543 22 6V15C22 16.1046 21.1046 17 20 17H12.7677L16.7598 20.6999C17.0636 20.9815 17.0816 21.456 16.8001 21.7598C16.5185 22.0636 16.044 22.0816 15.7402 21.8001L12 18.3337L8.25982 21.8001C7.95602 22.0816 7.48148 22.0636 7.19992 21.7598C6.91836 21.456 6.93638 20.9815 7.24018 20.6999L11.2323 17H4C2.89543 17 2 16.1046 2 15V6C2 4.89543 2.89543 4 4 4H11.25V2.75C11.25 2.33579 11.5858 2 12 2ZM4 5.5C3.72386 5.5 3.5 5.72386 3.5 6V15C3.5 15.2761 3.72386 15.5 4 15.5H20C20.2761 15.5 20.5 15.2761 20.5 15V6C20.5 5.72386 20.2761 5.5 20 5.5H4ZM14.5 10.5L10 8V13L14.5 10.5Z" fill="#0E1318"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M12 2C15.3137 2 18 4.68629 18 8C19.1046 8 20 8.89543 20 10V19C20 20.1046 19.1046 21 18 21H6C4.89543 21 4 20.1046 4 19V10C4 8.89543 4.89543 8 6 8C6 4.68629 8.68629 2 12 2ZM7.5 8C7.5 5.51472 9.51472 3.5 12 3.5C14.4853 3.5 16.5 5.51472 16.5 8H7.5ZM6 9.5C5.72386 9.5 5.5 9.72386 5.5 10V19C5.5 19.2761 5.72386 19.5 6 19.5H18C18.2761 19.5 18.5 19.2761 18.5 19V10C18.5 9.72386 18.2761 9.5 18 9.5H6ZM13.7778 12.6428C13.7778 13.3883 13.3574 14.0311 12.7508 14.3268L12.7481 17.3607C12.7477 17.7749 12.4117 18.1104 11.9975 18.11C11.5832 18.1097 11.2477 17.7736 11.2481 17.3594L11.2507 14.3275C10.6433 14.0322 10.2222 13.3889 10.2222 12.6428C10.2222 11.6172 11.0182 10.7857 12 10.7857C12.9818 10.7857 13.7778 11.6172 13.7778 12.6428Z" fill="#333333"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M6.75 19.4877C3.81824 19.2947 1.5 16.8556 1.5 13.875C1.5 11.5167 2.95125 9.49741 5.00939 8.66141C5.18497 5.50522 7.79992 3 11 3C14.0599 3 16.5848 5.29054 16.9536 8.25054C20.024 8.29262 22.5 10.7947 22.5 13.875C22.5 16.8556 20.1818 19.2947 17.25 19.4877V19.5H16.875H15V18H16.75V17.9981C16.7915 17.9994 16.8332 18 16.875 18C19.1532 18 21 16.1532 21 13.875C21 11.5968 19.1532 9.75 16.875 9.75C16.3484 9.75 15.8449 9.84867 15.3819 10.0285C15.4592 9.69819 15.5 9.35386 15.5 9C15.5 6.51472 13.4853 4.5 11 4.5C8.51472 4.5 6.5 6.51472 6.5 9C6.5 9.26854 6.52352 9.53159 6.56862 9.7872C4.55357 10.0589 3 11.7855 3 13.875C3 16.1532 4.84683 18 7.125 18C7.16681 18 7.20848 17.9994 7.25 17.9981V18H9V19.5H7.125H6.75V19.4877ZM12.75 13.8107L14.5455 15.6062C14.8384 15.8991 15.3133 15.8991 15.6062 15.6062C15.8991 15.3133 15.8991 14.8384 15.6062 14.5455L13.2554 12.1947C12.572 11.5113 11.4639 11.5113 10.7805 12.1947L8.42969 14.5455C8.13679 14.8384 8.13679 15.3133 8.42969 15.6062C8.72258 15.8991 9.19745 15.8991 9.49035 15.6062L11.25 13.8465V21.25C11.25 21.6642 11.5858 22 12 22C12.4142 22 12.75 21.6642 12.75 21.25V13.8107Z" fill="#F8F9F9"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M17.129 13.375C17.7011 13.0169 18.1729 12.5193 18.5001 11.929C18.8274 11.3387 18.9994 10.675 19 10C19 8.93913 18.5786 7.92172 17.8284 7.17157C17.0783 6.42143 16.0609 6 15 6C14.25 6 13.557 6.219 12.957 6.578C12.744 4.57 11.065 3 9 3C7.93913 3 6.92172 3.42143 6.17157 4.17157C5.42143 4.92172 5 5.93913 5 7C5 8.442 5.771 9.696 6.915 10.399C5.79401 10.8335 4.82535 11.5877 4.12933 12.568C3.43332 13.5483 3.04062 14.7114 3 15.913C3 16.145 3.114 16.377 3.343 16.493C5.171 17.536 7 18 9.057 18C9.074 18 9.09 17.997 9.108 17.997C9.04916 18.2992 9.01306 18.6054 9 18.913C9 19.145 9.114 19.377 9.343 19.493C11.171 20.536 13 21 15.057 21C17.114 21 18.943 20.536 20.657 19.609C20.7625 19.5539 20.8506 19.4704 20.9112 19.3679C20.9718 19.2654 21.0025 19.148 21 19.029C21 16.409 19.401 14.218 17.129 13.375ZM10.547 18.439C10.575 18.25 10.629 18.072 10.677 17.892C10.754 17.607 10.855 17.334 10.981 17.074C11.1246 16.7697 11.3009 16.482 11.507 16.216C12.146 15.4081 13.0448 14.8463 14.051 14.626C14.297 14.57 14.551 14.538 14.811 14.524C14.894 14.519 14.974 14.501 15.058 14.501C17.383 14.501 19.238 16.234 19.475 18.529C18.107 19.182 16.656 19.501 15.058 19.501C13.411 19.5 11.964 19.161 10.547 18.439ZM9 4.5C10.378 4.5 11.5 5.622 11.5 7C11.5 8.378 10.378 9.5 9 9.5C7.622 9.5 6.5 8.378 6.5 7C6.5 5.622 7.622 4.5 9 4.5ZM15 12.5C14.4243 12.4973 13.8675 12.2943 13.425 11.926C13.2934 11.8182 13.1731 11.6972 13.066 11.565C12.7027 11.1241 12.5028 10.5713 12.5 10C12.5 8.622 13.622 7.5 15 7.5C16.378 7.5 17.5 8.622 17.5 10C17.5 11.378 16.378 12.5 15 12.5ZM9.057 11.5C10.193 11.5 11.213 11.918 11.99 12.609C12.107 12.713 12.209 12.831 12.314 12.946C12.463 13.11 12.6 13.283 12.724 13.469C11.3514 14.0549 10.2408 15.1231 9.602 16.472C9.421 16.481 9.243 16.5 9.057 16.5C7.411 16.5 5.964 16.161 4.547 15.439C4.875 13.192 6.765 11.5 9.057 11.5Z" fill="#333333"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="14" height="13" viewBox="0 0 14 13" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M1.042 6.265C1.042 9.309 3.249 11.383 5.728 11.812C5.79543 11.8237 5.85991 11.8485 5.91773 11.8851C5.97556 11.9218 6.02561 11.9694 6.06503 12.0253C6.10445 12.0813 6.13246 12.1444 6.14747 12.2112C6.16248 12.278 6.16419 12.3471 6.1525 12.4145C6.14081 12.4819 6.11596 12.5464 6.07935 12.6042C6.04275 12.6621 5.99511 12.7121 5.93917 12.7515C5.88322 12.791 5.82006 12.819 5.75328 12.834C5.68651 12.849 5.61743 12.8507 5.55 12.839C2.639 12.335 0 9.881 0 6.265C0 4.728 0.699 3.52 1.515 2.602C2.1 1.944 2.769 1.409 3.307 1H1.671C1.53839 1 1.41121 0.947322 1.31745 0.853553C1.22368 0.759785 1.171 0.632608 1.171 0.5C1.171 0.367392 1.22368 0.240215 1.31745 0.146447C1.41121 0.0526785 1.53839 0 1.671 0H4.671C4.80361 0 4.93079 0.0526785 5.02455 0.146447C5.11832 0.240215 5.171 0.367392 5.171 0.5V3.5C5.171 3.63261 5.11832 3.75979 5.02455 3.85355C4.93079 3.94732 4.80361 4 4.671 4C4.53839 4 4.41121 3.94732 4.31745 3.85355C4.22368 3.75979 4.171 3.63261 4.171 3.5V1.654L4.17 1.656C3.598 2.086 2.9 2.613 2.295 3.294C1.58 4.098 1.042 5.071 1.042 6.265ZM12.15 6.671C12.15 3.659 9.99 1.598 7.543 1.138C7.4748 1.12643 7.40958 1.10139 7.35116 1.06435C7.29274 1.0273 7.24228 0.978997 7.20273 0.922245C7.16317 0.865493 7.13532 0.801432 7.12078 0.7338C7.10625 0.666168 7.10533 0.596318 7.11808 0.528327C7.13083 0.460336 7.15699 0.395564 7.19503 0.337791C7.23308 0.280017 7.28225 0.230399 7.33968 0.191831C7.39711 0.153263 7.46164 0.126518 7.52951 0.113155C7.59738 0.0997917 7.66724 0.100079 7.735 0.114C10.609 0.654 13.192 3.094 13.192 6.671C13.192 8.208 12.493 9.415 11.677 10.334C11.092 10.992 10.423 11.527 9.885 11.936H11.521C11.6536 11.936 11.7808 11.9887 11.8746 12.0824C11.9683 12.1762 12.021 12.3034 12.021 12.436C12.021 12.5686 11.9683 12.6958 11.8746 12.7896C11.7808 12.8833 11.6536 12.936 11.521 12.936H8.521C8.38839 12.936 8.26121 12.8833 8.16745 12.7896C8.07368 12.6958 8.021 12.5686 8.021 12.436V9.436C8.021 9.30339 8.07368 9.17622 8.16745 9.08245C8.26121 8.98868 8.38839 8.936 8.521 8.936C8.65361 8.936 8.78079 8.98868 8.87455 9.08245C8.96832 9.17622 9.021 9.30339 9.021 9.436V11.281H9.023C9.594 10.849 10.293 10.323 10.897 9.641C11.612 8.838 12.15 7.866 12.15 6.671Z" fill="#333333"/>
3
+ </svg>