diff --git a/docs/index.js b/docs/index.js index 7c53b27..56c2981 100644 --- a/docs/index.js +++ b/docs/index.js @@ -1,1024 +1,78264 @@ /*! Menduz diagrams */ -const buildInformation={date:"2020-08-22T19:10:08.527Z",commit:"HEAD",ref:"?"};!function(){"use strict";function unwrapExports(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function createCommonjsModule(e,t){return e(t={exports:{}},t.exports),t.exports}function getCjsExportFromNamespace(e){return e&&e.default||e} -/* +const buildInformation = { + "date": "2020-08-22T19:17:58.952Z", + "commit": "HEAD", + "ref": "?" +}; +(function () { + 'use strict'; + + function unwrapExports (x) { + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; + } + + function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; + } + + function getCjsExportFromNamespace (n) { + return n && n['default'] || n; + } + + /* object-assign (c) Sindre Sorhus @license MIT - */var getOwnPropertySymbols=Object.getOwnPropertySymbols,hasOwnProperty=Object.prototype.hasOwnProperty,propIsEnumerable=Object.prototype.propertyIsEnumerable;function toObject(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function shouldUseNative(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}var objectAssign=shouldUseNative()?Object.assign:function(e,t){for(var n,r,i=toObject(e),o=1;oQ.length&&Q.push(e)}function T(e,t,n,r){var i=typeof e;"undefined"!==i&&"boolean"!==i||(e=null);var o=!1;if(null===e)o=!0;else switch(i){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case p:case q:o=!0}}if(o)return n(r,e,""===t?"."+U(e,0):t),1;if(o=0,t=""===t?".":t+":",Array.isArray(e))for(var a=0;a=w},a=function(){},t.unstable_forceFrameRate=function(e){0>e||125>>1,i=e[r];if(!(void 0!==i&&0C(a,n))void 0!==l&&0>C(l,a)?(e[r]=l,e[s]=n,r=s):(e[r]=a,e[o]=n,r=o);else{if(!(void 0!==l&&0>C(l,n)))break e;e[r]=l,e[s]=n,r=s}}}return t}return null}function C(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var P=[],A=[],I=1,D=null,R=3,O=!1,N=!1,M=!1;function F(e){for(var t=S(A);null!==t;){if(null===t.callback)x(A);else{if(!(t.startTime<=e))break;x(A),t.sortIndex=t.expirationTime,k(P,t)}t=S(A)}}function L(e){if(M=!1,F(e),!N)if(null!==S(P))N=!0,n(j);else{var t=S(A);null!==t&&r(L,t.startTime-e)}}function j(e,n){N=!1,M&&(M=!1,i()),O=!0;var a=R;try{for(F(n),D=S(P);null!==D&&(!(D.expirationTime>n)||e&&!o());){var s=D.callback;if(null!==s){D.callback=null,R=D.priorityLevel;var l=s(D.expirationTime<=n);n=t.unstable_now(),"function"==typeof l?D.callback=l:D===S(P)&&x(P),F(n)}else x(P);D=S(P)}if(null!==D)var c=!0;else{var u=S(A);null!==u&&r(L,u.startTime-n),c=!1}return c}finally{D=null,R=a,O=!1}}function $(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var B=a;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){N||O||(N=!0,n(j))},t.unstable_getCurrentPriorityLevel=function(){return R},t.unstable_getFirstCallbackNode=function(){return S(P)},t.unstable_next=function(e){switch(R){case 1:case 2:case 3:var t=3;break;default:t=R}var n=R;R=t;try{return e()}finally{R=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=B,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=R;R=e;try{return t()}finally{R=n}},t.unstable_scheduleCallback=function(e,o,a){var s=t.unstable_now();if("object"==typeof a&&null!==a){var l=a.delay;l="number"==typeof l&&0s?(e.sortIndex=l,k(A,e),null===S(P)&&e===S(A)&&(M?i():M=!0,r(L,l-s))):(e.sortIndex=a,k(P,e),N||O||(N=!0,n(j))),e},t.unstable_shouldYield=function(){var e=t.unstable_now();F(e);var n=S(P);return n!==D&&null!==D&&null!==n&&null!==n.callback&&n.startTime<=e&&n.expirationTimet}return!1}function v$1(e,t,n,r,i,o){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o}var C$1={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){C$1[e]=new v$1(e,0,!1,e,null,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];C$1[t]=new v$1(t,1,!1,e[1],null,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){C$1[e]=new v$1(e,2,!1,e.toLowerCase(),null,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){C$1[e]=new v$1(e,2,!1,e,null,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){C$1[e]=new v$1(e,3,!1,e.toLowerCase(),null,!1)})),["checked","multiple","muted","selected"].forEach((function(e){C$1[e]=new v$1(e,3,!0,e,null,!1)})),["capture","download"].forEach((function(e){C$1[e]=new v$1(e,4,!1,e,null,!1)})),["cols","rows","size","span"].forEach((function(e){C$1[e]=new v$1(e,6,!1,e,null,!1)})),["rowSpan","start"].forEach((function(e){C$1[e]=new v$1(e,5,!1,e.toLowerCase(),null,!1)}));var Ua=/[\-:]([a-z])/g;function Va(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(Ua,Va);C$1[t]=new v$1(t,1,!1,e,null,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(Ua,Va);C$1[t]=new v$1(t,1,!1,e,"http://www.w3.org/1999/xlink",!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(Ua,Va);C$1[t]=new v$1(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1)})),["tabIndex","crossOrigin"].forEach((function(e){C$1[e]=new v$1(e,1,!1,e.toLowerCase(),null,!1)})),C$1.xlinkHref=new v$1("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0),["src","href","action","formAction"].forEach((function(e){C$1[e]=new v$1(e,1,!1,e.toLowerCase(),null,!0)}));var Wa=react.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function Xa(e,t,n,r){var i=C$1.hasOwnProperty(t)?C$1[t]:null;(null!==i?0===i.type:!r&&(2=n.length))throw Error(u$1(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:rb(n)}}function Kb(e,t){var n=rb(t.value),r=rb(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function Lb(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}var Mb={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function Nb(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 Ob(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?Nb(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var Pb,Qb=function(e){return"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction((function(){return e(t,n)}))}:e}((function(e,t){if(e.namespaceURI!==Mb.svg||"innerHTML"in e)e.innerHTML=t;else{for((Pb=Pb||document.createElement("div")).innerHTML=""+t.valueOf().toString()+"",t=Pb.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}}));function Rb(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}function Sb(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Tb={animationend:Sb("Animation","AnimationEnd"),animationiteration:Sb("Animation","AnimationIteration"),animationstart:Sb("Animation","AnimationStart"),transitionend:Sb("Transition","TransitionEnd")},Ub={},Vb={};function Wb(e){if(Ub[e])return Ub[e];if(!Tb[e])return e;var t,n=Tb[e];for(t in n)if(n.hasOwnProperty(t)&&t in Vb)return Ub[e]=n[t];return e}ya&&(Vb=document.createElement("div").style,"AnimationEvent"in window||(delete Tb.animationend.animation,delete Tb.animationiteration.animation,delete Tb.animationstart.animation),"TransitionEvent"in window||delete Tb.transitionend.transition);var Xb=Wb("animationend"),Yb=Wb("animationiteration"),Zb=Wb("animationstart"),$b=Wb("transitionend"),ac="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),bc=new("function"==typeof WeakMap?WeakMap:Map);function cc(e){var t=bc.get(e);return void 0===t&&(t=new Map,bc.set(e,t)),t}function dc(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!=(1026&(t=e).effectTag)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function ec(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function fc(e){if(dc(e)!==e)throw Error(u$1(188))}function gc(e){var t=e.alternate;if(!t){if(null===(t=dc(e)))throw Error(u$1(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(null===i)break;var o=i.alternate;if(null===o){if(null!==(r=i.return)){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return fc(i),e;if(o===r)return fc(i),t;o=o.sibling}throw Error(u$1(188))}if(n.return!==r.return)n=i,r=o;else{for(var a=!1,s=i.child;s;){if(s===n){a=!0,n=i,r=o;break}if(s===r){a=!0,r=i,n=o;break}s=s.sibling}if(!a){for(s=o.child;s;){if(s===n){a=!0,n=o,r=i;break}if(s===r){a=!0,r=o,n=i;break}s=s.sibling}if(!a)throw Error(u$1(189))}}if(n.alternate!==r)throw Error(u$1(190))}if(3!==n.tag)throw Error(u$1(188));return n.stateNode.current===n?e:t}function hc(e){if(!(e=gc(e)))return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}function ic(e,t){if(null==t)throw Error(u$1(30));return null==e?t:Array.isArray(e)?Array.isArray(t)?(e.push.apply(e,t),e):(e.push(t),e):Array.isArray(t)?[e].concat(t):[e,t]}function jc(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)}var kc=null;function lc(e){if(e){var t=e._dispatchListeners,n=e._dispatchInstances;if(Array.isArray(t))for(var r=0;rpc.length&&pc.push(e)}function rc(e,t,n,r){if(pc.length){var i=pc.pop();return i.topLevelType=e,i.eventSystemFlags=r,i.nativeEvent=t,i.targetInst=n,i}return{topLevelType:e,eventSystemFlags:r,nativeEvent:t,targetInst:n,ancestors:[]}}function sc(e){var t=e.targetInst,n=t;do{if(!n){e.ancestors.push(n);break}var r=n;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!==(t=n.tag)&&6!==t||e.ancestors.push(n),n=tc(r)}while(n);for(n=0;n=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=ud(r)}}function wd(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?wd(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function xd(){for(var e=window,t=td();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(!n)break;t=td((e=t.contentWindow).document)}return t}function yd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var zd="$",Ad="/$",Bd="$?",Cd="$!",Dd=null,Ed=null;function Fd(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function Gd(e,t){return"textarea"===e||"option"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var Hd="function"==typeof setTimeout?setTimeout:void 0,Id="function"==typeof clearTimeout?clearTimeout:void 0;function Jd(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break}return e}function Kd(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if(n===zd||n===Cd||n===Bd){if(0===t)return e;t--}else n===Ad&&t++}e=e.previousSibling}return null}var Ld=Math.random().toString(36).slice(2),Md="__reactInternalInstance$"+Ld,Nd="__reactEventHandlers$"+Ld,Od="__reactContainere$"+Ld;function tc(e){var t=e[Md];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Od]||n[Md]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=Kd(e);null!==e;){if(n=e[Md])return n;e=Kd(e)}return t}n=(e=n).parentNode}return null}function Nc(e){return!(e=e[Md]||e[Od])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function Pd(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(u$1(33))}function Qd(e){return e[Nd]||null}function Rd(e){do{e=e.return}while(e&&5!==e.tag);return e||null}function Sd(e,t){var n=e.stateNode;if(!n)return null;var r=la(n);if(!r)return null;n=r[t];e:switch(t){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(n&&"function"!=typeof n)throw Error(u$1(231,t,typeof n));return n}function Td(e,t,n){(t=Sd(e,n.dispatchConfig.phasedRegistrationNames[t]))&&(n._dispatchListeners=ic(n._dispatchListeners,t),n._dispatchInstances=ic(n._dispatchInstances,e))}function Ud(e){if(e&&e.dispatchConfig.phasedRegistrationNames){for(var t=e._targetInst,n=[];t;)n.push(t),t=Rd(t);for(t=n.length;0this.eventPool.length&&this.eventPool.push(e)}function de(e){e.eventPool=[],e.getPooled=ee,e.release=fe}objectAssign(G$1.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=be)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=be)},persist:function(){this.isPersistent=be},isPersistent:ce,destructor:function(){var e,t=this.constructor.Interface;for(e in t)this[e]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null,this.isPropagationStopped=this.isDefaultPrevented=ce,this._dispatchInstances=this._dispatchListeners=null}}),G$1.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},G$1.extend=function(e){function t(){}function n(){return r.apply(this,arguments)}var r=this;t.prototype=r.prototype;var i=new t;return objectAssign(i,n.prototype),n.prototype=i,n.prototype.constructor=n,n.Interface=objectAssign({},r.Interface,e),n.extend=r.extend,de(n),n},de(G$1);var ge=G$1.extend({data:null}),he=G$1.extend({data:null}),ie=[9,13,27,32],je=ya&&"CompositionEvent"in window,ke=null;ya&&"documentMode"in document&&(ke=document.documentMode);var le=ya&&"TextEvent"in window&&!ke,me=ya&&(!je||ke&&8=ke),ne=String.fromCharCode(32),oe={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(" ")}},pe=!1;function qe(e,t){switch(e){case"keyup":return-1!==ie.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"blur":return!0;default:return!1}}function re(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var se=!1;function te(e,t){switch(e){case"compositionend":return re(t);case"keypress":return 32!==t.which?null:(pe=!0,ne);case"textInput":return(e=t.data)===ne&&pe?null:e;default:return null}}function ue(e,t){if(se)return"compositionend"===e||!je&&qe(e,t)?(e=ae(),$d=Zd=Yd=null,se=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=document.documentMode,df={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ")}},ef=null,ff=null,gf=null,hf=!1;function jf(e,t){var n=t.window===t?t.document:9===t.nodeType?t:t.ownerDocument;return hf||null==ef||ef!==td(n)?null:("selectionStart"in(n=ef)&&yd(n)?n={start:n.selectionStart,end:n.selectionEnd}:n={anchorNode:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset},gf&&bf(gf,n)?null:(gf=n,(e=G$1.getPooled(df.select,ff,e,t)).type="select",e.target=ef,Xd(e),e))}var kf={eventTypes:df,extractEvents:function(e,t,n,r,i,o){if(!(o=!(i=o||(r.window===r?r.document:9===r.nodeType?r:r.ownerDocument)))){e:{i=cc(i),o=wa.onSelect;for(var a=0;azf||(e.current=yf[zf],yf[zf]=null,zf--)}function I$1(e,t){zf++,yf[zf]=e.current,e.current=t}var Af={},J$1={current:Af},K$1={current:!1},Bf=Af;function Cf(e,t){var n=e.type.contextTypes;if(!n)return Af;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i,o={};for(i in n)o[i]=t[i];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function L$1(e){return null!=(e=e.childContextTypes)}function Df(){H$1(K$1),H$1(J$1)}function Ef(e,t,n){if(J$1.current!==Af)throw Error(u$1(168));I$1(J$1,t),I$1(K$1,n)}function Ff(e,t,n){var r=e.stateNode;if(e=t.childContextTypes,"function"!=typeof r.getChildContext)return n;for(var i in r=r.getChildContext())if(!(i in e))throw Error(u$1(108,pb(t)||"Unknown",i));return objectAssign({},n,{},r)}function Gf(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Af,Bf=J$1.current,I$1(J$1,e),I$1(K$1,K$1.current),!0}function Hf(e,t,n){var r=e.stateNode;if(!r)throw Error(u$1(169));n?(e=Ff(e,t,Bf),r.__reactInternalMemoizedMergedChildContext=e,H$1(K$1),H$1(J$1),I$1(J$1,e)):H$1(K$1),I$1(K$1,n)}var If=scheduler.unstable_runWithPriority,Jf=scheduler.unstable_scheduleCallback,Kf=scheduler.unstable_cancelCallback,Lf=scheduler.unstable_requestPaint,Mf=scheduler.unstable_now,Nf=scheduler.unstable_getCurrentPriorityLevel,Of=scheduler.unstable_ImmediatePriority,Pf=scheduler.unstable_UserBlockingPriority,Qf=scheduler.unstable_NormalPriority,Rf=scheduler.unstable_LowPriority,Sf=scheduler.unstable_IdlePriority,Tf={},Uf=scheduler.unstable_shouldYield,Vf=void 0!==Lf?Lf:function(){},Wf=null,Xf=null,Yf=!1,Zf=Mf(),$f=1e4>Zf?Mf:function(){return Mf()-Zf};function ag(){switch(Nf()){case Of:return 99;case Pf:return 98;case Qf:return 97;case Rf:return 96;case Sf:return 95;default:throw Error(u$1(332))}}function bg(e){switch(e){case 99:return Of;case 98:return Pf;case 97:return Qf;case 96:return Rf;case 95:return Sf;default:throw Error(u$1(332))}}function cg(e,t){return e=bg(e),If(e,t)}function dg(e,t,n){return e=bg(e),Jf(e,t,n)}function eg(e){return null===Wf?(Wf=[e],Xf=Jf(Of,fg)):Wf.push(e),Tf}function gg(){if(null!==Xf){var e=Xf;Xf=null,Kf(e)}fg()}function fg(){if(!Yf&&null!==Wf){Yf=!0;var e=0;try{var t=Wf;cg(99,(function(){for(;e=t&&(rg=!0),e.firstContext=null)}function sg(e,t){if(mg!==e&&!1!==t&&0!==t)if("number"==typeof t&&1073741823!==t||(mg=e,t=1073741823),t={context:e,observedBits:t,next:null},null===lg){if(null===kg)throw Error(u$1(308));lg=t,kg.dependencies={expirationTime:0,firstContext:t,responders:null}}else lg=lg.next=t;return e._currentValue}var tg=!1;function ug(e){e.updateQueue={baseState:e.memoizedState,baseQueue:null,shared:{pending:null},effects:null}}function vg(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,baseQueue:e.baseQueue,shared:e.shared,effects:e.effects})}function wg(e,t){return(e={expirationTime:e,suspenseConfig:t,tag:0,payload:null,callback:null,next:null}).next=e}function xg(e,t){if(null!==(e=e.updateQueue)){var n=(e=e.shared).pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}}function yg(e,t){var n=e.alternate;null!==n&&vg(n,e),null===(n=(e=e.updateQueue).baseQueue)?(e.baseQueue=t.next=t,t.next=t):(t.next=n.next,n.next=t)}function zg(e,t,n,r){var i=e.updateQueue;tg=!1;var o=i.baseQueue,a=i.shared.pending;if(null!==a){if(null!==o){var s=o.next;o.next=a.next,a.next=s}o=a,i.shared.pending=null,null!==(s=e.alternate)&&(null!==(s=s.updateQueue)&&(s.baseQueue=a))}if(null!==o){s=o.next;var l=i.baseState,c=0,u=null,h=null,p=null;if(null!==s)for(var f=s;;){if((a=f.expirationTime)c&&(c=a)}else{null!==p&&(p=p.next={expirationTime:1073741823,suspenseConfig:f.suspenseConfig,tag:f.tag,payload:f.payload,callback:f.callback,next:null}),Ag(a,f.suspenseConfig);e:{var m=e,g=f;switch(a=t,d=n,g.tag){case 1:if("function"==typeof(m=g.payload)){l=m.call(d,l,a);break e}l=m;break e;case 3:m.effectTag=-4097&m.effectTag|64;case 0:if(null==(a="function"==typeof(m=g.payload)?m.call(d,l,a):m))break e;l=objectAssign({},l,a);break e;case 2:tg=!0}}null!==f.callback&&(e.effectTag|=32,null===(a=i.effects)?i.effects=[f]:a.push(f))}if(null===(f=f.next)||f===s){if(null===(a=i.shared.pending))break;f=o.next=a.next,a.next=s,i.baseQueue=o=a,i.shared.pending=null}}null===p?u=l:p.next=h,i.baseState=u,i.baseQueue=p,Bg(c),e.expirationTime=c,e.memoizedState=l}}function Cg(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;tm?(g=d,d=null):g=d.sibling;var y=p(i,d,s[m],l);if(null===y){null===d&&(d=g);break}e&&d&&null===y.alternate&&t(i,d),a=o(y,a,m),null===u?c=y:u.sibling=y,u=y,d=g}if(m===s.length)return n(i,d),c;if(null===d){for(;mm?(g=d,d=null):g=d.sibling;var v=p(i,d,y.value,l);if(null===v){null===d&&(d=g);break}e&&d&&null===v.alternate&&t(i,d),a=o(v,a,m),null===u?c=v:u.sibling=v,u=v,d=g}if(y.done)return n(i,d),c;if(null===d){for(;!y.done;m++,y=s.next())null!==(y=h(i,y.value,l))&&(a=o(y,a,m),null===u?c=y:u.sibling=y,u=y);return c}for(d=r(i,d);!y.done;m++,y=s.next())null!==(y=f(d,i,m,y.value,l))&&(e&&null!==y.alternate&&d.delete(null===y.key?m:y.key),a=o(y,a,m),null===u?c=y:u.sibling=y,u=y);return e&&d.forEach((function(e){return t(i,e)})),c}return function(e,r,o,s){var l="object"==typeof o&&null!==o&&o.type===ab&&null===o.key;l&&(o=o.props.children);var c="object"==typeof o&&null!==o;if(c)switch(o.$$typeof){case Za:e:{for(c=o.key,l=r;null!==l;){if(l.key===c){switch(l.tag){case 7:if(o.type===ab){n(e,l.sibling),(r=i(l,o.props.children)).return=e,e=r;break e}break;default:if(l.elementType===o.type){n(e,l.sibling),(r=i(l,o.props)).ref=Pg(e,l,o),r.return=e,e=r;break e}}n(e,l);break}t(e,l),l=l.sibling}o.type===ab?((r=Wg(o.props.children,e.mode,s,o.key)).return=e,e=r):((s=Ug(o.type,o.key,o.props,null,e.mode,s)).ref=Pg(e,r,o),s.return=e,e=s)}return a(e);case $a:e:{for(l=o.key;null!==r;){if(r.key===l){if(4===r.tag&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),(r=i(r,o.children||[])).return=e,e=r;break e}n(e,r);break}t(e,r),r=r.sibling}(r=Vg(o,e.mode,s)).return=e,e=r}return a(e)}if("string"==typeof o||"number"==typeof o)return o=""+o,null!==r&&6===r.tag?(n(e,r.sibling),(r=i(r,o)).return=e,e=r):(n(e,r),(r=Tg(o,e.mode,s)).return=e,e=r),a(e);if(Og(o))return d(e,r,o,s);if(nb(o))return m(e,r,o,s);if(c&&Qg(e,o),void 0===o&&!l)switch(e.tag){case 1:case 0:throw e=e.type,Error(u$1(152,e.displayName||e.name||"Component"))}return n(e,r)}}var Xg=Rg(!0),Yg=Rg(!1),Zg={},$g={current:Zg},ah={current:Zg},bh={current:Zg};function ch(e){if(e===Zg)throw Error(u$1(174));return e}function dh(e,t){switch(I$1(bh,t),I$1(ah,e),I$1($g,Zg),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ob(null,"");break;default:t=Ob(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}H$1($g),I$1($g,t)}function eh(){H$1($g),H$1(ah),H$1(bh)}function fh(e){ch(bh.current);var t=ch($g.current),n=Ob(t,e.type);t!==n&&(I$1(ah,e),I$1($g,n))}function gh(e){ah.current===e&&(H$1($g),H$1(ah))}var M$1={current:0};function hh(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||n.data===Bd||n.data===Cd))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(64&t.effectTag))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function ih(e,t){return{responder:e,props:t}}var jh=Wa.ReactCurrentDispatcher,kh=Wa.ReactCurrentBatchConfig,lh=0,N$1=null,O$1=null,P$1=null,mh=!1;function Q$1(){throw Error(u$1(321))}function nh(e,t){if(null===t)return!1;for(var n=0;no))throw Error(u$1(301));o+=1,P$1=O$1=null,t.updateQueue=null,jh.current=rh,e=n(r,i)}while(t.expirationTime===lh)}if(jh.current=sh,t=null!==O$1&&null!==O$1.next,lh=0,P$1=O$1=N$1=null,mh=!1,t)throw Error(u$1(300));return e}function th(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===P$1?N$1.memoizedState=P$1=e:P$1=P$1.next=e,P$1}function uh(){if(null===O$1){var e=N$1.alternate;e=null!==e?e.memoizedState:null}else e=O$1.next;var t=null===P$1?N$1.memoizedState:P$1.next;if(null!==t)P$1=t,O$1=e;else{if(null===e)throw Error(u$1(310));e={memoizedState:(O$1=e).memoizedState,baseState:O$1.baseState,baseQueue:O$1.baseQueue,queue:O$1.queue,next:null},null===P$1?N$1.memoizedState=P$1=e:P$1=P$1.next=e}return P$1}function vh(e,t){return"function"==typeof t?t(e):t}function wh(e){var t=uh(),n=t.queue;if(null===n)throw Error(u$1(311));n.lastRenderedReducer=e;var r=O$1,i=r.baseQueue,o=n.pending;if(null!==o){if(null!==i){var a=i.next;i.next=o.next,o.next=a}r.baseQueue=i=o,n.pending=null}if(null!==i){i=i.next,r=r.baseState;var s=a=o=null,l=i;do{var c=l.expirationTime;if(cN$1.expirationTime&&(N$1.expirationTime=c,Bg(c))}else null!==s&&(s=s.next={expirationTime:1073741823,suspenseConfig:l.suspenseConfig,action:l.action,eagerReducer:l.eagerReducer,eagerState:l.eagerState,next:null}),Ag(c,l.suspenseConfig),r=l.eagerReducer===e?l.eagerState:e(r,l.action);l=l.next}while(null!==l&&l!==i);null===s?o=r:s.next=a,$e(r,t.memoizedState)||(rg=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=s,n.lastRenderedState=r}return[t.memoizedState,n.dispatch]}function xh(e){var t=uh(),n=t.queue;if(null===n)throw Error(u$1(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(null!==i){n.pending=null;var a=i=i.next;do{o=e(o,a.action),a=a.next}while(a!==i);$e(o,t.memoizedState)||(rg=!0),t.memoizedState=o,null===t.baseQueue&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function yh(e){var t=th();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={pending:null,dispatch:null,lastRenderedReducer:vh,lastRenderedState:e}).dispatch=zh.bind(null,N$1,e),[t.memoizedState,e]}function Ah(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=N$1.updateQueue)?(t={lastEffect:null},N$1.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Bh(){return uh().memoizedState}function Ch(e,t,n,r){var i=th();N$1.effectTag|=e,i.memoizedState=Ah(1|t,n,void 0,void 0===r?null:r)}function Dh(e,t,n,r){var i=uh();r=void 0===r?null:r;var o=void 0;if(null!==O$1){var a=O$1.memoizedState;if(o=a.destroy,null!==r&&nh(r,a.deps))return void Ah(t,n,o,r)}N$1.effectTag|=e,i.memoizedState=Ah(1|t,n,o,r)}function Eh(e,t){return Ch(516,4,e,t)}function Fh(e,t){return Dh(516,4,e,t)}function Gh(e,t){return Dh(4,2,e,t)}function Hh(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Ih(e,t,n){return n=null!=n?n.concat([e]):null,Dh(4,2,Hh.bind(null,t,e),n)}function Jh(){}function Kh(e,t){return th().memoizedState=[e,void 0===t?null:t],e}function Lh(e,t){var n=uh();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&nh(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Mh(e,t){var n=uh();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&nh(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Nh(e,t,n){var r=ag();cg(98>r?98:r,(function(){e(!0)})),cg(97<\/script>",e=e.removeChild(e.firstChild)):"string"==typeof r.is?e=a.createElement(i,{is:r.is}):(e=a.createElement(i),"select"===i&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,i),e[Md]=t,e[Nd]=r,ni(e,t,!1,!1),t.stateNode=e,a=pd(i,r),i){case"iframe":case"object":case"embed":F$1("load",e),s=r;break;case"video":case"audio":for(s=0;sr.tailExpiration&&1t)&&tj.set(e,t))}}function xj(e,t){e.expirationTime=(e=n>(e=e.nextKnownPendingLevel)?n:e)&&t!==e?0:e}function Z$1(e){if(0!==e.lastExpiredTime)e.callbackExpirationTime=1073741823,e.callbackPriority=99,e.callbackNode=eg(yj.bind(null,e));else{var t=zj(e),n=e.callbackNode;if(0===t)null!==n&&(e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90);else{var r=Gg();if(1073741823===t?r=99:1===t||2===t?r=95:r=0>=(r=10*(1073741821-t)-10*(1073741821-r))?99:250>=r?98:5250>=r?97:95,null!==n){var i=e.callbackPriority;if(e.callbackExpirationTime===t&&i>=r)return;n!==Tf&&Kf(n)}e.callbackExpirationTime=t,e.callbackPriority=r,t=1073741823===t?eg(yj.bind(null,e)):dg(r,Bj.bind(null,e),{timeout:10*(1073741821-t)-$f()}),e.callbackNode=t}}}function Bj(e,t){if(wj=0,t)return Cj(e,t=Gg()),Z$1(e),null;var n=zj(e);if(0!==n){if(t=e.callbackNode,(W$1&(fj|gj))!==V$1)throw Error(u$1(327));if(Dj(),e===T$1&&n===U$1||Ej(e,n),null!==X$1){var r=W$1;W$1|=fj;for(var i=Fj();;)try{Gj();break}catch(t){Hj(e,t)}if(ng(),W$1=r,cj.current=i,S$1===hj)throw t=kj,Ej(e,n),xi(e,n),Z$1(e),t;if(null===X$1)switch(i=e.finishedWork=e.current.alternate,e.finishedExpirationTime=n,r=S$1,T$1=null,r){case ti:case hj:throw Error(u$1(345));case ij:Cj(e,2=n){e.lastPingedTime=n,Ej(e,n);break}}if(0!==(o=zj(e))&&o!==n)break;if(0!==r&&r!==n){e.lastPingedTime=r;break}e.timeoutHandle=Hd(Jj.bind(null,e),i);break}Jj(e);break;case vi:if(xi(e,n),n===(r=e.lastSuspendedTime)&&(e.nextKnownPendingLevel=Ij(i)),oj&&(0===(i=e.lastPingedTime)||i>=n)){e.lastPingedTime=n,Ej(e,n);break}if(0!==(i=zj(e))&&i!==n)break;if(0!==r&&r!==n){e.lastPingedTime=r;break}if(1073741823!==mj?r=10*(1073741821-mj)-$f():1073741823===lj?r=0:(r=10*(1073741821-lj)-5e3,0>(r=(i=$f())-r)&&(r=0),(n=10*(1073741821-n)-i)<(r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*bj(r/1960))-r)&&(r=n)),10=(r=0|a.busyMinDurationMs)?r=0:(i=0|a.busyDelayMs,r=(o=$f()-(10*(1073741821-o)-(0|a.timeoutMs||5e3)))<=i?0:i+r-o),10 component higher in the tree to provide a loading indicator or placeholder to display."+qb(a))}S$1!==jj&&(S$1=ij),s=Ai(s,a),h=o;do{switch(h.tag){case 3:l=s,h.effectTag|=4096,h.expirationTime=t,yg(h,Xi(h,l,t));break e;case 1:l=s;var b=h.type,w=h.stateNode;if(0==(64&h.effectTag)&&("function"==typeof b.getDerivedStateFromError||null!==w&&"function"==typeof w.componentDidCatch&&(null===aj||!aj.has(w)))){h.effectTag|=4096,h.expirationTime=t,yg(h,$i(h,l,t));break e}}h=h.return}while(null!==h)}X$1=Pj(X$1)}catch(e){t=e;continue}break}}function Fj(){var e=cj.current;return cj.current=sh,null===e?sh:e}function Ag(e,t){ewi&&(wi=e)}function Kj(){for(;null!==X$1;)X$1=Qj(X$1)}function Gj(){for(;null!==X$1&&!Uf();)X$1=Qj(X$1)}function Qj(e){var t=Rj(e.alternate,e,U$1);return e.memoizedProps=e.pendingProps,null===t&&(t=Pj(e)),dj.current=null,t}function Pj(e){X$1=e;do{var t=X$1.alternate;if(e=X$1.return,0==(2048&X$1.effectTag)){if(t=si(t,X$1,U$1),1===U$1||1!==X$1.childExpirationTime){for(var n=0,r=X$1.child;null!==r;){var i=r.expirationTime,o=r.childExpirationTime;i>n&&(n=i),o>n&&(n=o),r=r.sibling}X$1.childExpirationTime=n}if(null!==t)return t;null!==e&&0==(2048&e.effectTag)&&(null===e.firstEffect&&(e.firstEffect=X$1.firstEffect),null!==X$1.lastEffect&&(null!==e.lastEffect&&(e.lastEffect.nextEffect=X$1.firstEffect),e.lastEffect=X$1.lastEffect),1(e=e.childExpirationTime)?t:e}function Jj(e){var t=ag();return cg(99,Sj.bind(null,e,t)),null}function Sj(e,t){do{Dj()}while(null!==rj);if((W$1&(fj|gj))!==V$1)throw Error(u$1(327));var n=e.finishedWork,r=e.finishedExpirationTime;if(null===n)return null;if(e.finishedWork=null,e.finishedExpirationTime=0,n===e.current)throw Error(u$1(177));e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90,e.nextKnownPendingLevel=0;var i=Ij(n);if(e.firstPendingTime=i,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===T$1&&(X$1=T$1=null,U$1=0),1s&&(c=s,s=a,a=c),c=vd(_,a),u=vd(_,s),c&&u&&(1!==w.rangeCount||w.anchorNode!==c.node||w.anchorOffset!==c.offset||w.focusNode!==u.node||w.focusOffset!==u.offset)&&((b=b.createRange()).setStart(c.node,c.offset),w.removeAllRanges(),a>s?(w.addRange(b),w.extend(u.node,u.offset)):(b.setEnd(u.node,u.offset),w.addRange(b))))),b=[];for(w=_;w=w.parentNode;)1===w.nodeType&&b.push({element:w,left:w.scrollLeft,top:w.scrollTop});for("function"==typeof _.focus&&_.focus(),_=0;_=n?ji(e,t,n):(I$1(M$1,1&M$1.current),null!==(t=$h(e,t,n))?t.sibling:null);I$1(M$1,1&M$1.current);break;case 19:if(r=t.childExpirationTime>=n,0!=(64&e.effectTag)){if(r)return mi(e,t,n);t.effectTag|=64}if(null!==(i=t.memoizedState)&&(i.rendering=null,i.tail=null),I$1(M$1,M$1.current),!r)return null}return $h(e,t,n)}rg=!1}}else rg=!1;switch(t.expirationTime=0,t.tag){case 2:if(r=t.type,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps,i=Cf(t,J$1.current),qg(t,n),i=oh(null,t,r,e,i,n),t.effectTag|=1,"object"==typeof i&&null!==i&&"function"==typeof i.render&&void 0===i.$$typeof){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,L$1(r)){var o=!0;Gf(t)}else o=!1;t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,ug(t);var a=r.getDerivedStateFromProps;"function"==typeof a&&Fg(t,r,a,e),i.updater=Jg,t.stateNode=i,i._reactInternalFiber=t,Ng(t,r,e,n),t=gi(null,t,r,!0,o,n)}else t.tag=0,R$1(null,t,i,n),t=t.child;return t;case 16:e:{if(i=t.elementType,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps,ob(i),1!==i._status)throw i._result;switch(i=i._result,t.type=i,o=t.tag=Xj(i),e=ig(i,e),o){case 0:t=di(null,t,i,e,n);break e;case 1:t=fi(null,t,i,e,n);break e;case 11:t=Zh(null,t,i,e,n);break e;case 14:t=ai(null,t,i,ig(i.type,e),r,n);break e}throw Error(u$1(306,i,""))}return t;case 0:return r=t.type,i=t.pendingProps,di(e,t,r,i=t.elementType===r?i:ig(r,i),n);case 1:return r=t.type,i=t.pendingProps,fi(e,t,r,i=t.elementType===r?i:ig(r,i),n);case 3:if(hi(t),r=t.updateQueue,null===e||null===r)throw Error(u$1(282));if(r=t.pendingProps,i=null!==(i=t.memoizedState)?i.element:null,vg(e,t),zg(t,r,null,n),(r=t.memoizedState.element)===i)Xh(),t=$h(e,t,n);else{if((i=t.stateNode.hydrate)&&(Ph=Jd(t.stateNode.containerInfo.firstChild),Oh=t,i=Qh=!0),i)for(n=Yg(t,null,r,n),t.child=n;n;)n.effectTag=-3&n.effectTag|1024,n=n.sibling;else R$1(e,t,r,n),Xh();t=t.child}return t;case 5:return fh(t),null===e&&Uh(t),r=t.type,i=t.pendingProps,o=null!==e?e.memoizedProps:null,a=i.children,Gd(r,i)?a=null:null!==o&&Gd(r,o)&&(t.effectTag|=16),ei(e,t),4&t.mode&&1!==n&&i.hidden?(t.expirationTime=t.childExpirationTime=1,t=null):(R$1(e,t,a,n),t=t.child),t;case 6:return null===e&&Uh(t),null;case 13:return ji(e,t,n);case 4:return dh(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=Xg(t,null,r,n):R$1(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,Zh(e,t,r,i=t.elementType===r?i:ig(r,i),n);case 7:return R$1(e,t,t.pendingProps,n),t.child;case 8:case 12:return R$1(e,t,t.pendingProps.children,n),t.child;case 10:e:{r=t.type._context,i=t.pendingProps,a=t.memoizedProps,o=i.value;var s=t.type._context;if(I$1(jg,s._currentValue),s._currentValue=o,null!==a)if(s=a.value,0===(o=$e(s,o)?0:0|("function"==typeof r._calculateChangedBits?r._calculateChangedBits(s,o):1073741823))){if(a.children===i.children&&!K$1.current){t=$h(e,t,n);break e}}else for(null!==(s=t.child)&&(s.return=t);null!==s;){var l=s.dependencies;if(null!==l){a=s.child;for(var c=l.firstContext;null!==c;){if(c.context===r&&0!=(c.observedBits&o)){1===s.tag&&((c=wg(n,null)).tag=2,xg(s,c)),s.expirationTime=t&&e<=t}function xi(e,t){var n=e.firstSuspendedTime,r=e.lastSuspendedTime;nt||0===n)&&(e.lastSuspendedTime=t),t<=e.lastPingedTime&&(e.lastPingedTime=0),t<=e.lastExpiredTime&&(e.lastExpiredTime=0)}function yi(e,t){t>e.firstPendingTime&&(e.firstPendingTime=t);var n=e.firstSuspendedTime;0!==n&&(t>=n?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:t>=e.lastSuspendedTime&&(e.lastSuspendedTime=t+1),t>e.nextKnownPendingLevel&&(e.nextKnownPendingLevel=t))}function Cj(e,t){var n=e.lastExpiredTime;(0===n||n>t)&&(e.lastExpiredTime=t)}function bk(e,t,n,r){var i=t.current,o=Gg(),a=Dg.suspense;o=Hg(o,i,a);e:if(n){t:{if(dc(n=n._reactInternalFiber)!==n||1!==n.tag)throw Error(u$1(170));var s=n;do{switch(s.tag){case 3:s=s.stateNode.context;break t;case 1:if(L$1(s.type)){s=s.stateNode.__reactInternalMemoizedMergedChildContext;break t}}s=s.return}while(null!==s);throw Error(u$1(171))}if(1===n.tag){var l=n.type;if(L$1(l)){n=Ff(n,l,s);break e}}n=s}else n=Af;return null===t.context?t.context=n:t.pendingContext=n,(t=wg(o,a)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),xg(i,t),Ig(i,o),o}function ck(e){if(!(e=e.current).child)return null;switch(e.child.tag){case 5:default:return e.child.stateNode}}function dk(e,t){null!==(e=e.memoizedState)&&null!==e.dehydrated&&e.retryTime=0;u--){var h=i[u];"."===h?spliceOne(i,u):".."===h?(spliceOne(i,u),c++):c&&(spliceOne(i,u),c--)}if(!s)for(;c--;c)i.unshift("..");!s||""===i[0]||i[0]&&isAbsolute(i[0])||i.unshift("");var p=i.join("/");return n&&"/"!==p.substr(-1)&&(p+="/"),p}function valueOf(e){return e.valueOf?e.valueOf():Object.prototype.valueOf.call(e)}function valueEqual(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(Array.isArray(e))return Array.isArray(t)&&e.length===t.length&&e.every((function(e,n){return valueEqual(e,t[n])}));if("object"==typeof e||"object"==typeof t){var n=valueOf(e),r=valueOf(t);return n!==e||r!==t?valueEqual(n,r):Object.keys(Object.assign({},e,t)).every((function(n){return valueEqual(e[n],t[n])}))}return!1}var prefix="Invariant failed";function invariant(e,t){if(!e)throw new Error(prefix)}function addLeadingSlash(e){return"/"===e.charAt(0)?e:"/"+e}function stripLeadingSlash(e){return"/"===e.charAt(0)?e.substr(1):e}function hasBasename(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}function stripBasename(e,t){return hasBasename(e,t)?e.substr(t.length):e}function stripTrailingSlash(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function parsePath(e){var t=e||"/",n="",r="",i=t.indexOf("#");-1!==i&&(r=t.substr(i),t=t.substr(0,i));var o=t.indexOf("?");return-1!==o&&(n=t.substr(o),t=t.substr(0,o)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}function createPath(e){var t=e.pathname,n=e.search,r=e.hash,i=t||"/";return n&&"?"!==n&&(i+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(i+="#"===r.charAt(0)?r:"#"+r),i}function createLocation(e,t,n,r){var i;"string"==typeof e?(i=parsePath(e)).state=t:(void 0===(i=_extends({},e)).pathname&&(i.pathname=""),i.search?"?"!==i.search.charAt(0)&&(i.search="?"+i.search):i.search="",i.hash?"#"!==i.hash.charAt(0)&&(i.hash="#"+i.hash):i.hash="",void 0!==t&&void 0===i.state&&(i.state=t));try{i.pathname=decodeURI(i.pathname)}catch(e){throw e instanceof URIError?new URIError('Pathname "'+i.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):e}return n&&(i.key=n),r?i.pathname?"/"!==i.pathname.charAt(0)&&(i.pathname=resolvePathname(i.pathname,r.pathname)):i.pathname=r.pathname:i.pathname||(i.pathname="/"),i}function locationsAreEqual(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash&&e.key===t.key&&valueEqual(e.state,t.state)}function createTransitionManager(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,i){if(null!=e){var o="function"==typeof e?e(t,n):e;"string"==typeof o?"function"==typeof r?r(o,i):i(!0):i(!1!==o)}else i(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;rt?n.splice(t,n.length-t,r):n.push(r),u({action:"PUSH",location:r,index:t,entries:n})}}))},replace:function(e,t){var r=createLocation(e,t,h(),g.location);c.confirmTransitionTo(r,"REPLACE",n,(function(e){e&&(g.entries[g.index]=r,u({action:"REPLACE",location:r}))}))},go:m,goBack:function(){m(-1)},goForward:function(){m(1)},canGo:function(e){var t=g.index+e;return t>=0&&t=0||(i[n]=e[n]);return i}var FORWARD_REF_STATICS={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},MEMO_STATICS={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},TYPE_STATICS={};TYPE_STATICS[reactIs.ForwardRef]=FORWARD_REF_STATICS,TYPE_STATICS[reactIs.Memo]=MEMO_STATICS;var createNamedContext=function(e){var t=index();return t.displayName=e,t},historyContext=createNamedContext("Router-History"),createNamedContext$1=function(e){var t=index();return t.displayName=e,t},context=createNamedContext$1("Router"),Router=function(e){function t(t){var n;return(n=e.call(this,t)||this).state={location:t.history.location},n._isMounted=!1,n._pendingLocation=null,t.staticContext||(n.unlisten=t.history.listen((function(e){n._isMounted?n.setState({location:e}):n._pendingLocation=e}))),n}_inheritsLoose(t,e),t.computeRootMatch=function(e){return{path:"/",url:"/",params:{},isExact:"/"===e}};var n=t.prototype;return n.componentDidMount=function(){this._isMounted=!0,this._pendingLocation&&this.setState({location:this._pendingLocation})},n.componentWillUnmount=function(){this.unlisten&&this.unlisten()},n.render=function(){return react.createElement(context.Provider,{value:{history:this.props.history,location:this.state.location,match:t.computeRootMatch(this.state.location.pathname),staticContext:this.props.staticContext}},react.createElement(historyContext.Provider,{children:this.props.children||null,value:this.props.history}))},t}(react.Component),MemoryRouter=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),i=0;i=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},o=function(e,t){return function(n,r){t(n,r,e)}},a=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},l=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},h=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},p=function(){for(var e=[],t=0;t1||s(e,t)}))})}function s(e,t){try{!function(e){e.value instanceof d?Promise.resolve(e.value.v).then(l,c):u(o[0][2],e)}(i[e](t))}catch(e){u(o[0][3],e)}}function l(e){s("next",e)}function c(e){s("throw",e)}function u(e,t){e(t),o.shift(),o.length&&s(o[0][0],o[0][1])}},g=function(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:d(e[r](t)),done:"return"===r}:i?i(t):t}:i}},y=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=u(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,i){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,i,(t=e[n](t)).done,t.value)}))}}},v=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};var S=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};_=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&T(t,e,n);return S(t,e),t},b=function(e){return e&&e.__esModule?e:{default:e}},w=function(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)},E=function(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n},e("__extends",t),e("__assign",n),e("__rest",r),e("__decorate",i),e("__param",o),e("__metadata",a),e("__awaiter",s),e("__generator",l),e("__exportStar",c),e("__createBinding",T),e("__values",u),e("__read",h),e("__spread",p),e("__spreadArrays",f),e("__await",d),e("__asyncGenerator",m),e("__asyncDelegator",g),e("__asyncValues",y),e("__makeTemplateObject",v),e("__importStar",_),e("__importDefault",b),e("__classPrivateFieldGet",w),e("__classPrivateFieldSet",E)}(x(S,x(e.exports)))}()}));unwrapExports(tslib);var tslib_1=tslib.__extends,tslib_2=tslib.__assign,tslib_3=tslib.__rest,tslib_4=tslib.__decorate,tslib_5=tslib.__param,tslib_6=tslib.__metadata,tslib_7=tslib.__awaiter,tslib_8=tslib.__generator,tslib_9=tslib.__exportStar,tslib_10=tslib.__values,tslib_11=tslib.__read,tslib_12=tslib.__spread,tslib_13=tslib.__spreadArrays,tslib_14=tslib.__await,tslib_15=tslib.__asyncGenerator,tslib_16=tslib.__asyncDelegator,tslib_17=tslib.__asyncValues,tslib_18=tslib.__makeTemplateObject,tslib_19=tslib.__importStar,tslib_20=tslib.__importDefault,tslib_21=tslib.__classPrivateFieldGet,tslib_22=tslib.__classPrivateFieldSet,index_cjs=createCommonjsModule((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}); -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var n={NODE_CLIENT:!1,NODE_ADMIN:!1,SDK_VERSION:"${JSCORE_VERSION}"},r=function(e,t){if(!e)throw i(t)},i=function(e){return new Error("Firebase Database ("+n.SDK_VERSION+") INTERNAL ASSERT FAILED: "+e)},o=function(e){for(var t=[],n=0,r=0;r>6|192,t[n++]=63&i|128):55296==(64512&i)&&r+1>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=63&i|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=63&i|128)}return t},a={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"==typeof atob,encodeByteArray:function(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();for(var n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[],i=0;i>2,h=(3&o)<<4|s>>4,p=(15&s)<<2|c>>6,f=63&c;l||(f=64,a||(p=64)),r.push(n[u],n[h],n[p],n[f])}return r.join("")},encodeString:function(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(o(e),t)},decodeString:function(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):function(e){for(var t=[],n=0,r=0;n191&&i<224){var o=e[n++];t[r++]=String.fromCharCode((31&i)<<6|63&o)}else if(i>239&&i<365){var a=((7&i)<<18|(63&(o=e[n++]))<<12|(63&(s=e[n++]))<<6|63&e[n++])-65536;t[r++]=String.fromCharCode(55296+(a>>10)),t[r++]=String.fromCharCode(56320+(1023&a))}else{o=e[n++];var s=e[n++];t[r++]=String.fromCharCode((15&i)<<12|(63&o)<<6|63&s)}}return t.join("")}(this.decodeStringToByteArray(e,t))},decodeStringToByteArray:function(e,t){this.init_();for(var n=t?this.charToByteMapWebSafe_:this.charToByteMap_,r=[],i=0;i>4;if(r.push(c),64!==s){var u=a<<4&240|s>>2;if(r.push(u),64!==l){var h=s<<6&192|l;r.push(h)}}}return r},init_:function(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(var e=0;e=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}},s=function(e){try{return a.decodeString(e,!0)}catch(e){console.error("base64Decode failed: ",e)}return null}; -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */function l(e,t){if(!(t instanceof Object))return t;switch(t.constructor){case Date:return new Date(t.getTime());case Object:void 0===e&&(e={});break;case Array:e=[];break;default:return t}for(var n in t)t.hasOwnProperty(n)&&(e[n]=l(e[n],t[n]));return e} -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */var c=function(){function e(){var e=this;this.reject=function(){},this.resolve=function(){},this.promise=new Promise((function(t,n){e.resolve=t,e.reject=n}))}return e.prototype.wrapCallback=function(e){var t=this;return function(n,r){n?t.reject(n):t.resolve(r),"function"==typeof e&&(t.promise.catch((function(){})),1===e.length?e(n):e(n,r))}},e}(); -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */function u(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""}function h(){try{return"[object process]"===Object.prototype.toString.call(global$1.process)}catch(e){return!1}} -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var p=function(e){function t(n,r){var i=e.call(this,r)||this;return i.code=n,i.name="FirebaseError",Object.setPrototypeOf(i,t.prototype),Error.captureStackTrace&&Error.captureStackTrace(i,f.prototype.create),i}return tslib.__extends(t,e),t}(Error),f=function(){function e(e,t,n){this.service=e,this.serviceName=t,this.errors=n}return e.prototype.create=function(e){for(var t=[],n=1;n"}))}var m=/\{\$([^}]+)}/g; -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */function g(e){return JSON.parse(e)} -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var y=function(e){var t={},n={},r={},i="";try{var o=e.split(".");t=g(s(o[0])||""),n=g(s(o[1])||""),i=o[2],r=n.d||{},delete n.d}catch(e){}return{header:t,claims:n,data:r,signature:i}}; -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var v=function(){function e(){this.chain_=[],this.buf_=[],this.W_=[],this.pad_=[],this.inbuf_=0,this.total_=0,this.blockSize=64,this.pad_[0]=128;for(var e=1;e>>31)}var o,a,s=this.chain_[0],l=this.chain_[1],c=this.chain_[2],u=this.chain_[3],h=this.chain_[4];for(r=0;r<80;r++){r<40?r<20?(o=u^l&(c^u),a=1518500249):(o=l^c^u,a=1859775393):r<60?(o=l&c|u&(l|c),a=2400959708):(o=l^c^u,a=3395469782);i=(s<<5|s>>>27)+o+h+a+n[r]&4294967295;h=u,u=c,c=4294967295&(l<<30|l>>>2),l=s,s=i}this.chain_[0]=this.chain_[0]+s&4294967295,this.chain_[1]=this.chain_[1]+l&4294967295,this.chain_[2]=this.chain_[2]+c&4294967295,this.chain_[3]=this.chain_[3]+u&4294967295,this.chain_[4]=this.chain_[4]+h&4294967295},e.prototype.update=function(e,t){if(null!=e){void 0===t&&(t=e.length);for(var n=t-this.blockSize,r=0,i=this.buf_,o=this.inbuf_;r=56;n--)this.buf_[n]=255&t,t/=256;this.compress_(this.buf_);var r=0;for(n=0;n<5;n++)for(var i=24;i>=0;i-=8)e[r]=this.chain_[n]>>i&255,++r;return e},e}();var _=function(){function e(e,t){var n=this;this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then((function(){e(n)})).catch((function(e){n.error(e)}))}return e.prototype.next=function(e){this.forEachObserver((function(t){t.next(e)}))},e.prototype.error=function(e){this.forEachObserver((function(t){t.error(e)})),this.close(e)},e.prototype.complete=function(){this.forEachObserver((function(e){e.complete()})),this.close()},e.prototype.subscribe=function(e,t,n){var r,i=this;if(void 0===e&&void 0===t&&void 0===n)throw new Error("Missing Observer.");void 0===(r=function(e,t){if("object"!=typeof e||null===e)return!1;for(var n=0,r=t;n 4. Need to update it?")}var i=e+" failed: ";return i+=r+" argument "}t.CONSTANTS=n,t.Deferred=c,t.ErrorFactory=f,t.FirebaseError=p,t.Sha1=v,t.areCookiesEnabled=function(){return!(!navigator||!navigator.cookieEnabled)},t.assert=r,t.assertionError=i,t.async=function(e,t){return function(){for(var n=[],r=0;r=0},t.isEmpty=function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0},t.isIE=function(){var e=u();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0},t.isIndexedDBAvailable=function(){return"indexedDB"in self&&null!==indexedDB},t.isMobileCordova=function(){return"undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(u())},t.isNode=h,t.isNodeSdk=function(){return!0===n.NODE_CLIENT||!0===n.NODE_ADMIN},t.isReactNative=function(){return"object"==typeof navigator&&"ReactNative"===navigator.product},t.isSafari=function(){return!h()&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")},t.isUWP=function(){return u().indexOf("MSAppHost/")>=0},t.isValidFormat=function(e){var t=y(e).claims;return!!t&&"object"==typeof t&&t.hasOwnProperty("iat")},t.isValidTimestamp=function(e){var t=y(e).claims,n=Math.floor((new Date).getTime()/1e3),r=0,i=0;return"object"==typeof t&&(t.hasOwnProperty("nbf")?r=t.nbf:t.hasOwnProperty("iat")&&(r=t.iat),i=t.hasOwnProperty("exp")?t.exp:r+86400),!!n&&!!r&&!!i&&n>=r&&n<=i},t.issuedAtTime=function(e){var t=y(e).claims;return"object"==typeof t&&t.hasOwnProperty("iat")?t.iat:null},t.jsonEval=g,t.map=function(e,t,n){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=t.call(n,e[i],i,e));return r} -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */,t.querystring=function(e){for(var t=[],n=function(e,n){Array.isArray(n)?n.forEach((function(n){t.push(encodeURIComponent(e)+"="+encodeURIComponent(n))})):t.push(encodeURIComponent(e)+"="+encodeURIComponent(n))},r=0,i=Object.entries(e);r=55296&&r<=56319?(t+=4,n++):t+=3}return t},t.stringToByteArray=function(e){for(var t=[],n=0,i=0;i=55296&&o<=56319){var a=o-55296;i++,r(i>6|192,t[n++]=63&o|128):o<65536?(t[n++]=o>>12|224,t[n++]=o>>6&63|128,t[n++]=63&o|128):(t[n++]=o>>18|240,t[n++]=o>>12&63|128,t[n++]=o>>6&63|128,t[n++]=63&o|128)}return t},t.stringify=function(e){return JSON.stringify(e)},t.validateArgCount=function(e,t,n,r){var i;if(rn&&(i=0===n?"none":"no more than "+n),i)throw new Error(e+" failed: Was called with "+r+(1===r?" argument.":" arguments.")+" Expects "+i+".")},t.validateCallback=function(e,t,n,r){if((!r||n)&&"function"!=typeof n)throw new Error(w(e,t,r)+"must be a valid function.")},t.validateContextObject=function(e,t,n,r){if((!r||n)&&("object"!=typeof n||null===n))throw new Error(w(e,t,r)+"must be a valid context object.")} -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */,t.validateIndexedDBOpenable=function(){return new Promise((function(e,t){try{var n=!0,r="validate-browser-context-for-indexeddb-analytics-module",i=window.indexedDB.open(r);i.onsuccess=function(){i.result.close(),n||window.indexedDB.deleteDatabase(r),e(!0)},i.onupgradeneeded=function(){n=!1},i.onerror=function(){var e;t((null===(e=i.error)||void 0===e?void 0:e.message)||"")}}catch(e){t(e)}}))},t.validateNamespace=function(e,t,n,r){if((!r||n)&&"string"!=typeof n)throw new Error(w(e,t,r)+"must be a valid firebase namespace.")}}));unwrapExports(index_cjs);var index_cjs_1=index_cjs.CONSTANTS,index_cjs_2=index_cjs.Deferred,index_cjs_3=index_cjs.ErrorFactory,index_cjs_4=index_cjs.FirebaseError,index_cjs_5=index_cjs.Sha1,index_cjs_6=index_cjs.areCookiesEnabled,index_cjs_7=index_cjs.assert,index_cjs_8=index_cjs.assertionError,index_cjs_9=index_cjs.async,index_cjs_10=index_cjs.base64,index_cjs_11=index_cjs.base64Decode,index_cjs_12=index_cjs.base64Encode,index_cjs_13=index_cjs.contains,index_cjs_14=index_cjs.createSubscribe,index_cjs_15=index_cjs.decode,index_cjs_16=index_cjs.deepCopy,index_cjs_17=index_cjs.deepExtend,index_cjs_18=index_cjs.errorPrefix,index_cjs_19=index_cjs.getUA,index_cjs_20=index_cjs.isAdmin,index_cjs_21=index_cjs.isBrowser,index_cjs_22=index_cjs.isBrowserExtension,index_cjs_23=index_cjs.isElectron,index_cjs_24=index_cjs.isEmpty,index_cjs_25=index_cjs.isIE,index_cjs_26=index_cjs.isIndexedDBAvailable,index_cjs_27=index_cjs.isMobileCordova,index_cjs_28=index_cjs.isNode,index_cjs_29=index_cjs.isNodeSdk,index_cjs_30=index_cjs.isReactNative,index_cjs_31=index_cjs.isSafari,index_cjs_32=index_cjs.isUWP,index_cjs_33=index_cjs.isValidFormat,index_cjs_34=index_cjs.isValidTimestamp,index_cjs_35=index_cjs.issuedAtTime,index_cjs_36=index_cjs.jsonEval,index_cjs_37=index_cjs.map,index_cjs_38=index_cjs.querystring,index_cjs_39=index_cjs.querystringDecode,index_cjs_40=index_cjs.safeGet,index_cjs_41=index_cjs.stringLength,index_cjs_42=index_cjs.stringToByteArray,index_cjs_43=index_cjs.stringify,index_cjs_44=index_cjs.validateArgCount,index_cjs_45=index_cjs.validateCallback,index_cjs_46=index_cjs.validateContextObject,index_cjs_47=index_cjs.validateIndexedDBOpenable,index_cjs_48=index_cjs.validateNamespace,index_cjs$1=createCommonjsModule((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t,n){this.name=e,this.instanceFactory=t,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY"}return e.prototype.setInstantiationMode=function(e){return this.instantiationMode=e,this},e.prototype.setMultipleInstances=function(e){return this.multipleInstances=e,this},e.prototype.setServiceProps=function(e){return this.serviceProps=e,this},e}(),r=function(){function e(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map}return e.prototype.get=function(e){void 0===e&&(e="[DEFAULT]");var t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){var n=new index_cjs.Deferred;this.instancesDeferred.set(t,n);try{var r=this.getOrInitializeService(t);r&&n.resolve(r)}catch(e){}}return this.instancesDeferred.get(t).promise},e.prototype.getImmediate=function(e){var t=tslib.__assign({identifier:"[DEFAULT]",optional:!1},e),n=t.identifier,r=t.optional,i=this.normalizeInstanceIdentifier(n);try{var o=this.getOrInitializeService(i);if(!o){if(r)return null;throw Error("Service "+this.name+" is not available")}return o}catch(e){if(r)return null;throw e}},e.prototype.getComponent=function(){return this.component},e.prototype.setComponent=function(e){var t,n;if(e.name!==this.name)throw Error("Mismatching Component "+e.name+" for Provider "+this.name+".");if(this.component)throw Error("Component for "+this.name+" has already been provided");if(this.component=e,function(e){return"EAGER"===e.instantiationMode} -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */(e))try{this.getOrInitializeService("[DEFAULT]")}catch(e){}try{for(var r=tslib.__values(this.instancesDeferred.entries()),i=r.next();!i.done;i=r.next()){var o=tslib.__read(i.value,2),a=o[0],s=o[1],l=this.normalizeInstanceIdentifier(a);try{var c=this.getOrInitializeService(l);s.resolve(c)}catch(e){}}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},e.prototype.clearInstance=function(e){void 0===e&&(e="[DEFAULT]"),this.instancesDeferred.delete(e),this.instances.delete(e)},e.prototype.delete=function(){return tslib.__awaiter(this,void 0,void 0,(function(){var e;return tslib.__generator(this,(function(t){switch(t.label){case 0:return e=Array.from(this.instances.values()),[4,Promise.all(e.filter((function(e){return"INTERNAL"in e})).map((function(e){return e.INTERNAL.delete()})))];case 1:return t.sent(),[2]}}))}))},e.prototype.isComponentSet=function(){return null!=this.component},e.prototype.getOrInitializeService=function(e){var t=this.instances.get(e);return!t&&this.component&&(t=this.component.instanceFactory(this.container,function(e){return"[DEFAULT]"===e?void 0:e}(e)),this.instances.set(e,t)),t||null},e.prototype.normalizeInstanceIdentifier=function(e){return this.component?this.component.multipleInstances?e:"[DEFAULT]":e},e}(); -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */var i=function(){function e(e){this.name=e,this.providers=new Map}return e.prototype.addComponent=function(e){var t=this.getProvider(e.name);if(t.isComponentSet())throw new Error("Component "+e.name+" has already been registered with "+this.name);t.setComponent(e)},e.prototype.addOrOverwriteComponent=function(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)},e.prototype.getProvider=function(e){if(this.providers.has(e))return this.providers.get(e);var t=new r(e,this);return this.providers.set(e,t),t},e.prototype.getProviders=function(){return Array.from(this.providers.values())},e}();t.Component=n,t.ComponentContainer=i,t.Provider=r}));unwrapExports(index_cjs$1);var index_cjs_1$1=index_cjs$1.Component,index_cjs_2$1=index_cjs$1.ComponentContainer,index_cjs_3$1=index_cjs$1.Provider,_a; -/*! ***************************************************************************** - Copyright (c) Microsoft Corporation. All rights reserved. - Licensed under the Apache License, Version 2.0 (the "License"); you may not use - this file except in compliance with the License. You may obtain a copy of the - License at http://www.apache.org/licenses/LICENSE-2.0 - - THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED - WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, - MERCHANTABLITY OR NON-INFRINGEMENT. - - See the Apache Version 2.0 License for specific language governing permissions - and limitations under the License. - ***************************************************************************** */ -function __spreadArrays(){for(var e=0,t=0,n=arguments.length;t=(null!=r?r:t.logLevel)&&e({level:LogLevel[n].toLowerCase(),message:a,args:i,type:t.name})}},r=0,i=instances;r=0&&s.warn("\n Warning: You are trying to load Firebase while using Firebase Performance standalone script.\n You should load Firebase Performance with this instance of Firebase to avoid loading duplicate code.\n ")}var p=c.initializeApp;c.initializeApp=function(){for(var e=[],t=0;t>>0),g=0;function y(e,t,n){return e.call.apply(e.bind,arguments)}function v(e,t,n){if(!e)throw Error();if(2e.b&&(e.b++,t.next=e.a,e.a=t)}function F(){this.b=this.a=null}S=A("__EID__")?"__EID__":void 0,E(D,Error),D.prototype.name="CustomError",E(R,D),R.prototype.name="AssertionError",N.prototype.get=function(){if(0/g,te=/"/g,ne=/'/g,re=/\x00/g,ie=/[\x00&<>"']/;function oe(e,t){return-1!=e.indexOf(t)}function ae(e,t){return et?1:0}e:{var se=s.navigator;if(se){var le=se.userAgent;if(le){Q=le;break e}}Q=""}function ce(e){return oe(Q,e)}function ue(e,t){for(var n in e)t.call(void 0,e[n],n,e)}function he(e){for(var t in e)return!1;return!0}function pe(e){var t,n={};for(t in e)n[t]=e[t];return n}var fe="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function de(e,t){for(var n,r,i=1;i"}else o=void 0===e?"undefined":null===e?"null":typeof e;O("Argument is not a %s (or a non-Element, non-Location mock); got: %s",t,o)}}function ge(e,t){this.a=e===_e&&t||"",this.b=ve}function ye(e){return e instanceof ge&&e.constructor===ge&&e.b===ve?e.a:(O("expected object of type Const, got '"+e+"'"),"type_error:Const")}ge.prototype.ra=!0,ge.prototype.qa=function(){return this.a},ge.prototype.toString=function(){return"Const{"+this.a+"}"};var ve={},_e={},be=new ge(_e,"");function we(e,t){this.a=e===Ce&&t||"",this.b=xe}function Ee(e){return e instanceof we&&e.constructor===we&&e.b===xe?e.a:(O("expected object of type TrustedResourceUrl, got '"+e+"' of type "+h(e)),"type_error:TrustedResourceUrl")}function Te(e,t){var n=ye(e);if(!Se.test(n))throw Error("Invalid TrustedResourceUrl format: "+n);return e=n.replace(ke,(function(e,r){if(!Object.prototype.hasOwnProperty.call(t,r))throw Error('Found marker, "'+r+'", in format string, "'+n+'", but no valid label mapping found in args: '+JSON.stringify(t));return(e=t[r])instanceof ge?ye(e):encodeURIComponent(String(e))})),new we(Ce,e)}we.prototype.ra=!0,we.prototype.qa=function(){return this.a.toString()},we.prototype.toString=function(){return"TrustedResourceUrl{"+this.a+"}"};var ke=/%{(\w+)}/g,Se=/^((https:)?\/\/[0-9a-z.:[\]-]+\/|\/[^/\\]|[^:/\\%]+\/|[^:/\\%]*[?#]|about:blank#)/i,xe={},Ce={};function Pe(e,t){this.a=e===Oe&&t||"",this.b=Re}function Ae(e){return e instanceof Pe&&e.constructor===Pe&&e.b===Re?e.a:(O("expected object of type SafeUrl, got '"+e+"' of type "+h(e)),"type_error:SafeUrl")}Pe.prototype.ra=!0,Pe.prototype.qa=function(){return this.a.toString()},Pe.prototype.toString=function(){return"SafeUrl{"+this.a+"}"};var Ie=/^(?:(?:https?|mailto|ftp):|[^:/?#]*(?:[/?#]|$))/i;function De(e){return e instanceof Pe?e:(e="object"==typeof e&&e.ra?e.qa():String(e),Ie.test(e)||(e="about:invalid#zClosurez"),new Pe(Oe,e))}var Re={},Oe={};function Ne(){this.a="",this.b=Fe}function Me(e){return e instanceof Ne&&e.constructor===Ne&&e.b===Fe?e.a:(O("expected object of type SafeHtml, got '"+e+"' of type "+h(e)),"type_error:SafeHtml")}Ne.prototype.ra=!0,Ne.prototype.qa=function(){return this.a.toString()},Ne.prototype.toString=function(){return"SafeHtml{"+this.a+"}"};var Fe={};function Le(e){var t=new Ne;return t.a=e,t}Le("");var je=Le("");function $e(e,t){for(var n=e.split("%s"),r="",i=Array.prototype.slice.call(arguments,1);i.length&&1")&&(e=e.replace(ee,">")),-1!=e.indexOf('"')&&(e=e.replace(te,""")),-1!=e.indexOf("'")&&(e=e.replace(ne,"'")),-1!=e.indexOf("\0")&&(e=e.replace(re,"�"))),e}function Ve(e){return Ve[" "](e),e}Le("
"),Ve[" "]=u;var Ge,ze,Ue=ce("Opera"),He=ce("Trident")||ce("MSIE"),qe=ce("Edge"),We=qe||He,Ye=ce("Gecko")&&!(oe(Q.toLowerCase(),"webkit")&&!ce("Edge"))&&!(ce("Trident")||ce("MSIE"))&&!ce("Edge"),Ke=oe(Q.toLowerCase(),"webkit")&&!ce("Edge");function Qe(){var e=s.document;return e?e.documentMode:void 0}e:{var Xe="",Je=(ze=Q,Ye?/rv:([^\);]+)(\)|;)/.exec(ze):qe?/Edge\/([\d\.]+)/.exec(ze):He?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(ze):Ke?/WebKit\/(\S+)/.exec(ze):Ue?/(?:Version)[ \/]?(\S+)/.exec(ze):void 0);if(Je&&(Xe=Je?Je[1]:""),He){var Ze=Qe();if(null!=Ze&&Ze>parseFloat(Xe)){Ge=String(Ze);break e}}Ge=Xe}var et,tt={};function nt(e){return function(e,t){var n=tt;return Object.prototype.hasOwnProperty.call(n,e)?n[e]:n[e]=t(e)}(e,(function(){for(var t=0,n=X(String(Ge)).split("."),r=X(String(e)).split("."),i=Math.max(n.length,r.length),o=0;0==t&&o=e.keyCode)&&(e.keyCode=-1)}catch(e){}},qt.prototype.f=function(){return this.a};var Yt="closure_listenable_"+(1e6*Math.random()|0),Kt=0;function Qt(e,t,n,r,i){this.listener=e,this.proxy=null,this.src=t,this.type=n,this.capture=!!r,this.Ta=i,this.key=++Kt,this.ua=this.Na=!1}function Xt(e){e.ua=!0,e.listener=null,e.proxy=null,e.src=null,e.Ta=null}function Jt(e){this.src=e,this.a={},this.b=0}function Zt(e,t){var n=t.type;n in e.a&&q(e.a[n],t)&&(Xt(t),0==e.a[n].length&&(delete e.a[n],e.b--))}function en(e,t,n,r){for(var i=0;ir.keyCode||null!=r.returnValue)){e:{var i=!1;if(0==r.keyCode)try{r.keyCode=-1;break e}catch(e){i=!0}(i||null==r.returnValue)&&(r.returnValue=!0)}for(r=[],i=t.b;i;i=i.parentNode)r.push(i);for(e=e.type,i=r.length-1;0<=i;i--){t.b=r[i];var o=un(r[i],e,!0,t);n=n&&o}for(i=0;i>>0);function mn(e){return f(e)?e:(e[dn]||(e[dn]=function(t){return e.handleEvent(t)}),e[dn])}function gn(){$t.call(this),this.u=new Jt(this),this.Yb=this,this.eb=null}function yn(e,t,n,r,i){e.u.add(String(t),n,!1,r,i)}function vn(e,t,n,r,i){e.u.add(String(t),n,!0,r,i)}function _n(e,t,n,r){if(!(t=e.u.a[String(t)]))return!0;t=t.concat();for(var i=!0,o=0;ot)throw Error("Bad port number "+t);e.l=t}else e.l=null}function Dn(e,t,n){t instanceof Un?(e.a=t,function(e,t){t&&!e.f&&(Hn(e),e.c=null,e.a.forEach((function(e,t){var n=t.toLowerCase();t!=n&&(Wn(this,t),Kn(this,n,e))}),e)),e.f=t}(e.a,e.h)):(n||(t=Ln(t,Gn)),e.a=new Un(t,e.h))}function Rn(e,t,n){e.a.set(t,n)}function On(e,t){return e.a.get(t)}function Nn(e){return e instanceof Pn?new Pn(e):new Pn(e,void 0)}function Mn(e,t){var n=new Pn(null,void 0);return An(n,"https"),e&&(n.b=e),t&&(n.c=t),n}function Fn(e,t){return e?t?decodeURI(e.replace(/%25/g,"%2525")):decodeURIComponent(e):""}function Ln(e,t,n){return"string"==typeof e?(e=encodeURI(e).replace(t,jn),n&&(e=e.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e):null}function jn(e){return"%"+((e=e.charCodeAt(0))>>4&15).toString(16)+(15&e).toString(16)}Pn.prototype.toString=function(){var e=[],t=this.f;t&&e.push(Ln(t,$n,!0),":");var n=this.b;return(n||"file"==t)&&(e.push("//"),(t=this.i)&&e.push(Ln(t,$n,!0),"@"),e.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.l)&&e.push(":",String(n))),(n=this.c)&&(this.b&&"/"!=n.charAt(0)&&e.push("/"),e.push(Ln(n,"/"==n.charAt(0)?Vn:Bn,!0))),(n=this.a.toString())&&e.push("?",n),(n=this.g)&&e.push("#",Ln(n,zn)),e.join("")},Pn.prototype.resolve=function(e){var t=new Pn(this),n=!!e.f;n?An(t,e.f):n=!!e.i,n?t.i=e.i:n=!!e.b,n?t.b=e.b:n=null!=e.l;var r=e.c;if(n)In(t,e.l);else if(n=!!e.c){if("/"!=r.charAt(0))if(this.b&&!this.c)r="/"+r;else{var i=t.c.lastIndexOf("/");-1!=i&&(r=t.c.substr(0,i+1)+r)}if(".."==(i=r)||"."==i)r="";else if(oe(i,"./")||oe(i,"/.")){r=0==i.lastIndexOf("/",0),i=i.split("/");for(var o=[],a=0;a2*e.c&&Sn(e)))}function Yn(e,t){return Hn(e),t=Xn(e,t),xn(e.a.b,t)}function Kn(e,t,n){Wn(e,t),0'),r=a.document)&&(r.write(Me(e)),r.close())):(a=r.open(Ae(t),n,a))&&e.noopener&&(a.opener=null),a)try{a.focus()}catch(e){}return a}var cr=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,ur=/^[^@]+@[^@]+$/;function hr(){var e=null;return new vt((function(t){"complete"==s.document.readyState?t():(e=function(){t()},an(window,"load",e))})).o((function(t){throw sn(window,"load",e),t}))}function pr(e){return e=e||Er(),!("file:"!==Cr()&&"ionic:"!==Cr()||!e.toLowerCase().match(/iphone|ipad|ipod|android/))}function fr(){var e=s.window;try{return!(!e||e==e.top)}catch(e){return!1}}function dr(){return void 0!==s.WorkerGlobalScope&&"function"==typeof s.importScripts}function mr(){return t.INTERNAL.hasOwnProperty("reactNative")?"ReactNative":t.INTERNAL.hasOwnProperty("node")?"Node":dr()?"Worker":"Browser"}function gr(){var e=mr();return"ReactNative"===e||"Node"===e}var yr="Firefox",vr="Chrome";function _r(e){var t=e.toLowerCase();return oe(t,"opera/")||oe(t,"opr/")||oe(t,"opios/")?"Opera":oe(t,"iemobile")?"IEMobile":oe(t,"msie")||oe(t,"trident/")?"IE":oe(t,"edge/")?"Edge":oe(t,"firefox/")?yr:oe(t,"silk/")?"Silk":oe(t,"blackberry")?"Blackberry":oe(t,"webos")?"Webos":!oe(t,"safari/")||oe(t,"chrome/")||oe(t,"crios/")||oe(t,"android")?!oe(t,"chrome/")&&!oe(t,"crios/")||oe(t,"edge/")?oe(t,"android")?"Android":(e=e.match(/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/))&&2==e.length?e[1]:"Other":vr:"Safari"}var br={jd:"FirebaseCore-web",ld:"FirebaseUI-web"};function wr(e,t){t=t||[];var n,r=[],i={};for(n in br)i[br[n]]=!0;for(n=0;nt)throw Error("Short delay should be less than long delay!");this.a=e,this.c=t,e=Er(),t=mr(),this.b=ar(e)||"ReactNative"===t}function Fr(){var e=s.document;return!e||void 0===e.visibilityState||"visible"==e.visibilityState}function Lr(e){try{var t=new Date(parseInt(e,10));if(!isNaN(t.getTime())&&!/[^0-9]/.test(e))return t.toUTCString()}catch(e){}return null}function jr(){return!(!Tr("fireauth.oauthhelper",s)&&!Tr("fireauth.iframe",s))}Mr.prototype.get=function(){var e=s.navigator;return!e||"boolean"!=typeof e.onLine||!xr()&&"chrome-extension:"!==Cr()&&void 0===e.connection||e.onLine?this.b?this.c:this.a:Math.min(5e3,this.a)};var $r,Br={};function Vr(e){Br[e]||(Br[e]=!0,"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn(e))}try{var Gr={};Object.defineProperty(Gr,"abcd",{configurable:!0,enumerable:!0,value:1}),Object.defineProperty(Gr,"abcd",{configurable:!0,enumerable:!0,value:2}),$r=2==Gr.abcd}catch(ze){$r=!1}function zr(e,t,n){$r?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:n}):e[t]=n}function Ur(e,t){if(t)for(var n in t)t.hasOwnProperty(n)&&zr(e,n,t[n])}function Hr(e){var t={};return Ur(t,e),t}function qr(e){var t=e;if("object"==typeof e&&null!=e)for(var n in t="length"in e?[]:{},e)zr(t,n,qr(e[n]));return t}function Wr(e){var t=e&&(e[Jr]?"phone":null);if(!(t&&e&&e[Xr]))throw new T("internal-error","Internal assert: invalid MultiFactorInfo object");zr(this,"uid",e[Xr]),zr(this,"displayName",e[Kr]||null);var n=null;e[Qr]&&(n=new Date(e[Qr]).toUTCString()),zr(this,"enrollmentTime",n),zr(this,"factorId",t)}function Yr(e){try{var t=new Zr(e)}catch(e){t=null}return t}Wr.prototype.v=function(){return{uid:this.uid,displayName:this.displayName,factorId:this.factorId,enrollmentTime:this.enrollmentTime}};var Kr="displayName",Qr="enrolledAt",Xr="mfaEnrollmentId",Jr="phoneInfo";function Zr(e){Wr.call(this,e),zr(this,"phoneNumber",e[Jr])}function ei(e){var t={},n=e[ii],r=e[ai],i=e[si];if(e=Yr(e[oi]),!i||i!=ni&&i!=ri&&!n||i==ri&&!r||i==ti&&!e)throw Error("Invalid checkActionCode response!");i==ri?(t[ci]=n||null,t[hi]=n||null,t[li]=r):(t[ci]=r||null,t[hi]=r||null,t[li]=n||null),t[ui]=e||null,zr(this,fi,i),zr(this,pi,qr(t))}E(Zr,Wr),Zr.prototype.v=function(){var e=Zr.Za.v.call(this);return e.phoneNumber=this.phoneNumber,e};var ti="REVERT_SECOND_FACTOR_ADDITION",ni="EMAIL_SIGNIN",ri="VERIFY_AND_CHANGE_EMAIL",ii="email",oi="mfaInfo",ai="newEmail",si="requestType",li="email",ci="fromEmail",ui="multiFactorInfo",hi="previousEmail",pi="data",fi="operation";function di(e){var t=On(e=Nn(e),mi)||null,n=On(e,gi)||null,r=On(e,_i)||null;if(r=r&&wi[r]||null,!t||!n||!r)throw new T("argument-error",mi+", "+gi+"and "+_i+" are required in a valid action code URL.");Ur(this,{apiKey:t,operation:r,code:n,continueUrl:On(e,yi)||null,languageCode:On(e,vi)||null,tenantId:On(e,bi)||null})}var mi="apiKey",gi="oobCode",yi="continueUrl",vi="languageCode",_i="mode",bi="tenantId",wi={recoverEmail:"RECOVER_EMAIL",resetPassword:"PASSWORD_RESET",revertSecondFactorAddition:ti,signIn:ni,verifyAndChangeEmail:ri,verifyEmail:"VERIFY_EMAIL"};function Ei(e){try{return new di(e)}catch(e){return null}}function Ti(e){var t=e[Pi];if(void 0===t)throw new T("missing-continue-uri");if("string"!=typeof t||"string"==typeof t&&!t.length)throw new T("invalid-continue-uri");this.h=t,this.b=this.a=null,this.g=!1;var n=e[ki];if(n&&"object"==typeof n){t=n[Di];var r=n[Ai];if(n=n[Ii],"string"==typeof t&&t.length){if(this.a=t,void 0!==r&&"boolean"!=typeof r)throw new T("argument-error",Ai+" property must be a boolean when specified.");if(this.g=!!r,void 0!==n&&("string"!=typeof n||"string"==typeof n&&!n.length))throw new T("argument-error",Ii+" property must be a non empty string when specified.");this.b=n||null}else{if(void 0!==t)throw new T("argument-error",Di+" property must be a non empty string when specified.");if(void 0!==r||void 0!==n)throw new T("missing-android-pkg-name")}}else if(void 0!==n)throw new T("argument-error",ki+" property must be a non null object when specified.");if(this.f=null,(t=e[Ci])&&"object"==typeof t){if("string"==typeof(t=t[Ri])&&t.length)this.f=t;else if(void 0!==t)throw new T("argument-error",Ri+" property must be a non empty string when specified.")}else if(void 0!==t)throw new T("argument-error",Ci+" property must be a non null object when specified.");if(void 0!==(t=e[xi])&&"boolean"!=typeof t)throw new T("argument-error",xi+" property must be a boolean when specified.");if(this.c=!!t,void 0!==(e=e[Si])&&("string"!=typeof e||"string"==typeof e&&!e.length))throw new T("argument-error",Si+" property must be a non empty string when specified.");this.i=e||null}var ki="android",Si="dynamicLinkDomain",xi="handleCodeInApp",Ci="iOS",Pi="url",Ai="installApp",Ii="minimumVersion",Di="packageName",Ri="bundleId";function Oi(e){var t={};for(var n in t.continueUrl=e.h,t.canHandleCodeInApp=e.c,(t.androidPackageName=e.a)&&(t.androidMinimumVersion=e.b,t.androidInstallApp=e.g),t.iOSBundleId=e.f,t.dynamicLinkDomain=e.i,t)null===t[n]&&delete t[n];return t}var Ni=null;function Mi(e){var t="";return function(e,t){function n(t){for(;rn;n++)for(var r=e.concat(t[n].split("")),i=0;i>4),64!=a&&(t(o<<4&240|a>>2),64!=s&&t(a<<6&192|s))}}(e,(function(e){t+=String.fromCharCode(e)})),t}function Fi(e){var t=ji(e);if(!(t&&t.sub&&t.iss&&t.aud&&t.exp))throw Error("Invalid JWT");this.g=e,this.c=t.exp,this.h=t.sub,this.a=t.provider_id||t.firebase&&t.firebase.sign_in_provider||null,this.f=t.firebase&&t.firebase.tenant||null,this.b=!!t.is_anonymous||"anonymous"==this.a}function Li(e){try{return new Fi(e)}catch(e){return null}}function ji(e){if(!e)return null;if(3!=(e=e.split(".")).length)return null;for(var t=(4-(e=e[1]).length%4)%4,n=0;n Auth section -> Sign in method tab.",e):"http"==r||"https"==r?n=$e("This domain (%s) is not authorized to run this operation. Add it to the OAuth redirect domains list in the Firebase console -> Auth section -> Sign in method tab.",e):t="operation-not-supported-in-this-environment",T.call(this,t,n)}function Bo(e,t,n){T.call(this,e,n),(e=t||{}).Gb&&zr(this,"email",e.Gb),e.da&&zr(this,"phoneNumber",e.da),e.credential&&zr(this,"credential",e.credential),e.Wb&&zr(this,"tenantId",e.Wb)}function Vo(e){if(e.code){var t=e.code||"";0==t.indexOf(x)&&(t=t.substring(x.length));var n={credential:Ro(e),Wb:e.tenantId};if(e.email)n.Gb=e.email;else if(e.phoneNumber)n.da=e.phoneNumber;else if(!n.credential)return new T(t,e.message||void 0);return new Bo(t,n,e.message)}return null}function Go(){}function zo(e){return e.c||(e.c=e.b())}function Uo(){}function Ho(e){if(!e.f&&"undefined"==typeof XMLHttpRequest&&"undefined"!=typeof ActiveXObject){for(var t=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],n=0;n=function e(t){return t.c?t.c:t.a?e(t.a):(O("Root logger has no level set."),null)}(this).value)for(f(t)&&(t=t()),e=new Ko(e,String(t),this.f),n&&(e.a=n),n=this;n;)n=n.a};var na={},ra=null;function ia(e){var t;if(ra||(ra=new Qo(""),na[""]=ra,ra.c=ea),!(t=na[e])){t=new Qo(e);var n=e.lastIndexOf("."),r=e.substr(n+1);(n=ia(e.substr(0,n))).b||(n.b={}),n.b[r]=t,t.a=n,na[e]=t}return t}function oa(e,t){e&&e.log(ta,t,void 0)}function aa(e){this.f=e}function sa(e){gn.call(this),this.s=e,this.readyState=la,this.status=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.i=new Headers,this.b=null,this.m="GET",this.g="",this.a=!1,this.h=ia("goog.net.FetchXmlHttp"),this.l=this.c=this.f=null}E(aa,Go),aa.prototype.a=function(){return new sa(this.f)},aa.prototype.b=function(e){return function(){return e}}({}),E(sa,gn);var la=0;function ca(e){e.c.read().then(e.nc.bind(e)).catch(e.Sa.bind(e))}function ua(e,t){t&&e.f&&(e.status=e.f.status,e.statusText=e.f.statusText),e.readyState=4,e.f=null,e.c=null,e.l=null,ha(e)}function ha(e){e.onreadystatechange&&e.onreadystatechange.call(e)}function pa(e){gn.call(this),this.headers=new kn,this.D=e||null,this.c=!1,this.B=this.a=null,this.h=this.P=this.l="",this.f=this.O=this.i=this.N=!1,this.g=0,this.s=null,this.m=fa,this.w=this.R=!1}(e=sa.prototype).open=function(e,t){if(this.readyState!=la)throw this.abort(),Error("Error reopening a connection");this.m=e,this.g=t,this.readyState=1,ha(this)},e.send=function(e){if(1!=this.readyState)throw this.abort(),Error("need to call open() first. ");this.a=!0;var t={headers:this.i,method:this.m,credentials:void 0,cache:void 0};e&&(t.body=e),this.s.fetch(new Request(this.g,t)).then(this.sc.bind(this),this.Sa.bind(this))},e.abort=function(){this.response=this.responseText="",this.i=new Headers,this.status=0,this.c&&this.c.cancel("Request was aborted."),1<=this.readyState&&this.a&&4!=this.readyState&&(this.a=!1,ua(this,!1)),this.readyState=la},e.sc=function(e){this.a&&(this.f=e,this.b||(this.b=e.headers,this.readyState=2,ha(this)),this.a&&(this.readyState=3,ha(this),this.a&&("arraybuffer"===this.responseType?e.arrayBuffer().then(this.qc.bind(this),this.Sa.bind(this)):void 0!==s.ReadableStream&&"body"in e?(this.response=this.responseText="",this.c=e.body.getReader(),this.l=new TextDecoder,ca(this)):e.text().then(this.rc.bind(this),this.Sa.bind(this)))))},e.nc=function(e){if(this.a){var t=this.l.decode(e.value?e.value:new Uint8Array(0),{stream:!e.done});t&&(this.response=this.responseText+=t),e.done?ua(this,!0):ha(this),3==this.readyState&&ca(this)}},e.rc=function(e){this.a&&(this.response=this.responseText=e,ua(this,!0))},e.qc=function(e){this.a&&(this.response=e,ua(this,!0))},e.Sa=function(e){var t=this.h;t&&t.log(Zo,"Failed to fetch url "+this.g,e instanceof Error?e:Error(e)),this.a&&ua(this,!0)},e.setRequestHeader=function(e,t){this.i.append(e,t)},e.getResponseHeader=function(e){return this.b?this.b.get(e.toLowerCase())||"":((e=this.h)&&e.log(Zo,"Attempting to get response header but no headers have been received for url: "+this.g,void 0),"")},e.getAllResponseHeaders=function(){if(!this.b){var e=this.h;return e&&e.log(Zo,"Attempting to get all response headers but no headers have been received for url: "+this.g,void 0),""}e=[];for(var t=this.b.entries(),n=t.next();!n.done;)n=n.value,e.push(n[0]+": "+n[1]),n=t.next();return e.join("\r\n")},E(pa,gn);var fa="";pa.prototype.b=ia("goog.net.XhrIo");var da=/^https?$/i,ma=["POST","PUT"];function ga(e,t,n,r,i){if(e.a)throw Error("[goog.net.XhrIo] Object is active with another request="+e.l+"; newUri="+t);n=n?n.toUpperCase():"GET",e.l=t,e.h="",e.P=n,e.N=!1,e.c=!0,e.a=e.D?e.D.a():Lo.a(),e.B=e.D?zo(e.D):zo(Lo),e.a.onreadystatechange=_(e.Sb,e);try{oa(e.b,Sa(e,"Opening Xhr")),e.O=!0,e.a.open(n,String(t),!0),e.O=!1}catch(t){return oa(e.b,Sa(e,"Error opening Xhr: "+t.message)),void va(e,t)}t=r||"";var o=new kn(e.headers);i&&function(e,t){if(e.forEach&&"function"==typeof e.forEach)e.forEach(t,void 0);else if(p(e)||"string"==typeof e)V(e,t,void 0);else for(var n=Tn(e),r=En(e),i=r.length,o=0;ot?null:"string"==typeof e?e.charAt(t):e[t]}(o.X()),r=s.FormData&&t instanceof s.FormData,!H(ma,n)||i||r||o.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),o.forEach((function(e,t){this.a.setRequestHeader(t,e)}),e),e.m&&(e.a.responseType=e.m),"withCredentials"in e.a&&e.a.withCredentials!==e.R&&(e.a.withCredentials=e.R);try{Ea(e),0=t.l&&t.cancel())}this.w?this.w.call(this.s,this):this.u=!0,this.a||(e=new Oa(this),Pa(this),Ca(this,!1,e))}},xa.prototype.m=function(e,t){this.i=!1,Ca(this,e,t)},xa.prototype.then=function(e,t,n){var r,i,o=new vt((function(e,t){r=e,i=t}));return Aa(this,r,(function(e){e instanceof Oa?o.cancel():i(e)})),o.then(e,t,n)},xa.prototype.$goog_Thenable=!0,E(Ra,D),Ra.prototype.message="Deferred has already fired",Ra.prototype.name="AlreadyCalledError",E(Oa,D),Oa.prototype.message="Deferred was canceled",Oa.prototype.name="CanceledError",Na.prototype.c=function(){throw delete Ma[this.a],this.b};var Ma={};function Fa(e){var t,n=document,r=Ee(e).toString(),i=ut(document,"SCRIPT"),o={Tb:i,Ka:void 0},a=new xa(o);return t=window.setTimeout((function(){ja(i,!0);var e=new Va(Ba,"Timeout reached for loading script "+r);Pa(a),Ca(a,!1,e)}),5e3),o.Ka=t,i.onload=i.onreadystatechange=function(){i.readyState&&"loaded"!=i.readyState&&"complete"!=i.readyState||(ja(i,!1,t),Pa(a),Ca(a,!0,null))},i.onerror=function(){ja(i,!0,t);var e=new Va($a,"Error while loading script "+r);Pa(a),Ca(a,!1,e)},de(o={},{type:"text/javascript",charset:"UTF-8"}),ot(i,o),function(e,t){me(e,"HTMLScriptElement"),e.src=Ee(t),null===c&&(c=(t=(t=s.document).querySelector&&t.querySelector("script[nonce]"))&&(t=t.nonce||t.getAttribute("nonce"))&&l.test(t)?t:""),(t=c)&&e.setAttribute("nonce",t)}(i,e),function(e){var t;return(t=(e||document).getElementsByTagName("HEAD"))&&0!=t.length?t[0]:e.documentElement}(n).appendChild(i),a}function La(){if(this&&this.Tb){var e=this.Tb;e&&"SCRIPT"==e.tagName&&ja(e,!0,this.Ka)}}function ja(e,t,n){null!=n&&s.clearTimeout(n),e.onload=u,e.onerror=u,e.onreadystatechange=u,t&&window.setTimeout((function(){e&&e.parentNode&&e.parentNode.removeChild(e)}),0)}var $a=0,Ba=1;function Va(e,t){var n="Jsloader error (code #"+e+")";t&&(n+=": "+t),D.call(this,n),this.code=e}function Ga(e){this.f=e}function za(e,n,r){if(this.c=e,e=n||{},this.u=e.secureTokenEndpoint||"https://securetoken.googleapis.com/v1/token",this.m=e.secureTokenTimeout||qa,this.g=pe(e.secureTokenHeaders||Wa),this.h=e.firebaseEndpoint||"https://www.googleapis.com/identitytoolkit/v3/relyingparty/",this.l=e.identityPlatformEndpoint||"https://identitytoolkit.googleapis.com/v2/",this.i=e.firebaseTimeout||Ya,this.a=pe(e.firebaseHeaders||Ka),r&&(this.a["X-Client-Version"]=r,this.g["X-Client-Version"]=r),r="Node"==mr(),!(r=s.XMLHttpRequest||r&&t.INTERNAL.node&&t.INTERNAL.node.XMLHttpRequest)&&!dr())throw new T("internal-error","The XMLHttpRequest compatibility library was not found.");this.f=void 0,dr()?this.f=new aa(self):gr()?this.f=new Ga(r):this.f=new qo,this.b=null}E(Va,D),E(Ga,Go),Ga.prototype.a=function(){return new this.f},Ga.prototype.b=function(){return{}};var Ua,Ha="idToken",qa=new Mr(3e4,6e4),Wa={"Content-Type":"application/x-www-form-urlencoded"},Ya=new Mr(3e4,6e4),Ka={"Content-Type":"application/json"};function Qa(e,t){t?e.a["X-Firebase-Locale"]=t:delete e.a["X-Firebase-Locale"]}function Xa(e,t){t?(e.a["X-Client-Version"]=t,e.g["X-Client-Version"]=t):(delete e.a["X-Client-Version"],delete e.g["X-Client-Version"])}function Ja(e,t,n,r,i,o,a){(function(){var e=Er();return!((e=_r(e)!=vr?null:(e=e.match(/\sChrome\/(\d+)/i))&&2==e.length?parseInt(e[1],10):null)&&30>e)&&(!He||!et||9t;t++){i=0|n[t-15],r=0|n[t-2];var o=(0|n[t-16])+((i>>>7|i<<25)^(i>>>18|i<<14)^i>>>3)|0,a=(0|n[t-7])+((r>>>17|r<<15)^(r>>>19|r<<13)^r>>>10)|0;n[t]=o+a|0}r=0|e.a[0],i=0|e.a[1];var s=0|e.a[2],l=0|e.a[3],c=0|e.a[4],u=0|e.a[5],h=0|e.a[6];for(o=0|e.a[7],t=0;64>t;t++){var p=((r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10))+(r&i^r&s^i&s)|0;a=(o=o+((c>>>6|c<<26)^(c>>>11|c<<21)^(c>>>25|c<<7))|0)+((a=(a=c&u^~c&h)+(0|Xl[t])|0)+(0|n[t])|0)|0,o=h,h=u,u=c,c=l+a|0,l=s,s=i,i=r,r=a+p|0}e.a[0]=e.a[0]+r|0,e.a[1]=e.a[1]+i|0,e.a[2]=e.a[2]+s|0,e.a[3]=e.a[3]+l|0,e.a[4]=e.a[4]+c|0,e.a[5]=e.a[5]+u|0,e.a[6]=e.a[6]+h|0,e.a[7]=e.a[7]+o|0}function sc(e,t,n){void 0===n&&(n=t.length);var r=0,i=e.c;if("string"==typeof t)for(;r=o&&o==(0|o)))throw Error("message must be a byte array");e.f[i++]=o,i==e.b&&(ac(e),i=0)}}e.c=i,e.g+=n}ec.prototype.reset=function(){this.g=this.c=0,this.a=s.Int32Array?new Int32Array(this.h):K(this.h)};var lc=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function cc(){ec.call(this,8,uc)}E(cc,ec);var uc=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225];function hc(e,t,n,r,i){this.u=e,this.i=t,this.l=n,this.m=r||null,this.s=i||null,this.h=t+":"+n,this.w=new Zl,this.g=new Ql(this.h),this.f=null,this.b=[],this.a=this.c=null}function pc(e){return new T("invalid-cordova-configuration",e)}function fc(e){var t=new cc;sc(t,e),e=[];var n=8*t.g;56>t.c?sc(t,oc,56-t.c):sc(t,oc,t.b-(t.c-56));for(var r=63;56<=r;r--)t.f[r]=255&n,n/=256;for(ac(t),r=n=0;r>i&255;return function(e){return z(e,(function(e){return 1<(e=e.toString(16)).length?e:"0"+e})).join("")}(e)}function dc(e,t){for(var n=0;ne.f&&(e.a=e.f),t)}(t,n)).then((function(){return function(){var e=s.document,t=null;return Fr()||!e?St():new vt((function(n){t=function(){Fr()&&(e.removeEventListener("visibilitychange",t,!1),n())},e.addEventListener("visibilitychange",t,!1)})).o((function(n){throw e.removeEventListener("visibilitychange",t,!1),n}))}()})).then((function(){return t.h()})).then((function(){e(t,!0)})).o((function(n){t.i(n)&&e(t,!1)}))}(this,!0)},tu.prototype.stop=function(){this.b&&(this.b.cancel(),this.b=null)},nu.prototype.v=function(){return{apiKey:this.c.c,refreshToken:this.a,accessToken:this.b&&this.b.toString(),expirationTime:ru(this)}},nu.prototype.getToken=function(e){return e=!!e,this.b&&!this.a?xt(new T("user-token-expired")):e||!this.b||w()>ru(this)-3e4?this.a?ou(this,{grant_type:"refresh_token",refresh_token:this.a}):St(null):St({accessToken:this.b.toString(),refreshToken:this.a})},au.prototype.v=function(){return{lastLoginAt:this.b,createdAt:this.a}},E(lu,gn),lu.prototype.va=function(e){this.oa=e,Qa(this.a,e)},lu.prototype.ja=function(){return this.oa},lu.prototype.Ea=function(){return K(this.W)},lu.prototype.Ma=function(){this.B.b&&(this.B.stop(),this.B.start())},zr(lu.prototype,"providerId","firebase"),(e=lu.prototype).reload=function(){var e=this;return Nu(this,bu(this).then((function(){return xu(e).then((function(){return gu(e)})).then(_u)})))},e.mc=function(e){return this.I(e).then((function(e){return new zc(e)}))},e.I=function(e){var t=this;return Nu(this,bu(this).then((function(){return t.b.getToken(e)})).then((function(e){if(!e)throw new T("internal-error");return e.accessToken!=t.xa&&(mu(t,e.accessToken),t.dispatchEvent(new Jc("tokenChanged"))),ku(t,"refreshToken",e.refreshToken),e.accessToken})))},e.Ic=function(e){if(!(e=e.users)||!e.length)throw new T("internal-error");vu(this,{uid:(e=e[0]).localId,displayName:e.displayName,photoURL:e.photoUrl,email:e.email,emailVerified:!!e.emailVerified,phoneNumber:e.phoneNumber,lastLoginAt:e.lastLoginAt,createdAt:e.createdAt,tenantId:e.tenantId});for(var t=function(e){return(e=e.providerUserInfo)&&e.length?z(e,(function(e){return new su(e.rawId,e.providerId,e.email,e.displayName,e.photoUrl,e.phoneNumber)})):[]}(e),n=0;nthis.s&&(this.s=0),0==this.s&&nh(this)&&du(nh(this)),this.removeAuthTokenListener(e)},e.addAuthTokenListener=function(e){var t=this;this.m.push(e),oh(this,this.h.then((function(){t.l||H(t.m,e)&&e(rh(t))})))},e.removeAuthTokenListener=function(e){W(this.m,(function(t){return t==e}))},e.delete=function(){this.l=!0;for(var e=0;ei||i>=Ih.length)throw new T("internal-error","Argument validator received an unsupported number of arguments.");n=Ih[i],r=(r?"":n+" argument ")+(t.name?'"'+t.name+'" ':"")+"must be "+t.J+".";break e}r=null}}if(r)throw new T("argument-error",e+" failed: "+r)}(e=bh.prototype).Ga=function(){var e=this;return this.f?this.f:this.f=xh(this,St().then((function(){if(xr()&&!dr())return hr();throw new T("operation-not-supported-in-this-environment","RecaptchaVerifier is only supported in a browser HTTP/HTTPS environment.")})).then((function(){return e.m.g(e.w())})).then((function(t){return e.g=t,Ys(e.s,Ds,{})})).then((function(t){e.a[Th]=t.recaptchaSiteKey})).o((function(t){throw e.f=null,t})))},e.render=function(){Ch(this);var e=this;return xh(this,this.Ga().then((function(){if(null===e.c){var t=e.u;if(!e.i){var n=it(t);t=function(e,t,n){var r=arguments,i=document,o=String(r[0]),a=r[1];if(!rt&&a&&(a.name||a.type)){if(o=["<",o],a.name&&o.push(' name="',Be(a.name),'"'),a.type){o.push(' type="',Be(a.type),'"');var s={};de(s,a),delete s.type,a=s}o.push(">"),o=o.join("")}return o=ut(i,o),a&&("string"==typeof a?o.className=a:Array.isArray(a)?o.className=a.join(" "):ot(o,a)),21)for(var n=1;nn?r.push(e.substring(i,n)):r.push(e.substring(i,i+t));return r}; -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */function A(e,t){for(var n in e)e.hasOwnProperty(n)&&t(n,e[n])}var I=function(e){index_cjs.assert(!w(e),"Invalid JSON number");var t,n,r,i,o;0===e?(n=0,r=0,t=1/e==-1/0?1:0):(t=e<0,(e=Math.abs(e))>=Math.pow(2,-1022)?(n=(i=Math.min(Math.floor(Math.log(e)/Math.LN2),1023))+1023,r=Math.round(e*Math.pow(2,52-i)-Math.pow(2,52))):(n=0,r=Math.round(e/Math.pow(2,-1074))));var a=[];for(o=52;o;o-=1)a.push(r%2?1:0),r=Math.floor(r/2);for(o=11;o;o-=1)a.push(n%2?1:0),n=Math.floor(n/2);a.push(t?1:0),a.reverse();var s=a.join(""),l="";for(o=0;o<64;o+=8){var c=parseInt(s.substr(o,8),2).toString(16);1===c.length&&(c="0"+c),l+=c}return l.toLowerCase()},D=new RegExp("^-?(0*)\\d{1,10}$"),R=function(e){if(D.test(e)){var t=Number(e);if(t>=-2147483648&&t<=2147483647)return t}return null},O=function(e){try{e()}catch(e){setTimeout((function(){var t=e.stack||"";throw b("Exception was thrown by user callback.",t),e}),Math.floor(0))}},N=function(e,t){var n=setTimeout(e,t);return"object"==typeof n&&n.unref&&n.unref(),n},M=function(){function e(e,t){if(void 0===t){this.pieces_=e.split("/");for(var n=0,r=0;r0&&(this.pieces_[n]=this.pieces_[r],n++);this.pieces_.length=n,this.pieceNum_=0}else this.pieces_=e,this.pieceNum_=t}return Object.defineProperty(e,"Empty",{get:function(){return new e("")},enumerable:!1,configurable:!0}),e.prototype.getFront=function(){return this.pieceNum_>=this.pieces_.length?null:this.pieces_[this.pieceNum_]},e.prototype.getLength=function(){return this.pieces_.length-this.pieceNum_},e.prototype.popFront=function(){var t=this.pieceNum_;return t=this.pieces_.length)return null;for(var t=[],n=this.pieceNum_;n0&&n.push(i[r])}return new e(n,0)},e.prototype.isEmpty=function(){return this.pieceNum_>=this.pieces_.length},e.relativePath=function(t,n){var r=t.getFront(),i=n.getFront();if(null===r)return n;if(r===i)return e.relativePath(t.popFront(),n.popFront());throw new Error("INTERNAL ERROR: innerPath ("+n+") is not within outerPath ("+t+")")},e.comparePaths=function(e,t){for(var n=e.slice(),r=t.slice(),i=0;ie.getLength())return!1;for(;t0&&(this.byteLength_+=1),this.parts_.push(e),this.byteLength_+=index_cjs.stringLength(e),this.checkValid_()},e.prototype.pop=function(){var e=this.parts_.pop();this.byteLength_-=index_cjs.stringLength(e),this.parts_.length>0&&(this.byteLength_-=1)},e.prototype.checkValid_=function(){if(this.byteLength_>e.MAX_PATH_LENGTH_BYTES)throw new Error(this.errorPrefix_+"has a key path longer than "+e.MAX_PATH_LENGTH_BYTES+" bytes ("+this.byteLength_+").");if(this.parts_.length>e.MAX_PATH_DEPTH)throw new Error(this.errorPrefix_+"path specified exceeds the maximum depth that can be written ("+e.MAX_PATH_DEPTH+") or object contains a cycle "+this.toErrorString())},e.prototype.toErrorString=function(){return 0===this.parts_.length?"":"in property '"+this.parts_.join(".")+"'"},e}(),L=function(){function e(e,t,n,r,i,o){void 0===i&&(i=""),void 0===o&&(o=!1),this.secure=t,this.namespace=n,this.webSocketOnly=r,this.persistenceKey=i,this.includeNamespaceInQueryParams=o,this.host=e.toLowerCase(),this.domain=this.host.substr(this.host.indexOf(".")+1),this.internalHost=s.get("host:"+e)||this.host}return e.prototype.needsQueryParam=function(){return this.host!==this.internalHost||this.isCustomHost()||this.includeNamespaceInQueryParams},e.prototype.isCacheableHost=function(){return"s-"===this.internalHost.substr(0,2)},e.prototype.isDemoHost=function(){return"firebaseio-demo.com"===this.domain},e.prototype.isCustomHost=function(){return"firebaseio.com"!==this.domain&&"firebaseio-demo.com"!==this.domain},e.prototype.updateHost=function(e){e!==this.internalHost&&(this.internalHost=e,this.isCacheableHost()&&s.set("host:"+this.host,this.internalHost))},e.prototype.connectionURL=function(e,t){var n;if(index_cjs.assert("string"==typeof e,"typeof type must == string"),index_cjs.assert("object"==typeof t,"typeof params must == object"),"websocket"===e)n=(this.secure?"wss://":"ws://")+this.internalHost+"/.ws?";else{if("long_polling"!==e)throw new Error("Unknown connection type: "+e);n=(this.secure?"https://":"http://")+this.internalHost+"/.lp?"}this.needsQueryParam()&&(t.ns=this.namespace);var r=[];return A(t,(function(e,t){r.push(e+"="+t)})),n+r.join("&")},e.prototype.toString=function(){var e=this.toURLString();return this.persistenceKey&&(e+="<"+this.persistenceKey+">"),e},e.prototype.toURLString=function(){return(this.secure?"https://":"http://")+this.host},e}();var j,$,B,V,G,z=function(e){var t=U(e),n=t.namespace;"firebase.com"===t.domain&&_(t.host+" is no longer supported. Please use .firebaseio.com instead"),n&&"undefined"!==n||"localhost"===t.domain||_("Cannot parse Firebase url. Please use https://.firebaseio.com"),t.secure||"undefined"!=typeof window&&window.location&&window.location.protocol&&-1!==window.location.protocol.indexOf("https:")&&b("Insecure Firebase access from a secure page. Please use https in calls to new Firebase().");var r="ws"===t.scheme||"wss"===t.scheme;return{repoInfo:new L(t.host,t.secure,n,r,"",n!==t.subdomain),path:new M(t.pathString)}},U=function(e){var t="",n="",r="",i="",o="",a=!0,s="https",l=443;if("string"==typeof e){var c=e.indexOf("//");c>=0&&(s=e.substring(0,c-1),e=e.substring(c+2));var u=e.indexOf("/");-1===u&&(u=e.length);var h=e.indexOf("?");-1===h&&(h=e.length),t=e.substring(0,Math.min(u,h)),u0){var i=n[r];try{i=decodeURIComponent(i.replace(/\+/g," "))}catch(e){}t+="/"+i}return t}(e.substring(u,h)));var p=function(e){var t,n,r={};"?"===e.charAt(0)&&(e=e.substring(1));try{for(var i=tslib.__values(e.split("&")),o=i.next();!o.done;o=i.next()){var a=o.value;if(0!==a.length){var s=a.split("=");2===s.length?r[decodeURIComponent(s[0])]=decodeURIComponent(s[1]):b("Invalid query segment '"+a+"' in query '"+e+"'")}}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r}(e.substring(Math.min(e.length,h)));(c=t.indexOf(":"))>=0?(a="https"===s||"wss"===s,l=parseInt(t.substring(c+1),10)):c=t.length;var f=t.slice(0,c);if("localhost"===f.toLowerCase())n="localhost";else if(f.split(".").length<=2)n=f;else{var d=t.indexOf(".");r=t.substring(0,d).toLowerCase(),n=t.substring(d+1),o=r}"ns"in p&&(o=p.ns)}return{host:t,port:l,domain:n,subdomain:r,secure:a,scheme:s,pathString:i,namespace:o}},H=/[\[\].#$\/\u0000-\u001F\u007F]/,q=/[\[\].#$\u0000-\u001F\u007F]/,W=function(e){return"string"==typeof e&&0!==e.length&&!H.test(e)},Y=function(e){return"string"==typeof e&&0!==e.length&&!q.test(e)},K=function(e){return null===e||"string"==typeof e||"number"==typeof e&&!w(e)||e&&"object"==typeof e&&index_cjs.contains(e,".sv")},Q=function(e,t,n,r,i){i&&void 0===n||X(index_cjs.errorPrefix(e,t,i),n,r)},X=function(e,t,n){var r=n instanceof M?new F(n,e):n;if(void 0===t)throw new Error(e+"contains undefined "+r.toErrorString());if("function"==typeof t)throw new Error(e+"contains a function "+r.toErrorString()+" with contents = "+t.toString());if(w(t))throw new Error(e+"contains "+t.toString()+" "+r.toErrorString());if("string"==typeof t&&t.length>10485760/3&&index_cjs.stringLength(t)>10485760)throw new Error(e+"contains a string greater than 10485760 utf8 bytes "+r.toErrorString()+" ('"+t.substring(0,50)+"...')");if(t&&"object"==typeof t){var i=!1,o=!1;if(A(t,(function(t,n){if(".value"===t)i=!0;else if(".priority"!==t&&".sv"!==t&&(o=!0,!W(t)))throw new Error(e+" contains an invalid key ("+t+") "+r.toErrorString()+'. Keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]"');r.push(t),X(e,n,r),r.pop()})),i&&o)throw new Error(e+' contains ".value" child '+r.toErrorString()+" in addition to actual children.")}},J=function(e,t,n,r,i){if(!i||void 0!==n){var o=index_cjs.errorPrefix(e,t,i);if(!n||"object"!=typeof n||Array.isArray(n))throw new Error(o+" must be an object containing the children to replace.");var a=[];A(n,(function(e,t){var n=new M(e);if(X(o,t,r.child(n)),".priority"===n.getBack()&&!K(t))throw new Error(o+"contains an invalid value for '"+n.toString()+"', which must be a valid Firebase priority (a string, finite number, server value, or null).");a.push(n)})),function(e,t){var n,r;for(n=0;n=0;t--)r[t]=j.charAt(e%64),e=Math.floor(e/64);index_cjs.assert(0===e,"Cannot push at time == 0");var i=r.join("");if(n){for(t=11;t>=0&&63===B[t];t--)B[t]=0;B[t]++}else for(t=0;t<12;t++)B[t]=Math.floor(64*Math.random());for(t=0;t<12;t++)i+=j.charAt(B[t]);return index_cjs.assert(20===i.length,"nextPushId: Length should be 20."),i}),ue=function(){function e(e,t){this.name=e,this.node=t}return e.Wrap=function(t,n){return new e(t,n)},e}(),he=function(){function e(){}return e.prototype.getCompare=function(){return this.compare.bind(this)},e.prototype.indexedValueChanged=function(e,t){var n=new ue(E,e),r=new ue(E,t);return 0!==this.compare(n,r)},e.prototype.minPost=function(){return ue.MIN},e}(),pe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return tslib.__extends(t,e),Object.defineProperty(t,"__EMPTY_NODE",{get:function(){return V},set:function(e){V=e},enumerable:!1,configurable:!0}),t.prototype.compare=function(e,t){return k(e.name,t.name)},t.prototype.isDefinedOn=function(e){throw index_cjs.assertionError("KeyIndex.isDefinedOn not expected to be called.")},t.prototype.indexedValueChanged=function(e,t){return!1},t.prototype.minPost=function(){return ue.MIN},t.prototype.maxPost=function(){return new ue(T,V)},t.prototype.makePost=function(e,t){return index_cjs.assert("string"==typeof e,"KeyIndex indexValue must always be a string."),new ue(e,V)},t.prototype.toString=function(){return".key"},t}(he),fe=new pe;var de,me,ge,ye=function(e){return"number"==typeof e?"number:"+I(e):"string:"+e},ve=function(e){if(e.isLeafNode()){var t=e.val();index_cjs.assert("string"==typeof t||"number"==typeof t||"object"==typeof t&&index_cjs.contains(t,".sv"),"Priority must be a string or number.")}else index_cjs.assert(e===G||e.isEmpty(),"priority of unexpected type.");index_cjs.assert(e===G||e.getPriority().isEmpty(),"Priority nodes can't have a priority of their own.")},_e=function(){function e(t,n){void 0===n&&(n=e.__childrenNodeConstructor.EMPTY_NODE),this.value_=t,this.priorityNode_=n,this.lazyHash_=null,index_cjs.assert(void 0!==this.value_&&null!==this.value_,"LeafNode shouldn't be created with null/undefined value."),ve(this.priorityNode_)}return Object.defineProperty(e,"__childrenNodeConstructor",{get:function(){return de},set:function(e){de=e},enumerable:!1,configurable:!0}),e.prototype.isLeafNode=function(){return!0},e.prototype.getPriority=function(){return this.priorityNode_},e.prototype.updatePriority=function(t){return new e(this.value_,t)},e.prototype.getImmediateChild=function(t){return".priority"===t?this.priorityNode_:e.__childrenNodeConstructor.EMPTY_NODE},e.prototype.getChild=function(t){return t.isEmpty()?this:".priority"===t.getFront()?this.priorityNode_:e.__childrenNodeConstructor.EMPTY_NODE},e.prototype.hasChild=function(){return!1},e.prototype.getPredecessorChildName=function(e,t){return null},e.prototype.updateImmediateChild=function(t,n){return".priority"===t?this.updatePriority(n):n.isEmpty()&&".priority"!==t?this:e.__childrenNodeConstructor.EMPTY_NODE.updateImmediateChild(t,n).updatePriority(this.priorityNode_)},e.prototype.updateChild=function(t,n){var r=t.getFront();return null===r?n:n.isEmpty()&&".priority"!==r?this:(index_cjs.assert(".priority"!==r||1===t.getLength(),".priority must be the last token in a path"),this.updateImmediateChild(r,e.__childrenNodeConstructor.EMPTY_NODE.updateChild(t.popFront(),n)))},e.prototype.isEmpty=function(){return!1},e.prototype.numChildren=function(){return 0},e.prototype.forEachChild=function(e,t){return!1},e.prototype.val=function(e){return e&&!this.getPriority().isEmpty()?{".value":this.getValue(),".priority":this.getPriority().val()}:this.getValue()},e.prototype.hash=function(){if(null===this.lazyHash_){var e="";this.priorityNode_.isEmpty()||(e+="priority:"+ye(this.priorityNode_.val())+":");var t=typeof this.value_;e+=t+":",e+="number"===t?I(this.value_):this.value_,this.lazyHash_=h(e)}return this.lazyHash_},e.prototype.getValue=function(){return this.value_},e.prototype.compareTo=function(t){return t===e.__childrenNodeConstructor.EMPTY_NODE?1:t instanceof e.__childrenNodeConstructor?-1:(index_cjs.assert(t.isLeafNode(),"Unknown node type"),this.compareToLeafNode_(t))},e.prototype.compareToLeafNode_=function(t){var n=typeof t.value_,r=typeof this.value_,i=e.VALUE_TYPE_ORDER.indexOf(n),o=e.VALUE_TYPE_ORDER.indexOf(r);return index_cjs.assert(i>=0,"Unknown leaf type: "+n),index_cjs.assert(o>=0,"Unknown leaf type: "+r),i===o?"object"===r?0:this.value_0},e.prototype.peek=function(){if(0===this.nodeStack_.length)return null;var e=this.nodeStack_[this.nodeStack_.length-1];return this.resultGenerator_?this.resultGenerator_(e.key,e.value):{key:e.key,value:e.value}},e}(),ke=function(){function e(t,n,r,i,o){this.key=t,this.value=n,this.color=null!=r?r:e.RED,this.left=null!=i?i:xe.EMPTY_NODE,this.right=null!=o?o:xe.EMPTY_NODE}return e.prototype.copy=function(t,n,r,i,o){return new e(null!=t?t:this.key,null!=n?n:this.value,null!=r?r:this.color,null!=i?i:this.left,null!=o?o:this.right)},e.prototype.count=function(){return this.left.count()+1+this.right.count()},e.prototype.isEmpty=function(){return!1},e.prototype.inorderTraversal=function(e){return this.left.inorderTraversal(e)||!!e(this.key,this.value)||this.right.inorderTraversal(e)},e.prototype.reverseTraversal=function(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)},e.prototype.min_=function(){return this.left.isEmpty()?this:this.left.min_()},e.prototype.minKey=function(){return this.min_().key},e.prototype.maxKey=function(){return this.right.isEmpty()?this.key:this.right.maxKey()},e.prototype.insert=function(e,t,n){var r=this,i=n(e,r.key);return(r=i<0?r.copy(null,null,null,r.left.insert(e,t,n),null):0===i?r.copy(null,t,null,null,null):r.copy(null,null,null,null,r.right.insert(e,t,n))).fixUp_()},e.prototype.removeMin_=function(){if(this.left.isEmpty())return xe.EMPTY_NODE;var e=this;return e.left.isRed_()||e.left.left.isRed_()||(e=e.moveRedLeft_()),(e=e.copy(null,null,null,e.left.removeMin_(),null)).fixUp_()},e.prototype.remove=function(e,t){var n,r;if(t(e,(n=this).key)<0)n.left.isEmpty()||n.left.isRed_()||n.left.left.isRed_()||(n=n.moveRedLeft_()),n=n.copy(null,null,null,n.left.remove(e,t),null);else{if(n.left.isRed_()&&(n=n.rotateRight_()),n.right.isEmpty()||n.right.isRed_()||n.right.left.isRed_()||(n=n.moveRedRight_()),0===t(e,n.key)){if(n.right.isEmpty())return xe.EMPTY_NODE;r=n.right.min_(),n=n.copy(r.key,r.value,null,null,n.right.removeMin_())}n=n.copy(null,null,null,null,n.right.remove(e,t))}return n.fixUp_()},e.prototype.isRed_=function(){return this.color},e.prototype.fixUp_=function(){var e=this;return e.right.isRed_()&&!e.left.isRed_()&&(e=e.rotateLeft_()),e.left.isRed_()&&e.left.left.isRed_()&&(e=e.rotateRight_()),e.left.isRed_()&&e.right.isRed_()&&(e=e.colorFlip_()),e},e.prototype.moveRedLeft_=function(){var e=this.colorFlip_();return e.right.left.isRed_()&&(e=(e=(e=e.copy(null,null,null,null,e.right.rotateRight_())).rotateLeft_()).colorFlip_()),e},e.prototype.moveRedRight_=function(){var e=this.colorFlip_();return e.left.left.isRed_()&&(e=(e=e.rotateRight_()).colorFlip_()),e},e.prototype.rotateLeft_=function(){var t=this.copy(null,null,e.RED,null,this.right.left);return this.right.copy(null,null,this.color,t,null)},e.prototype.rotateRight_=function(){var t=this.copy(null,null,e.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,t)},e.prototype.colorFlip_=function(){var e=this.left.copy(null,null,!this.left.color,null,null),t=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,t)},e.prototype.checkMaxDepth_=function(){var e=this.check_();return Math.pow(2,e)<=this.count()+1},e.prototype.check_=function(){if(this.isRed_()&&this.left.isRed_())throw new Error("Red node has red child("+this.key+","+this.value+")");if(this.right.isRed_())throw new Error("Right child of ("+this.key+","+this.value+") is red");var e=this.left.check_();if(e!==this.right.check_())throw new Error("Black depths differ");return e+(this.isRed_()?0:1)},e.RED=!0,e.BLACK=!1,e}(),Se=function(){function e(){}return e.prototype.copy=function(e,t,n,r,i){return this},e.prototype.insert=function(e,t,n){return new ke(e,t,null)},e.prototype.remove=function(e,t){return this},e.prototype.count=function(){return 0},e.prototype.isEmpty=function(){return!0},e.prototype.inorderTraversal=function(e){return!1},e.prototype.reverseTraversal=function(e){return!1},e.prototype.minKey=function(){return null},e.prototype.maxKey=function(){return null},e.prototype.check_=function(){return 0},e.prototype.isRed_=function(){return!1},e}(),xe=function(){function e(t,n){void 0===n&&(n=e.EMPTY_NODE),this.comparator_=t,this.root_=n}return e.prototype.insert=function(t,n){return new e(this.comparator_,this.root_.insert(t,n,this.comparator_).copy(null,null,ke.BLACK,null,null))},e.prototype.remove=function(t){return new e(this.comparator_,this.root_.remove(t,this.comparator_).copy(null,null,ke.BLACK,null,null))},e.prototype.get=function(e){for(var t,n=this.root_;!n.isEmpty();){if(0===(t=this.comparator_(e,n.key)))return n.value;t<0?n=n.left:t>0&&(n=n.right)}return null},e.prototype.getPredecessorKey=function(e){for(var t,n=this.root_,r=null;!n.isEmpty();){if(0===(t=this.comparator_(e,n.key))){if(n.left.isEmpty())return r?r.key:null;for(n=n.left;!n.right.isEmpty();)n=n.right;return n.key}t<0?n=n.left:t>0&&(r=n,n=n.right)}throw new Error("Attempted to find predecessor key for a nonexistent key. What gives?")},e.prototype.isEmpty=function(){return this.root_.isEmpty()},e.prototype.count=function(){return this.root_.count()},e.prototype.minKey=function(){return this.root_.minKey()},e.prototype.maxKey=function(){return this.root_.maxKey()},e.prototype.inorderTraversal=function(e){return this.root_.inorderTraversal(e)},e.prototype.reverseTraversal=function(e){return this.root_.reverseTraversal(e)},e.prototype.getIterator=function(e){return new Te(this.root_,null,this.comparator_,!1,e)},e.prototype.getIteratorFrom=function(e,t){return new Te(this.root_,e,this.comparator_,!1,t)},e.prototype.getReverseIteratorFrom=function(e,t){return new Te(this.root_,e,this.comparator_,!0,t)},e.prototype.getReverseIterator=function(e){return new Te(this.root_,null,this.comparator_,!0,e)},e.EMPTY_NODE=new Se,e}(),Ce=Math.log(2),Pe=function(){function e(e){var t;this.count=(t=e+1,parseInt(Math.log(t)/Ce,10)),this.current_=this.count-1;var n,r=(n=this.count,parseInt(Array(n+1).join("1"),2));this.bits_=e+1&r}return e.prototype.nextBitIsOne=function(){var e=!(this.bits_&1<0;)r.getNext(),i=r.peek();return r},e.prototype.compareTo=function(e){return this.isEmpty()?e.isEmpty()?0:-1:e.isLeafNode()||e.isEmpty()?1:e===Me?-1:0},e.prototype.withIndex=function(t){if(t===fe||this.indexMap_.hasIndex(t))return this;var n=this.indexMap_.addIndex(t,this.children_);return new e(this.children_,this.priorityNode_,n)},e.prototype.isIndexed=function(e){return e===fe||this.indexMap_.hasIndex(e)},e.prototype.equals=function(e){if(e===this)return!0;if(e.isLeafNode())return!1;var t=e;if(this.getPriority().equals(t.getPriority())){if(this.children_.count()===t.children_.count()){for(var n=this.getIterator(Ee),r=t.getIterator(Ee),i=n.getNext(),o=r.getNext();i&&o;){if(i.name!==o.name||!i.node.equals(o.node))return!1;i=n.getNext(),o=r.getNext()}return null===i&&null===o}return!1}return!1},e.prototype.resolveIndex_=function(e){return e===fe?null:this.indexMap_.get(e.toString())},e.INTEGER_REGEXP_=/^(0|[1-9]\d*)$/,e}(),Me=new(function(e){function t(){return e.call(this,new xe(Oe),Ne.EMPTY_NODE,De.Default)||this}return tslib.__extends(t,e),t.prototype.compareTo=function(e){return e===this?0:1},t.prototype.equals=function(e){return e===this},t.prototype.getPriority=function(){return this},t.prototype.getImmediateChild=function(e){return Ne.EMPTY_NODE},t.prototype.isEmpty=function(){return!1},t}(Ne));Object.defineProperties(ue,{MIN:{value:new ue(E,Ne.EMPTY_NODE)},MAX:{value:new ue(T,Me)}}),pe.__EMPTY_NODE=Ne.EMPTY_NODE,_e.__childrenNodeConstructor=Ne,G=Me,function(e){ge=e}(Me);function Fe(e,t){if(void 0===t&&(t=null),null===e)return Ne.EMPTY_NODE;if("object"==typeof e&&".priority"in e&&(t=e[".priority"]),index_cjs.assert(null===t||"string"==typeof t||"number"==typeof t||"object"==typeof t&&".sv"in t,"Invalid priority type found: "+typeof t),"object"==typeof e&&".value"in e&&null!==e[".value"]&&(e=e[".value"]),"object"!=typeof e||".sv"in e)return new _e(e,Fe(t));if(e instanceof Array){var n=Ne.EMPTY_NODE;return A(e,(function(t,r){if(index_cjs.contains(e,t)&&"."!==t.substring(0,1)){var i=Fe(r);!i.isLeafNode()&&i.isEmpty()||(n=n.updateImmediateChild(t,i))}})),n.updatePriority(Fe(t))}var r=[],i=!1;if(A(e,(function(e,t){if("."!==e.substring(0,1)){var n=Fe(t);n.isEmpty()||(i=i||!n.getPriority().isEmpty(),r.push(new ue(e,n)))}})),0===r.length)return Ne.EMPTY_NODE;var o=Ae(r,Re,(function(e){return e.name}),Oe);if(i){var a=Ae(r,Ee.getCompare());return new Ne(o,Fe(t),new De({".priority":a},{".priority":Ee}))}return new Ne(o,Fe(t),De.Default)}!function(e){me=e}(Fe); -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var Le,je=new(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return tslib.__extends(t,e),t.prototype.compare=function(e,t){var n=e.node.compareTo(t.node);return 0===n?k(e.name,t.name):n},t.prototype.isDefinedOn=function(e){return!0},t.prototype.indexedValueChanged=function(e,t){return!e.equals(t)},t.prototype.minPost=function(){return ue.MIN},t.prototype.maxPost=function(){return ue.MAX},t.prototype.makePost=function(e,t){var n=Fe(e);return new ue(t,n)},t.prototype.toString=function(){return".value"},t}(he)),$e=function(e){function t(t){var n=e.call(this)||this;return n.indexPath_=t,index_cjs.assert(!t.isEmpty()&&".priority"!==t.getFront(),"Can't create PathIndex with empty path or .priority key"),n}return tslib.__extends(t,e),t.prototype.extractChild=function(e){return e.getChild(this.indexPath_)},t.prototype.isDefinedOn=function(e){return!e.getChild(this.indexPath_).isEmpty()},t.prototype.compare=function(e,t){var n=this.extractChild(e.node),r=this.extractChild(t.node),i=n.compareTo(r);return 0===i?k(e.name,t.name):i},t.prototype.makePost=function(e,t){var n=Fe(e),r=Ne.EMPTY_NODE.updateChild(this.indexPath_,n);return new ue(t,r)},t.prototype.maxPost=function(){var e=Ne.EMPTY_NODE.updateChild(this.indexPath_,Me);return new ue(T,e)},t.prototype.toString=function(){return this.indexPath_.slice().join("/")},t}(he),Be=function(){function e(e,t,n){this.node_=e,this.ref_=t,this.index_=n}return e.prototype.val=function(){return index_cjs.validateArgCount("DataSnapshot.val",0,0,arguments.length),this.node_.val()},e.prototype.exportVal=function(){return index_cjs.validateArgCount("DataSnapshot.exportVal",0,0,arguments.length),this.node_.val(!0)},e.prototype.toJSON=function(){return index_cjs.validateArgCount("DataSnapshot.toJSON",0,1,arguments.length),this.exportVal()},e.prototype.exists=function(){return index_cjs.validateArgCount("DataSnapshot.exists",0,0,arguments.length),!this.node_.isEmpty()},e.prototype.child=function(t){index_cjs.validateArgCount("DataSnapshot.child",0,1,arguments.length),t=String(t),ne("DataSnapshot.child",1,t,!1);var n=new M(t),r=this.ref_.child(n);return new e(this.node_.getChild(n),r,Ee)},e.prototype.hasChild=function(e){index_cjs.validateArgCount("DataSnapshot.hasChild",1,1,arguments.length),ne("DataSnapshot.hasChild",1,e,!1);var t=new M(e);return!this.node_.getChild(t).isEmpty()},e.prototype.getPriority=function(){return index_cjs.validateArgCount("DataSnapshot.getPriority",0,0,arguments.length),this.node_.getPriority().val()},e.prototype.forEach=function(t){var n=this;if(index_cjs.validateArgCount("DataSnapshot.forEach",1,1,arguments.length),index_cjs.validateCallback("DataSnapshot.forEach",1,t,!1),this.node_.isLeafNode())return!1;var r=this.node_;return!!r.forEachChild(this.index_,(function(r,i){return t(new e(i,n.ref_.child(r),Ee))}))},e.prototype.hasChildren=function(){return index_cjs.validateArgCount("DataSnapshot.hasChildren",0,0,arguments.length),!this.node_.isLeafNode()&&!this.node_.isEmpty()},Object.defineProperty(e.prototype,"key",{get:function(){return this.ref_.getKey()},enumerable:!1,configurable:!0}),e.prototype.numChildren=function(){return index_cjs.validateArgCount("DataSnapshot.numChildren",0,0,arguments.length),this.node_.numChildren()},e.prototype.getRef=function(){return index_cjs.validateArgCount("DataSnapshot.ref",0,0,arguments.length),this.ref_},Object.defineProperty(e.prototype,"ref",{get:function(){return this.getRef()},enumerable:!1,configurable:!0}),e}(),Ve=function(){function e(e,t,n,r){this.eventType=e,this.eventRegistration=t,this.snapshot=n,this.prevName=r}return e.prototype.getPath=function(){var e=this.snapshot.getRef();return"value"===this.eventType?e.path:e.getParent().path},e.prototype.getEventType=function(){return this.eventType},e.prototype.getEventRunner=function(){return this.eventRegistration.getEventRunner(this)},e.prototype.toString=function(){return this.getPath().toString()+":"+this.eventType+":"+index_cjs.stringify(this.snapshot.exportVal())},e}(),Ge=function(){function e(e,t,n){this.eventRegistration=e,this.error=t,this.path=n}return e.prototype.getPath=function(){return this.path},e.prototype.getEventType=function(){return"cancel"},e.prototype.getEventRunner=function(){return this.eventRegistration.getEventRunner(this)},e.prototype.toString=function(){return this.path.toString()+":cancel"},e}(),ze=function(){function e(e,t,n){this.callback_=e,this.cancelCallback_=t,this.context_=n}return e.prototype.respondsTo=function(e){return"value"===e},e.prototype.createEvent=function(e,t){var n=t.getQueryParams().getIndex();return new Ve("value",this,new Be(e.snapshotNode,t.getRef(),n))},e.prototype.getEventRunner=function(e){var t=this.context_;if("cancel"===e.getEventType()){index_cjs.assert(this.cancelCallback_,"Raising a cancel event on a listener with no cancel callback");var n=this.cancelCallback_;return function(){n.call(t,e.error)}}var r=this.callback_;return function(){r.call(t,e.snapshot)}},e.prototype.createCancelEvent=function(e,t){return this.cancelCallback_?new Ge(this,e,t):null},e.prototype.matches=function(t){return t instanceof e&&(!t.callback_||!this.callback_||t.callback_===this.callback_&&t.context_===this.context_)},e.prototype.hasAnyCallback=function(){return null!==this.callback_},e}(),Ue=function(){function e(e,t,n){this.callbacks_=e,this.cancelCallback_=t,this.context_=n}return e.prototype.respondsTo=function(e){var t="children_added"===e?"child_added":e;return t="children_removed"===t?"child_removed":t,index_cjs.contains(this.callbacks_,t)},e.prototype.createCancelEvent=function(e,t){return this.cancelCallback_?new Ge(this,e,t):null},e.prototype.createEvent=function(e,t){index_cjs.assert(null!=e.childName,"Child events should have a childName.");var n=t.getRef().child(e.childName),r=t.getQueryParams().getIndex();return new Ve(e.type,this,new Be(e.snapshotNode,n,r),e.prevName)},e.prototype.getEventRunner=function(e){var t=this.context_;if("cancel"===e.getEventType()){index_cjs.assert(this.cancelCallback_,"Raising a cancel event on a listener with no cancel callback");var n=this.cancelCallback_;return function(){n.call(t,e.error)}}var r=this.callbacks_[e.eventType];return function(){r.call(t,e.snapshot,e.prevName)}},e.prototype.matches=function(t){var n=this;if(t instanceof e){if(!this.callbacks_||!t.callbacks_)return!0;if(this.context_===t.context_){var r=Object.keys(t.callbacks_),i=Object.keys(this.callbacks_),o=r.length;if(o===i.length){if(1===o){var a=r[0],s=i[0];return!(s!==a||t.callbacks_[a]&&this.callbacks_[s]&&t.callbacks_[a]!==this.callbacks_[s])}return i.every((function(e){return t.callbacks_[e]===n.callbacks_[e]}))}}}return!1},e.prototype.hasAnyCallback=function(){return null!==this.callbacks_},e}(),He=function(){function e(e,t,n,r){this.repo=e,this.path=t,this.queryParams_=n,this.orderByCalled_=r}return Object.defineProperty(e,"__referenceConstructor",{get:function(){return index_cjs.assert(Le,"Reference.ts has not been loaded"),Le},set:function(e){Le=e},enumerable:!1,configurable:!0}),e.validateQueryEndpoints_=function(e){var t=null,n=null;if(e.hasStart()&&(t=e.getIndexStartValue()),e.hasEnd()&&(n=e.getIndexEndValue()),e.getIndex()===fe){var r="Query: When ordering by key, you may only pass one argument to startAt(), endAt(), or equalTo().",i="Query: When ordering by key, the argument passed to startAt(), endAt(),or equalTo() must be a string.";if(e.hasStart()){if(e.getIndexStartName()!==E)throw new Error(r);if("string"!=typeof t)throw new Error(i)}if(e.hasEnd()){if(e.getIndexEndName()!==T)throw new Error(r);if("string"!=typeof n)throw new Error(i)}}else if(e.getIndex()===Ee){if(null!=t&&!K(t)||null!=n&&!K(n))throw new Error("Query: When ordering by priority, the first argument passed to startAt(), endAt(), or equalTo() must be a valid priority value (null, a number, or a string).")}else if(index_cjs.assert(e.getIndex()instanceof $e||e.getIndex()===je,"unknown index type."),null!=t&&"object"==typeof t||null!=n&&"object"==typeof n)throw new Error("Query: First argument passed to startAt(), endAt(), or equalTo() cannot be an object.")},e.validateLimit_=function(e){if(e.hasStart()&&e.hasEnd()&&e.hasLimit()&&!e.hasAnchoredLimit())throw new Error("Query: Can't combine startAt(), endAt(), and limit(). Use limitToFirst() or limitToLast() instead.")},e.prototype.validateNoPreviousOrderByCall_=function(e){if(!0===this.orderByCalled_)throw new Error(e+": You can't combine multiple orderBy calls.")},e.prototype.getQueryParams=function(){return this.queryParams_},e.prototype.getRef=function(){return index_cjs.validateArgCount("Query.ref",0,0,arguments.length),new e.__referenceConstructor(this.repo,this.path)},e.prototype.on=function(t,n,r,i){index_cjs.validateArgCount("Query.on",2,4,arguments.length),ee("Query.on",1,t,!1),index_cjs.validateCallback("Query.on",2,n,!1);var o=e.getCancelAndContextArgs_("Query.on",r,i);if("value"===t)this.onValueEvent(n,o.cancel,o.context);else{var a={};a[t]=n,this.onChildEvent(a,o.cancel,o.context)}return n},e.prototype.onValueEvent=function(e,t,n){var r=new ze(e,t||null,n||null);this.repo.addEventCallbackForQuery(this,r)},e.prototype.onChildEvent=function(e,t,n){var r=new Ue(e,t,n);this.repo.addEventCallbackForQuery(this,r)},e.prototype.off=function(e,t,n){index_cjs.validateArgCount("Query.off",0,3,arguments.length),ee("Query.off",1,e,!0),index_cjs.validateCallback("Query.off",2,t,!0),index_cjs.validateContextObject("Query.off",3,n,!0);var r=null,i=null;if("value"===e){var o=t||null;r=new ze(o,null,n||null)}else e&&(t&&((i={})[e]=t),r=new Ue(i,null,n||null));this.repo.removeEventCallbackForQuery(this,r)},e.prototype.once=function(t,n,r,i){var o=this;index_cjs.validateArgCount("Query.once",1,4,arguments.length),ee("Query.once",1,t,!1),index_cjs.validateCallback("Query.once",2,n,!0);var a=e.getCancelAndContextArgs_("Query.once",r,i),s=!0,l=new index_cjs.Deferred;l.promise.catch((function(){}));var c=function(e){s&&(s=!1,o.off(t,c),n&&n.bind(a.context)(e),l.resolve(e))};return this.on(t,c,(function(e){o.off(t,c),a.cancel&&a.cancel.bind(a.context)(e),l.reject(e)})),l.promise},e.prototype.limitToFirst=function(t){if(index_cjs.validateArgCount("Query.limitToFirst",1,1,arguments.length),"number"!=typeof t||Math.floor(t)!==t||t<=0)throw new Error("Query.limitToFirst: First argument must be a positive integer.");if(this.queryParams_.hasLimit())throw new Error("Query.limitToFirst: Limit was already set (by another call to limit, limitToFirst, or limitToLast).");return new e(this.repo,this.path,this.queryParams_.limitToFirst(t),this.orderByCalled_)},e.prototype.limitToLast=function(t){if(index_cjs.validateArgCount("Query.limitToLast",1,1,arguments.length),"number"!=typeof t||Math.floor(t)!==t||t<=0)throw new Error("Query.limitToLast: First argument must be a positive integer.");if(this.queryParams_.hasLimit())throw new Error("Query.limitToLast: Limit was already set (by another call to limit, limitToFirst, or limitToLast).");return new e(this.repo,this.path,this.queryParams_.limitToLast(t),this.orderByCalled_)},e.prototype.orderByChild=function(t){if(index_cjs.validateArgCount("Query.orderByChild",1,1,arguments.length),"$key"===t)throw new Error('Query.orderByChild: "$key" is invalid. Use Query.orderByKey() instead.');if("$priority"===t)throw new Error('Query.orderByChild: "$priority" is invalid. Use Query.orderByPriority() instead.');if("$value"===t)throw new Error('Query.orderByChild: "$value" is invalid. Use Query.orderByValue() instead.');ne("Query.orderByChild",1,t,!1),this.validateNoPreviousOrderByCall_("Query.orderByChild");var n=new M(t);if(n.isEmpty())throw new Error("Query.orderByChild: cannot pass in empty path. Use Query.orderByValue() instead.");var r=new $e(n),i=this.queryParams_.orderBy(r);return e.validateQueryEndpoints_(i),new e(this.repo,this.path,i,!0)},e.prototype.orderByKey=function(){index_cjs.validateArgCount("Query.orderByKey",0,0,arguments.length),this.validateNoPreviousOrderByCall_("Query.orderByKey");var t=this.queryParams_.orderBy(fe);return e.validateQueryEndpoints_(t),new e(this.repo,this.path,t,!0)},e.prototype.orderByPriority=function(){index_cjs.validateArgCount("Query.orderByPriority",0,0,arguments.length),this.validateNoPreviousOrderByCall_("Query.orderByPriority");var t=this.queryParams_.orderBy(Ee);return e.validateQueryEndpoints_(t),new e(this.repo,this.path,t,!0)},e.prototype.orderByValue=function(){index_cjs.validateArgCount("Query.orderByValue",0,0,arguments.length),this.validateNoPreviousOrderByCall_("Query.orderByValue");var t=this.queryParams_.orderBy(je);return e.validateQueryEndpoints_(t),new e(this.repo,this.path,t,!0)},e.prototype.startAt=function(t,n){void 0===t&&(t=null),index_cjs.validateArgCount("Query.startAt",0,2,arguments.length),Q("Query.startAt",1,t,this.path,!0),te("Query.startAt",2,n,!0);var r=this.queryParams_.startAt(t,n);if(e.validateLimit_(r),e.validateQueryEndpoints_(r),this.queryParams_.hasStart())throw new Error("Query.startAt: Starting point was already set (by another call to startAt or equalTo).");return void 0===t&&(t=null,n=null),new e(this.repo,this.path,r,this.orderByCalled_)},e.prototype.endAt=function(t,n){void 0===t&&(t=null),index_cjs.validateArgCount("Query.endAt",0,2,arguments.length),Q("Query.endAt",1,t,this.path,!0),te("Query.endAt",2,n,!0);var r=this.queryParams_.endAt(t,n);if(e.validateLimit_(r),e.validateQueryEndpoints_(r),this.queryParams_.hasEnd())throw new Error("Query.endAt: Ending point was already set (by another call to endAt or equalTo).");return new e(this.repo,this.path,r,this.orderByCalled_)},e.prototype.equalTo=function(e,t){if(index_cjs.validateArgCount("Query.equalTo",1,2,arguments.length),Q("Query.equalTo",1,e,this.path,!1),te("Query.equalTo",2,t,!0),this.queryParams_.hasStart())throw new Error("Query.equalTo: Starting point was already set (by another call to startAt or equalTo).");if(this.queryParams_.hasEnd())throw new Error("Query.equalTo: Ending point was already set (by another call to endAt or equalTo).");return this.startAt(e,t).endAt(e,t)},e.prototype.toString=function(){return index_cjs.validateArgCount("Query.toString",0,0,arguments.length),this.repo.toString()+this.path.toUrlEncodedString()},e.prototype.toJSON=function(){return index_cjs.validateArgCount("Query.toJSON",0,1,arguments.length),this.toString()},e.prototype.queryObject=function(){return this.queryParams_.getQueryObject()},e.prototype.queryIdentifier=function(){var e=this.queryObject(),t=C(e);return"{}"===t?"default":t},e.prototype.isEqual=function(t){if(index_cjs.validateArgCount("Query.isEqual",1,1,arguments.length),!(t instanceof e)){var n="Query.isEqual failed: First argument must be an instance of firebase.database.Query.";throw new Error(n)}var r=this.repo===t.repo,i=this.path.equals(t.path),o=this.queryIdentifier()===t.queryIdentifier();return r&&i&&o},e.getCancelAndContextArgs_=function(e,t,n){var r={cancel:null,context:null};if(t&&n)r.cancel=t,index_cjs.validateCallback(e,3,r.cancel,!0),r.context=n,index_cjs.validateContextObject(e,4,r.context,!0);else if(t)if("object"==typeof t&&null!==t)r.context=t;else{if("function"!=typeof t)throw new Error(index_cjs.errorPrefix(e,3,!0)+" must either be a cancel callback or a context object.");r.cancel=t}return r},Object.defineProperty(e.prototype,"ref",{get:function(){return this.getRef()},enumerable:!1,configurable:!0}),e}(),qe=function(){function e(e){this.node_=e}return e.prototype.getImmediateChild=function(t){return new e(this.node_.getImmediateChild(t))},e.prototype.node=function(){return this.node_},e}(),We=function(){function e(e,t){this.syncTree_=e,this.path_=t}return e.prototype.getImmediateChild=function(t){var n=this.path_.child(t);return new e(this.syncTree_,n)},e.prototype.node=function(){return this.syncTree_.calcCompleteEventCache(this.path_)},e}(),Ye=function(e,t,n){return e&&"object"==typeof e?(index_cjs.assert(".sv"in e,"Unexpected leaf node or priority contents"),"string"==typeof e[".sv"]?Ke(e[".sv"],t,n):"object"==typeof e[".sv"]?Qe(e[".sv"],t):void index_cjs.assert(!1,"Unexpected server value: "+JSON.stringify(e,null,2))):e},Ke=function(e,t,n){switch(e){case"timestamp":return n.timestamp;default:index_cjs.assert(!1,"Unexpected server value: "+e)}},Qe=function(e,t,n){e.hasOwnProperty("increment")||index_cjs.assert(!1,"Unexpected server value: "+JSON.stringify(e,null,2));var r=e.increment;"number"!=typeof r&&index_cjs.assert(!1,"Unexpected increment value: "+r);var i=t.node();if(index_cjs.assert(null!=i,"Expected ChildrenNode.EMPTY_NODE for nulls"),!i.isLeafNode())return r;var o=i.getValue();return"number"!=typeof o?r:o+r},Xe=function(e,t,n,r){return Ze(t,new We(n,e),r)},Je=function(e,t,n){return Ze(e,new qe(t),n)};function Ze(e,t,n){var r,i=e.getPriority().val(),o=Ye(i,t.getImmediateChild(".priority"),n);if(e.isLeafNode()){var a=e,s=Ye(a.getValue(),t,n);return s!==a.getValue()||o!==a.getPriority().val()?new _e(s,Fe(o)):e}var l=e;return r=l,o!==l.getPriority().val()&&(r=r.updatePriority(new _e(o))),l.forEachChild(Ee,(function(e,i){var o=Ze(i,t.getImmediateChild(e),n);o!==i&&(r=r.updateImmediateChild(e,o))})),r} -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */var et,tt=function(){function e(){this.value=null,this.children=new Map}return e.prototype.find=function(e){if(null!=this.value)return this.value.getChild(e);if(!e.isEmpty()&&this.children.size>0){var t=e.getFront();return e=e.popFront(),this.children.has(t)?this.children.get(t).find(e):null}return null},e.prototype.remember=function(t,n){if(t.isEmpty())this.value=n,this.children.clear();else if(null!==this.value)this.value=this.value.updateChild(t,n);else{var r=t.getFront();this.children.has(r)||this.children.set(r,new e);var i=this.children.get(r);t=t.popFront(),i.remember(t,n)}},e.prototype.forget=function(e){if(e.isEmpty())return this.value=null,this.children.clear(),!0;if(null!==this.value){if(this.value.isLeafNode())return!1;var t=this.value;this.value=null;var n=this;return t.forEachChild(Ee,(function(e,t){n.remember(new M(e),t)})),this.forget(e)}if(this.children.size>0){var r=e.getFront();if(e=e.popFront(),this.children.has(r))this.children.get(r).forget(e)&&this.children.delete(r);return 0===this.children.size}return!0},e.prototype.forEachTree=function(e,t){null!==this.value?t(e,this.value):this.forEachChild((function(n,r){var i=new M(e.toString()+"/"+n);r.forEachTree(i,t)}))},e.prototype.forEachChild=function(e){this.children.forEach((function(t,n){e(n,t)}))},e}(); -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */!function(e){e[e.OVERWRITE=0]="OVERWRITE",e[e.MERGE=1]="MERGE",e[e.ACK_USER_WRITE=2]="ACK_USER_WRITE",e[e.LISTEN_COMPLETE=3]="LISTEN_COMPLETE"}(et||(et={}));var nt,rt,it=function(){function e(e,t,n,r){this.fromUser=e,this.fromServer=t,this.queryId=n,this.tagged=r,index_cjs.assert(!r||t,"Tagged queries must be from server.")}return e.User=new e(!0,!1,null,!1),e.Server=new e(!1,!0,null,!1),e.forServerTaggedQuery=function(t){return new e(!1,!0,t,!0)},e}(),ot=function(){function e(e,t,n){this.path=e,this.affectedTree=t,this.revert=n,this.type=et.ACK_USER_WRITE,this.source=it.User}return e.prototype.operationForChild=function(t){if(this.path.isEmpty()){if(null!=this.affectedTree.value)return index_cjs.assert(this.affectedTree.children.isEmpty(),"affectedTree should not have overlapping affected paths."),this;var n=this.affectedTree.subtree(new M(t));return new e(M.Empty,n,this.revert)}return index_cjs.assert(this.path.getFront()===t,"operationForChild called for unrelated child."),new e(this.path.popFront(),this.affectedTree,this.revert)},e}(),at=function(){function e(e,t){void 0===t&&(nt||(nt=new xe(S)),t=nt),this.value=e,this.children=t}return e.fromObject=function(t){var n=e.Empty;return A(t,(function(e,t){n=n.set(new M(e),t)})),n},e.prototype.isEmpty=function(){return null===this.value&&this.children.isEmpty()},e.prototype.findRootMostMatchingPathAndValue=function(e,t){if(null!=this.value&&t(this.value))return{path:M.Empty,value:this.value};if(e.isEmpty())return null;var n=e.getFront(),r=this.children.get(n);if(null!==r){var i=r.findRootMostMatchingPathAndValue(e.popFront(),t);return null!=i?{path:new M(n).child(i.path),value:i.value}:null}return null},e.prototype.findRootMostValueAndPath=function(e){return this.findRootMostMatchingPathAndValue(e,(function(){return!0}))},e.prototype.subtree=function(t){if(t.isEmpty())return this;var n=t.getFront(),r=this.children.get(n);return null!==r?r.subtree(t.popFront()):e.Empty},e.prototype.set=function(t,n){if(t.isEmpty())return new e(n,this.children);var r=t.getFront(),i=(this.children.get(r)||e.Empty).set(t.popFront(),n),o=this.children.insert(r,i);return new e(this.value,o)},e.prototype.remove=function(t){if(t.isEmpty())return this.children.isEmpty()?e.Empty:new e(null,this.children);var n=t.getFront(),r=this.children.get(n);if(r){var i=r.remove(t.popFront()),o=void 0;return o=i.isEmpty()?this.children.remove(n):this.children.insert(n,i),null===this.value&&o.isEmpty()?e.Empty:new e(this.value,o)}return this},e.prototype.get=function(e){if(e.isEmpty())return this.value;var t=e.getFront(),n=this.children.get(t);return n?n.get(e.popFront()):null},e.prototype.setTree=function(t,n){if(t.isEmpty())return n;var r=t.getFront(),i=(this.children.get(r)||e.Empty).setTree(t.popFront(),n),o=void 0;return o=i.isEmpty()?this.children.remove(r):this.children.insert(r,i),new e(this.value,o)},e.prototype.fold=function(e){return this.fold_(M.Empty,e)},e.prototype.fold_=function(e,t){var n={};return this.children.inorderTraversal((function(r,i){n[r]=i.fold_(e.child(r),t)})),t(e,this.value,n)},e.prototype.findOnPath=function(e,t){return this.findOnPath_(e,M.Empty,t)},e.prototype.findOnPath_=function(e,t,n){var r=!!this.value&&n(t,this.value);if(r)return r;if(e.isEmpty())return null;var i=e.getFront(),o=this.children.get(i);return o?o.findOnPath_(e.popFront(),t.child(i),n):null},e.prototype.foreachOnPath=function(e,t){return this.foreachOnPath_(e,M.Empty,t)},e.prototype.foreachOnPath_=function(t,n,r){if(t.isEmpty())return this;this.value&&r(n,this.value);var i=t.getFront(),o=this.children.get(i);return o?o.foreachOnPath_(t.popFront(),n.child(i),r):e.Empty},e.prototype.foreach=function(e){this.foreach_(M.Empty,e)},e.prototype.foreach_=function(e,t){this.children.inorderTraversal((function(n,r){r.foreach_(e.child(n),t)})),this.value&&t(e,this.value)},e.prototype.foreachChild=function(e){this.children.inorderTraversal((function(t,n){n.value&&e(t,n.value)}))},e.Empty=new e(null),e}(),st=function(){function e(e,t){this.source=e,this.path=t,this.type=et.LISTEN_COMPLETE}return e.prototype.operationForChild=function(t){return this.path.isEmpty()?new e(this.source,M.Empty):new e(this.source,this.path.popFront())},e}(),lt=function(){function e(e,t,n){this.source=e,this.path=t,this.snap=n,this.type=et.OVERWRITE}return e.prototype.operationForChild=function(t){return this.path.isEmpty()?new e(this.source,M.Empty,this.snap.getImmediateChild(t)):new e(this.source,this.path.popFront(),this.snap)},e}(),ct=function(){function e(e,t,n){this.source=e,this.path=t,this.children=n,this.type=et.MERGE}return e.prototype.operationForChild=function(t){if(this.path.isEmpty()){var n=this.children.subtree(new M(t));return n.isEmpty()?null:n.value?new lt(this.source,M.Empty,n.value):new e(this.source,M.Empty,n)}return index_cjs.assert(this.path.getFront()===t,"Can't get a merge for a child not on the path of the operation"),new e(this.source,this.path.popFront(),this.children)},e.prototype.toString=function(){return"Operation("+this.path+": "+this.source.toString()+" merge: "+this.children.toString()+")"},e}(),ut=function(){function e(e,t,n){this.node_=e,this.fullyInitialized_=t,this.filtered_=n}return e.prototype.isFullyInitialized=function(){return this.fullyInitialized_},e.prototype.isFiltered=function(){return this.filtered_},e.prototype.isCompleteForPath=function(e){if(e.isEmpty())return this.isFullyInitialized()&&!this.filtered_;var t=e.getFront();return this.isCompleteForChild(t)},e.prototype.isCompleteForChild=function(e){return this.isFullyInitialized()&&!this.filtered_||this.node_.hasChild(e)},e.prototype.getNode=function(){return this.node_},e}(),ht=function(){function e(e,t){this.eventCache_=e,this.serverCache_=t}return e.prototype.updateEventSnap=function(t,n,r){return new e(new ut(t,n,r),this.serverCache_)},e.prototype.updateServerSnap=function(t,n,r){return new e(this.eventCache_,new ut(t,n,r))},e.prototype.getEventCache=function(){return this.eventCache_},e.prototype.getCompleteEventSnap=function(){return this.eventCache_.isFullyInitialized()?this.eventCache_.getNode():null},e.prototype.getServerCache=function(){return this.serverCache_},e.prototype.getCompleteServerSnap=function(){return this.serverCache_.isFullyInitialized()?this.serverCache_.getNode():null},e.Empty=new e(new ut(Ne.EMPTY_NODE,!1,!1),new ut(Ne.EMPTY_NODE,!1,!1)),e}(),pt=function(){function e(e,t,n,r,i){this.type=e,this.snapshotNode=t,this.childName=n,this.oldSnap=r,this.prevName=i}return e.valueChange=function(t){return new e(e.VALUE,t)},e.childAddedChange=function(t,n){return new e(e.CHILD_ADDED,n,t)},e.childRemovedChange=function(t,n){return new e(e.CHILD_REMOVED,n,t)},e.childChangedChange=function(t,n,r){return new e(e.CHILD_CHANGED,n,t,r)},e.childMovedChange=function(t,n){return new e(e.CHILD_MOVED,n,t)},e.CHILD_ADDED="child_added",e.CHILD_REMOVED="child_removed",e.CHILD_CHANGED="child_changed",e.CHILD_MOVED="child_moved",e.VALUE="value",e}(),ft=function(){function e(e){this.index_=e}return e.prototype.updateChild=function(e,t,n,r,i,o){index_cjs.assert(e.isIndexed(this.index_),"A node must be indexed if only a child is updated");var a=e.getImmediateChild(t);return a.getChild(r).equals(n.getChild(r))&&a.isEmpty()===n.isEmpty()?e:(null!=o&&(n.isEmpty()?e.hasChild(t)?o.trackChildChange(pt.childRemovedChange(t,a)):index_cjs.assert(e.isLeafNode(),"A child remove without an old child only makes sense on a leaf node"):a.isEmpty()?o.trackChildChange(pt.childAddedChange(t,n)):o.trackChildChange(pt.childChangedChange(t,n,a))),e.isLeafNode()&&n.isEmpty()?e:e.updateImmediateChild(t,n).withIndex(this.index_))},e.prototype.updateFullNode=function(e,t,n){return null!=n&&(e.isLeafNode()||e.forEachChild(Ee,(function(e,r){t.hasChild(e)||n.trackChildChange(pt.childRemovedChange(e,r))})),t.isLeafNode()||t.forEachChild(Ee,(function(t,r){if(e.hasChild(t)){var i=e.getImmediateChild(t);i.equals(r)||n.trackChildChange(pt.childChangedChange(t,r,i))}else n.trackChildChange(pt.childAddedChange(t,r))}))),t.withIndex(this.index_)},e.prototype.updatePriority=function(e,t){return e.isEmpty()?Ne.EMPTY_NODE:e.updatePriority(t)},e.prototype.filtersNodes=function(){return!1},e.prototype.getIndexedFilter=function(){return this},e.prototype.getIndex=function(){return this.index_},e}(),dt=function(){function e(){this.changeMap=new Map}return e.prototype.trackChildChange=function(e){var t=e.type,n=e.childName;index_cjs.assert(t===pt.CHILD_ADDED||t===pt.CHILD_CHANGED||t===pt.CHILD_REMOVED,"Only child changes supported for tracking"),index_cjs.assert(".priority"!==n,"Only non-priority child changes can be tracked.");var r=this.changeMap.get(n);if(r){var i=r.type;if(t===pt.CHILD_ADDED&&i===pt.CHILD_REMOVED)this.changeMap.set(n,pt.childChangedChange(n,e.snapshotNode,r.snapshotNode));else if(t===pt.CHILD_REMOVED&&i===pt.CHILD_ADDED)this.changeMap.delete(n);else if(t===pt.CHILD_REMOVED&&i===pt.CHILD_CHANGED)this.changeMap.set(n,pt.childRemovedChange(n,r.oldSnap));else if(t===pt.CHILD_CHANGED&&i===pt.CHILD_ADDED)this.changeMap.set(n,pt.childAddedChange(n,e.snapshotNode));else{if(t!==pt.CHILD_CHANGED||i!==pt.CHILD_CHANGED)throw index_cjs.assertionError("Illegal combination of changes: "+e+" occurred after "+r);this.changeMap.set(n,pt.childChangedChange(n,e.snapshotNode,r.oldSnap))}}else this.changeMap.set(n,e)},e.prototype.getChanges=function(){return Array.from(this.changeMap.values())},e}(),mt=new(function(){function e(){}return e.prototype.getCompleteChild=function(e){return null},e.prototype.getChildAfterChild=function(e,t,n){return null},e}()),gt=function(){function e(e,t,n){void 0===n&&(n=null),this.writes_=e,this.viewCache_=t,this.optCompleteServerCache_=n}return e.prototype.getCompleteChild=function(e){var t=this.viewCache_.getEventCache();if(t.isCompleteForChild(e))return t.getNode().getImmediateChild(e);var n=null!=this.optCompleteServerCache_?new ut(this.optCompleteServerCache_,!0,!1):this.viewCache_.getServerCache();return this.writes_.calcCompleteChild(e,n)},e.prototype.getChildAfterChild=function(e,t,n){var r=null!=this.optCompleteServerCache_?this.optCompleteServerCache_:this.viewCache_.getCompleteServerSnap(),i=this.writes_.calcIndexedSlice(r,t,1,n,e);return 0===i.length?null:i[0]},e}(),yt=function(e,t){this.viewCache=e,this.changes=t},vt=function(){function e(e){this.filter_=e}return e.prototype.assertIndexed=function(e){index_cjs.assert(e.getEventCache().getNode().isIndexed(this.filter_.getIndex()),"Event snap not indexed"),index_cjs.assert(e.getServerCache().getNode().isIndexed(this.filter_.getIndex()),"Server snap not indexed")},e.prototype.applyOperation=function(t,n,r,i){var o,a,s=new dt;if(n.type===et.OVERWRITE){var l=n;l.source.fromUser?o=this.applyUserOverwrite_(t,l.path,l.snap,r,i,s):(index_cjs.assert(l.source.fromServer,"Unknown source."),a=l.source.tagged||t.getServerCache().isFiltered()&&!l.path.isEmpty(),o=this.applyServerOverwrite_(t,l.path,l.snap,r,i,a,s))}else if(n.type===et.MERGE){var c=n;c.source.fromUser?o=this.applyUserMerge_(t,c.path,c.children,r,i,s):(index_cjs.assert(c.source.fromServer,"Unknown source."),a=c.source.tagged||t.getServerCache().isFiltered(),o=this.applyServerMerge_(t,c.path,c.children,r,i,a,s))}else if(n.type===et.ACK_USER_WRITE){var u=n;o=u.revert?this.revertUserWrite_(t,u.path,r,i,s):this.ackUserWrite_(t,u.path,u.affectedTree,r,i,s)}else{if(n.type!==et.LISTEN_COMPLETE)throw index_cjs.assertionError("Unknown operation type: "+n.type);o=this.listenComplete_(t,n.path,r,s)}var h=s.getChanges();return e.maybeAddValueEvent_(t,o,h),new yt(o,h)},e.maybeAddValueEvent_=function(e,t,n){var r=t.getEventCache();if(r.isFullyInitialized()){var i=r.getNode().isLeafNode()||r.getNode().isEmpty(),o=e.getCompleteEventSnap();(n.length>0||!e.getEventCache().isFullyInitialized()||i&&!r.getNode().equals(o)||!r.getNode().getPriority().equals(o.getPriority()))&&n.push(pt.valueChange(t.getCompleteEventSnap()))}},e.prototype.generateEventCacheAfterServerEvent_=function(e,t,n,r,i){var o=e.getEventCache();if(null!=n.shadowingWrite(t))return e;var a=void 0,s=void 0;if(t.isEmpty())if(index_cjs.assert(e.getServerCache().isFullyInitialized(),"If change path is empty, we must have complete server data"),e.getServerCache().isFiltered()){var l=e.getCompleteServerSnap(),c=l instanceof Ne?l:Ne.EMPTY_NODE,u=n.calcCompleteEventChildren(c);a=this.filter_.updateFullNode(e.getEventCache().getNode(),u,i)}else{var h=n.calcCompleteEventCache(e.getCompleteServerSnap());a=this.filter_.updateFullNode(e.getEventCache().getNode(),h,i)}else{var p=t.getFront();if(".priority"===p){index_cjs.assert(1===t.getLength(),"Can't have a priority with additional path components");var f=o.getNode();s=e.getServerCache().getNode();var d=n.calcEventCacheAfterServerOverwrite(t,f,s);a=null!=d?this.filter_.updatePriority(f,d):o.getNode()}else{var m=t.popFront(),g=void 0;if(o.isCompleteForChild(p)){s=e.getServerCache().getNode();var y=n.calcEventCacheAfterServerOverwrite(t,o.getNode(),s);g=null!=y?o.getNode().getImmediateChild(p).updateChild(m,y):o.getNode().getImmediateChild(p)}else g=n.calcCompleteChild(p,e.getServerCache());a=null!=g?this.filter_.updateChild(o.getNode(),p,g,m,r,i):o.getNode()}}return e.updateEventSnap(a,o.isFullyInitialized()||t.isEmpty(),this.filter_.filtersNodes())},e.prototype.applyServerOverwrite_=function(e,t,n,r,i,o,a){var s,l=e.getServerCache(),c=o?this.filter_:this.filter_.getIndexedFilter();if(t.isEmpty())s=c.updateFullNode(l.getNode(),n,null);else if(c.filtersNodes()&&!l.isFiltered()){var u=l.getNode().updateChild(t,n);s=c.updateFullNode(l.getNode(),u,null)}else{var h=t.getFront();if(!l.isCompleteForPath(t)&&t.getLength()>1)return e;var p=t.popFront(),f=l.getNode().getImmediateChild(h).updateChild(p,n);s=".priority"===h?c.updatePriority(l.getNode(),f):c.updateChild(l.getNode(),h,f,p,mt,null)}var d=e.updateServerSnap(s,l.isFullyInitialized()||t.isEmpty(),c.filtersNodes()),m=new gt(r,d,i);return this.generateEventCacheAfterServerEvent_(d,t,r,m,a)},e.prototype.applyUserOverwrite_=function(e,t,n,r,i,o){var a,s,l=e.getEventCache(),c=new gt(r,e,i);if(t.isEmpty())s=this.filter_.updateFullNode(e.getEventCache().getNode(),n,o),a=e.updateEventSnap(s,!0,this.filter_.filtersNodes());else{var u=t.getFront();if(".priority"===u)s=this.filter_.updatePriority(e.getEventCache().getNode(),n),a=e.updateEventSnap(s,l.isFullyInitialized(),l.isFiltered());else{var h=t.popFront(),p=l.getNode().getImmediateChild(u),f=void 0;if(h.isEmpty())f=n;else{var d=c.getCompleteChild(u);f=null!=d?".priority"===h.getBack()&&d.getChild(h.parent()).isEmpty()?d:d.updateChild(h,n):Ne.EMPTY_NODE}if(p.equals(f))a=e;else{var m=this.filter_.updateChild(l.getNode(),u,f,h,c,o);a=e.updateEventSnap(m,l.isFullyInitialized(),this.filter_.filtersNodes())}}}return a},e.cacheHasChild_=function(e,t){return e.getEventCache().isCompleteForChild(t)},e.prototype.applyUserMerge_=function(t,n,r,i,o,a){var s=this,l=t;return r.foreach((function(r,c){var u=n.child(r);e.cacheHasChild_(t,u.getFront())&&(l=s.applyUserOverwrite_(l,u,c,i,o,a))})),r.foreach((function(r,c){var u=n.child(r);e.cacheHasChild_(t,u.getFront())||(l=s.applyUserOverwrite_(l,u,c,i,o,a))})),l},e.prototype.applyMerge_=function(e,t){return t.foreach((function(t,n){e=e.updateChild(t,n)})),e},e.prototype.applyServerMerge_=function(e,t,n,r,i,o,a){var s=this;if(e.getServerCache().getNode().isEmpty()&&!e.getServerCache().isFullyInitialized())return e;var l,c=e;l=t.isEmpty()?n:at.Empty.setTree(t,n);var u=e.getServerCache().getNode();return l.children.inorderTraversal((function(t,n){if(u.hasChild(t)){var l=e.getServerCache().getNode().getImmediateChild(t),h=s.applyMerge_(l,n);c=s.applyServerOverwrite_(c,new M(t),h,r,i,o,a)}})),l.children.inorderTraversal((function(t,n){var l=!e.getServerCache().isCompleteForChild(t)&&null==n.value;if(!u.hasChild(t)&&!l){var h=e.getServerCache().getNode().getImmediateChild(t),p=s.applyMerge_(h,n);c=s.applyServerOverwrite_(c,new M(t),p,r,i,o,a)}})),c},e.prototype.ackUserWrite_=function(e,t,n,r,i,o){if(null!=r.shadowingWrite(t))return e;var a=e.getServerCache().isFiltered(),s=e.getServerCache();if(null!=n.value){if(t.isEmpty()&&s.isFullyInitialized()||s.isCompleteForPath(t))return this.applyServerOverwrite_(e,t,s.getNode().getChild(t),r,i,a,o);if(t.isEmpty()){var l=at.Empty;return s.getNode().forEachChild(fe,(function(e,t){l=l.set(new M(e),t)})),this.applyServerMerge_(e,t,l,r,i,a,o)}return e}var c=at.Empty;return n.foreach((function(e,n){var r=t.child(e);s.isCompleteForPath(r)&&(c=c.set(e,s.getNode().getChild(r)))})),this.applyServerMerge_(e,t,c,r,i,a,o)},e.prototype.listenComplete_=function(e,t,n,r){var i=e.getServerCache(),o=e.updateServerSnap(i.getNode(),i.isFullyInitialized()||t.isEmpty(),i.isFiltered());return this.generateEventCacheAfterServerEvent_(o,t,n,mt,r)},e.prototype.revertUserWrite_=function(e,t,n,r,i){var o;if(null!=n.shadowingWrite(t))return e;var a=new gt(n,e,r),s=e.getEventCache().getNode(),l=void 0;if(t.isEmpty()||".priority"===t.getFront()){var c=void 0;if(e.getServerCache().isFullyInitialized())c=n.calcCompleteEventCache(e.getCompleteServerSnap());else{var u=e.getServerCache().getNode();index_cjs.assert(u instanceof Ne,"serverChildren would be complete if leaf node"),c=n.calcCompleteEventChildren(u)}c=c,l=this.filter_.updateFullNode(s,c,i)}else{var h=t.getFront(),p=n.calcCompleteChild(h,e.getServerCache());null==p&&e.getServerCache().isCompleteForChild(h)&&(p=s.getImmediateChild(h)),(l=null!=p?this.filter_.updateChild(s,h,p,t.popFront(),a,i):e.getEventCache().getNode().hasChild(h)?this.filter_.updateChild(s,h,Ne.EMPTY_NODE,t.popFront(),a,i):s).isEmpty()&&e.getServerCache().isFullyInitialized()&&(o=n.calcCompleteEventCache(e.getCompleteServerSnap())).isLeafNode()&&(l=this.filter_.updateFullNode(l,o,i))}return o=e.getServerCache().isFullyInitialized()||null!=n.shadowingWrite(M.Empty),e.updateEventSnap(l,o,this.filter_.filtersNodes())},e}(),_t=function(){function e(e){this.query_=e,this.index_=this.query_.getQueryParams().getIndex()}return e.prototype.generateEventsForChanges=function(e,t,n){var r=this,i=[],o=[];return e.forEach((function(e){e.type===pt.CHILD_CHANGED&&r.index_.indexedValueChanged(e.oldSnap,e.snapshotNode)&&o.push(pt.childMovedChange(e.childName,e.snapshotNode))})),this.generateEventsForType_(i,pt.CHILD_REMOVED,e,n,t),this.generateEventsForType_(i,pt.CHILD_ADDED,e,n,t),this.generateEventsForType_(i,pt.CHILD_MOVED,o,n,t),this.generateEventsForType_(i,pt.CHILD_CHANGED,e,n,t),this.generateEventsForType_(i,pt.VALUE,e,n,t),i},e.prototype.generateEventsForType_=function(e,t,n,r,i){var o=this,a=n.filter((function(e){return e.type===t}));a.sort(this.compareChanges_.bind(this)),a.forEach((function(t){var n=o.materializeSingleChange_(t,i);r.forEach((function(r){r.respondsTo(t.type)&&e.push(r.createEvent(n,o.query_))}))}))},e.prototype.materializeSingleChange_=function(e,t){return"value"===e.type||"child_removed"===e.type||(e.prevName=t.getPredecessorChildName(e.childName,e.snapshotNode,this.index_)),e},e.prototype.compareChanges_=function(e,t){if(null==e.childName||null==t.childName)throw index_cjs.assertionError("Should only compare child_ events.");var n=new ue(e.childName,e.snapshotNode),r=new ue(t.childName,t.snapshotNode);return this.index_.compare(n,r)},e}(),bt=function(){function e(e,t){this.query_=e,this.eventRegistrations_=[];var n=this.query_.getQueryParams(),r=new ft(n.getIndex()),i=n.getNodeFilter();this.processor_=new vt(i);var o=t.getServerCache(),a=t.getEventCache(),s=r.updateFullNode(Ne.EMPTY_NODE,o.getNode(),null),l=i.updateFullNode(Ne.EMPTY_NODE,a.getNode(),null),c=new ut(s,o.isFullyInitialized(),r.filtersNodes()),u=new ut(l,a.isFullyInitialized(),i.filtersNodes());this.viewCache_=new ht(u,c),this.eventGenerator_=new _t(this.query_)}return e.prototype.getQuery=function(){return this.query_},e.prototype.getServerCache=function(){return this.viewCache_.getServerCache().getNode()},e.prototype.getCompleteServerCache=function(e){var t=this.viewCache_.getCompleteServerSnap();return t&&(this.query_.getQueryParams().loadsAllData()||!e.isEmpty()&&!t.getImmediateChild(e.getFront()).isEmpty())?t.getChild(e):null},e.prototype.isEmpty=function(){return 0===this.eventRegistrations_.length},e.prototype.addEventRegistration=function(e){this.eventRegistrations_.push(e)},e.prototype.removeEventRegistration=function(e,t){var n=[];if(t){index_cjs.assert(null==e,"A cancel should cancel all event registrations.");var r=this.query_.path;this.eventRegistrations_.forEach((function(e){t=t;var i=e.createCancelEvent(t,r);i&&n.push(i)}))}if(e){for(var i=[],o=0;othis.lastWriteId_,"Stacking an older write on top of newer ones"),void 0===r&&(r=!0),this.allWrites_.push({path:e,snap:t,writeId:n,visible:r}),r&&(this.visibleWrites_=this.visibleWrites_.addWrite(e,t)),this.lastWriteId_=n},e.prototype.addMerge=function(e,t,n){index_cjs.assert(n>this.lastWriteId_,"Stacking an older merge on top of newer ones"),this.allWrites_.push({path:e,children:t,writeId:n,visible:!0}),this.visibleWrites_=this.visibleWrites_.addWrites(e,t),this.lastWriteId_=n},e.prototype.getWrite=function(e){for(var t=0;t=0,"removeWrite called with nonexistent writeId.");var r=this.allWrites_[n];this.allWrites_.splice(n,1);for(var i=r.visible,o=!1,a=this.allWrites_.length-1;i&&a>=0;){var s=this.allWrites_[a];s.visible&&(a>=n&&this.recordContainsPath_(s,r.path)?i=!1:r.path.contains(s.path)&&(o=!0)),a--}if(i){if(o)return this.resetTree_(),!0;r.snap?this.visibleWrites_=this.visibleWrites_.removeWrite(r.path):A(r.children,(function(e){t.visibleWrites_=t.visibleWrites_.removeWrite(r.path.child(e))}));return!0}return!1},e.prototype.getCompleteWriteData=function(e){return this.visibleWrites_.getCompleteNode(e)},e.prototype.calcCompleteEventCache=function(t,n,r,i){if(r||i){var o=this.visibleWrites_.childCompoundWrite(t);if(!i&&o.isEmpty())return n;if(i||null!=n||o.hasCompleteWrite(M.Empty)){var a=e.layerTree_(this.allWrites_,(function(e){return(e.visible||i)&&(!r||!~r.indexOf(e.writeId))&&(e.path.contains(t)||t.contains(e.path))}),t);c=n||Ne.EMPTY_NODE;return a.apply(c)}return null}var s=this.visibleWrites_.getCompleteNode(t);if(null!=s)return s;var l=this.visibleWrites_.childCompoundWrite(t);if(l.isEmpty())return n;if(null!=n||l.hasCompleteWrite(M.Empty)){var c=n||Ne.EMPTY_NODE;return l.apply(c)}return null},e.prototype.calcCompleteEventChildren=function(e,t){var n=Ne.EMPTY_NODE,r=this.visibleWrites_.getCompleteNode(e);if(r)return r.isLeafNode()||r.forEachChild(Ee,(function(e,t){n=n.updateImmediateChild(e,t)})),n;if(t){var i=this.visibleWrites_.childCompoundWrite(e);return t.forEachChild(Ee,(function(e,t){var r=i.childCompoundWrite(new M(e)).apply(t);n=n.updateImmediateChild(e,r)})),i.getCompleteChildren().forEach((function(e){n=n.updateImmediateChild(e.name,e.node)})),n}return this.visibleWrites_.childCompoundWrite(e).getCompleteChildren().forEach((function(e){n=n.updateImmediateChild(e.name,e.node)})),n},e.prototype.calcEventCacheAfterServerOverwrite=function(e,t,n,r){index_cjs.assert(n||r,"Either existingEventSnap or existingServerSnap must exist");var i=e.child(t);if(this.visibleWrites_.hasCompleteWrite(i))return null;var o=this.visibleWrites_.childCompoundWrite(i);return o.isEmpty()?r.getChild(t):o.apply(r.getChild(t))},e.prototype.calcCompleteChild=function(e,t,n){var r=e.child(t),i=this.visibleWrites_.getCompleteNode(r);return null!=i?i:n.isCompleteForChild(t)?this.visibleWrites_.childCompoundWrite(r).apply(n.getNode().getImmediateChild(t)):null},e.prototype.shadowingWrite=function(e){return this.visibleWrites_.getCompleteNode(e)},e.prototype.calcIndexedSlice=function(e,t,n,r,i,o){var a,s=this.visibleWrites_.childCompoundWrite(e),l=s.getCompleteNode(M.Empty);if(null!=l)a=l;else{if(null==t)return[];a=s.apply(t)}if((a=a.withIndex(o)).isEmpty()||a.isLeafNode())return[];for(var c=[],u=o.getCompare(),h=i?a.getReverseIteratorFrom(n,o):a.getIteratorFrom(n,o),p=h.getNext();p&&c.length0?this.lastWriteId_=this.allWrites_[this.allWrites_.length-1].writeId:this.lastWriteId_=-1},e.DefaultFilter_=function(e){return e.visible},e.layerTree_=function(e,t,n){for(var r=Et.Empty,i=0;i0&&!r)if(u){this.listenProvider_.stopListening(e.queryForListening_(t),null)}else c.forEach((function(t){var n=i.queryToTagMap.get(e.makeQueryKey_(t));i.listenProvider_.stopListening(e.queryForListening_(t),n)}));this.removeTags_(c)}return s},e.prototype.calcCompleteEventCache=function(e,t){var n=this.pendingWriteTree_,r=this.syncPointTree_.findOnPath(e,(function(t,n){var r=M.relativePath(t,e),i=n.getCompleteServerCache(r);if(i)return i}));return n.calcCompleteEventCache(e,r,t,!0)},e.prototype.collectDistinctViewsForSubTree_=function(e){return e.fold((function(e,t,n){if(t&&t.hasCompleteView())return[t.getCompleteView()];var r=[];return t&&(r=t.getQueryViews()),A(n,(function(e,t){r=r.concat(t)})),r}))},e.prototype.removeTags_=function(t){for(var n=0;n0&&index_cjs.contains(e.statsToReport_,t)&&(n[t]=i,r=!0)})),r&&this.server_.reportStats(n),N(this.reportStats_.bind(this),Math.floor(2*Math.random()*3e5))},e}(),Dt=function(){function e(){this.eventLists_=[],this.recursionDepth_=0}return e.prototype.queueEvents=function(e){for(var t=null,n=0;n0,"Requires a non-empty array")}return e.prototype.trigger=function(e){for(var t=[],n=1;ndocument.domain="'+document.domain+'";<\/script>';var a=""+o+"";try{this.myIFrame.doc.open(),this.myIFrame.doc.write(a),this.myIFrame.doc.close()}catch(e){g("frame writing exception"),e.stack&&g(e.stack),g(e)}}}return e.createIFrame_=function(){var e=document.createElement("iframe");if(e.style.display="none",!document.body)throw"Document body has not initialized. Wait to initialize Firebase until after the document is ready.";document.body.appendChild(e);try{e.contentWindow.document||g("No IE domain setting required")}catch(n){var t=document.domain;e.src="javascript:void((function(){document.open();document.domain='"+t+"';document.close();})())"}return e.contentDocument?e.doc=e.contentDocument:e.contentWindow?e.doc=e.contentWindow.document:e.document&&(e.doc=e.document),e},e.prototype.close=function(){var e=this;this.alive=!1,this.myIFrame&&(this.myIFrame.doc.body.innerHTML="",setTimeout((function(){null!==e.myIFrame&&(document.body.removeChild(e.myIFrame),e.myIFrame=null)}),Math.floor(0)));var t=this.onDisconnect;t&&(this.onDisconnect=null,t())},e.prototype.startLongPoll=function(e,t){for(this.myID=e,this.myPW=t,this.alive=!0;this.newRequest_(););},e.prototype.newRequest_=function(){if(this.alive&&this.sendNewPolls&&this.outstandingRequests.size<(this.pendingSegs.length>0?2:1)){this.currentSerial++;var e={};e.id=this.myID,e.pw=this.myPW,e.ser=this.currentSerial;for(var t=this.urlFn(e),n="",r=0;this.pendingSegs.length>0;){if(!(this.pendingSegs[0].d.length+30+n.length<=1870))break;var i=this.pendingSegs.shift();n=n+"&seg"+r+"="+i.seg+"&ts"+r+"="+i.ts+"&d"+r+"="+i.d,r++}return t+=n,this.addLongPollTag_(t,this.currentSerial),!0}return!1},e.prototype.enqueueSegment=function(e,t,n){this.pendingSegs.push({seg:e,ts:t,d:n}),this.alive&&this.newRequest_()},e.prototype.addLongPollTag_=function(e,t){var n=this;this.outstandingRequests.add(t);var r=function(){n.outstandingRequests.delete(t),n.newRequest_()},i=setTimeout(r,Math.floor(25e3));this.addTag(e,(function(){clearTimeout(i),r()}))},e.prototype.addTag=function(e,t){var n=this;index_cjs.isNodeSdk()?this.doNodeLongPoll(e,t):setTimeout((function(){try{if(!n.sendNewPolls)return;var r=n.myIFrame.doc.createElement("script");r.type="text/javascript",r.async=!0,r.src=e,r.onload=r.onreadystatechange=function(){var e=r.readyState;e&&"loaded"!==e&&"complete"!==e||(r.onload=r.onreadystatechange=null,r.parentNode&&r.parentNode.removeChild(r),t())},r.onerror=function(){g("Long-poll script failed to load: "+e),n.sendNewPolls=!1,n.close()},n.myIFrame.doc.body.appendChild(r)}catch(e){}}),Math.floor(1))},e}(),$t=""; -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var Bt=null;"undefined"!=typeof MozWebSocket?Bt=MozWebSocket:"undefined"!=typeof WebSocket&&(Bt=WebSocket);var Vt=function(){function e(t,n,r,i,o){this.connId=t,this.applicationId=r,this.keepaliveTimer=null,this.frames=null,this.totalFrames=0,this.bytesSent=0,this.bytesReceived=0,this.log_=y(this.connId),this.stats_=Pt.getCollection(n),this.connURL=e.connectionURL_(n,i,o)}return e.connectionURL_=function(e,t,n){var r={v:"5"};return!index_cjs.isNodeSdk()&&"undefined"!=typeof location&&location.href&&-1!==location.href.indexOf("firebaseio.com")&&(r.r="f"),t&&(r.s=t),n&&(r.ls=n),e.connectionURL("websocket",r)},e.prototype.open=function(e,t){var n=this;this.onDisconnect=t,this.onMessage=e,this.log_("Websocket connecting to "+this.connURL),this.everConnected_=!1,s.set("previous_websocket_failure",!0);try{if(index_cjs.isNodeSdk()){var r=index_cjs.CONSTANTS.NODE_ADMIN?"AdminNode":"Node",i={headers:{"User-Agent":"Firebase/5/"+$t+"/"+process.platform+"/"+r,"X-Firebase-GMPID":this.applicationId||""}},o=process.env,a=0===this.connURL.indexOf("wss://")?o.HTTPS_PROXY||o.https_proxy:o.HTTP_PROXY||o.http_proxy;a&&(i.proxy={origin:a}),this.mySock=new Bt(this.connURL,[],i)}else{i={headers:{"X-Firebase-GMPID":this.applicationId||""}};this.mySock=new Bt(this.connURL,[],i)}}catch(e){this.log_("Error instantiating WebSocket.");var l=e.message||e.data;return l&&this.log_(l),void this.onClosed_()}this.mySock.onopen=function(){n.log_("Websocket connected."),n.everConnected_=!0},this.mySock.onclose=function(){n.log_("Websocket connection was disconnected."),n.mySock=null,n.onClosed_()},this.mySock.onmessage=function(e){n.handleIncomingFrame(e)},this.mySock.onerror=function(e){n.log_("WebSocket error. Closing connection.");var t=e.message||e.data;t&&n.log_(t),n.onClosed_()}},e.prototype.start=function(){},e.forceDisallow=function(){e.forceDisallow_=!0},e.isAvailable=function(){var t=!1;if("undefined"!=typeof navigator&&navigator.userAgent){var n=navigator.userAgent.match(/Android ([0-9]{0,}\.[0-9]{0,})/);n&&n.length>1&&parseFloat(n[1])<4.4&&(t=!0)}return!t&&null!==Bt&&!e.forceDisallow_},e.previouslyFailed=function(){return s.isInMemoryStorage||!0===s.get("previous_websocket_failure")},e.prototype.markConnectionHealthy=function(){s.remove("previous_websocket_failure")},e.prototype.appendFrame_=function(e){if(this.frames.push(e),this.frames.length===this.totalFrames){var t=this.frames.join("");this.frames=null;var n=index_cjs.jsonEval(t);this.onMessage(n)}},e.prototype.handleNewFrameCount_=function(e){this.totalFrames=e,this.frames=[]},e.prototype.extractFrameCount_=function(e){if(index_cjs.assert(null===this.frames,"We already have a frame buffer"),e.length<=6){var t=Number(e);if(!isNaN(t))return this.handleNewFrameCount_(t),null}return this.handleNewFrameCount_(1),e},e.prototype.handleIncomingFrame=function(e){if(null!==this.mySock){var t=e.data;if(this.bytesReceived+=t.length,this.stats_.incrementCounter("bytes_received",t.length),this.resetKeepAlive(),null!==this.frames)this.appendFrame_(t);else{var n=this.extractFrameCount_(t);null!==n&&this.appendFrame_(n)}}},e.prototype.send=function(e){this.resetKeepAlive();var t=index_cjs.stringify(e);this.bytesSent+=t.length,this.stats_.incrementCounter("bytes_sent",t.length);var n=P(t,16384);n.length>1&&this.sendString_(String(n.length));for(var r=0;r0)return this.transports_[0];throw new Error("No transports available")},e.prototype.upgradeTransport=function(){return this.transports_.length>1?this.transports_[1]:null},e}(),zt=function(){function e(e,t,n,r,i,o,a,s){this.id=e,this.repoInfo_=t,this.applicationId_=n,this.onMessage_=r,this.onReady_=i,this.onDisconnect_=o,this.onKill_=a,this.lastSessionId=s,this.connectionCount=0,this.pendingDataMessages=[],this.state_=0,this.log_=y("c:"+this.id+":"),this.transportManager_=new Gt(t),this.log_("Connection created"),this.start_()}return e.prototype.start_=function(){var e=this,t=this.transportManager_.initialTransport();this.conn_=new t(this.nextTransportId_(),this.repoInfo_,this.applicationId_,void 0,this.lastSessionId),this.primaryResponsesRequired_=t.responsesRequiredToBeHealthy||0;var n=this.connReceiver_(this.conn_),r=this.disconnReceiver_(this.conn_);this.tx_=this.conn_,this.rx_=this.conn_,this.secondaryConn_=null,this.isHealthy_=!1,setTimeout((function(){e.conn_&&e.conn_.open(n,r)}),Math.floor(0));var i=t.healthyTimeout||0;i>0&&(this.healthyTimeout_=N((function(){e.healthyTimeout_=null,e.isHealthy_||(e.conn_&&e.conn_.bytesReceived>102400?(e.log_("Connection exceeded healthy timeout but has received "+e.conn_.bytesReceived+" bytes. Marking connection healthy."),e.isHealthy_=!0,e.conn_.markConnectionHealthy()):e.conn_&&e.conn_.bytesSent>10240?e.log_("Connection exceeded healthy timeout but has sent "+e.conn_.bytesSent+" bytes. Leaving connection alive."):(e.log_("Closing unhealthy connection after timeout."),e.close()))}),Math.floor(i)))},e.prototype.nextTransportId_=function(){return"c:"+this.id+":"+this.connectionCount++},e.prototype.disconnReceiver_=function(e){var t=this;return function(n){e===t.conn_?t.onConnectionLost_(n):e===t.secondaryConn_?(t.log_("Secondary connection lost."),t.onSecondaryConnectionLost_()):t.log_("closing an old connection")}},e.prototype.connReceiver_=function(e){var t=this;return function(n){2!==t.state_&&(e===t.rx_?t.onPrimaryMessageReceived_(n):e===t.secondaryConn_?t.onSecondaryMessageReceived_(n):t.log_("message on old connection"))}},e.prototype.sendRequest=function(e){var t={t:"d",d:e};this.sendData_(t)},e.prototype.tryCleanupConnection=function(){this.tx_===this.secondaryConn_&&this.rx_===this.secondaryConn_&&(this.log_("cleaning up and promoting a connection: "+this.secondaryConn_.connId),this.conn_=this.secondaryConn_,this.secondaryConn_=null)},e.prototype.onSecondaryControl_=function(e){if("t"in e){var t=e.t;"a"===t?this.upgradeIfSecondaryHealthy_():"r"===t?(this.log_("Got a reset on secondary, closing it"),this.secondaryConn_.close(),this.tx_!==this.secondaryConn_&&this.rx_!==this.secondaryConn_||this.close()):"o"===t&&(this.log_("got pong on secondary."),this.secondaryResponsesRequired_--,this.upgradeIfSecondaryHealthy_())}},e.prototype.onSecondaryMessageReceived_=function(e){var t=x("t",e),n=x("d",e);if("c"===t)this.onSecondaryControl_(n);else{if("d"!==t)throw new Error("Unknown protocol layer: "+t);this.pendingDataMessages.push(n)}},e.prototype.upgradeIfSecondaryHealthy_=function(){this.secondaryResponsesRequired_<=0?(this.log_("Secondary connection is healthy."),this.isHealthy_=!0,this.secondaryConn_.markConnectionHealthy(),this.proceedWithUpgrade_()):(this.log_("sending ping on secondary."),this.secondaryConn_.send({t:"c",d:{t:"p",d:{}}}))},e.prototype.proceedWithUpgrade_=function(){this.secondaryConn_.start(),this.log_("sending client ack on secondary"),this.secondaryConn_.send({t:"c",d:{t:"a",d:{}}}),this.log_("Ending transmission on primary"),this.conn_.send({t:"c",d:{t:"n",d:{}}}),this.tx_=this.secondaryConn_,this.tryCleanupConnection()},e.prototype.onPrimaryMessageReceived_=function(e){var t=x("t",e),n=x("d",e);"c"===t?this.onControl_(n):"d"===t&&this.onDataMessage_(n)},e.prototype.onDataMessage_=function(e){this.onPrimaryResponse_(),this.onMessage_(e)},e.prototype.onPrimaryResponse_=function(){this.isHealthy_||(this.primaryResponsesRequired_--,this.primaryResponsesRequired_<=0&&(this.log_("Primary connection is healthy."),this.isHealthy_=!0,this.conn_.markConnectionHealthy()))},e.prototype.onControl_=function(e){var t=x("t",e);if("d"in e){var n=e.d;if("h"===t)this.onHandshake_(n);else if("n"===t){this.log_("recvd end transmission on primary"),this.rx_=this.secondaryConn_;for(var r=0;r3e4&&(this.reconnectDelay_=1e3),this.lastConnectionEstablishedTime_=null}}else this.log_("Window isn't visible. Delaying reconnect."),this.reconnectDelay_=this.maxReconnectDelay_,this.lastConnectionAttemptTime_=(new Date).getTime();var e=(new Date).getTime()-this.lastConnectionAttemptTime_,t=Math.max(0,this.reconnectDelay_-e);t=Math.random()*t,this.log_("Trying to reconnect in "+t+"ms"),this.scheduleConnect_(t),this.reconnectDelay_=Math.min(this.maxReconnectDelay_,1.3*this.reconnectDelay_)}this.onConnectStatus_(!1)},t.prototype.establishConnection_=function(){if(this.shouldReconnect_()){this.log_("Making a connection attempt"),this.lastConnectionAttemptTime_=(new Date).getTime(),this.lastConnectionEstablishedTime_=null;var e=this.onDataMessage_.bind(this),n=this.onReady_.bind(this),r=this.onRealtimeDisconnect_.bind(this),i=this.id+":"+t.nextConnectionId_++,o=this,a=this.lastSessionId,s=!1,l=null,c=function(){l?l.close():(s=!0,r())};this.realtime_={close:c,sendRequest:function(e){index_cjs.assert(l,"sendRequest call when we're not connected not allowed."),l.sendRequest(e)}};var u=this.forceTokenRefresh_;this.forceTokenRefresh_=!1,this.authTokenProvider_.getToken(u).then((function(t){s?g("getToken() completed but was canceled"):(g("getToken() completed. Creating connection."),o.authToken_=t&&t.accessToken,l=new zt(i,o.repoInfo_,o.applicationId_,e,n,r,(function(e){b(e+" ("+o.repoInfo_.toString()+")"),o.interrupt("server_kill")}),a))})).then(null,(function(e){o.log_("Failed to get token: "+e),s||(index_cjs.CONSTANTS.NODE_ADMIN&&b(e),c())}))}},t.prototype.interrupt=function(e){g("Interrupting connection for reason: "+e),this.interruptReasons_[e]=!0,this.realtime_?this.realtime_.close():(this.establishConnectionTimer_&&(clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=null),this.connected_&&this.onRealtimeDisconnect_())},t.prototype.resume=function(e){g("Resuming connection for reason: "+e),delete this.interruptReasons_[e],index_cjs.isEmpty(this.interruptReasons_)&&(this.reconnectDelay_=1e3,this.realtime_||this.scheduleConnect_(0))},t.prototype.handleTimestamp_=function(e){var t=e-(new Date).getTime();this.onServerInfoUpdate_({serverTimeOffset:t})},t.prototype.cancelSentTransactions_=function(){for(var e=0;e=3&&(this.reconnectDelay_=3e4,this.authTokenProvider_.notifyForInvalidToken()))},t.prototype.onSecurityDebugPacket_=function(e){this.securityDebugCallback_?this.securityDebugCallback_(e):"msg"in e&&console.log("FIREBASE: "+e.msg.replace("\n","\nFIREBASE: "))},t.prototype.restoreState_=function(){var e,t,n,r;this.tryAuth();try{for(var i=tslib.__values(this.listens.values()),o=i.next();!o.done;o=i.next()){var a=o.value;try{for(var s=(n=void 0,tslib.__values(a.values())),l=s.next();!l.done;l=s.next()){var c=l.value;this.sendListen_(c)}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}for(var u=0;u=200&&s.status<300){try{e=index_cjs.jsonEval(s.responseText)}catch(e){b("Failed to parse JSON response for "+a+": "+s.responseText)}n(null,e)}else 401!==s.status&&404!==s.status&&b("Got unsuccessful REST response for "+a+" Status: "+s.status),n(s.status);n=null}},s.open("GET",a,!0),s.send()}))},t}(Ut),Wt=function(){function e(e,t,n,r){var i=this;if(this.repoInfo_=e,this.app=n,this.dataUpdateCount=0,this.statsListener_=null,this.eventQueue_=new Dt,this.nextWriteId_=1,this.interceptServerDataCallback_=null,this.onDisconnect_=new tt,this.persistentConnection_=null,this.stats_=Pt.getCollection(e),t||("object"==typeof window&&window.navigator&&window.navigator.userAgent||"").search(/googlebot|google webmaster tools|bingbot|yahoo! slurp|baiduspider|yandexbot|duckduckbot/i)>=0)this.server_=new qt(this.repoInfo_,this.onDataUpdate_.bind(this),r),setTimeout(this.onConnectStatus_.bind(this,!0),0);else{var o=n.options.databaseAuthVariableOverride;if(null!=o){if("object"!=typeof o)throw new Error("Only objects are supported for option databaseAuthVariableOverride");try{index_cjs.stringify(o)}catch(e){throw new Error("Invalid authOverride provided: "+e)}}this.persistentConnection_=new Ht(this.repoInfo_,n.options.appId,this.onDataUpdate_.bind(this),this.onConnectStatus_.bind(this),this.onServerInfoUpdate_.bind(this),r,o),this.server_=this.persistentConnection_}r.addTokenChangeListener((function(e){i.server_.refreshAuthToken(e)})),this.statsReporter_=Pt.getOrCreateReporter(e,(function(){return new It(i.stats_,i.server_)})),this.transactionsInit_(),this.infoData_=new xt,this.infoSyncTree_=new St({startListening:function(e,t,n,r){var o=[],a=i.infoData_.getNode(e.path);return a.isEmpty()||(o=i.infoSyncTree_.applyServerOverwrite(e.path,a),setTimeout((function(){r("ok")}),0)),o},stopListening:function(){}}),this.updateInfo_("connected",!1),this.serverSyncTree_=new St({startListening:function(e,t,n,r){return i.server_.listen(e,n,t,(function(t,n){var o=r(t,n);i.eventQueue_.raiseEventsForChangedPath(e.path,o)})),[]},stopListening:function(e,t){i.server_.unlisten(e,t)}})}return e.prototype.toString=function(){return(this.repoInfo_.secure?"https://":"http://")+this.repoInfo_.host},e.prototype.name=function(){return this.repoInfo_.namespace},e.prototype.serverTime=function(){var e=this.infoData_.getNode(new M(".info/serverTimeOffset")).val()||0;return(new Date).getTime()+e},e.prototype.generateServerValues=function(){return(e=(e={timestamp:this.serverTime()})||{}).timestamp=e.timestamp||(new Date).getTime(),e;var e},e.prototype.onDataUpdate_=function(e,t,n,r){this.dataUpdateCount++;var i=new M(e);t=this.interceptServerDataCallback_?this.interceptServerDataCallback_(e,t):t;var o=[];if(r)if(n){var a=index_cjs.map(t,(function(e){return Fe(e)}));o=this.serverSyncTree_.applyTaggedQueryMerge(i,a,r)}else{var s=Fe(t);o=this.serverSyncTree_.applyTaggedQueryOverwrite(i,s,r)}else if(n){var l=index_cjs.map(t,(function(e){return Fe(e)}));o=this.serverSyncTree_.applyServerMerge(i,l)}else{var c=Fe(t);o=this.serverSyncTree_.applyServerOverwrite(i,c)}var u=i;o.length>0&&(u=this.rerunTransactions_(i)),this.eventQueue_.raiseEventsForChangedPath(u,o)},e.prototype.interceptServerData_=function(e){this.interceptServerDataCallback_=e},e.prototype.onConnectStatus_=function(e){this.updateInfo_("connected",e),!1===e&&this.runOnDisconnectEvents_()},e.prototype.onServerInfoUpdate_=function(e){var t=this;A(e,(function(e,n){t.updateInfo_(e,n)}))},e.prototype.updateInfo_=function(e,t){var n=new M("/.info/"+e),r=Fe(t);this.infoData_.updateSnapshot(n,r);var i=this.infoSyncTree_.applyServerOverwrite(n,r);this.eventQueue_.raiseEventsForChangedPath(n,i)},e.prototype.getNextWriteId_=function(){return this.nextWriteId_++},e.prototype.setWithPriority=function(e,t,n,r){var i=this;this.log_("set",{path:e.toString(),value:t,priority:n});var o=this.generateServerValues(),a=Fe(t,n),s=this.serverSyncTree_.calcCompleteEventCache(e),l=Je(a,s,o),c=this.getNextWriteId_(),u=this.serverSyncTree_.applyUserOverwrite(e,l,c,!0);this.eventQueue_.queueEvents(u),this.server_.put(e.toString(),a.val(!0),(function(t,n){var o="ok"===t;o||b("set at "+e+" failed: "+t);var a=i.serverSyncTree_.ackUserWrite(c,!o);i.eventQueue_.raiseEventsForChangedPath(e,a),i.callOnCompleteCallback(r,t,n)}));var h=this.abortTransactions_(e);this.rerunTransactions_(h),this.eventQueue_.raiseEventsForChangedPath(h,[])},e.prototype.update=function(e,t,n){var r=this;this.log_("update",{path:e.toString(),value:t});var i=!0,o=this.generateServerValues(),a={};if(A(t,(function(t,n){i=!1,a[t]=Xe(e.child(t),Fe(n),r.serverSyncTree_,o)})),i)g("update() called with empty data. Don't do anything."),this.callOnCompleteCallback(n,"ok");else{var s=this.getNextWriteId_(),l=this.serverSyncTree_.applyUserMerge(e,a,s);this.eventQueue_.queueEvents(l),this.server_.merge(e.toString(),t,(function(t,i){var o="ok"===t;o||b("update at "+e+" failed: "+t);var a=r.serverSyncTree_.ackUserWrite(s,!o),l=a.length>0?r.rerunTransactions_(e):e;r.eventQueue_.raiseEventsForChangedPath(l,a),r.callOnCompleteCallback(n,t,i)})),A(t,(function(t){var n=r.abortTransactions_(e.child(t));r.rerunTransactions_(n)})),this.eventQueue_.raiseEventsForChangedPath(e,[])}},e.prototype.runOnDisconnectEvents_=function(){var e=this;this.log_("onDisconnectEvents");var t=this.generateServerValues(),n=new tt;this.onDisconnect_.forEachTree(M.Empty,(function(r,i){var o=Xe(r,i,e.serverSyncTree_,t);n.remember(r,o)}));var r=[];n.forEachTree(M.Empty,(function(t,n){r=r.concat(e.serverSyncTree_.applyServerOverwrite(t,n));var i=e.abortTransactions_(t);e.rerunTransactions_(i)})),this.onDisconnect_=new tt,this.eventQueue_.raiseEventsForChangedPath(M.Empty,r)},e.prototype.onDisconnectCancel=function(e,t){var n=this;this.server_.onDisconnectCancel(e.toString(),(function(r,i){"ok"===r&&n.onDisconnect_.forget(e),n.callOnCompleteCallback(t,r,i)}))},e.prototype.onDisconnectSet=function(e,t,n){var r=this,i=Fe(t);this.server_.onDisconnectPut(e.toString(),i.val(!0),(function(t,o){"ok"===t&&r.onDisconnect_.remember(e,i),r.callOnCompleteCallback(n,t,o)}))},e.prototype.onDisconnectSetWithPriority=function(e,t,n,r){var i=this,o=Fe(t,n);this.server_.onDisconnectPut(e.toString(),o.val(!0),(function(t,n){"ok"===t&&i.onDisconnect_.remember(e,o),i.callOnCompleteCallback(r,t,n)}))},e.prototype.onDisconnectUpdate=function(e,t,n){var r=this;if(index_cjs.isEmpty(t))return g("onDisconnect().update() called with empty data. Don't do anything."),void this.callOnCompleteCallback(n,"ok");this.server_.onDisconnectMerge(e.toString(),t,(function(i,o){"ok"===i&&A(t,(function(t,n){var i=Fe(n);r.onDisconnect_.remember(e.child(t),i)})),r.callOnCompleteCallback(n,i,o)}))},e.prototype.addEventCallbackForQuery=function(e,t){var n;n=".info"===e.path.getFront()?this.infoSyncTree_.addEventRegistration(e,t):this.serverSyncTree_.addEventRegistration(e,t),this.eventQueue_.raiseEventsAtPath(e.path,n)},e.prototype.removeEventCallbackForQuery=function(e,t){var n;n=".info"===e.path.getFront()?this.infoSyncTree_.removeEventRegistration(e,t):this.serverSyncTree_.removeEventRegistration(e,t),this.eventQueue_.raiseEventsAtPath(e.path,n)},e.prototype.interrupt=function(){this.persistentConnection_&&this.persistentConnection_.interrupt("repo_interrupt")},e.prototype.resume=function(){this.persistentConnection_&&this.persistentConnection_.resume("repo_interrupt")},e.prototype.stats=function(e){if(void 0===e&&(e=!1),"undefined"!=typeof console){var t;e?(this.statsListener_||(this.statsListener_=new At(this.stats_)),t=this.statsListener_.get()):t=this.stats_.get();var n=Object.keys(t).reduce((function(e,t){return Math.max(t.length,e)}),0);A(t,(function(e,t){for(var r=e,i=e.length;i=0)return null!=i&&i.trackChildChange(pt.childChangedChange(t,n,h)),s.updateImmediateChild(t,n);null!=i&&i.trackChildChange(pt.childRemovedChange(t,h));var d=s.updateImmediateChild(t,Ne.EMPTY_NODE);return null!=p&&this.rangedFilter_.matches(p)?(null!=i&&i.trackChildChange(pt.childAddedChange(p.name,p.node)),d.updateImmediateChild(p.name,p.node)):d}return n.isEmpty()?e:u&&o(c,l)>=0?(null!=i&&(i.trackChildChange(pt.childRemovedChange(c.name,c.node)),i.trackChildChange(pt.childAddedChange(t,n))),s.updateImmediateChild(t,n).updateImmediateChild(c.name,Ne.EMPTY_NODE)):e},e}(),Qt=function(){function e(){this.limitSet_=!1,this.startSet_=!1,this.startNameSet_=!1,this.endSet_=!1,this.endNameSet_=!1,this.limit_=0,this.viewFrom_="",this.indexStartValue_=null,this.indexStartName_="",this.indexEndValue_=null,this.indexEndName_="",this.index_=Ee}return e.prototype.hasStart=function(){return this.startSet_},e.prototype.isViewFromLeft=function(){return""===this.viewFrom_?this.startSet_:this.viewFrom_===e.WIRE_PROTOCOL_CONSTANTS_.VIEW_FROM_LEFT},e.prototype.getIndexStartValue=function(){return index_cjs.assert(this.startSet_,"Only valid if start has been set"),this.indexStartValue_},e.prototype.getIndexStartName=function(){return index_cjs.assert(this.startSet_,"Only valid if start has been set"),this.startNameSet_?this.indexStartName_:E},e.prototype.hasEnd=function(){return this.endSet_},e.prototype.getIndexEndValue=function(){return index_cjs.assert(this.endSet_,"Only valid if end has been set"),this.indexEndValue_},e.prototype.getIndexEndName=function(){return index_cjs.assert(this.endSet_,"Only valid if end has been set"),this.endNameSet_?this.indexEndName_:T},e.prototype.hasLimit=function(){return this.limitSet_},e.prototype.hasAnchoredLimit=function(){return this.limitSet_&&""!==this.viewFrom_},e.prototype.getLimit=function(){return index_cjs.assert(this.limitSet_,"Only valid if limit has been set"),this.limit_},e.prototype.getIndex=function(){return this.index_},e.prototype.copy_=function(){var t=new e;return t.limitSet_=this.limitSet_,t.limit_=this.limit_,t.startSet_=this.startSet_,t.indexStartValue_=this.indexStartValue_,t.startNameSet_=this.startNameSet_,t.indexStartName_=this.indexStartName_,t.endSet_=this.endSet_,t.indexEndValue_=this.indexEndValue_,t.endNameSet_=this.endNameSet_,t.indexEndName_=this.indexEndName_,t.index_=this.index_,t.viewFrom_=this.viewFrom_,t},e.prototype.limit=function(e){var t=this.copy_();return t.limitSet_=!0,t.limit_=e,t.viewFrom_="",t},e.prototype.limitToFirst=function(t){var n=this.copy_();return n.limitSet_=!0,n.limit_=t,n.viewFrom_=e.WIRE_PROTOCOL_CONSTANTS_.VIEW_FROM_LEFT,n},e.prototype.limitToLast=function(t){var n=this.copy_();return n.limitSet_=!0,n.limit_=t,n.viewFrom_=e.WIRE_PROTOCOL_CONSTANTS_.VIEW_FROM_RIGHT,n},e.prototype.startAt=function(e,t){var n=this.copy_();return n.startSet_=!0,void 0===e&&(e=null),n.indexStartValue_=e,null!=t?(n.startNameSet_=!0,n.indexStartName_=t):(n.startNameSet_=!1,n.indexStartName_=""),n},e.prototype.endAt=function(e,t){var n=this.copy_();return n.endSet_=!0,void 0===e&&(e=null),n.indexEndValue_=e,void 0!==t?(n.endNameSet_=!0,n.indexEndName_=t):(n.endNameSet_=!1,n.indexEndName_=""),n},e.prototype.orderBy=function(e){var t=this.copy_();return t.index_=e,t},e.prototype.getQueryObject=function(){var t=e.WIRE_PROTOCOL_CONSTANTS_,n={};if(this.startSet_&&(n[t.INDEX_START_VALUE]=this.indexStartValue_,this.startNameSet_&&(n[t.INDEX_START_NAME]=this.indexStartName_)),this.endSet_&&(n[t.INDEX_END_VALUE]=this.indexEndValue_,this.endNameSet_&&(n[t.INDEX_END_NAME]=this.indexEndName_)),this.limitSet_){n[t.LIMIT]=this.limit_;var r=this.viewFrom_;""===r&&(r=this.isViewFromLeft()?t.VIEW_FROM_LEFT:t.VIEW_FROM_RIGHT),n[t.VIEW_FROM]=r}return this.index_!==Ee&&(n[t.INDEX]=this.index_.toString()),n},e.prototype.loadsAllData=function(){return!(this.startSet_||this.endSet_||this.limitSet_)},e.prototype.isDefault=function(){return this.loadsAllData()&&this.index_===Ee},e.prototype.getNodeFilter=function(){return this.loadsAllData()?new ft(this.getIndex()):this.hasLimit()?new Kt(this):new Yt(this)},e.prototype.toRestQueryStringParameters=function(){var t,n=e.REST_QUERY_CONSTANTS_,r={};return this.isDefault()||(this.index_===Ee?t=n.PRIORITY_INDEX:this.index_===je?t=n.VALUE_INDEX:this.index_===fe?t=n.KEY_INDEX:(index_cjs.assert(this.index_ instanceof $e,"Unrecognized index type!"),t=this.index_.toString()),r[n.ORDER_BY]=index_cjs.stringify(t),this.startSet_&&(r[n.START_AT]=index_cjs.stringify(this.indexStartValue_),this.startNameSet_&&(r[n.START_AT]+=","+index_cjs.stringify(this.indexStartName_))),this.endSet_&&(r[n.END_AT]=index_cjs.stringify(this.indexEndValue_),this.endNameSet_&&(r[n.END_AT]+=","+index_cjs.stringify(this.indexEndName_))),this.limitSet_&&(this.isViewFromLeft()?r[n.LIMIT_TO_FIRST]=this.limit_:r[n.LIMIT_TO_LAST]=this.limit_)),r},e.WIRE_PROTOCOL_CONSTANTS_={INDEX_START_VALUE:"sp",INDEX_START_NAME:"sn",INDEX_END_VALUE:"ep",INDEX_END_NAME:"en",LIMIT:"l",VIEW_FROM:"vf",VIEW_FROM_LEFT:"l",VIEW_FROM_RIGHT:"r",INDEX:"i"},e.REST_QUERY_CONSTANTS_={ORDER_BY:"orderBy",PRIORITY_INDEX:"$priority",VALUE_INDEX:"$value",KEY_INDEX:"$key",START_AT:"startAt",END_AT:"endAt",LIMIT_TO_FIRST:"limitToFirst",LIMIT_TO_LAST:"limitToLast"},e.DEFAULT=new e,e}(),Xt=function(e){function t(t,n){if(!(t instanceof Wt))throw new Error("new Reference() no longer supported - use app.database().");return e.call(this,t,n,Qt.DEFAULT,!1)||this}return tslib.__extends(t,e),t.prototype.getKey=function(){return index_cjs.validateArgCount("Reference.key",0,0,arguments.length),this.path.isEmpty()?null:this.path.getBack()},t.prototype.child=function(e){return index_cjs.validateArgCount("Reference.child",1,1,arguments.length),"number"==typeof e?e=String(e):e instanceof M||(null===this.path.getFront()?re("Reference.child",1,e,!1):ne("Reference.child",1,e,!1)),new t(this.repo,this.path.child(e))},t.prototype.getParent=function(){index_cjs.validateArgCount("Reference.parent",0,0,arguments.length);var e=this.path.parent();return null===e?null:new t(this.repo,e)},t.prototype.getRoot=function(){index_cjs.validateArgCount("Reference.root",0,0,arguments.length);for(var e=this;null!==e.getParent();)e=e.getParent();return e},t.prototype.databaseProp=function(){return this.repo.database},t.prototype.set=function(e,t){index_cjs.validateArgCount("Reference.set",1,2,arguments.length),ie("Reference.set",this.path),Q("Reference.set",1,e,this.path,!1),index_cjs.validateCallback("Reference.set",2,t,!0);var n=new index_cjs.Deferred;return this.repo.setWithPriority(this.path,e,null,n.wrapCallback(t)),n.promise},t.prototype.update=function(e,t){if(index_cjs.validateArgCount("Reference.update",1,2,arguments.length),ie("Reference.update",this.path),Array.isArray(e)){for(var n={},r=0;r0},e.prototype.isEmpty=function(){return null===this.getValue()&&!this.hasChildren()},e.prototype.forEachChild=function(t){var n=this;A(this.node_.children,(function(r,i){t(new e(r,n,i))}))},e.prototype.forEachDescendant=function(e,t,n){t&&!n&&e(this),this.forEachChild((function(t){t.forEachDescendant(e,!0,n)})),t&&n&&e(this)},e.prototype.forEachAncestor=function(e,t){for(var n=t?this:this.parent();null!==n;){if(e(n))return!0;n=n.parent()}return!1},e.prototype.forEachImmediateDescendantWithValue=function(e){this.forEachChild((function(t){null!==t.getValue()?e(t):t.forEachImmediateDescendantWithValue(e)}))},e.prototype.path=function(){return new M(null===this.parent_?this.name_:this.parent_.path()+"/"+this.name_)},e.prototype.name=function(){return this.name_},e.prototype.parent=function(){return this.parent_},e.prototype.updateParents_=function(){null!==this.parent_&&this.parent_.updateChild_(this.name_,this)},e.prototype.updateChild_=function(e,t){var n=t.isEmpty(),r=index_cjs.contains(this.node_.children,e);n&&r?(delete this.node_.children[e],this.node_.childCount--,this.updateParents_()):n||r||(this.node_.children[e]=t.node_,this.node_.childCount++,this.updateParents_())},e}();!function(e){e[e.RUN=0]="RUN",e[e.SENT=1]="SENT",e[e.COMPLETED=2]="COMPLETED",e[e.SENT_NEEDS_ABORT=3]="SENT_NEEDS_ABORT",e[e.NEEDS_ABORT=4]="NEEDS_ABORT"}(Jt||(Jt={})),Wt.MAX_TRANSACTION_RETRIES_=25,Wt.prototype.transactionsInit_=function(){this.transactionQueueTree_=new en},Wt.prototype.startTransaction=function(e,t,n,r){this.log_("transaction on "+e);var i=function(){},o=new Xt(this,e);o.on("value",i);var a={path:e,update:t,onComplete:n,status:null,order:u(),applyLocally:r,retryCount:0,unwatcher:function(){o.off("value",i)},abortReason:null,currentWriteId:null,currentInputSnapshot:null,currentOutputSnapshotRaw:null,currentOutputSnapshotResolved:null},s=this.getLatestState_(e);a.currentInputSnapshot=s;var l=a.update(s.val());if(void 0===l){if(a.unwatcher(),a.currentOutputSnapshotRaw=null,a.currentOutputSnapshotResolved=null,a.onComplete){var c=new Be(a.currentInputSnapshot,new Xt(this,a.path),Ee);a.onComplete(null,!1,c)}}else{X("transaction failed: Data returned ",l,a.path),a.status=Jt.RUN;var h=this.transactionQueueTree_.subTree(e),p=h.getValue()||[];p.push(a),h.setValue(p);var f=void 0;if("object"==typeof l&&null!==l&&index_cjs.contains(l,".priority"))f=index_cjs.safeGet(l,".priority"),index_cjs.assert(K(f),"Invalid priority returned by transaction. Priority must be a valid string, finite number, server value, or null.");else f=(this.serverSyncTree_.calcCompleteEventCache(e)||Ne.EMPTY_NODE).getPriority().val();f=f;var d=this.generateServerValues(),m=Fe(l,f),g=Je(m,s,d);a.currentOutputSnapshotRaw=m,a.currentOutputSnapshotResolved=g,a.currentWriteId=this.getNextWriteId_();var y=this.serverSyncTree_.applyUserOverwrite(e,g,a.currentWriteId,a.applyLocally);this.eventQueue_.raiseEventsForChangedPath(e,y),this.sendReadyTransactions_()}},Wt.prototype.getLatestState_=function(e,t){return this.serverSyncTree_.calcCompleteEventCache(e,t)||Ne.EMPTY_NODE},Wt.prototype.sendReadyTransactions_=function(e){var t=this;if(void 0===e&&(e=this.transactionQueueTree_),e||this.pruneCompletedTransactionsBelowNode_(e),null!==e.getValue()){var n=this.buildTransactionQueue_(e);index_cjs.assert(n.length>0,"Sending zero length transaction queue"),n.every((function(e){return e.status===Jt.RUN}))&&this.sendTransactionQueue_(e.path(),n)}else e.hasChildren()&&e.forEachChild((function(e){t.sendReadyTransactions_(e)}))},Wt.prototype.sendTransactionQueue_=function(e,t){for(var n=this,r=t.map((function(e){return e.currentWriteId})),i=this.getLatestState_(e,r),o=i,a=i.hash(),s=0;s=Wt.MAX_TRANSACTION_RETRIES_)c=!0,u="maxretry",i=i.concat(this.serverSyncTree_.ackUserWrite(s.currentWriteId,!0));else{var h=this.getLatestState_(s.path,o);s.currentInputSnapshot=h;var p=e[a].update(h.val());if(void 0!==p){X("transaction failed: Data returned ",p,s.path);var f=Fe(p);"object"==typeof p&&null!=p&&index_cjs.contains(p,".priority")||(f=f.updatePriority(h.getPriority()));var d=s.currentWriteId,m=this.generateServerValues(),g=Je(f,h,m);s.currentOutputSnapshotRaw=f,s.currentOutputSnapshotResolved=g,s.currentWriteId=this.getNextWriteId_(),o.splice(o.indexOf(d),1),i=(i=i.concat(this.serverSyncTree_.applyUserOverwrite(s.path,g,s.currentWriteId,s.applyLocally))).concat(this.serverSyncTree_.ackUserWrite(d,!0))}else c=!0,u="nodata",i=i.concat(this.serverSyncTree_.ackUserWrite(s.currentWriteId,!0))}if(this.eventQueue_.raiseEventsForChangedPath(t,i),i=[],c&&(e[a].status=Jt.COMPLETED,n=e[a].unwatcher,setTimeout(n,Math.floor(0)),e[a].onComplete))if("nodata"===u){var y=new Xt(this,e[a].path),v=e[a].currentInputSnapshot,_=new Be(v,y,Ee);r.push(e[a].onComplete.bind(null,null,!1,_))}else r.push(e[a].onComplete.bind(null,new Error(u),!1,null))}this.pruneCompletedTransactionsBelowNode_(this.transactionQueueTree_);for(a=0;a0?n:null)}e.forEachChild((function(e){t.pruneCompletedTransactionsBelowNode_(e)}))},Wt.prototype.abortTransactions_=function(e){var t=this,n=this.getAncestorTransactionNode_(e).path(),r=this.transactionQueueTree_.subTree(e);return r.forEachAncestor((function(e){t.abortTransactionsOnNode_(e)})),this.abortTransactionsOnNode_(r),r.forEachDescendant((function(e){t.abortTransactionsOnNode_(e)})),n},Wt.prototype.abortTransactionsOnNode_=function(e){var t=e.getValue();if(null!==t){for(var n=[],r=[],i=-1,o=0;o=500&&t.status<600?[2,e()]:[2,t]}}))}))}function getExpiresInFromResponseExpiresIn(e){return Number(e.replace("s","000"))}function getAuthorizationHeader(e){return INTERNAL_AUTH_VERSION+" "+e} -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */function createInstallationRequest(e,t){var n=t.fid;return tslib_7(this,void 0,void 0,(function(){var t,r,i,o,a,s;return tslib_8(this,(function(l){switch(l.label){case 0:return t=getInstallationsEndpoint(e),r=getHeaders(e),i={fid:n,authVersion:INTERNAL_AUTH_VERSION,appId:e.appId,sdkVersion:PACKAGE_VERSION},o={method:"POST",headers:r,body:JSON.stringify(i)},[4,retryIfServerError((function(){return fetch(t,o)}))];case 1:return(a=l.sent()).ok?[4,a.json()]:[3,3];case 2:return s=l.sent(),[2,{fid:s.fid||n,registrationStatus:2,refreshToken:s.refreshToken,authToken:extractAuthTokenInfoFromResponse(s.authToken)}];case 3:return[4,getErrorFromResponse("Create Installation",a)];case 4:throw l.sent()}}))}))} -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */function sleep(e){return new Promise((function(t){setTimeout(t,e)}))} -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */function bufferToBase64UrlSafe(e){return btoa(String.fromCharCode.apply(String,tslib_12(e))).replace(/\+/g,"-").replace(/\//g,"_")} -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */var VALID_FID_PATTERN=/^[cdef][\w-]{21}$/,INVALID_FID="";function generateFid(){try{var e=new Uint8Array(17);(self.crypto||self.msCrypto).getRandomValues(e),e[0]=112+e[0]%16;var t=encode(e);return VALID_FID_PATTERN.test(t)?t:INVALID_FID}catch(e){return INVALID_FID}}function encode(e){return bufferToBase64UrlSafe(e).substr(0,22)} -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */function getKey(e){return e.appName+"!"+e.appId} -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */var fidChangeCallbacks=new Map;function fidChanged(e,t){var n=getKey(e);callFidChangeCallbacks(n,t),broadcastFidChange(n,t)}function addCallback(e,t){getBroadcastChannel();var n=getKey(e),r=fidChangeCallbacks.get(n);r||(r=new Set,fidChangeCallbacks.set(n,r)),r.add(t)}function removeCallback(e,t){var n=getKey(e),r=fidChangeCallbacks.get(n);r&&(r.delete(t),0===r.size&&fidChangeCallbacks.delete(n),closeBroadcastChannel())}function callFidChangeCallbacks(e,t){var n,r,i=fidChangeCallbacks.get(e);if(i)try{for(var o=tslib_10(i),a=o.next();!a.done;a=o.next()){(0,a.value)(t)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}function broadcastFidChange(e,t){var n=getBroadcastChannel();n&&n.postMessage({key:e,fid:t}),closeBroadcastChannel()}var broadcastChannel=null;function getBroadcastChannel(){return!broadcastChannel&&"BroadcastChannel"in self&&((broadcastChannel=new BroadcastChannel("[Firebase] FID Change")).onmessage=function(e){callFidChangeCallbacks(e.data.key,e.data.fid)}),broadcastChannel}function closeBroadcastChannel(){0===fidChangeCallbacks.size&&broadcastChannel&&(broadcastChannel.close(),broadcastChannel=null)} -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */var DATABASE_NAME="firebase-installations-database",DATABASE_VERSION=1,OBJECT_STORE_NAME="firebase-installations-store",dbPromise=null;function getDbPromise(){return dbPromise||(dbPromise=idb_1(DATABASE_NAME,DATABASE_VERSION,(function(e){switch(e.oldVersion){case 0:e.createObjectStore(OBJECT_STORE_NAME)}}))),dbPromise}function set(e,t){return tslib_7(this,void 0,void 0,(function(){var n,r,i,o,a;return tslib_8(this,(function(s){switch(s.label){case 0:return n=getKey(e),[4,getDbPromise()];case 1:return r=s.sent(),i=r.transaction(OBJECT_STORE_NAME,"readwrite"),[4,(o=i.objectStore(OBJECT_STORE_NAME)).get(n)];case 2:return a=s.sent(),[4,o.put(t,n)];case 3:return s.sent(),[4,i.complete];case 4:return s.sent(),a&&a.fid===t.fid||fidChanged(e,t.fid),[2,t]}}))}))}function remove(e){return tslib_7(this,void 0,void 0,(function(){var t,n,r;return tslib_8(this,(function(i){switch(i.label){case 0:return t=getKey(e),[4,getDbPromise()];case 1:return n=i.sent(),[4,(r=n.transaction(OBJECT_STORE_NAME,"readwrite")).objectStore(OBJECT_STORE_NAME).delete(t)];case 2:return i.sent(),[4,r.complete];case 3:return i.sent(),[2]}}))}))}function update(e,t){return tslib_7(this,void 0,void 0,(function(){var n,r,i,o,a,s;return tslib_8(this,(function(l){switch(l.label){case 0:return n=getKey(e),[4,getDbPromise()];case 1:return r=l.sent(),i=r.transaction(OBJECT_STORE_NAME,"readwrite"),[4,(o=i.objectStore(OBJECT_STORE_NAME)).get(n)];case 2:return a=l.sent(),void 0!==(s=t(a))?[3,4]:[4,o.delete(n)];case 3:return l.sent(),[3,6];case 4:return[4,o.put(s,n)];case 5:l.sent(),l.label=6;case 6:return[4,i.complete];case 7:return l.sent(),!s||a&&a.fid===s.fid||fidChanged(e,s.fid),[2,s]}}))}))} -/** - * @license - * Copyright 2019 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */function getInstallationEntry(e){return tslib_7(this,void 0,void 0,(function(){var t,n,r;return tslib_8(this,(function(i){switch(i.label){case 0:return[4,update(e,(function(n){var r=updateOrCreateInstallationEntry(n),i=triggerRegistrationIfNecessary(e,r);return t=i.registrationPromise,i.installationEntry}))];case 1:return(n=i.sent()).fid!==INVALID_FID?[3,3]:(r={},[4,t]);case 2:return[2,(r.installationEntry=i.sent(),r)];case 3:return[2,{installationEntry:n,registrationPromise:t}]}}))}))}function updateOrCreateInstallationEntry(e){return clearTimedOutRequest(e||{fid:generateFid(),registrationStatus:0})}function triggerRegistrationIfNecessary(e,t){if(0===t.registrationStatus){if(!navigator.onLine)return{installationEntry:t,registrationPromise:Promise.reject(ERROR_FACTORY.create("app-offline"))};var n={fid:t.fid,registrationStatus:1,registrationTime:Date.now()};return{installationEntry:n,registrationPromise:registerInstallation(e,n)}}return 1===t.registrationStatus?{installationEntry:t,registrationPromise:waitUntilFidRegistration(e)}:{installationEntry:t}}function registerInstallation(e,t){return tslib_7(this,void 0,void 0,(function(){var n,r;return tslib_8(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,7]),[4,createInstallationRequest(e,t)];case 1:return n=i.sent(),[2,set(e,n)];case 2:return isServerError(r=i.sent())&&409===r.serverCode?[4,remove(e)]:[3,4];case 3:return i.sent(),[3,6];case 4:return[4,set(e,{fid:t.fid,registrationStatus:0})];case 5:i.sent(),i.label=6;case 6:throw r;case 7:return[2]}}))}))}function waitUntilFidRegistration(e){return tslib_7(this,void 0,void 0,(function(){var t,n,r,i;return tslib_8(this,(function(o){switch(o.label){case 0:return[4,updateInstallationRequest(e)];case 1:t=o.sent(),o.label=2;case 2:return 1!==t.registrationStatus?[3,5]:[4,sleep(100)];case 3:return o.sent(),[4,updateInstallationRequest(e)];case 4:return t=o.sent(),[3,2];case 5:return 0!==t.registrationStatus?[3,7]:[4,getInstallationEntry(e)];case 6:return n=o.sent(),r=n.installationEntry,(i=n.registrationPromise)?[2,i]:[2,r];case 7:return[2,t]}}))}))}function updateInstallationRequest(e){return update(e,(function(e){if(!e)throw ERROR_FACTORY.create("installation-not-found");return clearTimedOutRequest(e)}))}function clearTimedOutRequest(e){return hasInstallationRequestTimedOut(e)?{fid:e.fid,registrationStatus:0}:e}function hasInstallationRequestTimedOut(e){return 1===e.registrationStatus&&e.registrationTime+PENDING_TIMEOUT_MS{e=e=>{r(e),n.isPending=!1},t=e=>{i(e),n.isPending=!1}}).catch(e=>Promise.reject(e));return n.resolve=e,n.reject=t,"finally"in n||(n.finally=e=>{n.then(e),n.catch(e)}),n.isPending=!0,n}Object.defineProperty(t,"__esModule",{value:!0}),t.future=n,t.default=n})),future=unwrapExports(fpFuture),fpFuture_1=fpFuture.future;let firebaseConfig={apiKey:"AIzaSyBhfoK4AFBLsruM0sDJ-sAFyksh4FqMpC8",authDomain:"diagrams-de8ed.firebaseapp.com",databaseURL:"https://diagrams-de8ed.firebaseio.com",projectId:"diagrams-de8ed",storageBucket:"diagrams-de8ed.appspot.com",messagingSenderId:"346071222923",appId:"1:346071222923:web:4d57d09e64ea7ed1ee628e",measurementId:"G-HLCQLCWE0G"};async function addFirebase(){index_cjs$3.initializeApp(firebaseConfig),index_cjs$3.analytics(),await index_cjs$3.auth().setPersistence(index_cjs$3.auth.Auth.Persistence.LOCAL),await new Promise((e,t)=>{const n=index_cjs$3.auth().onAuthStateChanged(t=>{n(),e(t)},e=>{console.error(e),t("API Failed")})})}function newNotebook(e){const t=index_cjs$3.database().ref(`users/${e}/notebooks`).push();return t.child("meta/uid").set(e,(function(e){e&&console.log("error setting uid",e)})),t.child("meta/title").set("Untitled notebook",(function(e){e&&console.log("error setting titile2",e)})),t}function openByHash(e,t){return index_cjs$3.database().ref().child(`users/${e}/notebooks/${t}`)}function logEvent$1(e){index_cjs$3.analytics().logEvent(e)}function logException(e){index_cjs$3.analytics().logEvent("exception",{description:"object"==typeof e?e.message:e,fatal:"object"==typeof e})}function logPageView(e,t){index_cjs$3.analytics().logEvent("page_view",{page_location:e,page_path:t})}async function newNotebookWithContent(e){const t=future();let n=index_cjs$3.auth().currentUser&&index_cjs$3.auth().currentUser.uid||"anonymous";const r=newNotebook(n);return new Firepad.Headless(r).setText(e,(function(e,i){t.resolve({ref:r,data:e,succeed:i,owner:n})})),t}globalThis.firebase=index_cjs$3;const history=createHashHistory();function navigateTo(e,t){const n={pathname:e,state:t||{}};history.location.pathname!=n.pathname&&history.push(n)}history.listen(e=>{logPageView(location.toString(),e.pathname)});var interopRequireDefault=createCommonjsModule((function(e){e.exports=function(e){return e&&e.__esModule?e:{default:e}}}));unwrapExports(interopRequireDefault);var _typeof_1=createCommonjsModule((function(e){function t(n){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=t=function(e){return typeof e}:e.exports=t=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(n)}e.exports=t})),interopRequireWildcard=createCommonjsModule((function(e){function t(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return t=function(){return e},e}e.exports=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==_typeof_1(e)&&"function"!=typeof e)return{default:e};var n=t();if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}}));function _defineProperty(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}unwrapExports(interopRequireWildcard);var defineProperty=_defineProperty;function _arrayWithHoles(e){if(Array.isArray(e))return e}var arrayWithHoles=_arrayWithHoles;function _iterableToArrayLimit(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}}var iterableToArrayLimit=_iterableToArrayLimit;function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(i[n]=e[n]);return i}unwrapExports(MonacoContainer);var objectWithoutPropertiesLoose=_objectWithoutPropertiesLoose$1;function _objectWithoutProperties(e,t){if(null==e)return{};var n,r,i=objectWithoutPropertiesLoose(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var objectWithoutProperties=_objectWithoutProperties;function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var classCallCheck=_classCallCheck;function _defineProperties(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{},t=e.src,r=(0,n.default)(e,["src"]);return this.configScriptSrc=t,this.__config=(0,utils.deepMerge)(this.__config,this.validateConfig(r)),this}},{key:"validateConfig",value:function(e){return e.urls?(this.informAboutDepreciation(),{paths:{vs:e.urls.monacoBase}}):e}},{key:"informAboutDepreciation",value:function(){console.warn("Deprecation warning!\n You are using deprecated way of configuration.\n\n Instead of using\n monaco.config({ urls: { monacoBase: '...' } })\n use\n monaco.config({ paths: { vs: '...' } })\n\n For more please check the link https://github.com/suren-atoyan/monaco-react#config\n ")}},{key:"injectScripts",value:function(e){document.body.appendChild(e)}},{key:"createScript",value:function(e){var t=document.createElement("script");return e&&(t.src=e),t}},{key:"createMonacoLoaderScript",value:function(e){var t=this,n=this.createScript("".concat(this.__config.paths.vs,"/loader.js"));return n.onload=function(n){return t.injectScripts(e)},n.onerror=this.reject,n}},{key:"createConfigScript",value:function(){var e=this.createScript();return this.configScriptSrc?e.src=this.configScriptSrc:e.innerHTML="\n require.config(".concat(JSON.stringify(this.__config),");\n require(['vs/editor/editor.main'], function() {\n document.dispatchEvent(new Event('monaco_init'));\n });\n "),e.onerror=this.reject,e}},{key:"init",value:function(){if(!this.isInitialized){if(window.monaco&&window.monaco.editor)return new Promise((function(e,t){return e(window.monaco)}));document.addEventListener("monaco_init",this.handleConfigScriptLoad);var e=this.createConfigScript(),t=this.createMonacoLoaderScript(e);this.injectScripts(t)}return this.isInitialized=!0,(0,utils.makeCancelable)(this.wrapperPromise)}}]),e}())(a.default);t.default=s}));unwrapExports(monaco$1);var noop_1=createCommonjsModule((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(e){};t.default=n}));unwrapExports(noop_1);var deepMerge=createCommonjsModule((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=interopRequireDefault(defineProperty);function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var i=function e(t,i){return Object.keys(i).forEach((function(n){i[n]instanceof Object&&t[n]&&Object.assign(i[n],e(t[n],i[n]))})),function(e){for(var t=1;t2&&void 0!==arguments[2])||arguments[2],r=(0,react.useRef)(!0);(0,react.useEffect)(r.current||!n?function(e){r.current=!1}:e,t)};t.default=n}));unwrapExports(useUpdate_1);var hooks=createCommonjsModule((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"useMount",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(t,"useUpdate",{enumerable:!0,get:function(){return r.default}});var n=interopRequireDefault(useMount_1),r=interopRequireDefault(useUpdate_1)}));unwrapExports(hooks);var themes_1=createCommonjsModule((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={"night-dark":{base:"vs-dark",inherit:!0,rules:[],colors:{"editor.background":"#202124"}}};t.default=n}));unwrapExports(themes_1);var Editor_1=createCommonjsModule((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=interopRequireDefault(defineProperty),r=interopRequireDefault(slicedToArray),i=interopRequireWildcard(react),o=interopRequireDefault(propTypes),a=interopRequireDefault(MonacoContainer),s=interopRequireDefault(themes_1);function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var c=function(e){var t=e.value,o=e.language,c=e.editorDidMount,u=e.theme,h=e.line,p=e.width,f=e.height,d=e.loading,m=e.options,g=e.overrideServices,y=e._isControlledMode,v=e.className,_=e.wrapperClassName,b=(0,i.useState)(!1),w=(0,r.default)(b,2),E=w[0],T=w[1],k=(0,i.useState)(!0),S=(0,r.default)(k,2),x=S[0],C=S[1],P=(0,i.useRef)(),A=(0,i.useRef)(),I=(0,i.useRef)();(0,hooks.useMount)((function(e){var t=utils.monaco.init();return t.then((function(e){return(A.current=e)&&C(!1)})).catch((function(e){return"cancelation"!==(null==e?void 0:e.type)&&console.error("Monaco initialization: error:",e)})),function(e){return P.current?R():t.cancel()}})),(0,hooks.useUpdate)((function(e){P.current.updateOptions(m)}),[m],E),(0,hooks.useUpdate)((function(e){if(P.current.getOption(A.current.editor.EditorOption.readOnly))P.current.setValue(t);else if(t!==P.current.getValue()){if(P.current.executeEdits("",[{range:P.current.getModel().getFullModelRange(),text:t}]),y){var n=P.current.getModel();n.forceTokenization(n.getLineCount())}P.current.pushUndoStop()}}),[t],E),(0,hooks.useUpdate)((function(e){P.current.setValue(t),A.current.editor.setModelLanguage(P.current.getModel(),o)}),[o],E),(0,hooks.useUpdate)((function(e){P.current.setScrollPosition({scrollTop:h})}),[h],E),(0,hooks.useUpdate)((function(e){A.current.editor.setTheme(u)}),[u],E);var D=(0,i.useCallback)((function(e){P.current=A.current.editor.create(I.current,function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(r=e[Symbol.iterator]()).next.bind(r)}var r=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e){function t(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}e.exports={defaults:{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1},getDefaults:t,changeDefaults:function(t){e.exports.defaults=t}}})),i=(r.defaults,r.getDefaults,r.changeDefaults,/[&<>"']/),o=/[&<>"']/g,a=/[<>"']|&(?!#?\w+;)/,s=/[<>"']|&(?!#?\w+;)/g,l={"&":"&","<":"<",">":">",'"':""","'":"'"},c=function(e){return l[e]},u=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function h(e){return e.replace(u,(function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""}))}var p=/(^|[^\[])\^/g,f=/[^\w:]/g,d=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i,m={},g=/^[^:]+:\/*[^/]*$/,y=/^([^:]+:)[\s\S]*$/,v=/^([^:]+:\/*[^/]*)[\s\S]*$/;function _(e,t){m[" "+e]||(g.test(e)?m[" "+e]=e+"/":m[" "+e]=b(e,"/",!0));var n=-1===(e=m[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(y,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(v,"$1")+t:e+t}function b(e,t,n){var r=e.length;if(0===r)return"";for(var i=0;i=0&&"\\"===n[i];)r=!r;return r?"|":" |"})).split(/ \|/),r=0;if(n.length>t)n.splice(t);else for(;n.length1?{type:"space",raw:t[0]}:{raw:"\n"}},t.code=function(e,t){var n=this.rules.block.code.exec(e);if(n){var r=t[t.length-1];if(r&&"paragraph"===r.type)return{raw:n[0],text:n[0].trimRight()};var i=n[0].replace(/^ {4}/gm,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?i:R(i,"\n")}}},t.fences=function(e){var t=this.rules.block.fences.exec(e);if(t){var n=t[0],r=function(e,t){var n=e.match(/^(\s+)(?:```)/);if(null===n)return t;var r=n[1];return t.split("\n").map((function(e){var t=e.match(/^\s+/);return null===t?e:t[0].length>=r.length?e.slice(r.length):e})).join("\n")}(n,t[3]||"");return{type:"code",raw:n,lang:t[2]?t[2].trim():t[2],text:r}}},t.heading=function(e){var t=this.rules.block.heading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[1].length,text:t[2]}},t.nptable=function(e){var t=this.rules.block.nptable.exec(e);if(t){var n={type:"table",header:O(t[1].replace(/^ *| *\| *$/g,"")),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:t[3]?t[3].replace(/\n$/,"").split("\n"):[],raw:t[0]};if(n.header.length===n.align.length){var r,i=n.align.length;for(r=0;r ?/gm,"");return{type:"blockquote",raw:t[0],text:n}}},t.list=function(e){var t=this.rules.block.list.exec(e);if(t){for(var n,r,i,o,a,s,l,c=t[0],u=t[2],h=u.length>1,p=")"===u[u.length-1],f={type:"list",raw:c,ordered:h,start:h?+u.slice(0,-1):"",loose:!1,items:[]},d=t[0].match(this.rules.block.item),m=!1,g=d.length,y=0;y1||this.options.smartLists&&i!==u)&&(o=d.slice(y+1).join("\n"),f.raw=f.raw.substring(0,f.raw.length-o.length),y=g-1)),a=m||/\n\n(?!\s*$)/.test(n),y!==g-1&&(m="\n"===n.charAt(n.length-1),a||(a=m)),a&&(f.loose=!0),l=void 0,(s=/^\[[ xX]\] /.test(n))&&(l=" "!==n[1],n=n.replace(/^\[[ xX]\] +/,"")),f.items.push({type:"list_item",raw:c,task:s,checked:l,loose:a,text:n});return f}},t.html=function(e){var t=this.rules.block.html.exec(e);if(t)return{type:this.options.sanitize?"paragraph":"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):N(t[0]):t[0]}},t.def=function(e){var t=this.rules.block.def.exec(e);if(t)return t[3]&&(t[3]=t[3].substring(1,t[3].length-1)),{tag:t[1].toLowerCase().replace(/\s+/g," "),raw:t[0],href:t[2],title:t[3]}},t.table=function(e){var t=this.rules.block.table.exec(e);if(t){var n={type:"table",header:O(t[1].replace(/^ *| *\| *$/g,"")),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:t[3]?t[3].replace(/\n$/,"").split("\n"):[]};if(n.header.length===n.align.length){n.raw=t[0];var r,i=n.align.length;for(r=0;r/i.test(r[0])&&(t=!1),!n&&/^<(pre|code|kbd|script)(\s|>)/i.test(r[0])?n=!0:n&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(r[0])&&(n=!1),{type:this.options.sanitize?"text":"html",raw:r[0],inLink:t,inRawBlock:n,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):N(r[0]):r[0]}},t.link=function(e){var t=this.rules.inline.link.exec(e);if(t){var n=M(t[2],"()");if(n>-1){var r=(0===t[0].indexOf("!")?5:4)+t[1].length+n;t[2]=t[2].substring(0,n),t[0]=t[0].substring(0,r).trim(),t[3]=""}var i=t[2],o="";if(this.options.pedantic){var a=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i);a?(i=a[1],o=a[3]):o=""}else o=t[3]?t[3].slice(1,-1):"";return F(t,{href:(i=i.trim().replace(/^<([\s\S]*)>$/,"$1"))?i.replace(this.rules.inline._escapes,"$1"):i,title:o?o.replace(this.rules.inline._escapes,"$1"):o},t[0])}},t.reflink=function(e,t){var n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){var r=(n[2]||n[1]).replace(/\s+/g," ");if(!(r=t[r.toLowerCase()])||!r.href){var i=n[0].charAt(0);return{type:"text",raw:i,text:i}}return F(n,r,n[0])}},t.strong=function(e,t,n){void 0===n&&(n="");var r=this.rules.inline.strong.start.exec(e);if(r&&(!r[1]||r[1]&&(""===n||this.rules.inline.punctuation.exec(n)))){t=t.slice(-1*e.length);var i,o="**"===r[0]?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;for(o.lastIndex=0;null!=(r=o.exec(t));)if(i=this.rules.inline.strong.middle.exec(t.slice(0,r.index+3)))return{type:"strong",raw:e.slice(0,i[0].length),text:e.slice(2,i[0].length-2)}}},t.em=function(e,t,n){void 0===n&&(n="");var r=this.rules.inline.em.start.exec(e);if(r&&(!r[1]||r[1]&&(""===n||this.rules.inline.punctuation.exec(n)))){t=t.slice(-1*e.length);var i,o="*"===r[0]?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;for(o.lastIndex=0;null!=(r=o.exec(t));)if(i=this.rules.inline.em.middle.exec(t.slice(0,r.index+2)))return{type:"em",raw:e.slice(0,i[0].length),text:e.slice(1,i[0].length-1)}}},t.codespan=function(e){var t=this.rules.inline.code.exec(e);if(t){var n=t[2].replace(/\n/g," "),r=/[^ ]/.test(n),i=n.startsWith(" ")&&n.endsWith(" ");return r&&i&&(n=n.substring(1,n.length-1)),n=N(n,!0),{type:"codespan",raw:t[0],text:n}}},t.br=function(e){var t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}},t.del=function(e){var t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[1]}},t.autolink=function(e,t){var n,r,i=this.rules.inline.autolink.exec(e);if(i)return r="@"===i[2]?"mailto:"+(n=N(this.options.mangle?t(i[1]):i[1])):n=N(i[1]),{type:"link",raw:i[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}},t.url=function(e,t){var n;if(n=this.rules.inline.url.exec(e)){var r,i;if("@"===n[2])i="mailto:"+(r=N(this.options.mangle?t(n[0]):n[0]));else{var o;do{o=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(o!==n[0]);r=N(n[0]),i="www."===n[1]?"http://"+r:r}return{type:"link",raw:n[0],text:r,href:i,tokens:[{type:"text",raw:r,text:r}]}}},t.inlineText=function(e,t,n){var r,i=this.rules.inline.text.exec(e);if(i)return r=t?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):N(i[0]):i[0]:N(this.options.smartypants?n(i[0]):i[0]),{type:"text",raw:i[0],text:r}},e}(),j=S,$=T,B=x,V={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:j,table:j,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};V.def=$(V.def).replace("label",V._label).replace("title",V._title).getRegex(),V.bullet=/(?:[*+-]|\d{1,9}[.)])/,V.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,V.item=$(V.item,"gm").replace(/bull/g,V.bullet).getRegex(),V.list=$(V.list).replace(/bull/g,V.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+V.def.source+")").getRegex(),V._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",V._comment=//,V.html=$(V.html,"i").replace("comment",V._comment).replace("tag",V._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),V.paragraph=$(V._paragraph).replace("hr",V.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|!--)").replace("tag",V._tag).getRegex(),V.blockquote=$(V.blockquote).replace("paragraph",V.paragraph).getRegex(),V.normal=B({},V),V.gfm=B({},V.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),V.gfm.nptable=$(V.gfm.nptable).replace("hr",V.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|!--)").replace("tag",V._tag).getRegex(),V.gfm.table=$(V.gfm.table).replace("hr",V.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|!--)").replace("tag",V._tag).getRegex(),V.pedantic=B({},V.normal,{html:$("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",V._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:j,paragraph:$(V.normal._paragraph).replace("hr",V.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",V.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var G={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:j,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:j,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~"};G.punctuation=$(G.punctuation).replace(/punctuation/g,G._punctuation).getRegex(),G._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",G._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",G.em.start=$(G.em.start).replace(/punctuation/g,G._punctuation).getRegex(),G.em.middle=$(G.em.middle).replace(/punctuation/g,G._punctuation).replace(/overlapSkip/g,G._overlapSkip).getRegex(),G.em.endAst=$(G.em.endAst,"g").replace(/punctuation/g,G._punctuation).getRegex(),G.em.endUnd=$(G.em.endUnd,"g").replace(/punctuation/g,G._punctuation).getRegex(),G.strong.start=$(G.strong.start).replace(/punctuation/g,G._punctuation).getRegex(),G.strong.middle=$(G.strong.middle).replace(/punctuation/g,G._punctuation).replace(/blockSkip/g,G._blockSkip).getRegex(),G.strong.endAst=$(G.strong.endAst,"g").replace(/punctuation/g,G._punctuation).getRegex(),G.strong.endUnd=$(G.strong.endUnd,"g").replace(/punctuation/g,G._punctuation).getRegex(),G.blockSkip=$(G._blockSkip,"g").getRegex(),G.overlapSkip=$(G._overlapSkip,"g").getRegex(),G._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,G._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,G._email=/[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])?)+(?![-_])/,G.autolink=$(G.autolink).replace("scheme",G._scheme).replace("email",G._email).getRegex(),G._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,G.tag=$(G.tag).replace("comment",V._comment).replace("attribute",G._attribute).getRegex(),G._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,G._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,G._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,G.link=$(G.link).replace("label",G._label).replace("href",G._href).replace("title",G._title).getRegex(),G.reflink=$(G.reflink).replace("label",G._label).getRegex(),G.reflinkSearch=$(G.reflinkSearch,"g").replace("reflink",G.reflink).replace("nolink",G.nolink).getRegex(),G.normal=B({},G),G.pedantic=B({},G.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:$(/^!?\[(label)\]\((.*?)\)/).replace("label",G._label).getRegex(),reflink:$(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",G._label).getRegex()}),G.gfm=B({},G.normal,{escape:$(G.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\.5&&(n="x"+n.toString(16)),r+="&#"+n+";";return r}var K=function(){function t(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||U,this.options.tokenizer=this.options.tokenizer||new L,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var t={block:H.normal,inline:q.normal};this.options.pedantic?(t.block=H.pedantic,t.inline=q.pedantic):this.options.gfm&&(t.block=H.gfm,this.options.breaks?t.inline=q.breaks:t.inline=q.gfm),this.tokenizer.rules=t}t.lex=function(e,n){return new t(n).lex(e)};var n,r,i,o=t.prototype;return o.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(e,this.tokens,!0),this.inline(this.tokens),this.tokens},o.blockTokens=function(e,t,n){var r,i,o,a;for(void 0===t&&(t=[]),void 0===n&&(n=!0),e=e.replace(/^ +$/gm,"");e;)if(r=this.tokenizer.space(e))e=e.substring(r.raw.length),r.type&&t.push(r);else if(r=this.tokenizer.code(e,t))e=e.substring(r.raw.length),r.type?t.push(r):((a=t[t.length-1]).raw+="\n"+r.raw,a.text+="\n"+r.text);else if(r=this.tokenizer.fences(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.heading(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.nptable(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.hr(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.blockquote(e))e=e.substring(r.raw.length),r.tokens=this.blockTokens(r.text,[],n),t.push(r);else if(r=this.tokenizer.list(e)){for(e=e.substring(r.raw.length),o=r.items.length,i=0;i0)for(;null!=(a=this.tokenizer.rules.inline.reflinkSearch.exec(s));)l.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(a=this.tokenizer.rules.inline.blockSkip.exec(s));)s=s.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;e;)if(o=this.tokenizer.escape(e))e=e.substring(o.raw.length),t.push(o);else if(o=this.tokenizer.tag(e,n,r))e=e.substring(o.raw.length),n=o.inLink,r=o.inRawBlock,t.push(o);else if(o=this.tokenizer.link(e))e=e.substring(o.raw.length),"link"===o.type&&(o.tokens=this.inlineTokens(o.text,[],!0,r)),t.push(o);else if(o=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(o.raw.length),"link"===o.type&&(o.tokens=this.inlineTokens(o.text,[],!0,r)),t.push(o);else if(o=this.tokenizer.strong(e,s,i))e=e.substring(o.raw.length),o.tokens=this.inlineTokens(o.text,[],n,r),t.push(o);else if(o=this.tokenizer.em(e,s,i))e=e.substring(o.raw.length),o.tokens=this.inlineTokens(o.text,[],n,r),t.push(o);else if(o=this.tokenizer.codespan(e))e=e.substring(o.raw.length),t.push(o);else if(o=this.tokenizer.br(e))e=e.substring(o.raw.length),t.push(o);else if(o=this.tokenizer.del(e))e=e.substring(o.raw.length),o.tokens=this.inlineTokens(o.text,[],n,r),t.push(o);else if(o=this.tokenizer.autolink(e,Y))e=e.substring(o.raw.length),t.push(o);else if(n||!(o=this.tokenizer.url(e,Y))){if(o=this.tokenizer.inlineText(e,r,W))e=e.substring(o.raw.length),i=o.raw.slice(-1),t.push(o);else if(e){var c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}throw new Error(c)}}else e=e.substring(o.raw.length),t.push(o);return t},n=t,i=[{key:"rules",get:function(){return{block:H,inline:q}}}],(r=null)&&e(n.prototype,r),i&&e(n,i),t}(),Q=r.defaults,X=k,J=w,Z=function(){function e(e){this.options=e||Q}var t=e.prototype;return t.code=function(e,t,n){var r=(t||"").match(/\S*/)[0];if(this.options.highlight){var i=this.options.highlight(e,r);null!=i&&i!==e&&(n=!0,e=i)}return r?'
'+(n?e:J(e,!0))+"
\n":"
"+(n?e:J(e,!0))+"
\n"},t.blockquote=function(e){return"
\n"+e+"
\n"},t.html=function(e){return e},t.heading=function(e,t,n,r){return this.options.headerIds?"'+e+"\n":""+e+"\n"},t.hr=function(){return this.options.xhtml?"
\n":"
\n"},t.list=function(e,t,n){var r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"\n"},t.listitem=function(e){return"
  • "+e+"
  • \n"},t.checkbox=function(e){return" "},t.paragraph=function(e){return"

    "+e+"

    \n"},t.table=function(e,t){return t&&(t=""+t+""),"\n\n"+e+"\n"+t+"
    \n"},t.tablerow=function(e){return"\n"+e+"\n"},t.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' align="'+t.align+'">':"<"+n+">")+e+"\n"},t.strong=function(e){return""+e+""},t.em=function(e){return""+e+""},t.codespan=function(e){return""+e+""},t.br=function(){return this.options.xhtml?"
    ":"
    "},t.del=function(e){return""+e+""},t.link=function(e,t,n){if(null===(e=X(this.options.sanitize,this.options.baseUrl,e)))return n;var r='"},t.image=function(e,t,n){if(null===(e=X(this.options.sanitize,this.options.baseUrl,e)))return n;var r=''+n+'":">"},t.text=function(e){return e},e}(),ee=function(){function e(){}var t=e.prototype;return t.strong=function(e){return e},t.em=function(e){return e},t.codespan=function(e){return e},t.del=function(e){return e},t.html=function(e){return e},t.text=function(e){return e},t.link=function(e,t,n){return""+n},t.image=function(e,t,n){return""+n},t.br=function(){return""},e}(),te=function(){function e(){this.seen={}}return e.prototype.slug=function(e){var t=e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(t)){var n=t;do{this.seen[n]++,t=n+"-"+this.seen[n]}while(this.seen.hasOwnProperty(t))}return this.seen[t]=0,t},e}(),ne=r.defaults,re=E,ie=function(){function e(e){this.options=e||ne,this.options.renderer=this.options.renderer||new Z,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ee,this.slugger=new te}e.parse=function(t,n){return new e(n).parse(t)};var t=e.prototype;return t.parse=function(e,t){void 0===t&&(t=!0);var n,r,i,o,a,s,l,c,u,h,p,f,d,m,g,y,v,_,b="",w=e.length;for(n=0;n0&&"text"===g.tokens[0].type?(g.tokens[0].text=_+" "+g.tokens[0].text,g.tokens[0].tokens&&g.tokens[0].tokens.length>0&&"text"===g.tokens[0].tokens[0].type&&(g.tokens[0].tokens[0].text=_+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:_}):m+=_),m+=this.parse(g.tokens,d),u+=this.renderer.listitem(m,v,y);b+=this.renderer.list(u,p,f);continue;case"html":b+=this.renderer.html(h.text);continue;case"paragraph":b+=this.renderer.paragraph(this.parseInline(h.tokens));continue;case"text":for(u=h.tokens?this.parseInline(h.tokens):h.text;n+1An error occurred:

    "+se(e.message+"",!0)+"
    ";throw e}}return he.options=he.setOptions=function(e){return oe(he.defaults,e),ce(he.defaults),he},he.getDefaults=le,he.defaults=ue,he.use=function(e){var t=oe({},e);if(e.renderer&&function(){var n=he.defaults.renderer||new Z,r=function(t){var r=n[t];n[t]=function(){for(var i=arguments.length,o=new Array(i),a=0;at.reject(e.error||e)),document.body.appendChild(n),t}async function injectCss(e){const t=future(),n=document.createElement("link");return n.href=e,n.rel="stylesheet",n.addEventListener("load",t.resolve),n.addEventListener("error",e=>t.reject(e.error||e)),document.body.appendChild(n),t}function fallbackCopyTextToClipboard(e){var t=document.createElement("textarea");t.value=e,t.style.top="0",t.style.left="0",t.style.position="fixed",document.body.appendChild(t),t.focus(),t.select();try{var n=document.execCommand("copy")?"successful":"unsuccessful";console.log("Fallback: Copying text command was "+n)}catch(e){console.error("Fallback: Oops, unable to copy",e)}document.body.removeChild(t)}async function copyTextToClipboard(e){return navigator.clipboard?navigator.clipboard.writeText(e).then((function(){console.log("Async: Copying to clipboard was successful!")}),(function(e){console.error("Async: Could not copy text: ",e)})):fallbackCopyTextToClipboard(e)}function generateStaticLinkFragment(e){return"/static?t="+encodeURIComponent(e)}function generateStaticLink(e){return document.location.protocol+"//"+document.location.host+"#"+generateStaticLinkFragment(e)}var sizeMap={small:16,medium:32,large:64};function getSvgProps(e){var t=e["aria-label"],n=e.className,r=e.size,i=e.verticalAlign,o=e.svgDataByHeight,a=sizeMap[r]||r,s=closestNaturalHeight(Object.keys(o),a),l=o[s].width;return{"aria-hidden":t?"false":"true","aria-label":t,role:"img",className:n,viewBox:"0 0 "+l+" "+s,width:a*(l/s),height:a,fill:"currentColor",style:{display:"inline-block",userSelect:"none",verticalAlign:i},dangerouslySetInnerHTML:{__html:o[s].path}}}function closestNaturalHeight(e,t){return e.map((function(e){return parseInt(e,10)})).reduce((function(e,n){return n<=t?n:e}),e[0])}var _extends$1=Object.assign||function(e){for(var t=1;t'},24:{width:24,path:''}}})))}function DownloadIcon(e){return react.createElement("svg",getSvgProps(_extends$1({},e,{svgDataByHeight:{16:{width:16,path:''},24:{width:24,path:''}}})))}function LinkIcon(e){return react.createElement("svg",getSvgProps(_extends$1({},e,{svgDataByHeight:{16:{width:16,path:''},24:{width:24,path:''}}})))}function MarkGithubIcon(e){return react.createElement("svg",getSvgProps(_extends$1({},e,{svgDataByHeight:{16:{width:16,path:''}}})))}function RepoForkedIcon(e){return react.createElement("svg",getSvgProps(_extends$1({},e,{svgDataByHeight:{16:{width:16,path:''}}})))}function ShareAndroidIcon(e){return react.createElement("svg",getSvgProps(_extends$1({},e,{svgDataByHeight:{16:{width:16,path:''},24:{width:24,path:''}}})))}function download(e,t){var n=document.createElement("a");n.setAttribute("href",URL.createObjectURL(new Blob([t],{type:"image/svg+xml"}))),n.setAttribute("download",e),n.style.display="none",document.body.appendChild(n),n.click(),document.body.removeChild(n)}function DownloadSvg(e){const t=react_7(null);return react.createElement(react.Fragment,null,"dangerouslySetInnerHTML"in e?react.createElement("div",{ref:t,dangerouslySetInnerHTML:e.dangerouslySetInnerHTML}):react.createElement("div",{ref:t},e.children),react.createElement("button",{className:"btn btn-sm btn-link",onClick:function(){download("diagram.svg",("children"in e?'\n\n':"")+t.current.innerHTML)},style:{fontSize:12}},react.createElement(DownloadIcon,{size:16}),"Download SVG"))}AlertIcon.defaultProps={className:"octicon",size:16,verticalAlign:"text-bottom"},DownloadIcon.defaultProps={className:"octicon",size:16,verticalAlign:"text-bottom"},LinkIcon.defaultProps={className:"octicon",size:16,verticalAlign:"text-bottom"},MarkGithubIcon.defaultProps={className:"octicon",size:16,verticalAlign:"text-bottom"},RepoForkedIcon.defaultProps={className:"octicon",size:16,verticalAlign:"text-bottom"},ShareAndroidIcon.defaultProps={className:"octicon",size:16,verticalAlign:"text-bottom"};const monospaceFont='Menlo, Monaco, "Courier New", monospace',font="14px "+monospaceFont,DIAGRAM_MARGIN=10,ACTOR_MARGIN=10,ACTOR_PADDING=10,SIGNAL_MARGIN=5,SIGNAL_PADDING=5,NOTE_MARGIN=10,NOTE_PADDING=5,NOTE_OVERLAP=15,TITLE_MARGIN=0,TITLE_PADDING=5,SELF_SIGNAL_WIDTH=20,ALIGN_LEFT=0,ALIGN_CENTER=1,ALIGN_HORIZONTAL_CENTER=2,ALIGN_VERTICAL_CENTER=3,can=document.createElement("canvas"),ctx=can.getContext("2d");function textBBox(e,t){ctx.font=t||font;const n=ctx.measureText(e);return Object.assign(n,{height:n.actualBoundingBoxDescent+n.actualBoundingBoxAscent})}class AssertException extends Error{toString(){return"AssertException: "+this.message}}function assert(e,t){if(!e)throw new AssertException(t)}function layout(e){if(e.signalsHeight_=0,e.actorsHeight_=0,e.width=0,e.height=0,e.title){e.title_={};var t=e.title_,n=textBBox(e.title);t.textBB=n,t.message=e.title,t.width=n.width+2*(TITLE_PADDING+TITLE_MARGIN),t.height=n.height+2*(TITLE_PADDING+TITLE_MARGIN),t.x=DIAGRAM_MARGIN,t.y=DIAGRAM_MARGIN,e.width+=t.width,e.height+=t.height}function r(t,n,r){if(assert(t=e.actors.length){const n=e.actors[t];n.paddingRight=0|Math.max(r,n.paddingRight||0)}else{const i=e.actors[t];i.distances[n]=0|Math.max(r,i.distances[n]?i.distances[n]:0)}}e.actors.forEach(t=>{var n=textBBox(t.name);t.textBB=n,t.x=0,t.y=0,t.width=n.width+2*(ACTOR_PADDING+ACTOR_MARGIN),t.height=n.height+2*(ACTOR_PADDING+ACTOR_MARGIN),t.distances=[],t.paddingRight=0,e.actorsHeight_=0|Math.max(t.height,e.actorsHeight_||0)}),e.signals.forEach(t=>{var n,i,o=textBBox(t.message);t.textBB=o,t.width=o.width,t.height=o.height;var a=0;if("Signal"==t.type)t.width+=2*(SIGNAL_MARGIN+SIGNAL_PADDING),t.height+=2*(SIGNAL_MARGIN+SIGNAL_PADDING),t.isSelf()?(i=(n=t.actorA.index)+1,t.width+=SELF_SIGNAL_WIDTH):(n=Math.min(t.actorA.index,t.actorB.index),i=Math.max(t.actorA.index,t.actorB.index));else if("Note"==t.type)if(t.width+=2*(NOTE_MARGIN+NOTE_PADDING),t.height+=2*(NOTE_MARGIN+NOTE_PADDING),a=2*ACTOR_MARGIN,t.placement==Diagram.PLACEMENT.LEFTOF)n=(i=t.actor.index)-1;else if(t.placement==Diagram.PLACEMENT.RIGHTOF)i=(n=t.actor.index)+1;else if(t.placement==Diagram.PLACEMENT.OVER&&t.hasManyActors())n=Math.min(t.actor[0].index,t.actor[1].index),i=Math.max(t.actor[0].index,t.actor[1].index),a=-(2*NOTE_PADDING+2*NOTE_OVERLAP);else if(t.placement==Diagram.PLACEMENT.OVER)return r((n=t.actor.index)-1,n,t.width/2),r(n,n+1,t.width/2),void(e.signalsHeight_+=t.height);r(n,i,t.width+a),e.signalsHeight_+=t.height});var i=0;e.actors.forEach(t=>{t.x=Math.max(i,t.x),t.distances.forEach((n,r)=>{if(void 0===n)return;const i=e.actors[r];n=0|Math.max(n,t.width/2,i.width/2),i.x=0|Math.max(i.x,t.x+t.width/2+n-i.width/2)}),i=t.x+t.width+t.paddingRight}),e.width=Math.max(i,e.width),e.width+=2*DIAGRAM_MARGIN,e.height+=2*DIAGRAM_MARGIN+2*e.actorsHeight_+e.signalsHeight_}async function initializeDiagrams(){await injectScript("bower_components/underscore/underscore-min.js"),await injectScript("bower_components/js-sequence-diagrams/dist/sequence-diagram-min.js")}function Line(e){return react.createElement("line",{x1:0|e.x1,x2:0|e.x2,y1:0|e.y1,y2:0|e.y2,style:{strokeWidth:"2px"},stroke:"#000000",fill:"none",strokeDasharray:void 0===e.linetype?void 0:e.linetype===Diagram.LINETYPE.DOTTED?"6px, 2px":void 0,markerEnd:void 0===e.arrowhead?void 0:e.arrowhead==Diagram.ARROWTYPE.FILLED?"url(#markerArrowBlock)":"url(#markerArrowOpen)"})}function Rect(e){return react.createElement("rect",{x:0|e.x,y:0|e.y,width:0|e.width,height:0|e.height,style:{strokeWidth:"2px"},stroke:"#000000",fill:"#ffffff"})}function Text(e){var t=textBBox(e.text,e.font),n=e.x,r=e.y;return e.align!=ALIGN_CENTER&&e.align!=ALIGN_HORIZONTAL_CENTER||(n-=t.width/2),e.align!=ALIGN_CENTER&&e.align!=ALIGN_VERTICAL_CENTER||(r-=t.height/2),r+=t.height,react.createElement("text",{x:0|n,y:0|r,style:{font:e.font},textAnchor:"start"},react.createElement("tspan",{x:0|n,y:0|r},e.text))}function getCenterX(e){return e.x+e.width/2}function getCenterY(e){return e.y+e.height/2}function TextBox(e){var t=e.box.x+e.margin,n=e.box.y+e.margin,r=e.box.width-2*e.margin,i=e.box.height-2*e.margin;const o=react.createElement(Rect,{x:t,y:n,width:r,height:i});return e.align==ALIGN_CENTER?(t=getCenterX(e.box),n=getCenterY(e.box)):(t+=e.padding,n+=e.padding),react.createElement(react.Fragment,null,o,react.createElement(Text,{x:t,y:n,text:e.text,font:e.font,align:e.align}))}function ActorSVG(e){return e.actor.y=e.offsetY,e.actor.height=e.height,react.createElement(TextBox,{box:e.actor,text:e.actor.name,margin:ACTOR_MARGIN,padding:ACTOR_PADDING,font:e.font,align:ALIGN_CENTER})}function RenderDiagram(e){const{diagram:t}=e;if(!t)return react.createElement("div",null,"Empty diagram");var n=0;const r=[];return t.actors.map((function(e){r.push(react.createElement(ActorSVG,{actor:e,offsetY:n,height:t.actorsHeight_,font:font,key:r.length})),r.push(react.createElement(ActorSVG,{actor:e,offsetY:n+t.actorsHeight_+t.signalsHeight_,height:t.actorsHeight_,font:font,key:r.length}));var i=getCenterX(e);r.push(react.createElement(Line,{x1:i,y1:n+t.actorsHeight_-ACTOR_MARGIN,x2:i,y2:n+t.actorsHeight_+ACTOR_MARGIN+t.signalsHeight_,key:r.length}))})),n+=t.actorsHeight_,t.signals.forEach((function(e){"Signal"==e.type?e.isSelf()?function(e){assert(e.isSelf(),"signal must be a self signal");var t=e.textBB,i=getCenterX(e.actorA),o=n+SIGNAL_MARGIN+SIGNAL_PADDING,a=o+e.height-2*SIGNAL_MARGIN-SIGNAL_PADDING;r.push(react.createElement(Line,{x1:i,y1:o,x2:i+SELF_SIGNAL_WIDTH,y2:o,linetype:e.linetype,key:r.length})),r.push(react.createElement(Line,{x1:i+SELF_SIGNAL_WIDTH,y1:o,x2:i+SELF_SIGNAL_WIDTH,y2:a,linetype:e.linetype,key:r.length})),r.push(react.createElement(Line,{x1:i+SELF_SIGNAL_WIDTH,y1:a,x2:i,y2:a,linetype:e.linetype,arrowhead:e.arrowtype,key:r.length}));var s=i+SELF_SIGNAL_WIDTH+SIGNAL_PADDING,l=(a-o-t.height)/2;r.push(react.createElement(Text,{x:s,y:o+l,text:e.message,font:font,align:ALIGN_LEFT,key:r.length}))}(e):function(e){var t=getCenterX(e.actorA),i=getCenterX(e.actorB),o=(i-t)/2+t,a=n+SIGNAL_MARGIN+SIGNAL_PADDING;r.push(react.createElement(Text,{x:o,y:a,text:e.message,font:font,align:ALIGN_HORIZONTAL_CENTER,key:r.length})),a=n+e.height-SIGNAL_PADDING,r.push(react.createElement(Line,{x1:t,y1:a,x2:i,y2:a,linetype:e.linetype,arrowhead:e.arrowtype,key:r.length}))}(e):"Note"==e.type&&function(e){e.y=n;var t=getCenterX(e.hasManyActors()?e.actor[0]:e.actor);switch(e.placement){case Diagram.PLACEMENT.RIGHTOF:e.x=t+ACTOR_MARGIN;break;case Diagram.PLACEMENT.LEFTOF:e.x=t-ACTOR_MARGIN-e.width;break;case Diagram.PLACEMENT.OVER:if(e.hasManyActors()){var i=getCenterX(e.actor[1]),o=NOTE_OVERLAP+NOTE_PADDING;e.x=Math.min(t,i)-o,e.width=Math.max(t,i)+o-e.x}else e.x=t-e.width/2;break;default:throw new Error("Unhandled note placement: "+e.placement)}r.push(react.createElement(TextBox,{box:e,text:e.message,margin:NOTE_MARGIN,padding:NOTE_PADDING,font:font,align:ALIGN_LEFT,key:r.length}))}(e),n+=e.height})),react.createElement(DownloadSvg,null,react.createElement("svg",{width:0|t.width,height:0|t.height,xmlns:"http://www.w3.org/2000/svg"},react.createElement("defs",null,react.createElement("marker",{viewBox:"0 0 5 5",markerWidth:"5",markerHeight:"5",orient:"auto",refX:"5",refY:"2.5",id:"markerArrowBlock"},react.createElement("path",{d:"M 0 0 L 5 2.5 L 0 5 z"})),react.createElement("marker",{viewBox:"0 0 9.6 16",markerWidth:"4",markerHeight:"16",orient:"auto",refX:"9.6",refY:"8",id:"markerArrowOpen"},react.createElement("path",{d:"M 9.6,8 1.92,16 0,13.7 5.76,8 0,2.286 1.92,0 9.6,8 z"}))),r))}function SequenceDiagram(e){const{input:t,className:n}=e,r=react_7(null),[i,o]=react_6(0),[a,s]=react_6(0),[l,c]=react_6(null),[u,h]=react_6(null);return react_5(()=>{try{const e=Diagram.parse(t.trim().replace(/^sequenceDiagram[\s\n\r]*/,""));layout(e),o(e.width),s(e.height),c(null),h(e)}catch(e){c(e.toString())}},[t,r]),l?react.createElement("pre",{className:n},l):react.createElement("div",{className:n,style:{width:i,height:a+32},ref:r},react.createElement(RenderDiagram,{diagram:u}))}window.Snap={};const DEFAULT_EXAMPLE='\n# Collaborative diagrams tool\n\n## This editor works with live collaboration, like Google Docs\n\nOnce you get an editable link, you can share it, and multiple users can edit the same document.\n\nWe use it for architecture discussions and planning with my team, it helps a lot because now that all of us are remote.\n\n## How to use it?\n\n1. Click in "Make a copy" in the top bar\n2. Edit the document created for you! Share the link to start collaborating.\n\n## What can we do with this tool?\n\n### Sequence diagrams\n\n```sequence\nAndrew->China: Says Hello\nNote right of China: China thinks about it\nChina--\x3eAndrew: How are you?\nAndrew->>China: I am good thanks!\n```\n\n### Graphviz\n\n```dot\ndigraph G {\n\n\tsubgraph cluster_0 {\n\t\tstyle=filled;\n\t\tcolor=lightgrey;\n\t\tnode [style=filled,color=white];\n\t\ta0 -> a1 -> a2 -> a3;\n\t\tlabel = "process #1";\n\t}\n\n\tsubgraph cluster_1 {\n\t\tnode [style=filled];\n\t\tb0 -> b1 -> b2 -> b3;\n\t\tlabel = "process #2";\n\t\tcolor=blue\n\t}\n\tstart -> a0;\n\tstart -> b0;\n\ta1 -> b3;\n\tb2 -> a3;\n\ta3 -> a0;\n\ta3 -> end;\n\tb3 -> end;\n\n\tstart [shape=Mdiamond];\n\tend [shape=Msquare];\n}\n```\n\n### This is another title with a sequence diagram\n\n```sequence\nTitle: Here is a title\nA->B: Normal line\nB--\x3eC: Dashed line\nC->>D: Open arrow\nD--\x3e>A: Dashed open arrow\n```\n\n### Add notes\n\n```sequence\n# Example of a comment.\nNote left of A: Note to the left of A\nNote right of A: Note to the right of A\nNote over A: Note over A\nNote over A,B: Note over both A and B\n```\n\n### Specify participants\n\n```sequence\nparticipant C\nparticipant B\nparticipant A\nNote right of A: By listing the participants you can change their order\n```\n\n### Code example:\n\n```javascript\n// this example generates a static link to use with this site\n\nconst content = "# this is a title\\n .. put sequences, .dot files or markdown in here ..";\n\nfunction generateStaticLink(content) {\n return `https://diagrams.menduz.com/#/static?t=${encodeURIComponent(content)}`;\n}\n\nconsole.log(generateStaticLink(content));\n```\n\n### Attributions\n\n- Sequence diagrams parser & syntax: https://bramp.github.io/js-sequence-diagrams/\n- Firepad: https://github.com/FirebaseExtended/firepad\n\n### Contact & feedback\n\nYou can contact me on https://twitter.com/@menduz\n\n### Help me pay the hosting\n\nIf you want to help with the expenses of the site, here is my Ethereum address, anything you send is more than welcome:\n\n```\nmenduz.eth - 0xf2f58ed9Ab3057838d88D06be8269270cDc8Aa89\n```\n\nThanks and enjoy!\n\n';function closeMenu(){document.querySelectorAll(".dropdown[open]").forEach(e=>{e.removeAttribute("open")})}function DropdownShare(e){return react.createElement("details",{className:"dropdown details-reset details-overlay d-inline-block mr-2"},react.createElement("summary",{className:"btn "+e.className,"aria-haspopup":"true"},e.label,react.createElement("div",{className:"dropdown-caret"})),react.createElement("ul",{className:"dropdown-menu dropdown-menu-sw",style:{width:200}},e.children))}var lottie=createCommonjsModule((function(module){"undefined"!=typeof navigator&&function(e,t){module.exports?module.exports=t(e):(e.lottie=t(e),e.bodymovin=e.lottie)}(window||{},(function(window){var svgNS="http://www.w3.org/2000/svg",locationHref="",initialDefaultFrame=-999999,subframeEnabled=!0,expressionsPlugin,isSafari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),bm_pow=Math.pow,bm_sqrt=Math.sqrt,bm_floor=Math.floor,bm_max=Math.max,bm_min=Math.min,BMMath={};function ProjectInterface(){return{}}!function(){var e,t=["abs","acos","acosh","asin","asinh","atan","atanh","atan2","ceil","cbrt","expm1","clz32","cos","cosh","exp","floor","fround","hypot","imul","log","log1p","log2","log10","max","min","pow","random","round","sign","sin","sinh","sqrt","tan","tanh","trunc","E","LN10","LN2","LOG10E","LOG2E","PI","SQRT1_2","SQRT2"],n=t.length;for(e=0;e1?n[1]=1:n[1]<=0&&(n[1]=0),HSVtoRGB(n[0],n[1],n[2])}function addBrightnessToRGB(e,t){var n=RGBtoHSV(255*e[0],255*e[1],255*e[2]);return n[2]+=t,n[2]>1?n[2]=1:n[2]<0&&(n[2]=0),HSVtoRGB(n[0],n[1],n[2])}function addHueToRGB(e,t){var n=RGBtoHSV(255*e[0],255*e[1],255*e[2]);return n[0]+=t/360,n[0]>1?n[0]-=1:n[0]<0&&(n[0]+=1),HSVtoRGB(n[0],n[1],n[2])}var rgbToHex=function(){var e,t,n=[];for(e=0;e<256;e+=1)t=e.toString(16),n[e]=1==t.length?"0"+t:t;return function(e,t,r){return e<0&&(e=0),t<0&&(t=0),r<0&&(r=0),"#"+n[e]+n[t]+n[r]}}();function BaseEvent(){}BaseEvent.prototype={triggerEvent:function(e,t){if(this._cbs[e])for(var n=this._cbs[e].length,r=0;r0||e>-1e-6&&e<0?r(1e4*e)/1e4:e}function R(){var e=this.props;return"matrix("+D(e[0])+","+D(e[1])+","+D(e[4])+","+D(e[5])+","+D(e[12])+","+D(e[13])+")"}return function(){this.reset=i,this.rotate=o,this.rotateX=a,this.rotateY=s,this.rotateZ=l,this.skew=u,this.skewFromAxis=h,this.shear=c,this.scale=p,this.setTransform=f,this.translate=d,this.transform=m,this.applyToPoint=b,this.applyToX=w,this.applyToY=E,this.applyToZ=T,this.applyToPointArray=P,this.applyToTriplePoints=C,this.applyToPointStringified=A,this.toCSS=I,this.to2dCSS=R,this.clone=v,this.cloneFromProps=_,this.equals=y,this.inversePoints=x,this.inversePoint=S,this.getInverseMatrix=k,this._t=this.transform,this.isIdentity=g,this._identity=!0,this._identityCalculated=!1,this.props=createTypedArray("float32",16),this.reset()}}(); -/*! - Transformation Matrix v2.0 - (c) Epistemex 2014-2015 - www.epistemex.com - By Ken Fyrstenberg - Contributions by leeoniya. - License: MIT, header required. - */!function(e,t){var n=this,r=t.pow(256,6),i=t.pow(2,52),o=2*i;function a(e){var t,n=e.length,r=this,i=0,o=r.i=r.j=0,a=r.S=[];for(n||(e=[n++]);i<256;)a[i]=i++;for(i=0;i<256;i++)a[i]=a[o=255&o+e[i%n]+(t=a[i])],a[o]=t;r.g=function(e){for(var t,n=0,i=r.i,o=r.j,a=r.S;e--;)t=a[i=255&i+1],n=256*n+a[255&(a[i]=a[o=255&o+t])+(a[o]=t)];return r.i=i,r.j=o,n}}function s(e,t){return t.i=e.i,t.j=e.j,t.S=e.S.slice(),t}function l(e,t){for(var n,r=e+"",i=0;i=o;)e/=2,t/=2,n>>>=1;return(e+n)/t};return g.int32=function(){return 0|m.g(4)},g.quick=function(){return m.g(4)/4294967296},g.double=g,l(c(m.S),e),(h.pass||p||function(e,n,r,i){return i&&(i.S&&s(i,m),e.state=function(){return s(m,{})}),r?(t.random=e,n):e})(g,d,"global"in h?h.global:this==t,h.state)},l(t.random(),e)}([],BMMath);var BezierFactory=function(){var e={getBezierEasing:function(e,n,r,i,o){var a=o||("bez_"+e+"_"+n+"_"+r+"_"+i).replace(/\./g,"p");if(t[a])return t[a];var s=new l([e,n,r,i]);return t[a]=s,s}},t={};var n="function"==typeof Float32Array;function r(e,t){return 1-3*t+3*e}function i(e,t){return 3*t-6*e}function o(e){return 3*e}function a(e,t,n){return((r(t,n)*e+i(t,n))*e+o(t))*e}function s(e,t,n){return 3*r(t,n)*e*e+2*i(t,n)*e+o(t)}function l(e){this._p=e,this._mSampleValues=n?new Float32Array(11):new Array(11),this._precomputed=!1,this.get=this.get.bind(this)}return l.prototype={get:function(e){var t=this._p[0],n=this._p[1],r=this._p[2],i=this._p[3];return this._precomputed||this._precompute(),t===n&&r===i?e:0===e?0:1===e?1:a(this._getTForX(e),n,i)},_precompute:function(){var e=this._p[0],t=this._p[1],n=this._p[2],r=this._p[3];this._precomputed=!0,e===t&&n===r||this._calcSampleValues()},_calcSampleValues:function(){for(var e=this._p[0],t=this._p[2],n=0;n<11;++n)this._mSampleValues[n]=a(.1*n,e,t)},_getTForX:function(e){for(var t=this._p[0],n=this._p[2],r=this._mSampleValues,i=0,o=1;10!==o&&r[o]<=e;++o)i+=.1;var l=i+.1*((e-r[--o])/(r[o+1]-r[o])),c=s(l,t,n);return c>=.001?function(e,t,n,r){for(var i=0;i<4;++i){var o=s(t,n,r);if(0===o)return t;t-=(a(t,n,r)-e)/o}return t}(e,l,t,n):0===c?l:function(e,t,n,r,i){var o,s,l=0;do{(o=a(s=t+(n-t)/2,r,i)-e)>0?n=s:t=s}while(Math.abs(o)>1e-7&&++l<10);return s}(e,i,i+.1,t,n)}},e}();function extendPrototype(e,t){var n,r,i=e.length;for(n=0;n-.001&&a<.001}var t=function(e,t,n,r){var i,o,a,s,l,c,u=defaultCurveSegments,h=0,p=[],f=[],d=bezier_length_pool.newElement();for(a=n.length,i=0;ia?-1:1,c=!0;c;)if(r[o]<=a&&r[o+1]>a?(s=(a-r[o])/(r[o+1]-r[o]),c=!1):o+=l,o<0||o>=i-1){if(o===i-1)return n[o];c=!1}return n[o]+(n[o+1]-n[o])*s}var s=createTypedArray("float32",8);return{getSegmentsLength:function(e){var n,r=segments_length_pool.newElement(),i=e.c,o=e.v,a=e.o,s=e.i,l=e._length,c=r.lengths,u=0;for(n=0;n1?1:i,l),h=a(o=o>1?1:o,l),p=e.length,f=1-u,d=1-h,m=f*f*f,g=u*f*f*3,y=u*u*f*3,v=u*u*u,_=f*f*d,b=u*f*d+f*u*d+f*f*h,w=u*u*d+f*u*h+u*f*h,E=u*u*h,T=f*d*d,k=u*d*d+f*h*d+f*d*h,S=u*h*d+f*h*h+u*d*h,x=u*h*h,C=d*d*d,P=h*d*d+d*h*d+d*d*h,A=h*h*d+d*h*h+h*d*h,I=h*h*h;for(c=0;cp?h>f?h-p-f:f-p-h:f>p?f-p-h:p-h-f)>-1e-4&&u<1e-4}}}!function(){for(var e=0,t=["ms","moz","webkit","o"],n=0;n=0;t-=1)if("sh"==e[t].ty)if(e[t].ks.k.i)r(e[t].ks.k);else for(o=e[t].ks.k.length,i=0;in[0]||!(n[0]>e[0])&&(e[1]>n[1]||!(n[1]>e[1])&&(e[2]>n[2]||!(n[2]>e[2])&&void 0))}var o,a=function(){var e=[4,4,14];function t(e){var t,n,r,i=e.length;for(t=0;t=0;n-=1)if("sh"==e[n].ty)if(e[n].ks.k.i)e[n].ks.k.c=e[n].closed;else for(i=e[n].ks.k.length,r=0;r0&&(u=!1),u){var h=createTag("style");h.setAttribute("f-forigin",o[i].fOrigin),h.setAttribute("f-origin",o[i].origin),h.setAttribute("f-family",o[i].fFamily),h.type="text/css",h.innerHTML="@font-face {font-family: "+o[i].fFamily+"; font-style: normal; src: url('"+o[i].fPath+"');}",t.appendChild(h)}}else if("g"===o[i].fOrigin||1===o[i].origin){for(l=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),c=0;c=a.t-i){o.h&&(o=a),f=0;break}if(a.t-i>e){f=d;break}d=v||e<_){var w=e>=v?b.points.length-1:0;for(l=b.points[w].point.length,s=0;s=k&&T=v)n[0]=y[0],n[1]=y[1],n[2]=y[2];else if(e<=_)n[0]=o.s[0],n[1]=o.s[1],n[2]=o.s[2];else{!function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=Math.atan2(2*r*o-2*n*i,1-2*r*r-2*i*i),s=Math.asin(2*n*r+2*i*o),l=Math.atan2(2*n*o-2*r*i,1-2*n*n-2*i*i);e[0]=a/degToRads,e[1]=s/degToRads,e[2]=l/degToRads}(n,function(e,t,n){var r,i,o,a,s,l=[],c=e[0],u=e[1],h=e[2],p=e[3],f=t[0],d=t[1],m=t[2],g=t[3];(i=c*f+u*d+h*m+p*g)<0&&(i=-i,f=-f,d=-d,m=-m,g=-g);1-i>1e-6?(r=Math.acos(i),o=Math.sin(r),a=Math.sin((1-n)*r)/o,s=Math.sin(n*r)/o):(a=1-n,s=n);return l[0]=a*c+s*f,l[1]=a*u+s*d,l[2]=a*h+s*m,l[3]=a*p+s*g,l}(r(o.s),r(y),(e-_)/(v-_)))}else for(d=0;d=v?c=1:e<_?c=0:(o.o.x.constructor===Array?(o.__fnct||(o.__fnct=[]),o.__fnct[d]?p=o.__fnct[d]:(S=void 0===o.o.x[d]?o.o.x[0]:o.o.x[d],x=void 0===o.o.y[d]?o.o.y[0]:o.o.y[d],C=void 0===o.i.x[d]?o.i.x[0]:o.i.x[d],P=void 0===o.i.y[d]?o.i.y[0]:o.i.y[d],p=BezierFactory.getBezierEasing(S,x,C,P).get,o.__fnct[d]=p)):o.__fnct?p=o.__fnct:(S=o.o.x,x=o.o.y,C=o.i.x,P=o.i.y,p=BezierFactory.getBezierEasing(S,x,C,P).get,o.__fnct=p),c=p((e-_)/(v-_)))),y=a.s||o.e,A=1===o.h?o.s[d]:o.s[d]+(y[d]-o.s[d])*c,"multidimensional"===this.propType?n[d]=A:n=A}return t.lastIndex=f,n}function r(e){var t=e[0]*degToRads,n=e[1]*degToRads,r=e[2]*degToRads,i=Math.cos(t/2),o=Math.cos(n/2),a=Math.cos(r/2),s=Math.sin(t/2),l=Math.sin(n/2),c=Math.sin(r/2);return[s*l*a+i*o*c,s*o*a+i*l*c,i*l*a-s*o*c,i*o*a-s*l*c]}function i(){var t=this.comp.renderedFrame-this.offsetTime,n=this.keyframes[0].t-this.offsetTime,r=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(t===this._caching.lastFrame||this._caching.lastFrame!==e&&(this._caching.lastFrame>=r&&t>=r||this._caching.lastFrame=t&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var i=this.interpolateValue(t,this._caching);this.pv=i}return this._caching.lastFrame=t,this.pv}function o(e){var n;if("unidimensional"===this.propType)n=e*this.mult,t(this.v-n)>1e-5&&(this.v=n,this._mdf=!0);else for(var r=0,i=this.v.length;r1e-5&&(this.v[r]=n,this._mdf=!0),r+=1}function a(){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{this.lock=!0,this._mdf=this._isFirstFrame;var e,t=this.effectsSequence.length,n=this.kf?this.pv:this.data.k;for(e=0;e=this.p.keyframes[this.p.keyframes.length-1].t?(n=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/i,0),r=this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/i,0)):(n=this.p.pv,r=this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/i,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){n=[],r=[];var o=this.px,a=this.py;o._caching.lastFrame+o.offsetTime<=o.keyframes[0].t?(n[0]=o.getValueAtTime((o.keyframes[0].t+.01)/i,0),n[1]=a.getValueAtTime((a.keyframes[0].t+.01)/i,0),r[0]=o.getValueAtTime(o.keyframes[0].t/i,0),r[1]=a.getValueAtTime(a.keyframes[0].t/i,0)):o._caching.lastFrame+o.offsetTime>=o.keyframes[o.keyframes.length-1].t?(n[0]=o.getValueAtTime(o.keyframes[o.keyframes.length-1].t/i,0),n[1]=a.getValueAtTime(a.keyframes[a.keyframes.length-1].t/i,0),r[0]=o.getValueAtTime((o.keyframes[o.keyframes.length-1].t-.01)/i,0),r[1]=a.getValueAtTime((a.keyframes[a.keyframes.length-1].t-.01)/i,0)):(n=[o.pv,a.pv],r[0]=o.getValueAtTime((o._caching.lastFrame+o.offsetTime-.01)/i,o.offsetTime),r[1]=a.getValueAtTime((a._caching.lastFrame+a.offsetTime-.01)/i,a.offsetTime))}else n=r=e;this.v.rotate(-Math.atan2(n[1]-r[1],n[0]-r[0]))}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=this.elem.globalData.frameId}},precalculateMatrix:function(){if(!this.a.k&&(this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1,!this.s.effectsSequence.length)){if(this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2,this.sk){if(this.sk.effectsSequence.length||this.sa.effectsSequence.length)return;this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3}if(this.r){if(this.r.effectsSequence.length)return;this.pre.rotate(-this.r.v),this.appliedTransformations=4}else this.rz.effectsSequence.length||this.ry.effectsSequence.length||this.rx.effectsSequence.length||this.or.effectsSequence.length||(this.pre.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.appliedTransformations=4)}},autoOrient:function(){}},extendPrototype([DynamicPropertyContainer],t),t.prototype.addDynamicProperty=function(e){this._addDynamicProperty(e),this.elem.addDynamicProperty(e),this._isDirty=!0},t.prototype._addDynamicProperty=DynamicPropertyContainer.prototype.addDynamicProperty,{getTransformProperty:function(e,n,r){return new t(e,n,r)}}}();function ShapePath(){this.c=!1,this._length=0,this._maxLength=8,this.v=createSizedArray(this._maxLength),this.o=createSizedArray(this._maxLength),this.i=createSizedArray(this._maxLength)}ShapePath.prototype.setPathData=function(e,t){this.c=e,this.setLength(t);for(var n=0;n=this._maxLength&&this.doubleArrayLength(),n){case"v":o=this.v;break;case"i":o=this.i;break;case"o":o=this.o}(!o[r]||o[r]&&!i)&&(o[r]=point_pool.newElement()),o[r][0]=e,o[r][1]=t},ShapePath.prototype.setTripleAt=function(e,t,n,r,i,o,a,s){this.setXYAt(e,t,"v",a,s),this.setXYAt(n,r,"o",a,s),this.setXYAt(i,o,"i",a,s)},ShapePath.prototype.reverse=function(){var e=new ShapePath;e.setPathData(this.c,this._length);var t=this.v,n=this.o,r=this.i,i=0;this.c&&(e.setTripleAt(t[0][0],t[0][1],r[0][0],r[0][1],n[0][0],n[0][1],0,!1),i=1);var o,a=this._length-1,s=this._length;for(o=i;o=f[f.length-1].t-this.offsetTime)r=f[f.length-1].s?f[f.length-1].s[0]:f[f.length-2].e[0],o=!0;else{for(var d,m,g=p,y=f.length-1,v=!0;v&&(d=f[g],!((m=f[g+1]).t-this.offsetTime>e));)g=m.t-this.offsetTime)u=1;else if(en&&e>n)||(this._caching.lastIndex=r=1?o.push({s:e-1,e:t-1}):(o.push({s:e,e:1}),o.push({s:0,e:t-1}));var a,s,l=[],c=o.length;for(a=0;ar+n);else u=s.s*i<=r?0:(s.s*i-r)/n,h=s.e*i>=r+n?1:(s.e*i-r)/n,l.push([u,h])}return l.length||l.push([0,0]),l},TrimModifier.prototype.releasePathsData=function(e){var t,n=e.length;for(t=0;t1?1:this.s.v<0?0:this.s.v)+i)>(n=(this.e.v>1?1:this.e.v<0?0:this.e.v)+i)){var o=t;t=n,n=o}t=1e-4*Math.round(1e4*t),n=1e-4*Math.round(1e4*n),this.sValue=t,this.eValue=n}else t=this.sValue,n=this.eValue;var a,s,l,c,u,h,p=this.shapes.length,f=0;if(n===t)for(a=0;a=0;a-=1)if((d=this.shapes[a]).shape._mdf){for((m=d.localShapeCollection).releaseShapes(),2===this.m&&p>1?(y=this.calculateShapeEdges(t,n,d.totalShapeLength,b,f),b+=d.totalShapeLength):y=[[v,_]],l=y.length,s=0;s=1?g.push({s:d.totalShapeLength*(v-1),e:d.totalShapeLength*(_-1)}):(g.push({s:d.totalShapeLength*v,e:d.totalShapeLength}),g.push({s:0,e:d.totalShapeLength*(_-1)}));var w=this.addShapes(d,g[0]);if(g[0].s!==g[0].e){if(g.length>1)if(d.shape.paths.shapes[d.shape.paths._length-1].c){var E=w.pop();this.addPaths(w,m),w=this.addShapes(d,g[1],E)}else this.addPaths(w,m),w=this.addShapes(d,g[1]);this.addPaths(w,m)}}d.shape.paths=m}}},TrimModifier.prototype.addPaths=function(e,t){var n,r=e.length;for(n=0;nt.e){n.c=!1;break}t.s<=d&&t.e>=d+a.addedLength?(this.addSegment(p[r].v[i-1],p[r].o[i-1],p[r].i[i],p[r].v[i],n,s,g),g=!1):(c=bez.getNewSegment(p[r].v[i-1],p[r].v[i],p[r].o[i-1],p[r].i[i],(t.s-d)/a.addedLength,(t.e-d)/a.addedLength,l[i-1]),this.addSegmentFromArray(c,n,s,g),g=!1,n.c=!1),d+=a.addedLength,s+=1}if(p[r].c&&l.length){if(a=l[i-1],d<=t.e){var y=l[i-1].addedLength;t.s<=d&&t.e>=d+y?(this.addSegment(p[r].v[i-1],p[r].o[i-1],p[r].i[0],p[r].v[0],n,s,g),g=!1):(c=bez.getNewSegment(p[r].v[i-1],p[r].v[0],p[r].o[i-1],p[r].i[0],(t.s-d)/y,(t.e-d)/y,l[i-1]),this.addSegmentFromArray(c,n,s,g),g=!1,n.c=!1)}else n.c=!1;d+=a.addedLength,s+=1}if(n._length&&(n.setXYAt(n.v[u][0],n.v[u][1],"i",u),n.setXYAt(n.v[n._length-1][0],n.v[n._length-1][1],"o",n._length-1)),d>t.e)break;r0;)n-=1,this._elements.unshift(t[n]);this.dynamicProperties.length?this.k=!0:this.getValue(!0)},RepeaterModifier.prototype.resetElements=function(e){var t,n=e.length;for(t=0;t0?Math.floor(c):Math.ceil(c),p=(this.tr.v.props,this.pMatrix.props),f=this.rMatrix.props,d=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var m,g,y=0;if(c>0){for(;yh;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),y-=1;u&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-u,!0),y-=u)}for(r=1===this.data.m?0:this._currentCopies-1,i=1===this.data.m?1:-1,o=this._currentCopies;o;){if(g=(n=(t=this.elemsData[r].it)[t.length-1].transform.mProps.v.props).length,t[t.length-1].transform.mProps._mdf=!0,t[t.length-1].transform.op._mdf=!0,t[t.length-1].transform.op.v=this.so.v+(this.eo.v-this.so.v)*(r/(this._currentCopies-1)),0!==y){for((0!==r&&1===i||r!==this._currentCopies-1&&-1===i)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7],f[8],f[9],f[10],f[11],f[12],f[13],f[14],f[15]),this.matrix.transform(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],d[8],d[9],d[10],d[11],d[12],d[13],d[14],d[15]),this.matrix.transform(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],p[8],p[9],p[10],p[11],p[12],p[13],p[14],p[15]),m=0;m.01)return!1;n+=1}return!0},GradientProperty.prototype.checkCollapsable=function(){if(this.o.length/2!=this.c.length/4)return!1;if(this.data.k.k[0].s)for(var e=0,t=this.data.k.k.length;e=s+se||!d?(v=(s+se-c)/l.partialLength,j=f.point[0]+(l.point[0]-f.point[0])*v,$=f.point[1]+(l.point[1]-f.point[1])*v,k.translate(-w[0]*C[i].an/200,-w[1]*N/100),u=!1):d&&(c+=l.partialLength,(h+=1)>=d.length&&(h=0,m[p+=1]?d=m[p].points:b.v.c?(h=0,d=m[p=0].points):(c-=l.partialLength,d=null)),d&&(f=l,g=(l=d[h]).partialLength));L=C[i].an/2-C[i].add,k.translate(-L,0,0)}else L=C[i].an/2-C[i].add,k.translate(-L,0,0),k.translate(-w[0]*C[i].an/200,-w[1]*N/100,0);for(C[i].l/2,D=0;D1,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},TextProperty.prototype.addEffect=function(e){this.effectsSequence.push(e),this.elem.addDynamicProperty(this)},TextProperty.prototype.getValue=function(e){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length||e){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var t=this.currentData,n=this.keysIndex;if(this.lock)this.setCurrentData(this.currentData);else{this.lock=!0,this._mdf=!1;var r,i=this.effectsSequence.length,o=e||this.data.d.k[this.keysIndex].s;for(r=0;rt));)n+=1;return this.keysIndex!==n&&(this.keysIndex=n),this.data.d.k[this.keysIndex].s},TextProperty.prototype.buildFinalText=function(e){for(var t,n=FontManager.getCombinedCharacterCodes(),r=[],i=0,o=e.length;i=55296&&t<=56319&&(t=e.charCodeAt(i+1))>=56320&&t<=57343?(r.push(e.substr(i,2)),++i):r.push(e.charAt(i)),i+=1;return r},TextProperty.prototype.completeTextData=function(e){e.__complete=!0;var t,n,r,i,o,a,s,l=this.elem.globalData.fontManager,c=this.data,u=[],h=0,p=c.m.g,f=0,d=0,m=0,g=[],y=0,v=0,_=l.getFontByName(e.f),b=0,w=_.fStyle?_.fStyle.split(" "):[],E="normal",T="normal";for(n=w.length,t=0;tA&&" "!==C[t]?(-1===D?n+=1:t=D,x+=e.finalLineHeight||1.2*e.finalSize,C.splice(t,D===t?1:0,"\r"),D=-1,y=0):(y+=b,y+=S);x+=_.ascent*e.finalSize/100,this.canResize&&e.finalSize>this.minimumFontSize&&Iv?y:v,y=-2*S,i="",r=!0,m+=1):i=R,l.chars?(s=l.getCharData(R,_.fStyle,l.getFontByName(e.f).fFamily),b=r?0:s.w*e.finalSize/100):b=l.measureText(i,e.f,e.finalSize)," "===R?O+=b+S:(y+=b+S+O,O=0),u.push({l:b,an:b,add:f,n:r,anIndexes:[],val:i,line:m,animatorJustifyOffset:0}),2==p){if(f+=b,""===i||" "===i||t===n-1){for(""!==i&&" "!==i||(f-=b);d<=t;)u[d].an=f,u[d].ind=h,u[d].extra=b,d+=1;h+=1,f=0}}else if(3==p){if(f+=b,""===i||t===n-1){for(""===i&&(f-=b);d<=t;)u[d].an=f,u[d].ind=h,u[d].extra=b,d+=1;f=0,h+=1}}else u[h].ind=h,u[h].extra=0,h+=1;if(e.l=u,v=y>v?y:v,g.push(y),e.sz)e.boxWidth=e.sz[0],e.justifyOffset=0;else switch(e.boxWidth=v,e.j){case 1:e.justifyOffset=-e.boxWidth;break;case 2:e.justifyOffset=-e.boxWidth/2;break;default:e.justifyOffset=0}e.lineWidths=g;var N,M,F=c.a;a=F.length;var L,j,$=[];for(o=0;o0?i=this.ne.v/100:o=-this.ne.v/100,this.xe.v>0?a=1-this.xe.v/100:s=1+this.xe.v/100;var l=BezierFactory.getBezierEasing(i,o,a,s).get,c=0,u=this.finalS,h=this.finalE,p=this.data.sh;if(2===p)c=l(c=h===u?r>=h?1:0:e(0,t(.5/(h-u)+(r-u)/(h-u),1)));else if(3===p)c=l(c=h===u?r>=h?0:1:1-e(0,t(.5/(h-u)+(r-u)/(h-u),1)));else if(4===p)h===u?c=0:(c=e(0,t(.5/(h-u)+(r-u)/(h-u),1)))<.5?c*=2:c=1-2*(c-.5),c=l(c);else if(5===p){if(h===u)c=0;else{var f=h-u,d=-f/2+(r=t(e(0,r+.5-u),h-u)),m=f/2;c=Math.sqrt(1-d*d/(m*m))}c=l(c)}else 6===p?(h===u?c=0:(r=t(e(0,r+.5-u),h-u),c=(1+Math.cos(Math.PI+2*Math.PI*r/(h-u)))/2),c=l(c)):(r>=n(u)&&(c=e(0,t(r-u<0?t(h,1)-(u-r):h-r,1))),c=l(c));return c*this.a.v},getValue:function(e){this.iterateDynamicProperties(),this._mdf=e||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,e&&2===this.data.r&&(this.e.v=this._currentTextLength);var t=2===this.data.r?1:100/this.data.totalChars,n=this.o.v/t,r=this.s.v/t+n,i=this.e.v/t+n;if(r>i){var o=r;r=i,i=o}this.finalS=r,this.finalE=i}},extendPrototype([DynamicPropertyContainer],r),{getTextSelectorProp:function(e,t,n){return new r(e,t,n)}}}(),pool_factory=function(e,t,n,r){var i=0,o=e,a=createSizedArray(o);return{newElement:function(){return i?a[i-=1]:t()},release:function(e){i===o&&(a=pooling.double(a),o*=2),n&&n(e),a[i]=e,i+=1}}},pooling={double:function(e){return e.concat(createSizedArray(e.length))}},point_pool=pool_factory(8,(function(){return createTypedArray("float32",2)})),shape_pool=function(){var e=pool_factory(4,(function(){return new ShapePath}),(function(e){var t,n=e._length;for(t=0;t0&&(this.maskElement.setAttribute("id",g),this.element.maskedElement.setAttribute(v,"url("+locationHref+"#"+g+")"),i.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this)}function HierarchyElement(){}function FrameElement(){}function TransformElement(){}function RenderableElement(){}function RenderableDOMElement(){}function ProcessedElement(e,t){this.elem=e,this.pos=t}function SVGStyleData(e,t){this.data=e,this.type=e.ty,this.d="",this.lvl=t,this._mdf=!1,this.closed=!0===e.hd,this.pElem=createNS("path"),this.msElem=null}function SVGShapeData(e,t,n){this.caches=[],this.styles=[],this.transformers=e,this.lStr="",this.sh=n,this.lvl=t,this._isAnimated=!!n.k;for(var r=0,i=e.length;r=0;t--)this.elements[t]||(n=this.layers[t]).ip-n.st<=e-this.layers[t].st&&n.op-n.st>e-this.layers[t].st&&this.buildItem(t),this.completeLayers=!!this.elements[t]&&this.completeLayers;this.checkPendingElements()},BaseRenderer.prototype.createItem=function(e){switch(e.ty){case 2:return this.createImage(e);case 0:return this.createComp(e);case 1:return this.createSolid(e);case 3:return this.createNull(e);case 4:return this.createShape(e);case 5:return this.createText(e);case 13:return this.createCamera(e)}return this.createNull(e)},BaseRenderer.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},BaseRenderer.prototype.buildAllItems=function(){var e,t=this.layers.length;for(e=0;e=0;t--)(this.completeLayers||this.elements[t])&&this.elements[t].prepareFrame(e-this.layers[t].st);if(this.globalData._mdf)for(t=0;tn&&"meet"===o||rn&&"slice"===o)?(e-this.transformCanvas.w*(t/this.transformCanvas.h))/2*this.renderConfig.dpr:"xMax"===s&&(rn&&"slice"===o)?(e-this.transformCanvas.w*(t/this.transformCanvas.h))*this.renderConfig.dpr:0,this.transformCanvas.ty="YMid"===l&&(r>n&&"meet"===o||rn&&"meet"===o||r=0;e-=1)this.elements[e]&&this.elements[e].destroy();this.elements.length=0,this.globalData.canvasContext=null,this.animationItem.container=null,this.destroyed=!0},CanvasRenderer.prototype.renderFrame=function(e,t){if((this.renderedFrame!==e||!0!==this.renderConfig.clearCanvas||t)&&!this.destroyed&&-1!==e){this.renderedFrame=e,this.globalData.frameNum=e-this.animationItem._isFirstFrame,this.globalData.frameId+=1,this.globalData._mdf=!this.renderConfig.clearCanvas||t,this.globalData.projectInterface.currentFrame=e;var n,r=this.layers.length;for(this.completeLayers||this.checkLayers(e),n=0;n=0;n-=1)(this.completeLayers||this.elements[n])&&this.elements[n].renderFrame();!0!==this.renderConfig.clearCanvas&&this.restore()}}},CanvasRenderer.prototype.buildItem=function(e){var t=this.elements;if(!t[e]&&99!=this.layers[e].ty){var n=this.createItem(this.layers[e],this,this.globalData);t[e]=n,n.initExpressions()}},CanvasRenderer.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){this.pendingElements.pop().checkParenting()}},CanvasRenderer.prototype.hide=function(){this.animationItem.container.style.display="none"},CanvasRenderer.prototype.show=function(){this.animationItem.container.style.display="block"},extendPrototype([BaseRenderer],HybridRenderer),HybridRenderer.prototype.buildItem=SVGRenderer.prototype.buildItem,HybridRenderer.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){this.pendingElements.pop().checkParenting()}},HybridRenderer.prototype.appendElementInPos=function(e,t){var n=e.getBaseElement();if(n){var r=this.layers[t];if(r.ddd&&this.supports3d)this.addTo3dContainer(n,t);else if(this.threeDElements)this.addTo3dContainer(n,t);else{for(var i,o,a=0;a=e)return this.threeDElements[t].perspectiveElem;t+=1}},HybridRenderer.prototype.createThreeDContainer=function(e,t){var n=createTag("div");styleDiv(n);var r=createTag("div");styleDiv(r),"3d"===t&&(n.style.width=this.globalData.compSize.w+"px",n.style.height=this.globalData.compSize.h+"px",n.style.transformOrigin=n.style.mozTransformOrigin=n.style.webkitTransformOrigin="50% 50%",r.style.transform=r.style.webkitTransform="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)"),n.appendChild(r);var i={container:r,perspectiveElem:n,startPos:e,endPos:e,type:t};return this.threeDElements.push(i),i},HybridRenderer.prototype.build3dContainers=function(){var e,t,n=this.layers.length,r="";for(e=0;e=0;e--)this.resizerElem.appendChild(this.threeDElements[e].perspectiveElem)},HybridRenderer.prototype.addTo3dContainer=function(e,t){for(var n=0,r=this.threeDElements.length;na?(e=i/this.globalData.compSize.w,t=i/this.globalData.compSize.w,n=0,r=(o-this.globalData.compSize.h*(i/this.globalData.compSize.w))/2):(e=o/this.globalData.compSize.h,t=o/this.globalData.compSize.h,n=(i-this.globalData.compSize.w*(o/this.globalData.compSize.h))/2,r=0),this.resizerElem.style.transform=this.resizerElem.style.webkitTransform="matrix3d("+e+",0,0,0,0,"+t+",0,0,0,0,1,0,"+n+","+r+",0,1)"},HybridRenderer.prototype.renderFrame=SVGRenderer.prototype.renderFrame,HybridRenderer.prototype.hide=function(){this.resizerElem.style.display="none"},HybridRenderer.prototype.show=function(){this.resizerElem.style.display="block"},HybridRenderer.prototype.initItems=function(){if(this.buildAllItems(),this.camera)this.camera.setup();else{var e,t=this.globalData.compSize.w,n=this.globalData.compSize.h,r=this.threeDElements.length;for(e=0;e1&&(o+=" C"+t.o[r-1][0]+","+t.o[r-1][1]+" "+t.i[0][0]+","+t.i[0][1]+" "+t.v[0][0]+","+t.v[0][1]),n.lastPath!==o){var a="";n.elem&&(t.c&&(a=e.inv?this.solidPath+o:o),n.elem.setAttribute("d",a)),n.lastPath=o}},MaskElement.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null},HierarchyElement.prototype={initHierarchy:function(){this.hierarchy=[],this._isParent=!1,this.checkParenting()},setHierarchy:function(e){this.hierarchy=e},setAsParent:function(){this._isParent=!0},checkParenting:function(){void 0!==this.data.parent&&this.comp.buildElementParenting(this,this.data.parent,[])}},FrameElement.prototype={initFrame:function(){this._isFirstFrame=!1,this.dynamicProperties=[],this._mdf=!1},prepareProperties:function(e,t){var n,r=this.dynamicProperties.length;for(n=0;ne?!0!==this.isInRange&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):!1!==this.isInRange&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())},renderRenderable:function(){var e,t=this.renderableComponents.length;for(e=0;e0;)l=r.transformers[m].mProps._mdf||l,d--,m--;if(l)for(d=y-r.styles[u].lvl,m=r.transformers.length-1;d>0;)f=r.transformers[m].mProps.v.props,p.transform(f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7],f[8],f[9],f[10],f[11],f[12],f[13],f[14],f[15]),d--,m--}else p=e;if(a=(h=r.sh.paths)._length,l){for(s="",o=0;o=1?.99:t.h.v<=-1?-.99:t.h.v),_=Math.cos(y+t.a.v)*v+u[0],b=Math.sin(y+t.a.v)*v+u[1];l.setAttribute("fx",_),l.setAttribute("fy",b),c&&!t.g._collapsable&&(t.of.setAttribute("fx",_),t.of.setAttribute("fy",b))}}function s(e,t,n){var r=t.style,i=t.d;i&&(i._mdf||n)&&i.dashStr&&(r.pElem.setAttribute("stroke-dasharray",i.dashStr),r.pElem.setAttribute("stroke-dashoffset",i.dashoffset[0])),t.c&&(t.c._mdf||n)&&r.pElem.setAttribute("stroke","rgb("+bm_floor(t.c.v[0])+","+bm_floor(t.c.v[1])+","+bm_floor(t.c.v[2])+")"),(t.o._mdf||n)&&r.pElem.setAttribute("stroke-opacity",t.o.v),(t.w._mdf||n)&&(r.pElem.setAttribute("stroke-width",t.w.v),r.msElem&&r.msElem.setAttribute("stroke-width",t.w.v))}return{createRenderFunction:function(e){e.ty;switch(e.ty){case"fl":return i;case"gf":return a;case"gs":return o;case"st":return s;case"sh":case"el":case"rc":case"sr":return r;case"tr":return n}}}}();function ShapeTransformManager(){this.sequences={},this.sequenceList=[],this.transform_key_count=0}function CVShapeData(e,t,n,r){this.styledShapes=[],this.tr=[0,0,0,0,0,0];var i=4;"rc"==t.ty?i=5:"el"==t.ty?i=6:"sr"==t.ty&&(i=7),this.sh=ShapePropertyFactory.getShapeProp(e,t,i,e);var o,a,s=n.length;for(o=0;o=0;r-=1)n=e.transforms[r].transform.mProps.v.props,e.finalTransform.transform(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8],n[9],n[10],n[11],n[12],n[13],n[14],n[15]);e._mdf=o},processSequences:function(e){var t,n=this.sequenceList.length;for(t=0;t=0;e-=1)this.shapeModifiers[e].processShapes(this._isFirstFrame)}},lcEnum:{1:"butt",2:"round",3:"square"},ljEnum:{1:"miter",2:"round",3:"bevel"},searchProcessedElement:function(e){for(var t=this.processedElements,n=0,r=t.length;n=0;n-=1)(this.completeLayers||this.elements[n])&&(this.elements[n].prepareFrame(this.renderedFrame-this.layers[n].st),this.elements[n]._mdf&&(this._mdf=!0))}},ICompElement.prototype.renderInnerContent=function(){var e,t=this.layers.length;for(e=0;ee?this.textSpans[e]:createNS(l?"path":"text"),_<=e&&(a.setAttribute("stroke-linecap","butt"),a.setAttribute("stroke-linejoin","round"),a.setAttribute("stroke-miterlimit","4"),this.textSpans[e]=a,this.layerElement.appendChild(a)),a.style.display="inherit"),u.reset(),u.scale(n.finalSize/100,n.finalSize/100),p&&(s[e].n&&(f=-g,d+=n.yOffset,d+=m?1:0,m=!1),this.applyTextPropertiesToMatrix(n,u,s[e].line,f,d),f+=s[e].l||0,f+=g),l?(c=(y=(v=this.globalData.fontManager.getCharData(n.finalText[e],r.fStyle,this.globalData.fontManager.getFontByName(n.f).fFamily))&&v.data||{}).shapes?y.shapes[0].it:[],p?h+=this.createPathShape(u,c):a.setAttribute("d",this.createPathShape(u,c))):(p&&a.setAttribute("transform","translate("+u.props[12]+","+u.props[13]+")"),a.textContent=s[e].val,a.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"));p&&a&&a.setAttribute("d",h)}else{var b=this.textContainer,w="start";switch(n.j){case 1:w="end";break;case 2:w="middle"}b.setAttribute("text-anchor",w),b.setAttribute("letter-spacing",g);var E=this.buildTextContents(n.finalText);for(t=E.length,d=n.ps?n.ps[1]+n.ascent:0,e=0;e1&&s&&this.setShapesAsAnimated(a)}},SVGShapeElement.prototype.setShapesAsAnimated=function(e){var t,n=e.length;for(t=0;t=0;s-=1){if((p=this.searchProcessedElement(e[s]))?t[s]=n[p-1]:e[s]._render=a,"fl"==e[s].ty||"st"==e[s].ty||"gf"==e[s].ty||"gs"==e[s].ty)p?t[s].style.closed=!1:t[s]=this.createStyleElement(e[s],i),e[s]._render&&r.appendChild(t[s].style.pElem),m.push(t[s].style);else if("gr"==e[s].ty){if(p)for(c=t[s].it.length,l=0;l=c?f<0?r:i:r+p*Math.pow((o-e)/f,1/n),u[h++]=a,s+=256/255;return u.join(" ")},SVGProLevelsFilter.prototype.renderFrame=function(e){if(e||this.filterManager._mdf){var t,n=this.filterManager.effectElements;this.feFuncRComposed&&(e||n[3].p._mdf||n[4].p._mdf||n[5].p._mdf||n[6].p._mdf||n[7].p._mdf)&&(t=this.getTableValue(n[3].p.v,n[4].p.v,n[5].p.v,n[6].p.v,n[7].p.v),this.feFuncRComposed.setAttribute("tableValues",t),this.feFuncGComposed.setAttribute("tableValues",t),this.feFuncBComposed.setAttribute("tableValues",t)),this.feFuncR&&(e||n[10].p._mdf||n[11].p._mdf||n[12].p._mdf||n[13].p._mdf||n[14].p._mdf)&&(t=this.getTableValue(n[10].p.v,n[11].p.v,n[12].p.v,n[13].p.v,n[14].p.v),this.feFuncR.setAttribute("tableValues",t)),this.feFuncG&&(e||n[17].p._mdf||n[18].p._mdf||n[19].p._mdf||n[20].p._mdf||n[21].p._mdf)&&(t=this.getTableValue(n[17].p.v,n[18].p.v,n[19].p.v,n[20].p.v,n[21].p.v),this.feFuncG.setAttribute("tableValues",t)),this.feFuncB&&(e||n[24].p._mdf||n[25].p._mdf||n[26].p._mdf||n[27].p._mdf||n[28].p._mdf)&&(t=this.getTableValue(n[24].p.v,n[25].p.v,n[26].p.v,n[27].p.v,n[28].p.v),this.feFuncB.setAttribute("tableValues",t)),this.feFuncA&&(e||n[31].p._mdf||n[32].p._mdf||n[33].p._mdf||n[34].p._mdf||n[35].p._mdf)&&(t=this.getTableValue(n[31].p.v,n[32].p.v,n[33].p.v,n[34].p.v,n[35].p.v),this.feFuncA.setAttribute("tableValues",t))}},SVGDropShadowEffect.prototype.renderFrame=function(e){if(e||this.filterManager._mdf){if((e||this.filterManager.effectElements[4].p._mdf)&&this.feGaussianBlur.setAttribute("stdDeviation",this.filterManager.effectElements[4].p.v/4),e||this.filterManager.effectElements[0].p._mdf){var t=this.filterManager.effectElements[0].p.v;this.feFlood.setAttribute("flood-color",rgbToHex(Math.round(255*t[0]),Math.round(255*t[1]),Math.round(255*t[2])))}if((e||this.filterManager.effectElements[1].p._mdf)&&this.feFlood.setAttribute("flood-opacity",this.filterManager.effectElements[1].p.v/255),e||this.filterManager.effectElements[2].p._mdf||this.filterManager.effectElements[3].p._mdf){var n=this.filterManager.effectElements[3].p.v,r=(this.filterManager.effectElements[2].p.v-90)*degToRads,i=n*Math.cos(r),o=n*Math.sin(r);this.feOffset.setAttribute("dx",i),this.feOffset.setAttribute("dy",o)}}};var _svgMatteSymbols=[];function SVGMatte3Effect(e,t,n){this.initialized=!1,this.filterManager=t,this.filterElem=e,this.elem=n,n.matteElement=createNS("g"),n.matteElement.appendChild(n.layerElement),n.matteElement.appendChild(n.transformedElement),n.baseElement=n.matteElement}function SVGEffects(e){var t,n,r=e.data.ef?e.data.ef.length:0,i=createElementID(),o=filtersFactory.createFilter(i),a=0;for(this.filters=[],t=0;ts&&"xMidYMid slice"===l||a=0;e-=1)(this.completeLayers||this.elements[e])&&this.elements[e].renderFrame()},CVCompElement.prototype.destroy=function(){var e;for(e=this.layers.length-1;e>=0;e-=1)this.elements[e]&&this.elements[e].destroy();this.layers=null,this.elements=null},CVMaskElement.prototype.renderFrame=function(){if(this.hasMasks){var e,t,n,r,i=this.element.finalTransform.mat,o=this.element.canvasContext,a=this.masksProperties.length;for(o.beginPath(),e=0;e=0;o-=1){if((l=this.searchProcessedElement(e[o]))?t[o]=n[l-1]:e[o]._shouldRender=r,"fl"==e[o].ty||"st"==e[o].ty||"gf"==e[o].ty||"gs"==e[o].ty)l?t[o].style.closed=!1:t[o]=this.createStyleElement(e[o],d),p.push(t[o].style);else if("gr"==e[o].ty){if(l)for(s=t[o].it.length,a=0;a=0;i-=1)"tr"==t[i].ty?(o=n[i].transform,this.renderShapeTransform(e,o)):"sh"==t[i].ty||"el"==t[i].ty||"rc"==t[i].ty||"sr"==t[i].ty?this.renderPath(t[i],n[i]):"fl"==t[i].ty?this.renderFill(t[i],n[i],o):"st"==t[i].ty?this.renderStroke(t[i],n[i],o):"gf"==t[i].ty||"gs"==t[i].ty?this.renderGradientFill(t[i],n[i],o):"gr"==t[i].ty?this.renderShape(o,t[i].it,n[i].it):t[i].ty;r&&this.drawLayer()},CVShapeElement.prototype.renderStyledShape=function(e,t){if(this._isFirstFrame||t._mdf||e.transforms._mdf){var n,r,i,o=e.trNodes,a=t.paths,s=a._length;o.length=0;var l=e.transforms.finalTransform;for(i=0;i=1?.99:t.h.v<=-1?-.99:t.h.v),u=Math.cos(l+t.a.v)*c+o[0],h=Math.sin(l+t.a.v)*c+o[1],p=i.createRadialGradient(u,h,0,o[0],o[1],s);var f,d=e.g.p,m=t.g.c,g=1;for(f=0;f=e.x+e.width&&this.currentBBox.height+this.currentBBox.y>=e.y+e.height},HShapeElement.prototype.renderInnerContent=function(){if(this._renderShapeFrame(),!this.hidden&&(this._isFirstFrame||this._mdf)){var e=this.tempBoundingBox,t=999999;if(e.x=t,e.xMax=-t,e.y=t,e.yMax=-t,this.calculateBoundingBox(this.itemsData,e),e.width=e.xMax=0;e-=1){var r=this.hierarchy[e].finalTransform.mProp;this.mat.translate(-r.p.v[0],-r.p.v[1],r.p.v[2]),this.mat.rotateX(-r.or.v[0]).rotateY(-r.or.v[1]).rotateZ(r.or.v[2]),this.mat.rotateX(-r.rx.v).rotateY(-r.ry.v).rotateZ(r.rz.v),this.mat.scale(1/r.s.v[0],1/r.s.v[1],1/r.s.v[2]),this.mat.translate(r.a.v[0],r.a.v[1],r.a.v[2])}if(this.p?this.mat.translate(-this.p.v[0],-this.p.v[1],this.p.v[2]):this.mat.translate(-this.px.v,-this.py.v,this.pz.v),this.a){var i;i=this.p?[this.p.v[0]-this.a.v[0],this.p.v[1]-this.a.v[1],this.p.v[2]-this.a.v[2]]:[this.px.v-this.a.v[0],this.py.v-this.a.v[1],this.pz.v-this.a.v[2]];var o=Math.sqrt(Math.pow(i[0],2)+Math.pow(i[1],2)+Math.pow(i[2],2)),a=[i[0]/o,i[1]/o,i[2]/o],s=Math.sqrt(a[2]*a[2]+a[0]*a[0]),l=Math.atan2(a[1],s),c=Math.atan2(a[0],-a[2]);this.mat.rotateY(c).rotateX(-l)}this.mat.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v),this.mat.rotateX(-this.or.v[0]).rotateY(-this.or.v[1]).rotateZ(this.or.v[2]),this.mat.translate(this.globalData.compSize.w/2,this.globalData.compSize.h/2,0),this.mat.translate(0,0,this.pe.v);var u=!this._prevMat.equals(this.mat);if((u||this.pe._mdf)&&this.comp.threeDElements){var h;for(t=this.comp.threeDElements.length,e=0;e=0;n-=1)t[n].animation.destroy(e)},e.freeze=function(){a=!0},e.unfreeze=function(){a=!1,d()},e.getRegisteredAnimations=function(){var e,n=t.length,r=[];for(e=0;ethis.animationData.op&&(this.animationData.op=e.op,this.totalFrames=Math.floor(e.op-this.animationData.ip));var t,n,r=this.animationData.layers,i=r.length,o=e.layers,a=o.length;for(n=0;nthis.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame()},AnimationItem.prototype.renderFrame=function(){if(!1!==this.isLoaded)try{this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(e){this.triggerRenderFrameError(e)}},AnimationItem.prototype.play=function(e){e&&this.name!=e||!0===this.isPaused&&(this.isPaused=!1,this._idle&&(this._idle=!1,this.trigger("_active")))},AnimationItem.prototype.pause=function(e){e&&this.name!=e||!1===this.isPaused&&(this.isPaused=!0,this._idle=!0,this.trigger("_idle"))},AnimationItem.prototype.togglePause=function(e){e&&this.name!=e||(!0===this.isPaused?this.play():this.pause())},AnimationItem.prototype.stop=function(e){e&&this.name!=e||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},AnimationItem.prototype.goToAndStop=function(e,t,n){n&&this.name!=n||(t?this.setCurrentRawFrameValue(e):this.setCurrentRawFrameValue(e*this.frameModifier),this.pause())},AnimationItem.prototype.goToAndPlay=function(e,t,n){this.goToAndStop(e,t,n),this.play()},AnimationItem.prototype.advanceTime=function(e){if(!0!==this.isPaused&&!1!==this.isLoaded){var t=this.currentRawFrame+e*this.frameModifier,n=!1;t>=this.totalFrames-1&&this.frameModifier>0?this.loop&&this.playCount!==this.loop?t>=this.totalFrames?(this.playCount+=1,this.checkSegments(t%this.totalFrames)||(this.setCurrentRawFrameValue(t%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(t):this.checkSegments(t>this.totalFrames?t%this.totalFrames:0)||(n=!0,t=this.totalFrames-1):t<0?this.checkSegments(t%this.totalFrames)||(!this.loop||this.playCount--<=0&&!0!==this.loop?(n=!0,t=0):(this.setCurrentRawFrameValue(this.totalFrames+t%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0)):this.setCurrentRawFrameValue(t),n&&(this.setCurrentRawFrameValue(t),this.pause(),this.trigger("complete"))}},AnimationItem.prototype.adjustSegment=function(e,t){this.playCount=0,e[1]0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.timeCompleted=this.totalFrames=e[0]-e[1],this.firstFrame=e[1],this.setCurrentRawFrameValue(this.totalFrames-.001-t)):e[1]>e[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.timeCompleted=this.totalFrames=e[1]-e[0],this.firstFrame=e[0],this.setCurrentRawFrameValue(.001+t)),this.trigger("segmentStart")},AnimationItem.prototype.setSegment=function(e,t){var n=-1;this.isPaused&&(this.currentRawFrame+this.firstFramet&&(n=t-e)),this.firstFrame=e,this.timeCompleted=this.totalFrames=t-e,-1!==n&&this.goToAndStop(n,!0)},AnimationItem.prototype.playSegments=function(e,t){if(t&&(this.segments.length=0),"object"==typeof e[0]){var n,r=e.length;for(n=0;n1){for(r=0;rc.length-1)&&(t=c.length-1),r=u-(i=c[c.length-1-t].t)),"pingpong"===e){if(Math.floor((l-i)/r)%2!=0)return this.getValueAtTime((r-(l-i)%r+i)/this.comp.globalData.frameRate,0)}else{if("offset"===e){var h=this.getValueAtTime(i/this.comp.globalData.frameRate,0),p=this.getValueAtTime(u/this.comp.globalData.frameRate,0),f=this.getValueAtTime(((l-i)%r+i)/this.comp.globalData.frameRate,0),d=Math.floor((l-i)/r);if(this.pv.length){for(a=(s=new Array(h.length)).length,o=0;o=u)return this.pv;if(n?i=u+(r=t?Math.abs(elem.comp.globalData.frameRate*t):Math.max(0,this.elem.data.op-u)):((!t||t>c.length-1)&&(t=c.length-1),r=(i=c[t].t)-u),"pingpong"===e){if(Math.floor((u-l)/r)%2==0)return this.getValueAtTime(((u-l)%r+u)/this.comp.globalData.frameRate,0)}else{if("offset"===e){var h=this.getValueAtTime(u/this.comp.globalData.frameRate,0),p=this.getValueAtTime(i/this.comp.globalData.frameRate,0),f=this.getValueAtTime((r-(u-l)%r+u)/this.comp.globalData.frameRate,0),d=Math.floor((u-l)/r)+1;if(this.pv.length){for(a=(s=new Array(h.length)).length,o=0;o1?(i+e-o)/(t-1):1,s=0,l=0;for(n=this.pv.length?createTypedArray("float32",this.pv.length):0;sa){var u=s,h=n.c&&s===l-1?0:s+1,p=(a-c)/o[s].addedLength;r=bez.getPointInSegment(n.v[u],n.v[h],n.o[u],n.i[h],p,o[s]);break}c+=o[s].addedLength,s+=1}return r||(r=n.c?[n.v[0][0],n.v[0][1]]:[n.v[n._length-1][0],n.v[n._length-1][1]]),r},vectorOnPath:function(e,t,n){e=1==e?this.v.c?0:.999:e;var r=this.pointOnPath(e,t),i=this.pointOnPath(e+.001,t),o=i[0]-r[0],a=i[1]-r[1],s=Math.sqrt(Math.pow(o,2)+Math.pow(a,2));return 0===s?[0,0]:"tangent"===n?[o/s,a/s]:[-a/s,o/s]},tangentOnPath:function(e,t){return this.vectorOnPath(e,t,"tangent")},normalOnPath:function(e,t){return this.vectorOnPath(e,t,"normal")},setGroupProperty:expressionHelpers.setGroupProperty,getValueAtTime:expressionHelpers.getStaticValueAtTime},extendPrototype([c],s),extendPrototype([c],l),l.prototype.getValueAtTime=function(e){return this._cachingAtTime||(this._cachingAtTime={shapeValue:shape_pool.clone(this.pv),lastIndex:0,lastTime:initialDefaultFrame}),e*=this.elem.globalData.frameRate,(e-=this.offsetTime)!==this._cachingAtTime.lastTime&&(this._cachingAtTime.lastIndex=this._cachingAtTime.lastTime1&&(defaultCurveSegments=e)}function inBrowser(){return"undefined"!=typeof navigator}function installPlugin(e,t){"expressions"===e&&(expressionsPlugin=t)}function getFactory(e){switch(e){case"propertyFactory":return PropertyFactory;case"shapePropertyFactory":return ShapePropertyFactory;case"matrix":return Matrix}}function checkReady(){"complete"===document.readyState&&(clearInterval(readyStateCheckInterval),searchAnimations())}function getQueryVariable(e){for(var t=queryString.split("&"),n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var d=function(e){var t=e.animation,n=t.animationData,r=t.animationKey,a=e.reverse,l=void 0!==a&&a,u=e.size,p=void 0===u?24:u,d=e.strokeColor,m=e.pathCss,g=e.loop,y=e.autoplay,v=e.wrapperStyle,_=e.options,b=e.onClick,w=e.render,E=f(e,["animation","reverse","size","strokeColor","pathCss","loop","autoplay","wrapperStyle","options","onClick","render"]),T=h((0,i.useState)(),2),k=T[0],S=T[1],x=(0,i.useRef)(null);(0,i.useEffect)((function(){var e=(0,utils$1.getEffect)(r),t="".concat(r,"_i").concat(Math.floor(1e4*Math.random()+1));if(d||m)try{var i="#".concat(t," path { stroke: ").concat(d||"inherit","; ").concat(m||"","}"),a=document.getElementById("useAnimationsSheet");a||((a=document.createElement("style")).setAttribute("id","useAnimationsSheet"),a.appendChild(document.createTextNode("")),document.head.appendChild(a)),(a?a.sheet||a.styleSheet:null).insertRule(i)}catch(e){console.warn("There's been a problem with deleting a CSSRule, please report that issue in https://github.com/useAnimations/react-useanimations",e)}var s=c({container:x.current,renderer:"svg",animationData:n,loop:g||"LOOP_PLAY"===e,autoplay:y||"LOOP_PLAY"===e,rendererSettings:{progressiveLoad:!0,id:t}},_);return S(o.default.loadAnimation(s)),function(){null==k||k.destroy(),S(void 0);try{var e=document.getElementById("useAnimationsSheet"),n=e?e.sheet||e.styleSheet:null;if(n){var r=Array.from(n.cssRules).findIndex((function(e){return e.selectorText==="#".concat(t," path")}));-1!==r&&n.deleteRule(r)}}catch(e){console.warn("There's been a problem with deleting a CSSRule, please report that issue in https://github.com/useAnimations/react-useanimations",e)}}}),[]);var C=c({overflow:"hidden",outline:"none",width:"".concat(p,"px"),height:"".concat(p,"px")},v),P=k?(0,utils$1.getEvents)({animation:k,reverse:l,animEffect:(0,utils$1.getEffect)(r)}):void 0,A=c(c({},P),{},{onClick:function(e){b&&b(e),P&&"onClick"in P&&P.onClick()}}),I=c(c({ref:x},E),{},{style:C});return w?w(A,I):i.default.createElement("div",s({},A,I))};t.default=d})),UseAnimations=unwrapExports(reactUseanimations),v$3="5.6.5",fr=30,ip=0,op=60,w$2=24,h$1=24,nm="skip-back",ddd=0,assets=[],layers=[{ddd:0,ind:1,ty:4,nm:"line",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:180,ix:10},p:{a:1,k:[{i:{x:.667,y:1},o:{x:1,y:0},t:20,s:[12,12,0],to:[2.708,0,0],ti:[0,0,0]},{i:{x:0,y:1},o:{x:.333,y:0},t:40,s:[28.25,12,0],to:[0,0,0],ti:[2.708,0,0]},{t:60,s:[12,12,0]}],ix:2},a:{a:0,k:[12,12,0],ix:1},s:{a:0,k:[100,100,100],ix:6}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[19,5],[19,19]],c:!1},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:!1},{ty:"st",c:{a:0,k:[0,0,0,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:2,ix:5},lc:2,lj:2,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:!1},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"line",np:2,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:!1}],ip:0,op:60,st:0,bm:0},{ddd:0,ind:2,ty:4,nm:"triangle 2",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:180,ix:10},p:{a:0,k:[12,12,0],ix:2},a:{a:0,k:[12,12,0],ix:1},s:{a:1,k:[{i:{x:[0,0,.667],y:[1,1,1]},o:{x:[.333,.333,.333],y:[0,0,0]},t:50,s:[75,75,100]},{t:60,s:[100,100,100]}],ix:6}},ao:0,hasMask:!0,masksProperties:[{inv:!1,mode:"a",pt:{a:1,k:[{i:{x:.833,y:.833},o:{x:.167,y:.167},t:40,s:[{i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-15.5,-1.167],[-15.5,24.5],[-.333,24.5],[-.333,-1.167]],c:!0}]},{i:{x:.833,y:.833},o:{x:.167,y:.167},t:43,s:[{i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-12.333,-1.333],[-12.333,24.333],[2.833,24.333],[2.833,-1.333]],c:!0}]},{i:{x:.833,y:.833},o:{x:.167,y:.167},t:44,s:[{i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-8.5,-.833],[-8.5,24.833],[6.667,24.833],[6.667,-.833]],c:!0}]},{i:{x:.833,y:.833},o:{x:.167,y:.167},t:45,s:[{i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-4.833,-.833],[-4.833,24.833],[10.333,24.833],[10.333,-.833]],c:!0}]},{i:{x:.833,y:.833},o:{x:.167,y:.167},t:46,s:[{i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-2,-.833],[-2,24.833],[13.167,24.833],[13.167,-.833]],c:!0}]},{i:{x:.833,y:.833},o:{x:.167,y:.167},t:47,s:[{i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-.167,-.833],[-.167,24.833],[15,24.833],[15,-.833]],c:!0}]},{t:48,s:[{i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[2.5,-.833],[2.5,24.833],[17.667,24.833],[17.667,-.833]],c:!0}]}],ix:1},o:{a:0,k:100,ix:3},x:{a:0,k:0,ix:4},nm:"Mask 1"}],shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0]],v:[[-5,-8],[5,0],[-5,8]],c:!0},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:!1},{ty:"st",c:{a:0,k:[0,0,0,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:2,ix:5},lc:2,lj:2,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:!1},{ty:"tr",p:{a:0,k:[10,12],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"triangle",np:2,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:!1}],ip:40,op:60,st:40,bm:0},{ddd:0,ind:3,ty:4,nm:"triangle",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:180,ix:10},p:{a:1,k:[{i:{x:.833,y:1},o:{x:1,y:0},t:0,s:[12,12,0],to:[-3.333,0,0],ti:[3.333,0,0]},{t:15,s:[-8,12,0]}],ix:2},a:{a:0,k:[12,12,0],ix:1},s:{a:1,k:[{i:{x:[0,0,.667],y:[1,1,1]},o:{x:[.333,.333,.333],y:[0,0,0]},t:0,s:[100,100,100]},{t:20,s:[75,75,100]}],ix:6}},ao:0,hasMask:!0,masksProperties:[{inv:!1,mode:"a",pt:{a:1,k:[{i:{x:.833,y:.833},o:{x:.167,y:.167},t:0,s:[{i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[.125,.125],[.125,24],[19.125,24],[19.125,.125]],c:!0}]},{i:{x:.833,y:.833},o:{x:.167,y:.167},t:5,s:[{i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[.125,.125],[.125,23.571],[19.232,23.571],[19.232,.125]],c:!0}]},{i:{x:.833,y:.833},o:{x:.167,y:.167},t:7,s:[{i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-.936,.277],[-.936,23.723],[18.172,23.723],[18.172,.277]],c:!0}]},{i:{x:.833,y:.833},o:{x:.167,y:.167},t:8,s:[{i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-1.717,.12],[-1.717,23.567],[17.39,23.567],[17.39,.12]],c:!0}]},{i:{x:.833,y:.833},o:{x:.167,y:.167},t:9,s:[{i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-2.846,.282],[-2.846,23.728],[16.261,23.728],[16.261,.282]],c:!0}]},{i:{x:.833,y:.833},o:{x:.167,y:.167},t:10,s:[{i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-4.513,.282],[-4.513,23.728],[14.595,23.728],[14.595,.282]],c:!0}]},{i:{x:.833,y:.833},o:{x:.167,y:.167},t:11,s:[{i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-7.013,.615],[-7.013,24.061],[12.095,24.061],[12.095,.615]],c:!0}]},{i:{x:.833,y:.833},o:{x:.167,y:.167},t:12,s:[{i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-10.179,.615],[-10.179,24.061],[8.928,24.061],[8.928,.615]],c:!0}]},{i:{x:.833,y:.833},o:{x:.167,y:.167},t:13,s:[{i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-15.179,.115],[-15.179,23.561],[3.928,23.561],[3.928,.115]],c:!0}]},{t:14,s:[{i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-22.013,.282],[-22.013,23.728],[-2.905,23.728],[-2.905,.282]],c:!0}]}],ix:1},o:{a:0,k:100,ix:3},x:{a:0,k:0,ix:4},nm:"Mask 1"}],shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0]],v:[[-5,-8],[5,0],[-5,8]],c:!0},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:!1},{ty:"st",c:{a:0,k:[0,0,0,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:2,ix:5},lc:2,lj:2,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:!1},{ty:"tr",p:{a:0,k:[10,12],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"triangle",np:2,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:!1}],ip:0,op:15,st:0,bm:0}],markers=[],skipBack={v:v$3,fr:fr,ip:ip,op:op,w:w$2,h:h$1,nm:nm,ddd:ddd,assets:assets,layers:layers,markers:markers},skipBack$1=Object.freeze({__proto__:null,v:v$3,fr:fr,ip:ip,op:op,w:w$2,h:h$1,nm:nm,ddd:ddd,assets:assets,layers:layers,markers:markers,default:skipBack}),require$$0=getCjsExportFromNamespace(skipBack$1),skipBack$2=createCommonjsModule((function(e,t){var n;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r={animationData:((n=require$$0)&&n.__esModule?n:{default:n}).default,animationKey:"skipBack"};t.default=r})),skipBack$3=unwrapExports(skipBack$2);function getUserAgent(){return"object"==typeof navigator&&"userAgent"in navigator?navigator.userAgent:"object"==typeof process&&"version"in process?`Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`:""}var register_1=register;function register(e,t,n,r){if("function"!=typeof n)throw new Error("method for before hook must be a function");return r||(r={}),Array.isArray(t)?t.reverse().reduce((function(t,n){return register.bind(null,e,n,t,r)}),n)():Promise.resolve().then((function(){return e.registry[t]?e.registry[t].reduce((function(e,t){return t.hook.bind(null,e,r)}),n)():n(r)}))}var add=addHook;function addHook(e,t,n,r){var i=r;e.registry[n]||(e.registry[n]=[]),"before"===t&&(r=function(e,t){return Promise.resolve().then(i.bind(null,t)).then(e.bind(null,t))}),"after"===t&&(r=function(e,t){var n;return Promise.resolve().then(e.bind(null,t)).then((function(e){return i(n=e,t)})).then((function(){return n}))}),"error"===t&&(r=function(e,t){return Promise.resolve().then(e.bind(null,t)).catch((function(e){return i(e,t)}))}),e.registry[n].push({hook:r,orig:i})}var remove$1=removeHook;function removeHook(e,t,n){if(e.registry[t]){var r=e.registry[t].map((function(e){return e.orig})).indexOf(n);-1!==r&&e.registry[t].splice(r,1)}}var bind=Function.bind,bindable=bind.bind(bind);function bindApi(e,t,n){var r=bindable(remove$1,null).apply(null,n?[t,n]:[t]);e.api={remove:r},e.remove=r,["before","error","after","wrap"].forEach((function(r){var i=n?[t,r,n]:[t,r];e[r]=e.api[r]=bindable(add,null).apply(null,i)}))}function HookSingular(){var e={registry:{}},t=register_1.bind(null,e,"h");return bindApi(t,e,"h"),t}function HookCollection(){var e={registry:{}},t=register_1.bind(null,e);return bindApi(t,e),t}var collectionHookDeprecationMessageDisplayed=!1;function Hook(){return collectionHookDeprecationMessageDisplayed||(console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4'),collectionHookDeprecationMessageDisplayed=!0),HookCollection()}Hook.Singular=HookSingular.bind(),Hook.Collection=HookCollection.bind();var beforeAfterHook=Hook,Hook_1=Hook,Singular=Hook.Singular,Collection=Hook.Collection; -/*! - * is-plain-object + + var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; + + var ReactPropTypesSecret_1 = ReactPropTypesSecret; + + var printWarning = function() {}; + + { + var ReactPropTypesSecret$1 = ReactPropTypesSecret_1; + var loggedTypeFailures = {}; + var has = Function.call.bind(Object.prototype.hasOwnProperty); + + printWarning = function(text) { + var message = 'Warning: ' + text; + if (typeof console !== 'undefined') { + console.error(message); + } + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch (x) {} + }; + } + + /** + * Assert that the values match with the type specs. + * Error messages are memorized and will only be shown once. * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Released under the MIT License. + * @param {object} typeSpecs Map of name to a ReactPropType + * @param {object} values Runtime values that need to be type-checked + * @param {string} location e.g. "prop", "context", "child context" + * @param {string} componentName Name of the component for error messages. + * @param {?Function} getStack Returns the component stack. + * @private + */ + function checkPropTypes(typeSpecs, values, location, componentName, getStack) { + { + for (var typeSpecName in typeSpecs) { + if (has(typeSpecs, typeSpecName)) { + var error; + // Prop type validation may throw. In case they do, we don't want to + // fail the render phase where it didn't fail before. So we log it. + // After these have been cleaned up, we'll let them throw. + try { + // This is intentionally an invariant that gets caught. It's the same + // behavior as without this statement except with a better message. + if (typeof typeSpecs[typeSpecName] !== 'function') { + var err = Error( + (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + ); + err.name = 'Invariant Violation'; + throw err; + } + error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret$1); + } catch (ex) { + error = ex; + } + if (error && !(error instanceof Error)) { + printWarning( + (componentName || 'React class') + ': type specification of ' + + location + ' `' + typeSpecName + '` is invalid; the type checker ' + + 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' + + 'You may have forgotten to pass an argument to the type checker ' + + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + + 'shape all require an argument).' + ); + } + if (error instanceof Error && !(error.message in loggedTypeFailures)) { + // Only monitor this failure once because there tends to be a lot of the + // same error. + loggedTypeFailures[error.message] = true; + + var stack = getStack ? getStack() : ''; + + printWarning( + 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '') + ); + } + } + } + } + } + + /** + * Resets warning cache when testing. + * + * @private + */ + checkPropTypes.resetWarningCache = function() { + { + loggedTypeFailures = {}; + } + }; + + var checkPropTypes_1 = checkPropTypes; + + var react_development = createCommonjsModule(function (module, exports) { + + + + { + (function() { + + var _assign = objectAssign; + var checkPropTypes = checkPropTypes_1; + + var ReactVersion = '16.13.1'; + + // The Symbol used to tag the ReactElement-like types. If there is no native Symbol + // nor polyfill, then a plain number is used for performance. + var hasSymbol = typeof Symbol === 'function' && Symbol.for; + var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7; + var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca; + var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb; + var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc; + var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2; + var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd; + var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary + var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf; + var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0; + var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1; + var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8; + var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3; + var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4; + var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9; + var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5; + var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6; + var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7; + var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; + var FAUX_ITERATOR_SYMBOL = '@@iterator'; + function getIteratorFn(maybeIterable) { + if (maybeIterable === null || typeof maybeIterable !== 'object') { + return null; + } + + var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; + + if (typeof maybeIterator === 'function') { + return maybeIterator; + } + + return null; + } + + /** + * Keeps track of the current dispatcher. + */ + var ReactCurrentDispatcher = { + /** + * @internal + * @type {ReactComponent} + */ + current: null + }; + + /** + * Keeps track of the current batch's configuration such as how long an update + * should suspend for if it needs to. + */ + var ReactCurrentBatchConfig = { + suspense: null + }; + + /** + * Keeps track of the current owner. + * + * The current owner is the component who should own any components that are + * currently being constructed. + */ + var ReactCurrentOwner = { + /** + * @internal + * @type {ReactComponent} + */ + current: null + }; + + var BEFORE_SLASH_RE = /^(.*)[\\\/]/; + function describeComponentFrame (name, source, ownerName) { + var sourceInfo = ''; + + if (source) { + var path = source.fileName; + var fileName = path.replace(BEFORE_SLASH_RE, ''); + + { + // In DEV, include code for a common special case: + // prefer "folder/index.js" instead of just "index.js". + if (/^index\./.test(fileName)) { + var match = path.match(BEFORE_SLASH_RE); + + if (match) { + var pathBeforeSlash = match[1]; + + if (pathBeforeSlash) { + var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, ''); + fileName = folderName + '/' + fileName; + } + } + } + } + + sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')'; + } else if (ownerName) { + sourceInfo = ' (created by ' + ownerName + ')'; + } + + return '\n in ' + (name || 'Unknown') + sourceInfo; + } + + var Resolved = 1; + function refineResolvedLazyComponent(lazyComponent) { + return lazyComponent._status === Resolved ? lazyComponent._result : null; + } + + function getWrappedName(outerType, innerType, wrapperName) { + var functionName = innerType.displayName || innerType.name || ''; + return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName); + } + + function getComponentName(type) { + if (type == null) { + // Host root, text node or just invalid type. + return null; + } + + { + if (typeof type.tag === 'number') { + error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.'); + } + } + + if (typeof type === 'function') { + return type.displayName || type.name || null; + } + + if (typeof type === 'string') { + return type; + } + + switch (type) { + case REACT_FRAGMENT_TYPE: + return 'Fragment'; + + case REACT_PORTAL_TYPE: + return 'Portal'; + + case REACT_PROFILER_TYPE: + return "Profiler"; + + case REACT_STRICT_MODE_TYPE: + return 'StrictMode'; + + case REACT_SUSPENSE_TYPE: + return 'Suspense'; + + case REACT_SUSPENSE_LIST_TYPE: + return 'SuspenseList'; + } + + if (typeof type === 'object') { + switch (type.$$typeof) { + case REACT_CONTEXT_TYPE: + return 'Context.Consumer'; + + case REACT_PROVIDER_TYPE: + return 'Context.Provider'; + + case REACT_FORWARD_REF_TYPE: + return getWrappedName(type, type.render, 'ForwardRef'); + + case REACT_MEMO_TYPE: + return getComponentName(type.type); + + case REACT_BLOCK_TYPE: + return getComponentName(type.render); + + case REACT_LAZY_TYPE: + { + var thenable = type; + var resolvedThenable = refineResolvedLazyComponent(thenable); + + if (resolvedThenable) { + return getComponentName(resolvedThenable); + } + + break; + } + } + } + + return null; + } + + var ReactDebugCurrentFrame = {}; + var currentlyValidatingElement = null; + function setCurrentlyValidatingElement(element) { + { + currentlyValidatingElement = element; + } + } + + { + // Stack implementation injected by the current renderer. + ReactDebugCurrentFrame.getCurrentStack = null; + + ReactDebugCurrentFrame.getStackAddendum = function () { + var stack = ''; // Add an extra top frame while an element is being validated + + if (currentlyValidatingElement) { + var name = getComponentName(currentlyValidatingElement.type); + var owner = currentlyValidatingElement._owner; + stack += describeComponentFrame(name, currentlyValidatingElement._source, owner && getComponentName(owner.type)); + } // Delegate to the injected renderer-specific implementation + + + var impl = ReactDebugCurrentFrame.getCurrentStack; + + if (impl) { + stack += impl() || ''; + } + + return stack; + }; + } + + /** + * Used by act() to track whether you're inside an act() scope. + */ + var IsSomeRendererActing = { + current: false + }; + + var ReactSharedInternals = { + ReactCurrentDispatcher: ReactCurrentDispatcher, + ReactCurrentBatchConfig: ReactCurrentBatchConfig, + ReactCurrentOwner: ReactCurrentOwner, + IsSomeRendererActing: IsSomeRendererActing, + // Used by renderers to avoid bundling object-assign twice in UMD bundles: + assign: _assign + }; + + { + _assign(ReactSharedInternals, { + // These should not be included in production. + ReactDebugCurrentFrame: ReactDebugCurrentFrame, + // Shim for React DOM 16.0.0 which still destructured (but not used) this. + // TODO: remove in React 17.0. + ReactComponentTreeHook: {} + }); + } + + // by calls to these methods by a Babel plugin. + // + // In PROD (or in packages without access to React internals), + // they are left as they are instead. + + function warn(format) { + { + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + printWarning('warn', format, args); + } + } + function error(format) { + { + for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; + } + + printWarning('error', format, args); + } + } + + function printWarning(level, format, args) { + // When changing this logic, you might want to also + // update consoleWithStackDev.www.js as well. + { + var hasExistingStack = args.length > 0 && typeof args[args.length - 1] === 'string' && args[args.length - 1].indexOf('\n in') === 0; + + if (!hasExistingStack) { + var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; + var stack = ReactDebugCurrentFrame.getStackAddendum(); + + if (stack !== '') { + format += '%s'; + args = args.concat([stack]); + } + } + + var argsWithFormat = args.map(function (item) { + return '' + item; + }); // Careful: RN currently depends on this prefix + + argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it + // breaks IE9: https://github.com/facebook/react/issues/13610 + // eslint-disable-next-line react-internal/no-production-logging + + Function.prototype.apply.call(console[level], console, argsWithFormat); + + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + var argIndex = 0; + var message = 'Warning: ' + format.replace(/%s/g, function () { + return args[argIndex++]; + }); + throw new Error(message); + } catch (x) {} + } + } + + var didWarnStateUpdateForUnmountedComponent = {}; + + function warnNoop(publicInstance, callerName) { + { + var _constructor = publicInstance.constructor; + var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass'; + var warningKey = componentName + "." + callerName; + + if (didWarnStateUpdateForUnmountedComponent[warningKey]) { + return; + } + + error("Can't call %s on a component that is not yet mounted. " + 'This is a no-op, but it might indicate a bug in your application. ' + 'Instead, assign to `this.state` directly or define a `state = {};` ' + 'class property with the desired state in the %s component.', callerName, componentName); + + didWarnStateUpdateForUnmountedComponent[warningKey] = true; + } + } + /** + * This is the abstract API for an update queue. + */ + + + var ReactNoopUpdateQueue = { + /** + * Checks whether or not this composite component is mounted. + * @param {ReactClass} publicInstance The instance we want to test. + * @return {boolean} True if mounted, false otherwise. + * @protected + * @final + */ + isMounted: function (publicInstance) { + return false; + }, + + /** + * Forces an update. This should only be invoked when it is known with + * certainty that we are **not** in a DOM transaction. + * + * You may want to call this when you know that some deeper aspect of the + * component's state has changed but `setState` was not called. + * + * This will not invoke `shouldComponentUpdate`, but it will invoke + * `componentWillUpdate` and `componentDidUpdate`. + * + * @param {ReactClass} publicInstance The instance that should rerender. + * @param {?function} callback Called after component is updated. + * @param {?string} callerName name of the calling function in the public API. + * @internal + */ + enqueueForceUpdate: function (publicInstance, callback, callerName) { + warnNoop(publicInstance, 'forceUpdate'); + }, + + /** + * Replaces all of the state. Always use this or `setState` to mutate state. + * You should treat `this.state` as immutable. + * + * There is no guarantee that `this.state` will be immediately updated, so + * accessing `this.state` after calling this method may return the old value. + * + * @param {ReactClass} publicInstance The instance that should rerender. + * @param {object} completeState Next state. + * @param {?function} callback Called after component is updated. + * @param {?string} callerName name of the calling function in the public API. + * @internal + */ + enqueueReplaceState: function (publicInstance, completeState, callback, callerName) { + warnNoop(publicInstance, 'replaceState'); + }, + + /** + * Sets a subset of the state. This only exists because _pendingState is + * internal. This provides a merging strategy that is not available to deep + * properties which is confusing. TODO: Expose pendingState or don't use it + * during the merge. + * + * @param {ReactClass} publicInstance The instance that should rerender. + * @param {object} partialState Next partial state to be merged with state. + * @param {?function} callback Called after component is updated. + * @param {?string} Name of the calling function in the public API. + * @internal + */ + enqueueSetState: function (publicInstance, partialState, callback, callerName) { + warnNoop(publicInstance, 'setState'); + } + }; + + var emptyObject = {}; + + { + Object.freeze(emptyObject); + } + /** + * Base class helpers for the updating state of a component. + */ + + + function Component(props, context, updater) { + this.props = props; + this.context = context; // If a component has string refs, we will assign a different object later. + + this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the + // renderer. + + this.updater = updater || ReactNoopUpdateQueue; + } + + Component.prototype.isReactComponent = {}; + /** + * Sets a subset of the state. Always use this to mutate + * state. You should treat `this.state` as immutable. + * + * There is no guarantee that `this.state` will be immediately updated, so + * accessing `this.state` after calling this method may return the old value. + * + * There is no guarantee that calls to `setState` will run synchronously, + * as they may eventually be batched together. You can provide an optional + * callback that will be executed when the call to setState is actually + * completed. + * + * When a function is provided to setState, it will be called at some point in + * the future (not synchronously). It will be called with the up to date + * component arguments (state, props, context). These values can be different + * from this.* because your function may be called after receiveProps but before + * shouldComponentUpdate, and this new state, props, and context will not yet be + * assigned to this. + * + * @param {object|function} partialState Next partial state or function to + * produce next partial state to be merged with current state. + * @param {?function} callback Called after state is updated. + * @final + * @protected + */ + + Component.prototype.setState = function (partialState, callback) { + if (!(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null)) { + { + throw Error( "setState(...): takes an object of state variables to update or a function which returns an object of state variables." ); + } + } + + this.updater.enqueueSetState(this, partialState, callback, 'setState'); + }; + /** + * Forces an update. This should only be invoked when it is known with + * certainty that we are **not** in a DOM transaction. + * + * You may want to call this when you know that some deeper aspect of the + * component's state has changed but `setState` was not called. + * + * This will not invoke `shouldComponentUpdate`, but it will invoke + * `componentWillUpdate` and `componentDidUpdate`. + * + * @param {?function} callback Called after update is complete. + * @final + * @protected + */ + + + Component.prototype.forceUpdate = function (callback) { + this.updater.enqueueForceUpdate(this, callback, 'forceUpdate'); + }; + /** + * Deprecated APIs. These APIs used to exist on classic React classes but since + * we would like to deprecate them, we're not going to move them over to this + * modern base class. Instead, we define a getter that warns if it's accessed. + */ + + + { + var deprecatedAPIs = { + isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'], + replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).'] + }; + + var defineDeprecationWarning = function (methodName, info) { + Object.defineProperty(Component.prototype, methodName, { + get: function () { + warn('%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]); + + return undefined; + } + }); + }; + + for (var fnName in deprecatedAPIs) { + if (deprecatedAPIs.hasOwnProperty(fnName)) { + defineDeprecationWarning(fnName, deprecatedAPIs[fnName]); + } + } + } + + function ComponentDummy() {} + + ComponentDummy.prototype = Component.prototype; + /** + * Convenience component with default shallow equality check for sCU. + */ + + function PureComponent(props, context, updater) { + this.props = props; + this.context = context; // If a component has string refs, we will assign a different object later. + + this.refs = emptyObject; + this.updater = updater || ReactNoopUpdateQueue; + } + + var pureComponentPrototype = PureComponent.prototype = new ComponentDummy(); + pureComponentPrototype.constructor = PureComponent; // Avoid an extra prototype jump for these methods. + + _assign(pureComponentPrototype, Component.prototype); + + pureComponentPrototype.isPureReactComponent = true; + + // an immutable object with a single mutable value + function createRef() { + var refObject = { + current: null + }; + + { + Object.seal(refObject); + } + + return refObject; + } + + var hasOwnProperty = Object.prototype.hasOwnProperty; + var RESERVED_PROPS = { + key: true, + ref: true, + __self: true, + __source: true + }; + var specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs; + + { + didWarnAboutStringRefs = {}; + } + + function hasValidRef(config) { + { + if (hasOwnProperty.call(config, 'ref')) { + var getter = Object.getOwnPropertyDescriptor(config, 'ref').get; + + if (getter && getter.isReactWarning) { + return false; + } + } + } + + return config.ref !== undefined; + } + + function hasValidKey(config) { + { + if (hasOwnProperty.call(config, 'key')) { + var getter = Object.getOwnPropertyDescriptor(config, 'key').get; + + if (getter && getter.isReactWarning) { + return false; + } + } + } + + return config.key !== undefined; + } + + function defineKeyPropWarningGetter(props, displayName) { + var warnAboutAccessingKey = function () { + { + if (!specialPropKeyWarningShown) { + specialPropKeyWarningShown = true; + + error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName); + } + } + }; + + warnAboutAccessingKey.isReactWarning = true; + Object.defineProperty(props, 'key', { + get: warnAboutAccessingKey, + configurable: true + }); + } + + function defineRefPropWarningGetter(props, displayName) { + var warnAboutAccessingRef = function () { + { + if (!specialPropRefWarningShown) { + specialPropRefWarningShown = true; + + error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName); + } + } + }; + + warnAboutAccessingRef.isReactWarning = true; + Object.defineProperty(props, 'ref', { + get: warnAboutAccessingRef, + configurable: true + }); + } + + function warnIfStringRefCannotBeAutoConverted(config) { + { + if (typeof config.ref === 'string' && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) { + var componentName = getComponentName(ReactCurrentOwner.current.type); + + if (!didWarnAboutStringRefs[componentName]) { + error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://fb.me/react-strict-mode-string-ref', getComponentName(ReactCurrentOwner.current.type), config.ref); + + didWarnAboutStringRefs[componentName] = true; + } + } + } + } + /** + * Factory method to create a new React element. This no longer adheres to + * the class pattern, so do not use new to call it. Also, instanceof check + * will not work. Instead test $$typeof field against Symbol.for('react.element') to check + * if something is a React Element. + * + * @param {*} type + * @param {*} props + * @param {*} key + * @param {string|object} ref + * @param {*} owner + * @param {*} self A *temporary* helper to detect places where `this` is + * different from the `owner` when React.createElement is called, so that we + * can warn. We want to get rid of owner and replace string `ref`s with arrow + * functions, and as long as `this` and owner are the same, there will be no + * change in behavior. + * @param {*} source An annotation object (added by a transpiler or otherwise) + * indicating filename, line number, and/or other information. + * @internal + */ + + + var ReactElement = function (type, key, ref, self, source, owner, props) { + var element = { + // This tag allows us to uniquely identify this as a React Element + $$typeof: REACT_ELEMENT_TYPE, + // Built-in properties that belong on the element + type: type, + key: key, + ref: ref, + props: props, + // Record the component responsible for creating this element. + _owner: owner + }; + + { + // The validation flag is currently mutative. We put it on + // an external backing store so that we can freeze the whole object. + // This can be replaced with a WeakMap once they are implemented in + // commonly used development environments. + element._store = {}; // To make comparing ReactElements easier for testing purposes, we make + // the validation flag non-enumerable (where possible, which should + // include every environment we run tests in), so the test framework + // ignores it. + + Object.defineProperty(element._store, 'validated', { + configurable: false, + enumerable: false, + writable: true, + value: false + }); // self and source are DEV only properties. + + Object.defineProperty(element, '_self', { + configurable: false, + enumerable: false, + writable: false, + value: self + }); // Two elements created in two different places should be considered + // equal for testing purposes and therefore we hide it from enumeration. + + Object.defineProperty(element, '_source', { + configurable: false, + enumerable: false, + writable: false, + value: source + }); + + if (Object.freeze) { + Object.freeze(element.props); + Object.freeze(element); + } + } + + return element; + }; + /** + * Create and return a new ReactElement of the given type. + * See https://reactjs.org/docs/react-api.html#createelement + */ + + function createElement(type, config, children) { + var propName; // Reserved names are extracted + + var props = {}; + var key = null; + var ref = null; + var self = null; + var source = null; + + if (config != null) { + if (hasValidRef(config)) { + ref = config.ref; + + { + warnIfStringRefCannotBeAutoConverted(config); + } + } + + if (hasValidKey(config)) { + key = '' + config.key; + } + + self = config.__self === undefined ? null : config.__self; + source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object + + for (propName in config) { + if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { + props[propName] = config[propName]; + } + } + } // Children can be more than one argument, and those are transferred onto + // the newly allocated props object. + + + var childrenLength = arguments.length - 2; + + if (childrenLength === 1) { + props.children = children; + } else if (childrenLength > 1) { + var childArray = Array(childrenLength); + + for (var i = 0; i < childrenLength; i++) { + childArray[i] = arguments[i + 2]; + } + + { + if (Object.freeze) { + Object.freeze(childArray); + } + } + + props.children = childArray; + } // Resolve default props + + + if (type && type.defaultProps) { + var defaultProps = type.defaultProps; + + for (propName in defaultProps) { + if (props[propName] === undefined) { + props[propName] = defaultProps[propName]; + } + } + } + + { + if (key || ref) { + var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type; + + if (key) { + defineKeyPropWarningGetter(props, displayName); + } + + if (ref) { + defineRefPropWarningGetter(props, displayName); + } + } + } + + return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props); + } + function cloneAndReplaceKey(oldElement, newKey) { + var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props); + return newElement; + } + /** + * Clone and return a new ReactElement using element as the starting point. + * See https://reactjs.org/docs/react-api.html#cloneelement + */ + + function cloneElement(element, config, children) { + if (!!(element === null || element === undefined)) { + { + throw Error( "React.cloneElement(...): The argument must be a React element, but you passed " + element + "." ); + } + } + + var propName; // Original props are copied + + var props = _assign({}, element.props); // Reserved names are extracted + + + var key = element.key; + var ref = element.ref; // Self is preserved since the owner is preserved. + + var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a + // transpiler, and the original source is probably a better indicator of the + // true owner. + + var source = element._source; // Owner will be preserved, unless ref is overridden + + var owner = element._owner; + + if (config != null) { + if (hasValidRef(config)) { + // Silently steal the ref from the parent. + ref = config.ref; + owner = ReactCurrentOwner.current; + } + + if (hasValidKey(config)) { + key = '' + config.key; + } // Remaining properties override existing props + + + var defaultProps; + + if (element.type && element.type.defaultProps) { + defaultProps = element.type.defaultProps; + } + + for (propName in config) { + if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { + if (config[propName] === undefined && defaultProps !== undefined) { + // Resolve default props + props[propName] = defaultProps[propName]; + } else { + props[propName] = config[propName]; + } + } + } + } // Children can be more than one argument, and those are transferred onto + // the newly allocated props object. + + + var childrenLength = arguments.length - 2; + + if (childrenLength === 1) { + props.children = children; + } else if (childrenLength > 1) { + var childArray = Array(childrenLength); + + for (var i = 0; i < childrenLength; i++) { + childArray[i] = arguments[i + 2]; + } + + props.children = childArray; + } + + return ReactElement(element.type, key, ref, self, source, owner, props); + } + /** + * Verifies the object is a ReactElement. + * See https://reactjs.org/docs/react-api.html#isvalidelement + * @param {?object} object + * @return {boolean} True if `object` is a ReactElement. + * @final + */ + + function isValidElement(object) { + return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; + } + + var SEPARATOR = '.'; + var SUBSEPARATOR = ':'; + /** + * Escape and wrap key so it is safe to use as a reactid + * + * @param {string} key to be escaped. + * @return {string} the escaped key. + */ + + function escape(key) { + var escapeRegex = /[=:]/g; + var escaperLookup = { + '=': '=0', + ':': '=2' + }; + var escapedString = ('' + key).replace(escapeRegex, function (match) { + return escaperLookup[match]; + }); + return '$' + escapedString; + } + /** + * TODO: Test that a single child and an array with one item have the same key + * pattern. + */ + + + var didWarnAboutMaps = false; + var userProvidedKeyEscapeRegex = /\/+/g; + + function escapeUserProvidedKey(text) { + return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/'); + } + + var POOL_SIZE = 10; + var traverseContextPool = []; + + function getPooledTraverseContext(mapResult, keyPrefix, mapFunction, mapContext) { + if (traverseContextPool.length) { + var traverseContext = traverseContextPool.pop(); + traverseContext.result = mapResult; + traverseContext.keyPrefix = keyPrefix; + traverseContext.func = mapFunction; + traverseContext.context = mapContext; + traverseContext.count = 0; + return traverseContext; + } else { + return { + result: mapResult, + keyPrefix: keyPrefix, + func: mapFunction, + context: mapContext, + count: 0 + }; + } + } + + function releaseTraverseContext(traverseContext) { + traverseContext.result = null; + traverseContext.keyPrefix = null; + traverseContext.func = null; + traverseContext.context = null; + traverseContext.count = 0; + + if (traverseContextPool.length < POOL_SIZE) { + traverseContextPool.push(traverseContext); + } + } + /** + * @param {?*} children Children tree container. + * @param {!string} nameSoFar Name of the key path so far. + * @param {!function} callback Callback to invoke with each child found. + * @param {?*} traverseContext Used to pass information throughout the traversal + * process. + * @return {!number} The number of children in this subtree. */ -function isObject(e){return"[object Object]"===Object.prototype.toString.call(e)}function isPlainObject(e){var t,n;return!1!==isObject(e)&&(void 0===(t=e.constructor)||!1!==isObject(n=t.prototype)&&!1!==n.hasOwnProperty("isPrototypeOf"))}function lowercaseKeys(e){return e?Object.keys(e).reduce((t,n)=>(t[n.toLowerCase()]=e[n],t),{}):{}}function mergeDeep(e,t){const n=Object.assign({},e);return Object.keys(t).forEach(r=>{isPlainObject(t[r])?r in e?n[r]=mergeDeep(e[r],t[r]):Object.assign(n,{[r]:t[r]}):Object.assign(n,{[r]:t[r]})}),n}function merge(e,t,n){if("string"==typeof t){let[e,r]=t.split(" ");n=Object.assign(r?{method:e,url:r}:{url:e},n)}else n=Object.assign({},t);n.headers=lowercaseKeys(n.headers);const r=mergeDeep(e||{},n);return e&&e.mediaType.previews.length&&(r.mediaType.previews=e.mediaType.previews.filter(e=>!r.mediaType.previews.includes(e)).concat(r.mediaType.previews)),r.mediaType.previews=r.mediaType.previews.map(e=>e.replace(/-preview/,"")),r}function addQueryParameters(e,t){const n=/\?/.test(e)?"&":"?",r=Object.keys(t);return 0===r.length?e:e+n+r.map(e=>"q"===e?"q="+t.q.split("+").map(encodeURIComponent).join("+"):`${e}=${encodeURIComponent(t[e])}`).join("&")}beforeAfterHook.Hook=Hook_1,beforeAfterHook.Singular=Singular,beforeAfterHook.Collection=Collection;const urlVariableRegex=/\{[^}]+\}/g;function removeNonChars(e){return e.replace(/^\W+|\W+$/g,"").split(/,/)}function extractUrlVariableNames(e){const t=e.match(urlVariableRegex);return t?t.map(removeNonChars).reduce((e,t)=>e.concat(t),[]):[]}function omit(e,t){return Object.keys(e).filter(e=>!t.includes(e)).reduce((t,n)=>(t[n]=e[n],t),{})}function encodeReserved(e){return e.split(/(%[0-9A-Fa-f]{2})/g).map((function(e){return/%[0-9A-Fa-f]/.test(e)||(e=encodeURI(e).replace(/%5B/g,"[").replace(/%5D/g,"]")),e})).join("")}function encodeUnreserved(e){return encodeURIComponent(e).replace(/[!'()*]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}))}function encodeValue(e,t,n){return t="+"===e||"#"===e?encodeReserved(t):encodeUnreserved(t),n?encodeUnreserved(n)+"="+t:t}function isDefined(e){return null!=e}function isKeyOperator(e){return";"===e||"&"===e||"?"===e}function getValues(e,t,n,r){var i=e[n],o=[];if(isDefined(i)&&""!==i)if("string"==typeof i||"number"==typeof i||"boolean"==typeof i)i=i.toString(),r&&"*"!==r&&(i=i.substring(0,parseInt(r,10))),o.push(encodeValue(t,i,isKeyOperator(t)?n:""));else if("*"===r)Array.isArray(i)?i.filter(isDefined).forEach((function(e){o.push(encodeValue(t,e,isKeyOperator(t)?n:""))})):Object.keys(i).forEach((function(e){isDefined(i[e])&&o.push(encodeValue(t,i[e],e))}));else{const e=[];Array.isArray(i)?i.filter(isDefined).forEach((function(n){e.push(encodeValue(t,n))})):Object.keys(i).forEach((function(n){isDefined(i[n])&&(e.push(encodeUnreserved(n)),e.push(encodeValue(t,i[n].toString())))})),isKeyOperator(t)?o.push(encodeUnreserved(n)+"="+e.join(",")):0!==e.length&&o.push(e.join(","))}else";"===t?isDefined(i)&&o.push(encodeUnreserved(n)):""!==i||"&"!==t&&"?"!==t?""===i&&o.push(""):o.push(encodeUnreserved(n)+"=");return o}function parseUrl(e){return{expand:expand.bind(null,e)}}function expand(e,t){var n=["+","#",".","/",";","?","&"];return e.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,(function(e,r,i){if(r){let e="";const i=[];if(-1!==n.indexOf(r.charAt(0))&&(e=r.charAt(0),r=r.substr(1)),r.split(/,/g).forEach((function(n){var r=/([^:\*]*)(?::(\d+)|(\*))?/.exec(n);i.push(getValues(t,e,r[1],r[2]||r[3]))})),e&&"+"!==e){var o=",";return"?"===e?o="&":"#"!==e&&(o=e),(0!==i.length?e:"")+i.join(o)}return i.join(",")}return encodeReserved(i)}))}function parse$1(e){let t,n=e.method.toUpperCase(),r=(e.url||"/").replace(/:([a-z]\w+)/g,"{+$1}"),i=Object.assign({},e.headers),o=omit(e,["method","baseUrl","url","headers","request","mediaType"]);const a=extractUrlVariableNames(r);r=parseUrl(r).expand(o),/^http/.test(r)||(r=e.baseUrl+r);const s=omit(o,Object.keys(e).filter(e=>a.includes(e)).concat("baseUrl"));if(!/application\/octet-stream/i.test(i.accept)&&(e.mediaType.format&&(i.accept=i.accept.split(/,/).map(t=>t.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,"application/vnd$1$2."+e.mediaType.format)).join(",")),e.mediaType.previews.length)){const t=i.accept.match(/[\w-]+(?=-preview)/g)||[];i.accept=t.concat(e.mediaType.previews).map(t=>`application/vnd.github.${t}-preview${e.mediaType.format?"."+e.mediaType.format:"+json"}`).join(",")}return["GET","HEAD"].includes(n)?r=addQueryParameters(r,s):"data"in s?t=s.data:Object.keys(s).length?t=s:i["content-length"]=0,i["content-type"]||void 0===t||(i["content-type"]="application/json; charset=utf-8"),["PATCH","PUT"].includes(n)&&void 0===t&&(t=""),Object.assign({method:n,url:r,headers:i},void 0!==t?{body:t}:null,e.request?{request:e.request}:null)}function endpointWithDefaults(e,t,n){return parse$1(merge(e,t,n))}function withDefaults(e,t){const n=merge(e,t),r=endpointWithDefaults.bind(null,n);return Object.assign(r,{DEFAULTS:n,defaults:withDefaults.bind(null,n),merge:merge.bind(null,n),parse:parse$1})}const VERSION="6.0.5",userAgent=`octokit-endpoint.js/${VERSION} ${getUserAgent()}`,DEFAULTS={method:"GET",baseUrl:"https://api.github.com",headers:{accept:"application/vnd.github.v3+json","user-agent":userAgent},mediaType:{format:"",previews:[]}},endpoint=withDefaults(null,DEFAULTS);var browser$2=createCommonjsModule((function(e,t){var n=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==n)return n;throw new Error("unable to locate global object")}();e.exports=t=n.fetch,t.default=n.fetch.bind(n),t.Headers=n.Headers,t.Request=n.Request,t.Response=n.Response})),browser_1=browser$2.Headers,browser_2=browser$2.Request,browser_3=browser$2.Response;class Deprecation extends Error{constructor(e){super(e),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="Deprecation"}}var wrappy_1=wrappy;function wrappy(e,t){if(e&&t)return wrappy(e)(t);if("function"!=typeof e)throw new TypeError("need wrapper function");return Object.keys(e).forEach((function(t){n[t]=e[t]})),n;function n(){for(var t=new Array(arguments.length),n=0;nconsole.warn(e));class RequestError extends Error{constructor(e,t,n){super(e),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="HttpError",this.status=t,Object.defineProperty(this,"code",{get:()=>(logOnce(new Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`.")),t)}),this.headers=n.headers||{};const r=Object.assign({},n.request);n.request.headers.authorization&&(r.headers=Object.assign({},n.request.headers,{authorization:n.request.headers.authorization.replace(/ .*$/," [REDACTED]")})),r.url=r.url.replace(/\bclient_secret=\w+/g,"client_secret=[REDACTED]").replace(/\baccess_token=\w+/g,"access_token=[REDACTED]"),this.request=r}}const VERSION$1="5.4.7";function getBufferResponse(e){return e.arrayBuffer()}function fetchWrapper(e){(isPlainObject(e.body)||Array.isArray(e.body))&&(e.body=JSON.stringify(e.body));let t,n,r={};return(e.request&&e.request.fetch||browser$2)(e.url,Object.assign({method:e.method,body:e.body,headers:e.headers,redirect:e.redirect},e.request)).then(i=>{n=i.url,t=i.status;for(const e of i.headers)r[e[0]]=e[1];if(204===t||205===t)return;if("HEAD"===e.method){if(t<400)return;throw new RequestError(i.statusText,t,{headers:r,request:e})}if(304===t)throw new RequestError("Not modified",t,{headers:r,request:e});if(t>=400)return i.text().then(n=>{const i=new RequestError(n,t,{headers:r,request:e});try{let e=JSON.parse(i.message);Object.assign(i,e);let t=e.errors;i.message=i.message+": "+t.map(JSON.stringify).join(", ")}catch(e){}throw i});const o=i.headers.get("content-type");return/application\/json/.test(o)?i.json():!o||/^text\/|charset=utf-8$/.test(o)?i.text():getBufferResponse(i)}).then(e=>({status:t,url:n,headers:r,data:e})).catch(t=>{if(t instanceof RequestError)throw t;throw new RequestError(t.message,500,{headers:r,request:e})})}function withDefaults$1(e,t){const n=e.defaults(t);return Object.assign((function(e,t){const r=n.merge(e,t);if(!r.request||!r.request.hook)return fetchWrapper(n.parse(r));const i=(e,t)=>fetchWrapper(n.parse(n.merge(e,t)));return Object.assign(i,{endpoint:n,defaults:withDefaults$1.bind(null,n)}),r.request.hook(i,r)}),{endpoint:n,defaults:withDefaults$1.bind(null,n)})}const request=withDefaults$1(endpoint,{headers:{"user-agent":`octokit-request.js/${VERSION$1} ${getUserAgent()}`}}),VERSION$2="4.5.4";class GraphqlError extends Error{constructor(e,t){super(t.data.errors[0].message),Object.assign(this,t.data),Object.assign(this,{headers:t.headers}),this.name="GraphqlError",this.request=e,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}const NON_VARIABLE_OPTIONS=["method","baseUrl","url","headers","request","query","mediaType"];function graphql(e,t,n){n=n="string"==typeof t?Object.assign({query:t},n):t;const r=Object.keys(n).reduce((e,t)=>NON_VARIABLE_OPTIONS.includes(t)?(e[t]=n[t],e):(e.variables||(e.variables={}),e.variables[t]=n[t],e),{});return e(r).then(e=>{if(e.data.errors){const t={};for(const n of Object.keys(e.headers))t[n]=e.headers[n];throw new GraphqlError(r,{headers:t,data:e.data})}return e.data.data})}function withDefaults$2(e,t){const n=e.defaults(t);return Object.assign((e,t)=>graphql(n,e,t),{defaults:withDefaults$2.bind(null,n),endpoint:request.endpoint})}const graphql$1=withDefaults$2(request,{headers:{"user-agent":`octokit-graphql.js/${VERSION$2} ${getUserAgent()}`},method:"POST",url:"/graphql"});function withCustomRequest(e){return withDefaults$2(e,{method:"POST",url:"/graphql"})}async function auth(e){const t=3===e.split(/\./).length?"app":/^v\d+\./.test(e)?"installation":"oauth";return{type:"token",token:e,tokenType:t}}function withAuthorizationPrefix(e){return 3===e.split(/\./).length?"bearer "+e:"token "+e}async function hook(e,t,n,r){const i=t.endpoint.merge(n,r);return i.headers.authorization=withAuthorizationPrefix(e),t(i)}const createTokenAuth=function(e){if(!e)throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");if("string"!=typeof e)throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");return e=e.replace(/^(token|bearer) +/i,""),Object.assign(auth.bind(null,e),{hook:hook.bind(null,e)})},VERSION$3="3.1.2";class Octokit{constructor(e={}){const t=new Collection,n={baseUrl:request.endpoint.DEFAULTS.baseUrl,headers:{},request:Object.assign({},e.request,{hook:t.bind(null,"request")}),mediaType:{previews:[],format:""}};if(n.headers["user-agent"]=[e.userAgent,`octokit-core.js/${VERSION$3} ${getUserAgent()}`].filter(Boolean).join(" "),e.baseUrl&&(n.baseUrl=e.baseUrl),e.previews&&(n.mediaType.previews=e.previews),e.timeZone&&(n.headers["time-zone"]=e.timeZone),this.request=request.defaults(n),this.graphql=withCustomRequest(this.request).defaults({...n,baseUrl:n.baseUrl.replace(/\/api\/v3$/,"/api")}),this.log=Object.assign({debug:()=>{},info:()=>{},warn:console.warn.bind(console),error:console.error.bind(console)},e.log),this.hook=t,e.authStrategy){const n=e.authStrategy(Object.assign({request:this.request},e.auth));t.wrap("request",n.hook),this.auth=n}else if(e.auth){const n=createTokenAuth(e.auth);t.wrap("request",n.hook),this.auth=n}else this.auth=async()=>({type:"unauthenticated"});this.constructor.plugins.forEach(t=>{Object.assign(this,t(this,e))})}static defaults(e){return class extends(this){constructor(...t){const n=t[0]||{};super("function"!=typeof e?Object.assign({},e,n,n.userAgent&&e.userAgent?{userAgent:`${n.userAgent} ${e.userAgent}`}:null):e(n))}}}static plugin(...e){var t;const n=this.plugins;return(t=class extends(this){}).plugins=n.concat(e.filter(e=>!n.includes(e))),t}}Octokit.VERSION=VERSION$3,Octokit.plugins=[];const VERSION$4="1.0.0";function requestLog(e){e.hook.wrap("request",(t,n)=>{e.log.debug("request",n);const r=Date.now(),i=e.request.endpoint.parse(n),o=i.url.replace(n.baseUrl,"");return t(n).then(t=>(e.log.info(`${i.method} ${o} - ${t.status} in ${Date.now()-r}ms`),t)).catch(t=>{throw e.log.info(`${i.method} ${o} - ${t.status} in ${Date.now()-r}ms`),t})})}requestLog.VERSION=VERSION$4;const VERSION$5="2.3.0";function normalizePaginatedListResponse(e){if(!("total_count"in e.data&&!("url"in e.data)))return e;const t=e.data.incomplete_results,n=e.data.repository_selection,r=e.data.total_count;delete e.data.incomplete_results,delete e.data.repository_selection,delete e.data.total_count;const i=Object.keys(e.data)[0],o=e.data[i];return e.data=o,void 0!==t&&(e.data.incomplete_results=t),void 0!==n&&(e.data.repository_selection=n),e.data.total_count=r,e}function iterator(e,t,n){const r="function"==typeof t?t.endpoint(n):e.request.endpoint(t,n),i="function"==typeof t?t:e.request,o=r.method,a=r.headers;let s=r.url;return{[Symbol.asyncIterator]:()=>({next:()=>s?i({method:o,url:s,headers:a}).then(normalizePaginatedListResponse).then(e=>(s=((e.headers.link||"").match(/<([^>]+)>;\s*rel="next"/)||[])[1],{value:e})):Promise.resolve({done:!0})})}}function paginate(e,t,n,r){return"function"==typeof n&&(r=n,n=void 0),gather(e,[],iterator(e,t,n)[Symbol.asyncIterator](),r)}function gather(e,t,n,r){return n.next().then(i=>{if(i.done)return t;let o=!1;return t=t.concat(r?r(i.value,(function(){o=!0})):i.value.data),o?t:gather(e,t,n,r)})}function paginateRest(e){return{paginate:Object.assign(paginate.bind(null,e),{iterator:iterator.bind(null,e)})}}paginateRest.VERSION=VERSION$5;const Endpoints={actions:{addSelectedRepoToOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"],cancelWorkflowRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel"],createOrUpdateOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}"],createOrUpdateRepoSecret:["PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}"],createRegistrationTokenForOrg:["POST /orgs/{org}/actions/runners/registration-token"],createRegistrationTokenForRepo:["POST /repos/{owner}/{repo}/actions/runners/registration-token"],createRemoveTokenForOrg:["POST /orgs/{org}/actions/runners/remove-token"],createRemoveTokenForRepo:["POST /repos/{owner}/{repo}/actions/runners/remove-token"],createWorkflowDispatch:["POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches"],deleteArtifact:["DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],deleteOrgSecret:["DELETE /orgs/{org}/actions/secrets/{secret_name}"],deleteRepoSecret:["DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}"],deleteSelfHostedRunnerFromOrg:["DELETE /orgs/{org}/actions/runners/{runner_id}"],deleteSelfHostedRunnerFromRepo:["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}"],deleteWorkflowRun:["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}"],deleteWorkflowRunLogs:["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs"],downloadArtifact:["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}"],downloadJobLogsForWorkflowRun:["GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs"],downloadWorkflowRunLogs:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs"],getArtifact:["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],getJobForWorkflowRun:["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"],getOrgPublicKey:["GET /orgs/{org}/actions/secrets/public-key"],getOrgSecret:["GET /orgs/{org}/actions/secrets/{secret_name}"],getRepoPublicKey:["GET /repos/{owner}/{repo}/actions/secrets/public-key"],getRepoSecret:["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"],getSelfHostedRunnerForOrg:["GET /orgs/{org}/actions/runners/{runner_id}"],getSelfHostedRunnerForRepo:["GET /repos/{owner}/{repo}/actions/runners/{runner_id}"],getWorkflow:["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"],getWorkflowRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}"],getWorkflowRunUsage:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing"],getWorkflowUsage:["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing"],listArtifactsForRepo:["GET /repos/{owner}/{repo}/actions/artifacts"],listJobsForWorkflowRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"],listOrgSecrets:["GET /orgs/{org}/actions/secrets"],listRepoSecrets:["GET /repos/{owner}/{repo}/actions/secrets"],listRepoWorkflows:["GET /repos/{owner}/{repo}/actions/workflows"],listRunnerApplicationsForOrg:["GET /orgs/{org}/actions/runners/downloads"],listRunnerApplicationsForRepo:["GET /repos/{owner}/{repo}/actions/runners/downloads"],listSelectedReposForOrgSecret:["GET /orgs/{org}/actions/secrets/{secret_name}/repositories"],listSelfHostedRunnersForOrg:["GET /orgs/{org}/actions/runners"],listSelfHostedRunnersForRepo:["GET /repos/{owner}/{repo}/actions/runners"],listWorkflowRunArtifacts:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts"],listWorkflowRuns:["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs"],listWorkflowRunsForRepo:["GET /repos/{owner}/{repo}/actions/runs"],reRunWorkflow:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun"],removeSelectedRepoFromOrgSecret:["DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"],setSelectedReposForOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories"]},activity:{checkRepoIsStarredByAuthenticatedUser:["GET /user/starred/{owner}/{repo}"],deleteRepoSubscription:["DELETE /repos/{owner}/{repo}/subscription"],deleteThreadSubscription:["DELETE /notifications/threads/{thread_id}/subscription"],getFeeds:["GET /feeds"],getRepoSubscription:["GET /repos/{owner}/{repo}/subscription"],getThread:["GET /notifications/threads/{thread_id}"],getThreadSubscriptionForAuthenticatedUser:["GET /notifications/threads/{thread_id}/subscription"],listEventsForAuthenticatedUser:["GET /users/{username}/events"],listNotificationsForAuthenticatedUser:["GET /notifications"],listOrgEventsForAuthenticatedUser:["GET /users/{username}/events/orgs/{org}"],listPublicEvents:["GET /events"],listPublicEventsForRepoNetwork:["GET /networks/{owner}/{repo}/events"],listPublicEventsForUser:["GET /users/{username}/events/public"],listPublicOrgEvents:["GET /orgs/{org}/events"],listReceivedEventsForUser:["GET /users/{username}/received_events"],listReceivedPublicEventsForUser:["GET /users/{username}/received_events/public"],listRepoEvents:["GET /repos/{owner}/{repo}/events"],listRepoNotificationsForAuthenticatedUser:["GET /repos/{owner}/{repo}/notifications"],listReposStarredByAuthenticatedUser:["GET /user/starred"],listReposStarredByUser:["GET /users/{username}/starred"],listReposWatchedByUser:["GET /users/{username}/subscriptions"],listStargazersForRepo:["GET /repos/{owner}/{repo}/stargazers"],listWatchedReposForAuthenticatedUser:["GET /user/subscriptions"],listWatchersForRepo:["GET /repos/{owner}/{repo}/subscribers"],markNotificationsAsRead:["PUT /notifications"],markRepoNotificationsAsRead:["PUT /repos/{owner}/{repo}/notifications"],markThreadAsRead:["PATCH /notifications/threads/{thread_id}"],setRepoSubscription:["PUT /repos/{owner}/{repo}/subscription"],setThreadSubscription:["PUT /notifications/threads/{thread_id}/subscription"],starRepoForAuthenticatedUser:["PUT /user/starred/{owner}/{repo}"],unstarRepoForAuthenticatedUser:["DELETE /user/starred/{owner}/{repo}"]},apps:{addRepoToInstallation:["PUT /user/installations/{installation_id}/repositories/{repository_id}",{mediaType:{previews:["machine-man"]}}],checkToken:["POST /applications/{client_id}/token"],createContentAttachment:["POST /content_references/{content_reference_id}/attachments",{mediaType:{previews:["corsair"]}}],createFromManifest:["POST /app-manifests/{code}/conversions"],createInstallationAccessToken:["POST /app/installations/{installation_id}/access_tokens",{mediaType:{previews:["machine-man"]}}],deleteAuthorization:["DELETE /applications/{client_id}/grant"],deleteInstallation:["DELETE /app/installations/{installation_id}",{mediaType:{previews:["machine-man"]}}],deleteToken:["DELETE /applications/{client_id}/token"],getAuthenticated:["GET /app",{mediaType:{previews:["machine-man"]}}],getBySlug:["GET /apps/{app_slug}",{mediaType:{previews:["machine-man"]}}],getInstallation:["GET /app/installations/{installation_id}",{mediaType:{previews:["machine-man"]}}],getOrgInstallation:["GET /orgs/{org}/installation",{mediaType:{previews:["machine-man"]}}],getRepoInstallation:["GET /repos/{owner}/{repo}/installation",{mediaType:{previews:["machine-man"]}}],getSubscriptionPlanForAccount:["GET /marketplace_listing/accounts/{account_id}"],getSubscriptionPlanForAccountStubbed:["GET /marketplace_listing/stubbed/accounts/{account_id}"],getUserInstallation:["GET /users/{username}/installation",{mediaType:{previews:["machine-man"]}}],listAccountsForPlan:["GET /marketplace_listing/plans/{plan_id}/accounts"],listAccountsForPlanStubbed:["GET /marketplace_listing/stubbed/plans/{plan_id}/accounts"],listInstallationReposForAuthenticatedUser:["GET /user/installations/{installation_id}/repositories",{mediaType:{previews:["machine-man"]}}],listInstallations:["GET /app/installations",{mediaType:{previews:["machine-man"]}}],listInstallationsForAuthenticatedUser:["GET /user/installations",{mediaType:{previews:["machine-man"]}}],listPlans:["GET /marketplace_listing/plans"],listPlansStubbed:["GET /marketplace_listing/stubbed/plans"],listReposAccessibleToInstallation:["GET /installation/repositories",{mediaType:{previews:["machine-man"]}}],listSubscriptionsForAuthenticatedUser:["GET /user/marketplace_purchases"],listSubscriptionsForAuthenticatedUserStubbed:["GET /user/marketplace_purchases/stubbed"],removeRepoFromInstallation:["DELETE /user/installations/{installation_id}/repositories/{repository_id}",{mediaType:{previews:["machine-man"]}}],resetToken:["PATCH /applications/{client_id}/token"],revokeInstallationAccessToken:["DELETE /installation/token"],suspendInstallation:["PUT /app/installations/{installation_id}/suspended"],unsuspendInstallation:["DELETE /app/installations/{installation_id}/suspended"]},billing:{getGithubActionsBillingOrg:["GET /orgs/{org}/settings/billing/actions"],getGithubActionsBillingUser:["GET /users/{username}/settings/billing/actions"],getGithubPackagesBillingOrg:["GET /orgs/{org}/settings/billing/packages"],getGithubPackagesBillingUser:["GET /users/{username}/settings/billing/packages"],getSharedStorageBillingOrg:["GET /orgs/{org}/settings/billing/shared-storage"],getSharedStorageBillingUser:["GET /users/{username}/settings/billing/shared-storage"]},checks:{create:["POST /repos/{owner}/{repo}/check-runs",{mediaType:{previews:["antiope"]}}],createSuite:["POST /repos/{owner}/{repo}/check-suites",{mediaType:{previews:["antiope"]}}],get:["GET /repos/{owner}/{repo}/check-runs/{check_run_id}",{mediaType:{previews:["antiope"]}}],getSuite:["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}",{mediaType:{previews:["antiope"]}}],listAnnotations:["GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations",{mediaType:{previews:["antiope"]}}],listForRef:["GET /repos/{owner}/{repo}/commits/{ref}/check-runs",{mediaType:{previews:["antiope"]}}],listForSuite:["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs",{mediaType:{previews:["antiope"]}}],listSuitesForRef:["GET /repos/{owner}/{repo}/commits/{ref}/check-suites",{mediaType:{previews:["antiope"]}}],rerequestSuite:["POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest",{mediaType:{previews:["antiope"]}}],setSuitesPreferences:["PATCH /repos/{owner}/{repo}/check-suites/preferences",{mediaType:{previews:["antiope"]}}],update:["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}",{mediaType:{previews:["antiope"]}}]},codeScanning:{getAlert:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_id}"],listAlertsForRepo:["GET /repos/{owner}/{repo}/code-scanning/alerts"]},codesOfConduct:{getAllCodesOfConduct:["GET /codes_of_conduct",{mediaType:{previews:["scarlet-witch"]}}],getConductCode:["GET /codes_of_conduct/{key}",{mediaType:{previews:["scarlet-witch"]}}],getForRepo:["GET /repos/{owner}/{repo}/community/code_of_conduct",{mediaType:{previews:["scarlet-witch"]}}]},emojis:{get:["GET /emojis"]},gists:{checkIsStarred:["GET /gists/{gist_id}/star"],create:["POST /gists"],createComment:["POST /gists/{gist_id}/comments"],delete:["DELETE /gists/{gist_id}"],deleteComment:["DELETE /gists/{gist_id}/comments/{comment_id}"],fork:["POST /gists/{gist_id}/forks"],get:["GET /gists/{gist_id}"],getComment:["GET /gists/{gist_id}/comments/{comment_id}"],getRevision:["GET /gists/{gist_id}/{sha}"],list:["GET /gists"],listComments:["GET /gists/{gist_id}/comments"],listCommits:["GET /gists/{gist_id}/commits"],listForUser:["GET /users/{username}/gists"],listForks:["GET /gists/{gist_id}/forks"],listPublic:["GET /gists/public"],listStarred:["GET /gists/starred"],star:["PUT /gists/{gist_id}/star"],unstar:["DELETE /gists/{gist_id}/star"],update:["PATCH /gists/{gist_id}"],updateComment:["PATCH /gists/{gist_id}/comments/{comment_id}"]},git:{createBlob:["POST /repos/{owner}/{repo}/git/blobs"],createCommit:["POST /repos/{owner}/{repo}/git/commits"],createRef:["POST /repos/{owner}/{repo}/git/refs"],createTag:["POST /repos/{owner}/{repo}/git/tags"],createTree:["POST /repos/{owner}/{repo}/git/trees"],deleteRef:["DELETE /repos/{owner}/{repo}/git/refs/{ref}"],getBlob:["GET /repos/{owner}/{repo}/git/blobs/{file_sha}"],getCommit:["GET /repos/{owner}/{repo}/git/commits/{commit_sha}"],getRef:["GET /repos/{owner}/{repo}/git/ref/{ref}"],getTag:["GET /repos/{owner}/{repo}/git/tags/{tag_sha}"],getTree:["GET /repos/{owner}/{repo}/git/trees/{tree_sha}"],listMatchingRefs:["GET /repos/{owner}/{repo}/git/matching-refs/{ref}"],updateRef:["PATCH /repos/{owner}/{repo}/git/refs/{ref}"]},gitignore:{getAllTemplates:["GET /gitignore/templates"],getTemplate:["GET /gitignore/templates/{name}"]},interactions:{getRestrictionsForOrg:["GET /orgs/{org}/interaction-limits",{mediaType:{previews:["sombra"]}}],getRestrictionsForRepo:["GET /repos/{owner}/{repo}/interaction-limits",{mediaType:{previews:["sombra"]}}],removeRestrictionsForOrg:["DELETE /orgs/{org}/interaction-limits",{mediaType:{previews:["sombra"]}}],removeRestrictionsForRepo:["DELETE /repos/{owner}/{repo}/interaction-limits",{mediaType:{previews:["sombra"]}}],setRestrictionsForOrg:["PUT /orgs/{org}/interaction-limits",{mediaType:{previews:["sombra"]}}],setRestrictionsForRepo:["PUT /repos/{owner}/{repo}/interaction-limits",{mediaType:{previews:["sombra"]}}]},issues:{addAssignees:["POST /repos/{owner}/{repo}/issues/{issue_number}/assignees"],addLabels:["POST /repos/{owner}/{repo}/issues/{issue_number}/labels"],checkUserCanBeAssigned:["GET /repos/{owner}/{repo}/assignees/{assignee}"],create:["POST /repos/{owner}/{repo}/issues"],createComment:["POST /repos/{owner}/{repo}/issues/{issue_number}/comments"],createLabel:["POST /repos/{owner}/{repo}/labels"],createMilestone:["POST /repos/{owner}/{repo}/milestones"],deleteComment:["DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}"],deleteLabel:["DELETE /repos/{owner}/{repo}/labels/{name}"],deleteMilestone:["DELETE /repos/{owner}/{repo}/milestones/{milestone_number}"],get:["GET /repos/{owner}/{repo}/issues/{issue_number}"],getComment:["GET /repos/{owner}/{repo}/issues/comments/{comment_id}"],getEvent:["GET /repos/{owner}/{repo}/issues/events/{event_id}"],getLabel:["GET /repos/{owner}/{repo}/labels/{name}"],getMilestone:["GET /repos/{owner}/{repo}/milestones/{milestone_number}"],list:["GET /issues"],listAssignees:["GET /repos/{owner}/{repo}/assignees"],listComments:["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"],listCommentsForRepo:["GET /repos/{owner}/{repo}/issues/comments"],listEvents:["GET /repos/{owner}/{repo}/issues/{issue_number}/events"],listEventsForRepo:["GET /repos/{owner}/{repo}/issues/events"],listEventsForTimeline:["GET /repos/{owner}/{repo}/issues/{issue_number}/timeline",{mediaType:{previews:["mockingbird"]}}],listForAuthenticatedUser:["GET /user/issues"],listForOrg:["GET /orgs/{org}/issues"],listForRepo:["GET /repos/{owner}/{repo}/issues"],listLabelsForMilestone:["GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels"],listLabelsForRepo:["GET /repos/{owner}/{repo}/labels"],listLabelsOnIssue:["GET /repos/{owner}/{repo}/issues/{issue_number}/labels"],listMilestones:["GET /repos/{owner}/{repo}/milestones"],lock:["PUT /repos/{owner}/{repo}/issues/{issue_number}/lock"],removeAllLabels:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels"],removeAssignees:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees"],removeLabel:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}"],setLabels:["PUT /repos/{owner}/{repo}/issues/{issue_number}/labels"],unlock:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock"],update:["PATCH /repos/{owner}/{repo}/issues/{issue_number}"],updateComment:["PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}"],updateLabel:["PATCH /repos/{owner}/{repo}/labels/{name}"],updateMilestone:["PATCH /repos/{owner}/{repo}/milestones/{milestone_number}"]},licenses:{get:["GET /licenses/{license}"],getAllCommonlyUsed:["GET /licenses"],getForRepo:["GET /repos/{owner}/{repo}/license"]},markdown:{render:["POST /markdown"],renderRaw:["POST /markdown/raw",{headers:{"content-type":"text/plain; charset=utf-8"}}]},meta:{get:["GET /meta"]},migrations:{cancelImport:["DELETE /repos/{owner}/{repo}/import"],deleteArchiveForAuthenticatedUser:["DELETE /user/migrations/{migration_id}/archive",{mediaType:{previews:["wyandotte"]}}],deleteArchiveForOrg:["DELETE /orgs/{org}/migrations/{migration_id}/archive",{mediaType:{previews:["wyandotte"]}}],downloadArchiveForOrg:["GET /orgs/{org}/migrations/{migration_id}/archive",{mediaType:{previews:["wyandotte"]}}],getArchiveForAuthenticatedUser:["GET /user/migrations/{migration_id}/archive",{mediaType:{previews:["wyandotte"]}}],getCommitAuthors:["GET /repos/{owner}/{repo}/import/authors"],getImportStatus:["GET /repos/{owner}/{repo}/import"],getLargeFiles:["GET /repos/{owner}/{repo}/import/large_files"],getStatusForAuthenticatedUser:["GET /user/migrations/{migration_id}",{mediaType:{previews:["wyandotte"]}}],getStatusForOrg:["GET /orgs/{org}/migrations/{migration_id}",{mediaType:{previews:["wyandotte"]}}],listForAuthenticatedUser:["GET /user/migrations",{mediaType:{previews:["wyandotte"]}}],listForOrg:["GET /orgs/{org}/migrations",{mediaType:{previews:["wyandotte"]}}],listReposForOrg:["GET /orgs/{org}/migrations/{migration_id}/repositories",{mediaType:{previews:["wyandotte"]}}],listReposForUser:["GET /user/migrations/{migration_id}/repositories",{mediaType:{previews:["wyandotte"]}}],mapCommitAuthor:["PATCH /repos/{owner}/{repo}/import/authors/{author_id}"],setLfsPreference:["PATCH /repos/{owner}/{repo}/import/lfs"],startForAuthenticatedUser:["POST /user/migrations"],startForOrg:["POST /orgs/{org}/migrations"],startImport:["PUT /repos/{owner}/{repo}/import"],unlockRepoForAuthenticatedUser:["DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock",{mediaType:{previews:["wyandotte"]}}],unlockRepoForOrg:["DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock",{mediaType:{previews:["wyandotte"]}}],updateImport:["PATCH /repos/{owner}/{repo}/import"]},orgs:{blockUser:["PUT /orgs/{org}/blocks/{username}"],checkBlockedUser:["GET /orgs/{org}/blocks/{username}"],checkMembershipForUser:["GET /orgs/{org}/members/{username}"],checkPublicMembershipForUser:["GET /orgs/{org}/public_members/{username}"],convertMemberToOutsideCollaborator:["PUT /orgs/{org}/outside_collaborators/{username}"],createInvitation:["POST /orgs/{org}/invitations"],createWebhook:["POST /orgs/{org}/hooks"],deleteWebhook:["DELETE /orgs/{org}/hooks/{hook_id}"],get:["GET /orgs/{org}"],getMembershipForAuthenticatedUser:["GET /user/memberships/orgs/{org}"],getMembershipForUser:["GET /orgs/{org}/memberships/{username}"],getWebhook:["GET /orgs/{org}/hooks/{hook_id}"],list:["GET /organizations"],listAppInstallations:["GET /orgs/{org}/installations",{mediaType:{previews:["machine-man"]}}],listBlockedUsers:["GET /orgs/{org}/blocks"],listForAuthenticatedUser:["GET /user/orgs"],listForUser:["GET /users/{username}/orgs"],listInvitationTeams:["GET /orgs/{org}/invitations/{invitation_id}/teams"],listMembers:["GET /orgs/{org}/members"],listMembershipsForAuthenticatedUser:["GET /user/memberships/orgs"],listOutsideCollaborators:["GET /orgs/{org}/outside_collaborators"],listPendingInvitations:["GET /orgs/{org}/invitations"],listPublicMembers:["GET /orgs/{org}/public_members"],listWebhooks:["GET /orgs/{org}/hooks"],pingWebhook:["POST /orgs/{org}/hooks/{hook_id}/pings"],removeMember:["DELETE /orgs/{org}/members/{username}"],removeMembershipForUser:["DELETE /orgs/{org}/memberships/{username}"],removeOutsideCollaborator:["DELETE /orgs/{org}/outside_collaborators/{username}"],removePublicMembershipForAuthenticatedUser:["DELETE /orgs/{org}/public_members/{username}"],setMembershipForUser:["PUT /orgs/{org}/memberships/{username}"],setPublicMembershipForAuthenticatedUser:["PUT /orgs/{org}/public_members/{username}"],unblockUser:["DELETE /orgs/{org}/blocks/{username}"],update:["PATCH /orgs/{org}"],updateMembershipForAuthenticatedUser:["PATCH /user/memberships/orgs/{org}"],updateWebhook:["PATCH /orgs/{org}/hooks/{hook_id}"]},projects:{addCollaborator:["PUT /projects/{project_id}/collaborators/{username}",{mediaType:{previews:["inertia"]}}],createCard:["POST /projects/columns/{column_id}/cards",{mediaType:{previews:["inertia"]}}],createColumn:["POST /projects/{project_id}/columns",{mediaType:{previews:["inertia"]}}],createForAuthenticatedUser:["POST /user/projects",{mediaType:{previews:["inertia"]}}],createForOrg:["POST /orgs/{org}/projects",{mediaType:{previews:["inertia"]}}],createForRepo:["POST /repos/{owner}/{repo}/projects",{mediaType:{previews:["inertia"]}}],delete:["DELETE /projects/{project_id}",{mediaType:{previews:["inertia"]}}],deleteCard:["DELETE /projects/columns/cards/{card_id}",{mediaType:{previews:["inertia"]}}],deleteColumn:["DELETE /projects/columns/{column_id}",{mediaType:{previews:["inertia"]}}],get:["GET /projects/{project_id}",{mediaType:{previews:["inertia"]}}],getCard:["GET /projects/columns/cards/{card_id}",{mediaType:{previews:["inertia"]}}],getColumn:["GET /projects/columns/{column_id}",{mediaType:{previews:["inertia"]}}],getPermissionForUser:["GET /projects/{project_id}/collaborators/{username}/permission",{mediaType:{previews:["inertia"]}}],listCards:["GET /projects/columns/{column_id}/cards",{mediaType:{previews:["inertia"]}}],listCollaborators:["GET /projects/{project_id}/collaborators",{mediaType:{previews:["inertia"]}}],listColumns:["GET /projects/{project_id}/columns",{mediaType:{previews:["inertia"]}}],listForOrg:["GET /orgs/{org}/projects",{mediaType:{previews:["inertia"]}}],listForRepo:["GET /repos/{owner}/{repo}/projects",{mediaType:{previews:["inertia"]}}],listForUser:["GET /users/{username}/projects",{mediaType:{previews:["inertia"]}}],moveCard:["POST /projects/columns/cards/{card_id}/moves",{mediaType:{previews:["inertia"]}}],moveColumn:["POST /projects/columns/{column_id}/moves",{mediaType:{previews:["inertia"]}}],removeCollaborator:["DELETE /projects/{project_id}/collaborators/{username}",{mediaType:{previews:["inertia"]}}],update:["PATCH /projects/{project_id}",{mediaType:{previews:["inertia"]}}],updateCard:["PATCH /projects/columns/cards/{card_id}",{mediaType:{previews:["inertia"]}}],updateColumn:["PATCH /projects/columns/{column_id}",{mediaType:{previews:["inertia"]}}]},pulls:{checkIfMerged:["GET /repos/{owner}/{repo}/pulls/{pull_number}/merge"],create:["POST /repos/{owner}/{repo}/pulls"],createReplyForReviewComment:["POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies"],createReview:["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],createReviewComment:["POST /repos/{owner}/{repo}/pulls/{pull_number}/comments"],deletePendingReview:["DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"],deleteReviewComment:["DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}"],dismissReview:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals"],get:["GET /repos/{owner}/{repo}/pulls/{pull_number}"],getReview:["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"],getReviewComment:["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}"],list:["GET /repos/{owner}/{repo}/pulls"],listCommentsForReview:["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments"],listCommits:["GET /repos/{owner}/{repo}/pulls/{pull_number}/commits"],listFiles:["GET /repos/{owner}/{repo}/pulls/{pull_number}/files"],listRequestedReviewers:["GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"],listReviewComments:["GET /repos/{owner}/{repo}/pulls/{pull_number}/comments"],listReviewCommentsForRepo:["GET /repos/{owner}/{repo}/pulls/comments"],listReviews:["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],merge:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge"],removeRequestedReviewers:["DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"],requestReviewers:["POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"],submitReview:["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events"],update:["PATCH /repos/{owner}/{repo}/pulls/{pull_number}"],updateBranch:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch",{mediaType:{previews:["lydian"]}}],updateReview:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"],updateReviewComment:["PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}"]},rateLimit:{get:["GET /rate_limit"]},reactions:{createForCommitComment:["POST /repos/{owner}/{repo}/comments/{comment_id}/reactions",{mediaType:{previews:["squirrel-girl"]}}],createForIssue:["POST /repos/{owner}/{repo}/issues/{issue_number}/reactions",{mediaType:{previews:["squirrel-girl"]}}],createForIssueComment:["POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions",{mediaType:{previews:["squirrel-girl"]}}],createForPullRequestReviewComment:["POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions",{mediaType:{previews:["squirrel-girl"]}}],createForTeamDiscussionCommentInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions",{mediaType:{previews:["squirrel-girl"]}}],createForTeamDiscussionInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions",{mediaType:{previews:["squirrel-girl"]}}],deleteForCommitComment:["DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}",{mediaType:{previews:["squirrel-girl"]}}],deleteForIssue:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}",{mediaType:{previews:["squirrel-girl"]}}],deleteForIssueComment:["DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}",{mediaType:{previews:["squirrel-girl"]}}],deleteForPullRequestComment:["DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}",{mediaType:{previews:["squirrel-girl"]}}],deleteForTeamDiscussion:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}",{mediaType:{previews:["squirrel-girl"]}}],deleteForTeamDiscussionComment:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}",{mediaType:{previews:["squirrel-girl"]}}],deleteLegacy:["DELETE /reactions/{reaction_id}",{mediaType:{previews:["squirrel-girl"]}},{deprecated:"octokit.reactions.deleteLegacy() is deprecated, see https://developer.github.com/v3/reactions/#delete-a-reaction-legacy"}],listForCommitComment:["GET /repos/{owner}/{repo}/comments/{comment_id}/reactions",{mediaType:{previews:["squirrel-girl"]}}],listForIssue:["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions",{mediaType:{previews:["squirrel-girl"]}}],listForIssueComment:["GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions",{mediaType:{previews:["squirrel-girl"]}}],listForPullRequestReviewComment:["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions",{mediaType:{previews:["squirrel-girl"]}}],listForTeamDiscussionCommentInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions",{mediaType:{previews:["squirrel-girl"]}}],listForTeamDiscussionInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions",{mediaType:{previews:["squirrel-girl"]}}]},repos:{acceptInvitation:["PATCH /user/repository_invitations/{invitation_id}"],addAppAccessRestrictions:["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",{},{mapToData:"apps"}],addCollaborator:["PUT /repos/{owner}/{repo}/collaborators/{username}"],addStatusCheckContexts:["POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",{},{mapToData:"contexts"}],addTeamAccessRestrictions:["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",{},{mapToData:"teams"}],addUserAccessRestrictions:["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",{},{mapToData:"users"}],checkCollaborator:["GET /repos/{owner}/{repo}/collaborators/{username}"],checkVulnerabilityAlerts:["GET /repos/{owner}/{repo}/vulnerability-alerts",{mediaType:{previews:["dorian"]}}],compareCommits:["GET /repos/{owner}/{repo}/compare/{base}...{head}"],createCommitComment:["POST /repos/{owner}/{repo}/commits/{commit_sha}/comments"],createCommitSignatureProtection:["POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures",{mediaType:{previews:["zzzax"]}}],createCommitStatus:["POST /repos/{owner}/{repo}/statuses/{sha}"],createDeployKey:["POST /repos/{owner}/{repo}/keys"],createDeployment:["POST /repos/{owner}/{repo}/deployments"],createDeploymentStatus:["POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"],createDispatchEvent:["POST /repos/{owner}/{repo}/dispatches"],createForAuthenticatedUser:["POST /user/repos"],createFork:["POST /repos/{owner}/{repo}/forks"],createInOrg:["POST /orgs/{org}/repos"],createOrUpdateFileContents:["PUT /repos/{owner}/{repo}/contents/{path}"],createPagesSite:["POST /repos/{owner}/{repo}/pages",{mediaType:{previews:["switcheroo"]}}],createRelease:["POST /repos/{owner}/{repo}/releases"],createUsingTemplate:["POST /repos/{template_owner}/{template_repo}/generate",{mediaType:{previews:["baptiste"]}}],createWebhook:["POST /repos/{owner}/{repo}/hooks"],declineInvitation:["DELETE /user/repository_invitations/{invitation_id}"],delete:["DELETE /repos/{owner}/{repo}"],deleteAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"],deleteAdminBranchProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"],deleteBranchProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection"],deleteCommitComment:["DELETE /repos/{owner}/{repo}/comments/{comment_id}"],deleteCommitSignatureProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures",{mediaType:{previews:["zzzax"]}}],deleteDeployKey:["DELETE /repos/{owner}/{repo}/keys/{key_id}"],deleteDeployment:["DELETE /repos/{owner}/{repo}/deployments/{deployment_id}"],deleteFile:["DELETE /repos/{owner}/{repo}/contents/{path}"],deleteInvitation:["DELETE /repos/{owner}/{repo}/invitations/{invitation_id}"],deletePagesSite:["DELETE /repos/{owner}/{repo}/pages",{mediaType:{previews:["switcheroo"]}}],deletePullRequestReviewProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"],deleteRelease:["DELETE /repos/{owner}/{repo}/releases/{release_id}"],deleteReleaseAsset:["DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}"],deleteWebhook:["DELETE /repos/{owner}/{repo}/hooks/{hook_id}"],disableAutomatedSecurityFixes:["DELETE /repos/{owner}/{repo}/automated-security-fixes",{mediaType:{previews:["london"]}}],disableVulnerabilityAlerts:["DELETE /repos/{owner}/{repo}/vulnerability-alerts",{mediaType:{previews:["dorian"]}}],downloadArchive:["GET /repos/{owner}/{repo}/{archive_format}/{ref}"],enableAutomatedSecurityFixes:["PUT /repos/{owner}/{repo}/automated-security-fixes",{mediaType:{previews:["london"]}}],enableVulnerabilityAlerts:["PUT /repos/{owner}/{repo}/vulnerability-alerts",{mediaType:{previews:["dorian"]}}],get:["GET /repos/{owner}/{repo}"],getAccessRestrictions:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"],getAdminBranchProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"],getAllStatusCheckContexts:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"],getAllTopics:["GET /repos/{owner}/{repo}/topics",{mediaType:{previews:["mercy"]}}],getAppsWithAccessToProtectedBranch:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"],getBranch:["GET /repos/{owner}/{repo}/branches/{branch}"],getBranchProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection"],getClones:["GET /repos/{owner}/{repo}/traffic/clones"],getCodeFrequencyStats:["GET /repos/{owner}/{repo}/stats/code_frequency"],getCollaboratorPermissionLevel:["GET /repos/{owner}/{repo}/collaborators/{username}/permission"],getCombinedStatusForRef:["GET /repos/{owner}/{repo}/commits/{ref}/status"],getCommit:["GET /repos/{owner}/{repo}/commits/{ref}"],getCommitActivityStats:["GET /repos/{owner}/{repo}/stats/commit_activity"],getCommitComment:["GET /repos/{owner}/{repo}/comments/{comment_id}"],getCommitSignatureProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures",{mediaType:{previews:["zzzax"]}}],getCommunityProfileMetrics:["GET /repos/{owner}/{repo}/community/profile",{mediaType:{previews:["black-panther"]}}],getContent:["GET /repos/{owner}/{repo}/contents/{path}"],getContributorsStats:["GET /repos/{owner}/{repo}/stats/contributors"],getDeployKey:["GET /repos/{owner}/{repo}/keys/{key_id}"],getDeployment:["GET /repos/{owner}/{repo}/deployments/{deployment_id}"],getDeploymentStatus:["GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}"],getLatestPagesBuild:["GET /repos/{owner}/{repo}/pages/builds/latest"],getLatestRelease:["GET /repos/{owner}/{repo}/releases/latest"],getPages:["GET /repos/{owner}/{repo}/pages"],getPagesBuild:["GET /repos/{owner}/{repo}/pages/builds/{build_id}"],getParticipationStats:["GET /repos/{owner}/{repo}/stats/participation"],getPullRequestReviewProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"],getPunchCardStats:["GET /repos/{owner}/{repo}/stats/punch_card"],getReadme:["GET /repos/{owner}/{repo}/readme"],getRelease:["GET /repos/{owner}/{repo}/releases/{release_id}"],getReleaseAsset:["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"],getReleaseByTag:["GET /repos/{owner}/{repo}/releases/tags/{tag}"],getStatusChecksProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"],getTeamsWithAccessToProtectedBranch:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"],getTopPaths:["GET /repos/{owner}/{repo}/traffic/popular/paths"],getTopReferrers:["GET /repos/{owner}/{repo}/traffic/popular/referrers"],getUsersWithAccessToProtectedBranch:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"],getViews:["GET /repos/{owner}/{repo}/traffic/views"],getWebhook:["GET /repos/{owner}/{repo}/hooks/{hook_id}"],listBranches:["GET /repos/{owner}/{repo}/branches"],listBranchesForHeadCommit:["GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head",{mediaType:{previews:["groot"]}}],listCollaborators:["GET /repos/{owner}/{repo}/collaborators"],listCommentsForCommit:["GET /repos/{owner}/{repo}/commits/{commit_sha}/comments"],listCommitCommentsForRepo:["GET /repos/{owner}/{repo}/comments"],listCommitStatusesForRef:["GET /repos/{owner}/{repo}/commits/{ref}/statuses"],listCommits:["GET /repos/{owner}/{repo}/commits"],listContributors:["GET /repos/{owner}/{repo}/contributors"],listDeployKeys:["GET /repos/{owner}/{repo}/keys"],listDeploymentStatuses:["GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"],listDeployments:["GET /repos/{owner}/{repo}/deployments"],listForAuthenticatedUser:["GET /user/repos"],listForOrg:["GET /orgs/{org}/repos"],listForUser:["GET /users/{username}/repos"],listForks:["GET /repos/{owner}/{repo}/forks"],listInvitations:["GET /repos/{owner}/{repo}/invitations"],listInvitationsForAuthenticatedUser:["GET /user/repository_invitations"],listLanguages:["GET /repos/{owner}/{repo}/languages"],listPagesBuilds:["GET /repos/{owner}/{repo}/pages/builds"],listPublic:["GET /repositories"],listPullRequestsAssociatedWithCommit:["GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls",{mediaType:{previews:["groot"]}}],listReleaseAssets:["GET /repos/{owner}/{repo}/releases/{release_id}/assets"],listReleases:["GET /repos/{owner}/{repo}/releases"],listTags:["GET /repos/{owner}/{repo}/tags"],listTeams:["GET /repos/{owner}/{repo}/teams"],listWebhooks:["GET /repos/{owner}/{repo}/hooks"],merge:["POST /repos/{owner}/{repo}/merges"],pingWebhook:["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"],removeAppAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",{},{mapToData:"apps"}],removeCollaborator:["DELETE /repos/{owner}/{repo}/collaborators/{username}"],removeStatusCheckContexts:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",{},{mapToData:"contexts"}],removeStatusCheckProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"],removeTeamAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",{},{mapToData:"teams"}],removeUserAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",{},{mapToData:"users"}],replaceAllTopics:["PUT /repos/{owner}/{repo}/topics",{mediaType:{previews:["mercy"]}}],requestPagesBuild:["POST /repos/{owner}/{repo}/pages/builds"],setAdminBranchProtection:["POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"],setAppAccessRestrictions:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",{},{mapToData:"apps"}],setStatusCheckContexts:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",{},{mapToData:"contexts"}],setTeamAccessRestrictions:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",{},{mapToData:"teams"}],setUserAccessRestrictions:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",{},{mapToData:"users"}],testPushWebhook:["POST /repos/{owner}/{repo}/hooks/{hook_id}/tests"],transfer:["POST /repos/{owner}/{repo}/transfer"],update:["PATCH /repos/{owner}/{repo}"],updateBranchProtection:["PUT /repos/{owner}/{repo}/branches/{branch}/protection"],updateCommitComment:["PATCH /repos/{owner}/{repo}/comments/{comment_id}"],updateInformationAboutPagesSite:["PUT /repos/{owner}/{repo}/pages"],updateInvitation:["PATCH /repos/{owner}/{repo}/invitations/{invitation_id}"],updatePullRequestReviewProtection:["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"],updateRelease:["PATCH /repos/{owner}/{repo}/releases/{release_id}"],updateReleaseAsset:["PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}"],updateStatusCheckPotection:["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"],updateWebhook:["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"],uploadReleaseAsset:["POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}",{baseUrl:"https://uploads.github.com"}]},search:{code:["GET /search/code"],commits:["GET /search/commits",{mediaType:{previews:["cloak"]}}],issuesAndPullRequests:["GET /search/issues"],labels:["GET /search/labels"],repos:["GET /search/repositories"],topics:["GET /search/topics",{mediaType:{previews:["mercy"]}}],users:["GET /search/users"]},teams:{addOrUpdateMembershipForUserInOrg:["PUT /orgs/{org}/teams/{team_slug}/memberships/{username}"],addOrUpdateProjectPermissionsInOrg:["PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}",{mediaType:{previews:["inertia"]}}],addOrUpdateRepoPermissionsInOrg:["PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"],checkPermissionsForProjectInOrg:["GET /orgs/{org}/teams/{team_slug}/projects/{project_id}",{mediaType:{previews:["inertia"]}}],checkPermissionsForRepoInOrg:["GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"],create:["POST /orgs/{org}/teams"],createDiscussionCommentInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"],createDiscussionInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions"],deleteDiscussionCommentInOrg:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"],deleteDiscussionInOrg:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"],deleteInOrg:["DELETE /orgs/{org}/teams/{team_slug}"],getByName:["GET /orgs/{org}/teams/{team_slug}"],getDiscussionCommentInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"],getDiscussionInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"],getMembershipForUserInOrg:["GET /orgs/{org}/teams/{team_slug}/memberships/{username}"],list:["GET /orgs/{org}/teams"],listChildInOrg:["GET /orgs/{org}/teams/{team_slug}/teams"],listDiscussionCommentsInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"],listDiscussionsInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions"],listForAuthenticatedUser:["GET /user/teams"],listMembersInOrg:["GET /orgs/{org}/teams/{team_slug}/members"],listPendingInvitationsInOrg:["GET /orgs/{org}/teams/{team_slug}/invitations"],listProjectsInOrg:["GET /orgs/{org}/teams/{team_slug}/projects",{mediaType:{previews:["inertia"]}}],listReposInOrg:["GET /orgs/{org}/teams/{team_slug}/repos"],removeMembershipForUserInOrg:["DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}"],removeProjectInOrg:["DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}"],removeRepoInOrg:["DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"],updateDiscussionCommentInOrg:["PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"],updateDiscussionInOrg:["PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"],updateInOrg:["PATCH /orgs/{org}/teams/{team_slug}"]},users:{addEmailForAuthenticated:["POST /user/emails"],block:["PUT /user/blocks/{username}"],checkBlocked:["GET /user/blocks/{username}"],checkFollowingForUser:["GET /users/{username}/following/{target_user}"],checkPersonIsFollowedByAuthenticated:["GET /user/following/{username}"],createGpgKeyForAuthenticated:["POST /user/gpg_keys"],createPublicSshKeyForAuthenticated:["POST /user/keys"],deleteEmailForAuthenticated:["DELETE /user/emails"],deleteGpgKeyForAuthenticated:["DELETE /user/gpg_keys/{gpg_key_id}"],deletePublicSshKeyForAuthenticated:["DELETE /user/keys/{key_id}"],follow:["PUT /user/following/{username}"],getAuthenticated:["GET /user"],getByUsername:["GET /users/{username}"],getContextForUser:["GET /users/{username}/hovercard"],getGpgKeyForAuthenticated:["GET /user/gpg_keys/{gpg_key_id}"],getPublicSshKeyForAuthenticated:["GET /user/keys/{key_id}"],list:["GET /users"],listBlockedByAuthenticated:["GET /user/blocks"],listEmailsForAuthenticated:["GET /user/emails"],listFollowedByAuthenticated:["GET /user/following"],listFollowersForAuthenticatedUser:["GET /user/followers"],listFollowersForUser:["GET /users/{username}/followers"],listFollowingForUser:["GET /users/{username}/following"],listGpgKeysForAuthenticated:["GET /user/gpg_keys"],listGpgKeysForUser:["GET /users/{username}/gpg_keys"],listPublicEmailsForAuthenticated:["GET /user/public_emails"],listPublicKeysForUser:["GET /users/{username}/keys"],listPublicSshKeysForAuthenticated:["GET /user/keys"],setPrimaryEmailVisibilityForAuthenticated:["PATCH /user/email/visibility"],unblock:["DELETE /user/blocks/{username}"],unfollow:["DELETE /user/following/{username}"],updateAuthenticated:["PATCH /user"]}},VERSION$6="4.1.2";function endpointsToMethods(e,t){const n={};for(const[r,i]of Object.entries(t))for(const[t,o]of Object.entries(i)){const[i,a,s]=o,[l,c]=i.split(/ /),u=Object.assign({method:l,url:c},a);n[r]||(n[r]={});const h=n[r];s?h[t]=decorate(e,r,t,u,s):h[t]=e.request.defaults(u)}return n}function decorate(e,t,n,r,i){const o=e.request.defaults(r);return Object.assign((function(...r){let a=o.endpoint.merge(...r);if(i.mapToData)return a=Object.assign({},a,{data:a[i.mapToData],[i.mapToData]:void 0}),o(a);if(i.renamed){const[r,o]=i.renamed;e.log.warn(`octokit.${t}.${n}() has been renamed to octokit.${r}.${o}()`)}if(i.deprecated&&e.log.warn(i.deprecated),i.renamedParameters){const a=o.endpoint.merge(...r);for(const[r,o]of Object.entries(i.renamedParameters))r in a&&(e.log.warn(`"${r}" parameter is deprecated for "octokit.${t}.${n}()". Use "${o}" instead`),o in a||(a[o]=a[r]),delete a[r]);return o(a)}return o(...r)}),o)}function restEndpointMethods(e){return endpointsToMethods(e,Endpoints)}restEndpointMethods.VERSION=VERSION$6;const VERSION$7="18.0.3",Octokit$1=Octokit.plugin(requestLog,restEndpointMethods,paginateRest).defaults({userAgent:"octokit-rest.js/"+VERSION$7}),authContext=react_14();function ProvideAuth(e){const t=useProvideAuth();return react.createElement(authContext.Provider,{value:t},e.children)}const useAuth=()=>react_8(authContext);function storeCredential(e,t){localStorage.setItem(e+"_key",t)}function loadCredential(e){return localStorage.getItem(e+"_key")}function useProvideAuth(){const[e,t]=react_6(null),[n,r]=react_6(null),[i,o]=react_6(!1);var a=new index_cjs$3.auth.GithubAuthProvider;function s(){t(null),r(null),localStorage.clear()}a.addScope("gist");const l=async()=>index_cjs$3.auth().signOut().then(()=>{logEvent$1("sign_out"),s(),location.reload()});async function c(e,n=!1){let i=loadCredential(e.uid);if(r(e.uid),i){const r=new Octokit$1({auth:i}),{data:o}=await r.request("/user");if(o.id)return n&&index_cjs$3.database().ref().child("users/"+e.uid+"/profile").set({login:o.login,id:o.id,name:o.name,avatar_url:o.avatar_url}),t({user:e,octokit:r,gh:o}),e}return l(),null}return react_5(()=>{const e=index_cjs$3.auth().onAuthStateChanged(e=>{e?c(e):s()});return()=>e()},[]),{uid:n,data:e,signin:async()=>(o(!0),index_cjs$3.auth().signInWithPopup(a).then(e=>{e.credential&&storeCredential(e.user.uid,e.credential.accessToken),logEvent$1("sign_in");const t=c(e.user,!0);return t.then(()=>o(!1)),t}).catch(e=>{logEvent$1("cancel_signin"),o(!1),logException(e)})),signout:l,loading:i}}let isResizing=!1;function ResizeableSidebar(e){const[t,n]=react_6(e.size),r=react_11((function(e){if(!isResizing)return;let t=e.clientX-document.body.offsetLeft;n(t>150?t:0)}),[]),i=react_11((function(e){if(!isResizing)return;isResizing=!1,document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",i)}),[]);return react_5(()=>{t!=e.size&&e.onResize(t)},[t]),react.createElement("div",{className:"sidebar-container"},react.createElement("div",{className:"sidebar-dragger "+(isResizing?"active":""),onMouseDown:function(e){e.stopPropagation(),e.preventDefault(),document.addEventListener("mousemove",r),document.addEventListener("mouseup",i),isResizing=!0},style:{left:e.size}}),e.children)}function Avatar(e){const[t,n]=react_6(),r=useAuth();return react_5(()=>{e.userId&&r.uid&&index_cjs$3.database().ref().child(`users/${e.userId}/profile`).once("value",(function(e){n(e.toJSON())}))},[e.userId]),t?react.createElement("img",{className:"avatar avatar-small "+e.className,alt:t.login,title:t.login,"aria-label":t.login,src:t.avatar_url+"&s=40",width:"20",height:"20",onClick:e.onClick}):react.createElement("img",{className:"avatar",height:"20",width:"20",title:"anonymous",alt:"anonymous",src:"https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png",onClick:e.onClick})}function UserList(e){const t=useAuth(),[n,r]=react_6({});return react_5(()=>{if(e.documentRef){r({});const t=e.documentRef.child("users");return t.on("value",e=>{r(e.toJSON())}),()=>{t.off()}}},[e.documentRef]),react.createElement("div",{className:"AvatarStack AvatarStack--three-plus AvatarStack--right d-inline-block flex-self-center"},react.createElement("div",{className:"AvatarStack-body"},Object.keys(n||{}).map(e=>t.uid!=e&&react.createElement(Avatar,{userId:e,className:"tooltipped tooltipped-sw tooltipped-align-right-1",key:e}))))}function UserMenu(){const e=useAuth();return e.data?react.createElement(react.Fragment,null,react.createElement("details",{className:"dropdown details-reset details-overlay d-inline-block mr-2"},react.createElement("summary",{"aria-haspopup":"true"},react.createElement("span",{className:"btn btn-invisible user-name",style:{color:"#000"}},react.createElement("span",{className:"mr-2"},e.data.user.displayName),react.createElement("img",{className:"avatar avatar-small",alt:e.data.user.displayName,src:e.data.user.photoURL+"&s=40",width:"20",height:"20","aria-label":e.data.user.displayName}),react.createElement("div",{className:"dropdown-caret"}))),react.createElement("ul",{className:"dropdown-menu dropdown-menu-sw"},react.createElement("li",null,react.createElement("a",{className:"dropdown-item",href:"#/list",onClick:()=>{navigateTo("/list")}},react.createElement("span",null,"My notebooks"))),react.createElement("li",null,react.createElement("a",{className:"dropdown-item",href:document.location.toString(),onClick:()=>{e.signout().then(()=>closeMenu()).catch(()=>closeMenu())}},react.createElement("span",null,"Sign out")))))):react.createElement(react.Fragment,null,react.createElement("details",{className:"dropdown details-reset details-overlay d-inline-block mr-2"},react.createElement("summary",{"aria-haspopup":"true"},react.createElement("span",{className:"btn btn-invisible user-name",style:{color:"#000"}},react.createElement("span",{className:"mr-2"},"Anonymous"),react.createElement("img",{className:"avatar avatar-small",alt:"Anonymous",src:"https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png",width:"20",height:"20","aria-label":"Sign in"}),react.createElement("div",{className:"dropdown-caret"}))),react.createElement("ul",{className:"dropdown-menu dropdown-menu-sw"},react.createElement("li",null,react.createElement("a",{className:"dropdown-item",href:document.location.toString(),onClick:()=>{e.signin().then(()=>closeMenu()).catch(()=>closeMenu())}},react.createElement(MarkGithubIcon,{size:16,className:"mr-2"}),react.createElement("span",null,"Sign in"))))))}class ErrorBoundary extends react.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0}}componentDidCatch(e,t){console.error(e),console.log(t)}render(){return this.state.hasError?react.createElement("h1",null,"Something went wrong."):this.props.children}}function createCommonjsModule$1(e,t){return e(t={exports:{}},t.exports),t.exports}var expatlib=createCommonjsModule$1((function(e,t){var n,r=(n="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(e){var t,r=void 0!==(e=e||{})?e:{};r.ready=new Promise((function(e,n){t=e}));var i,o={};for(i in r)r.hasOwnProperty(i)&&(o[i]=r[i]);var a,s="./this.program",l="";document.currentScript&&(l=document.currentScript.src),n&&(l=n),l=0!==l.indexOf("blob:")?l.substr(0,l.lastIndexOf("/")+1):"",a=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText};var c,u,h=r.print||console.log.bind(console),p=r.printErr||console.warn.bind(console);for(i in o)o.hasOwnProperty(i)&&(r[i]=o[i]);o=null,r.arguments&&r.arguments,r.thisProgram&&(s=r.thisProgram),r.quit&&r.quit,r.wasmBinary&&(c=r.wasmBinary),r.noExitRuntime&&r.noExitRuntime,"object"!=typeof WebAssembly&&p("no native wasm support detected");var f=new WebAssembly.Table({initial:153,maximum:153,element:"anyfunc"}),d=!1;function m(e,t){e||U("Assertion failed: "+t)}var g,y,v,_,b,w="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function E(e,t,n){for(var r=t+n,i=t;e[i]&&!(i>=r);)++i;if(i-t>16&&e.subarray&&w)return w.decode(e.subarray(t,i));for(var o="";t>10,56320|1023&c)}}else o+=String.fromCharCode((31&a)<<6|s)}else o+=String.fromCharCode(a)}return o}function T(e,t){return e?E(v,e,t):""}function k(e,t,n,r){if(!(r>0))return 0;for(var i=n,o=n+r-1,a=0;a=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++a)),s<=127){if(n>=o)break;t[n++]=s}else if(s<=2047){if(n+1>=o)break;t[n++]=192|s>>6,t[n++]=128|63&s}else if(s<=65535){if(n+2>=o)break;t[n++]=224|s>>12,t[n++]=128|s>>6&63,t[n++]=128|63&s}else{if(n+3>=o)break;t[n++]=240|s>>18,t[n++]=128|s>>12&63,t[n++]=128|s>>6&63,t[n++]=128|63&s}}return t[n]=0,n-i}function S(e){for(var t=0,n=0;n=55296&&r<=57343&&(r=65536+((1023&r)<<10)|1023&e.charCodeAt(++n)),r<=127?++t:t+=r<=2047?2:r<=65535?3:4}return t}function x(e,t){return e%t>0&&(e+=t-e%t),e}function C(e){g=e,r.HEAP8=y=new Int8Array(e),r.HEAP16=new Int16Array(e),r.HEAP32=_=new Int32Array(e),r.HEAPU8=v=new Uint8Array(e),r.HEAPU16=new Uint16Array(e),r.HEAPU32=new Uint32Array(e),r.HEAPF32=new Float32Array(e),r.HEAPF64=b=new Float64Array(e)}var P=r.INITIAL_MEMORY||16777216;function A(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var n=t.func;"number"==typeof n?void 0===t.arg?r.dynCall_v(n):r.dynCall_vi(n,t.arg):n(void 0===t.arg?null:t.arg)}else t(r)}}(u=r.wasmMemory?r.wasmMemory:new WebAssembly.Memory({initial:P/65536,maximum:32768}))&&(g=u.buffer),P=g.byteLength,C(g),_[2100]=5251440;var I=[],D=[],R=[],O=[];function N(e){I.unshift(e)}function M(e){O.unshift(e)}var F=Math.abs,L=Math.ceil,j=Math.floor,$=Math.min,B=0,V=null;function G(e){B++,r.monitorRunDependencies&&r.monitorRunDependencies(B)}function z(e){if(B--,r.monitorRunDependencies&&r.monitorRunDependencies(B),0==B&&V){var t=V;V=null,t()}}function U(e){throw r.onAbort&&r.onAbort(e),h(e+=""),p(e),d=!0,e="abort("+e+"). Build with -s ASSERTIONS=1 for more info.",new WebAssembly.RuntimeError(e)}function H(e){return function(e,t){return String.prototype.startsWith?e.startsWith(t):0===e.indexOf(t)}(e,"data:application/octet-stream;base64,")}r.preloadedImages={},r.preloadedAudios={};var q,W,Y,K="expatlib.wasm";function Q(){try{if(c)return new Uint8Array(c);throw"both async and sync fetching of the wasm failed"}catch(e){U(e)}}H(K)||(q=K,K=r.locateFile?r.locateFile(q,l):l+q);var X={1284:function(e){var t=r.getCache(r.CExpatJS)[e];if(!t.hasOwnProperty("startElement"))throw"a JSImplementation must implement all functions, you forgot CExpatJS::startElement.";t.startElement()},1504:function(e){var t=r.getCache(r.CExpatJS)[e];if(!t.hasOwnProperty("endElement"))throw"a JSImplementation must implement all functions, you forgot CExpatJS::endElement.";t.endElement()},1716:function(e){var t=r.getCache(r.CExpatJS)[e];if(!t.hasOwnProperty("characterData"))throw"a JSImplementation must implement all functions, you forgot CExpatJS::characterData.";t.characterData()}};function J(){var e=function(){var e=new Error;if(!e.stack){try{throw new Error}catch(t){e=t}if(!e.stack)return"(no stack trace available)"}return e.stack.toString()}();return r.extraStackTrace&&(e+="\n"+r.extraStackTrace()),e.replace(/\b_Z[\w\d_]+/g,(function(e){return e==e?e:e+" ["+e+"]"}))}D.push({func:function(){me()}});var Z={splitPath:function(e){return/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1)},normalizeArray:function(e,t){for(var n=0,r=e.length-1;r>=0;r--){var i=e[r];"."===i?e.splice(r,1):".."===i?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n;n--)e.unshift("..");return e},normalize:function(e){var t="/"===e.charAt(0),n="/"===e.substr(-1);return(e=Z.normalizeArray(e.split("/").filter((function(e){return!!e})),!t).join("/"))||t||(e="."),e&&n&&(e+="/"),(t?"/":"")+e},dirname:function(e){var t=Z.splitPath(e),n=t[0],r=t[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."},basename:function(e){if("/"===e)return"/";var t=e.lastIndexOf("/");return-1===t?e:e.substr(t+1)},extname:function(e){return Z.splitPath(e)[3]},join:function(){var e=Array.prototype.slice.call(arguments,0);return Z.normalize(e.join("/"))},join2:function(e,t){return Z.normalize(e+"/"+t)}};function ee(e){return _[Ne()>>2]=e,e}var te={resolve:function(){for(var e="",t=!1,n=arguments.length-1;n>=-1&&!t;n--){var r=n>=0?arguments[n]:ie.cwd();if("string"!=typeof r)throw new TypeError("Arguments to path.resolve must be strings");if(!r)return"";e=r+"/"+e,t="/"===r.charAt(0)}return(t?"/":"")+(e=Z.normalizeArray(e.split("/").filter((function(e){return!!e})),!t).join("/"))||"."},relative:function(e,t){function n(e){for(var t=0;t=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=te.resolve(e).substr(1),t=te.resolve(t).substr(1);for(var r=n(e.split("/")),i=n(t.split("/")),o=Math.min(r.length,i.length),a=o,s=0;s0&&(h(E(e.output,0)),e.output=[])}},default_tty1_ops:{put_char:function(e,t){null===t||10===t?(p(E(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(p(E(e.output,0)),e.output=[])}}},re={ops_table:null,mount:function(e){return re.createNode(null,"/",16895,0)},createNode:function(e,t,n,r){if(ie.isBlkdev(n)||ie.isFIFO(n))throw new ie.ErrnoError(63);re.ops_table||(re.ops_table={dir:{node:{getattr:re.node_ops.getattr,setattr:re.node_ops.setattr,lookup:re.node_ops.lookup,mknod:re.node_ops.mknod,rename:re.node_ops.rename,unlink:re.node_ops.unlink,rmdir:re.node_ops.rmdir,readdir:re.node_ops.readdir,symlink:re.node_ops.symlink},stream:{llseek:re.stream_ops.llseek}},file:{node:{getattr:re.node_ops.getattr,setattr:re.node_ops.setattr},stream:{llseek:re.stream_ops.llseek,read:re.stream_ops.read,write:re.stream_ops.write,allocate:re.stream_ops.allocate,mmap:re.stream_ops.mmap,msync:re.stream_ops.msync}},link:{node:{getattr:re.node_ops.getattr,setattr:re.node_ops.setattr,readlink:re.node_ops.readlink},stream:{}},chrdev:{node:{getattr:re.node_ops.getattr,setattr:re.node_ops.setattr},stream:ie.chrdev_stream_ops}});var i=ie.createNode(e,t,n,r);return ie.isDir(i.mode)?(i.node_ops=re.ops_table.dir.node,i.stream_ops=re.ops_table.dir.stream,i.contents={}):ie.isFile(i.mode)?(i.node_ops=re.ops_table.file.node,i.stream_ops=re.ops_table.file.stream,i.usedBytes=0,i.contents=null):ie.isLink(i.mode)?(i.node_ops=re.ops_table.link.node,i.stream_ops=re.ops_table.link.stream):ie.isChrdev(i.mode)&&(i.node_ops=re.ops_table.chrdev.node,i.stream_ops=re.ops_table.chrdev.stream),i.timestamp=Date.now(),e&&(e.contents[t]=i),i},getFileDataAsRegularArray:function(e){if(e.contents&&e.contents.subarray){for(var t=[],n=0;n=t)){t=Math.max(t,n*(n<1048576?2:1.125)>>>0),0!=n&&(t=Math.max(t,256));var r=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(r.subarray(0,e.usedBytes),0)}},resizeFileStorage:function(e,t){if(e.usedBytes!=t){if(0==t)return e.contents=null,void(e.usedBytes=0);if(!e.contents||e.contents.subarray){var n=e.contents;return e.contents=new Uint8Array(t),n&&e.contents.set(n.subarray(0,Math.min(t,e.usedBytes))),void(e.usedBytes=t)}if(e.contents||(e.contents=[]),e.contents.length>t)e.contents.length=t;else for(;e.contents.length=e.node.usedBytes)return 0;var a=Math.min(e.node.usedBytes-i,r);if(a>8&&o.subarray)t.set(o.subarray(i,i+a),n);else for(var s=0;s0||i+r8)throw new ie.ErrnoError(32);for(var i=Z.normalizeArray(e.split("/").filter((function(e){return!!e})),!1),o=ie.root,a="/",s=0;s40)throw new ie.ErrnoError(32)}}return{path:a,node:o}},getPath:function(e){for(var t;;){if(ie.isRoot(e)){var n=e.mount.mountpoint;return t?"/"!==n[n.length-1]?n+"/"+t:n+t:n}t=t?e.name+"/"+t:e.name,e=e.parent}},hashName:function(e,t){for(var n=0,r=0;r>>0)%ie.nameTable.length},hashAddNode:function(e){var t=ie.hashName(e.parent.id,e.name);e.name_next=ie.nameTable[t],ie.nameTable[t]=e},hashRemoveNode:function(e){var t=ie.hashName(e.parent.id,e.name);if(ie.nameTable[t]===e)ie.nameTable[t]=e.name_next;else for(var n=ie.nameTable[t];n;){if(n.name_next===e){n.name_next=e.name_next;break}n=n.name_next}},lookupNode:function(e,t){var n=ie.mayLookup(e);if(n)throw new ie.ErrnoError(n,e);for(var r=ie.hashName(e.id,t),i=ie.nameTable[r];i;i=i.name_next){var o=i.name;if(i.parent.id===e.id&&o===t)return i}return ie.lookup(e,t)},createNode:function(e,t,n,r){var i=new ie.FSNode(e,t,n,r);return ie.hashAddNode(i),i},destroyNode:function(e){ie.hashRemoveNode(e)},isRoot:function(e){return e===e.parent},isMountpoint:function(e){return!!e.mounted},isFile:function(e){return 32768==(61440&e)},isDir:function(e){return 16384==(61440&e)},isLink:function(e){return 40960==(61440&e)},isChrdev:function(e){return 8192==(61440&e)},isBlkdev:function(e){return 24576==(61440&e)},isFIFO:function(e){return 4096==(61440&e)},isSocket:function(e){return 49152==(49152&e)},flagModes:{r:0,rs:1052672,"r+":2,w:577,wx:705,xw:705,"w+":578,"wx+":706,"xw+":706,a:1089,ax:1217,xa:1217,"a+":1090,"ax+":1218,"xa+":1218},modeStringToFlags:function(e){var t=ie.flagModes[e];if(void 0===t)throw new Error("Unknown file open mode: "+e);return t},flagsToPermissionString:function(e){var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t},nodePermissions:function(e,t){return ie.ignorePermissions||(-1===t.indexOf("r")||292&e.mode)&&(-1===t.indexOf("w")||146&e.mode)&&(-1===t.indexOf("x")||73&e.mode)?0:2},mayLookup:function(e){var t=ie.nodePermissions(e,"x");return t||(e.node_ops.lookup?0:2)},mayCreate:function(e,t){try{return ie.lookupNode(e,t),20}catch(e){}return ie.nodePermissions(e,"wx")},mayDelete:function(e,t,n){var r;try{r=ie.lookupNode(e,t)}catch(e){return e.errno}var i=ie.nodePermissions(e,"wx");if(i)return i;if(n){if(!ie.isDir(r.mode))return 54;if(ie.isRoot(r)||ie.getPath(r)===ie.cwd())return 10}else if(ie.isDir(r.mode))return 31;return 0},mayOpen:function(e,t){return e?ie.isLink(e.mode)?32:ie.isDir(e.mode)&&("r"!==ie.flagsToPermissionString(t)||512&t)?31:ie.nodePermissions(e,ie.flagsToPermissionString(t)):44},MAX_OPEN_FDS:4096,nextfd:function(e,t){e=e||0,t=t||ie.MAX_OPEN_FDS;for(var n=e;n<=t;n++)if(!ie.streams[n])return n;throw new ie.ErrnoError(33)},getStream:function(e){return ie.streams[e]},createStream:function(e,t,n){ie.FSStream||(ie.FSStream=function(){},ie.FSStream.prototype={object:{get:function(){return this.node},set:function(e){this.node=e}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}}});var r=new ie.FSStream;for(var i in e)r[i]=e[i];e=r;var o=ie.nextfd(t,n);return e.fd=o,ie.streams[o]=e,e},closeStream:function(e){ie.streams[e]=null},chrdev_stream_ops:{open:function(e){var t=ie.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:function(){throw new ie.ErrnoError(70)}},major:function(e){return e>>8},minor:function(e){return 255&e},makedev:function(e,t){return e<<8|t},registerDevice:function(e,t){ie.devices[e]={stream_ops:t}},getDevice:function(e){return ie.devices[e]},getMounts:function(e){for(var t=[],n=[e];n.length;){var r=n.pop();t.push(r),n.push.apply(n,r.mounts)}return t},syncfs:function(e,t){"function"==typeof e&&(t=e,e=!1),ie.syncFSRequests++,ie.syncFSRequests>1&&p("warning: "+ie.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var n=ie.getMounts(ie.root.mount),r=0;function i(e){return ie.syncFSRequests--,t(e)}function o(e){if(e)return o.errored?void 0:(o.errored=!0,i(e));++r>=n.length&&i(null)}n.forEach((function(t){if(!t.type.syncfs)return o(null);t.type.syncfs(t,e,o)}))},mount:function(e,t,n){var r,i="/"===n,o=!n;if(i&&ie.root)throw new ie.ErrnoError(10);if(!i&&!o){var a=ie.lookupPath(n,{follow_mount:!1});if(n=a.path,r=a.node,ie.isMountpoint(r))throw new ie.ErrnoError(10);if(!ie.isDir(r.mode))throw new ie.ErrnoError(54)}var s={type:e,opts:t,mountpoint:n,mounts:[]},l=e.mount(s);return l.mount=s,s.root=l,i?ie.root=l:r&&(r.mounted=s,r.mount&&r.mount.mounts.push(s)),l},unmount:function(e){var t=ie.lookupPath(e,{follow_mount:!1});if(!ie.isMountpoint(t.node))throw new ie.ErrnoError(28);var n=t.node,r=n.mounted,i=ie.getMounts(r);Object.keys(ie.nameTable).forEach((function(e){for(var t=ie.nameTable[e];t;){var n=t.name_next;-1!==i.indexOf(t.mount)&&ie.destroyNode(t),t=n}})),n.mounted=null;var o=n.mount.mounts.indexOf(r);n.mount.mounts.splice(o,1)},lookup:function(e,t){return e.node_ops.lookup(e,t)},mknod:function(e,t,n){var r=ie.lookupPath(e,{parent:!0}).node,i=Z.basename(e);if(!i||"."===i||".."===i)throw new ie.ErrnoError(28);var o=ie.mayCreate(r,i);if(o)throw new ie.ErrnoError(o);if(!r.node_ops.mknod)throw new ie.ErrnoError(63);return r.node_ops.mknod(r,i,t,n)},create:function(e,t){return t=void 0!==t?t:438,t&=4095,t|=32768,ie.mknod(e,t,0)},mkdir:function(e,t){return t=void 0!==t?t:511,t&=1023,t|=16384,ie.mknod(e,t,0)},mkdirTree:function(e,t){for(var n=e.split("/"),r="",i=0;ithis.length-1||e<0)){var t=e%this.chunkSize,n=e/this.chunkSize|0;return this.getter(n)[t]}},o.prototype.setDataGetter=function(e){this.getter=e},o.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",n,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+n+". Status: "+e.status);var t,r=Number(e.getResponseHeader("Content-length")),i=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t,o=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t,a=1048576;i||(a=r);var s=this;s.setDataGetter((function(e){var t=e*a,i=(e+1)*a-1;if(i=Math.min(i,r-1),void 0===s.chunks[e]&&(s.chunks[e]=function(e,t){if(e>t)throw new Error("invalid range ("+e+", "+t+") or no bytes requested!");if(t>r-1)throw new Error("only "+r+" bytes available! programmer error!");var i=new XMLHttpRequest;if(i.open("GET",n,!1),r!==a&&i.setRequestHeader("Range","bytes="+e+"-"+t),"undefined"!=typeof Uint8Array&&(i.responseType="arraybuffer"),i.overrideMimeType&&i.overrideMimeType("text/plain; charset=x-user-defined"),i.send(null),!(i.status>=200&&i.status<300||304===i.status))throw new Error("Couldn't load "+n+". Status: "+i.status);return void 0!==i.response?new Uint8Array(i.response||[]):he(i.responseText||"",!0)}(t,i)),void 0===s.chunks[e])throw new Error("doXHR failed!");return s.chunks[e]})),!o&&r||(a=r=1,r=this.getter(0).length,a=r,h("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=r,this._chunkSize=a,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var a={isDevice:!1,url:n},s=ie.createFile(e,t,a,r,i);a.contents?s.contents=a.contents:a.url&&(s.contents=null,s.url=a.url),Object.defineProperties(s,{usedBytes:{get:function(){return this.contents.length}}});var l={};return Object.keys(s.stream_ops).forEach((function(e){var t=s.stream_ops[e];l[e]=function(){if(!ie.forceLoadFile(s))throw new ie.ErrnoError(29);return t.apply(null,arguments)}})),l.read=function(e,t,n,r,i){if(!ie.forceLoadFile(s))throw new ie.ErrnoError(29);var o=e.node.contents;if(i>=o.length)return 0;var a=Math.min(o.length-i,r);if(o.slice)for(var l=0;l>2]=r.dev,_[n+4>>2]=0,_[n+8>>2]=r.ino,_[n+12>>2]=r.mode,_[n+16>>2]=r.nlink,_[n+20>>2]=r.uid,_[n+24>>2]=r.gid,_[n+28>>2]=r.rdev,_[n+32>>2]=0,Y=[r.size>>>0,(W=r.size,+F(W)>=1?W>0?(0|$(+j(W/4294967296),4294967295))>>>0:~~+L((W-+(~~W>>>0))/4294967296)>>>0:0)],_[n+40>>2]=Y[0],_[n+44>>2]=Y[1],_[n+48>>2]=4096,_[n+52>>2]=r.blocks,_[n+56>>2]=r.atime.getTime()/1e3|0,_[n+60>>2]=0,_[n+64>>2]=r.mtime.getTime()/1e3|0,_[n+68>>2]=0,_[n+72>>2]=r.ctime.getTime()/1e3|0,_[n+76>>2]=0,Y=[r.ino>>>0,(W=r.ino,+F(W)>=1?W>0?(0|$(+j(W/4294967296),4294967295))>>>0:~~+L((W-+(~~W>>>0))/4294967296)>>>0:0)],_[n+80>>2]=Y[0],_[n+84>>2]=Y[1],0},doMsync:function(e,t,n,r,i){var o=v.slice(e,e+n);ie.msync(t,o,i,n,r)},doMkdir:function(e,t){return"/"===(e=Z.normalize(e))[e.length-1]&&(e=e.substr(0,e.length-1)),ie.mkdir(e,t,0),0},doMknod:function(e,t,n){switch(61440&t){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}return ie.mknod(e,t,n),0},doReadlink:function(e,t,n){if(n<=0)return-28;var r=ie.readlink(e),i=Math.min(n,S(r)),o=y[t+i];return k(r,v,t,n+1),y[t+i]=o,i},doAccess:function(e,t){if(-8&t)return-28;var n;if(!(n=ie.lookupPath(e,{follow:!0}).node))return-44;var r="";return 4&t&&(r+="r"),2&t&&(r+="w"),1&t&&(r+="x"),r&&ie.nodePermissions(n,r)?-2:0},doDup:function(e,t,n){var r=ie.getStream(n);return r&&ie.close(r),ie.open(e,t,0,n,n).fd},doReadv:function(e,t,n,r){for(var i=0,o=0;o>2],s=_[t+(8*o+4)>>2],l=ie.read(e,y,a,s,r);if(l<0)return-1;if(i+=l,l>2],s=_[t+(8*o+4)>>2],l=ie.write(e,y,a,s,r);if(l<0)return-1;i+=l}return i},varargs:void 0,get:function(){return oe.varargs+=4,_[oe.varargs-4>>2]},getStr:function(e){return T(e)},getStreamFromFD:function(e){var t=ie.getStream(e);if(!t)throw new ie.ErrnoError(8);return t},get64:function(e,t){return e}};function ae(e){try{return u.grow(e-g.byteLength+65535>>>16),C(u.buffer),1}catch(e){}}var se={};function le(){if(!le.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:s||"./this.program"};for(var t in se)e[t]=se[t];var n=[];for(var t in e)n.push(t+"="+e[t]);le.strings=n}return le.strings}function ce(e,t){ce.array||(ce.array=[]);var n,r=ce.array;for(r.length=0;n=v[e++];)100===n||102===n?(t=t+7&-8,r.push(b[t>>3]),t+=8):(t=t+3&-4,r.push(_[t>>2]),t+=4);return r}var ue=function(e,t,n,r){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=ie.nextInode++,this.name=t,this.mode=n,this.node_ops={},this.stream_ops={},this.rdev=r};function he(e,t,n){var r=n>0?n:S(e)+1,i=new Array(r),o=k(e,i,0,i.length);return t&&(i.length=o),i}Object.defineProperties(ue.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(e){e?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(e){e?this.mode|=146:this.mode&=-147}},isFolder:{get:function(){return ie.isDir(this.mode)}},isDevice:{get:function(){return ie.isChrdev(this.mode)}}}),ie.FSNode=ue,ie.staticInit();var pe={j:function(){return 42},b:function(){U()},a:function(e,t,n){var r=ce(t,n);return X[e].apply(null,r)},d:function(e,t,n){v.copyWithin(e,t,t+n)},e:function(e){e>>>=0;var t=v.length;if(e>2147483648)return!1;for(var n=1;n<=4;n*=2){var r=t*(1+.2/n);if(r=Math.min(r,e+100663296),ae(Math.min(2147483648,x(Math.max(16777216,e,r),65536))))return!0}return!1},f:function(e,t){var n=0;return le().forEach((function(r,i){var o=t+n;_[e+4*i>>2]=o,function(e,t,n){for(var r=0;r>0]=e.charCodeAt(r);n||(y[t>>0]=0)}(r,o),n+=r.length+1})),0},g:function(e,t){var n=le();_[e>>2]=n.length;var r=0;return n.forEach((function(e){r+=e.length+1})),_[t>>2]=r,0},h:function(e){try{var t=oe.getStreamFromFD(e);return ie.close(t),0}catch(e){return void 0!==ie&&e instanceof ie.ErrnoError||U(e),e.errno}},i:function(e,t,n,r,i){try{var o=oe.getStreamFromFD(e),a=4294967296*n+(t>>>0);return a<=-9007199254740992||a>=9007199254740992?-61:(ie.llseek(o,a,r),Y=[o.position>>>0,(W=o.position,+F(W)>=1?W>0?(0|$(+j(W/4294967296),4294967295))>>>0:~~+L((W-+(~~W>>>0))/4294967296)>>>0:0)],_[i>>2]=Y[0],_[i+4>>2]=Y[1],o.getdents&&0===a&&0===r&&(o.getdents=null),0)}catch(e){return void 0!==ie&&e instanceof ie.ErrnoError||U(e),e.errno}},c:function(e,t,n,r){try{var i=oe.getStreamFromFD(e),o=oe.doWritev(i,t,n);return _[r>>2]=o,0}catch(e){return void 0!==ie&&e instanceof ie.ErrnoError||U(e),e.errno}},k:function(e){var t=Date.now();return _[e>>2]=t/1e3|0,_[e+4>>2]=t%1e3*1e3|0,0},memory:u,table:f},fe=function(){var e={a:pe};function t(e,t){var n=e.exports;r.asm=n,z()}function n(e){t(e.instance)}function i(t){return(c||"function"!=typeof fetch?new Promise((function(e,t){e(Q())})):fetch(K,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+K+"'";return e.arrayBuffer()})).catch((function(){return Q()}))).then((function(t){return WebAssembly.instantiate(t,e)})).then(t,(function(e){p("failed to asynchronously prepare wasm: "+e),U(e)}))}if(G(),r.instantiateWasm)try{return r.instantiateWasm(e,t)}catch(e){return p("Module.instantiateWasm callback failed with error: "+e),!1}return function(){if(c||"function"!=typeof WebAssembly.instantiateStreaming||H(K)||"function"!=typeof fetch)return i(n);fetch(K,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(n,(function(e){p("wasm streaming compile failed: "+e),p("falling back to ArrayBuffer instantiation"),i(n)}))}))}(),{}}();r.asm=fe;var de,me=r.___wasm_call_ctors=function(){return(me=r.___wasm_call_ctors=r.asm.l).apply(null,arguments)},ge=(r.___em_js__array_bounds_check_error=function(){return(r.___em_js__array_bounds_check_error=r.asm.m).apply(null,arguments)},r._emscripten_bind_CExpat_CExpat_0=function(){return(ge=r._emscripten_bind_CExpat_CExpat_0=r.asm.n).apply(null,arguments)}),ye=r._emscripten_bind_CExpat_create_0=function(){return(ye=r._emscripten_bind_CExpat_create_0=r.asm.o).apply(null,arguments)},ve=r._emscripten_bind_CExpat_destroy_0=function(){return(ve=r._emscripten_bind_CExpat_destroy_0=r.asm.p).apply(null,arguments)},_e=r._emscripten_bind_CExpat_parse_1=function(){return(_e=r._emscripten_bind_CExpat_parse_1=r.asm.q).apply(null,arguments)},be=r._emscripten_bind_CExpat_tag_0=function(){return(be=r._emscripten_bind_CExpat_tag_0=r.asm.r).apply(null,arguments)},we=r._emscripten_bind_CExpat_attrs_0=function(){return(we=r._emscripten_bind_CExpat_attrs_0=r.asm.s).apply(null,arguments)},Ee=r._emscripten_bind_CExpat_content_0=function(){return(Ee=r._emscripten_bind_CExpat_content_0=r.asm.t).apply(null,arguments)},Te=r._emscripten_bind_CExpat_startElement_0=function(){return(Te=r._emscripten_bind_CExpat_startElement_0=r.asm.u).apply(null,arguments)},ke=r._emscripten_bind_CExpat_endElement_0=function(){return(ke=r._emscripten_bind_CExpat_endElement_0=r.asm.v).apply(null,arguments)},Se=r._emscripten_bind_CExpat_characterData_0=function(){return(Se=r._emscripten_bind_CExpat_characterData_0=r.asm.w).apply(null,arguments)},xe=r._emscripten_bind_CExpat___destroy___0=function(){return(xe=r._emscripten_bind_CExpat___destroy___0=r.asm.x).apply(null,arguments)},Ce=r._emscripten_bind_CExpatJS_CExpatJS_0=function(){return(Ce=r._emscripten_bind_CExpatJS_CExpatJS_0=r.asm.y).apply(null,arguments)},Pe=r._emscripten_bind_CExpatJS_startElement_0=function(){return(Pe=r._emscripten_bind_CExpatJS_startElement_0=r.asm.z).apply(null,arguments)},Ae=r._emscripten_bind_CExpatJS_endElement_0=function(){return(Ae=r._emscripten_bind_CExpatJS_endElement_0=r.asm.A).apply(null,arguments)},Ie=r._emscripten_bind_CExpatJS_characterData_0=function(){return(Ie=r._emscripten_bind_CExpatJS_characterData_0=r.asm.B).apply(null,arguments)},De=r._emscripten_bind_CExpatJS___destroy___0=function(){return(De=r._emscripten_bind_CExpatJS___destroy___0=r.asm.C).apply(null,arguments)},Re=r._emscripten_bind_VoidPtr___destroy___0=function(){return(Re=r._emscripten_bind_VoidPtr___destroy___0=r.asm.D).apply(null,arguments)},Oe=r._malloc=function(){return(Oe=r._malloc=r.asm.E).apply(null,arguments)},Ne=(r._free=function(){return(r._free=r.asm.F).apply(null,arguments)},r.___errno_location=function(){return(Ne=r.___errno_location=r.asm.G).apply(null,arguments)});function Me(e){function n(){de||(de=!0,r.calledRun=!0,d||(r.noFSInit||ie.init.initialized||ie.init(),ne.init(),A(D),ie.ignorePermissions=!1,A(R),t(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),function(){if(r.postRun)for("function"==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;)M(r.postRun.shift());A(O)}()))}B>0||(function(){if(r.preRun)for("function"==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)N(r.preRun.shift());A(I)}(),B>0||(r.setStatus?(r.setStatus("Running..."),setTimeout((function(){setTimeout((function(){r.setStatus("")}),1),n()}),1)):n()))}if(r.dynCall_vi=function(){return(r.dynCall_vi=r.asm.H).apply(null,arguments)},r.asm=fe,V=function e(){de||Me(),de||(V=e)},r.run=Me,r.preInit)for("function"==typeof r.preInit&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();function Fe(){}function Le(e){return(e||Fe).__cache__}function je(e,t){var n=Le(t),r=n[e];return r||((r=Object.create((t||Fe).prototype)).ptr=e,n[e]=r)}Me(),Fe.prototype=Object.create(Fe.prototype),Fe.prototype.constructor=Fe,Fe.prototype.__class__=Fe,Fe.__cache__={},r.WrapperObject=Fe,r.getCache=Le,r.wrapPointer=je,r.castObject=function(e,t){return je(e.ptr,t)},r.NULL=je(0),r.destroy=function(e){if(!e.__destroy__)throw"Error: Cannot destroy object. (Did you create it yourself?)";e.__destroy__(),delete Le(e.__class__)[e.ptr]},r.compare=function(e,t){return e.ptr===t.ptr},r.getPointer=function(e){return e.ptr},r.getClass=function(e){return e.__class__};var $e={buffer:0,size:0,pos:0,temps:[],needed:0,prepare:function(){if($e.needed){for(var e=0;e<$e.temps.length;e++)r._free($e.temps[e]);$e.temps.length=0,r._free($e.buffer),$e.buffer=0,$e.size+=$e.needed,$e.needed=0}$e.buffer||($e.size+=128,$e.buffer=r._malloc($e.size),m($e.buffer)),$e.pos=0},alloc:function(e,t){m($e.buffer);var n,i=t.BYTES_PER_ELEMENT,o=e.length*i;return o=o+7&-8,$e.pos+o>=$e.size?(m(o>0),$e.needed+=o,n=r._malloc(o),$e.temps.push(n)):(n=$e.buffer+$e.pos,$e.pos+=o),n},copy:function(e,t,n){switch(n>>>=0,t.BYTES_PER_ELEMENT){case 2:n>>>=1;break;case 4:n>>>=2;break;case 8:n>>>=3}for(var r=0;r=r);)++i;if(i-t>16&&e.subarray&&x)return x.decode(e.subarray(t,i));for(var o="";t>10,56320|1023&c)}}else o+=String.fromCharCode((31&a)<<6|s)}else o+=String.fromCharCode(a)}return o}function P(e,t){return e?C(E,e,t):""}function A(e,t,n,r){if(!(r>0))return 0;for(var i=n,o=n+r-1,a=0;a=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++a)),s<=127){if(n>=o)break;t[n++]=s}else if(s<=2047){if(n+1>=o)break;t[n++]=192|s>>6,t[n++]=128|63&s}else if(s<=65535){if(n+2>=o)break;t[n++]=224|s>>12,t[n++]=128|s>>6&63,t[n++]=128|63&s}else{if(n+3>=o)break;t[n++]=240|s>>18,t[n++]=128|s>>12&63,t[n++]=128|s>>6&63,t[n++]=128|63&s}}return t[n]=0,n-i}function I(e){for(var t=0,n=0;n=55296&&r<=57343&&(r=65536+((1023&r)<<10)|1023&e.charCodeAt(++n)),r<=127?++t:t+=r<=2047?2:r<=65535?3:4}return t}function D(e,t){return e%t>0&&(e+=t-e%t),e}function R(e){b=e,r.HEAP8=w=new Int8Array(e),r.HEAP16=T=new Int16Array(e),r.HEAP32=k=new Int32Array(e),r.HEAPU8=E=new Uint8Array(e),r.HEAPU16=new Uint16Array(e),r.HEAPU32=new Uint32Array(e),r.HEAPF32=new Float32Array(e),r.HEAPF64=S=new Float64Array(e)}var O=r.INITIAL_MEMORY||16777216;function N(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var n=t.func;"number"==typeof n?void 0===t.arg?r.dynCall_v(n):r.dynCall_vi(n,t.arg):n(void 0===t.arg?null:t.arg)}else t(r)}}(d=r.wasmMemory?r.wasmMemory:new WebAssembly.Memory({initial:O/65536,maximum:32768}))&&(b=d.buffer),O=b.byteLength,R(b),k[54684]=5461776;var M=[],F=[],L=[],j=[];function $(e){M.unshift(e)}function B(e){j.unshift(e)}var V=Math.abs,G=Math.ceil,z=Math.floor,U=Math.min,H=0,q=null;function W(e){H++,r.monitorRunDependencies&&r.monitorRunDependencies(H)}function Y(e){if(H--,r.monitorRunDependencies&&r.monitorRunDependencies(H),0==H&&q){var t=q;q=null,t()}}function K(e){throw r.onAbort&&r.onAbort(e),u(e+=""),h(e),v=!0,e="abort("+e+"). Build with -s ASSERTIONS=1 for more info.",new WebAssembly.RuntimeError(e)}function Q(e){return function(e,t){return String.prototype.startsWith?e.startsWith(t):0===e.indexOf(t)}(e,"data:application/octet-stream;base64,")}r.preloadedImages={},r.preloadedAudios={};var X,J,Z,ee="graphvizlib.wasm";function te(){try{if(p)return new Uint8Array(p);throw"both async and sync fetching of the wasm failed"}catch(e){K(e)}}Q(ee)||(X=ee,ee=r.locateFile?r.locateFile(X,c):c+X);var ne,re={1186:function(e,t){var n=P(e),r=P(t);ue.createPath("/",ae.dirname(n)),ue.writeFile(ae.join("/",n),r)}};function ie(){var e=function(){var e=new Error;if(!e.stack){try{throw new Error}catch(t){e=t}if(!e.stack)return"(no stack trace available)"}return e.stack.toString()}();return r.extraStackTrace&&(e+="\n"+r.extraStackTrace()),e.replace(/\b_Z[\w\d_]+/g,(function(e){return e==e?e:e+" ["+e+"]"}))}function oe(e){return k[Le()>>2]=e,e}F.push({func:function(){Pe()}}),ne=function(){return performance.now()};var ae={splitPath:function(e){return/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1)},normalizeArray:function(e,t){for(var n=0,r=e.length-1;r>=0;r--){var i=e[r];"."===i?e.splice(r,1):".."===i?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n;n--)e.unshift("..");return e},normalize:function(e){var t="/"===e.charAt(0),n="/"===e.substr(-1);return(e=ae.normalizeArray(e.split("/").filter((function(e){return!!e})),!t).join("/"))||t||(e="."),e&&n&&(e+="/"),(t?"/":"")+e},dirname:function(e){var t=ae.splitPath(e),n=t[0],r=t[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."},basename:function(e){if("/"===e)return"/";var t=e.lastIndexOf("/");return-1===t?e:e.substr(t+1)},extname:function(e){return ae.splitPath(e)[3]},join:function(){var e=Array.prototype.slice.call(arguments,0);return ae.normalize(e.join("/"))},join2:function(e,t){return ae.normalize(e+"/"+t)}},se={resolve:function(){for(var e="",t=!1,n=arguments.length-1;n>=-1&&!t;n--){var r=n>=0?arguments[n]:ue.cwd();if("string"!=typeof r)throw new TypeError("Arguments to path.resolve must be strings");if(!r)return"";e=r+"/"+e,t="/"===r.charAt(0)}return(t?"/":"")+(e=ae.normalizeArray(e.split("/").filter((function(e){return!!e})),!t).join("/"))||"."},relative:function(e,t){function n(e){for(var t=0;t=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=se.resolve(e).substr(1),t=se.resolve(t).substr(1);for(var r=n(e.split("/")),i=n(t.split("/")),o=Math.min(r.length,i.length),a=o,s=0;s0&&(u(C(e.output,0)),e.output=[])}},default_tty1_ops:{put_char:function(e,t){null===t||10===t?(h(C(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(h(C(e.output,0)),e.output=[])}}},ce={ops_table:null,mount:function(e){return ce.createNode(null,"/",16895,0)},createNode:function(e,t,n,r){if(ue.isBlkdev(n)||ue.isFIFO(n))throw new ue.ErrnoError(63);ce.ops_table||(ce.ops_table={dir:{node:{getattr:ce.node_ops.getattr,setattr:ce.node_ops.setattr,lookup:ce.node_ops.lookup,mknod:ce.node_ops.mknod,rename:ce.node_ops.rename,unlink:ce.node_ops.unlink,rmdir:ce.node_ops.rmdir,readdir:ce.node_ops.readdir,symlink:ce.node_ops.symlink},stream:{llseek:ce.stream_ops.llseek}},file:{node:{getattr:ce.node_ops.getattr,setattr:ce.node_ops.setattr},stream:{llseek:ce.stream_ops.llseek,read:ce.stream_ops.read,write:ce.stream_ops.write,allocate:ce.stream_ops.allocate,mmap:ce.stream_ops.mmap,msync:ce.stream_ops.msync}},link:{node:{getattr:ce.node_ops.getattr,setattr:ce.node_ops.setattr,readlink:ce.node_ops.readlink},stream:{}},chrdev:{node:{getattr:ce.node_ops.getattr,setattr:ce.node_ops.setattr},stream:ue.chrdev_stream_ops}});var i=ue.createNode(e,t,n,r);return ue.isDir(i.mode)?(i.node_ops=ce.ops_table.dir.node,i.stream_ops=ce.ops_table.dir.stream,i.contents={}):ue.isFile(i.mode)?(i.node_ops=ce.ops_table.file.node,i.stream_ops=ce.ops_table.file.stream,i.usedBytes=0,i.contents=null):ue.isLink(i.mode)?(i.node_ops=ce.ops_table.link.node,i.stream_ops=ce.ops_table.link.stream):ue.isChrdev(i.mode)&&(i.node_ops=ce.ops_table.chrdev.node,i.stream_ops=ce.ops_table.chrdev.stream),i.timestamp=Date.now(),e&&(e.contents[t]=i),i},getFileDataAsRegularArray:function(e){if(e.contents&&e.contents.subarray){for(var t=[],n=0;n=t)){t=Math.max(t,n*(n<1048576?2:1.125)>>>0),0!=n&&(t=Math.max(t,256));var r=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(r.subarray(0,e.usedBytes),0)}},resizeFileStorage:function(e,t){if(e.usedBytes!=t){if(0==t)return e.contents=null,void(e.usedBytes=0);if(!e.contents||e.contents.subarray){var n=e.contents;return e.contents=new Uint8Array(t),n&&e.contents.set(n.subarray(0,Math.min(t,e.usedBytes))),void(e.usedBytes=t)}if(e.contents||(e.contents=[]),e.contents.length>t)e.contents.length=t;else for(;e.contents.length=e.node.usedBytes)return 0;var a=Math.min(e.node.usedBytes-i,r);if(a>8&&o.subarray)t.set(o.subarray(i,i+a),n);else for(var s=0;s0||i+r8)throw new ue.ErrnoError(32);for(var i=ae.normalizeArray(e.split("/").filter((function(e){return!!e})),!1),o=ue.root,a="/",s=0;s40)throw new ue.ErrnoError(32)}}return{path:a,node:o}},getPath:function(e){for(var t;;){if(ue.isRoot(e)){var n=e.mount.mountpoint;return t?"/"!==n[n.length-1]?n+"/"+t:n+t:n}t=t?e.name+"/"+t:e.name,e=e.parent}},hashName:function(e,t){for(var n=0,r=0;r>>0)%ue.nameTable.length},hashAddNode:function(e){var t=ue.hashName(e.parent.id,e.name);e.name_next=ue.nameTable[t],ue.nameTable[t]=e},hashRemoveNode:function(e){var t=ue.hashName(e.parent.id,e.name);if(ue.nameTable[t]===e)ue.nameTable[t]=e.name_next;else for(var n=ue.nameTable[t];n;){if(n.name_next===e){n.name_next=e.name_next;break}n=n.name_next}},lookupNode:function(e,t){var n=ue.mayLookup(e);if(n)throw new ue.ErrnoError(n,e);for(var r=ue.hashName(e.id,t),i=ue.nameTable[r];i;i=i.name_next){var o=i.name;if(i.parent.id===e.id&&o===t)return i}return ue.lookup(e,t)},createNode:function(e,t,n,r){var i=new ue.FSNode(e,t,n,r);return ue.hashAddNode(i),i},destroyNode:function(e){ue.hashRemoveNode(e)},isRoot:function(e){return e===e.parent},isMountpoint:function(e){return!!e.mounted},isFile:function(e){return 32768==(61440&e)},isDir:function(e){return 16384==(61440&e)},isLink:function(e){return 40960==(61440&e)},isChrdev:function(e){return 8192==(61440&e)},isBlkdev:function(e){return 24576==(61440&e)},isFIFO:function(e){return 4096==(61440&e)},isSocket:function(e){return 49152==(49152&e)},flagModes:{r:0,rs:1052672,"r+":2,w:577,wx:705,xw:705,"w+":578,"wx+":706,"xw+":706,a:1089,ax:1217,xa:1217,"a+":1090,"ax+":1218,"xa+":1218},modeStringToFlags:function(e){var t=ue.flagModes[e];if(void 0===t)throw new Error("Unknown file open mode: "+e);return t},flagsToPermissionString:function(e){var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t},nodePermissions:function(e,t){return ue.ignorePermissions||(-1===t.indexOf("r")||292&e.mode)&&(-1===t.indexOf("w")||146&e.mode)&&(-1===t.indexOf("x")||73&e.mode)?0:2},mayLookup:function(e){var t=ue.nodePermissions(e,"x");return t||(e.node_ops.lookup?0:2)},mayCreate:function(e,t){try{return ue.lookupNode(e,t),20}catch(e){}return ue.nodePermissions(e,"wx")},mayDelete:function(e,t,n){var r;try{r=ue.lookupNode(e,t)}catch(e){return e.errno}var i=ue.nodePermissions(e,"wx");if(i)return i;if(n){if(!ue.isDir(r.mode))return 54;if(ue.isRoot(r)||ue.getPath(r)===ue.cwd())return 10}else if(ue.isDir(r.mode))return 31;return 0},mayOpen:function(e,t){return e?ue.isLink(e.mode)?32:ue.isDir(e.mode)&&("r"!==ue.flagsToPermissionString(t)||512&t)?31:ue.nodePermissions(e,ue.flagsToPermissionString(t)):44},MAX_OPEN_FDS:4096,nextfd:function(e,t){e=e||0,t=t||ue.MAX_OPEN_FDS;for(var n=e;n<=t;n++)if(!ue.streams[n])return n;throw new ue.ErrnoError(33)},getStream:function(e){return ue.streams[e]},createStream:function(e,t,n){ue.FSStream||(ue.FSStream=function(){},ue.FSStream.prototype={object:{get:function(){return this.node},set:function(e){this.node=e}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}}});var r=new ue.FSStream;for(var i in e)r[i]=e[i];e=r;var o=ue.nextfd(t,n);return e.fd=o,ue.streams[o]=e,e},closeStream:function(e){ue.streams[e]=null},chrdev_stream_ops:{open:function(e){var t=ue.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:function(){throw new ue.ErrnoError(70)}},major:function(e){return e>>8},minor:function(e){return 255&e},makedev:function(e,t){return e<<8|t},registerDevice:function(e,t){ue.devices[e]={stream_ops:t}},getDevice:function(e){return ue.devices[e]},getMounts:function(e){for(var t=[],n=[e];n.length;){var r=n.pop();t.push(r),n.push.apply(n,r.mounts)}return t},syncfs:function(e,t){"function"==typeof e&&(t=e,e=!1),ue.syncFSRequests++,ue.syncFSRequests>1&&h("warning: "+ue.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var n=ue.getMounts(ue.root.mount),r=0;function i(e){return ue.syncFSRequests--,t(e)}function o(e){if(e)return o.errored?void 0:(o.errored=!0,i(e));++r>=n.length&&i(null)}n.forEach((function(t){if(!t.type.syncfs)return o(null);t.type.syncfs(t,e,o)}))},mount:function(e,t,n){var r,i="/"===n,o=!n;if(i&&ue.root)throw new ue.ErrnoError(10);if(!i&&!o){var a=ue.lookupPath(n,{follow_mount:!1});if(n=a.path,r=a.node,ue.isMountpoint(r))throw new ue.ErrnoError(10);if(!ue.isDir(r.mode))throw new ue.ErrnoError(54)}var s={type:e,opts:t,mountpoint:n,mounts:[]},l=e.mount(s);return l.mount=s,s.root=l,i?ue.root=l:r&&(r.mounted=s,r.mount&&r.mount.mounts.push(s)),l},unmount:function(e){var t=ue.lookupPath(e,{follow_mount:!1});if(!ue.isMountpoint(t.node))throw new ue.ErrnoError(28);var n=t.node,r=n.mounted,i=ue.getMounts(r);Object.keys(ue.nameTable).forEach((function(e){for(var t=ue.nameTable[e];t;){var n=t.name_next;-1!==i.indexOf(t.mount)&&ue.destroyNode(t),t=n}})),n.mounted=null;var o=n.mount.mounts.indexOf(r);n.mount.mounts.splice(o,1)},lookup:function(e,t){return e.node_ops.lookup(e,t)},mknod:function(e,t,n){var r=ue.lookupPath(e,{parent:!0}).node,i=ae.basename(e);if(!i||"."===i||".."===i)throw new ue.ErrnoError(28);var o=ue.mayCreate(r,i);if(o)throw new ue.ErrnoError(o);if(!r.node_ops.mknod)throw new ue.ErrnoError(63);return r.node_ops.mknod(r,i,t,n)},create:function(e,t){return t=void 0!==t?t:438,t&=4095,t|=32768,ue.mknod(e,t,0)},mkdir:function(e,t){return t=void 0!==t?t:511,t&=1023,t|=16384,ue.mknod(e,t,0)},mkdirTree:function(e,t){for(var n=e.split("/"),r="",i=0;ithis.length-1||e<0)){var t=e%this.chunkSize,n=e/this.chunkSize|0;return this.getter(n)[t]}},o.prototype.setDataGetter=function(e){this.getter=e},o.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",n,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+n+". Status: "+e.status);var t,r=Number(e.getResponseHeader("Content-length")),i=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t,o=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t,a=1048576;i||(a=r);var s=this;s.setDataGetter((function(e){var t=e*a,i=(e+1)*a-1;if(i=Math.min(i,r-1),void 0===s.chunks[e]&&(s.chunks[e]=function(e,t){if(e>t)throw new Error("invalid range ("+e+", "+t+") or no bytes requested!");if(t>r-1)throw new Error("only "+r+" bytes available! programmer error!");var i=new XMLHttpRequest;if(i.open("GET",n,!1),r!==a&&i.setRequestHeader("Range","bytes="+e+"-"+t),"undefined"!=typeof Uint8Array&&(i.responseType="arraybuffer"),i.overrideMimeType&&i.overrideMimeType("text/plain; charset=x-user-defined"),i.send(null),!(i.status>=200&&i.status<300||304===i.status))throw new Error("Couldn't load "+n+". Status: "+i.status);return void 0!==i.response?new Uint8Array(i.response||[]):ke(i.responseText||"",!0)}(t,i)),void 0===s.chunks[e])throw new Error("doXHR failed!");return s.chunks[e]})),!o&&r||(a=r=1,r=this.getter(0).length,a=r,u("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=r,this._chunkSize=a,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var a={isDevice:!1,url:n},s=ue.createFile(e,t,a,r,i);a.contents?s.contents=a.contents:a.url&&(s.contents=null,s.url=a.url),Object.defineProperties(s,{usedBytes:{get:function(){return this.contents.length}}});var l={};return Object.keys(s.stream_ops).forEach((function(e){var t=s.stream_ops[e];l[e]=function(){if(!ue.forceLoadFile(s))throw new ue.ErrnoError(29);return t.apply(null,arguments)}})),l.read=function(e,t,n,r,i){if(!ue.forceLoadFile(s))throw new ue.ErrnoError(29);var o=e.node.contents;if(i>=o.length)return 0;var a=Math.min(o.length-i,r);if(o.slice)for(var l=0;l>2]=r.dev,k[n+4>>2]=0,k[n+8>>2]=r.ino,k[n+12>>2]=r.mode,k[n+16>>2]=r.nlink,k[n+20>>2]=r.uid,k[n+24>>2]=r.gid,k[n+28>>2]=r.rdev,k[n+32>>2]=0,Z=[r.size>>>0,(J=r.size,+V(J)>=1?J>0?(0|U(+z(J/4294967296),4294967295))>>>0:~~+G((J-+(~~J>>>0))/4294967296)>>>0:0)],k[n+40>>2]=Z[0],k[n+44>>2]=Z[1],k[n+48>>2]=4096,k[n+52>>2]=r.blocks,k[n+56>>2]=r.atime.getTime()/1e3|0,k[n+60>>2]=0,k[n+64>>2]=r.mtime.getTime()/1e3|0,k[n+68>>2]=0,k[n+72>>2]=r.ctime.getTime()/1e3|0,k[n+76>>2]=0,Z=[r.ino>>>0,(J=r.ino,+V(J)>=1?J>0?(0|U(+z(J/4294967296),4294967295))>>>0:~~+G((J-+(~~J>>>0))/4294967296)>>>0:0)],k[n+80>>2]=Z[0],k[n+84>>2]=Z[1],0},doMsync:function(e,t,n,r,i){var o=E.slice(e,e+n);ue.msync(t,o,i,n,r)},doMkdir:function(e,t){return"/"===(e=ae.normalize(e))[e.length-1]&&(e=e.substr(0,e.length-1)),ue.mkdir(e,t,0),0},doMknod:function(e,t,n){switch(61440&t){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}return ue.mknod(e,t,n),0},doReadlink:function(e,t,n){if(n<=0)return-28;var r=ue.readlink(e),i=Math.min(n,I(r)),o=w[t+i];return A(r,E,t,n+1),w[t+i]=o,i},doAccess:function(e,t){if(-8&t)return-28;var n;if(!(n=ue.lookupPath(e,{follow:!0}).node))return-44;var r="";return 4&t&&(r+="r"),2&t&&(r+="w"),1&t&&(r+="x"),r&&ue.nodePermissions(n,r)?-2:0},doDup:function(e,t,n){var r=ue.getStream(n);return r&&ue.close(r),ue.open(e,t,0,n,n).fd},doReadv:function(e,t,n,r){for(var i=0,o=0;o>2],s=k[t+(8*o+4)>>2],l=ue.read(e,w,a,s,r);if(l<0)return-1;if(i+=l,l>2],s=k[t+(8*o+4)>>2],l=ue.write(e,w,a,s,r);if(l<0)return-1;i+=l}return i},varargs:void 0,get:function(){return he.varargs+=4,k[he.varargs-4>>2]},getStr:function(e){return P(e)},getStreamFromFD:function(e){var t=ue.getStream(e);if(!t)throw new ue.ErrnoError(8);return t},get64:function(e,t){return e}},pe=0;function fe(e){try{return d.grow(e-b.byteLength+65535>>>16),R(d.buffer),1}catch(e){}}var de={};function me(){if(!me.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:s||"./this.program"};for(var t in de)e[t]=de[t];var n=[];for(var t in e)n.push(t+"="+e[t]);me.strings=n}return me.strings}function ge(e){return e%4==0&&(e%100!=0||e%400==0)}function ye(e,t){for(var n=0,r=0;r<=t;n+=e[r++]);return n}var ve=[31,29,31,30,31,30,31,31,30,31,30,31],_e=[31,28,31,30,31,30,31,31,30,31,30,31];function be(e,t){for(var n=new Date(e.getTime());t>0;){var r=ge(n.getFullYear()),i=n.getMonth(),o=(r?ve:_e)[i];if(!(t>o-n.getDate()))return n.setDate(n.getDate()+t),n;t-=o-n.getDate()+1,n.setDate(1),i<11?n.setMonth(i+1):(n.setMonth(0),n.setFullYear(n.getFullYear()+1))}return n}function we(e,t,n,r){var i=k[r+40>>2],o={tm_sec:k[r>>2],tm_min:k[r+4>>2],tm_hour:k[r+8>>2],tm_mday:k[r+12>>2],tm_mon:k[r+16>>2],tm_year:k[r+20>>2],tm_wday:k[r+24>>2],tm_yday:k[r+28>>2],tm_isdst:k[r+32>>2],tm_gmtoff:k[r+36>>2],tm_zone:i?P(i):""},a=P(n),s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var l in s)a=a.replace(new RegExp(l,"g"),s[l]);var c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],u=["January","February","March","April","May","June","July","August","September","October","November","December"];function h(e,t,n){for(var r="number"==typeof e?e.toString():e||"";r.length0?1:0}var r;return 0===(r=n(e.getFullYear()-t.getFullYear()))&&0===(r=n(e.getMonth()-t.getMonth()))&&(r=n(e.getDate()-t.getDate())),r}function d(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function m(e){var t=be(new Date(e.tm_year+1900,0,1),e.tm_yday),n=new Date(t.getFullYear(),0,4),r=new Date(t.getFullYear()+1,0,4),i=d(n),o=d(r);return f(i,t)<=0?f(o,t)<=0?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var g={"%a":function(e){return c[e.tm_wday].substring(0,3)},"%A":function(e){return c[e.tm_wday]},"%b":function(e){return u[e.tm_mon].substring(0,3)},"%B":function(e){return u[e.tm_mon]},"%C":function(e){return p((e.tm_year+1900)/100|0,2)},"%d":function(e){return p(e.tm_mday,2)},"%e":function(e){return h(e.tm_mday,2," ")},"%g":function(e){return m(e).toString().substring(2)},"%G":function(e){return m(e)},"%H":function(e){return p(e.tm_hour,2)},"%I":function(e){var t=e.tm_hour;return 0==t?t=12:t>12&&(t-=12),p(t,2)},"%j":function(e){return p(e.tm_mday+ye(ge(e.tm_year+1900)?ve:_e,e.tm_mon-1),3)},"%m":function(e){return p(e.tm_mon+1,2)},"%M":function(e){return p(e.tm_min,2)},"%n":function(){return"\n"},"%p":function(e){return e.tm_hour>=0&&e.tm_hour<12?"AM":"PM"},"%S":function(e){return p(e.tm_sec,2)},"%t":function(){return"\t"},"%u":function(e){return e.tm_wday||7},"%U":function(e){var t=new Date(e.tm_year+1900,0,1),n=0===t.getDay()?t:be(t,7-t.getDay()),r=new Date(e.tm_year+1900,e.tm_mon,e.tm_mday);if(f(n,r)<0){var i=ye(ge(r.getFullYear())?ve:_e,r.getMonth()-1)-31,o=31-n.getDate()+i+r.getDate();return p(Math.ceil(o/7),2)}return 0===f(n,t)?"01":"00"},"%V":function(e){var t,n=new Date(e.tm_year+1900,0,4),r=new Date(e.tm_year+1901,0,4),i=d(n),o=d(r),a=be(new Date(e.tm_year+1900,0,1),e.tm_yday);return f(a,i)<0?"53":f(o,a)<=0?"01":(t=i.getFullYear()=0;return t=(t=Math.abs(t)/60)/60*100+t%60,(n?"+":"-")+String("0000"+t).slice(-4)},"%Z":function(e){return e.tm_zone},"%%":function(){return"%"}};for(var l in g)a.indexOf(l)>=0&&(a=a.replace(new RegExp(l,"g"),g[l](o)));var y=ke(a,!1);return y.length>t?0:(function(e,t){w.set(e,t)}(y,e),y.length-1)}function Ee(e,t){Ee.array||(Ee.array=[]);var n,r=Ee.array;for(r.length=0;n=E[e++];)100===n||102===n?(t=t+7&-8,r.push(S[t>>3]),t+=8):(t=t+3&-4,r.push(k[t>>2]),t+=4);return r}var Te=function(e,t,n,r){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=ue.nextInode++,this.name=t,this.mode=n,this.node_ops={},this.stream_ops={},this.rdev=r};function ke(e,t,n){var r=n>0?n:I(e)+1,i=new Array(r),o=A(e,i,0,i.length);return t&&(i.length=o),i}Object.defineProperties(Te.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(e){e?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(e){e?this.mode|=146:this.mode&=-147}},isFolder:{get:function(){return ue.isDir(this.mode)}},isDevice:{get:function(){return ue.isChrdev(this.mode)}}}),ue.FSNode=Te,ue.staticInit();var Se={L:function(e,t){return function(e,t){var n;if(0===e)n=Date.now();else{if(1!==e&&4!==e)return oe(28),-1;n=ne()}return k[t>>2]=n/1e3|0,k[t+4>>2]=n%1e3*1e3*1e3|0,0}(e,t)},k:function(e){return Ne(e)},j:function(e,t,n){throw e},J:function(e,t){return oe(63),-1},Q:function(e,t){try{return e=he.getStr(e),he.doAccess(e,t)}catch(e){return void 0!==ue&&e instanceof ue.ErrnoError||K(e),-e.errno}},x:function(e,t,n){he.varargs=n;try{var r=he.getStreamFromFD(e);switch(t){case 0:return(i=he.get())<0?-28:ue.open(r.path,r.flags,0,i).fd;case 1:case 2:return 0;case 3:return r.flags;case 4:var i=he.get();return r.flags|=i,0;case 12:return i=he.get(),T[i+0>>1]=2,0;case 13:case 14:return 0;case 16:case 8:return-28;case 9:return oe(28),-1;default:return-28}}catch(e){return void 0!==ue&&e instanceof ue.ErrnoError||K(e),-e.errno}},S:function(e,t){try{var n=he.getStreamFromFD(e);return he.doStat(ue.stat,n.path,t)}catch(e){return void 0!==ue&&e instanceof ue.ErrnoError||K(e),-e.errno}},p:function(){return 42},N:function(e,t,n){he.varargs=n;try{var r=he.getStreamFromFD(e);switch(t){case 21509:case 21505:return r.tty?0:-59;case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:return r.tty?0:-59;case 21519:if(!r.tty)return-59;var i=he.get();return k[i>>2]=0,0;case 21520:return r.tty?-28:-59;case 21531:return i=he.get(),ue.ioctl(r,t,i);case 21523:case 21524:return r.tty?0:-59;default:K("bad ioctl syscall "+t)}}catch(e){return void 0!==ue&&e instanceof ue.ErrnoError||K(e),-e.errno}},O:function(e,t,n,r,i,o){try{return function(e,t,n,r,i,o){var a;o<<=12;var s=!1;if(0!=(16&r)&&e%16384!=0)return-28;if(0!=(32&r)){if(!(a=Be(16384,t)))return-48;je(a,0,t),s=!0}else{var l=ue.getStream(i);if(!l)return-8;var c=ue.mmap(l,E,e,t,o,n,r);a=c.ptr,s=c.allocated}return he.mappings[a]={malloc:a,len:t,allocated:s,fd:i,prot:n,flags:r,offset:o},a}(e,t,n,r,i,o)}catch(e){return void 0!==ue&&e instanceof ue.ErrnoError||K(e),-e.errno}},P:function(e,t){try{return function(e,t){if(-1==(0|e)||0===t)return-28;var n=he.mappings[e];if(!n)return 0;if(t===n.len){var r=ue.getStream(n.fd);2&n.prot&&he.doMsync(e,r,t,n.flags,n.offset),ue.munmap(r),he.mappings[e]=null,n.allocated&&Me(n.malloc)}return 0}(e,t)}catch(e){return void 0!==ue&&e instanceof ue.ErrnoError||K(e),-e.errno}},y:function(e,t,n){he.varargs=n;try{var r=he.getStr(e),i=he.get();return ue.open(r,t,i).fd}catch(e){return void 0!==ue&&e instanceof ue.ErrnoError||K(e),-e.errno}},R:function(e,t){try{return e=he.getStr(e),he.doStat(ue.stat,e,t)}catch(e){return void 0!==ue&&e instanceof ue.ErrnoError||K(e),-e.errno}},K:function(e){try{return e=he.getStr(e),ue.unlink(e),0}catch(e){return void 0!==ue&&e instanceof ue.ErrnoError||K(e),-e.errno}},v:function(){K()},B:function(e,t,n){var r=Ee(t,n);return re[e].apply(null,r)},d:function(e,t){!function(e,t){throw $e(e,t||1),"longjmp"}(e,t)},D:function(e,t,n){E.copyWithin(e,t,t+n)},E:function(e){e>>>=0;var t=E.length;if(e>2147483648)return!1;for(var n=1;n<=4;n*=2){var r=t*(1+.2/n);if(r=Math.min(r,e+100663296),fe(Math.min(2147483648,D(Math.max(16777216,e,r),65536))))return!0}return!1},H:function(e,t){var n=0;return me().forEach((function(r,i){var o=t+n;k[e+4*i>>2]=o,function(e,t,n){for(var r=0;r>0]=e.charCodeAt(r);n||(w[t>>0]=0)}(r,o),n+=r.length+1})),0},I:function(e,t){var n=me();k[e>>2]=n.length;var r=0;return n.forEach((function(e){r+=e.length+1})),k[t>>2]=r,0},l:function(e){!function(e,t){t&&f&&0===e||(f||(v=!0,r.onExit&&r.onExit(e)),l(e,new rt(e)))}(e)},o:function(e){try{var t=he.getStreamFromFD(e);return ue.close(t),0}catch(e){return void 0!==ue&&e instanceof ue.ErrnoError||K(e),e.errno}},G:function(e,t){try{var n=he.getStreamFromFD(e),r=n.tty?2:ue.isDir(n.mode)?3:ue.isLink(n.mode)?7:4;return w[t>>0]=r,0}catch(e){return void 0!==ue&&e instanceof ue.ErrnoError||K(e),e.errno}},M:function(e,t,n,r){try{var i=he.getStreamFromFD(e),o=he.doReadv(i,t,n);return k[r>>2]=o,0}catch(e){return void 0!==ue&&e instanceof ue.ErrnoError||K(e),e.errno}},C:function(e,t,n,r,i){try{var o=he.getStreamFromFD(e),a=4294967296*n+(t>>>0);return a<=-9007199254740992||a>=9007199254740992?-61:(ue.llseek(o,a,r),Z=[o.position>>>0,(J=o.position,+V(J)>=1?J>0?(0|U(+z(J/4294967296),4294967295))>>>0:~~+G((J-+(~~J>>>0))/4294967296)>>>0:0)],k[i>>2]=Z[0],k[i+4>>2]=Z[1],o.getdents&&0===a&&0===r&&(o.getdents=null),0)}catch(e){return void 0!==ue&&e instanceof ue.ErrnoError||K(e),e.errno}},w:function(e,t,n,r){try{var i=he.getStreamFromFD(e),o=he.doWritev(i,t,n);return k[r>>2]=o,0}catch(e){return void 0!==ue&&e instanceof ue.ErrnoError||K(e),e.errno}},a:function(){return 0|m},V:function(e){var t=Date.now();return k[e>>2]=t/1e3|0,k[e+4>>2]=t%1e3*1e3|0,0},W:function(e){var t=tt();try{return Ze(e)}catch(e){if(nt(t),e!==e+0&&"longjmp"!==e)throw e;$e(1,0)}},T:function(e,t){var n=tt();try{return et(e,t)}catch(e){if(nt(n),e!==e+0&&"longjmp"!==e)throw e;$e(1,0)}},u:function(e){var t=tt();try{return We(e)}catch(e){if(nt(t),e!==e+0&&"longjmp"!==e)throw e;$e(1,0)}},f:function(e,t){var n=tt();try{return Ye(e,t)}catch(e){if(nt(n),e!==e+0&&"longjmp"!==e)throw e;$e(1,0)}},e:function(e,t,n){var r=tt();try{return Ke(e,t,n)}catch(e){if(nt(r),e!==e+0&&"longjmp"!==e)throw e;$e(1,0)}},g:function(e,t,n,r){var i=tt();try{return Qe(e,t,n,r)}catch(e){if(nt(i),e!==e+0&&"longjmp"!==e)throw e;$e(1,0)}},m:function(e,t,n,r,i){var o=tt();try{return Xe(e,t,n,r,i)}catch(e){if(nt(o),e!==e+0&&"longjmp"!==e)throw e;$e(1,0)}},U:function(e,t,n,r,i,o,a){var s=tt();try{return Je(e,t,n,r,i,o,a)}catch(e){if(nt(s),e!==e+0&&"longjmp"!==e)throw e;$e(1,0)}},r:function(e){var t=tt();try{Ve(e)}catch(e){if(nt(t),e!==e+0&&"longjmp"!==e)throw e;$e(1,0)}},h:function(e,t){var n=tt();try{Ge(e,t)}catch(e){if(nt(n),e!==e+0&&"longjmp"!==e)throw e;$e(1,0)}},n:function(e,t,n){var r=tt();try{ze(e,t,n)}catch(e){if(nt(r),e!==e+0&&"longjmp"!==e)throw e;$e(1,0)}},t:function(e,t,n,r){var i=tt();try{Ue(e,t,n,r)}catch(e){if(nt(i),e!==e+0&&"longjmp"!==e)throw e;$e(1,0)}},s:function(e,t,n,r,i){var o=tt();try{He(e,t,n,r,i)}catch(e){if(nt(o),e!==e+0&&"longjmp"!==e)throw e;$e(1,0)}},q:function(e,t,n,r,i,o){var a=tt();try{qe(e,t,n,r,i,o)}catch(e){if(nt(a),e!==e+0&&"longjmp"!==e)throw e;$e(1,0)}},memory:d,i:function e(t,n,r,i){n|=0,r|=0,i|=0;var o=0;for(pe=pe+1|0,k[(t|=0)>>2]=pe;(0|o)<(0|i);){if(0==(0|k[r+(o<<3)>>2]))return k[r+(o<<3)>>2]=pe,k[r+(4+(o<<3))>>2]=n,k[r+(8+(o<<3))>>2]=0,g(0|i),0|r;o=o+1|0}return r=0|e(0|t,0|n,0|(r=0|Fe(0|r,8*(1+(i=2*i|0)|0)|0)),0|i),g(0|i),0|r},b:function(e){g(0|e)},F:function(e,t,n,r){return we(e,t,n,r)},table:y,c:function(e,t,n){e|=0,t|=0,n|=0;for(var r=0,i=0;(0|r)<(0|n)&&0!=(0|(i=0|k[t+(r<<3)>>2]));){if((0|i)==(0|e))return 0|k[t+(4+(r<<3))>>2];r=r+1|0}return 0},z:function(e){var t=Date.now()/1e3|0;return e&&(k[e>>2]=t),t},A:function(e){return 0!==e&&je(e,0,16),0}},xe=function(){var e={a:Se};function t(e,t){var n=e.exports;r.asm=n,Y()}function n(e){t(e.instance)}function i(t){return(p||"function"!=typeof fetch?new Promise((function(e,t){e(te())})):fetch(ee,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+ee+"'";return e.arrayBuffer()})).catch((function(){return te()}))).then((function(t){return WebAssembly.instantiate(t,e)})).then(t,(function(e){h("failed to asynchronously prepare wasm: "+e),K(e)}))}if(W(),r.instantiateWasm)try{return r.instantiateWasm(e,t)}catch(e){return h("Module.instantiateWasm callback failed with error: "+e),!1}return function(){if(p||"function"!=typeof WebAssembly.instantiateStreaming||Q(ee)||"function"!=typeof fetch)return i(n);fetch(ee,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(n,(function(e){h("wasm streaming compile failed: "+e),h("falling back to ArrayBuffer instantiation"),i(n)}))}))}(),{}}();r.asm=xe;var Ce,Pe=r.___wasm_call_ctors=function(){return(Pe=r.___wasm_call_ctors=r.asm.X).apply(null,arguments)},Ae=(r.___em_js__array_bounds_check_error=function(){return(r.___em_js__array_bounds_check_error=r.asm.Y).apply(null,arguments)},r._emscripten_bind_VoidPtr___destroy___0=function(){return(Ae=r._emscripten_bind_VoidPtr___destroy___0=r.asm.Z).apply(null,arguments)}),Ie=r._emscripten_bind_Main_layout_3=function(){return(Ie=r._emscripten_bind_Main_layout_3=r.asm._).apply(null,arguments)},De=r._emscripten_bind_Main_lastError_0=function(){return(De=r._emscripten_bind_Main_lastError_0=r.asm.$).apply(null,arguments)},Re=r._emscripten_bind_Main_createFile_2=function(){return(Re=r._emscripten_bind_Main_createFile_2=r.asm.aa).apply(null,arguments)},Oe=r._emscripten_bind_Main___destroy___0=function(){return(Oe=r._emscripten_bind_Main___destroy___0=r.asm.ba).apply(null,arguments)},Ne=r._malloc=function(){return(Ne=r._malloc=r.asm.ca).apply(null,arguments)},Me=r._free=function(){return(Me=r._free=r.asm.da).apply(null,arguments)},Fe=r._realloc=function(){return(Fe=r._realloc=r.asm.ea).apply(null,arguments)},Le=r.___errno_location=function(){return(Le=r.___errno_location=r.asm.fa).apply(null,arguments)},je=r._memset=function(){return(je=r._memset=r.asm.ga).apply(null,arguments)},$e=r._setThrew=function(){return($e=r._setThrew=r.asm.ha).apply(null,arguments)},Be=r._memalign=function(){return(Be=r._memalign=r.asm.ia).apply(null,arguments)},Ve=r.dynCall_v=function(){return(Ve=r.dynCall_v=r.asm.ja).apply(null,arguments)},Ge=r.dynCall_vi=function(){return(Ge=r.dynCall_vi=r.asm.ka).apply(null,arguments)},ze=r.dynCall_vii=function(){return(ze=r.dynCall_vii=r.asm.la).apply(null,arguments)},Ue=r.dynCall_viii=function(){return(Ue=r.dynCall_viii=r.asm.ma).apply(null,arguments)},He=r.dynCall_viiii=function(){return(He=r.dynCall_viiii=r.asm.na).apply(null,arguments)},qe=r.dynCall_viiiii=function(){return(qe=r.dynCall_viiiii=r.asm.oa).apply(null,arguments)},We=r.dynCall_i=function(){return(We=r.dynCall_i=r.asm.pa).apply(null,arguments)},Ye=r.dynCall_ii=function(){return(Ye=r.dynCall_ii=r.asm.qa).apply(null,arguments)},Ke=r.dynCall_iii=function(){return(Ke=r.dynCall_iii=r.asm.ra).apply(null,arguments)},Qe=r.dynCall_iiii=function(){return(Qe=r.dynCall_iiii=r.asm.sa).apply(null,arguments)},Xe=r.dynCall_iiiii=function(){return(Xe=r.dynCall_iiiii=r.asm.ta).apply(null,arguments)},Je=r.dynCall_iiiiiii=function(){return(Je=r.dynCall_iiiiiii=r.asm.ua).apply(null,arguments)},Ze=r.dynCall_d=function(){return(Ze=r.dynCall_d=r.asm.va).apply(null,arguments)},et=r.dynCall_di=function(){return(et=r.dynCall_di=r.asm.wa).apply(null,arguments)},tt=r.stackSave=function(){return(tt=r.stackSave=r.asm.xa).apply(null,arguments)},nt=r.stackRestore=function(){return(nt=r.stackRestore=r.asm.ya).apply(null,arguments)};function rt(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function it(e){function n(){Ce||(Ce=!0,r.calledRun=!0,v||(r.noFSInit||ue.init.initialized||ue.init(),le.init(),N(F),ue.ignorePermissions=!1,N(L),t(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),function(){if(r.postRun)for("function"==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;)B(r.postRun.shift());N(j)}()))}H>0||(function(){if(r.preRun)for("function"==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)$(r.preRun.shift());N(M)}(),H>0||(r.setStatus?(r.setStatus("Running..."),setTimeout((function(){setTimeout((function(){r.setStatus("")}),1),n()}),1)):n()))}if(r.asm=xe,q=function e(){Ce||it(),Ce||(q=e)},r.run=it,r.preInit)for("function"==typeof r.preInit&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();function ot(){}function at(e){return(e||ot).__cache__}function st(e,t){var n=at(t),r=n[e];return r||((r=Object.create((t||ot).prototype)).ptr=e,n[e]=r)}f=!0,it(),ot.prototype=Object.create(ot.prototype),ot.prototype.constructor=ot,ot.prototype.__class__=ot,ot.__cache__={},r.WrapperObject=ot,r.getCache=at,r.wrapPointer=st,r.castObject=function(e,t){return st(e.ptr,t)},r.NULL=st(0),r.destroy=function(e){if(!e.__destroy__)throw"Error: Cannot destroy object. (Did you create it yourself?)";e.__destroy__(),delete at(e.__class__)[e.ptr]},r.compare=function(e,t){return e.ptr===t.ptr},r.getPointer=function(e){return e.ptr},r.getClass=function(e){return e.__class__};var lt={buffer:0,size:0,pos:0,temps:[],needed:0,prepare:function(){if(lt.needed){for(var e=0;e=lt.size?(_(o>0),lt.needed+=o,n=r._malloc(o),lt.temps.push(n)):(n=lt.buffer+lt.pos,lt.pos+=o),n},copy:function(e,t,n){switch(n>>>=0,t.BYTES_PER_ELEMENT){case 2:n>>>=1;break;case 4:n>>>=2;break;case 8:n>>>=3}for(var r=0;r\n\n'}}function imagesToFiles(e){return e.map(imageToFile)}function createFiles(e,t){var n=__assign({images:[],files:[]},t);__spreadArrays$1(n.files,imagesToFiles(n.images)).forEach((function(t){return e.Main.prototype.createFile(t.path,t.data)}))}var graphviz={layout:function(e,t,n,r){return void 0===t&&(t="svg"),void 0===n&&(n="dot"),e?loadWasm(graphvizlib$1,null==r?void 0:r.wasmFolder).then((function(i){createFiles(i,r);var o=i.Main.prototype.layout(e,t,n);if(!o)throw new Error(i.Main.prototype.lastError());return o})):Promise.resolve("")},circo:function(e,t,n){return void 0===t&&(t="svg"),this.layout(e,t,"circo",n)},dot:function(e,t,n){return void 0===t&&(t="svg"),this.layout(e,t,"dot",n)},fdp:function(e,t,n){return void 0===t&&(t="svg"),this.layout(e,t,"fdp",n)},neato:function(e,t,n){return void 0===t&&(t="svg"),this.layout(e,t,"neato",n)},osage:function(e,t,n){return void 0===t&&(t="svg"),this.layout(e,t,"osage",n)},patchwork:function(e,t,n){return void 0===t&&(t="svg"),this.layout(e,t,"patchwork",n)},twopi:function(e,t,n){return void 0===t&&(t="svg"),this.layout(e,t,"twopi",n)}},escapeReplacements={amp:"&",lt:"<",gt:">",quot:'"',"#39":"'"};function unescape(e){return e.text.replace(/&(amp|lt|gt|quot|#39);/g,(function(e,t){return escapeReplacements[t]}))}function Code(e){const t=react_7(null),[n,r]=react_6("txt"),[i,o]=react_6("");return react_12(()=>{t.current&&monaco.editor.colorize(i||"",n||"text",{tabSize:2}).then(e=>{t.current.innerHTML=e},e=>{console.error(e)})},[t,i,n]),react_5(()=>{e.code!=i&&o(e.code),e.language!=n&&r(e.language)}),react.createElement("pre",{ref:t,className:"vs"},i)}function Dot(e){const[t,n]=react_6("Loading..."),[r,i]=react_6();return react_5(()=>{graphviz.dot(e.code,"svg",{wasmFolder:"wasm"}).then(e=>{i(""),n(e)}).catch(e=>{i(e.message)})},[e.code]),react.createElement(react.Fragment,null,r&&react.createElement("pre",null,r),react.createElement(DownloadSvg,{dangerouslySetInnerHTML:{__html:t}}))}function renderMarkdown(e,t=0){if("type"in e){if("heading"!==e.type){if("code"===e.type)return"sequence"==e.lang?react.createElement(SequenceDiagram,{key:t,input:unescape(e)||""}):"dot"==e.lang?react.createElement(Dot,{key:t,code:unescape(e)||""}):react.createElement(Code,{key:t,language:e.lang||"",code:unescape(e)});if("paragraph"===e.type)return"tokens"in e?react.createElement("p",{key:t},e.tokens.map(renderMarkdown)):react.createElement("p",{key:t},unescape(e));if("blockquote"===e.type)return"tokens"in e?react.createElement("blockquote",{key:t},e.tokens.map(renderMarkdown)):react.createElement("blockquote",{key:t},unescape(e));if("em"===e.type)return"tokens"in e?react.createElement("em",{key:t},e.tokens.map(renderMarkdown)):react.createElement("em",{key:t},unescape(e));if("strong"===e.type)return"tokens"in e?react.createElement("b",{key:t},e.tokens.map(renderMarkdown)):react.createElement("b",{key:t},unescape(e));if("html"===e.type)return react.createElement("span",{key:t},JSON.stringify(e.raw,null,2));if("text"===e.type)return"tokens"in e?react.createElement("span",{key:t},e.tokens.map(renderMarkdown)):react.createElement("span",{key:t},unescape(e));if("codespan"===e.type)return react.createElement("code",{key:t},unescape(e));if("link"===e.type)return react.createElement("span",{key:t},unescape(e));if("space"===e.type)return react.createElement("div",{key:t,className:"my-2"});if("escape"===e.type)return react.createElement("span",{key:t},unescape(e));if("hr"===e.type)return react.createElement("hr",{key:t});if("list_item"===e.type)return"tokens"in e?react.createElement("li",{key:t},e.tokens.map(renderMarkdown)):react.createElement("li",{key:t},unescape(e));if("list"===e.type){const n=e;return n.ordered?react.createElement("ol",{key:t,start:n.start},n.items.map(renderMarkdown)):react.createElement("ul",{key:t},n.items.map(renderMarkdown))}return react.createElement("span",{key:t,style:{color:"red!important"}},e.raw)}switch(e.depth){case 1:return react.createElement("h1",{key:t},unescape(e));case 2:return react.createElement("h2",{key:t},unescape(e));case 3:return react.createElement("h3",{key:t},unescape(e));case 4:return react.createElement("h4",{key:t},unescape(e));case 5:return react.createElement("h5",{key:t},unescape(e));default:return react.createElement("h6",{key:t},unescape(e))}}return react.createElement("code",{key:t,style:{color:"orange!important"}},JSON.stringify(e,null,2))}function saveSize(e){localStorage.setItem("w-size",JSON.stringify({size:e}))}function loadSize(){try{const e=JSON.parse(localStorage.getItem("w-size")||"{}");if("number"==typeof e.size&&!isNaN(e.size)&&e.size>=0)return e.size}catch{}return.3*window.innerWidth}function Editor$1(e){const t=react_7(),[n,r]=react_6(null),[i,o]=react_6(!1),[a,s]=react_6(!1),[l,c]=react_6(null),[u,h]=react_6([]),p=useRouteMatch(),f=useLocation(),d=useAuth(),m="notepadId"in p.params,g=e.readonly||m,[y,v]=react_6(e.readonly?0:loadSize()),[_,b]=react_6(),[,w]=react_6(!1),[E,T]=react_6(null),[k,S]=react_6(null);let x=null;react_5(()=>{const e=new URLSearchParams(f.search);b(e.get("t")||""),e.has("open")&&v(loadSize())},[f.search]);const C=g?"vs-disabled":"vs";async function P(){const e=t.current.getValue();o(!0);const{ref:n,succeed:r,owner:i}=await newNotebookWithContent(e);o(!1),r&&(logEvent$1("make_copy"),v(loadSize()),navigateTo(`/notebook/${i}/${n.key}`))}react_5(()=>{if("notebook"in p.params&&p.params.notebook){const e=openByHash(p.params.user,p.params.notebook);r(e)}else r(null)},[p.url]),react_5(()=>{if(t.current)if(monaco.editor.defineTheme("vs-disabled",{base:"vs",inherit:!0,rules:[],colors:{"editor.background":"#eeeeee"}}),monaco.editor.setTheme(C),t.current.render(),x=null,l&&(l.dispose(),t.current.setValue("")),n){t.current.setValue("");let e={defaultText:DEFAULT_EXAMPLE};d.uid&&(e.userId=d.uid),c(Firepad.fromMonaco(n,t.current,e))}else g&&_&&(c(null),t.current.setValue(_||""))},[t.current,n,_,g]),react_5(()=>{l&&l.on("synced",(function(e){s(!e)}))},[l]),react_5(()=>{l&&d.uid&&l.setUserId(d.uid)},[d.data]),react_5(()=>{t.current&&t.current.layout()},[y]);let A=!1;for(let e of u)if("type"in e&&"heading"==e.type){document.title=e.text+" - Diagrams",x=e.text,A=!0;break}A||(document.title="Untitled document - Diagrams");const I=u.map(renderMarkdown);return react_5(()=>{n?(n.child("meta").once("value",(function(e){S(e||null)})),x&&n.child("meta/title").set(x,e=>{e&&console.log("err, cant set meta")})):S(null)},[n,x]),react_5(()=>{k&&index_cjs$3.database().ref().child(`users/${k.child("uid").val()}/profile`).once("value",(function(e){T(e.toJSON())}))},[k]),react.createElement("div",{className:0==y?"fullscreen":""},react.createElement(ResizeableSidebar,{size:y,onResize:e=>{v(e),saveSize(e)}},react.createElement("div",{className:"tools d-flex flex-justify-between",style:{width:y}},react.createElement("div",{className:"p-2 d-flex"},_?react.createElement("div",{className:"flex-self-center ml-2"},react.createElement("span",{className:"css-truncate css-truncate-overflow"},x)):E?react.createElement(react.Fragment,null,react.createElement("img",{className:"avatar avatar-small m-2",alt:E.login,src:E.avatar_url+"&s=40",width:"20",height:"20","aria-label":E.login}),react.createElement("div",{className:"flex-self-center"},react.createElement("span",{style:{fontFamily:monospaceFont}},E.login)," / ",react.createElement("span",{className:"css-truncate css-truncate-overflow"},x))):react.createElement(react.Fragment,null,react.createElement("img",{className:"avatar avatar-small m-2",alt:"anonymous",src:"https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png",width:"20",height:"20","aria-label":"Sign in"}),react.createElement("div",{className:"flex-self-center"},react.createElement("span",{style:{fontFamily:monospaceFont,fontWeight:"bold"}},"anonymous")," / ",react.createElement("span",{className:"css-truncate css-truncate-overflow"},x)))),react.createElement("div",{className:"p-2"},react.createElement((function(){return d.uid?react.createElement("button",{className:"btn tooltipped tooltipped-se mr-2","aria-label":"Makes a copy",onClick:P,"aria-disabled":!d.uid},react.createElement(RepoForkedIcon,{size:16}),react.createElement("span",null,"Make a copy",i&&react.createElement("span",{className:"AnimatedEllipsis"}))):react.createElement("details",{className:"dropdown details-reset details-overlay d-inline-block mr-2"},react.createElement("summary",{"aria-haspopup":"true"},react.createElement("span",{className:"btn"},react.createElement(RepoForkedIcon,{size:16}),"Make a copy",i&&react.createElement("span",{className:"AnimatedEllipsis"}),react.createElement("div",{className:"dropdown-caret"}))),react.createElement("ul",{className:"dropdown-menu dropdown-menu-se",style:{width:300}},react.createElement("li",null,react.createElement("a",{className:"dropdown-item",onClick:async()=>{o(!0),await d.signin(),P()},href:document.location.toString()},react.createElement(MarkGithubIcon,{size:16,className:"mr-2"}),react.createElement("span",null,"Sign-in with GitHub"))),react.createElement("li",null,react.createElement("a",{className:"dropdown-item",onClick:async()=>{o(!0),P()},href:document.location.toString()},react.createElement("span",null,"Continue anonymously")))))}),null))),react.createElement("div",{className:"editor",style:{width:y}},g&&react.createElement("div",{className:"readonly-notice",style:{borderBottom:"1px solid #dbdbda"}},react.createElement("div",{className:"Toast Toast--warning",style:{maxWidth:1e3,width:"auto"}},react.createElement("span",{className:"Toast-icon"},react.createElement(AlertIcon,{size:16})),react.createElement("span",{className:"Toast-content"},"This is a read-only page. Make a copy to edit the document."))),react.createElement(ErrorBoundary,null,react.createElement(Monaco,{theme:C,language:"markdown",loading:react.createElement("div",null,"Loading editor..."),value:"",editorDidMount:function(e,n){t.current=n,w(!0),t.current.onDidChangeModelContent(e=>{const n=parseMD(t.current.getValue());h(n)})},options:{fontFamily:monospaceFont,lineNumbers:"on",minimap:{enabled:!1},automaticLayout:!0}})))),react.createElement("div",{className:"content",style:{left:y+5}},react.createElement("div",{className:"top-bar content-bar d-flex flex-justify-between"},react.createElement("div",{className:"p-2"},react.createElement("button",{className:"btn btn-octicon tooltipped tooltipped-se mr-2","aria-label":"Show or hide the code editor.",onClick:()=>{v(0==y?loadSize():0)}},react.createElement(UseAnimations,{reverse:0==y,animation:skipBack$3,size:24,strokeColor:"#586069"})),a&&react.createElement("span",{className:"m-1"},react.createElement("span",null,"Saving"),react.createElement("span",{className:"AnimatedEllipsis"}))),react.createElement("div",{className:"p-2 d-flex"},react.createElement(UserList,{documentRef:n}),react.createElement(DropdownShare,{label:"Share",className:"btn-invisible"},react.createElement("li",null,react.createElement("a",{className:"dropdown-item",onClick:function(){copyTextToClipboard(generateStaticLink(t.current.getValue())).then(()=>{t.current.focus(),logEvent$1("share_ro"),closeMenu()})},href:document.location.toString()},react.createElement(ShareAndroidIcon,{size:16,className:"mr-2"}),react.createElement("span",null,"Copy read-only link"))),g||react.createElement("li",null,react.createElement("a",{className:"dropdown-item",onClick:function(){copyTextToClipboard(document.location.toString()).then(()=>{t.current.focus(),logEvent$1("share_editable"),closeMenu()})},href:document.location.toString()},react.createElement(LinkIcon,{size:16,className:"mr-2"}),react.createElement("span",null,"Share editable link")))),react.createElement(UserMenu,null))),react.createElement("div",{className:"scroll"},react.createElement("div",{className:"markdown-body"},I))))}function ListNotebooks(e){return react.createElement("div",{className:"Box"},Object.keys(e.data).map(t=>react.createElement("div",{key:t,className:"Box-row d-flex flex-items-center"},react.createElement("div",{className:"flex-auto"},react.createElement("strong",null,react.createElement(Link,{to:`/notebook/${e.data[t].meta.uid}/${t}`},e.data[t].meta.title))),react.createElement("button",{type:"button",className:"btn btn-primary",name:"button",onClick:()=>{navigateTo(`/notebook/${e.data[t].meta.uid}/${t}`)}},"Open"))))}function List(){const e=useAuth(),[t,n]=react_6(null),[r,i]=react_6(!1);if(document.title="My notebooks - Sequence diagrams",react_5(()=>{e.uid&&index_cjs$3.database().ref("users/"+e.uid+"/notebooks").once("value",e=>{n(e.toJSON())})},[e.uid]),!e.uid)return react.createElement("div",{className:"p-11"},"Please sign in to see this page. ",react.createElement(UserMenu,null));return react.createElement("div",{className:"content p-responsive",style:{left:0}},react.createElement("div",{className:"top-bar content-bar d-flex flex-justify-between"},react.createElement("div",{className:"p-2 d-flex"},react.createElement("span",{className:"flex-self-center"},"My notebooks")),react.createElement("div",{className:"p-2 d-flex"},react.createElement(UserMenu,null))),react.createElement("div",{className:"scroll p-4"},react.createElement("div",{className:"Subhead pt-4"},react.createElement("div",{className:"Subhead-heading"},"My notebooks"),react.createElement("div",{className:"Subhead-actions"},react.createElement("button",{disabled:!!r,className:"btn btn-sm btn-primary",role:"button",onClick:async function(){i(!0);const{ref:e,succeed:t,owner:n}=await newNotebookWithContent(DEFAULT_EXAMPLE);i(!1),t&&(logEvent$1("new_notebook_list"),navigateTo(`/notebook/${n}/${e.key}`))}},"New notebook",r&&react.createElement("span",{className:"AnimatedEllipsis"}))),react.createElement("div",{className:"Subhead-description"},"Here are the notebooks of your own.")),t?react.createElement(ListNotebooks,{data:t}):react.createElement("span",{className:"m-1"},react.createElement("span",null,"Loading"),react.createElement("span",{className:"AnimatedEllipsis"}))))}function Index(){return useAuth().uid?react.createElement(Redirect,{to:"/list"}):react.createElement(Redirect,{to:generateStaticLinkFragment(DEFAULT_EXAMPLE)+"&open=true"})}function RedirectOldModel(){const e=useRouteMatch();return react.createElement(Redirect,{to:"/notebook/anonymous/"+e.params.notepadId})}function App(){return react.createElement(react.Fragment,null,react.createElement(ProvideAuth,null,react.createElement(Router,{history:history},react.createElement(Switch,null,react.createElement(Route,{exact:!0,path:"/notebook/:user/:notebook"},react.createElement(Editor$1,{newModel:!0})),react.createElement(Route,{exact:!0,path:"/editor/:notepadId"},react.createElement(RedirectOldModel,null)),react.createElement(Route,{exact:!0,path:"/static"},react.createElement(Editor$1,{readonly:!0})),react.createElement(Route,{path:"/list"},react.createElement(List,null)),react.createElement(Route,{path:"/"},react.createElement(Index,null))))))}async function initUI(e){const t=document.getElementById("loading-placeholder");t&&t.remove(),reactDom.render(react.createElement(App,null),e)}async function addFirepad(){await injectScript("firepad/firepad.min.js"),await injectCss("firepad/firepad.css")}async function main(){await addFirebase(),await addFirepad(),await initializeDiagrams(),initUI(document.getElementById("app"))}marked.setOptions({sanitize:!0}),main().catch(e=>{console.error(e)})}(); + + + function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) { + var type = typeof children; + + if (type === 'undefined' || type === 'boolean') { + // All of the above are perceived as null. + children = null; + } + + var invokeCallback = false; + + if (children === null) { + invokeCallback = true; + } else { + switch (type) { + case 'string': + case 'number': + invokeCallback = true; + break; + + case 'object': + switch (children.$$typeof) { + case REACT_ELEMENT_TYPE: + case REACT_PORTAL_TYPE: + invokeCallback = true; + } + + } + } + + if (invokeCallback) { + callback(traverseContext, children, // If it's the only child, treat the name as if it was wrapped in an array + // so that it's consistent if the number of children grows. + nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar); + return 1; + } + + var child; + var nextName; + var subtreeCount = 0; // Count of children found in the current subtree. + + var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR; + + if (Array.isArray(children)) { + for (var i = 0; i < children.length; i++) { + child = children[i]; + nextName = nextNamePrefix + getComponentKey(child, i); + subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext); + } + } else { + var iteratorFn = getIteratorFn(children); + + if (typeof iteratorFn === 'function') { + + { + // Warn about using Maps as children + if (iteratorFn === children.entries) { + if (!didWarnAboutMaps) { + warn('Using Maps as children is deprecated and will be removed in ' + 'a future major release. Consider converting children to ' + 'an array of keyed ReactElements instead.'); + } + + didWarnAboutMaps = true; + } + } + + var iterator = iteratorFn.call(children); + var step; + var ii = 0; + + while (!(step = iterator.next()).done) { + child = step.value; + nextName = nextNamePrefix + getComponentKey(child, ii++); + subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext); + } + } else if (type === 'object') { + var addendum = ''; + + { + addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + ReactDebugCurrentFrame.getStackAddendum(); + } + + var childrenString = '' + children; + + { + { + throw Error( "Objects are not valid as a React child (found: " + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + ")." + addendum ); + } + } + } + } + + return subtreeCount; + } + /** + * Traverses children that are typically specified as `props.children`, but + * might also be specified through attributes: + * + * - `traverseAllChildren(this.props.children, ...)` + * - `traverseAllChildren(this.props.leftPanelChildren, ...)` + * + * The `traverseContext` is an optional argument that is passed through the + * entire traversal. It can be used to store accumulations or anything else that + * the callback might find relevant. + * + * @param {?*} children Children tree object. + * @param {!function} callback To invoke upon traversing each child. + * @param {?*} traverseContext Context for traversal. + * @return {!number} The number of children in this subtree. + */ + + + function traverseAllChildren(children, callback, traverseContext) { + if (children == null) { + return 0; + } + + return traverseAllChildrenImpl(children, '', callback, traverseContext); + } + /** + * Generate a key string that identifies a component within a set. + * + * @param {*} component A component that could contain a manual key. + * @param {number} index Index that is used if a manual key is not provided. + * @return {string} + */ + + + function getComponentKey(component, index) { + // Do some typechecking here since we call this blindly. We want to ensure + // that we don't block potential future ES APIs. + if (typeof component === 'object' && component !== null && component.key != null) { + // Explicit key + return escape(component.key); + } // Implicit key determined by the index in the set + + + return index.toString(36); + } + + function forEachSingleChild(bookKeeping, child, name) { + var func = bookKeeping.func, + context = bookKeeping.context; + func.call(context, child, bookKeeping.count++); + } + /** + * Iterates through children that are typically specified as `props.children`. + * + * See https://reactjs.org/docs/react-api.html#reactchildrenforeach + * + * The provided forEachFunc(child, index) will be called for each + * leaf child. + * + * @param {?*} children Children tree container. + * @param {function(*, int)} forEachFunc + * @param {*} forEachContext Context for forEachContext. + */ + + + function forEachChildren(children, forEachFunc, forEachContext) { + if (children == null) { + return children; + } + + var traverseContext = getPooledTraverseContext(null, null, forEachFunc, forEachContext); + traverseAllChildren(children, forEachSingleChild, traverseContext); + releaseTraverseContext(traverseContext); + } + + function mapSingleChildIntoContext(bookKeeping, child, childKey) { + var result = bookKeeping.result, + keyPrefix = bookKeeping.keyPrefix, + func = bookKeeping.func, + context = bookKeeping.context; + var mappedChild = func.call(context, child, bookKeeping.count++); + + if (Array.isArray(mappedChild)) { + mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, function (c) { + return c; + }); + } else if (mappedChild != null) { + if (isValidElement(mappedChild)) { + mappedChild = cloneAndReplaceKey(mappedChild, // Keep both the (mapped) and old keys if they differ, just as + // traverseAllChildren used to do for objects as children + keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey); + } + + result.push(mappedChild); + } + } + + function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) { + var escapedPrefix = ''; + + if (prefix != null) { + escapedPrefix = escapeUserProvidedKey(prefix) + '/'; + } + + var traverseContext = getPooledTraverseContext(array, escapedPrefix, func, context); + traverseAllChildren(children, mapSingleChildIntoContext, traverseContext); + releaseTraverseContext(traverseContext); + } + /** + * Maps children that are typically specified as `props.children`. + * + * See https://reactjs.org/docs/react-api.html#reactchildrenmap + * + * The provided mapFunction(child, key, index) will be called for each + * leaf child. + * + * @param {?*} children Children tree container. + * @param {function(*, int)} func The map function. + * @param {*} context Context for mapFunction. + * @return {object} Object containing the ordered map of results. + */ + + + function mapChildren(children, func, context) { + if (children == null) { + return children; + } + + var result = []; + mapIntoWithKeyPrefixInternal(children, result, null, func, context); + return result; + } + /** + * Count the number of children that are typically specified as + * `props.children`. + * + * See https://reactjs.org/docs/react-api.html#reactchildrencount + * + * @param {?*} children Children tree container. + * @return {number} The number of children. + */ + + + function countChildren(children) { + return traverseAllChildren(children, function () { + return null; + }, null); + } + /** + * Flatten a children object (typically specified as `props.children`) and + * return an array with appropriately re-keyed children. + * + * See https://reactjs.org/docs/react-api.html#reactchildrentoarray + */ + + + function toArray(children) { + var result = []; + mapIntoWithKeyPrefixInternal(children, result, null, function (child) { + return child; + }); + return result; + } + /** + * Returns the first child in a collection of children and verifies that there + * is only one child in the collection. + * + * See https://reactjs.org/docs/react-api.html#reactchildrenonly + * + * The current implementation of this function assumes that a single child gets + * passed without a wrapper, but the purpose of this helper function is to + * abstract away the particular structure of children. + * + * @param {?object} children Child collection structure. + * @return {ReactElement} The first and only `ReactElement` contained in the + * structure. + */ + + + function onlyChild(children) { + if (!isValidElement(children)) { + { + throw Error( "React.Children.only expected to receive a single React element child." ); + } + } + + return children; + } + + function createContext(defaultValue, calculateChangedBits) { + if (calculateChangedBits === undefined) { + calculateChangedBits = null; + } else { + { + if (calculateChangedBits !== null && typeof calculateChangedBits !== 'function') { + error('createContext: Expected the optional second argument to be a ' + 'function. Instead received: %s', calculateChangedBits); + } + } + } + + var context = { + $$typeof: REACT_CONTEXT_TYPE, + _calculateChangedBits: calculateChangedBits, + // As a workaround to support multiple concurrent renderers, we categorize + // some renderers as primary and others as secondary. We only expect + // there to be two concurrent renderers at most: React Native (primary) and + // Fabric (secondary); React DOM (primary) and React ART (secondary). + // Secondary renderers store their context values on separate fields. + _currentValue: defaultValue, + _currentValue2: defaultValue, + // Used to track how many concurrent renderers this context currently + // supports within in a single renderer. Such as parallel server rendering. + _threadCount: 0, + // These are circular + Provider: null, + Consumer: null + }; + context.Provider = { + $$typeof: REACT_PROVIDER_TYPE, + _context: context + }; + var hasWarnedAboutUsingNestedContextConsumers = false; + var hasWarnedAboutUsingConsumerProvider = false; + + { + // A separate object, but proxies back to the original context object for + // backwards compatibility. It has a different $$typeof, so we can properly + // warn for the incorrect usage of Context as a Consumer. + var Consumer = { + $$typeof: REACT_CONTEXT_TYPE, + _context: context, + _calculateChangedBits: context._calculateChangedBits + }; // $FlowFixMe: Flow complains about not setting a value, which is intentional here + + Object.defineProperties(Consumer, { + Provider: { + get: function () { + if (!hasWarnedAboutUsingConsumerProvider) { + hasWarnedAboutUsingConsumerProvider = true; + + error('Rendering is not supported and will be removed in ' + 'a future major release. Did you mean to render instead?'); + } + + return context.Provider; + }, + set: function (_Provider) { + context.Provider = _Provider; + } + }, + _currentValue: { + get: function () { + return context._currentValue; + }, + set: function (_currentValue) { + context._currentValue = _currentValue; + } + }, + _currentValue2: { + get: function () { + return context._currentValue2; + }, + set: function (_currentValue2) { + context._currentValue2 = _currentValue2; + } + }, + _threadCount: { + get: function () { + return context._threadCount; + }, + set: function (_threadCount) { + context._threadCount = _threadCount; + } + }, + Consumer: { + get: function () { + if (!hasWarnedAboutUsingNestedContextConsumers) { + hasWarnedAboutUsingNestedContextConsumers = true; + + error('Rendering is not supported and will be removed in ' + 'a future major release. Did you mean to render instead?'); + } + + return context.Consumer; + } + } + }); // $FlowFixMe: Flow complains about missing properties because it doesn't understand defineProperty + + context.Consumer = Consumer; + } + + { + context._currentRenderer = null; + context._currentRenderer2 = null; + } + + return context; + } + + function lazy(ctor) { + var lazyType = { + $$typeof: REACT_LAZY_TYPE, + _ctor: ctor, + // React uses these fields to store the result. + _status: -1, + _result: null + }; + + { + // In production, this would just set it on the object. + var defaultProps; + var propTypes; + Object.defineProperties(lazyType, { + defaultProps: { + configurable: true, + get: function () { + return defaultProps; + }, + set: function (newDefaultProps) { + error('React.lazy(...): It is not supported to assign `defaultProps` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.'); + + defaultProps = newDefaultProps; // Match production behavior more closely: + + Object.defineProperty(lazyType, 'defaultProps', { + enumerable: true + }); + } + }, + propTypes: { + configurable: true, + get: function () { + return propTypes; + }, + set: function (newPropTypes) { + error('React.lazy(...): It is not supported to assign `propTypes` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.'); + + propTypes = newPropTypes; // Match production behavior more closely: + + Object.defineProperty(lazyType, 'propTypes', { + enumerable: true + }); + } + } + }); + } + + return lazyType; + } + + function forwardRef(render) { + { + if (render != null && render.$$typeof === REACT_MEMO_TYPE) { + error('forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).'); + } else if (typeof render !== 'function') { + error('forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render); + } else { + if (render.length !== 0 && render.length !== 2) { + error('forwardRef render functions accept exactly two parameters: props and ref. %s', render.length === 1 ? 'Did you forget to use the ref parameter?' : 'Any additional parameter will be undefined.'); + } + } + + if (render != null) { + if (render.defaultProps != null || render.propTypes != null) { + error('forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?'); + } + } + } + + return { + $$typeof: REACT_FORWARD_REF_TYPE, + render: render + }; + } + + function isValidElementType(type) { + return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. + type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE); + } + + function memo(type, compare) { + { + if (!isValidElementType(type)) { + error('memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type); + } + } + + return { + $$typeof: REACT_MEMO_TYPE, + type: type, + compare: compare === undefined ? null : compare + }; + } + + function resolveDispatcher() { + var dispatcher = ReactCurrentDispatcher.current; + + if (!(dispatcher !== null)) { + { + throw Error( "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem." ); + } + } + + return dispatcher; + } + + function useContext(Context, unstable_observedBits) { + var dispatcher = resolveDispatcher(); + + { + if (unstable_observedBits !== undefined) { + error('useContext() second argument is reserved for future ' + 'use in React. Passing it is not supported. ' + 'You passed: %s.%s', unstable_observedBits, typeof unstable_observedBits === 'number' && Array.isArray(arguments[2]) ? '\n\nDid you call array.map(useContext)? ' + 'Calling Hooks inside a loop is not supported. ' + 'Learn more at https://fb.me/rules-of-hooks' : ''); + } // TODO: add a more generic warning for invalid values. + + + if (Context._context !== undefined) { + var realContext = Context._context; // Don't deduplicate because this legitimately causes bugs + // and nobody should be using this in existing code. + + if (realContext.Consumer === Context) { + error('Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be ' + 'removed in a future major release. Did you mean to call useContext(Context) instead?'); + } else if (realContext.Provider === Context) { + error('Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?'); + } + } + } + + return dispatcher.useContext(Context, unstable_observedBits); + } + function useState(initialState) { + var dispatcher = resolveDispatcher(); + return dispatcher.useState(initialState); + } + function useReducer(reducer, initialArg, init) { + var dispatcher = resolveDispatcher(); + return dispatcher.useReducer(reducer, initialArg, init); + } + function useRef(initialValue) { + var dispatcher = resolveDispatcher(); + return dispatcher.useRef(initialValue); + } + function useEffect(create, deps) { + var dispatcher = resolveDispatcher(); + return dispatcher.useEffect(create, deps); + } + function useLayoutEffect(create, deps) { + var dispatcher = resolveDispatcher(); + return dispatcher.useLayoutEffect(create, deps); + } + function useCallback(callback, deps) { + var dispatcher = resolveDispatcher(); + return dispatcher.useCallback(callback, deps); + } + function useMemo(create, deps) { + var dispatcher = resolveDispatcher(); + return dispatcher.useMemo(create, deps); + } + function useImperativeHandle(ref, create, deps) { + var dispatcher = resolveDispatcher(); + return dispatcher.useImperativeHandle(ref, create, deps); + } + function useDebugValue(value, formatterFn) { + { + var dispatcher = resolveDispatcher(); + return dispatcher.useDebugValue(value, formatterFn); + } + } + + var propTypesMisspellWarningShown; + + { + propTypesMisspellWarningShown = false; + } + + function getDeclarationErrorAddendum() { + if (ReactCurrentOwner.current) { + var name = getComponentName(ReactCurrentOwner.current.type); + + if (name) { + return '\n\nCheck the render method of `' + name + '`.'; + } + } + + return ''; + } + + function getSourceInfoErrorAddendum(source) { + if (source !== undefined) { + var fileName = source.fileName.replace(/^.*[\\\/]/, ''); + var lineNumber = source.lineNumber; + return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.'; + } + + return ''; + } + + function getSourceInfoErrorAddendumForProps(elementProps) { + if (elementProps !== null && elementProps !== undefined) { + return getSourceInfoErrorAddendum(elementProps.__source); + } + + return ''; + } + /** + * Warn if there's no key explicitly set on dynamic arrays of children or + * object keys are not valid. This allows us to keep track of children between + * updates. + */ + + + var ownerHasKeyUseWarning = {}; + + function getCurrentComponentErrorInfo(parentType) { + var info = getDeclarationErrorAddendum(); + + if (!info) { + var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name; + + if (parentName) { + info = "\n\nCheck the top-level render call using <" + parentName + ">."; + } + } + + return info; + } + /** + * Warn if the element doesn't have an explicit key assigned to it. + * This element is in an array. The array could grow and shrink or be + * reordered. All children that haven't already been validated are required to + * have a "key" property assigned to it. Error statuses are cached so a warning + * will only be shown once. + * + * @internal + * @param {ReactElement} element Element that requires a key. + * @param {*} parentType element's parent's type. + */ + + + function validateExplicitKey(element, parentType) { + if (!element._store || element._store.validated || element.key != null) { + return; + } + + element._store.validated = true; + var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType); + + if (ownerHasKeyUseWarning[currentComponentErrorInfo]) { + return; + } + + ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a + // property, it may be the creator of the child that's responsible for + // assigning it a key. + + var childOwner = ''; + + if (element && element._owner && element._owner !== ReactCurrentOwner.current) { + // Give the component that originally created this child. + childOwner = " It was passed a child from " + getComponentName(element._owner.type) + "."; + } + + setCurrentlyValidatingElement(element); + + { + error('Each child in a list should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.', currentComponentErrorInfo, childOwner); + } + + setCurrentlyValidatingElement(null); + } + /** + * Ensure that every element either is passed in a static location, in an + * array with an explicit keys property defined, or in an object literal + * with valid key property. + * + * @internal + * @param {ReactNode} node Statically passed child of any type. + * @param {*} parentType node's parent's type. + */ + + + function validateChildKeys(node, parentType) { + if (typeof node !== 'object') { + return; + } + + if (Array.isArray(node)) { + for (var i = 0; i < node.length; i++) { + var child = node[i]; + + if (isValidElement(child)) { + validateExplicitKey(child, parentType); + } + } + } else if (isValidElement(node)) { + // This element was passed in a valid location. + if (node._store) { + node._store.validated = true; + } + } else if (node) { + var iteratorFn = getIteratorFn(node); + + if (typeof iteratorFn === 'function') { + // Entry iterators used to provide implicit keys, + // but now we print a separate warning for them later. + if (iteratorFn !== node.entries) { + var iterator = iteratorFn.call(node); + var step; + + while (!(step = iterator.next()).done) { + if (isValidElement(step.value)) { + validateExplicitKey(step.value, parentType); + } + } + } + } + } + } + /** + * Given an element, validate that its props follow the propTypes definition, + * provided by the type. + * + * @param {ReactElement} element + */ + + + function validatePropTypes(element) { + { + var type = element.type; + + if (type === null || type === undefined || typeof type === 'string') { + return; + } + + var name = getComponentName(type); + var propTypes; + + if (typeof type === 'function') { + propTypes = type.propTypes; + } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here. + // Inner props are checked in the reconciler. + type.$$typeof === REACT_MEMO_TYPE)) { + propTypes = type.propTypes; + } else { + return; + } + + if (propTypes) { + setCurrentlyValidatingElement(element); + checkPropTypes(propTypes, element.props, 'prop', name, ReactDebugCurrentFrame.getStackAddendum); + setCurrentlyValidatingElement(null); + } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) { + propTypesMisspellWarningShown = true; + + error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', name || 'Unknown'); + } + + if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) { + error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.'); + } + } + } + /** + * Given a fragment, validate that it can only be provided with fragment props + * @param {ReactElement} fragment + */ + + + function validateFragmentProps(fragment) { + { + setCurrentlyValidatingElement(fragment); + var keys = Object.keys(fragment.props); + + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + + if (key !== 'children' && key !== 'key') { + error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key); + + break; + } + } + + if (fragment.ref !== null) { + error('Invalid attribute `ref` supplied to `React.Fragment`.'); + } + + setCurrentlyValidatingElement(null); + } + } + function createElementWithValidation(type, props, children) { + var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to + // succeed and there will likely be errors in render. + + if (!validType) { + var info = ''; + + if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) { + info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports."; + } + + var sourceInfo = getSourceInfoErrorAddendumForProps(props); + + if (sourceInfo) { + info += sourceInfo; + } else { + info += getDeclarationErrorAddendum(); + } + + var typeString; + + if (type === null) { + typeString = 'null'; + } else if (Array.isArray(type)) { + typeString = 'array'; + } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) { + typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />"; + info = ' Did you accidentally export a JSX literal instead of a component?'; + } else { + typeString = typeof type; + } + + { + error('React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info); + } + } + + var element = createElement.apply(this, arguments); // The result can be nullish if a mock or a custom function is used. + // TODO: Drop this when these are no longer allowed as the type argument. + + if (element == null) { + return element; + } // Skip key warning if the type isn't valid since our key validation logic + // doesn't expect a non-string/function type and can throw confusing errors. + // We don't want exception behavior to differ between dev and prod. + // (Rendering will throw with a helpful message and as soon as the type is + // fixed, the key warnings will appear.) + + + if (validType) { + for (var i = 2; i < arguments.length; i++) { + validateChildKeys(arguments[i], type); + } + } + + if (type === REACT_FRAGMENT_TYPE) { + validateFragmentProps(element); + } else { + validatePropTypes(element); + } + + return element; + } + var didWarnAboutDeprecatedCreateFactory = false; + function createFactoryWithValidation(type) { + var validatedFactory = createElementWithValidation.bind(null, type); + validatedFactory.type = type; + + { + if (!didWarnAboutDeprecatedCreateFactory) { + didWarnAboutDeprecatedCreateFactory = true; + + warn('React.createFactory() is deprecated and will be removed in ' + 'a future major release. Consider using JSX ' + 'or use React.createElement() directly instead.'); + } // Legacy hook: remove it + + + Object.defineProperty(validatedFactory, 'type', { + enumerable: false, + get: function () { + warn('Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.'); + + Object.defineProperty(this, 'type', { + value: type + }); + return type; + } + }); + } + + return validatedFactory; + } + function cloneElementWithValidation(element, props, children) { + var newElement = cloneElement.apply(this, arguments); + + for (var i = 2; i < arguments.length; i++) { + validateChildKeys(arguments[i], newElement.type); + } + + validatePropTypes(newElement); + return newElement; + } + + { + + try { + var frozenObject = Object.freeze({}); + var testMap = new Map([[frozenObject, null]]); + var testSet = new Set([frozenObject]); // This is necessary for Rollup to not consider these unused. + // https://github.com/rollup/rollup/issues/1771 + // TODO: we can remove these if Rollup fixes the bug. + + testMap.set(0, 0); + testSet.add(0); + } catch (e) { + } + } + + var createElement$1 = createElementWithValidation ; + var cloneElement$1 = cloneElementWithValidation ; + var createFactory = createFactoryWithValidation ; + var Children = { + map: mapChildren, + forEach: forEachChildren, + count: countChildren, + toArray: toArray, + only: onlyChild + }; + + exports.Children = Children; + exports.Component = Component; + exports.Fragment = REACT_FRAGMENT_TYPE; + exports.Profiler = REACT_PROFILER_TYPE; + exports.PureComponent = PureComponent; + exports.StrictMode = REACT_STRICT_MODE_TYPE; + exports.Suspense = REACT_SUSPENSE_TYPE; + exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals; + exports.cloneElement = cloneElement$1; + exports.createContext = createContext; + exports.createElement = createElement$1; + exports.createFactory = createFactory; + exports.createRef = createRef; + exports.forwardRef = forwardRef; + exports.isValidElement = isValidElement; + exports.lazy = lazy; + exports.memo = memo; + exports.useCallback = useCallback; + exports.useContext = useContext; + exports.useDebugValue = useDebugValue; + exports.useEffect = useEffect; + exports.useImperativeHandle = useImperativeHandle; + exports.useLayoutEffect = useLayoutEffect; + exports.useMemo = useMemo; + exports.useReducer = useReducer; + exports.useRef = useRef; + exports.useState = useState; + exports.version = ReactVersion; + })(); + } + }); + var react_development_1 = react_development.Children; + var react_development_2 = react_development.Component; + var react_development_3 = react_development.Fragment; + var react_development_4 = react_development.Profiler; + var react_development_5 = react_development.PureComponent; + var react_development_6 = react_development.StrictMode; + var react_development_7 = react_development.Suspense; + var react_development_8 = react_development.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; + var react_development_9 = react_development.cloneElement; + var react_development_10 = react_development.createContext; + var react_development_11 = react_development.createElement; + var react_development_12 = react_development.createFactory; + var react_development_13 = react_development.createRef; + var react_development_14 = react_development.forwardRef; + var react_development_15 = react_development.isValidElement; + var react_development_16 = react_development.lazy; + var react_development_17 = react_development.memo; + var react_development_18 = react_development.useCallback; + var react_development_19 = react_development.useContext; + var react_development_20 = react_development.useDebugValue; + var react_development_21 = react_development.useEffect; + var react_development_22 = react_development.useImperativeHandle; + var react_development_23 = react_development.useLayoutEffect; + var react_development_24 = react_development.useMemo; + var react_development_25 = react_development.useReducer; + var react_development_26 = react_development.useRef; + var react_development_27 = react_development.useState; + var react_development_28 = react_development.version; + + var react = createCommonjsModule(function (module) { + + { + module.exports = react_development; + } + }); + var react_1 = react.Children; + var react_2 = react.Component; + var react_3 = react.PropTypes; + var react_4 = react.createElement; + var react_5 = react.useEffect; + var react_6 = react.useState; + var react_7 = react.useRef; + var react_8 = react.useContext; + var react_9 = react.useMemo; + var react_10 = react.useDebugValue; + var react_11 = react.useCallback; + var react_12 = react.useLayoutEffect; + var react_13 = react.PureComponent; + var react_14 = react.createContext; + + var scheduler_development = createCommonjsModule(function (module, exports) { + + + + { + (function() { + + var enableSchedulerDebugging = false; + var enableProfiling = true; + + var requestHostCallback; + var requestHostTimeout; + var cancelHostTimeout; + var shouldYieldToHost; + var requestPaint; + + if ( // If Scheduler runs in a non-DOM environment, it falls back to a naive + // implementation using setTimeout. + typeof window === 'undefined' || // Check if MessageChannel is supported, too. + typeof MessageChannel !== 'function') { + // If this accidentally gets imported in a non-browser environment, e.g. JavaScriptCore, + // fallback to a naive implementation. + var _callback = null; + var _timeoutID = null; + + var _flushCallback = function () { + if (_callback !== null) { + try { + var currentTime = exports.unstable_now(); + var hasRemainingTime = true; + + _callback(hasRemainingTime, currentTime); + + _callback = null; + } catch (e) { + setTimeout(_flushCallback, 0); + throw e; + } + } + }; + + var initialTime = Date.now(); + + exports.unstable_now = function () { + return Date.now() - initialTime; + }; + + requestHostCallback = function (cb) { + if (_callback !== null) { + // Protect against re-entrancy. + setTimeout(requestHostCallback, 0, cb); + } else { + _callback = cb; + setTimeout(_flushCallback, 0); + } + }; + + requestHostTimeout = function (cb, ms) { + _timeoutID = setTimeout(cb, ms); + }; + + cancelHostTimeout = function () { + clearTimeout(_timeoutID); + }; + + shouldYieldToHost = function () { + return false; + }; + + requestPaint = exports.unstable_forceFrameRate = function () {}; + } else { + // Capture local references to native APIs, in case a polyfill overrides them. + var performance = window.performance; + var _Date = window.Date; + var _setTimeout = window.setTimeout; + var _clearTimeout = window.clearTimeout; + + if (typeof console !== 'undefined') { + // TODO: Scheduler no longer requires these methods to be polyfilled. But + // maybe we want to continue warning if they don't exist, to preserve the + // option to rely on it in the future? + var requestAnimationFrame = window.requestAnimationFrame; + var cancelAnimationFrame = window.cancelAnimationFrame; // TODO: Remove fb.me link + + if (typeof requestAnimationFrame !== 'function') { + // Using console['error'] to evade Babel and ESLint + console['error']("This browser doesn't support requestAnimationFrame. " + 'Make sure that you load a ' + 'polyfill in older browsers. https://fb.me/react-polyfills'); + } + + if (typeof cancelAnimationFrame !== 'function') { + // Using console['error'] to evade Babel and ESLint + console['error']("This browser doesn't support cancelAnimationFrame. " + 'Make sure that you load a ' + 'polyfill in older browsers. https://fb.me/react-polyfills'); + } + } + + if (typeof performance === 'object' && typeof performance.now === 'function') { + exports.unstable_now = function () { + return performance.now(); + }; + } else { + var _initialTime = _Date.now(); + + exports.unstable_now = function () { + return _Date.now() - _initialTime; + }; + } + + var isMessageLoopRunning = false; + var scheduledHostCallback = null; + var taskTimeoutID = -1; // Scheduler periodically yields in case there is other work on the main + // thread, like user events. By default, it yields multiple times per frame. + // It does not attempt to align with frame boundaries, since most tasks don't + // need to be frame aligned; for those that do, use requestAnimationFrame. + + var yieldInterval = 5; + var deadline = 0; // TODO: Make this configurable + + { + // `isInputPending` is not available. Since we have no way of knowing if + // there's pending input, always yield at the end of the frame. + shouldYieldToHost = function () { + return exports.unstable_now() >= deadline; + }; // Since we yield every frame regardless, `requestPaint` has no effect. + + + requestPaint = function () {}; + } + + exports.unstable_forceFrameRate = function (fps) { + if (fps < 0 || fps > 125) { + // Using console['error'] to evade Babel and ESLint + console['error']('forceFrameRate takes a positive int between 0 and 125, ' + 'forcing framerates higher than 125 fps is not unsupported'); + return; + } + + if (fps > 0) { + yieldInterval = Math.floor(1000 / fps); + } else { + // reset the framerate + yieldInterval = 5; + } + }; + + var performWorkUntilDeadline = function () { + if (scheduledHostCallback !== null) { + var currentTime = exports.unstable_now(); // Yield after `yieldInterval` ms, regardless of where we are in the vsync + // cycle. This means there's always time remaining at the beginning of + // the message event. + + deadline = currentTime + yieldInterval; + var hasTimeRemaining = true; + + try { + var hasMoreWork = scheduledHostCallback(hasTimeRemaining, currentTime); + + if (!hasMoreWork) { + isMessageLoopRunning = false; + scheduledHostCallback = null; + } else { + // If there's more work, schedule the next message event at the end + // of the preceding one. + port.postMessage(null); + } + } catch (error) { + // If a scheduler task throws, exit the current browser task so the + // error can be observed. + port.postMessage(null); + throw error; + } + } else { + isMessageLoopRunning = false; + } // Yielding to the browser will give it a chance to paint, so we can + }; + + var channel = new MessageChannel(); + var port = channel.port2; + channel.port1.onmessage = performWorkUntilDeadline; + + requestHostCallback = function (callback) { + scheduledHostCallback = callback; + + if (!isMessageLoopRunning) { + isMessageLoopRunning = true; + port.postMessage(null); + } + }; + + requestHostTimeout = function (callback, ms) { + taskTimeoutID = _setTimeout(function () { + callback(exports.unstable_now()); + }, ms); + }; + + cancelHostTimeout = function () { + _clearTimeout(taskTimeoutID); + + taskTimeoutID = -1; + }; + } + + function push(heap, node) { + var index = heap.length; + heap.push(node); + siftUp(heap, node, index); + } + function peek(heap) { + var first = heap[0]; + return first === undefined ? null : first; + } + function pop(heap) { + var first = heap[0]; + + if (first !== undefined) { + var last = heap.pop(); + + if (last !== first) { + heap[0] = last; + siftDown(heap, last, 0); + } + + return first; + } else { + return null; + } + } + + function siftUp(heap, node, i) { + var index = i; + + while (true) { + var parentIndex = index - 1 >>> 1; + var parent = heap[parentIndex]; + + if (parent !== undefined && compare(parent, node) > 0) { + // The parent is larger. Swap positions. + heap[parentIndex] = node; + heap[index] = parent; + index = parentIndex; + } else { + // The parent is smaller. Exit. + return; + } + } + } + + function siftDown(heap, node, i) { + var index = i; + var length = heap.length; + + while (index < length) { + var leftIndex = (index + 1) * 2 - 1; + var left = heap[leftIndex]; + var rightIndex = leftIndex + 1; + var right = heap[rightIndex]; // If the left or right node is smaller, swap with the smaller of those. + + if (left !== undefined && compare(left, node) < 0) { + if (right !== undefined && compare(right, left) < 0) { + heap[index] = right; + heap[rightIndex] = node; + index = rightIndex; + } else { + heap[index] = left; + heap[leftIndex] = node; + index = leftIndex; + } + } else if (right !== undefined && compare(right, node) < 0) { + heap[index] = right; + heap[rightIndex] = node; + index = rightIndex; + } else { + // Neither child is smaller. Exit. + return; + } + } + } + + function compare(a, b) { + // Compare sort index first, then task id. + var diff = a.sortIndex - b.sortIndex; + return diff !== 0 ? diff : a.id - b.id; + } + + // TODO: Use symbols? + var NoPriority = 0; + var ImmediatePriority = 1; + var UserBlockingPriority = 2; + var NormalPriority = 3; + var LowPriority = 4; + var IdlePriority = 5; + + var runIdCounter = 0; + var mainThreadIdCounter = 0; + var profilingStateSize = 4; + var sharedProfilingBuffer = // $FlowFixMe Flow doesn't know about SharedArrayBuffer + typeof SharedArrayBuffer === 'function' ? new SharedArrayBuffer(profilingStateSize * Int32Array.BYTES_PER_ELEMENT) : // $FlowFixMe Flow doesn't know about ArrayBuffer + typeof ArrayBuffer === 'function' ? new ArrayBuffer(profilingStateSize * Int32Array.BYTES_PER_ELEMENT) : null // Don't crash the init path on IE9 + ; + var profilingState = sharedProfilingBuffer !== null ? new Int32Array(sharedProfilingBuffer) : []; // We can't read this but it helps save bytes for null checks + + var PRIORITY = 0; + var CURRENT_TASK_ID = 1; + var CURRENT_RUN_ID = 2; + var QUEUE_SIZE = 3; + + { + profilingState[PRIORITY] = NoPriority; // This is maintained with a counter, because the size of the priority queue + // array might include canceled tasks. + + profilingState[QUEUE_SIZE] = 0; + profilingState[CURRENT_TASK_ID] = 0; + } // Bytes per element is 4 + + + var INITIAL_EVENT_LOG_SIZE = 131072; + var MAX_EVENT_LOG_SIZE = 524288; // Equivalent to 2 megabytes + + var eventLogSize = 0; + var eventLogBuffer = null; + var eventLog = null; + var eventLogIndex = 0; + var TaskStartEvent = 1; + var TaskCompleteEvent = 2; + var TaskErrorEvent = 3; + var TaskCancelEvent = 4; + var TaskRunEvent = 5; + var TaskYieldEvent = 6; + var SchedulerSuspendEvent = 7; + var SchedulerResumeEvent = 8; + + function logEvent(entries) { + if (eventLog !== null) { + var offset = eventLogIndex; + eventLogIndex += entries.length; + + if (eventLogIndex + 1 > eventLogSize) { + eventLogSize *= 2; + + if (eventLogSize > MAX_EVENT_LOG_SIZE) { + // Using console['error'] to evade Babel and ESLint + console['error']("Scheduler Profiling: Event log exceeded maximum size. Don't " + 'forget to call `stopLoggingProfilingEvents()`.'); + stopLoggingProfilingEvents(); + return; + } + + var newEventLog = new Int32Array(eventLogSize * 4); + newEventLog.set(eventLog); + eventLogBuffer = newEventLog.buffer; + eventLog = newEventLog; + } + + eventLog.set(entries, offset); + } + } + + function startLoggingProfilingEvents() { + eventLogSize = INITIAL_EVENT_LOG_SIZE; + eventLogBuffer = new ArrayBuffer(eventLogSize * 4); + eventLog = new Int32Array(eventLogBuffer); + eventLogIndex = 0; + } + function stopLoggingProfilingEvents() { + var buffer = eventLogBuffer; + eventLogSize = 0; + eventLogBuffer = null; + eventLog = null; + eventLogIndex = 0; + return buffer; + } + function markTaskStart(task, ms) { + { + profilingState[QUEUE_SIZE]++; + + if (eventLog !== null) { + // performance.now returns a float, representing milliseconds. When the + // event is logged, it's coerced to an int. Convert to microseconds to + // maintain extra degrees of precision. + logEvent([TaskStartEvent, ms * 1000, task.id, task.priorityLevel]); + } + } + } + function markTaskCompleted(task, ms) { + { + profilingState[PRIORITY] = NoPriority; + profilingState[CURRENT_TASK_ID] = 0; + profilingState[QUEUE_SIZE]--; + + if (eventLog !== null) { + logEvent([TaskCompleteEvent, ms * 1000, task.id]); + } + } + } + function markTaskCanceled(task, ms) { + { + profilingState[QUEUE_SIZE]--; + + if (eventLog !== null) { + logEvent([TaskCancelEvent, ms * 1000, task.id]); + } + } + } + function markTaskErrored(task, ms) { + { + profilingState[PRIORITY] = NoPriority; + profilingState[CURRENT_TASK_ID] = 0; + profilingState[QUEUE_SIZE]--; + + if (eventLog !== null) { + logEvent([TaskErrorEvent, ms * 1000, task.id]); + } + } + } + function markTaskRun(task, ms) { + { + runIdCounter++; + profilingState[PRIORITY] = task.priorityLevel; + profilingState[CURRENT_TASK_ID] = task.id; + profilingState[CURRENT_RUN_ID] = runIdCounter; + + if (eventLog !== null) { + logEvent([TaskRunEvent, ms * 1000, task.id, runIdCounter]); + } + } + } + function markTaskYield(task, ms) { + { + profilingState[PRIORITY] = NoPriority; + profilingState[CURRENT_TASK_ID] = 0; + profilingState[CURRENT_RUN_ID] = 0; + + if (eventLog !== null) { + logEvent([TaskYieldEvent, ms * 1000, task.id, runIdCounter]); + } + } + } + function markSchedulerSuspended(ms) { + { + mainThreadIdCounter++; + + if (eventLog !== null) { + logEvent([SchedulerSuspendEvent, ms * 1000, mainThreadIdCounter]); + } + } + } + function markSchedulerUnsuspended(ms) { + { + if (eventLog !== null) { + logEvent([SchedulerResumeEvent, ms * 1000, mainThreadIdCounter]); + } + } + } + + /* eslint-disable no-var */ + // Math.pow(2, 30) - 1 + // 0b111111111111111111111111111111 + + var maxSigned31BitInt = 1073741823; // Times out immediately + + var IMMEDIATE_PRIORITY_TIMEOUT = -1; // Eventually times out + + var USER_BLOCKING_PRIORITY = 250; + var NORMAL_PRIORITY_TIMEOUT = 5000; + var LOW_PRIORITY_TIMEOUT = 10000; // Never times out + + var IDLE_PRIORITY = maxSigned31BitInt; // Tasks are stored on a min heap + + var taskQueue = []; + var timerQueue = []; // Incrementing id counter. Used to maintain insertion order. + + var taskIdCounter = 1; // Pausing the scheduler is useful for debugging. + var currentTask = null; + var currentPriorityLevel = NormalPriority; // This is set while performing work, to prevent re-entrancy. + + var isPerformingWork = false; + var isHostCallbackScheduled = false; + var isHostTimeoutScheduled = false; + + function advanceTimers(currentTime) { + // Check for tasks that are no longer delayed and add them to the queue. + var timer = peek(timerQueue); + + while (timer !== null) { + if (timer.callback === null) { + // Timer was cancelled. + pop(timerQueue); + } else if (timer.startTime <= currentTime) { + // Timer fired. Transfer to the task queue. + pop(timerQueue); + timer.sortIndex = timer.expirationTime; + push(taskQueue, timer); + + { + markTaskStart(timer, currentTime); + timer.isQueued = true; + } + } else { + // Remaining timers are pending. + return; + } + + timer = peek(timerQueue); + } + } + + function handleTimeout(currentTime) { + isHostTimeoutScheduled = false; + advanceTimers(currentTime); + + if (!isHostCallbackScheduled) { + if (peek(taskQueue) !== null) { + isHostCallbackScheduled = true; + requestHostCallback(flushWork); + } else { + var firstTimer = peek(timerQueue); + + if (firstTimer !== null) { + requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime); + } + } + } + } + + function flushWork(hasTimeRemaining, initialTime) { + { + markSchedulerUnsuspended(initialTime); + } // We'll need a host callback the next time work is scheduled. + + + isHostCallbackScheduled = false; + + if (isHostTimeoutScheduled) { + // We scheduled a timeout but it's no longer needed. Cancel it. + isHostTimeoutScheduled = false; + cancelHostTimeout(); + } + + isPerformingWork = true; + var previousPriorityLevel = currentPriorityLevel; + + try { + if (enableProfiling) { + try { + return workLoop(hasTimeRemaining, initialTime); + } catch (error) { + if (currentTask !== null) { + var currentTime = exports.unstable_now(); + markTaskErrored(currentTask, currentTime); + currentTask.isQueued = false; + } + + throw error; + } + } else { + // No catch in prod codepath. + return workLoop(hasTimeRemaining, initialTime); + } + } finally { + currentTask = null; + currentPriorityLevel = previousPriorityLevel; + isPerformingWork = false; + + { + var _currentTime = exports.unstable_now(); + + markSchedulerSuspended(_currentTime); + } + } + } + + function workLoop(hasTimeRemaining, initialTime) { + var currentTime = initialTime; + advanceTimers(currentTime); + currentTask = peek(taskQueue); + + while (currentTask !== null && !(enableSchedulerDebugging )) { + if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) { + // This currentTask hasn't expired, and we've reached the deadline. + break; + } + + var callback = currentTask.callback; + + if (callback !== null) { + currentTask.callback = null; + currentPriorityLevel = currentTask.priorityLevel; + var didUserCallbackTimeout = currentTask.expirationTime <= currentTime; + markTaskRun(currentTask, currentTime); + var continuationCallback = callback(didUserCallbackTimeout); + currentTime = exports.unstable_now(); + + if (typeof continuationCallback === 'function') { + currentTask.callback = continuationCallback; + markTaskYield(currentTask, currentTime); + } else { + { + markTaskCompleted(currentTask, currentTime); + currentTask.isQueued = false; + } + + if (currentTask === peek(taskQueue)) { + pop(taskQueue); + } + } + + advanceTimers(currentTime); + } else { + pop(taskQueue); + } + + currentTask = peek(taskQueue); + } // Return whether there's additional work + + + if (currentTask !== null) { + return true; + } else { + var firstTimer = peek(timerQueue); + + if (firstTimer !== null) { + requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime); + } + + return false; + } + } + + function unstable_runWithPriority(priorityLevel, eventHandler) { + switch (priorityLevel) { + case ImmediatePriority: + case UserBlockingPriority: + case NormalPriority: + case LowPriority: + case IdlePriority: + break; + + default: + priorityLevel = NormalPriority; + } + + var previousPriorityLevel = currentPriorityLevel; + currentPriorityLevel = priorityLevel; + + try { + return eventHandler(); + } finally { + currentPriorityLevel = previousPriorityLevel; + } + } + + function unstable_next(eventHandler) { + var priorityLevel; + + switch (currentPriorityLevel) { + case ImmediatePriority: + case UserBlockingPriority: + case NormalPriority: + // Shift down to normal priority + priorityLevel = NormalPriority; + break; + + default: + // Anything lower than normal priority should remain at the current level. + priorityLevel = currentPriorityLevel; + break; + } + + var previousPriorityLevel = currentPriorityLevel; + currentPriorityLevel = priorityLevel; + + try { + return eventHandler(); + } finally { + currentPriorityLevel = previousPriorityLevel; + } + } + + function unstable_wrapCallback(callback) { + var parentPriorityLevel = currentPriorityLevel; + return function () { + // This is a fork of runWithPriority, inlined for performance. + var previousPriorityLevel = currentPriorityLevel; + currentPriorityLevel = parentPriorityLevel; + + try { + return callback.apply(this, arguments); + } finally { + currentPriorityLevel = previousPriorityLevel; + } + }; + } + + function timeoutForPriorityLevel(priorityLevel) { + switch (priorityLevel) { + case ImmediatePriority: + return IMMEDIATE_PRIORITY_TIMEOUT; + + case UserBlockingPriority: + return USER_BLOCKING_PRIORITY; + + case IdlePriority: + return IDLE_PRIORITY; + + case LowPriority: + return LOW_PRIORITY_TIMEOUT; + + case NormalPriority: + default: + return NORMAL_PRIORITY_TIMEOUT; + } + } + + function unstable_scheduleCallback(priorityLevel, callback, options) { + var currentTime = exports.unstable_now(); + var startTime; + var timeout; + + if (typeof options === 'object' && options !== null) { + var delay = options.delay; + + if (typeof delay === 'number' && delay > 0) { + startTime = currentTime + delay; + } else { + startTime = currentTime; + } + + timeout = typeof options.timeout === 'number' ? options.timeout : timeoutForPriorityLevel(priorityLevel); + } else { + timeout = timeoutForPriorityLevel(priorityLevel); + startTime = currentTime; + } + + var expirationTime = startTime + timeout; + var newTask = { + id: taskIdCounter++, + callback: callback, + priorityLevel: priorityLevel, + startTime: startTime, + expirationTime: expirationTime, + sortIndex: -1 + }; + + { + newTask.isQueued = false; + } + + if (startTime > currentTime) { + // This is a delayed task. + newTask.sortIndex = startTime; + push(timerQueue, newTask); + + if (peek(taskQueue) === null && newTask === peek(timerQueue)) { + // All tasks are delayed, and this is the task with the earliest delay. + if (isHostTimeoutScheduled) { + // Cancel an existing timeout. + cancelHostTimeout(); + } else { + isHostTimeoutScheduled = true; + } // Schedule a timeout. + + + requestHostTimeout(handleTimeout, startTime - currentTime); + } + } else { + newTask.sortIndex = expirationTime; + push(taskQueue, newTask); + + { + markTaskStart(newTask, currentTime); + newTask.isQueued = true; + } // Schedule a host callback, if needed. If we're already performing work, + // wait until the next time we yield. + + + if (!isHostCallbackScheduled && !isPerformingWork) { + isHostCallbackScheduled = true; + requestHostCallback(flushWork); + } + } + + return newTask; + } + + function unstable_pauseExecution() { + } + + function unstable_continueExecution() { + + if (!isHostCallbackScheduled && !isPerformingWork) { + isHostCallbackScheduled = true; + requestHostCallback(flushWork); + } + } + + function unstable_getFirstCallbackNode() { + return peek(taskQueue); + } + + function unstable_cancelCallback(task) { + { + if (task.isQueued) { + var currentTime = exports.unstable_now(); + markTaskCanceled(task, currentTime); + task.isQueued = false; + } + } // Null out the callback to indicate the task has been canceled. (Can't + // remove from the queue because you can't remove arbitrary nodes from an + // array based heap, only the first one.) + + + task.callback = null; + } + + function unstable_getCurrentPriorityLevel() { + return currentPriorityLevel; + } + + function unstable_shouldYield() { + var currentTime = exports.unstable_now(); + advanceTimers(currentTime); + var firstTask = peek(taskQueue); + return firstTask !== currentTask && currentTask !== null && firstTask !== null && firstTask.callback !== null && firstTask.startTime <= currentTime && firstTask.expirationTime < currentTask.expirationTime || shouldYieldToHost(); + } + + var unstable_requestPaint = requestPaint; + var unstable_Profiling = { + startLoggingProfilingEvents: startLoggingProfilingEvents, + stopLoggingProfilingEvents: stopLoggingProfilingEvents, + sharedProfilingBuffer: sharedProfilingBuffer + } ; + + exports.unstable_IdlePriority = IdlePriority; + exports.unstable_ImmediatePriority = ImmediatePriority; + exports.unstable_LowPriority = LowPriority; + exports.unstable_NormalPriority = NormalPriority; + exports.unstable_Profiling = unstable_Profiling; + exports.unstable_UserBlockingPriority = UserBlockingPriority; + exports.unstable_cancelCallback = unstable_cancelCallback; + exports.unstable_continueExecution = unstable_continueExecution; + exports.unstable_getCurrentPriorityLevel = unstable_getCurrentPriorityLevel; + exports.unstable_getFirstCallbackNode = unstable_getFirstCallbackNode; + exports.unstable_next = unstable_next; + exports.unstable_pauseExecution = unstable_pauseExecution; + exports.unstable_requestPaint = unstable_requestPaint; + exports.unstable_runWithPriority = unstable_runWithPriority; + exports.unstable_scheduleCallback = unstable_scheduleCallback; + exports.unstable_shouldYield = unstable_shouldYield; + exports.unstable_wrapCallback = unstable_wrapCallback; + })(); + } + }); + var scheduler_development_1 = scheduler_development.unstable_now; + var scheduler_development_2 = scheduler_development.unstable_forceFrameRate; + var scheduler_development_3 = scheduler_development.unstable_IdlePriority; + var scheduler_development_4 = scheduler_development.unstable_ImmediatePriority; + var scheduler_development_5 = scheduler_development.unstable_LowPriority; + var scheduler_development_6 = scheduler_development.unstable_NormalPriority; + var scheduler_development_7 = scheduler_development.unstable_Profiling; + var scheduler_development_8 = scheduler_development.unstable_UserBlockingPriority; + var scheduler_development_9 = scheduler_development.unstable_cancelCallback; + var scheduler_development_10 = scheduler_development.unstable_continueExecution; + var scheduler_development_11 = scheduler_development.unstable_getCurrentPriorityLevel; + var scheduler_development_12 = scheduler_development.unstable_getFirstCallbackNode; + var scheduler_development_13 = scheduler_development.unstable_next; + var scheduler_development_14 = scheduler_development.unstable_pauseExecution; + var scheduler_development_15 = scheduler_development.unstable_requestPaint; + var scheduler_development_16 = scheduler_development.unstable_runWithPriority; + var scheduler_development_17 = scheduler_development.unstable_scheduleCallback; + var scheduler_development_18 = scheduler_development.unstable_shouldYield; + var scheduler_development_19 = scheduler_development.unstable_wrapCallback; + + var scheduler = createCommonjsModule(function (module) { + + { + module.exports = scheduler_development; + } + }); + + var schedulerTracing_development = createCommonjsModule(function (module, exports) { + + + + { + (function() { + + var DEFAULT_THREAD_ID = 0; // Counters used to generate unique IDs. + + var interactionIDCounter = 0; + var threadIDCounter = 0; // Set of currently traced interactions. + // Interactions "stack"– + // Meaning that newly traced interactions are appended to the previously active set. + // When an interaction goes out of scope, the previous set (if any) is restored. + + exports.__interactionsRef = null; // Listener(s) to notify when interactions begin and end. + + exports.__subscriberRef = null; + + { + exports.__interactionsRef = { + current: new Set() + }; + exports.__subscriberRef = { + current: null + }; + } + function unstable_clear(callback) { + + var prevInteractions = exports.__interactionsRef.current; + exports.__interactionsRef.current = new Set(); + + try { + return callback(); + } finally { + exports.__interactionsRef.current = prevInteractions; + } + } + function unstable_getCurrent() { + { + return exports.__interactionsRef.current; + } + } + function unstable_getThreadID() { + return ++threadIDCounter; + } + function unstable_trace(name, timestamp, callback) { + var threadID = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : DEFAULT_THREAD_ID; + + var interaction = { + __count: 1, + id: interactionIDCounter++, + name: name, + timestamp: timestamp + }; + var prevInteractions = exports.__interactionsRef.current; // Traced interactions should stack/accumulate. + // To do that, clone the current interactions. + // The previous set will be restored upon completion. + + var interactions = new Set(prevInteractions); + interactions.add(interaction); + exports.__interactionsRef.current = interactions; + var subscriber = exports.__subscriberRef.current; + var returnValue; + + try { + if (subscriber !== null) { + subscriber.onInteractionTraced(interaction); + } + } finally { + try { + if (subscriber !== null) { + subscriber.onWorkStarted(interactions, threadID); + } + } finally { + try { + returnValue = callback(); + } finally { + exports.__interactionsRef.current = prevInteractions; + + try { + if (subscriber !== null) { + subscriber.onWorkStopped(interactions, threadID); + } + } finally { + interaction.__count--; // If no async work was scheduled for this interaction, + // Notify subscribers that it's completed. + + if (subscriber !== null && interaction.__count === 0) { + subscriber.onInteractionScheduledWorkCompleted(interaction); + } + } + } + } + } + + return returnValue; + } + function unstable_wrap(callback) { + var threadID = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_THREAD_ID; + + var wrappedInteractions = exports.__interactionsRef.current; + var subscriber = exports.__subscriberRef.current; + + if (subscriber !== null) { + subscriber.onWorkScheduled(wrappedInteractions, threadID); + } // Update the pending async work count for the current interactions. + // Update after calling subscribers in case of error. + + + wrappedInteractions.forEach(function (interaction) { + interaction.__count++; + }); + var hasRun = false; + + function wrapped() { + var prevInteractions = exports.__interactionsRef.current; + exports.__interactionsRef.current = wrappedInteractions; + subscriber = exports.__subscriberRef.current; + + try { + var returnValue; + + try { + if (subscriber !== null) { + subscriber.onWorkStarted(wrappedInteractions, threadID); + } + } finally { + try { + returnValue = callback.apply(undefined, arguments); + } finally { + exports.__interactionsRef.current = prevInteractions; + + if (subscriber !== null) { + subscriber.onWorkStopped(wrappedInteractions, threadID); + } + } + } + + return returnValue; + } finally { + if (!hasRun) { + // We only expect a wrapped function to be executed once, + // But in the event that it's executed more than once– + // Only decrement the outstanding interaction counts once. + hasRun = true; // Update pending async counts for all wrapped interactions. + // If this was the last scheduled async work for any of them, + // Mark them as completed. + + wrappedInteractions.forEach(function (interaction) { + interaction.__count--; + + if (subscriber !== null && interaction.__count === 0) { + subscriber.onInteractionScheduledWorkCompleted(interaction); + } + }); + } + } + } + + wrapped.cancel = function cancel() { + subscriber = exports.__subscriberRef.current; + + try { + if (subscriber !== null) { + subscriber.onWorkCanceled(wrappedInteractions, threadID); + } + } finally { + // Update pending async counts for all wrapped interactions. + // If this was the last scheduled async work for any of them, + // Mark them as completed. + wrappedInteractions.forEach(function (interaction) { + interaction.__count--; + + if (subscriber && interaction.__count === 0) { + subscriber.onInteractionScheduledWorkCompleted(interaction); + } + }); + } + }; + + return wrapped; + } + + var subscribers = null; + + { + subscribers = new Set(); + } + + function unstable_subscribe(subscriber) { + { + subscribers.add(subscriber); + + if (subscribers.size === 1) { + exports.__subscriberRef.current = { + onInteractionScheduledWorkCompleted: onInteractionScheduledWorkCompleted, + onInteractionTraced: onInteractionTraced, + onWorkCanceled: onWorkCanceled, + onWorkScheduled: onWorkScheduled, + onWorkStarted: onWorkStarted, + onWorkStopped: onWorkStopped + }; + } + } + } + function unstable_unsubscribe(subscriber) { + { + subscribers.delete(subscriber); + + if (subscribers.size === 0) { + exports.__subscriberRef.current = null; + } + } + } + + function onInteractionTraced(interaction) { + var didCatchError = false; + var caughtError = null; + subscribers.forEach(function (subscriber) { + try { + subscriber.onInteractionTraced(interaction); + } catch (error) { + if (!didCatchError) { + didCatchError = true; + caughtError = error; + } + } + }); + + if (didCatchError) { + throw caughtError; + } + } + + function onInteractionScheduledWorkCompleted(interaction) { + var didCatchError = false; + var caughtError = null; + subscribers.forEach(function (subscriber) { + try { + subscriber.onInteractionScheduledWorkCompleted(interaction); + } catch (error) { + if (!didCatchError) { + didCatchError = true; + caughtError = error; + } + } + }); + + if (didCatchError) { + throw caughtError; + } + } + + function onWorkScheduled(interactions, threadID) { + var didCatchError = false; + var caughtError = null; + subscribers.forEach(function (subscriber) { + try { + subscriber.onWorkScheduled(interactions, threadID); + } catch (error) { + if (!didCatchError) { + didCatchError = true; + caughtError = error; + } + } + }); + + if (didCatchError) { + throw caughtError; + } + } + + function onWorkStarted(interactions, threadID) { + var didCatchError = false; + var caughtError = null; + subscribers.forEach(function (subscriber) { + try { + subscriber.onWorkStarted(interactions, threadID); + } catch (error) { + if (!didCatchError) { + didCatchError = true; + caughtError = error; + } + } + }); + + if (didCatchError) { + throw caughtError; + } + } + + function onWorkStopped(interactions, threadID) { + var didCatchError = false; + var caughtError = null; + subscribers.forEach(function (subscriber) { + try { + subscriber.onWorkStopped(interactions, threadID); + } catch (error) { + if (!didCatchError) { + didCatchError = true; + caughtError = error; + } + } + }); + + if (didCatchError) { + throw caughtError; + } + } + + function onWorkCanceled(interactions, threadID) { + var didCatchError = false; + var caughtError = null; + subscribers.forEach(function (subscriber) { + try { + subscriber.onWorkCanceled(interactions, threadID); + } catch (error) { + if (!didCatchError) { + didCatchError = true; + caughtError = error; + } + } + }); + + if (didCatchError) { + throw caughtError; + } + } + + exports.unstable_clear = unstable_clear; + exports.unstable_getCurrent = unstable_getCurrent; + exports.unstable_getThreadID = unstable_getThreadID; + exports.unstable_subscribe = unstable_subscribe; + exports.unstable_trace = unstable_trace; + exports.unstable_unsubscribe = unstable_unsubscribe; + exports.unstable_wrap = unstable_wrap; + })(); + } + }); + var schedulerTracing_development_1 = schedulerTracing_development.__interactionsRef; + var schedulerTracing_development_2 = schedulerTracing_development.__subscriberRef; + var schedulerTracing_development_3 = schedulerTracing_development.unstable_clear; + var schedulerTracing_development_4 = schedulerTracing_development.unstable_getCurrent; + var schedulerTracing_development_5 = schedulerTracing_development.unstable_getThreadID; + var schedulerTracing_development_6 = schedulerTracing_development.unstable_subscribe; + var schedulerTracing_development_7 = schedulerTracing_development.unstable_trace; + var schedulerTracing_development_8 = schedulerTracing_development.unstable_unsubscribe; + var schedulerTracing_development_9 = schedulerTracing_development.unstable_wrap; + + var tracing = createCommonjsModule(function (module) { + + { + module.exports = schedulerTracing_development; + } + }); + + var reactDom_development = createCommonjsModule(function (module, exports) { + + + + { + (function() { + + var React = react; + var _assign = objectAssign; + var Scheduler = scheduler; + var checkPropTypes = checkPropTypes_1; + var tracing$1 = tracing; + + var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; // Prevent newer renderers from RTE when used with older react package versions. + // Current owner and dispatcher used to share the same ref, + // but PR #14548 split them out to better support the react-debug-tools package. + + if (!ReactSharedInternals.hasOwnProperty('ReactCurrentDispatcher')) { + ReactSharedInternals.ReactCurrentDispatcher = { + current: null + }; + } + + if (!ReactSharedInternals.hasOwnProperty('ReactCurrentBatchConfig')) { + ReactSharedInternals.ReactCurrentBatchConfig = { + suspense: null + }; + } + + // by calls to these methods by a Babel plugin. + // + // In PROD (or in packages without access to React internals), + // they are left as they are instead. + + function warn(format) { + { + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + printWarning('warn', format, args); + } + } + function error(format) { + { + for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; + } + + printWarning('error', format, args); + } + } + + function printWarning(level, format, args) { + // When changing this logic, you might want to also + // update consoleWithStackDev.www.js as well. + { + var hasExistingStack = args.length > 0 && typeof args[args.length - 1] === 'string' && args[args.length - 1].indexOf('\n in') === 0; + + if (!hasExistingStack) { + var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; + var stack = ReactDebugCurrentFrame.getStackAddendum(); + + if (stack !== '') { + format += '%s'; + args = args.concat([stack]); + } + } + + var argsWithFormat = args.map(function (item) { + return '' + item; + }); // Careful: RN currently depends on this prefix + + argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it + // breaks IE9: https://github.com/facebook/react/issues/13610 + // eslint-disable-next-line react-internal/no-production-logging + + Function.prototype.apply.call(console[level], console, argsWithFormat); + + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + var argIndex = 0; + var message = 'Warning: ' + format.replace(/%s/g, function () { + return args[argIndex++]; + }); + throw new Error(message); + } catch (x) {} + } + } + + if (!React) { + { + throw Error( "ReactDOM was loaded before React. Make sure you load the React package before loading ReactDOM." ); + } + } + + var invokeGuardedCallbackImpl = function (name, func, context, a, b, c, d, e, f) { + var funcArgs = Array.prototype.slice.call(arguments, 3); + + try { + func.apply(context, funcArgs); + } catch (error) { + this.onError(error); + } + }; + + { + // In DEV mode, we swap out invokeGuardedCallback for a special version + // that plays more nicely with the browser's DevTools. The idea is to preserve + // "Pause on exceptions" behavior. Because React wraps all user-provided + // functions in invokeGuardedCallback, and the production version of + // invokeGuardedCallback uses a try-catch, all user exceptions are treated + // like caught exceptions, and the DevTools won't pause unless the developer + // takes the extra step of enabling pause on caught exceptions. This is + // unintuitive, though, because even though React has caught the error, from + // the developer's perspective, the error is uncaught. + // + // To preserve the expected "Pause on exceptions" behavior, we don't use a + // try-catch in DEV. Instead, we synchronously dispatch a fake event to a fake + // DOM node, and call the user-provided callback from inside an event handler + // for that fake event. If the callback throws, the error is "captured" using + // a global event handler. But because the error happens in a different + // event loop context, it does not interrupt the normal program flow. + // Effectively, this gives us try-catch behavior without actually using + // try-catch. Neat! + // Check that the browser supports the APIs we need to implement our special + // DEV version of invokeGuardedCallback + if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') { + var fakeNode = document.createElement('react'); + + var invokeGuardedCallbackDev = function (name, func, context, a, b, c, d, e, f) { + // If document doesn't exist we know for sure we will crash in this method + // when we call document.createEvent(). However this can cause confusing + // errors: https://github.com/facebookincubator/create-react-app/issues/3482 + // So we preemptively throw with a better message instead. + if (!(typeof document !== 'undefined')) { + { + throw Error( "The `document` global was defined when React was initialized, but is not defined anymore. This can happen in a test environment if a component schedules an update from an asynchronous callback, but the test has already finished running. To solve this, you can either unmount the component at the end of your test (and ensure that any asynchronous operations get canceled in `componentWillUnmount`), or you can change the test itself to be asynchronous." ); + } + } + + var evt = document.createEvent('Event'); // Keeps track of whether the user-provided callback threw an error. We + // set this to true at the beginning, then set it to false right after + // calling the function. If the function errors, `didError` will never be + // set to false. This strategy works even if the browser is flaky and + // fails to call our global error handler, because it doesn't rely on + // the error event at all. + + var didError = true; // Keeps track of the value of window.event so that we can reset it + // during the callback to let user code access window.event in the + // browsers that support it. + + var windowEvent = window.event; // Keeps track of the descriptor of window.event to restore it after event + // dispatching: https://github.com/facebook/react/issues/13688 + + var windowEventDescriptor = Object.getOwnPropertyDescriptor(window, 'event'); // Create an event handler for our fake event. We will synchronously + // dispatch our fake event using `dispatchEvent`. Inside the handler, we + // call the user-provided callback. + + var funcArgs = Array.prototype.slice.call(arguments, 3); + + function callCallback() { + // We immediately remove the callback from event listeners so that + // nested `invokeGuardedCallback` calls do not clash. Otherwise, a + // nested call would trigger the fake event handlers of any call higher + // in the stack. + fakeNode.removeEventListener(evtType, callCallback, false); // We check for window.hasOwnProperty('event') to prevent the + // window.event assignment in both IE <= 10 as they throw an error + // "Member not found" in strict mode, and in Firefox which does not + // support window.event. + + if (typeof window.event !== 'undefined' && window.hasOwnProperty('event')) { + window.event = windowEvent; + } + + func.apply(context, funcArgs); + didError = false; + } // Create a global error event handler. We use this to capture the value + // that was thrown. It's possible that this error handler will fire more + // than once; for example, if non-React code also calls `dispatchEvent` + // and a handler for that event throws. We should be resilient to most of + // those cases. Even if our error event handler fires more than once, the + // last error event is always used. If the callback actually does error, + // we know that the last error event is the correct one, because it's not + // possible for anything else to have happened in between our callback + // erroring and the code that follows the `dispatchEvent` call below. If + // the callback doesn't error, but the error event was fired, we know to + // ignore it because `didError` will be false, as described above. + + + var error; // Use this to track whether the error event is ever called. + + var didSetError = false; + var isCrossOriginError = false; + + function handleWindowError(event) { + error = event.error; + didSetError = true; + + if (error === null && event.colno === 0 && event.lineno === 0) { + isCrossOriginError = true; + } + + if (event.defaultPrevented) { + // Some other error handler has prevented default. + // Browsers silence the error report if this happens. + // We'll remember this to later decide whether to log it or not. + if (error != null && typeof error === 'object') { + try { + error._suppressLogging = true; + } catch (inner) {// Ignore. + } + } + } + } // Create a fake event type. + + + var evtType = "react-" + (name ? name : 'invokeguardedcallback'); // Attach our event handlers + + window.addEventListener('error', handleWindowError); + fakeNode.addEventListener(evtType, callCallback, false); // Synchronously dispatch our fake event. If the user-provided function + // errors, it will trigger our global error handler. + + evt.initEvent(evtType, false, false); + fakeNode.dispatchEvent(evt); + + if (windowEventDescriptor) { + Object.defineProperty(window, 'event', windowEventDescriptor); + } + + if (didError) { + if (!didSetError) { + // The callback errored, but the error event never fired. + error = new Error('An error was thrown inside one of your components, but React ' + "doesn't know what it was. This is likely due to browser " + 'flakiness. React does its best to preserve the "Pause on ' + 'exceptions" behavior of the DevTools, which requires some ' + "DEV-mode only tricks. It's possible that these don't work in " + 'your browser. Try triggering the error in production mode, ' + 'or switching to a modern browser. If you suspect that this is ' + 'actually an issue with React, please file an issue.'); + } else if (isCrossOriginError) { + error = new Error("A cross-origin error was thrown. React doesn't have access to " + 'the actual error object in development. ' + 'See https://fb.me/react-crossorigin-error for more information.'); + } + + this.onError(error); + } // Remove our event listeners + + + window.removeEventListener('error', handleWindowError); + }; + + invokeGuardedCallbackImpl = invokeGuardedCallbackDev; + } + } + + var invokeGuardedCallbackImpl$1 = invokeGuardedCallbackImpl; + + var hasError = false; + var caughtError = null; // Used by event system to capture/rethrow the first error. + + var hasRethrowError = false; + var rethrowError = null; + var reporter = { + onError: function (error) { + hasError = true; + caughtError = error; + } + }; + /** + * Call a function while guarding against errors that happens within it. + * Returns an error if it throws, otherwise null. + * + * In production, this is implemented using a try-catch. The reason we don't + * use a try-catch directly is so that we can swap out a different + * implementation in DEV mode. + * + * @param {String} name of the guard to use for logging or debugging + * @param {Function} func The function to invoke + * @param {*} context The context to use when calling the function + * @param {...*} args Arguments for function + */ + + function invokeGuardedCallback(name, func, context, a, b, c, d, e, f) { + hasError = false; + caughtError = null; + invokeGuardedCallbackImpl$1.apply(reporter, arguments); + } + /** + * Same as invokeGuardedCallback, but instead of returning an error, it stores + * it in a global so it can be rethrown by `rethrowCaughtError` later. + * TODO: See if caughtError and rethrowError can be unified. + * + * @param {String} name of the guard to use for logging or debugging + * @param {Function} func The function to invoke + * @param {*} context The context to use when calling the function + * @param {...*} args Arguments for function + */ + + function invokeGuardedCallbackAndCatchFirstError(name, func, context, a, b, c, d, e, f) { + invokeGuardedCallback.apply(this, arguments); + + if (hasError) { + var error = clearCaughtError(); + + if (!hasRethrowError) { + hasRethrowError = true; + rethrowError = error; + } + } + } + /** + * During execution of guarded functions we will capture the first error which + * we will rethrow to be handled by the top level error handler. + */ + + function rethrowCaughtError() { + if (hasRethrowError) { + var error = rethrowError; + hasRethrowError = false; + rethrowError = null; + throw error; + } + } + function hasCaughtError() { + return hasError; + } + function clearCaughtError() { + if (hasError) { + var error = caughtError; + hasError = false; + caughtError = null; + return error; + } else { + { + { + throw Error( "clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue." ); + } + } + } + } + + var getFiberCurrentPropsFromNode = null; + var getInstanceFromNode = null; + var getNodeFromInstance = null; + function setComponentTree(getFiberCurrentPropsFromNodeImpl, getInstanceFromNodeImpl, getNodeFromInstanceImpl) { + getFiberCurrentPropsFromNode = getFiberCurrentPropsFromNodeImpl; + getInstanceFromNode = getInstanceFromNodeImpl; + getNodeFromInstance = getNodeFromInstanceImpl; + + { + if (!getNodeFromInstance || !getInstanceFromNode) { + error('EventPluginUtils.setComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.'); + } + } + } + var validateEventDispatches; + + { + validateEventDispatches = function (event) { + var dispatchListeners = event._dispatchListeners; + var dispatchInstances = event._dispatchInstances; + var listenersIsArr = Array.isArray(dispatchListeners); + var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0; + var instancesIsArr = Array.isArray(dispatchInstances); + var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0; + + if (instancesIsArr !== listenersIsArr || instancesLen !== listenersLen) { + error('EventPluginUtils: Invalid `event`.'); + } + }; + } + /** + * Dispatch the event to the listener. + * @param {SyntheticEvent} event SyntheticEvent to handle + * @param {function} listener Application-level callback + * @param {*} inst Internal component instance + */ + + + function executeDispatch(event, listener, inst) { + var type = event.type || 'unknown-event'; + event.currentTarget = getNodeFromInstance(inst); + invokeGuardedCallbackAndCatchFirstError(type, listener, undefined, event); + event.currentTarget = null; + } + /** + * Standard/simple iteration through an event's collected dispatches. + */ + + function executeDispatchesInOrder(event) { + var dispatchListeners = event._dispatchListeners; + var dispatchInstances = event._dispatchInstances; + + { + validateEventDispatches(event); + } + + if (Array.isArray(dispatchListeners)) { + for (var i = 0; i < dispatchListeners.length; i++) { + if (event.isPropagationStopped()) { + break; + } // Listeners and Instances are two parallel arrays that are always in sync. + + + executeDispatch(event, dispatchListeners[i], dispatchInstances[i]); + } + } else if (dispatchListeners) { + executeDispatch(event, dispatchListeners, dispatchInstances); + } + + event._dispatchListeners = null; + event._dispatchInstances = null; + } + + var FunctionComponent = 0; + var ClassComponent = 1; + var IndeterminateComponent = 2; // Before we know whether it is function or class + + var HostRoot = 3; // Root of a host tree. Could be nested inside another node. + + var HostPortal = 4; // A subtree. Could be an entry point to a different renderer. + + var HostComponent = 5; + var HostText = 6; + var Fragment = 7; + var Mode = 8; + var ContextConsumer = 9; + var ContextProvider = 10; + var ForwardRef = 11; + var Profiler = 12; + var SuspenseComponent = 13; + var MemoComponent = 14; + var SimpleMemoComponent = 15; + var LazyComponent = 16; + var IncompleteClassComponent = 17; + var DehydratedFragment = 18; + var SuspenseListComponent = 19; + var FundamentalComponent = 20; + var ScopeComponent = 21; + var Block = 22; + + /** + * Injectable ordering of event plugins. + */ + var eventPluginOrder = null; + /** + * Injectable mapping from names to event plugin modules. + */ + + var namesToPlugins = {}; + /** + * Recomputes the plugin list using the injected plugins and plugin ordering. + * + * @private + */ + + function recomputePluginOrdering() { + if (!eventPluginOrder) { + // Wait until an `eventPluginOrder` is injected. + return; + } + + for (var pluginName in namesToPlugins) { + var pluginModule = namesToPlugins[pluginName]; + var pluginIndex = eventPluginOrder.indexOf(pluginName); + + if (!(pluginIndex > -1)) { + { + throw Error( "EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `" + pluginName + "`." ); + } + } + + if (plugins[pluginIndex]) { + continue; + } + + if (!pluginModule.extractEvents) { + { + throw Error( "EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `" + pluginName + "` does not." ); + } + } + + plugins[pluginIndex] = pluginModule; + var publishedEvents = pluginModule.eventTypes; + + for (var eventName in publishedEvents) { + if (!publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName)) { + { + throw Error( "EventPluginRegistry: Failed to publish event `" + eventName + "` for plugin `" + pluginName + "`." ); + } + } + } + } + } + /** + * Publishes an event so that it can be dispatched by the supplied plugin. + * + * @param {object} dispatchConfig Dispatch configuration for the event. + * @param {object} PluginModule Plugin publishing the event. + * @return {boolean} True if the event was successfully published. + * @private + */ + + + function publishEventForPlugin(dispatchConfig, pluginModule, eventName) { + if (!!eventNameDispatchConfigs.hasOwnProperty(eventName)) { + { + throw Error( "EventPluginRegistry: More than one plugin attempted to publish the same event name, `" + eventName + "`." ); + } + } + + eventNameDispatchConfigs[eventName] = dispatchConfig; + var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames; + + if (phasedRegistrationNames) { + for (var phaseName in phasedRegistrationNames) { + if (phasedRegistrationNames.hasOwnProperty(phaseName)) { + var phasedRegistrationName = phasedRegistrationNames[phaseName]; + publishRegistrationName(phasedRegistrationName, pluginModule, eventName); + } + } + + return true; + } else if (dispatchConfig.registrationName) { + publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName); + return true; + } + + return false; + } + /** + * Publishes a registration name that is used to identify dispatched events. + * + * @param {string} registrationName Registration name to add. + * @param {object} PluginModule Plugin publishing the event. + * @private + */ + + + function publishRegistrationName(registrationName, pluginModule, eventName) { + if (!!registrationNameModules[registrationName]) { + { + throw Error( "EventPluginRegistry: More than one plugin attempted to publish the same registration name, `" + registrationName + "`." ); + } + } + + registrationNameModules[registrationName] = pluginModule; + registrationNameDependencies[registrationName] = pluginModule.eventTypes[eventName].dependencies; + + { + var lowerCasedName = registrationName.toLowerCase(); + possibleRegistrationNames[lowerCasedName] = registrationName; + + if (registrationName === 'onDoubleClick') { + possibleRegistrationNames.ondblclick = registrationName; + } + } + } + /** + * Registers plugins so that they can extract and dispatch events. + */ + + /** + * Ordered list of injected plugins. + */ + + + var plugins = []; + /** + * Mapping from event name to dispatch config + */ + + var eventNameDispatchConfigs = {}; + /** + * Mapping from registration name to plugin module + */ + + var registrationNameModules = {}; + /** + * Mapping from registration name to event name + */ + + var registrationNameDependencies = {}; + /** + * Mapping from lowercase registration names to the properly cased version, + * used to warn in the case of missing event handlers. Available + * only in true. + * @type {Object} + */ + + var possibleRegistrationNames = {} ; // Trust the developer to only use possibleRegistrationNames in true + + /** + * Injects an ordering of plugins (by plugin name). This allows the ordering + * to be decoupled from injection of the actual plugins so that ordering is + * always deterministic regardless of packaging, on-the-fly injection, etc. + * + * @param {array} InjectedEventPluginOrder + * @internal + */ + + function injectEventPluginOrder(injectedEventPluginOrder) { + if (!!eventPluginOrder) { + { + throw Error( "EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React." ); + } + } // Clone the ordering so it cannot be dynamically mutated. + + + eventPluginOrder = Array.prototype.slice.call(injectedEventPluginOrder); + recomputePluginOrdering(); + } + /** + * Injects plugins to be used by plugin event system. The plugin names must be + * in the ordering injected by `injectEventPluginOrder`. + * + * Plugins can be injected as part of page initialization or on-the-fly. + * + * @param {object} injectedNamesToPlugins Map from names to plugin modules. + * @internal + */ + + function injectEventPluginsByName(injectedNamesToPlugins) { + var isOrderingDirty = false; + + for (var pluginName in injectedNamesToPlugins) { + if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) { + continue; + } + + var pluginModule = injectedNamesToPlugins[pluginName]; + + if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== pluginModule) { + if (!!namesToPlugins[pluginName]) { + { + throw Error( "EventPluginRegistry: Cannot inject two different event plugins using the same name, `" + pluginName + "`." ); + } + } + + namesToPlugins[pluginName] = pluginModule; + isOrderingDirty = true; + } + } + + if (isOrderingDirty) { + recomputePluginOrdering(); + } + } + + var canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined'); + + var PLUGIN_EVENT_SYSTEM = 1; + var IS_REPLAYED = 1 << 5; + var IS_FIRST_ANCESTOR = 1 << 6; + + var restoreImpl = null; + var restoreTarget = null; + var restoreQueue = null; + + function restoreStateOfTarget(target) { + // We perform this translation at the end of the event loop so that we + // always receive the correct fiber here + var internalInstance = getInstanceFromNode(target); + + if (!internalInstance) { + // Unmounted + return; + } + + if (!(typeof restoreImpl === 'function')) { + { + throw Error( "setRestoreImplementation() needs to be called to handle a target for controlled events. This error is likely caused by a bug in React. Please file an issue." ); + } + } + + var stateNode = internalInstance.stateNode; // Guard against Fiber being unmounted. + + if (stateNode) { + var _props = getFiberCurrentPropsFromNode(stateNode); + + restoreImpl(internalInstance.stateNode, internalInstance.type, _props); + } + } + + function setRestoreImplementation(impl) { + restoreImpl = impl; + } + function enqueueStateRestore(target) { + if (restoreTarget) { + if (restoreQueue) { + restoreQueue.push(target); + } else { + restoreQueue = [target]; + } + } else { + restoreTarget = target; + } + } + function needsStateRestore() { + return restoreTarget !== null || restoreQueue !== null; + } + function restoreStateIfNeeded() { + if (!restoreTarget) { + return; + } + + var target = restoreTarget; + var queuedTargets = restoreQueue; + restoreTarget = null; + restoreQueue = null; + restoreStateOfTarget(target); + + if (queuedTargets) { + for (var i = 0; i < queuedTargets.length; i++) { + restoreStateOfTarget(queuedTargets[i]); + } + } + } + + var enableProfilerTimer = true; // Trace which interactions trigger each commit. + + var enableDeprecatedFlareAPI = false; // Experimental Host Component support. + + var enableFundamentalAPI = false; // Experimental Scope support. + var warnAboutStringRefs = false; + + // the renderer. Such as when we're dispatching events or if third party + // libraries need to call batchedUpdates. Eventually, this API will go away when + // everything is batched by default. We'll then have a similar API to opt-out of + // scheduled work and instead do synchronous work. + // Defaults + + var batchedUpdatesImpl = function (fn, bookkeeping) { + return fn(bookkeeping); + }; + + var discreteUpdatesImpl = function (fn, a, b, c, d) { + return fn(a, b, c, d); + }; + + var flushDiscreteUpdatesImpl = function () {}; + + var batchedEventUpdatesImpl = batchedUpdatesImpl; + var isInsideEventHandler = false; + var isBatchingEventUpdates = false; + + function finishEventHandler() { + // Here we wait until all updates have propagated, which is important + // when using controlled components within layers: + // https://github.com/facebook/react/issues/1698 + // Then we restore state of any controlled component. + var controlledComponentsHavePendingUpdates = needsStateRestore(); + + if (controlledComponentsHavePendingUpdates) { + // If a controlled event was fired, we may need to restore the state of + // the DOM node back to the controlled value. This is necessary when React + // bails out of the update without touching the DOM. + flushDiscreteUpdatesImpl(); + restoreStateIfNeeded(); + } + } + + function batchedUpdates(fn, bookkeeping) { + if (isInsideEventHandler) { + // If we are currently inside another batch, we need to wait until it + // fully completes before restoring state. + return fn(bookkeeping); + } + + isInsideEventHandler = true; + + try { + return batchedUpdatesImpl(fn, bookkeeping); + } finally { + isInsideEventHandler = false; + finishEventHandler(); + } + } + function batchedEventUpdates(fn, a, b) { + if (isBatchingEventUpdates) { + // If we are currently inside another batch, we need to wait until it + // fully completes before restoring state. + return fn(a, b); + } + + isBatchingEventUpdates = true; + + try { + return batchedEventUpdatesImpl(fn, a, b); + } finally { + isBatchingEventUpdates = false; + finishEventHandler(); + } + } // This is for the React Flare event system + function discreteUpdates(fn, a, b, c, d) { + var prevIsInsideEventHandler = isInsideEventHandler; + isInsideEventHandler = true; + + try { + return discreteUpdatesImpl(fn, a, b, c, d); + } finally { + isInsideEventHandler = prevIsInsideEventHandler; + + if (!isInsideEventHandler) { + finishEventHandler(); + } + } + } + function flushDiscreteUpdatesIfNeeded(timeStamp) { + // event.timeStamp isn't overly reliable due to inconsistencies in + // how different browsers have historically provided the time stamp. + // Some browsers provide high-resolution time stamps for all events, + // some provide low-resolution time stamps for all events. FF < 52 + // even mixes both time stamps together. Some browsers even report + // negative time stamps or time stamps that are 0 (iOS9) in some cases. + // Given we are only comparing two time stamps with equality (!==), + // we are safe from the resolution differences. If the time stamp is 0 + // we bail-out of preventing the flush, which can affect semantics, + // such as if an earlier flush removes or adds event listeners that + // are fired in the subsequent flush. However, this is the same + // behaviour as we had before this change, so the risks are low. + if (!isInsideEventHandler && (!enableDeprecatedFlareAPI )) { + flushDiscreteUpdatesImpl(); + } + } + function setBatchingImplementation(_batchedUpdatesImpl, _discreteUpdatesImpl, _flushDiscreteUpdatesImpl, _batchedEventUpdatesImpl) { + batchedUpdatesImpl = _batchedUpdatesImpl; + discreteUpdatesImpl = _discreteUpdatesImpl; + flushDiscreteUpdatesImpl = _flushDiscreteUpdatesImpl; + batchedEventUpdatesImpl = _batchedEventUpdatesImpl; + } + + var DiscreteEvent = 0; + var UserBlockingEvent = 1; + var ContinuousEvent = 2; + + // A reserved attribute. + // It is handled by React separately and shouldn't be written to the DOM. + var RESERVED = 0; // A simple string attribute. + // Attributes that aren't in the whitelist are presumed to have this type. + + var STRING = 1; // A string attribute that accepts booleans in React. In HTML, these are called + // "enumerated" attributes with "true" and "false" as possible values. + // When true, it should be set to a "true" string. + // When false, it should be set to a "false" string. + + var BOOLEANISH_STRING = 2; // A real boolean attribute. + // When true, it should be present (set either to an empty string or its name). + // When false, it should be omitted. + + var BOOLEAN = 3; // An attribute that can be used as a flag as well as with a value. + // When true, it should be present (set either to an empty string or its name). + // When false, it should be omitted. + // For any other value, should be present with that value. + + var OVERLOADED_BOOLEAN = 4; // An attribute that must be numeric or parse as a numeric. + // When falsy, it should be removed. + + var NUMERIC = 5; // An attribute that must be positive numeric or parse as a positive numeric. + // When falsy, it should be removed. + + var POSITIVE_NUMERIC = 6; + + /* eslint-disable max-len */ + var ATTRIBUTE_NAME_START_CHAR = ":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD"; + /* eslint-enable max-len */ + + var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040"; + var ROOT_ATTRIBUTE_NAME = 'data-reactroot'; + var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + ATTRIBUTE_NAME_START_CHAR + '][' + ATTRIBUTE_NAME_CHAR + ']*$'); + var hasOwnProperty = Object.prototype.hasOwnProperty; + var illegalAttributeNameCache = {}; + var validatedAttributeNameCache = {}; + function isAttributeNameSafe(attributeName) { + if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) { + return true; + } + + if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) { + return false; + } + + if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) { + validatedAttributeNameCache[attributeName] = true; + return true; + } + + illegalAttributeNameCache[attributeName] = true; + + { + error('Invalid attribute name: `%s`', attributeName); + } + + return false; + } + function shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) { + if (propertyInfo !== null) { + return propertyInfo.type === RESERVED; + } + + if (isCustomComponentTag) { + return false; + } + + if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) { + return true; + } + + return false; + } + function shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag) { + if (propertyInfo !== null && propertyInfo.type === RESERVED) { + return false; + } + + switch (typeof value) { + case 'function': // $FlowIssue symbol is perfectly valid here + + case 'symbol': + // eslint-disable-line + return true; + + case 'boolean': + { + if (isCustomComponentTag) { + return false; + } + + if (propertyInfo !== null) { + return !propertyInfo.acceptsBooleans; + } else { + var prefix = name.toLowerCase().slice(0, 5); + return prefix !== 'data-' && prefix !== 'aria-'; + } + } + + default: + return false; + } + } + function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) { + if (value === null || typeof value === 'undefined') { + return true; + } + + if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) { + return true; + } + + if (isCustomComponentTag) { + return false; + } + + if (propertyInfo !== null) { + switch (propertyInfo.type) { + case BOOLEAN: + return !value; + + case OVERLOADED_BOOLEAN: + return value === false; + + case NUMERIC: + return isNaN(value); + + case POSITIVE_NUMERIC: + return isNaN(value) || value < 1; + } + } + + return false; + } + function getPropertyInfo(name) { + return properties.hasOwnProperty(name) ? properties[name] : null; + } + + function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL) { + this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN; + this.attributeName = attributeName; + this.attributeNamespace = attributeNamespace; + this.mustUseProperty = mustUseProperty; + this.propertyName = name; + this.type = type; + this.sanitizeURL = sanitizeURL; + } // When adding attributes to this list, be sure to also add them to + // the `possibleStandardNames` module to ensure casing and incorrect + // name warnings. + + + var properties = {}; // These props are reserved by React. They shouldn't be written to the DOM. + + var reservedProps = ['children', 'dangerouslySetInnerHTML', // TODO: This prevents the assignment of defaultValue to regular + // elements (not just inputs). Now that ReactDOMInput assigns to the + // defaultValue property -- do we need this? + 'defaultValue', 'defaultChecked', 'innerHTML', 'suppressContentEditableWarning', 'suppressHydrationWarning', 'style']; + + reservedProps.forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, RESERVED, false, // mustUseProperty + name, // attributeName + null, // attributeNamespace + false); + }); // A few React string attributes have a different name. + // This is a mapping from React prop names to the attribute names. + + [['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor', 'for'], ['httpEquiv', 'http-equiv']].forEach(function (_ref) { + var name = _ref[0], + attributeName = _ref[1]; + properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty + attributeName, // attributeName + null, // attributeNamespace + false); + }); // These are "enumerated" HTML attributes that accept "true" and "false". + // In React, we let users pass `true` and `false` even though technically + // these aren't boolean attributes (they are coerced to strings). + + ['contentEditable', 'draggable', 'spellCheck', 'value'].forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty + name.toLowerCase(), // attributeName + null, // attributeNamespace + false); + }); // These are "enumerated" SVG attributes that accept "true" and "false". + // In React, we let users pass `true` and `false` even though technically + // these aren't boolean attributes (they are coerced to strings). + // Since these are SVG attributes, their attribute names are case-sensitive. + + ['autoReverse', 'externalResourcesRequired', 'focusable', 'preserveAlpha'].forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty + name, // attributeName + null, // attributeNamespace + false); + }); // These are HTML boolean attributes. + + ['allowFullScreen', 'async', // Note: there is a special case that prevents it from being written to the DOM + // on the client side because the browsers are inconsistent. Instead we call focus(). + 'autoFocus', 'autoPlay', 'controls', 'default', 'defer', 'disabled', 'disablePictureInPicture', 'formNoValidate', 'hidden', 'loop', 'noModule', 'noValidate', 'open', 'playsInline', 'readOnly', 'required', 'reversed', 'scoped', 'seamless', // Microdata + 'itemScope'].forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, BOOLEAN, false, // mustUseProperty + name.toLowerCase(), // attributeName + null, // attributeNamespace + false); + }); // These are the few React props that we set as DOM properties + // rather than attributes. These are all booleans. + + ['checked', // Note: `option.selected` is not updated if `select.multiple` is + // disabled with `removeAttribute`. We have special logic for handling this. + 'multiple', 'muted', 'selected' // NOTE: if you add a camelCased prop to this list, + // you'll need to set attributeName to name.toLowerCase() + // instead in the assignment below. + ].forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, BOOLEAN, true, // mustUseProperty + name, // attributeName + null, // attributeNamespace + false); + }); // These are HTML attributes that are "overloaded booleans": they behave like + // booleans, but can also accept a string value. + + ['capture', 'download' // NOTE: if you add a camelCased prop to this list, + // you'll need to set attributeName to name.toLowerCase() + // instead in the assignment below. + ].forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false, // mustUseProperty + name, // attributeName + null, // attributeNamespace + false); + }); // These are HTML attributes that must be positive numbers. + + ['cols', 'rows', 'size', 'span' // NOTE: if you add a camelCased prop to this list, + // you'll need to set attributeName to name.toLowerCase() + // instead in the assignment below. + ].forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false, // mustUseProperty + name, // attributeName + null, // attributeNamespace + false); + }); // These are HTML attributes that must be numbers. + + ['rowSpan', 'start'].forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, NUMERIC, false, // mustUseProperty + name.toLowerCase(), // attributeName + null, // attributeNamespace + false); + }); + var CAMELIZE = /[\-\:]([a-z])/g; + + var capitalize = function (token) { + return token[1].toUpperCase(); + }; // This is a list of all SVG attributes that need special casing, namespacing, + // or boolean value assignment. Regular attributes that just accept strings + // and have the same names are omitted, just like in the HTML whitelist. + // Some of these attributes can be hard to find. This list was created by + // scraping the MDN documentation. + + + ['accent-height', 'alignment-baseline', 'arabic-form', 'baseline-shift', 'cap-height', 'clip-path', 'clip-rule', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'dominant-baseline', 'enable-background', 'fill-opacity', 'fill-rule', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'glyph-name', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'horiz-adv-x', 'horiz-origin-x', 'image-rendering', 'letter-spacing', 'lighting-color', 'marker-end', 'marker-mid', 'marker-start', 'overline-position', 'overline-thickness', 'paint-order', 'panose-1', 'pointer-events', 'rendering-intent', 'shape-rendering', 'stop-color', 'stop-opacity', 'strikethrough-position', 'strikethrough-thickness', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-anchor', 'text-decoration', 'text-rendering', 'underline-position', 'underline-thickness', 'unicode-bidi', 'unicode-range', 'units-per-em', 'v-alphabetic', 'v-hanging', 'v-ideographic', 'v-mathematical', 'vector-effect', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'word-spacing', 'writing-mode', 'xmlns:xlink', 'x-height' // NOTE: if you add a camelCased prop to this list, + // you'll need to set attributeName to name.toLowerCase() + // instead in the assignment below. + ].forEach(function (attributeName) { + var name = attributeName.replace(CAMELIZE, capitalize); + properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty + attributeName, null, // attributeNamespace + false); + }); // String SVG attributes with the xlink namespace. + + ['xlink:actuate', 'xlink:arcrole', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type' // NOTE: if you add a camelCased prop to this list, + // you'll need to set attributeName to name.toLowerCase() + // instead in the assignment below. + ].forEach(function (attributeName) { + var name = attributeName.replace(CAMELIZE, capitalize); + properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty + attributeName, 'http://www.w3.org/1999/xlink', false); + }); // String SVG attributes with the xml namespace. + + ['xml:base', 'xml:lang', 'xml:space' // NOTE: if you add a camelCased prop to this list, + // you'll need to set attributeName to name.toLowerCase() + // instead in the assignment below. + ].forEach(function (attributeName) { + var name = attributeName.replace(CAMELIZE, capitalize); + properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty + attributeName, 'http://www.w3.org/XML/1998/namespace', false); + }); // These attribute exists both in HTML and SVG. + // The attribute name is case-sensitive in SVG so we can't just use + // the React name like we do for attributes that exist only in HTML. + + ['tabIndex', 'crossOrigin'].forEach(function (attributeName) { + properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty + attributeName.toLowerCase(), // attributeName + null, // attributeNamespace + false); + }); // These attributes accept URLs. These must not allow javascript: URLS. + // These will also need to accept Trusted Types object in the future. + + var xlinkHref = 'xlinkHref'; + properties[xlinkHref] = new PropertyInfoRecord('xlinkHref', STRING, false, // mustUseProperty + 'xlink:href', 'http://www.w3.org/1999/xlink', true); + ['src', 'href', 'action', 'formAction'].forEach(function (attributeName) { + properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty + attributeName.toLowerCase(), // attributeName + null, // attributeNamespace + true); + }); + + var ReactDebugCurrentFrame = null; + + { + ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; + } // A javascript: URL can contain leading C0 control or \u0020 SPACE, + // and any newline or tab are filtered out as if they're not part of the URL. + // https://url.spec.whatwg.org/#url-parsing + // Tab or newline are defined as \r\n\t: + // https://infra.spec.whatwg.org/#ascii-tab-or-newline + // A C0 control is a code point in the range \u0000 NULL to \u001F + // INFORMATION SEPARATOR ONE, inclusive: + // https://infra.spec.whatwg.org/#c0-control-or-space + + /* eslint-disable max-len */ + + + var isJavaScriptProtocol = /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i; + var didWarn = false; + + function sanitizeURL(url) { + { + if (!didWarn && isJavaScriptProtocol.test(url)) { + didWarn = true; + + error('A future version of React will block javascript: URLs as a security precaution. ' + 'Use event handlers instead if you can. If you need to generate unsafe HTML try ' + 'using dangerouslySetInnerHTML instead. React was passed %s.', JSON.stringify(url)); + } + } + } + + /** + * Get the value for a property on a node. Only used in DEV for SSR validation. + * The "expected" argument is used as a hint of what the expected value is. + * Some properties have multiple equivalent values. + */ + function getValueForProperty(node, name, expected, propertyInfo) { + { + if (propertyInfo.mustUseProperty) { + var propertyName = propertyInfo.propertyName; + return node[propertyName]; + } else { + if ( propertyInfo.sanitizeURL) { + // If we haven't fully disabled javascript: URLs, and if + // the hydration is successful of a javascript: URL, we + // still want to warn on the client. + sanitizeURL('' + expected); + } + + var attributeName = propertyInfo.attributeName; + var stringValue = null; + + if (propertyInfo.type === OVERLOADED_BOOLEAN) { + if (node.hasAttribute(attributeName)) { + var value = node.getAttribute(attributeName); + + if (value === '') { + return true; + } + + if (shouldRemoveAttribute(name, expected, propertyInfo, false)) { + return value; + } + + if (value === '' + expected) { + return expected; + } + + return value; + } + } else if (node.hasAttribute(attributeName)) { + if (shouldRemoveAttribute(name, expected, propertyInfo, false)) { + // We had an attribute but shouldn't have had one, so read it + // for the error message. + return node.getAttribute(attributeName); + } + + if (propertyInfo.type === BOOLEAN) { + // If this was a boolean, it doesn't matter what the value is + // the fact that we have it is the same as the expected. + return expected; + } // Even if this property uses a namespace we use getAttribute + // because we assume its namespaced name is the same as our config. + // To use getAttributeNS we need the local name which we don't have + // in our config atm. + + + stringValue = node.getAttribute(attributeName); + } + + if (shouldRemoveAttribute(name, expected, propertyInfo, false)) { + return stringValue === null ? expected : stringValue; + } else if (stringValue === '' + expected) { + return expected; + } else { + return stringValue; + } + } + } + } + /** + * Get the value for a attribute on a node. Only used in DEV for SSR validation. + * The third argument is used as a hint of what the expected value is. Some + * attributes have multiple equivalent values. + */ + + function getValueForAttribute(node, name, expected) { + { + if (!isAttributeNameSafe(name)) { + return; + } + + if (!node.hasAttribute(name)) { + return expected === undefined ? undefined : null; + } + + var value = node.getAttribute(name); + + if (value === '' + expected) { + return expected; + } + + return value; + } + } + /** + * Sets the value for a property on a node. + * + * @param {DOMElement} node + * @param {string} name + * @param {*} value + */ + + function setValueForProperty(node, name, value, isCustomComponentTag) { + var propertyInfo = getPropertyInfo(name); + + if (shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag)) { + return; + } + + if (shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag)) { + value = null; + } // If the prop isn't in the special list, treat it as a simple attribute. + + + if (isCustomComponentTag || propertyInfo === null) { + if (isAttributeNameSafe(name)) { + var _attributeName = name; + + if (value === null) { + node.removeAttribute(_attributeName); + } else { + node.setAttribute(_attributeName, '' + value); + } + } + + return; + } + + var mustUseProperty = propertyInfo.mustUseProperty; + + if (mustUseProperty) { + var propertyName = propertyInfo.propertyName; + + if (value === null) { + var type = propertyInfo.type; + node[propertyName] = type === BOOLEAN ? false : ''; + } else { + // Contrary to `setAttribute`, object properties are properly + // `toString`ed by IE8/9. + node[propertyName] = value; + } + + return; + } // The rest are treated as attributes with special cases. + + + var attributeName = propertyInfo.attributeName, + attributeNamespace = propertyInfo.attributeNamespace; + + if (value === null) { + node.removeAttribute(attributeName); + } else { + var _type = propertyInfo.type; + var attributeValue; + + if (_type === BOOLEAN || _type === OVERLOADED_BOOLEAN && value === true) { + // If attribute type is boolean, we know for sure it won't be an execution sink + // and we won't require Trusted Type here. + attributeValue = ''; + } else { + // `setAttribute` with objects becomes only `[object]` in IE8/9, + // ('' + value) makes it output the correct toString()-value. + { + attributeValue = '' + value; + } + + if (propertyInfo.sanitizeURL) { + sanitizeURL(attributeValue.toString()); + } + } + + if (attributeNamespace) { + node.setAttributeNS(attributeNamespace, attributeName, attributeValue); + } else { + node.setAttribute(attributeName, attributeValue); + } + } + } + + var BEFORE_SLASH_RE = /^(.*)[\\\/]/; + function describeComponentFrame (name, source, ownerName) { + var sourceInfo = ''; + + if (source) { + var path = source.fileName; + var fileName = path.replace(BEFORE_SLASH_RE, ''); + + { + // In DEV, include code for a common special case: + // prefer "folder/index.js" instead of just "index.js". + if (/^index\./.test(fileName)) { + var match = path.match(BEFORE_SLASH_RE); + + if (match) { + var pathBeforeSlash = match[1]; + + if (pathBeforeSlash) { + var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, ''); + fileName = folderName + '/' + fileName; + } + } + } + } + + sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')'; + } else if (ownerName) { + sourceInfo = ' (created by ' + ownerName + ')'; + } + + return '\n in ' + (name || 'Unknown') + sourceInfo; + } + + // The Symbol used to tag the ReactElement-like types. If there is no native Symbol + // nor polyfill, then a plain number is used for performance. + var hasSymbol = typeof Symbol === 'function' && Symbol.for; + var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7; + var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca; + var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb; + var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc; + var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2; + var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd; + var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary + var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf; + var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0; + var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1; + var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8; + var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3; + var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4; + var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9; + var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; + var FAUX_ITERATOR_SYMBOL = '@@iterator'; + function getIteratorFn(maybeIterable) { + if (maybeIterable === null || typeof maybeIterable !== 'object') { + return null; + } + + var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; + + if (typeof maybeIterator === 'function') { + return maybeIterator; + } + + return null; + } + + var Uninitialized = -1; + var Pending = 0; + var Resolved = 1; + var Rejected = 2; + function refineResolvedLazyComponent(lazyComponent) { + return lazyComponent._status === Resolved ? lazyComponent._result : null; + } + function initializeLazyComponentType(lazyComponent) { + if (lazyComponent._status === Uninitialized) { + lazyComponent._status = Pending; + var ctor = lazyComponent._ctor; + var thenable = ctor(); + lazyComponent._result = thenable; + thenable.then(function (moduleObject) { + if (lazyComponent._status === Pending) { + var defaultExport = moduleObject.default; + + { + if (defaultExport === undefined) { + error('lazy: Expected the result of a dynamic import() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + "const MyComponent = lazy(() => import('./MyComponent'))", moduleObject); + } + } + + lazyComponent._status = Resolved; + lazyComponent._result = defaultExport; + } + }, function (error) { + if (lazyComponent._status === Pending) { + lazyComponent._status = Rejected; + lazyComponent._result = error; + } + }); + } + } + + function getWrappedName(outerType, innerType, wrapperName) { + var functionName = innerType.displayName || innerType.name || ''; + return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName); + } + + function getComponentName(type) { + if (type == null) { + // Host root, text node or just invalid type. + return null; + } + + { + if (typeof type.tag === 'number') { + error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.'); + } + } + + if (typeof type === 'function') { + return type.displayName || type.name || null; + } + + if (typeof type === 'string') { + return type; + } + + switch (type) { + case REACT_FRAGMENT_TYPE: + return 'Fragment'; + + case REACT_PORTAL_TYPE: + return 'Portal'; + + case REACT_PROFILER_TYPE: + return "Profiler"; + + case REACT_STRICT_MODE_TYPE: + return 'StrictMode'; + + case REACT_SUSPENSE_TYPE: + return 'Suspense'; + + case REACT_SUSPENSE_LIST_TYPE: + return 'SuspenseList'; + } + + if (typeof type === 'object') { + switch (type.$$typeof) { + case REACT_CONTEXT_TYPE: + return 'Context.Consumer'; + + case REACT_PROVIDER_TYPE: + return 'Context.Provider'; + + case REACT_FORWARD_REF_TYPE: + return getWrappedName(type, type.render, 'ForwardRef'); + + case REACT_MEMO_TYPE: + return getComponentName(type.type); + + case REACT_BLOCK_TYPE: + return getComponentName(type.render); + + case REACT_LAZY_TYPE: + { + var thenable = type; + var resolvedThenable = refineResolvedLazyComponent(thenable); + + if (resolvedThenable) { + return getComponentName(resolvedThenable); + } + + break; + } + } + } + + return null; + } + + var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame; + + function describeFiber(fiber) { + switch (fiber.tag) { + case HostRoot: + case HostPortal: + case HostText: + case Fragment: + case ContextProvider: + case ContextConsumer: + return ''; + + default: + var owner = fiber._debugOwner; + var source = fiber._debugSource; + var name = getComponentName(fiber.type); + var ownerName = null; + + if (owner) { + ownerName = getComponentName(owner.type); + } + + return describeComponentFrame(name, source, ownerName); + } + } + + function getStackByFiberInDevAndProd(workInProgress) { + var info = ''; + var node = workInProgress; + + do { + info += describeFiber(node); + node = node.return; + } while (node); + + return info; + } + var current = null; + var isRendering = false; + function getCurrentFiberOwnerNameInDevOrNull() { + { + if (current === null) { + return null; + } + + var owner = current._debugOwner; + + if (owner !== null && typeof owner !== 'undefined') { + return getComponentName(owner.type); + } + } + + return null; + } + function getCurrentFiberStackInDev() { + { + if (current === null) { + return ''; + } // Safe because if current fiber exists, we are reconciling, + // and it is guaranteed to be the work-in-progress version. + + + return getStackByFiberInDevAndProd(current); + } + } + function resetCurrentFiber() { + { + ReactDebugCurrentFrame$1.getCurrentStack = null; + current = null; + isRendering = false; + } + } + function setCurrentFiber(fiber) { + { + ReactDebugCurrentFrame$1.getCurrentStack = getCurrentFiberStackInDev; + current = fiber; + isRendering = false; + } + } + function setIsRendering(rendering) { + { + isRendering = rendering; + } + } + + // Flow does not allow string concatenation of most non-string types. To work + // around this limitation, we use an opaque type that can only be obtained by + // passing the value through getToStringValue first. + function toString(value) { + return '' + value; + } + function getToStringValue(value) { + switch (typeof value) { + case 'boolean': + case 'number': + case 'object': + case 'string': + case 'undefined': + return value; + + default: + // function, symbol are assigned as empty strings + return ''; + } + } + + var ReactDebugCurrentFrame$2 = null; + var ReactControlledValuePropTypes = { + checkPropTypes: null + }; + + { + ReactDebugCurrentFrame$2 = ReactSharedInternals.ReactDebugCurrentFrame; + var hasReadOnlyValue = { + button: true, + checkbox: true, + image: true, + hidden: true, + radio: true, + reset: true, + submit: true + }; + var propTypes = { + value: function (props, propName, componentName) { + if (hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled || props[propName] == null || enableDeprecatedFlareAPI ) { + return null; + } + + return new Error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.'); + }, + checked: function (props, propName, componentName) { + if (props.onChange || props.readOnly || props.disabled || props[propName] == null || enableDeprecatedFlareAPI ) { + return null; + } + + return new Error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.'); + } + }; + /** + * Provide a linked `value` attribute for controlled forms. You should not use + * this outside of the ReactDOM controlled form components. + */ + + ReactControlledValuePropTypes.checkPropTypes = function (tagName, props) { + checkPropTypes(propTypes, props, 'prop', tagName, ReactDebugCurrentFrame$2.getStackAddendum); + }; + } + + function isCheckable(elem) { + var type = elem.type; + var nodeName = elem.nodeName; + return nodeName && nodeName.toLowerCase() === 'input' && (type === 'checkbox' || type === 'radio'); + } + + function getTracker(node) { + return node._valueTracker; + } + + function detachTracker(node) { + node._valueTracker = null; + } + + function getValueFromNode(node) { + var value = ''; + + if (!node) { + return value; + } + + if (isCheckable(node)) { + value = node.checked ? 'true' : 'false'; + } else { + value = node.value; + } + + return value; + } + + function trackValueOnNode(node) { + var valueField = isCheckable(node) ? 'checked' : 'value'; + var descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField); + var currentValue = '' + node[valueField]; // if someone has already defined a value or Safari, then bail + // and don't track value will cause over reporting of changes, + // but it's better then a hard failure + // (needed for certain tests that spyOn input values and Safari) + + if (node.hasOwnProperty(valueField) || typeof descriptor === 'undefined' || typeof descriptor.get !== 'function' || typeof descriptor.set !== 'function') { + return; + } + + var get = descriptor.get, + set = descriptor.set; + Object.defineProperty(node, valueField, { + configurable: true, + get: function () { + return get.call(this); + }, + set: function (value) { + currentValue = '' + value; + set.call(this, value); + } + }); // We could've passed this the first time + // but it triggers a bug in IE11 and Edge 14/15. + // Calling defineProperty() again should be equivalent. + // https://github.com/facebook/react/issues/11768 + + Object.defineProperty(node, valueField, { + enumerable: descriptor.enumerable + }); + var tracker = { + getValue: function () { + return currentValue; + }, + setValue: function (value) { + currentValue = '' + value; + }, + stopTracking: function () { + detachTracker(node); + delete node[valueField]; + } + }; + return tracker; + } + + function track(node) { + if (getTracker(node)) { + return; + } // TODO: Once it's just Fiber we can move this to node._wrapperState + + + node._valueTracker = trackValueOnNode(node); + } + function updateValueIfChanged(node) { + if (!node) { + return false; + } + + var tracker = getTracker(node); // if there is no tracker at this point it's unlikely + // that trying again will succeed + + if (!tracker) { + return true; + } + + var lastValue = tracker.getValue(); + var nextValue = getValueFromNode(node); + + if (nextValue !== lastValue) { + tracker.setValue(nextValue); + return true; + } + + return false; + } + + var didWarnValueDefaultValue = false; + var didWarnCheckedDefaultChecked = false; + var didWarnControlledToUncontrolled = false; + var didWarnUncontrolledToControlled = false; + + function isControlled(props) { + var usesChecked = props.type === 'checkbox' || props.type === 'radio'; + return usesChecked ? props.checked != null : props.value != null; + } + /** + * Implements an host component that allows setting these optional + * props: `checked`, `value`, `defaultChecked`, and `defaultValue`. + * + * If `checked` or `value` are not supplied (or null/undefined), user actions + * that affect the checked state or value will trigger updates to the element. + * + * If they are supplied (and not null/undefined), the rendered element will not + * trigger updates to the element. Instead, the props must change in order for + * the rendered element to be updated. + * + * The rendered element will be initialized as unchecked (or `defaultChecked`) + * with an empty value (or `defaultValue`). + * + * See http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html + */ + + + function getHostProps(element, props) { + var node = element; + var checked = props.checked; + + var hostProps = _assign({}, props, { + defaultChecked: undefined, + defaultValue: undefined, + value: undefined, + checked: checked != null ? checked : node._wrapperState.initialChecked + }); + + return hostProps; + } + function initWrapperState(element, props) { + { + ReactControlledValuePropTypes.checkPropTypes('input', props); + + if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) { + error('%s contains an input of type %s with both checked and defaultChecked props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the checked prop, or the defaultChecked prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type); + + didWarnCheckedDefaultChecked = true; + } + + if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) { + error('%s contains an input of type %s with both value and defaultValue props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type); + + didWarnValueDefaultValue = true; + } + } + + var node = element; + var defaultValue = props.defaultValue == null ? '' : props.defaultValue; + node._wrapperState = { + initialChecked: props.checked != null ? props.checked : props.defaultChecked, + initialValue: getToStringValue(props.value != null ? props.value : defaultValue), + controlled: isControlled(props) + }; + } + function updateChecked(element, props) { + var node = element; + var checked = props.checked; + + if (checked != null) { + setValueForProperty(node, 'checked', checked, false); + } + } + function updateWrapper(element, props) { + var node = element; + + { + var controlled = isControlled(props); + + if (!node._wrapperState.controlled && controlled && !didWarnUncontrolledToControlled) { + error('A component is changing an uncontrolled input of type %s to be controlled. ' + 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', props.type); + + didWarnUncontrolledToControlled = true; + } + + if (node._wrapperState.controlled && !controlled && !didWarnControlledToUncontrolled) { + error('A component is changing a controlled input of type %s to be uncontrolled. ' + 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', props.type); + + didWarnControlledToUncontrolled = true; + } + } + + updateChecked(element, props); + var value = getToStringValue(props.value); + var type = props.type; + + if (value != null) { + if (type === 'number') { + if (value === 0 && node.value === '' || // We explicitly want to coerce to number here if possible. + // eslint-disable-next-line + node.value != value) { + node.value = toString(value); + } + } else if (node.value !== toString(value)) { + node.value = toString(value); + } + } else if (type === 'submit' || type === 'reset') { + // Submit/reset inputs need the attribute removed completely to avoid + // blank-text buttons. + node.removeAttribute('value'); + return; + } + + { + // When syncing the value attribute, the value comes from a cascade of + // properties: + // 1. The value React property + // 2. The defaultValue React property + // 3. Otherwise there should be no change + if (props.hasOwnProperty('value')) { + setDefaultValue(node, props.type, value); + } else if (props.hasOwnProperty('defaultValue')) { + setDefaultValue(node, props.type, getToStringValue(props.defaultValue)); + } + } + + { + // When syncing the checked attribute, it only changes when it needs + // to be removed, such as transitioning from a checkbox into a text input + if (props.checked == null && props.defaultChecked != null) { + node.defaultChecked = !!props.defaultChecked; + } + } + } + function postMountWrapper(element, props, isHydrating) { + var node = element; // Do not assign value if it is already set. This prevents user text input + // from being lost during SSR hydration. + + if (props.hasOwnProperty('value') || props.hasOwnProperty('defaultValue')) { + var type = props.type; + var isButton = type === 'submit' || type === 'reset'; // Avoid setting value attribute on submit/reset inputs as it overrides the + // default value provided by the browser. See: #12872 + + if (isButton && (props.value === undefined || props.value === null)) { + return; + } + + var initialValue = toString(node._wrapperState.initialValue); // Do not assign value if it is already set. This prevents user text input + // from being lost during SSR hydration. + + if (!isHydrating) { + { + // When syncing the value attribute, the value property should use + // the wrapperState._initialValue property. This uses: + // + // 1. The value React property when present + // 2. The defaultValue React property when present + // 3. An empty string + if (initialValue !== node.value) { + node.value = initialValue; + } + } + } + + { + // Otherwise, the value attribute is synchronized to the property, + // so we assign defaultValue to the same thing as the value property + // assignment step above. + node.defaultValue = initialValue; + } + } // Normally, we'd just do `node.checked = node.checked` upon initial mount, less this bug + // this is needed to work around a chrome bug where setting defaultChecked + // will sometimes influence the value of checked (even after detachment). + // Reference: https://bugs.chromium.org/p/chromium/issues/detail?id=608416 + // We need to temporarily unset name to avoid disrupting radio button groups. + + + var name = node.name; + + if (name !== '') { + node.name = ''; + } + + { + // When syncing the checked attribute, both the checked property and + // attribute are assigned at the same time using defaultChecked. This uses: + // + // 1. The checked React property when present + // 2. The defaultChecked React property when present + // 3. Otherwise, false + node.defaultChecked = !node.defaultChecked; + node.defaultChecked = !!node._wrapperState.initialChecked; + } + + if (name !== '') { + node.name = name; + } + } + function restoreControlledState(element, props) { + var node = element; + updateWrapper(node, props); + updateNamedCousins(node, props); + } + + function updateNamedCousins(rootNode, props) { + var name = props.name; + + if (props.type === 'radio' && name != null) { + var queryRoot = rootNode; + + while (queryRoot.parentNode) { + queryRoot = queryRoot.parentNode; + } // If `rootNode.form` was non-null, then we could try `form.elements`, + // but that sometimes behaves strangely in IE8. We could also try using + // `form.getElementsByName`, but that will only return direct children + // and won't include inputs that use the HTML5 `form=` attribute. Since + // the input might not even be in a form. It might not even be in the + // document. Let's just use the local `querySelectorAll` to ensure we don't + // miss anything. + + + var group = queryRoot.querySelectorAll('input[name=' + JSON.stringify('' + name) + '][type="radio"]'); + + for (var i = 0; i < group.length; i++) { + var otherNode = group[i]; + + if (otherNode === rootNode || otherNode.form !== rootNode.form) { + continue; + } // This will throw if radio buttons rendered by different copies of React + // and the same name are rendered into the same form (same as #1939). + // That's probably okay; we don't support it just as we don't support + // mixing React radio buttons with non-React ones. + + + var otherProps = getFiberCurrentPropsFromNode$1(otherNode); + + if (!otherProps) { + { + throw Error( "ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported." ); + } + } // We need update the tracked value on the named cousin since the value + // was changed but the input saw no event or value set + + + updateValueIfChanged(otherNode); // If this is a controlled radio button group, forcing the input that + // was previously checked to update will cause it to be come re-checked + // as appropriate. + + updateWrapper(otherNode, otherProps); + } + } + } // In Chrome, assigning defaultValue to certain input types triggers input validation. + // For number inputs, the display value loses trailing decimal points. For email inputs, + // Chrome raises "The specified value is not a valid email address". + // + // Here we check to see if the defaultValue has actually changed, avoiding these problems + // when the user is inputting text + // + // https://github.com/facebook/react/issues/7253 + + + function setDefaultValue(node, type, value) { + if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js + type !== 'number' || node.ownerDocument.activeElement !== node) { + if (value == null) { + node.defaultValue = toString(node._wrapperState.initialValue); + } else if (node.defaultValue !== toString(value)) { + node.defaultValue = toString(value); + } + } + } + + var didWarnSelectedSetOnOption = false; + var didWarnInvalidChild = false; + + function flattenChildren(children) { + var content = ''; // Flatten children. We'll warn if they are invalid + // during validateProps() which runs for hydration too. + // Note that this would throw on non-element objects. + // Elements are stringified (which is normally irrelevant + // but matters for ). + + React.Children.forEach(children, function (child) { + if (child == null) { + return; + } + + content += child; // Note: we don't warn about invalid children here. + // Instead, this is done separately below so that + // it happens during the hydration codepath too. + }); + return content; + } + /** + * Implements an