semanticweb/The Business of Extracting Knowledge from Academic Publications_files/portal.min
!function(e){var n={};function t(r){if(n[r])return n[r].exports;var a=n[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,t),a.l=!0,a.exports}t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var a in e)t.d(r,a,function(n){return e[n]}.bind(null,a));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="",t(t.s=0)}([function(e,n,t){t(1),e.exports=t(6)},function(e,n,t){var r=t(2);"string"==typeof r&&(r=[[e.i,r,""]]);var a={hmr:!0,transform:void 0,insertInto:void 0};t(4)(r,a);r.locals&&(e.exports=r.locals)},function(e,n,t){(n=t(3)(!1)).push([e.i,"",""]),e.exports=n},function(e,n,t){"use strict";e.exports=function(e){var n=[];return n.toString=function(){return this.map((function(n){var t=function(e,n){var t=e[1]||"",r=e[3];if(!r)return t;if(n&&"function"==typeof btoa){var a=(i=r,l=btoa(unescape(encodeURIComponent(JSON.stringify(i)))),u="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(l),"/*# ".concat(u," */")),o=r.sources.map((function(e){return"/*# sourceURL=".concat(r.sourceRoot||"").concat(e," */")}));return[t].concat(o).concat([a]).join("\n")}var i,l,u;return[t].join("\n")}(n,e);return n[2]?"@media ".concat(n[2]," {").concat(t,"}"):t})).join("")},n.i=function(e,t,r){"string"==typeof e&&(e=[[null,e,""]]);var a={};if(r)for(var o=0;o=0&&p.splice(n,1)}function b(e){var n=document.createElement("style");if(void 0===e.attrs.type&&(e.attrs.type="text/css"),void 0===e.attrs.nonce){var r=function(){0;return t.nc}();r&&(e.attrs.nonce=r)}return v(n,e.attrs),m(e,n),n}function v(e,n){Object.keys(n).forEach((function(t){e.setAttribute(t,n[t])}))}function y(e,n){var t,r,a,o;if(n.transform&&e.css){if(!(o="function"==typeof n.transform?n.transform(e.css):n.transform.default(e.css)))return function(){};e.css=o}if(n.singleton){var i=s++;t=c||(c=b(n)),r=k.bind(null,t,i,!1),a=k.bind(null,t,i,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(t=function(e){var n=document.createElement("link");return void 0===e.attrs.type&&(e.attrs.type="text/css"),e.attrs.rel="stylesheet",v(n,e.attrs),m(e,n),n}(n),r=S.bind(null,t,n),a=function(){g(t),t.href&&URL.revokeObjectURL(t.href)}):(t=b(n),r=E.bind(null,t),a=function(){g(t)});return r(e),function(n){if(n){if(n.css===e.css&&n.media===e.media&&n.sourceMap===e.sourceMap)return;r(e=n)}else a()}}e.exports=function(e,n){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(n=n||{}).attrs="object"==typeof n.attrs?n.attrs:{},n.singleton||"boolean"==typeof n.singleton||(n.singleton=i()),n.insertInto||(n.insertInto="head"),n.insertAt||(n.insertAt="bottom");var t=h(e,n);return d(t,n),function(e){for(var r=[],a=0;aO.length&&O.push(e)}function R(e,n,t){return null==e?0:function e(n,t,r,a){var l=typeof n;"undefined"!==l&&"boolean"!==l||(n=null);var u=!1;if(null===n)u=!0;else switch(l){case"string":case"number":u=!0;break;case"object":switch(n.$$typeof){case o:case i:u=!0}}if(u)return r(a,n,""===t?"."+I(n,0):t),1;if(u=0,t=""===t?".":t+":",Array.isArray(n))for(var c=0;cn}return!1}(n,t,a,r)&&(t=null),r||null===a?function(e){return!!W.call(V,e)||!W.call(Q,e)&&(B.test(e)?V[e]=!0:(Q[e]=!0,!1))}(n)&&(null===t?e.removeAttribute(n):e.setAttribute(n,""+t)):a.mustUseProperty?e[a.propertyName]=null===t?3!==a.type&&"":t:(n=a.attributeName,r=a.attributeNamespace,null===t?e.removeAttribute(n):(t=3===(a=a.type)||4===a&&!0===t?"":""+t,r?e.setAttributeNS(r,n,t):e.setAttribute(n,t))))}J.hasOwnProperty("ReactCurrentDispatcher")||(J.ReactCurrentDispatcher={current:null}),J.hasOwnProperty("ReactCurrentBatchConfig")||(J.ReactCurrentBatchConfig={suspense:null});var X=/^(.*)[\\\/]/,Z="function"==typeof Symbol&&Symbol.for,ee=Z?Symbol.for("react.element"):60103,ne=Z?Symbol.for("react.portal"):60106,te=Z?Symbol.for("react.fragment"):60107,re=Z?Symbol.for("react.strict_mode"):60108,ae=Z?Symbol.for("react.profiler"):60114,oe=Z?Symbol.for("react.provider"):60109,ie=Z?Symbol.for("react.context"):60110,le=Z?Symbol.for("react.concurrent_mode"):60111,ue=Z?Symbol.for("react.forward_ref"):60112,ce=Z?Symbol.for("react.suspense"):60113,se=Z?Symbol.for("react.suspense_list"):60120,pe=Z?Symbol.for("react.memo"):60115,fe=Z?Symbol.for("react.lazy"):60116,de=Z?Symbol.for("react.block"):60121,he="function"==typeof Symbol&&Symbol.iterator;function me(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=he&&e[he]||e["@@iterator"])?e:null}function ge(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case te:return"Fragment";case ne:return"Portal";case ae:return"Profiler";case re:return"StrictMode";case ce:return"Suspense";case se:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case ie:return"Context.Consumer";case oe:return"Context.Provider";case ue:var n=e.render;return n=n.displayName||n.name||"",e.displayName||(""!==n?"ForwardRef("+n+")":"ForwardRef");case pe:return ge(e.type);case de:return ge(e.render);case fe:if(e=1===e._status?e._result:null)return ge(e)}return null}function be(e){var n="";do{e:switch(e.tag){case 3:case 4:case 6:case 7:case 10:case 9:var t="";break e;default:var r=e._debugOwner,a=e._debugSource,o=ge(e.type);t=null,r&&(t=ge(r.type)),r=o,o="",a?o=" (at "+a.fileName.replace(X,"")+":"+a.lineNumber+")":t&&(o=" (created by "+t+")"),t="\n in "+(r||"Unknown")+o}n+=t,e=e.return}while(e);return n}function ve(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function ye(e){var n=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===n||"radio"===n)}function xe(e){e._valueTracker||(e._valueTracker=function(e){var n=ye(e)?"checked":"value",t=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),r=""+e[n];if(!e.hasOwnProperty(n)&&void 0!==t&&"function"==typeof t.get&&"function"==typeof t.set){var a=t.get,o=t.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return a.call(this)},set:function(e){r=""+e,o.call(this,e)}}),Object.defineProperty(e,n,{enumerable:t.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}(e))}function we(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var t=n.getValue(),r="";return e&&(r=ye(e)?e.checked?"true":"false":e.value),(e=r)!==t&&(n.setValue(e),!0)}function ke(e,n){var t=n.checked;return a({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=t?t:e._wrapperState.initialChecked})}function Ee(e,n){var t=null==n.defaultValue?"":n.defaultValue,r=null!=n.checked?n.checked:n.defaultChecked;t=ve(null!=n.value?n.value:t),e._wrapperState={initialChecked:r,initialValue:t,controlled:"checkbox"===n.type||"radio"===n.type?null!=n.checked:null!=n.value}}function Se(e,n){null!=(n=n.checked)&&G(e,"checked",n,!1)}function Ce(e,n){Se(e,n);var t=ve(n.value),r=n.type;if(null!=t)"number"===r?(0===t&&""===e.value||e.value!=t)&&(e.value=""+t):e.value!==""+t&&(e.value=""+t);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");n.hasOwnProperty("value")?Te(e,n.type,t):n.hasOwnProperty("defaultValue")&&Te(e,n.type,ve(n.defaultValue)),null==n.checked&&null!=n.defaultChecked&&(e.defaultChecked=!!n.defaultChecked)}function Pe(e,n,t){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var r=n.type;if(!("submit"!==r&&"reset"!==r||void 0!==n.value&&null!==n.value))return;n=""+e._wrapperState.initialValue,t||n===e.value||(e.value=n),e.defaultValue=n}""!==(t=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==t&&(e.name=t)}function Te(e,n,t){"number"===n&&e.ownerDocument.activeElement===e||(null==t?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+t&&(e.defaultValue=""+t))}function _e(e,n){return e=a({children:void 0},n),(n=function(e){var n="";return r.Children.forEach(e,(function(e){null!=e&&(n+=e)})),n}(n.children))&&(e.children=n),e}function Ne(e,n,t,r){if(e=e.options,n){n={};for(var a=0;a=t.length))throw Error(i(93));t=t[0]}n=t}null==n&&(n=""),t=n}e._wrapperState={initialValue:ve(t)}}function je(e,n){var t=ve(n.value),r=ve(n.defaultValue);null!=t&&((t=""+t)!==e.value&&(e.value=t),null==n.defaultValue&&e.defaultValue!==t&&(e.defaultValue=t)),null!=r&&(e.defaultValue=""+r)}function Re(e){var n=e.textContent;n===e._wrapperState.initialValue&&""!==n&&null!==n&&(e.value=n)}function Ie(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ze(e,n){return null==e||"http://www.w3.org/1999/xhtml"===e?Ie(n):"http://www.w3.org/2000/svg"===e&&"foreignObject"===n?"http://www.w3.org/1999/xhtml":e}var Fe,Ae=function(e){return"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(n,t,r,a){MSApp.execUnsafeLocalFunction((function(){return e(n,t)}))}:e}((function(e,n){if("http://www.w3.org/2000/svg"!==e.namespaceURI||"innerHTML"in e)e.innerHTML=n;else{for((Fe=Fe||document.createElement("div")).innerHTML="",n=Fe.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;n.firstChild;)e.appendChild(n.firstChild)}}));function Me(e,n){if(n){var t=e.firstChild;if(t&&t===e.lastChild&&3===t.nodeType)return void(t.nodeValue=n)}e.textContent=n}function De(e,n){var t={};return t[e.toLowerCase()]=n.toLowerCase(),t["Webkit"+e]="webkit"+n,t["Moz"+e]="moz"+n,t}var Ue={animationend:De("Animation","AnimationEnd"),animationiteration:De("Animation","AnimationIteration"),animationstart:De("Animation","AnimationStart"),transitionend:De("Transition","TransitionEnd")},He={},Be={};function We(e){if(He[e])return He[e];if(!Ue[e])return e;var n,t=Ue[e];for(n in t)if(t.hasOwnProperty(n)&&n in Be)return He[e]=t[n];return e}T&&(Be=document.createElement("div").style,"AnimationEvent"in window||(delete Ue.animationend.animation,delete Ue.animationiteration.animation,delete Ue.animationstart.animation),"TransitionEvent"in window||delete Ue.transitionend.transition);var Qe=We("animationend"),Ve=We("animationiteration"),$e=We("animationstart"),qe=We("transitionend"),Ke="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Ye=new("function"==typeof WeakMap?WeakMap:Map);function Je(e){var n=Ye.get(e);return void 0===n&&(n=new Map,Ye.set(e,n)),n}function Ge(e){var n=e,t=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do{0!=(1026&(n=e).effectTag)&&(t=n.return),e=n.return}while(e)}return 3===n.tag?t:null}function Xe(e){if(13===e.tag){var n=e.memoizedState;if(null===n&&null!==(e=e.alternate)&&(n=e.memoizedState),null!==n)return n.dehydrated}return null}function Ze(e){if(Ge(e)!==e)throw Error(i(188))}function en(e){if(!(e=function(e){var n=e.alternate;if(!n){if(null===(n=Ge(e)))throw Error(i(188));return n!==e?null:e}for(var t=e,r=n;;){var a=t.return;if(null===a)break;var o=a.alternate;if(null===o){if(null!==(r=a.return)){t=r;continue}break}if(a.child===o.child){for(o=a.child;o;){if(o===t)return Ze(a),e;if(o===r)return Ze(a),n;o=o.sibling}throw Error(i(188))}if(t.return!==r.return)t=a,r=o;else{for(var l=!1,u=a.child;u;){if(u===t){l=!0,t=a,r=o;break}if(u===r){l=!0,r=a,t=o;break}u=u.sibling}if(!l){for(u=o.child;u;){if(u===t){l=!0,t=o,r=a;break}if(u===r){l=!0,r=o,t=a;break}u=u.sibling}if(!l)throw Error(i(189))}}if(t.alternate!==r)throw Error(i(190))}if(3!==t.tag)throw Error(i(188));return t.stateNode.current===t?e:n}(e)))return null;for(var n=e;;){if(5===n.tag||6===n.tag)return n;if(n.child)n.child.return=n,n=n.child;else{if(n===e)break;for(;!n.sibling;){if(!n.return||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}}return null}function nn(e,n){if(null==n)throw Error(i(30));return null==e?n:Array.isArray(e)?Array.isArray(n)?(e.push.apply(e,n),e):(e.push(n),e):Array.isArray(n)?[e].concat(n):[e,n]}function tn(e,n,t){Array.isArray(e)?e.forEach(n,t):e&&n.call(t,e)}var rn=null;function an(e){if(e){var n=e._dispatchListeners,t=e._dispatchInstances;if(Array.isArray(n))for(var r=0;rcn.length&&cn.push(e)}function pn(e,n,t,r){if(cn.length){var a=cn.pop();return a.topLevelType=e,a.eventSystemFlags=r,a.nativeEvent=n,a.targetInst=t,a}return{topLevelType:e,eventSystemFlags:r,nativeEvent:n,targetInst:t,ancestors:[]}}function fn(e){var n=e.targetInst,t=n;do{if(!t){e.ancestors.push(t);break}var r=t;if(3===r.tag)r=r.stateNode.containerInfo;else{for(;r.return;)r=r.return;r=3!==r.tag?null:r.stateNode.containerInfo}if(!r)break;5!==(n=t.tag)&&6!==n||e.ancestors.push(t),t=Ct(r)}while(t);for(t=0;t=n)return{node:r,offset:n-e};e=t}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=ct(r)}}function pt(){for(var e=window,n=ut();n instanceof e.HTMLIFrameElement;){try{var t="string"==typeof n.contentWindow.location.href}catch(e){t=!1}if(!t)break;n=ut((e=n.contentWindow).document)}return n}function ft(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&("input"===n&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===n||"true"===e.contentEditable)}var dt=null,ht=null;function mt(e,n){switch(e){case"button":case"input":case"select":case"textarea":return!!n.autoFocus}return!1}function gt(e,n){return"textarea"===e||"option"===e||"noscript"===e||"string"==typeof n.children||"number"==typeof n.children||"object"==typeof n.dangerouslySetInnerHTML&&null!==n.dangerouslySetInnerHTML&&null!=n.dangerouslySetInnerHTML.__html}var bt="function"==typeof setTimeout?setTimeout:void 0,vt="function"==typeof clearTimeout?clearTimeout:void 0;function yt(e){for(;null!=e;e=e.nextSibling){var n=e.nodeType;if(1===n||3===n)break}return e}function xt(e){e=e.previousSibling;for(var n=0;e;){if(8===e.nodeType){var t=e.data;if("$"===t||"$!"===t||"$?"===t){if(0===n)return e;n--}else"/$"===t&&n++}e=e.previousSibling}return null}var wt=Math.random().toString(36).slice(2),kt="__reactInternalInstance$"+wt,Et="__reactEventHandlers$"+wt,St="__reactContainere$"+wt;function Ct(e){var n=e[kt];if(n)return n;for(var t=e.parentNode;t;){if(n=t[St]||t[kt]){if(t=n.alternate,null!==n.child||null!==t&&null!==t.child)for(e=xt(e);null!==e;){if(t=e[kt])return t;e=xt(e)}return n}t=(e=t).parentNode}return null}function Pt(e){return!(e=e[kt]||e[St])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function Tt(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(i(33))}function _t(e){return e[Et]||null}function Nt(e){do{e=e.return}while(e&&5!==e.tag);return e||null}function Ot(e,n){var t=e.stateNode;if(!t)return null;var r=h(t);if(!r)return null;t=r[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(t&&"function"!=typeof t)throw Error(i(231,n,typeof t));return t}function Lt(e,n,t){(n=Ot(e,t.dispatchConfig.phasedRegistrationNames[n]))&&(t._dispatchListeners=nn(t._dispatchListeners,n),t._dispatchInstances=nn(t._dispatchInstances,e))}function jt(e){if(e&&e.dispatchConfig.phasedRegistrationNames){for(var n=e._targetInst,t=[];n;)t.push(n),n=Nt(n);for(n=t.length;0this.eventPool.length&&this.eventPool.push(e)}function Vt(e){e.eventPool=[],e.getPooled=Wt,e.release=Qt}a(Bt.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=Ut)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=Ut)},persist:function(){this.isPersistent=Ut},isPersistent:Ht,destructor:function(){var e,n=this.constructor.Interface;for(e in n)this[e]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null,this.isPropagationStopped=this.isDefaultPrevented=Ht,this._dispatchInstances=this._dispatchListeners=null}}),Bt.Interface={type:null,target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null},Bt.extend=function(e){function n(){}function t(){return r.apply(this,arguments)}var r=this;n.prototype=r.prototype;var o=new n;return a(o,t.prototype),t.prototype=o,t.prototype.constructor=t,t.Interface=a({},r.Interface,e),t.extend=r.extend,Vt(t),t},Vt(Bt);var $t=Bt.extend({data:null}),qt=Bt.extend({data:null}),Kt=[9,13,27,32],Yt=T&&"CompositionEvent"in window,Jt=null;T&&"documentMode"in document&&(Jt=document.documentMode);var Gt=T&&"TextEvent"in window&&!Jt,Xt=T&&(!Yt||Jt&&8=Jt),Zt=String.fromCharCode(32),er={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},nr=!1;function tr(e,n){switch(e){case"keyup":return-1!==Kt.indexOf(n.keyCode);case"keydown":return 229!==n.keyCode;case"keypress":case"mousedown":case"blur":return!0;default:return!1}}function rr(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var ar=!1,or={eventTypes:er,extractEvents:function(e,n,t,r){var a;if(Yt)e:{switch(e){case"compositionstart":var o=er.compositionStart;break e;case"compositionend":o=er.compositionEnd;break e;case"compositionupdate":o=er.compositionUpdate;break e}o=void 0}else ar?tr(e,t)&&(o=er.compositionEnd):"keydown"===e&&229===t.keyCode&&(o=er.compositionStart);return o?(Xt&&"ko"!==t.locale&&(ar||o!==er.compositionStart?o===er.compositionEnd&&ar&&(a=Dt()):(At="value"in(Ft=r)?Ft.value:Ft.textContent,ar=!0)),o=$t.getPooled(o,n,t,r),(a||null!==(a=rr(t)))&&(o.data=a),zt(o),a=o):a=null,(e=Gt?function(e,n){switch(e){case"compositionend":return rr(n);case"keypress":return 32!==n.which?null:(nr=!0,Zt);case"textInput":return(e=n.data)===Zt&&nr?null:e;default:return null}}(e,t):function(e,n){if(ar)return"compositionend"===e||!Yt&&tr(e,n)?(e=Dt(),Mt=At=Ft=null,ar=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1=document.documentMode,Dr={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ")}},Ur=null,Hr=null,Br=null,Wr=!1;function Qr(e,n){var t=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;return Wr||null==Ur||Ur!==ut(t)?null:(t="selectionStart"in(t=Ur)&&ft(t)?{start:t.selectionStart,end:t.selectionEnd}:{anchorNode:(t=(t.ownerDocument&&t.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:t.anchorOffset,focusNode:t.focusNode,focusOffset:t.focusOffset},Br&&Ar(Br,t)?null:(Br=t,(e=Bt.getPooled(Dr.select,Hr,e,n)).type="select",e.target=Ur,zt(e),e))}var Vr={eventTypes:Dr,extractEvents:function(e,n,t,r,a,o){if(!(o=!(a=o||(r.window===r?r.document:9===r.nodeType?r:r.ownerDocument)))){e:{a=Je(a),o=C.onSelect;for(var i=0;ioa||(e.current=aa[oa],aa[oa]=null,oa--)}function la(e,n){oa++,aa[oa]=e.current,e.current=n}var ua={},ca={current:ua},sa={current:!1},pa=ua;function fa(e,n){var t=e.type.contextTypes;if(!t)return ua;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===n)return r.__reactInternalMemoizedMaskedChildContext;var a,o={};for(a in t)o[a]=n[a];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=o),o}function da(e){return null!==(e=e.childContextTypes)&&void 0!==e}function ha(){ia(sa),ia(ca)}function ma(e,n,t){if(ca.current!==ua)throw Error(i(168));la(ca,n),la(sa,t)}function ga(e,n,t){var r=e.stateNode;if(e=n.childContextTypes,"function"!=typeof r.getChildContext)return t;for(var o in r=r.getChildContext())if(!(o in e))throw Error(i(108,ge(n)||"Unknown",o));return a({},t,{},r)}function ba(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ua,pa=ca.current,la(ca,e),la(sa,sa.current),!0}function va(e,n,t){var r=e.stateNode;if(!r)throw Error(i(169));t?(e=ga(e,n,pa),r.__reactInternalMemoizedMergedChildContext=e,ia(sa),ia(ca),la(ca,e)):ia(sa),la(sa,t)}var ya=o.unstable_runWithPriority,xa=o.unstable_scheduleCallback,wa=o.unstable_cancelCallback,ka=o.unstable_requestPaint,Ea=o.unstable_now,Sa=o.unstable_getCurrentPriorityLevel,Ca=o.unstable_ImmediatePriority,Pa=o.unstable_UserBlockingPriority,Ta=o.unstable_NormalPriority,_a=o.unstable_LowPriority,Na=o.unstable_IdlePriority,Oa={},La=o.unstable_shouldYield,ja=void 0!==ka?ka:function(){},Ra=null,Ia=null,za=!1,Fa=Ea(),Aa=1e4>Fa?Ea:function(){return Ea()-Fa};function Ma(){switch(Sa()){case Ca:return 99;case Pa:return 98;case Ta:return 97;case _a:return 96;case Na:return 95;default:throw Error(i(332))}}function Da(e){switch(e){case 99:return Ca;case 98:return Pa;case 97:return Ta;case 96:return _a;case 95:return Na;default:throw Error(i(332))}}function Ua(e,n){return e=Da(e),ya(e,n)}function Ha(e,n,t){return e=Da(e),xa(e,n,t)}function Ba(e){return null===Ra?(Ra=[e],Ia=xa(Ca,Qa)):Ra.push(e),Oa}function Wa(){if(null!==Ia){var e=Ia;Ia=null,wa(e)}Qa()}function Qa(){if(!za&&null!==Ra){za=!0;var e=0;try{var n=Ra;Ua(99,(function(){for(;e=n&&(_i=!0),e.firstContext=null)}function no(e,n){if(Ja!==e&&!1!==n&&0!==n)if("number"==typeof n&&1073741823!==n||(Ja=e,n=1073741823),n={context:e,observedBits:n,next:null},null===Ya){if(null===Ka)throw Error(i(308));Ya=n,Ka.dependencies={expirationTime:0,firstContext:n,responders:null}}else Ya=Ya.next=n;return e._currentValue}var to=!1;function ro(e){e.updateQueue={baseState:e.memoizedState,baseQueue:null,shared:{pending:null},effects:null}}function ao(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,baseQueue:e.baseQueue,shared:e.shared,effects:e.effects})}function oo(e,n){return(e={expirationTime:e,suspenseConfig:n,tag:0,payload:null,callback:null,next:null}).next=e}function io(e,n){if(null!==(e=e.updateQueue)){var t=(e=e.shared).pending;null===t?n.next=n:(n.next=t.next,t.next=n),e.pending=n}}function lo(e,n){var t=e.alternate;null!==t&&ao(t,e),null===(t=(e=e.updateQueue).baseQueue)?(e.baseQueue=n.next=n,n.next=n):(n.next=t.next,t.next=n)}function uo(e,n,t,r){var o=e.updateQueue;to=!1;var i=o.baseQueue,l=o.shared.pending;if(null!==l){if(null!==i){var u=i.next;i.next=l.next,l.next=u}i=l,o.shared.pending=null,null!==(u=e.alternate)&&null!==(u=u.updateQueue)&&(u.baseQueue=l)}if(null!==i){u=i.next;var c=o.baseState,s=0,p=null,f=null,d=null;if(null!==u)for(var h=u;;){if((l=h.expirationTime)s&&(s=l)}else{null!==d&&(d=d.next={expirationTime:1073741823,suspenseConfig:h.suspenseConfig,tag:h.tag,payload:h.payload,callback:h.callback,next:null}),ru(l,h.suspenseConfig);e:{var g=e,b=h;switch(l=n,m=t,b.tag){case 1:if("function"==typeof(g=b.payload)){c=g.call(m,c,l);break e}c=g;break e;case 3:g.effectTag=-4097&g.effectTag|64;case 0:if(null===(l="function"==typeof(g=b.payload)?g.call(m,c,l):g)||void 0===l)break e;c=a({},c,l);break e;case 2:to=!0}}null!==h.callback&&(e.effectTag|=32,null===(l=o.effects)?o.effects=[h]:l.push(h))}if(null===(h=h.next)||h===u){if(null===(l=o.shared.pending))break;h=i.next=l.next,l.next=u,o.baseQueue=i=l,o.shared.pending=null}}null===d?p=c:d.next=f,o.baseState=p,o.baseQueue=d,au(s),e.expirationTime=s,e.memoizedState=c}}function co(e,n,t){if(e=n.effects,n.effects=null,null!==e)for(n=0;nm?(g=p,p=null):g=p.sibling;var b=d(a,p,l[m],u);if(null===b){null===p&&(p=g);break}e&&p&&null===b.alternate&&n(a,p),i=o(b,i,m),null===s?c=b:s.sibling=b,s=b,p=g}if(m===l.length)return t(a,p),c;if(null===p){for(;mg?(b=m,m=null):b=m.sibling;var y=d(a,m,v.value,c);if(null===y){null===m&&(m=b);break}e&&m&&null===y.alternate&&n(a,m),l=o(y,l,g),null===p?s=y:p.sibling=y,p=y,m=b}if(v.done)return t(a,m),s;if(null===m){for(;!v.done;g++,v=u.next())null!==(v=f(a,v.value,c))&&(l=o(v,l,g),null===p?s=v:p.sibling=v,p=v);return s}for(m=r(a,m);!v.done;g++,v=u.next())null!==(v=h(m,a,g,v.value,c))&&(e&&null!==v.alternate&&m.delete(null===v.key?g:v.key),l=o(v,l,g),null===p?s=v:p.sibling=v,p=v);return e&&m.forEach((function(e){return n(a,e)})),s}return function(e,r,o,u){var c="object"==typeof o&&null!==o&&o.type===te&&null===o.key;c&&(o=o.props.children);var s="object"==typeof o&&null!==o;if(s)switch(o.$$typeof){case ee:e:{for(s=o.key,c=r;null!==c;){if(c.key===s){switch(c.tag){case 7:if(o.type===te){t(e,c.sibling),(r=a(c,o.props.children)).return=e,e=r;break e}break;default:if(c.elementType===o.type){t(e,c.sibling),(r=a(c,o.props)).ref=xo(e,c,o),r.return=e,e=r;break e}}t(e,c);break}n(e,c),c=c.sibling}o.type===te?((r=Pu(o.props.children,e.mode,u,o.key)).return=e,e=r):((u=Cu(o.type,o.key,o.props,null,e.mode,u)).ref=xo(e,r,o),u.return=e,e=u)}return l(e);case ne:e:{for(c=o.key;null!==r;){if(r.key===c){if(4===r.tag&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){t(e,r.sibling),(r=a(r,o.children||[])).return=e,e=r;break e}t(e,r);break}n(e,r),r=r.sibling}(r=_u(o,e.mode,u)).return=e,e=r}return l(e)}if("string"==typeof o||"number"==typeof o)return o=""+o,null!==r&&6===r.tag?(t(e,r.sibling),(r=a(r,o)).return=e,e=r):(t(e,r),(r=Tu(o,e.mode,u)).return=e,e=r),l(e);if(yo(o))return m(e,r,o,u);if(me(o))return g(e,r,o,u);if(s&&wo(e,o),void 0===o&&!c)switch(e.tag){case 1:case 0:throw e=e.type,Error(i(152,e.displayName||e.name||"Component"))}return t(e,r)}}var Eo=ko(!0),So=ko(!1),Co={},Po={current:Co},To={current:Co},_o={current:Co};function No(e){if(e===Co)throw Error(i(174));return e}function Oo(e,n){switch(la(_o,n),la(To,e),la(Po,Co),e=n.nodeType){case 9:case 11:n=(n=n.documentElement)?n.namespaceURI:ze(null,"");break;default:n=ze(n=(e=8===e?n.parentNode:n).namespaceURI||null,e=e.tagName)}ia(Po),la(Po,n)}function Lo(){ia(Po),ia(To),ia(_o)}function jo(e){No(_o.current);var n=No(Po.current),t=ze(n,e.type);n!==t&&(la(To,e),la(Po,t))}function Ro(e){To.current===e&&(ia(Po),ia(To))}var Io={current:0};function zo(e){for(var n=e;null!==n;){if(13===n.tag){var t=n.memoizedState;if(null!==t&&(null===(t=t.dehydrated)||"$?"===t.data||"$!"===t.data))return n}else if(19===n.tag&&void 0!==n.memoizedProps.revealOrder){if(0!=(64&n.effectTag))return n}else if(null!==n.child){n.child.return=n,n=n.child;continue}if(n===e)break;for(;null===n.sibling;){if(null===n.return||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}function Fo(e,n){return{responder:e,props:n}}var Ao=J.ReactCurrentDispatcher,Mo=J.ReactCurrentBatchConfig,Do=0,Uo=null,Ho=null,Bo=null,Wo=!1;function Qo(){throw Error(i(321))}function Vo(e,n){if(null===n)return!1;for(var t=0;to))throw Error(i(301));o+=1,Bo=Ho=null,n.updateQueue=null,Ao.current=bi,e=t(r,a)}while(n.expirationTime===Do)}if(Ao.current=hi,n=null!==Ho&&null!==Ho.next,Do=0,Bo=Ho=Uo=null,Wo=!1,n)throw Error(i(300));return e}function qo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===Bo?Uo.memoizedState=Bo=e:Bo=Bo.next=e,Bo}function Ko(){if(null===Ho){var e=Uo.alternate;e=null!==e?e.memoizedState:null}else e=Ho.next;var n=null===Bo?Uo.memoizedState:Bo.next;if(null!==n)Bo=n,Ho=e;else{if(null===e)throw Error(i(310));e={memoizedState:(Ho=e).memoizedState,baseState:Ho.baseState,baseQueue:Ho.baseQueue,queue:Ho.queue,next:null},null===Bo?Uo.memoizedState=Bo=e:Bo=Bo.next=e}return Bo}function Yo(e,n){return"function"==typeof n?n(e):n}function Jo(e){var n=Ko(),t=n.queue;if(null===t)throw Error(i(311));t.lastRenderedReducer=e;var r=Ho,a=r.baseQueue,o=t.pending;if(null!==o){if(null!==a){var l=a.next;a.next=o.next,o.next=l}r.baseQueue=a=o,t.pending=null}if(null!==a){a=a.next,r=r.baseState;var u=l=o=null,c=a;do{var s=c.expirationTime;if(sUo.expirationTime&&(Uo.expirationTime=s,au(s))}else null!==u&&(u=u.next={expirationTime:1073741823,suspenseConfig:c.suspenseConfig,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null}),ru(s,c.suspenseConfig),r=c.eagerReducer===e?c.eagerState:e(r,c.action);c=c.next}while(null!==c&&c!==a);null===u?o=r:u.next=l,zr(r,n.memoizedState)||(_i=!0),n.memoizedState=r,n.baseState=o,n.baseQueue=u,t.lastRenderedState=r}return[n.memoizedState,t.dispatch]}function Go(e){var n=Ko(),t=n.queue;if(null===t)throw Error(i(311));t.lastRenderedReducer=e;var r=t.dispatch,a=t.pending,o=n.memoizedState;if(null!==a){t.pending=null;var l=a=a.next;do{o=e(o,l.action),l=l.next}while(l!==a);zr(o,n.memoizedState)||(_i=!0),n.memoizedState=o,null===n.baseQueue&&(n.baseState=o),t.lastRenderedState=o}return[o,r]}function Xo(e){var n=qo();return"function"==typeof e&&(e=e()),n.memoizedState=n.baseState=e,e=(e=n.queue={pending:null,dispatch:null,lastRenderedReducer:Yo,lastRenderedState:e}).dispatch=di.bind(null,Uo,e),[n.memoizedState,e]}function Zo(e,n,t,r){return e={tag:e,create:n,destroy:t,deps:r,next:null},null===(n=Uo.updateQueue)?(n={lastEffect:null},Uo.updateQueue=n,n.lastEffect=e.next=e):null===(t=n.lastEffect)?n.lastEffect=e.next=e:(r=t.next,t.next=e,e.next=r,n.lastEffect=e),e}function ei(){return Ko().memoizedState}function ni(e,n,t,r){var a=qo();Uo.effectTag|=e,a.memoizedState=Zo(1|n,t,void 0,void 0===r?null:r)}function ti(e,n,t,r){var a=Ko();r=void 0===r?null:r;var o=void 0;if(null!==Ho){var i=Ho.memoizedState;if(o=i.destroy,null!==r&&Vo(r,i.deps))return void Zo(n,t,o,r)}Uo.effectTag|=e,a.memoizedState=Zo(1|n,t,o,r)}function ri(e,n){return ni(516,4,e,n)}function ai(e,n){return ti(516,4,e,n)}function oi(e,n){return ti(4,2,e,n)}function ii(e,n){return"function"==typeof n?(e=e(),n(e),function(){n(null)}):null!=n?(e=e(),n.current=e,function(){n.current=null}):void 0}function li(e,n,t){return t=null!=t?t.concat([e]):null,ti(4,2,ii.bind(null,n,e),t)}function ui(){}function ci(e,n){return qo().memoizedState=[e,void 0===n?null:n],e}function si(e,n){var t=Ko();n=void 0===n?null:n;var r=t.memoizedState;return null!==r&&null!==n&&Vo(n,r[1])?r[0]:(t.memoizedState=[e,n],e)}function pi(e,n){var t=Ko();n=void 0===n?null:n;var r=t.memoizedState;return null!==r&&null!==n&&Vo(n,r[1])?r[0]:(e=e(),t.memoizedState=[e,n],e)}function fi(e,n,t){var r=Ma();Ua(98>r?98:r,(function(){e(!0)})),Ua(97<\/script>",e=e.removeChild(e.firstChild)):"string"==typeof r.is?e=u.createElement(o,{is:r.is}):(e=u.createElement(o),"select"===o&&(u=e,r.multiple?u.multiple=!0:r.size&&(u.size=r.size))):e=u.createElementNS(e,o),e[kt]=n,e[Et]=r,Mi(e,n),n.stateNode=e,u=at(o,r),o){case"iframe":case"object":case"embed":$n("load",e),c=r;break;case"video":case"audio":for(c=0;cr.tailExpiration&&1n)&&Ul.set(e,n))}}function ql(e,n){e.expirationTime=(e=t>(e=e.nextKnownPendingLevel)?t:e)&&n!==e?0:e}function Yl(e){if(0!==e.lastExpiredTime)e.callbackExpirationTime=1073741823,e.callbackPriority=99,e.callbackNode=Ba(Gl.bind(null,e));else{var n=Kl(e),t=e.callbackNode;if(0===n)null!==t&&(e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90);else{var r=Ql();if(r=1073741823===n?99:1===n||2===n?95:0>=(r=10*(1073741821-n)-10*(1073741821-r))?99:250>=r?98:5250>=r?97:95,null!==t){var a=e.callbackPriority;if(e.callbackExpirationTime===n&&a>=r)return;t!==Oa&&wa(t)}e.callbackExpirationTime=n,e.callbackPriority=r,n=1073741823===n?Ba(Gl.bind(null,e)):Ha(r,Jl.bind(null,e),{timeout:10*(1073741821-n)-Aa()}),e.callbackNode=n}}}function Jl(e,n){if(Wl=0,n)return Ru(e,n=Ql()),Yl(e),null;var t=Kl(e);if(0!==t){if(n=e.callbackNode,0!=(48&wl))throw Error(i(327));if(du(),e===kl&&t===Sl||eu(e,t),null!==El){var r=wl;wl|=16;for(var a=tu();;)try{iu();break}catch(n){nu(e,n)}if(Ga(),wl=r,gl.current=a,1===Cl)throw n=Pl,eu(e,t),Lu(e,t),Yl(e),n;if(null===El)switch(a=e.finishedWork=e.current.alternate,e.finishedExpirationTime=t,r=Cl,kl=null,r){case vl:case 1:throw Error(i(345));case 2:Ru(e,2=t){e.lastPingedTime=t,eu(e,t);break}}if(0!==(o=Kl(e))&&o!==t)break;if(0!==r&&r!==t){e.lastPingedTime=r;break}e.timeoutHandle=bt(su.bind(null,e),a);break}su(e);break;case xl:if(Lu(e,t),t===(r=e.lastSuspendedTime)&&(e.nextKnownPendingLevel=cu(a)),Ll&&(0===(a=e.lastPingedTime)||a>=t)){e.lastPingedTime=t,eu(e,t);break}if(0!==(a=Kl(e))&&a!==t)break;if(0!==r&&r!==t){e.lastPingedTime=r;break}if(1073741823!==_l?r=10*(1073741821-_l)-Aa():1073741823===Tl?r=0:(r=10*(1073741821-Tl)-5e3,0>(r=(a=Aa())-r)&&(r=0),(t=10*(1073741821-t)-a)<(r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*ml(r/1960))-r)&&(r=t)),10=(r=0|l.busyMinDurationMs)?r=0:(a=0|l.busyDelayMs,r=(o=Aa()-(10*(1073741821-o)-(0|l.timeoutMs||5e3)))<=a?0:a+r-o),10 component higher in the tree to provide a loading indicator or placeholder to display."+be(i))}5!==Cl&&(Cl=2),l=Ji(l,i),p=o;do{switch(p.tag){case 3:u=l,p.effectTag|=4096,p.expirationTime=n,lo(p,fl(p,u,n));break e;case 1:u=l;var x=p.type,w=p.stateNode;if(0==(64&p.effectTag)&&("function"==typeof x.getDerivedStateFromError||null!==w&&"function"==typeof w.componentDidCatch&&(null===Fl||!Fl.has(w)))){p.effectTag|=4096,p.expirationTime=n,lo(p,dl(p,u,n));break e}}p=p.return}while(null!==p)}El=uu(El)}catch(e){n=e;continue}break}}function tu(){var e=gl.current;return gl.current=hi,null===e?hi:e}function ru(e,n){eOl&&(Ol=e)}function ou(){for(;null!==El;)El=lu(El)}function iu(){for(;null!==El&&!La();)El=lu(El)}function lu(e){var n=hl(e.alternate,e,Sl);return e.memoizedProps=e.pendingProps,null===n&&(n=uu(e)),bl.current=null,n}function uu(e){El=e;do{var n=El.alternate;if(e=El.return,0==(2048&El.effectTag)){if(n=Ki(n,El,Sl),1===Sl||1!==El.childExpirationTime){for(var t=0,r=El.child;null!==r;){var a=r.expirationTime,o=r.childExpirationTime;a>t&&(t=a),o>t&&(t=o),r=r.sibling}El.childExpirationTime=t}if(null!==n)return n;null!==e&&0==(2048&e.effectTag)&&(null===e.firstEffect&&(e.firstEffect=El.firstEffect),null!==El.lastEffect&&(null!==e.lastEffect&&(e.lastEffect.nextEffect=El.firstEffect),e.lastEffect=El.lastEffect),1(e=e.childExpirationTime)?n:e}function su(e){var n=Ma();return Ua(99,pu.bind(null,e,n)),null}function pu(e,n){do{du()}while(null!==Ml);if(0!=(48&wl))throw Error(i(327));var t=e.finishedWork,r=e.finishedExpirationTime;if(null===t)return null;if(e.finishedWork=null,e.finishedExpirationTime=0,t===e.current)throw Error(i(177));e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90,e.nextKnownPendingLevel=0;var a=cu(t);if(e.firstPendingTime=a,r<=e.lastSuspendedTime?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:r<=e.firstSuspendedTime&&(e.firstSuspendedTime=r-1),r<=e.lastPingedTime&&(e.lastPingedTime=0),r<=e.lastExpiredTime&&(e.lastExpiredTime=0),e===kl&&(El=kl=null,Sl=0),1u&&(s=u,u=l,l=s),s=st(x,l),p=st(x,u),s&&p&&(1!==k.rangeCount||k.anchorNode!==s.node||k.anchorOffset!==s.offset||k.focusNode!==p.node||k.focusOffset!==p.offset)&&((w=w.createRange()).setStart(s.node,s.offset),k.removeAllRanges(),l>u?(k.addRange(w),k.extend(p.node,p.offset)):(w.setEnd(p.node,p.offset),k.addRange(w))))),w=[];for(k=x;k=k.parentNode;)1===k.nodeType&&w.push({element:k,left:k.scrollLeft,top:k.scrollTop});for("function"==typeof x.focus&&x.focus(),x=0;x=t?Bi(e,n,t):(la(Io,1&Io.current),null!==(n=$i(e,n,t))?n.sibling:null);la(Io,1&Io.current);break;case 19:if(r=n.childExpirationTime>=t,0!=(64&e.effectTag)){if(r)return Vi(e,n,t);n.effectTag|=64}if(null!==(a=n.memoizedState)&&(a.rendering=null,a.tail=null),la(Io,Io.current),!r)return null}return $i(e,n,t)}_i=!1}}else _i=!1;switch(n.expirationTime=0,n.tag){case 2:if(r=n.type,null!==e&&(e.alternate=null,n.alternate=null,n.effectTag|=2),e=n.pendingProps,a=fa(n,ca.current),eo(n,t),a=$o(null,n,r,e,a,t),n.effectTag|=1,"object"==typeof a&&null!==a&&"function"==typeof a.render&&void 0===a.$$typeof){if(n.tag=1,n.memoizedState=null,n.updateQueue=null,da(r)){var o=!0;ba(n)}else o=!1;n.memoizedState=null!==a.state&&void 0!==a.state?a.state:null,ro(n);var l=r.getDerivedStateFromProps;"function"==typeof l&&fo(n,r,l,e),a.updater=ho,n.stateNode=a,a._reactInternalFiber=n,vo(n,r,e,t),n=Fi(null,n,r,!0,o,t)}else n.tag=0,Ni(null,n,a,t),n=n.child;return n;case 16:e:{if(a=n.elementType,null!==e&&(e.alternate=null,n.alternate=null,n.effectTag|=2),e=n.pendingProps,function(e){if(-1===e._status){e._status=0;var n=e._ctor;n=n(),e._result=n,n.then((function(n){0===e._status&&(n=n.default,e._status=1,e._result=n)}),(function(n){0===e._status&&(e._status=2,e._result=n)}))}}(a),1!==a._status)throw a._result;switch(a=a._result,n.type=a,o=n.tag=function(e){if("function"==typeof e)return Eu(e)?1:0;if(null!=e){if((e=e.$$typeof)===ue)return 11;if(e===pe)return 14}return 2}(a),e=$a(a,e),o){case 0:n=Ii(null,n,a,e,t);break e;case 1:n=zi(null,n,a,e,t);break e;case 11:n=Oi(null,n,a,e,t);break e;case 14:n=Li(null,n,a,$a(a.type,e),r,t);break e}throw Error(i(306,a,""))}return n;case 0:return r=n.type,a=n.pendingProps,Ii(e,n,r,a=n.elementType===r?a:$a(r,a),t);case 1:return r=n.type,a=n.pendingProps,zi(e,n,r,a=n.elementType===r?a:$a(r,a),t);case 3:if(Ai(n),r=n.updateQueue,null===e||null===r)throw Error(i(282));if(r=n.pendingProps,a=null!==(a=n.memoizedState)?a.element:null,ao(e,n),uo(n,r,null,t),(r=n.memoizedState.element)===a)Pi(),n=$i(e,n,t);else{if((a=n.stateNode.hydrate)&&(yi=yt(n.stateNode.containerInfo.firstChild),vi=n,a=xi=!0),a)for(t=So(n,null,r,t),n.child=t;t;)t.effectTag=-3&t.effectTag|1024,t=t.sibling;else Ni(e,n,r,t),Pi();n=n.child}return n;case 5:return jo(n),null===e&&Ei(n),r=n.type,a=n.pendingProps,o=null!==e?e.memoizedProps:null,l=a.children,gt(r,a)?l=null:null!==o&>(r,o)&&(n.effectTag|=16),Ri(e,n),4&n.mode&&1!==t&&a.hidden?(n.expirationTime=n.childExpirationTime=1,n=null):(Ni(e,n,l,t),n=n.child),n;case 6:return null===e&&Ei(n),null;case 13:return Bi(e,n,t);case 4:return Oo(n,n.stateNode.containerInfo),r=n.pendingProps,null===e?n.child=Eo(n,null,r,t):Ni(e,n,r,t),n.child;case 11:return r=n.type,a=n.pendingProps,Oi(e,n,r,a=n.elementType===r?a:$a(r,a),t);case 7:return Ni(e,n,n.pendingProps,t),n.child;case 8:case 12:return Ni(e,n,n.pendingProps.children,t),n.child;case 10:e:{r=n.type._context,a=n.pendingProps,l=n.memoizedProps,o=a.value;var u=n.type._context;if(la(qa,u._currentValue),u._currentValue=o,null!==l)if(u=l.value,0==(o=zr(u,o)?0:0|("function"==typeof r._calculateChangedBits?r._calculateChangedBits(u,o):1073741823))){if(l.children===a.children&&!sa.current){n=$i(e,n,t);break e}}else for(null!==(u=n.child)&&(u.return=n);null!==u;){var c=u.dependencies;if(null!==c){l=u.child;for(var s=c.firstContext;null!==s;){if(s.context===r&&0!=(s.observedBits&o)){1===u.tag&&((s=oo(t,null)).tag=2,io(u,s)),u.expirationTime=n&&e<=n}function Lu(e,n){var t=e.firstSuspendedTime,r=e.lastSuspendedTime;tn||0===t)&&(e.lastSuspendedTime=n),n<=e.lastPingedTime&&(e.lastPingedTime=0),n<=e.lastExpiredTime&&(e.lastExpiredTime=0)}function ju(e,n){n>e.firstPendingTime&&(e.firstPendingTime=n);var t=e.firstSuspendedTime;0!==t&&(n>=t?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:n>=e.lastSuspendedTime&&(e.lastSuspendedTime=n+1),n>e.nextKnownPendingLevel&&(e.nextKnownPendingLevel=n))}function Ru(e,n){var t=e.lastExpiredTime;(0===t||t>n)&&(e.lastExpiredTime=n)}function Iu(e,n,t,r){var a=n.current,o=Ql(),l=so.suspense;o=Vl(o,a,l);e:if(t){n:{if(Ge(t=t._reactInternalFiber)!==t||1!==t.tag)throw Error(i(170));var u=t;do{switch(u.tag){case 3:u=u.stateNode.context;break n;case 1:if(da(u.type)){u=u.stateNode.__reactInternalMemoizedMergedChildContext;break n}}u=u.return}while(null!==u);throw Error(i(171))}if(1===t.tag){var c=t.type;if(da(c)){t=ga(t,c,u);break e}}t=u}else t=ua;return null===n.context?n.context=t:n.pendingContext=t,(n=oo(o,l)).payload={element:e},null!==(r=void 0===r?null:r)&&(n.callback=r),io(a,n),$l(a,o),o}function zu(e){if(!(e=e.current).child)return null;switch(e.child.tag){case 5:default:return e.child.stateNode}}function Fu(e,n){null!==(e=e.memoizedState)&&null!==e.dehydrated&&e.retryTime=k},l=function(){},n.unstable_forceFrameRate=function(e){0>e||125>>1,a=e[r];if(!(void 0!==a&&0<_(a,n)))break e;e[r]=n,e[t]=a,t=r}}function P(e){return void 0===(e=e[0])?null:e}function T(e){var n=e[0];if(void 0!==n){var t=e.pop();if(t!==n){e[0]=t;e:for(var r=0,a=e.length;r_(i,t))void 0!==u&&0>_(u,i)?(e[r]=u,e[l]=t,r=l):(e[r]=i,e[o]=t,r=o);else{if(!(void 0!==u&&0>_(u,t)))break e;e[r]=u,e[l]=t,r=l}}}return n}return null}function _(e,n){var t=e.sortIndex-n.sortIndex;return 0!==t?t:e.id-n.id}var N=[],O=[],L=1,j=null,R=3,I=!1,z=!1,F=!1;function A(e){for(var n=P(O);null!==n;){if(null===n.callback)T(O);else{if(!(n.startTime<=e))break;T(O),n.sortIndex=n.expirationTime,C(N,n)}n=P(O)}}function M(e){if(F=!1,A(e),!z)if(null!==P(N))z=!0,r(D);else{var n=P(O);null!==n&&a(M,n.startTime-e)}}function D(e,t){z=!1,F&&(F=!1,o()),I=!0;var r=R;try{for(A(t),j=P(N);null!==j&&(!(j.expirationTime>t)||e&&!i());){var l=j.callback;if(null!==l){j.callback=null,R=j.priorityLevel;var u=l(j.expirationTime<=t);t=n.unstable_now(),"function"==typeof u?j.callback=u:j===P(N)&&T(N),A(t)}else T(N);j=P(N)}if(null!==j)var c=!0;else{var s=P(O);null!==s&&a(M,s.startTime-t),c=!1}return c}finally{j=null,R=r,I=!1}}function U(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var H=l;n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(e){e.callback=null},n.unstable_continueExecution=function(){z||I||(z=!0,r(D))},n.unstable_getCurrentPriorityLevel=function(){return R},n.unstable_getFirstCallbackNode=function(){return P(N)},n.unstable_next=function(e){switch(R){case 1:case 2:case 3:var n=3;break;default:n=R}var t=R;R=n;try{return e()}finally{R=t}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=H,n.unstable_runWithPriority=function(e,n){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var t=R;R=e;try{return n()}finally{R=t}},n.unstable_scheduleCallback=function(e,t,i){var l=n.unstable_now();if("object"==typeof i&&null!==i){var u=i.delay;u="number"==typeof u&&0l?(e.sortIndex=u,C(O,e),null===P(N)&&e===P(O)&&(F?o():F=!0,a(M,u-l))):(e.sortIndex=i,C(N,e),z||I||(z=!0,r(D))),e},n.unstable_shouldYield=function(){var e=n.unstable_now();A(e);var t=P(N);return t!==j&&null!==j&&null!==t&&null!==t.callback&&t.startTime<=e&&t.expirationTime=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var l=t.call(o,"catchLoc"),u=t.call(o,"finallyLoc");if(l&&u){if(this.prev=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&t.call(a,"finallyLoc")&&this.prev=0;--n){var t=this.tryEntries[n];if(t.finallyLoc===e)return this.complete(t.completion,t.afterLoc),k(t),s}},catch:function(e){for(var n=this.tryEntries.length-1;n>=0;--n){var t=this.tryEntries[n];if(t.tryLoc===e){var r=t.completion;if("throw"===r.type){var a=r.arg;k(t)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,t){return this.delegate={iterator:S(e),resultName:n,nextLoc:t},"next"===this.method&&(this.arg=void 0),s}},e}(e.exports);try{regeneratorRuntime=r}catch(e){Function("r","regeneratorRuntime = r")(r)}},function(e,n,t){},function(e,n){e.exports=function(e){var n=e.siteUrl;n=n.replace(/\/$/,""),Array.prototype.forEach.call(document.querySelectorAll("form[data-members-form]"),(function(e){var t=e.querySelector("[data-members-error]");e.addEventListener("submit",(function r(a){e.removeEventListener("submit",r),a.preventDefault(),t&&(t.innerText=""),e.classList.remove("success","invalid","error");for(var o=a.target.querySelector("input[data-members-email]"),i=a.target.querySelector("input[data-members-name]"),l=o.value,u=i&&i.value||void 0,c=void 0,s=[],p=a.target.querySelectorAll("input[data-members-label]")||[],f=0;fe.length)&&(n=e.length);for(var t=0,r=new Array(n);t=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:t}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,a,o=!0,i=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){i=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(i)throw a}}}}function p(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function f(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function d(e){for(var n=1;n=0||(a[t]=e[t]);return a}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}t(11);var m=t(1),g=t.n(m);function b(e,n,t,r,a,o,i){try{var l=e[o](i),u=l.value}catch(e){return void t(e)}l.done?n(u):Promise.resolve(u).then(r,a)}function v(e){return function(){var n=this,t=arguments;return new Promise((function(r,a){var o=e.apply(n,t);function i(e){b(o,r,a,i,l,"next",e)}function l(e){b(o,r,a,i,l,"throw",e)}i(void 0)}))}}function y(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function x(e,n){for(var t=0;t"},s,{ref:function(n){return e.node=n},title:l,style:c,frameBorder:"0"}),this.iframeHead&&Object(o.createPortal)(r,this.iframeHead),this.iframeRoot&&Object(o.createPortal)(t,this.iframeRoot))}}]),t}(r.Component);function O(){return(O=Object.assign||function(e){for(var n=1;n=0||(a[t]=e[t]);return a}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}(e,["svgRef","title"]);return a.a.createElement("svg",O({id:"Regular",viewBox:"0 0 24 24",ref:n},r),t?a.a.createElement("title",null,t):null,L,j,R,I)},F=a.a.forwardRef((function(e,n){return a.a.createElement(z,O({svgRef:n},e))}));t.p;var A=function(e){var n=e.gravatar,t=function(e){var n=e.style,t=void 0===n?{}:n;return{avatarContainer:d({},t.avatarContainer||{}),gravatar:d({},t.avatarContainer||{}),userIcon:d({width:"34px",height:"34px",color:"#fff"},t.userIcon||{})}}({style:e.style});return a.a.createElement("figure",{className:"gh-portal-avatar",style:t.avatarContainer},a.a.createElement(F,{style:t.userIcon}),n?a.a.createElement("img",{style:t.gravatar,src:n,alt:""}):null)},M=t(0).createContext({site:{},member:{},action:"",brandColor:"",onAction:function(){}});function D(){return(D=Object.assign||function(e){for(var n=1;n=0||(a[t]=e[t]);return a}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}(e,["svgRef","title"]);return a.a.createElement("svg",D({width:21,height:24,viewBox:"0 0 21 24",fill:"none",ref:n},r),t?a.a.createElement("title",null,t):null,U)},B=a.a.forwardRef((function(e,n){return a.a.createElement(H,D({svgRef:n},e))}));function W(){return(W=Object.assign||function(e){for(var n=1;n=0||(a[t]=e[t]);return a}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}(e,["svgRef","title"]);return a.a.createElement("svg",W({width:24,height:24,viewBox:"0 0 24 24",ref:n},r),t?a.a.createElement("title",null,t):null,Q)},$=a.a.forwardRef((function(e,n){return a.a.createElement(V,W({svgRef:n},e))}));function q(){return(q=Object.assign||function(e){for(var n=1;n=0||(a[t]=e[t]);return a}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}(e,["svgRef","title"]);return a.a.createElement("svg",q({width:25,height:24,viewBox:"0 0 25 24",fill:"none",ref:n},r),t?a.a.createElement("title",null,t):null,K,Y)},G=a.a.forwardRef((function(e,n){return a.a.createElement(J,q({svgRef:n},e))}));function X(){return(X=Object.assign||function(e){for(var n=1;n=0||(a[t]=e[t]);return a}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}(e,["svgRef","title"]);return a.a.createElement("svg",X({width:24,height:18,viewBox:"0 0 24 18",fill:"none",ref:n},r),t?a.a.createElement("title",null,t):null,Z,ee)},te=a.a.forwardRef((function(e,n){return a.a.createElement(ne,X({svgRef:n},e))}));function re(){return(re=Object.assign||function(e){for(var n=1;n=0||(a[t]=e[t]);return a}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}(e,["svgRef","title"]);return a.a.createElement("svg",re({width:26,height:26,viewBox:"0 0 26 26",fill:"none",ref:n},r),t?a.a.createElement("title",null,t):null,ae,oe)},le=a.a.forwardRef((function(e,n){return a.a.createElement(ie,re({svgRef:n},e))})),ue=(t.p,t(0)),ce={"icon-1":B,"icon-2":$,"icon-3":G,"icon-4":te,"icon-5":le},se=function(e){e.brandColor;var n=d({},e.hasText?{}:{width:"105px"});return{frame:d({zIndex:"3999998",position:"fixed",bottom:"0",right:"0",width:"500px",maxWidth:"500px",height:"98px",animation:"250ms ease 0s 1 normal none running animation-bhegco",transition:"opacity 0.3s ease 0s",overflow:"hidden",opacity:1},n),userIcon:{width:"34px",height:"34px",color:"#fff"},buttonIcon:{width:"24px",height:"24px",color:"#fff"},closeIcon:{width:"20px",height:"20px",color:"#fff"}}},pe=function(e){E(t,e);var n=_(t);function t(e){var r;return y(this,t),(r=n.call(this,e)).state={},r.container=ue.createRef(),r.height=null,r.width=null,r}return w(t,[{key:"updateHeight",value:function(e){this.props.updateHeight&&this.props.updateHeight(e)}},{key:"updateWidth",value:function(e){this.props.updateWidth&&this.props.updateWidth(e)}},{key:"componentDidMount",value:function(){this.container&&(this.height=this.container.current&&this.container.current.offsetHeight,this.width=this.container.current&&this.container.current.offsetWidth,this.updateHeight(this.height),this.updateWidth(this.width))}},{key:"componentDidUpdate",value:function(){if(this.container){var e=this.container.current&&this.container.current.offsetHeight,n=this.container.current&&this.container.current.offsetWidth;e!==this.height&&(this.height=e,this.updateHeight(this.height)),n!==this.width&&(this.width=n,this.updateWidth(this.width))}}},{key:"renderTriggerIcon",value:function(){var e=this.context.site||{},n=e.portal_button_icon,t=void 0===n?"":n,r=e.portal_button_style,a=void 0===r?"":r,o=se({brandColor:this.context.brandColor}),i=this.context.member&&this.context.member.avatar_image;if(!a.includes("icon"))return null;if(i)return ue.createElement(A,{gravatar:i});if(this.context.member)return ue.createElement(F,{style:o.userIcon});if(Object.keys(ce).includes(t)){var l=ce[t];return ue.createElement(l,{style:o.buttonIcon})}return t?ue.createElement("img",{style:{width:"26px",height:"26px"},src:t,alt:""}):(this.hasText()&&(o.userIcon.width="26px",o.userIcon.height="26px"),ue.createElement(F,{style:o.userIcon}))}},{key:"hasText",value:function(){var e=this.context.site,n=e.portal_button_signup_text,t=e.portal_button_style;return["icon-and-text","text-only"].includes(t)&&!this.context.member&&n}},{key:"renderText",value:function(){var e=this.context.site.portal_button_signup_text;return this.hasText()?ue.createElement("span",{className:"gh-portal-triggerbtn-label"}," ",e," "):null}},{key:"onToggle",value:function(){var e=this.context,n=e.showPopup,t=e.member;if(n)this.context.onAction("closePopup");else{var r=t?"accountHome":"signup";this.context.onAction("openPopup",{page:r})}}},{key:"render",value:function(){var e=this,n=this.hasText(),t=this.context.member?"halo":"";return n?ue.createElement("div",{className:"gh-portal-triggerbtn-wrapper",ref:this.container},ue.createElement("div",{className:"gh-portal-triggerbtn-container with-label",onClick:function(n){return e.onToggle(n)}},this.renderTriggerIcon(),n?this.renderText():"")):ue.createElement("div",{className:"gh-portal-triggerbtn-wrapper"},ue.createElement("div",{className:"gh-portal-triggerbtn-container "+t,onClick:function(n){return e.onToggle(n)}},this.renderTriggerIcon()))}}]),t}(ue.Component);pe.contextType=M;var fe=function(e){E(t,e);var n=_(t);function t(e){var r;return y(this,t),(r=n.call(this,e)).state={width:null},r}return w(t,[{key:"onWidthChange",value:function(e){this.setState({width:e})}},{key:"hasText",value:function(){var e=this.context.site,n=e.portal_button_signup_text,t=e.portal_button_style;return["icon-and-text","text-only"].includes(t)&&!this.context.member&&n}},{key:"renderFrameStyles",value:function(){var e="\n :root {\n --brandcolor: ".concat(this.context.brandColor,"\n }\n ")+'\n /* Colors\n /* ----------------------------------------------------- */\n :root {\n --black: #000;\n --grey0: #1d1d1d;\n --grey1: #333;\n --grey2: #3d3d3d;\n --grey3: #474747;\n --grey4: #515151;\n --grey5: #686868;\n --grey6: #7f7f7f;\n --grey7: #979797;\n --grey8: #aeaeae;\n --grey9: #c5c5c5;\n --grey10: #dcdcdc;\n --grey11: #e1e1e1;\n --grey12: #eaeaea;\n --grey13: #f9f9f9;\n --white: #fff;\n --red: #f02525;\n --yellow: #FFDC15;\n --green: #7FC724;\n }\n\n /* Globals\n /* ----------------------------------------------------- */\n html {\n font-size: 62.5%;\n height: 100%;\n }\n\n body {\n margin: 0px;\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;\n font-size: 1.6rem;\n height: 100%;\n line-height: 1.6em;\n font-weight: 400;\n font-style: normal;\n color: var(--grey4);\n box-sizing: border-box;\n }\n\n button,\n button span {\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;\n }\n\n *, ::after, ::before {\n box-sizing: border-box;\n }\n\n h1, h2, h3, h4, h5, h6, p {\n line-height: 1.15em;\n padding: 0;\n margin: 0;\n }\n\n h1 {\n font-size: 31px;\n font-weight: 500;\n letter-spacing: 0.2px;\n }\n\n h2 {\n font-size: 23px;\n font-weight: 500;\n letter-spacing: 0.2px;\n }\n\n h3 {\n font-size: 20px;\n font-weight: 500;\n letter-spacing: 0.2px;\n }\n\n p {\n font-size: 15px;\n line-height: 1.55em;\n margin-bottom: 24px;\n }\n\n strong {\n font-weight: 600;\n }\n\n a,\n .gh-portal-link {\n cursor: pointer;\n }\n\n svg {\n box-sizing: content-box;\n }\n\n input,\n textarea {\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;\n font-size: 1.5rem;\n }\n\n textarea {\n padding: 10px;\n line-height: 1.5em;\n }\n\n .gh-portal-triggerbtn-wrapper {\n display: inline-flex;\n align-items: flex-start;\n justify-content: flex-end;\n height: 100%;\n opacity: 1;\n transition: transform 0.16s linear 0s; opacity 0.08s linear 0s;\n user-select: none;\n line-height: 1;\n padding: 10px 28px 0 17px;\n }\n \n .gh-portal-triggerbtn-wrapper span {\n margin-bottom: 1px;\n }\n \n .gh-portal-triggerbtn-container {\n position: relative;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n background: var(--brandcolor);\n height: 60px;\n min-width: 60px;\n box-shadow: rgba(0, 0, 0, 0.24) 0px 8px 16px -2px;\n border-radius: 999px;\n transition: opacity 0.3s ease;\n }\n\n .gh-portal-triggerbtn-container:before {\n position: absolute;\n content: "";\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n border-radius: 999px;\n background: rgba(255, 255, 255, 0);\n transition: background 0.3s ease;\n }\n\n .gh-portal-triggerbtn-container:hover:before {\n background: rgba(255, 255, 255, 0.08);\n }\n\n .gh-portal-triggerbtn-container.halo:before {\n top: -4px;\n right: -4px;\n bottom: -4px;\n left: -4px;\n border: 4px solid rgba(255, 255, 255, 0.15);\n }\n\n .gh-portal-triggerbtn-container.with-label {\n padding: 0 12px 0 16px;\n }\n\n .gh-portal-triggerbtn-label {\n padding: 8px;\n color: rgb(255, 255, 255);\n display: block;\n white-space: nowrap;\n max-width: 380px;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .gh-portal-avatar {\n margin-bottom: 0px !important;\n width: 60px;\n height: 60px;\n }\n\n .gh-portal-avatar {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n margin: 0 0 8px 0;\n border-radius: 999px;\n }\n\n .gh-portal-avatar img {\n position: absolute;\n display: block;\n top: -2px;\n right: -2px;\n bottom: -2px;\n left: -2px;\n width: calc(100% + 4px);\n height: calc(100% + 4px);\n opacity: 1;\n max-width: unset;\n }\n';return ue.createElement("style",{dangerouslySetInnerHTML:{__html:e}})}},{key:"render",value:function(){var e=this,n=this.context.site.portal_button,t=this.context.showPopup;if(!n)return null;var r=this.hasText(),a=d({},se({brandColor:this.context.brandColor,hasText:r}).frame);if(this.state.width){var o=this.state.width+2;a.width="".concat(o,"px")}return ue.createElement(N,{className:"gh-portal-triggerbtn-iframe",style:a,title:"portal-trigger",head:this.renderFrameStyles()},ue.createElement(pe,{isPopupOpen:t,updateWidth:function(n){return e.onWidthChange(n)}}))}}]),t}(ue.Component);function de(){return(de=Object.assign||function(e){for(var n=1;n=0||(a[t]=e[t]);return a}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}(e,["svgRef","title"]);return a.a.createElement("svg",de({viewBox:"0 0 24 24",ref:n},r),t?a.a.createElement("title",null,t):null,he,me)},be=a.a.forwardRef((function(e,n){return a.a.createElement(ge,de({svgRef:n},e))}));function ve(){return(ve=Object.assign||function(e){for(var n=1;n=0||(a[t]=e[t]);return a}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}(e,["svgRef","title"]);return a.a.createElement("svg",ve({viewBox:"0 0 24 24",ref:n},r),t?a.a.createElement("title",null,t):null,ye,xe)},ke=a.a.forwardRef((function(e,n){return a.a.createElement(we,ve({svgRef:n},e))}));function Ee(){return(Ee=Object.assign||function(e){for(var n=1;n=0||(a[t]=e[t]);return a}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}(e,["svgRef","title"]);return a.a.createElement("svg",Ee({viewBox:"0 0 24 24",ref:n},r),t?a.a.createElement("title",null,t):null,Se,Ce)},Te=a.a.forwardRef((function(e,n){return a.a.createElement(Pe,Ee({svgRef:n},e))})),_e=(t.p,function(e){e.qsParams;var n=e.action,t=e.status;if(t&&["true","false"].includes(t)){var r=JSON.parse(t);return{type:n,status:r?"success":"error",duration:3e3,autoHide:!!r}}return{}}),Ne=function(e){var n=e.status,t=e.billingOnly;return!t&&["success"].includes(n)?{type:"stripe:checkout",status:["success"].includes(n)?"success":"warning",duration:3e3,autoHide:!0}:t&&["billing-update-success","billing-update-cancel"].includes(n)?{type:"stripe:billing-update",status:"billing-update-success"===n?"success":"warning",duration:3e3,autoHide:!0,closeable:!0}:void 0},Oe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=window.location.search||"",t=new URLSearchParams(n);e.forEach((function(e){t.delete(e)}));var r=t.toString()?"?".concat(t):"";window.history.replaceState({},"","".concat(window.location.pathname).concat(r))};function Le(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.billingOnly,t=void 0!==n&&n,r=window.location.search;if(!r)return null;var a=new URLSearchParams(r),o=a.get("action"),i=a.get("success"),l=a.get("stripe"),u=null;return l?Ne({qsParams:a,status:l,billingOnly:t}):o&&i&&!t?_e({qsParams:a,action:o,status:i}):u}var je=t(3),Re=t.n(je);function Ie(){var e=c(window.location.hash.substr(1).split("?"),1)[0];e&&/^\/portal\/?(?:\/(\w+(?:\/\w+)?))?\/?$/.test(e)&&window.history.pushState("",document.title,window.location.pathname+window.location.search)}function ze(e){var n=e.page,t=e.siteUrl||"".concat(window.location.protocol,"//").concat(window.location.host).concat(window.location.pathname),r=function(e){var n=e.page,t={default:"#/portal",signin:"#/portal/signin",signup:"#/portal/signup",account:"#/portal/account","account-plans":"#/portal/account/plans","account-profile":"#/portal/account/profile"};return Object.keys(t).includes(n)?t[n]:t.default}({page:n});return"".concat(t).concat(r)}function Fe(){return!(navigator&&navigator.cookieEnabled)}function Ae(e){var n=e.member,t=void 0===n?{}:n;return De({member:t})?(t.subscriptions||[]).find((function(e){return["active","trialing","unpaid","past_due"].includes(e.status)})):null}function Me(e){var n=e.member,t=Ae({member:void 0===n?{}:n});return!!t&&"Complimentary"===t.plan.nickname}function De(e){var n=e.member,t=void 0===n?{}:n;return t&&t.paid}function Ue(e){var n=e.subscription;return n&&n.plan?{type:n.plan.interval,price:n.plan.amount/100,currency:n.plan.currency_symbol,name:n.plan.nickname}:null}function He(e){return Ue({subscription:Ae({member:e.member})})}function Be(e){var n=e.site,t=Ve({site:void 0===n?{}:n});return!t||0===t.length||1===t.length&&"free"===t[0].type}function We(e){var n=e.site,t=void 0===n?{}:n,r=e.plan,a=Ve({site:t});return"free"===r?!a||0===a.length||a.find((function(e){return"free"===e.type})):"monthly"===r?a&&a.length>0&&a.find((function(e){return"month"===e.type})):"yearly"===r&&a&&a.length>0&&a.find((function(e){return"year"===e.type}))}function Qe(e){return"string"==typeof e&&e?e.charAt(0).toUpperCase()+e.slice(1):""}function Ve(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.site,t=void 0===n?{}:n,r=e.includeFree,a=void 0===r||r,o=e.pageQuery,i=t||{},l=i.plans,u=i.allow_self_signup,c=i.is_stripe_configured,s=i.portal_plans;if(!l)return[];var p=[],f=Re()(l.monthly,l.yearly),d=[{type:"month",price:l.monthly,currency_symbol:Ke(l.currency),name:"Monthly"},{type:"year",price:l.yearly,currency_symbol:Ke(l.currency),name:"Yearly",discount:f}];u&&s.includes("free")&&a&&p.push({type:"free",price:0,currency_symbol:Ke(l.currency),name:"Free"});var h="free"===o&&We({site:t,plan:"free"});return c&&!h&&d.forEach((function(e){s.includes(e.name.toLowerCase())&&p.push(e)})),p}var $e=function(e){var n=e.member;return n?n.email:""},qe=function(e){var n=e.member;return n?n.name:""},Ke=function(e){return Intl.NumberFormat("en",{currency:e,style:"currency"}).format(0).replace(/[\d\s.]/g,"")},Ye=function(e){return null==e?"":e.toLocaleString()},Je=function(e){var n=e.type,t=e.status,r=e.autoHide,a=e.duration,o=e.closeable,i=e.state,l=e.message,u=e.meta,c=void 0===u?{}:u,s=0;return i&&i.popupNotification&&(s=(i.popupNotification.count||0)+1),{type:n,status:t,autoHide:r,closeable:o,duration:a,meta:c,message:l,count:s}},Ge=t(0),Xe=function(e){var n=e.type,t=e.status,r=e.context,a=ze({page:"signin",siteUrl:r.site.url}),o=ze({page:"signup",siteUrl:r.site.url});if("signin"===n&&"success"===t&&r.member){var i=r.member.firstname||"";return Ge.createElement("p",null,"Welcome back",i?", "+i:"","!",Ge.createElement("br",null),"You've successfully signed in.")}return"signin"===n&&"error"===t?Ge.createElement("p",null,"Could not sign in. Login link expired. ",Ge.createElement("a",{href:a,target:"_parent"},"Click here to retry")):"signup"===n&&"success"===t?Ge.createElement("p",null,"You've successfully subscribed to ",Ge.createElement("br",null),Ge.createElement("strong",null,r.site.title)):"updateEmail"===n&&"success"===t?Ge.createElement("p",null,"Success! Your email is updated."):"updateEmail"===n&&"error"===t?Ge.createElement("p",null,"Could not update email! Invalid link."):"signup"===n&&"error"===t?Ge.createElement("p",null,"Signup error: Invalid link ",Ge.createElement("br",null),Ge.createElement("a",{href:o,target:"_parent"},"Click here to retry")):"stripe:checkout"===n&&"success"===t?r.member?Ge.createElement("p",null,"Success! Your account is fully activated, you now have access to all content."):Ge.createElement("p",null,"Success! Check your email for magic link to sign-in."):"stripe:checkout"===n&&"warning"===t?r.member?Ge.createElement("p",null,"Plan upgrade was cancelled."):Ge.createElement("p",null,"Plan checkout was cancelled."):Ge.createElement("p",null,"success"===t?"Success":"Error")},Ze=function(e){E(t,e);var n=_(t);function t(){var e;return y(this,t),(e=n.call(this)).state={className:""},e}return w(t,[{key:"componentWillUnmount",value:function(){clearTimeout(this.timeoutId)}},{key:"onNotificationClose",value:function(){this.props.onHideNotification()}},{key:"componentDidUpdate",value:function(){var e=this.context.showPopup;!this.state.className&&e&&this.setState({className:"slideout"})}},{key:"componentDidMount",value:function(){var e=this,n=this.props,t=n.autoHide,r=n.duration,a=void 0===r?2400:r;this.context.showPopup?this.setState({className:"slideout"}):t&&(this.timeoutId=setTimeout((function(){e.setState({className:"slideout"})}),a))}},{key:"onAnimationEnd",value:function(e){"notification-slideout"!==e.animationName&&"notification-slideout-mobile"!==e.animationName||this.props.onHideNotification(e)}},{key:"render",value:function(){var e=this,n=this.props,t=n.type,r=n.status,a=this.state.className,o=void 0===a?"":a,i=r?" ".concat(r):" neutral",l=o?" ".concat(o):"";return Ge.createElement("div",{className:"gh-portal-notification-wrapper"},Ge.createElement("div",{className:"gh-portal-notification".concat(i).concat(l),onAnimationEnd:function(n){return e.onAnimationEnd(n)}},"error"===r?Ge.createElement(Te,{className:"gh-portal-notification-icon error",alt:""}):Ge.createElement(ke,{className:"gh-portal-notification-icon success",alt:""}),Ge.createElement(Xe,{type:t,status:r,context:this.context}),Ge.createElement(be,{className:"gh-portal-notification-closeicon",alt:"Close",onClick:function(n){return e.onNotificationClose(n)}})))}}]),t}(Ge.Component);Ze.contextType=M;var en=function(e){E(t,e);var n=_(t);function t(){var e;y(this,t),e=n.call(this);var r=Le()||{},a=r.type,o=r.status,i=r.autoHide,l=r.duration;return e.state={active:!0,type:a,status:o,autoHide:i,duration:l,className:""},e}return w(t,[{key:"onHideNotification",value:function(){var e=this.state.type,n=[];["signin","signup"].includes(e)?n.push("action","success"):["stripe:checkout"].includes(e)&&n.push("stripe"),Oe(n),this.context.onAction("refreshMemberData"),this.setState({active:!1})}},{key:"renderFrameStyles",value:function(){var e="\n :root {\n --brandcolor: ".concat(this.context.brandColor,"\n }\n ")+'\n /* Colors\n /* ----------------------------------------------------- */\n :root {\n --black: #000;\n --grey0: #1d1d1d;\n --grey1: #333;\n --grey2: #3d3d3d;\n --grey3: #474747;\n --grey4: #515151;\n --grey5: #686868;\n --grey6: #7f7f7f;\n --grey7: #979797;\n --grey8: #aeaeae;\n --grey9: #c5c5c5;\n --grey10: #dcdcdc;\n --grey11: #e1e1e1;\n --grey12: #eaeaea;\n --grey13: #f9f9f9;\n --white: #fff;\n --red: #f02525;\n --yellow: #FFDC15;\n --green: #7FC724;\n }\n\n /* Globals\n /* ----------------------------------------------------- */\n html {\n font-size: 62.5%;\n height: 100%;\n }\n\n body {\n margin: 0px;\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;\n font-size: 1.6rem;\n height: 100%;\n line-height: 1.6em;\n font-weight: 400;\n font-style: normal;\n color: var(--grey4);\n box-sizing: border-box;\n }\n\n button,\n button span {\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;\n }\n\n *, ::after, ::before {\n box-sizing: border-box;\n }\n\n h1, h2, h3, h4, h5, h6, p {\n line-height: 1.15em;\n padding: 0;\n margin: 0;\n }\n\n h1 {\n font-size: 31px;\n font-weight: 500;\n letter-spacing: 0.2px;\n }\n\n h2 {\n font-size: 23px;\n font-weight: 500;\n letter-spacing: 0.2px;\n }\n\n h3 {\n font-size: 20px;\n font-weight: 500;\n letter-spacing: 0.2px;\n }\n\n p {\n font-size: 15px;\n line-height: 1.55em;\n margin-bottom: 24px;\n }\n\n strong {\n font-weight: 600;\n }\n\n a,\n .gh-portal-link {\n cursor: pointer;\n }\n\n svg {\n box-sizing: content-box;\n }\n\n input,\n textarea {\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;\n font-size: 1.5rem;\n }\n\n textarea {\n padding: 10px;\n line-height: 1.5em;\n }\n\n .gh-portal-notification-wrapper {\n position: relative;\n overflow: hidden;\n height: 100%;\n width: 100%;\n }\n\n .gh-portal-notification {\n position: absolute;\n display: flex;\n align-items: center;\n top: 12px;\n right: 12px;\n width: 100%;\n padding: 14px 44px 18px 20px;\n max-width: 380px;\n min-height: 66px;\n font-size: 1.3rem;\n letter-spacing: 0.2px;\n background: rgba(33,33,33,0.95);\n backdrop-filter: blur(8px);\n color: var(--white);\n border-radius: 5px;\n box-shadow: 0 3.2px 3.6px rgba(0, 0, 0, 0.024), 0 8.8px 10px -5px rgba(0, 0, 0, 0.08);\n animation: notification-slidein 0.55s cubic-bezier(0.215, 0.610, 0.355, 1.000);\n }\n\n .gh-portal-notification.slideout {\n animation: notification-slideout 0.4s cubic-bezier(0.550, 0.055, 0.675, 0.190);\n }\n\n .gh-portal-notification.hide {\n display: none;\n }\n\n .gh-portal-notification p {\n flex-grow: 1;\n font-size: 1.4rem;\n line-height: 1.5em;\n text-align: left;\n margin: 0;\n padding: 0 0 0 40px;\n color: var(--grey13);\n }\n\n .gh-portal-notification p strong {\n color: var(--white);\n }\n\n .gh-portal-notification a {\n color: var(--white);\n text-decoration: underline;\n transition: all 0.2s ease-in-out;\n outline: none;\n }\n\n .gh-portal-notification a:hover {\n opacity: 0.8;\n }\n\n .gh-portal-notification-icon {\n position: absolute;\n top: calc(50% - 14px);\n left: 17px;\n width: 28px;\n height: 28px;\n }\n\n .gh-portal-notification-icon.success {\n color: var(--green);\n }\n\n .gh-portal-notification-icon.error {\n color: #FF2828;\n }\n\n .gh-portal-notification-closeicon {\n position: absolute;\n top: 5px;\n bottom: 0;\n right: 5px;\n color: var(--white);\n cursor: pointer;\n width: 12px;\n height: 12px;\n padding: 10px;\n transition: all 0.2s ease-in-out forwards;\n opacity: 0.8;\n }\n\n .gh-portal-notification-closeicon:hover {\n opacity: 1.0;\n } \n\n @keyframes notification-slidein {\n 0% { transform: translateX(380px); }\n 60% { transform: translateX(-6px); }\n 100% { transform: translateX(0); }\n }\n\n @keyframes notification-slideout {\n 0% { transform: translateX(0); }\n 30% { transform: translateX(-10px); }\n 100% { transform: translateX(380px); }\n }\n\n @keyframes notification-slidein-mobile {\n 0% { transform: translateY(-150px); }\n 50% { transform: translateY(6px); }\n 100% { transform: translateY(0); }\n }\n\n @keyframes notification-slideout-mobile {\n 0% { transform: translateY(0); }\n 35% { transform: translateY(6px); }\n 100% { transform: translateY(-150px); }\n }\n\n @media (max-width: 414px) {\n .gh-portal-notification {\n left: 12px;\n max-width: calc(100% - 24px);\n animation-name: notification-slidein-mobile;\n }\n\n .gh-portal-notification.slideout {\n animation-duration: 0.55s;\n animation-name: notification-slideout-mobile;\n }\n }\n';return Ge.createElement("style",{dangerouslySetInnerHTML:{__html:e}})}},{key:"render",value:function(){var e=this,n=d({},(this.context.brandColor,{frame:{zIndex:"4000000",position:"fixed",top:"0",right:"0",maxWidth:"415px",width:"100%",height:"120px",animation:"250ms ease 0s 1 normal none running animation-bhegco",transition:"opacity 0.3s ease 0s",overflow:"hidden"}}).frame);if(!this.state.active)return null;var t=this.state,r=t.type,a=t.status,o=t.autoHide,i=t.duration;return r&&a?Ge.createElement(N,{style:n,title:"portal-notification",head:this.renderFrameStyles(),className:"gh-portal-notification-iframe"},Ge.createElement(Ze,Object.assign({type:r,status:a,autoHide:o,duration:i},{onHideNotification:function(n){return e.onHideNotification(n)}}))):null}}]),t}(Ge.Component);en.contextType=M;var nn={preview:function(){var e=c(window.location.hash.substr(1).split("?"),2),n=e[0],t=e[1];return"/portal/preview"===n||"/portal"===n&&t},dev:function(){return!1},test:function(){return!1}},tn=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.some((function(e){var n=nn[e];return!(!n||!n())}))};function rn(){return(rn=Object.assign||function(e){for(var n=1;n=0||(a[t]=e[t]);return a}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}(e,["svgRef","title"]);return a.a.createElement("svg",rn({id:"loader-1",x:"0px",y:"0px",width:"40px",height:"40px",viewBox:"0 0 40 40",enableBackground:"new 0 0 40 40",xmlSpace:"preserve",ref:n},r),t?a.a.createElement("title",null,t):null,an,on)},un=a.a.forwardRef((function(e,n){return a.a.createElement(ln,rn({svgRef:n},e))}));t.p;var cn=function(e){var n=e.label,t=(e.type,e.onClick),r=e.disabled,o=e.retry,i=e.brandColor,l=e.isRunning,u=e.isPrimary,c=void 0===u||u,s=e.isDestructive,p=void 0!==s&&s,f=e.style,h=e.tabindex,m=function(e){var n=e.style,t=void 0===n?{}:n,r=e.isPrimary,a=e.brandColor||"#3eb0ef",o="1.0",i="auto";return e.disabled&&(o="0.5",i="none"),{button:d(d(d({},r?{color:"#fff"}:{}),r?{backgroundColor:a}:{}),{},{opacity:o,pointerEvents:i},t||{})}}({disabled:r,retry:o,brandColor:i,style:f,isPrimary:c}),g="gh-portal-btn";c&&(g+=" gh-portal-btn-main gh-portal-btn-primary"),p&&(g+=" gh-portal-btn-destructive"),Fe()&&(r=!0);var b=c?"gh-portal-loadingicon":"gh-portal-loadingicon dark";return a.a.createElement("button",{className:g,style:m.button,onClick:function(e){return t(e)},disabled:r,type:"submit",tabIndex:h},l?a.a.createElement(un,{className:b}):n)};function sn(){return(sn=Object.assign||function(e){for(var n=1;n=0||(a[t]=e[t]);return a}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}(e,["svgRef","title"]);return a.a.createElement("svg",sn({id:"Regular",viewBox:"0 0 24 24",ref:n},r),t?a.a.createElement("title",null,t):null,pn,fn)},hn=a.a.forwardRef((function(e,n){return a.a.createElement(dn,sn({svgRef:n},e))}));t.p;var mn=function(e){var n=e.label,t=void 0===n?"Back":n,r=(e.brandColor,e.hidden),o=void 0!==r&&r,i=e.onClick;return o?null:a.a.createElement("button",{className:"gh-portal-btn gh-portal-btn-back",onClick:function(e){return i(e)}},a.a.createElement(hn,null)," ",t)},gn=function(e){var n=e.id,t=e.label,o=e.onToggle,i=e.checked,l=void 0!==i&&i,u=Object(r.useContext)(M).action,s=c(Object(r.useState)(l),2),p=s[0],f=s[1],d=["updateNewsletter:failed","updateNewsletter:success"].includes(u);return Object(r.useEffect)((function(){f(l)}),[l,d]),a.a.createElement("div",{className:"gh-portal-for-switch"},a.a.createElement("label",{className:"switch",htmlFor:n},a.a.createElement("input",{type:"checkbox",checked:p,id:n,onChange:function(){},"aria-label":t}),a.a.createElement("span",{className:"input-toggle-component",onClick:function(e){f(!p),o(e)},"data-testid":"switch-input"})))},bn=function(e){E(t,e);var n=_(t);function t(){return y(this,t),n.apply(this,arguments)}return w(t,[{key:"render",value:function(){var e=this;return a.a.createElement("div",{className:"gh-portal-closeicon-container"},a.a.createElement(be,{className:"gh-portal-closeicon",alt:"Close",onClick:function(){return e.context.onAction("closePopup")}}))}}]),t}(a.a.Component);bn.contextType=M;var vn=function(e){var n=new Date(e),t=n.toDateString().substring(4,7),r=n.toDateString().substring(8,10).replace(/^0+/g,""),a=n.toDateString().substring(11,15);return"".concat(r," ").concat(t," ").concat(a)},yn=t(0),xn=function(e){var n=e.avatar,t=e.brandColor;return yn.createElement(yn.Fragment,null,yn.createElement(A,{gravatar:n,style:{userIcon:{color:t,width:"56px",height:"56px",padding:"2px"}}}))},wn=function(e){e.onClose;var n=e.handleSignout,t=e.supportAddress,r="mailto:".concat(void 0===t?"":t);return yn.createElement("footer",{className:"gh-portal-account-footer"},yn.createElement("ul",{className:"gh-portal-account-footermenu"},yn.createElement("li",null,yn.createElement("button",{className:"gh-portal-btn",name:"logout","aria-label":"logout",onClick:function(e){return n(e)}},"Sign out"))),yn.createElement("div",{className:"gh-portal-account-footerright"},yn.createElement("ul",{className:"gh-portal-account-footermenu"},yn.createElement("li",null,yn.createElement("a",{className:"gh-portal-btn gh-portal-btn-branded",href:r,onClick:function(){r&&window.open(r)}},"Contact support")))))},kn=function(e){var n=e.member,t=e.brandColor,r=n.avatar_image;return yn.createElement("header",{className:"gh-portal-account-header"},yn.createElement(xn,{avatar:r,brandColor:t}),yn.createElement("h2",{className:"gh-portal-main-title"},"Your account"))},En=function(e){var n=e.member,t=e.site,a=e.openUpdatePlan,o=e.onEditBilling,i=function(e){var n=e.defaultCardLast4;if(n){var t="**** **** **** ".concat(n);return yn.createElement("p",null,t)}return null},l=Ae({member:n});if(l){var u=Me({member:n}),c=l.plan,s=l.default_payment_card_last4;return yn.createElement(yn.Fragment,null,yn.createElement("section",null,yn.createElement("div",{className:"gh-portal-list-detail"},yn.createElement("h3",null,"Plan"),yn.createElement((function(e){var n=e.plan,t=e.isComplimentary,r=n.amount,a=void 0===r?0:r,o=n.currency,i=n.interval,l="".concat(Intl.NumberFormat("en",{currency:o,style:"currency"}).format(a/100),"/").concat(i);return t&&(l="Complimentary (".concat(l,")")),yn.createElement("p",null,l)}),{plan:c,isComplimentary:u})),yn.createElement((function(e){return e.isComplimentary||Be({site:t})?null:yn.createElement("button",{className:"gh-portal-btn gh-portal-btn-list",onClick:function(e){return a(e)}},"Change")}),{isComplimentary:u})),yn.createElement((function(e){var n=e.defaultCardLast4,t=e.isComplimentary,a="editBilling:running"===Object(r.useContext)(M).action?yn.createElement(un,{className:"gh-portal-billing-button-loader"}):"Update";return t?null:yn.createElement("section",null,yn.createElement("div",{className:"gh-portal-list-detail"},yn.createElement("h3",null,"Billing info"),yn.createElement(i,{defaultCardLast4:n})),yn.createElement("button",{className:"gh-portal-btn gh-portal-btn-list",onClick:function(e){return o(e)}},a))}),{isComplimentary:u,defaultCardLast4:s}))}return null},Sn=function(e){var n=e.member,t=e.site,r=(e.action,e.openEditProfile),a=e.openUpdatePlan,o=e.onEditBilling,i=e.onToggleSubscription,l=n.name,u=n.email,c=n.subscribed,s=c?"Subscribed":"Unsubscribed";return yn.createElement("div",{className:"gh-portal-list"},yn.createElement("section",null,yn.createElement("div",{className:"gh-portal-list-detail"},yn.createElement("h3",null,l||"Account"),yn.createElement("p",null,u)),yn.createElement("button",{className:"gh-portal-btn gh-portal-btn-list",onClick:function(e){return r(e)}},"Edit")),yn.createElement(En,{site:t,member:n,onEditBilling:o,openUpdatePlan:a}),yn.createElement("section",null,yn.createElement("div",{className:"gh-portal-list-detail"},yn.createElement("h3",null,"Email newsletter"),yn.createElement("p",null,s)),yn.createElement("div",null,yn.createElement(gn,{onToggle:function(e){i(e,c)},checked:c}))))},Cn=function(e){var n=e.site,t=e.action,r=e.openSubscribe,a=e.brandColor;if(!n.is_stripe_configured||Be({site:n}))return null;var o=["checkoutPlan:running"].includes(t);return yn.createElement(cn,{isRunning:o,label:"View plans",onClick:function(){return r()},brandColor:a,style:{width:"100%"}})},Pn=function(e){var n=e.member,t=e.action,r=e.site,a=e.openSubscribe,o=e.brandColor;if(!r.is_stripe_configured)return null;if(n.paid){var i=Ae({member:n}),l=i.current_period_end;return i.cancel_at_period_end?null:yn.createElement("div",{className:"gh-portal-section"},yn.createElement("p",{className:"gh-portal-text-center gh-portal-free-ctatext"},"Your subscription will renew on ",vn(l)))}return yn.createElement("div",{className:"gh-portal-section"},yn.createElement("p",{className:"gh-portal-text-center gh-portal-free-ctatext"},"You currently have a free membership, upgrade to a paid subscription for full access."),yn.createElement(Cn,{action:t,site:r,openSubscribe:a,brandColor:o}))},Tn=function(e){var n=e.member,t=e.onAction,r=e.action,a=e.brandColor,o=e.showOnlyContinue,i=void 0!==o&&o;if(!n.paid)return null;var l=Ae({member:n});if(!l)return null;if(i&&!l.cancel_at_period_end)return null;var u=l.cancel_at_period_end?"Continue subscription":"Cancel subscription",c=["cancelSubscription:running"].includes(r),s=!!c,p=!!l.cancel_at_period_end;return yn.createElement("div",{className:"gh-portal-cancelcontinue-container"},yn.createElement((function(){if(!l.cancel_at_period_end)return null;var e=l.current_period_end;return yn.createElement("p",{className:"gh-portal-text-center gh-portal-free-ctatext"},"Your subscription will expire on ",vn(e))}),null),yn.createElement(cn,{onClick:function(e){t("cancelSubscription",{subscriptionId:l.id,cancelAtPeriodEnd:!l.cancel_at_period_end})},isRunning:c,disabled:s,isPrimary:p,brandColor:a,label:u,style:{width:"100%"}}))},_n=function(e){var n=e.member,t=e.site,r=e.onAction,a=e.action,o=e.openSubscribe,i=e.brandColor,l=e.openEditProfile,u=e.openUpdatePlan,c=e.onEditBilling,s=e.onToggleSubscription;return yn.createElement("div",{className:"gh-portal-content gh-portal-account-main"},yn.createElement(bn,null),yn.createElement(kn,{member:n,brandColor:i}),yn.createElement("section",{className:"gh-portal-account-data"},yn.createElement(Pn,{action:a,member:n,site:t,openSubscribe:function(e){return o(e)},brandColor:i}),yn.createElement(Tn,{member:n,onAction:r,action:a,brandColor:i,showOnlyContinue:!0}),yn.createElement(Sn,{action:a,member:n,site:t,openEditProfile:function(e){return l(e)},onToggleSubscription:function(e,n){return s(e,n)},openUpdatePlan:function(e,n){return u(e,n)},onEditBilling:function(e,n){return c(e,n)}})))},Nn=function(e){E(t,e);var n=_(t);function t(){return y(this,t),n.apply(this,arguments)}return w(t,[{key:"componentDidMount",value:function(){this.context.member||this.context.onAction("switchPage",{page:"signup"})}},{key:"openSubscribe",value:function(e){this.context.onAction("switchPage",{page:"accountPlan",lastPage:"accountHome"})}},{key:"openEditProfile",value:function(){this.context.onAction("switchPage",{page:"accountProfile",lastPage:"accountHome"})}},{key:"checkoutPlan",value:function(e){(0,this.context.onAction)("checkoutPlan",{plan:e.name})}},{key:"openUpdatePlan",value:function(){this.context.site.is_stripe_configured&&this.context.onAction("switchPage",{page:"accountPlan",lastPage:"accountHome"})}},{key:"onEditBilling",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=(e.subscriptionId,this.context.member),t=Ae({member:n});this.context.onAction("editBilling",{subscriptionId:t.id})}},{key:"onToggleSubscription",value:function(e,n){e.preventDefault(),this.context.onAction("updateNewsletter",{subscribed:!n})}},{key:"handleSignout",value:function(e){e.preventDefault(),this.context.onAction("signout")}},{key:"render",value:function(){var e=this,n=this.context,t=n.member,r=n.site.members_support_address;return t?yn.createElement("div",{className:"gh-portal-account-wrapper"},yn.createElement(_n,Object.assign({},this.context,{openSubscribe:function(n){return e.openSubscribe(n)},openEditProfile:function(n){return e.openEditProfile(n)},onToggleSubscription:function(n,t){return e.onToggleSubscription(n,t)},openUpdatePlan:function(n,t){return e.openUpdatePlan(n,t)},onEditBilling:function(n,t){return e.onEditBilling(n,t)}})),yn.createElement(wn,{onClose:function(){return e.context.onAction("closePopup")},handleSignout:function(n){return e.handleSignout(n)},supportAddress:r})):null}}]),t}(yn.Component);function On(e){var n=e.name,t=e.onPlanSelect,r=e.isChecked,o=e.disabled;return Fe()&&(o=!0),a.a.createElement("div",{className:"gh-portal-plan-checkbox"},a.a.createElement("input",{name:n,key:n,type:"checkbox",checked:r,"aria-label":n,onChange:function(e){return t(e,n)},disabled:o}),a.a.createElement("span",{className:"checkmark"}))}function Ln(e){var n=e.currencySymbol,t=e.price,r=3!==n.length?"gh-portal-plan-currency gh-portal-plan-currency-symbol":"gh-portal-plan-currency gh-portal-plan-currency-code";return a.a.createElement("div",{className:"gh-portal-plan-pricelabel"},a.a.createElement("span",{className:r},n),a.a.createElement("span",{className:"gh-portal-plan-price"},Ye(t)))}function jn(e){var n=e.plans,t=e.selectedPlan,r=e.onPlanSelect,o=e.changePlan,i=n.some((function(e){return"Monthly"===e.name}));return n.map((function(e,n){var l=e.name,u=e.currency_symbol,c=e.price,s=e.discount,p=t===l,f=p?"gh-portal-plan-section checked":"gh-portal-plan-section",d={},h="";switch(l){case"Free":d.feature="Free preview";break;case"Monthly":case"Complimentary":d.feature="Full access";break;case"Yearly":h="Annually",d.feature=i&&s>0?s+"% discount":"Full access"}return a.a.createElement("div",{className:f,key:l,onClick:function(e){return r(e,l)}},a.a.createElement(On,{name:l,isChecked:p,onPlanSelect:r}),a.a.createElement("h4",{className:"gh-portal-plan-name"},h||l),a.a.createElement(Ln,{name:l,currencySymbol:u,price:c}),a.a.createElement("div",{className:"gh-portal-plan-featurewrapper"},a.a.createElement("div",{className:"gh-portal-plan-feature"},d.feature),o&&t===l?a.a.createElement("span",{className:"gh-portal-plan-current"},"Current plan"):""))}))}function Rn(e){return e.showLabel?a.a.createElement("label",{className:"gh-portal-input-label"},"Plan"):null}Nn.contextType=M;var In=function(e){var n=e.plans,t=e.showLabel,r=void 0===t||t,o=(e.type,e.selectedPlan),i=e.onPlanSelect,l=e.changePlan,u=void 0!==l&&l;if(e.style,!n||0===n.length||1===n.length&&"free"===n[0].type)return null;var c=Fe();return c&&(i=function(e,n){}),a.a.createElement("section",null,a.a.createElement(Rn,{showLabel:r}),a.a.createElement("div",{className:"gh-portal-plans-container"+(u?" hide-checkbox":"")+(c?" disabled":"")},a.a.createElement(jn,{plans:n,onPlanSelect:i,selectedPlan:o,changePlan:u})))},zn=t(0),Fn=function(e){var n=e.member,t=e.lastPage,r=e.brandColor,a=e.onBack,o=e.showConfirmation,i=e.confirmationType,l=De({member:n})?"Change plan":"Choose a plan";return o&&(l=function(e){var n=e.confirmationType;return"changePlan"===n?"Confirm subscription":"cancel"===n?"Cancel subscription":"subscribe"===n?"Subscribe":void 0}({confirmationType:i})),zn.createElement("header",{className:"gh-portal-detail-header"},zn.createElement(mn,{brandColor:r,onClick:function(e){return a(e)},hidden:!t&&!o}),zn.createElement("h3",{className:"gh-portal-main-title"},l))},An=function(e){var n=e.member,t=e.onCancelContinueSubscription,r=e.action,a=e.brandColor,o=e.showOnlyContinue,i=void 0!==o&&o;if(!n.paid)return null;var l=Ae({member:n});if(!l)return null;if(i&&!l.cancel_at_period_end)return null;if(l.cancel_at_period_end)return null;var u=l.cancel_at_period_end?"Continue subscription":"Cancel subscription",c=["cancelSubscription:running"].includes(r),s=!!c,p=!!l.cancel_at_period_end,f=!l.cancelAtPeriodEnd;return zn.createElement("div",{className:"gh-portal-expire-container"},zn.createElement((function(){if(!l.cancel_at_period_end)return null;var e=l.current_period_end;return zn.createElement("p",{className:"gh-portal-expire-warning"},"Your subscription will expire on ",vn(e),".")}),null),zn.createElement(cn,{onClick:function(e){t({subscriptionId:l.id,cancelAtPeriodEnd:!l.cancel_at_period_end})},isRunning:c,disabled:s,isPrimary:p,isDestructive:f,brandColor:a,label:u,style:{width:"100%"}}))},Mn=function(e){var n=e.action,t=e.member,a=e.plan,o=e.type,i=e.brandColor,l=e.onConfirm,u=c(Object(r.useState)(""),2),s=u[0],p=u[1],f=Ae({member:t}),d=["updateSubscription:running","checkoutPlan:running","cancelSubscription:running"].includes(n),h=vn(f.current_period_end);He({member:t}).type!==a.type&&(h="today");var m=Ye(a.price),g="".concat(a.currency_symbol).concat(m,"/").concat(a.type," – Starting ").concat(h);return"changePlan"===o?zn.createElement(zn.Fragment,null,zn.createElement("div",{className:"gh-portal-list outline mb6"},zn.createElement("section",null,zn.createElement("div",{className:"gh-portal-list-detail"},zn.createElement("h3",null,"Account"),zn.createElement("p",null,t.email))),zn.createElement("section",null,zn.createElement("div",{className:"gh-portal-list-detail"},zn.createElement("h3",null,"Price"),zn.createElement("p",null,g)))),zn.createElement(cn,{onClick:function(e){return l(e,a)},isRunning:d,isPrimary:!0,brandColor:i,label:"Confirm",style:{width:"100%",height:"40px"}})):zn.createElement("div",{className:"gh-portal-cancellation-form"},zn.createElement("p",null,"If you cancel your subscription now, you will continue to have access until ",zn.createElement("strong",null,vn(f.current_period_end)),"."),zn.createElement("section",{className:"gh-portal-input-section"},zn.createElement("div",{className:"gh-portal-input-labelcontainer"},zn.createElement("label",{className:"gh-portal-input-label"},"Cancellation reason")),zn.createElement("textarea",{className:"gh-portal-input",key:"cancellation_reason",label:"Cancellation reason",type:"text",name:"cancellation_reason",placeholder:"",value:s,onChange:function(e){return p(e.target.value)},rows:"2",maxlength:"500"})),zn.createElement(cn,{onClick:function(e){return l(e,s)},isRunning:d,isPrimary:!0,brandColor:i,label:"Confirm cancellation",style:{width:"100%",height:"40px"}}))},Dn=function(e){var n=e.plans,t=e.selectedPlan,r=e.member,a=e.action,o=e.brandColor,i=e.onPlanSelect,l=e.onCancelContinueSubscription;return zn.createElement("section",null,zn.createElement("div",{className:"gh-portal-section gh-portal-accountplans-main"},zn.createElement(In,{showLabel:!1,plans:n,selectedPlan:t,onPlanSelect:function(e,n){return i(e,n)},changePlan:!0})),zn.createElement(An,{member:r,onCancelContinueSubscription:l,action:a,brandColor:o}))},Un=function(e){var n=e.plans,t=e.selectedPlan,r=e.action,a=e.brandColor,o=e.onPlanSelect,i=e.onPlanCheckout,l=["checkoutPlan:running"].includes(r),u="";return 1===n.length&&(u="singleplan"),zn.createElement("section",null,zn.createElement("div",{className:"gh-portal-section gh-portal-accountplans-main ".concat(u)},zn.createElement(In,{showLabel:!1,plans:n,selectedPlan:t,onPlanSelect:function(e,n){return o(e,n)}})),zn.createElement(cn,{onClick:function(e){return i(e)},isRunning:l,isPrimary:!0,brandColor:a,label:"Continue",style:{height:"40px",width:"100%",marginTop:"24px"}}))},Hn=function(e){var n=e.plans,t=e.selectedPlan,r=e.confirmationPlan,a=e.confirmationType,o=e.member,i=e.onAction,l=e.action,u=e.brandColor,c=e.showConfirmation,s=void 0!==c&&c,p=e.onPlanSelect,f=e.onPlanCheckout,d=e.onConfirm,h=e.onCancelContinueSubscription;return De({member:o})?s?zn.createElement(Mn,{action:l,member:o,plan:r,type:a,onConfirm:d,brandColor:u}):zn.createElement(Dn,{plans:n,selectedPlan:t,member:o,action:l,brandColor:u,onCancelContinueSubscription:h,onPlanSelect:p}):zn.createElement(Un,{plans:n,selectedPlan:t,member:o,onAction:i,action:l,brandColor:u,onPlanSelect:p,onPlanCheckout:f})},Bn=function(e){E(t,e);var n=_(t);function t(e,r){var a;return y(this,t),(a=n.call(this,e,r)).state=a.getInitialState(),a}return w(t,[{key:"componentDidMount",value:function(){this.context.member||this.context.onAction("switchPage",{page:"signup"})}},{key:"componentWillUnmount",value:function(){clearTimeout(this.timeoutId)}},{key:"getInitialState",value:function(){var e=this.context,n=e.member,t=e.site;this.plans=Ve({site:t,includeFree:!1});var r=He({member:n}),a=r?this.plans.find((function(e){return e.name===r.name&&e.price===r.price&&e.currency===r.currency})):null;return!De({member:n})&&this.plans.length>0&&(a=this.plans[0]),{selectedPlan:a?a.name:null}}},{key:"handleSignout",value:function(e){e.preventDefault(),this.context.onAction("signout")}},{key:"onBack",value:function(e){this.state.showConfirmation?this.cancelConfirmPage():this.context.onAction("back")}},{key:"cancelConfirmPage",value:function(){this.setState({showConfirmation:!1,confirmationPlan:null,confirmationType:null})}},{key:"onPlanCheckout",value:function(e,n){var t=this.context,r=t.onAction,a=t.member,o=this.state,i=o.confirmationPlan,l=o.selectedPlan;if(De({member:a})){var u=Ae({member:a}),c=u?u.id:"";c&&r("updateSubscription",{plan:i.name,subscriptionId:c,cancelAtPeriodEnd:!1})}else r("checkoutPlan",{plan:l})}},{key:"onPlanSelect",value:function(e,n){var t=this;e.preventDefault();var r=this.context.member;if(De({member:r})){var a=this.plans.find((function(e){return e.name===n})),o=this.getActivePlanName({member:r})?"changePlan":"subscribe";n!==this.state.selectedPlan&&this.setState({confirmationPlan:a,confirmationType:o,showConfirmation:!0})}else this.timeoutId=setTimeout((function(){t.setState((function(e){return{selectedPlan:n}}))}),5)}},{key:"onCancelContinueSubscription",value:function(e){var n=e.subscriptionId,t=e.cancelAtPeriodEnd,r=Ue({subscription:function(e){var n=e.member,t=e.subscriptionId;return De({member:n})?(n.subscriptions||[]).find((function(e){return e.id===t})):null}({subscriptionId:n,member:this.context.member})});t?this.setState({showConfirmation:!0,confirmationPlan:r,confirmationType:"cancel"}):this.context.onAction("cancelSubscription",{subscriptionId:n,cancelAtPeriodEnd:t})}},{key:"onCancelSubscriptionConfirmation",value:function(e){var n=Ae({member:this.context.member});if(!n)return null;this.context.onAction("cancelSubscription",{subscriptionId:n.id,cancelAtPeriodEnd:!0,cancellationReason:e})}},{key:"getActivePlanName",value:function(e){var n=He({member:e.member});return n?n.name:null}},{key:"onConfirm",value:function(e,n){var t=this.state.confirmationType;return"cancel"===t?this.onCancelSubscriptionConfirmation(n):["changePlan","subscribe"].includes(t)?this.onPlanCheckout(n):void 0}},{key:"render",value:function(){var e=this,n=this.context,t=n.member,r=n.brandColor,a=n.lastPage,o=this.plans,i=this.state,l=i.selectedPlan,u=i.showConfirmation,c=i.confirmationPlan,s=i.confirmationType;return zn.createElement(zn.Fragment,null,zn.createElement("div",{className:"gh-portal-content"},zn.createElement(bn,null),zn.createElement(Fn,{lastPage:a,member:t,brandColor:r,onBack:function(n){return e.onBack(n)},confirmationType:s,showConfirmation:u}),zn.createElement(Hn,Object.assign({},this.context,{plans:o,selectedPlan:l,showConfirmation:u,confirmationPlan:c,confirmationType:s},{onConfirm:function(){return e.onConfirm.apply(e,arguments)},onCancelContinueSubscription:function(n){return e.onCancelContinueSubscription(n)},onPlanSelect:function(n,t){return e.onPlanSelect(n,t)},onPlanCheckout:function(n,t){return e.onPlanCheckout(n,t)}}))))}}]),t}(zn.Component);function Wn(e){var n=e.message,t=e.style;return n?a.a.createElement("p",{style:d({},t||{})},n):null}Bn.contextType=M;var Qn=function(e){var n=e.name,t=e.id,o=e.label,i=e.hideLabel,l=e.type,u=e.value,c=e.placeholder,s=e.disabled,p=e.onChange,f=void 0===p?function(){}:p,d=e.onBlur,h=void 0===d?function(){}:d,m=e.onKeyDown,g=void 0===m?function(){}:m,b=e.tabindex,v=e.maxlength,y=e.autoFocus,x=e.errorMessage,w=Object(r.useRef)(null);t=t||"input-".concat(n);var k=i?"gh-portal-input-label hidden":"gh-portal-input-label",E=x?"gh-portal-input error":"gh-portal-input";Fe()&&(s=!0);var S="",C="",P="";switch(t){case"input-email":S="off",C="off",P="off";break;case"input-name":S="off",C="off"}return Object(r.useEffect)((function(){y&&w.current.focus()}),[y]),a.a.createElement("section",{className:"gh-portal-input-section"},a.a.createElement("div",{className:"gh-portal-input-labelcontainer"},a.a.createElement("label",{htmlFor:t,className:k}," ",o," "),a.a.createElement(Wn,{message:x,name:n})),a.a.createElement("input",{ref:w,id:t,className:E,type:l,name:n,value:u,placeholder:c,onChange:function(e){return f(e,n)},onKeyDown:function(e){return g(e,n)},onBlur:function(e){return h(e,n)},disabled:s,tabIndex:b,maxLength:v,autoComplete:S,autoCorrect:C,autoCapitalize:P,"aria-label":o}))},Vn=function(e){var n=e.field,t=e.onChange,r=e.onBlur,o=void 0===r?function(){}:r,i=e.onKeyDown,l=void 0===i?function(){}:i;return n?a.a.createElement(a.a.Fragment,null,a.a.createElement(Qn,{key:n.name,label:n.label,type:n.type,name:n.name,placeholder:n.placeholder,value:n.value,onKeyDown:l,onChange:function(e){return t(e,n)},onBlur:function(e){return o(e,n)},tabIndex:n.tabindex,errorMessage:n.errorMessage,autoFocus:n.autoFocus})):null},$n=function(e){E(t,e);var n=_(t);function t(e){var r;return y(this,t),(r=n.call(this,e)).state={},r}return w(t,[{key:"render",value:function(){var e=this.props,n=e.fields,t=e.onChange,r=e.onBlur,o=e.onKeyDown,i=n.map((function(e){return a.a.createElement(Vn,{field:e,key:e.name,onChange:t,onBlur:r,onKeyDown:o})}));return a.a.createElement(a.a.Fragment,null,i)}}]),t}(r.Component),qn=function(e){var n=e.fields,t={};return n.forEach((function(e){var n=e.name,r=function(e){var n,t=e.field;if(t.required&&!t.value)switch(t.name){case"name":return"Enter your name";case"email":return"Enter your email address";default:return"Please enter ".concat(t.name)}return"email"!==t.type||(n=t.value)&&/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(String(n).toLowerCase())?null:"Invalid email address"}({field:e});t[n]=r})),t};function Kn(){return(Kn=Object.assign||function(e){for(var n=1;n=0||(a[t]=e[t]);return a}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}(e,["svgRef","title"]);return a.a.createElement("svg",Kn({viewBox:"0 0 24 24",ref:n},r),Yn,void 0===t?Jn:t?a.a.createElement("title",null,t):null,Gn,Xn,Zn,et,nt)},rt=a.a.forwardRef((function(e,n){return a.a.createElement(tt,Kn({svgRef:n},e))})),at=(t.p,t(0)),ot=function(e){E(t,e);var n=_(t);function t(e){var r;return y(this,t),(r=n.call(this,e)).state={name:"",email:"",plan:"Free"},r}return w(t,[{key:"componentDidMount",value:function(){this.context.member&&this.context.onAction("switchPage",{page:"accountHome"});var e=this.getPlans(),n=this.state.plan,t=this.getDefaultSelectedPlan(e,this.state.plan);t!==n&&this.setState({plan:t})}},{key:"componentDidUpdate",value:function(){var e=this.getPlans(),n=this.state.plan,t=this.getDefaultSelectedPlan(e,this.state.plan);t!==n&&this.setState({plan:t})}},{key:"componentWillUnmount",value:function(){clearTimeout(this.timeoutId)}},{key:"handleSignup",value:function(e){var n=this;e.preventDefault(),this.setState((function(e){return{errors:qn({fields:n.getInputFields({state:e})})}}),(function(){var e=n.context.onAction,t=n.state,r=t.name,a=t.email,o=t.plan,i=t.errors;i&&Object.values(i).filter((function(e){return!!e})).length>0||(e("signup",{name:r,email:a,plan:o}),n.setState({errors:{}}))}))}},{key:"handleInputChange",value:function(e,n){var t=n.name,r=e.target.value;this.setState(p({},t,r))}},{key:"handleSelectPlan",value:function(e,n){var t=this;e.preventDefault(),this.timeoutId=setTimeout((function(){t.setState((function(e){return{plan:n}}))}),5)}},{key:"onKeyDown",value:function(e){13===e.keyCode&&this.handleSignup(e)}},{key:"getDefaultSelectedPlan",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0;if(!e||0===e.length)return"Free";var t=e.some((function(e){return e.name===n}));return t?n:e[0].name||"Free"}},{key:"getPlans",value:function(){var e=this.context.site,n=e.plans,t=e.allow_self_signup,r=e.is_stripe_configured,a=e.portal_plans,o=this.context.pageQuery,i=[],l=Re()(n.monthly,n.yearly),u=[{type:"month",price:n.monthly,currency_symbol:n.currency_symbol,name:"Monthly"},{type:"year",price:n.yearly,currency_symbol:n.currency_symbol,name:"Yearly",discount:l}];return t&&(void 0===a||a.includes("free"))&&i.push({type:"free",price:0,currency_symbol:n.currency_symbol,name:"Free"}),r&&"free"!==o&&u.forEach((function(e){(void 0===a||a.includes(e.name.toLowerCase()))&&i.push(e)})),i}},{key:"getInputFields",value:function(e){var n=e.state,t=e.fieldNames,r=this.context.site.portal_name,a=n.errors||{},o=[{type:"email",value:n.email,placeholder:"jamie@example.com",label:"Email",name:"email",required:!0,tabindex:2,errorMessage:a.email||""}];return r&&o.unshift({type:"text",value:n.name,placeholder:"Jamie Larson",label:"Name",name:"name",required:!0,tabindex:1,errorMessage:a.name||""}),o[0].autoFocus=!0,t&&t.length>0?o.filter((function(e){return t.includes(e.name)})):o}},{key:"renderSubmitButton",value:function(){var e=this,n=this.context,t=n.action,r=n.site,a=n.brandColor;if(0===Ve({site:r,pageQuery:n.pageQuery}).length)return null;var o="Continue";Be({site:r})&&(o="Sign up");var i=!1;"signup:running"===t&&(o="Sending...",i=!0);var l=!1;"signup:failed"===t&&(o="Retry",l=!0);var u="signup:running"===t;return at.createElement(cn,{style:{width:"100%"},retry:l,onClick:function(n){return e.handleSignup(n)},disabled:u,brandColor:a,label:o,isRunning:i,tabIndex:"3"})}},{key:"renderPlans",value:function(){var e=this,n=this.context,t=Ve({site:n.site,pageQuery:n.pageQuery});return at.createElement(at.Fragment,null,at.createElement(In,{plans:t,selectedPlan:this.state.plan,onPlanSelect:function(n,t){return e.handleSelectPlan(n,t)}}))}},{key:"renderLoginMessage",value:function(){var e=this.context,n=e.brandColor,t=e.onAction;return at.createElement("div",{className:"gh-portal-signup-message"},at.createElement("div",null,"Already a member?"),at.createElement("button",{className:"gh-portal-btn gh-portal-btn-link",style:{color:n},onClick:function(){return t("switchPage",{page:"signin"})}},at.createElement("span",null,"Sign in")))}},{key:"renderForm",value:function(){var e=this,n=this.getInputFields({state:this.state}),t=this.context;return 0===Ve({site:t.site,pageQuery:t.pageQuery}).length?at.createElement("section",null,at.createElement("div",{className:"gh-portal-section"},at.createElement("p",{className:"gh-portal-invite-only-notification"},"This site is invite-only, contact the owner for access."))):at.createElement("section",null,at.createElement("div",{className:"gh-portal-section"},at.createElement($n,{fields:n,onChange:function(n,t){return e.handleInputChange(n,t)},onKeyDown:function(n,t){return e.onKeyDown(n,t)}}),this.renderPlans()))}},{key:"renderSiteLogo",value:function(){var e=this.getPlans(),n=this.context.site,t=n.icon;return t?("url(".concat(t,")"),at.createElement("img",{className:"gh-portal-signup-logo",src:t,alt:n.title})):0===e.length?at.createElement(rt,{className:"gh-portal-icon gh-portal-icon-invitation"}):null}},{key:"renderFormHeader",value:function(){var e=this.context.site.title||"";return at.createElement("header",{className:"gh-portal-signup-header"},this.renderSiteLogo(),at.createElement("h2",{className:"gh-portal-main-title"},e))}},{key:"render",value:function(){var e=this.getPlans(),n=this.getInputFields({state:this.state}),t="",r="";return e.length<=1&&(1===e.length&&"free"===e[0].type||0===e.length?(t="noplan",1===n.length&&(t="single-field"),0===e.length&&(r="invite-only")):t="singleplan"),at.createElement(at.Fragment,null,at.createElement("div",{className:"gh-portal-content signup "+t},at.createElement(bn,null),this.renderFormHeader(),this.renderForm()),at.createElement("footer",{className:"gh-portal-signup-footer "+r},this.renderSubmitButton(),this.renderLoginMessage()))}}]),t}(at.Component);ot.contextType=M;var it=ot;function lt(){return(lt=Object.assign||function(e){for(var n=1;n=0||(a[t]=e[t]);return a}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}(e,["svgRef","title"]);return a.a.createElement("svg",lt({viewBox:"0 0 24 24",ref:n},r),t?a.a.createElement("title",null,t):null,ut,ct,st,pt,ft)},ht=a.a.forwardRef((function(e,n){return a.a.createElement(dt,lt({svgRef:n},e))})),mt=(t.p,t(0)),gt=function(e){E(t,e);var n=_(t);function t(){return y(this,t),n.apply(this,arguments)}return w(t,[{key:"renderFormHeader",value:function(){return mt.createElement("section",{className:"gh-portal-inbox-notification"},mt.createElement("header",{className:"gh-portal-header"},mt.createElement(ht,{className:"gh-portal-icon gh-portal-icon-envelope"}),mt.createElement("h2",null,"We've sent you a login link!")),mt.createElement("p",null,"If the email doesn't arrive in 3 minutes, be sure to check your spam folder!"))}},{key:"renderLoginMessage",value:function(){var e=this;return mt.createElement(mt.Fragment,null,mt.createElement("div",{style:{color:"#1d1d1d",fontWeight:"bold",cursor:"pointer"},onClick:function(){return e.context.onAction("switchPage",{page:"signin"})}},"Back to Log in"))}},{key:"handleClose",value:function(e){this.context.onAction("closePopup")}},{key:"renderCloseButton",value:function(){var e=this;return mt.createElement(cn,{style:{width:"100%"},onClick:function(n){return e.handleClose(n)},brandColor:this.context.brandColor,label:"Close"})}},{key:"render",value:function(){return mt.createElement("div",{className:"gh-portal-content"},mt.createElement(bn,null),this.renderFormHeader(),this.renderCloseButton())}}]),t}(mt.Component);gt.contextType=M;var bt=t(5),vt=t.n(bt),yt=t(0),xt=function(e){var n=e.showLinks,t=e.toggleShowLinks,r=n?"Show Data Attributes":"Show Links";return yt.createElement("h4",{className:"gh-portal-links-cell toggle",onClick:function(){return t({showLinks:!n})}},r)},wt=function(e){var n=e.pageName,t=function(e){var n=e.page,t=e.isLink,r=e.siteUrl;return"default"===n?t?"".concat(r,"#/portal"):"data-portal":"signup"===n?t?"".concat(r,"#/portal/signup"):'data-portal="signup"':"signin"===n?t?"".concat(r,"#/portal/signin"):'data-portal="signin"':"accountHome"===n?t?"".concat(r,"#/portal/account"):'data-portal="account"':"accountPlan"===n?t?"".concat(r,"#/portal/account/plans"):'data-portal="account/plans"':"accountProfile"===n?t?"".concat(r,"#/portal/account/profile"):'data-portal="account/profile"':void 0}({page:e.page,isLink:e.isLink,siteUrl:e.siteUrl});return yt.createElement("tr",null,yt.createElement("td",{className:"pagename"},n),yt.createElement("td",{className:"page-url"},yt.createElement("input",{value:t,disabled:"disabled"})),yt.createElement("td",{className:"copy"},yt.createElement("button",{type:"button",onClick:function(e){vt()(t)}},"Copy")))},kt=function(e){E(t,e);var n=_(t);function t(e){var r;return y(this,t),(r=n.call(this,e)).state={showLinks:!0},r}return w(t,[{key:"render",value:function(){var e=this,n=this.context.site.url,t=void 0===n?"":n;return yt.createElement("div",{className:"gh-portal-links-main"},yt.createElement("p",null,"Use these links or data attributes to show the various sections of members modal."),yt.createElement("table",{className:"gh-portal-links-table"},yt.createElement("tr",{className:"header"},yt.createElement("td",null,yt.createElement("h4",null,"Section")),yt.createElement("td",{colspan:"2"},yt.createElement("div",{className:"toggle-header"},yt.createElement("h4",null,this.state.showLinks?"Link":"Data Attribute"),yt.createElement(xt,{showLinks:this.state.showLinks,toggleShowLinks:function(n){var t=n.showLinks;return e.setState({showLinks:t})}})))),yt.createElement(wt,{pageName:"Default",page:"default",isLink:this.state.showLinks,siteUrl:t}),yt.createElement(wt,{pageName:"Sign up",page:"signup",isLink:this.state.showLinks,siteUrl:t}),yt.createElement(wt,{pageName:"Sign in",page:"signin",isLink:this.state.showLinks,siteUrl:t}),yt.createElement(wt,{pageName:"Account home",page:"accountHome",isLink:this.state.showLinks,siteUrl:t}),yt.createElement(wt,{pageName:"Account/Plans",page:"accountPlan",isLink:this.state.showLinks,siteUrl:t}),yt.createElement(wt,{pageName:"Account/Profile",page:"accountProfile",isLink:this.state.showLinks,siteUrl:t})))}}]),t}(yt.Component);kt.contextType=M;var Et=function(e){var n=e.hide,t=void 0!==n&&n,r=e.onClose;return t?null:a.a.createElement(be,{className:"closeicon",alt:"Close",onClick:r})},St=function(e){var n=e.message,t=(e.site||{}).members_support_address||"",r="mailto:".concat(t);return n?a.a.createElement("p",null,n):a.a.createElement("p",null," An unexpected error occured. Please try again or ",a.a.createElement("a",{href:r,onClick:function(){r&&window.open(r)}},"contact support")," if the error persists.")},Ct=function(e){E(t,e);var n=_(t);function t(){var e;return y(this,t),(e=n.call(this)).state={className:""},e}return w(t,[{key:"onAnimationEnd",value:function(e){var n=(this.context.popupNotification||{}).type;"popupnotification-slideout"===e.animationName&&("stripe:billing-update"===n&&Oe(["stripe"]),this.context.onAction("clearPopupNotification"))}},{key:"closeNotification",value:function(e){this.context.onAction("clearPopupNotification")}},{key:"componentDidUpdate",value:function(){var e=this.context.popupNotification;e.count!==this.state.notificationCount&&(clearTimeout(this.timeoutId),this.handlePopupNotification({popupNotification:e}))}},{key:"handlePopupNotification",value:function(e){var n=this,t=e.popupNotification;if(this.setState({notificationCount:t.count}),t.autoHide){var r=t.duration,a=void 0===r?2600:r;this.timeoutId=setTimeout((function(){n.setState((function(e){return"slideout"!==e.className?{className:"slideout",notificationCount:t.count}:{}}))}),a)}}},{key:"componentDidMount",value:function(){var e=this.context.popupNotification;this.handlePopupNotification({popupNotification:e})}},{key:"componentWillUnmount",value:function(){clearTimeout(this.timeoutId)}},{key:"render",value:function(){var e=this,n=this.context,t=n.popupNotification,r=n.site,o=this.state.className,i=t.type,l=t.status,u=t.closeable,c=t.message,s=l?" ".concat(l):"",p=o?" ".concat(o):"";return a.a.createElement("div",{className:"gh-portal-popupnotification".concat(s).concat(p),onAnimationEnd:function(n){return e.onAnimationEnd(n)}},"error"===l?a.a.createElement(Te,{className:"gh-portal-popupnotification-icon error",alt:""}):a.a.createElement(ke,{className:"gh-portal-popupnotification-icon success",alt:""}),a.a.createElement(St,{type:i,status:l,message:c,site:r}),a.a.createElement(Et,{hide:!u,onClose:function(n){return e.closeNotification(n)}}))}}]),t}(a.a.Component);Ct.contextType=M;var Pt=t(0),Tt=function(e){E(t,e);var n=_(t);function t(e){var r;return y(this,t),(r=n.call(this,e)).state={email:""},r}return w(t,[{key:"componentDidMount",value:function(){this.context.member&&this.context.onAction("switchPage",{page:"accountHome"})}},{key:"handleSignin",value:function(e){var n=this;e.preventDefault(),this.setState((function(e){return{errors:qn({fields:n.getInputFields({state:e})})}}),(function(){var e=n.state,t=e.email,r=e.errors;r&&Object.values(r).filter((function(e){return!!e})).length>0||n.context.onAction("signin",{email:t})}))}},{key:"handleInputChange",value:function(e,n){var t=n.name;this.setState(p({},t,e.target.value))}},{key:"onKeyDown",value:function(e){13===e.keyCode&&this.handleSignin(e)}},{key:"getInputFields",value:function(e){var n=e.state,t=n.errors||{};return[{type:"email",value:n.email,placeholder:"jamie@example.com",label:"Email",name:"email",required:!0,errorMessage:t.email||"",autoFocus:!0}]}},{key:"renderSubmitButton",value:function(){var e=this,n=this.context.action,t=!1,r="signin:running"===n,a=r?"Sending login link...":"Continue",o=!!r;return"signin:failed"===n&&(a="Retry",t=!0),Pt.createElement(cn,{retry:t,style:{width:"100%"},onClick:function(n){return e.handleSignin(n)},disabled:o,brandColor:this.context.brandColor,label:a,isRunning:r})}},{key:"renderSignupMessage",value:function(){var e=this,n=this.context.brandColor;return Pt.createElement("div",{className:"gh-portal-signup-message"},Pt.createElement("div",null,"Don't have an account?"),Pt.createElement("button",{className:"gh-portal-btn gh-portal-btn-link",style:{color:n},onClick:function(){return e.context.onAction("switchPage",{page:"signup"})}},Pt.createElement("span",null,"Sign up")))}},{key:"renderForm",value:function(){var e=this;return Pt.createElement("section",null,Pt.createElement("div",{className:"gh-portal-section"},Pt.createElement($n,{fields:this.getInputFields({state:this.state}),onChange:function(n,t){return e.handleInputChange(n,t)},onKeyDown:function(n,t){return e.onKeyDown(n,t)}})))}},{key:"renderSiteLogo",value:function(){var e=this.context.site.icon;return e?("url(".concat(e,")"),Pt.createElement("img",{className:"gh-portal-signup-logo",src:e,alt:this.context.site.title})):null}},{key:"renderFormHeader",value:function(){var e=this.context.site.title||"Site Title";return Pt.createElement("header",{className:"gh-portal-signin-header"},this.renderSiteLogo(),Pt.createElement("h2",{className:"gh-portal-main-title"},"Log in to ",e))}},{key:"render",value:function(){return Pt.createElement(Pt.Fragment,null,Pt.createElement("div",{className:"gh-portal-content signin"},Pt.createElement(bn,null),this.renderFormHeader(),this.renderForm()),Pt.createElement("footer",{className:"gh-portal-signin-footer"},this.renderSubmitButton(),this.renderSignupMessage()))}}]),t}(Pt.Component);Tt.contextType=M;var _t=t(0),Nt=function(e){E(t,e);var n=_(t);function t(){return y(this,t),n.apply(this,arguments)}return w(t,[{key:"render",value:function(){return _t.createElement("div",{style:{display:"flex",flexDirection:"column",color:"#313131"}},_t.createElement("div",{style:{paddingLeft:"16px",paddingRight:"16px",paddingTop:"12px"}},"Loading..."))}}]),t}(_t.Component),Ot=t(0),Lt=function(e){E(t,e);var n=_(t);function t(e,r){var a;y(this,t),a=n.call(this,e,r);var o=r.member||{},i=o.name,l=void 0===i?"":i,u=o.email,c=void 0===u?"":u;return a.state={name:l,email:c},a}return w(t,[{key:"componentDidMount",value:function(){this.context.member||this.context.onAction("switchPage",{page:"signup"})}},{key:"handleSignout",value:function(e){e.preventDefault(),this.context.onAction("signout")}},{key:"onBack",value:function(e){this.context.onAction("back")}},{key:"onProfileSave",value:function(e){var n=this;e.preventDefault(),this.setState((function(e){return{errors:qn({fields:n.getInputFields({state:e})})}}),(function(){var e=n.state,t=e.email,r=e.name,a=e.errors;a&&Object.values(a).filter((function(e){return!!e})).length>0||(n.context.onAction("clearPopupNotification"),n.context.onAction("updateProfile",{email:t,name:r}))}))}},{key:"renderSaveButton",value:function(){var e=this,n="updateProfile:running"===this.context.action,t="Save";"updateProfile:failed"===this.context.action&&(t="Retry");var r=!!n;return Ot.createElement(cn,{isRunning:n,onClick:function(n){return e.onProfileSave(n)},disabled:r,brandColor:this.context.brandColor,label:t,style:{width:"100%"}})}},{key:"renderDeleteAccountButton",value:function(){return Ot.createElement("div",{style:{cursor:"pointer",color:"red"},role:"button"},"Delete account")}},{key:"renderAccountFooter",value:function(){return Ot.createElement("footer",{className:"gh-portal-action-footer"},this.renderSaveButton())}},{key:"renderHeader",value:function(){var e=this;return Ot.createElement("header",{className:"gh-portal-detail-header"},Ot.createElement(mn,{brandColor:this.context.brandColor,hidden:!this.context.lastPage,onClick:function(n){return e.onBack(n)}}),Ot.createElement("h3",{className:"gh-portal-main-title"},"Account settings"))}},{key:"renderUserAvatar",value:function(){var e=this.context.member&&this.context.member.avatar_image;return Ot.createElement("div",{style:{position:"relative",display:"flex",width:"64px",height:"64px",marginBottom:"6px",borderRadius:"100%",boxShadow:"0 0 0 3px #fff",border:"1px solid gray",overflow:"hidden",justifyContent:"center",alignItems:"center"}},Ot.createElement(A,{gravatar:e,style:{userIcon:{color:"black",width:"56px",height:"56px"}}}))}},{key:"handleInputChange",value:function(e,n){var t=n.name;this.setState(p({},t,e.target.value))}},{key:"getInputFields",value:function(e){var n=e.state,t=e.fieldNames,r=n.errors||{},a=[{type:"text",value:n.name,placeholder:"Jamie Larson",label:"Name",name:"name",required:!0,errorMessage:r.name||""},{type:"email",value:n.email,placeholder:"jamie@example.com",label:"Email",name:"email",required:!0,errorMessage:r.email||""}];return t&&t.length>0?a.filter((function(e){return t.includes(e.name)})):a}},{key:"onKeyDown",value:function(e){13===e.keyCode&&this.onProfileSave(e)}},{key:"renderProfileData",value:function(){var e=this;return Ot.createElement("div",{className:"gh-portal-section"},Ot.createElement($n,{fields:this.getInputFields({state:this.state}),onChange:function(n,t){return e.handleInputChange(n,t)},onKeyDown:function(n,t){return e.onKeyDown(n,t)}}))}},{key:"render",value:function(){return this.context.member?Ot.createElement(Ot.Fragment,null,Ot.createElement("div",{className:"gh-portal-content with-footer"},Ot.createElement(bn,null),this.renderHeader(),Ot.createElement("div",{className:"gh-portal-section"},this.renderProfileData())),this.renderAccountFooter()):null}}]),t}(Ot.Component);Lt.contextType=M;var jt={signin:Tt,signup:it,accountHome:Nn,accountPlan:Bn,accountProfile:Lt,magiclink:gt,loading:Nt,links:kt},Rt=function(e){var n=e.page;return Object.keys(jt).includes(n)?n:"signup"},It=jt;function zt(){return(zt=Object.assign||function(e){for(var n=1;n=0||(a[t]=e[t]);return a}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}(e,["svgRef","title"]);return a.a.createElement("svg",zt({viewBox:"0 0 156 156",ref:n},r),t?a.a.createElement("title",null,t):null,Ft)},Mt=a.a.forwardRef((function(e,n){return a.a.createElement(At,zt({svgRef:n},e))})),Dt=(t.p,t(0)),Ut=function(e){return e.member,{modalContainer:{zIndex:"3999999",position:"fixed",left:"0",top:"0",width:"100%",height:"100%",overflow:"hidden"},frame:{common:{margin:"auto",position:"relative",padding:"0",outline:"0",width:"100%",opacity:"1",overflow:"hidden",height:"100%"}},page:{links:{width:"600px"}}}};function Ht(e){var n=e.message;return Fe()?Dt.createElement("div",{className:"gh-portal-cookiebanner"},n):null}var Bt=function(e){E(t,e);var n=_(t);function t(){return y(this,t),n.apply(this,arguments)}return w(t,[{key:"componentDidMount",value:function(){var e=this;this.node&&!tn(["preview"])&&(this.node.focus(),this.keyUphandler=function(n){var t=n.target&&n.target.tagName;"Escape"===n.key&&"INPUT"!==t&&e.context.onAction("closePopup")},this.node.ownerDocument.removeEventListener("keyup",this.keyUphandler),this.node.ownerDocument.addEventListener("keyup",this.keyUphandler))}},{key:"componentWillUnmount",value:function(){this.node&&this.node.ownerDocument.removeEventListener("keyup",this.keyUphandler)}},{key:"handlePopupClose",value:function(e){e.preventDefault(),e.target===e.currentTarget&&this.context.onAction("closePopup")}},{key:"renderActivePage",value:function(){var e=this.context.page;Rt({page:e});var n=It[e];return Dt.createElement(n,null)}},{key:"renderPopupNotification",value:function(){var e=this.context.popupNotification;return e&&e.type?Dt.createElement(Ct,null):null}},{key:"render",value:function(){var e=this,n=this.context,t=n.page,r=n.site,a=r.portal_plans,o=r.is_stripe_configured,i=r.allow_self_signup;Rt({page:t});var l=d({},Ut({page:t}).page[t]),u="";"signup"!==t&&"signin"!==t||(!i||3!==a.length||"signup"!==t&&"signin"!==t||(u="gh-portal-container-wide"),(a.length<=1||!i&&a.length>1&&-1!==a.indexOf("free")||!o)&&(u="gh-portal-container-narrow"));var c="",s=t;switch(t){case"signup":c="Cookies must be enabled in your browser to sign up.";break;case"signin":c="Cookies must be enabled in your browser to sign in.";break;case"accountHome":s="account-home";break;case"accountProfile":s="account-profile";break;case"accountPlan":s="account-plan";break;default:c="Cookies must be enabled in your browser.",s=t}var p=tn(["preview","dev"])&&!r.disableBackground?"gh-portal-popup-container preview":"gh-portal-popup-container";return Dt.createElement("div",{className:"gh-portal-popup-wrapper "+s,onClick:function(n){return e.handlePopupClose(n)}},Dt.createElement("div",{className:p+" "+u+" "+s,style:l,ref:function(n){return e.node=n},tabIndex:-1},Dt.createElement(Ht,{message:c}),this.renderPopupNotification(),this.renderActivePage()),Dt.createElement("div",{className:"gh-portal-powered"+(tn(["preview"])?" hidden":"")},Dt.createElement("a",{href:"https://ghost.org",target:"_blank",rel:"noopener noreferrer",onClick:function(){window.open("https://ghost.org","_blank")}},Dt.createElement(Mt,null)," ",Dt.createElement("span",null,"Publish with Ghost"))))}}]),t}(Dt.Component);Bt.contextType=M;var Wt=function(e){E(t,e);var n=_(t);function t(e){var r;return y(this,t),(r=n.call(this,e)).state={height:null},r}return w(t,[{key:"renderCurrentPage",value:function(e){var n=It[e];return Dt.createElement(n,null)}},{key:"onHeightChange",value:function(e){this.setState({height:e})}},{key:"handlePopupClose",value:function(e){e.preventDefault(),e.target===e.currentTarget&&this.context.onAction("closePopup")}},{key:"renderFrameStyles",value:function(){var e="\n :root {\n --brandcolor: ".concat(this.context.brandColor,"\n }\n ")+'\n /* Colors\n /* ----------------------------------------------------- */\n :root {\n --black: #000;\n --grey0: #1d1d1d;\n --grey1: #333;\n --grey2: #3d3d3d;\n --grey3: #474747;\n --grey4: #515151;\n --grey5: #686868;\n --grey6: #7f7f7f;\n --grey7: #979797;\n --grey8: #aeaeae;\n --grey9: #c5c5c5;\n --grey10: #dcdcdc;\n --grey11: #e1e1e1;\n --grey12: #eaeaea;\n --grey13: #f9f9f9;\n --white: #fff;\n --red: #f02525;\n --yellow: #FFDC15;\n --green: #7FC724;\n }\n\n /* Globals\n /* ----------------------------------------------------- */\n html {\n font-size: 62.5%;\n height: 100%;\n }\n\n body {\n margin: 0px;\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;\n font-size: 1.6rem;\n height: 100%;\n line-height: 1.6em;\n font-weight: 400;\n font-style: normal;\n color: var(--grey4);\n box-sizing: border-box;\n }\n\n button,\n button span {\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;\n }\n\n *, ::after, ::before {\n box-sizing: border-box;\n }\n\n h1, h2, h3, h4, h5, h6, p {\n line-height: 1.15em;\n padding: 0;\n margin: 0;\n }\n\n h1 {\n font-size: 31px;\n font-weight: 500;\n letter-spacing: 0.2px;\n }\n\n h2 {\n font-size: 23px;\n font-weight: 500;\n letter-spacing: 0.2px;\n }\n\n h3 {\n font-size: 20px;\n font-weight: 500;\n letter-spacing: 0.2px;\n }\n\n p {\n font-size: 15px;\n line-height: 1.55em;\n margin-bottom: 24px;\n }\n\n strong {\n font-weight: 600;\n }\n\n a,\n .gh-portal-link {\n cursor: pointer;\n }\n\n svg {\n box-sizing: content-box;\n }\n\n input,\n textarea {\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;\n font-size: 1.5rem;\n }\n\n textarea {\n padding: 10px;\n line-height: 1.5em;\n }\n\n .gh-portal-main-title {\n text-align: center;\n color: var(--grey0);\n line-height: 1.35em;\n }\n\n .gh-portal-text-disabled {\n color: var(--grey3);\n font-weight: normal;\n opacity: 0.35;\n }\n\n .gh-portal-text-center {\n text-align: center;\n }\n\n .gh-portal-input-label {\n color: var(--grey1);\n font-size: 1.3rem;\n font-weight: 500;\n margin-bottom: 2px;\n letter-spacing: 0.35px;\n }\n\n .gh-portal-setting-data {\n color: var(--grey6);\n font-size: 1.3rem;\n line-height: 1.15em;\n }\n\n .gh-portal-error {\n color: var(--red);\n font-size: 1.4rem;\n line-height: 1.6em;\n margin: 12px 0;\n }\n\n /* Buttons\n /* ----------------------------------------------------- */\n .gh-portal-btn {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 1.4rem;\n font-weight: 500;\n line-height: 1em;\n letter-spacing: 0.2px;\n text-align: center;\n white-space: nowrap;\n text-decoration: none;\n color: var(--grey0);\n background: var(--white);\n border: 1px solid var(--grey12);\n min-width: 80px;\n height: 42px;\n padding: 0 1.8rem;\n border-radius: 4px;\n cursor: pointer;\n transition: all .25s ease;\n box-shadow: none;\n box-shadow: 0 2px 6px -3px rgba(0,0,0,0.19);\n user-select: none;\n outline: none;\n }\n\n .gh-portal-btn:hover {\n border-color: var(--grey10);\n }\n\n .gh-portal-btn:disabled {\n opacity: 0.3 !important;\n cursor: auto;\n }\n\n .gh-portal-btn-icon svg {\n width: 16px;\n height: 16px;\n margin-right: 4px;\n stroke: currentColor;\n }\n\n .gh-portal-btn-icon svg path {\n stroke: currentColor;\n }\n\n .gh-portal-btn-link {\n line-height: 1;\n background: none;\n padding: 0;\n height: unset;\n min-width: unset;\n box-shadow: none;\n border: none;\n }\n\n .gh-portal-btn-link:hover {\n box-shadow: none;\n opacity: 0.85;\n }\n\n .gh-portal-btn-branded {\n color: var(--brandcolor);\n }\n\n .gh-portal-btn-list {\n font-size: 1.4rem;\n color: var(--brandcolor);\n height: 38px;\n width: unset;\n min-width: unset;\n padding: 0 4px;\n margin: 0 -4px;\n box-shadow: none;\n border: none;\n }\n\n .gh-portal-btn-list:hover {\n box-shadow: none;\n opacity: 0.75;\n }\n\n .gh-portal-btn-logout {\n position: absolute;\n top: 22px;\n left: 24px;\n background: none;\n border: none;\n height: unset;\n color: var(--grey3);\n padding: 0;\n margin: 0;\n z-index: 999;\n box-shadow: none;\n }\n\n .gh-portal-btn-logout .label {\n opacity: 0;\n transform: translateX(-6px);\n transition: all 0.2s ease-in-out;\n }\n\n .gh-portal-btn-logout:hover {\n padding: 0;\n margin: 0;\n background: none;\n border: none;\n height: unset;\n box-shadow: none;\n }\n\n .gh-portal-btn-logout:hover .label {\n opacity: 1.0;\n transform: translateX(-4px);\n }\n\n .gh-portal-logouticon {\n color: var(--grey9);\n cursor: pointer;\n width: 23px;\n height: 23px;\n padding: 6px;\n transform: translateX(0);\n transition: all 0.2s ease-in-out;\n }\n\n .gh-portal-logouticon path {\n stroke: var(--grey9);\n transition: all 0.2s ease-in-out;\n }\n\n .gh-portal-btn-logout:hover .gh-portal-logouticon {\n transform: translateX(-2px);\n }\n\n .gh-portal-btn-logout:hover .gh-portal-logouticon path {\n stroke: var(--grey3);\n }\n\n /* Global layout styles\n /* ----------------------------------------------------- */\n .gh-portal-popup-background {\n position: absolute;\n display: block;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n animation: fadein 0.2s;\n background: linear-gradient(315deg , rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.3) 100%);\n backdrop-filter: blur(2px);\n -webkit-backdrop-filter: blur(2px);\n -webkit-transform: translate3d(0, 0, 0);\n -moz-transform: translate3d(0, 0, 0);\n -ms-transform: translate3d(0, 0, 0);\n transform: translate3d(0, 0, 0);\n }\n\n .gh-portal-popup-background.preview {\n background: #EDF0F2;\n animation: none;\n }\n\n @keyframes fadein {\n 0% { opacity: 0; }\n 100%{ opacity: 1.0; }\n }\n\n .gh-portal-popup-wrapper {\n position: relative;\n padding: 15vmin 0 0;\n height: 100%;\n }\n\n .gh-portal-popup-container {\n outline: none;\n position: relative;\n display: flex;\n box-sizing: border-box;\n flex-direction: column;\n justify-content: flex-start;\n overflow: hidden;\n font-size: 1.5rem;\n text-align: left;\n letter-spacing: 0;\n text-rendering: optimizeLegibility;\n background: var(--white);\n width: 400px;\n margin: 0 auto;\n border-radius: 5px;\n box-shadow: 0 3.8px 2.2px rgba(0, 0, 0, 0.028), 0 9.2px 5.3px rgba(0, 0, 0, 0.04), 0 17.3px 10px rgba(0, 0, 0, 0.05), 0 30.8px 17.9px rgba(0, 0, 0, 0.06), 0 57.7px 33.4px rgba(0, 0, 0, 0.072), 0 138px 80px rgba(0, 0, 0, 0.1);\n animation: popup 0.25s ease-in-out;\n z-index: 9999;\n }\n\n @keyframes popup {\n 0% {\n transform: scale(0.9) translateY(20px);\n opacity: 0;\n }\n 75% {\n opacity: 1.0;\n }\n 100%{\n transform: scale(1) translateY(0);\n }\n }\n\n .gh-portal-powered {\n position: absolute;\n bottom: 24px;\n left: 24px;\n }\n \n .gh-portal-powered a {\n display: inline-flex;\n align-items: center;\n padding: 6px 9px 6px 6px;\n border: none;\n font-size: 12px;\n line-height: 12px;\n letter-spacing: -.3px;\n font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;\n font-weight: 600;\n text-decoration: none;\n color: #383838;\n background: #fff;\n border-radius: 5px;\n box-shadow: 0 0 0 1px rgba(0,0,0,.05),0 1px 3px rgba(0,0,0,.08);\n cursor: pointer;\n outline: none;\n background: var(--white);\n z-index: 9998;\n animation: powered-fade-in 0.25s ease-in-out;\n transform-origin: top right;\n }\n\n @keyframes powered-fade-in {\n 0% {\n transform: scale(0.98); \n opacity: 0; \n }\n 75% {\n opacity: 1.0;\n }\n 100%{\n transform: scale(1);\n }\n }\n\n .gh-portal-powered a svg {\n height: 16px;\n width: 16px;\n margin: 0 6px 0 0;\n }\n\n .gh-portal-container-wide {\n width: 440px;\n }\n\n .gh-portal-container-narrow {\n width: 380px;\n }\n\n .gh-portal-popup-container.preview {\n box-shadow:\n 0 0 0 1px rgba(0,0,0,0.02),\n 0 2.8px 2.2px rgba(0, 0, 0, 0.02),\n 0 6.7px 5.3px rgba(0, 0, 0, 0.028),\n 0 12.5px 10px rgba(0, 0, 0, 0.035),\n 0 22.3px 17.9px rgba(0, 0, 0, 0.042),\n 0 41.8px 33.4px rgba(0, 0, 0, 0.05),\n 0 100px 80px rgba(0, 0, 0, 0.07);\n animation: none;\n }\n\n /* Sets the main content area of the popup scrollable. \n /* 12vw is the sum horizontal padding of the popup container \n */\n .gh-portal-content {\n position: relative;\n overflow-y: scroll;\n padding: 24px 32px 32px;\n max-height: calc(100vh - 12vw);\n }\n\n .gh-portal-content.with-footer {\n overflow-y: scroll;\n padding-bottom: 0;\n max-height: calc(100vh - 12vw - 72px);\n }\n\n /* Hide scrollbar for Chrome, Safari and Opera */\n .gh-portal-content::-webkit-scrollbar {\n display: none;\n }\n\n /* Hide scrollbar for IE, Edge and Firefox */\n .gh-portal-content {\n -ms-overflow-style: none; /* IE and Edge */\n scrollbar-width: none; /* Firefox */\n } \n \n .gh-portal-popup-container footer {\n padding: 0 32px 32px;\n height: 72px;\n }\n\n .gh-portal-closeicon-container {\n position: absolute;\n top: 14px;\n right: 14px;\n z-index: 999;\n }\n\n .gh-portal-closeicon {\n color: var(--grey9);\n cursor: pointer;\n width: 16px;\n height: 16px;\n padding: 12px;\n transition: all 0.2s ease-in-out;\n }\n\n .gh-portal-closeicon:hover {\n color: var(--grey5);\n }\n\n .gh-portal-logout-container {\n position: absolute;\n top: 8px;\n left: 8px;\n }\n\n .gh-portal-header {\n display: flex;\n flex-direction: column;\n align-items: center;\n padding-bottom: 24px;\n }\n\n .gh-portal-section {\n margin-bottom: 32px;\n }\n\n .gh-portal-section.form {\n margin-bottom: 20px;\n }\n\n .gh-portal-detail-header {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n margin: -4px 0 24px;\n }\n\n .gh-portal-detail-footer .gh-portal-btn {\n min-width: 90px;\n }\n\n .gh-portal-action-footer {\n display: flex;\n align-items: center;\n justify-content: space-between;\n }\n\n .gh-portal-list {\n background: var(--white);\n padding: 20px;\n border-radius: 3px;\n box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.07), 0px 1px 1.5px 0px rgba(0, 0, 0, 0.05);\n }\n\n .gh-portal-list.outline {\n box-shadow: none;\n border: 1px solid var(--grey12);\n }\n\n .gh-portal-list section {\n display: flex;\n align-items: center;\n margin: 0 -20px 20px;\n padding: 0 20px 20px;\n border-bottom: 1px solid var(--grey12);\n }\n\n .gh-portal-list section:last-of-type {\n margin-bottom: 0;\n padding-bottom: 0;\n border: none;\n }\n\n .gh-portal-list-detail {\n flex-grow: 1;\n }\n\n .gh-portal-list-detail h3 {\n font-size: 1.5rem;\n font-weight: 500;\n }\n\n .gh-portal-list-detail p {\n font-size: 1.3rem;\n letter-spacing: 0.3px;\n line-height: 1.15em;\n padding: 0;\n margin: 2px 0 0;\n color: var(--grey6);\n }\n\n .gh-portal-expire-warning {\n text-align: center;\n color: var(--red);\n font-weight: 500;\n font-size: 1.4rem;\n margin: 12px 0;\n }\n\n .gh-portal-cookiebanner {\n background: var(--red);\n color: var(--white);\n text-align: center;\n font-size: 1.4rem;\n letter-spacing: 0.2px;\n line-height: 1.4em;\n padding: 8px;\n }\n\n .gh-portal-popup-container.account-profile .gh-portal-action-footer {\n height: unset;\n padding-bottom: 36px;\n }\n\n /* Icons\n /* ----------------------------------------------------- */\n .gh-portal-icon {\n color: var(--brandcolor);\n }\n\n /* Spacing modifiers\n /* ----------------------------------------------------- */\n .mt1 { margin-top: 4px; }\n .mt2 { margin-top: 8px; }\n .mt3 { margin-top: 12px; }\n .mt4 { margin-top: 16px; }\n .mt5 { margin-top: 20px; }\n .mt6 { margin-top: 24px; }\n .mt7 { margin-top: 28px; }\n .mt8 { margin-top: 32px; }\n .mt9 { margin-top: 36px; }\n .mt10 { margin-top: 40px; }\n\n .mr1 { margin-right: 4px; }\n .mr2 { margin-right: 8px; }\n .mr3 { margin-right: 12px; }\n .mr4 { margin-right: 16px; }\n .mr5 { margin-right: 20px; }\n .mr6 { margin-right: 24px; }\n .mr7 { margin-right: 28px; }\n .mr8 { margin-right: 32px; }\n .mr9 { margin-right: 36px; }\n .mr10 { margin-right: 40px; }\n\n .mb1 { margin-bottom: 4px; }\n .mb2 { margin-bottom: 8px; }\n .mb3 { margin-bottom: 12px; }\n .mb4 { margin-bottom: 16px; }\n .mb5 { margin-bottom: 20px; }\n .mb6 { margin-bottom: 24px; }\n .mb7 { margin-bottom: 28px; }\n .mb8 { margin-bottom: 32px; }\n .mb9 { margin-bottom: 36px; }\n .mb10 { margin-bottom: 40px; }\n\n .ml1 { margin-left: 4px; }\n .ml2 { margin-left: 8px; }\n .ml3 { margin-left: 12px; }\n .ml4 { margin-left: 16px; }\n .ml5 { margin-left: 20px; }\n .ml6 { margin-left: 24px; }\n .ml7 { margin-left: 28px; }\n .ml8 { margin-left: 32px; }\n .ml9 { margin-left: 36px; }\n .ml10 { margin-left: 40px; }\n\n .pt1 { padding-top: 4px; }\n .pt2 { padding-top: 8px; }\n .pt3 { padding-top: 12px; }\n .pt4 { padding-top: 16px; }\n .pt5 { padding-top: 20px; }\n .pt6 { padding-top: 24px; }\n .pt7 { padding-top: 28px; }\n .pt8 { padding-top: 32px; }\n .pt9 { padding-top: 36px; }\n .pt10 { padding-top: 40px; }\n \n .pr1 { padding-right: 4px; }\n .pr2 { padding-right: 8px; }\n .pr3 { padding-right: 12px; }\n .pr4 { padding-right: 16px; }\n .pr5 { padding-right: 20px; }\n .pr6 { padding-right: 24px; }\n .pr7 { padding-right: 28px; }\n .pr8 { padding-right: 32px; }\n .pr9 { padding-right: 36px; }\n .pr10 { padding-right: 40px; }\n \n .pb1 { padding-bottom: 4px; }\n .pb2 { padding-bottom: 8px; }\n .pb3 { padding-bottom: 12px; }\n .pb4 { padding-bottom: 16px; }\n .pb5 { padding-bottom: 20px; }\n .pb6 { padding-bottom: 24px; }\n .pb7 { padding-bottom: 28px; }\n .pb8 { padding-bottom: 32px; }\n .pb9 { padding-bottom: 36px; }\n .pb10 { padding-bottom: 40px; }\n \n .pl1 { padding-left: 4px; }\n .pl2 { padding-left: 8px; }\n .pl3 { padding-left: 12px; }\n .pl4 { padding-left: 16px; }\n .pl5 { padding-left: 20px; }\n .pl6 { padding-left: 24px; }\n .pl7 { padding-left: 28px; }\n .pl8 { padding-left: 32px; }\n .pl9 { padding-left: 36px; }\n .pl10 { padding-left: 40px; }\n\n .hidden { display: none !important; }\n\n .gh-portal-account-main {\n background: var(--grey13);\n padding: 32px 32px 0;\n max-height: calc(100vh - 12vw - 104px);\n }\n\n .gh-portal-account-header {\n display: flex;\n flex-direction: column;\n align-items: center;\n margin: 0 0 32px;\n }\n\n .gh-portal-account-header .gh-portal-avatar {\n margin: 6px 0 8px !important;\n }\n\n .gh-portal-account-data {\n margin-bottom: 32px;\n }\n\n footer.gh-portal-account-footer {\n display: flex;\n padding: 32px;\n height: 104px;\n border-top: 1px solid #eaeaea;\n }\n\n .gh-portal-account-footer.paid {\n margin-top: 12px;\n }\n\n .gh-portal-account-footermenu {\n display: flex;\n list-style: none;\n padding: 0;\n margin: 0;\n }\n\n .gh-portal-account-footerright {\n display: flex;\n flex-grow: 1;\n align-items: center;\n justify-content: flex-end;\n }\n\n .gh-portal-account-footermenu li {\n margin-right: 16px;\n }\n\n .gh-portal-account-footermenu li:last-of-type {\n margin-right: 0;\n }\n\n .gh-portal-freeaccount-newsletter {\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-top: 24px;\n }\n\n .gh-portal-freeaccount-newsletter .label {\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n }\n\n .gh-portal-free-ctatext {\n margin-top: -12px;\n }\n\n .gh-portal-cancelcontinue-container {\n margin: 24px 0 32px;\n }\n\n .gh-portal-billing-button-loader {\n width: 32px;\n height: 32px;\n margin-right: -3px;\n opacity: 0.6;\n }\n\n .gh-portal-accountplans-main {\n margin-top: 24px;\n margin-bottom: 0;\n }\n\n .gh-portal-expire-container {\n margin: 24px 0 0;\n }\n\n .gh-portal-cancellation-form p {\n margin-bottom: 12px;\n }\n\n .gh-portal-cancellation-form .gh-portal-input-section {\n margin-bottom: 20px;\n }\n\n .gh-portal-cancellation-form .gh-portal-input {\n resize: none;\n width: 100%;\n height: 62px;\n padding: 6px 12px;\n }\n\n .gh-portal-input {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n\n display: block;\n box-sizing: border-box;\n font-size: 1.5rem;\n color: inherit;\n background: transparent;\n outline: none;\n border: 1px solid var(--grey12);\n border-radius: 3px;\n width: 100%;\n height: 40px;\n padding: 0 12px;\n margin-bottom: 18px;\n letter-spacing: 0.2px;\n box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.07), 0px 1px 1.5px 0px rgba(0, 0, 0, 0.05);\n transition: border-color 0.25s ease-in-out;\n }\n\n .gh-portal-input-labelcontainer {\n display: flex;\n justify-content: space-between;\n width: 100%;\n }\n\n .gh-portal-input-labelcontainer p {\n color: var(--red);\n font-size: 1.3rem;\n letter-spacing: 0.35px;\n line-height: 1.6em;\n margin-bottom: 0;\n }\n\n .gh-portal-input-label.hidden {\n display: none;\n }\n\n .gh-portal-input:focus {\n border-color: #cdcdcd;\n }\n\n .gh-portal-input.error {\n border-color: var(--red);\n }\n\n .gh-portal-input::placeholder {\n color: var(--grey7);\n }\n\n .gh-portal-input:disabled {\n background: var(--grey13);\n color: var(--grey9);\n box-shadow: none;\n }\n\n .gh-portal-input:disabled::placeholder {\n color: var(--grey9);\n }\n\n .gh-portal-plans-container {\n display: flex;\n align-items: stretch;\n border: 1px solid var(--grey10);\n border-radius: 5px;\n }\n\n .gh-portal-plan-section {\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: center;\n flex: 1;\n font-size: 1.4rem;\n line-height: 1.35em;\n border-right: 1px solid var(--grey10);\n padding: 16px 10px;\n cursor: pointer;\n user-select: none;\n }\n\n .gh-portal-plans-container.disabled .gh-portal-plan-section {\n cursor: auto;\n }\n\n .gh-portal-plan-section.checked::before {\n position: absolute;\n display: block;\n top: -1px;\n right: -1px;\n bottom: -1px;\n left: -1px;\n content: "";\n z-index: 999;\n border: 2px solid var(--brandcolor);\n pointer-events: none;\n }\n\n .gh-portal-plan-section:first-of-type::before {\n border-top-left-radius: 5px;\n border-bottom-left-radius: 5px;\n }\n\n .gh-portal-plan-section:last-of-type::before {\n border-top-right-radius: 5px;\n border-bottom-right-radius: 5px;\n }\n\n .gh-portal-plan-section:last-of-type {\n border-right: none;\n }\n\n .gh-portal-plans-container.disabled .gh-portal-plan-section.checked::before {\n opacity: 0.3;\n }\n\n .gh-portal-plan-pricelabel {\n display: flex;\n margin-top: 8px;\n }\n\n .gh-portal-plan-name {\n font-size: 1.2rem;\n font-weight: 500;\n letter-spacing: 0.5px;\n text-transform: uppercase;\n margin-top: 8px;\n }\n\n .gh-portal-plan-currency {\n position: relative;\n bottom: 2px;\n font-size: 1.4rem;\n font-weight: 500;\n letter-spacing: 0.4px;\n }\n\n .gh-portal-plan-currency-code {\n margin-right: 2px;\n font-size: 1.15rem;\n }\n\n .gh-portal-plan-price {\n font-size: 2.2rem;\n font-weight: 500;\n letter-spacing: 0.1px;\n }\n\n .gh-portal-plan-type {\n color: var(--grey7);\n }\n\n .gh-portal-plan-featurewrapper {\n display: flex;\n flex-direction: column;\n align-items: center;\n border-top: 1px solid var(--grey12);\n margin-top: 12px;\n padding-top: 12px;\n width: 100%;\n }\n\n .gh-portal-plan-feature {\n font-size: 1.25rem;\n font-weight: 500;\n line-height: 1.25em;\n text-align: center;\n letter-spacing: 0.2px;\n }\n\n .gh-portal-plan-checkbox {\n position: relative;\n display: block;\n font-size: 22px;\n height: 18px;\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n }\n\n .gh-portal-plans-container.disabled .gh-portal-plan-checkbox {\n cursor: auto;\n }\n\n .gh-portal-plan-checkbox input {\n position: absolute;\n height: 0;\n width: 0;\n opacity: 0;\n cursor: pointer;\n }\n\n .gh-portal-plan-checkbox .checkmark {\n position: absolute;\n top: 0;\n left: -9px;\n background-color: var(--grey12);\n border-radius: 999px;\n height: 18px;\n width: 18px;\n }\n\n .gh-portal-plan-checkbox input:checked ~ .checkmark {\n background-color: var(--brandcolor);\n }\n\n .gh-portal-plan-checkbox .checkmark::after {\n position: absolute;\n display: none;\n content: "";\n }\n\n .gh-portal-plan-checkbox input:checked ~ .checkmark:after {\n display: block;\n }\n\n .gh-portal-plan-checkbox .checkmark:after {\n left: 6.5px;\n top: 2.5px;\n width: 5px;\n height: 11px;\n border: solid var(--white);\n border-width: 0 2px 2px 0;\n -webkit-transform: rotate(45deg);\n -ms-transform: rotate(45deg);\n transform: rotate(45deg);\n }\n\n .gh-portal-plans-container.disabled .gh-portal-plan-checkbox input:checked ~ .checkmark {\n opacity: 0.3;\n }\n\n .gh-portal-content.signup.singleplan .gh-portal-plan-section {\n cursor: auto;\n }\n\n .gh-portal-content.signup.singleplan .gh-portal-plan-checkbox,\n .gh-portal-content.signup.singleplan .gh-portal-plan-section.checked::before {\n display: none;\n }\n\n .gh-portal-content.signup.singleplan .gh-portal-plan-name {\n margin-top: 0;\n }\n\n .gh-portal-plan-section:not(.checked)::before {\n position: absolute;\n display: block;\n top: -1px;\n right: -1px;\n bottom: -1px;\n left: -1px;\n content: "";\n z-index: 999;\n border: 1px solid var(--brandcolor);\n pointer-events: none;\n opacity: 0;\n transition: all 0.2s ease-in-out;\n }\n\n .gh-portal-plans-container.disabled .gh-portal-plan-section:not(.checked):hover::before {\n opacity: 0;\n }\n\n .gh-portal-plans-container.hide-checkbox .gh-portal-plan-checkbox {\n display: none;\n }\n\n .gh-portal-plans-container.hide-checkbox .gh-portal-plan-section {\n padding-top: 12px;\n padding-bottom: 20px;\n }\n\n .gh-portal-plan-current {\n display: block;\n font-size: 1.25rem;\n letter-spacing: 0.2px;\n line-height: 1.25em;\n color: var(--brandcolor);\n margin: 4px 0 -2px;\n }\n\n .gh-portal-for-switch label,\n .gh-portal-for-switch .container {\n position: relative;\n display: inline-block;\n width: 36px !important;\n height: 22px !important;\n cursor: pointer;\n }\n\n .gh-portal-for-switch label p,\n .gh-portal-for-switch .container p {\n overflow: auto;\n color: var(--grey0);\n font-weight: normal;\n }\n\n .gh-portal-for-switch input {\n opacity: 0;\n width: 0;\n height: 0;\n }\n\n .gh-portal-for-switch .input-toggle-component {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: var(--grey13);\n border: 1px solid var(--grey11);\n transition: .3s;\n width: 36px !important;\n height: 22px !important;\n border-radius: 999px;\n transition: background 0.15s ease-in-out, border-color 0.15s ease-in-out;\n cursor: pointer;\n }\n\n .gh-portal-for-switch label:hover input:not(:checked) + .input-toggle-component,\n .gh-portal-for-switch .container:hover input:not(:checked) + .input-toggle-component {\n border-color: var(--grey9);\n }\n\n .gh-portal-for-switch .input-toggle-component:before {\n position: absolute;\n content: "";\n top: 2px !important;\n left: 2px !important;\n height: 16px !important;\n width: 16px !important;\n background-color: white;\n transition: .3s;\n box-shadow: 0 0 1px rgba(0,0,0,.3), 0 4px 6px rgba(0,0,0,.1);\n border-radius: 999px;\n }\n\n .gh-portal-for-switch input:checked + .input-toggle-component {\n background: var(--brandcolor);\n border-color: transparent;\n }\n\n .gh-portal-for-switch input:checked + .input-toggle-component:before {\n transform: translateX(14px);\n box-shadow: none;\n }\n\n .gh-portal-for-switch .container {\n width: 38px !important;\n height: 22px !important;\n }\n\n .gh-portal-btn-main {\n box-shadow: none;\n position: relative;\n height: 42px;\n border: none;\n }\n\n .gh-portal-btn-main:hover,\n .gh-portal-btn-main:focus {\n box-shadow: none;\n border: none;\n }\n\n .gh-portal-btn-primary:hover,\n .gh-portal-btn-primary:focus {\n opacity: 0.92 !important;\n }\n\n .gh-portal-btn-primary:disabled:hover::before {\n display: none;\n }\n\n .gh-portal-btn-destructive:not(:disabled):hover {\n color: var(--red);\n border-color: var(--red);\n }\n\n .gh-portal-loadingicon {\n position: absolute;\n left: 50%;\n display: inline-block;\n margin-left: -19px;\n height: 31px;\n }\n\n .gh-portal-loadingicon path,\n .gh-portal-loadingicon rect {\n fill: #fff;\n }\n\n .gh-portal-loadingicon.dark path,\n .gh-portal-loadingicon.dark rect {\n fill: #1d1d1d;\n }\n\n .gh-portal-btn-back,\n .gh-portal-btn-back:hover {\n box-shadow: none;\n position: relative;\n height: unset;\n min-width: unset;\n position: absolute;\n top: -3px;\n left: -16px;\n background: none;\n padding: 8px;\n margin: 0;\n box-shadow: none;\n color: var(--grey3);\n border: none;\n }\n\n .gh-portal-btn-back:hover {\n color: var(--grey1);\n transform: translateX(-4px);\n }\n\n .gh-portal-btn-back svg {\n width: 17px;\n height: 17px;\n margin-top: 1px;\n margin-right: 2px;\n }\n\n .gh-portal-avatar {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n margin: 0 0 8px 0;\n border-radius: 999px;\n }\n\n .gh-portal-avatar img {\n position: absolute;\n display: block;\n top: -2px;\n right: -2px;\n bottom: -2px;\n left: -2px;\n width: calc(100% + 4px);\n height: calc(100% + 4px);\n opacity: 1;\n max-width: unset;\n }\n\n .gh-portal-icon-envelope {\n width: 44px;\n margin: 12px 0 10px;\n }\n\n .gh-portal-inbox-notification {\n display: flex;\n flex-direction: column;\n align-items: center;\n }\n\n .gh-portal-inbox-notification p {\n text-align: center;\n margin-bottom: 30px;\n }\n\n .gh-portal-links-table {\n width: 100%;\n }\n\n .gh-portal-links-table tr td {\n white-space: nowrap;\n padding: 4px 12px 4px 0;\n }\n\n .gh-portal-links-table tr.header td {\n border-bottom: 1px solid var(--grey12);\n }\n\n .gh-portal-links-table tr.header h4.toggle {\n font-weight: 400;\n color: var(--brandcolor);\n cursor: pointer;\n }\n\n .gh-portal-links-table tr td:last-of-type {\n text-align: right;\n padding-right: 0;\n }\n\n .gh-portal-links-table tr.header .toggle-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n }\n\n .gh-portal-signup-logo {\n position: relative;\n display: block;\n background-position: 50%;\n background-size: cover;\n border-radius: 2px;\n width: 56px;\n height: 56px;\n margin: 12px 0 10px;\n }\n\n .gh-portal-signup-header,\n .gh-portal-signin-header {\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: 0 32px 24px;\n }\n\n .gh-portal-signup-header .gh-portal-main-title,\n .gh-portal-signin-header .gh-portal-main-title {\n margin-top: 12px;\n }\n\n .gh-portal-signup-logo + .gh-portal-main-title {\n margin: 4px 0 0;\n }\n\n .gh-portal-signup-header.nodivider {\n border: none;\n margin-bottom: 0;\n }\n\n .gh-portal-signup-message {\n display: flex;\n justify-content: center;\n color: var(--grey4);\n font-size: 1.3rem;\n letter-spacing: 0.2px;\n margin-top: 8px;\n }\n\n .gh-portal-signup-message button {\n font-size: 1.3rem;\n font-weight: 600;\n margin-left: 4px;\n }\n\n .gh-portal-signup-message button span {\n display: inline-block;\n padding-bottom: 2px;\n margin-bottom: -2px;\n }\n\n .gh-portal-content.signup {\n background: linear-gradient(#fff 30%,hsla(0,0%,100%,0)),\n linear-gradient(hsla(0,0%,100%,0),#fff 70%) 0 100%,\n linear-gradient(#fff,transparent),\n linear-gradient(transparent,rgba(0,0,0,.08)) 0 100%;\n background-repeat: no-repeat;\n background-color: #fff;\n background-size: 100% 40px,100% 40px,100% 14px,100% 14px;\n background-attachment: local,local,scroll,scroll;\n }\n\n footer.gh-portal-signup-footer,\n footer.gh-portal-signin-footer {\n padding-top: 24px;\n height: 132px;\n }\n\n .gh-portal-content.signup,\n .gh-portal-content.signin {\n max-height: calc(100vh - 12vw - 132px);\n padding-bottom: 0;\n }\n\n .gh-portal-content.signup .gh-portal-section {\n margin-bottom: 0;\n }\n\n .gh-portal-content.signup.noplan {\n margin-bottom: -8px;\n }\n\n .gh-portal-content.signup.single-field {\n margin-bottom: 0;\n }\n\n .gh-portal-content.signup.single-field .gh-portal-input,\n .gh-portal-content.signin .gh-portal-input {\n margin-bottom: 8px;\n }\n\n .gh-portal-content.signup.single-field + .gh-portal-signup-footer,\n footer.gh-portal-signin-footer {\n padding-top: 12px;\n }\n\n .gh-portal-content.signin .gh-portal-section {\n margin-bottom: 0;\n }\n\n .gh-portal-content.signup.single-field + footer.gh-portal-signup-footer,\n .gh-portal-content.signin + footer.gh-portal-signin-footer {\n height: 120px;\n }\n\n footer.gh-portal-signup-footer.invite-only {\n height: unset;\n }\n\n .gh-portal-invite-only-notification {\n margin: 8px 32px;\n padding: 0;\n text-align: center;\n color: var(--grey2);\n }\n\n .gh-portal-icon-invitation {\n width: 44px;\n margin: 12px 0 2px;\n }\n\n .gh-portal-icon-invitation path,\n .gh-portal-icon-invitation circle,\n .gh-portal-icon-invitation line {\n stroke-width: 1.2px;\n }\n\n .gh-portal-popupnotification {\n position: absolute;\n top: 8px;\n left: 8px;\n right: 8px;\n padding: 8px;\n background: var(--grey2);\n z-index: 9999;\n border-radius: 4px;\n font-size: 1.3rem;\n box-shadow: 0px 0.8151839971542358px 0.8151839971542358px 0px rgba(0,0,0,0.01),\n 0px 2.2538793087005615px 2.2538793087005615px 0px rgba(0,0,0,0.02),\n 0px 5.426473140716553px 5.426473140716553px 0px rgba(0,0,0,0.03),\n 0px 18px 18px 0px rgba(0,0,0,0.04);\n animation: popupnotification-slidein 0.6s ease-in-out;\n }\n\n .gh-portal-popupnotification.slideout {\n animation: popupnotification-slideout 0.48s ease-in;\n }\n\n .gh-portal-popupnotification p {\n color: var(--white);\n margin: 0;\n padding: 0 20px;\n font-size: 1.4rem;\n line-height: 1.5em;\n letter-spacing: 0.2px;\n text-align: center;\n }\n\n .gh-portal-popupnotification a {\n color: var(--white);\n }\n\n .gh-portal-popupnotification-icon {\n position: absolute;\n top: 10px;\n left: 10px;\n width: 16px;\n height: 16px;\n }\n\n .gh-portal-popupnotification-icon.success {\n color: var(--green);\n }\n\n .gh-portal-popupnotification-icon.error {\n color: #FF2828;\n }\n\n .gh-portal-popupnotification .closeicon {\n position: absolute;\n top: 0px;\n bottom: 0;\n right: 0;\n color: var(--white);\n cursor: pointer;\n width: 12px;\n height: 12px;\n padding: 12px;\n transition: all 0.2s ease-in-out forwards;\n opacity: 0.8;\n }\n\n .gh-portal-popupnotification .closeicon:hover {\n opacity: 1.0;\n }\n\n @keyframes popupnotification-slidein {\n 0% { transform: translateY(-100px); }\n 60% { transform: translateY(8px); }\n 100% { transform: translateY(0); }\n }\n\n @keyframes popupnotification-slideout {\n 0% { transform: translateY(0); }\n 40% { transform: translateY(8px); }\n 100% { transform: translateY(-100px); }\n }\n\n@media (max-width: 480px) {\n .gh-portal-popup-wrapper {\n height: 100%;\n padding: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: space-between;\n background: var(--white);\n }\n \n .gh-portal-popup-container {\n width: 100%;\n border-radius: 0;\n overflow: unset;\n animation: popup-mobile 0.25s ease-in-out;\n box-shadow: none !important;\n }\n\n .gh-portal-popup-wrapper.account-home,\n .gh-portal-popup-container.account-home {\n background: var(--grey13);\n }\n\n .gh-portal-popup-container.account-home .gh-portal-account-footer {\n border-top: none;\n padding-top: 0;\n height: unset;\n }\n\n .gh-portal-content {\n overflow-y: auto !important;\n max-height: unset !important;\n }\n\n .gh-portal-powered {\n position: relative;\n bottom: unset;\n left: unset;\n background: var(--white);\n display: flex;\n justify-content: center;\n width: 100%;\n padding-top: 32px;\n }\n\n .gh-portal-popup-wrapper.account-home .gh-portal-powered {\n background: var(--grey13);\n }\n\n .gh-portal-powered a {\n animation: none;\n box-shadow: none;\n background: none;\n margin-bottom: 32px;\n }\n\n .gh-portal-powered a span {\n opacity: 0.5;\n }\n\n .gh-portal-powered a svg {\n opacity: 0.65;\n }\n\n .gh-portal-popup-wrapper.account-home .gh-portal-powered a {\n box-shadow: none;\n }\n}\n\n@media (max-width: 414px) {\n .gh-portal-input {\n height: 44px;\n }\n\n .gh-portal-btn:not(.gh-portal-btn-link):not(.gh-portal-btn-back) {\n min-height: 44px;\n }\n}\n\n@media (max-width: 390px) {\n .gh-portal-plans-container {\n flex-direction: column;\n }\n\n .gh-portal-plan-section {\n flex-direction: row;\n min-height: 60px;\n border-right: none;\n border-bottom: 1px solid var(--grey10);\n }\n\n .gh-portal-plan-section:last-of-type {\n border-bottom: none;\n }\n\n .gh-portal-plan-checkbox {\n order: 1;\n margin-left: 12px;\n }\n\n .gh-portal-plan-name {\n position: absolute;\n left: 40px;\n top: 12px;\n padding: 0;\n margin: 0;\n text-transform: none;\n font-size: 1.4rem;\n letter-spacing: 0.2px;\n }\n\n .gh-portal-plan-featurewrapper {\n position: absolute;\n left: 40px;\n top: 32px;\n padding: 0;\n margin: 0;\n width: unset;\n text-align: left;\n border-top: none;\n font-weight: 400;\n letter-spacing: 0.2px;\n }\n \n .gh-portal-plan-pricelabel {\n right: 20px;\n top: 12px;\n position: absolute;\n }\n\n .gh-portal-plan-section:first-of-type.checked::before {\n border-top-left-radius: 5px;\n border-top-right-radius: 5px;\n border-bottom-left-radius: 0;\n }\n\n .gh-portal-plan-section:last-of-type.checked::before {\n border-bottom-left-radius: 5px;\n border-bottom-right-radius: 5px;\n border-top-right-radius: 0;\n }\n\n .gh-portal-plans-container.hide-checkbox .gh-portal-plan-name,\n .gh-portal-plans-container.hide-checkbox .gh-portal-plan-featurewrapper,\n .gh-portal-content.signup.singleplan .gh-portal-plan-name,\n .gh-portal-content.signup.singleplan .gh-portal-plan-featurewrapper {\n left: 12px;\n }\n\n .gh-portal-plans-container.hide-checkbox .gh-portal-plan-featurewrapper {\n flex-direction: row;\n }\n\n .gh-portal-plans-container.hide-checkbox .gh-portal-plan-featurewrapper .gh-portal-plan-current {\n margin: 0 0 0 12px;\n }\n\n .gh-portal-input {\n font-size: 1.4rem;\n margin-bottom: 16px;\n }\n\n .gh-portal-content {\n padding: 24px;\n }\n\n .gh-portal-popup-container footer {\n padding-right: 24px;\n padding-bottom: 24px;\n padding-left: 24px;\n }\n\n .gh-portal-signup-header,\n .gh-portal-signin-header {\n padding-bottom: 16px;\n }\n\n .gh-portal-account-main {\n padding: 24px 24px 0;\n }\n\n .gh-portal-powered {\n padding-top: 12px;\n }\n}\n\n@media (min-width: 768px) and (max-height: 768px) {\n .gh-portal-signup-header,\n .gh-portal-signin-header {\n padding-bottom: 16px;\n }\n}\n\n@keyframes popup-mobile {\n 0% {\n opacity: 0;\n }\n 100%{\n opacity: 1.0;\n }\n}\n';return Dt.createElement("style",{dangerouslySetInnerHTML:{__html:e}})}},{key:"renderFrameContainer",value:function(){var e=this,n=this.context,t=n.member,r=n.site,a=Ut({member:t}),o=d({},a.frame.common);tn(["preview"])&&(a.modalContainer.zIndex="3999997");var i=tn(["preview","dev"])&&!r.disableBackground?"gh-portal-popup-background preview":"gh-portal-popup-background";return Dt.createElement("div",{style:a.modalContainer},Dt.createElement(N,{style:o,title:"portal-popup",head:this.renderFrameStyles()},Dt.createElement("div",{className:i,onClick:function(n){return e.handlePopupClose(n)}}),Dt.createElement(Bt,null)))}},{key:"render",value:function(){return this.context.showPopup?this.renderFrameContainer():null}}]),t}(Dt.Component);Wt.contextType=M;var Qt=function(e){var n=e.siteUrl,t=void 0===n?window.location.origin:n;function r(e){var n=e.type,r=e.resource;if("members"===n)return"".concat(t.replace(/\/$/,""),"/").concat("members/api","/").concat(r,"/")}function a(e){var n=e.url,t=e.method,r=e.headers,a=void 0===r?{}:r,o=e.credentials,i=e.body;return fetch(n,{method:t,headers:a,credentials:o,body:i})}var o={};return o.site={read:function(){return a({url:r({type:"members",resource:"site"}),method:"GET",headers:{"Content-Type":"application/json"}}).then((function(e){if(e.ok)return e.json();throw new Error("Failed to fetch site data")}))}},o.member={identity:function(){return a({url:r({type:"members",resource:"session"}),credentials:"same-origin"}).then((function(e){return e.ok?e.text():null}))},sessionData:function(){return a({url:r({type:"members",resource:"member"}),credentials:"same-origin"}).then((function(e){return e.ok?e.json():null}))},update:function(e){var n=e.name,t=e.subscribed;return a({url:r({type:"members",resource:"member"}),method:"PUT",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify({name:n,subscribed:t})}).then((function(e){return e.ok?e.json():null}))},sendMagicLink:function(e){var n=e.email,t=e.emailType,o=e.labels,i=e.name,l=e.oldEmail;return a({url:r({type:"members",resource:"send-magic-link"}),method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i,email:n,oldEmail:l,emailType:t,labels:o,requestSrc:"portal"})}).then((function(e){if(e.ok)return"Success";throw new Error("Failed to send magic link email")}))},signout:function(){return a({url:r({type:"members",resource:"session"}),method:"DELETE"}).then((function(e){if(e.ok)return window.location.replace(t),"Success";throw new Error("Failed to signout")}))},checkoutPlan:function(){var e=arguments;return v(g.a.mark((function n(){var i,l,u,c,s,p,f,h,m,b,v,y,x;return g.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i=e.length>0&&void 0!==e[0]?e[0]:{},l=i.plan,u=i.cancelUrl,c=i.successUrl,s=i.email,p=i.name,f=i.metadata,h=void 0===f?{}:f,m=new URL(t),n.next=4,o.member.identity();case 4:return b=n.sent,v=r({type:"members",resource:"create-stripe-checkout-session"}),c||((y=new URL(t)).searchParams.set("stripe","success"),c=y.href),u||((x=window.location.href.startsWith(m.href)?new URL(window.location.href):new URL(t)).searchParams.set("stripe","cancel"),u=x.href),n.abrupt("return",a({url:v,method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plan:l,identity:b,metadata:d({name:p,requestSrc:"portal"},h),successUrl:c,cancelUrl:u,customerEmail:s})}).then((function(e){if(!e.ok)throw new Error("Could not create stripe checkout session");return e.json()})).then((function(e){return window.Stripe(e.publicKey).redirectToCheckout({sessionId:e.sessionId})})).then((function(e){if(e.error)throw new Error(e.error.message)})).catch((function(e){throw e})));case 9:case"end":return n.stop()}}),n)})))()},editBilling:function(){var e=arguments;return v(g.a.mark((function n(){var i,l,u,c,s,p,f,d,h;return g.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i=e.length>0&&void 0!==e[0]?e[0]:{},l=i.successUrl,u=i.cancelUrl,c=i.subscriptionId,s=new URL(t),n.next=4,o.member.identity();case 4:return p=n.sent,f=r({type:"members",resource:"create-stripe-update-session"}),l||((d=new URL(t)).searchParams.set("stripe","billing-update-success"),l=d.href),u||((h=window.location.href.startsWith(s.href)?new URL(window.location.href):new URL(t)).searchParams.set("stripe","billing-update-cancel"),u=h.href),n.abrupt("return",a({url:f,method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({identity:p,subscription_id:c,successUrl:l,cancelUrl:u})}).then((function(e){if(!e.ok)throw new Error("Could not create stripe checkout session");return e.json()})).then((function(e){return window.Stripe(e.publicKey).redirectToCheckout({sessionId:e.sessionId})})).then((function(e){if(e.error)throw new Error(e.error.message)})).catch((function(e){throw e})));case 9:case"end":return n.stop()}}),n)})))()},updateSubscription:function(e){return v(g.a.mark((function n(){var t,i,l,u,c,s;return g.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return t=e.subscriptionId,i=e.planName,l=e.cancelAtPeriodEnd,u=e.cancellationReason,n.next=3,o.member.identity();case 3:return c=n.sent,s=r({type:"members",resource:"subscriptions"})+t+"/",n.abrupt("return",a({url:s,method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({cancel_at_period_end:l,cancellation_reason:u,identity:c,planName:i})}));case 6:case"end":return n.stop()}}),n)})))()}},o.init=v(g.a.mark((function e(){var n,t,r;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.site.read();case 2:return n=e.sent,t=n.site,e.next=6,o.member.sessionData();case 6:return r=e.sent,e.abrupt("return",{site:t,member:r});case 8:case"end":return e.stop()}}),e)}))),o},Vt={title:"A Ghost site",description:"Thoughts, stories and ideas.",logo:"https://pbs.twimg.com/profile_images/1111773508231667713/mf2N0uqc_400x400.png",icon:"https://pbs.twimg.com/profile_images/1111773508231667713/mf2N0uqc_400x400.png",accent_color:"",url:"http://localhost:2368/",plans:{monthly:5e3,yearly:15e4,currency:"USD"},allow_self_signup:!0,is_stripe_configured:!0,portal_button:!0,portal_name:!0,portal_plans:["monthly","yearly"],portal_button_icon:"icon-1",portal_button_signup_text:"Subscribe now",portal_button_style:"icon-and-text",members_support_address:"support@example.com"},$t={free:{uuid:"d7d3b1a0-90f4-4b93-a51f-76b56213b535",email:"jamie@example.com",name:"Jamie Larson",firstname:"Jamie",avatar_image:"",subscriptions:[],paid:!1},paid:{uuid:"7dcc8939-3be0-4ac8-a363-96d19f909de6",email:"jamie@example.com",name:"Jamie Larson",firstname:"Jamie",avatar_image:"",subscriptions:[{id:"sub_HCLyRzHcGciDWJ",customer:{id:"cus_HCLy4Y3eLt50YJ",name:null,email:"jamie@example.com"},plan:{id:"fd43b943666b97640188afb382cca39479de30f799985679dd7a71ad2925ac6c",nickname:"Yearly",interval:"year",amount:1500,currency:"USD"},status:"active",start_date:"2019-05-01T11:42:40.000Z",default_payment_card_last4:"4242",cancel_at_period_end:!1,current_period_end:"2021-06-05T11:42:40.000Z"}],paid:!0},complimentary:{uuid:"67906ee2-c80f-4b61-9c9b-6b98c5d3a195",email:"jamie@example.com",name:"Jamie Larson",firstname:"Jamie",subscribed:!0,subscriptions:[{id:"sub_HxAis4368CZIuX",customer:{id:"cus_HxAiVNQ8C3MdAN",name:null,email:"jamie@example.com"},plan:{id:"d46f4d6de40f9bb47c86b8c9abb8285182f0b10f3ac05b5ba8633417ecac2746",nickname:"Complimentary",amount:0,interval:"year",currency:"USD"},status:"active",start_date:"2020-09-03T11:12:37.000Z",default_payment_card_last4:null,cancel_at_period_end:!1,current_period_end:"2021-09-03T11:12:37.000Z"}],paid:!0},preview:{uuid:"7dcc8939-3be0-4ac8-a363-96d19f909de6",email:"jamie@example.com",name:"Jamie Larson",firstname:"Jamie",avatar_image:"",subscriptions:[{id:"sub_HCLyRzHcGciDWJ",customer:{id:"cus_HCLy4Y3eLt50YJ",name:null,email:"jamie@example.com"},plan:{id:"fd43b943666b97640188afb382cca39479de30f799985679dd7a71ad2925ac6c",nickname:"Yearly",interval:"year",amount:500,currency:"USD"},status:"active",start_date:"2019-05-01T11:42:40.000Z",default_payment_card_last4:"4242",cancel_at_period_end:!1,current_period_end:"2021-06-05T11:42:40.000Z"}],paid:!0}};function qt(e){var n=e.state;return Ie(),{showPopup:!1,lastPage:null,pageQuery:"",popupNotification:null,page:"magiclink"===n.page?"":n.page}}function Kt(){return(Kt=v(g.a.mark((function e(n){var t,r;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.api,r=n.state,e.prev=1,e.next=4,t.member.signout();case 4:return e.abrupt("return",{action:"signout:success"});case 7:return e.prev=7,e.t0=e.catch(1),e.abrupt("return",{action:"signout:failed",popupNotification:Je({type:"signout:failed",autoHide:!1,closeable:!0,state:r,status:"error",message:"Failed to log out, please try again"})});case 10:case"end":return e.stop()}}),e,null,[[1,7]])})))).apply(this,arguments)}function Yt(){return(Yt=v(g.a.mark((function e(n){var t,r,a;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.data,r=n.api,a=n.state,e.prev=1,e.next=4,r.member.sendMagicLink(t);case 4:return e.abrupt("return",{page:"magiclink"});case 7:return e.prev=7,e.t0=e.catch(1),e.abrupt("return",{action:"signin:failed",popupNotification:Je({type:"signin:failed",autoHide:!1,closeable:!0,state:a,status:"error",message:"Failed to log in, please try again"})});case 10:case"end":return e.stop()}}),e,null,[[1,7]])})))).apply(this,arguments)}function Jt(){return(Jt=v(g.a.mark((function e(n){var t,r,a,o,i,l;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=n.data,r=n.state,a=n.api,e.prev=1,o=t.plan,i=t.email,l=t.name,"free"!==o.toLowerCase()){e.next=8;break}return e.next=6,a.member.sendMagicLink(t);case 6:e.next=10;break;case 8:return e.next=10,a.member.checkoutPlan({plan:o,email:i,name:l});case 10:return e.abrupt("return",{page:"magiclink"});case 13:return e.prev=13,e.t0=e.catch(1),e.abrupt("return",{action:"signup:failed",popupNotification:Je({type:"signup:failed",autoHide:!1,closeable:!0,state:r,status:"error",message:"Failed to sign up, please try again"})});case 16:case"end":return e.stop()}}),e,null,[[1,13]])})))).apply(this,arguments)}function Gt(){return(Gt=v(g.a.mark((function e(n){var t,r,a,o;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.data,r=n.state,a=n.api,e.prev=1,o=t.plan,e.next=5,a.member.checkoutPlan({plan:o,metadata:{checkoutType:"upgrade"}});case 5:e.next=10;break;case 7:return e.prev=7,e.t0=e.catch(1),e.abrupt("return",{action:"checkoutPlan:failed",popupNotification:Je({type:"checkoutPlan:failed",autoHide:!1,closeable:!0,state:r,status:"error",message:"Failed to process checkout, please try again"})});case 10:case"end":return e.stop()}}),e,null,[[1,7]])})))).apply(this,arguments)}function Xt(){return(Xt=v(g.a.mark((function e(n){var t,r,a,o,i,l,u,c;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.data,r=n.state,a=n.api,e.prev=1,o=t.plan,i=t.subscriptionId,l=t.cancelAtPeriodEnd,e.next=5,a.member.updateSubscription({planName:o,subscriptionId:i,cancelAtPeriodEnd:l});case 5:return e.next=7,a.member.sessionData();case 7:return u=e.sent,c="updateSubscription:success",e.abrupt("return",{action:c,popupNotification:Je({type:c,autoHide:!0,closeable:!0,state:r,status:"success",message:"Subscription plan updated successfully"}),page:"accountHome",member:u});case 12:return e.prev=12,e.t0=e.catch(1),e.abrupt("return",{action:"updateSubscription:failed",popupNotification:Je({type:"updateSubscription:failed",autoHide:!1,closeable:!0,state:r,status:"error",message:"Failed to update subscription, please try again"})});case 15:case"end":return e.stop()}}),e,null,[[1,12]])})))).apply(this,arguments)}function Zt(){return(Zt=v(g.a.mark((function e(n){var t,r,a,o,i,l,u;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.data,r=n.state,a=n.api,e.prev=1,o=t.subscriptionId,i=t.cancelAtPeriodEnd,l=t.cancellationReason,e.next=5,a.member.updateSubscription({subscriptionId:o,cancelAtPeriodEnd:i,cancellationReason:l});case 5:return e.next=7,a.member.sessionData();case 7:return u=e.sent,e.abrupt("return",{action:"cancelSubscription:success",page:"accountHome",member:u});case 12:return e.prev=12,e.t0=e.catch(1),e.abrupt("return",{action:"cancelSubscription:failed",popupNotification:Je({type:"cancelSubscription:failed",autoHide:!1,closeable:!0,state:r,status:"error",message:"Failed to cancel subscription, please try again"})});case 15:case"end":return e.stop()}}),e,null,[[1,12]])})))).apply(this,arguments)}function er(){return(er=v(g.a.mark((function e(n){var t,r,a;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.data,r=n.state,a=n.api,e.prev=1,e.next=4,a.member.editBilling(t);case 4:e.next=9;break;case 6:return e.prev=6,e.t0=e.catch(1),e.abrupt("return",{action:"editBilling:failed",popupNotification:Je({type:"editBilling:failed",autoHide:!1,closeable:!0,state:r,status:"error",message:"Failed to update billing information, please try again"})});case 9:case"end":return e.stop()}}),e,null,[[1,6]])})))).apply(this,arguments)}function nr(){return(nr=v(g.a.mark((function e(){return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",{popupNotification:null});case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function tr(){return(tr=v(g.a.mark((function e(n){var t,r,a,o,i,l;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.data,r=n.state,a=n.api,e.prev=1,o=t.subscribed,e.next=5,a.member.update({subscribed:o});case 5:if(i=e.sent){e.next=8;break}throw new Error("Failed to update newsletter");case 8:return l="updateNewsletter:success",e.abrupt("return",{action:l,member:i,popupNotification:Je({type:l,autoHide:!0,closeable:!0,state:r,status:"success",message:"Email newsletter settings updated"})});case 12:return e.prev=12,e.t0=e.catch(1),e.abrupt("return",{action:"updateNewsletter:failed",popupNotification:Je({type:"updateNewsletter:failed",autoHide:!0,closeable:!0,state:r,status:"error",message:"Failed to update newsletter settings"})});case 15:case"end":return e.stop()}}),e,null,[[1,12]])})))).apply(this,arguments)}function rr(e){return ar.apply(this,arguments)}function ar(){return(ar=v(g.a.mark((function e(n){var t,r,a,o,i;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=n.data,r=n.state,a=n.api,o=t.email,i=$e({member:r.member}),o===i){e.next=13;break}return e.prev=4,e.next=7,a.member.sendMagicLink({email:o,oldEmail:i,emailType:"updateEmail"});case 7:return e.abrupt("return",{success:!0});case 10:return e.prev=10,e.t0=e.catch(4),e.abrupt("return",{success:!1,error:e.t0});case 13:return e.abrupt("return",null);case 14:case"end":return e.stop()}}),e,null,[[4,10]])})))).apply(this,arguments)}function or(e){return ir.apply(this,arguments)}function ir(){return(ir=v(g.a.mark((function e(n){var t,r,a,o,i;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=n.data,r=n.state,a=n.api,o=t.name,qe({member:r.member})===o){e.next=16;break}return e.prev=4,e.next=7,a.member.update({name:o});case 7:if(i=e.sent){e.next=10;break}throw new Error("Failed to update member");case 10:return e.abrupt("return",{member:i,success:!0});case 13:return e.prev=13,e.t0=e.catch(4),e.abrupt("return",{success:!1,error:e.t0});case 16:return e.abrupt("return",null);case 17:case"end":return e.stop()}}),e,null,[[4,13]])})))).apply(this,arguments)}function lr(){return(lr=v(g.a.mark((function e(n){var t,r,a;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=n.state,r=n.api,!t.member){e.next=14;break}return e.prev=2,e.next=5,r.member.sessionData();case 5:if(!(a=e.sent)){e.next=8;break}return e.abrupt("return",{member:a,success:!0});case 8:return e.abrupt("return",null);case 11:return e.prev=11,e.t0=e.catch(2),e.abrupt("return",{success:!1,error:e.t0});case 14:return e.abrupt("return",null);case 15:case"end":return e.stop()}}),e,null,[[2,11]])})))).apply(this,arguments)}function ur(){return(ur=v(g.a.mark((function e(n){var t,r,a,o,i,l,u,s,p,f,h,m,b,v;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.data,r=n.state,a=n.api,e.next=3,Promise.all([or({data:t,state:r,api:a}),rr({data:t,state:r,api:a})]);case 3:if(o=e.sent,i=c(o,2),l=i[0],u=i[1],!l||!u){e.next=14;break}if(!u.success){e.next=10;break}return e.abrupt("return",d(d({action:"updateProfile:success"},l.success?{member:l.member}:{}),{},{page:"accountHome",popupNotification:Je({type:"updateProfile:success",autoHide:!0,closeable:!0,status:"success",state:r,message:"Check your inbox to verify email update"})}));case 10:return s=l.success?"Failed to send verification email":"Failed to update account data",e.abrupt("return",d(d({action:"updateProfile:failed"},l.success?{member:l.member}:{}),{},{popupNotification:Je({type:"updateProfile:failed",autoHide:!0,closeable:!0,status:"error",message:s,state:r})}));case 14:if(!l){e.next=21;break}return p=l.success?"updateProfile:success":"updateProfile:failed",f=l.success?"success":"error",h=l.success?"Account details updated successfully":"Failed to update account details",e.abrupt("return",d(d(d({action:p},l.success?{member:l.member}:{}),l.success?{page:"accountHome"}:{}),{},{popupNotification:Je({type:p,autoHide:l.success,closeable:!0,status:f,state:r,message:h})}));case 21:if(!u){e.next=26;break}return m=u.success?"updateProfile:success":"updateProfile:failed",b=u.success?"success":"error",v=u.success?"Check your inbox to verify email update":"Failed to send verification email",e.abrupt("return",d(d({action:m},u.success?{page:"accountHome"}:{}),{},{popupNotification:Je({type:m,autoHide:u.success,closeable:!0,status:b,state:r,message:v})}));case 26:return e.abrupt("return",{action:"updateProfile:success",page:"accountHome",popupNotification:Je({type:"updateProfile:success",autoHide:!0,closeable:!0,status:"success",state:r,message:"Account details updated successfully"})});case 27:case"end":return e.stop()}}),e)})))).apply(this,arguments)}d(d({},Vt),{},{portal_plans:["free","monthly","yearly"]});var cr={togglePopup:function(e){return{showPopup:!e.state.showPopup}},openPopup:function(e){var n=e.data;return d({showPopup:!0,page:n.page},n.pageQuery?{pageQuery:n.pageQuery}:{})},closePopup:qt,switchPage:function(e){var n=e.data;return{page:n.page,popupNotification:null,lastPage:n.lastPage||null}},openNotification:function(e){return d({showNotification:!0},e.data)},closeNotification:function(e){return e.state,{showNotification:!1}},back:function(e){var n=e.state;return n.lastPage?{page:n.lastPage}:qt({state:n})},signout:function(e){return Kt.apply(this,arguments)},signin:function(e){return Yt.apply(this,arguments)},signup:function(e){return Jt.apply(this,arguments)},updateSubscription:function(e){return Xt.apply(this,arguments)},cancelSubscription:function(e){return Zt.apply(this,arguments)},updateNewsletter:function(e){return tr.apply(this,arguments)},updateProfile:function(e){return ur.apply(this,arguments)},refreshMemberData:function(e){return lr.apply(this,arguments)},clearPopupNotification:function(){return nr.apply(this,arguments)},editBilling:function(e){return er.apply(this,arguments)},checkoutPlan:function(e){return Gt.apply(this,arguments)}};function sr(e){return pr.apply(this,arguments)}function pr(){return(pr=v(g.a.mark((function e(n){var t,r,a,o,i;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=n.action,r=n.data,a=n.state,o=n.api,!(i=cr[t])){e.next=9;break}return e.next=5,i({data:r,state:a,api:o});case 5:if(e.t0=e.sent,e.t0){e.next=8;break}e.t0={};case 8:return e.abrupt("return",e.t0);case 9:return e.abrupt("return",{});case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}t(13);var fr=t(0),dr={showPopup:!0,site:Vt,member:$t.paid,page:"accountHome"},hr=function(e){E(t,e);var n=_(t);function t(e){var r;return y(this,t),r=n.call(this,e),e.testState||r.setupCustomTriggerButton(),r.state=e.testState||{site:null,member:null,page:"loading",showPopup:!1,action:"init:running",initStatus:"running",lastPage:null},r}return w(t,[{key:"componentDidMount",value:function(){this.props.testState||this.initSetup()}},{key:"componentDidUpdate",value:function(e,n){n.showPopup!==this.state.showPopup&&this.handleCustomTriggerClassUpdate()}},{key:"componentWillUnmount",value:function(){var e=this;clearTimeout(this.timeoutId),this.customTriggerButtons&&this.customTriggerButtons.forEach((function(n){n.removeEventListener("click",e.clickHandler)}))}},{key:"setupCustomTriggerButton",value:function(){var e=this;this.clickHandler=function(n){n.preventDefault();var t=n.currentTarget,r=t&&t.dataset.portal,a=e.getPageFromLinkPath(r)||{},o=a.page,i=a.pageQuery;"success"===e.state.initStatus&&!e.state.member&&["monthly","yearly"].includes(i)&&We({site:e.state.site,plan:i})&&(Ie(),e.onAction("signup",{plan:Qe(i)})),o&&e.onAction("openPopup",{page:o,pageQuery:i})},this.customTriggerButtons=document.querySelectorAll("[data-portal]")||[],this.customTriggerButtons.forEach((function(n){n.classList.add("gh-portal-close"),n.removeEventListener("click",e.clickHandler),n.addEventListener("click",e.clickHandler)}))}},{key:"handleCustomTriggerClassUpdate",value:function(){var e=this;this.customTriggerButtons.forEach((function(n){var t=e.state.showPopup?"gh-portal-open":"gh-portal-close",r=e.state.showPopup?"gh-portal-close":"gh-portal-open";n.classList.add(t),n.classList.remove(r)}))}},{key:"initSetup",value:function(){var e=v(g.a.mark((function e(){var n,t,r,a,o,i,l,u,c,s=this;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.fetchData();case 3:n=e.sent,t=n.site,r=n.member,a=n.page,o=n.showPopup,i=n.popupNotification,l=n.lastPage,u=n.pageQuery,c={site:t,member:r,page:a,lastPage:l,pageQuery:u,showPopup:o,popupNotification:i,action:"init:success",initStatus:"success"},!r&&["monthly","yearly"].includes(u)&&We({site:t,plan:u})&&(Ie(),this.onAction("signup",{plan:Qe(u)})),this.setState(c),this.hashHandler=function(){s.updateStateForPreviewLinks()},window.addEventListener("hashchange",this.hashHandler,!1),e.next=22;break;case 18:e.prev=18,e.t0=e.catch(0),console.error("[Portal] Failed to initialize:",e.t0),this.setState({action:"init:failed",initStatus:"failed"});case 22:case"end":return e.stop()}}),e,this,[[0,18]])})));return function(){return e.apply(this,arguments)}}()},{key:"fetchData",value:function(){var e=v(g.a.mark((function e(){var n,t,r,a,o,i,l,u,c,s,p,f,m,b,v;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.fetchApiData();case 2:return n=e.sent,t=n.site,r=n.member,a=this.fetchDevData(),o=a.site,i=h(a,["site"]),l=this.fetchLinkData(),u=l.site,c=h(l,["site"]),s=this.fetchPreviewData(),p=s.site,f=h(s,["site"]),m=this.fetchNotificationData(),b=m.site,v=h(m,["site"]),e.abrupt("return",d(d(d(d({member:r,page:"",site:d(d(d(d(d(d({},t),u),p),b),o),{},{plans:d(d(d({},(o||{}).plans),(t||{}).plans),(p||{}).plans)})},i),c),v),f));case 11:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"fetchDevData",value:function(){return tn(["dev"])?dr:{}}},{key:"fetchQueryStrData",value:function(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=new URLSearchParams(n),r={site:{plans:{}}},a=[],o=s(t.entries());try{for(o.s();!(e=o.n()).done;){var i=e.value,l=i[0],u=decodeURIComponent(i[1]);if("button"===l)r.site.portal_button=JSON.parse(u);else if("name"===l)r.site.portal_name=JSON.parse(u);else if("isFree"===l&&JSON.parse(u))a.push("free");else if("isMonthly"===l&&JSON.parse(u))a.push("monthly");else if("isYearly"===l&&JSON.parse(u))a.push("yearly");else if("plans"===l)r.site.portal_plans=u?u.split(","):[];else if("page"===l&&u)r.page=u;else if("accentColor"!==l||""!==u&&!u)if("buttonIcon"===l&&u)r.site.portal_button_icon=u;else if("signupButtonText"===l)r.site.portal_button_signup_text=u||"";else if("buttonStyle"===l&&u)r.site.portal_button_style=u;else if("monthlyPrice"!==l||isNaN(Number(u)))if("yearlyPrice"!==l||isNaN(Number(u)))if("currency"===l&&u){var c=u.toUpperCase();r.site.plans.currency=c,r.site.plans.currency_symbol=Ke(c)}else"disableBackground"===l&&JSON.parse(u)&&(r.site.disableBackground=JSON.parse(u));else r.site.plans.yearly=Number(u);else r.site.plans.monthly=Number(u);else r.site.accent_color=u}}catch(e){o.e(e)}finally{o.f()}return r.site.portal_plans=a,r}},{key:"fetchNotificationData",value:function(){var e=Le({billingOnly:!0})||{},n=e.type,t=e.status,r=e.duration,a=e.autoHide,o=e.closeable;return["stripe:billing-update"].includes(n)?"success"===t?{showPopup:!0,popupNotification:Je({type:n,status:t,duration:r,closeable:o,autoHide:a,state:this.state,message:"success"===t?"Billing info updated successfully":""})}:{showPopup:!0}:{}}},{key:"fetchLinkData",value:function(){var e=c(window.location.hash.substr(1).split("?"),1)[0],n=/^\/portal\/?(?:\/(\w+(?:\/\w+)?))?\/?$/;if(e&&n.test(e)){var t=c(e.match(n),2)[1],r=this.getPageFromLinkPath(t)||{},a=r.page,o=r.pageQuery,i=["accountPlan","accountProfile"].includes(a)?"accountHome":null;return d(d(d({showPopup:!["monthly","yearly"].includes(o)},a?{page:a}:{}),o?{pageQuery:o}:{}),i?{lastPage:i}:{})}return{}}},{key:"fetchPreviewData",value:function(){var e=c(window.location.hash.substr(1).split("?"),2)[1];if(tn(["preview"])){var n=this.fetchQueryStrData(e);return n.showPopup=!0,n}return{}}},{key:"getColorOverride",value:function(){var e=document.querySelector("script[data-ghost]");return!(!e||!e.dataset.accentColor)&&e.dataset.accentColor}},{key:"fetchApiData",value:function(){var e=v(g.a.mark((function e(){var n,t,r,a,o;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=this.props.siteUrl,this.GhostApi=Qt({siteUrl:n}),e.next=5,this.GhostApi.init();case 5:return t=e.sent,r=t.site,a=t.member,this.setupFirstPromoter({site:r,member:a}),(o=this.getColorOverride())&&(r.accent_color=o),e.abrupt("return",{site:r,member:a});case 14:if(e.prev=14,e.t0=e.catch(0),!tn(["dev","test"])){e.next=18;break}return e.abrupt("return",{});case 18:throw e.t0;case 19:case"end":return e.stop()}}),e,this,[[0,14]])})));return function(){return e.apply(this,arguments)}}()},{key:"setupFirstPromoter",value:function(e){var n=e.site,t=e.member,r=function(e){var n=e.site;return n&&n.firstpromoter_id}({site:n}),a=function(e){var n=e.site;try{return new URL(n.url).origin.replace(/^http(s?):\/\//,"").replace(/\/$/,"")}catch(e){return n.url.replace(/^http(s?):\/\//,"").replace(/\/$/,"")}}({site:n});if(r&&a){var o=document.createElement("script");o.type="text/javascript",o.async=!0,o.src="https://cdn.firstpromoter.com/fprom.js",o.onload=o.onreadystatechange=function(){var e=this.readyState;if(!e||"complete"===e||"loaded"===e)try{if(window.$FPROM.init(r,a),t){var n=t.email,o=t.uuid;if(window.$FPROM)window.$FPROM.trackSignup({email:n,uid:o});else{var i=window._fprom||[];window._fprom=i,i.push(["event","signup"]),i.push(["email",n]),i.push(["uid",o])}}}catch(e){}};var i=document.getElementsByTagName("script")[0];i.parentNode.insertBefore(o,i)}}},{key:"onAction",value:function(){var e=v(g.a.mark((function e(n,t){var r,a,o=this;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return clearTimeout(this.timeoutId),this.setState({action:"".concat(n,":running")}),e.prev=2,e.next=5,sr({action:n,data:t,state:this.state,api:this.GhostApi});case 5:r=e.sent,this.setState(r),r&&r.action&&!r.action.includes(":failed")&&(this.timeoutId=setTimeout((function(){o.setState({action:""})}),2e3)),e.next=14;break;case 10:e.prev=10,e.t0=e.catch(2),a=Je({type:"".concat(n,":failed"),autoHide:!0,closeable:!0,status:"error",state:this.state,meta:{error:e.t0}}),this.setState({action:"".concat(n,":failed"),popupNotification:a});case 14:case"end":return e.stop()}}),e,this,[[2,10]])})));return function(n,t){return e.apply(this,arguments)}}()},{key:"updateStateForPreviewLinks",value:function(){var e=this.fetchPreviewData(),n=e.site,t=h(e,["site"]),r=this.fetchLinkData(),a=r.site,o=h(r,["site"]),i=d(d({site:d(d(d(d({},this.state.site),a||{}),n||{}),{},{plans:d(d(d({},this.state.site&&this.state.site.plans),(a||{}).plans),(n||{}).plans)})},o),t);!this.state.member&&["monthly","yearly"].includes(i.pageQuery)&&We({site:i.site,plan:i.pageQuery})&&(Ie(),this.onAction("signup",{plan:Qe(i.pageQuery)})),this.setState(i)}},{key:"getStripeUrlParam",value:function(){var e=new URL(window.location.href);return e.searchParams.get("stripe")||e.searchParams.get("portal-stripe")}},{key:"getPageFromPath",value:function(e){return"signup"===e?"signup":"signin"===e?"signin":"account"===e?"accountHome":"account/plans"===e?"accountPlan":"account/profile"===e?"accountProfile":void 0}},{key:"getPageFromLinkPath",value:function(e){return"signup"===e?{page:"signup"}:"signup/free"===e?{page:"signup",pageQuery:"free"}:"signup/monthly"===e?{page:"signup",pageQuery:"monthly"}:"signup/yearly"===e?{page:"signup",pageQuery:"yearly"}:"signin"===e?{page:"signin"}:"account"===e?{page:"accountHome"}:"account/plans"===e?{page:"accountPlan"}:"account/profile"===e?{page:"accountProfile"}:{}}},{key:"getAccentColor",value:function(){var e=(this.state.site||{}).accent_color;return(void 0===e?"#15171A":e)||"#15171A"}},{key:"getContextPage",value:function(e){var n=e.page,t=e.member;return n||(n=t?"accountHome":"signup"),"accountPlan"===n&&Me({member:t})&&(n="accountHome"),Rt({page:n})}},{key:"getContextMember",value:function(e){var n=e.page,t=e.member;return tn(["dev","preview"])?{page:n}.page.includes("account")?tn(["dev"])?t||$t.free:tn(["preview"])?$t.preview:$t.paid:null:t}},{key:"getContextFromState",value:function(){var e=this,n=this.state,t=n.site,r=n.member,a=n.action,o=n.page,i=n.lastPage,l=n.showPopup,u=n.pageQuery,c=n.popupNotification,s=this.getContextPage({page:o,member:r}),p=this.getContextMember({page:s,member:r});return{site:t,action:a,brandColor:this.getAccentColor(),page:s,pageQuery:u,member:p,lastPage:i,showPopup:l,popupNotification:c,onAction:function(n,t){return e.onAction(n,t)}}}},{key:"render",value:function(){return"success"===this.state.initStatus?fr.createElement(M.Provider,{value:this.getContextFromState()},fr.createElement(Wt,null),fr.createElement(fe,null),fr.createElement(en,null)):null}}]),t}(fr.Component),mr=t(14);!function(){var e=function(){var e=document.querySelector("script[data-ghost]");return e?e.dataset.ghost:""}()||window.location.origin;(function(e){var n=e.siteUrl;!function(){var e=document.createElement("div");e.id="ghost-portal-root",document.body.appendChild(e)}(),mr({siteUrl:n}),function(){var e=new URL(window.location.href);e.searchParams.get("token")&&(e.searchParams.delete("token"),window.history.replaceState({},document.title,e.href))}()})({siteUrl:e}),i.a.render(a.a.createElement(a.a.StrictMode,null,a.a.createElement(hr,{siteUrl:e})),document.getElementById("ghost-portal-root"))}()}])}]);