!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"substack@538433c"};var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="0f880831-8985-471c-a908-dcfb3324291f",e._sentryDebugIdIdentifier="sentry-dbid-0f880831-8985-471c-a908-dcfb3324291f")}catch(e){}}();"use strict";(self.webpackChunksubstack=self.webpackChunksubstack||[]).push([["67562"],{25568:function(e){let{AbortController:t,AbortSignal:r}="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0;e.exports=t,e.exports.AbortSignal=r,e.exports.default=t},85902:function(e,t,r){r.d(t,{mg:()=>Y,vd:()=>P});var n,i=r(17402),s=r(30115),o=r.n(s),l=r(20311),a=r.n(l),c=r(2833),p=r.n(c),u=((n=u||{}).BASE="base",n.BODY="body",n.HEAD="head",n.HTML="html",n.LINK="link",n.META="meta",n.NOSCRIPT="noscript",n.SCRIPT="script",n.STYLE="style",n.TITLE="title",n.FRAGMENT="Symbol(react.fragment)",n),d={rel:["amphtml","canonical","alternate"]},h={type:["application/ld+json"]},m={charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]},f=Object.values(u),y={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},g=Object.entries(y).reduce((e,[t,r])=>(e[r]=t,e),{}),b="data-rh",T=(e,t)=>{for(let r=e.length-1;r>=0;r-=1){let n=e[r];if(Object.prototype.hasOwnProperty.call(n,t))return n[t]}return null},A=(e,t)=>t.filter(t=>void 0!==t[e]).map(t=>t[e]).reduce((e,t)=>({...e,...t}),{}),C=(e,t,r)=>{let n={};return r.filter(t=>{let r;return!!Array.isArray(t[e])||(void 0!==t[e]&&(r=`Helmet: ${e} should be of type "Array". Instead found type "${typeof t[e]}"`,console&&"function"==typeof console.warn&&console.warn(r)),!1)}).map(t=>t[e]).reverse().reduce((e,r)=>{let i={};r.filter(e=>{let r,s=Object.keys(e);for(let n=0;ne.push(t));let s=Object.keys(i);for(let e=0;eArray.isArray(e)?e.join(""):e,x=(e,t)=>Array.isArray(e)?e.reduce((e,r)=>(((e,t)=>{let r=Object.keys(e);for(let n=0;n({...e,[t]:void 0}),$=["noscript","script","style"],k=(e,t=!0)=>!1===t?String(e):String(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),v=e=>Object.keys(e).reduce((t,r)=>{let n=void 0!==e[r]?`${r}="${e[r]}"`:`${r}`;return t?`${t} ${n}`:n},""),E=(e,t={})=>Object.keys(e).reduce((t,r)=>(t[y[r]||r]=e[r],t),t),S=(e,t)=>t.map((t,r)=>{let n={key:r,[b]:!0};return Object.keys(t).forEach(e=>{let r=y[e]||e;"innerHTML"===r||"cssText"===r?n.dangerouslySetInnerHTML={__html:t.innerHTML||t.cssText}:n[r]=t[e]}),i.default.createElement(e,n)}),M=(e,t,r=!0)=>{switch(e){case"title":return{toComponent:()=>{var e;let r;return e=t.title,r=E(t.titleAttributes,{key:e,[b]:!0}),[i.default.createElement("title",r,e)]},toString:()=>{var n,i;let s,o;return n=t.title,i=t.titleAttributes,s=v(i),o=w(n),s?`<${e} ${b}="true" ${s}>${k(o,r)}`:`<${e} ${b}="true">${k(o,r)}`}};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>E(t),toString:()=>v(t)};default:return{toComponent:()=>S(e,t),toString:()=>((e,t,r=!0)=>t.reduce((t,n)=>{let i=Object.keys(n).filter(e=>"innerHTML"!==e&&"cssText"!==e).reduce((e,t)=>{let i=void 0===n[t]?t:`${t}="${k(n[t],r)}"`;return e?`${e} ${i}`:i},""),s=n.innerHTML||n.cssText||"",o=-1===$.indexOf(e);return`${t}<${e} ${b}="true" ${i}${o?"/>":`>${s}`}`},""))(e,t,r)}}},j=e=>{let{baseTag:t,bodyAttributes:r,encode:n=!0,htmlAttributes:i,noscriptTags:s,styleTags:o,title:l="",titleAttributes:a,prioritizeSeoTags:c}=e,{linkTags:p,metaTags:u,scriptTags:f}=e,y={toComponent:()=>{},toString:()=>""};return c&&({priorityMethods:y,linkTags:p,metaTags:u,scriptTags:f}=(({metaTags:e,linkTags:t,scriptTags:r,encode:n})=>{let i=x(e,m),s=x(t,d),o=x(r,h);return{priorityMethods:{toComponent:()=>[...S("meta",i.priority),...S("link",s.priority),...S("script",o.priority)],toString:()=>`${M("meta",i.priority,n)} ${M("link",s.priority,n)} ${M("script",o.priority,n)}`},metaTags:i.default,linkTags:s.default,scriptTags:o.default}})(e)),{priority:y,base:M("base",t,n),bodyAttributes:M("bodyAttributes",r,n),htmlAttributes:M("htmlAttributes",i,n),link:M("link",p,n),meta:M("meta",u,n),noscript:M("noscript",s,n),script:M("script",f,n),style:M("style",o,n),title:M("title",{title:l,titleAttributes:a},n)}},D=[],L=!!("undefined"!=typeof window&&window.document&&window.document.createElement),H=class{instances=[];canUseDOM=L;context;value={setHelmet:e=>{this.context.helmet=e},helmetInstances:{get:()=>this.canUseDOM?D:this.instances,add:e=>{(this.canUseDOM?D:this.instances).push(e)},remove:e=>{let t=(this.canUseDOM?D:this.instances).indexOf(e);(this.canUseDOM?D:this.instances).splice(t,1)}}};constructor(e,t){this.context=e,this.canUseDOM=t||!1,t||(e.helmet=j({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},I=i.default.createContext({}),P=class e extends i.Component{static canUseDOM=L;helmetData;constructor(t){super(t),this.helmetData=new H(this.props.context||{},e.canUseDOM)}render(){return i.default.createElement(I.Provider,{value:this.helmetData.value},this.props.children)}},U=(e,t)=>{let r,n=document.head||document.querySelector("head"),i=n.querySelectorAll(`${e}[${b}]`),s=[].slice.call(i),o=[];return t&&t.length&&t.forEach(t=>{let n=document.createElement(e);for(let e in t)if(Object.prototype.hasOwnProperty.call(t,e))if("innerHTML"===e)n.innerHTML=t.innerHTML;else if("cssText"===e)n.styleSheet?n.styleSheet.cssText=t.cssText:n.appendChild(document.createTextNode(t.cssText));else{let r=void 0===t[e]?"":t[e];n.setAttribute(e,r)}n.setAttribute(b,"true"),s.some((e,t)=>(r=t,n.isEqualNode(e)))?s.splice(r,1):o.push(n)}),s.forEach(e=>e.parentNode?.removeChild(e)),o.forEach(e=>n.appendChild(e)),{oldTags:s,newTags:o}},N=(e,t)=>{let r=document.getElementsByTagName(e)[0];if(!r)return;let n=r.getAttribute(b),i=n?n.split(","):[],s=[...i],o=Object.keys(t);for(let e of o){let n=t[e]||"";r.getAttribute(e)!==n&&r.setAttribute(e,n),-1===i.indexOf(e)&&i.push(e);let o=s.indexOf(e);-1!==o&&s.splice(o,1)}for(let e=s.length-1;e>=0;e-=1)r.removeAttribute(s[e]);i.length===s.length?r.removeAttribute(b):r.getAttribute(b)!==o.join(",")&&r.setAttribute(b,o.join(","))},R=(e,t)=>{let{baseTag:r,bodyAttributes:n,htmlAttributes:i,linkTags:s,metaTags:o,noscriptTags:l,onChangeClientState:a,scriptTags:c,styleTags:p,title:u,titleAttributes:d}=e;N("body",n),N("html",i),void 0!==u&&document.title!==u&&(document.title=w(u)),N("title",d);let h={baseTag:U("base",r),linkTags:U("link",s),metaTags:U("meta",o),noscriptTags:U("noscript",l),scriptTags:U("script",c),styleTags:U("style",p)},m={},f={};Object.keys(h).forEach(e=>{let{newTags:t,oldTags:r}=h[e];t.length&&(m[e]=t),r.length&&(f[e]=h[e].oldTags)}),t&&t(),a(e,m,f)},q=null,_=class extends i.Component{rendered=!1;shouldComponentUpdate(e){return!p()(e,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){let{helmetInstances:e}=this.props.context;e.remove(this),this.emitChange()}emitChange(){var e;let t,{helmetInstances:r,setHelmet:n}=this.props.context,i=null,s={baseTag:(t=["href"],(e=r.get().map(e=>{let t={...e.props};return delete t.context,t})).filter(e=>void 0!==e.base).map(e=>e.base).reverse().reduce((e,r)=>{if(!e.length){let n=Object.keys(r);for(let i=0;i{}),scriptTags:C("script",["src","innerHTML"],e),styleTags:C("style",["cssText"],e),title:(e=>{let t=T(e,"title"),r=T(e,"titleTemplate");if(Array.isArray(t)&&(t=t.join("")),r&&t)return r.replace(/%s/g,()=>t);let n=T(e,"defaultTitle");return t||n||void 0})(e),titleAttributes:A("titleAttributes",e),prioritizeSeoTags:((e,t)=>{if(Array.isArray(e)&&e.length){for(let r=0;r{R(s,()=>{q=null})}):(R(s),q=null);else j&&(i=j(s));n(i)}init(){if(this.rendered)return;this.rendered=!0;let{helmetInstances:e}=this.props.context;e.add(this),this.emitChange()}render(){return this.init(),null}},Y=class extends i.Component{static defaultProps={defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1};shouldComponentUpdate(e){return!o()(O(this.props,"helmetData"),O(e,"helmetData"))}mapNestedChildrenToProps(e,t){if(!t)return null;switch(e.type){case"script":case"noscript":return{innerHTML:t};case"style":return{cssText:t};default:throw Error(`<${e.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(e,t,r,n){return{...t,[e.type]:[...t[e.type]||[],{...r,...this.mapNestedChildrenToProps(e,n)}]}}mapObjectTypeChildren(e,t,r,n){switch(e.type){case"title":return{...t,[e.type]:n,titleAttributes:{...r}};case"body":return{...t,bodyAttributes:{...r}};case"html":return{...t,htmlAttributes:{...r}};default:return{...t,[e.type]:{...r}}}}mapArrayTypeChildrenToProps(e,t){let r={...t};return Object.keys(e).forEach(t=>{r={...r,[t]:e[t]}}),r}warnOnInvalidChildren(e,t){return a()(f.some(t=>e.type===t),"function"==typeof e.type?"You may be attempting to nest components within each other, which is not allowed. Refer to our API for more information.":`Only elements types ${f.join(", ")} are allowed. Helmet does not support rendering <${e.type}> elements. Refer to our API for more information.`),a()(!t||"string"==typeof t||Array.isArray(t)&&!t.some(e=>"string"!=typeof e),`Helmet expects a string as a child of <${e.type}>. Did you forget to wrap your children in braces? ( <${e.type}>{\`\`} ) Refer to our API for more information.`),!0}mapChildrenToProps(e,t){let r={};return i.default.Children.forEach(e,e=>{if(!e||!e.props)return;let{children:n,...i}=e.props,s=Object.keys(i).reduce((e,t)=>(e[g[t]||t]=i[t],e),{}),{type:o}=e;switch("symbol"==typeof o?o=o.toString():this.warnOnInvalidChildren(e,n),o){case"Symbol(react.fragment)":t=this.mapChildrenToProps(n,t);break;case"link":case"meta":case"noscript":case"script":case"style":r=this.flattenArrayTypeChildren(e,r,s,n);break;default:t=this.mapObjectTypeChildren(e,t,s,n)}}),this.mapArrayTypeChildrenToProps(r,t)}render(){let{children:e,...t}=this.props,r={...t},{helmetData:n}=t;return e&&(r=this.mapChildrenToProps(e,r)),!n||n instanceof H||(n=new H(n.context,!0),delete r.helmetData),n?i.default.createElement(_,{...r,context:n.value}):i.default.createElement(I.Consumer,null,e=>i.default.createElement(_,{...r,context:e}))}}}}]);