@revisium/admin 0.11.0-alpha.5 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -37,7 +37,7 @@ var C6=Object.defineProperty;var E6=(e,t,r)=>t in e?C6(e,t,{enumerable:!0,config
|
|
37
37
|
`+P[D].replace(" at new "," at ");return s.displayName&&J.includes("<anonymous>")&&(J=J.replace("<anonymous>",s.displayName)),J}while(1<=D&&0<=W);break}}}finally{q=!1,Error.prepareStackTrace=h}return(s=s?s.displayName||s.name:"")?U(s):""}function F(s){switch(s.tag){case 5:return U(s.type);case 16:return U("Lazy");case 13:return U("Suspense");case 19:return U("SuspenseList");case 0:case 2:case 15:return s=$(s.type,!1),s;case 11:return s=$(s.type.render,!1),s;case 1:return s=$(s.type,!0),s;default:return""}}function V(s){if(s==null)return null;if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case T:return"Fragment";case R:return"Portal";case M:return"Profiler";case A:return"StrictMode";case ie:return"Suspense";case N:return"SuspenseList"}if(typeof s=="object")switch(s.$$typeof){case Q:return(s.displayName||"Context")+".Consumer";case B:return(s._context.displayName||"Context")+".Provider";case se:var u=s.render;return s=s.displayName,s||(s=u.displayName||u.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case X:return u=s.displayName||null,u!==null?u:V(s.type)||"Memo";case ce:u=s._payload,s=s._init;try{return V(s(u))}catch{}}return null}function de(s){var u=s.type;switch(s.tag){case 24:return"Cache";case 9:return(u.displayName||"Context")+".Consumer";case 10:return(u._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return s=u.render,s=s.displayName||s.name||"",u.displayName||(s!==""?"ForwardRef("+s+")":"ForwardRef");case 7:return"Fragment";case 5:return u;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return V(u);case 8:return u===A?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof u=="function")return u.displayName||u.name||null;if(typeof u=="string")return u}return null}function pe(s){switch(typeof s){case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function Ee(s){var u=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(u==="checkbox"||u==="radio")}function Me(s){var u=Ee(s)?"checked":"value",h=Object.getOwnPropertyDescriptor(s.constructor.prototype,u),v=""+s[u];if(!s.hasOwnProperty(u)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var P=h.get,I=h.set;return Object.defineProperty(s,u,{configurable:!0,get:function(){return P.call(this)},set:function(D){v=""+D,I.call(this,D)}}),Object.defineProperty(s,u,{enumerable:h.enumerable}),{getValue:function(){return v},setValue:function(D){v=""+D},stopTracking:function(){s._valueTracker=null,delete s[u]}}}}function Y(s){s._valueTracker||(s._valueTracker=Me(s))}function K(s){if(!s)return!1;var u=s._valueTracker;if(!u)return!0;var h=u.getValue(),v="";return s&&(v=Ee(s)?s.checked?"true":"false":s.value),s=v,s!==h?(u.setValue(s),!0):!1}function we(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}function Te(s,u){var h=u.checked;return Z({},u,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:h??s._wrapperState.initialChecked})}function he(s,u){var h=u.defaultValue==null?"":u.defaultValue,v=u.checked!=null?u.checked:u.defaultChecked;h=pe(u.value!=null?u.value:h),s._wrapperState={initialChecked:v,initialValue:h,controlled:u.type==="checkbox"||u.type==="radio"?u.checked!=null:u.value!=null}}function Ce(s,u){u=u.checked,u!=null&&C(s,"checked",u,!1)}function Ge(s,u){Ce(s,u);var h=pe(u.value),v=u.type;if(h!=null)v==="number"?(h===0&&s.value===""||s.value!=h)&&(s.value=""+h):s.value!==""+h&&(s.value=""+h);else if(v==="submit"||v==="reset"){s.removeAttribute("value");return}u.hasOwnProperty("value")?Kt(s,u.type,h):u.hasOwnProperty("defaultValue")&&Kt(s,u.type,pe(u.defaultValue)),u.checked==null&&u.defaultChecked!=null&&(s.defaultChecked=!!u.defaultChecked)}function $t(s,u,h){if(u.hasOwnProperty("value")||u.hasOwnProperty("defaultValue")){var v=u.type;if(!(v!=="submit"&&v!=="reset"||u.value!==void 0&&u.value!==null))return;u=""+s._wrapperState.initialValue,h||u===s.value||(s.value=u),s.defaultValue=u}h=s.name,h!==""&&(s.name=""),s.defaultChecked=!!s._wrapperState.initialChecked,h!==""&&(s.name=h)}function Kt(s,u,h){(u!=="number"||we(s.ownerDocument)!==s)&&(h==null?s.defaultValue=""+s._wrapperState.initialValue:s.defaultValue!==""+h&&(s.defaultValue=""+h))}var It=Array.isArray;function jt(s,u,h,v){if(s=s.options,u){u={};for(var P=0;P<h.length;P++)u["$"+h[P]]=!0;for(h=0;h<s.length;h++)P=u.hasOwnProperty("$"+s[h].value),s[h].selected!==P&&(s[h].selected=P),P&&v&&(s[h].defaultSelected=!0)}else{for(h=""+pe(h),u=null,P=0;P<s.length;P++){if(s[P].value===h){s[P].selected=!0,v&&(s[P].defaultSelected=!0);return}u!==null||s[P].disabled||(u=s[P])}u!==null&&(u.selected=!0)}}function Lt(s,u){if(u.dangerouslySetInnerHTML!=null)throw Error(r(91));return Z({},u,{value:void 0,defaultValue:void 0,children:""+s._wrapperState.initialValue})}function ht(s,u){var h=u.value;if(h==null){if(h=u.children,u=u.defaultValue,h!=null){if(u!=null)throw Error(r(92));if(It(h)){if(1<h.length)throw Error(r(93));h=h[0]}u=h}u==null&&(u=""),h=u}s._wrapperState={initialValue:pe(h)}}function on(s,u){var h=pe(u.value),v=pe(u.defaultValue);h!=null&&(h=""+h,h!==s.value&&(s.value=h),u.defaultValue==null&&s.defaultValue!==h&&(s.defaultValue=h)),v!=null&&(s.defaultValue=""+v)}function mn(s){var u=s.textContent;u===s._wrapperState.initialValue&&u!==""&&u!==null&&(s.value=u)}function Ir(s){switch(s){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 Jr(s,u){return s==null||s==="http://www.w3.org/1999/xhtml"?Ir(u):s==="http://www.w3.org/2000/svg"&&u==="foreignObject"?"http://www.w3.org/1999/xhtml":s}var vn,Nr=function(s){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(u,h,v,P){MSApp.execUnsafeLocalFunction(function(){return s(u,h,v,P)})}:s}(function(s,u){if(s.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in s)s.innerHTML=u;else{for(vn=vn||document.createElement("div"),vn.innerHTML="<svg>"+u.valueOf().toString()+"</svg>",u=vn.firstChild;s.firstChild;)s.removeChild(s.firstChild);for(;u.firstChild;)s.appendChild(u.firstChild)}});function an(s,u){if(u){var h=s.firstChild;if(h&&h===s.lastChild&&h.nodeType===3){h.nodeValue=u;return}}s.textContent=u}var sn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},_a=["Webkit","ms","Moz","O"];Object.keys(sn).forEach(function(s){_a.forEach(function(u){u=u+s.charAt(0).toUpperCase()+s.substring(1),sn[u]=sn[s]})});function Yi(s,u,h){return u==null||typeof u=="boolean"||u===""?"":h||typeof u!="number"||u===0||sn.hasOwnProperty(s)&&sn[s]?(""+u).trim():u+"px"}function xa(s,u){s=s.style;for(var h in u)if(u.hasOwnProperty(h)){var v=h.indexOf("--")===0,P=Yi(h,u[h],v);h==="float"&&(h="cssFloat"),v?s.setProperty(h,P):s[h]=P}}var Xi=Z({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Oi(s,u){if(u){if(Xi[s]&&(u.children!=null||u.dangerouslySetInnerHTML!=null))throw Error(r(137,s));if(u.dangerouslySetInnerHTML!=null){if(u.children!=null)throw Error(r(60));if(typeof u.dangerouslySetInnerHTML!="object"||!("__html"in u.dangerouslySetInnerHTML))throw Error(r(61))}if(u.style!=null&&typeof u.style!="object")throw Error(r(62))}}function gn(s,u){if(s.indexOf("-")===-1)return typeof u.is=="string";switch(s){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Wo=null;function Ko(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var Pa=null,qn=null,vo=null;function pi(s){if(s=ah(s)){if(typeof Pa!="function")throw Error(r(280));var u=s.stateNode;u&&(u=bv(u),Pa(s.stateNode,s.type,u))}}function Ji(s){qn?vo?vo.push(s):vo=[s]:qn=s}function le(){if(qn){var s=qn,u=vo;if(vo=qn=null,pi(s),u)for(s=0;s<u.length;s++)pi(u[s])}}function ye(s,u){return s(u)}function xe(){}var $e=!1;function Be(s,u,h){if($e)return s(u,h);$e=!0;try{return ye(s,u,h)}finally{$e=!1,(qn!==null||vo!==null)&&(xe(),le())}}function pt(s,u){var h=s.stateNode;if(h===null)return null;var v=bv(h);if(v===null)return null;h=v[u];e:switch(u){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(v=!v.disabled)||(s=s.type,v=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!v;break e;default:s=!1}if(s)return null;if(h&&typeof h!="function")throw Error(r(231,u,typeof h));return h}var tt=!1;if(l)try{var Ue={};Object.defineProperty(Ue,"passive",{get:function(){tt=!0}}),window.addEventListener("test",Ue,Ue),window.removeEventListener("test",Ue,Ue)}catch{tt=!1}function xt(s,u,h,v,P,I,D,W,J){var Se=Array.prototype.slice.call(arguments,3);try{u.apply(h,Se)}catch(ke){this.onError(ke)}}var H=!1,L=null,G=!1,te=null,ue={onError:function(s){H=!0,L=s}};function ze(s,u,h,v,P,I,D,W,J){H=!1,L=null,xt.apply(ue,arguments)}function Ye(s,u,h,v,P,I,D,W,J){if(ze.apply(this,arguments),H){if(H){var Se=L;H=!1,L=null}else throw Error(r(198));G||(G=!0,te=Se)}}function ot(s){var u=s,h=s;if(s.alternate)for(;u.return;)u=u.return;else{s=u;do u=s,(u.flags&4098)!==0&&(h=u.return),s=u.return;while(s)}return u.tag===3?h:null}function Wt(s){if(s.tag===13){var u=s.memoizedState;if(u===null&&(s=s.alternate,s!==null&&(u=s.memoizedState)),u!==null)return u.dehydrated}return null}function nr(s){if(ot(s)!==s)throw Error(r(188))}function Pt(s){var u=s.alternate;if(!u){if(u=ot(s),u===null)throw Error(r(188));return u!==s?null:s}for(var h=s,v=u;;){var P=h.return;if(P===null)break;var I=P.alternate;if(I===null){if(v=P.return,v!==null){h=v;continue}break}if(P.child===I.child){for(I=P.child;I;){if(I===h)return nr(P),s;if(I===v)return nr(P),u;I=I.sibling}throw Error(r(188))}if(h.return!==v.return)h=P,v=I;else{for(var D=!1,W=P.child;W;){if(W===h){D=!0,h=P,v=I;break}if(W===v){D=!0,v=P,h=I;break}W=W.sibling}if(!D){for(W=I.child;W;){if(W===h){D=!0,h=I,v=P;break}if(W===v){D=!0,v=I,h=P;break}W=W.sibling}if(!D)throw Error(r(189))}}if(h.alternate!==v)throw Error(r(190))}if(h.tag!==3)throw Error(r(188));return h.stateNode.current===h?s:u}function At(s){return s=Pt(s),s!==null?cr(s):null}function cr(s){if(s.tag===5||s.tag===6)return s;for(s=s.child;s!==null;){var u=cr(s);if(u!==null)return u;s=s.sibling}return null}var ft=t.unstable_scheduleCallback,Gt=t.unstable_cancelCallback,it=t.unstable_shouldYield,Ct=t.unstable_requestPaint,Et=t.unstable_now,ar=t.unstable_getCurrentPriorityLevel,Fr=t.unstable_ImmediatePriority,mi=t.unstable_UserBlockingPriority,ei=t.unstable_NormalPriority,ti=t.unstable_LowPriority,vi=t.unstable_IdlePriority,gi=null,ln=null;function as(s){if(ln&&typeof ln.onCommitFiberRoot=="function")try{ln.onCommitFiberRoot(gi,s,void 0,(s.current.flags&128)===128)}catch{}}var ri=Math.clz32?Math.clz32:Xs,jc=Math.log,Ys=Math.LN2;function Xs(s){return s>>>=0,s===0?32:31-(jc(s)/Ys|0)|0}var Go=64,ss=4194304;function Ca(s){switch(s&-s){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return s&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return s}}function go(s,u){var h=s.pendingLanes;if(h===0)return 0;var v=0,P=s.suspendedLanes,I=s.pingedLanes,D=h&268435455;if(D!==0){var W=D&~P;W!==0?v=Ca(W):(I&=D,I!==0&&(v=Ca(I)))}else D=h&~P,D!==0?v=Ca(D):I!==0&&(v=Ca(I));if(v===0)return 0;if(u!==0&&u!==v&&(u&P)===0&&(P=v&-v,I=u&-u,P>=I||P===16&&(I&4194240)!==0))return u;if((v&4)!==0&&(v|=h&16),u=s.entangledLanes,u!==0)for(s=s.entanglements,u&=v;0<u;)h=31-ri(u),P=1<<h,v|=s[h],u&=~P;return v}function $c(s,u){switch(s){case 1:case 2:case 4:return u+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return u+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function zf(s,u){for(var h=s.suspendedLanes,v=s.pingedLanes,P=s.expirationTimes,I=s.pendingLanes;0<I;){var D=31-ri(I),W=1<<D,J=P[D];J===-1?((W&h)===0||(W&v)!==0)&&(P[D]=$c(W,u)):J<=u&&(s.expiredLanes|=W),I&=~W}}function qf(s){return s=s.pendingLanes&-1073741825,s!==0?s:s&1073741824?1073741824:0}function ov(){var s=Go;return Go<<=1,(Go&4194240)===0&&(Go=64),s}function Ac(s){for(var u=[],h=0;31>h;h++)u.push(s);return u}function du(s,u,h){s.pendingLanes|=u,u!==536870912&&(s.suspendedLanes=0,s.pingedLanes=0),s=s.eventTimes,u=31-ri(u),s[u]=h}function Pw(s,u){var h=s.pendingLanes&~u;s.pendingLanes=u,s.suspendedLanes=0,s.pingedLanes=0,s.expiredLanes&=u,s.mutableReadLanes&=u,s.entangledLanes&=u,u=s.entanglements;var v=s.eventTimes;for(s=s.expirationTimes;0<h;){var P=31-ri(h),I=1<<P;u[P]=0,v[P]=-1,s[P]=-1,h&=~I}}function Uf(s,u){var h=s.entangledLanes|=u;for(s=s.entanglements;h;){var v=31-ri(h),P=1<<v;P&u|s[v]&u&&(s[v]|=u),h&=~P}}var sr=0;function av(s){return s&=-s,1<s?4<s?(s&268435455)!==0?16:536870912:4:1}var sv,Hf,Dc,lv,uv,Wf=!1,ls=[],yo=null,bo=null,wo=null,fu=new Map,Js=new Map,So=[],cv="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Ea(s,u){switch(s){case"focusin":case"focusout":yo=null;break;case"dragenter":case"dragleave":bo=null;break;case"mouseover":case"mouseout":wo=null;break;case"pointerover":case"pointerout":fu.delete(u.pointerId);break;case"gotpointercapture":case"lostpointercapture":Js.delete(u.pointerId)}}function Qo(s,u,h,v,P,I){return s===null||s.nativeEvent!==I?(s={blockedOn:u,domEventName:h,eventSystemFlags:v,nativeEvent:I,targetContainers:[P]},u!==null&&(u=ah(u),u!==null&&Hf(u)),s):(s.eventSystemFlags|=v,u=s.targetContainers,P!==null&&u.indexOf(P)===-1&&u.push(P),s)}function Cw(s,u,h,v,P){switch(u){case"focusin":return yo=Qo(yo,s,u,h,v,P),!0;case"dragenter":return bo=Qo(bo,s,u,h,v,P),!0;case"mouseover":return wo=Qo(wo,s,u,h,v,P),!0;case"pointerover":var I=P.pointerId;return fu.set(I,Qo(fu.get(I)||null,s,u,h,v,P)),!0;case"gotpointercapture":return I=P.pointerId,Js.set(I,Qo(Js.get(I)||null,s,u,h,v,P)),!0}return!1}function Kf(s){var u=pu(s.target);if(u!==null){var h=ot(u);if(h!==null){if(u=h.tag,u===13){if(u=Wt(h),u!==null){s.blockedOn=u,uv(s.priority,function(){Dc(h)});return}}else if(u===3&&h.stateNode.current.memoizedState.isDehydrated){s.blockedOn=h.tag===3?h.stateNode.containerInfo:null;return}}}s.blockedOn=null}function Mc(s){if(s.blockedOn!==null)return!1;for(var u=s.targetContainers;0<u.length;){var h=dr(s.domEventName,s.eventSystemFlags,u[0],s.nativeEvent);if(h===null){h=s.nativeEvent;var v=new h.constructor(h.type,h);Wo=v,h.target.dispatchEvent(v),Wo=null}else return u=ah(h),u!==null&&Hf(u),s.blockedOn=h,!1;u.shift()}return!0}function Gf(s,u,h){Mc(s)&&h.delete(u)}function Ew(){Wf=!1,yo!==null&&Mc(yo)&&(yo=null),bo!==null&&Mc(bo)&&(bo=null),wo!==null&&Mc(wo)&&(wo=null),fu.forEach(Gf),Js.forEach(Gf)}function hu(s,u){s.blockedOn===u&&(s.blockedOn=null,Wf||(Wf=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Ew)))}function Zs(s){function u(P){return hu(P,s)}if(0<ls.length){hu(ls[0],s);for(var h=1;h<ls.length;h++){var v=ls[h];v.blockedOn===s&&(v.blockedOn=null)}}for(yo!==null&&hu(yo,s),bo!==null&&hu(bo,s),wo!==null&&hu(wo,s),fu.forEach(u),Js.forEach(u),h=0;h<So.length;h++)v=So[h],v.blockedOn===s&&(v.blockedOn=null);for(;0<So.length&&(h=So[0],h.blockedOn===null);)Kf(h),h.blockedOn===null&&So.shift()}var el=k.ReactCurrentBatchConfig,z=!0;function oe(s,u,h,v){var P=sr,I=el.transition;el.transition=null;try{sr=1,We(s,u,h,v)}finally{sr=P,el.transition=I}}function _e(s,u,h,v){var P=sr,I=el.transition;el.transition=null;try{sr=4,We(s,u,h,v)}finally{sr=P,el.transition=I}}function We(s,u,h,v){if(z){var P=dr(s,u,h,v);if(P===null)zw(s,u,v,Bt,h),Ea(s,v);else if(Cw(P,s,u,h,v))v.stopPropagation();else if(Ea(s,v),u&4&&-1<cv.indexOf(s)){for(;P!==null;){var I=ah(P);if(I!==null&&sv(I),I=dr(s,u,h,v),I===null&&zw(s,u,v,Bt,h),I===P)break;P=I}P!==null&&v.stopPropagation()}else zw(s,u,v,null,h)}}var Bt=null;function dr(s,u,h,v){if(Bt=null,s=Ko(v),s=pu(s),s!==null)if(u=ot(s),u===null)s=null;else if(h=u.tag,h===13){if(s=Wt(u),s!==null)return s;s=null}else if(h===3){if(u.stateNode.current.memoizedState.isDehydrated)return u.tag===3?u.stateNode.containerInfo:null;s=null}else u!==s&&(s=null);return Bt=s,null}function kr(s){switch(s){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(ar()){case Fr:return 1;case mi:return 4;case ei:case ti:return 16;case vi:return 536870912;default:return 16}default:return 16}}var Mt=null,Tr=null,ni=null;function ii(){if(ni)return ni;var s,u=Tr,h=u.length,v,P="value"in Mt?Mt.value:Mt.textContent,I=P.length;for(s=0;s<h&&u[s]===P[s];s++);var D=h-s;for(v=1;v<=D&&u[h-v]===P[I-v];v++);return ni=P.slice(s,1<v?1-v:void 0)}function Ta(s){var u=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&u===13&&(s=13)):s=u,s===10&&(s=13),32<=s||s===13?s:0}function tl(){return!0}function Nc(){return!1}function oi(s){function u(h,v,P,I,D){this._reactName=h,this._targetInst=P,this.type=v,this.nativeEvent=I,this.target=D,this.currentTarget=null;for(var W in s)s.hasOwnProperty(W)&&(h=s[W],this[W]=h?h(I):I[W]);return this.isDefaultPrevented=(I.defaultPrevented!=null?I.defaultPrevented:I.returnValue===!1)?tl:Nc,this.isPropagationStopped=Nc,this}return Z(u.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=tl)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=tl)},persist:function(){},isPersistent:tl}),u}var Fc={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Tw=oi(Fc),Qf=Z({},Fc,{view:0,detail:0}),J3=oi(Qf),Ow,Rw,Yf,dv=Z({},Qf,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:kw,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==Yf&&(Yf&&s.type==="mousemove"?(Ow=s.screenX-Yf.screenX,Rw=s.screenY-Yf.screenY):Rw=Ow=0,Yf=s),Ow)},movementY:function(s){return"movementY"in s?s.movementY:Rw}}),jT=oi(dv),Z3=Z({},dv,{dataTransfer:0}),ez=oi(Z3),tz=Z({},Qf,{relatedTarget:0}),Iw=oi(tz),rz=Z({},Fc,{animationName:0,elapsedTime:0,pseudoElement:0}),nz=oi(rz),iz=Z({},Fc,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),oz=oi(iz),az=Z({},Fc,{data:0}),$T=oi(az),sz={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},lz={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},uz={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function cz(s){var u=this.nativeEvent;return u.getModifierState?u.getModifierState(s):(s=uz[s])?!!u[s]:!1}function kw(){return cz}var dz=Z({},Qf,{key:function(s){if(s.key){var u=sz[s.key]||s.key;if(u!=="Unidentified")return u}return s.type==="keypress"?(s=Ta(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?lz[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:kw,charCode:function(s){return s.type==="keypress"?Ta(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?Ta(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),fz=oi(dz),hz=Z({},dv,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),AT=oi(hz),pz=Z({},Qf,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:kw}),mz=oi(pz),vz=Z({},Fc,{propertyName:0,elapsedTime:0,pseudoElement:0}),gz=oi(vz),yz=Z({},dv,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),bz=oi(yz),wz=[9,13,27,32],jw=l&&"CompositionEvent"in window,Xf=null;l&&"documentMode"in document&&(Xf=document.documentMode);var Sz=l&&"TextEvent"in window&&!Xf,DT=l&&(!jw||Xf&&8<Xf&&11>=Xf),MT=" ",NT=!1;function FT(s,u){switch(s){case"keyup":return wz.indexOf(u.keyCode)!==-1;case"keydown":return u.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function LT(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Lc=!1;function _z(s,u){switch(s){case"compositionend":return LT(u);case"keypress":return u.which!==32?null:(NT=!0,MT);case"textInput":return s=u.data,s===MT&&NT?null:s;default:return null}}function xz(s,u){if(Lc)return s==="compositionend"||!jw&&FT(s,u)?(s=ii(),ni=Tr=Mt=null,Lc=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(u.ctrlKey||u.altKey||u.metaKey)||u.ctrlKey&&u.altKey){if(u.char&&1<u.char.length)return u.char;if(u.which)return String.fromCharCode(u.which)}return null;case"compositionend":return DT&&u.locale!=="ko"?null:u.data;default:return null}}var Pz={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function BT(s){var u=s&&s.nodeName&&s.nodeName.toLowerCase();return u==="input"?!!Pz[s.type]:u==="textarea"}function VT(s,u,h,v){Ji(v),u=vv(u,"onChange"),0<u.length&&(h=new Tw("onChange","change",null,h,v),s.push({event:h,listeners:u}))}var Jf=null,Zf=null;function Cz(s){oO(s,0)}function fv(s){var u=Uc(s);if(K(u))return s}function Ez(s,u){if(s==="change")return u}var zT=!1;if(l){var $w;if(l){var Aw="oninput"in document;if(!Aw){var qT=document.createElement("div");qT.setAttribute("oninput","return;"),Aw=typeof qT.oninput=="function"}$w=Aw}else $w=!1;zT=$w&&(!document.documentMode||9<document.documentMode)}function UT(){Jf&&(Jf.detachEvent("onpropertychange",HT),Zf=Jf=null)}function HT(s){if(s.propertyName==="value"&&fv(Zf)){var u=[];VT(u,Zf,s,Ko(s)),Be(Cz,u)}}function Tz(s,u,h){s==="focusin"?(UT(),Jf=u,Zf=h,Jf.attachEvent("onpropertychange",HT)):s==="focusout"&&UT()}function Oz(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return fv(Zf)}function Rz(s,u){if(s==="click")return fv(u)}function Iz(s,u){if(s==="input"||s==="change")return fv(u)}function kz(s,u){return s===u&&(s!==0||1/s===1/u)||s!==s&&u!==u}var Yo=typeof Object.is=="function"?Object.is:kz;function eh(s,u){if(Yo(s,u))return!0;if(typeof s!="object"||s===null||typeof u!="object"||u===null)return!1;var h=Object.keys(s),v=Object.keys(u);if(h.length!==v.length)return!1;for(v=0;v<h.length;v++){var P=h[v];if(!c.call(u,P)||!Yo(s[P],u[P]))return!1}return!0}function WT(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function KT(s,u){var h=WT(s);s=0;for(var v;h;){if(h.nodeType===3){if(v=s+h.textContent.length,s<=u&&v>=u)return{node:h,offset:u-s};s=v}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=WT(h)}}function GT(s,u){return s&&u?s===u?!0:s&&s.nodeType===3?!1:u&&u.nodeType===3?GT(s,u.parentNode):"contains"in s?s.contains(u):s.compareDocumentPosition?!!(s.compareDocumentPosition(u)&16):!1:!1}function QT(){for(var s=window,u=we();u instanceof s.HTMLIFrameElement;){try{var h=typeof u.contentWindow.location.href=="string"}catch{h=!1}if(h)s=u.contentWindow;else break;u=we(s.document)}return u}function Dw(s){var u=s&&s.nodeName&&s.nodeName.toLowerCase();return u&&(u==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||u==="textarea"||s.contentEditable==="true")}function jz(s){var u=QT(),h=s.focusedElem,v=s.selectionRange;if(u!==h&&h&&h.ownerDocument&>(h.ownerDocument.documentElement,h)){if(v!==null&&Dw(h)){if(u=v.start,s=v.end,s===void 0&&(s=u),"selectionStart"in h)h.selectionStart=u,h.selectionEnd=Math.min(s,h.value.length);else if(s=(u=h.ownerDocument||document)&&u.defaultView||window,s.getSelection){s=s.getSelection();var P=h.textContent.length,I=Math.min(v.start,P);v=v.end===void 0?I:Math.min(v.end,P),!s.extend&&I>v&&(P=v,v=I,I=P),P=KT(h,I);var D=KT(h,v);P&&D&&(s.rangeCount!==1||s.anchorNode!==P.node||s.anchorOffset!==P.offset||s.focusNode!==D.node||s.focusOffset!==D.offset)&&(u=u.createRange(),u.setStart(P.node,P.offset),s.removeAllRanges(),I>v?(s.addRange(u),s.extend(D.node,D.offset)):(u.setEnd(D.node,D.offset),s.addRange(u)))}}for(u=[],s=h;s=s.parentNode;)s.nodeType===1&&u.push({element:s,left:s.scrollLeft,top:s.scrollTop});for(typeof h.focus=="function"&&h.focus(),h=0;h<u.length;h++)s=u[h],s.element.scrollLeft=s.left,s.element.scrollTop=s.top}}var $z=l&&"documentMode"in document&&11>=document.documentMode,Bc=null,Mw=null,th=null,Nw=!1;function YT(s,u,h){var v=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;Nw||Bc==null||Bc!==we(v)||(v=Bc,"selectionStart"in v&&Dw(v)?v={start:v.selectionStart,end:v.selectionEnd}:(v=(v.ownerDocument&&v.ownerDocument.defaultView||window).getSelection(),v={anchorNode:v.anchorNode,anchorOffset:v.anchorOffset,focusNode:v.focusNode,focusOffset:v.focusOffset}),th&&eh(th,v)||(th=v,v=vv(Mw,"onSelect"),0<v.length&&(u=new Tw("onSelect","select",null,u,h),s.push({event:u,listeners:v}),u.target=Bc)))}function hv(s,u){var h={};return h[s.toLowerCase()]=u.toLowerCase(),h["Webkit"+s]="webkit"+u,h["Moz"+s]="moz"+u,h}var Vc={animationend:hv("Animation","AnimationEnd"),animationiteration:hv("Animation","AnimationIteration"),animationstart:hv("Animation","AnimationStart"),transitionend:hv("Transition","TransitionEnd")},Fw={},XT={};l&&(XT=document.createElement("div").style,"AnimationEvent"in window||(delete Vc.animationend.animation,delete Vc.animationiteration.animation,delete Vc.animationstart.animation),"TransitionEvent"in window||delete Vc.transitionend.transition);function pv(s){if(Fw[s])return Fw[s];if(!Vc[s])return s;var u=Vc[s],h;for(h in u)if(u.hasOwnProperty(h)&&h in XT)return Fw[s]=u[h];return s}var JT=pv("animationend"),ZT=pv("animationiteration"),eO=pv("animationstart"),tO=pv("transitionend"),rO=new Map,nO="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function rl(s,u){rO.set(s,u),o(u,[s])}for(var Lw=0;Lw<nO.length;Lw++){var Bw=nO[Lw],Az=Bw.toLowerCase(),Dz=Bw[0].toUpperCase()+Bw.slice(1);rl(Az,"on"+Dz)}rl(JT,"onAnimationEnd"),rl(ZT,"onAnimationIteration"),rl(eO,"onAnimationStart"),rl("dblclick","onDoubleClick"),rl("focusin","onFocus"),rl("focusout","onBlur"),rl(tO,"onTransitionEnd"),a("onMouseEnter",["mouseout","mouseover"]),a("onMouseLeave",["mouseout","mouseover"]),a("onPointerEnter",["pointerout","pointerover"]),a("onPointerLeave",["pointerout","pointerover"]),o("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),o("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),o("onBeforeInput",["compositionend","keypress","textInput","paste"]),o("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var rh="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Mz=new Set("cancel close invalid load scroll toggle".split(" ").concat(rh));function iO(s,u,h){var v=s.type||"unknown-event";s.currentTarget=h,Ye(v,u,void 0,s),s.currentTarget=null}function oO(s,u){u=(u&4)!==0;for(var h=0;h<s.length;h++){var v=s[h],P=v.event;v=v.listeners;e:{var I=void 0;if(u)for(var D=v.length-1;0<=D;D--){var W=v[D],J=W.instance,Se=W.currentTarget;if(W=W.listener,J!==I&&P.isPropagationStopped())break e;iO(P,W,Se),I=J}else for(D=0;D<v.length;D++){if(W=v[D],J=W.instance,Se=W.currentTarget,W=W.listener,J!==I&&P.isPropagationStopped())break e;iO(P,W,Se),I=J}}}if(G)throw s=te,G=!1,te=null,s}function Lr(s,u){var h=u[Gw];h===void 0&&(h=u[Gw]=new Set);var v=s+"__bubble";h.has(v)||(aO(u,s,2,!1),h.add(v))}function Vw(s,u,h){var v=0;u&&(v|=4),aO(h,s,v,u)}var mv="_reactListening"+Math.random().toString(36).slice(2);function nh(s){if(!s[mv]){s[mv]=!0,n.forEach(function(h){h!=="selectionchange"&&(Mz.has(h)||Vw(h,!1,s),Vw(h,!0,s))});var u=s.nodeType===9?s:s.ownerDocument;u===null||u[mv]||(u[mv]=!0,Vw("selectionchange",!1,u))}}function aO(s,u,h,v){switch(kr(u)){case 1:var P=oe;break;case 4:P=_e;break;default:P=We}h=P.bind(null,u,h,s),P=void 0,!tt||u!=="touchstart"&&u!=="touchmove"&&u!=="wheel"||(P=!0),v?P!==void 0?s.addEventListener(u,h,{capture:!0,passive:P}):s.addEventListener(u,h,!0):P!==void 0?s.addEventListener(u,h,{passive:P}):s.addEventListener(u,h,!1)}function zw(s,u,h,v,P){var I=v;if((u&1)===0&&(u&2)===0&&v!==null)e:for(;;){if(v===null)return;var D=v.tag;if(D===3||D===4){var W=v.stateNode.containerInfo;if(W===P||W.nodeType===8&&W.parentNode===P)break;if(D===4)for(D=v.return;D!==null;){var J=D.tag;if((J===3||J===4)&&(J=D.stateNode.containerInfo,J===P||J.nodeType===8&&J.parentNode===P))return;D=D.return}for(;W!==null;){if(D=pu(W),D===null)return;if(J=D.tag,J===5||J===6){v=I=D;continue e}W=W.parentNode}}v=v.return}Be(function(){var Se=I,ke=Ko(h),Ae=[];e:{var Ie=rO.get(s);if(Ie!==void 0){var He=Tw,Xe=s;switch(s){case"keypress":if(Ta(h)===0)break e;case"keydown":case"keyup":He=fz;break;case"focusin":Xe="focus",He=Iw;break;case"focusout":Xe="blur",He=Iw;break;case"beforeblur":case"afterblur":He=Iw;break;case"click":if(h.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":He=jT;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":He=ez;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":He=mz;break;case JT:case ZT:case eO:He=nz;break;case tO:He=gz;break;case"scroll":He=J3;break;case"wheel":He=bz;break;case"copy":case"cut":case"paste":He=oz;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":He=AT}var et=(u&4)!==0,yn=!et&&s==="scroll",fe=et?Ie!==null?Ie+"Capture":null:Ie;et=[];for(var re=Se,me;re!==null;){me=re;var Fe=me.stateNode;if(me.tag===5&&Fe!==null&&(me=Fe,fe!==null&&(Fe=pt(re,fe),Fe!=null&&et.push(ih(re,Fe,me)))),yn)break;re=re.return}0<et.length&&(Ie=new He(Ie,Xe,null,h,ke),Ae.push({event:Ie,listeners:et}))}}if((u&7)===0){e:{if(Ie=s==="mouseover"||s==="pointerover",He=s==="mouseout"||s==="pointerout",Ie&&h!==Wo&&(Xe=h.relatedTarget||h.fromElement)&&(pu(Xe)||Xe[us]))break e;if((He||Ie)&&(Ie=ke.window===ke?ke:(Ie=ke.ownerDocument)?Ie.defaultView||Ie.parentWindow:window,He?(Xe=h.relatedTarget||h.toElement,He=Se,Xe=Xe?pu(Xe):null,Xe!==null&&(yn=ot(Xe),Xe!==yn||Xe.tag!==5&&Xe.tag!==6)&&(Xe=null)):(He=null,Xe=Se),He!==Xe)){if(et=jT,Fe="onMouseLeave",fe="onMouseEnter",re="mouse",(s==="pointerout"||s==="pointerover")&&(et=AT,Fe="onPointerLeave",fe="onPointerEnter",re="pointer"),yn=He==null?Ie:Uc(He),me=Xe==null?Ie:Uc(Xe),Ie=new et(Fe,re+"leave",He,h,ke),Ie.target=yn,Ie.relatedTarget=me,Fe=null,pu(ke)===Se&&(et=new et(fe,re+"enter",Xe,h,ke),et.target=me,et.relatedTarget=yn,Fe=et),yn=Fe,He&&Xe)t:{for(et=He,fe=Xe,re=0,me=et;me;me=zc(me))re++;for(me=0,Fe=fe;Fe;Fe=zc(Fe))me++;for(;0<re-me;)et=zc(et),re--;for(;0<me-re;)fe=zc(fe),me--;for(;re--;){if(et===fe||fe!==null&&et===fe.alternate)break t;et=zc(et),fe=zc(fe)}et=null}else et=null;He!==null&&sO(Ae,Ie,He,et,!1),Xe!==null&&yn!==null&&sO(Ae,yn,Xe,et,!0)}}e:{if(Ie=Se?Uc(Se):window,He=Ie.nodeName&&Ie.nodeName.toLowerCase(),He==="select"||He==="input"&&Ie.type==="file")var nt=Ez;else if(BT(Ie))if(zT)nt=Iz;else{nt=Oz;var mt=Tz}else(He=Ie.nodeName)&&He.toLowerCase()==="input"&&(Ie.type==="checkbox"||Ie.type==="radio")&&(nt=Rz);if(nt&&(nt=nt(s,Se))){VT(Ae,nt,h,ke);break e}mt&&mt(s,Ie,Se),s==="focusout"&&(mt=Ie._wrapperState)&&mt.controlled&&Ie.type==="number"&&Kt(Ie,"number",Ie.value)}switch(mt=Se?Uc(Se):window,s){case"focusin":(BT(mt)||mt.contentEditable==="true")&&(Bc=mt,Mw=Se,th=null);break;case"focusout":th=Mw=Bc=null;break;case"mousedown":Nw=!0;break;case"contextmenu":case"mouseup":case"dragend":Nw=!1,YT(Ae,h,ke);break;case"selectionchange":if($z)break;case"keydown":case"keyup":YT(Ae,h,ke)}var vt;if(jw)e:{switch(s){case"compositionstart":var Tt="onCompositionStart";break e;case"compositionend":Tt="onCompositionEnd";break e;case"compositionupdate":Tt="onCompositionUpdate";break e}Tt=void 0}else Lc?FT(s,h)&&(Tt="onCompositionEnd"):s==="keydown"&&h.keyCode===229&&(Tt="onCompositionStart");Tt&&(DT&&h.locale!=="ko"&&(Lc||Tt!=="onCompositionStart"?Tt==="onCompositionEnd"&&Lc&&(vt=ii()):(Mt=ke,Tr="value"in Mt?Mt.value:Mt.textContent,Lc=!0)),mt=vv(Se,Tt),0<mt.length&&(Tt=new $T(Tt,s,null,h,ke),Ae.push({event:Tt,listeners:mt}),vt?Tt.data=vt:(vt=LT(h),vt!==null&&(Tt.data=vt)))),(vt=Sz?_z(s,h):xz(s,h))&&(Se=vv(Se,"onBeforeInput"),0<Se.length&&(ke=new $T("onBeforeInput","beforeinput",null,h,ke),Ae.push({event:ke,listeners:Se}),ke.data=vt))}oO(Ae,u)})}function ih(s,u,h){return{instance:s,listener:u,currentTarget:h}}function vv(s,u){for(var h=u+"Capture",v=[];s!==null;){var P=s,I=P.stateNode;P.tag===5&&I!==null&&(P=I,I=pt(s,h),I!=null&&v.unshift(ih(s,I,P)),I=pt(s,u),I!=null&&v.push(ih(s,I,P))),s=s.return}return v}function zc(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5);return s||null}function sO(s,u,h,v,P){for(var I=u._reactName,D=[];h!==null&&h!==v;){var W=h,J=W.alternate,Se=W.stateNode;if(J!==null&&J===v)break;W.tag===5&&Se!==null&&(W=Se,P?(J=pt(h,I),J!=null&&D.unshift(ih(h,J,W))):P||(J=pt(h,I),J!=null&&D.push(ih(h,J,W)))),h=h.return}D.length!==0&&s.push({event:u,listeners:D})}var Nz=/\r\n?/g,Fz=/\u0000|\uFFFD/g;function lO(s){return(typeof s=="string"?s:""+s).replace(Nz,`
|
38
38
|
`).replace(Fz,"")}function gv(s,u,h){if(u=lO(u),lO(s)!==u&&h)throw Error(r(425))}function yv(){}var qw=null,Uw=null;function Hw(s,u){return s==="textarea"||s==="noscript"||typeof u.children=="string"||typeof u.children=="number"||typeof u.dangerouslySetInnerHTML=="object"&&u.dangerouslySetInnerHTML!==null&&u.dangerouslySetInnerHTML.__html!=null}var Ww=typeof setTimeout=="function"?setTimeout:void 0,Lz=typeof clearTimeout=="function"?clearTimeout:void 0,uO=typeof Promise=="function"?Promise:void 0,Bz=typeof queueMicrotask=="function"?queueMicrotask:typeof uO<"u"?function(s){return uO.resolve(null).then(s).catch(Vz)}:Ww;function Vz(s){setTimeout(function(){throw s})}function Kw(s,u){var h=u,v=0;do{var P=h.nextSibling;if(s.removeChild(h),P&&P.nodeType===8)if(h=P.data,h==="/$"){if(v===0){s.removeChild(P),Zs(u);return}v--}else h!=="$"&&h!=="$?"&&h!=="$!"||v++;h=P}while(h);Zs(u)}function nl(s){for(;s!=null;s=s.nextSibling){var u=s.nodeType;if(u===1||u===3)break;if(u===8){if(u=s.data,u==="$"||u==="$!"||u==="$?")break;if(u==="/$")return null}}return s}function cO(s){s=s.previousSibling;for(var u=0;s;){if(s.nodeType===8){var h=s.data;if(h==="$"||h==="$!"||h==="$?"){if(u===0)return s;u--}else h==="/$"&&u++}s=s.previousSibling}return null}var qc=Math.random().toString(36).slice(2),Oa="__reactFiber$"+qc,oh="__reactProps$"+qc,us="__reactContainer$"+qc,Gw="__reactEvents$"+qc,zz="__reactListeners$"+qc,qz="__reactHandles$"+qc;function pu(s){var u=s[Oa];if(u)return u;for(var h=s.parentNode;h;){if(u=h[us]||h[Oa]){if(h=u.alternate,u.child!==null||h!==null&&h.child!==null)for(s=cO(s);s!==null;){if(h=s[Oa])return h;s=cO(s)}return u}s=h,h=s.parentNode}return null}function ah(s){return s=s[Oa]||s[us],!s||s.tag!==5&&s.tag!==6&&s.tag!==13&&s.tag!==3?null:s}function Uc(s){if(s.tag===5||s.tag===6)return s.stateNode;throw Error(r(33))}function bv(s){return s[oh]||null}var Qw=[],Hc=-1;function il(s){return{current:s}}function Br(s){0>Hc||(s.current=Qw[Hc],Qw[Hc]=null,Hc--)}function $r(s,u){Hc++,Qw[Hc]=s.current,s.current=u}var ol={},ai=il(ol),Ri=il(!1),mu=ol;function Wc(s,u){var h=s.type.contextTypes;if(!h)return ol;var v=s.stateNode;if(v&&v.__reactInternalMemoizedUnmaskedChildContext===u)return v.__reactInternalMemoizedMaskedChildContext;var P={},I;for(I in h)P[I]=u[I];return v&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=u,s.__reactInternalMemoizedMaskedChildContext=P),P}function Ii(s){return s=s.childContextTypes,s!=null}function wv(){Br(Ri),Br(ai)}function dO(s,u,h){if(ai.current!==ol)throw Error(r(168));$r(ai,u),$r(Ri,h)}function fO(s,u,h){var v=s.stateNode;if(u=u.childContextTypes,typeof v.getChildContext!="function")return h;v=v.getChildContext();for(var P in v)if(!(P in u))throw Error(r(108,de(s)||"Unknown",P));return Z({},h,v)}function Sv(s){return s=(s=s.stateNode)&&s.__reactInternalMemoizedMergedChildContext||ol,mu=ai.current,$r(ai,s),$r(Ri,Ri.current),!0}function hO(s,u,h){var v=s.stateNode;if(!v)throw Error(r(169));h?(s=fO(s,u,mu),v.__reactInternalMemoizedMergedChildContext=s,Br(Ri),Br(ai),$r(ai,s)):Br(Ri),$r(Ri,h)}var cs=null,_v=!1,Yw=!1;function pO(s){cs===null?cs=[s]:cs.push(s)}function Uz(s){_v=!0,pO(s)}function al(){if(!Yw&&cs!==null){Yw=!0;var s=0,u=sr;try{var h=cs;for(sr=1;s<h.length;s++){var v=h[s];do v=v(!0);while(v!==null)}cs=null,_v=!1}catch(P){throw cs!==null&&(cs=cs.slice(s+1)),ft(Fr,al),P}finally{sr=u,Yw=!1}}return null}var Kc=[],Gc=0,xv=null,Pv=0,_o=[],xo=0,vu=null,ds=1,fs="";function gu(s,u){Kc[Gc++]=Pv,Kc[Gc++]=xv,xv=s,Pv=u}function mO(s,u,h){_o[xo++]=ds,_o[xo++]=fs,_o[xo++]=vu,vu=s;var v=ds;s=fs;var P=32-ri(v)-1;v&=~(1<<P),h+=1;var I=32-ri(u)+P;if(30<I){var D=P-P%5;I=(v&(1<<D)-1).toString(32),v>>=D,P-=D,ds=1<<32-ri(u)+P|h<<P|v,fs=I+s}else ds=1<<I|h<<P|v,fs=s}function Xw(s){s.return!==null&&(gu(s,1),mO(s,1,0))}function Jw(s){for(;s===xv;)xv=Kc[--Gc],Kc[Gc]=null,Pv=Kc[--Gc],Kc[Gc]=null;for(;s===vu;)vu=_o[--xo],_o[xo]=null,fs=_o[--xo],_o[xo]=null,ds=_o[--xo],_o[xo]=null}var Zi=null,eo=null,Gr=!1,Xo=null;function vO(s,u){var h=To(5,null,null,0);h.elementType="DELETED",h.stateNode=u,h.return=s,u=s.deletions,u===null?(s.deletions=[h],s.flags|=16):u.push(h)}function gO(s,u){switch(s.tag){case 5:var h=s.type;return u=u.nodeType!==1||h.toLowerCase()!==u.nodeName.toLowerCase()?null:u,u!==null?(s.stateNode=u,Zi=s,eo=nl(u.firstChild),!0):!1;case 6:return u=s.pendingProps===""||u.nodeType!==3?null:u,u!==null?(s.stateNode=u,Zi=s,eo=null,!0):!1;case 13:return u=u.nodeType!==8?null:u,u!==null?(h=vu!==null?{id:ds,overflow:fs}:null,s.memoizedState={dehydrated:u,treeContext:h,retryLane:1073741824},h=To(18,null,null,0),h.stateNode=u,h.return=s,s.child=h,Zi=s,eo=null,!0):!1;default:return!1}}function Zw(s){return(s.mode&1)!==0&&(s.flags&128)===0}function eS(s){if(Gr){var u=eo;if(u){var h=u;if(!gO(s,u)){if(Zw(s))throw Error(r(418));u=nl(h.nextSibling);var v=Zi;u&&gO(s,u)?vO(v,h):(s.flags=s.flags&-4097|2,Gr=!1,Zi=s)}}else{if(Zw(s))throw Error(r(418));s.flags=s.flags&-4097|2,Gr=!1,Zi=s}}}function yO(s){for(s=s.return;s!==null&&s.tag!==5&&s.tag!==3&&s.tag!==13;)s=s.return;Zi=s}function Cv(s){if(s!==Zi)return!1;if(!Gr)return yO(s),Gr=!0,!1;var u;if((u=s.tag!==3)&&!(u=s.tag!==5)&&(u=s.type,u=u!=="head"&&u!=="body"&&!Hw(s.type,s.memoizedProps)),u&&(u=eo)){if(Zw(s))throw bO(),Error(r(418));for(;u;)vO(s,u),u=nl(u.nextSibling)}if(yO(s),s.tag===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));e:{for(s=s.nextSibling,u=0;s;){if(s.nodeType===8){var h=s.data;if(h==="/$"){if(u===0){eo=nl(s.nextSibling);break e}u--}else h!=="$"&&h!=="$!"&&h!=="$?"||u++}s=s.nextSibling}eo=null}}else eo=Zi?nl(s.stateNode.nextSibling):null;return!0}function bO(){for(var s=eo;s;)s=nl(s.nextSibling)}function Qc(){eo=Zi=null,Gr=!1}function tS(s){Xo===null?Xo=[s]:Xo.push(s)}var Hz=k.ReactCurrentBatchConfig;function sh(s,u,h){if(s=h.ref,s!==null&&typeof s!="function"&&typeof s!="object"){if(h._owner){if(h=h._owner,h){if(h.tag!==1)throw Error(r(309));var v=h.stateNode}if(!v)throw Error(r(147,s));var P=v,I=""+s;return u!==null&&u.ref!==null&&typeof u.ref=="function"&&u.ref._stringRef===I?u.ref:(u=function(D){var W=P.refs;D===null?delete W[I]:W[I]=D},u._stringRef=I,u)}if(typeof s!="string")throw Error(r(284));if(!h._owner)throw Error(r(290,s))}return s}function Ev(s,u){throw s=Object.prototype.toString.call(u),Error(r(31,s==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":s))}function wO(s){var u=s._init;return u(s._payload)}function SO(s){function u(fe,re){if(s){var me=fe.deletions;me===null?(fe.deletions=[re],fe.flags|=16):me.push(re)}}function h(fe,re){if(!s)return null;for(;re!==null;)u(fe,re),re=re.sibling;return null}function v(fe,re){for(fe=new Map;re!==null;)re.key!==null?fe.set(re.key,re):fe.set(re.index,re),re=re.sibling;return fe}function P(fe,re){return fe=pl(fe,re),fe.index=0,fe.sibling=null,fe}function I(fe,re,me){return fe.index=me,s?(me=fe.alternate,me!==null?(me=me.index,me<re?(fe.flags|=2,re):me):(fe.flags|=2,re)):(fe.flags|=1048576,re)}function D(fe){return s&&fe.alternate===null&&(fe.flags|=2),fe}function W(fe,re,me,Fe){return re===null||re.tag!==6?(re=WS(me,fe.mode,Fe),re.return=fe,re):(re=P(re,me),re.return=fe,re)}function J(fe,re,me,Fe){var nt=me.type;return nt===T?ke(fe,re,me.props.children,Fe,me.key):re!==null&&(re.elementType===nt||typeof nt=="object"&&nt!==null&&nt.$$typeof===ce&&wO(nt)===re.type)?(Fe=P(re,me.props),Fe.ref=sh(fe,re,me),Fe.return=fe,Fe):(Fe=Yv(me.type,me.key,me.props,null,fe.mode,Fe),Fe.ref=sh(fe,re,me),Fe.return=fe,Fe)}function Se(fe,re,me,Fe){return re===null||re.tag!==4||re.stateNode.containerInfo!==me.containerInfo||re.stateNode.implementation!==me.implementation?(re=KS(me,fe.mode,Fe),re.return=fe,re):(re=P(re,me.children||[]),re.return=fe,re)}function ke(fe,re,me,Fe,nt){return re===null||re.tag!==7?(re=Cu(me,fe.mode,Fe,nt),re.return=fe,re):(re=P(re,me),re.return=fe,re)}function Ae(fe,re,me){if(typeof re=="string"&&re!==""||typeof re=="number")return re=WS(""+re,fe.mode,me),re.return=fe,re;if(typeof re=="object"&&re!==null){switch(re.$$typeof){case E:return me=Yv(re.type,re.key,re.props,null,fe.mode,me),me.ref=sh(fe,null,re),me.return=fe,me;case R:return re=KS(re,fe.mode,me),re.return=fe,re;case ce:var Fe=re._init;return Ae(fe,Fe(re._payload),me)}if(It(re)||ge(re))return re=Cu(re,fe.mode,me,null),re.return=fe,re;Ev(fe,re)}return null}function Ie(fe,re,me,Fe){var nt=re!==null?re.key:null;if(typeof me=="string"&&me!==""||typeof me=="number")return nt!==null?null:W(fe,re,""+me,Fe);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case E:return me.key===nt?J(fe,re,me,Fe):null;case R:return me.key===nt?Se(fe,re,me,Fe):null;case ce:return nt=me._init,Ie(fe,re,nt(me._payload),Fe)}if(It(me)||ge(me))return nt!==null?null:ke(fe,re,me,Fe,null);Ev(fe,me)}return null}function He(fe,re,me,Fe,nt){if(typeof Fe=="string"&&Fe!==""||typeof Fe=="number")return fe=fe.get(me)||null,W(re,fe,""+Fe,nt);if(typeof Fe=="object"&&Fe!==null){switch(Fe.$$typeof){case E:return fe=fe.get(Fe.key===null?me:Fe.key)||null,J(re,fe,Fe,nt);case R:return fe=fe.get(Fe.key===null?me:Fe.key)||null,Se(re,fe,Fe,nt);case ce:var mt=Fe._init;return He(fe,re,me,mt(Fe._payload),nt)}if(It(Fe)||ge(Fe))return fe=fe.get(me)||null,ke(re,fe,Fe,nt,null);Ev(re,Fe)}return null}function Xe(fe,re,me,Fe){for(var nt=null,mt=null,vt=re,Tt=re=0,Mn=null;vt!==null&&Tt<me.length;Tt++){vt.index>Tt?(Mn=vt,vt=null):Mn=vt.sibling;var lr=Ie(fe,vt,me[Tt],Fe);if(lr===null){vt===null&&(vt=Mn);break}s&&vt&&lr.alternate===null&&u(fe,vt),re=I(lr,re,Tt),mt===null?nt=lr:mt.sibling=lr,mt=lr,vt=Mn}if(Tt===me.length)return h(fe,vt),Gr&&gu(fe,Tt),nt;if(vt===null){for(;Tt<me.length;Tt++)vt=Ae(fe,me[Tt],Fe),vt!==null&&(re=I(vt,re,Tt),mt===null?nt=vt:mt.sibling=vt,mt=vt);return Gr&&gu(fe,Tt),nt}for(vt=v(fe,vt);Tt<me.length;Tt++)Mn=He(vt,fe,Tt,me[Tt],Fe),Mn!==null&&(s&&Mn.alternate!==null&&vt.delete(Mn.key===null?Tt:Mn.key),re=I(Mn,re,Tt),mt===null?nt=Mn:mt.sibling=Mn,mt=Mn);return s&&vt.forEach(function(ml){return u(fe,ml)}),Gr&&gu(fe,Tt),nt}function et(fe,re,me,Fe){var nt=ge(me);if(typeof nt!="function")throw Error(r(150));if(me=nt.call(me),me==null)throw Error(r(151));for(var mt=nt=null,vt=re,Tt=re=0,Mn=null,lr=me.next();vt!==null&&!lr.done;Tt++,lr=me.next()){vt.index>Tt?(Mn=vt,vt=null):Mn=vt.sibling;var ml=Ie(fe,vt,lr.value,Fe);if(ml===null){vt===null&&(vt=Mn);break}s&&vt&&ml.alternate===null&&u(fe,vt),re=I(ml,re,Tt),mt===null?nt=ml:mt.sibling=ml,mt=ml,vt=Mn}if(lr.done)return h(fe,vt),Gr&&gu(fe,Tt),nt;if(vt===null){for(;!lr.done;Tt++,lr=me.next())lr=Ae(fe,lr.value,Fe),lr!==null&&(re=I(lr,re,Tt),mt===null?nt=lr:mt.sibling=lr,mt=lr);return Gr&&gu(fe,Tt),nt}for(vt=v(fe,vt);!lr.done;Tt++,lr=me.next())lr=He(vt,fe,Tt,lr.value,Fe),lr!==null&&(s&&lr.alternate!==null&&vt.delete(lr.key===null?Tt:lr.key),re=I(lr,re,Tt),mt===null?nt=lr:mt.sibling=lr,mt=lr);return s&&vt.forEach(function(P6){return u(fe,P6)}),Gr&&gu(fe,Tt),nt}function yn(fe,re,me,Fe){if(typeof me=="object"&&me!==null&&me.type===T&&me.key===null&&(me=me.props.children),typeof me=="object"&&me!==null){switch(me.$$typeof){case E:e:{for(var nt=me.key,mt=re;mt!==null;){if(mt.key===nt){if(nt=me.type,nt===T){if(mt.tag===7){h(fe,mt.sibling),re=P(mt,me.props.children),re.return=fe,fe=re;break e}}else if(mt.elementType===nt||typeof nt=="object"&&nt!==null&&nt.$$typeof===ce&&wO(nt)===mt.type){h(fe,mt.sibling),re=P(mt,me.props),re.ref=sh(fe,mt,me),re.return=fe,fe=re;break e}h(fe,mt);break}else u(fe,mt);mt=mt.sibling}me.type===T?(re=Cu(me.props.children,fe.mode,Fe,me.key),re.return=fe,fe=re):(Fe=Yv(me.type,me.key,me.props,null,fe.mode,Fe),Fe.ref=sh(fe,re,me),Fe.return=fe,fe=Fe)}return D(fe);case R:e:{for(mt=me.key;re!==null;){if(re.key===mt)if(re.tag===4&&re.stateNode.containerInfo===me.containerInfo&&re.stateNode.implementation===me.implementation){h(fe,re.sibling),re=P(re,me.children||[]),re.return=fe,fe=re;break e}else{h(fe,re);break}else u(fe,re);re=re.sibling}re=KS(me,fe.mode,Fe),re.return=fe,fe=re}return D(fe);case ce:return mt=me._init,yn(fe,re,mt(me._payload),Fe)}if(It(me))return Xe(fe,re,me,Fe);if(ge(me))return et(fe,re,me,Fe);Ev(fe,me)}return typeof me=="string"&&me!==""||typeof me=="number"?(me=""+me,re!==null&&re.tag===6?(h(fe,re.sibling),re=P(re,me),re.return=fe,fe=re):(h(fe,re),re=WS(me,fe.mode,Fe),re.return=fe,fe=re),D(fe)):h(fe,re)}return yn}var Yc=SO(!0),_O=SO(!1),Tv=il(null),Ov=null,Xc=null,rS=null;function nS(){rS=Xc=Ov=null}function iS(s){var u=Tv.current;Br(Tv),s._currentValue=u}function oS(s,u,h){for(;s!==null;){var v=s.alternate;if((s.childLanes&u)!==u?(s.childLanes|=u,v!==null&&(v.childLanes|=u)):v!==null&&(v.childLanes&u)!==u&&(v.childLanes|=u),s===h)break;s=s.return}}function Jc(s,u){Ov=s,rS=Xc=null,s=s.dependencies,s!==null&&s.firstContext!==null&&((s.lanes&u)!==0&&(ki=!0),s.firstContext=null)}function Po(s){var u=s._currentValue;if(rS!==s)if(s={context:s,memoizedValue:u,next:null},Xc===null){if(Ov===null)throw Error(r(308));Xc=s,Ov.dependencies={lanes:0,firstContext:s}}else Xc=Xc.next=s;return u}var yu=null;function aS(s){yu===null?yu=[s]:yu.push(s)}function xO(s,u,h,v){var P=u.interleaved;return P===null?(h.next=h,aS(u)):(h.next=P.next,P.next=h),u.interleaved=h,hs(s,v)}function hs(s,u){s.lanes|=u;var h=s.alternate;for(h!==null&&(h.lanes|=u),h=s,s=s.return;s!==null;)s.childLanes|=u,h=s.alternate,h!==null&&(h.childLanes|=u),h=s,s=s.return;return h.tag===3?h.stateNode:null}var sl=!1;function sS(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function PO(s,u){s=s.updateQueue,u.updateQueue===s&&(u.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,effects:s.effects})}function ps(s,u){return{eventTime:s,lane:u,tag:0,payload:null,callback:null,next:null}}function ll(s,u,h){var v=s.updateQueue;if(v===null)return null;if(v=v.shared,(ir&2)!==0){var P=v.pending;return P===null?u.next=u:(u.next=P.next,P.next=u),v.pending=u,hs(s,h)}return P=v.interleaved,P===null?(u.next=u,aS(v)):(u.next=P.next,P.next=u),v.interleaved=u,hs(s,h)}function Rv(s,u,h){if(u=u.updateQueue,u!==null&&(u=u.shared,(h&4194240)!==0)){var v=u.lanes;v&=s.pendingLanes,h|=v,u.lanes=h,Uf(s,h)}}function CO(s,u){var h=s.updateQueue,v=s.alternate;if(v!==null&&(v=v.updateQueue,h===v)){var P=null,I=null;if(h=h.firstBaseUpdate,h!==null){do{var D={eventTime:h.eventTime,lane:h.lane,tag:h.tag,payload:h.payload,callback:h.callback,next:null};I===null?P=I=D:I=I.next=D,h=h.next}while(h!==null);I===null?P=I=u:I=I.next=u}else P=I=u;h={baseState:v.baseState,firstBaseUpdate:P,lastBaseUpdate:I,shared:v.shared,effects:v.effects},s.updateQueue=h;return}s=h.lastBaseUpdate,s===null?h.firstBaseUpdate=u:s.next=u,h.lastBaseUpdate=u}function Iv(s,u,h,v){var P=s.updateQueue;sl=!1;var I=P.firstBaseUpdate,D=P.lastBaseUpdate,W=P.shared.pending;if(W!==null){P.shared.pending=null;var J=W,Se=J.next;J.next=null,D===null?I=Se:D.next=Se,D=J;var ke=s.alternate;ke!==null&&(ke=ke.updateQueue,W=ke.lastBaseUpdate,W!==D&&(W===null?ke.firstBaseUpdate=Se:W.next=Se,ke.lastBaseUpdate=J))}if(I!==null){var Ae=P.baseState;D=0,ke=Se=J=null,W=I;do{var Ie=W.lane,He=W.eventTime;if((v&Ie)===Ie){ke!==null&&(ke=ke.next={eventTime:He,lane:0,tag:W.tag,payload:W.payload,callback:W.callback,next:null});e:{var Xe=s,et=W;switch(Ie=u,He=h,et.tag){case 1:if(Xe=et.payload,typeof Xe=="function"){Ae=Xe.call(He,Ae,Ie);break e}Ae=Xe;break e;case 3:Xe.flags=Xe.flags&-65537|128;case 0:if(Xe=et.payload,Ie=typeof Xe=="function"?Xe.call(He,Ae,Ie):Xe,Ie==null)break e;Ae=Z({},Ae,Ie);break e;case 2:sl=!0}}W.callback!==null&&W.lane!==0&&(s.flags|=64,Ie=P.effects,Ie===null?P.effects=[W]:Ie.push(W))}else He={eventTime:He,lane:Ie,tag:W.tag,payload:W.payload,callback:W.callback,next:null},ke===null?(Se=ke=He,J=Ae):ke=ke.next=He,D|=Ie;if(W=W.next,W===null){if(W=P.shared.pending,W===null)break;Ie=W,W=Ie.next,Ie.next=null,P.lastBaseUpdate=Ie,P.shared.pending=null}}while(!0);if(ke===null&&(J=Ae),P.baseState=J,P.firstBaseUpdate=Se,P.lastBaseUpdate=ke,u=P.shared.interleaved,u!==null){P=u;do D|=P.lane,P=P.next;while(P!==u)}else I===null&&(P.shared.lanes=0);Su|=D,s.lanes=D,s.memoizedState=Ae}}function EO(s,u,h){if(s=u.effects,u.effects=null,s!==null)for(u=0;u<s.length;u++){var v=s[u],P=v.callback;if(P!==null){if(v.callback=null,v=h,typeof P!="function")throw Error(r(191,P));P.call(v)}}}var lh={},Ra=il(lh),uh=il(lh),ch=il(lh);function bu(s){if(s===lh)throw Error(r(174));return s}function lS(s,u){switch($r(ch,u),$r(uh,s),$r(Ra,lh),s=u.nodeType,s){case 9:case 11:u=(u=u.documentElement)?u.namespaceURI:Jr(null,"");break;default:s=s===8?u.parentNode:u,u=s.namespaceURI||null,s=s.tagName,u=Jr(u,s)}Br(Ra),$r(Ra,u)}function Zc(){Br(Ra),Br(uh),Br(ch)}function TO(s){bu(ch.current);var u=bu(Ra.current),h=Jr(u,s.type);u!==h&&($r(uh,s),$r(Ra,h))}function uS(s){uh.current===s&&(Br(Ra),Br(uh))}var Zr=il(0);function kv(s){for(var u=s;u!==null;){if(u.tag===13){var h=u.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||h.data==="$?"||h.data==="$!"))return u}else if(u.tag===19&&u.memoizedProps.revealOrder!==void 0){if((u.flags&128)!==0)return u}else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===s)break;for(;u.sibling===null;){if(u.return===null||u.return===s)return null;u=u.return}u.sibling.return=u.return,u=u.sibling}return null}var cS=[];function dS(){for(var s=0;s<cS.length;s++)cS[s]._workInProgressVersionPrimary=null;cS.length=0}var jv=k.ReactCurrentDispatcher,fS=k.ReactCurrentBatchConfig,wu=0,en=null,Tn=null,An=null,$v=!1,dh=!1,fh=0,Wz=0;function si(){throw Error(r(321))}function hS(s,u){if(u===null)return!1;for(var h=0;h<u.length&&h<s.length;h++)if(!Yo(s[h],u[h]))return!1;return!0}function pS(s,u,h,v,P,I){if(wu=I,en=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,jv.current=s===null||s.memoizedState===null?Yz:Xz,s=h(v,P),dh){I=0;do{if(dh=!1,fh=0,25<=I)throw Error(r(301));I+=1,An=Tn=null,u.updateQueue=null,jv.current=Jz,s=h(v,P)}while(dh)}if(jv.current=Mv,u=Tn!==null&&Tn.next!==null,wu=0,An=Tn=en=null,$v=!1,u)throw Error(r(300));return s}function mS(){var s=fh!==0;return fh=0,s}function Ia(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return An===null?en.memoizedState=An=s:An=An.next=s,An}function Co(){if(Tn===null){var s=en.alternate;s=s!==null?s.memoizedState:null}else s=Tn.next;var u=An===null?en.memoizedState:An.next;if(u!==null)An=u,Tn=s;else{if(s===null)throw Error(r(310));Tn=s,s={memoizedState:Tn.memoizedState,baseState:Tn.baseState,baseQueue:Tn.baseQueue,queue:Tn.queue,next:null},An===null?en.memoizedState=An=s:An=An.next=s}return An}function hh(s,u){return typeof u=="function"?u(s):u}function vS(s){var u=Co(),h=u.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=s;var v=Tn,P=v.baseQueue,I=h.pending;if(I!==null){if(P!==null){var D=P.next;P.next=I.next,I.next=D}v.baseQueue=P=I,h.pending=null}if(P!==null){I=P.next,v=v.baseState;var W=D=null,J=null,Se=I;do{var ke=Se.lane;if((wu&ke)===ke)J!==null&&(J=J.next={lane:0,action:Se.action,hasEagerState:Se.hasEagerState,eagerState:Se.eagerState,next:null}),v=Se.hasEagerState?Se.eagerState:s(v,Se.action);else{var Ae={lane:ke,action:Se.action,hasEagerState:Se.hasEagerState,eagerState:Se.eagerState,next:null};J===null?(W=J=Ae,D=v):J=J.next=Ae,en.lanes|=ke,Su|=ke}Se=Se.next}while(Se!==null&&Se!==I);J===null?D=v:J.next=W,Yo(v,u.memoizedState)||(ki=!0),u.memoizedState=v,u.baseState=D,u.baseQueue=J,h.lastRenderedState=v}if(s=h.interleaved,s!==null){P=s;do I=P.lane,en.lanes|=I,Su|=I,P=P.next;while(P!==s)}else P===null&&(h.lanes=0);return[u.memoizedState,h.dispatch]}function gS(s){var u=Co(),h=u.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=s;var v=h.dispatch,P=h.pending,I=u.memoizedState;if(P!==null){h.pending=null;var D=P=P.next;do I=s(I,D.action),D=D.next;while(D!==P);Yo(I,u.memoizedState)||(ki=!0),u.memoizedState=I,u.baseQueue===null&&(u.baseState=I),h.lastRenderedState=I}return[I,v]}function OO(){}function RO(s,u){var h=en,v=Co(),P=u(),I=!Yo(v.memoizedState,P);if(I&&(v.memoizedState=P,ki=!0),v=v.queue,yS(jO.bind(null,h,v,s),[s]),v.getSnapshot!==u||I||An!==null&&An.memoizedState.tag&1){if(h.flags|=2048,ph(9,kO.bind(null,h,v,P,u),void 0,null),Dn===null)throw Error(r(349));(wu&30)!==0||IO(h,u,P)}return P}function IO(s,u,h){s.flags|=16384,s={getSnapshot:u,value:h},u=en.updateQueue,u===null?(u={lastEffect:null,stores:null},en.updateQueue=u,u.stores=[s]):(h=u.stores,h===null?u.stores=[s]:h.push(s))}function kO(s,u,h,v){u.value=h,u.getSnapshot=v,$O(u)&&AO(s)}function jO(s,u,h){return h(function(){$O(u)&&AO(s)})}function $O(s){var u=s.getSnapshot;s=s.value;try{var h=u();return!Yo(s,h)}catch{return!0}}function AO(s){var u=hs(s,1);u!==null&&ta(u,s,1,-1)}function DO(s){var u=Ia();return typeof s=="function"&&(s=s()),u.memoizedState=u.baseState=s,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:hh,lastRenderedState:s},u.queue=s,s=s.dispatch=Qz.bind(null,en,s),[u.memoizedState,s]}function ph(s,u,h,v){return s={tag:s,create:u,destroy:h,deps:v,next:null},u=en.updateQueue,u===null?(u={lastEffect:null,stores:null},en.updateQueue=u,u.lastEffect=s.next=s):(h=u.lastEffect,h===null?u.lastEffect=s.next=s:(v=h.next,h.next=s,s.next=v,u.lastEffect=s)),s}function MO(){return Co().memoizedState}function Av(s,u,h,v){var P=Ia();en.flags|=s,P.memoizedState=ph(1|u,h,void 0,v===void 0?null:v)}function Dv(s,u,h,v){var P=Co();v=v===void 0?null:v;var I=void 0;if(Tn!==null){var D=Tn.memoizedState;if(I=D.destroy,v!==null&&hS(v,D.deps)){P.memoizedState=ph(u,h,I,v);return}}en.flags|=s,P.memoizedState=ph(1|u,h,I,v)}function NO(s,u){return Av(8390656,8,s,u)}function yS(s,u){return Dv(2048,8,s,u)}function FO(s,u){return Dv(4,2,s,u)}function LO(s,u){return Dv(4,4,s,u)}function BO(s,u){if(typeof u=="function")return s=s(),u(s),function(){u(null)};if(u!=null)return s=s(),u.current=s,function(){u.current=null}}function VO(s,u,h){return h=h!=null?h.concat([s]):null,Dv(4,4,BO.bind(null,u,s),h)}function bS(){}function zO(s,u){var h=Co();u=u===void 0?null:u;var v=h.memoizedState;return v!==null&&u!==null&&hS(u,v[1])?v[0]:(h.memoizedState=[s,u],s)}function qO(s,u){var h=Co();u=u===void 0?null:u;var v=h.memoizedState;return v!==null&&u!==null&&hS(u,v[1])?v[0]:(s=s(),h.memoizedState=[s,u],s)}function UO(s,u,h){return(wu&21)===0?(s.baseState&&(s.baseState=!1,ki=!0),s.memoizedState=h):(Yo(h,u)||(h=ov(),en.lanes|=h,Su|=h,s.baseState=!0),u)}function Kz(s,u){var h=sr;sr=h!==0&&4>h?h:4,s(!0);var v=fS.transition;fS.transition={};try{s(!1),u()}finally{sr=h,fS.transition=v}}function HO(){return Co().memoizedState}function Gz(s,u,h){var v=fl(s);if(h={lane:v,action:h,hasEagerState:!1,eagerState:null,next:null},WO(s))KO(u,h);else if(h=xO(s,u,h,v),h!==null){var P=bi();ta(h,s,v,P),GO(h,u,v)}}function Qz(s,u,h){var v=fl(s),P={lane:v,action:h,hasEagerState:!1,eagerState:null,next:null};if(WO(s))KO(u,P);else{var I=s.alternate;if(s.lanes===0&&(I===null||I.lanes===0)&&(I=u.lastRenderedReducer,I!==null))try{var D=u.lastRenderedState,W=I(D,h);if(P.hasEagerState=!0,P.eagerState=W,Yo(W,D)){var J=u.interleaved;J===null?(P.next=P,aS(u)):(P.next=J.next,J.next=P),u.interleaved=P;return}}catch{}finally{}h=xO(s,u,P,v),h!==null&&(P=bi(),ta(h,s,v,P),GO(h,u,v))}}function WO(s){var u=s.alternate;return s===en||u!==null&&u===en}function KO(s,u){dh=$v=!0;var h=s.pending;h===null?u.next=u:(u.next=h.next,h.next=u),s.pending=u}function GO(s,u,h){if((h&4194240)!==0){var v=u.lanes;v&=s.pendingLanes,h|=v,u.lanes=h,Uf(s,h)}}var Mv={readContext:Po,useCallback:si,useContext:si,useEffect:si,useImperativeHandle:si,useInsertionEffect:si,useLayoutEffect:si,useMemo:si,useReducer:si,useRef:si,useState:si,useDebugValue:si,useDeferredValue:si,useTransition:si,useMutableSource:si,useSyncExternalStore:si,useId:si,unstable_isNewReconciler:!1},Yz={readContext:Po,useCallback:function(s,u){return Ia().memoizedState=[s,u===void 0?null:u],s},useContext:Po,useEffect:NO,useImperativeHandle:function(s,u,h){return h=h!=null?h.concat([s]):null,Av(4194308,4,BO.bind(null,u,s),h)},useLayoutEffect:function(s,u){return Av(4194308,4,s,u)},useInsertionEffect:function(s,u){return Av(4,2,s,u)},useMemo:function(s,u){var h=Ia();return u=u===void 0?null:u,s=s(),h.memoizedState=[s,u],s},useReducer:function(s,u,h){var v=Ia();return u=h!==void 0?h(u):u,v.memoizedState=v.baseState=u,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:u},v.queue=s,s=s.dispatch=Gz.bind(null,en,s),[v.memoizedState,s]},useRef:function(s){var u=Ia();return s={current:s},u.memoizedState=s},useState:DO,useDebugValue:bS,useDeferredValue:function(s){return Ia().memoizedState=s},useTransition:function(){var s=DO(!1),u=s[0];return s=Kz.bind(null,s[1]),Ia().memoizedState=s,[u,s]},useMutableSource:function(){},useSyncExternalStore:function(s,u,h){var v=en,P=Ia();if(Gr){if(h===void 0)throw Error(r(407));h=h()}else{if(h=u(),Dn===null)throw Error(r(349));(wu&30)!==0||IO(v,u,h)}P.memoizedState=h;var I={value:h,getSnapshot:u};return P.queue=I,NO(jO.bind(null,v,I,s),[s]),v.flags|=2048,ph(9,kO.bind(null,v,I,h,u),void 0,null),h},useId:function(){var s=Ia(),u=Dn.identifierPrefix;if(Gr){var h=fs,v=ds;h=(v&~(1<<32-ri(v)-1)).toString(32)+h,u=":"+u+"R"+h,h=fh++,0<h&&(u+="H"+h.toString(32)),u+=":"}else h=Wz++,u=":"+u+"r"+h.toString(32)+":";return s.memoizedState=u},unstable_isNewReconciler:!1},Xz={readContext:Po,useCallback:zO,useContext:Po,useEffect:yS,useImperativeHandle:VO,useInsertionEffect:FO,useLayoutEffect:LO,useMemo:qO,useReducer:vS,useRef:MO,useState:function(){return vS(hh)},useDebugValue:bS,useDeferredValue:function(s){var u=Co();return UO(u,Tn.memoizedState,s)},useTransition:function(){var s=vS(hh)[0],u=Co().memoizedState;return[s,u]},useMutableSource:OO,useSyncExternalStore:RO,useId:HO,unstable_isNewReconciler:!1},Jz={readContext:Po,useCallback:zO,useContext:Po,useEffect:yS,useImperativeHandle:VO,useInsertionEffect:FO,useLayoutEffect:LO,useMemo:qO,useReducer:gS,useRef:MO,useState:function(){return gS(hh)},useDebugValue:bS,useDeferredValue:function(s){var u=Co();return Tn===null?u.memoizedState=s:UO(u,Tn.memoizedState,s)},useTransition:function(){var s=gS(hh)[0],u=Co().memoizedState;return[s,u]},useMutableSource:OO,useSyncExternalStore:RO,useId:HO,unstable_isNewReconciler:!1};function Jo(s,u){if(s&&s.defaultProps){u=Z({},u),s=s.defaultProps;for(var h in s)u[h]===void 0&&(u[h]=s[h]);return u}return u}function wS(s,u,h,v){u=s.memoizedState,h=h(v,u),h=h==null?u:Z({},u,h),s.memoizedState=h,s.lanes===0&&(s.updateQueue.baseState=h)}var Nv={isMounted:function(s){return(s=s._reactInternals)?ot(s)===s:!1},enqueueSetState:function(s,u,h){s=s._reactInternals;var v=bi(),P=fl(s),I=ps(v,P);I.payload=u,h!=null&&(I.callback=h),u=ll(s,I,P),u!==null&&(ta(u,s,P,v),Rv(u,s,P))},enqueueReplaceState:function(s,u,h){s=s._reactInternals;var v=bi(),P=fl(s),I=ps(v,P);I.tag=1,I.payload=u,h!=null&&(I.callback=h),u=ll(s,I,P),u!==null&&(ta(u,s,P,v),Rv(u,s,P))},enqueueForceUpdate:function(s,u){s=s._reactInternals;var h=bi(),v=fl(s),P=ps(h,v);P.tag=2,u!=null&&(P.callback=u),u=ll(s,P,v),u!==null&&(ta(u,s,v,h),Rv(u,s,v))}};function QO(s,u,h,v,P,I,D){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(v,I,D):u.prototype&&u.prototype.isPureReactComponent?!eh(h,v)||!eh(P,I):!0}function YO(s,u,h){var v=!1,P=ol,I=u.contextType;return typeof I=="object"&&I!==null?I=Po(I):(P=Ii(u)?mu:ai.current,v=u.contextTypes,I=(v=v!=null)?Wc(s,P):ol),u=new u(h,I),s.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=Nv,s.stateNode=u,u._reactInternals=s,v&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=P,s.__reactInternalMemoizedMaskedChildContext=I),u}function XO(s,u,h,v){s=u.state,typeof u.componentWillReceiveProps=="function"&&u.componentWillReceiveProps(h,v),typeof u.UNSAFE_componentWillReceiveProps=="function"&&u.UNSAFE_componentWillReceiveProps(h,v),u.state!==s&&Nv.enqueueReplaceState(u,u.state,null)}function SS(s,u,h,v){var P=s.stateNode;P.props=h,P.state=s.memoizedState,P.refs={},sS(s);var I=u.contextType;typeof I=="object"&&I!==null?P.context=Po(I):(I=Ii(u)?mu:ai.current,P.context=Wc(s,I)),P.state=s.memoizedState,I=u.getDerivedStateFromProps,typeof I=="function"&&(wS(s,u,I,h),P.state=s.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof P.getSnapshotBeforeUpdate=="function"||typeof P.UNSAFE_componentWillMount!="function"&&typeof P.componentWillMount!="function"||(u=P.state,typeof P.componentWillMount=="function"&&P.componentWillMount(),typeof P.UNSAFE_componentWillMount=="function"&&P.UNSAFE_componentWillMount(),u!==P.state&&Nv.enqueueReplaceState(P,P.state,null),Iv(s,h,P,v),P.state=s.memoizedState),typeof P.componentDidMount=="function"&&(s.flags|=4194308)}function ed(s,u){try{var h="",v=u;do h+=F(v),v=v.return;while(v);var P=h}catch(I){P=`
|
39
39
|
Error generating stack: `+I.message+`
|
40
|
-
`+I.stack}return{value:s,source:u,stack:P,digest:null}}function _S(s,u,h){return{value:s,source:null,stack:h??null,digest:u??null}}function xS(s,u){try{console.error(u.value)}catch(h){setTimeout(function(){throw h})}}var Zz=typeof WeakMap=="function"?WeakMap:Map;function JO(s,u,h){h=ps(-1,h),h.tag=3,h.payload={element:null};var v=u.value;return h.callback=function(){Uv||(Uv=!0,FS=v),xS(s,u)},h}function ZO(s,u,h){h=ps(-1,h),h.tag=3;var v=s.type.getDerivedStateFromError;if(typeof v=="function"){var P=u.value;h.payload=function(){return v(P)},h.callback=function(){xS(s,u)}}var I=s.stateNode;return I!==null&&typeof I.componentDidCatch=="function"&&(h.callback=function(){xS(s,u),typeof v!="function"&&(cl===null?cl=new Set([this]):cl.add(this));var D=u.stack;this.componentDidCatch(u.value,{componentStack:D!==null?D:""})}),h}function eR(s,u,h){var v=s.pingCache;if(v===null){v=s.pingCache=new Zz;var P=new Set;v.set(u,P)}else P=v.get(u),P===void 0&&(P=new Set,v.set(u,P));P.has(h)||(P.add(h),s=h6.bind(null,s,u,h),u.then(s,s))}function tR(s){do{var u;if((u=s.tag===13)&&(u=s.memoizedState,u=u!==null?u.dehydrated!==null:!0),u)return s;s=s.return}while(s!==null);return null}function rR(s,u,h,v,P){return(s.mode&1)===0?(s===u?s.flags|=65536:(s.flags|=128,h.flags|=131072,h.flags&=-52805,h.tag===1&&(h.alternate===null?h.tag=17:(u=ps(-1,1),u.tag=2,ll(h,u,1))),h.lanes|=1),s):(s.flags|=65536,s.lanes=P,s)}var e6=k.ReactCurrentOwner,ki=!1;function yi(s,u,h,v){u.child=s===null?_O(u,null,h,v):Yc(u,s.child,h,v)}function nR(s,u,h,v,P){h=h.render;var I=u.ref;return Jc(u,P),v=pS(s,u,h,v,I,P),h=mS(),s!==null&&!ki?(u.updateQueue=s.updateQueue,u.flags&=-2053,s.lanes&=~P,ms(s,u,P)):(Gr&&h&&Xw(u),u.flags|=1,yi(s,u,v,P),u.child)}function iR(s,u,h,v,P){if(s===null){var I=h.type;return typeof I=="function"&&!HS(I)&&I.defaultProps===void 0&&h.compare===null&&h.defaultProps===void 0?(u.tag=15,u.type=I,oR(s,u,I,v,P)):(s=Yv(h.type,null,v,u,u.mode,P),s.ref=u.ref,s.return=u,u.child=s)}if(I=s.child,(s.lanes&P)===0){var D=I.memoizedProps;if(h=h.compare,h=h!==null?h:eh,h(D,v)&&s.ref===u.ref)return ms(s,u,P)}return u.flags|=1,s=pl(I,v),s.ref=u.ref,s.return=u,u.child=s}function oR(s,u,h,v,P){if(s!==null){var I=s.memoizedProps;if(eh(I,v)&&s.ref===u.ref)if(ki=!1,u.pendingProps=v=I,(s.lanes&P)!==0)(s.flags&131072)!==0&&(ki=!0);else return u.lanes=s.lanes,ms(s,u,P)}return PS(s,u,h,v,P)}function aR(s,u,h){var v=u.pendingProps,P=v.children,I=s!==null?s.memoizedState:null;if(v.mode==="hidden")if((u.mode&1)===0)u.memoizedState={baseLanes:0,cachePool:null,transitions:null},$r(rd,to),to|=h;else{if((h&1073741824)===0)return s=I!==null?I.baseLanes|h:h,u.lanes=u.childLanes=1073741824,u.memoizedState={baseLanes:s,cachePool:null,transitions:null},u.updateQueue=null,$r(rd,to),to|=s,null;u.memoizedState={baseLanes:0,cachePool:null,transitions:null},v=I!==null?I.baseLanes:h,$r(rd,to),to|=v}else I!==null?(v=I.baseLanes|h,u.memoizedState=null):v=h,$r(rd,to),to|=v;return yi(s,u,P,h),u.child}function sR(s,u){var h=u.ref;(s===null&&h!==null||s!==null&&s.ref!==h)&&(u.flags|=512,u.flags|=2097152)}function PS(s,u,h,v,P){var I=Ii(h)?mu:ai.current;return I=Wc(u,I),Jc(u,P),h=pS(s,u,h,v,I,P),v=mS(),s!==null&&!ki?(u.updateQueue=s.updateQueue,u.flags&=-2053,s.lanes&=~P,ms(s,u,P)):(Gr&&v&&Xw(u),u.flags|=1,yi(s,u,h,P),u.child)}function lR(s,u,h,v,P){if(Ii(h)){var I=!0;Sv(u)}else I=!1;if(Jc(u,P),u.stateNode===null)Lv(s,u),YO(u,h,v),SS(u,h,v,P),v=!0;else if(s===null){var D=u.stateNode,W=u.memoizedProps;D.props=W;var J=D.context,Se=h.contextType;typeof Se=="object"&&Se!==null?Se=Po(Se):(Se=Ii(h)?mu:ai.current,Se=Wc(u,Se));var ke=h.getDerivedStateFromProps,Ae=typeof ke=="function"||typeof D.getSnapshotBeforeUpdate=="function";Ae||typeof D.UNSAFE_componentWillReceiveProps!="function"&&typeof D.componentWillReceiveProps!="function"||(W!==v||J!==Se)&&XO(u,D,v,Se),sl=!1;var Ie=u.memoizedState;D.state=Ie,Iv(u,v,D,P),J=u.memoizedState,W!==v||Ie!==J||Ri.current||sl?(typeof ke=="function"&&(wS(u,h,ke,v),J=u.memoizedState),(W=sl||QO(u,h,W,v,Ie,J,Se))?(Ae||typeof D.UNSAFE_componentWillMount!="function"&&typeof D.componentWillMount!="function"||(typeof D.componentWillMount=="function"&&D.componentWillMount(),typeof D.UNSAFE_componentWillMount=="function"&&D.UNSAFE_componentWillMount()),typeof D.componentDidMount=="function"&&(u.flags|=4194308)):(typeof D.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=v,u.memoizedState=J),D.props=v,D.state=J,D.context=Se,v=W):(typeof D.componentDidMount=="function"&&(u.flags|=4194308),v=!1)}else{D=u.stateNode,PO(s,u),W=u.memoizedProps,Se=u.type===u.elementType?W:Jo(u.type,W),D.props=Se,Ae=u.pendingProps,Ie=D.context,J=h.contextType,typeof J=="object"&&J!==null?J=Po(J):(J=Ii(h)?mu:ai.current,J=Wc(u,J));var He=h.getDerivedStateFromProps;(ke=typeof He=="function"||typeof D.getSnapshotBeforeUpdate=="function")||typeof D.UNSAFE_componentWillReceiveProps!="function"&&typeof D.componentWillReceiveProps!="function"||(W!==Ae||Ie!==J)&&XO(u,D,v,J),sl=!1,Ie=u.memoizedState,D.state=Ie,Iv(u,v,D,P);var Xe=u.memoizedState;W!==Ae||Ie!==Xe||Ri.current||sl?(typeof He=="function"&&(wS(u,h,He,v),Xe=u.memoizedState),(Se=sl||QO(u,h,Se,v,Ie,Xe,J)||!1)?(ke||typeof D.UNSAFE_componentWillUpdate!="function"&&typeof D.componentWillUpdate!="function"||(typeof D.componentWillUpdate=="function"&&D.componentWillUpdate(v,Xe,J),typeof D.UNSAFE_componentWillUpdate=="function"&&D.UNSAFE_componentWillUpdate(v,Xe,J)),typeof D.componentDidUpdate=="function"&&(u.flags|=4),typeof D.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof D.componentDidUpdate!="function"||W===s.memoizedProps&&Ie===s.memoizedState||(u.flags|=4),typeof D.getSnapshotBeforeUpdate!="function"||W===s.memoizedProps&&Ie===s.memoizedState||(u.flags|=1024),u.memoizedProps=v,u.memoizedState=Xe),D.props=v,D.state=Xe,D.context=J,v=Se):(typeof D.componentDidUpdate!="function"||W===s.memoizedProps&&Ie===s.memoizedState||(u.flags|=4),typeof D.getSnapshotBeforeUpdate!="function"||W===s.memoizedProps&&Ie===s.memoizedState||(u.flags|=1024),v=!1)}return CS(s,u,h,v,I,P)}function CS(s,u,h,v,P,I){sR(s,u);var D=(u.flags&128)!==0;if(!v&&!D)return P&&hO(u,h,!1),ms(s,u,I);v=u.stateNode,e6.current=u;var W=D&&typeof h.getDerivedStateFromError!="function"?null:v.render();return u.flags|=1,s!==null&&D?(u.child=Yc(u,s.child,null,I),u.child=Yc(u,null,W,I)):yi(s,u,W,I),u.memoizedState=v.state,P&&hO(u,h,!0),u.child}function uR(s){var u=s.stateNode;u.pendingContext?dO(s,u.pendingContext,u.pendingContext!==u.context):u.context&&dO(s,u.context,!1),lS(s,u.containerInfo)}function cR(s,u,h,v,P){return Qc(),tS(P),u.flags|=256,yi(s,u,h,v),u.child}var ES={dehydrated:null,treeContext:null,retryLane:0};function TS(s){return{baseLanes:s,cachePool:null,transitions:null}}function dR(s,u,h){var v=u.pendingProps,P=Zr.current,I=!1,D=(u.flags&128)!==0,W;if((W=D)||(W=s!==null&&s.memoizedState===null?!1:(P&2)!==0),W?(I=!0,u.flags&=-129):(s===null||s.memoizedState!==null)&&(P|=1),$r(Zr,P&1),s===null)return eS(u),s=u.memoizedState,s!==null&&(s=s.dehydrated,s!==null)?((u.mode&1)===0?u.lanes=1:s.data==="$!"?u.lanes=8:u.lanes=1073741824,null):(D=v.children,s=v.fallback,I?(v=u.mode,I=u.child,D={mode:"hidden",children:D},(v&1)===0&&I!==null?(I.childLanes=0,I.pendingProps=D):I=Xv(D,v,0,null),s=Cu(s,v,h,null),I.return=u,s.return=u,I.sibling=s,u.child=I,u.child.memoizedState=TS(h),u.memoizedState=ES,s):OS(u,D));if(P=s.memoizedState,P!==null&&(W=P.dehydrated,W!==null))return t6(s,u,D,v,W,P,h);if(I){I=v.fallback,D=u.mode,P=s.child,W=P.sibling;var J={mode:"hidden",children:v.children};return(D&1)===0&&u.child!==P?(v=u.child,v.childLanes=0,v.pendingProps=J,u.deletions=null):(v=pl(P,J),v.subtreeFlags=P.subtreeFlags&14680064),W!==null?I=pl(W,I):(I=Cu(I,D,h,null),I.flags|=2),I.return=u,v.return=u,v.sibling=I,u.child=v,v=I,I=u.child,D=s.child.memoizedState,D=D===null?TS(h):{baseLanes:D.baseLanes|h,cachePool:null,transitions:D.transitions},I.memoizedState=D,I.childLanes=s.childLanes&~h,u.memoizedState=ES,v}return I=s.child,s=I.sibling,v=pl(I,{mode:"visible",children:v.children}),(u.mode&1)===0&&(v.lanes=h),v.return=u,v.sibling=null,s!==null&&(h=u.deletions,h===null?(u.deletions=[s],u.flags|=16):h.push(s)),u.child=v,u.memoizedState=null,v}function OS(s,u){return u=Xv({mode:"visible",children:u},s.mode,0,null),u.return=s,s.child=u}function Fv(s,u,h,v){return v!==null&&tS(v),Yc(u,s.child,null,h),s=OS(u,u.pendingProps.children),s.flags|=2,u.memoizedState=null,s}function t6(s,u,h,v,P,I,D){if(h)return u.flags&256?(u.flags&=-257,v=_S(Error(r(422))),Fv(s,u,D,v)):u.memoizedState!==null?(u.child=s.child,u.flags|=128,null):(I=v.fallback,P=u.mode,v=Xv({mode:"visible",children:v.children},P,0,null),I=Cu(I,P,D,null),I.flags|=2,v.return=u,I.return=u,v.sibling=I,u.child=v,(u.mode&1)!==0&&Yc(u,s.child,null,D),u.child.memoizedState=TS(D),u.memoizedState=ES,I);if((u.mode&1)===0)return Fv(s,u,D,null);if(P.data==="$!"){if(v=P.nextSibling&&P.nextSibling.dataset,v)var W=v.dgst;return v=W,I=Error(r(419)),v=_S(I,v,void 0),Fv(s,u,D,v)}if(W=(D&s.childLanes)!==0,ki||W){if(v=Dn,v!==null){switch(D&-D){case 4:P=2;break;case 16:P=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:P=32;break;case 536870912:P=268435456;break;default:P=0}P=(P&(v.suspendedLanes|D))!==0?0:P,P!==0&&P!==I.retryLane&&(I.retryLane=P,hs(s,P),ta(v,s,P,-1))}return US(),v=_S(Error(r(421))),Fv(s,u,D,v)}return P.data==="$?"?(u.flags|=128,u.child=s.child,u=p6.bind(null,s),P._reactRetry=u,null):(s=I.treeContext,eo=nl(P.nextSibling),Zi=u,Gr=!0,Xo=null,s!==null&&(_o[xo++]=ds,_o[xo++]=fs,_o[xo++]=vu,ds=s.id,fs=s.overflow,vu=u),u=OS(u,v.children),u.flags|=4096,u)}function fR(s,u,h){s.lanes|=u;var v=s.alternate;v!==null&&(v.lanes|=u),oS(s.return,u,h)}function RS(s,u,h,v,P){var I=s.memoizedState;I===null?s.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:v,tail:h,tailMode:P}:(I.isBackwards=u,I.rendering=null,I.renderingStartTime=0,I.last=v,I.tail=h,I.tailMode=P)}function hR(s,u,h){var v=u.pendingProps,P=v.revealOrder,I=v.tail;if(yi(s,u,v.children,h),v=Zr.current,(v&2)!==0)v=v&1|2,u.flags|=128;else{if(s!==null&&(s.flags&128)!==0)e:for(s=u.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&fR(s,h,u);else if(s.tag===19)fR(s,h,u);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===u)break e;for(;s.sibling===null;){if(s.return===null||s.return===u)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}v&=1}if($r(Zr,v),(u.mode&1)===0)u.memoizedState=null;else switch(P){case"forwards":for(h=u.child,P=null;h!==null;)s=h.alternate,s!==null&&kv(s)===null&&(P=h),h=h.sibling;h=P,h===null?(P=u.child,u.child=null):(P=h.sibling,h.sibling=null),RS(u,!1,P,h,I);break;case"backwards":for(h=null,P=u.child,u.child=null;P!==null;){if(s=P.alternate,s!==null&&kv(s)===null){u.child=P;break}s=P.sibling,P.sibling=h,h=P,P=s}RS(u,!0,h,null,I);break;case"together":RS(u,!1,null,null,void 0);break;default:u.memoizedState=null}return u.child}function Lv(s,u){(u.mode&1)===0&&s!==null&&(s.alternate=null,u.alternate=null,u.flags|=2)}function ms(s,u,h){if(s!==null&&(u.dependencies=s.dependencies),Su|=u.lanes,(h&u.childLanes)===0)return null;if(s!==null&&u.child!==s.child)throw Error(r(153));if(u.child!==null){for(s=u.child,h=pl(s,s.pendingProps),u.child=h,h.return=u;s.sibling!==null;)s=s.sibling,h=h.sibling=pl(s,s.pendingProps),h.return=u;h.sibling=null}return u.child}function r6(s,u,h){switch(u.tag){case 3:uR(u),Qc();break;case 5:TO(u);break;case 1:Ii(u.type)&&Sv(u);break;case 4:lS(u,u.stateNode.containerInfo);break;case 10:var v=u.type._context,P=u.memoizedProps.value;$r(Tv,v._currentValue),v._currentValue=P;break;case 13:if(v=u.memoizedState,v!==null)return v.dehydrated!==null?($r(Zr,Zr.current&1),u.flags|=128,null):(h&u.child.childLanes)!==0?dR(s,u,h):($r(Zr,Zr.current&1),s=ms(s,u,h),s!==null?s.sibling:null);$r(Zr,Zr.current&1);break;case 19:if(v=(h&u.childLanes)!==0,(s.flags&128)!==0){if(v)return hR(s,u,h);u.flags|=128}if(P=u.memoizedState,P!==null&&(P.rendering=null,P.tail=null,P.lastEffect=null),$r(Zr,Zr.current),v)break;return null;case 22:case 23:return u.lanes=0,aR(s,u,h)}return ms(s,u,h)}var pR,IS,mR,vR;pR=function(s,u){for(var h=u.child;h!==null;){if(h.tag===5||h.tag===6)s.appendChild(h.stateNode);else if(h.tag!==4&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===u)break;for(;h.sibling===null;){if(h.return===null||h.return===u)return;h=h.return}h.sibling.return=h.return,h=h.sibling}},IS=function(){},mR=function(s,u,h,v){var P=s.memoizedProps;if(P!==v){s=u.stateNode,bu(Ra.current);var I=null;switch(h){case"input":P=Te(s,P),v=Te(s,v),I=[];break;case"select":P=Z({},P,{value:void 0}),v=Z({},v,{value:void 0}),I=[];break;case"textarea":P=Lt(s,P),v=Lt(s,v),I=[];break;default:typeof P.onClick!="function"&&typeof v.onClick=="function"&&(s.onclick=yv)}Oi(h,v);var D;h=null;for(Se in P)if(!v.hasOwnProperty(Se)&&P.hasOwnProperty(Se)&&P[Se]!=null)if(Se==="style"){var W=P[Se];for(D in W)W.hasOwnProperty(D)&&(h||(h={}),h[D]="")}else Se!=="dangerouslySetInnerHTML"&&Se!=="children"&&Se!=="suppressContentEditableWarning"&&Se!=="suppressHydrationWarning"&&Se!=="autoFocus"&&(i.hasOwnProperty(Se)?I||(I=[]):(I=I||[]).push(Se,null));for(Se in v){var J=v[Se];if(W=P!=null?P[Se]:void 0,v.hasOwnProperty(Se)&&J!==W&&(J!=null||W!=null))if(Se==="style")if(W){for(D in W)!W.hasOwnProperty(D)||J&&J.hasOwnProperty(D)||(h||(h={}),h[D]="");for(D in J)J.hasOwnProperty(D)&&W[D]!==J[D]&&(h||(h={}),h[D]=J[D])}else h||(I||(I=[]),I.push(Se,h)),h=J;else Se==="dangerouslySetInnerHTML"?(J=J?J.__html:void 0,W=W?W.__html:void 0,J!=null&&W!==J&&(I=I||[]).push(Se,J)):Se==="children"?typeof J!="string"&&typeof J!="number"||(I=I||[]).push(Se,""+J):Se!=="suppressContentEditableWarning"&&Se!=="suppressHydrationWarning"&&(i.hasOwnProperty(Se)?(J!=null&&Se==="onScroll"&&Lr("scroll",s),I||W===J||(I=[])):(I=I||[]).push(Se,J))}h&&(I=I||[]).push("style",h);var Se=I;(u.updateQueue=Se)&&(u.flags|=4)}},vR=function(s,u,h,v){h!==v&&(u.flags|=4)};function mh(s,u){if(!Gr)switch(s.tailMode){case"hidden":u=s.tail;for(var h=null;u!==null;)u.alternate!==null&&(h=u),u=u.sibling;h===null?s.tail=null:h.sibling=null;break;case"collapsed":h=s.tail;for(var v=null;h!==null;)h.alternate!==null&&(v=h),h=h.sibling;v===null?u||s.tail===null?s.tail=null:s.tail.sibling=null:v.sibling=null}}function li(s){var u=s.alternate!==null&&s.alternate.child===s.child,h=0,v=0;if(u)for(var P=s.child;P!==null;)h|=P.lanes|P.childLanes,v|=P.subtreeFlags&14680064,v|=P.flags&14680064,P.return=s,P=P.sibling;else for(P=s.child;P!==null;)h|=P.lanes|P.childLanes,v|=P.subtreeFlags,v|=P.flags,P.return=s,P=P.sibling;return s.subtreeFlags|=v,s.childLanes=h,u}function n6(s,u,h){var v=u.pendingProps;switch(Jw(u),u.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return li(u),null;case 1:return Ii(u.type)&&wv(),li(u),null;case 3:return v=u.stateNode,Zc(),Br(Ri),Br(ai),dS(),v.pendingContext&&(v.context=v.pendingContext,v.pendingContext=null),(s===null||s.child===null)&&(Cv(u)?u.flags|=4:s===null||s.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,Xo!==null&&(VS(Xo),Xo=null))),IS(s,u),li(u),null;case 5:uS(u);var P=bu(ch.current);if(h=u.type,s!==null&&u.stateNode!=null)mR(s,u,h,v,P),s.ref!==u.ref&&(u.flags|=512,u.flags|=2097152);else{if(!v){if(u.stateNode===null)throw Error(r(166));return li(u),null}if(s=bu(Ra.current),Cv(u)){v=u.stateNode,h=u.type;var I=u.memoizedProps;switch(v[Oa]=u,v[oh]=I,s=(u.mode&1)!==0,h){case"dialog":Lr("cancel",v),Lr("close",v);break;case"iframe":case"object":case"embed":Lr("load",v);break;case"video":case"audio":for(P=0;P<rh.length;P++)Lr(rh[P],v);break;case"source":Lr("error",v);break;case"img":case"image":case"link":Lr("error",v),Lr("load",v);break;case"details":Lr("toggle",v);break;case"input":he(v,I),Lr("invalid",v);break;case"select":v._wrapperState={wasMultiple:!!I.multiple},Lr("invalid",v);break;case"textarea":ht(v,I),Lr("invalid",v)}Oi(h,I),P=null;for(var D in I)if(I.hasOwnProperty(D)){var W=I[D];D==="children"?typeof W=="string"?v.textContent!==W&&(I.suppressHydrationWarning!==!0&&gv(v.textContent,W,s),P=["children",W]):typeof W=="number"&&v.textContent!==""+W&&(I.suppressHydrationWarning!==!0&&gv(v.textContent,W,s),P=["children",""+W]):i.hasOwnProperty(D)&&W!=null&&D==="onScroll"&&Lr("scroll",v)}switch(h){case"input":Y(v),$t(v,I,!0);break;case"textarea":Y(v),mn(v);break;case"select":case"option":break;default:typeof I.onClick=="function"&&(v.onclick=yv)}v=P,u.updateQueue=v,v!==null&&(u.flags|=4)}else{D=P.nodeType===9?P:P.ownerDocument,s==="http://www.w3.org/1999/xhtml"&&(s=Ir(h)),s==="http://www.w3.org/1999/xhtml"?h==="script"?(s=D.createElement("div"),s.innerHTML="<script><\/script>",s=s.removeChild(s.firstChild)):typeof v.is=="string"?s=D.createElement(h,{is:v.is}):(s=D.createElement(h),h==="select"&&(D=s,v.multiple?D.multiple=!0:v.size&&(D.size=v.size))):s=D.createElementNS(s,h),s[Oa]=u,s[oh]=v,pR(s,u,!1,!1),u.stateNode=s;e:{switch(D=gn(h,v),h){case"dialog":Lr("cancel",s),Lr("close",s),P=v;break;case"iframe":case"object":case"embed":Lr("load",s),P=v;break;case"video":case"audio":for(P=0;P<rh.length;P++)Lr(rh[P],s);P=v;break;case"source":Lr("error",s),P=v;break;case"img":case"image":case"link":Lr("error",s),Lr("load",s),P=v;break;case"details":Lr("toggle",s),P=v;break;case"input":he(s,v),P=Te(s,v),Lr("invalid",s);break;case"option":P=v;break;case"select":s._wrapperState={wasMultiple:!!v.multiple},P=Z({},v,{value:void 0}),Lr("invalid",s);break;case"textarea":ht(s,v),P=Lt(s,v),Lr("invalid",s);break;default:P=v}Oi(h,P),W=P;for(I in W)if(W.hasOwnProperty(I)){var J=W[I];I==="style"?xa(s,J):I==="dangerouslySetInnerHTML"?(J=J?J.__html:void 0,J!=null&&Nr(s,J)):I==="children"?typeof J=="string"?(h!=="textarea"||J!=="")&&an(s,J):typeof J=="number"&&an(s,""+J):I!=="suppressContentEditableWarning"&&I!=="suppressHydrationWarning"&&I!=="autoFocus"&&(i.hasOwnProperty(I)?J!=null&&I==="onScroll"&&Lr("scroll",s):J!=null&&C(s,I,J,D))}switch(h){case"input":Y(s),$t(s,v,!1);break;case"textarea":Y(s),mn(s);break;case"option":v.value!=null&&s.setAttribute("value",""+pe(v.value));break;case"select":s.multiple=!!v.multiple,I=v.value,I!=null?jt(s,!!v.multiple,I,!1):v.defaultValue!=null&&jt(s,!!v.multiple,v.defaultValue,!0);break;default:typeof P.onClick=="function"&&(s.onclick=yv)}switch(h){case"button":case"input":case"select":case"textarea":v=!!v.autoFocus;break e;case"img":v=!0;break e;default:v=!1}}v&&(u.flags|=4)}u.ref!==null&&(u.flags|=512,u.flags|=2097152)}return li(u),null;case 6:if(s&&u.stateNode!=null)vR(s,u,s.memoizedProps,v);else{if(typeof v!="string"&&u.stateNode===null)throw Error(r(166));if(h=bu(ch.current),bu(Ra.current),Cv(u)){if(v=u.stateNode,h=u.memoizedProps,v[Oa]=u,(I=v.nodeValue!==h)&&(s=Zi,s!==null))switch(s.tag){case 3:gv(v.nodeValue,h,(s.mode&1)!==0);break;case 5:s.memoizedProps.suppressHydrationWarning!==!0&&gv(v.nodeValue,h,(s.mode&1)!==0)}I&&(u.flags|=4)}else v=(h.nodeType===9?h:h.ownerDocument).createTextNode(v),v[Oa]=u,u.stateNode=v}return li(u),null;case 13:if(Br(Zr),v=u.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(Gr&&eo!==null&&(u.mode&1)!==0&&(u.flags&128)===0)bO(),Qc(),u.flags|=98560,I=!1;else if(I=Cv(u),v!==null&&v.dehydrated!==null){if(s===null){if(!I)throw Error(r(318));if(I=u.memoizedState,I=I!==null?I.dehydrated:null,!I)throw Error(r(317));I[Oa]=u}else Qc(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;li(u),I=!1}else Xo!==null&&(VS(Xo),Xo=null),I=!0;if(!I)return u.flags&65536?u:null}return(u.flags&128)!==0?(u.lanes=h,u):(v=v!==null,v!==(s!==null&&s.memoizedState!==null)&&v&&(u.child.flags|=8192,(u.mode&1)!==0&&(s===null||(Zr.current&1)!==0?On===0&&(On=3):US())),u.updateQueue!==null&&(u.flags|=4),li(u),null);case 4:return Zc(),IS(s,u),s===null&&nh(u.stateNode.containerInfo),li(u),null;case 10:return iS(u.type._context),li(u),null;case 17:return Ii(u.type)&&wv(),li(u),null;case 19:if(Br(Zr),I=u.memoizedState,I===null)return li(u),null;if(v=(u.flags&128)!==0,D=I.rendering,D===null)if(v)mh(I,!1);else{if(On!==0||s!==null&&(s.flags&128)!==0)for(s=u.child;s!==null;){if(D=kv(s),D!==null){for(u.flags|=128,mh(I,!1),v=D.updateQueue,v!==null&&(u.updateQueue=v,u.flags|=4),u.subtreeFlags=0,v=h,h=u.child;h!==null;)I=h,s=v,I.flags&=14680066,D=I.alternate,D===null?(I.childLanes=0,I.lanes=s,I.child=null,I.subtreeFlags=0,I.memoizedProps=null,I.memoizedState=null,I.updateQueue=null,I.dependencies=null,I.stateNode=null):(I.childLanes=D.childLanes,I.lanes=D.lanes,I.child=D.child,I.subtreeFlags=0,I.deletions=null,I.memoizedProps=D.memoizedProps,I.memoizedState=D.memoizedState,I.updateQueue=D.updateQueue,I.type=D.type,s=D.dependencies,I.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),h=h.sibling;return $r(Zr,Zr.current&1|2),u.child}s=s.sibling}I.tail!==null&&Et()>nd&&(u.flags|=128,v=!0,mh(I,!1),u.lanes=4194304)}else{if(!v)if(s=kv(D),s!==null){if(u.flags|=128,v=!0,h=s.updateQueue,h!==null&&(u.updateQueue=h,u.flags|=4),mh(I,!0),I.tail===null&&I.tailMode==="hidden"&&!D.alternate&&!Gr)return li(u),null}else 2*Et()-I.renderingStartTime>nd&&h!==1073741824&&(u.flags|=128,v=!0,mh(I,!1),u.lanes=4194304);I.isBackwards?(D.sibling=u.child,u.child=D):(h=I.last,h!==null?h.sibling=D:u.child=D,I.last=D)}return I.tail!==null?(u=I.tail,I.rendering=u,I.tail=u.sibling,I.renderingStartTime=Et(),u.sibling=null,h=Zr.current,$r(Zr,v?h&1|2:h&1),u):(li(u),null);case 22:case 23:return qS(),v=u.memoizedState!==null,s!==null&&s.memoizedState!==null!==v&&(u.flags|=8192),v&&(u.mode&1)!==0?(to&1073741824)!==0&&(li(u),u.subtreeFlags&6&&(u.flags|=8192)):li(u),null;case 24:return null;case 25:return null}throw Error(r(156,u.tag))}function i6(s,u){switch(Jw(u),u.tag){case 1:return Ii(u.type)&&wv(),s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 3:return Zc(),Br(Ri),Br(ai),dS(),s=u.flags,(s&65536)!==0&&(s&128)===0?(u.flags=s&-65537|128,u):null;case 5:return uS(u),null;case 13:if(Br(Zr),s=u.memoizedState,s!==null&&s.dehydrated!==null){if(u.alternate===null)throw Error(r(340));Qc()}return s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 19:return Br(Zr),null;case 4:return Zc(),null;case 10:return iS(u.type._context),null;case 22:case 23:return qS(),null;case 24:return null;default:return null}}var Bv=!1,ui=!1,o6=typeof WeakSet=="function"?WeakSet:Set,Ke=null;function td(s,u){var h=s.ref;if(h!==null)if(typeof h=="function")try{h(null)}catch(v){un(s,u,v)}else h.current=null}function kS(s,u,h){try{h()}catch(v){un(s,u,v)}}var gR=!1;function a6(s,u){if(qw=z,s=QT(),Dw(s)){if("selectionStart"in s)var h={start:s.selectionStart,end:s.selectionEnd};else e:{h=(h=s.ownerDocument)&&h.defaultView||window;var v=h.getSelection&&h.getSelection();if(v&&v.rangeCount!==0){h=v.anchorNode;var P=v.anchorOffset,I=v.focusNode;v=v.focusOffset;try{h.nodeType,I.nodeType}catch{h=null;break e}var D=0,W=-1,J=-1,Se=0,ke=0,Ae=s,Ie=null;t:for(;;){for(var He;Ae!==h||P!==0&&Ae.nodeType!==3||(W=D+P),Ae!==I||v!==0&&Ae.nodeType!==3||(J=D+v),Ae.nodeType===3&&(D+=Ae.nodeValue.length),(He=Ae.firstChild)!==null;)Ie=Ae,Ae=He;for(;;){if(Ae===s)break t;if(Ie===h&&++Se===P&&(W=D),Ie===I&&++ke===v&&(J=D),(He=Ae.nextSibling)!==null)break;Ae=Ie,Ie=Ae.parentNode}Ae=He}h=W===-1||J===-1?null:{start:W,end:J}}else h=null}h=h||{start:0,end:0}}else h=null;for(Uw={focusedElem:s,selectionRange:h},z=!1,Ke=u;Ke!==null;)if(u=Ke,s=u.child,(u.subtreeFlags&1028)!==0&&s!==null)s.return=u,Ke=s;else for(;Ke!==null;){u=Ke;try{var Xe=u.alternate;if((u.flags&1024)!==0)switch(u.tag){case 0:case 11:case 15:break;case 1:if(Xe!==null){var et=Xe.memoizedProps,yn=Xe.memoizedState,fe=u.stateNode,re=fe.getSnapshotBeforeUpdate(u.elementType===u.type?et:Jo(u.type,et),yn);fe.__reactInternalSnapshotBeforeUpdate=re}break;case 3:var me=u.stateNode.containerInfo;me.nodeType===1?me.textContent="":me.nodeType===9&&me.documentElement&&me.removeChild(me.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(Fe){un(u,u.return,Fe)}if(s=u.sibling,s!==null){s.return=u.return,Ke=s;break}Ke=u.return}return Xe=gR,gR=!1,Xe}function vh(s,u,h){var v=u.updateQueue;if(v=v!==null?v.lastEffect:null,v!==null){var P=v=v.next;do{if((P.tag&s)===s){var I=P.destroy;P.destroy=void 0,I!==void 0&&kS(u,h,I)}P=P.next}while(P!==v)}}function Vv(s,u){if(u=u.updateQueue,u=u!==null?u.lastEffect:null,u!==null){var h=u=u.next;do{if((h.tag&s)===s){var v=h.create;h.destroy=v()}h=h.next}while(h!==u)}}function jS(s){var u=s.ref;if(u!==null){var h=s.stateNode;switch(s.tag){case 5:s=h;break;default:s=h}typeof u=="function"?u(s):u.current=s}}function yR(s){var u=s.alternate;u!==null&&(s.alternate=null,yR(u)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(u=s.stateNode,u!==null&&(delete u[Oa],delete u[oh],delete u[Gw],delete u[zz],delete u[qz])),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}function bR(s){return s.tag===5||s.tag===3||s.tag===4}function wR(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||bR(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function $S(s,u,h){var v=s.tag;if(v===5||v===6)s=s.stateNode,u?h.nodeType===8?h.parentNode.insertBefore(s,u):h.insertBefore(s,u):(h.nodeType===8?(u=h.parentNode,u.insertBefore(s,h)):(u=h,u.appendChild(s)),h=h._reactRootContainer,h!=null||u.onclick!==null||(u.onclick=yv));else if(v!==4&&(s=s.child,s!==null))for($S(s,u,h),s=s.sibling;s!==null;)$S(s,u,h),s=s.sibling}function AS(s,u,h){var v=s.tag;if(v===5||v===6)s=s.stateNode,u?h.insertBefore(s,u):h.appendChild(s);else if(v!==4&&(s=s.child,s!==null))for(AS(s,u,h),s=s.sibling;s!==null;)AS(s,u,h),s=s.sibling}var Un=null,Zo=!1;function ul(s,u,h){for(h=h.child;h!==null;)SR(s,u,h),h=h.sibling}function SR(s,u,h){if(ln&&typeof ln.onCommitFiberUnmount=="function")try{ln.onCommitFiberUnmount(gi,h)}catch{}switch(h.tag){case 5:ui||td(h,u);case 6:var v=Un,P=Zo;Un=null,ul(s,u,h),Un=v,Zo=P,Un!==null&&(Zo?(s=Un,h=h.stateNode,s.nodeType===8?s.parentNode.removeChild(h):s.removeChild(h)):Un.removeChild(h.stateNode));break;case 18:Un!==null&&(Zo?(s=Un,h=h.stateNode,s.nodeType===8?Kw(s.parentNode,h):s.nodeType===1&&Kw(s,h),Zs(s)):Kw(Un,h.stateNode));break;case 4:v=Un,P=Zo,Un=h.stateNode.containerInfo,Zo=!0,ul(s,u,h),Un=v,Zo=P;break;case 0:case 11:case 14:case 15:if(!ui&&(v=h.updateQueue,v!==null&&(v=v.lastEffect,v!==null))){P=v=v.next;do{var I=P,D=I.destroy;I=I.tag,D!==void 0&&((I&2)!==0||(I&4)!==0)&&kS(h,u,D),P=P.next}while(P!==v)}ul(s,u,h);break;case 1:if(!ui&&(td(h,u),v=h.stateNode,typeof v.componentWillUnmount=="function"))try{v.props=h.memoizedProps,v.state=h.memoizedState,v.componentWillUnmount()}catch(W){un(h,u,W)}ul(s,u,h);break;case 21:ul(s,u,h);break;case 22:h.mode&1?(ui=(v=ui)||h.memoizedState!==null,ul(s,u,h),ui=v):ul(s,u,h);break;default:ul(s,u,h)}}function _R(s){var u=s.updateQueue;if(u!==null){s.updateQueue=null;var h=s.stateNode;h===null&&(h=s.stateNode=new o6),u.forEach(function(v){var P=m6.bind(null,s,v);h.has(v)||(h.add(v),v.then(P,P))})}}function ea(s,u){var h=u.deletions;if(h!==null)for(var v=0;v<h.length;v++){var P=h[v];try{var I=s,D=u,W=D;e:for(;W!==null;){switch(W.tag){case 5:Un=W.stateNode,Zo=!1;break e;case 3:Un=W.stateNode.containerInfo,Zo=!0;break e;case 4:Un=W.stateNode.containerInfo,Zo=!0;break e}W=W.return}if(Un===null)throw Error(r(160));SR(I,D,P),Un=null,Zo=!1;var J=P.alternate;J!==null&&(J.return=null),P.return=null}catch(Se){un(P,u,Se)}}if(u.subtreeFlags&12854)for(u=u.child;u!==null;)xR(u,s),u=u.sibling}function xR(s,u){var h=s.alternate,v=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:if(ea(u,s),ka(s),v&4){try{vh(3,s,s.return),Vv(3,s)}catch(et){un(s,s.return,et)}try{vh(5,s,s.return)}catch(et){un(s,s.return,et)}}break;case 1:ea(u,s),ka(s),v&512&&h!==null&&td(h,h.return);break;case 5:if(ea(u,s),ka(s),v&512&&h!==null&&td(h,h.return),s.flags&32){var P=s.stateNode;try{an(P,"")}catch(et){un(s,s.return,et)}}if(v&4&&(P=s.stateNode,P!=null)){var I=s.memoizedProps,D=h!==null?h.memoizedProps:I,W=s.type,J=s.updateQueue;if(s.updateQueue=null,J!==null)try{W==="input"&&I.type==="radio"&&I.name!=null&&Ce(P,I),gn(W,D);var Se=gn(W,I);for(D=0;D<J.length;D+=2){var ke=J[D],Ae=J[D+1];ke==="style"?xa(P,Ae):ke==="dangerouslySetInnerHTML"?Nr(P,Ae):ke==="children"?an(P,Ae):C(P,ke,Ae,Se)}switch(W){case"input":Ge(P,I);break;case"textarea":on(P,I);break;case"select":var Ie=P._wrapperState.wasMultiple;P._wrapperState.wasMultiple=!!I.multiple;var He=I.value;He!=null?jt(P,!!I.multiple,He,!1):Ie!==!!I.multiple&&(I.defaultValue!=null?jt(P,!!I.multiple,I.defaultValue,!0):jt(P,!!I.multiple,I.multiple?[]:"",!1))}P[oh]=I}catch(et){un(s,s.return,et)}}break;case 6:if(ea(u,s),ka(s),v&4){if(s.stateNode===null)throw Error(r(162));P=s.stateNode,I=s.memoizedProps;try{P.nodeValue=I}catch(et){un(s,s.return,et)}}break;case 3:if(ea(u,s),ka(s),v&4&&h!==null&&h.memoizedState.isDehydrated)try{Zs(u.containerInfo)}catch(et){un(s,s.return,et)}break;case 4:ea(u,s),ka(s);break;case 13:ea(u,s),ka(s),P=s.child,P.flags&8192&&(I=P.memoizedState!==null,P.stateNode.isHidden=I,!I||P.alternate!==null&&P.alternate.memoizedState!==null||(NS=Et())),v&4&&_R(s);break;case 22:if(ke=h!==null&&h.memoizedState!==null,s.mode&1?(ui=(Se=ui)||ke,ea(u,s),ui=Se):ea(u,s),ka(s),v&8192){if(Se=s.memoizedState!==null,(s.stateNode.isHidden=Se)&&!ke&&(s.mode&1)!==0)for(Ke=s,ke=s.child;ke!==null;){for(Ae=Ke=ke;Ke!==null;){switch(Ie=Ke,He=Ie.child,Ie.tag){case 0:case 11:case 14:case 15:vh(4,Ie,Ie.return);break;case 1:td(Ie,Ie.return);var Xe=Ie.stateNode;if(typeof Xe.componentWillUnmount=="function"){v=Ie,h=Ie.return;try{u=v,Xe.props=u.memoizedProps,Xe.state=u.memoizedState,Xe.componentWillUnmount()}catch(et){un(v,h,et)}}break;case 5:td(Ie,Ie.return);break;case 22:if(Ie.memoizedState!==null){ER(Ae);continue}}He!==null?(He.return=Ie,Ke=He):ER(Ae)}ke=ke.sibling}e:for(ke=null,Ae=s;;){if(Ae.tag===5){if(ke===null){ke=Ae;try{P=Ae.stateNode,Se?(I=P.style,typeof I.setProperty=="function"?I.setProperty("display","none","important"):I.display="none"):(W=Ae.stateNode,J=Ae.memoizedProps.style,D=J!=null&&J.hasOwnProperty("display")?J.display:null,W.style.display=Yi("display",D))}catch(et){un(s,s.return,et)}}}else if(Ae.tag===6){if(ke===null)try{Ae.stateNode.nodeValue=Se?"":Ae.memoizedProps}catch(et){un(s,s.return,et)}}else if((Ae.tag!==22&&Ae.tag!==23||Ae.memoizedState===null||Ae===s)&&Ae.child!==null){Ae.child.return=Ae,Ae=Ae.child;continue}if(Ae===s)break e;for(;Ae.sibling===null;){if(Ae.return===null||Ae.return===s)break e;ke===Ae&&(ke=null),Ae=Ae.return}ke===Ae&&(ke=null),Ae.sibling.return=Ae.return,Ae=Ae.sibling}}break;case 19:ea(u,s),ka(s),v&4&&_R(s);break;case 21:break;default:ea(u,s),ka(s)}}function ka(s){var u=s.flags;if(u&2){try{e:{for(var h=s.return;h!==null;){if(bR(h)){var v=h;break e}h=h.return}throw Error(r(160))}switch(v.tag){case 5:var P=v.stateNode;v.flags&32&&(an(P,""),v.flags&=-33);var I=wR(s);AS(s,I,P);break;case 3:case 4:var D=v.stateNode.containerInfo,W=wR(s);$S(s,W,D);break;default:throw Error(r(161))}}catch(J){un(s,s.return,J)}s.flags&=-3}u&4096&&(s.flags&=-4097)}function s6(s,u,h){Ke=s,PR(s)}function PR(s,u,h){for(var v=(s.mode&1)!==0;Ke!==null;){var P=Ke,I=P.child;if(P.tag===22&&v){var D=P.memoizedState!==null||Bv;if(!D){var W=P.alternate,J=W!==null&&W.memoizedState!==null||ui;W=Bv;var Se=ui;if(Bv=D,(ui=J)&&!Se)for(Ke=P;Ke!==null;)D=Ke,J=D.child,D.tag===22&&D.memoizedState!==null?TR(P):J!==null?(J.return=D,Ke=J):TR(P);for(;I!==null;)Ke=I,PR(I),I=I.sibling;Ke=P,Bv=W,ui=Se}CR(s)}else(P.subtreeFlags&8772)!==0&&I!==null?(I.return=P,Ke=I):CR(s)}}function CR(s){for(;Ke!==null;){var u=Ke;if((u.flags&8772)!==0){var h=u.alternate;try{if((u.flags&8772)!==0)switch(u.tag){case 0:case 11:case 15:ui||Vv(5,u);break;case 1:var v=u.stateNode;if(u.flags&4&&!ui)if(h===null)v.componentDidMount();else{var P=u.elementType===u.type?h.memoizedProps:Jo(u.type,h.memoizedProps);v.componentDidUpdate(P,h.memoizedState,v.__reactInternalSnapshotBeforeUpdate)}var I=u.updateQueue;I!==null&&EO(u,I,v);break;case 3:var D=u.updateQueue;if(D!==null){if(h=null,u.child!==null)switch(u.child.tag){case 5:h=u.child.stateNode;break;case 1:h=u.child.stateNode}EO(u,D,h)}break;case 5:var W=u.stateNode;if(h===null&&u.flags&4){h=W;var J=u.memoizedProps;switch(u.type){case"button":case"input":case"select":case"textarea":J.autoFocus&&h.focus();break;case"img":J.src&&(h.src=J.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(u.memoizedState===null){var Se=u.alternate;if(Se!==null){var ke=Se.memoizedState;if(ke!==null){var Ae=ke.dehydrated;Ae!==null&&Zs(Ae)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}ui||u.flags&512&&jS(u)}catch(Ie){un(u,u.return,Ie)}}if(u===s){Ke=null;break}if(h=u.sibling,h!==null){h.return=u.return,Ke=h;break}Ke=u.return}}function ER(s){for(;Ke!==null;){var u=Ke;if(u===s){Ke=null;break}var h=u.sibling;if(h!==null){h.return=u.return,Ke=h;break}Ke=u.return}}function TR(s){for(;Ke!==null;){var u=Ke;try{switch(u.tag){case 0:case 11:case 15:var h=u.return;try{Vv(4,u)}catch(J){un(u,h,J)}break;case 1:var v=u.stateNode;if(typeof v.componentDidMount=="function"){var P=u.return;try{v.componentDidMount()}catch(J){un(u,P,J)}}var I=u.return;try{jS(u)}catch(J){un(u,I,J)}break;case 5:var D=u.return;try{jS(u)}catch(J){un(u,D,J)}}}catch(J){un(u,u.return,J)}if(u===s){Ke=null;break}var W=u.sibling;if(W!==null){W.return=u.return,Ke=W;break}Ke=u.return}}var l6=Math.ceil,zv=k.ReactCurrentDispatcher,DS=k.ReactCurrentOwner,Eo=k.ReactCurrentBatchConfig,ir=0,Dn=null,Sn=null,Hn=0,to=0,rd=il(0),On=0,gh=null,Su=0,qv=0,MS=0,yh=null,ji=null,NS=0,nd=1/0,vs=null,Uv=!1,FS=null,cl=null,Hv=!1,dl=null,Wv=0,bh=0,LS=null,Kv=-1,Gv=0;function bi(){return(ir&6)!==0?Et():Kv!==-1?Kv:Kv=Et()}function fl(s){return(s.mode&1)===0?1:(ir&2)!==0&&Hn!==0?Hn&-Hn:Hz.transition!==null?(Gv===0&&(Gv=ov()),Gv):(s=sr,s!==0||(s=window.event,s=s===void 0?16:kr(s.type)),s)}function ta(s,u,h,v){if(50<bh)throw bh=0,LS=null,Error(r(185));du(s,h,v),((ir&2)===0||s!==Dn)&&(s===Dn&&((ir&2)===0&&(qv|=h),On===4&&hl(s,Hn)),$i(s,v),h===1&&ir===0&&(u.mode&1)===0&&(nd=Et()+500,_v&&al()))}function $i(s,u){var h=s.callbackNode;zf(s,u);var v=go(s,s===Dn?Hn:0);if(v===0)h!==null&&Gt(h),s.callbackNode=null,s.callbackPriority=0;else if(u=v&-v,s.callbackPriority!==u){if(h!=null&&Gt(h),u===1)s.tag===0?Uz(RR.bind(null,s)):pO(RR.bind(null,s)),Bz(function(){(ir&6)===0&&al()}),h=null;else{switch(av(v)){case 1:h=Fr;break;case 4:h=mi;break;case 16:h=ei;break;case 536870912:h=vi;break;default:h=ei}h=NR(h,OR.bind(null,s))}s.callbackPriority=u,s.callbackNode=h}}function OR(s,u){if(Kv=-1,Gv=0,(ir&6)!==0)throw Error(r(327));var h=s.callbackNode;if(id()&&s.callbackNode!==h)return null;var v=go(s,s===Dn?Hn:0);if(v===0)return null;if((v&30)!==0||(v&s.expiredLanes)!==0||u)u=Qv(s,v);else{u=v;var P=ir;ir|=2;var I=kR();(Dn!==s||Hn!==u)&&(vs=null,nd=Et()+500,xu(s,u));do try{d6();break}catch(W){IR(s,W)}while(!0);nS(),zv.current=I,ir=P,Sn!==null?u=0:(Dn=null,Hn=0,u=On)}if(u!==0){if(u===2&&(P=qf(s),P!==0&&(v=P,u=BS(s,P))),u===1)throw h=gh,xu(s,0),hl(s,v),$i(s,Et()),h;if(u===6)hl(s,v);else{if(P=s.current.alternate,(v&30)===0&&!u6(P)&&(u=Qv(s,v),u===2&&(I=qf(s),I!==0&&(v=I,u=BS(s,I))),u===1))throw h=gh,xu(s,0),hl(s,v),$i(s,Et()),h;switch(s.finishedWork=P,s.finishedLanes=v,u){case 0:case 1:throw Error(r(345));case 2:Pu(s,ji,vs);break;case 3:if(hl(s,v),(v&130023424)===v&&(u=NS+500-Et(),10<u)){if(go(s,0)!==0)break;if(P=s.suspendedLanes,(P&v)!==v){bi(),s.pingedLanes|=s.suspendedLanes&P;break}s.timeoutHandle=Ww(Pu.bind(null,s,ji,vs),u);break}Pu(s,ji,vs);break;case 4:if(hl(s,v),(v&4194240)===v)break;for(u=s.eventTimes,P=-1;0<v;){var D=31-ri(v);I=1<<D,D=u[D],D>P&&(P=D),v&=~I}if(v=P,v=Et()-v,v=(120>v?120:480>v?480:1080>v?1080:1920>v?1920:3e3>v?3e3:4320>v?4320:1960*l6(v/1960))-v,10<v){s.timeoutHandle=Ww(Pu.bind(null,s,ji,vs),v);break}Pu(s,ji,vs);break;case 5:Pu(s,ji,vs);break;default:throw Error(r(329))}}}return $i(s,Et()),s.callbackNode===h?OR.bind(null,s):null}function BS(s,u){var h=yh;return s.current.memoizedState.isDehydrated&&(xu(s,u).flags|=256),s=Qv(s,u),s!==2&&(u=ji,ji=h,u!==null&&VS(u)),s}function VS(s){ji===null?ji=s:ji.push.apply(ji,s)}function u6(s){for(var u=s;;){if(u.flags&16384){var h=u.updateQueue;if(h!==null&&(h=h.stores,h!==null))for(var v=0;v<h.length;v++){var P=h[v],I=P.getSnapshot;P=P.value;try{if(!Yo(I(),P))return!1}catch{return!1}}}if(h=u.child,u.subtreeFlags&16384&&h!==null)h.return=u,u=h;else{if(u===s)break;for(;u.sibling===null;){if(u.return===null||u.return===s)return!0;u=u.return}u.sibling.return=u.return,u=u.sibling}}return!0}function hl(s,u){for(u&=~MS,u&=~qv,s.suspendedLanes|=u,s.pingedLanes&=~u,s=s.expirationTimes;0<u;){var h=31-ri(u),v=1<<h;s[h]=-1,u&=~v}}function RR(s){if((ir&6)!==0)throw Error(r(327));id();var u=go(s,0);if((u&1)===0)return $i(s,Et()),null;var h=Qv(s,u);if(s.tag!==0&&h===2){var v=qf(s);v!==0&&(u=v,h=BS(s,v))}if(h===1)throw h=gh,xu(s,0),hl(s,u),$i(s,Et()),h;if(h===6)throw Error(r(345));return s.finishedWork=s.current.alternate,s.finishedLanes=u,Pu(s,ji,vs),$i(s,Et()),null}function zS(s,u){var h=ir;ir|=1;try{return s(u)}finally{ir=h,ir===0&&(nd=Et()+500,_v&&al())}}function _u(s){dl!==null&&dl.tag===0&&(ir&6)===0&&id();var u=ir;ir|=1;var h=Eo.transition,v=sr;try{if(Eo.transition=null,sr=1,s)return s()}finally{sr=v,Eo.transition=h,ir=u,(ir&6)===0&&al()}}function qS(){to=rd.current,Br(rd)}function xu(s,u){s.finishedWork=null,s.finishedLanes=0;var h=s.timeoutHandle;if(h!==-1&&(s.timeoutHandle=-1,Lz(h)),Sn!==null)for(h=Sn.return;h!==null;){var v=h;switch(Jw(v),v.tag){case 1:v=v.type.childContextTypes,v!=null&&wv();break;case 3:Zc(),Br(Ri),Br(ai),dS();break;case 5:uS(v);break;case 4:Zc();break;case 13:Br(Zr);break;case 19:Br(Zr);break;case 10:iS(v.type._context);break;case 22:case 23:qS()}h=h.return}if(Dn=s,Sn=s=pl(s.current,null),Hn=to=u,On=0,gh=null,MS=qv=Su=0,ji=yh=null,yu!==null){for(u=0;u<yu.length;u++)if(h=yu[u],v=h.interleaved,v!==null){h.interleaved=null;var P=v.next,I=h.pending;if(I!==null){var D=I.next;I.next=P,v.next=D}h.pending=v}yu=null}return s}function IR(s,u){do{var h=Sn;try{if(nS(),jv.current=Mv,$v){for(var v=en.memoizedState;v!==null;){var P=v.queue;P!==null&&(P.pending=null),v=v.next}$v=!1}if(wu=0,An=Tn=en=null,dh=!1,fh=0,DS.current=null,h===null||h.return===null){On=1,gh=u,Sn=null;break}e:{var I=s,D=h.return,W=h,J=u;if(u=Hn,W.flags|=32768,J!==null&&typeof J=="object"&&typeof J.then=="function"){var Se=J,ke=W,Ae=ke.tag;if((ke.mode&1)===0&&(Ae===0||Ae===11||Ae===15)){var Ie=ke.alternate;Ie?(ke.updateQueue=Ie.updateQueue,ke.memoizedState=Ie.memoizedState,ke.lanes=Ie.lanes):(ke.updateQueue=null,ke.memoizedState=null)}var He=tR(D);if(He!==null){He.flags&=-257,rR(He,D,W,I,u),He.mode&1&&eR(I,Se,u),u=He,J=Se;var Xe=u.updateQueue;if(Xe===null){var et=new Set;et.add(J),u.updateQueue=et}else Xe.add(J);break e}else{if((u&1)===0){eR(I,Se,u),US();break e}J=Error(r(426))}}else if(Gr&&W.mode&1){var yn=tR(D);if(yn!==null){(yn.flags&65536)===0&&(yn.flags|=256),rR(yn,D,W,I,u),tS(ed(J,W));break e}}I=J=ed(J,W),On!==4&&(On=2),yh===null?yh=[I]:yh.push(I),I=D;do{switch(I.tag){case 3:I.flags|=65536,u&=-u,I.lanes|=u;var fe=JO(I,J,u);CO(I,fe);break e;case 1:W=J;var re=I.type,me=I.stateNode;if((I.flags&128)===0&&(typeof re.getDerivedStateFromError=="function"||me!==null&&typeof me.componentDidCatch=="function"&&(cl===null||!cl.has(me)))){I.flags|=65536,u&=-u,I.lanes|=u;var Fe=ZO(I,W,u);CO(I,Fe);break e}}I=I.return}while(I!==null)}$R(h)}catch(nt){u=nt,Sn===h&&h!==null&&(Sn=h=h.return);continue}break}while(!0)}function kR(){var s=zv.current;return zv.current=Mv,s===null?Mv:s}function US(){(On===0||On===3||On===2)&&(On=4),Dn===null||(Su&268435455)===0&&(qv&268435455)===0||hl(Dn,Hn)}function Qv(s,u){var h=ir;ir|=2;var v=kR();(Dn!==s||Hn!==u)&&(vs=null,xu(s,u));do try{c6();break}catch(P){IR(s,P)}while(!0);if(nS(),ir=h,zv.current=v,Sn!==null)throw Error(r(261));return Dn=null,Hn=0,On}function c6(){for(;Sn!==null;)jR(Sn)}function d6(){for(;Sn!==null&&!it();)jR(Sn)}function jR(s){var u=MR(s.alternate,s,to);s.memoizedProps=s.pendingProps,u===null?$R(s):Sn=u,DS.current=null}function $R(s){var u=s;do{var h=u.alternate;if(s=u.return,(u.flags&32768)===0){if(h=n6(h,u,to),h!==null){Sn=h;return}}else{if(h=i6(h,u),h!==null){h.flags&=32767,Sn=h;return}if(s!==null)s.flags|=32768,s.subtreeFlags=0,s.deletions=null;else{On=6,Sn=null;return}}if(u=u.sibling,u!==null){Sn=u;return}Sn=u=s}while(u!==null);On===0&&(On=5)}function Pu(s,u,h){var v=sr,P=Eo.transition;try{Eo.transition=null,sr=1,f6(s,u,h,v)}finally{Eo.transition=P,sr=v}return null}function f6(s,u,h,v){do id();while(dl!==null);if((ir&6)!==0)throw Error(r(327));h=s.finishedWork;var P=s.finishedLanes;if(h===null)return null;if(s.finishedWork=null,s.finishedLanes=0,h===s.current)throw Error(r(177));s.callbackNode=null,s.callbackPriority=0;var I=h.lanes|h.childLanes;if(Pw(s,I),s===Dn&&(Sn=Dn=null,Hn=0),(h.subtreeFlags&2064)===0&&(h.flags&2064)===0||Hv||(Hv=!0,NR(ei,function(){return id(),null})),I=(h.flags&15990)!==0,(h.subtreeFlags&15990)!==0||I){I=Eo.transition,Eo.transition=null;var D=sr;sr=1;var W=ir;ir|=4,DS.current=null,a6(s,h),xR(h,s),jz(Uw),z=!!qw,Uw=qw=null,s.current=h,s6(h),Ct(),ir=W,sr=D,Eo.transition=I}else s.current=h;if(Hv&&(Hv=!1,dl=s,Wv=P),I=s.pendingLanes,I===0&&(cl=null),as(h.stateNode),$i(s,Et()),u!==null)for(v=s.onRecoverableError,h=0;h<u.length;h++)P=u[h],v(P.value,{componentStack:P.stack,digest:P.digest});if(Uv)throw Uv=!1,s=FS,FS=null,s;return(Wv&1)!==0&&s.tag!==0&&id(),I=s.pendingLanes,(I&1)!==0?s===LS?bh++:(bh=0,LS=s):bh=0,al(),null}function id(){if(dl!==null){var s=av(Wv),u=Eo.transition,h=sr;try{if(Eo.transition=null,sr=16>s?16:s,dl===null)var v=!1;else{if(s=dl,dl=null,Wv=0,(ir&6)!==0)throw Error(r(331));var P=ir;for(ir|=4,Ke=s.current;Ke!==null;){var I=Ke,D=I.child;if((Ke.flags&16)!==0){var W=I.deletions;if(W!==null){for(var J=0;J<W.length;J++){var Se=W[J];for(Ke=Se;Ke!==null;){var ke=Ke;switch(ke.tag){case 0:case 11:case 15:vh(8,ke,I)}var Ae=ke.child;if(Ae!==null)Ae.return=ke,Ke=Ae;else for(;Ke!==null;){ke=Ke;var Ie=ke.sibling,He=ke.return;if(yR(ke),ke===Se){Ke=null;break}if(Ie!==null){Ie.return=He,Ke=Ie;break}Ke=He}}}var Xe=I.alternate;if(Xe!==null){var et=Xe.child;if(et!==null){Xe.child=null;do{var yn=et.sibling;et.sibling=null,et=yn}while(et!==null)}}Ke=I}}if((I.subtreeFlags&2064)!==0&&D!==null)D.return=I,Ke=D;else e:for(;Ke!==null;){if(I=Ke,(I.flags&2048)!==0)switch(I.tag){case 0:case 11:case 15:vh(9,I,I.return)}var fe=I.sibling;if(fe!==null){fe.return=I.return,Ke=fe;break e}Ke=I.return}}var re=s.current;for(Ke=re;Ke!==null;){D=Ke;var me=D.child;if((D.subtreeFlags&2064)!==0&&me!==null)me.return=D,Ke=me;else e:for(D=re;Ke!==null;){if(W=Ke,(W.flags&2048)!==0)try{switch(W.tag){case 0:case 11:case 15:Vv(9,W)}}catch(nt){un(W,W.return,nt)}if(W===D){Ke=null;break e}var Fe=W.sibling;if(Fe!==null){Fe.return=W.return,Ke=Fe;break e}Ke=W.return}}if(ir=P,al(),ln&&typeof ln.onPostCommitFiberRoot=="function")try{ln.onPostCommitFiberRoot(gi,s)}catch{}v=!0}return v}finally{sr=h,Eo.transition=u}}return!1}function AR(s,u,h){u=ed(h,u),u=JO(s,u,1),s=ll(s,u,1),u=bi(),s!==null&&(du(s,1,u),$i(s,u))}function un(s,u,h){if(s.tag===3)AR(s,s,h);else for(;u!==null;){if(u.tag===3){AR(u,s,h);break}else if(u.tag===1){var v=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof v.componentDidCatch=="function"&&(cl===null||!cl.has(v))){s=ed(h,s),s=ZO(u,s,1),u=ll(u,s,1),s=bi(),u!==null&&(du(u,1,s),$i(u,s));break}}u=u.return}}function h6(s,u,h){var v=s.pingCache;v!==null&&v.delete(u),u=bi(),s.pingedLanes|=s.suspendedLanes&h,Dn===s&&(Hn&h)===h&&(On===4||On===3&&(Hn&130023424)===Hn&&500>Et()-NS?xu(s,0):MS|=h),$i(s,u)}function DR(s,u){u===0&&((s.mode&1)===0?u=1:(u=ss,ss<<=1,(ss&130023424)===0&&(ss=4194304)));var h=bi();s=hs(s,u),s!==null&&(du(s,u,h),$i(s,h))}function p6(s){var u=s.memoizedState,h=0;u!==null&&(h=u.retryLane),DR(s,h)}function m6(s,u){var h=0;switch(s.tag){case 13:var v=s.stateNode,P=s.memoizedState;P!==null&&(h=P.retryLane);break;case 19:v=s.stateNode;break;default:throw Error(r(314))}v!==null&&v.delete(u),DR(s,h)}var MR;MR=function(s,u,h){if(s!==null)if(s.memoizedProps!==u.pendingProps||Ri.current)ki=!0;else{if((s.lanes&h)===0&&(u.flags&128)===0)return ki=!1,r6(s,u,h);ki=(s.flags&131072)!==0}else ki=!1,Gr&&(u.flags&1048576)!==0&&mO(u,Pv,u.index);switch(u.lanes=0,u.tag){case 2:var v=u.type;Lv(s,u),s=u.pendingProps;var P=Wc(u,ai.current);Jc(u,h),P=pS(null,u,v,s,P,h);var I=mS();return u.flags|=1,typeof P=="object"&&P!==null&&typeof P.render=="function"&&P.$$typeof===void 0?(u.tag=1,u.memoizedState=null,u.updateQueue=null,Ii(v)?(I=!0,Sv(u)):I=!1,u.memoizedState=P.state!==null&&P.state!==void 0?P.state:null,sS(u),P.updater=Nv,u.stateNode=P,P._reactInternals=u,SS(u,v,s,h),u=CS(null,u,v,!0,I,h)):(u.tag=0,Gr&&I&&Xw(u),yi(null,u,P,h),u=u.child),u;case 16:v=u.elementType;e:{switch(Lv(s,u),s=u.pendingProps,P=v._init,v=P(v._payload),u.type=v,P=u.tag=g6(v),s=Jo(v,s),P){case 0:u=PS(null,u,v,s,h);break e;case 1:u=lR(null,u,v,s,h);break e;case 11:u=nR(null,u,v,s,h);break e;case 14:u=iR(null,u,v,Jo(v.type,s),h);break e}throw Error(r(306,v,""))}return u;case 0:return v=u.type,P=u.pendingProps,P=u.elementType===v?P:Jo(v,P),PS(s,u,v,P,h);case 1:return v=u.type,P=u.pendingProps,P=u.elementType===v?P:Jo(v,P),lR(s,u,v,P,h);case 3:e:{if(uR(u),s===null)throw Error(r(387));v=u.pendingProps,I=u.memoizedState,P=I.element,PO(s,u),Iv(u,v,null,h);var D=u.memoizedState;if(v=D.element,I.isDehydrated)if(I={element:v,isDehydrated:!1,cache:D.cache,pendingSuspenseBoundaries:D.pendingSuspenseBoundaries,transitions:D.transitions},u.updateQueue.baseState=I,u.memoizedState=I,u.flags&256){P=ed(Error(r(423)),u),u=cR(s,u,v,h,P);break e}else if(v!==P){P=ed(Error(r(424)),u),u=cR(s,u,v,h,P);break e}else for(eo=nl(u.stateNode.containerInfo.firstChild),Zi=u,Gr=!0,Xo=null,h=_O(u,null,v,h),u.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling;else{if(Qc(),v===P){u=ms(s,u,h);break e}yi(s,u,v,h)}u=u.child}return u;case 5:return TO(u),s===null&&eS(u),v=u.type,P=u.pendingProps,I=s!==null?s.memoizedProps:null,D=P.children,Hw(v,P)?D=null:I!==null&&Hw(v,I)&&(u.flags|=32),sR(s,u),yi(s,u,D,h),u.child;case 6:return s===null&&eS(u),null;case 13:return dR(s,u,h);case 4:return lS(u,u.stateNode.containerInfo),v=u.pendingProps,s===null?u.child=Yc(u,null,v,h):yi(s,u,v,h),u.child;case 11:return v=u.type,P=u.pendingProps,P=u.elementType===v?P:Jo(v,P),nR(s,u,v,P,h);case 7:return yi(s,u,u.pendingProps,h),u.child;case 8:return yi(s,u,u.pendingProps.children,h),u.child;case 12:return yi(s,u,u.pendingProps.children,h),u.child;case 10:e:{if(v=u.type._context,P=u.pendingProps,I=u.memoizedProps,D=P.value,$r(Tv,v._currentValue),v._currentValue=D,I!==null)if(Yo(I.value,D)){if(I.children===P.children&&!Ri.current){u=ms(s,u,h);break e}}else for(I=u.child,I!==null&&(I.return=u);I!==null;){var W=I.dependencies;if(W!==null){D=I.child;for(var J=W.firstContext;J!==null;){if(J.context===v){if(I.tag===1){J=ps(-1,h&-h),J.tag=2;var Se=I.updateQueue;if(Se!==null){Se=Se.shared;var ke=Se.pending;ke===null?J.next=J:(J.next=ke.next,ke.next=J),Se.pending=J}}I.lanes|=h,J=I.alternate,J!==null&&(J.lanes|=h),oS(I.return,h,u),W.lanes|=h;break}J=J.next}}else if(I.tag===10)D=I.type===u.type?null:I.child;else if(I.tag===18){if(D=I.return,D===null)throw Error(r(341));D.lanes|=h,W=D.alternate,W!==null&&(W.lanes|=h),oS(D,h,u),D=I.sibling}else D=I.child;if(D!==null)D.return=I;else for(D=I;D!==null;){if(D===u){D=null;break}if(I=D.sibling,I!==null){I.return=D.return,D=I;break}D=D.return}I=D}yi(s,u,P.children,h),u=u.child}return u;case 9:return P=u.type,v=u.pendingProps.children,Jc(u,h),P=Po(P),v=v(P),u.flags|=1,yi(s,u,v,h),u.child;case 14:return v=u.type,P=Jo(v,u.pendingProps),P=Jo(v.type,P),iR(s,u,v,P,h);case 15:return oR(s,u,u.type,u.pendingProps,h);case 17:return v=u.type,P=u.pendingProps,P=u.elementType===v?P:Jo(v,P),Lv(s,u),u.tag=1,Ii(v)?(s=!0,Sv(u)):s=!1,Jc(u,h),YO(u,v,P),SS(u,v,P,h),CS(null,u,v,!0,s,h);case 19:return hR(s,u,h);case 22:return aR(s,u,h)}throw Error(r(156,u.tag))};function NR(s,u){return ft(s,u)}function v6(s,u,h,v){this.tag=s,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=u,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=v,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function To(s,u,h,v){return new v6(s,u,h,v)}function HS(s){return s=s.prototype,!(!s||!s.isReactComponent)}function g6(s){if(typeof s=="function")return HS(s)?1:0;if(s!=null){if(s=s.$$typeof,s===se)return 11;if(s===X)return 14}return 2}function pl(s,u){var h=s.alternate;return h===null?(h=To(s.tag,u,s.key,s.mode),h.elementType=s.elementType,h.type=s.type,h.stateNode=s.stateNode,h.alternate=s,s.alternate=h):(h.pendingProps=u,h.type=s.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=s.flags&14680064,h.childLanes=s.childLanes,h.lanes=s.lanes,h.child=s.child,h.memoizedProps=s.memoizedProps,h.memoizedState=s.memoizedState,h.updateQueue=s.updateQueue,u=s.dependencies,h.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},h.sibling=s.sibling,h.index=s.index,h.ref=s.ref,h}function Yv(s,u,h,v,P,I){var D=2;if(v=s,typeof s=="function")HS(s)&&(D=1);else if(typeof s=="string")D=5;else e:switch(s){case T:return Cu(h.children,P,I,u);case A:D=8,P|=8;break;case M:return s=To(12,h,u,P|2),s.elementType=M,s.lanes=I,s;case ie:return s=To(13,h,u,P),s.elementType=ie,s.lanes=I,s;case N:return s=To(19,h,u,P),s.elementType=N,s.lanes=I,s;case ne:return Xv(h,P,I,u);default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case B:D=10;break e;case Q:D=9;break e;case se:D=11;break e;case X:D=14;break e;case ce:D=16,v=null;break e}throw Error(r(130,s==null?s:typeof s,""))}return u=To(D,h,u,P),u.elementType=s,u.type=v,u.lanes=I,u}function Cu(s,u,h,v){return s=To(7,s,v,u),s.lanes=h,s}function Xv(s,u,h,v){return s=To(22,s,v,u),s.elementType=ne,s.lanes=h,s.stateNode={isHidden:!1},s}function WS(s,u,h){return s=To(6,s,null,u),s.lanes=h,s}function KS(s,u,h){return u=To(4,s.children!==null?s.children:[],s.key,u),u.lanes=h,u.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},u}function y6(s,u,h,v,P){this.tag=u,this.containerInfo=s,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ac(0),this.expirationTimes=Ac(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ac(0),this.identifierPrefix=v,this.onRecoverableError=P,this.mutableSourceEagerHydrationData=null}function GS(s,u,h,v,P,I,D,W,J){return s=new y6(s,u,h,W,J),u===1?(u=1,I===!0&&(u|=8)):u=0,I=To(3,null,null,u),s.current=I,I.stateNode=s,I.memoizedState={element:v,isDehydrated:h,cache:null,transitions:null,pendingSuspenseBoundaries:null},sS(I),s}function b6(s,u,h){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:R,key:v==null?null:""+v,children:s,containerInfo:u,implementation:h}}function FR(s){if(!s)return ol;s=s._reactInternals;e:{if(ot(s)!==s||s.tag!==1)throw Error(r(170));var u=s;do{switch(u.tag){case 3:u=u.stateNode.context;break e;case 1:if(Ii(u.type)){u=u.stateNode.__reactInternalMemoizedMergedChildContext;break e}}u=u.return}while(u!==null);throw Error(r(171))}if(s.tag===1){var h=s.type;if(Ii(h))return fO(s,h,u)}return u}function LR(s,u,h,v,P,I,D,W,J){return s=GS(h,v,!0,s,P,I,D,W,J),s.context=FR(null),h=s.current,v=bi(),P=fl(h),I=ps(v,P),I.callback=u??null,ll(h,I,P),s.current.lanes=P,du(s,P,v),$i(s,v),s}function Jv(s,u,h,v){var P=u.current,I=bi(),D=fl(P);return h=FR(h),u.context===null?u.context=h:u.pendingContext=h,u=ps(I,D),u.payload={element:s},v=v===void 0?null:v,v!==null&&(u.callback=v),s=ll(P,u,D),s!==null&&(ta(s,P,D,I),Rv(s,P,D)),D}function Zv(s){if(s=s.current,!s.child)return null;switch(s.child.tag){case 5:return s.child.stateNode;default:return s.child.stateNode}}function BR(s,u){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var h=s.retryLane;s.retryLane=h!==0&&h<u?h:u}}function QS(s,u){BR(s,u),(s=s.alternate)&&BR(s,u)}function w6(){return null}var VR=typeof reportError=="function"?reportError:function(s){console.error(s)};function YS(s){this._internalRoot=s}eg.prototype.render=YS.prototype.render=function(s){var u=this._internalRoot;if(u===null)throw Error(r(409));Jv(s,u,null,null)},eg.prototype.unmount=YS.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var u=s.containerInfo;_u(function(){Jv(null,s,null,null)}),u[us]=null}};function eg(s){this._internalRoot=s}eg.prototype.unstable_scheduleHydration=function(s){if(s){var u=lv();s={blockedOn:null,target:s,priority:u};for(var h=0;h<So.length&&u!==0&&u<So[h].priority;h++);So.splice(h,0,s),h===0&&Kf(s)}};function XS(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function tg(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11&&(s.nodeType!==8||s.nodeValue!==" react-mount-point-unstable "))}function zR(){}function S6(s,u,h,v,P){if(P){if(typeof v=="function"){var I=v;v=function(){var Se=Zv(D);I.call(Se)}}var D=LR(u,v,s,0,null,!1,!1,"",zR);return s._reactRootContainer=D,s[us]=D.current,nh(s.nodeType===8?s.parentNode:s),_u(),D}for(;P=s.lastChild;)s.removeChild(P);if(typeof v=="function"){var W=v;v=function(){var Se=Zv(J);W.call(Se)}}var J=GS(s,0,!1,null,null,!1,!1,"",zR);return s._reactRootContainer=J,s[us]=J.current,nh(s.nodeType===8?s.parentNode:s),_u(function(){Jv(u,J,h,v)}),J}function rg(s,u,h,v,P){var I=h._reactRootContainer;if(I){var D=I;if(typeof P=="function"){var W=P;P=function(){var J=Zv(D);W.call(J)}}Jv(u,D,s,P)}else D=S6(h,u,s,P,v);return Zv(D)}sv=function(s){switch(s.tag){case 3:var u=s.stateNode;if(u.current.memoizedState.isDehydrated){var h=Ca(u.pendingLanes);h!==0&&(Uf(u,h|1),$i(u,Et()),(ir&6)===0&&(nd=Et()+500,al()))}break;case 13:_u(function(){var v=hs(s,1);if(v!==null){var P=bi();ta(v,s,1,P)}}),QS(s,1)}},Hf=function(s){if(s.tag===13){var u=hs(s,134217728);if(u!==null){var h=bi();ta(u,s,134217728,h)}QS(s,134217728)}},Dc=function(s){if(s.tag===13){var u=fl(s),h=hs(s,u);if(h!==null){var v=bi();ta(h,s,u,v)}QS(s,u)}},lv=function(){return sr},uv=function(s,u){var h=sr;try{return sr=s,u()}finally{sr=h}},Pa=function(s,u,h){switch(u){case"input":if(Ge(s,h),u=h.name,h.type==="radio"&&u!=null){for(h=s;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll("input[name="+JSON.stringify(""+u)+'][type="radio"]'),u=0;u<h.length;u++){var v=h[u];if(v!==s&&v.form===s.form){var P=bv(v);if(!P)throw Error(r(90));K(v),Ge(v,P)}}}break;case"textarea":on(s,h);break;case"select":u=h.value,u!=null&&jt(s,!!h.multiple,u,!1)}},ye=zS,xe=_u;var _6={usingClientEntryPoint:!1,Events:[ah,Uc,bv,Ji,le,zS]},wh={findFiberByHostInstance:pu,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},x6={bundleType:wh.bundleType,version:wh.version,rendererPackageName:wh.rendererPackageName,rendererConfig:wh.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:k.ReactCurrentDispatcher,findHostInstanceByFiber:function(s){return s=At(s),s===null?null:s.stateNode},findFiberByHostInstance:wh.findFiberByHostInstance||w6,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ng=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ng.isDisabled&&ng.supportsFiber)try{gi=ng.inject(x6),ln=ng}catch{}}return Ai.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=_6,Ai.createPortal=function(s,u){var h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!XS(u))throw Error(r(200));return b6(s,u,null,h)},Ai.createRoot=function(s,u){if(!XS(s))throw Error(r(299));var h=!1,v="",P=VR;return u!=null&&(u.unstable_strictMode===!0&&(h=!0),u.identifierPrefix!==void 0&&(v=u.identifierPrefix),u.onRecoverableError!==void 0&&(P=u.onRecoverableError)),u=GS(s,1,!1,null,null,h,!1,v,P),s[us]=u.current,nh(s.nodeType===8?s.parentNode:s),new YS(u)},Ai.findDOMNode=function(s){if(s==null)return null;if(s.nodeType===1)return s;var u=s._reactInternals;if(u===void 0)throw typeof s.render=="function"?Error(r(188)):(s=Object.keys(s).join(","),Error(r(268,s)));return s=At(u),s=s===null?null:s.stateNode,s},Ai.flushSync=function(s){return _u(s)},Ai.hydrate=function(s,u,h){if(!tg(u))throw Error(r(200));return rg(null,s,u,!0,h)},Ai.hydrateRoot=function(s,u,h){if(!XS(s))throw Error(r(405));var v=h!=null&&h.hydratedSources||null,P=!1,I="",D=VR;if(h!=null&&(h.unstable_strictMode===!0&&(P=!0),h.identifierPrefix!==void 0&&(I=h.identifierPrefix),h.onRecoverableError!==void 0&&(D=h.onRecoverableError)),u=LR(u,null,s,1,h??null,P,!1,I,D),s[us]=u.current,nh(s),v)for(s=0;s<v.length;s++)h=v[s],P=h._getVersion,P=P(h._source),u.mutableSourceEagerHydrationData==null?u.mutableSourceEagerHydrationData=[h,P]:u.mutableSourceEagerHydrationData.push(h,P);return new eg(u)},Ai.render=function(s,u,h){if(!tg(u))throw Error(r(200));return rg(null,s,u,!1,h)},Ai.unmountComponentAtNode=function(s){if(!tg(s))throw Error(r(40));return s._reactRootContainer?(_u(function(){rg(null,null,s,!1,function(){s._reactRootContainer=null,s[us]=null})}),!0):!1},Ai.unstable_batchedUpdates=zS,Ai.unstable_renderSubtreeIntoContainer=function(s,u,h,v){if(!tg(h))throw Error(r(200));if(s==null||s._reactInternals===void 0)throw Error(r(38));return rg(s,u,h,!1,v)},Ai.version="18.3.1-next-f1338f8080-20240426",Ai}var YR;function cM(){if(YR)return e1.exports;YR=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),e1.exports=$6(),e1.exports}var XR;function A6(){if(XR)return og;XR=1;var e=cM();return og.createRoot=e.createRoot,og.hydrateRoot=e.hydrateRoot,og}var D6=A6();const M6={BASE_URL:"/",DEV:!1,GIT_BRANCH_NAME:"HEAD",GIT_COMMIT_HASH:"df72e0a",MODE:"production",PACKAGE_VERSION:"0.11.0-alpha.5",PROD:!0,REACT_APP_ENDPOINT_HOST:"",REACT_APP_ENDPOINT_PORT:"",REACT_APP_ENDPOINT_SERVER_URL:"/endpoint",REACT_APP_GRAPHQL_SERVER_URL:"/graphql",REACT_APP_SWAGGER_SERVER_URL:"/api",SSR:!1},Oy=e=>{var n;const t=M6[e];return((n=window.__env__)==null?void 0:n[e])||t};function N6(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function F6(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var L6=function(){function e(r){var n=this;this._insertTag=function(i){var o;n.tags.length===0?n.insertionPoint?o=n.insertionPoint.nextSibling:n.prepend?o=n.container.firstChild:o=n.before:o=n.tags[n.tags.length-1].nextSibling,n.container.insertBefore(i,o),n.tags.push(i)},this.isSpeedy=r.speedy===void 0?!0:r.speedy,this.tags=[],this.ctr=0,this.nonce=r.nonce,this.key=r.key,this.container=r.container,this.prepend=r.prepend,this.insertionPoint=r.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(n){n.forEach(this._insertTag)},t.insert=function(n){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(F6(this));var i=this.tags[this.tags.length-1];if(this.isSpeedy){var o=N6(i);try{o.insertRule(n,o.cssRules.length)}catch{}}else i.appendChild(document.createTextNode(n));this.ctr++},t.flush=function(){this.tags.forEach(function(n){return n.parentNode&&n.parentNode.removeChild(n)}),this.tags=[],this.ctr=0},e}(),ci="-ms-",ib="-moz-",hr="-webkit-",dM="comm",JP="rule",ZP="decl",B6="@import",fM="@keyframes",V6="@layer",z6=Math.abs,a0=String.fromCharCode,q6=Object.assign;function U6(e,t){return Yn(e,0)^45?(((t<<2^Yn(e,0))<<2^Yn(e,1))<<2^Yn(e,2))<<2^Yn(e,3):0}function hM(e){return e.trim()}function H6(e,t){return(e=t.exec(e))?e[0]:e}function pr(e,t,r){return e.replace(t,r)}function tx(e,t){return e.indexOf(t)}function Yn(e,t){return e.charCodeAt(t)|0}function Op(e,t,r){return e.slice(t,r)}function Ma(e){return e.length}function eC(e){return e.length}function ag(e,t){return t.push(e),e}function W6(e,t){return e.map(t).join("")}var s0=1,Zd=1,pM=0,Vi=0,Cn=0,_f="";function l0(e,t,r,n,i,o,a){return{value:e,root:t,parent:r,type:n,props:i,children:o,line:s0,column:Zd,length:a,return:""}}function _h(e,t){return q6(l0("",null,null,"",null,null,0),e,{length:-e.length},t)}function K6(){return Cn}function G6(){return Cn=Vi>0?Yn(_f,--Vi):0,Zd--,Cn===10&&(Zd=1,s0--),Cn}function so(){return Cn=Vi<pM?Yn(_f,Vi++):0,Zd++,Cn===10&&(Zd=1,s0++),Cn}function Ua(){return Yn(_f,Vi)}function Ry(){return Vi}function Sm(e,t){return Op(_f,e,t)}function Rp(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function mM(e){return s0=Zd=1,pM=Ma(_f=e),Vi=0,[]}function vM(e){return _f="",e}function Iy(e){return hM(Sm(Vi-1,rx(e===91?e+2:e===40?e+1:e)))}function Q6(e){for(;(Cn=Ua())&&Cn<33;)so();return Rp(e)>2||Rp(Cn)>3?"":" "}function Y6(e,t){for(;--t&&so()&&!(Cn<48||Cn>102||Cn>57&&Cn<65||Cn>70&&Cn<97););return Sm(e,Ry()+(t<6&&Ua()==32&&so()==32))}function rx(e){for(;so();)switch(Cn){case e:return Vi;case 34:case 39:e!==34&&e!==39&&rx(Cn);break;case 40:e===41&&rx(e);break;case 92:so();break}return Vi}function X6(e,t){for(;so()&&e+Cn!==57;)if(e+Cn===84&&Ua()===47)break;return"/*"+Sm(t,Vi-1)+"*"+a0(e===47?e:so())}function J6(e){for(;!Rp(Ua());)so();return Sm(e,Vi)}function Z6(e){return vM(ky("",null,null,null,[""],e=mM(e),0,[0],e))}function ky(e,t,r,n,i,o,a,l,c){for(var d=0,f=0,p=a,m=0,g=0,b=0,y=1,w=1,_=1,S=0,C="",k=i,E=o,R=n,T=C;w;)switch(b=S,S=so()){case 40:if(b!=108&&Yn(T,p-1)==58){tx(T+=pr(Iy(S),"&","&\f"),"&\f")!=-1&&(_=-1);break}case 34:case 39:case 91:T+=Iy(S);break;case 9:case 10:case 13:case 32:T+=Q6(b);break;case 92:T+=Y6(Ry()-1,7);continue;case 47:switch(Ua()){case 42:case 47:ag(e8(X6(so(),Ry()),t,r),c);break;default:T+="/"}break;case 123*y:l[d++]=Ma(T)*_;case 125*y:case 59:case 0:switch(S){case 0:case 125:w=0;case 59+f:_==-1&&(T=pr(T,/\f/g,"")),g>0&&Ma(T)-p&&ag(g>32?ZR(T+";",n,r,p-1):ZR(pr(T," ","")+";",n,r,p-2),c);break;case 59:T+=";";default:if(ag(R=JR(T,t,r,d,f,i,l,C,k=[],E=[],p),o),S===123)if(f===0)ky(T,t,R,R,k,o,p,l,E);else switch(m===99&&Yn(T,3)===110?100:m){case 100:case 108:case 109:case 115:ky(e,R,R,n&&ag(JR(e,R,R,0,0,i,l,C,i,k=[],p),E),i,E,p,l,n?k:E);break;default:ky(T,R,R,R,[""],E,0,l,E)}}d=f=g=0,y=_=1,C=T="",p=a;break;case 58:p=1+Ma(T),g=b;default:if(y<1){if(S==123)--y;else if(S==125&&y++==0&&G6()==125)continue}switch(T+=a0(S),S*y){case 38:_=f>0?1:(T+="\f",-1);break;case 44:l[d++]=(Ma(T)-1)*_,_=1;break;case 64:Ua()===45&&(T+=Iy(so())),m=Ua(),f=p=Ma(C=T+=J6(Ry())),S++;break;case 45:b===45&&Ma(T)==2&&(y=0)}}return o}function JR(e,t,r,n,i,o,a,l,c,d,f){for(var p=i-1,m=i===0?o:[""],g=eC(m),b=0,y=0,w=0;b<n;++b)for(var _=0,S=Op(e,p+1,p=z6(y=a[b])),C=e;_<g;++_)(C=hM(y>0?m[_]+" "+S:pr(S,/&\f/g,m[_])))&&(c[w++]=C);return l0(e,t,r,i===0?JP:l,c,d,f)}function e8(e,t,r){return l0(e,t,r,dM,a0(K6()),Op(e,2,-2),0)}function ZR(e,t,r,n){return l0(e,t,r,ZP,Op(e,0,n),Op(e,n+1,-1),n)}function qd(e,t){for(var r="",n=eC(e),i=0;i<n;i++)r+=t(e[i],i,e,t)||"";return r}function t8(e,t,r,n){switch(e.type){case V6:if(e.children.length)break;case B6:case ZP:return e.return=e.return||e.value;case dM:return"";case fM:return e.return=e.value+"{"+qd(e.children,n)+"}";case JP:e.value=e.props.join(",")}return Ma(r=qd(e.children,n))?e.return=e.value+"{"+r+"}":""}function r8(e){var t=eC(e);return function(r,n,i,o){for(var a="",l=0;l<t;l++)a+=e[l](r,n,i,o)||"";return a}}function n8(e){return function(t){t.root||(t=t.return)&&e(t)}}var eI=function(t){var r=new WeakMap;return function(n){if(r.has(n))return r.get(n);var i=t(n);return r.set(n,i),i}};function gM(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}var i8=function(t,r,n){for(var i=0,o=0;i=o,o=Ua(),i===38&&o===12&&(r[n]=1),!Rp(o);)so();return Sm(t,Vi)},o8=function(t,r){var n=-1,i=44;do switch(Rp(i)){case 0:i===38&&Ua()===12&&(r[n]=1),t[n]+=i8(Vi-1,r,n);break;case 2:t[n]+=Iy(i);break;case 4:if(i===44){t[++n]=Ua()===58?"&\f":"",r[n]=t[n].length;break}default:t[n]+=a0(i)}while(i=so());return t},a8=function(t,r){return vM(o8(mM(t),r))},tI=new WeakMap,s8=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var r=t.value,n=t.parent,i=t.column===n.column&&t.line===n.line;n.type!=="rule";)if(n=n.parent,!n)return;if(!(t.props.length===1&&r.charCodeAt(0)!==58&&!tI.get(n))&&!i){tI.set(t,!0);for(var o=[],a=a8(r,o),l=n.props,c=0,d=0;c<a.length;c++)for(var f=0;f<l.length;f++,d++)t.props[d]=o[c]?a[c].replace(/&\f/g,l[f]):l[f]+" "+a[c]}}},l8=function(t){if(t.type==="decl"){var r=t.value;r.charCodeAt(0)===108&&r.charCodeAt(2)===98&&(t.return="",t.value="")}};function yM(e,t){switch(U6(e,t)){case 5103:return hr+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return hr+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return hr+e+ib+e+ci+e+e;case 6828:case 4268:return hr+e+ci+e+e;case 6165:return hr+e+ci+"flex-"+e+e;case 5187:return hr+e+pr(e,/(\w+).+(:[^]+)/,hr+"box-$1$2"+ci+"flex-$1$2")+e;case 5443:return hr+e+ci+"flex-item-"+pr(e,/flex-|-self/,"")+e;case 4675:return hr+e+ci+"flex-line-pack"+pr(e,/align-content|flex-|-self/,"")+e;case 5548:return hr+e+ci+pr(e,"shrink","negative")+e;case 5292:return hr+e+ci+pr(e,"basis","preferred-size")+e;case 6060:return hr+"box-"+pr(e,"-grow","")+hr+e+ci+pr(e,"grow","positive")+e;case 4554:return hr+pr(e,/([^-])(transform)/g,"$1"+hr+"$2")+e;case 6187:return pr(pr(pr(e,/(zoom-|grab)/,hr+"$1"),/(image-set)/,hr+"$1"),e,"")+e;case 5495:case 3959:return pr(e,/(image-set\([^]*)/,hr+"$1$`$1");case 4968:return pr(pr(e,/(.+:)(flex-)?(.*)/,hr+"box-pack:$3"+ci+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+hr+e+e;case 4095:case 3583:case 4068:case 2532:return pr(e,/(.+)-inline(.+)/,hr+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Ma(e)-1-t>6)switch(Yn(e,t+1)){case 109:if(Yn(e,t+4)!==45)break;case 102:return pr(e,/(.+:)(.+)-([^]+)/,"$1"+hr+"$2-$3$1"+ib+(Yn(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~tx(e,"stretch")?yM(pr(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Yn(e,t+1)!==115)break;case 6444:switch(Yn(e,Ma(e)-3-(~tx(e,"!important")&&10))){case 107:return pr(e,":",":"+hr)+e;case 101:return pr(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+hr+(Yn(e,14)===45?"inline-":"")+"box$3$1"+hr+"$2$3$1"+ci+"$2box$3")+e}break;case 5936:switch(Yn(e,t+11)){case 114:return hr+e+ci+pr(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return hr+e+ci+pr(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return hr+e+ci+pr(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return hr+e+ci+e+e}return e}var u8=function(t,r,n,i){if(t.length>-1&&!t.return)switch(t.type){case ZP:t.return=yM(t.value,t.length);break;case fM:return qd([_h(t,{value:pr(t.value,"@","@"+hr)})],i);case JP:if(t.length)return W6(t.props,function(o){switch(H6(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return qd([_h(t,{props:[pr(o,/:(read-\w+)/,":"+ib+"$1")]})],i);case"::placeholder":return qd([_h(t,{props:[pr(o,/:(plac\w+)/,":"+hr+"input-$1")]}),_h(t,{props:[pr(o,/:(plac\w+)/,":"+ib+"$1")]}),_h(t,{props:[pr(o,/:(plac\w+)/,ci+"input-$1")]})],i)}return""})}},c8=[u8],d8=function(t){var r=t.key;if(r==="css"){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(y){var w=y.getAttribute("data-emotion");w.indexOf(" ")!==-1&&(document.head.appendChild(y),y.setAttribute("data-s",""))})}var i=t.stylisPlugins||c8,o={},a,l=[];a=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+r+' "]'),function(y){for(var w=y.getAttribute("data-emotion").split(" "),_=1;_<w.length;_++)o[w[_]]=!0;l.push(y)});var c,d=[s8,l8];{var f,p=[t8,n8(function(y){f.insert(y)})],m=r8(d.concat(i,p)),g=function(w){return qd(Z6(w),m)};c=function(w,_,S,C){f=S,g(w?w+"{"+_.styles+"}":_.styles),C&&(b.inserted[_.name]=!0)}}var b={key:r,sheet:new L6({key:r,container:a,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:o,registered:{},insert:c};return b.sheet.hydrate(l),b};function ob(){return ob=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ob.apply(null,arguments)}var n1={exports:{}},br={};/** @license React v16.13.1
|
40
|
+
`+I.stack}return{value:s,source:u,stack:P,digest:null}}function _S(s,u,h){return{value:s,source:null,stack:h??null,digest:u??null}}function xS(s,u){try{console.error(u.value)}catch(h){setTimeout(function(){throw h})}}var Zz=typeof WeakMap=="function"?WeakMap:Map;function JO(s,u,h){h=ps(-1,h),h.tag=3,h.payload={element:null};var v=u.value;return h.callback=function(){Uv||(Uv=!0,FS=v),xS(s,u)},h}function ZO(s,u,h){h=ps(-1,h),h.tag=3;var v=s.type.getDerivedStateFromError;if(typeof v=="function"){var P=u.value;h.payload=function(){return v(P)},h.callback=function(){xS(s,u)}}var I=s.stateNode;return I!==null&&typeof I.componentDidCatch=="function"&&(h.callback=function(){xS(s,u),typeof v!="function"&&(cl===null?cl=new Set([this]):cl.add(this));var D=u.stack;this.componentDidCatch(u.value,{componentStack:D!==null?D:""})}),h}function eR(s,u,h){var v=s.pingCache;if(v===null){v=s.pingCache=new Zz;var P=new Set;v.set(u,P)}else P=v.get(u),P===void 0&&(P=new Set,v.set(u,P));P.has(h)||(P.add(h),s=h6.bind(null,s,u,h),u.then(s,s))}function tR(s){do{var u;if((u=s.tag===13)&&(u=s.memoizedState,u=u!==null?u.dehydrated!==null:!0),u)return s;s=s.return}while(s!==null);return null}function rR(s,u,h,v,P){return(s.mode&1)===0?(s===u?s.flags|=65536:(s.flags|=128,h.flags|=131072,h.flags&=-52805,h.tag===1&&(h.alternate===null?h.tag=17:(u=ps(-1,1),u.tag=2,ll(h,u,1))),h.lanes|=1),s):(s.flags|=65536,s.lanes=P,s)}var e6=k.ReactCurrentOwner,ki=!1;function yi(s,u,h,v){u.child=s===null?_O(u,null,h,v):Yc(u,s.child,h,v)}function nR(s,u,h,v,P){h=h.render;var I=u.ref;return Jc(u,P),v=pS(s,u,h,v,I,P),h=mS(),s!==null&&!ki?(u.updateQueue=s.updateQueue,u.flags&=-2053,s.lanes&=~P,ms(s,u,P)):(Gr&&h&&Xw(u),u.flags|=1,yi(s,u,v,P),u.child)}function iR(s,u,h,v,P){if(s===null){var I=h.type;return typeof I=="function"&&!HS(I)&&I.defaultProps===void 0&&h.compare===null&&h.defaultProps===void 0?(u.tag=15,u.type=I,oR(s,u,I,v,P)):(s=Yv(h.type,null,v,u,u.mode,P),s.ref=u.ref,s.return=u,u.child=s)}if(I=s.child,(s.lanes&P)===0){var D=I.memoizedProps;if(h=h.compare,h=h!==null?h:eh,h(D,v)&&s.ref===u.ref)return ms(s,u,P)}return u.flags|=1,s=pl(I,v),s.ref=u.ref,s.return=u,u.child=s}function oR(s,u,h,v,P){if(s!==null){var I=s.memoizedProps;if(eh(I,v)&&s.ref===u.ref)if(ki=!1,u.pendingProps=v=I,(s.lanes&P)!==0)(s.flags&131072)!==0&&(ki=!0);else return u.lanes=s.lanes,ms(s,u,P)}return PS(s,u,h,v,P)}function aR(s,u,h){var v=u.pendingProps,P=v.children,I=s!==null?s.memoizedState:null;if(v.mode==="hidden")if((u.mode&1)===0)u.memoizedState={baseLanes:0,cachePool:null,transitions:null},$r(rd,to),to|=h;else{if((h&1073741824)===0)return s=I!==null?I.baseLanes|h:h,u.lanes=u.childLanes=1073741824,u.memoizedState={baseLanes:s,cachePool:null,transitions:null},u.updateQueue=null,$r(rd,to),to|=s,null;u.memoizedState={baseLanes:0,cachePool:null,transitions:null},v=I!==null?I.baseLanes:h,$r(rd,to),to|=v}else I!==null?(v=I.baseLanes|h,u.memoizedState=null):v=h,$r(rd,to),to|=v;return yi(s,u,P,h),u.child}function sR(s,u){var h=u.ref;(s===null&&h!==null||s!==null&&s.ref!==h)&&(u.flags|=512,u.flags|=2097152)}function PS(s,u,h,v,P){var I=Ii(h)?mu:ai.current;return I=Wc(u,I),Jc(u,P),h=pS(s,u,h,v,I,P),v=mS(),s!==null&&!ki?(u.updateQueue=s.updateQueue,u.flags&=-2053,s.lanes&=~P,ms(s,u,P)):(Gr&&v&&Xw(u),u.flags|=1,yi(s,u,h,P),u.child)}function lR(s,u,h,v,P){if(Ii(h)){var I=!0;Sv(u)}else I=!1;if(Jc(u,P),u.stateNode===null)Lv(s,u),YO(u,h,v),SS(u,h,v,P),v=!0;else if(s===null){var D=u.stateNode,W=u.memoizedProps;D.props=W;var J=D.context,Se=h.contextType;typeof Se=="object"&&Se!==null?Se=Po(Se):(Se=Ii(h)?mu:ai.current,Se=Wc(u,Se));var ke=h.getDerivedStateFromProps,Ae=typeof ke=="function"||typeof D.getSnapshotBeforeUpdate=="function";Ae||typeof D.UNSAFE_componentWillReceiveProps!="function"&&typeof D.componentWillReceiveProps!="function"||(W!==v||J!==Se)&&XO(u,D,v,Se),sl=!1;var Ie=u.memoizedState;D.state=Ie,Iv(u,v,D,P),J=u.memoizedState,W!==v||Ie!==J||Ri.current||sl?(typeof ke=="function"&&(wS(u,h,ke,v),J=u.memoizedState),(W=sl||QO(u,h,W,v,Ie,J,Se))?(Ae||typeof D.UNSAFE_componentWillMount!="function"&&typeof D.componentWillMount!="function"||(typeof D.componentWillMount=="function"&&D.componentWillMount(),typeof D.UNSAFE_componentWillMount=="function"&&D.UNSAFE_componentWillMount()),typeof D.componentDidMount=="function"&&(u.flags|=4194308)):(typeof D.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=v,u.memoizedState=J),D.props=v,D.state=J,D.context=Se,v=W):(typeof D.componentDidMount=="function"&&(u.flags|=4194308),v=!1)}else{D=u.stateNode,PO(s,u),W=u.memoizedProps,Se=u.type===u.elementType?W:Jo(u.type,W),D.props=Se,Ae=u.pendingProps,Ie=D.context,J=h.contextType,typeof J=="object"&&J!==null?J=Po(J):(J=Ii(h)?mu:ai.current,J=Wc(u,J));var He=h.getDerivedStateFromProps;(ke=typeof He=="function"||typeof D.getSnapshotBeforeUpdate=="function")||typeof D.UNSAFE_componentWillReceiveProps!="function"&&typeof D.componentWillReceiveProps!="function"||(W!==Ae||Ie!==J)&&XO(u,D,v,J),sl=!1,Ie=u.memoizedState,D.state=Ie,Iv(u,v,D,P);var Xe=u.memoizedState;W!==Ae||Ie!==Xe||Ri.current||sl?(typeof He=="function"&&(wS(u,h,He,v),Xe=u.memoizedState),(Se=sl||QO(u,h,Se,v,Ie,Xe,J)||!1)?(ke||typeof D.UNSAFE_componentWillUpdate!="function"&&typeof D.componentWillUpdate!="function"||(typeof D.componentWillUpdate=="function"&&D.componentWillUpdate(v,Xe,J),typeof D.UNSAFE_componentWillUpdate=="function"&&D.UNSAFE_componentWillUpdate(v,Xe,J)),typeof D.componentDidUpdate=="function"&&(u.flags|=4),typeof D.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof D.componentDidUpdate!="function"||W===s.memoizedProps&&Ie===s.memoizedState||(u.flags|=4),typeof D.getSnapshotBeforeUpdate!="function"||W===s.memoizedProps&&Ie===s.memoizedState||(u.flags|=1024),u.memoizedProps=v,u.memoizedState=Xe),D.props=v,D.state=Xe,D.context=J,v=Se):(typeof D.componentDidUpdate!="function"||W===s.memoizedProps&&Ie===s.memoizedState||(u.flags|=4),typeof D.getSnapshotBeforeUpdate!="function"||W===s.memoizedProps&&Ie===s.memoizedState||(u.flags|=1024),v=!1)}return CS(s,u,h,v,I,P)}function CS(s,u,h,v,P,I){sR(s,u);var D=(u.flags&128)!==0;if(!v&&!D)return P&&hO(u,h,!1),ms(s,u,I);v=u.stateNode,e6.current=u;var W=D&&typeof h.getDerivedStateFromError!="function"?null:v.render();return u.flags|=1,s!==null&&D?(u.child=Yc(u,s.child,null,I),u.child=Yc(u,null,W,I)):yi(s,u,W,I),u.memoizedState=v.state,P&&hO(u,h,!0),u.child}function uR(s){var u=s.stateNode;u.pendingContext?dO(s,u.pendingContext,u.pendingContext!==u.context):u.context&&dO(s,u.context,!1),lS(s,u.containerInfo)}function cR(s,u,h,v,P){return Qc(),tS(P),u.flags|=256,yi(s,u,h,v),u.child}var ES={dehydrated:null,treeContext:null,retryLane:0};function TS(s){return{baseLanes:s,cachePool:null,transitions:null}}function dR(s,u,h){var v=u.pendingProps,P=Zr.current,I=!1,D=(u.flags&128)!==0,W;if((W=D)||(W=s!==null&&s.memoizedState===null?!1:(P&2)!==0),W?(I=!0,u.flags&=-129):(s===null||s.memoizedState!==null)&&(P|=1),$r(Zr,P&1),s===null)return eS(u),s=u.memoizedState,s!==null&&(s=s.dehydrated,s!==null)?((u.mode&1)===0?u.lanes=1:s.data==="$!"?u.lanes=8:u.lanes=1073741824,null):(D=v.children,s=v.fallback,I?(v=u.mode,I=u.child,D={mode:"hidden",children:D},(v&1)===0&&I!==null?(I.childLanes=0,I.pendingProps=D):I=Xv(D,v,0,null),s=Cu(s,v,h,null),I.return=u,s.return=u,I.sibling=s,u.child=I,u.child.memoizedState=TS(h),u.memoizedState=ES,s):OS(u,D));if(P=s.memoizedState,P!==null&&(W=P.dehydrated,W!==null))return t6(s,u,D,v,W,P,h);if(I){I=v.fallback,D=u.mode,P=s.child,W=P.sibling;var J={mode:"hidden",children:v.children};return(D&1)===0&&u.child!==P?(v=u.child,v.childLanes=0,v.pendingProps=J,u.deletions=null):(v=pl(P,J),v.subtreeFlags=P.subtreeFlags&14680064),W!==null?I=pl(W,I):(I=Cu(I,D,h,null),I.flags|=2),I.return=u,v.return=u,v.sibling=I,u.child=v,v=I,I=u.child,D=s.child.memoizedState,D=D===null?TS(h):{baseLanes:D.baseLanes|h,cachePool:null,transitions:D.transitions},I.memoizedState=D,I.childLanes=s.childLanes&~h,u.memoizedState=ES,v}return I=s.child,s=I.sibling,v=pl(I,{mode:"visible",children:v.children}),(u.mode&1)===0&&(v.lanes=h),v.return=u,v.sibling=null,s!==null&&(h=u.deletions,h===null?(u.deletions=[s],u.flags|=16):h.push(s)),u.child=v,u.memoizedState=null,v}function OS(s,u){return u=Xv({mode:"visible",children:u},s.mode,0,null),u.return=s,s.child=u}function Fv(s,u,h,v){return v!==null&&tS(v),Yc(u,s.child,null,h),s=OS(u,u.pendingProps.children),s.flags|=2,u.memoizedState=null,s}function t6(s,u,h,v,P,I,D){if(h)return u.flags&256?(u.flags&=-257,v=_S(Error(r(422))),Fv(s,u,D,v)):u.memoizedState!==null?(u.child=s.child,u.flags|=128,null):(I=v.fallback,P=u.mode,v=Xv({mode:"visible",children:v.children},P,0,null),I=Cu(I,P,D,null),I.flags|=2,v.return=u,I.return=u,v.sibling=I,u.child=v,(u.mode&1)!==0&&Yc(u,s.child,null,D),u.child.memoizedState=TS(D),u.memoizedState=ES,I);if((u.mode&1)===0)return Fv(s,u,D,null);if(P.data==="$!"){if(v=P.nextSibling&&P.nextSibling.dataset,v)var W=v.dgst;return v=W,I=Error(r(419)),v=_S(I,v,void 0),Fv(s,u,D,v)}if(W=(D&s.childLanes)!==0,ki||W){if(v=Dn,v!==null){switch(D&-D){case 4:P=2;break;case 16:P=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:P=32;break;case 536870912:P=268435456;break;default:P=0}P=(P&(v.suspendedLanes|D))!==0?0:P,P!==0&&P!==I.retryLane&&(I.retryLane=P,hs(s,P),ta(v,s,P,-1))}return US(),v=_S(Error(r(421))),Fv(s,u,D,v)}return P.data==="$?"?(u.flags|=128,u.child=s.child,u=p6.bind(null,s),P._reactRetry=u,null):(s=I.treeContext,eo=nl(P.nextSibling),Zi=u,Gr=!0,Xo=null,s!==null&&(_o[xo++]=ds,_o[xo++]=fs,_o[xo++]=vu,ds=s.id,fs=s.overflow,vu=u),u=OS(u,v.children),u.flags|=4096,u)}function fR(s,u,h){s.lanes|=u;var v=s.alternate;v!==null&&(v.lanes|=u),oS(s.return,u,h)}function RS(s,u,h,v,P){var I=s.memoizedState;I===null?s.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:v,tail:h,tailMode:P}:(I.isBackwards=u,I.rendering=null,I.renderingStartTime=0,I.last=v,I.tail=h,I.tailMode=P)}function hR(s,u,h){var v=u.pendingProps,P=v.revealOrder,I=v.tail;if(yi(s,u,v.children,h),v=Zr.current,(v&2)!==0)v=v&1|2,u.flags|=128;else{if(s!==null&&(s.flags&128)!==0)e:for(s=u.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&fR(s,h,u);else if(s.tag===19)fR(s,h,u);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===u)break e;for(;s.sibling===null;){if(s.return===null||s.return===u)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}v&=1}if($r(Zr,v),(u.mode&1)===0)u.memoizedState=null;else switch(P){case"forwards":for(h=u.child,P=null;h!==null;)s=h.alternate,s!==null&&kv(s)===null&&(P=h),h=h.sibling;h=P,h===null?(P=u.child,u.child=null):(P=h.sibling,h.sibling=null),RS(u,!1,P,h,I);break;case"backwards":for(h=null,P=u.child,u.child=null;P!==null;){if(s=P.alternate,s!==null&&kv(s)===null){u.child=P;break}s=P.sibling,P.sibling=h,h=P,P=s}RS(u,!0,h,null,I);break;case"together":RS(u,!1,null,null,void 0);break;default:u.memoizedState=null}return u.child}function Lv(s,u){(u.mode&1)===0&&s!==null&&(s.alternate=null,u.alternate=null,u.flags|=2)}function ms(s,u,h){if(s!==null&&(u.dependencies=s.dependencies),Su|=u.lanes,(h&u.childLanes)===0)return null;if(s!==null&&u.child!==s.child)throw Error(r(153));if(u.child!==null){for(s=u.child,h=pl(s,s.pendingProps),u.child=h,h.return=u;s.sibling!==null;)s=s.sibling,h=h.sibling=pl(s,s.pendingProps),h.return=u;h.sibling=null}return u.child}function r6(s,u,h){switch(u.tag){case 3:uR(u),Qc();break;case 5:TO(u);break;case 1:Ii(u.type)&&Sv(u);break;case 4:lS(u,u.stateNode.containerInfo);break;case 10:var v=u.type._context,P=u.memoizedProps.value;$r(Tv,v._currentValue),v._currentValue=P;break;case 13:if(v=u.memoizedState,v!==null)return v.dehydrated!==null?($r(Zr,Zr.current&1),u.flags|=128,null):(h&u.child.childLanes)!==0?dR(s,u,h):($r(Zr,Zr.current&1),s=ms(s,u,h),s!==null?s.sibling:null);$r(Zr,Zr.current&1);break;case 19:if(v=(h&u.childLanes)!==0,(s.flags&128)!==0){if(v)return hR(s,u,h);u.flags|=128}if(P=u.memoizedState,P!==null&&(P.rendering=null,P.tail=null,P.lastEffect=null),$r(Zr,Zr.current),v)break;return null;case 22:case 23:return u.lanes=0,aR(s,u,h)}return ms(s,u,h)}var pR,IS,mR,vR;pR=function(s,u){for(var h=u.child;h!==null;){if(h.tag===5||h.tag===6)s.appendChild(h.stateNode);else if(h.tag!==4&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===u)break;for(;h.sibling===null;){if(h.return===null||h.return===u)return;h=h.return}h.sibling.return=h.return,h=h.sibling}},IS=function(){},mR=function(s,u,h,v){var P=s.memoizedProps;if(P!==v){s=u.stateNode,bu(Ra.current);var I=null;switch(h){case"input":P=Te(s,P),v=Te(s,v),I=[];break;case"select":P=Z({},P,{value:void 0}),v=Z({},v,{value:void 0}),I=[];break;case"textarea":P=Lt(s,P),v=Lt(s,v),I=[];break;default:typeof P.onClick!="function"&&typeof v.onClick=="function"&&(s.onclick=yv)}Oi(h,v);var D;h=null;for(Se in P)if(!v.hasOwnProperty(Se)&&P.hasOwnProperty(Se)&&P[Se]!=null)if(Se==="style"){var W=P[Se];for(D in W)W.hasOwnProperty(D)&&(h||(h={}),h[D]="")}else Se!=="dangerouslySetInnerHTML"&&Se!=="children"&&Se!=="suppressContentEditableWarning"&&Se!=="suppressHydrationWarning"&&Se!=="autoFocus"&&(i.hasOwnProperty(Se)?I||(I=[]):(I=I||[]).push(Se,null));for(Se in v){var J=v[Se];if(W=P!=null?P[Se]:void 0,v.hasOwnProperty(Se)&&J!==W&&(J!=null||W!=null))if(Se==="style")if(W){for(D in W)!W.hasOwnProperty(D)||J&&J.hasOwnProperty(D)||(h||(h={}),h[D]="");for(D in J)J.hasOwnProperty(D)&&W[D]!==J[D]&&(h||(h={}),h[D]=J[D])}else h||(I||(I=[]),I.push(Se,h)),h=J;else Se==="dangerouslySetInnerHTML"?(J=J?J.__html:void 0,W=W?W.__html:void 0,J!=null&&W!==J&&(I=I||[]).push(Se,J)):Se==="children"?typeof J!="string"&&typeof J!="number"||(I=I||[]).push(Se,""+J):Se!=="suppressContentEditableWarning"&&Se!=="suppressHydrationWarning"&&(i.hasOwnProperty(Se)?(J!=null&&Se==="onScroll"&&Lr("scroll",s),I||W===J||(I=[])):(I=I||[]).push(Se,J))}h&&(I=I||[]).push("style",h);var Se=I;(u.updateQueue=Se)&&(u.flags|=4)}},vR=function(s,u,h,v){h!==v&&(u.flags|=4)};function mh(s,u){if(!Gr)switch(s.tailMode){case"hidden":u=s.tail;for(var h=null;u!==null;)u.alternate!==null&&(h=u),u=u.sibling;h===null?s.tail=null:h.sibling=null;break;case"collapsed":h=s.tail;for(var v=null;h!==null;)h.alternate!==null&&(v=h),h=h.sibling;v===null?u||s.tail===null?s.tail=null:s.tail.sibling=null:v.sibling=null}}function li(s){var u=s.alternate!==null&&s.alternate.child===s.child,h=0,v=0;if(u)for(var P=s.child;P!==null;)h|=P.lanes|P.childLanes,v|=P.subtreeFlags&14680064,v|=P.flags&14680064,P.return=s,P=P.sibling;else for(P=s.child;P!==null;)h|=P.lanes|P.childLanes,v|=P.subtreeFlags,v|=P.flags,P.return=s,P=P.sibling;return s.subtreeFlags|=v,s.childLanes=h,u}function n6(s,u,h){var v=u.pendingProps;switch(Jw(u),u.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return li(u),null;case 1:return Ii(u.type)&&wv(),li(u),null;case 3:return v=u.stateNode,Zc(),Br(Ri),Br(ai),dS(),v.pendingContext&&(v.context=v.pendingContext,v.pendingContext=null),(s===null||s.child===null)&&(Cv(u)?u.flags|=4:s===null||s.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,Xo!==null&&(VS(Xo),Xo=null))),IS(s,u),li(u),null;case 5:uS(u);var P=bu(ch.current);if(h=u.type,s!==null&&u.stateNode!=null)mR(s,u,h,v,P),s.ref!==u.ref&&(u.flags|=512,u.flags|=2097152);else{if(!v){if(u.stateNode===null)throw Error(r(166));return li(u),null}if(s=bu(Ra.current),Cv(u)){v=u.stateNode,h=u.type;var I=u.memoizedProps;switch(v[Oa]=u,v[oh]=I,s=(u.mode&1)!==0,h){case"dialog":Lr("cancel",v),Lr("close",v);break;case"iframe":case"object":case"embed":Lr("load",v);break;case"video":case"audio":for(P=0;P<rh.length;P++)Lr(rh[P],v);break;case"source":Lr("error",v);break;case"img":case"image":case"link":Lr("error",v),Lr("load",v);break;case"details":Lr("toggle",v);break;case"input":he(v,I),Lr("invalid",v);break;case"select":v._wrapperState={wasMultiple:!!I.multiple},Lr("invalid",v);break;case"textarea":ht(v,I),Lr("invalid",v)}Oi(h,I),P=null;for(var D in I)if(I.hasOwnProperty(D)){var W=I[D];D==="children"?typeof W=="string"?v.textContent!==W&&(I.suppressHydrationWarning!==!0&&gv(v.textContent,W,s),P=["children",W]):typeof W=="number"&&v.textContent!==""+W&&(I.suppressHydrationWarning!==!0&&gv(v.textContent,W,s),P=["children",""+W]):i.hasOwnProperty(D)&&W!=null&&D==="onScroll"&&Lr("scroll",v)}switch(h){case"input":Y(v),$t(v,I,!0);break;case"textarea":Y(v),mn(v);break;case"select":case"option":break;default:typeof I.onClick=="function"&&(v.onclick=yv)}v=P,u.updateQueue=v,v!==null&&(u.flags|=4)}else{D=P.nodeType===9?P:P.ownerDocument,s==="http://www.w3.org/1999/xhtml"&&(s=Ir(h)),s==="http://www.w3.org/1999/xhtml"?h==="script"?(s=D.createElement("div"),s.innerHTML="<script><\/script>",s=s.removeChild(s.firstChild)):typeof v.is=="string"?s=D.createElement(h,{is:v.is}):(s=D.createElement(h),h==="select"&&(D=s,v.multiple?D.multiple=!0:v.size&&(D.size=v.size))):s=D.createElementNS(s,h),s[Oa]=u,s[oh]=v,pR(s,u,!1,!1),u.stateNode=s;e:{switch(D=gn(h,v),h){case"dialog":Lr("cancel",s),Lr("close",s),P=v;break;case"iframe":case"object":case"embed":Lr("load",s),P=v;break;case"video":case"audio":for(P=0;P<rh.length;P++)Lr(rh[P],s);P=v;break;case"source":Lr("error",s),P=v;break;case"img":case"image":case"link":Lr("error",s),Lr("load",s),P=v;break;case"details":Lr("toggle",s),P=v;break;case"input":he(s,v),P=Te(s,v),Lr("invalid",s);break;case"option":P=v;break;case"select":s._wrapperState={wasMultiple:!!v.multiple},P=Z({},v,{value:void 0}),Lr("invalid",s);break;case"textarea":ht(s,v),P=Lt(s,v),Lr("invalid",s);break;default:P=v}Oi(h,P),W=P;for(I in W)if(W.hasOwnProperty(I)){var J=W[I];I==="style"?xa(s,J):I==="dangerouslySetInnerHTML"?(J=J?J.__html:void 0,J!=null&&Nr(s,J)):I==="children"?typeof J=="string"?(h!=="textarea"||J!=="")&&an(s,J):typeof J=="number"&&an(s,""+J):I!=="suppressContentEditableWarning"&&I!=="suppressHydrationWarning"&&I!=="autoFocus"&&(i.hasOwnProperty(I)?J!=null&&I==="onScroll"&&Lr("scroll",s):J!=null&&C(s,I,J,D))}switch(h){case"input":Y(s),$t(s,v,!1);break;case"textarea":Y(s),mn(s);break;case"option":v.value!=null&&s.setAttribute("value",""+pe(v.value));break;case"select":s.multiple=!!v.multiple,I=v.value,I!=null?jt(s,!!v.multiple,I,!1):v.defaultValue!=null&&jt(s,!!v.multiple,v.defaultValue,!0);break;default:typeof P.onClick=="function"&&(s.onclick=yv)}switch(h){case"button":case"input":case"select":case"textarea":v=!!v.autoFocus;break e;case"img":v=!0;break e;default:v=!1}}v&&(u.flags|=4)}u.ref!==null&&(u.flags|=512,u.flags|=2097152)}return li(u),null;case 6:if(s&&u.stateNode!=null)vR(s,u,s.memoizedProps,v);else{if(typeof v!="string"&&u.stateNode===null)throw Error(r(166));if(h=bu(ch.current),bu(Ra.current),Cv(u)){if(v=u.stateNode,h=u.memoizedProps,v[Oa]=u,(I=v.nodeValue!==h)&&(s=Zi,s!==null))switch(s.tag){case 3:gv(v.nodeValue,h,(s.mode&1)!==0);break;case 5:s.memoizedProps.suppressHydrationWarning!==!0&&gv(v.nodeValue,h,(s.mode&1)!==0)}I&&(u.flags|=4)}else v=(h.nodeType===9?h:h.ownerDocument).createTextNode(v),v[Oa]=u,u.stateNode=v}return li(u),null;case 13:if(Br(Zr),v=u.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(Gr&&eo!==null&&(u.mode&1)!==0&&(u.flags&128)===0)bO(),Qc(),u.flags|=98560,I=!1;else if(I=Cv(u),v!==null&&v.dehydrated!==null){if(s===null){if(!I)throw Error(r(318));if(I=u.memoizedState,I=I!==null?I.dehydrated:null,!I)throw Error(r(317));I[Oa]=u}else Qc(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;li(u),I=!1}else Xo!==null&&(VS(Xo),Xo=null),I=!0;if(!I)return u.flags&65536?u:null}return(u.flags&128)!==0?(u.lanes=h,u):(v=v!==null,v!==(s!==null&&s.memoizedState!==null)&&v&&(u.child.flags|=8192,(u.mode&1)!==0&&(s===null||(Zr.current&1)!==0?On===0&&(On=3):US())),u.updateQueue!==null&&(u.flags|=4),li(u),null);case 4:return Zc(),IS(s,u),s===null&&nh(u.stateNode.containerInfo),li(u),null;case 10:return iS(u.type._context),li(u),null;case 17:return Ii(u.type)&&wv(),li(u),null;case 19:if(Br(Zr),I=u.memoizedState,I===null)return li(u),null;if(v=(u.flags&128)!==0,D=I.rendering,D===null)if(v)mh(I,!1);else{if(On!==0||s!==null&&(s.flags&128)!==0)for(s=u.child;s!==null;){if(D=kv(s),D!==null){for(u.flags|=128,mh(I,!1),v=D.updateQueue,v!==null&&(u.updateQueue=v,u.flags|=4),u.subtreeFlags=0,v=h,h=u.child;h!==null;)I=h,s=v,I.flags&=14680066,D=I.alternate,D===null?(I.childLanes=0,I.lanes=s,I.child=null,I.subtreeFlags=0,I.memoizedProps=null,I.memoizedState=null,I.updateQueue=null,I.dependencies=null,I.stateNode=null):(I.childLanes=D.childLanes,I.lanes=D.lanes,I.child=D.child,I.subtreeFlags=0,I.deletions=null,I.memoizedProps=D.memoizedProps,I.memoizedState=D.memoizedState,I.updateQueue=D.updateQueue,I.type=D.type,s=D.dependencies,I.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),h=h.sibling;return $r(Zr,Zr.current&1|2),u.child}s=s.sibling}I.tail!==null&&Et()>nd&&(u.flags|=128,v=!0,mh(I,!1),u.lanes=4194304)}else{if(!v)if(s=kv(D),s!==null){if(u.flags|=128,v=!0,h=s.updateQueue,h!==null&&(u.updateQueue=h,u.flags|=4),mh(I,!0),I.tail===null&&I.tailMode==="hidden"&&!D.alternate&&!Gr)return li(u),null}else 2*Et()-I.renderingStartTime>nd&&h!==1073741824&&(u.flags|=128,v=!0,mh(I,!1),u.lanes=4194304);I.isBackwards?(D.sibling=u.child,u.child=D):(h=I.last,h!==null?h.sibling=D:u.child=D,I.last=D)}return I.tail!==null?(u=I.tail,I.rendering=u,I.tail=u.sibling,I.renderingStartTime=Et(),u.sibling=null,h=Zr.current,$r(Zr,v?h&1|2:h&1),u):(li(u),null);case 22:case 23:return qS(),v=u.memoizedState!==null,s!==null&&s.memoizedState!==null!==v&&(u.flags|=8192),v&&(u.mode&1)!==0?(to&1073741824)!==0&&(li(u),u.subtreeFlags&6&&(u.flags|=8192)):li(u),null;case 24:return null;case 25:return null}throw Error(r(156,u.tag))}function i6(s,u){switch(Jw(u),u.tag){case 1:return Ii(u.type)&&wv(),s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 3:return Zc(),Br(Ri),Br(ai),dS(),s=u.flags,(s&65536)!==0&&(s&128)===0?(u.flags=s&-65537|128,u):null;case 5:return uS(u),null;case 13:if(Br(Zr),s=u.memoizedState,s!==null&&s.dehydrated!==null){if(u.alternate===null)throw Error(r(340));Qc()}return s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 19:return Br(Zr),null;case 4:return Zc(),null;case 10:return iS(u.type._context),null;case 22:case 23:return qS(),null;case 24:return null;default:return null}}var Bv=!1,ui=!1,o6=typeof WeakSet=="function"?WeakSet:Set,Ke=null;function td(s,u){var h=s.ref;if(h!==null)if(typeof h=="function")try{h(null)}catch(v){un(s,u,v)}else h.current=null}function kS(s,u,h){try{h()}catch(v){un(s,u,v)}}var gR=!1;function a6(s,u){if(qw=z,s=QT(),Dw(s)){if("selectionStart"in s)var h={start:s.selectionStart,end:s.selectionEnd};else e:{h=(h=s.ownerDocument)&&h.defaultView||window;var v=h.getSelection&&h.getSelection();if(v&&v.rangeCount!==0){h=v.anchorNode;var P=v.anchorOffset,I=v.focusNode;v=v.focusOffset;try{h.nodeType,I.nodeType}catch{h=null;break e}var D=0,W=-1,J=-1,Se=0,ke=0,Ae=s,Ie=null;t:for(;;){for(var He;Ae!==h||P!==0&&Ae.nodeType!==3||(W=D+P),Ae!==I||v!==0&&Ae.nodeType!==3||(J=D+v),Ae.nodeType===3&&(D+=Ae.nodeValue.length),(He=Ae.firstChild)!==null;)Ie=Ae,Ae=He;for(;;){if(Ae===s)break t;if(Ie===h&&++Se===P&&(W=D),Ie===I&&++ke===v&&(J=D),(He=Ae.nextSibling)!==null)break;Ae=Ie,Ie=Ae.parentNode}Ae=He}h=W===-1||J===-1?null:{start:W,end:J}}else h=null}h=h||{start:0,end:0}}else h=null;for(Uw={focusedElem:s,selectionRange:h},z=!1,Ke=u;Ke!==null;)if(u=Ke,s=u.child,(u.subtreeFlags&1028)!==0&&s!==null)s.return=u,Ke=s;else for(;Ke!==null;){u=Ke;try{var Xe=u.alternate;if((u.flags&1024)!==0)switch(u.tag){case 0:case 11:case 15:break;case 1:if(Xe!==null){var et=Xe.memoizedProps,yn=Xe.memoizedState,fe=u.stateNode,re=fe.getSnapshotBeforeUpdate(u.elementType===u.type?et:Jo(u.type,et),yn);fe.__reactInternalSnapshotBeforeUpdate=re}break;case 3:var me=u.stateNode.containerInfo;me.nodeType===1?me.textContent="":me.nodeType===9&&me.documentElement&&me.removeChild(me.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(Fe){un(u,u.return,Fe)}if(s=u.sibling,s!==null){s.return=u.return,Ke=s;break}Ke=u.return}return Xe=gR,gR=!1,Xe}function vh(s,u,h){var v=u.updateQueue;if(v=v!==null?v.lastEffect:null,v!==null){var P=v=v.next;do{if((P.tag&s)===s){var I=P.destroy;P.destroy=void 0,I!==void 0&&kS(u,h,I)}P=P.next}while(P!==v)}}function Vv(s,u){if(u=u.updateQueue,u=u!==null?u.lastEffect:null,u!==null){var h=u=u.next;do{if((h.tag&s)===s){var v=h.create;h.destroy=v()}h=h.next}while(h!==u)}}function jS(s){var u=s.ref;if(u!==null){var h=s.stateNode;switch(s.tag){case 5:s=h;break;default:s=h}typeof u=="function"?u(s):u.current=s}}function yR(s){var u=s.alternate;u!==null&&(s.alternate=null,yR(u)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(u=s.stateNode,u!==null&&(delete u[Oa],delete u[oh],delete u[Gw],delete u[zz],delete u[qz])),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}function bR(s){return s.tag===5||s.tag===3||s.tag===4}function wR(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||bR(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function $S(s,u,h){var v=s.tag;if(v===5||v===6)s=s.stateNode,u?h.nodeType===8?h.parentNode.insertBefore(s,u):h.insertBefore(s,u):(h.nodeType===8?(u=h.parentNode,u.insertBefore(s,h)):(u=h,u.appendChild(s)),h=h._reactRootContainer,h!=null||u.onclick!==null||(u.onclick=yv));else if(v!==4&&(s=s.child,s!==null))for($S(s,u,h),s=s.sibling;s!==null;)$S(s,u,h),s=s.sibling}function AS(s,u,h){var v=s.tag;if(v===5||v===6)s=s.stateNode,u?h.insertBefore(s,u):h.appendChild(s);else if(v!==4&&(s=s.child,s!==null))for(AS(s,u,h),s=s.sibling;s!==null;)AS(s,u,h),s=s.sibling}var Un=null,Zo=!1;function ul(s,u,h){for(h=h.child;h!==null;)SR(s,u,h),h=h.sibling}function SR(s,u,h){if(ln&&typeof ln.onCommitFiberUnmount=="function")try{ln.onCommitFiberUnmount(gi,h)}catch{}switch(h.tag){case 5:ui||td(h,u);case 6:var v=Un,P=Zo;Un=null,ul(s,u,h),Un=v,Zo=P,Un!==null&&(Zo?(s=Un,h=h.stateNode,s.nodeType===8?s.parentNode.removeChild(h):s.removeChild(h)):Un.removeChild(h.stateNode));break;case 18:Un!==null&&(Zo?(s=Un,h=h.stateNode,s.nodeType===8?Kw(s.parentNode,h):s.nodeType===1&&Kw(s,h),Zs(s)):Kw(Un,h.stateNode));break;case 4:v=Un,P=Zo,Un=h.stateNode.containerInfo,Zo=!0,ul(s,u,h),Un=v,Zo=P;break;case 0:case 11:case 14:case 15:if(!ui&&(v=h.updateQueue,v!==null&&(v=v.lastEffect,v!==null))){P=v=v.next;do{var I=P,D=I.destroy;I=I.tag,D!==void 0&&((I&2)!==0||(I&4)!==0)&&kS(h,u,D),P=P.next}while(P!==v)}ul(s,u,h);break;case 1:if(!ui&&(td(h,u),v=h.stateNode,typeof v.componentWillUnmount=="function"))try{v.props=h.memoizedProps,v.state=h.memoizedState,v.componentWillUnmount()}catch(W){un(h,u,W)}ul(s,u,h);break;case 21:ul(s,u,h);break;case 22:h.mode&1?(ui=(v=ui)||h.memoizedState!==null,ul(s,u,h),ui=v):ul(s,u,h);break;default:ul(s,u,h)}}function _R(s){var u=s.updateQueue;if(u!==null){s.updateQueue=null;var h=s.stateNode;h===null&&(h=s.stateNode=new o6),u.forEach(function(v){var P=m6.bind(null,s,v);h.has(v)||(h.add(v),v.then(P,P))})}}function ea(s,u){var h=u.deletions;if(h!==null)for(var v=0;v<h.length;v++){var P=h[v];try{var I=s,D=u,W=D;e:for(;W!==null;){switch(W.tag){case 5:Un=W.stateNode,Zo=!1;break e;case 3:Un=W.stateNode.containerInfo,Zo=!0;break e;case 4:Un=W.stateNode.containerInfo,Zo=!0;break e}W=W.return}if(Un===null)throw Error(r(160));SR(I,D,P),Un=null,Zo=!1;var J=P.alternate;J!==null&&(J.return=null),P.return=null}catch(Se){un(P,u,Se)}}if(u.subtreeFlags&12854)for(u=u.child;u!==null;)xR(u,s),u=u.sibling}function xR(s,u){var h=s.alternate,v=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:if(ea(u,s),ka(s),v&4){try{vh(3,s,s.return),Vv(3,s)}catch(et){un(s,s.return,et)}try{vh(5,s,s.return)}catch(et){un(s,s.return,et)}}break;case 1:ea(u,s),ka(s),v&512&&h!==null&&td(h,h.return);break;case 5:if(ea(u,s),ka(s),v&512&&h!==null&&td(h,h.return),s.flags&32){var P=s.stateNode;try{an(P,"")}catch(et){un(s,s.return,et)}}if(v&4&&(P=s.stateNode,P!=null)){var I=s.memoizedProps,D=h!==null?h.memoizedProps:I,W=s.type,J=s.updateQueue;if(s.updateQueue=null,J!==null)try{W==="input"&&I.type==="radio"&&I.name!=null&&Ce(P,I),gn(W,D);var Se=gn(W,I);for(D=0;D<J.length;D+=2){var ke=J[D],Ae=J[D+1];ke==="style"?xa(P,Ae):ke==="dangerouslySetInnerHTML"?Nr(P,Ae):ke==="children"?an(P,Ae):C(P,ke,Ae,Se)}switch(W){case"input":Ge(P,I);break;case"textarea":on(P,I);break;case"select":var Ie=P._wrapperState.wasMultiple;P._wrapperState.wasMultiple=!!I.multiple;var He=I.value;He!=null?jt(P,!!I.multiple,He,!1):Ie!==!!I.multiple&&(I.defaultValue!=null?jt(P,!!I.multiple,I.defaultValue,!0):jt(P,!!I.multiple,I.multiple?[]:"",!1))}P[oh]=I}catch(et){un(s,s.return,et)}}break;case 6:if(ea(u,s),ka(s),v&4){if(s.stateNode===null)throw Error(r(162));P=s.stateNode,I=s.memoizedProps;try{P.nodeValue=I}catch(et){un(s,s.return,et)}}break;case 3:if(ea(u,s),ka(s),v&4&&h!==null&&h.memoizedState.isDehydrated)try{Zs(u.containerInfo)}catch(et){un(s,s.return,et)}break;case 4:ea(u,s),ka(s);break;case 13:ea(u,s),ka(s),P=s.child,P.flags&8192&&(I=P.memoizedState!==null,P.stateNode.isHidden=I,!I||P.alternate!==null&&P.alternate.memoizedState!==null||(NS=Et())),v&4&&_R(s);break;case 22:if(ke=h!==null&&h.memoizedState!==null,s.mode&1?(ui=(Se=ui)||ke,ea(u,s),ui=Se):ea(u,s),ka(s),v&8192){if(Se=s.memoizedState!==null,(s.stateNode.isHidden=Se)&&!ke&&(s.mode&1)!==0)for(Ke=s,ke=s.child;ke!==null;){for(Ae=Ke=ke;Ke!==null;){switch(Ie=Ke,He=Ie.child,Ie.tag){case 0:case 11:case 14:case 15:vh(4,Ie,Ie.return);break;case 1:td(Ie,Ie.return);var Xe=Ie.stateNode;if(typeof Xe.componentWillUnmount=="function"){v=Ie,h=Ie.return;try{u=v,Xe.props=u.memoizedProps,Xe.state=u.memoizedState,Xe.componentWillUnmount()}catch(et){un(v,h,et)}}break;case 5:td(Ie,Ie.return);break;case 22:if(Ie.memoizedState!==null){ER(Ae);continue}}He!==null?(He.return=Ie,Ke=He):ER(Ae)}ke=ke.sibling}e:for(ke=null,Ae=s;;){if(Ae.tag===5){if(ke===null){ke=Ae;try{P=Ae.stateNode,Se?(I=P.style,typeof I.setProperty=="function"?I.setProperty("display","none","important"):I.display="none"):(W=Ae.stateNode,J=Ae.memoizedProps.style,D=J!=null&&J.hasOwnProperty("display")?J.display:null,W.style.display=Yi("display",D))}catch(et){un(s,s.return,et)}}}else if(Ae.tag===6){if(ke===null)try{Ae.stateNode.nodeValue=Se?"":Ae.memoizedProps}catch(et){un(s,s.return,et)}}else if((Ae.tag!==22&&Ae.tag!==23||Ae.memoizedState===null||Ae===s)&&Ae.child!==null){Ae.child.return=Ae,Ae=Ae.child;continue}if(Ae===s)break e;for(;Ae.sibling===null;){if(Ae.return===null||Ae.return===s)break e;ke===Ae&&(ke=null),Ae=Ae.return}ke===Ae&&(ke=null),Ae.sibling.return=Ae.return,Ae=Ae.sibling}}break;case 19:ea(u,s),ka(s),v&4&&_R(s);break;case 21:break;default:ea(u,s),ka(s)}}function ka(s){var u=s.flags;if(u&2){try{e:{for(var h=s.return;h!==null;){if(bR(h)){var v=h;break e}h=h.return}throw Error(r(160))}switch(v.tag){case 5:var P=v.stateNode;v.flags&32&&(an(P,""),v.flags&=-33);var I=wR(s);AS(s,I,P);break;case 3:case 4:var D=v.stateNode.containerInfo,W=wR(s);$S(s,W,D);break;default:throw Error(r(161))}}catch(J){un(s,s.return,J)}s.flags&=-3}u&4096&&(s.flags&=-4097)}function s6(s,u,h){Ke=s,PR(s)}function PR(s,u,h){for(var v=(s.mode&1)!==0;Ke!==null;){var P=Ke,I=P.child;if(P.tag===22&&v){var D=P.memoizedState!==null||Bv;if(!D){var W=P.alternate,J=W!==null&&W.memoizedState!==null||ui;W=Bv;var Se=ui;if(Bv=D,(ui=J)&&!Se)for(Ke=P;Ke!==null;)D=Ke,J=D.child,D.tag===22&&D.memoizedState!==null?TR(P):J!==null?(J.return=D,Ke=J):TR(P);for(;I!==null;)Ke=I,PR(I),I=I.sibling;Ke=P,Bv=W,ui=Se}CR(s)}else(P.subtreeFlags&8772)!==0&&I!==null?(I.return=P,Ke=I):CR(s)}}function CR(s){for(;Ke!==null;){var u=Ke;if((u.flags&8772)!==0){var h=u.alternate;try{if((u.flags&8772)!==0)switch(u.tag){case 0:case 11:case 15:ui||Vv(5,u);break;case 1:var v=u.stateNode;if(u.flags&4&&!ui)if(h===null)v.componentDidMount();else{var P=u.elementType===u.type?h.memoizedProps:Jo(u.type,h.memoizedProps);v.componentDidUpdate(P,h.memoizedState,v.__reactInternalSnapshotBeforeUpdate)}var I=u.updateQueue;I!==null&&EO(u,I,v);break;case 3:var D=u.updateQueue;if(D!==null){if(h=null,u.child!==null)switch(u.child.tag){case 5:h=u.child.stateNode;break;case 1:h=u.child.stateNode}EO(u,D,h)}break;case 5:var W=u.stateNode;if(h===null&&u.flags&4){h=W;var J=u.memoizedProps;switch(u.type){case"button":case"input":case"select":case"textarea":J.autoFocus&&h.focus();break;case"img":J.src&&(h.src=J.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(u.memoizedState===null){var Se=u.alternate;if(Se!==null){var ke=Se.memoizedState;if(ke!==null){var Ae=ke.dehydrated;Ae!==null&&Zs(Ae)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}ui||u.flags&512&&jS(u)}catch(Ie){un(u,u.return,Ie)}}if(u===s){Ke=null;break}if(h=u.sibling,h!==null){h.return=u.return,Ke=h;break}Ke=u.return}}function ER(s){for(;Ke!==null;){var u=Ke;if(u===s){Ke=null;break}var h=u.sibling;if(h!==null){h.return=u.return,Ke=h;break}Ke=u.return}}function TR(s){for(;Ke!==null;){var u=Ke;try{switch(u.tag){case 0:case 11:case 15:var h=u.return;try{Vv(4,u)}catch(J){un(u,h,J)}break;case 1:var v=u.stateNode;if(typeof v.componentDidMount=="function"){var P=u.return;try{v.componentDidMount()}catch(J){un(u,P,J)}}var I=u.return;try{jS(u)}catch(J){un(u,I,J)}break;case 5:var D=u.return;try{jS(u)}catch(J){un(u,D,J)}}}catch(J){un(u,u.return,J)}if(u===s){Ke=null;break}var W=u.sibling;if(W!==null){W.return=u.return,Ke=W;break}Ke=u.return}}var l6=Math.ceil,zv=k.ReactCurrentDispatcher,DS=k.ReactCurrentOwner,Eo=k.ReactCurrentBatchConfig,ir=0,Dn=null,Sn=null,Hn=0,to=0,rd=il(0),On=0,gh=null,Su=0,qv=0,MS=0,yh=null,ji=null,NS=0,nd=1/0,vs=null,Uv=!1,FS=null,cl=null,Hv=!1,dl=null,Wv=0,bh=0,LS=null,Kv=-1,Gv=0;function bi(){return(ir&6)!==0?Et():Kv!==-1?Kv:Kv=Et()}function fl(s){return(s.mode&1)===0?1:(ir&2)!==0&&Hn!==0?Hn&-Hn:Hz.transition!==null?(Gv===0&&(Gv=ov()),Gv):(s=sr,s!==0||(s=window.event,s=s===void 0?16:kr(s.type)),s)}function ta(s,u,h,v){if(50<bh)throw bh=0,LS=null,Error(r(185));du(s,h,v),((ir&2)===0||s!==Dn)&&(s===Dn&&((ir&2)===0&&(qv|=h),On===4&&hl(s,Hn)),$i(s,v),h===1&&ir===0&&(u.mode&1)===0&&(nd=Et()+500,_v&&al()))}function $i(s,u){var h=s.callbackNode;zf(s,u);var v=go(s,s===Dn?Hn:0);if(v===0)h!==null&&Gt(h),s.callbackNode=null,s.callbackPriority=0;else if(u=v&-v,s.callbackPriority!==u){if(h!=null&&Gt(h),u===1)s.tag===0?Uz(RR.bind(null,s)):pO(RR.bind(null,s)),Bz(function(){(ir&6)===0&&al()}),h=null;else{switch(av(v)){case 1:h=Fr;break;case 4:h=mi;break;case 16:h=ei;break;case 536870912:h=vi;break;default:h=ei}h=NR(h,OR.bind(null,s))}s.callbackPriority=u,s.callbackNode=h}}function OR(s,u){if(Kv=-1,Gv=0,(ir&6)!==0)throw Error(r(327));var h=s.callbackNode;if(id()&&s.callbackNode!==h)return null;var v=go(s,s===Dn?Hn:0);if(v===0)return null;if((v&30)!==0||(v&s.expiredLanes)!==0||u)u=Qv(s,v);else{u=v;var P=ir;ir|=2;var I=kR();(Dn!==s||Hn!==u)&&(vs=null,nd=Et()+500,xu(s,u));do try{d6();break}catch(W){IR(s,W)}while(!0);nS(),zv.current=I,ir=P,Sn!==null?u=0:(Dn=null,Hn=0,u=On)}if(u!==0){if(u===2&&(P=qf(s),P!==0&&(v=P,u=BS(s,P))),u===1)throw h=gh,xu(s,0),hl(s,v),$i(s,Et()),h;if(u===6)hl(s,v);else{if(P=s.current.alternate,(v&30)===0&&!u6(P)&&(u=Qv(s,v),u===2&&(I=qf(s),I!==0&&(v=I,u=BS(s,I))),u===1))throw h=gh,xu(s,0),hl(s,v),$i(s,Et()),h;switch(s.finishedWork=P,s.finishedLanes=v,u){case 0:case 1:throw Error(r(345));case 2:Pu(s,ji,vs);break;case 3:if(hl(s,v),(v&130023424)===v&&(u=NS+500-Et(),10<u)){if(go(s,0)!==0)break;if(P=s.suspendedLanes,(P&v)!==v){bi(),s.pingedLanes|=s.suspendedLanes&P;break}s.timeoutHandle=Ww(Pu.bind(null,s,ji,vs),u);break}Pu(s,ji,vs);break;case 4:if(hl(s,v),(v&4194240)===v)break;for(u=s.eventTimes,P=-1;0<v;){var D=31-ri(v);I=1<<D,D=u[D],D>P&&(P=D),v&=~I}if(v=P,v=Et()-v,v=(120>v?120:480>v?480:1080>v?1080:1920>v?1920:3e3>v?3e3:4320>v?4320:1960*l6(v/1960))-v,10<v){s.timeoutHandle=Ww(Pu.bind(null,s,ji,vs),v);break}Pu(s,ji,vs);break;case 5:Pu(s,ji,vs);break;default:throw Error(r(329))}}}return $i(s,Et()),s.callbackNode===h?OR.bind(null,s):null}function BS(s,u){var h=yh;return s.current.memoizedState.isDehydrated&&(xu(s,u).flags|=256),s=Qv(s,u),s!==2&&(u=ji,ji=h,u!==null&&VS(u)),s}function VS(s){ji===null?ji=s:ji.push.apply(ji,s)}function u6(s){for(var u=s;;){if(u.flags&16384){var h=u.updateQueue;if(h!==null&&(h=h.stores,h!==null))for(var v=0;v<h.length;v++){var P=h[v],I=P.getSnapshot;P=P.value;try{if(!Yo(I(),P))return!1}catch{return!1}}}if(h=u.child,u.subtreeFlags&16384&&h!==null)h.return=u,u=h;else{if(u===s)break;for(;u.sibling===null;){if(u.return===null||u.return===s)return!0;u=u.return}u.sibling.return=u.return,u=u.sibling}}return!0}function hl(s,u){for(u&=~MS,u&=~qv,s.suspendedLanes|=u,s.pingedLanes&=~u,s=s.expirationTimes;0<u;){var h=31-ri(u),v=1<<h;s[h]=-1,u&=~v}}function RR(s){if((ir&6)!==0)throw Error(r(327));id();var u=go(s,0);if((u&1)===0)return $i(s,Et()),null;var h=Qv(s,u);if(s.tag!==0&&h===2){var v=qf(s);v!==0&&(u=v,h=BS(s,v))}if(h===1)throw h=gh,xu(s,0),hl(s,u),$i(s,Et()),h;if(h===6)throw Error(r(345));return s.finishedWork=s.current.alternate,s.finishedLanes=u,Pu(s,ji,vs),$i(s,Et()),null}function zS(s,u){var h=ir;ir|=1;try{return s(u)}finally{ir=h,ir===0&&(nd=Et()+500,_v&&al())}}function _u(s){dl!==null&&dl.tag===0&&(ir&6)===0&&id();var u=ir;ir|=1;var h=Eo.transition,v=sr;try{if(Eo.transition=null,sr=1,s)return s()}finally{sr=v,Eo.transition=h,ir=u,(ir&6)===0&&al()}}function qS(){to=rd.current,Br(rd)}function xu(s,u){s.finishedWork=null,s.finishedLanes=0;var h=s.timeoutHandle;if(h!==-1&&(s.timeoutHandle=-1,Lz(h)),Sn!==null)for(h=Sn.return;h!==null;){var v=h;switch(Jw(v),v.tag){case 1:v=v.type.childContextTypes,v!=null&&wv();break;case 3:Zc(),Br(Ri),Br(ai),dS();break;case 5:uS(v);break;case 4:Zc();break;case 13:Br(Zr);break;case 19:Br(Zr);break;case 10:iS(v.type._context);break;case 22:case 23:qS()}h=h.return}if(Dn=s,Sn=s=pl(s.current,null),Hn=to=u,On=0,gh=null,MS=qv=Su=0,ji=yh=null,yu!==null){for(u=0;u<yu.length;u++)if(h=yu[u],v=h.interleaved,v!==null){h.interleaved=null;var P=v.next,I=h.pending;if(I!==null){var D=I.next;I.next=P,v.next=D}h.pending=v}yu=null}return s}function IR(s,u){do{var h=Sn;try{if(nS(),jv.current=Mv,$v){for(var v=en.memoizedState;v!==null;){var P=v.queue;P!==null&&(P.pending=null),v=v.next}$v=!1}if(wu=0,An=Tn=en=null,dh=!1,fh=0,DS.current=null,h===null||h.return===null){On=1,gh=u,Sn=null;break}e:{var I=s,D=h.return,W=h,J=u;if(u=Hn,W.flags|=32768,J!==null&&typeof J=="object"&&typeof J.then=="function"){var Se=J,ke=W,Ae=ke.tag;if((ke.mode&1)===0&&(Ae===0||Ae===11||Ae===15)){var Ie=ke.alternate;Ie?(ke.updateQueue=Ie.updateQueue,ke.memoizedState=Ie.memoizedState,ke.lanes=Ie.lanes):(ke.updateQueue=null,ke.memoizedState=null)}var He=tR(D);if(He!==null){He.flags&=-257,rR(He,D,W,I,u),He.mode&1&&eR(I,Se,u),u=He,J=Se;var Xe=u.updateQueue;if(Xe===null){var et=new Set;et.add(J),u.updateQueue=et}else Xe.add(J);break e}else{if((u&1)===0){eR(I,Se,u),US();break e}J=Error(r(426))}}else if(Gr&&W.mode&1){var yn=tR(D);if(yn!==null){(yn.flags&65536)===0&&(yn.flags|=256),rR(yn,D,W,I,u),tS(ed(J,W));break e}}I=J=ed(J,W),On!==4&&(On=2),yh===null?yh=[I]:yh.push(I),I=D;do{switch(I.tag){case 3:I.flags|=65536,u&=-u,I.lanes|=u;var fe=JO(I,J,u);CO(I,fe);break e;case 1:W=J;var re=I.type,me=I.stateNode;if((I.flags&128)===0&&(typeof re.getDerivedStateFromError=="function"||me!==null&&typeof me.componentDidCatch=="function"&&(cl===null||!cl.has(me)))){I.flags|=65536,u&=-u,I.lanes|=u;var Fe=ZO(I,W,u);CO(I,Fe);break e}}I=I.return}while(I!==null)}$R(h)}catch(nt){u=nt,Sn===h&&h!==null&&(Sn=h=h.return);continue}break}while(!0)}function kR(){var s=zv.current;return zv.current=Mv,s===null?Mv:s}function US(){(On===0||On===3||On===2)&&(On=4),Dn===null||(Su&268435455)===0&&(qv&268435455)===0||hl(Dn,Hn)}function Qv(s,u){var h=ir;ir|=2;var v=kR();(Dn!==s||Hn!==u)&&(vs=null,xu(s,u));do try{c6();break}catch(P){IR(s,P)}while(!0);if(nS(),ir=h,zv.current=v,Sn!==null)throw Error(r(261));return Dn=null,Hn=0,On}function c6(){for(;Sn!==null;)jR(Sn)}function d6(){for(;Sn!==null&&!it();)jR(Sn)}function jR(s){var u=MR(s.alternate,s,to);s.memoizedProps=s.pendingProps,u===null?$R(s):Sn=u,DS.current=null}function $R(s){var u=s;do{var h=u.alternate;if(s=u.return,(u.flags&32768)===0){if(h=n6(h,u,to),h!==null){Sn=h;return}}else{if(h=i6(h,u),h!==null){h.flags&=32767,Sn=h;return}if(s!==null)s.flags|=32768,s.subtreeFlags=0,s.deletions=null;else{On=6,Sn=null;return}}if(u=u.sibling,u!==null){Sn=u;return}Sn=u=s}while(u!==null);On===0&&(On=5)}function Pu(s,u,h){var v=sr,P=Eo.transition;try{Eo.transition=null,sr=1,f6(s,u,h,v)}finally{Eo.transition=P,sr=v}return null}function f6(s,u,h,v){do id();while(dl!==null);if((ir&6)!==0)throw Error(r(327));h=s.finishedWork;var P=s.finishedLanes;if(h===null)return null;if(s.finishedWork=null,s.finishedLanes=0,h===s.current)throw Error(r(177));s.callbackNode=null,s.callbackPriority=0;var I=h.lanes|h.childLanes;if(Pw(s,I),s===Dn&&(Sn=Dn=null,Hn=0),(h.subtreeFlags&2064)===0&&(h.flags&2064)===0||Hv||(Hv=!0,NR(ei,function(){return id(),null})),I=(h.flags&15990)!==0,(h.subtreeFlags&15990)!==0||I){I=Eo.transition,Eo.transition=null;var D=sr;sr=1;var W=ir;ir|=4,DS.current=null,a6(s,h),xR(h,s),jz(Uw),z=!!qw,Uw=qw=null,s.current=h,s6(h),Ct(),ir=W,sr=D,Eo.transition=I}else s.current=h;if(Hv&&(Hv=!1,dl=s,Wv=P),I=s.pendingLanes,I===0&&(cl=null),as(h.stateNode),$i(s,Et()),u!==null)for(v=s.onRecoverableError,h=0;h<u.length;h++)P=u[h],v(P.value,{componentStack:P.stack,digest:P.digest});if(Uv)throw Uv=!1,s=FS,FS=null,s;return(Wv&1)!==0&&s.tag!==0&&id(),I=s.pendingLanes,(I&1)!==0?s===LS?bh++:(bh=0,LS=s):bh=0,al(),null}function id(){if(dl!==null){var s=av(Wv),u=Eo.transition,h=sr;try{if(Eo.transition=null,sr=16>s?16:s,dl===null)var v=!1;else{if(s=dl,dl=null,Wv=0,(ir&6)!==0)throw Error(r(331));var P=ir;for(ir|=4,Ke=s.current;Ke!==null;){var I=Ke,D=I.child;if((Ke.flags&16)!==0){var W=I.deletions;if(W!==null){for(var J=0;J<W.length;J++){var Se=W[J];for(Ke=Se;Ke!==null;){var ke=Ke;switch(ke.tag){case 0:case 11:case 15:vh(8,ke,I)}var Ae=ke.child;if(Ae!==null)Ae.return=ke,Ke=Ae;else for(;Ke!==null;){ke=Ke;var Ie=ke.sibling,He=ke.return;if(yR(ke),ke===Se){Ke=null;break}if(Ie!==null){Ie.return=He,Ke=Ie;break}Ke=He}}}var Xe=I.alternate;if(Xe!==null){var et=Xe.child;if(et!==null){Xe.child=null;do{var yn=et.sibling;et.sibling=null,et=yn}while(et!==null)}}Ke=I}}if((I.subtreeFlags&2064)!==0&&D!==null)D.return=I,Ke=D;else e:for(;Ke!==null;){if(I=Ke,(I.flags&2048)!==0)switch(I.tag){case 0:case 11:case 15:vh(9,I,I.return)}var fe=I.sibling;if(fe!==null){fe.return=I.return,Ke=fe;break e}Ke=I.return}}var re=s.current;for(Ke=re;Ke!==null;){D=Ke;var me=D.child;if((D.subtreeFlags&2064)!==0&&me!==null)me.return=D,Ke=me;else e:for(D=re;Ke!==null;){if(W=Ke,(W.flags&2048)!==0)try{switch(W.tag){case 0:case 11:case 15:Vv(9,W)}}catch(nt){un(W,W.return,nt)}if(W===D){Ke=null;break e}var Fe=W.sibling;if(Fe!==null){Fe.return=W.return,Ke=Fe;break e}Ke=W.return}}if(ir=P,al(),ln&&typeof ln.onPostCommitFiberRoot=="function")try{ln.onPostCommitFiberRoot(gi,s)}catch{}v=!0}return v}finally{sr=h,Eo.transition=u}}return!1}function AR(s,u,h){u=ed(h,u),u=JO(s,u,1),s=ll(s,u,1),u=bi(),s!==null&&(du(s,1,u),$i(s,u))}function un(s,u,h){if(s.tag===3)AR(s,s,h);else for(;u!==null;){if(u.tag===3){AR(u,s,h);break}else if(u.tag===1){var v=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof v.componentDidCatch=="function"&&(cl===null||!cl.has(v))){s=ed(h,s),s=ZO(u,s,1),u=ll(u,s,1),s=bi(),u!==null&&(du(u,1,s),$i(u,s));break}}u=u.return}}function h6(s,u,h){var v=s.pingCache;v!==null&&v.delete(u),u=bi(),s.pingedLanes|=s.suspendedLanes&h,Dn===s&&(Hn&h)===h&&(On===4||On===3&&(Hn&130023424)===Hn&&500>Et()-NS?xu(s,0):MS|=h),$i(s,u)}function DR(s,u){u===0&&((s.mode&1)===0?u=1:(u=ss,ss<<=1,(ss&130023424)===0&&(ss=4194304)));var h=bi();s=hs(s,u),s!==null&&(du(s,u,h),$i(s,h))}function p6(s){var u=s.memoizedState,h=0;u!==null&&(h=u.retryLane),DR(s,h)}function m6(s,u){var h=0;switch(s.tag){case 13:var v=s.stateNode,P=s.memoizedState;P!==null&&(h=P.retryLane);break;case 19:v=s.stateNode;break;default:throw Error(r(314))}v!==null&&v.delete(u),DR(s,h)}var MR;MR=function(s,u,h){if(s!==null)if(s.memoizedProps!==u.pendingProps||Ri.current)ki=!0;else{if((s.lanes&h)===0&&(u.flags&128)===0)return ki=!1,r6(s,u,h);ki=(s.flags&131072)!==0}else ki=!1,Gr&&(u.flags&1048576)!==0&&mO(u,Pv,u.index);switch(u.lanes=0,u.tag){case 2:var v=u.type;Lv(s,u),s=u.pendingProps;var P=Wc(u,ai.current);Jc(u,h),P=pS(null,u,v,s,P,h);var I=mS();return u.flags|=1,typeof P=="object"&&P!==null&&typeof P.render=="function"&&P.$$typeof===void 0?(u.tag=1,u.memoizedState=null,u.updateQueue=null,Ii(v)?(I=!0,Sv(u)):I=!1,u.memoizedState=P.state!==null&&P.state!==void 0?P.state:null,sS(u),P.updater=Nv,u.stateNode=P,P._reactInternals=u,SS(u,v,s,h),u=CS(null,u,v,!0,I,h)):(u.tag=0,Gr&&I&&Xw(u),yi(null,u,P,h),u=u.child),u;case 16:v=u.elementType;e:{switch(Lv(s,u),s=u.pendingProps,P=v._init,v=P(v._payload),u.type=v,P=u.tag=g6(v),s=Jo(v,s),P){case 0:u=PS(null,u,v,s,h);break e;case 1:u=lR(null,u,v,s,h);break e;case 11:u=nR(null,u,v,s,h);break e;case 14:u=iR(null,u,v,Jo(v.type,s),h);break e}throw Error(r(306,v,""))}return u;case 0:return v=u.type,P=u.pendingProps,P=u.elementType===v?P:Jo(v,P),PS(s,u,v,P,h);case 1:return v=u.type,P=u.pendingProps,P=u.elementType===v?P:Jo(v,P),lR(s,u,v,P,h);case 3:e:{if(uR(u),s===null)throw Error(r(387));v=u.pendingProps,I=u.memoizedState,P=I.element,PO(s,u),Iv(u,v,null,h);var D=u.memoizedState;if(v=D.element,I.isDehydrated)if(I={element:v,isDehydrated:!1,cache:D.cache,pendingSuspenseBoundaries:D.pendingSuspenseBoundaries,transitions:D.transitions},u.updateQueue.baseState=I,u.memoizedState=I,u.flags&256){P=ed(Error(r(423)),u),u=cR(s,u,v,h,P);break e}else if(v!==P){P=ed(Error(r(424)),u),u=cR(s,u,v,h,P);break e}else for(eo=nl(u.stateNode.containerInfo.firstChild),Zi=u,Gr=!0,Xo=null,h=_O(u,null,v,h),u.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling;else{if(Qc(),v===P){u=ms(s,u,h);break e}yi(s,u,v,h)}u=u.child}return u;case 5:return TO(u),s===null&&eS(u),v=u.type,P=u.pendingProps,I=s!==null?s.memoizedProps:null,D=P.children,Hw(v,P)?D=null:I!==null&&Hw(v,I)&&(u.flags|=32),sR(s,u),yi(s,u,D,h),u.child;case 6:return s===null&&eS(u),null;case 13:return dR(s,u,h);case 4:return lS(u,u.stateNode.containerInfo),v=u.pendingProps,s===null?u.child=Yc(u,null,v,h):yi(s,u,v,h),u.child;case 11:return v=u.type,P=u.pendingProps,P=u.elementType===v?P:Jo(v,P),nR(s,u,v,P,h);case 7:return yi(s,u,u.pendingProps,h),u.child;case 8:return yi(s,u,u.pendingProps.children,h),u.child;case 12:return yi(s,u,u.pendingProps.children,h),u.child;case 10:e:{if(v=u.type._context,P=u.pendingProps,I=u.memoizedProps,D=P.value,$r(Tv,v._currentValue),v._currentValue=D,I!==null)if(Yo(I.value,D)){if(I.children===P.children&&!Ri.current){u=ms(s,u,h);break e}}else for(I=u.child,I!==null&&(I.return=u);I!==null;){var W=I.dependencies;if(W!==null){D=I.child;for(var J=W.firstContext;J!==null;){if(J.context===v){if(I.tag===1){J=ps(-1,h&-h),J.tag=2;var Se=I.updateQueue;if(Se!==null){Se=Se.shared;var ke=Se.pending;ke===null?J.next=J:(J.next=ke.next,ke.next=J),Se.pending=J}}I.lanes|=h,J=I.alternate,J!==null&&(J.lanes|=h),oS(I.return,h,u),W.lanes|=h;break}J=J.next}}else if(I.tag===10)D=I.type===u.type?null:I.child;else if(I.tag===18){if(D=I.return,D===null)throw Error(r(341));D.lanes|=h,W=D.alternate,W!==null&&(W.lanes|=h),oS(D,h,u),D=I.sibling}else D=I.child;if(D!==null)D.return=I;else for(D=I;D!==null;){if(D===u){D=null;break}if(I=D.sibling,I!==null){I.return=D.return,D=I;break}D=D.return}I=D}yi(s,u,P.children,h),u=u.child}return u;case 9:return P=u.type,v=u.pendingProps.children,Jc(u,h),P=Po(P),v=v(P),u.flags|=1,yi(s,u,v,h),u.child;case 14:return v=u.type,P=Jo(v,u.pendingProps),P=Jo(v.type,P),iR(s,u,v,P,h);case 15:return oR(s,u,u.type,u.pendingProps,h);case 17:return v=u.type,P=u.pendingProps,P=u.elementType===v?P:Jo(v,P),Lv(s,u),u.tag=1,Ii(v)?(s=!0,Sv(u)):s=!1,Jc(u,h),YO(u,v,P),SS(u,v,P,h),CS(null,u,v,!0,s,h);case 19:return hR(s,u,h);case 22:return aR(s,u,h)}throw Error(r(156,u.tag))};function NR(s,u){return ft(s,u)}function v6(s,u,h,v){this.tag=s,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=u,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=v,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function To(s,u,h,v){return new v6(s,u,h,v)}function HS(s){return s=s.prototype,!(!s||!s.isReactComponent)}function g6(s){if(typeof s=="function")return HS(s)?1:0;if(s!=null){if(s=s.$$typeof,s===se)return 11;if(s===X)return 14}return 2}function pl(s,u){var h=s.alternate;return h===null?(h=To(s.tag,u,s.key,s.mode),h.elementType=s.elementType,h.type=s.type,h.stateNode=s.stateNode,h.alternate=s,s.alternate=h):(h.pendingProps=u,h.type=s.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=s.flags&14680064,h.childLanes=s.childLanes,h.lanes=s.lanes,h.child=s.child,h.memoizedProps=s.memoizedProps,h.memoizedState=s.memoizedState,h.updateQueue=s.updateQueue,u=s.dependencies,h.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},h.sibling=s.sibling,h.index=s.index,h.ref=s.ref,h}function Yv(s,u,h,v,P,I){var D=2;if(v=s,typeof s=="function")HS(s)&&(D=1);else if(typeof s=="string")D=5;else e:switch(s){case T:return Cu(h.children,P,I,u);case A:D=8,P|=8;break;case M:return s=To(12,h,u,P|2),s.elementType=M,s.lanes=I,s;case ie:return s=To(13,h,u,P),s.elementType=ie,s.lanes=I,s;case N:return s=To(19,h,u,P),s.elementType=N,s.lanes=I,s;case ne:return Xv(h,P,I,u);default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case B:D=10;break e;case Q:D=9;break e;case se:D=11;break e;case X:D=14;break e;case ce:D=16,v=null;break e}throw Error(r(130,s==null?s:typeof s,""))}return u=To(D,h,u,P),u.elementType=s,u.type=v,u.lanes=I,u}function Cu(s,u,h,v){return s=To(7,s,v,u),s.lanes=h,s}function Xv(s,u,h,v){return s=To(22,s,v,u),s.elementType=ne,s.lanes=h,s.stateNode={isHidden:!1},s}function WS(s,u,h){return s=To(6,s,null,u),s.lanes=h,s}function KS(s,u,h){return u=To(4,s.children!==null?s.children:[],s.key,u),u.lanes=h,u.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},u}function y6(s,u,h,v,P){this.tag=u,this.containerInfo=s,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ac(0),this.expirationTimes=Ac(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ac(0),this.identifierPrefix=v,this.onRecoverableError=P,this.mutableSourceEagerHydrationData=null}function GS(s,u,h,v,P,I,D,W,J){return s=new y6(s,u,h,W,J),u===1?(u=1,I===!0&&(u|=8)):u=0,I=To(3,null,null,u),s.current=I,I.stateNode=s,I.memoizedState={element:v,isDehydrated:h,cache:null,transitions:null,pendingSuspenseBoundaries:null},sS(I),s}function b6(s,u,h){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:R,key:v==null?null:""+v,children:s,containerInfo:u,implementation:h}}function FR(s){if(!s)return ol;s=s._reactInternals;e:{if(ot(s)!==s||s.tag!==1)throw Error(r(170));var u=s;do{switch(u.tag){case 3:u=u.stateNode.context;break e;case 1:if(Ii(u.type)){u=u.stateNode.__reactInternalMemoizedMergedChildContext;break e}}u=u.return}while(u!==null);throw Error(r(171))}if(s.tag===1){var h=s.type;if(Ii(h))return fO(s,h,u)}return u}function LR(s,u,h,v,P,I,D,W,J){return s=GS(h,v,!0,s,P,I,D,W,J),s.context=FR(null),h=s.current,v=bi(),P=fl(h),I=ps(v,P),I.callback=u??null,ll(h,I,P),s.current.lanes=P,du(s,P,v),$i(s,v),s}function Jv(s,u,h,v){var P=u.current,I=bi(),D=fl(P);return h=FR(h),u.context===null?u.context=h:u.pendingContext=h,u=ps(I,D),u.payload={element:s},v=v===void 0?null:v,v!==null&&(u.callback=v),s=ll(P,u,D),s!==null&&(ta(s,P,D,I),Rv(s,P,D)),D}function Zv(s){if(s=s.current,!s.child)return null;switch(s.child.tag){case 5:return s.child.stateNode;default:return s.child.stateNode}}function BR(s,u){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var h=s.retryLane;s.retryLane=h!==0&&h<u?h:u}}function QS(s,u){BR(s,u),(s=s.alternate)&&BR(s,u)}function w6(){return null}var VR=typeof reportError=="function"?reportError:function(s){console.error(s)};function YS(s){this._internalRoot=s}eg.prototype.render=YS.prototype.render=function(s){var u=this._internalRoot;if(u===null)throw Error(r(409));Jv(s,u,null,null)},eg.prototype.unmount=YS.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var u=s.containerInfo;_u(function(){Jv(null,s,null,null)}),u[us]=null}};function eg(s){this._internalRoot=s}eg.prototype.unstable_scheduleHydration=function(s){if(s){var u=lv();s={blockedOn:null,target:s,priority:u};for(var h=0;h<So.length&&u!==0&&u<So[h].priority;h++);So.splice(h,0,s),h===0&&Kf(s)}};function XS(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function tg(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11&&(s.nodeType!==8||s.nodeValue!==" react-mount-point-unstable "))}function zR(){}function S6(s,u,h,v,P){if(P){if(typeof v=="function"){var I=v;v=function(){var Se=Zv(D);I.call(Se)}}var D=LR(u,v,s,0,null,!1,!1,"",zR);return s._reactRootContainer=D,s[us]=D.current,nh(s.nodeType===8?s.parentNode:s),_u(),D}for(;P=s.lastChild;)s.removeChild(P);if(typeof v=="function"){var W=v;v=function(){var Se=Zv(J);W.call(Se)}}var J=GS(s,0,!1,null,null,!1,!1,"",zR);return s._reactRootContainer=J,s[us]=J.current,nh(s.nodeType===8?s.parentNode:s),_u(function(){Jv(u,J,h,v)}),J}function rg(s,u,h,v,P){var I=h._reactRootContainer;if(I){var D=I;if(typeof P=="function"){var W=P;P=function(){var J=Zv(D);W.call(J)}}Jv(u,D,s,P)}else D=S6(h,u,s,P,v);return Zv(D)}sv=function(s){switch(s.tag){case 3:var u=s.stateNode;if(u.current.memoizedState.isDehydrated){var h=Ca(u.pendingLanes);h!==0&&(Uf(u,h|1),$i(u,Et()),(ir&6)===0&&(nd=Et()+500,al()))}break;case 13:_u(function(){var v=hs(s,1);if(v!==null){var P=bi();ta(v,s,1,P)}}),QS(s,1)}},Hf=function(s){if(s.tag===13){var u=hs(s,134217728);if(u!==null){var h=bi();ta(u,s,134217728,h)}QS(s,134217728)}},Dc=function(s){if(s.tag===13){var u=fl(s),h=hs(s,u);if(h!==null){var v=bi();ta(h,s,u,v)}QS(s,u)}},lv=function(){return sr},uv=function(s,u){var h=sr;try{return sr=s,u()}finally{sr=h}},Pa=function(s,u,h){switch(u){case"input":if(Ge(s,h),u=h.name,h.type==="radio"&&u!=null){for(h=s;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll("input[name="+JSON.stringify(""+u)+'][type="radio"]'),u=0;u<h.length;u++){var v=h[u];if(v!==s&&v.form===s.form){var P=bv(v);if(!P)throw Error(r(90));K(v),Ge(v,P)}}}break;case"textarea":on(s,h);break;case"select":u=h.value,u!=null&&jt(s,!!h.multiple,u,!1)}},ye=zS,xe=_u;var _6={usingClientEntryPoint:!1,Events:[ah,Uc,bv,Ji,le,zS]},wh={findFiberByHostInstance:pu,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},x6={bundleType:wh.bundleType,version:wh.version,rendererPackageName:wh.rendererPackageName,rendererConfig:wh.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:k.ReactCurrentDispatcher,findHostInstanceByFiber:function(s){return s=At(s),s===null?null:s.stateNode},findFiberByHostInstance:wh.findFiberByHostInstance||w6,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ng=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ng.isDisabled&&ng.supportsFiber)try{gi=ng.inject(x6),ln=ng}catch{}}return Ai.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=_6,Ai.createPortal=function(s,u){var h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!XS(u))throw Error(r(200));return b6(s,u,null,h)},Ai.createRoot=function(s,u){if(!XS(s))throw Error(r(299));var h=!1,v="",P=VR;return u!=null&&(u.unstable_strictMode===!0&&(h=!0),u.identifierPrefix!==void 0&&(v=u.identifierPrefix),u.onRecoverableError!==void 0&&(P=u.onRecoverableError)),u=GS(s,1,!1,null,null,h,!1,v,P),s[us]=u.current,nh(s.nodeType===8?s.parentNode:s),new YS(u)},Ai.findDOMNode=function(s){if(s==null)return null;if(s.nodeType===1)return s;var u=s._reactInternals;if(u===void 0)throw typeof s.render=="function"?Error(r(188)):(s=Object.keys(s).join(","),Error(r(268,s)));return s=At(u),s=s===null?null:s.stateNode,s},Ai.flushSync=function(s){return _u(s)},Ai.hydrate=function(s,u,h){if(!tg(u))throw Error(r(200));return rg(null,s,u,!0,h)},Ai.hydrateRoot=function(s,u,h){if(!XS(s))throw Error(r(405));var v=h!=null&&h.hydratedSources||null,P=!1,I="",D=VR;if(h!=null&&(h.unstable_strictMode===!0&&(P=!0),h.identifierPrefix!==void 0&&(I=h.identifierPrefix),h.onRecoverableError!==void 0&&(D=h.onRecoverableError)),u=LR(u,null,s,1,h??null,P,!1,I,D),s[us]=u.current,nh(s),v)for(s=0;s<v.length;s++)h=v[s],P=h._getVersion,P=P(h._source),u.mutableSourceEagerHydrationData==null?u.mutableSourceEagerHydrationData=[h,P]:u.mutableSourceEagerHydrationData.push(h,P);return new eg(u)},Ai.render=function(s,u,h){if(!tg(u))throw Error(r(200));return rg(null,s,u,!1,h)},Ai.unmountComponentAtNode=function(s){if(!tg(s))throw Error(r(40));return s._reactRootContainer?(_u(function(){rg(null,null,s,!1,function(){s._reactRootContainer=null,s[us]=null})}),!0):!1},Ai.unstable_batchedUpdates=zS,Ai.unstable_renderSubtreeIntoContainer=function(s,u,h,v){if(!tg(h))throw Error(r(200));if(s==null||s._reactInternals===void 0)throw Error(r(38));return rg(s,u,h,!1,v)},Ai.version="18.3.1-next-f1338f8080-20240426",Ai}var YR;function cM(){if(YR)return e1.exports;YR=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),e1.exports=$6(),e1.exports}var XR;function A6(){if(XR)return og;XR=1;var e=cM();return og.createRoot=e.createRoot,og.hydrateRoot=e.hydrateRoot,og}var D6=A6();const M6={BASE_URL:"/",DEV:!1,GIT_BRANCH_NAME:"HEAD",GIT_COMMIT_HASH:"f61b09c",MODE:"production",PACKAGE_VERSION:"1.0.0",PROD:!0,REACT_APP_ENDPOINT_HOST:"",REACT_APP_ENDPOINT_PORT:"",REACT_APP_ENDPOINT_SERVER_URL:"/endpoint",REACT_APP_GRAPHQL_SERVER_URL:"/graphql",REACT_APP_SWAGGER_SERVER_URL:"/api",SSR:!1},Oy=e=>{var n;const t=M6[e];return((n=window.__env__)==null?void 0:n[e])||t};function N6(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function F6(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var L6=function(){function e(r){var n=this;this._insertTag=function(i){var o;n.tags.length===0?n.insertionPoint?o=n.insertionPoint.nextSibling:n.prepend?o=n.container.firstChild:o=n.before:o=n.tags[n.tags.length-1].nextSibling,n.container.insertBefore(i,o),n.tags.push(i)},this.isSpeedy=r.speedy===void 0?!0:r.speedy,this.tags=[],this.ctr=0,this.nonce=r.nonce,this.key=r.key,this.container=r.container,this.prepend=r.prepend,this.insertionPoint=r.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(n){n.forEach(this._insertTag)},t.insert=function(n){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(F6(this));var i=this.tags[this.tags.length-1];if(this.isSpeedy){var o=N6(i);try{o.insertRule(n,o.cssRules.length)}catch{}}else i.appendChild(document.createTextNode(n));this.ctr++},t.flush=function(){this.tags.forEach(function(n){return n.parentNode&&n.parentNode.removeChild(n)}),this.tags=[],this.ctr=0},e}(),ci="-ms-",ib="-moz-",hr="-webkit-",dM="comm",JP="rule",ZP="decl",B6="@import",fM="@keyframes",V6="@layer",z6=Math.abs,a0=String.fromCharCode,q6=Object.assign;function U6(e,t){return Yn(e,0)^45?(((t<<2^Yn(e,0))<<2^Yn(e,1))<<2^Yn(e,2))<<2^Yn(e,3):0}function hM(e){return e.trim()}function H6(e,t){return(e=t.exec(e))?e[0]:e}function pr(e,t,r){return e.replace(t,r)}function tx(e,t){return e.indexOf(t)}function Yn(e,t){return e.charCodeAt(t)|0}function Op(e,t,r){return e.slice(t,r)}function Ma(e){return e.length}function eC(e){return e.length}function ag(e,t){return t.push(e),e}function W6(e,t){return e.map(t).join("")}var s0=1,Zd=1,pM=0,Vi=0,Cn=0,_f="";function l0(e,t,r,n,i,o,a){return{value:e,root:t,parent:r,type:n,props:i,children:o,line:s0,column:Zd,length:a,return:""}}function _h(e,t){return q6(l0("",null,null,"",null,null,0),e,{length:-e.length},t)}function K6(){return Cn}function G6(){return Cn=Vi>0?Yn(_f,--Vi):0,Zd--,Cn===10&&(Zd=1,s0--),Cn}function so(){return Cn=Vi<pM?Yn(_f,Vi++):0,Zd++,Cn===10&&(Zd=1,s0++),Cn}function Ua(){return Yn(_f,Vi)}function Ry(){return Vi}function Sm(e,t){return Op(_f,e,t)}function Rp(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function mM(e){return s0=Zd=1,pM=Ma(_f=e),Vi=0,[]}function vM(e){return _f="",e}function Iy(e){return hM(Sm(Vi-1,rx(e===91?e+2:e===40?e+1:e)))}function Q6(e){for(;(Cn=Ua())&&Cn<33;)so();return Rp(e)>2||Rp(Cn)>3?"":" "}function Y6(e,t){for(;--t&&so()&&!(Cn<48||Cn>102||Cn>57&&Cn<65||Cn>70&&Cn<97););return Sm(e,Ry()+(t<6&&Ua()==32&&so()==32))}function rx(e){for(;so();)switch(Cn){case e:return Vi;case 34:case 39:e!==34&&e!==39&&rx(Cn);break;case 40:e===41&&rx(e);break;case 92:so();break}return Vi}function X6(e,t){for(;so()&&e+Cn!==57;)if(e+Cn===84&&Ua()===47)break;return"/*"+Sm(t,Vi-1)+"*"+a0(e===47?e:so())}function J6(e){for(;!Rp(Ua());)so();return Sm(e,Vi)}function Z6(e){return vM(ky("",null,null,null,[""],e=mM(e),0,[0],e))}function ky(e,t,r,n,i,o,a,l,c){for(var d=0,f=0,p=a,m=0,g=0,b=0,y=1,w=1,_=1,S=0,C="",k=i,E=o,R=n,T=C;w;)switch(b=S,S=so()){case 40:if(b!=108&&Yn(T,p-1)==58){tx(T+=pr(Iy(S),"&","&\f"),"&\f")!=-1&&(_=-1);break}case 34:case 39:case 91:T+=Iy(S);break;case 9:case 10:case 13:case 32:T+=Q6(b);break;case 92:T+=Y6(Ry()-1,7);continue;case 47:switch(Ua()){case 42:case 47:ag(e8(X6(so(),Ry()),t,r),c);break;default:T+="/"}break;case 123*y:l[d++]=Ma(T)*_;case 125*y:case 59:case 0:switch(S){case 0:case 125:w=0;case 59+f:_==-1&&(T=pr(T,/\f/g,"")),g>0&&Ma(T)-p&&ag(g>32?ZR(T+";",n,r,p-1):ZR(pr(T," ","")+";",n,r,p-2),c);break;case 59:T+=";";default:if(ag(R=JR(T,t,r,d,f,i,l,C,k=[],E=[],p),o),S===123)if(f===0)ky(T,t,R,R,k,o,p,l,E);else switch(m===99&&Yn(T,3)===110?100:m){case 100:case 108:case 109:case 115:ky(e,R,R,n&&ag(JR(e,R,R,0,0,i,l,C,i,k=[],p),E),i,E,p,l,n?k:E);break;default:ky(T,R,R,R,[""],E,0,l,E)}}d=f=g=0,y=_=1,C=T="",p=a;break;case 58:p=1+Ma(T),g=b;default:if(y<1){if(S==123)--y;else if(S==125&&y++==0&&G6()==125)continue}switch(T+=a0(S),S*y){case 38:_=f>0?1:(T+="\f",-1);break;case 44:l[d++]=(Ma(T)-1)*_,_=1;break;case 64:Ua()===45&&(T+=Iy(so())),m=Ua(),f=p=Ma(C=T+=J6(Ry())),S++;break;case 45:b===45&&Ma(T)==2&&(y=0)}}return o}function JR(e,t,r,n,i,o,a,l,c,d,f){for(var p=i-1,m=i===0?o:[""],g=eC(m),b=0,y=0,w=0;b<n;++b)for(var _=0,S=Op(e,p+1,p=z6(y=a[b])),C=e;_<g;++_)(C=hM(y>0?m[_]+" "+S:pr(S,/&\f/g,m[_])))&&(c[w++]=C);return l0(e,t,r,i===0?JP:l,c,d,f)}function e8(e,t,r){return l0(e,t,r,dM,a0(K6()),Op(e,2,-2),0)}function ZR(e,t,r,n){return l0(e,t,r,ZP,Op(e,0,n),Op(e,n+1,-1),n)}function qd(e,t){for(var r="",n=eC(e),i=0;i<n;i++)r+=t(e[i],i,e,t)||"";return r}function t8(e,t,r,n){switch(e.type){case V6:if(e.children.length)break;case B6:case ZP:return e.return=e.return||e.value;case dM:return"";case fM:return e.return=e.value+"{"+qd(e.children,n)+"}";case JP:e.value=e.props.join(",")}return Ma(r=qd(e.children,n))?e.return=e.value+"{"+r+"}":""}function r8(e){var t=eC(e);return function(r,n,i,o){for(var a="",l=0;l<t;l++)a+=e[l](r,n,i,o)||"";return a}}function n8(e){return function(t){t.root||(t=t.return)&&e(t)}}var eI=function(t){var r=new WeakMap;return function(n){if(r.has(n))return r.get(n);var i=t(n);return r.set(n,i),i}};function gM(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}var i8=function(t,r,n){for(var i=0,o=0;i=o,o=Ua(),i===38&&o===12&&(r[n]=1),!Rp(o);)so();return Sm(t,Vi)},o8=function(t,r){var n=-1,i=44;do switch(Rp(i)){case 0:i===38&&Ua()===12&&(r[n]=1),t[n]+=i8(Vi-1,r,n);break;case 2:t[n]+=Iy(i);break;case 4:if(i===44){t[++n]=Ua()===58?"&\f":"",r[n]=t[n].length;break}default:t[n]+=a0(i)}while(i=so());return t},a8=function(t,r){return vM(o8(mM(t),r))},tI=new WeakMap,s8=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var r=t.value,n=t.parent,i=t.column===n.column&&t.line===n.line;n.type!=="rule";)if(n=n.parent,!n)return;if(!(t.props.length===1&&r.charCodeAt(0)!==58&&!tI.get(n))&&!i){tI.set(t,!0);for(var o=[],a=a8(r,o),l=n.props,c=0,d=0;c<a.length;c++)for(var f=0;f<l.length;f++,d++)t.props[d]=o[c]?a[c].replace(/&\f/g,l[f]):l[f]+" "+a[c]}}},l8=function(t){if(t.type==="decl"){var r=t.value;r.charCodeAt(0)===108&&r.charCodeAt(2)===98&&(t.return="",t.value="")}};function yM(e,t){switch(U6(e,t)){case 5103:return hr+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return hr+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return hr+e+ib+e+ci+e+e;case 6828:case 4268:return hr+e+ci+e+e;case 6165:return hr+e+ci+"flex-"+e+e;case 5187:return hr+e+pr(e,/(\w+).+(:[^]+)/,hr+"box-$1$2"+ci+"flex-$1$2")+e;case 5443:return hr+e+ci+"flex-item-"+pr(e,/flex-|-self/,"")+e;case 4675:return hr+e+ci+"flex-line-pack"+pr(e,/align-content|flex-|-self/,"")+e;case 5548:return hr+e+ci+pr(e,"shrink","negative")+e;case 5292:return hr+e+ci+pr(e,"basis","preferred-size")+e;case 6060:return hr+"box-"+pr(e,"-grow","")+hr+e+ci+pr(e,"grow","positive")+e;case 4554:return hr+pr(e,/([^-])(transform)/g,"$1"+hr+"$2")+e;case 6187:return pr(pr(pr(e,/(zoom-|grab)/,hr+"$1"),/(image-set)/,hr+"$1"),e,"")+e;case 5495:case 3959:return pr(e,/(image-set\([^]*)/,hr+"$1$`$1");case 4968:return pr(pr(e,/(.+:)(flex-)?(.*)/,hr+"box-pack:$3"+ci+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+hr+e+e;case 4095:case 3583:case 4068:case 2532:return pr(e,/(.+)-inline(.+)/,hr+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Ma(e)-1-t>6)switch(Yn(e,t+1)){case 109:if(Yn(e,t+4)!==45)break;case 102:return pr(e,/(.+:)(.+)-([^]+)/,"$1"+hr+"$2-$3$1"+ib+(Yn(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~tx(e,"stretch")?yM(pr(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Yn(e,t+1)!==115)break;case 6444:switch(Yn(e,Ma(e)-3-(~tx(e,"!important")&&10))){case 107:return pr(e,":",":"+hr)+e;case 101:return pr(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+hr+(Yn(e,14)===45?"inline-":"")+"box$3$1"+hr+"$2$3$1"+ci+"$2box$3")+e}break;case 5936:switch(Yn(e,t+11)){case 114:return hr+e+ci+pr(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return hr+e+ci+pr(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return hr+e+ci+pr(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return hr+e+ci+e+e}return e}var u8=function(t,r,n,i){if(t.length>-1&&!t.return)switch(t.type){case ZP:t.return=yM(t.value,t.length);break;case fM:return qd([_h(t,{value:pr(t.value,"@","@"+hr)})],i);case JP:if(t.length)return W6(t.props,function(o){switch(H6(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return qd([_h(t,{props:[pr(o,/:(read-\w+)/,":"+ib+"$1")]})],i);case"::placeholder":return qd([_h(t,{props:[pr(o,/:(plac\w+)/,":"+hr+"input-$1")]}),_h(t,{props:[pr(o,/:(plac\w+)/,":"+ib+"$1")]}),_h(t,{props:[pr(o,/:(plac\w+)/,ci+"input-$1")]})],i)}return""})}},c8=[u8],d8=function(t){var r=t.key;if(r==="css"){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(y){var w=y.getAttribute("data-emotion");w.indexOf(" ")!==-1&&(document.head.appendChild(y),y.setAttribute("data-s",""))})}var i=t.stylisPlugins||c8,o={},a,l=[];a=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+r+' "]'),function(y){for(var w=y.getAttribute("data-emotion").split(" "),_=1;_<w.length;_++)o[w[_]]=!0;l.push(y)});var c,d=[s8,l8];{var f,p=[t8,n8(function(y){f.insert(y)})],m=r8(d.concat(i,p)),g=function(w){return qd(Z6(w),m)};c=function(w,_,S,C){f=S,g(w?w+"{"+_.styles+"}":_.styles),C&&(b.inserted[_.name]=!0)}}var b={key:r,sheet:new L6({key:r,container:a,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:o,registered:{},insert:c};return b.sheet.hydrate(l),b};function ob(){return ob=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ob.apply(null,arguments)}var n1={exports:{}},br={};/** @license React v16.13.1
|
41
41
|
* react-is.production.min.js
|
42
42
|
*
|
43
43
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
@@ -437,9 +437,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
437
437
|
--`.concat(o),l="",c=gue(e),d=!0,B.label=1;case 1:return d?[4,c.next()]:[3,3];case 2:for(f=B.sent(),p=f.value,m=f.done,g=typeof p=="string"?p:r.decode(p),b=l.length-a.length+1,d=!m,l+=g,y=l.indexOf(a,b);y>-1;){if(w=void 0,T=[l.slice(0,y),l.slice(y+a.length)],w=T[0],l=T[1],_=w.indexOf(`\r
|
438
438
|
\r
|
439
439
|
`),S=_ue(w.slice(0,_)),C=S["content-type"],C&&C.toLowerCase().indexOf("application/json")===-1)throw new Error("Unsupported patch content type: application/json is required.");if(k=w.slice(_),k){if(E=U5(e,k),Object.keys(E).length>1||"data"in E||"incremental"in E||"errors"in E||"payload"in E)if(rue(E)){if(R={},"payload"in E){if(Object.keys(E).length===1&&E.payload===null)return[2];R=ve({},E.payload)}"errors"in E&&(R=ve(ve({},R),{extensions:ve(ve({},"extensions"in R?R.extensions:null),(A={},A[LE]=E.errors,A))})),t(R)}else t(E);else if(Object.keys(E).length===1&&"hasNext"in E&&!E.hasNext)return[2]}y=l.indexOf(a)}return[3,1];case 3:return[2]}})})}function _ue(e){var t={};return e.split(`
|
440
|
-
`).forEach(function(r){var n=r.indexOf(":");if(n>-1){var i=r.slice(0,n).trim().toLowerCase(),o=r.slice(n+1).trim();t[i]=o}}),t}function U5(e,t){if(e.status>=300){var r=function(){try{return JSON.parse(t)}catch{return t}};q5(e,r(),"Response not successful: Received status code ".concat(e.status))}try{return JSON.parse(t)}catch(i){var n=i;throw n.name="ServerParseError",n.response=e,n.statusCode=e.status,n.bodyText=t,n}}function xue(e,t){e.result&&e.result.errors&&e.result.data&&t.next(e.result),t.error(e)}function Pue(e){return function(t){return t.text().then(function(r){return U5(t,r)}).then(function(r){return!Array.isArray(r)&&!W$.call(r,"data")&&!W$.call(r,"errors")&&q5(t,r,"Server response was missing for query '".concat(Array.isArray(e)?e.map(function(n){return n.operationName}):e.operationName,"'.")),r})}}var yP=function(e,t){var r;try{r=JSON.stringify(e)}catch(i){var n=Ei(39,t,i.message);throw n.parseError=i,n}return r},Cue={includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},Eue={accept:"*/*","content-type":"application/json"},Tue={method:"POST"},Oue={http:Cue,headers:Eue,options:Tue},Rue=function(e,t){return t(e)};function Iue(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i={},o={};r.forEach(function(p){i=ve(ve(ve({},i),p.options),{headers:ve(ve({},i.headers),p.headers)}),p.credentials&&(i.credentials=p.credentials),o=ve(ve({},o),p.http)}),i.headers&&(i.headers=kue(i.headers,o.preserveHeaderCase));var a=e.operationName,l=e.extensions,c=e.variables,d=e.query,f={operationName:a,variables:c};return o.includeExtensions&&(f.extensions=l),o.includeQuery&&(f.query=t(d,G0)),{options:i,body:f}}function kue(e,t){if(!t){var r=Object.create(null);return Object.keys(Object(e)).forEach(function(o){r[o.toLowerCase()]=e[o]}),r}var n=Object.create(null);Object.keys(Object(e)).forEach(function(o){n[o.toLowerCase()]={originalName:o,value:e[o]}});var i=Object.create(null);return Object.keys(n).forEach(function(o){i[n[o].originalName]=n[o].value}),i}var jue=function(e){if(!e&&typeof fetch>"u")throw Ei(37)},$ue=function(e,t){var r=e.getContext(),n=r.uri;return n||(typeof t=="function"?t(e):t||"/graphql")};function Aue(e,t){var r=[],n=function(p,m){r.push("".concat(p,"=").concat(encodeURIComponent(m)))};if("query"in t&&n("query",t.query),t.operationName&&n("operationName",t.operationName),t.variables){var i=void 0;try{i=yP(t.variables,"Variables map")}catch(p){return{parseError:p}}n("variables",i)}if(t.extensions){var o=void 0;try{o=yP(t.extensions,"Extensions map")}catch(p){return{parseError:p}}n("extensions",o)}var a="",l=e,c=e.indexOf("#");c!==-1&&(a=e.substr(c),l=e.substr(0,c));var d=l.indexOf("?")===-1?"?":"&",f=l+d+r.join("&")+a;return{newURI:f}}var K$=aa(function(){return fetch}),H5=function(e){e===void 0&&(e={});var t=e.uri,r=t===void 0?"/graphql":t,n=e.fetch,i=e.print,o=i===void 0?Rue:i,a=e.includeExtensions,l=e.preserveHeaderCase,c=e.useGETForQueries,d=e.includeUnusedVariables,f=d===void 0?!1:d,p=Ms(e,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);globalThis.__DEV__!==!1&&jue(n||K$);var m={http:{includeExtensions:a,preserveHeaderCase:l},options:p.fetchOptions,credentials:p.credentials,headers:p.headers};return new Ws(function(g){var b=$ue(g,r),y=g.getContext(),w={};if(y.clientAwareness){var _=y.clientAwareness,S=_.name,C=_.version;S&&(w["apollographql-client-name"]=S),C&&(w["apollographql-client-version"]=C)}var k=ve(ve({},w),y.headers),E={http:y.http,options:y.fetchOptions,credentials:y.credentials,headers:k};if(Jp(["client"],g.query)){var R=M5(g.query);if(!R)return c_(new Error("HttpLink: Trying to send a client-only query to the server. To send to the server, ensure a non-client field is added to the query or set the `transformOptions.removeClientFields` option to `true`."));g.query=R}var T=Iue(g,o,Oue,m,E),A=T.options,M=T.body;M.variables&&!f&&(M.variables=aue(M.variables,g.query));var B;!A.signal&&typeof AbortController<"u"&&(B=new AbortController,A.signal=B.signal);var Q=function(ge){return ge.kind==="OperationDefinition"&&ge.operation==="mutation"},se=function(ge){return ge.kind==="OperationDefinition"&&ge.operation==="subscription"},ie=se(Gm(g.query)),N=Jp(["defer"],g.query);if(c&&!g.query.definitions.some(Q)&&(A.method="GET"),N||ie){A.headers=A.headers||{};var X="multipart/mixed;";ie&&N&&globalThis.__DEV__!==!1&&_t.warn(38),ie?X+="boundary=graphql;subscriptionSpec=1.0,application/json":N&&(X+="deferSpec=20220824,application/json"),A.headers.accept=X}if(A.method==="GET"){var ce=Aue(b,M),ne=ce.newURI,ee=ce.parseError;if(ee)return c_(ee);b=ne}else try{A.body=yP(M,"Payload")}catch(ge){return c_(ge)}return new Rr(function(ge){var Z=n||aa(function(){return fetch})||K$,j=ge.next.bind(ge);return Z(b,A).then(function(U){var q;g.setContext({response:U});var $=(q=U.headers)===null||q===void 0?void 0:q.get("content-type");return $!==null&&/^multipart\/mixed/i.test($)?Sue(U,j):Pue(g)(U).then(j)}).then(function(){B=void 0,ge.complete()}).catch(function(U){B=void 0,xue(U,ge)}),function(){B&&B.abort()}})})},Due=function(e){ga(t,e);function t(r){r===void 0&&(r={});var n=e.call(this,H5(r).request)||this;return n.options=r,n}return t}(Ws);const{toString:G$,hasOwnProperty:Mue}=Object.prototype,Q$=Function.prototype.toString,bP=new Map;function qr(e,t){try{return wP(e,t)}finally{bP.clear()}}function wP(e,t){if(e===t)return!0;const r=G$.call(e),n=G$.call(t);if(r!==n)return!1;switch(r){case"[object Array]":if(e.length!==t.length)return!1;case"[object Object]":{if(X$(e,t))return!0;const i=Y$(e),o=Y$(t),a=i.length;if(a!==o.length)return!1;for(let l=0;l<a;++l)if(!Mue.call(t,i[l]))return!1;for(let l=0;l<a;++l){const c=i[l];if(!wP(e[c],t[c]))return!1}return!0}case"[object Error]":return e.name===t.name&&e.message===t.message;case"[object Number]":if(e!==e)return t!==t;case"[object Boolean]":case"[object Date]":return+e==+t;case"[object RegExp]":case"[object String]":return e==`${t}`;case"[object Map]":case"[object Set]":{if(e.size!==t.size)return!1;if(X$(e,t))return!0;const i=e.entries(),o=r==="[object Map]";for(;;){const a=i.next();if(a.done)break;const[l,c]=a.value;if(!t.has(l)||o&&!wP(c,t.get(l)))return!1}return!0}case"[object Uint16Array]":case"[object Uint8Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object ArrayBuffer]":e=new Uint8Array(e),t=new Uint8Array(t);case"[object DataView]":{let i=e.byteLength;if(i===t.byteLength)for(;i--&&e[i]===t[i];);return i===-1}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{const i=Q$.call(e);return i!==Q$.call(t)?!1:!Lue(i,Fue)}}return!1}function Y$(e){return Object.keys(e).filter(Nue,e)}function Nue(e){return this[e]!==void 0}const Fue="{ [native code] }";function Lue(e,t){const r=e.length-t.length;return r>=0&&e.indexOf(t,r)===r}function X$(e,t){let r=bP.get(e);if(r){if(r.has(t))return!0}else bP.set(e,r=new Set);return r.add(t),!1}function W5(e,t,r,n){var i=t.data,o=Ms(t,["data"]),a=r.data,l=Ms(r,["data"]);return qr(o,l)&&Jy(Gm(e).selectionSet,i,a,{fragmentMap:z0(H0(e)),variables:n})}function Jy(e,t,r,n){if(t===r)return!0;var i=new Set;return e.selections.every(function(o){if(i.has(o)||(i.add(o),!Hm(o,n.variables))||J$(o))return!0;if(Kl(o)){var a=Wl(o),l=t&&t[a],c=r&&r[a],d=o.selectionSet;if(!d)return qr(l,c);var f=Array.isArray(l),p=Array.isArray(c);if(f!==p)return!1;if(f&&p){var m=l.length;if(c.length!==m)return!1;for(var g=0;g<m;++g)if(!Jy(d,l[g],c[g],n))return!1;return!0}return Jy(d,l,c,n)}else{var b=q0(o,n.fragmentMap);if(b)return J$(b)?!0:Jy(b.selectionSet,t,r,n)}})}function J$(e){return!!e.directives&&e.directives.some(Bue)}function Bue(e){return e.name.value==="nonreactive"}var K5=function(){function e(){this.assumeImmutableResults=!1,this.getFragmentDoc=em(Use,{max:Bs["cache.fragmentQueryDocuments"]||1e3,cache:kb})}return e.prototype.batch=function(t){var r=this,n=typeof t.optimistic=="string"?t.optimistic:t.optimistic===!1?null:void 0,i;return this.performTransaction(function(){return i=t.update(r)},n),i},e.prototype.recordOptimisticTransaction=function(t,r){this.performTransaction(t,r)},e.prototype.transformDocument=function(t){return t},e.prototype.transformForLink=function(t){return t},e.prototype.identify=function(t){},e.prototype.gc=function(){return[]},e.prototype.modify=function(t){return!1},e.prototype.readQuery=function(t,r){return r===void 0&&(r=!!t.optimistic),this.read(ve(ve({},t),{rootId:t.id||"ROOT_QUERY",optimistic:r}))},e.prototype.watchFragment=function(t){var r=this,n=t.fragment,i=t.fragmentName,o=t.from,a=t.optimistic,l=a===void 0?!0:a,c=this.getFragmentDoc(n,i),d={returnPartialData:!0,id:typeof o=="string"?o:this.identify(o),query:c,optimistic:l},f;return new Rr(function(p){return r.watch(ve(ve({},d),{immediate:!0,callback:function(m){if(!(f&&W5(c,{data:f==null?void 0:f.result},{data:m.result}))){var g={data:m.result,complete:!!m.complete};m.missing&&(g.missing=Q0(m.missing.map(function(b){return b.missing}))),f=m,p.next(g)}}}))})},e.prototype.readFragment=function(t,r){return r===void 0&&(r=!!t.optimistic),this.read(ve(ve({},t),{query:this.getFragmentDoc(t.fragment,t.fragmentName),rootId:t.id,optimistic:r}))},e.prototype.writeQuery=function(t){var r=t.id,n=t.data,i=Ms(t,["id","data"]);return this.write(Object.assign(i,{dataId:r||"ROOT_QUERY",result:n}))},e.prototype.writeFragment=function(t){var r=t.id,n=t.data,i=t.fragment,o=t.fragmentName,a=Ms(t,["id","data","fragment","fragmentName"]);return this.write(Object.assign(a,{query:this.getFragmentDoc(i,o),dataId:r,result:n}))},e.prototype.updateQuery=function(t,r){return this.batch({update:function(n){var i=n.readQuery(t),o=r(i);return o==null?i:(n.writeQuery(ve(ve({},t),{data:o})),o)}})},e.prototype.updateFragment=function(t,r){return this.batch({update:function(n){var i=n.readFragment(t),o=r(i);return o==null?i:(n.writeFragment(ve(ve({},t),{data:o})),o)}})},e}();globalThis.__DEV__!==!1&&(K5.prototype.getMemoryInternals=tle);var G5=function(e){ga(t,e);function t(r,n,i,o){var a,l=e.call(this,r)||this;if(l.message=r,l.path=n,l.query=i,l.variables=o,Array.isArray(l.path)){l.missing=l.message;for(var c=l.path.length-1;c>=0;--c)l.missing=(a={},a[l.path[c]]=l.missing,a)}else l.missing=l.path;return l.__proto__=t.prototype,l}return t}(Error),Fn=Object.prototype.hasOwnProperty;function Dh(e){return e==null}function Q5(e,t){var r=e.__typename,n=e.id,i=e._id;if(typeof r=="string"&&(t&&(t.keyObject=Dh(n)?Dh(i)?void 0:{_id:i}:{id:n}),Dh(n)&&!Dh(i)&&(n=i),!Dh(n)))return"".concat(r,":").concat(typeof n=="number"||typeof n=="string"?n:JSON.stringify(n))}var Y5={dataIdFromObject:Q5,addTypename:!0,resultCaching:!0,canonizeResults:!1};function Vue(e){return gf(Y5,e)}function X5(e){var t=e.canonizeResults;return t===void 0?Y5.canonizeResults:t}function zue(e,t){return wr(t)?e.get(t.__ref,"__typename"):t&&t.__typename}var J5=/^[_a-z][_0-9a-z]*/i;function Yl(e){var t=e.match(J5);return t?t[0]:e}function SP(e,t,r){return fn(t)?hn(t)?t.every(function(n){return SP(e,n,r)}):e.selections.every(function(n){if(Kl(n)&&Hm(n,r)){var i=Wl(n);return Fn.call(t,i)&&(!n.selectionSet||SP(n.selectionSet,t[i],r))}return!0}):!1}function Bd(e){return fn(e)&&!wr(e)&&!hn(e)}function que(){return new Ql}function Z5(e,t){var r=z0(H0(e));return{fragmentMap:r,lookupFragment:function(n){var i=r[n];return!i&&t&&(i=t.lookup(n)),i||null}}}var Zy=Object.create(null),d_=function(){return Zy},Z$=Object.create(null),tm=function(){function e(t,r){var n=this;this.policies=t,this.group=r,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(i,o){return mP(wr(i)?n.get(i.__ref,o):i&&i[o])},this.canRead=function(i){return wr(i)?n.has(i.__ref):typeof i=="object"},this.toReference=function(i,o){if(typeof i=="string")return Qd(i);if(wr(i))return i;var a=n.policies.identify(i)[0];if(a){var l=Qd(a);return o&&n.merge(a,i),l}}}return e.prototype.toObject=function(){return ve({},this.data)},e.prototype.has=function(t){return this.lookup(t,!0)!==void 0},e.prototype.get=function(t,r){if(this.group.depend(t,r),Fn.call(this.data,t)){var n=this.data[t];if(n&&Fn.call(n,r))return n[r]}if(r==="__typename"&&Fn.call(this.policies.rootTypenamesById,t))return this.policies.rootTypenamesById[t];if(this instanceof xl)return this.parent.get(t,r)},e.prototype.lookup=function(t,r){if(r&&this.group.depend(t,"__exists"),Fn.call(this.data,t))return this.data[t];if(this instanceof xl)return this.parent.lookup(t,r);if(this.policies.rootTypenamesById[t])return Object.create(null)},e.prototype.merge=function(t,r){var n=this,i;wr(t)&&(t=t.__ref),wr(r)&&(r=r.__ref);var o=typeof t=="string"?this.lookup(i=t):t,a=typeof r=="string"?this.lookup(i=r):r;if(a){_t(typeof i=="string",1);var l=new Ql(Hue).merge(o,a);if(this.data[i]=l,l!==o&&(delete this.refs[i],this.group.caching)){var c=Object.create(null);o||(c.__exists=1),Object.keys(a).forEach(function(d){if(!o||o[d]!==l[d]){c[d]=1;var f=Yl(d);f!==d&&!n.policies.hasKeyArgs(l.__typename,f)&&(c[f]=1),l[d]===void 0&&!(n instanceof xl)&&delete l[d]}}),c.__typename&&!(o&&o.__typename)&&this.policies.rootTypenamesById[i]===l.__typename&&delete c.__typename,Object.keys(c).forEach(function(d){return n.group.dirty(i,d)})}}},e.prototype.modify=function(t,r){var n=this,i=this.lookup(t);if(i){var o=Object.create(null),a=!1,l=!0,c={DELETE:Zy,INVALIDATE:Z$,isReference:wr,toReference:this.toReference,canRead:this.canRead,readField:function(d,f){return n.policies.readField(typeof d=="string"?{fieldName:d,from:f||Qd(t)}:d,{store:n})}};if(Object.keys(i).forEach(function(d){var f=Yl(d),p=i[d];if(p!==void 0){var m=typeof r=="function"?r:r[d]||r[f];if(m){var g=m===d_?Zy:m(mP(p),ve(ve({},c),{fieldName:f,storeFieldName:d,storage:n.getStorage(t,d)}));if(g===Z$)n.group.dirty(t,d);else if(g===Zy&&(g=void 0),g!==p&&(o[d]=g,a=!0,p=g,globalThis.__DEV__!==!1)){var b=function(E){if(n.lookup(E.__ref)===void 0)return globalThis.__DEV__!==!1&&_t.warn(2,E),!0};if(wr(g))b(g);else if(Array.isArray(g))for(var y=!1,w=void 0,_=0,S=g;_<S.length;_++){var C=S[_];if(wr(C)){if(y=!0,b(C))break}else if(typeof C=="object"&&C){var k=n.policies.identify(C)[0];k&&(w=C)}if(y&&w!==void 0){globalThis.__DEV__!==!1&&_t.warn(3,w);break}}}}p!==void 0&&(l=!1)}}),a)return this.merge(t,o),l&&(this instanceof xl?this.data[t]=void 0:delete this.data[t],this.group.dirty(t,"__exists")),!0}return!1},e.prototype.delete=function(t,r,n){var i,o=this.lookup(t);if(o){var a=this.getFieldValue(o,"__typename"),l=r&&n?this.policies.getStoreFieldName({typename:a,fieldName:r,args:n}):r;return this.modify(t,l?(i={},i[l]=d_,i):d_)}return!1},e.prototype.evict=function(t,r){var n=!1;return t.id&&(Fn.call(this.data,t.id)&&(n=this.delete(t.id,t.fieldName,t.args)),this instanceof xl&&this!==r&&(n=this.parent.evict(t,r)||n),(t.fieldName||n)&&this.group.dirty(t.id,t.fieldName||"__exists")),n},e.prototype.clear=function(){this.replace(null)},e.prototype.extract=function(){var t=this,r=this.toObject(),n=[];return this.getRootIdSet().forEach(function(i){Fn.call(t.policies.rootTypenamesById,i)||n.push(i)}),n.length&&(r.__META={extraRootIds:n.sort()}),r},e.prototype.replace=function(t){var r=this;if(Object.keys(this.data).forEach(function(o){t&&Fn.call(t,o)||r.delete(o)}),t){var n=t.__META,i=Ms(t,["__META"]);Object.keys(i).forEach(function(o){r.merge(o,i[o])}),n&&n.extraRootIds.forEach(this.retain,this)}},e.prototype.retain=function(t){return this.rootIds[t]=(this.rootIds[t]||0)+1},e.prototype.release=function(t){if(this.rootIds[t]>0){var r=--this.rootIds[t];return r||delete this.rootIds[t],r}return 0},e.prototype.getRootIdSet=function(t){return t===void 0&&(t=new Set),Object.keys(this.rootIds).forEach(t.add,t),this instanceof xl?this.parent.getRootIdSet(t):Object.keys(this.policies.rootTypenamesById).forEach(t.add,t),t},e.prototype.gc=function(){var t=this,r=this.getRootIdSet(),n=this.toObject();r.forEach(function(a){Fn.call(n,a)&&(Object.keys(t.findChildRefIds(a)).forEach(r.add,r),delete n[a])});var i=Object.keys(n);if(i.length){for(var o=this;o instanceof xl;)o=o.parent;i.forEach(function(a){return o.delete(a)})}return i},e.prototype.findChildRefIds=function(t){if(!Fn.call(this.refs,t)){var r=this.refs[t]=Object.create(null),n=this.data[t];if(!n)return r;var i=new Set([n]);i.forEach(function(o){wr(o)&&(r[o.__ref]=!0),fn(o)&&Object.keys(o).forEach(function(a){var l=o[a];fn(l)&&i.add(l)})})}return this.refs[t]},e.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},e}(),eB=function(){function e(t,r){r===void 0&&(r=null),this.caching=t,this.parent=r,this.d=null,this.resetCaching()}return e.prototype.resetCaching=function(){this.d=this.caching?j5():null,this.keyMaker=new kf(jf)},e.prototype.depend=function(t,r){if(this.d){this.d(f_(t,r));var n=Yl(r);n!==r&&this.d(f_(t,n)),this.parent&&this.parent.depend(t,r)}},e.prototype.dirty=function(t,r){this.d&&this.d.dirty(f_(t,r),r==="__exists"?"forget":"setDirty")},e}();function f_(e,t){return t+"#"+e}function e2(e,t){yp(e)&&e.group.depend(t,"__exists")}(function(e){var t=function(r){ga(n,r);function n(i){var o=i.policies,a=i.resultCaching,l=a===void 0?!0:a,c=i.seed,d=r.call(this,o,new eB(l))||this;return d.stump=new Uue(d),d.storageTrie=new kf(jf),c&&d.replace(c),d}return n.prototype.addLayer=function(i,o){return this.stump.addLayer(i,o)},n.prototype.removeLayer=function(){return this},n.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},n}(e);e.Root=t})(tm||(tm={}));var xl=function(e){ga(t,e);function t(r,n,i,o){var a=e.call(this,n.policies,o)||this;return a.id=r,a.parent=n,a.replay=i,a.group=o,i(a),a}return t.prototype.addLayer=function(r,n){return new t(r,this,n,this.group)},t.prototype.removeLayer=function(r){var n=this,i=this.parent.removeLayer(r);return r===this.id?(this.group.caching&&Object.keys(this.data).forEach(function(o){var a=n.data[o],l=i.lookup(o);l?a?a!==l&&Object.keys(a).forEach(function(c){qr(a[c],l[c])||n.group.dirty(o,c)}):(n.group.dirty(o,"__exists"),Object.keys(l).forEach(function(c){n.group.dirty(o,c)})):n.delete(o)}),i):i===this.parent?this:i.addLayer(this.id,this.replay)},t.prototype.toObject=function(){return ve(ve({},this.parent.toObject()),this.data)},t.prototype.findChildRefIds=function(r){var n=this.parent.findChildRefIds(r);return Fn.call(this.data,r)?ve(ve({},n),e.prototype.findChildRefIds.call(this,r)):n},t.prototype.getStorage=function(){for(var r=this.parent;r.parent;)r=r.parent;return r.getStorage.apply(r,arguments)},t}(tm),Uue=function(e){ga(t,e);function t(r){return e.call(this,"EntityStore.Stump",r,function(){},new eB(r.group.caching,r.group))||this}return t.prototype.removeLayer=function(){return this},t.prototype.merge=function(r,n){return this.parent.merge(r,n)},t}(xl);function Hue(e,t,r){var n=e[r],i=t[r];return qr(n,i)?n:i}function yp(e){return!!(e instanceof tm&&e.group.caching)}function Wue(e){return fn(e)?hn(e)?e.slice(0):ve({__proto__:Object.getPrototypeOf(e)},e):e}var t2=function(){function e(){this.known=new(h5?WeakSet:Set),this.pool=new kf(jf),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return e.prototype.isKnown=function(t){return fn(t)&&this.known.has(t)},e.prototype.pass=function(t){if(fn(t)){var r=Wue(t);return this.passes.set(r,t),r}return t},e.prototype.admit=function(t){var r=this;if(fn(t)){var n=this.passes.get(t);if(n)return n;var i=Object.getPrototypeOf(t);switch(i){case Array.prototype:{if(this.known.has(t))return t;var o=t.map(this.admit,this),a=this.pool.lookupArray(o);return a.array||(this.known.add(a.array=o),globalThis.__DEV__!==!1&&Object.freeze(o)),a.array}case null:case Object.prototype:{if(this.known.has(t))return t;var l=Object.getPrototypeOf(t),c=[l],d=this.sortedKeys(t);c.push(d.json);var f=c.length;d.sorted.forEach(function(g){c.push(r.admit(t[g]))});var a=this.pool.lookupArray(c);if(!a.object){var p=a.object=Object.create(l);this.known.add(p),d.sorted.forEach(function(g,b){p[g]=c[f+b]}),globalThis.__DEV__!==!1&&Object.freeze(p)}return a.object}}}return t},e.prototype.sortedKeys=function(t){var r=Object.keys(t),n=this.pool.lookupArray(r);if(!n.keys){r.sort();var i=JSON.stringify(r);(n.keys=this.keysByJSON.get(i))||this.keysByJSON.set(i,n.keys={sorted:r,json:i})}return n.keys},e}();function r2(e){return[e.selectionSet,e.objectOrReference,e.context,e.context.canonizeResults]}var Kue=function(){function e(t){var r=this;this.knownResults=new(jf?WeakMap:Map),this.config=gf(t,{addTypename:t.addTypename!==!1,canonizeResults:X5(t)}),this.canon=t.canon||new t2,this.executeSelectionSet=em(function(n){var i,o=n.context.canonizeResults,a=r2(n);a[3]=!o;var l=(i=r.executeSelectionSet).peek.apply(i,a);return l?o?ve(ve({},l),{result:r.canon.admit(l.result)}):l:(e2(n.context.store,n.enclosingRef.__ref),r.execSelectionSetImpl(n))},{max:this.config.resultCacheMaxSize||Bs["inMemoryCache.executeSelectionSet"]||5e4,keyArgs:r2,makeCacheKey:function(n,i,o,a){if(yp(o.store))return o.store.makeCacheKey(n,wr(i)?i.__ref:i,o.varString,a)}}),this.executeSubSelectedArray=em(function(n){return e2(n.context.store,n.enclosingRef.__ref),r.execSubSelectedArrayImpl(n)},{max:this.config.resultCacheMaxSize||Bs["inMemoryCache.executeSubSelectedArray"]||1e4,makeCacheKey:function(n){var i=n.field,o=n.array,a=n.context;if(yp(a.store))return a.store.makeCacheKey(i,o,a.varString)}})}return e.prototype.resetCanon=function(){this.canon=new t2},e.prototype.diffQueryAgainstStore=function(t){var r=t.store,n=t.query,i=t.rootId,o=i===void 0?"ROOT_QUERY":i,a=t.variables,l=t.returnPartialData,c=l===void 0?!0:l,d=t.canonizeResults,f=d===void 0?this.config.canonizeResults:d,p=this.config.cache.policies;a=ve(ve({},OE(S5(n))),a);var m=Qd(o),g=this.executeSelectionSet({selectionSet:Gm(n).selectionSet,objectOrReference:m,enclosingRef:m,context:ve({store:r,query:n,policies:p,variables:a,varString:Ml(a),canonizeResults:f},Z5(n,this.config.fragments))}),b;if(g.missing&&(b=[new G5(Gue(g.missing),g.missing,n,a)],!c))throw b[0];return{result:g.result,complete:!b,missing:b}},e.prototype.isFresh=function(t,r,n,i){if(yp(i.store)&&this.knownResults.get(t)===n){var o=this.executeSelectionSet.peek(n,r,i,this.canon.isKnown(t));if(o&&t===o.result)return!0}return!1},e.prototype.execSelectionSetImpl=function(t){var r=this,n=t.selectionSet,i=t.objectOrReference,o=t.enclosingRef,a=t.context;if(wr(i)&&!a.policies.rootTypenamesById[i.__ref]&&!a.store.has(i.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(i.__ref," object")};var l=a.variables,c=a.policies,d=a.store,f=d.getFieldValue(i,"__typename"),p=[],m,g=new Ql;this.config.addTypename&&typeof f=="string"&&!c.rootIdsByTypename[f]&&p.push({__typename:f});function b(C,k){var E;return C.missing&&(m=g.merge(m,(E={},E[k]=C.missing,E))),C.result}var y=new Set(n.selections);y.forEach(function(C){var k,E;if(Hm(C,l))if(Kl(C)){var R=c.readField({fieldName:C.name.value,field:C,variables:a.variables,from:i},a),T=Wl(C);R===void 0?AE.added(C)||(m=g.merge(m,(k={},k[T]="Can't find field '".concat(C.name.value,"' on ").concat(wr(i)?i.__ref+" object":"object "+JSON.stringify(i,null,2)),k))):hn(R)?R.length>0&&(R=b(r.executeSubSelectedArray({field:C,array:R,enclosingRef:o,context:a}),T)):C.selectionSet?R!=null&&(R=b(r.executeSelectionSet({selectionSet:C.selectionSet,objectOrReference:R,enclosingRef:wr(R)?R:o,context:a}),T)):a.canonizeResults&&(R=r.canon.pass(R)),R!==void 0&&p.push((E={},E[T]=R,E))}else{var A=q0(C,a.lookupFragment);if(!A&&C.kind===Je.FRAGMENT_SPREAD)throw Ei(9,C.name.value);A&&c.fragmentMatches(A,f)&&A.selectionSet.selections.forEach(y.add,y)}});var w=Q0(p),_={result:w,missing:m},S=a.canonizeResults?this.canon.admit(_):mP(_);return S.result&&this.knownResults.set(S.result,n),S},e.prototype.execSubSelectedArrayImpl=function(t){var r=this,n=t.field,i=t.array,o=t.enclosingRef,a=t.context,l,c=new Ql;function d(f,p){var m;return f.missing&&(l=c.merge(l,(m={},m[p]=f.missing,m))),f.result}return n.selectionSet&&(i=i.filter(a.store.canRead)),i=i.map(function(f,p){return f===null?null:hn(f)?d(r.executeSubSelectedArray({field:n,array:f,enclosingRef:o,context:a}),p):n.selectionSet?d(r.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:f,enclosingRef:wr(f)?f:o,context:a}),p):(globalThis.__DEV__!==!1&&Que(a.store,n,f),f)}),{result:a.canonizeResults?this.canon.admit(i):i,missing:l}},e}();function Gue(e){try{JSON.stringify(e,function(t,r){if(typeof r=="string")throw r;return r})}catch(t){return t}}function Que(e,t,r){if(!t.selectionSet){var n=new Set([r]);n.forEach(function(i){fn(i)&&(_t(!wr(i),10,zue(e,i),t.name.value),Object.values(i).forEach(n.add,n))})}}var BE=new IE,n2=new WeakMap;function bp(e){var t=n2.get(e);return t||n2.set(e,t={vars:new Set,dep:j5()}),t}function i2(e){bp(e).vars.forEach(function(t){return t.forgetCache(e)})}function Yue(e){bp(e).vars.forEach(function(t){return t.attachCache(e)})}function Xue(e){var t=new Set,r=new Set,n=function(o){if(arguments.length>0){if(e!==o){e=o,t.forEach(function(c){bp(c).dep.dirty(n),Jue(c)});var a=Array.from(r);r.clear(),a.forEach(function(c){return c(e)})}}else{var l=BE.getValue();l&&(i(l),bp(l).dep(n))}return e};n.onNextChange=function(o){return r.add(o),function(){r.delete(o)}};var i=n.attachCache=function(o){return t.add(o),bp(o).vars.add(n),n};return n.forgetCache=function(o){return t.delete(o)},n}function Jue(e){e.broadcastWatches&&e.broadcastWatches()}var o2=Object.create(null);function VE(e){var t=JSON.stringify(e);return o2[t]||(o2[t]=Object.create(null))}function a2(e){var t=VE(e);return t.keyFieldsFn||(t.keyFieldsFn=function(r,n){var i=function(a,l){return n.readField(l,a)},o=n.keyObject=zE(e,function(a){var l=Xd(n.storeObject,a,i);return l===void 0&&r!==n.storeObject&&Fn.call(r,a[0])&&(l=Xd(r,a,rB)),_t(l!==void 0,4,a.join("."),r),l});return"".concat(n.typename,":").concat(JSON.stringify(o))})}function s2(e){var t=VE(e);return t.keyArgsFn||(t.keyArgsFn=function(r,n){var i=n.field,o=n.variables,a=n.fieldName,l=zE(e,function(d){var f=d[0],p=f.charAt(0);if(p==="@"){if(i&&Za(i.directives)){var m=f.slice(1),g=i.directives.find(function(_){return _.name.value===m}),b=g&&U0(g,o);return b&&Xd(b,d.slice(1))}return}if(p==="$"){var y=f.slice(1);if(o&&Fn.call(o,y)){var w=d.slice(0);return w[0]=y,Xd(o,w)}return}if(r)return Xd(r,d)}),c=JSON.stringify(l);return(r||c!=="{}")&&(a+=":"+c),a})}function zE(e,t){var r=new Ql;return tB(e).reduce(function(n,i){var o,a=t(i);if(a!==void 0){for(var l=i.length-1;l>=0;--l)a=(o={},o[i[l]]=a,o);n=r.merge(n,a)}return n},Object.create(null))}function tB(e){var t=VE(e);if(!t.paths){var r=t.paths=[],n=[];e.forEach(function(i,o){hn(i)?(tB(i).forEach(function(a){return r.push(n.concat(a))}),n.length=0):(n.push(i),hn(e[o+1])||(r.push(n.slice(0)),n.length=0))})}return t.paths}function rB(e,t){return e[t]}function Xd(e,t,r){return r=r||rB,nB(t.reduce(function n(i,o){return hn(i)?i.map(function(a){return n(a,o)}):i&&r(i,o)},e))}function nB(e){return fn(e)?hn(e)?e.map(nB):zE(Object.keys(e).sort(),function(t){return Xd(e,t)}):e}function _P(e){return e.args!==void 0?e.args:e.field?U0(e.field,e.variables):null}var Zue=function(){},l2=function(e,t){return t.fieldName},u2=function(e,t,r){var n=r.mergeObjects;return n(e,t)},c2=function(e,t){return t},ece=function(){function e(t){this.config=t,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=ve({dataIdFromObject:Q5},t),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),t.possibleTypes&&this.addPossibleTypes(t.possibleTypes),t.typePolicies&&this.addTypePolicies(t.typePolicies)}return e.prototype.identify=function(t,r){var n,i=this,o=r&&(r.typename||((n=r.storeObject)===null||n===void 0?void 0:n.__typename))||t.__typename;if(o===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var a=r&&r.storeObject||t,l=ve(ve({},r),{typename:o,storeObject:a,readField:r&&r.readField||function(){var m=qE(arguments,a);return i.readField(m,{store:i.cache.data,variables:m.variables})}}),c,d=o&&this.getTypePolicy(o),f=d&&d.keyFn||this.config.dataIdFromObject;f;){var p=f(ve(ve({},t),a),l);if(hn(p))f=a2(p);else{c=p;break}}return c=c?String(c):void 0,l.keyObject?[c,l.keyObject]:[c]},e.prototype.addTypePolicies=function(t){var r=this;Object.keys(t).forEach(function(n){var i=t[n],o=i.queryType,a=i.mutationType,l=i.subscriptionType,c=Ms(i,["queryType","mutationType","subscriptionType"]);o&&r.setRootTypename("Query",n),a&&r.setRootTypename("Mutation",n),l&&r.setRootTypename("Subscription",n),Fn.call(r.toBeAdded,n)?r.toBeAdded[n].push(c):r.toBeAdded[n]=[c]})},e.prototype.updateTypePolicy=function(t,r){var n=this,i=this.getTypePolicy(t),o=r.keyFields,a=r.fields;function l(c,d){c.merge=typeof d=="function"?d:d===!0?u2:d===!1?c2:c.merge}l(i,r.merge),i.keyFn=o===!1?Zue:hn(o)?a2(o):typeof o=="function"?o:i.keyFn,a&&Object.keys(a).forEach(function(c){var d=n.getFieldPolicy(t,c,!0),f=a[c];if(typeof f=="function")d.read=f;else{var p=f.keyArgs,m=f.read,g=f.merge;d.keyFn=p===!1?l2:hn(p)?s2(p):typeof p=="function"?p:d.keyFn,typeof m=="function"&&(d.read=m),l(d,g)}d.read&&d.merge&&(d.keyFn=d.keyFn||l2)})},e.prototype.setRootTypename=function(t,r){r===void 0&&(r=t);var n="ROOT_"+t.toUpperCase(),i=this.rootTypenamesById[n];r!==i&&(_t(!i||i===t,5,t),i&&delete this.rootIdsByTypename[i],this.rootIdsByTypename[r]=n,this.rootTypenamesById[n]=r)},e.prototype.addPossibleTypes=function(t){var r=this;this.usingPossibleTypes=!0,Object.keys(t).forEach(function(n){r.getSupertypeSet(n,!0),t[n].forEach(function(i){r.getSupertypeSet(i,!0).add(n);var o=i.match(J5);(!o||o[0]!==i)&&r.fuzzySubtypes.set(i,new RegExp(i))})})},e.prototype.getTypePolicy=function(t){var r=this;if(!Fn.call(this.typePolicies,t)){var n=this.typePolicies[t]=Object.create(null);n.fields=Object.create(null);var i=this.supertypeMap.get(t);!i&&this.fuzzySubtypes.size&&(i=this.getSupertypeSet(t,!0),this.fuzzySubtypes.forEach(function(a,l){if(a.test(t)){var c=r.supertypeMap.get(l);c&&c.forEach(function(d){return i.add(d)})}})),i&&i.size&&i.forEach(function(a){var l=r.getTypePolicy(a),c=l.fields,d=Ms(l,["fields"]);Object.assign(n,d),Object.assign(n.fields,c)})}var o=this.toBeAdded[t];return o&&o.length&&o.splice(0).forEach(function(a){r.updateTypePolicy(t,a)}),this.typePolicies[t]},e.prototype.getFieldPolicy=function(t,r,n){if(t){var i=this.getTypePolicy(t).fields;return i[r]||n&&(i[r]=Object.create(null))}},e.prototype.getSupertypeSet=function(t,r){var n=this.supertypeMap.get(t);return!n&&r&&this.supertypeMap.set(t,n=new Set),n},e.prototype.fragmentMatches=function(t,r,n,i){var o=this;if(!t.typeCondition)return!0;if(!r)return!1;var a=t.typeCondition.name.value;if(r===a)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(a))for(var l=this.getSupertypeSet(r,!0),c=[l],d=function(b){var y=o.getSupertypeSet(b,!1);y&&y.size&&c.indexOf(y)<0&&c.push(y)},f=!!(n&&this.fuzzySubtypes.size),p=!1,m=0;m<c.length;++m){var g=c[m];if(g.has(a))return l.has(a)||(p&&globalThis.__DEV__!==!1&&_t.warn(6,r,a),l.add(a)),!0;g.forEach(d),f&&m===c.length-1&&SP(t.selectionSet,n,i)&&(f=!1,p=!0,this.fuzzySubtypes.forEach(function(b,y){var w=r.match(b);w&&w[0]===r&&d(y)}))}return!1},e.prototype.hasKeyArgs=function(t,r){var n=this.getFieldPolicy(t,r,!1);return!!(n&&n.keyFn)},e.prototype.getStoreFieldName=function(t){var r=t.typename,n=t.fieldName,i=this.getFieldPolicy(r,n,!1),o,a=i&&i.keyFn;if(a&&r)for(var l={typename:r,fieldName:n,field:t.field||null,variables:t.variables},c=_P(t);a;){var d=a(c,l);if(hn(d))a=s2(d);else{o=d||n;break}}return o===void 0&&(o=t.field?yle(t.field,t.variables):w5(n,_P(t))),o===!1?n:n===Yl(o)?o:n+":"+o},e.prototype.readField=function(t,r){var n=t.from;if(n){var i=t.field||t.fieldName;if(i){if(t.typename===void 0){var o=r.store.getFieldValue(n,"__typename");o&&(t.typename=o)}var a=this.getStoreFieldName(t),l=Yl(a),c=r.store.getFieldValue(n,a),d=this.getFieldPolicy(t.typename,l,!1),f=d&&d.read;if(f){var p=d2(this,n,t,r,r.store.getStorage(wr(n)?n.__ref:n,a));return BE.withValue(this.cache,f,[c,p])}return c}}},e.prototype.getReadFunction=function(t,r){var n=this.getFieldPolicy(t,r,!1);return n&&n.read},e.prototype.getMergeFunction=function(t,r,n){var i=this.getFieldPolicy(t,r,!1),o=i&&i.merge;return!o&&n&&(i=this.getTypePolicy(n),o=i&&i.merge),o},e.prototype.runMergeFunction=function(t,r,n,i,o){var a=n.field,l=n.typename,c=n.merge;return c===u2?iB(i.store)(t,r):c===c2?r:(i.overwrite&&(t=void 0),c(t,r,d2(this,void 0,{typename:l,fieldName:a.name.value,field:a,variables:i.variables},i,o||Object.create(null))))},e}();function d2(e,t,r,n,i){var o=e.getStoreFieldName(r),a=Yl(o),l=r.variables||n.variables,c=n.store,d=c.toReference,f=c.canRead;return{args:_P(r),field:r.field||null,fieldName:a,storeFieldName:o,variables:l,isReference:wr,toReference:d,storage:i,cache:e.cache,canRead:f,readField:function(){return e.readField(qE(arguments,t,l),n)},mergeObjects:iB(n.store)}}function qE(e,t,r){var n=e[0],i=e[1],o=e.length,a;return typeof n=="string"?a={fieldName:n,from:o>1?i:t}:(a=ve({},n),Fn.call(a,"from")||(a.from=t)),globalThis.__DEV__!==!1&&a.from===void 0&&globalThis.__DEV__!==!1&&_t.warn(7,JL(Array.from(e))),a.variables===void 0&&(a.variables=r),a}function iB(e){return function(r,n){if(hn(r)||hn(n))throw Ei(8);if(fn(r)&&fn(n)){var i=e.getFieldValue(r,"__typename"),o=e.getFieldValue(n,"__typename"),a=i&&o&&i!==o;if(a)return n;if(wr(r)&&Bd(n))return e.merge(r.__ref,n),r;if(Bd(r)&&wr(n))return e.merge(r,n.__ref),n;if(Bd(r)&&Bd(n))return ve(ve({},r),n)}return n}}function h_(e,t,r){var n="".concat(t).concat(r),i=e.flavors.get(n);return i||e.flavors.set(n,i=e.clientOnly===t&&e.deferred===r?e:ve(ve({},e),{clientOnly:t,deferred:r})),i}var tce=function(){function e(t,r,n){this.cache=t,this.reader=r,this.fragments=n}return e.prototype.writeToStore=function(t,r){var n=this,i=r.query,o=r.result,a=r.dataId,l=r.variables,c=r.overwrite,d=Km(i),f=que();l=ve(ve({},OE(d)),l);var p=ve(ve({store:t,written:Object.create(null),merge:function(g,b){return f.merge(g,b)},variables:l,varString:Ml(l)},Z5(i,this.fragments)),{overwrite:!!c,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),m=this.processSelectionSet({result:o||Object.create(null),dataId:a,selectionSet:d.selectionSet,mergeTree:{map:new Map},context:p});if(!wr(m))throw Ei(11,o);return p.incomingById.forEach(function(g,b){var y=g.storeObject,w=g.mergeTree,_=g.fieldNodeSet,S=Qd(b);if(w&&w.map.size){var C=n.applyMerges(w,S,y,p);if(wr(C))return;y=C}if(globalThis.__DEV__!==!1&&!p.overwrite){var k=Object.create(null);_.forEach(function(T){T.selectionSet&&(k[T.name.value]=!0)});var E=function(T){return k[Yl(T)]===!0},R=function(T){var A=w&&w.map.get(T);return!!(A&&A.info&&A.info.merge)};Object.keys(y).forEach(function(T){E(T)&&!R(T)&&rce(S,y,T,p.store)})}t.merge(b,y)}),t.retain(m.__ref),m},e.prototype.processSelectionSet=function(t){var r=this,n=t.dataId,i=t.result,o=t.selectionSet,a=t.context,l=t.mergeTree,c=this.cache.policies,d=Object.create(null),f=n&&c.rootTypenamesById[n]||cP(i,o,a.fragmentMap)||n&&a.store.get(n,"__typename");typeof f=="string"&&(d.__typename=f);var p=function(){var C=qE(arguments,d,a.variables);if(wr(C.from)){var k=a.incomingById.get(C.from.__ref);if(k){var E=c.readField(ve(ve({},C),{from:k.storeObject}),a);if(E!==void 0)return E}}return c.readField(C,a)},m=new Set;this.flattenFields(o,i,a,f).forEach(function(C,k){var E,R=Wl(k),T=i[R];if(m.add(k),T!==void 0){var A=c.getStoreFieldName({typename:f,fieldName:k.name.value,field:k,variables:C.variables}),M=f2(l,A),B=r.processFieldValue(T,k,k.selectionSet?h_(C,!1,!1):C,M),Q=void 0;k.selectionSet&&(wr(B)||Bd(B))&&(Q=p("__typename",B));var se=c.getMergeFunction(f,k.name.value,Q);se?M.info={field:k,typename:f,merge:se}:h2(l,A),d=C.merge(d,(E={},E[A]=B,E))}else globalThis.__DEV__!==!1&&!C.clientOnly&&!C.deferred&&!AE.added(k)&&!c.getReadFunction(f,k.name.value)&&globalThis.__DEV__!==!1&&_t.error(12,Wl(k),i)});try{var g=c.identify(i,{typename:f,selectionSet:o,fragmentMap:a.fragmentMap,storeObject:d,readField:p}),b=g[0],y=g[1];n=n||b,y&&(d=a.merge(d,y))}catch(C){if(!n)throw C}if(typeof n=="string"){var w=Qd(n),_=a.written[n]||(a.written[n]=[]);if(_.indexOf(o)>=0||(_.push(o),this.reader&&this.reader.isFresh(i,w,o,a)))return w;var S=a.incomingById.get(n);return S?(S.storeObject=a.merge(S.storeObject,d),S.mergeTree=xP(S.mergeTree,l),m.forEach(function(C){return S.fieldNodeSet.add(C)})):a.incomingById.set(n,{storeObject:d,mergeTree:$b(l)?void 0:l,fieldNodeSet:m}),w}return d},e.prototype.processFieldValue=function(t,r,n,i){var o=this;return!r.selectionSet||t===null?globalThis.__DEV__!==!1?B5(t):t:hn(t)?t.map(function(a,l){var c=o.processFieldValue(a,r,n,f2(i,l));return h2(i,l),c}):this.processSelectionSet({result:t,selectionSet:r.selectionSet,context:n,mergeTree:i})},e.prototype.flattenFields=function(t,r,n,i){i===void 0&&(i=cP(r,t,n.fragmentMap));var o=new Map,a=this.cache.policies,l=new kf(!1);return function c(d,f){var p=l.lookup(d,f.clientOnly,f.deferred);p.visited||(p.visited=!0,d.selections.forEach(function(m){if(Hm(m,n.variables)){var g=f.clientOnly,b=f.deferred;if(!(g&&b)&&Za(m.directives)&&m.directives.forEach(function(_){var S=_.name.value;if(S==="client"&&(g=!0),S==="defer"){var C=U0(_,n.variables);(!C||C.if!==!1)&&(b=!0)}}),Kl(m)){var y=o.get(m);y&&(g=g&&y.clientOnly,b=b&&y.deferred),o.set(m,h_(n,g,b))}else{var w=q0(m,n.lookupFragment);if(!w&&m.kind===Je.FRAGMENT_SPREAD)throw Ei(13,m.name.value);w&&a.fragmentMatches(w,i,r,n.variables)&&c(w.selectionSet,h_(n,g,b))}}}))}(t,n),o},e.prototype.applyMerges=function(t,r,n,i,o){var a,l=this;if(t.map.size&&!wr(n)){var c=!hn(n)&&(wr(r)||Bd(r))?r:void 0,d=n;c&&!o&&(o=[wr(c)?c.__ref:c]);var f,p=function(m,g){return hn(m)?typeof g=="number"?m[g]:void 0:i.store.getFieldValue(m,String(g))};t.map.forEach(function(m,g){var b=p(c,g),y=p(d,g);if(y!==void 0){o&&o.push(g);var w=l.applyMerges(m,b,y,i,o);w!==y&&(f=f||new Map,f.set(g,w)),o&&_t(o.pop()===g)}}),f&&(n=hn(d)?d.slice(0):ve({},d),f.forEach(function(m,g){n[g]=m}))}return t.info?this.cache.policies.runMergeFunction(r,n,t.info,i,o&&(a=i.store).getStorage.apply(a,o)):n},e}(),oB=[];function f2(e,t){var r=e.map;return r.has(t)||r.set(t,oB.pop()||{map:new Map}),r.get(t)}function xP(e,t){if(e===t||!t||$b(t))return e;if(!e||$b(e))return t;var r=e.info&&t.info?ve(ve({},e.info),t.info):e.info||t.info,n=e.map.size&&t.map.size,i=n?new Map:e.map.size?e.map:t.map,o={info:r,map:i};if(n){var a=new Set(t.map.keys());e.map.forEach(function(l,c){o.map.set(c,xP(l,t.map.get(c))),a.delete(c)}),a.forEach(function(l){o.map.set(l,xP(t.map.get(l),e.map.get(l)))})}return o}function $b(e){return!e||!(e.info||e.map.size)}function h2(e,t){var r=e.map,n=r.get(t);n&&$b(n)&&(oB.push(n),r.delete(t))}var p2=new Set;function rce(e,t,r,n){var i=function(p){var m=n.getFieldValue(p,r);return typeof m=="object"&&m},o=i(e);if(o){var a=i(t);if(a&&!wr(o)&&!qr(o,a)&&!Object.keys(o).every(function(p){return n.getFieldValue(a,p)!==void 0})){var l=n.getFieldValue(e,"__typename")||n.getFieldValue(t,"__typename"),c=Yl(r),d="".concat(l,".").concat(c);if(!p2.has(d)){p2.add(d);var f=[];!hn(o)&&!hn(a)&&[o,a].forEach(function(p){var m=n.getFieldValue(p,"__typename");typeof m=="string"&&!f.includes(m)&&f.push(m)}),globalThis.__DEV__!==!1&&_t.warn(14,c,l,f.length?"either ensure all objects of type "+f.join(" and ")+" have an ID or a custom merge function, or ":"",d,ve({},o),ve({},a))}}}}var aB=function(e){ga(t,e);function t(r){r===void 0&&(r={});var n=e.call(this)||this;return n.watches=new Set,n.addTypenameTransform=new $5(AE),n.assumeImmutableResults=!0,n.makeVar=Xue,n.txCount=0,n.config=Vue(r),n.addTypename=!!n.config.addTypename,n.policies=new ece({cache:n,dataIdFromObject:n.config.dataIdFromObject,possibleTypes:n.config.possibleTypes,typePolicies:n.config.typePolicies}),n.init(),n}return t.prototype.init=function(){var r=this.data=new tm.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=r.stump,this.resetResultCache()},t.prototype.resetResultCache=function(r){var n=this,i=this.storeReader,o=this.config.fragments;this.storeWriter=new tce(this,this.storeReader=new Kue({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:X5(this.config),canon:r?void 0:i&&i.canon,fragments:o}),o),this.maybeBroadcastWatch=em(function(a,l){return n.broadcastWatch(a,l)},{max:this.config.resultCacheMaxSize||Bs["inMemoryCache.maybeBroadcastWatch"]||5e3,makeCacheKey:function(a){var l=a.optimistic?n.optimisticData:n.data;if(yp(l)){var c=a.optimistic,d=a.id,f=a.variables;return l.makeCacheKey(a.query,a.callback,Ml({optimistic:c,id:d,variables:f}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach(function(a){return a.resetCaching()})},t.prototype.restore=function(r){return this.init(),r&&this.data.replace(r),this},t.prototype.extract=function(r){return r===void 0&&(r=!1),(r?this.optimisticData:this.data).extract()},t.prototype.read=function(r){var n=r.returnPartialData,i=n===void 0?!1:n;try{return this.storeReader.diffQueryAgainstStore(ve(ve({},r),{store:r.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:i})).result||null}catch(o){if(o instanceof G5)return null;throw o}},t.prototype.write=function(r){try{return++this.txCount,this.storeWriter.writeToStore(this.data,r)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},t.prototype.modify=function(r){if(Fn.call(r,"id")&&!r.id)return!1;var n=r.optimistic?this.optimisticData:this.data;try{return++this.txCount,n.modify(r.id||"ROOT_QUERY",r.fields)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},t.prototype.diff=function(r){return this.storeReader.diffQueryAgainstStore(ve(ve({},r),{store:r.optimistic?this.optimisticData:this.data,rootId:r.id||"ROOT_QUERY",config:this.config}))},t.prototype.watch=function(r){var n=this;return this.watches.size||Yue(this),this.watches.add(r),r.immediate&&this.maybeBroadcastWatch(r),function(){n.watches.delete(r)&&!n.watches.size&&i2(n),n.maybeBroadcastWatch.forget(r)}},t.prototype.gc=function(r){var n;Ml.reset(),G0.reset(),this.addTypenameTransform.resetCache(),(n=this.config.fragments)===null||n===void 0||n.resetCaches();var i=this.optimisticData.gc();return r&&!this.txCount&&(r.resetResultCache?this.resetResultCache(r.resetResultIdentities):r.resetResultIdentities&&this.storeReader.resetCanon()),i},t.prototype.retain=function(r,n){return(n?this.optimisticData:this.data).retain(r)},t.prototype.release=function(r,n){return(n?this.optimisticData:this.data).release(r)},t.prototype.identify=function(r){if(wr(r))return r.__ref;try{return this.policies.identify(r)[0]}catch(n){globalThis.__DEV__!==!1&&_t.warn(n)}},t.prototype.evict=function(r){if(!r.id){if(Fn.call(r,"id"))return!1;r=ve(ve({},r),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(r,this.data)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},t.prototype.reset=function(r){var n=this;return this.init(),Ml.reset(),r&&r.discardWatches?(this.watches.forEach(function(i){return n.maybeBroadcastWatch.forget(i)}),this.watches.clear(),i2(this)):this.broadcastWatches(),Promise.resolve()},t.prototype.removeOptimistic=function(r){var n=this.optimisticData.removeLayer(r);n!==this.optimisticData&&(this.optimisticData=n,this.broadcastWatches())},t.prototype.batch=function(r){var n=this,i=r.update,o=r.optimistic,a=o===void 0?!0:o,l=r.removeOptimistic,c=r.onWatchUpdated,d,f=function(m){var g=n,b=g.data,y=g.optimisticData;++n.txCount,m&&(n.data=n.optimisticData=m);try{return d=i(n)}finally{--n.txCount,n.data=b,n.optimisticData=y}},p=new Set;return c&&!this.txCount&&this.broadcastWatches(ve(ve({},r),{onWatchUpdated:function(m){return p.add(m),!1}})),typeof a=="string"?this.optimisticData=this.optimisticData.addLayer(a,f):a===!1?f(this.data):f(),typeof l=="string"&&(this.optimisticData=this.optimisticData.removeLayer(l)),c&&p.size?(this.broadcastWatches(ve(ve({},r),{onWatchUpdated:function(m,g){var b=c.call(this,m,g);return b!==!1&&p.delete(m),b}})),p.size&&p.forEach(function(m){return n.maybeBroadcastWatch.dirty(m)})):this.broadcastWatches(r),d},t.prototype.performTransaction=function(r,n){return this.batch({update:r,optimistic:n||n!==null})},t.prototype.transformDocument=function(r){return this.addTypenameToDocument(this.addFragmentsToDocument(r))},t.prototype.broadcastWatches=function(r){var n=this;this.txCount||this.watches.forEach(function(i){return n.maybeBroadcastWatch(i,r)})},t.prototype.addFragmentsToDocument=function(r){var n=this.config.fragments;return n?n.transform(r):r},t.prototype.addTypenameToDocument=function(r){return this.addTypename?this.addTypenameTransform.transformDocument(r):r},t.prototype.broadcastWatch=function(r,n){var i=r.lastDiff,o=this.diff(r);n&&(r.optimistic&&typeof n.optimistic=="string"&&(o.fromOptimisticTransaction=!0),n.onWatchUpdated&&n.onWatchUpdated.call(this,r,o,i)===!1)||(!i||!qr(i.result,o.result))&&r.callback(r.lastDiff=o,i)},t}(K5);globalThis.__DEV__!==!1&&(aB.prototype.getMemoryInternals=ele);var Or;(function(e){e[e.loading=1]="loading",e[e.setVariables=2]="setVariables",e[e.fetchMore=3]="fetchMore",e[e.refetch=4]="refetch",e[e.poll=6]="poll",e[e.ready=7]="ready",e[e.error=8]="error"})(Or||(Or={}));function rm(e){return e?e<7:!1}var m2=Object.assign,nce=Object.hasOwnProperty,PP=function(e){ga(t,e);function t(r){var n=r.queryManager,i=r.queryInfo,o=r.options,a=e.call(this,function(w){try{var _=w._subscription._observer;_&&!_.error&&(_.error=ice)}catch{}var S=!a.observers.size;a.observers.add(w);var C=a.last;return C&&C.error?w.error&&w.error(C.error):C&&C.result&&w.next&&w.next(C.result),S&&a.reobserve().catch(function(){}),function(){a.observers.delete(w)&&!a.observers.size&&a.tearDownQuery()}})||this;a.observers=new Set,a.subscriptions=new Set,a.queryInfo=i,a.queryManager=n,a.waitForOwnResult=p_(o.fetchPolicy),a.isTornDown=!1;var l=n.defaultOptions.watchQuery,c=l===void 0?{}:l,d=c.fetchPolicy,f=d===void 0?"cache-first":d,p=o.fetchPolicy,m=p===void 0?f:p,g=o.initialFetchPolicy,b=g===void 0?m==="standby"?f:m:g;a.options=ve(ve({},o),{initialFetchPolicy:b,fetchPolicy:m}),a.queryId=i.queryId||n.generateQueryId();var y=Km(a.query);return a.queryName=y&&y.name&&y.name.value,a}return Object.defineProperty(t.prototype,"query",{get:function(){return this.lastQuery||this.options.query},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),t.prototype.result=function(){var r=this;return new Promise(function(n,i){var o={next:function(l){n(l),r.observers.delete(o),r.observers.size||r.queryManager.removeQuery(r.queryId),setTimeout(function(){a.unsubscribe()},0)},error:i},a=r.subscribe(o)})},t.prototype.resetDiff=function(){this.queryInfo.resetDiff()},t.prototype.getCurrentResult=function(r){r===void 0&&(r=!0);var n=this.getLastResult(!0),i=this.queryInfo.networkStatus||n&&n.networkStatus||Or.ready,o=ve(ve({},n),{loading:rm(i),networkStatus:i}),a=this.options.fetchPolicy,l=a===void 0?"cache-first":a;if(!(p_(l)||this.queryManager.getDocumentInfo(this.query).hasForcedResolvers))if(this.waitForOwnResult)this.queryInfo.updateWatch();else{var c=this.queryInfo.getDiff();(c.complete||this.options.returnPartialData)&&(o.data=c.result),qr(o.data,{})&&(o.data=void 0),c.complete?(delete o.partial,c.complete&&o.networkStatus===Or.loading&&(l==="cache-first"||l==="cache-only")&&(o.networkStatus=Or.ready,o.loading=!1)):o.partial=!0,globalThis.__DEV__!==!1&&!c.complete&&!this.options.partialRefetch&&!o.loading&&!o.data&&!o.error&&lB(c.missing)}return r&&this.updateLastResult(o),o},t.prototype.isDifferentFromLastResult=function(r,n){if(!this.last)return!0;var i=this.queryManager.getDocumentInfo(this.query).hasNonreactiveDirective?!W5(this.query,this.last.result,r,this.variables):!qr(this.last.result,r);return i||n&&!qr(this.last.variables,n)},t.prototype.getLast=function(r,n){var i=this.last;if(i&&i[r]&&(!n||qr(i.variables,this.variables)))return i[r]},t.prototype.getLastResult=function(r){return this.getLast("result",r)},t.prototype.getLastError=function(r){return this.getLast("error",r)},t.prototype.resetLastResults=function(){delete this.last,this.isTornDown=!1},t.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},t.prototype.refetch=function(r){var n,i={pollInterval:0},o=this.options.fetchPolicy;if(o==="cache-and-network"?i.fetchPolicy=o:o==="no-cache"?i.fetchPolicy="no-cache":i.fetchPolicy="network-only",globalThis.__DEV__!==!1&&r&&nce.call(r,"variables")){var a=S5(this.query),l=a.variableDefinitions;(!l||!l.some(function(c){return c.variable.name.value==="variables"}))&&globalThis.__DEV__!==!1&&_t.warn(20,r,((n=a.name)===null||n===void 0?void 0:n.value)||a)}return r&&!qr(this.options.variables,r)&&(i.variables=this.options.variables=ve(ve({},this.options.variables),r)),this.queryInfo.resetLastWrite(),this.reobserve(i,Or.refetch)},t.prototype.fetchMore=function(r){var n=this,i=ve(ve({},r.query?r:ve(ve(ve(ve({},this.options),{query:this.options.query}),r),{variables:ve(ve({},this.options.variables),r.variables)})),{fetchPolicy:"no-cache"});i.query=this.transformDocument(i.query);var o=this.queryManager.generateQueryId();this.lastQuery=r.query?this.transformDocument(this.options.query):i.query;var a=this.queryInfo,l=a.networkStatus;a.networkStatus=Or.fetchMore,i.notifyOnNetworkStatusChange&&this.observe();var c=new Set;return this.queryManager.fetchQuery(o,i,Or.fetchMore).then(function(d){return n.queryManager.removeQuery(o),a.networkStatus===Or.fetchMore&&(a.networkStatus=l),n.queryManager.cache.batch({update:function(f){var p=r.updateQuery;p?f.updateQuery({query:n.query,variables:n.variables,returnPartialData:!0,optimistic:!1},function(m){return p(m,{fetchMoreResult:d.data,variables:i.variables})}):f.writeQuery({query:i.query,variables:i.variables,data:d.data})},onWatchUpdated:function(f){c.add(f.query)}}),d}).finally(function(){c.has(n.query)||sB(n)})},t.prototype.subscribeToMore=function(r){var n=this,i=this.queryManager.startGraphQLSubscription({query:r.document,variables:r.variables,context:r.context}).subscribe({next:function(o){var a=r.updateQuery;a&&n.updateQuery(function(l,c){var d=c.variables;return a(l,{subscriptionData:o,variables:d})})},error:function(o){if(r.onError){r.onError(o);return}globalThis.__DEV__!==!1&&_t.error(21,o)}});return this.subscriptions.add(i),function(){n.subscriptions.delete(i)&&i.unsubscribe()}},t.prototype.setOptions=function(r){return this.reobserve(r)},t.prototype.silentSetOptions=function(r){var n=gf(this.options,r||{});m2(this.options,n)},t.prototype.setVariables=function(r){return qr(this.variables,r)?this.observers.size?this.result():Promise.resolve():(this.options.variables=r,this.observers.size?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:r},Or.setVariables):Promise.resolve())},t.prototype.updateQuery=function(r){var n=this.queryManager,i=n.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}).result,o=r(i,{variables:this.variables});o&&(n.cache.writeQuery({query:this.options.query,data:o,variables:this.variables}),n.broadcastQueries())},t.prototype.startPolling=function(r){this.options.pollInterval=r,this.updatePolling()},t.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},t.prototype.applyNextFetchPolicy=function(r,n){if(n.nextFetchPolicy){var i=n.fetchPolicy,o=i===void 0?"cache-first":i,a=n.initialFetchPolicy,l=a===void 0?o:a;o==="standby"||(typeof n.nextFetchPolicy=="function"?n.fetchPolicy=n.nextFetchPolicy(o,{reason:r,options:n,observable:this,initialFetchPolicy:l}):r==="variables-changed"?n.fetchPolicy=l:n.fetchPolicy=n.nextFetchPolicy)}return n.fetchPolicy},t.prototype.fetch=function(r,n,i){return this.queryManager.setObservableQuery(this),this.queryManager.fetchConcastWithInfo(this.queryId,r,n,i)},t.prototype.updatePolling=function(){var r=this;if(!this.queryManager.ssrMode){var n=this,i=n.pollingInfo,o=n.options.pollInterval;if(!o||!this.hasObservers()){i&&(clearTimeout(i.timeout),delete this.pollingInfo);return}if(!(i&&i.interval===o)){_t(o,22);var a=i||(this.pollingInfo={});a.interval=o;var l=function(){var d,f;r.pollingInfo&&(!rm(r.queryInfo.networkStatus)&&!(!((f=(d=r.options).skipPollAttempt)===null||f===void 0)&&f.call(d))?r.reobserve({fetchPolicy:r.options.initialFetchPolicy==="no-cache"?"no-cache":"network-only"},Or.poll).then(c,c):c())},c=function(){var d=r.pollingInfo;d&&(clearTimeout(d.timeout),d.timeout=setTimeout(l,d.interval))};c()}}},t.prototype.updateLastResult=function(r,n){n===void 0&&(n=this.variables);var i=this.getLastError();return i&&this.last&&!qr(n,this.last.variables)&&(i=void 0),this.last=ve({result:this.queryManager.assumeImmutableResults?r:B5(r),variables:n},i?{error:i}:null)},t.prototype.reobserveAsConcast=function(r,n){var i=this;this.isTornDown=!1;var o=n===Or.refetch||n===Or.fetchMore||n===Or.poll,a=this.options.variables,l=this.options.fetchPolicy,c=gf(this.options,r||{}),d=o?c:m2(this.options,c),f=this.transformDocument(d.query);this.lastQuery=f,o||(this.updatePolling(),r&&r.variables&&!qr(r.variables,a)&&d.fetchPolicy!=="standby"&&d.fetchPolicy===l&&(this.applyNextFetchPolicy("variables-changed",d),n===void 0&&(n=Or.setVariables))),this.waitForOwnResult&&(this.waitForOwnResult=p_(d.fetchPolicy));var p=function(){i.concast===b&&(i.waitForOwnResult=!1)},m=d.variables&&ve({},d.variables),g=this.fetch(d,n,f),b=g.concast,y=g.fromLink,w={next:function(_){qr(i.variables,m)&&(p(),i.reportResult(_,m))},error:function(_){qr(i.variables,m)&&(p(),i.reportError(_,m))}};return!o&&(y||!this.concast)&&(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=b,this.observer=w),b.addObserver(w),b},t.prototype.reobserve=function(r,n){return this.reobserveAsConcast(r,n).promise},t.prototype.resubscribeAfterError=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=this.last;this.resetLastResults();var o=this.subscribe.apply(this,r);return this.last=i,o},t.prototype.observe=function(){this.reportResult(this.getCurrentResult(!1),this.variables)},t.prototype.reportResult=function(r,n){var i=this.getLastError(),o=this.isDifferentFromLastResult(r,n);(i||!r.partial||this.options.returnPartialData)&&this.updateLastResult(r,n),(i||o)&&gp(this.observers,"next",r)},t.prototype.reportError=function(r,n){var i=ve(ve({},this.getLastResult()),{error:r,errors:r.graphQLErrors,networkStatus:Or.error,loading:!1});this.updateLastResult(i,n),gp(this.observers,"error",this.last.error=r)},t.prototype.hasObservers=function(){return this.observers.size>0},t.prototype.tearDownQuery=function(){this.isTornDown||(this.concast&&this.observer&&(this.concast.removeObserver(this.observer),delete this.concast,delete this.observer),this.stopPolling(),this.subscriptions.forEach(function(r){return r.unsubscribe()}),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},t.prototype.transformDocument=function(r){return this.queryManager.transform(r)},t}(Rr);V5(PP);function sB(e){var t=e.options,r=t.fetchPolicy,n=t.nextFetchPolicy;return r==="cache-and-network"||r==="network-only"?e.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(i,o){return this.nextFetchPolicy=n,typeof this.nextFetchPolicy=="function"?this.nextFetchPolicy(i,o):r}}):e.reobserve()}function ice(e){globalThis.__DEV__!==!1&&_t.error(23,e.message,e.stack)}function lB(e){globalThis.__DEV__!==!1&&e&&globalThis.__DEV__!==!1&&_t.debug(24,e)}function p_(e){return e==="network-only"||e==="no-cache"||e==="standby"}var uB=function(){function e(t){var r=t.cache,n=t.client,i=t.resolvers,o=t.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=r,n&&(this.client=n),i&&this.addResolvers(i),o&&this.setFragmentMatcher(o)}return e.prototype.addResolvers=function(t){var r=this;this.resolvers=this.resolvers||{},Array.isArray(t)?t.forEach(function(n){r.resolvers=F$(r.resolvers,n)}):this.resolvers=F$(this.resolvers,t)},e.prototype.setResolvers=function(t){this.resolvers={},this.addResolvers(t)},e.prototype.getResolvers=function(){return this.resolvers||{}},e.prototype.runResolvers=function(t){return Cl(this,arguments,void 0,function(r){var n=r.document,i=r.remoteResult,o=r.context,a=r.variables,l=r.onlyRunForcedResolvers,c=l===void 0?!1:l;return El(this,function(d){return n?[2,this.resolveDocument(n,i.data,o,a,this.fragmentMatcher,c).then(function(f){return ve(ve({},i),{data:f.result})})]:[2,i]})})},e.prototype.setFragmentMatcher=function(t){this.fragmentMatcher=t},e.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},e.prototype.clientQuery=function(t){return Jp(["client"],t)&&this.resolvers?t:null},e.prototype.serverQuery=function(t){return M5(t)},e.prototype.prepareContext=function(t){var r=this.cache;return ve(ve({},t),{cache:r,getCacheKey:function(n){return r.identify(n)}})},e.prototype.addExportedVariables=function(t){return Cl(this,arguments,void 0,function(r,n,i){return n===void 0&&(n={}),i===void 0&&(i={}),El(this,function(o){return r?[2,this.resolveDocument(r,this.buildRootValueFromCache(r,n)||{},this.prepareContext(i),n).then(function(a){return ve(ve({},n),a.exportedVariables)})]:[2,ve({},n)]})})},e.prototype.shouldForceResolvers=function(t){var r=!1;return Ls(t,{Directive:{enter:function(n){if(n.name.value==="client"&&n.arguments&&(r=n.arguments.some(function(i){return i.name.value==="always"&&i.value.kind==="BooleanValue"&&i.value.value===!0}),r))return EE}}}),r},e.prototype.buildRootValueFromCache=function(t,r){return this.cache.diff({query:Ble(t),variables:r,returnPartialData:!0,optimistic:!1}).result},e.prototype.resolveDocument=function(t,r){return Cl(this,arguments,void 0,function(n,i,o,a,l,c){var d,f,p,m,g,b,y,w,_,S,C;return o===void 0&&(o={}),a===void 0&&(a={}),l===void 0&&(l=function(){return!0}),c===void 0&&(c=!1),El(this,function(k){return d=Gm(n),f=H0(n),p=z0(f),m=this.collectSelectionsToResolve(d,p),g=d.operation,b=g?g.charAt(0).toUpperCase()+g.slice(1):"Query",y=this,w=y.cache,_=y.client,S={fragmentMap:p,context:ve(ve({},o),{cache:w,client:_}),variables:a,fragmentMatcher:l,defaultOperationType:b,exportedVariables:{},selectionsToResolve:m,onlyRunForcedResolvers:c},C=!1,[2,this.resolveSelectionSet(d.selectionSet,C,i,S).then(function(E){return{result:E,exportedVariables:S.exportedVariables}})]})})},e.prototype.resolveSelectionSet=function(t,r,n,i){return Cl(this,void 0,void 0,function(){var o,a,l,c,d,f=this;return El(this,function(p){return o=i.fragmentMap,a=i.context,l=i.variables,c=[n],d=function(m){return Cl(f,void 0,void 0,function(){var g,b;return El(this,function(y){return!r&&!i.selectionsToResolve.has(m)?[2]:Hm(m,l)?Kl(m)?[2,this.resolveField(m,r,n,i).then(function(w){var _;typeof w<"u"&&c.push((_={},_[Wl(m)]=w,_))})]:(wle(m)?g=m:(g=o[m.name.value],_t(g,18,m.name.value)),g&&g.typeCondition&&(b=g.typeCondition.name.value,i.fragmentMatcher(n,b,a))?[2,this.resolveSelectionSet(g.selectionSet,r,n,i).then(function(w){c.push(w)})]:[2]):[2]})})},[2,Promise.all(t.selections.map(d)).then(function(){return Q0(c)})]})})},e.prototype.resolveField=function(t,r,n,i){return Cl(this,void 0,void 0,function(){var o,a,l,c,d,f,p,m,g,b=this;return El(this,function(y){return n?(o=i.variables,a=t.name.value,l=Wl(t),c=a!==l,d=n[l]||n[a],f=Promise.resolve(d),(!i.onlyRunForcedResolvers||this.shouldForceResolvers(t))&&(p=n.__typename||i.defaultOperationType,m=this.resolvers&&this.resolvers[p],m&&(g=m[c?a:l],g&&(f=Promise.resolve(BE.withValue(this.cache,g,[n,U0(t,o),i.context,{field:t,fragmentMap:i.fragmentMap}]))))),[2,f.then(function(w){var _,S;if(w===void 0&&(w=d),t.directives&&t.directives.forEach(function(k){k.name.value==="export"&&k.arguments&&k.arguments.forEach(function(E){E.name.value==="as"&&E.value.kind==="StringValue"&&(i.exportedVariables[E.value.value]=w)})}),!t.selectionSet||w==null)return w;var C=(S=(_=t.directives)===null||_===void 0?void 0:_.some(function(k){return k.name.value==="client"}))!==null&&S!==void 0?S:!1;if(Array.isArray(w))return b.resolveSubSelectedArray(t,r||C,w,i);if(t.selectionSet)return b.resolveSelectionSet(t.selectionSet,r||C,w,i)})]):[2,null]})})},e.prototype.resolveSubSelectedArray=function(t,r,n,i){var o=this;return Promise.all(n.map(function(a){if(a===null)return null;if(Array.isArray(a))return o.resolveSubSelectedArray(t,r,a,i);if(t.selectionSet)return o.resolveSelectionSet(t.selectionSet,r,a,i)}))},e.prototype.collectSelectionsToResolve=function(t,r){var n=function(a){return!Array.isArray(a)},i=this.selectionsToResolveCache;function o(a){if(!i.has(a)){var l=new Set;i.set(a,l),Ls(a,{Directive:function(c,d,f,p,m){c.name.value==="client"&&m.forEach(function(g){n(g)&&O$(g)&&l.add(g)})},FragmentSpread:function(c,d,f,p,m){var g=r[c.name.value];_t(g,19,c.name.value);var b=o(g);b.size>0&&(m.forEach(function(y){n(y)&&O$(y)&&l.add(y)}),l.add(c),b.forEach(function(y){l.add(y)}))}})}return i.get(a)}return o(t)},e}(),Vd=new(jf?WeakMap:Map);function m_(e,t){var r=e[t];typeof r=="function"&&(e[t]=function(){return Vd.set(e,(Vd.get(e)+1)%1e15),r.apply(this,arguments)})}function v2(e){e.notifyTimeout&&(clearTimeout(e.notifyTimeout),e.notifyTimeout=void 0)}var v_=function(){function e(t,r){r===void 0&&(r=t.generateQueryId()),this.queryId=r,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var n=this.cache=t.cache;Vd.has(n)||(Vd.set(n,0),m_(n,"evict"),m_(n,"modify"),m_(n,"reset"))}return e.prototype.init=function(t){var r=t.networkStatus||Or.loading;return this.variables&&this.networkStatus!==Or.loading&&!qr(this.variables,t.variables)&&(r=Or.setVariables),qr(t.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:t.document,variables:t.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:r}),t.observableQuery&&this.setObservableQuery(t.observableQuery),t.lastRequestId&&(this.lastRequestId=t.lastRequestId),this},e.prototype.reset=function(){v2(this),this.dirty=!1},e.prototype.resetDiff=function(){this.lastDiff=void 0},e.prototype.getDiff=function(){var t=this.getDiffOptions();if(this.lastDiff&&qr(t,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables);var r=this.observableQuery;if(r&&r.options.fetchPolicy==="no-cache")return{complete:!1};var n=this.cache.diff(t);return this.updateLastDiff(n,t),n},e.prototype.updateLastDiff=function(t,r){this.lastDiff=t?{diff:t,options:r||this.getDiffOptions()}:void 0},e.prototype.getDiffOptions=function(t){var r;return t===void 0&&(t=this.variables),{query:this.document,variables:t,returnPartialData:!0,optimistic:!0,canonizeResults:(r=this.observableQuery)===null||r===void 0?void 0:r.options.canonizeResults}},e.prototype.setDiff=function(t){var r=this,n,i=this.lastDiff&&this.lastDiff.diff;t&&!t.complete&&(!((n=this.observableQuery)===null||n===void 0)&&n.getLastError())||(this.updateLastDiff(t),!this.dirty&&!qr(i&&i.result,t&&t.result)&&(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(function(){return r.notify()},0))))},e.prototype.setObservableQuery=function(t){var r=this;t!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=t,t?(t.queryInfo=this,this.listeners.add(this.oqListener=function(){var n=r.getDiff();n.fromOptimisticTransaction?t.observe():sB(t)})):delete this.oqListener)},e.prototype.notify=function(){var t=this;v2(this),this.shouldNotify()&&this.listeners.forEach(function(r){return r(t)}),this.dirty=!1},e.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(rm(this.networkStatus)&&this.observableQuery){var t=this.observableQuery.options.fetchPolicy;if(t!=="cache-only"&&t!=="cache-and-network")return!1}return!0},e.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=e.prototype.cancel;var t=this.observableQuery;t&&t.stopPolling()}},e.prototype.cancel=function(){},e.prototype.updateWatch=function(t){var r=this;t===void 0&&(t=this.variables);var n=this.observableQuery;if(!(n&&n.options.fetchPolicy==="no-cache")){var i=ve(ve({},this.getDiffOptions(t)),{watcher:this,callback:function(o){return r.setDiff(o)}});(!this.lastWatch||!qr(i,this.lastWatch))&&(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=i))}},e.prototype.resetLastWrite=function(){this.lastWrite=void 0},e.prototype.shouldWrite=function(t,r){var n=this.lastWrite;return!(n&&n.dmCount===Vd.get(this.cache)&&qr(r,n.variables)&&qr(t.data,n.result.data))},e.prototype.markResult=function(t,r,n,i){var o=this,a=new Ql,l=Za(t.errors)?t.errors.slice(0):[];if(this.reset(),"incremental"in t&&Za(t.incremental)){var c=z5(this.getDiff().result,t);t.data=c}else if("hasNext"in t&&t.hasNext){var d=this.getDiff();t.data=a.merge(d.result,t.data)}this.graphQLErrors=l,n.fetchPolicy==="no-cache"?this.updateLastDiff({result:t.data,complete:!0},this.getDiffOptions(n.variables)):i!==0&&(CP(t,n.errorPolicy)?this.cache.performTransaction(function(f){if(o.shouldWrite(t,n.variables))f.writeQuery({query:r,data:t.data,variables:n.variables,overwrite:i===1}),o.lastWrite={result:t,variables:n.variables,dmCount:Vd.get(o.cache)};else if(o.lastDiff&&o.lastDiff.diff.complete){t.data=o.lastDiff.diff.result;return}var p=o.getDiffOptions(n.variables),m=f.diff(p);!o.stopped&&qr(o.variables,n.variables)&&o.updateWatch(n.variables),o.updateLastDiff(m,p),m.complete&&(t.data=m.result)}):this.lastWrite=void 0)},e.prototype.markReady=function(){return this.networkError=null,this.networkStatus=Or.ready},e.prototype.markError=function(t){return this.networkStatus=Or.error,this.lastWrite=void 0,this.reset(),t.graphQLErrors&&(this.graphQLErrors=t.graphQLErrors),t.networkError&&(this.networkError=t.networkError),t},e}();function CP(e,t){t===void 0&&(t="none");var r=t==="ignore"||t==="all",n=!Xy(e);return!n&&r&&e.data&&(n=!0),n}var oce=Object.prototype.hasOwnProperty,g2=Object.create(null),ace=function(){function e(t){var r=t.cache,n=t.link,i=t.defaultOptions,o=t.documentTransform,a=t.queryDeduplication,l=a===void 0?!1:a,c=t.onBroadcast,d=t.ssrMode,f=d===void 0?!1:d,p=t.clientAwareness,m=p===void 0?{}:p,g=t.localState,b=t.assumeImmutableResults,y=b===void 0?!!r.assumeImmutableResults:b,w=t.defaultContext,_=this;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new m5(Bs["queryManager.getDocumentInfo"]||2e3),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new kf(!1);var S=new $5(function(C){return _.cache.transformDocument(C)},{cache:!1});this.cache=r,this.link=n,this.defaultOptions=i||Object.create(null),this.queryDeduplication=l,this.clientAwareness=m,this.localState=g||new uB({cache:r}),this.ssrMode=f,this.assumeImmutableResults=y,this.documentTransform=o?S.concat(o).concat(S):S,this.defaultContext=w||Object.create(null),(this.onBroadcast=c)&&(this.mutationStore=Object.create(null))}return e.prototype.stop=function(){var t=this;this.queries.forEach(function(r,n){t.stopQueryNoBroadcast(n)}),this.cancelPendingFetches(Ei(25))},e.prototype.cancelPendingFetches=function(t){this.fetchCancelFns.forEach(function(r){return r(t)}),this.fetchCancelFns.clear()},e.prototype.mutate=function(t){return Cl(this,arguments,void 0,function(r){var n,i,o,a,l,c,d,f=r.mutation,p=r.variables,m=r.optimisticResponse,g=r.updateQueries,b=r.refetchQueries,y=b===void 0?[]:b,w=r.awaitRefetchQueries,_=w===void 0?!1:w,S=r.update,C=r.onQueryUpdated,k=r.fetchPolicy,E=k===void 0?((c=this.defaultOptions.mutate)===null||c===void 0?void 0:c.fetchPolicy)||"network-only":k,R=r.errorPolicy,T=R===void 0?((d=this.defaultOptions.mutate)===null||d===void 0?void 0:d.errorPolicy)||"none":R,A=r.keepRootFields,M=r.context;return El(this,function(B){switch(B.label){case 0:return _t(f,26),_t(E==="network-only"||E==="no-cache",27),n=this.generateMutationId(),f=this.cache.transformForLink(this.transform(f)),i=this.getDocumentInfo(f).hasClientExports,p=this.getVariables(f,p),i?[4,this.localState.addExportedVariables(f,p,M)]:[3,2];case 1:p=B.sent(),B.label=2;case 2:return o=this.mutationStore&&(this.mutationStore[n]={mutation:f,variables:p,loading:!0,error:null}),a=m&&this.markMutationOptimistic(m,{mutationId:n,document:f,variables:p,fetchPolicy:E,errorPolicy:T,context:M,updateQueries:g,update:S,keepRootFields:A}),this.broadcastQueries(),l=this,[2,new Promise(function(Q,se){return l_(l.getObservableFromLink(f,ve(ve({},M),{optimisticResponse:a?m:void 0}),p,!1),function(ie){if(Xy(ie)&&T==="none")throw new fd({graphQLErrors:vP(ie)});o&&(o.loading=!1,o.error=null);var N=ve({},ie);return typeof y=="function"&&(y=y(N)),T==="ignore"&&Xy(N)&&delete N.errors,l.markMutationResult({mutationId:n,result:N,document:f,variables:p,fetchPolicy:E,errorPolicy:T,context:M,update:S,updateQueries:g,awaitRefetchQueries:_,refetchQueries:y,removeOptimistic:a?n:void 0,onQueryUpdated:C,keepRootFields:A})}).subscribe({next:function(ie){l.broadcastQueries(),(!("hasNext"in ie)||ie.hasNext===!1)&&Q(ie)},error:function(ie){o&&(o.loading=!1,o.error=ie),a&&l.cache.removeOptimistic(n),l.broadcastQueries(),se(ie instanceof fd?ie:new fd({networkError:ie}))}})})]}})})},e.prototype.markMutationResult=function(t,r){var n=this;r===void 0&&(r=this.cache);var i=t.result,o=[],a=t.fetchPolicy==="no-cache";if(!a&&CP(i,t.errorPolicy)){if(Yd(i)||o.push({result:i.data,dataId:"ROOT_MUTATION",query:t.document,variables:t.variables}),Yd(i)&&Za(i.incremental)){var l=r.diff({id:"ROOT_MUTATION",query:this.getDocumentInfo(t.document).asQuery,variables:t.variables,optimistic:!1,returnPartialData:!0}),c=void 0;l.result&&(c=z5(l.result,i)),typeof c<"u"&&(i.data=c,o.push({result:c,dataId:"ROOT_MUTATION",query:t.document,variables:t.variables}))}var d=t.updateQueries;d&&this.queries.forEach(function(p,m){var g=p.observableQuery,b=g&&g.queryName;if(!(!b||!oce.call(d,b))){var y=d[b],w=n.queries.get(m),_=w.document,S=w.variables,C=r.diff({query:_,variables:S,returnPartialData:!0,optimistic:!1}),k=C.result,E=C.complete;if(E&&k){var R=y(k,{mutationResult:i,queryName:_&&dP(_)||void 0,queryVariables:S});R&&o.push({result:R,dataId:"ROOT_QUERY",query:_,variables:S})}}})}if(o.length>0||(t.refetchQueries||"").length>0||t.update||t.onQueryUpdated||t.removeOptimistic){var f=[];if(this.refetchQueries({updateCache:function(p){a||o.forEach(function(y){return p.write(y)});var m=t.update,g=!tue(i)||Yd(i)&&!i.hasNext;if(m){if(!a){var b=p.diff({id:"ROOT_MUTATION",query:n.getDocumentInfo(t.document).asQuery,variables:t.variables,optimistic:!1,returnPartialData:!0});b.complete&&(i=ve(ve({},i),{data:b.result}),"incremental"in i&&delete i.incremental,"hasNext"in i&&delete i.hasNext)}g&&m(p,i,{context:t.context,variables:t.variables})}!a&&!t.keepRootFields&&g&&p.modify({id:"ROOT_MUTATION",fields:function(y,w){var _=w.fieldName,S=w.DELETE;return _==="__typename"?y:S}})},include:t.refetchQueries,optimistic:!1,removeOptimistic:t.removeOptimistic,onQueryUpdated:t.onQueryUpdated||null}).forEach(function(p){return f.push(p)}),t.awaitRefetchQueries||t.onQueryUpdated)return Promise.all(f).then(function(){return i})}return Promise.resolve(i)},e.prototype.markMutationOptimistic=function(t,r){var n=this,i=typeof t=="function"?t(r.variables,{IGNORE:g2}):t;return i===g2?!1:(this.cache.recordOptimisticTransaction(function(o){try{n.markMutationResult(ve(ve({},r),{result:{data:i}}),o)}catch(a){globalThis.__DEV__!==!1&&_t.error(a)}},r.mutationId),!0)},e.prototype.fetchQuery=function(t,r,n){return this.fetchConcastWithInfo(t,r,n).concast.promise},e.prototype.getQueryStore=function(){var t=Object.create(null);return this.queries.forEach(function(r,n){t[n]={variables:r.variables,networkStatus:r.networkStatus,networkError:r.networkError,graphQLErrors:r.graphQLErrors}}),t},e.prototype.resetErrors=function(t){var r=this.queries.get(t);r&&(r.networkError=void 0,r.graphQLErrors=[])},e.prototype.transform=function(t){return this.documentTransform.transformDocument(t)},e.prototype.getDocumentInfo=function(t){var r=this.transformCache;if(!r.has(t)){var n={hasClientExports:Nse(t),hasForcedResolvers:this.localState.shouldForceResolvers(t),hasNonreactiveDirective:Jp(["nonreactive"],t),clientQuery:this.localState.clientQuery(t),serverQuery:D5([{name:"client",remove:!0},{name:"connection"},{name:"nonreactive"}],t),defaultVars:OE(Km(t)),asQuery:ve(ve({},t),{definitions:t.definitions.map(function(i){return i.kind==="OperationDefinition"&&i.operation!=="query"?ve(ve({},i),{operation:"query"}):i})})};r.set(t,n)}return r.get(t)},e.prototype.getVariables=function(t,r){return ve(ve({},this.getDocumentInfo(t).defaultVars),r)},e.prototype.watchQuery=function(t){var r=this.transform(t.query);t=ve(ve({},t),{variables:this.getVariables(r,t.variables)}),typeof t.notifyOnNetworkStatusChange>"u"&&(t.notifyOnNetworkStatusChange=!1);var n=new v_(this),i=new PP({queryManager:this,queryInfo:n,options:t});return i.lastQuery=r,this.queries.set(i.queryId,n),n.init({document:r,observableQuery:i,variables:i.variables}),i},e.prototype.query=function(t,r){var n=this;return r===void 0&&(r=this.generateQueryId()),_t(t.query,28),_t(t.query.kind==="Document",29),_t(!t.returnPartialData,30),_t(!t.pollInterval,31),this.fetchQuery(r,ve(ve({},t),{query:this.transform(t.query)})).finally(function(){return n.stopQuery(r)})},e.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},e.prototype.generateRequestId=function(){return this.requestIdCounter++},e.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},e.prototype.stopQueryInStore=function(t){this.stopQueryInStoreNoBroadcast(t),this.broadcastQueries()},e.prototype.stopQueryInStoreNoBroadcast=function(t){var r=this.queries.get(t);r&&r.stop()},e.prototype.clearStore=function(t){return t===void 0&&(t={discardWatches:!0}),this.cancelPendingFetches(Ei(32)),this.queries.forEach(function(r){r.observableQuery?r.networkStatus=Or.loading:r.stop()}),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(t)},e.prototype.getObservableQueries=function(t){var r=this;t===void 0&&(t="active");var n=new Map,i=new Map,o=new Set;return Array.isArray(t)&&t.forEach(function(a){typeof a=="string"?i.set(a,!1):lle(a)?i.set(r.transform(a),!1):fn(a)&&a.query&&o.add(a)}),this.queries.forEach(function(a,l){var c=a.observableQuery,d=a.document;if(c){if(t==="all"){n.set(l,c);return}var f=c.queryName,p=c.options.fetchPolicy;if(p==="standby"||t==="active"&&!c.hasObservers())return;(t==="active"||f&&i.has(f)||d&&i.has(d))&&(n.set(l,c),f&&i.set(f,!0),d&&i.set(d,!0))}}),o.size&&o.forEach(function(a){var l=rP("legacyOneTimeQuery"),c=r.getQuery(l).init({document:a.query,variables:a.variables}),d=new PP({queryManager:r,queryInfo:c,options:ve(ve({},a),{fetchPolicy:"network-only"})});_t(d.queryId===l),c.setObservableQuery(d),n.set(l,d)}),globalThis.__DEV__!==!1&&i.size&&i.forEach(function(a,l){a||globalThis.__DEV__!==!1&&_t.warn(typeof l=="string"?33:34,l)}),n},e.prototype.reFetchObservableQueries=function(t){var r=this;t===void 0&&(t=!1);var n=[];return this.getObservableQueries(t?"all":"active").forEach(function(i,o){var a=i.options.fetchPolicy;i.resetLastResults(),(t||a!=="standby"&&a!=="cache-only")&&n.push(i.refetch()),r.getQuery(o).setDiff(null)}),this.broadcastQueries(),Promise.all(n)},e.prototype.setObservableQuery=function(t){this.getQuery(t.queryId).setObservableQuery(t)},e.prototype.startGraphQLSubscription=function(t){var r=this,n=t.query,i=t.fetchPolicy,o=t.errorPolicy,a=o===void 0?"none":o,l=t.variables,c=t.context,d=c===void 0?{}:c;n=this.transform(n),l=this.getVariables(n,l);var f=function(m){return r.getObservableFromLink(n,d,m).map(function(g){i!=="no-cache"&&(CP(g,a)&&r.cache.write({query:n,result:g.data,dataId:"ROOT_SUBSCRIPTION",variables:m}),r.broadcastQueries());var b=Xy(g),y=yue(g);if(b||y){var w={};if(b&&(w.graphQLErrors=g.errors),y&&(w.protocolErrors=g.extensions[LE]),a==="none"||y)throw new fd(w)}return a==="ignore"&&delete g.errors,g})};if(this.getDocumentInfo(n).hasClientExports){var p=this.localState.addExportedVariables(n,l,d).then(f);return new Rr(function(m){var g=null;return p.then(function(b){return g=b.subscribe(m)},m.error),function(){return g&&g.unsubscribe()}})}return f(l)},e.prototype.stopQuery=function(t){this.stopQueryNoBroadcast(t),this.broadcastQueries()},e.prototype.stopQueryNoBroadcast=function(t){this.stopQueryInStoreNoBroadcast(t),this.removeQuery(t)},e.prototype.removeQuery=function(t){this.fetchCancelFns.delete(t),this.queries.has(t)&&(this.getQuery(t).stop(),this.queries.delete(t))},e.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach(function(t){return t.notify()})},e.prototype.getLocalState=function(){return this.localState},e.prototype.getObservableFromLink=function(t,r,n,i){var o=this,a;i===void 0&&(i=(a=r==null?void 0:r.queryDeduplication)!==null&&a!==void 0?a:this.queryDeduplication);var l,c=this.getDocumentInfo(t),d=c.serverQuery,f=c.clientQuery;if(d){var p=this,m=p.inFlightLinkObservables,g=p.link,b={query:d,variables:n,operationName:dP(d)||void 0,context:this.prepareContext(ve(ve({},r),{forceFetch:!i}))};if(r=b.context,i){var y=G0(d),w=Ml(n),_=m.lookup(y,w);if(l=_.observable,!l){var S=new Pd([gP(g,b)]);l=_.observable=S,S.beforeNext(function(){m.remove(y,w)})}}else l=new Pd([gP(g,b)])}else l=new Pd([Rr.of({data:{}})]),r=this.prepareContext(r);return f&&(l=l_(l,function(C){return o.localState.runResolvers({document:f,remoteResult:C,context:r,variables:n})})),l},e.prototype.getResultsFromLink=function(t,r,n){var i=t.lastRequestId=this.generateRequestId(),o=this.cache.transformForLink(n.query);return l_(this.getObservableFromLink(o,n.context,n.variables),function(a){var l=vP(a),c=l.length>0;if(i>=t.lastRequestId){if(c&&n.errorPolicy==="none")throw t.markError(new fd({graphQLErrors:l}));t.markResult(a,o,n,r),t.markReady()}var d={data:a.data,loading:!1,networkStatus:Or.ready};return c&&n.errorPolicy!=="ignore"&&(d.errors=l,d.networkStatus=Or.error),d},function(a){var l=bue(a)?a:new fd({networkError:a});throw i>=t.lastRequestId&&t.markError(l),l})},e.prototype.fetchConcastWithInfo=function(t,r,n,i){var o=this;n===void 0&&(n=Or.loading),i===void 0&&(i=r.query);var a=this.getVariables(i,r.variables),l=this.getQuery(t),c=this.defaultOptions.watchQuery,d=r.fetchPolicy,f=d===void 0?c&&c.fetchPolicy||"cache-first":d,p=r.errorPolicy,m=p===void 0?c&&c.errorPolicy||"none":p,g=r.returnPartialData,b=g===void 0?!1:g,y=r.notifyOnNetworkStatusChange,w=y===void 0?!1:y,_=r.context,S=_===void 0?{}:_,C=Object.assign({},r,{query:i,variables:a,fetchPolicy:f,errorPolicy:m,returnPartialData:b,notifyOnNetworkStatusChange:w,context:S}),k=function(M){C.variables=M;var B=o.fetchQueryByPolicy(l,C,n);return C.fetchPolicy!=="standby"&&B.sources.length>0&&l.observableQuery&&l.observableQuery.applyNextFetchPolicy("after-fetch",r),B},E=function(){return o.fetchCancelFns.delete(t)};this.fetchCancelFns.set(t,function(M){E(),setTimeout(function(){return R.cancel(M)})});var R,T;if(this.getDocumentInfo(C.query).hasClientExports)R=new Pd(this.localState.addExportedVariables(C.query,C.variables,C.context).then(k).then(function(M){return M.sources})),T=!0;else{var A=k(C.variables);T=A.fromLink,R=new Pd(A.sources)}return R.promise.then(E,E),{concast:R,fromLink:T}},e.prototype.refetchQueries=function(t){var r=this,n=t.updateCache,i=t.include,o=t.optimistic,a=o===void 0?!1:o,l=t.removeOptimistic,c=l===void 0?a?rP("refetchQueries"):void 0:l,d=t.onQueryUpdated,f=new Map;i&&this.getObservableQueries(i).forEach(function(m,g){f.set(g,{oq:m,lastDiff:r.getQuery(g).getDiff()})});var p=new Map;return n&&this.cache.batch({update:n,optimistic:a&&c||!1,removeOptimistic:c,onWatchUpdated:function(m,g,b){var y=m.watcher instanceof v_&&m.watcher.observableQuery;if(y){if(d){f.delete(y.queryId);var w=d(y,g,b);return w===!0&&(w=y.refetch()),w!==!1&&p.set(y,w),w}d!==null&&f.set(y.queryId,{oq:y,lastDiff:b,diff:g})}}}),f.size&&f.forEach(function(m,g){var b=m.oq,y=m.lastDiff,w=m.diff,_;if(d){if(!w){var S=b.queryInfo;S.reset(),w=S.getDiff()}_=d(b,w,y)}(!d||_===!0)&&(_=b.refetch()),_!==!1&&p.set(b,_),g.indexOf("legacyOneTimeQuery")>=0&&r.stopQueryNoBroadcast(g)}),c&&this.cache.removeOptimistic(c),p},e.prototype.fetchQueryByPolicy=function(t,r,n){var i=this,o=r.query,a=r.variables,l=r.fetchPolicy,c=r.refetchWritePolicy,d=r.errorPolicy,f=r.returnPartialData,p=r.context,m=r.notifyOnNetworkStatusChange,g=t.networkStatus;t.init({document:o,variables:a,networkStatus:n});var b=function(){return t.getDiff()},y=function(k,E){E===void 0&&(E=t.networkStatus||Or.loading);var R=k.result;globalThis.__DEV__!==!1&&!f&&!qr(R,{})&&lB(k.missing);var T=function(A){return Rr.of(ve({data:A,loading:rm(E),networkStatus:E},k.complete?null:{partial:!0}))};return R&&i.getDocumentInfo(o).hasForcedResolvers?i.localState.runResolvers({document:o,remoteResult:{data:R},context:p,variables:a,onlyRunForcedResolvers:!0}).then(function(A){return T(A.data||void 0)}):d==="none"&&E===Or.refetch&&Array.isArray(k.missing)?T(void 0):T(R)},w=l==="no-cache"?0:n===Or.refetch&&c!=="merge"?1:2,_=function(){return i.getResultsFromLink(t,w,{query:o,variables:a,context:p,fetchPolicy:l,errorPolicy:d})},S=m&&typeof g=="number"&&g!==n&&rm(n);switch(l){default:case"cache-first":{var C=b();return C.complete?{fromLink:!1,sources:[y(C,t.markReady())]}:f||S?{fromLink:!0,sources:[y(C),_()]}:{fromLink:!0,sources:[_()]}}case"cache-and-network":{var C=b();return C.complete||f||S?{fromLink:!0,sources:[y(C),_()]}:{fromLink:!0,sources:[_()]}}case"cache-only":return{fromLink:!1,sources:[y(b(),t.markReady())]};case"network-only":return S?{fromLink:!0,sources:[y(b()),_()]}:{fromLink:!0,sources:[_()]};case"no-cache":return S?{fromLink:!0,sources:[y(t.getDiff()),_()]}:{fromLink:!0,sources:[_()]};case"standby":return{fromLink:!1,sources:[]}}},e.prototype.getQuery=function(t){return t&&!this.queries.has(t)&&this.queries.set(t,new v_(this,t)),this.queries.get(t)},e.prototype.prepareContext=function(t){t===void 0&&(t={});var r=this.localState.prepareContext(t);return ve(ve(ve({},this.defaultContext),r),{clientAwareness:this.clientAwareness})},e}(),y2=!1,cB=function(){function e(t){var r=this;if(this.resetStoreCallbacks=[],this.clearStoreCallbacks=[],!t.cache)throw Ei(15);var n=t.uri,i=t.credentials,o=t.headers,a=t.cache,l=t.documentTransform,c=t.ssrMode,d=c===void 0?!1:c,f=t.ssrForceFetchDelay,p=f===void 0?0:f,m=t.connectToDevTools,g=m===void 0?typeof window=="object"&&!window.__APOLLO_CLIENT__&&globalThis.__DEV__!==!1:m,b=t.queryDeduplication,y=b===void 0?!0:b,w=t.defaultOptions,_=t.defaultContext,S=t.assumeImmutableResults,C=S===void 0?a.assumeImmutableResults:S,k=t.resolvers,E=t.typeDefs,R=t.fragmentMatcher,T=t.name,A=t.version,M=t.link;M||(M=n?new Due({uri:n,credentials:i,headers:o}):Ws.empty()),this.link=M,this.cache=a,this.disableNetworkFetches=d||p>0,this.queryDeduplication=y,this.defaultOptions=w||Object.create(null),this.typeDefs=E,p&&setTimeout(function(){return r.disableNetworkFetches=!1},p),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.watchFragment=this.watchFragment.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),this.version=SE,this.localState=new uB({cache:a,client:this,resolvers:k,fragmentMatcher:R}),this.queryManager=new ace({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,defaultContext:_,documentTransform:l,queryDeduplication:y,ssrMode:d,clientAwareness:{name:T,version:A},localState:this.localState,assumeImmutableResults:C,onBroadcast:g?function(){r.devToolsHookCb&&r.devToolsHookCb({action:{},state:{queries:r.queryManager.getQueryStore(),mutations:r.queryManager.mutationStore||{}},dataWithOptimisticResults:r.cache.extract(!0)})}:void 0}),g&&this.connectToDevTools()}return e.prototype.connectToDevTools=function(){if(typeof window=="object"){var t=window,r=Symbol.for("apollo.devtools");(t[r]=t[r]||[]).push(this),t.__APOLLO_CLIENT__=this}!y2&&globalThis.__DEV__!==!1&&(y2=!0,setTimeout(function(){if(typeof window<"u"&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__&&/^(https?|file):$/.test(window.location.protocol)){var n=window.navigator,i=n&&n.userAgent,o=void 0;typeof i=="string"&&(i.indexOf("Chrome/")>-1?o="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":i.indexOf("Firefox/")>-1&&(o="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),o&&globalThis.__DEV__!==!1&&_t.log("Download the Apollo DevTools for a better development experience: %s",o)}},1e4))},Object.defineProperty(e.prototype,"documentTransform",{get:function(){return this.queryManager.documentTransform},enumerable:!1,configurable:!0}),e.prototype.stop=function(){this.queryManager.stop()},e.prototype.watchQuery=function(t){return this.defaultOptions.watchQuery&&(t=u_(this.defaultOptions.watchQuery,t)),this.disableNetworkFetches&&(t.fetchPolicy==="network-only"||t.fetchPolicy==="cache-and-network")&&(t=ve(ve({},t),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(t)},e.prototype.query=function(t){return this.defaultOptions.query&&(t=u_(this.defaultOptions.query,t)),_t(t.fetchPolicy!=="cache-and-network",16),this.disableNetworkFetches&&t.fetchPolicy==="network-only"&&(t=ve(ve({},t),{fetchPolicy:"cache-first"})),this.queryManager.query(t)},e.prototype.mutate=function(t){return this.defaultOptions.mutate&&(t=u_(this.defaultOptions.mutate,t)),this.queryManager.mutate(t)},e.prototype.subscribe=function(t){return this.queryManager.startGraphQLSubscription(t)},e.prototype.readQuery=function(t,r){return r===void 0&&(r=!1),this.cache.readQuery(t,r)},e.prototype.watchFragment=function(t){return this.cache.watchFragment(t)},e.prototype.readFragment=function(t,r){return r===void 0&&(r=!1),this.cache.readFragment(t,r)},e.prototype.writeQuery=function(t){var r=this.cache.writeQuery(t);return t.broadcast!==!1&&this.queryManager.broadcastQueries(),r},e.prototype.writeFragment=function(t){var r=this.cache.writeFragment(t);return t.broadcast!==!1&&this.queryManager.broadcastQueries(),r},e.prototype.__actionHookForDevTools=function(t){this.devToolsHookCb=t},e.prototype.__requestRaw=function(t){return gP(this.link,t)},e.prototype.resetStore=function(){var t=this;return Promise.resolve().then(function(){return t.queryManager.clearStore({discardWatches:!1})}).then(function(){return Promise.all(t.resetStoreCallbacks.map(function(r){return r()}))}).then(function(){return t.reFetchObservableQueries()})},e.prototype.clearStore=function(){var t=this;return Promise.resolve().then(function(){return t.queryManager.clearStore({discardWatches:!0})}).then(function(){return Promise.all(t.clearStoreCallbacks.map(function(r){return r()}))})},e.prototype.onResetStore=function(t){var r=this;return this.resetStoreCallbacks.push(t),function(){r.resetStoreCallbacks=r.resetStoreCallbacks.filter(function(n){return n!==t})}},e.prototype.onClearStore=function(t){var r=this;return this.clearStoreCallbacks.push(t),function(){r.clearStoreCallbacks=r.clearStoreCallbacks.filter(function(n){return n!==t})}},e.prototype.reFetchObservableQueries=function(t){return this.queryManager.reFetchObservableQueries(t)},e.prototype.refetchQueries=function(t){var r=this.queryManager.refetchQueries(t),n=[],i=[];r.forEach(function(a,l){n.push(l),i.push(a)});var o=Promise.all(i);return o.queries=n,o.results=i,o.catch(function(a){globalThis.__DEV__!==!1&&_t.debug(17,a)}),o},e.prototype.getObservableQueries=function(t){return t===void 0&&(t="active"),this.queryManager.getObservableQueries(t)},e.prototype.extract=function(t){return this.cache.extract(t)},e.prototype.restore=function(t){return this.cache.restore(t)},e.prototype.addResolvers=function(t){this.localState.addResolvers(t)},e.prototype.setResolvers=function(t){this.localState.setResolvers(t)},e.prototype.getResolvers=function(){return this.localState.getResolvers()},e.prototype.setLocalStateFragmentMatcher=function(t){this.localState.setFragmentMatcher(t)},e.prototype.setLink=function(t){this.link=this.queryManager.link=t},Object.defineProperty(e.prototype,"defaultContext",{get:function(){return this.queryManager.defaultContext},enumerable:!1,configurable:!0}),e}();globalThis.__DEV__!==!1&&(cB.prototype.getMemoryInternals=Zse);var eb=new Map,EP=new Map,dB=!0,Ab=!1;function fB(e){return e.replace(/[\s,]+/g," ").trim()}function sce(e){return fB(e.source.body.substring(e.start,e.end))}function lce(e){var t=new Set,r=[];return e.definitions.forEach(function(n){if(n.kind==="FragmentDefinition"){var i=n.name.value,o=sce(n.loc),a=EP.get(i);a&&!a.has(o)?dB&&console.warn("Warning: fragment with name "+i+` already exists.
|
440
|
+
`).forEach(function(r){var n=r.indexOf(":");if(n>-1){var i=r.slice(0,n).trim().toLowerCase(),o=r.slice(n+1).trim();t[i]=o}}),t}function U5(e,t){if(e.status>=300){var r=function(){try{return JSON.parse(t)}catch{return t}};q5(e,r(),"Response not successful: Received status code ".concat(e.status))}try{return JSON.parse(t)}catch(i){var n=i;throw n.name="ServerParseError",n.response=e,n.statusCode=e.status,n.bodyText=t,n}}function xue(e,t){e.result&&e.result.errors&&e.result.data&&t.next(e.result),t.error(e)}function Pue(e){return function(t){return t.text().then(function(r){return U5(t,r)}).then(function(r){return!Array.isArray(r)&&!W$.call(r,"data")&&!W$.call(r,"errors")&&q5(t,r,"Server response was missing for query '".concat(Array.isArray(e)?e.map(function(n){return n.operationName}):e.operationName,"'.")),r})}}var yP=function(e,t){var r;try{r=JSON.stringify(e)}catch(i){var n=Ei(39,t,i.message);throw n.parseError=i,n}return r},Cue={includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},Eue={accept:"*/*","content-type":"application/json"},Tue={method:"POST"},Oue={http:Cue,headers:Eue,options:Tue},Rue=function(e,t){return t(e)};function Iue(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i={},o={};r.forEach(function(p){i=ve(ve(ve({},i),p.options),{headers:ve(ve({},i.headers),p.headers)}),p.credentials&&(i.credentials=p.credentials),o=ve(ve({},o),p.http)}),i.headers&&(i.headers=kue(i.headers,o.preserveHeaderCase));var a=e.operationName,l=e.extensions,c=e.variables,d=e.query,f={operationName:a,variables:c};return o.includeExtensions&&(f.extensions=l),o.includeQuery&&(f.query=t(d,G0)),{options:i,body:f}}function kue(e,t){if(!t){var r=Object.create(null);return Object.keys(Object(e)).forEach(function(o){r[o.toLowerCase()]=e[o]}),r}var n=Object.create(null);Object.keys(Object(e)).forEach(function(o){n[o.toLowerCase()]={originalName:o,value:e[o]}});var i=Object.create(null);return Object.keys(n).forEach(function(o){i[n[o].originalName]=n[o].value}),i}var jue=function(e){if(!e&&typeof fetch>"u")throw Ei(37)},$ue=function(e,t){var r=e.getContext(),n=r.uri;return n||(typeof t=="function"?t(e):t||"/graphql")};function Aue(e,t){var r=[],n=function(p,m){r.push("".concat(p,"=").concat(encodeURIComponent(m)))};if("query"in t&&n("query",t.query),t.operationName&&n("operationName",t.operationName),t.variables){var i=void 0;try{i=yP(t.variables,"Variables map")}catch(p){return{parseError:p}}n("variables",i)}if(t.extensions){var o=void 0;try{o=yP(t.extensions,"Extensions map")}catch(p){return{parseError:p}}n("extensions",o)}var a="",l=e,c=e.indexOf("#");c!==-1&&(a=e.substr(c),l=e.substr(0,c));var d=l.indexOf("?")===-1?"?":"&",f=l+d+r.join("&")+a;return{newURI:f}}var K$=aa(function(){return fetch}),H5=function(e){e===void 0&&(e={});var t=e.uri,r=t===void 0?"/graphql":t,n=e.fetch,i=e.print,o=i===void 0?Rue:i,a=e.includeExtensions,l=e.preserveHeaderCase,c=e.useGETForQueries,d=e.includeUnusedVariables,f=d===void 0?!1:d,p=Ms(e,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);globalThis.__DEV__!==!1&&jue(n||K$);var m={http:{includeExtensions:a,preserveHeaderCase:l},options:p.fetchOptions,credentials:p.credentials,headers:p.headers};return new Ws(function(g){var b=$ue(g,r),y=g.getContext(),w={};if(y.clientAwareness){var _=y.clientAwareness,S=_.name,C=_.version;S&&(w["apollographql-client-name"]=S),C&&(w["apollographql-client-version"]=C)}var k=ve(ve({},w),y.headers),E={http:y.http,options:y.fetchOptions,credentials:y.credentials,headers:k};if(Jp(["client"],g.query)){var R=M5(g.query);if(!R)return c_(new Error("HttpLink: Trying to send a client-only query to the server. To send to the server, ensure a non-client field is added to the query or set the `transformOptions.removeClientFields` option to `true`."));g.query=R}var T=Iue(g,o,Oue,m,E),A=T.options,M=T.body;M.variables&&!f&&(M.variables=aue(M.variables,g.query));var B;!A.signal&&typeof AbortController<"u"&&(B=new AbortController,A.signal=B.signal);var Q=function(ge){return ge.kind==="OperationDefinition"&&ge.operation==="mutation"},se=function(ge){return ge.kind==="OperationDefinition"&&ge.operation==="subscription"},ie=se(Gm(g.query)),N=Jp(["defer"],g.query);if(c&&!g.query.definitions.some(Q)&&(A.method="GET"),N||ie){A.headers=A.headers||{};var X="multipart/mixed;";ie&&N&&globalThis.__DEV__!==!1&&_t.warn(38),ie?X+="boundary=graphql;subscriptionSpec=1.0,application/json":N&&(X+="deferSpec=20220824,application/json"),A.headers.accept=X}if(A.method==="GET"){var ce=Aue(b,M),ne=ce.newURI,ee=ce.parseError;if(ee)return c_(ee);b=ne}else try{A.body=yP(M,"Payload")}catch(ge){return c_(ge)}return new Rr(function(ge){var Z=n||aa(function(){return fetch})||K$,j=ge.next.bind(ge);return Z(b,A).then(function(U){var q;g.setContext({response:U});var $=(q=U.headers)===null||q===void 0?void 0:q.get("content-type");return $!==null&&/^multipart\/mixed/i.test($)?Sue(U,j):Pue(g)(U).then(j)}).then(function(){B=void 0,ge.complete()}).catch(function(U){B=void 0,xue(U,ge)}),function(){B&&B.abort()}})})},Due=function(e){ga(t,e);function t(r){r===void 0&&(r={});var n=e.call(this,H5(r).request)||this;return n.options=r,n}return t}(Ws);const{toString:G$,hasOwnProperty:Mue}=Object.prototype,Q$=Function.prototype.toString,bP=new Map;function qr(e,t){try{return wP(e,t)}finally{bP.clear()}}function wP(e,t){if(e===t)return!0;const r=G$.call(e),n=G$.call(t);if(r!==n)return!1;switch(r){case"[object Array]":if(e.length!==t.length)return!1;case"[object Object]":{if(X$(e,t))return!0;const i=Y$(e),o=Y$(t),a=i.length;if(a!==o.length)return!1;for(let l=0;l<a;++l)if(!Mue.call(t,i[l]))return!1;for(let l=0;l<a;++l){const c=i[l];if(!wP(e[c],t[c]))return!1}return!0}case"[object Error]":return e.name===t.name&&e.message===t.message;case"[object Number]":if(e!==e)return t!==t;case"[object Boolean]":case"[object Date]":return+e==+t;case"[object RegExp]":case"[object String]":return e==`${t}`;case"[object Map]":case"[object Set]":{if(e.size!==t.size)return!1;if(X$(e,t))return!0;const i=e.entries(),o=r==="[object Map]";for(;;){const a=i.next();if(a.done)break;const[l,c]=a.value;if(!t.has(l)||o&&!wP(c,t.get(l)))return!1}return!0}case"[object Uint16Array]":case"[object Uint8Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object ArrayBuffer]":e=new Uint8Array(e),t=new Uint8Array(t);case"[object DataView]":{let i=e.byteLength;if(i===t.byteLength)for(;i--&&e[i]===t[i];);return i===-1}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{const i=Q$.call(e);return i!==Q$.call(t)?!1:!Lue(i,Fue)}}return!1}function Y$(e){return Object.keys(e).filter(Nue,e)}function Nue(e){return this[e]!==void 0}const Fue="{ [native code] }";function Lue(e,t){const r=e.length-t.length;return r>=0&&e.indexOf(t,r)===r}function X$(e,t){let r=bP.get(e);if(r){if(r.has(t))return!0}else bP.set(e,r=new Set);return r.add(t),!1}function W5(e,t,r,n){var i=t.data,o=Ms(t,["data"]),a=r.data,l=Ms(r,["data"]);return qr(o,l)&&Jy(Gm(e).selectionSet,i,a,{fragmentMap:z0(H0(e)),variables:n})}function Jy(e,t,r,n){if(t===r)return!0;var i=new Set;return e.selections.every(function(o){if(i.has(o)||(i.add(o),!Hm(o,n.variables))||J$(o))return!0;if(Kl(o)){var a=Wl(o),l=t&&t[a],c=r&&r[a],d=o.selectionSet;if(!d)return qr(l,c);var f=Array.isArray(l),p=Array.isArray(c);if(f!==p)return!1;if(f&&p){var m=l.length;if(c.length!==m)return!1;for(var g=0;g<m;++g)if(!Jy(d,l[g],c[g],n))return!1;return!0}return Jy(d,l,c,n)}else{var b=q0(o,n.fragmentMap);if(b)return J$(b)?!0:Jy(b.selectionSet,t,r,n)}})}function J$(e){return!!e.directives&&e.directives.some(Bue)}function Bue(e){return e.name.value==="nonreactive"}var K5=function(){function e(){this.assumeImmutableResults=!1,this.getFragmentDoc=em(Use,{max:Bs["cache.fragmentQueryDocuments"]||1e3,cache:kb})}return e.prototype.batch=function(t){var r=this,n=typeof t.optimistic=="string"?t.optimistic:t.optimistic===!1?null:void 0,i;return this.performTransaction(function(){return i=t.update(r)},n),i},e.prototype.recordOptimisticTransaction=function(t,r){this.performTransaction(t,r)},e.prototype.transformDocument=function(t){return t},e.prototype.transformForLink=function(t){return t},e.prototype.identify=function(t){},e.prototype.gc=function(){return[]},e.prototype.modify=function(t){return!1},e.prototype.readQuery=function(t,r){return r===void 0&&(r=!!t.optimistic),this.read(ve(ve({},t),{rootId:t.id||"ROOT_QUERY",optimistic:r}))},e.prototype.watchFragment=function(t){var r=this,n=t.fragment,i=t.fragmentName,o=t.from,a=t.optimistic,l=a===void 0?!0:a,c=this.getFragmentDoc(n,i),d={returnPartialData:!0,id:typeof o=="string"?o:this.identify(o),query:c,optimistic:l},f;return new Rr(function(p){return r.watch(ve(ve({},d),{immediate:!0,callback:function(m){if(!(f&&W5(c,{data:f==null?void 0:f.result},{data:m.result}))){var g={data:m.result,complete:!!m.complete};m.missing&&(g.missing=Q0(m.missing.map(function(b){return b.missing}))),f=m,p.next(g)}}}))})},e.prototype.readFragment=function(t,r){return r===void 0&&(r=!!t.optimistic),this.read(ve(ve({},t),{query:this.getFragmentDoc(t.fragment,t.fragmentName),rootId:t.id,optimistic:r}))},e.prototype.writeQuery=function(t){var r=t.id,n=t.data,i=Ms(t,["id","data"]);return this.write(Object.assign(i,{dataId:r||"ROOT_QUERY",result:n}))},e.prototype.writeFragment=function(t){var r=t.id,n=t.data,i=t.fragment,o=t.fragmentName,a=Ms(t,["id","data","fragment","fragmentName"]);return this.write(Object.assign(a,{query:this.getFragmentDoc(i,o),dataId:r,result:n}))},e.prototype.updateQuery=function(t,r){return this.batch({update:function(n){var i=n.readQuery(t),o=r(i);return o==null?i:(n.writeQuery(ve(ve({},t),{data:o})),o)}})},e.prototype.updateFragment=function(t,r){return this.batch({update:function(n){var i=n.readFragment(t),o=r(i);return o==null?i:(n.writeFragment(ve(ve({},t),{data:o})),o)}})},e}();globalThis.__DEV__!==!1&&(K5.prototype.getMemoryInternals=tle);var G5=function(e){ga(t,e);function t(r,n,i,o){var a,l=e.call(this,r)||this;if(l.message=r,l.path=n,l.query=i,l.variables=o,Array.isArray(l.path)){l.missing=l.message;for(var c=l.path.length-1;c>=0;--c)l.missing=(a={},a[l.path[c]]=l.missing,a)}else l.missing=l.path;return l.__proto__=t.prototype,l}return t}(Error),Fn=Object.prototype.hasOwnProperty;function Dh(e){return e==null}function Q5(e,t){var r=e.__typename,n=e.id,i=e._id;if(typeof r=="string"&&(t&&(t.keyObject=Dh(n)?Dh(i)?void 0:{_id:i}:{id:n}),Dh(n)&&!Dh(i)&&(n=i),!Dh(n)))return"".concat(r,":").concat(typeof n=="number"||typeof n=="string"?n:JSON.stringify(n))}var Y5={dataIdFromObject:Q5,addTypename:!0,resultCaching:!0,canonizeResults:!1};function Vue(e){return gf(Y5,e)}function X5(e){var t=e.canonizeResults;return t===void 0?Y5.canonizeResults:t}function zue(e,t){return wr(t)?e.get(t.__ref,"__typename"):t&&t.__typename}var J5=/^[_a-z][_0-9a-z]*/i;function Yl(e){var t=e.match(J5);return t?t[0]:e}function SP(e,t,r){return fn(t)?hn(t)?t.every(function(n){return SP(e,n,r)}):e.selections.every(function(n){if(Kl(n)&&Hm(n,r)){var i=Wl(n);return Fn.call(t,i)&&(!n.selectionSet||SP(n.selectionSet,t[i],r))}return!0}):!1}function Bd(e){return fn(e)&&!wr(e)&&!hn(e)}function que(){return new Ql}function Z5(e,t){var r=z0(H0(e));return{fragmentMap:r,lookupFragment:function(n){var i=r[n];return!i&&t&&(i=t.lookup(n)),i||null}}}var Zy=Object.create(null),d_=function(){return Zy},Z$=Object.create(null),tm=function(){function e(t,r){var n=this;this.policies=t,this.group=r,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(i,o){return mP(wr(i)?n.get(i.__ref,o):i&&i[o])},this.canRead=function(i){return wr(i)?n.has(i.__ref):typeof i=="object"},this.toReference=function(i,o){if(typeof i=="string")return Qd(i);if(wr(i))return i;var a=n.policies.identify(i)[0];if(a){var l=Qd(a);return o&&n.merge(a,i),l}}}return e.prototype.toObject=function(){return ve({},this.data)},e.prototype.has=function(t){return this.lookup(t,!0)!==void 0},e.prototype.get=function(t,r){if(this.group.depend(t,r),Fn.call(this.data,t)){var n=this.data[t];if(n&&Fn.call(n,r))return n[r]}if(r==="__typename"&&Fn.call(this.policies.rootTypenamesById,t))return this.policies.rootTypenamesById[t];if(this instanceof xl)return this.parent.get(t,r)},e.prototype.lookup=function(t,r){if(r&&this.group.depend(t,"__exists"),Fn.call(this.data,t))return this.data[t];if(this instanceof xl)return this.parent.lookup(t,r);if(this.policies.rootTypenamesById[t])return Object.create(null)},e.prototype.merge=function(t,r){var n=this,i;wr(t)&&(t=t.__ref),wr(r)&&(r=r.__ref);var o=typeof t=="string"?this.lookup(i=t):t,a=typeof r=="string"?this.lookup(i=r):r;if(a){_t(typeof i=="string",1);var l=new Ql(Hue).merge(o,a);if(this.data[i]=l,l!==o&&(delete this.refs[i],this.group.caching)){var c=Object.create(null);o||(c.__exists=1),Object.keys(a).forEach(function(d){if(!o||o[d]!==l[d]){c[d]=1;var f=Yl(d);f!==d&&!n.policies.hasKeyArgs(l.__typename,f)&&(c[f]=1),l[d]===void 0&&!(n instanceof xl)&&delete l[d]}}),c.__typename&&!(o&&o.__typename)&&this.policies.rootTypenamesById[i]===l.__typename&&delete c.__typename,Object.keys(c).forEach(function(d){return n.group.dirty(i,d)})}}},e.prototype.modify=function(t,r){var n=this,i=this.lookup(t);if(i){var o=Object.create(null),a=!1,l=!0,c={DELETE:Zy,INVALIDATE:Z$,isReference:wr,toReference:this.toReference,canRead:this.canRead,readField:function(d,f){return n.policies.readField(typeof d=="string"?{fieldName:d,from:f||Qd(t)}:d,{store:n})}};if(Object.keys(i).forEach(function(d){var f=Yl(d),p=i[d];if(p!==void 0){var m=typeof r=="function"?r:r[d]||r[f];if(m){var g=m===d_?Zy:m(mP(p),ve(ve({},c),{fieldName:f,storeFieldName:d,storage:n.getStorage(t,d)}));if(g===Z$)n.group.dirty(t,d);else if(g===Zy&&(g=void 0),g!==p&&(o[d]=g,a=!0,p=g,globalThis.__DEV__!==!1)){var b=function(E){if(n.lookup(E.__ref)===void 0)return globalThis.__DEV__!==!1&&_t.warn(2,E),!0};if(wr(g))b(g);else if(Array.isArray(g))for(var y=!1,w=void 0,_=0,S=g;_<S.length;_++){var C=S[_];if(wr(C)){if(y=!0,b(C))break}else if(typeof C=="object"&&C){var k=n.policies.identify(C)[0];k&&(w=C)}if(y&&w!==void 0){globalThis.__DEV__!==!1&&_t.warn(3,w);break}}}}p!==void 0&&(l=!1)}}),a)return this.merge(t,o),l&&(this instanceof xl?this.data[t]=void 0:delete this.data[t],this.group.dirty(t,"__exists")),!0}return!1},e.prototype.delete=function(t,r,n){var i,o=this.lookup(t);if(o){var a=this.getFieldValue(o,"__typename"),l=r&&n?this.policies.getStoreFieldName({typename:a,fieldName:r,args:n}):r;return this.modify(t,l?(i={},i[l]=d_,i):d_)}return!1},e.prototype.evict=function(t,r){var n=!1;return t.id&&(Fn.call(this.data,t.id)&&(n=this.delete(t.id,t.fieldName,t.args)),this instanceof xl&&this!==r&&(n=this.parent.evict(t,r)||n),(t.fieldName||n)&&this.group.dirty(t.id,t.fieldName||"__exists")),n},e.prototype.clear=function(){this.replace(null)},e.prototype.extract=function(){var t=this,r=this.toObject(),n=[];return this.getRootIdSet().forEach(function(i){Fn.call(t.policies.rootTypenamesById,i)||n.push(i)}),n.length&&(r.__META={extraRootIds:n.sort()}),r},e.prototype.replace=function(t){var r=this;if(Object.keys(this.data).forEach(function(o){t&&Fn.call(t,o)||r.delete(o)}),t){var n=t.__META,i=Ms(t,["__META"]);Object.keys(i).forEach(function(o){r.merge(o,i[o])}),n&&n.extraRootIds.forEach(this.retain,this)}},e.prototype.retain=function(t){return this.rootIds[t]=(this.rootIds[t]||0)+1},e.prototype.release=function(t){if(this.rootIds[t]>0){var r=--this.rootIds[t];return r||delete this.rootIds[t],r}return 0},e.prototype.getRootIdSet=function(t){return t===void 0&&(t=new Set),Object.keys(this.rootIds).forEach(t.add,t),this instanceof xl?this.parent.getRootIdSet(t):Object.keys(this.policies.rootTypenamesById).forEach(t.add,t),t},e.prototype.gc=function(){var t=this,r=this.getRootIdSet(),n=this.toObject();r.forEach(function(a){Fn.call(n,a)&&(Object.keys(t.findChildRefIds(a)).forEach(r.add,r),delete n[a])});var i=Object.keys(n);if(i.length){for(var o=this;o instanceof xl;)o=o.parent;i.forEach(function(a){return o.delete(a)})}return i},e.prototype.findChildRefIds=function(t){if(!Fn.call(this.refs,t)){var r=this.refs[t]=Object.create(null),n=this.data[t];if(!n)return r;var i=new Set([n]);i.forEach(function(o){wr(o)&&(r[o.__ref]=!0),fn(o)&&Object.keys(o).forEach(function(a){var l=o[a];fn(l)&&i.add(l)})})}return this.refs[t]},e.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},e}(),eB=function(){function e(t,r){r===void 0&&(r=null),this.caching=t,this.parent=r,this.d=null,this.resetCaching()}return e.prototype.resetCaching=function(){this.d=this.caching?j5():null,this.keyMaker=new kf(jf)},e.prototype.depend=function(t,r){if(this.d){this.d(f_(t,r));var n=Yl(r);n!==r&&this.d(f_(t,n)),this.parent&&this.parent.depend(t,r)}},e.prototype.dirty=function(t,r){this.d&&this.d.dirty(f_(t,r),r==="__exists"?"forget":"setDirty")},e}();function f_(e,t){return t+"#"+e}function eA(e,t){yp(e)&&e.group.depend(t,"__exists")}(function(e){var t=function(r){ga(n,r);function n(i){var o=i.policies,a=i.resultCaching,l=a===void 0?!0:a,c=i.seed,d=r.call(this,o,new eB(l))||this;return d.stump=new Uue(d),d.storageTrie=new kf(jf),c&&d.replace(c),d}return n.prototype.addLayer=function(i,o){return this.stump.addLayer(i,o)},n.prototype.removeLayer=function(){return this},n.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},n}(e);e.Root=t})(tm||(tm={}));var xl=function(e){ga(t,e);function t(r,n,i,o){var a=e.call(this,n.policies,o)||this;return a.id=r,a.parent=n,a.replay=i,a.group=o,i(a),a}return t.prototype.addLayer=function(r,n){return new t(r,this,n,this.group)},t.prototype.removeLayer=function(r){var n=this,i=this.parent.removeLayer(r);return r===this.id?(this.group.caching&&Object.keys(this.data).forEach(function(o){var a=n.data[o],l=i.lookup(o);l?a?a!==l&&Object.keys(a).forEach(function(c){qr(a[c],l[c])||n.group.dirty(o,c)}):(n.group.dirty(o,"__exists"),Object.keys(l).forEach(function(c){n.group.dirty(o,c)})):n.delete(o)}),i):i===this.parent?this:i.addLayer(this.id,this.replay)},t.prototype.toObject=function(){return ve(ve({},this.parent.toObject()),this.data)},t.prototype.findChildRefIds=function(r){var n=this.parent.findChildRefIds(r);return Fn.call(this.data,r)?ve(ve({},n),e.prototype.findChildRefIds.call(this,r)):n},t.prototype.getStorage=function(){for(var r=this.parent;r.parent;)r=r.parent;return r.getStorage.apply(r,arguments)},t}(tm),Uue=function(e){ga(t,e);function t(r){return e.call(this,"EntityStore.Stump",r,function(){},new eB(r.group.caching,r.group))||this}return t.prototype.removeLayer=function(){return this},t.prototype.merge=function(r,n){return this.parent.merge(r,n)},t}(xl);function Hue(e,t,r){var n=e[r],i=t[r];return qr(n,i)?n:i}function yp(e){return!!(e instanceof tm&&e.group.caching)}function Wue(e){return fn(e)?hn(e)?e.slice(0):ve({__proto__:Object.getPrototypeOf(e)},e):e}var tA=function(){function e(){this.known=new(h5?WeakSet:Set),this.pool=new kf(jf),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return e.prototype.isKnown=function(t){return fn(t)&&this.known.has(t)},e.prototype.pass=function(t){if(fn(t)){var r=Wue(t);return this.passes.set(r,t),r}return t},e.prototype.admit=function(t){var r=this;if(fn(t)){var n=this.passes.get(t);if(n)return n;var i=Object.getPrototypeOf(t);switch(i){case Array.prototype:{if(this.known.has(t))return t;var o=t.map(this.admit,this),a=this.pool.lookupArray(o);return a.array||(this.known.add(a.array=o),globalThis.__DEV__!==!1&&Object.freeze(o)),a.array}case null:case Object.prototype:{if(this.known.has(t))return t;var l=Object.getPrototypeOf(t),c=[l],d=this.sortedKeys(t);c.push(d.json);var f=c.length;d.sorted.forEach(function(g){c.push(r.admit(t[g]))});var a=this.pool.lookupArray(c);if(!a.object){var p=a.object=Object.create(l);this.known.add(p),d.sorted.forEach(function(g,b){p[g]=c[f+b]}),globalThis.__DEV__!==!1&&Object.freeze(p)}return a.object}}}return t},e.prototype.sortedKeys=function(t){var r=Object.keys(t),n=this.pool.lookupArray(r);if(!n.keys){r.sort();var i=JSON.stringify(r);(n.keys=this.keysByJSON.get(i))||this.keysByJSON.set(i,n.keys={sorted:r,json:i})}return n.keys},e}();function rA(e){return[e.selectionSet,e.objectOrReference,e.context,e.context.canonizeResults]}var Kue=function(){function e(t){var r=this;this.knownResults=new(jf?WeakMap:Map),this.config=gf(t,{addTypename:t.addTypename!==!1,canonizeResults:X5(t)}),this.canon=t.canon||new tA,this.executeSelectionSet=em(function(n){var i,o=n.context.canonizeResults,a=rA(n);a[3]=!o;var l=(i=r.executeSelectionSet).peek.apply(i,a);return l?o?ve(ve({},l),{result:r.canon.admit(l.result)}):l:(eA(n.context.store,n.enclosingRef.__ref),r.execSelectionSetImpl(n))},{max:this.config.resultCacheMaxSize||Bs["inMemoryCache.executeSelectionSet"]||5e4,keyArgs:rA,makeCacheKey:function(n,i,o,a){if(yp(o.store))return o.store.makeCacheKey(n,wr(i)?i.__ref:i,o.varString,a)}}),this.executeSubSelectedArray=em(function(n){return eA(n.context.store,n.enclosingRef.__ref),r.execSubSelectedArrayImpl(n)},{max:this.config.resultCacheMaxSize||Bs["inMemoryCache.executeSubSelectedArray"]||1e4,makeCacheKey:function(n){var i=n.field,o=n.array,a=n.context;if(yp(a.store))return a.store.makeCacheKey(i,o,a.varString)}})}return e.prototype.resetCanon=function(){this.canon=new tA},e.prototype.diffQueryAgainstStore=function(t){var r=t.store,n=t.query,i=t.rootId,o=i===void 0?"ROOT_QUERY":i,a=t.variables,l=t.returnPartialData,c=l===void 0?!0:l,d=t.canonizeResults,f=d===void 0?this.config.canonizeResults:d,p=this.config.cache.policies;a=ve(ve({},OE(S5(n))),a);var m=Qd(o),g=this.executeSelectionSet({selectionSet:Gm(n).selectionSet,objectOrReference:m,enclosingRef:m,context:ve({store:r,query:n,policies:p,variables:a,varString:Ml(a),canonizeResults:f},Z5(n,this.config.fragments))}),b;if(g.missing&&(b=[new G5(Gue(g.missing),g.missing,n,a)],!c))throw b[0];return{result:g.result,complete:!b,missing:b}},e.prototype.isFresh=function(t,r,n,i){if(yp(i.store)&&this.knownResults.get(t)===n){var o=this.executeSelectionSet.peek(n,r,i,this.canon.isKnown(t));if(o&&t===o.result)return!0}return!1},e.prototype.execSelectionSetImpl=function(t){var r=this,n=t.selectionSet,i=t.objectOrReference,o=t.enclosingRef,a=t.context;if(wr(i)&&!a.policies.rootTypenamesById[i.__ref]&&!a.store.has(i.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(i.__ref," object")};var l=a.variables,c=a.policies,d=a.store,f=d.getFieldValue(i,"__typename"),p=[],m,g=new Ql;this.config.addTypename&&typeof f=="string"&&!c.rootIdsByTypename[f]&&p.push({__typename:f});function b(C,k){var E;return C.missing&&(m=g.merge(m,(E={},E[k]=C.missing,E))),C.result}var y=new Set(n.selections);y.forEach(function(C){var k,E;if(Hm(C,l))if(Kl(C)){var R=c.readField({fieldName:C.name.value,field:C,variables:a.variables,from:i},a),T=Wl(C);R===void 0?AE.added(C)||(m=g.merge(m,(k={},k[T]="Can't find field '".concat(C.name.value,"' on ").concat(wr(i)?i.__ref+" object":"object "+JSON.stringify(i,null,2)),k))):hn(R)?R.length>0&&(R=b(r.executeSubSelectedArray({field:C,array:R,enclosingRef:o,context:a}),T)):C.selectionSet?R!=null&&(R=b(r.executeSelectionSet({selectionSet:C.selectionSet,objectOrReference:R,enclosingRef:wr(R)?R:o,context:a}),T)):a.canonizeResults&&(R=r.canon.pass(R)),R!==void 0&&p.push((E={},E[T]=R,E))}else{var A=q0(C,a.lookupFragment);if(!A&&C.kind===Je.FRAGMENT_SPREAD)throw Ei(9,C.name.value);A&&c.fragmentMatches(A,f)&&A.selectionSet.selections.forEach(y.add,y)}});var w=Q0(p),_={result:w,missing:m},S=a.canonizeResults?this.canon.admit(_):mP(_);return S.result&&this.knownResults.set(S.result,n),S},e.prototype.execSubSelectedArrayImpl=function(t){var r=this,n=t.field,i=t.array,o=t.enclosingRef,a=t.context,l,c=new Ql;function d(f,p){var m;return f.missing&&(l=c.merge(l,(m={},m[p]=f.missing,m))),f.result}return n.selectionSet&&(i=i.filter(a.store.canRead)),i=i.map(function(f,p){return f===null?null:hn(f)?d(r.executeSubSelectedArray({field:n,array:f,enclosingRef:o,context:a}),p):n.selectionSet?d(r.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:f,enclosingRef:wr(f)?f:o,context:a}),p):(globalThis.__DEV__!==!1&&Que(a.store,n,f),f)}),{result:a.canonizeResults?this.canon.admit(i):i,missing:l}},e}();function Gue(e){try{JSON.stringify(e,function(t,r){if(typeof r=="string")throw r;return r})}catch(t){return t}}function Que(e,t,r){if(!t.selectionSet){var n=new Set([r]);n.forEach(function(i){fn(i)&&(_t(!wr(i),10,zue(e,i),t.name.value),Object.values(i).forEach(n.add,n))})}}var BE=new IE,nA=new WeakMap;function bp(e){var t=nA.get(e);return t||nA.set(e,t={vars:new Set,dep:j5()}),t}function iA(e){bp(e).vars.forEach(function(t){return t.forgetCache(e)})}function Yue(e){bp(e).vars.forEach(function(t){return t.attachCache(e)})}function Xue(e){var t=new Set,r=new Set,n=function(o){if(arguments.length>0){if(e!==o){e=o,t.forEach(function(c){bp(c).dep.dirty(n),Jue(c)});var a=Array.from(r);r.clear(),a.forEach(function(c){return c(e)})}}else{var l=BE.getValue();l&&(i(l),bp(l).dep(n))}return e};n.onNextChange=function(o){return r.add(o),function(){r.delete(o)}};var i=n.attachCache=function(o){return t.add(o),bp(o).vars.add(n),n};return n.forgetCache=function(o){return t.delete(o)},n}function Jue(e){e.broadcastWatches&&e.broadcastWatches()}var oA=Object.create(null);function VE(e){var t=JSON.stringify(e);return oA[t]||(oA[t]=Object.create(null))}function aA(e){var t=VE(e);return t.keyFieldsFn||(t.keyFieldsFn=function(r,n){var i=function(a,l){return n.readField(l,a)},o=n.keyObject=zE(e,function(a){var l=Xd(n.storeObject,a,i);return l===void 0&&r!==n.storeObject&&Fn.call(r,a[0])&&(l=Xd(r,a,rB)),_t(l!==void 0,4,a.join("."),r),l});return"".concat(n.typename,":").concat(JSON.stringify(o))})}function sA(e){var t=VE(e);return t.keyArgsFn||(t.keyArgsFn=function(r,n){var i=n.field,o=n.variables,a=n.fieldName,l=zE(e,function(d){var f=d[0],p=f.charAt(0);if(p==="@"){if(i&&Za(i.directives)){var m=f.slice(1),g=i.directives.find(function(_){return _.name.value===m}),b=g&&U0(g,o);return b&&Xd(b,d.slice(1))}return}if(p==="$"){var y=f.slice(1);if(o&&Fn.call(o,y)){var w=d.slice(0);return w[0]=y,Xd(o,w)}return}if(r)return Xd(r,d)}),c=JSON.stringify(l);return(r||c!=="{}")&&(a+=":"+c),a})}function zE(e,t){var r=new Ql;return tB(e).reduce(function(n,i){var o,a=t(i);if(a!==void 0){for(var l=i.length-1;l>=0;--l)a=(o={},o[i[l]]=a,o);n=r.merge(n,a)}return n},Object.create(null))}function tB(e){var t=VE(e);if(!t.paths){var r=t.paths=[],n=[];e.forEach(function(i,o){hn(i)?(tB(i).forEach(function(a){return r.push(n.concat(a))}),n.length=0):(n.push(i),hn(e[o+1])||(r.push(n.slice(0)),n.length=0))})}return t.paths}function rB(e,t){return e[t]}function Xd(e,t,r){return r=r||rB,nB(t.reduce(function n(i,o){return hn(i)?i.map(function(a){return n(a,o)}):i&&r(i,o)},e))}function nB(e){return fn(e)?hn(e)?e.map(nB):zE(Object.keys(e).sort(),function(t){return Xd(e,t)}):e}function _P(e){return e.args!==void 0?e.args:e.field?U0(e.field,e.variables):null}var Zue=function(){},lA=function(e,t){return t.fieldName},uA=function(e,t,r){var n=r.mergeObjects;return n(e,t)},cA=function(e,t){return t},ece=function(){function e(t){this.config=t,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=ve({dataIdFromObject:Q5},t),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),t.possibleTypes&&this.addPossibleTypes(t.possibleTypes),t.typePolicies&&this.addTypePolicies(t.typePolicies)}return e.prototype.identify=function(t,r){var n,i=this,o=r&&(r.typename||((n=r.storeObject)===null||n===void 0?void 0:n.__typename))||t.__typename;if(o===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var a=r&&r.storeObject||t,l=ve(ve({},r),{typename:o,storeObject:a,readField:r&&r.readField||function(){var m=qE(arguments,a);return i.readField(m,{store:i.cache.data,variables:m.variables})}}),c,d=o&&this.getTypePolicy(o),f=d&&d.keyFn||this.config.dataIdFromObject;f;){var p=f(ve(ve({},t),a),l);if(hn(p))f=aA(p);else{c=p;break}}return c=c?String(c):void 0,l.keyObject?[c,l.keyObject]:[c]},e.prototype.addTypePolicies=function(t){var r=this;Object.keys(t).forEach(function(n){var i=t[n],o=i.queryType,a=i.mutationType,l=i.subscriptionType,c=Ms(i,["queryType","mutationType","subscriptionType"]);o&&r.setRootTypename("Query",n),a&&r.setRootTypename("Mutation",n),l&&r.setRootTypename("Subscription",n),Fn.call(r.toBeAdded,n)?r.toBeAdded[n].push(c):r.toBeAdded[n]=[c]})},e.prototype.updateTypePolicy=function(t,r){var n=this,i=this.getTypePolicy(t),o=r.keyFields,a=r.fields;function l(c,d){c.merge=typeof d=="function"?d:d===!0?uA:d===!1?cA:c.merge}l(i,r.merge),i.keyFn=o===!1?Zue:hn(o)?aA(o):typeof o=="function"?o:i.keyFn,a&&Object.keys(a).forEach(function(c){var d=n.getFieldPolicy(t,c,!0),f=a[c];if(typeof f=="function")d.read=f;else{var p=f.keyArgs,m=f.read,g=f.merge;d.keyFn=p===!1?lA:hn(p)?sA(p):typeof p=="function"?p:d.keyFn,typeof m=="function"&&(d.read=m),l(d,g)}d.read&&d.merge&&(d.keyFn=d.keyFn||lA)})},e.prototype.setRootTypename=function(t,r){r===void 0&&(r=t);var n="ROOT_"+t.toUpperCase(),i=this.rootTypenamesById[n];r!==i&&(_t(!i||i===t,5,t),i&&delete this.rootIdsByTypename[i],this.rootIdsByTypename[r]=n,this.rootTypenamesById[n]=r)},e.prototype.addPossibleTypes=function(t){var r=this;this.usingPossibleTypes=!0,Object.keys(t).forEach(function(n){r.getSupertypeSet(n,!0),t[n].forEach(function(i){r.getSupertypeSet(i,!0).add(n);var o=i.match(J5);(!o||o[0]!==i)&&r.fuzzySubtypes.set(i,new RegExp(i))})})},e.prototype.getTypePolicy=function(t){var r=this;if(!Fn.call(this.typePolicies,t)){var n=this.typePolicies[t]=Object.create(null);n.fields=Object.create(null);var i=this.supertypeMap.get(t);!i&&this.fuzzySubtypes.size&&(i=this.getSupertypeSet(t,!0),this.fuzzySubtypes.forEach(function(a,l){if(a.test(t)){var c=r.supertypeMap.get(l);c&&c.forEach(function(d){return i.add(d)})}})),i&&i.size&&i.forEach(function(a){var l=r.getTypePolicy(a),c=l.fields,d=Ms(l,["fields"]);Object.assign(n,d),Object.assign(n.fields,c)})}var o=this.toBeAdded[t];return o&&o.length&&o.splice(0).forEach(function(a){r.updateTypePolicy(t,a)}),this.typePolicies[t]},e.prototype.getFieldPolicy=function(t,r,n){if(t){var i=this.getTypePolicy(t).fields;return i[r]||n&&(i[r]=Object.create(null))}},e.prototype.getSupertypeSet=function(t,r){var n=this.supertypeMap.get(t);return!n&&r&&this.supertypeMap.set(t,n=new Set),n},e.prototype.fragmentMatches=function(t,r,n,i){var o=this;if(!t.typeCondition)return!0;if(!r)return!1;var a=t.typeCondition.name.value;if(r===a)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(a))for(var l=this.getSupertypeSet(r,!0),c=[l],d=function(b){var y=o.getSupertypeSet(b,!1);y&&y.size&&c.indexOf(y)<0&&c.push(y)},f=!!(n&&this.fuzzySubtypes.size),p=!1,m=0;m<c.length;++m){var g=c[m];if(g.has(a))return l.has(a)||(p&&globalThis.__DEV__!==!1&&_t.warn(6,r,a),l.add(a)),!0;g.forEach(d),f&&m===c.length-1&&SP(t.selectionSet,n,i)&&(f=!1,p=!0,this.fuzzySubtypes.forEach(function(b,y){var w=r.match(b);w&&w[0]===r&&d(y)}))}return!1},e.prototype.hasKeyArgs=function(t,r){var n=this.getFieldPolicy(t,r,!1);return!!(n&&n.keyFn)},e.prototype.getStoreFieldName=function(t){var r=t.typename,n=t.fieldName,i=this.getFieldPolicy(r,n,!1),o,a=i&&i.keyFn;if(a&&r)for(var l={typename:r,fieldName:n,field:t.field||null,variables:t.variables},c=_P(t);a;){var d=a(c,l);if(hn(d))a=sA(d);else{o=d||n;break}}return o===void 0&&(o=t.field?yle(t.field,t.variables):w5(n,_P(t))),o===!1?n:n===Yl(o)?o:n+":"+o},e.prototype.readField=function(t,r){var n=t.from;if(n){var i=t.field||t.fieldName;if(i){if(t.typename===void 0){var o=r.store.getFieldValue(n,"__typename");o&&(t.typename=o)}var a=this.getStoreFieldName(t),l=Yl(a),c=r.store.getFieldValue(n,a),d=this.getFieldPolicy(t.typename,l,!1),f=d&&d.read;if(f){var p=dA(this,n,t,r,r.store.getStorage(wr(n)?n.__ref:n,a));return BE.withValue(this.cache,f,[c,p])}return c}}},e.prototype.getReadFunction=function(t,r){var n=this.getFieldPolicy(t,r,!1);return n&&n.read},e.prototype.getMergeFunction=function(t,r,n){var i=this.getFieldPolicy(t,r,!1),o=i&&i.merge;return!o&&n&&(i=this.getTypePolicy(n),o=i&&i.merge),o},e.prototype.runMergeFunction=function(t,r,n,i,o){var a=n.field,l=n.typename,c=n.merge;return c===uA?iB(i.store)(t,r):c===cA?r:(i.overwrite&&(t=void 0),c(t,r,dA(this,void 0,{typename:l,fieldName:a.name.value,field:a,variables:i.variables},i,o||Object.create(null))))},e}();function dA(e,t,r,n,i){var o=e.getStoreFieldName(r),a=Yl(o),l=r.variables||n.variables,c=n.store,d=c.toReference,f=c.canRead;return{args:_P(r),field:r.field||null,fieldName:a,storeFieldName:o,variables:l,isReference:wr,toReference:d,storage:i,cache:e.cache,canRead:f,readField:function(){return e.readField(qE(arguments,t,l),n)},mergeObjects:iB(n.store)}}function qE(e,t,r){var n=e[0],i=e[1],o=e.length,a;return typeof n=="string"?a={fieldName:n,from:o>1?i:t}:(a=ve({},n),Fn.call(a,"from")||(a.from=t)),globalThis.__DEV__!==!1&&a.from===void 0&&globalThis.__DEV__!==!1&&_t.warn(7,JL(Array.from(e))),a.variables===void 0&&(a.variables=r),a}function iB(e){return function(r,n){if(hn(r)||hn(n))throw Ei(8);if(fn(r)&&fn(n)){var i=e.getFieldValue(r,"__typename"),o=e.getFieldValue(n,"__typename"),a=i&&o&&i!==o;if(a)return n;if(wr(r)&&Bd(n))return e.merge(r.__ref,n),r;if(Bd(r)&&wr(n))return e.merge(r,n.__ref),n;if(Bd(r)&&Bd(n))return ve(ve({},r),n)}return n}}function h_(e,t,r){var n="".concat(t).concat(r),i=e.flavors.get(n);return i||e.flavors.set(n,i=e.clientOnly===t&&e.deferred===r?e:ve(ve({},e),{clientOnly:t,deferred:r})),i}var tce=function(){function e(t,r,n){this.cache=t,this.reader=r,this.fragments=n}return e.prototype.writeToStore=function(t,r){var n=this,i=r.query,o=r.result,a=r.dataId,l=r.variables,c=r.overwrite,d=Km(i),f=que();l=ve(ve({},OE(d)),l);var p=ve(ve({store:t,written:Object.create(null),merge:function(g,b){return f.merge(g,b)},variables:l,varString:Ml(l)},Z5(i,this.fragments)),{overwrite:!!c,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),m=this.processSelectionSet({result:o||Object.create(null),dataId:a,selectionSet:d.selectionSet,mergeTree:{map:new Map},context:p});if(!wr(m))throw Ei(11,o);return p.incomingById.forEach(function(g,b){var y=g.storeObject,w=g.mergeTree,_=g.fieldNodeSet,S=Qd(b);if(w&&w.map.size){var C=n.applyMerges(w,S,y,p);if(wr(C))return;y=C}if(globalThis.__DEV__!==!1&&!p.overwrite){var k=Object.create(null);_.forEach(function(T){T.selectionSet&&(k[T.name.value]=!0)});var E=function(T){return k[Yl(T)]===!0},R=function(T){var A=w&&w.map.get(T);return!!(A&&A.info&&A.info.merge)};Object.keys(y).forEach(function(T){E(T)&&!R(T)&&rce(S,y,T,p.store)})}t.merge(b,y)}),t.retain(m.__ref),m},e.prototype.processSelectionSet=function(t){var r=this,n=t.dataId,i=t.result,o=t.selectionSet,a=t.context,l=t.mergeTree,c=this.cache.policies,d=Object.create(null),f=n&&c.rootTypenamesById[n]||cP(i,o,a.fragmentMap)||n&&a.store.get(n,"__typename");typeof f=="string"&&(d.__typename=f);var p=function(){var C=qE(arguments,d,a.variables);if(wr(C.from)){var k=a.incomingById.get(C.from.__ref);if(k){var E=c.readField(ve(ve({},C),{from:k.storeObject}),a);if(E!==void 0)return E}}return c.readField(C,a)},m=new Set;this.flattenFields(o,i,a,f).forEach(function(C,k){var E,R=Wl(k),T=i[R];if(m.add(k),T!==void 0){var A=c.getStoreFieldName({typename:f,fieldName:k.name.value,field:k,variables:C.variables}),M=fA(l,A),B=r.processFieldValue(T,k,k.selectionSet?h_(C,!1,!1):C,M),Q=void 0;k.selectionSet&&(wr(B)||Bd(B))&&(Q=p("__typename",B));var se=c.getMergeFunction(f,k.name.value,Q);se?M.info={field:k,typename:f,merge:se}:hA(l,A),d=C.merge(d,(E={},E[A]=B,E))}else globalThis.__DEV__!==!1&&!C.clientOnly&&!C.deferred&&!AE.added(k)&&!c.getReadFunction(f,k.name.value)&&globalThis.__DEV__!==!1&&_t.error(12,Wl(k),i)});try{var g=c.identify(i,{typename:f,selectionSet:o,fragmentMap:a.fragmentMap,storeObject:d,readField:p}),b=g[0],y=g[1];n=n||b,y&&(d=a.merge(d,y))}catch(C){if(!n)throw C}if(typeof n=="string"){var w=Qd(n),_=a.written[n]||(a.written[n]=[]);if(_.indexOf(o)>=0||(_.push(o),this.reader&&this.reader.isFresh(i,w,o,a)))return w;var S=a.incomingById.get(n);return S?(S.storeObject=a.merge(S.storeObject,d),S.mergeTree=xP(S.mergeTree,l),m.forEach(function(C){return S.fieldNodeSet.add(C)})):a.incomingById.set(n,{storeObject:d,mergeTree:$b(l)?void 0:l,fieldNodeSet:m}),w}return d},e.prototype.processFieldValue=function(t,r,n,i){var o=this;return!r.selectionSet||t===null?globalThis.__DEV__!==!1?B5(t):t:hn(t)?t.map(function(a,l){var c=o.processFieldValue(a,r,n,fA(i,l));return hA(i,l),c}):this.processSelectionSet({result:t,selectionSet:r.selectionSet,context:n,mergeTree:i})},e.prototype.flattenFields=function(t,r,n,i){i===void 0&&(i=cP(r,t,n.fragmentMap));var o=new Map,a=this.cache.policies,l=new kf(!1);return function c(d,f){var p=l.lookup(d,f.clientOnly,f.deferred);p.visited||(p.visited=!0,d.selections.forEach(function(m){if(Hm(m,n.variables)){var g=f.clientOnly,b=f.deferred;if(!(g&&b)&&Za(m.directives)&&m.directives.forEach(function(_){var S=_.name.value;if(S==="client"&&(g=!0),S==="defer"){var C=U0(_,n.variables);(!C||C.if!==!1)&&(b=!0)}}),Kl(m)){var y=o.get(m);y&&(g=g&&y.clientOnly,b=b&&y.deferred),o.set(m,h_(n,g,b))}else{var w=q0(m,n.lookupFragment);if(!w&&m.kind===Je.FRAGMENT_SPREAD)throw Ei(13,m.name.value);w&&a.fragmentMatches(w,i,r,n.variables)&&c(w.selectionSet,h_(n,g,b))}}}))}(t,n),o},e.prototype.applyMerges=function(t,r,n,i,o){var a,l=this;if(t.map.size&&!wr(n)){var c=!hn(n)&&(wr(r)||Bd(r))?r:void 0,d=n;c&&!o&&(o=[wr(c)?c.__ref:c]);var f,p=function(m,g){return hn(m)?typeof g=="number"?m[g]:void 0:i.store.getFieldValue(m,String(g))};t.map.forEach(function(m,g){var b=p(c,g),y=p(d,g);if(y!==void 0){o&&o.push(g);var w=l.applyMerges(m,b,y,i,o);w!==y&&(f=f||new Map,f.set(g,w)),o&&_t(o.pop()===g)}}),f&&(n=hn(d)?d.slice(0):ve({},d),f.forEach(function(m,g){n[g]=m}))}return t.info?this.cache.policies.runMergeFunction(r,n,t.info,i,o&&(a=i.store).getStorage.apply(a,o)):n},e}(),oB=[];function fA(e,t){var r=e.map;return r.has(t)||r.set(t,oB.pop()||{map:new Map}),r.get(t)}function xP(e,t){if(e===t||!t||$b(t))return e;if(!e||$b(e))return t;var r=e.info&&t.info?ve(ve({},e.info),t.info):e.info||t.info,n=e.map.size&&t.map.size,i=n?new Map:e.map.size?e.map:t.map,o={info:r,map:i};if(n){var a=new Set(t.map.keys());e.map.forEach(function(l,c){o.map.set(c,xP(l,t.map.get(c))),a.delete(c)}),a.forEach(function(l){o.map.set(l,xP(t.map.get(l),e.map.get(l)))})}return o}function $b(e){return!e||!(e.info||e.map.size)}function hA(e,t){var r=e.map,n=r.get(t);n&&$b(n)&&(oB.push(n),r.delete(t))}var pA=new Set;function rce(e,t,r,n){var i=function(p){var m=n.getFieldValue(p,r);return typeof m=="object"&&m},o=i(e);if(o){var a=i(t);if(a&&!wr(o)&&!qr(o,a)&&!Object.keys(o).every(function(p){return n.getFieldValue(a,p)!==void 0})){var l=n.getFieldValue(e,"__typename")||n.getFieldValue(t,"__typename"),c=Yl(r),d="".concat(l,".").concat(c);if(!pA.has(d)){pA.add(d);var f=[];!hn(o)&&!hn(a)&&[o,a].forEach(function(p){var m=n.getFieldValue(p,"__typename");typeof m=="string"&&!f.includes(m)&&f.push(m)}),globalThis.__DEV__!==!1&&_t.warn(14,c,l,f.length?"either ensure all objects of type "+f.join(" and ")+" have an ID or a custom merge function, or ":"",d,ve({},o),ve({},a))}}}}var aB=function(e){ga(t,e);function t(r){r===void 0&&(r={});var n=e.call(this)||this;return n.watches=new Set,n.addTypenameTransform=new $5(AE),n.assumeImmutableResults=!0,n.makeVar=Xue,n.txCount=0,n.config=Vue(r),n.addTypename=!!n.config.addTypename,n.policies=new ece({cache:n,dataIdFromObject:n.config.dataIdFromObject,possibleTypes:n.config.possibleTypes,typePolicies:n.config.typePolicies}),n.init(),n}return t.prototype.init=function(){var r=this.data=new tm.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=r.stump,this.resetResultCache()},t.prototype.resetResultCache=function(r){var n=this,i=this.storeReader,o=this.config.fragments;this.storeWriter=new tce(this,this.storeReader=new Kue({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:X5(this.config),canon:r?void 0:i&&i.canon,fragments:o}),o),this.maybeBroadcastWatch=em(function(a,l){return n.broadcastWatch(a,l)},{max:this.config.resultCacheMaxSize||Bs["inMemoryCache.maybeBroadcastWatch"]||5e3,makeCacheKey:function(a){var l=a.optimistic?n.optimisticData:n.data;if(yp(l)){var c=a.optimistic,d=a.id,f=a.variables;return l.makeCacheKey(a.query,a.callback,Ml({optimistic:c,id:d,variables:f}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach(function(a){return a.resetCaching()})},t.prototype.restore=function(r){return this.init(),r&&this.data.replace(r),this},t.prototype.extract=function(r){return r===void 0&&(r=!1),(r?this.optimisticData:this.data).extract()},t.prototype.read=function(r){var n=r.returnPartialData,i=n===void 0?!1:n;try{return this.storeReader.diffQueryAgainstStore(ve(ve({},r),{store:r.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:i})).result||null}catch(o){if(o instanceof G5)return null;throw o}},t.prototype.write=function(r){try{return++this.txCount,this.storeWriter.writeToStore(this.data,r)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},t.prototype.modify=function(r){if(Fn.call(r,"id")&&!r.id)return!1;var n=r.optimistic?this.optimisticData:this.data;try{return++this.txCount,n.modify(r.id||"ROOT_QUERY",r.fields)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},t.prototype.diff=function(r){return this.storeReader.diffQueryAgainstStore(ve(ve({},r),{store:r.optimistic?this.optimisticData:this.data,rootId:r.id||"ROOT_QUERY",config:this.config}))},t.prototype.watch=function(r){var n=this;return this.watches.size||Yue(this),this.watches.add(r),r.immediate&&this.maybeBroadcastWatch(r),function(){n.watches.delete(r)&&!n.watches.size&&iA(n),n.maybeBroadcastWatch.forget(r)}},t.prototype.gc=function(r){var n;Ml.reset(),G0.reset(),this.addTypenameTransform.resetCache(),(n=this.config.fragments)===null||n===void 0||n.resetCaches();var i=this.optimisticData.gc();return r&&!this.txCount&&(r.resetResultCache?this.resetResultCache(r.resetResultIdentities):r.resetResultIdentities&&this.storeReader.resetCanon()),i},t.prototype.retain=function(r,n){return(n?this.optimisticData:this.data).retain(r)},t.prototype.release=function(r,n){return(n?this.optimisticData:this.data).release(r)},t.prototype.identify=function(r){if(wr(r))return r.__ref;try{return this.policies.identify(r)[0]}catch(n){globalThis.__DEV__!==!1&&_t.warn(n)}},t.prototype.evict=function(r){if(!r.id){if(Fn.call(r,"id"))return!1;r=ve(ve({},r),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(r,this.data)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},t.prototype.reset=function(r){var n=this;return this.init(),Ml.reset(),r&&r.discardWatches?(this.watches.forEach(function(i){return n.maybeBroadcastWatch.forget(i)}),this.watches.clear(),iA(this)):this.broadcastWatches(),Promise.resolve()},t.prototype.removeOptimistic=function(r){var n=this.optimisticData.removeLayer(r);n!==this.optimisticData&&(this.optimisticData=n,this.broadcastWatches())},t.prototype.batch=function(r){var n=this,i=r.update,o=r.optimistic,a=o===void 0?!0:o,l=r.removeOptimistic,c=r.onWatchUpdated,d,f=function(m){var g=n,b=g.data,y=g.optimisticData;++n.txCount,m&&(n.data=n.optimisticData=m);try{return d=i(n)}finally{--n.txCount,n.data=b,n.optimisticData=y}},p=new Set;return c&&!this.txCount&&this.broadcastWatches(ve(ve({},r),{onWatchUpdated:function(m){return p.add(m),!1}})),typeof a=="string"?this.optimisticData=this.optimisticData.addLayer(a,f):a===!1?f(this.data):f(),typeof l=="string"&&(this.optimisticData=this.optimisticData.removeLayer(l)),c&&p.size?(this.broadcastWatches(ve(ve({},r),{onWatchUpdated:function(m,g){var b=c.call(this,m,g);return b!==!1&&p.delete(m),b}})),p.size&&p.forEach(function(m){return n.maybeBroadcastWatch.dirty(m)})):this.broadcastWatches(r),d},t.prototype.performTransaction=function(r,n){return this.batch({update:r,optimistic:n||n!==null})},t.prototype.transformDocument=function(r){return this.addTypenameToDocument(this.addFragmentsToDocument(r))},t.prototype.broadcastWatches=function(r){var n=this;this.txCount||this.watches.forEach(function(i){return n.maybeBroadcastWatch(i,r)})},t.prototype.addFragmentsToDocument=function(r){var n=this.config.fragments;return n?n.transform(r):r},t.prototype.addTypenameToDocument=function(r){return this.addTypename?this.addTypenameTransform.transformDocument(r):r},t.prototype.broadcastWatch=function(r,n){var i=r.lastDiff,o=this.diff(r);n&&(r.optimistic&&typeof n.optimistic=="string"&&(o.fromOptimisticTransaction=!0),n.onWatchUpdated&&n.onWatchUpdated.call(this,r,o,i)===!1)||(!i||!qr(i.result,o.result))&&r.callback(r.lastDiff=o,i)},t}(K5);globalThis.__DEV__!==!1&&(aB.prototype.getMemoryInternals=ele);var Or;(function(e){e[e.loading=1]="loading",e[e.setVariables=2]="setVariables",e[e.fetchMore=3]="fetchMore",e[e.refetch=4]="refetch",e[e.poll=6]="poll",e[e.ready=7]="ready",e[e.error=8]="error"})(Or||(Or={}));function rm(e){return e?e<7:!1}var mA=Object.assign,nce=Object.hasOwnProperty,PP=function(e){ga(t,e);function t(r){var n=r.queryManager,i=r.queryInfo,o=r.options,a=e.call(this,function(w){try{var _=w._subscription._observer;_&&!_.error&&(_.error=ice)}catch{}var S=!a.observers.size;a.observers.add(w);var C=a.last;return C&&C.error?w.error&&w.error(C.error):C&&C.result&&w.next&&w.next(C.result),S&&a.reobserve().catch(function(){}),function(){a.observers.delete(w)&&!a.observers.size&&a.tearDownQuery()}})||this;a.observers=new Set,a.subscriptions=new Set,a.queryInfo=i,a.queryManager=n,a.waitForOwnResult=p_(o.fetchPolicy),a.isTornDown=!1;var l=n.defaultOptions.watchQuery,c=l===void 0?{}:l,d=c.fetchPolicy,f=d===void 0?"cache-first":d,p=o.fetchPolicy,m=p===void 0?f:p,g=o.initialFetchPolicy,b=g===void 0?m==="standby"?f:m:g;a.options=ve(ve({},o),{initialFetchPolicy:b,fetchPolicy:m}),a.queryId=i.queryId||n.generateQueryId();var y=Km(a.query);return a.queryName=y&&y.name&&y.name.value,a}return Object.defineProperty(t.prototype,"query",{get:function(){return this.lastQuery||this.options.query},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),t.prototype.result=function(){var r=this;return new Promise(function(n,i){var o={next:function(l){n(l),r.observers.delete(o),r.observers.size||r.queryManager.removeQuery(r.queryId),setTimeout(function(){a.unsubscribe()},0)},error:i},a=r.subscribe(o)})},t.prototype.resetDiff=function(){this.queryInfo.resetDiff()},t.prototype.getCurrentResult=function(r){r===void 0&&(r=!0);var n=this.getLastResult(!0),i=this.queryInfo.networkStatus||n&&n.networkStatus||Or.ready,o=ve(ve({},n),{loading:rm(i),networkStatus:i}),a=this.options.fetchPolicy,l=a===void 0?"cache-first":a;if(!(p_(l)||this.queryManager.getDocumentInfo(this.query).hasForcedResolvers))if(this.waitForOwnResult)this.queryInfo.updateWatch();else{var c=this.queryInfo.getDiff();(c.complete||this.options.returnPartialData)&&(o.data=c.result),qr(o.data,{})&&(o.data=void 0),c.complete?(delete o.partial,c.complete&&o.networkStatus===Or.loading&&(l==="cache-first"||l==="cache-only")&&(o.networkStatus=Or.ready,o.loading=!1)):o.partial=!0,globalThis.__DEV__!==!1&&!c.complete&&!this.options.partialRefetch&&!o.loading&&!o.data&&!o.error&&lB(c.missing)}return r&&this.updateLastResult(o),o},t.prototype.isDifferentFromLastResult=function(r,n){if(!this.last)return!0;var i=this.queryManager.getDocumentInfo(this.query).hasNonreactiveDirective?!W5(this.query,this.last.result,r,this.variables):!qr(this.last.result,r);return i||n&&!qr(this.last.variables,n)},t.prototype.getLast=function(r,n){var i=this.last;if(i&&i[r]&&(!n||qr(i.variables,this.variables)))return i[r]},t.prototype.getLastResult=function(r){return this.getLast("result",r)},t.prototype.getLastError=function(r){return this.getLast("error",r)},t.prototype.resetLastResults=function(){delete this.last,this.isTornDown=!1},t.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},t.prototype.refetch=function(r){var n,i={pollInterval:0},o=this.options.fetchPolicy;if(o==="cache-and-network"?i.fetchPolicy=o:o==="no-cache"?i.fetchPolicy="no-cache":i.fetchPolicy="network-only",globalThis.__DEV__!==!1&&r&&nce.call(r,"variables")){var a=S5(this.query),l=a.variableDefinitions;(!l||!l.some(function(c){return c.variable.name.value==="variables"}))&&globalThis.__DEV__!==!1&&_t.warn(20,r,((n=a.name)===null||n===void 0?void 0:n.value)||a)}return r&&!qr(this.options.variables,r)&&(i.variables=this.options.variables=ve(ve({},this.options.variables),r)),this.queryInfo.resetLastWrite(),this.reobserve(i,Or.refetch)},t.prototype.fetchMore=function(r){var n=this,i=ve(ve({},r.query?r:ve(ve(ve(ve({},this.options),{query:this.options.query}),r),{variables:ve(ve({},this.options.variables),r.variables)})),{fetchPolicy:"no-cache"});i.query=this.transformDocument(i.query);var o=this.queryManager.generateQueryId();this.lastQuery=r.query?this.transformDocument(this.options.query):i.query;var a=this.queryInfo,l=a.networkStatus;a.networkStatus=Or.fetchMore,i.notifyOnNetworkStatusChange&&this.observe();var c=new Set;return this.queryManager.fetchQuery(o,i,Or.fetchMore).then(function(d){return n.queryManager.removeQuery(o),a.networkStatus===Or.fetchMore&&(a.networkStatus=l),n.queryManager.cache.batch({update:function(f){var p=r.updateQuery;p?f.updateQuery({query:n.query,variables:n.variables,returnPartialData:!0,optimistic:!1},function(m){return p(m,{fetchMoreResult:d.data,variables:i.variables})}):f.writeQuery({query:i.query,variables:i.variables,data:d.data})},onWatchUpdated:function(f){c.add(f.query)}}),d}).finally(function(){c.has(n.query)||sB(n)})},t.prototype.subscribeToMore=function(r){var n=this,i=this.queryManager.startGraphQLSubscription({query:r.document,variables:r.variables,context:r.context}).subscribe({next:function(o){var a=r.updateQuery;a&&n.updateQuery(function(l,c){var d=c.variables;return a(l,{subscriptionData:o,variables:d})})},error:function(o){if(r.onError){r.onError(o);return}globalThis.__DEV__!==!1&&_t.error(21,o)}});return this.subscriptions.add(i),function(){n.subscriptions.delete(i)&&i.unsubscribe()}},t.prototype.setOptions=function(r){return this.reobserve(r)},t.prototype.silentSetOptions=function(r){var n=gf(this.options,r||{});mA(this.options,n)},t.prototype.setVariables=function(r){return qr(this.variables,r)?this.observers.size?this.result():Promise.resolve():(this.options.variables=r,this.observers.size?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:r},Or.setVariables):Promise.resolve())},t.prototype.updateQuery=function(r){var n=this.queryManager,i=n.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}).result,o=r(i,{variables:this.variables});o&&(n.cache.writeQuery({query:this.options.query,data:o,variables:this.variables}),n.broadcastQueries())},t.prototype.startPolling=function(r){this.options.pollInterval=r,this.updatePolling()},t.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},t.prototype.applyNextFetchPolicy=function(r,n){if(n.nextFetchPolicy){var i=n.fetchPolicy,o=i===void 0?"cache-first":i,a=n.initialFetchPolicy,l=a===void 0?o:a;o==="standby"||(typeof n.nextFetchPolicy=="function"?n.fetchPolicy=n.nextFetchPolicy(o,{reason:r,options:n,observable:this,initialFetchPolicy:l}):r==="variables-changed"?n.fetchPolicy=l:n.fetchPolicy=n.nextFetchPolicy)}return n.fetchPolicy},t.prototype.fetch=function(r,n,i){return this.queryManager.setObservableQuery(this),this.queryManager.fetchConcastWithInfo(this.queryId,r,n,i)},t.prototype.updatePolling=function(){var r=this;if(!this.queryManager.ssrMode){var n=this,i=n.pollingInfo,o=n.options.pollInterval;if(!o||!this.hasObservers()){i&&(clearTimeout(i.timeout),delete this.pollingInfo);return}if(!(i&&i.interval===o)){_t(o,22);var a=i||(this.pollingInfo={});a.interval=o;var l=function(){var d,f;r.pollingInfo&&(!rm(r.queryInfo.networkStatus)&&!(!((f=(d=r.options).skipPollAttempt)===null||f===void 0)&&f.call(d))?r.reobserve({fetchPolicy:r.options.initialFetchPolicy==="no-cache"?"no-cache":"network-only"},Or.poll).then(c,c):c())},c=function(){var d=r.pollingInfo;d&&(clearTimeout(d.timeout),d.timeout=setTimeout(l,d.interval))};c()}}},t.prototype.updateLastResult=function(r,n){n===void 0&&(n=this.variables);var i=this.getLastError();return i&&this.last&&!qr(n,this.last.variables)&&(i=void 0),this.last=ve({result:this.queryManager.assumeImmutableResults?r:B5(r),variables:n},i?{error:i}:null)},t.prototype.reobserveAsConcast=function(r,n){var i=this;this.isTornDown=!1;var o=n===Or.refetch||n===Or.fetchMore||n===Or.poll,a=this.options.variables,l=this.options.fetchPolicy,c=gf(this.options,r||{}),d=o?c:mA(this.options,c),f=this.transformDocument(d.query);this.lastQuery=f,o||(this.updatePolling(),r&&r.variables&&!qr(r.variables,a)&&d.fetchPolicy!=="standby"&&d.fetchPolicy===l&&(this.applyNextFetchPolicy("variables-changed",d),n===void 0&&(n=Or.setVariables))),this.waitForOwnResult&&(this.waitForOwnResult=p_(d.fetchPolicy));var p=function(){i.concast===b&&(i.waitForOwnResult=!1)},m=d.variables&&ve({},d.variables),g=this.fetch(d,n,f),b=g.concast,y=g.fromLink,w={next:function(_){qr(i.variables,m)&&(p(),i.reportResult(_,m))},error:function(_){qr(i.variables,m)&&(p(),i.reportError(_,m))}};return!o&&(y||!this.concast)&&(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=b,this.observer=w),b.addObserver(w),b},t.prototype.reobserve=function(r,n){return this.reobserveAsConcast(r,n).promise},t.prototype.resubscribeAfterError=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=this.last;this.resetLastResults();var o=this.subscribe.apply(this,r);return this.last=i,o},t.prototype.observe=function(){this.reportResult(this.getCurrentResult(!1),this.variables)},t.prototype.reportResult=function(r,n){var i=this.getLastError(),o=this.isDifferentFromLastResult(r,n);(i||!r.partial||this.options.returnPartialData)&&this.updateLastResult(r,n),(i||o)&&gp(this.observers,"next",r)},t.prototype.reportError=function(r,n){var i=ve(ve({},this.getLastResult()),{error:r,errors:r.graphQLErrors,networkStatus:Or.error,loading:!1});this.updateLastResult(i,n),gp(this.observers,"error",this.last.error=r)},t.prototype.hasObservers=function(){return this.observers.size>0},t.prototype.tearDownQuery=function(){this.isTornDown||(this.concast&&this.observer&&(this.concast.removeObserver(this.observer),delete this.concast,delete this.observer),this.stopPolling(),this.subscriptions.forEach(function(r){return r.unsubscribe()}),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},t.prototype.transformDocument=function(r){return this.queryManager.transform(r)},t}(Rr);V5(PP);function sB(e){var t=e.options,r=t.fetchPolicy,n=t.nextFetchPolicy;return r==="cache-and-network"||r==="network-only"?e.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(i,o){return this.nextFetchPolicy=n,typeof this.nextFetchPolicy=="function"?this.nextFetchPolicy(i,o):r}}):e.reobserve()}function ice(e){globalThis.__DEV__!==!1&&_t.error(23,e.message,e.stack)}function lB(e){globalThis.__DEV__!==!1&&e&&globalThis.__DEV__!==!1&&_t.debug(24,e)}function p_(e){return e==="network-only"||e==="no-cache"||e==="standby"}var uB=function(){function e(t){var r=t.cache,n=t.client,i=t.resolvers,o=t.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=r,n&&(this.client=n),i&&this.addResolvers(i),o&&this.setFragmentMatcher(o)}return e.prototype.addResolvers=function(t){var r=this;this.resolvers=this.resolvers||{},Array.isArray(t)?t.forEach(function(n){r.resolvers=F$(r.resolvers,n)}):this.resolvers=F$(this.resolvers,t)},e.prototype.setResolvers=function(t){this.resolvers={},this.addResolvers(t)},e.prototype.getResolvers=function(){return this.resolvers||{}},e.prototype.runResolvers=function(t){return Cl(this,arguments,void 0,function(r){var n=r.document,i=r.remoteResult,o=r.context,a=r.variables,l=r.onlyRunForcedResolvers,c=l===void 0?!1:l;return El(this,function(d){return n?[2,this.resolveDocument(n,i.data,o,a,this.fragmentMatcher,c).then(function(f){return ve(ve({},i),{data:f.result})})]:[2,i]})})},e.prototype.setFragmentMatcher=function(t){this.fragmentMatcher=t},e.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},e.prototype.clientQuery=function(t){return Jp(["client"],t)&&this.resolvers?t:null},e.prototype.serverQuery=function(t){return M5(t)},e.prototype.prepareContext=function(t){var r=this.cache;return ve(ve({},t),{cache:r,getCacheKey:function(n){return r.identify(n)}})},e.prototype.addExportedVariables=function(t){return Cl(this,arguments,void 0,function(r,n,i){return n===void 0&&(n={}),i===void 0&&(i={}),El(this,function(o){return r?[2,this.resolveDocument(r,this.buildRootValueFromCache(r,n)||{},this.prepareContext(i),n).then(function(a){return ve(ve({},n),a.exportedVariables)})]:[2,ve({},n)]})})},e.prototype.shouldForceResolvers=function(t){var r=!1;return Ls(t,{Directive:{enter:function(n){if(n.name.value==="client"&&n.arguments&&(r=n.arguments.some(function(i){return i.name.value==="always"&&i.value.kind==="BooleanValue"&&i.value.value===!0}),r))return EE}}}),r},e.prototype.buildRootValueFromCache=function(t,r){return this.cache.diff({query:Ble(t),variables:r,returnPartialData:!0,optimistic:!1}).result},e.prototype.resolveDocument=function(t,r){return Cl(this,arguments,void 0,function(n,i,o,a,l,c){var d,f,p,m,g,b,y,w,_,S,C;return o===void 0&&(o={}),a===void 0&&(a={}),l===void 0&&(l=function(){return!0}),c===void 0&&(c=!1),El(this,function(k){return d=Gm(n),f=H0(n),p=z0(f),m=this.collectSelectionsToResolve(d,p),g=d.operation,b=g?g.charAt(0).toUpperCase()+g.slice(1):"Query",y=this,w=y.cache,_=y.client,S={fragmentMap:p,context:ve(ve({},o),{cache:w,client:_}),variables:a,fragmentMatcher:l,defaultOperationType:b,exportedVariables:{},selectionsToResolve:m,onlyRunForcedResolvers:c},C=!1,[2,this.resolveSelectionSet(d.selectionSet,C,i,S).then(function(E){return{result:E,exportedVariables:S.exportedVariables}})]})})},e.prototype.resolveSelectionSet=function(t,r,n,i){return Cl(this,void 0,void 0,function(){var o,a,l,c,d,f=this;return El(this,function(p){return o=i.fragmentMap,a=i.context,l=i.variables,c=[n],d=function(m){return Cl(f,void 0,void 0,function(){var g,b;return El(this,function(y){return!r&&!i.selectionsToResolve.has(m)?[2]:Hm(m,l)?Kl(m)?[2,this.resolveField(m,r,n,i).then(function(w){var _;typeof w<"u"&&c.push((_={},_[Wl(m)]=w,_))})]:(wle(m)?g=m:(g=o[m.name.value],_t(g,18,m.name.value)),g&&g.typeCondition&&(b=g.typeCondition.name.value,i.fragmentMatcher(n,b,a))?[2,this.resolveSelectionSet(g.selectionSet,r,n,i).then(function(w){c.push(w)})]:[2]):[2]})})},[2,Promise.all(t.selections.map(d)).then(function(){return Q0(c)})]})})},e.prototype.resolveField=function(t,r,n,i){return Cl(this,void 0,void 0,function(){var o,a,l,c,d,f,p,m,g,b=this;return El(this,function(y){return n?(o=i.variables,a=t.name.value,l=Wl(t),c=a!==l,d=n[l]||n[a],f=Promise.resolve(d),(!i.onlyRunForcedResolvers||this.shouldForceResolvers(t))&&(p=n.__typename||i.defaultOperationType,m=this.resolvers&&this.resolvers[p],m&&(g=m[c?a:l],g&&(f=Promise.resolve(BE.withValue(this.cache,g,[n,U0(t,o),i.context,{field:t,fragmentMap:i.fragmentMap}]))))),[2,f.then(function(w){var _,S;if(w===void 0&&(w=d),t.directives&&t.directives.forEach(function(k){k.name.value==="export"&&k.arguments&&k.arguments.forEach(function(E){E.name.value==="as"&&E.value.kind==="StringValue"&&(i.exportedVariables[E.value.value]=w)})}),!t.selectionSet||w==null)return w;var C=(S=(_=t.directives)===null||_===void 0?void 0:_.some(function(k){return k.name.value==="client"}))!==null&&S!==void 0?S:!1;if(Array.isArray(w))return b.resolveSubSelectedArray(t,r||C,w,i);if(t.selectionSet)return b.resolveSelectionSet(t.selectionSet,r||C,w,i)})]):[2,null]})})},e.prototype.resolveSubSelectedArray=function(t,r,n,i){var o=this;return Promise.all(n.map(function(a){if(a===null)return null;if(Array.isArray(a))return o.resolveSubSelectedArray(t,r,a,i);if(t.selectionSet)return o.resolveSelectionSet(t.selectionSet,r,a,i)}))},e.prototype.collectSelectionsToResolve=function(t,r){var n=function(a){return!Array.isArray(a)},i=this.selectionsToResolveCache;function o(a){if(!i.has(a)){var l=new Set;i.set(a,l),Ls(a,{Directive:function(c,d,f,p,m){c.name.value==="client"&&m.forEach(function(g){n(g)&&O$(g)&&l.add(g)})},FragmentSpread:function(c,d,f,p,m){var g=r[c.name.value];_t(g,19,c.name.value);var b=o(g);b.size>0&&(m.forEach(function(y){n(y)&&O$(y)&&l.add(y)}),l.add(c),b.forEach(function(y){l.add(y)}))}})}return i.get(a)}return o(t)},e}(),Vd=new(jf?WeakMap:Map);function m_(e,t){var r=e[t];typeof r=="function"&&(e[t]=function(){return Vd.set(e,(Vd.get(e)+1)%1e15),r.apply(this,arguments)})}function vA(e){e.notifyTimeout&&(clearTimeout(e.notifyTimeout),e.notifyTimeout=void 0)}var v_=function(){function e(t,r){r===void 0&&(r=t.generateQueryId()),this.queryId=r,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var n=this.cache=t.cache;Vd.has(n)||(Vd.set(n,0),m_(n,"evict"),m_(n,"modify"),m_(n,"reset"))}return e.prototype.init=function(t){var r=t.networkStatus||Or.loading;return this.variables&&this.networkStatus!==Or.loading&&!qr(this.variables,t.variables)&&(r=Or.setVariables),qr(t.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:t.document,variables:t.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:r}),t.observableQuery&&this.setObservableQuery(t.observableQuery),t.lastRequestId&&(this.lastRequestId=t.lastRequestId),this},e.prototype.reset=function(){vA(this),this.dirty=!1},e.prototype.resetDiff=function(){this.lastDiff=void 0},e.prototype.getDiff=function(){var t=this.getDiffOptions();if(this.lastDiff&&qr(t,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables);var r=this.observableQuery;if(r&&r.options.fetchPolicy==="no-cache")return{complete:!1};var n=this.cache.diff(t);return this.updateLastDiff(n,t),n},e.prototype.updateLastDiff=function(t,r){this.lastDiff=t?{diff:t,options:r||this.getDiffOptions()}:void 0},e.prototype.getDiffOptions=function(t){var r;return t===void 0&&(t=this.variables),{query:this.document,variables:t,returnPartialData:!0,optimistic:!0,canonizeResults:(r=this.observableQuery)===null||r===void 0?void 0:r.options.canonizeResults}},e.prototype.setDiff=function(t){var r=this,n,i=this.lastDiff&&this.lastDiff.diff;t&&!t.complete&&(!((n=this.observableQuery)===null||n===void 0)&&n.getLastError())||(this.updateLastDiff(t),!this.dirty&&!qr(i&&i.result,t&&t.result)&&(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(function(){return r.notify()},0))))},e.prototype.setObservableQuery=function(t){var r=this;t!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=t,t?(t.queryInfo=this,this.listeners.add(this.oqListener=function(){var n=r.getDiff();n.fromOptimisticTransaction?t.observe():sB(t)})):delete this.oqListener)},e.prototype.notify=function(){var t=this;vA(this),this.shouldNotify()&&this.listeners.forEach(function(r){return r(t)}),this.dirty=!1},e.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(rm(this.networkStatus)&&this.observableQuery){var t=this.observableQuery.options.fetchPolicy;if(t!=="cache-only"&&t!=="cache-and-network")return!1}return!0},e.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=e.prototype.cancel;var t=this.observableQuery;t&&t.stopPolling()}},e.prototype.cancel=function(){},e.prototype.updateWatch=function(t){var r=this;t===void 0&&(t=this.variables);var n=this.observableQuery;if(!(n&&n.options.fetchPolicy==="no-cache")){var i=ve(ve({},this.getDiffOptions(t)),{watcher:this,callback:function(o){return r.setDiff(o)}});(!this.lastWatch||!qr(i,this.lastWatch))&&(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=i))}},e.prototype.resetLastWrite=function(){this.lastWrite=void 0},e.prototype.shouldWrite=function(t,r){var n=this.lastWrite;return!(n&&n.dmCount===Vd.get(this.cache)&&qr(r,n.variables)&&qr(t.data,n.result.data))},e.prototype.markResult=function(t,r,n,i){var o=this,a=new Ql,l=Za(t.errors)?t.errors.slice(0):[];if(this.reset(),"incremental"in t&&Za(t.incremental)){var c=z5(this.getDiff().result,t);t.data=c}else if("hasNext"in t&&t.hasNext){var d=this.getDiff();t.data=a.merge(d.result,t.data)}this.graphQLErrors=l,n.fetchPolicy==="no-cache"?this.updateLastDiff({result:t.data,complete:!0},this.getDiffOptions(n.variables)):i!==0&&(CP(t,n.errorPolicy)?this.cache.performTransaction(function(f){if(o.shouldWrite(t,n.variables))f.writeQuery({query:r,data:t.data,variables:n.variables,overwrite:i===1}),o.lastWrite={result:t,variables:n.variables,dmCount:Vd.get(o.cache)};else if(o.lastDiff&&o.lastDiff.diff.complete){t.data=o.lastDiff.diff.result;return}var p=o.getDiffOptions(n.variables),m=f.diff(p);!o.stopped&&qr(o.variables,n.variables)&&o.updateWatch(n.variables),o.updateLastDiff(m,p),m.complete&&(t.data=m.result)}):this.lastWrite=void 0)},e.prototype.markReady=function(){return this.networkError=null,this.networkStatus=Or.ready},e.prototype.markError=function(t){return this.networkStatus=Or.error,this.lastWrite=void 0,this.reset(),t.graphQLErrors&&(this.graphQLErrors=t.graphQLErrors),t.networkError&&(this.networkError=t.networkError),t},e}();function CP(e,t){t===void 0&&(t="none");var r=t==="ignore"||t==="all",n=!Xy(e);return!n&&r&&e.data&&(n=!0),n}var oce=Object.prototype.hasOwnProperty,gA=Object.create(null),ace=function(){function e(t){var r=t.cache,n=t.link,i=t.defaultOptions,o=t.documentTransform,a=t.queryDeduplication,l=a===void 0?!1:a,c=t.onBroadcast,d=t.ssrMode,f=d===void 0?!1:d,p=t.clientAwareness,m=p===void 0?{}:p,g=t.localState,b=t.assumeImmutableResults,y=b===void 0?!!r.assumeImmutableResults:b,w=t.defaultContext,_=this;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new m5(Bs["queryManager.getDocumentInfo"]||2e3),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new kf(!1);var S=new $5(function(C){return _.cache.transformDocument(C)},{cache:!1});this.cache=r,this.link=n,this.defaultOptions=i||Object.create(null),this.queryDeduplication=l,this.clientAwareness=m,this.localState=g||new uB({cache:r}),this.ssrMode=f,this.assumeImmutableResults=y,this.documentTransform=o?S.concat(o).concat(S):S,this.defaultContext=w||Object.create(null),(this.onBroadcast=c)&&(this.mutationStore=Object.create(null))}return e.prototype.stop=function(){var t=this;this.queries.forEach(function(r,n){t.stopQueryNoBroadcast(n)}),this.cancelPendingFetches(Ei(25))},e.prototype.cancelPendingFetches=function(t){this.fetchCancelFns.forEach(function(r){return r(t)}),this.fetchCancelFns.clear()},e.prototype.mutate=function(t){return Cl(this,arguments,void 0,function(r){var n,i,o,a,l,c,d,f=r.mutation,p=r.variables,m=r.optimisticResponse,g=r.updateQueries,b=r.refetchQueries,y=b===void 0?[]:b,w=r.awaitRefetchQueries,_=w===void 0?!1:w,S=r.update,C=r.onQueryUpdated,k=r.fetchPolicy,E=k===void 0?((c=this.defaultOptions.mutate)===null||c===void 0?void 0:c.fetchPolicy)||"network-only":k,R=r.errorPolicy,T=R===void 0?((d=this.defaultOptions.mutate)===null||d===void 0?void 0:d.errorPolicy)||"none":R,A=r.keepRootFields,M=r.context;return El(this,function(B){switch(B.label){case 0:return _t(f,26),_t(E==="network-only"||E==="no-cache",27),n=this.generateMutationId(),f=this.cache.transformForLink(this.transform(f)),i=this.getDocumentInfo(f).hasClientExports,p=this.getVariables(f,p),i?[4,this.localState.addExportedVariables(f,p,M)]:[3,2];case 1:p=B.sent(),B.label=2;case 2:return o=this.mutationStore&&(this.mutationStore[n]={mutation:f,variables:p,loading:!0,error:null}),a=m&&this.markMutationOptimistic(m,{mutationId:n,document:f,variables:p,fetchPolicy:E,errorPolicy:T,context:M,updateQueries:g,update:S,keepRootFields:A}),this.broadcastQueries(),l=this,[2,new Promise(function(Q,se){return l_(l.getObservableFromLink(f,ve(ve({},M),{optimisticResponse:a?m:void 0}),p,!1),function(ie){if(Xy(ie)&&T==="none")throw new fd({graphQLErrors:vP(ie)});o&&(o.loading=!1,o.error=null);var N=ve({},ie);return typeof y=="function"&&(y=y(N)),T==="ignore"&&Xy(N)&&delete N.errors,l.markMutationResult({mutationId:n,result:N,document:f,variables:p,fetchPolicy:E,errorPolicy:T,context:M,update:S,updateQueries:g,awaitRefetchQueries:_,refetchQueries:y,removeOptimistic:a?n:void 0,onQueryUpdated:C,keepRootFields:A})}).subscribe({next:function(ie){l.broadcastQueries(),(!("hasNext"in ie)||ie.hasNext===!1)&&Q(ie)},error:function(ie){o&&(o.loading=!1,o.error=ie),a&&l.cache.removeOptimistic(n),l.broadcastQueries(),se(ie instanceof fd?ie:new fd({networkError:ie}))}})})]}})})},e.prototype.markMutationResult=function(t,r){var n=this;r===void 0&&(r=this.cache);var i=t.result,o=[],a=t.fetchPolicy==="no-cache";if(!a&&CP(i,t.errorPolicy)){if(Yd(i)||o.push({result:i.data,dataId:"ROOT_MUTATION",query:t.document,variables:t.variables}),Yd(i)&&Za(i.incremental)){var l=r.diff({id:"ROOT_MUTATION",query:this.getDocumentInfo(t.document).asQuery,variables:t.variables,optimistic:!1,returnPartialData:!0}),c=void 0;l.result&&(c=z5(l.result,i)),typeof c<"u"&&(i.data=c,o.push({result:c,dataId:"ROOT_MUTATION",query:t.document,variables:t.variables}))}var d=t.updateQueries;d&&this.queries.forEach(function(p,m){var g=p.observableQuery,b=g&&g.queryName;if(!(!b||!oce.call(d,b))){var y=d[b],w=n.queries.get(m),_=w.document,S=w.variables,C=r.diff({query:_,variables:S,returnPartialData:!0,optimistic:!1}),k=C.result,E=C.complete;if(E&&k){var R=y(k,{mutationResult:i,queryName:_&&dP(_)||void 0,queryVariables:S});R&&o.push({result:R,dataId:"ROOT_QUERY",query:_,variables:S})}}})}if(o.length>0||(t.refetchQueries||"").length>0||t.update||t.onQueryUpdated||t.removeOptimistic){var f=[];if(this.refetchQueries({updateCache:function(p){a||o.forEach(function(y){return p.write(y)});var m=t.update,g=!tue(i)||Yd(i)&&!i.hasNext;if(m){if(!a){var b=p.diff({id:"ROOT_MUTATION",query:n.getDocumentInfo(t.document).asQuery,variables:t.variables,optimistic:!1,returnPartialData:!0});b.complete&&(i=ve(ve({},i),{data:b.result}),"incremental"in i&&delete i.incremental,"hasNext"in i&&delete i.hasNext)}g&&m(p,i,{context:t.context,variables:t.variables})}!a&&!t.keepRootFields&&g&&p.modify({id:"ROOT_MUTATION",fields:function(y,w){var _=w.fieldName,S=w.DELETE;return _==="__typename"?y:S}})},include:t.refetchQueries,optimistic:!1,removeOptimistic:t.removeOptimistic,onQueryUpdated:t.onQueryUpdated||null}).forEach(function(p){return f.push(p)}),t.awaitRefetchQueries||t.onQueryUpdated)return Promise.all(f).then(function(){return i})}return Promise.resolve(i)},e.prototype.markMutationOptimistic=function(t,r){var n=this,i=typeof t=="function"?t(r.variables,{IGNORE:gA}):t;return i===gA?!1:(this.cache.recordOptimisticTransaction(function(o){try{n.markMutationResult(ve(ve({},r),{result:{data:i}}),o)}catch(a){globalThis.__DEV__!==!1&&_t.error(a)}},r.mutationId),!0)},e.prototype.fetchQuery=function(t,r,n){return this.fetchConcastWithInfo(t,r,n).concast.promise},e.prototype.getQueryStore=function(){var t=Object.create(null);return this.queries.forEach(function(r,n){t[n]={variables:r.variables,networkStatus:r.networkStatus,networkError:r.networkError,graphQLErrors:r.graphQLErrors}}),t},e.prototype.resetErrors=function(t){var r=this.queries.get(t);r&&(r.networkError=void 0,r.graphQLErrors=[])},e.prototype.transform=function(t){return this.documentTransform.transformDocument(t)},e.prototype.getDocumentInfo=function(t){var r=this.transformCache;if(!r.has(t)){var n={hasClientExports:Nse(t),hasForcedResolvers:this.localState.shouldForceResolvers(t),hasNonreactiveDirective:Jp(["nonreactive"],t),clientQuery:this.localState.clientQuery(t),serverQuery:D5([{name:"client",remove:!0},{name:"connection"},{name:"nonreactive"}],t),defaultVars:OE(Km(t)),asQuery:ve(ve({},t),{definitions:t.definitions.map(function(i){return i.kind==="OperationDefinition"&&i.operation!=="query"?ve(ve({},i),{operation:"query"}):i})})};r.set(t,n)}return r.get(t)},e.prototype.getVariables=function(t,r){return ve(ve({},this.getDocumentInfo(t).defaultVars),r)},e.prototype.watchQuery=function(t){var r=this.transform(t.query);t=ve(ve({},t),{variables:this.getVariables(r,t.variables)}),typeof t.notifyOnNetworkStatusChange>"u"&&(t.notifyOnNetworkStatusChange=!1);var n=new v_(this),i=new PP({queryManager:this,queryInfo:n,options:t});return i.lastQuery=r,this.queries.set(i.queryId,n),n.init({document:r,observableQuery:i,variables:i.variables}),i},e.prototype.query=function(t,r){var n=this;return r===void 0&&(r=this.generateQueryId()),_t(t.query,28),_t(t.query.kind==="Document",29),_t(!t.returnPartialData,30),_t(!t.pollInterval,31),this.fetchQuery(r,ve(ve({},t),{query:this.transform(t.query)})).finally(function(){return n.stopQuery(r)})},e.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},e.prototype.generateRequestId=function(){return this.requestIdCounter++},e.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},e.prototype.stopQueryInStore=function(t){this.stopQueryInStoreNoBroadcast(t),this.broadcastQueries()},e.prototype.stopQueryInStoreNoBroadcast=function(t){var r=this.queries.get(t);r&&r.stop()},e.prototype.clearStore=function(t){return t===void 0&&(t={discardWatches:!0}),this.cancelPendingFetches(Ei(32)),this.queries.forEach(function(r){r.observableQuery?r.networkStatus=Or.loading:r.stop()}),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(t)},e.prototype.getObservableQueries=function(t){var r=this;t===void 0&&(t="active");var n=new Map,i=new Map,o=new Set;return Array.isArray(t)&&t.forEach(function(a){typeof a=="string"?i.set(a,!1):lle(a)?i.set(r.transform(a),!1):fn(a)&&a.query&&o.add(a)}),this.queries.forEach(function(a,l){var c=a.observableQuery,d=a.document;if(c){if(t==="all"){n.set(l,c);return}var f=c.queryName,p=c.options.fetchPolicy;if(p==="standby"||t==="active"&&!c.hasObservers())return;(t==="active"||f&&i.has(f)||d&&i.has(d))&&(n.set(l,c),f&&i.set(f,!0),d&&i.set(d,!0))}}),o.size&&o.forEach(function(a){var l=rP("legacyOneTimeQuery"),c=r.getQuery(l).init({document:a.query,variables:a.variables}),d=new PP({queryManager:r,queryInfo:c,options:ve(ve({},a),{fetchPolicy:"network-only"})});_t(d.queryId===l),c.setObservableQuery(d),n.set(l,d)}),globalThis.__DEV__!==!1&&i.size&&i.forEach(function(a,l){a||globalThis.__DEV__!==!1&&_t.warn(typeof l=="string"?33:34,l)}),n},e.prototype.reFetchObservableQueries=function(t){var r=this;t===void 0&&(t=!1);var n=[];return this.getObservableQueries(t?"all":"active").forEach(function(i,o){var a=i.options.fetchPolicy;i.resetLastResults(),(t||a!=="standby"&&a!=="cache-only")&&n.push(i.refetch()),r.getQuery(o).setDiff(null)}),this.broadcastQueries(),Promise.all(n)},e.prototype.setObservableQuery=function(t){this.getQuery(t.queryId).setObservableQuery(t)},e.prototype.startGraphQLSubscription=function(t){var r=this,n=t.query,i=t.fetchPolicy,o=t.errorPolicy,a=o===void 0?"none":o,l=t.variables,c=t.context,d=c===void 0?{}:c;n=this.transform(n),l=this.getVariables(n,l);var f=function(m){return r.getObservableFromLink(n,d,m).map(function(g){i!=="no-cache"&&(CP(g,a)&&r.cache.write({query:n,result:g.data,dataId:"ROOT_SUBSCRIPTION",variables:m}),r.broadcastQueries());var b=Xy(g),y=yue(g);if(b||y){var w={};if(b&&(w.graphQLErrors=g.errors),y&&(w.protocolErrors=g.extensions[LE]),a==="none"||y)throw new fd(w)}return a==="ignore"&&delete g.errors,g})};if(this.getDocumentInfo(n).hasClientExports){var p=this.localState.addExportedVariables(n,l,d).then(f);return new Rr(function(m){var g=null;return p.then(function(b){return g=b.subscribe(m)},m.error),function(){return g&&g.unsubscribe()}})}return f(l)},e.prototype.stopQuery=function(t){this.stopQueryNoBroadcast(t),this.broadcastQueries()},e.prototype.stopQueryNoBroadcast=function(t){this.stopQueryInStoreNoBroadcast(t),this.removeQuery(t)},e.prototype.removeQuery=function(t){this.fetchCancelFns.delete(t),this.queries.has(t)&&(this.getQuery(t).stop(),this.queries.delete(t))},e.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach(function(t){return t.notify()})},e.prototype.getLocalState=function(){return this.localState},e.prototype.getObservableFromLink=function(t,r,n,i){var o=this,a;i===void 0&&(i=(a=r==null?void 0:r.queryDeduplication)!==null&&a!==void 0?a:this.queryDeduplication);var l,c=this.getDocumentInfo(t),d=c.serverQuery,f=c.clientQuery;if(d){var p=this,m=p.inFlightLinkObservables,g=p.link,b={query:d,variables:n,operationName:dP(d)||void 0,context:this.prepareContext(ve(ve({},r),{forceFetch:!i}))};if(r=b.context,i){var y=G0(d),w=Ml(n),_=m.lookup(y,w);if(l=_.observable,!l){var S=new Pd([gP(g,b)]);l=_.observable=S,S.beforeNext(function(){m.remove(y,w)})}}else l=new Pd([gP(g,b)])}else l=new Pd([Rr.of({data:{}})]),r=this.prepareContext(r);return f&&(l=l_(l,function(C){return o.localState.runResolvers({document:f,remoteResult:C,context:r,variables:n})})),l},e.prototype.getResultsFromLink=function(t,r,n){var i=t.lastRequestId=this.generateRequestId(),o=this.cache.transformForLink(n.query);return l_(this.getObservableFromLink(o,n.context,n.variables),function(a){var l=vP(a),c=l.length>0;if(i>=t.lastRequestId){if(c&&n.errorPolicy==="none")throw t.markError(new fd({graphQLErrors:l}));t.markResult(a,o,n,r),t.markReady()}var d={data:a.data,loading:!1,networkStatus:Or.ready};return c&&n.errorPolicy!=="ignore"&&(d.errors=l,d.networkStatus=Or.error),d},function(a){var l=bue(a)?a:new fd({networkError:a});throw i>=t.lastRequestId&&t.markError(l),l})},e.prototype.fetchConcastWithInfo=function(t,r,n,i){var o=this;n===void 0&&(n=Or.loading),i===void 0&&(i=r.query);var a=this.getVariables(i,r.variables),l=this.getQuery(t),c=this.defaultOptions.watchQuery,d=r.fetchPolicy,f=d===void 0?c&&c.fetchPolicy||"cache-first":d,p=r.errorPolicy,m=p===void 0?c&&c.errorPolicy||"none":p,g=r.returnPartialData,b=g===void 0?!1:g,y=r.notifyOnNetworkStatusChange,w=y===void 0?!1:y,_=r.context,S=_===void 0?{}:_,C=Object.assign({},r,{query:i,variables:a,fetchPolicy:f,errorPolicy:m,returnPartialData:b,notifyOnNetworkStatusChange:w,context:S}),k=function(M){C.variables=M;var B=o.fetchQueryByPolicy(l,C,n);return C.fetchPolicy!=="standby"&&B.sources.length>0&&l.observableQuery&&l.observableQuery.applyNextFetchPolicy("after-fetch",r),B},E=function(){return o.fetchCancelFns.delete(t)};this.fetchCancelFns.set(t,function(M){E(),setTimeout(function(){return R.cancel(M)})});var R,T;if(this.getDocumentInfo(C.query).hasClientExports)R=new Pd(this.localState.addExportedVariables(C.query,C.variables,C.context).then(k).then(function(M){return M.sources})),T=!0;else{var A=k(C.variables);T=A.fromLink,R=new Pd(A.sources)}return R.promise.then(E,E),{concast:R,fromLink:T}},e.prototype.refetchQueries=function(t){var r=this,n=t.updateCache,i=t.include,o=t.optimistic,a=o===void 0?!1:o,l=t.removeOptimistic,c=l===void 0?a?rP("refetchQueries"):void 0:l,d=t.onQueryUpdated,f=new Map;i&&this.getObservableQueries(i).forEach(function(m,g){f.set(g,{oq:m,lastDiff:r.getQuery(g).getDiff()})});var p=new Map;return n&&this.cache.batch({update:n,optimistic:a&&c||!1,removeOptimistic:c,onWatchUpdated:function(m,g,b){var y=m.watcher instanceof v_&&m.watcher.observableQuery;if(y){if(d){f.delete(y.queryId);var w=d(y,g,b);return w===!0&&(w=y.refetch()),w!==!1&&p.set(y,w),w}d!==null&&f.set(y.queryId,{oq:y,lastDiff:b,diff:g})}}}),f.size&&f.forEach(function(m,g){var b=m.oq,y=m.lastDiff,w=m.diff,_;if(d){if(!w){var S=b.queryInfo;S.reset(),w=S.getDiff()}_=d(b,w,y)}(!d||_===!0)&&(_=b.refetch()),_!==!1&&p.set(b,_),g.indexOf("legacyOneTimeQuery")>=0&&r.stopQueryNoBroadcast(g)}),c&&this.cache.removeOptimistic(c),p},e.prototype.fetchQueryByPolicy=function(t,r,n){var i=this,o=r.query,a=r.variables,l=r.fetchPolicy,c=r.refetchWritePolicy,d=r.errorPolicy,f=r.returnPartialData,p=r.context,m=r.notifyOnNetworkStatusChange,g=t.networkStatus;t.init({document:o,variables:a,networkStatus:n});var b=function(){return t.getDiff()},y=function(k,E){E===void 0&&(E=t.networkStatus||Or.loading);var R=k.result;globalThis.__DEV__!==!1&&!f&&!qr(R,{})&&lB(k.missing);var T=function(A){return Rr.of(ve({data:A,loading:rm(E),networkStatus:E},k.complete?null:{partial:!0}))};return R&&i.getDocumentInfo(o).hasForcedResolvers?i.localState.runResolvers({document:o,remoteResult:{data:R},context:p,variables:a,onlyRunForcedResolvers:!0}).then(function(A){return T(A.data||void 0)}):d==="none"&&E===Or.refetch&&Array.isArray(k.missing)?T(void 0):T(R)},w=l==="no-cache"?0:n===Or.refetch&&c!=="merge"?1:2,_=function(){return i.getResultsFromLink(t,w,{query:o,variables:a,context:p,fetchPolicy:l,errorPolicy:d})},S=m&&typeof g=="number"&&g!==n&&rm(n);switch(l){default:case"cache-first":{var C=b();return C.complete?{fromLink:!1,sources:[y(C,t.markReady())]}:f||S?{fromLink:!0,sources:[y(C),_()]}:{fromLink:!0,sources:[_()]}}case"cache-and-network":{var C=b();return C.complete||f||S?{fromLink:!0,sources:[y(C),_()]}:{fromLink:!0,sources:[_()]}}case"cache-only":return{fromLink:!1,sources:[y(b(),t.markReady())]};case"network-only":return S?{fromLink:!0,sources:[y(b()),_()]}:{fromLink:!0,sources:[_()]};case"no-cache":return S?{fromLink:!0,sources:[y(t.getDiff()),_()]}:{fromLink:!0,sources:[_()]};case"standby":return{fromLink:!1,sources:[]}}},e.prototype.getQuery=function(t){return t&&!this.queries.has(t)&&this.queries.set(t,new v_(this,t)),this.queries.get(t)},e.prototype.prepareContext=function(t){t===void 0&&(t={});var r=this.localState.prepareContext(t);return ve(ve(ve({},this.defaultContext),r),{clientAwareness:this.clientAwareness})},e}(),yA=!1,cB=function(){function e(t){var r=this;if(this.resetStoreCallbacks=[],this.clearStoreCallbacks=[],!t.cache)throw Ei(15);var n=t.uri,i=t.credentials,o=t.headers,a=t.cache,l=t.documentTransform,c=t.ssrMode,d=c===void 0?!1:c,f=t.ssrForceFetchDelay,p=f===void 0?0:f,m=t.connectToDevTools,g=m===void 0?typeof window=="object"&&!window.__APOLLO_CLIENT__&&globalThis.__DEV__!==!1:m,b=t.queryDeduplication,y=b===void 0?!0:b,w=t.defaultOptions,_=t.defaultContext,S=t.assumeImmutableResults,C=S===void 0?a.assumeImmutableResults:S,k=t.resolvers,E=t.typeDefs,R=t.fragmentMatcher,T=t.name,A=t.version,M=t.link;M||(M=n?new Due({uri:n,credentials:i,headers:o}):Ws.empty()),this.link=M,this.cache=a,this.disableNetworkFetches=d||p>0,this.queryDeduplication=y,this.defaultOptions=w||Object.create(null),this.typeDefs=E,p&&setTimeout(function(){return r.disableNetworkFetches=!1},p),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.watchFragment=this.watchFragment.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),this.version=SE,this.localState=new uB({cache:a,client:this,resolvers:k,fragmentMatcher:R}),this.queryManager=new ace({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,defaultContext:_,documentTransform:l,queryDeduplication:y,ssrMode:d,clientAwareness:{name:T,version:A},localState:this.localState,assumeImmutableResults:C,onBroadcast:g?function(){r.devToolsHookCb&&r.devToolsHookCb({action:{},state:{queries:r.queryManager.getQueryStore(),mutations:r.queryManager.mutationStore||{}},dataWithOptimisticResults:r.cache.extract(!0)})}:void 0}),g&&this.connectToDevTools()}return e.prototype.connectToDevTools=function(){if(typeof window=="object"){var t=window,r=Symbol.for("apollo.devtools");(t[r]=t[r]||[]).push(this),t.__APOLLO_CLIENT__=this}!yA&&globalThis.__DEV__!==!1&&(yA=!0,setTimeout(function(){if(typeof window<"u"&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__&&/^(https?|file):$/.test(window.location.protocol)){var n=window.navigator,i=n&&n.userAgent,o=void 0;typeof i=="string"&&(i.indexOf("Chrome/")>-1?o="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":i.indexOf("Firefox/")>-1&&(o="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),o&&globalThis.__DEV__!==!1&&_t.log("Download the Apollo DevTools for a better development experience: %s",o)}},1e4))},Object.defineProperty(e.prototype,"documentTransform",{get:function(){return this.queryManager.documentTransform},enumerable:!1,configurable:!0}),e.prototype.stop=function(){this.queryManager.stop()},e.prototype.watchQuery=function(t){return this.defaultOptions.watchQuery&&(t=u_(this.defaultOptions.watchQuery,t)),this.disableNetworkFetches&&(t.fetchPolicy==="network-only"||t.fetchPolicy==="cache-and-network")&&(t=ve(ve({},t),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(t)},e.prototype.query=function(t){return this.defaultOptions.query&&(t=u_(this.defaultOptions.query,t)),_t(t.fetchPolicy!=="cache-and-network",16),this.disableNetworkFetches&&t.fetchPolicy==="network-only"&&(t=ve(ve({},t),{fetchPolicy:"cache-first"})),this.queryManager.query(t)},e.prototype.mutate=function(t){return this.defaultOptions.mutate&&(t=u_(this.defaultOptions.mutate,t)),this.queryManager.mutate(t)},e.prototype.subscribe=function(t){return this.queryManager.startGraphQLSubscription(t)},e.prototype.readQuery=function(t,r){return r===void 0&&(r=!1),this.cache.readQuery(t,r)},e.prototype.watchFragment=function(t){return this.cache.watchFragment(t)},e.prototype.readFragment=function(t,r){return r===void 0&&(r=!1),this.cache.readFragment(t,r)},e.prototype.writeQuery=function(t){var r=this.cache.writeQuery(t);return t.broadcast!==!1&&this.queryManager.broadcastQueries(),r},e.prototype.writeFragment=function(t){var r=this.cache.writeFragment(t);return t.broadcast!==!1&&this.queryManager.broadcastQueries(),r},e.prototype.__actionHookForDevTools=function(t){this.devToolsHookCb=t},e.prototype.__requestRaw=function(t){return gP(this.link,t)},e.prototype.resetStore=function(){var t=this;return Promise.resolve().then(function(){return t.queryManager.clearStore({discardWatches:!1})}).then(function(){return Promise.all(t.resetStoreCallbacks.map(function(r){return r()}))}).then(function(){return t.reFetchObservableQueries()})},e.prototype.clearStore=function(){var t=this;return Promise.resolve().then(function(){return t.queryManager.clearStore({discardWatches:!0})}).then(function(){return Promise.all(t.clearStoreCallbacks.map(function(r){return r()}))})},e.prototype.onResetStore=function(t){var r=this;return this.resetStoreCallbacks.push(t),function(){r.resetStoreCallbacks=r.resetStoreCallbacks.filter(function(n){return n!==t})}},e.prototype.onClearStore=function(t){var r=this;return this.clearStoreCallbacks.push(t),function(){r.clearStoreCallbacks=r.clearStoreCallbacks.filter(function(n){return n!==t})}},e.prototype.reFetchObservableQueries=function(t){return this.queryManager.reFetchObservableQueries(t)},e.prototype.refetchQueries=function(t){var r=this.queryManager.refetchQueries(t),n=[],i=[];r.forEach(function(a,l){n.push(l),i.push(a)});var o=Promise.all(i);return o.queries=n,o.results=i,o.catch(function(a){globalThis.__DEV__!==!1&&_t.debug(17,a)}),o},e.prototype.getObservableQueries=function(t){return t===void 0&&(t="active"),this.queryManager.getObservableQueries(t)},e.prototype.extract=function(t){return this.cache.extract(t)},e.prototype.restore=function(t){return this.cache.restore(t)},e.prototype.addResolvers=function(t){this.localState.addResolvers(t)},e.prototype.setResolvers=function(t){this.localState.setResolvers(t)},e.prototype.getResolvers=function(){return this.localState.getResolvers()},e.prototype.setLocalStateFragmentMatcher=function(t){this.localState.setFragmentMatcher(t)},e.prototype.setLink=function(t){this.link=this.queryManager.link=t},Object.defineProperty(e.prototype,"defaultContext",{get:function(){return this.queryManager.defaultContext},enumerable:!1,configurable:!0}),e}();globalThis.__DEV__!==!1&&(cB.prototype.getMemoryInternals=Zse);var eb=new Map,EP=new Map,dB=!0,Ab=!1;function fB(e){return e.replace(/[\s,]+/g," ").trim()}function sce(e){return fB(e.source.body.substring(e.start,e.end))}function lce(e){var t=new Set,r=[];return e.definitions.forEach(function(n){if(n.kind==="FragmentDefinition"){var i=n.name.value,o=sce(n.loc),a=EP.get(i);a&&!a.has(o)?dB&&console.warn("Warning: fragment with name "+i+` already exists.
|
441
441
|
graphql-tag enforces all fragment names across your application to be unique; read more about
|
442
|
-
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):a||EP.set(i,a=new Set),a.add(o),t.has(o)||(t.add(o),r.push(n))}else r.push(n)}),ve(ve({},e),{definitions:r})}function uce(e){var t=new Set(e.definitions);t.forEach(function(n){n.loc&&delete n.loc,Object.keys(n).forEach(function(i){var o=n[i];o&&typeof o=="object"&&t.add(o)})});var r=e.loc;return r&&(delete r.startToken,delete r.endToken),e}function cce(e){var t=fB(e);if(!eb.has(t)){var r=u5(e,{experimentalFragmentVariables:Ab,allowLegacyFragmentVariables:Ab});if(!r||r.kind!=="Document")throw new Error("Not a valid GraphQL document.");eb.set(t,uce(lce(r)))}return eb.get(t)}function Ne(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];typeof e=="string"&&(e=[e]);var n=e[0];return t.forEach(function(i,o){i&&i.kind==="Document"?n+=i.loc.source.body:n+=i,n+=e[o+1]}),cce(n)}function dce(){eb.clear(),EP.clear()}function fce(){dB=!1}function hce(){Ab=!0}function pce(){Ab=!1}var Mh={gql:Ne,resetCaches:dce,disableFragmentWarnings:fce,enableExperimentalFragmentVariables:hce,disableExperimentalFragmentVariables:pce};(function(e){e.gql=Mh.gql,e.resetCaches=Mh.resetCaches,e.disableFragmentWarnings=Mh.disableFragmentWarnings,e.enableExperimentalFragmentVariables=Mh.enableExperimentalFragmentVariables,e.disableExperimentalFragmentVariables=Mh.disableExperimentalFragmentVariables})(Ne||(Ne={}));Ne.default=Ne;var g_={exports:{}},b2;function mce(){return b2||(b2=1,function(e){e.exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=void 0,e.exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=void 0,e.exports.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=void 0,Object.assign(e.exports,wm())}(g_)),g_.exports}var Nl=mce();const vce=mc(Nl),gce=o0({__proto__:null,default:vce},[Nl]);var w2=TE?Symbol.for("__APOLLO_CONTEXT__"):"__APOLLO_CONTEXT__";function yce(){_t("createContext"in gce,45);var e=Nl.createContext[w2];return e||(Object.defineProperty(Nl.createContext,w2,{value:e=Nl.createContext({}),enumerable:!1,writable:!1,configurable:!0}),e.displayName="ApolloContext"),e}var bce=function(e){var t=e.client,r=e.children,n=yce(),i=Nl.useContext(n),o=Nl.useMemo(function(){return ve(ve({},i),{client:t||i.client})},[i,t]);return _t(o.client,46),Nl.createElement(n.Provider,{value:o},r)};function wce(e){return new Ws(function(t,r){var n=Ms(t,[]);return new Rr(function(i){var o,a=!1;return Promise.resolve(n).then(function(l){return e(l,t.getContext())}).then(t.setContext).then(function(){a||(o=r(t).subscribe({next:i.next.bind(i),error:i.error.bind(i),complete:i.complete.bind(i)}))}).catch(i.error.bind(i)),function(){a=!0,o&&o.unsubscribe()}})})}function hB(e){return new Ws(function(t,r){return new Rr(function(n){var i,o,a;try{i=r(t).subscribe({next:function(l){if(l.errors&&(a=e({graphQLErrors:l.errors,response:l,operation:t,forward:r}),a)){o=a.subscribe({next:n.next.bind(n),error:n.error.bind(n),complete:n.complete.bind(n)});return}n.next(l)},error:function(l){if(a=e({operation:t,networkError:l,graphQLErrors:l&&l.result&&l.result.errors,forward:r}),a){o=a.subscribe({next:n.next.bind(n),error:n.error.bind(n),complete:n.complete.bind(n)});return}n.error(l)},complete:function(){a||n.complete.bind(n)()}})}catch(l){e({networkError:l,operation:t,forward:r}),n.error(l)}return function(){i&&i.unsubscribe(),o&&i.unsubscribe()}})})}(function(e){ga(t,e);function t(r){var n=e.call(this)||this;return n.link=hB(r),n}return t.prototype.request=function(r,n){return this.link.request(r,n)},t})(Ws);const Sce={BASE_URL:"/",DEV:!1,GIT_BRANCH_NAME:"HEAD",GIT_COMMIT_HASH:"df72e0a",MODE:"production",PACKAGE_VERSION:"0.11.0-alpha.5",PROD:!0,REACT_APP_ENDPOINT_HOST:"",REACT_APP_ENDPOINT_PORT:"",REACT_APP_ENDPOINT_SERVER_URL:"/endpoint",REACT_APP_GRAPHQL_SERVER_URL:"/graphql",REACT_APP_SWAGGER_SERVER_URL:"/api",SSR:!1},_ce=e=>{var n;const t=(n=window.__env__)==null?void 0:n[e],r=Sce[e];return t||r},UE="/",xc="login",pB="logout",Y0="signup",mB="username",vB="github",gB="google",yB="completed",xce="confirm",Fl="app",Ll=":organizationId",Bl=":projectName",Vl=":branchName",X0="-/draft",bB="-/:revisionId",wp=":tableId",wB=":rowId";var zr=(e=>(e.Organization="organization",e.Project="project",e.Branch="branch",e.DraftRevision="draftRevision",e.HeadRevision="headRevision",e.SpecificRevision="specificRevision",e.DraftTable="draftTable",e.HeadTable="headTable",e.SpecificTable="specificTable",e.DraftRow="draftRow",e.HeadRow="headRow",e.SpecificRow="specificRow",e))(zr||{});const $f=({hideSidebar:e,sidebar:t,title:r,actions:n,children:i})=>x.jsxs(je,{minHeight:"100vh",children:[!e&&x.jsxs(je,{backgroundColor:"gray.50",borderRight:"1px solid",borderRightColor:"gray.200",flexDirection:"column",justifyContent:t?"space-between":"flex-end",padding:"1rem",width:"250px",height:"100vh",top:0,position:"sticky",children:[x.jsx(wt,{children:t}),x.jsx(Cf,{color:"gray.400",alignSelf:"center",as:qo,to:`/${pB}`,children:"Logout"})]}),x.jsxs(je,{alignItems:"center",flex:1,flexDirection:"column",width:"100%",children:[(r||n)&&x.jsxs(je,{alignItems:"center",backgroundColor:"white",borderBottom:"1px solid",borderBottomColor:"gray.50",justifyContent:"space-between",maxWidth:"900px",padding:"8px",width:"100%",position:"sticky",zIndex:1,top:0,children:[r,n]}),x.jsx(je,{flex:1,flexDirection:"column",maxWidth:"900px",padding:"1rem 1rem 0rem 1rem",width:"100%",children:i})]})]});var Pce=bc({viewBox:"0 0 14 14",d:"M14,7.77 L14,6.17 L12.06,5.53 L11.61,4.44 L12.49,2.6 L11.36,1.47 L9.55,2.38 L8.46,1.93 L7.77,0.01 L6.17,0.01 L5.54,1.95 L4.43,2.4 L2.59,1.52 L1.46,2.65 L2.37,4.46 L1.92,5.55 L0,6.23 L0,7.82 L1.94,8.46 L2.39,9.55 L1.51,11.39 L2.64,12.52 L4.45,11.61 L5.54,12.06 L6.23,13.98 L7.82,13.98 L8.45,12.04 L9.56,11.59 L11.4,12.47 L12.53,11.34 L11.61,9.53 L12.08,8.44 L14,7.75 L14,7.77 Z M7,10 C5.34,10 4,8.66 4,7 C4,5.34 5.34,4 7,4 C8.66,4 10,5.34 10,7 C10,8.66 8.66,10 7,10 Z",displayName:"SettingsIcon"}),Cce=bc({displayName:"CloseIcon",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"}),Ece=bc({d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z",displayName:"CopyIcon"}),J0=bc({displayName:"DeleteIcon",path:x.jsx("g",{fill:"currentColor",children:x.jsx("path",{d:"M19.452 7.5H4.547a.5.5 0 00-.5.545l1.287 14.136A2 2 0 007.326 24h9.347a2 2 0 001.992-1.819L19.95 8.045a.5.5 0 00-.129-.382.5.5 0 00-.369-.163zm-9.2 13a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zm5 0a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zM22 4h-4.75a.25.25 0 01-.25-.25V2.5A2.5 2.5 0 0014.5 0h-5A2.5 2.5 0 007 2.5v1.25a.25.25 0 01-.25.25H2a1 1 0 000 2h20a1 1 0 000-2zM9 3.75V2.5a.5.5 0 01.5-.5h5a.5.5 0 01.5.5v1.25a.25.25 0 01-.25.25h-5.5A.25.25 0 019 3.75z"})})}),Tce=bc({viewBox:"0 0 10 10",d:"M3,2 C2.44771525,2 2,1.55228475 2,1 C2,0.44771525 2.44771525,0 3,0 C3.55228475,0 4,0.44771525 4,1 C4,1.55228475 3.55228475,2 3,2 Z M3,6 C2.44771525,6 2,5.55228475 2,5 C2,4.44771525 2.44771525,4 3,4 C3.55228475,4 4,4.44771525 4,5 C4,5.55228475 3.55228475,6 3,6 Z M3,10 C2.44771525,10 2,9.55228475 2,9 C2,8.44771525 2.44771525,8 3,8 C3.55228475,8 4,8.44771525 4,9 C4,9.55228475 3.55228475,10 3,10 Z M7,2 C6.44771525,2 6,1.55228475 6,1 C6,0.44771525 6.44771525,0 7,0 C7.55228475,0 8,0.44771525 8,1 C8,1.55228475 7.55228475,2 7,2 Z M7,6 C6.44771525,6 6,5.55228475 6,5 C6,4.44771525 6.44771525,4 7,4 C7.55228475,4 8,4.44771525 8,5 C8,5.55228475 7.55228475,6 7,6 Z M7,10 C6.44771525,10 6,9.55228475 6,9 C6,8.44771525 6.44771525,8 7,8 C7.55228475,8 8,8.44771525 8,9 C8,9.55228475 7.55228475,10 7,10 Z",displayName:"DragHandleIcon"}),SB=bc({viewBox:"0 0 14 14",path:x.jsx("g",{fill:"currentColor",children:x.jsx("polygon",{points:"5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039"})})}),Oce=bc({d:"M0,12a1.5,1.5,0,0,0,1.5,1.5h8.75a.25.25,0,0,1,.25.25V22.5a1.5,1.5,0,0,0,3,0V13.75a.25.25,0,0,1,.25-.25H22.5a1.5,1.5,0,0,0,0-3H13.75a.25.25,0,0,1-.25-.25V1.5a1.5,1.5,0,0,0-3,0v8.75a.25.25,0,0,1-.25.25H1.5A1.5,1.5,0,0,0,0,12Z",displayName:"AddIcon"});const ks=({height:e="2.5rem",title:t,onClick:r,isDisabled:n,isSelected:i,isLoading:o,icon:a,dataTestId:l})=>x.jsx(Lo,{"data-testid":l,_hover:{color:"gray.400"},_disabled:i?{backgroundColor:"gray.50",cursor:"not-allowed"}:void 0,alignSelf:"flex-start",color:"gray.300",fontWeight:"500",height:e,isDisabled:n||i,isLoading:o,variant:"ghost",onClick:r,children:x.jsxs(je,{alignItems:"center",gap:"0.5rem",children:[a,x.jsx(bt,{children:t})]})}),Af=e=>x.jsx(ks,{...e,icon:x.jsx(Oce,{boxSize:3})}),Qm=({height:e="2.5rem",loading:t,isDisabled:r,onClick:n,title:i,dataTestId:o})=>x.jsxs(Lo,{"data-testid":o,_hover:{backgroundColor:"gray.50"},alignSelf:"flex-start",color:"gray.400",height:e,isLoading:t,isDisabled:r,variant:"ghost",onClick:n,width:"48px",children:[x.jsx(SB,{boxSize:3,mr:i?2:0}),i]}),Z0=({height:e="2.5rem",onClick:t,isDisabled:r,dataTestId:n})=>x.jsx(Lo,{"data-testid":n,isDisabled:r,_hover:{backgroundColor:"gray.50"},alignSelf:"flex-start",color:"gray.400",height:e,variant:"ghost",onClick:t,width:"48px",children:x.jsx(Cce,{boxSize:3})});var _B={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},S2=Re.createContext&&Re.createContext(_B),Rce=["attr","size","title"];function Ice(e,t){if(e==null)return{};var r=kce(e,t),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function kce(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Db(){return Db=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Db.apply(this,arguments)}function _2(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Mb(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?_2(Object(r),!0).forEach(function(n){jce(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_2(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function jce(e,t,r){return t=$ce(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $ce(e){var t=Ace(e,"string");return typeof t=="symbol"?t:t+""}function Ace(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function xB(e){return e&&e.map((t,r)=>Re.createElement(t.tag,Mb({key:r},t.attr),xB(t.child)))}function Hr(e){return t=>Re.createElement(Dce,Db({attr:Mb({},e.attr)},t),xB(e.child))}function Dce(e){var t=r=>{var{attr:n,size:i,title:o}=e,a=Ice(e,Rce),l=i||r.size||"1em",c;return r.className&&(c=r.className),e.className&&(c=(c?c+" ":"")+e.className),Re.createElement("svg",Db({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,a,{className:c,style:Mb(Mb({color:e.color||r.color},r.style),e.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),o&&Re.createElement("title",null,o),e.children)};return S2!==void 0?Re.createElement(S2.Consumer,null,r=>t(r)):t(_B)}function PB(e){return Hr({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M228,128a100,100,0,0,1-98.66,100H128a99.39,99.39,0,0,1-68.62-27.29,12,12,0,0,1,16.48-17.45,76,76,0,1,0-1.57-109c-.13.13-.25.25-.39.37L54.89,92H72a12,12,0,0,1,0,24H24a12,12,0,0,1-12-12V56a12,12,0,0,1,24,0V76.72L57.48,57.06A100,100,0,0,1,228,128Z"},child:[]}]})(e)}function HE(e){return Hr({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M156,128a28,28,0,1,1-28-28A28,28,0,0,1,156,128Z"},child:[]}]})(e)}function CB(e){return Hr({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M216,104v8a56.06,56.06,0,0,1-48.44,55.47A39.8,39.8,0,0,1,176,192v40a8,8,0,0,1-8,8H104a8,8,0,0,1-8-8V216H72a40,40,0,0,1-40-40A24,24,0,0,0,8,152a8,8,0,0,1,0-16,40,40,0,0,1,40,40,24,24,0,0,0,24,24H96v-8a39.8,39.8,0,0,1,8.44-24.53A56.06,56.06,0,0,1,56,112v-8a58.14,58.14,0,0,1,7.69-28.32A59.78,59.78,0,0,1,69.07,28,8,8,0,0,1,76,24a59.75,59.75,0,0,1,48,24h24a59.75,59.75,0,0,1,48-24,8,8,0,0,1,6.93,4,59.74,59.74,0,0,1,5.37,47.68A58,58,0,0,1,216,104Z"},child:[]}]})(e)}function EB(e){return Hr({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M128,24A104,104,0,1,0,232,128,104,104,0,0,0,128,24Zm0,184A80,80,0,1,1,181.34,68.37a8,8,0,0,1-10.67,11.92A64,64,0,1,0,191.5,136H128a8,8,0,0,1,0-16h72a8,8,0,0,1,8,8A80.09,80.09,0,0,1,128,208Z"},child:[]}]})(e)}function x2(e){return Hr({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z"},child:[]}]})(e)}function Mce(e){return Hr({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Zm34.83-86.83a4,4,0,0,1,0,5.66l-32,32a4,4,0,0,1-5.66,0l-32-32a4,4,0,0,1,5.66-5.66L124,158.34V88a4,4,0,0,1,8,0v70.34l25.17-25.17A4,4,0,0,1,162.83,133.17Z"},child:[]}]})(e)}function Nce(e){return Hr({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Zm42.83-94.83a4,4,0,0,1,0,5.66l-32,32a4,4,0,0,1-5.66-5.66L158.34,132H88a4,4,0,0,1,0-8h70.34L133.17,98.83a4,4,0,0,1,5.66-5.66Z"},child:[]}]})(e)}function Fce(e){return Hr({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M202.83,146.83l-72,72a4,4,0,0,1-5.66,0l-72-72a4,4,0,0,1,5.66-5.66L124,206.34V40a4,4,0,0,1,8,0V206.34l65.17-65.17a4,4,0,0,1,5.66,5.66Z"},child:[]}]})(e)}function Lce(e){return Hr({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M218.83,130.83l-72,72a4,4,0,0,1-5.66-5.66L206.34,132H40a4,4,0,0,1,0-8H206.34L141.17,58.83a4,4,0,0,1,5.66-5.66l72,72A4,4,0,0,1,218.83,130.83Z"},child:[]}]})(e)}function Bce(e){return Hr({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M35.89,128C52,136.23,52,155.64,52,172c0,24.8,1.35,40,28,40a4,4,0,0,1,0,8c-36,0-36-26.61-36-48,0-24.8-1.35-40-28-40a4,4,0,0,1,0-8c26.65,0,28-15.2,28-40,0-21.39,0-48,36-48a4,4,0,0,1,0,8C53.35,44,52,59.2,52,84,52,100.36,52,119.77,35.89,128ZM240,124c-26.65,0-28-15.2-28-40,0-21.39,0-48-36-48a4,4,0,0,0,0,8c26.65,0,28,15.2,28,40,0,16.36,0,35.77,16.11,44C204,136.23,204,155.64,204,172c0,24.8-1.35,40-28,40a4,4,0,0,0,0,8c36,0,36-26.61,36-48,0-24.8,1.35-40,28-40a4,4,0,0,0,0-8Z"},child:[]}]})(e)}function Vce(e){return Hr({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M162.83,205.17a4,4,0,0,1-5.66,5.66l-80-80a4,4,0,0,1,0-5.66l80-80a4,4,0,1,1,5.66,5.66L85.66,128Z"},child:[]}]})(e)}function zce(e){return Hr({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M155.87,36.06a4,4,0,0,1-3.87,3,4.29,4.29,0,0,1-1-.13,92,92,0,0,0-46,0,4,4,0,0,1-2-7.74,100.09,100.09,0,0,1,50,0A4,4,0,0,1,155.87,36.06ZM56.65,57.94a100.18,100.18,0,0,0-25,43.29,4,4,0,0,0,7.71,2.14,92.06,92.06,0,0,1,23-39.82,4,4,0,1,0-5.7-5.61ZM39.36,152.62a4,4,0,0,0-7.71,2.14,100.08,100.08,0,0,0,25,43.31,4,4,0,1,0,5.71-5.61A91.91,91.91,0,0,1,39.36,152.62ZM151,217.09a92,92,0,0,1-46,0,4,4,0,0,0-2,7.75,100,100,0,0,0,50,0,4,4,0,1,0-2-7.74Zm70.58-67.25a4,4,0,0,0-4.92,2.79,92.12,92.12,0,0,1-23,39.82,4,4,0,1,0,5.7,5.61,100.18,100.18,0,0,0,25-43.29A4,4,0,0,0,221.58,149.84Zm-4.94-46.46a4,4,0,0,0,7.71-2.14,100.08,100.08,0,0,0-25-43.31,4,4,0,1,0-5.71,5.61A91.91,91.91,0,0,1,216.64,103.38Z"},child:[]}]})(e)}function P2(e){return Hr({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Z"},child:[]}]})(e)}function qce(e){return Hr({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M192.14,42.55C174.94,33.17,152.16,28,128,28S81.06,33.17,63.86,42.55C45.89,52.35,36,65.65,36,80v96c0,14.35,9.89,27.65,27.86,37.45,17.2,9.38,40,14.55,64.14,14.55s46.94-5.17,64.14-14.55c18-9.8,27.86-23.1,27.86-37.45V80C220,65.65,210.11,52.35,192.14,42.55ZM212,176c0,11.29-8.41,22.1-23.69,30.43C172.27,215.18,150.85,220,128,220s-44.27-4.82-60.31-13.57C52.41,198.1,44,187.29,44,176V149.48c4.69,5.93,11.37,11.34,19.86,16,17.2,9.38,40,14.55,64.14,14.55s46.94-5.17,64.14-14.55c8.49-4.63,15.17-10,19.86-16Zm0-48c0,11.29-8.41,22.1-23.69,30.43C172.27,167.18,150.85,172,128,172s-44.27-4.82-60.31-13.57C52.41,150.1,44,139.29,44,128V101.48c4.69,5.93,11.37,11.34,19.86,16,17.2,9.38,40,14.55,64.14,14.55s46.94-5.17,64.14-14.55c8.49-4.63,15.17-10,19.86-16Zm-23.69-17.57C172.27,119.18,150.85,124,128,124s-44.27-4.82-60.31-13.57C52.41,102.1,44,91.29,44,80s8.41-22.1,23.69-30.43C83.73,40.82,105.15,36,128,36s44.27,4.82,60.31,13.57C203.59,57.9,212,68.71,212,80S203.59,102.1,188.31,110.43Z"},child:[]}]})(e)}function Uce(e){return Hr({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M128,100a28,28,0,1,0,28,28A28,28,0,0,0,128,100Zm0,48a20,20,0,1,1,20-20A20,20,0,0,1,128,148Z"},child:[]}]})(e)}function TB(e){return Hr({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M243.66,126.38c-.34-.76-8.52-18.89-26.83-37.2C199.87,72.22,170.7,52,128,52S56.13,72.22,39.17,89.18c-18.31,18.31-26.49,36.44-26.83,37.2a4.08,4.08,0,0,0,0,3.25c.34.77,8.52,18.89,26.83,37.2,17,17,46.14,37.17,88.83,37.17s71.87-20.21,88.83-37.17c18.31-18.31,26.49-36.43,26.83-37.2A4.08,4.08,0,0,0,243.66,126.38Zm-32.7,35c-23.07,23-51,34.62-83,34.62s-59.89-11.65-83-34.62A135.71,135.71,0,0,1,20.44,128,135.69,135.69,0,0,1,45,94.62C68.11,71.65,96,60,128,60s59.89,11.65,83,34.62A135.79,135.79,0,0,1,235.56,128,135.71,135.71,0,0,1,211,161.38ZM128,84a44,44,0,1,0,44,44A44.05,44.05,0,0,0,128,84Zm0,80a36,36,0,1,1,36-36A36,36,0,0,1,128,164Z"},child:[]}]})(e)}function OB(e){return Hr({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M236,88.12a50.44,50.44,0,0,1-14.81,34.31l-34.75,34.74A50.33,50.33,0,0,1,150.62,172h-.05A50.63,50.63,0,0,1,100,120a4,4,0,0,1,4-3.89h.11a4,4,0,0,1,3.89,4.11A42.64,42.64,0,0,0,150.58,164h0a42.32,42.32,0,0,0,30.14-12.49l34.75-34.74a42.63,42.63,0,1,0-60.29-60.28l-11,11a4,4,0,0,1-5.66-5.65l11-11A50.64,50.64,0,0,1,236,88.12ZM111.78,188.49l-11,11A42.33,42.33,0,0,1,70.6,212h0a42.63,42.63,0,0,1-30.11-72.77l34.75-34.74A42.63,42.63,0,0,1,148,135.82a4,4,0,0,0,8,.23A50.64,50.64,0,0,0,69.55,98.83L34.8,133.57A50.63,50.63,0,0,0,70.56,220h0a50.33,50.33,0,0,0,35.81-14.83l11-11a4,4,0,1,0-5.65-5.66Z"},child:[]}]})(e)}function Hce(e){return Hr({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M234.83,21.17a4,4,0,0,0-5.66,0L173.94,76.4l-8.2-8.2a28,28,0,0,0-39.6,0L100,94.34l-9.17-9.17a4,4,0,0,0-5.66,5.66L94.34,100,68.2,126.14a28,28,0,0,0,0,39.6l8.2,8.2L21.17,229.17a4,4,0,0,0,5.66,5.66L82.06,179.6l8.2,8.2a28,28,0,0,0,39.6,0L156,161.66l9.17,9.17a4,4,0,0,0,5.66-5.66L161.66,156l26.14-26.14a28,28,0,0,0,0-39.6l-8.2-8.2,55.23-55.23A4,4,0,0,0,234.83,21.17Zm-110.63,161a20,20,0,0,1-28.28,0L73.86,160.08a20,20,0,0,1,0-28.28L100,105.66,150.34,156Zm57.94-57.94L156,150.34,105.66,100,131.8,73.86a20,20,0,0,1,28.28,0l22.06,22.06A20,20,0,0,1,182.14,124.2ZM92.29,33.49a4,4,0,1,1,7.42-3l8,20a4,4,0,0,1-2.22,5.2A3.91,3.91,0,0,1,104,56a4,4,0,0,1-3.71-2.51Zm-64,61a4,4,0,0,1,5.2-2.22l20,8A4,4,0,0,1,52,108a3.91,3.91,0,0,1-1.49-.29l-20-8A4,4,0,0,1,28.29,94.51Zm199.42,67A4,4,0,0,1,224,164a3.91,3.91,0,0,1-1.49-.29l-20-8a4,4,0,1,1,3-7.42l20,8A4,4,0,0,1,227.71,161.49Zm-64,61a4,4,0,0,1-2.22,5.2A3.91,3.91,0,0,1,160,228a4,4,0,0,1-3.71-2.51l-8-20a4,4,0,0,1,7.42-3Z"},child:[]}]})(e)}function Wce(e){return Hr({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M146.83,141.17a4,4,0,0,0-5.66,0L120,162.34,93.66,136l21.17-21.17a4,4,0,0,0-5.66-5.66L88,130.34,66.83,109.17a4,4,0,0,0-5.66,5.66L70.34,124,44.2,150.14a28,28,0,0,0,0,39.6l8.2,8.2L21.17,229.17a4,4,0,0,0,5.66,5.66L58.06,203.6l8.2,8.2a28,28,0,0,0,39.6,0L132,185.66l9.17,9.17a4,4,0,0,0,5.66-5.66L125.66,168l21.17-21.17A4,4,0,0,0,146.83,141.17Zm-46.63,65a20,20,0,0,1-28.28,0L49.86,184.08a20,20,0,0,1,0-28.28L76,129.66,126.34,180Zm134.63-185a4,4,0,0,0-5.66,0L197.94,52.4l-8.2-8.2a28,28,0,0,0-39.6,0L124,70.34l-9.17-9.17a4,4,0,0,0-5.66,5.66l80,80a4,4,0,0,0,5.66-5.66L185.66,132l26.14-26.14a28,28,0,0,0,0-39.6l-8.2-8.2,31.23-31.23A4,4,0,0,0,234.83,21.17ZM212,86.06a19.86,19.86,0,0,1-5.86,14.14L180,126.34,129.66,76,155.8,49.86a20,20,0,0,1,28.28,0l22.06,22.06A19.85,19.85,0,0,1,212,86.06Z"},child:[]}]})(e)}function Kce(e){return Hr({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M234.83,109.17l-80-80A4,4,0,0,0,148,32V76.09c-54,2.44-120.43,53.55-127.94,119a7.87,7.87,0,0,0,4.58,8.16,8,8,0,0,0,3.41.77,7.9,7.9,0,0,0,5.79-2.55h0c11.53-12.27,53.29-51.73,114.16-53.4V192a4,4,0,0,0,6.83,2.83l80-80A4,4,0,0,0,234.83,109.17ZM156,182.33V144a4,4,0,0,0-4-4c-27.39,0-54.08,7.17-79.34,21.3A189.91,189.91,0,0,0,28,196l2.92,2.74L28,196c3.36-29.21,19.55-57.48,45.6-79.57C97.53,96.11,126.83,84,152,84a4,4,0,0,0,4-4V41.66L226.34,112Z"},child:[]}]})(e)}function Gce(e){return Hr({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M176,148h32a12,12,0,0,0,12-12V104a12,12,0,0,0-12-12H176a12,12,0,0,0-12,12v12H84V76H96a12,12,0,0,0,12-12V32A12,12,0,0,0,96,20H64A12,12,0,0,0,52,32V64A12,12,0,0,0,64,76H76V192a20,20,0,0,0,20,20h68v12a12,12,0,0,0,12,12h32a12,12,0,0,0,12-12V192a12,12,0,0,0-12-12H176a12,12,0,0,0-12,12v12H96a12,12,0,0,1-12-12V124h80v12A12,12,0,0,0,176,148ZM60,64V32a4,4,0,0,1,4-4H96a4,4,0,0,1,4,4V64a4,4,0,0,1-4,4H64A4,4,0,0,1,60,64ZM172,192a4,4,0,0,1,4-4h32a4,4,0,0,1,4,4v32a4,4,0,0,1-4,4H176a4,4,0,0,1-4-4Zm0-88a4,4,0,0,1,4-4h32a4,4,0,0,1,4,4v32a4,4,0,0,1-4,4H176a4,4,0,0,1-4-4Z"},child:[]}]})(e)}function Qce(e){return Hr({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M236,136v64a12,12,0,0,1-12,12H32a12,12,0,0,1-12-12V136a12,12,0,0,1,12-12H80a4,4,0,0,1,0,8H32a4,4,0,0,0-4,4v64a4,4,0,0,0,4,4H224a4,4,0,0,0,4-4V136a4,4,0,0,0-4-4H176a4,4,0,0,1,0-8h48A12,12,0,0,1,236,136ZM82.83,74.83,124,33.66V128a4,4,0,0,0,8,0V33.66l41.17,41.17a4,4,0,1,0,5.66-5.66l-48-48a4,4,0,0,0-5.66,0l-48,48a4,4,0,0,0,5.66,5.66ZM196,168a8,8,0,1,0-8,8A8,8,0,0,0,196,168Z"},child:[]}]})(e)}function WE(e){return Hr({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M233.34,190.09,145.88,38.22h0a20.75,20.75,0,0,0-35.76,0L22.66,190.09a19.52,19.52,0,0,0,0,19.71A20.36,20.36,0,0,0,40.54,220H215.46a20.36,20.36,0,0,0,17.86-10.2A19.52,19.52,0,0,0,233.34,190.09ZM226.4,205.8a12.47,12.47,0,0,1-10.94,6.2H40.54a12.47,12.47,0,0,1-10.94-6.2,11.45,11.45,0,0,1,0-11.72L117.05,42.21a12.76,12.76,0,0,1,21.9,0L226.4,194.08A11.45,11.45,0,0,1,226.4,205.8ZM124,144V104a4,4,0,0,1,8,0v40a4,4,0,0,1-8,0Zm12,36a8,8,0,1,1-8-8A8,8,0,0,1,136,180Z"},child:[]}]})(e)}const js=({value:e,placeholder:t,autoFocus:r,onChange:n,onBlur:i,onEnter:o,width:a,height:l,type:c,dataTestId:d,autoComplete:f})=>{const p=RB();return x.jsx(C0,{autoComplete:f,"data-testid":d,borderColor:"gray.100",borderStyle:"solid",borderWidth:"1px",padding:"0 9px",placeholder:t,ref:r?p:void 0,value:e,variant:"unstyled",onChange:n,onBlur:i,width:a,height:l,type:c,onKeyDown:o?m=>{m.key==="Enter"&&o()}:void 0})},{ToastContainer:C2,toast:KE}=VZ(),Yce=H5({uri:_ce("REACT_APP_GRAPHQL_SERVER_URL")}),Xce=wce(async()=>({headers:{Authorization:`Bearer ${localStorage.getItem("token")}`}})),Jce=hB(({graphQLErrors:e})=>{if(e)for(const t of e)KE({status:"error",variant:"left-accent",colorScheme:"red",duration:3e3,isClosable:!0,position:"top",description:t.message})}),xr=new cB({connectToDevTools:!0,link:sue([Xce,Jce,Yce]),cache:new aB({typePolicies:{TableModel:{keyFields:["versionId"]},RowModel:{keyFields:["versionId"]}}}),defaultOptions:{watchQuery:{fetchPolicy:"cache-and-network"}}});xr.cache;const RB=()=>O.useCallback(e=>{e&&e.focus()},[]),Df=(e,...t)=>{const r=O.useRef(null),[n,i]=O.useState(t),o=O.useMemo(()=>n.length!==t.length||n.some((a,l)=>a!==t[l])?(i(t),t):n,[t,n]);return r.current||(r.current=dt.get(e)),O.useEffect(()=>{var l;const a=r.current;return(l=a==null?void 0:a.init)==null||l.call(a,...o),()=>{var c;(c=a==null?void 0:a.dispose)==null||c.call(a)}},[o]),r.current};class Zce{constructor(){Pe(this,"registrations",new Map)}register(t,r,n){this.registrations.set(t,{factory:r,scope:n.scope})}get(t){const r=this.registrations.get(t);if(!r)throw new Error(`No provider found for ${t.name}`);return r.scope==="singleton"?(r.instance||(r.instance=r.factory()),r.instance):r.factory()}}const dt=new Zce;class GE{constructor(t){Pe(this,"values");this.values=t,st(this,{},{autoBind:!0})}setValue(t,r){this.values[t]=r}get isValid(){return Object.values(this.values).every(t=>!!t)}}const QE=JSON,ede=e=>e.toUpperCase(),tde=e=>{const t={};return e.forEach((r,n)=>{t[n]=r}),t},rde=(e,t,r)=>e.document?e:{document:e,variables:t,requestHeaders:r,signal:void 0},nde=(e,t,r)=>e.query?e:{query:e,variables:t,requestHeaders:r,signal:void 0},ide=(e,t)=>e.documents?e:{documents:e,requestHeaders:t,signal:void 0},E2=e=>{var n,i;let t;const r=e.definitions.filter(o=>o.kind==="OperationDefinition");return r.length===1&&(t=(i=(n=r[0])==null?void 0:n.name)==null?void 0:i.value),t},y_=e=>{if(typeof e=="string"){let r;try{const n=u5(e);r=E2(n)}catch{}return{query:e,operationName:r}}const t=E2(e);return{query:d5(e),operationName:t}};class Sp extends Error{constructor(t,r){const n=`${Sp.extractMessage(t)}: ${JSON.stringify({response:t,request:r})}`;super(n),Object.setPrototypeOf(this,Sp.prototype),this.response=t,this.request=r,typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Sp)}static extractMessage(t){var r,n;return((n=(r=t.errors)==null?void 0:r[0])==null?void 0:n.message)??`GraphQL Error (Code: ${t.status})`}}var Jh={exports:{}},ode=Jh.exports,T2;function ade(){return T2||(T2=1,function(e,t){var r=typeof self<"u"?self:ode,n=function(){function o(){this.fetch=!1,this.DOMException=r.DOMException}return o.prototype=r,new o}();(function(o){(function(a){var l={searchParams:"URLSearchParams"in o,iterable:"Symbol"in o&&"iterator"in Symbol,blob:"FileReader"in o&&"Blob"in o&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in o,arrayBuffer:"ArrayBuffer"in o};function c(N){return N&&DataView.prototype.isPrototypeOf(N)}if(l.arrayBuffer)var d=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],f=ArrayBuffer.isView||function(N){return N&&d.indexOf(Object.prototype.toString.call(N))>-1};function p(N){if(typeof N!="string"&&(N=String(N)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(N))throw new TypeError("Invalid character in header field name");return N.toLowerCase()}function m(N){return typeof N!="string"&&(N=String(N)),N}function g(N){var X={next:function(){var ce=N.shift();return{done:ce===void 0,value:ce}}};return l.iterable&&(X[Symbol.iterator]=function(){return X}),X}function b(N){this.map={},N instanceof b?N.forEach(function(X,ce){this.append(ce,X)},this):Array.isArray(N)?N.forEach(function(X){this.append(X[0],X[1])},this):N&&Object.getOwnPropertyNames(N).forEach(function(X){this.append(X,N[X])},this)}b.prototype.append=function(N,X){N=p(N),X=m(X);var ce=this.map[N];this.map[N]=ce?ce+", "+X:X},b.prototype.delete=function(N){delete this.map[p(N)]},b.prototype.get=function(N){return N=p(N),this.has(N)?this.map[N]:null},b.prototype.has=function(N){return this.map.hasOwnProperty(p(N))},b.prototype.set=function(N,X){this.map[p(N)]=m(X)},b.prototype.forEach=function(N,X){for(var ce in this.map)this.map.hasOwnProperty(ce)&&N.call(X,this.map[ce],ce,this)},b.prototype.keys=function(){var N=[];return this.forEach(function(X,ce){N.push(ce)}),g(N)},b.prototype.values=function(){var N=[];return this.forEach(function(X){N.push(X)}),g(N)},b.prototype.entries=function(){var N=[];return this.forEach(function(X,ce){N.push([ce,X])}),g(N)},l.iterable&&(b.prototype[Symbol.iterator]=b.prototype.entries);function y(N){if(N.bodyUsed)return Promise.reject(new TypeError("Already read"));N.bodyUsed=!0}function w(N){return new Promise(function(X,ce){N.onload=function(){X(N.result)},N.onerror=function(){ce(N.error)}})}function _(N){var X=new FileReader,ce=w(X);return X.readAsArrayBuffer(N),ce}function S(N){var X=new FileReader,ce=w(X);return X.readAsText(N),ce}function C(N){for(var X=new Uint8Array(N),ce=new Array(X.length),ne=0;ne<X.length;ne++)ce[ne]=String.fromCharCode(X[ne]);return ce.join("")}function k(N){if(N.slice)return N.slice(0);var X=new Uint8Array(N.byteLength);return X.set(new Uint8Array(N)),X.buffer}function E(){return this.bodyUsed=!1,this._initBody=function(N){this._bodyInit=N,N?typeof N=="string"?this._bodyText=N:l.blob&&Blob.prototype.isPrototypeOf(N)?this._bodyBlob=N:l.formData&&FormData.prototype.isPrototypeOf(N)?this._bodyFormData=N:l.searchParams&&URLSearchParams.prototype.isPrototypeOf(N)?this._bodyText=N.toString():l.arrayBuffer&&l.blob&&c(N)?(this._bodyArrayBuffer=k(N.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):l.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(N)||f(N))?this._bodyArrayBuffer=k(N):this._bodyText=N=Object.prototype.toString.call(N):this._bodyText="",this.headers.get("content-type")||(typeof N=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):l.searchParams&&URLSearchParams.prototype.isPrototypeOf(N)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},l.blob&&(this.blob=function(){var N=y(this);if(N)return N;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?y(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(_)}),this.text=function(){var N=y(this);if(N)return N;if(this._bodyBlob)return S(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(C(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},l.formData&&(this.formData=function(){return this.text().then(M)}),this.json=function(){return this.text().then(JSON.parse)},this}var R=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function T(N){var X=N.toUpperCase();return R.indexOf(X)>-1?X:N}function A(N,X){X=X||{};var ce=X.body;if(N instanceof A){if(N.bodyUsed)throw new TypeError("Already read");this.url=N.url,this.credentials=N.credentials,X.headers||(this.headers=new b(N.headers)),this.method=N.method,this.mode=N.mode,this.signal=N.signal,!ce&&N._bodyInit!=null&&(ce=N._bodyInit,N.bodyUsed=!0)}else this.url=String(N);if(this.credentials=X.credentials||this.credentials||"same-origin",(X.headers||!this.headers)&&(this.headers=new b(X.headers)),this.method=T(X.method||this.method||"GET"),this.mode=X.mode||this.mode||null,this.signal=X.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&ce)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(ce)}A.prototype.clone=function(){return new A(this,{body:this._bodyInit})};function M(N){var X=new FormData;return N.trim().split("&").forEach(function(ce){if(ce){var ne=ce.split("="),ee=ne.shift().replace(/\+/g," "),ge=ne.join("=").replace(/\+/g," ");X.append(decodeURIComponent(ee),decodeURIComponent(ge))}}),X}function B(N){var X=new b,ce=N.replace(/\r?\n[\t ]+/g," ");return ce.split(/\r?\n/).forEach(function(ne){var ee=ne.split(":"),ge=ee.shift().trim();if(ge){var Z=ee.join(":").trim();X.append(ge,Z)}}),X}E.call(A.prototype);function Q(N,X){X||(X={}),this.type="default",this.status=X.status===void 0?200:X.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in X?X.statusText:"OK",this.headers=new b(X.headers),this.url=X.url||"",this._initBody(N)}E.call(Q.prototype),Q.prototype.clone=function(){return new Q(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new b(this.headers),url:this.url})},Q.error=function(){var N=new Q(null,{status:0,statusText:""});return N.type="error",N};var se=[301,302,303,307,308];Q.redirect=function(N,X){if(se.indexOf(X)===-1)throw new RangeError("Invalid status code");return new Q(null,{status:X,headers:{location:N}})},a.DOMException=o.DOMException;try{new a.DOMException}catch{a.DOMException=function(X,ce){this.message=X,this.name=ce;var ne=Error(X);this.stack=ne.stack},a.DOMException.prototype=Object.create(Error.prototype),a.DOMException.prototype.constructor=a.DOMException}function ie(N,X){return new Promise(function(ce,ne){var ee=new A(N,X);if(ee.signal&&ee.signal.aborted)return ne(new a.DOMException("Aborted","AbortError"));var ge=new XMLHttpRequest;function Z(){ge.abort()}ge.onload=function(){var j={status:ge.status,statusText:ge.statusText,headers:B(ge.getAllResponseHeaders()||"")};j.url="responseURL"in ge?ge.responseURL:j.headers.get("X-Request-URL");var U="response"in ge?ge.response:ge.responseText;ce(new Q(U,j))},ge.onerror=function(){ne(new TypeError("Network request failed"))},ge.ontimeout=function(){ne(new TypeError("Network request failed"))},ge.onabort=function(){ne(new a.DOMException("Aborted","AbortError"))},ge.open(ee.method,ee.url,!0),ee.credentials==="include"?ge.withCredentials=!0:ee.credentials==="omit"&&(ge.withCredentials=!1),"responseType"in ge&&l.blob&&(ge.responseType="blob"),ee.headers.forEach(function(j,U){ge.setRequestHeader(U,j)}),ee.signal&&(ee.signal.addEventListener("abort",Z),ge.onreadystatechange=function(){ge.readyState===4&&ee.signal.removeEventListener("abort",Z)}),ge.send(typeof ee._bodyInit>"u"?null:ee._bodyInit)})}return ie.polyfill=!0,o.fetch||(o.fetch=ie,o.Headers=b,o.Request=A,o.Response=Q),a.Headers=b,a.Request=A,a.Response=Q,a.fetch=ie,Object.defineProperty(a,"__esModule",{value:!0}),a})({})})(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;t=i.fetch,t.default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t}(Jh,Jh.exports)),Jh.exports}var Nb=ade();const tb=mc(Nb),sde=o0({__proto__:null,default:tb},[Nb]),hd=e=>{let t={};return e&&(typeof Headers<"u"&&e instanceof Headers||sde&&Nb.Headers&&e instanceof Nb.Headers?t=tde(e):Array.isArray(e)?e.forEach(([r,n])=>{r&&n!==void 0&&(t[r]=n)}):t=e),t},O2=e=>e.replace(/([\s,]|#[^\n\r]+)+/g," ").trim(),lde=e=>{if(!Array.isArray(e.query)){const n=e,i=[`query=${encodeURIComponent(O2(n.query))}`];return e.variables&&i.push(`variables=${encodeURIComponent(n.jsonSerializer.stringify(n.variables))}`),n.operationName&&i.push(`operationName=${encodeURIComponent(n.operationName)}`),i.join("&")}if(typeof e.variables<"u"&&!Array.isArray(e.variables))throw new Error("Cannot create query with given variable type, array expected");const t=e,r=e.query.reduce((n,i,o)=>(n.push({query:O2(i),variables:t.variables?t.jsonSerializer.stringify(t.variables[o]):void 0}),n),[]);return`query=${encodeURIComponent(t.jsonSerializer.stringify(r))}`},ude=e=>async t=>{const{url:r,query:n,variables:i,operationName:o,fetch:a,fetchOptions:l,middleware:c}=t,d={...t.headers};let f="",p;e==="POST"?(p=dde(n,i,o,l.jsonSerializer),typeof p=="string"&&(d["Content-Type"]="application/json")):f=lde({query:n,variables:i,operationName:o,jsonSerializer:l.jsonSerializer??QE});const m={method:e,headers:d,body:p,...l};let g=r,b=m;if(c){const y=await Promise.resolve(c({...m,url:r,operationName:o,variables:i})),{url:w,..._}=y;g=w,b=_}return f&&(g=`${g}?${f}`),await a(g,b)};class cde{constructor(t,r={}){this.url=t,this.requestConfig=r,this.rawRequest=async(...n)=>{const[i,o,a]=n,l=nde(i,o,a),{headers:c,fetch:d=tb,method:f="POST",requestMiddleware:p,responseMiddleware:m,...g}=this.requestConfig,{url:b}=this;l.signal!==void 0&&(g.signal=l.signal);const{operationName:y}=y_(l.query);return b_({url:b,query:l.query,variables:l.variables,headers:{...hd(w_(c)),...hd(l.requestHeaders)},operationName:y,fetch:d,method:f,fetchOptions:g,middleware:p}).then(w=>(m&&m(w),w)).catch(w=>{throw m&&m(w),w})}}async request(t,...r){const[n,i]=r,o=rde(t,n,i),{headers:a,fetch:l=tb,method:c="POST",requestMiddleware:d,responseMiddleware:f,...p}=this.requestConfig,{url:m}=this;o.signal!==void 0&&(p.signal=o.signal);const{query:g,operationName:b}=y_(o.document);return b_({url:m,query:g,variables:o.variables,headers:{...hd(w_(a)),...hd(o.requestHeaders)},operationName:b,fetch:l,method:c,fetchOptions:p,middleware:d}).then(y=>(f&&f(y),y.data)).catch(y=>{throw f&&f(y),y})}batchRequests(t,r){const n=ide(t,r),{headers:i,...o}=this.requestConfig;n.signal!==void 0&&(o.signal=n.signal);const a=n.documents.map(({document:c})=>y_(c).query),l=n.documents.map(({variables:c})=>c);return b_({url:this.url,query:a,variables:l,headers:{...hd(w_(i)),...hd(n.requestHeaders)},operationName:void 0,fetch:this.requestConfig.fetch??tb,method:this.requestConfig.method||"POST",fetchOptions:o,middleware:this.requestConfig.requestMiddleware}).then(c=>(this.requestConfig.responseMiddleware&&this.requestConfig.responseMiddleware(c),c.data)).catch(c=>{throw this.requestConfig.responseMiddleware&&this.requestConfig.responseMiddleware(c),c})}setHeaders(t){return this.requestConfig.headers=t,this}setHeader(t,r){const{headers:n}=this.requestConfig;return n?n[t]=r:this.requestConfig.headers={[t]:r},this}setEndpoint(t){return this.url=t,this}}const b_=async e=>{const{query:t,variables:r,fetchOptions:n}=e,i=ude(ede(e.method??"post")),o=Array.isArray(e.query),a=await i(e),l=await fde(a,n.jsonSerializer??QE),c=Array.isArray(l)?!l.some(({data:f})=>!f):!!l.data,d=Array.isArray(l)||!l.errors||Array.isArray(l.errors)&&!l.errors.length||n.errorPolicy==="all"||n.errorPolicy==="ignore";if(a.ok&&d&&c){const{errors:f,...p}=(Array.isArray(l),l),m=n.errorPolicy==="ignore"?p:l;return{...o?{data:m}:m,headers:a.headers,status:a.status}}else{const f=typeof l=="string"?{error:l}:l;throw new Sp({...f,status:a.status,headers:a.headers},{query:t,variables:r})}},dde=(e,t,r,n)=>{const i=n??QE;if(!Array.isArray(e))return i.stringify({query:e,variables:t,operationName:r});if(typeof t<"u"&&!Array.isArray(t))throw new Error("Cannot create request body with given variable type, array expected");const o=e.reduce((a,l,c)=>(a.push({query:l,variables:t?t[c]:void 0}),a),[]);return i.stringify(o)},fde=async(e,t)=>{let r;return e.headers.forEach((n,i)=>{i.toLowerCase()==="content-type"&&(r=n)}),r&&(r.toLowerCase().startsWith("application/json")||r.toLowerCase().startsWith("application/graphql+json")||r.toLowerCase().startsWith("application/graphql-response+json"))?t.parse(await e.text()):e.text()},w_=e=>typeof e=="function"?e():e;Ne`
|
442
|
+
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):a||EP.set(i,a=new Set),a.add(o),t.has(o)||(t.add(o),r.push(n))}else r.push(n)}),ve(ve({},e),{definitions:r})}function uce(e){var t=new Set(e.definitions);t.forEach(function(n){n.loc&&delete n.loc,Object.keys(n).forEach(function(i){var o=n[i];o&&typeof o=="object"&&t.add(o)})});var r=e.loc;return r&&(delete r.startToken,delete r.endToken),e}function cce(e){var t=fB(e);if(!eb.has(t)){var r=u5(e,{experimentalFragmentVariables:Ab,allowLegacyFragmentVariables:Ab});if(!r||r.kind!=="Document")throw new Error("Not a valid GraphQL document.");eb.set(t,uce(lce(r)))}return eb.get(t)}function Ne(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];typeof e=="string"&&(e=[e]);var n=e[0];return t.forEach(function(i,o){i&&i.kind==="Document"?n+=i.loc.source.body:n+=i,n+=e[o+1]}),cce(n)}function dce(){eb.clear(),EP.clear()}function fce(){dB=!1}function hce(){Ab=!0}function pce(){Ab=!1}var Mh={gql:Ne,resetCaches:dce,disableFragmentWarnings:fce,enableExperimentalFragmentVariables:hce,disableExperimentalFragmentVariables:pce};(function(e){e.gql=Mh.gql,e.resetCaches=Mh.resetCaches,e.disableFragmentWarnings=Mh.disableFragmentWarnings,e.enableExperimentalFragmentVariables=Mh.enableExperimentalFragmentVariables,e.disableExperimentalFragmentVariables=Mh.disableExperimentalFragmentVariables})(Ne||(Ne={}));Ne.default=Ne;var g_={exports:{}},bA;function mce(){return bA||(bA=1,function(e){e.exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=void 0,e.exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=void 0,e.exports.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=void 0,Object.assign(e.exports,wm())}(g_)),g_.exports}var Nl=mce();const vce=mc(Nl),gce=o0({__proto__:null,default:vce},[Nl]);var wA=TE?Symbol.for("__APOLLO_CONTEXT__"):"__APOLLO_CONTEXT__";function yce(){_t("createContext"in gce,45);var e=Nl.createContext[wA];return e||(Object.defineProperty(Nl.createContext,wA,{value:e=Nl.createContext({}),enumerable:!1,writable:!1,configurable:!0}),e.displayName="ApolloContext"),e}var bce=function(e){var t=e.client,r=e.children,n=yce(),i=Nl.useContext(n),o=Nl.useMemo(function(){return ve(ve({},i),{client:t||i.client})},[i,t]);return _t(o.client,46),Nl.createElement(n.Provider,{value:o},r)};function wce(e){return new Ws(function(t,r){var n=Ms(t,[]);return new Rr(function(i){var o,a=!1;return Promise.resolve(n).then(function(l){return e(l,t.getContext())}).then(t.setContext).then(function(){a||(o=r(t).subscribe({next:i.next.bind(i),error:i.error.bind(i),complete:i.complete.bind(i)}))}).catch(i.error.bind(i)),function(){a=!0,o&&o.unsubscribe()}})})}function hB(e){return new Ws(function(t,r){return new Rr(function(n){var i,o,a;try{i=r(t).subscribe({next:function(l){if(l.errors&&(a=e({graphQLErrors:l.errors,response:l,operation:t,forward:r}),a)){o=a.subscribe({next:n.next.bind(n),error:n.error.bind(n),complete:n.complete.bind(n)});return}n.next(l)},error:function(l){if(a=e({operation:t,networkError:l,graphQLErrors:l&&l.result&&l.result.errors,forward:r}),a){o=a.subscribe({next:n.next.bind(n),error:n.error.bind(n),complete:n.complete.bind(n)});return}n.error(l)},complete:function(){a||n.complete.bind(n)()}})}catch(l){e({networkError:l,operation:t,forward:r}),n.error(l)}return function(){i&&i.unsubscribe(),o&&i.unsubscribe()}})})}(function(e){ga(t,e);function t(r){var n=e.call(this)||this;return n.link=hB(r),n}return t.prototype.request=function(r,n){return this.link.request(r,n)},t})(Ws);const Sce={BASE_URL:"/",DEV:!1,GIT_BRANCH_NAME:"HEAD",GIT_COMMIT_HASH:"f61b09c",MODE:"production",PACKAGE_VERSION:"1.0.0",PROD:!0,REACT_APP_ENDPOINT_HOST:"",REACT_APP_ENDPOINT_PORT:"",REACT_APP_ENDPOINT_SERVER_URL:"/endpoint",REACT_APP_GRAPHQL_SERVER_URL:"/graphql",REACT_APP_SWAGGER_SERVER_URL:"/api",SSR:!1},_ce=e=>{var n;const t=(n=window.__env__)==null?void 0:n[e],r=Sce[e];return t||r},UE="/",xc="login",pB="logout",Y0="signup",mB="username",vB="github",gB="google",yB="completed",xce="confirm",Fl="app",Ll=":organizationId",Bl=":projectName",Vl=":branchName",X0="-/draft",bB="-/:revisionId",wp=":tableId",wB=":rowId";var zr=(e=>(e.Organization="organization",e.Project="project",e.Branch="branch",e.DraftRevision="draftRevision",e.HeadRevision="headRevision",e.SpecificRevision="specificRevision",e.DraftTable="draftTable",e.HeadTable="headTable",e.SpecificTable="specificTable",e.DraftRow="draftRow",e.HeadRow="headRow",e.SpecificRow="specificRow",e))(zr||{});const $f=({hideSidebar:e,sidebar:t,title:r,actions:n,children:i})=>x.jsxs(je,{minHeight:"100vh",children:[!e&&x.jsxs(je,{backgroundColor:"gray.50",borderRight:"1px solid",borderRightColor:"gray.200",flexDirection:"column",justifyContent:t?"space-between":"flex-end",padding:"1rem",width:"250px",height:"100vh",top:0,position:"sticky",children:[x.jsx(wt,{children:t}),x.jsx(Cf,{color:"gray.400",alignSelf:"center",as:qo,to:`/${pB}`,children:"Logout"})]}),x.jsxs(je,{alignItems:"center",flex:1,flexDirection:"column",width:"100%",children:[(r||n)&&x.jsxs(je,{alignItems:"center",backgroundColor:"white",borderBottom:"1px solid",borderBottomColor:"gray.50",justifyContent:"space-between",maxWidth:"900px",padding:"8px",width:"100%",position:"sticky",zIndex:1,top:0,children:[r,n]}),x.jsx(je,{flex:1,flexDirection:"column",maxWidth:"900px",padding:"1rem 1rem 0rem 1rem",width:"100%",children:i})]})]});var Pce=bc({viewBox:"0 0 14 14",d:"M14,7.77 L14,6.17 L12.06,5.53 L11.61,4.44 L12.49,2.6 L11.36,1.47 L9.55,2.38 L8.46,1.93 L7.77,0.01 L6.17,0.01 L5.54,1.95 L4.43,2.4 L2.59,1.52 L1.46,2.65 L2.37,4.46 L1.92,5.55 L0,6.23 L0,7.82 L1.94,8.46 L2.39,9.55 L1.51,11.39 L2.64,12.52 L4.45,11.61 L5.54,12.06 L6.23,13.98 L7.82,13.98 L8.45,12.04 L9.56,11.59 L11.4,12.47 L12.53,11.34 L11.61,9.53 L12.08,8.44 L14,7.75 L14,7.77 Z M7,10 C5.34,10 4,8.66 4,7 C4,5.34 5.34,4 7,4 C8.66,4 10,5.34 10,7 C10,8.66 8.66,10 7,10 Z",displayName:"SettingsIcon"}),Cce=bc({displayName:"CloseIcon",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"}),Ece=bc({d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z",displayName:"CopyIcon"}),J0=bc({displayName:"DeleteIcon",path:x.jsx("g",{fill:"currentColor",children:x.jsx("path",{d:"M19.452 7.5H4.547a.5.5 0 00-.5.545l1.287 14.136A2 2 0 007.326 24h9.347a2 2 0 001.992-1.819L19.95 8.045a.5.5 0 00-.129-.382.5.5 0 00-.369-.163zm-9.2 13a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zm5 0a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zM22 4h-4.75a.25.25 0 01-.25-.25V2.5A2.5 2.5 0 0014.5 0h-5A2.5 2.5 0 007 2.5v1.25a.25.25 0 01-.25.25H2a1 1 0 000 2h20a1 1 0 000-2zM9 3.75V2.5a.5.5 0 01.5-.5h5a.5.5 0 01.5.5v1.25a.25.25 0 01-.25.25h-5.5A.25.25 0 019 3.75z"})})}),Tce=bc({viewBox:"0 0 10 10",d:"M3,2 C2.44771525,2 2,1.55228475 2,1 C2,0.44771525 2.44771525,0 3,0 C3.55228475,0 4,0.44771525 4,1 C4,1.55228475 3.55228475,2 3,2 Z M3,6 C2.44771525,6 2,5.55228475 2,5 C2,4.44771525 2.44771525,4 3,4 C3.55228475,4 4,4.44771525 4,5 C4,5.55228475 3.55228475,6 3,6 Z M3,10 C2.44771525,10 2,9.55228475 2,9 C2,8.44771525 2.44771525,8 3,8 C3.55228475,8 4,8.44771525 4,9 C4,9.55228475 3.55228475,10 3,10 Z M7,2 C6.44771525,2 6,1.55228475 6,1 C6,0.44771525 6.44771525,0 7,0 C7.55228475,0 8,0.44771525 8,1 C8,1.55228475 7.55228475,2 7,2 Z M7,6 C6.44771525,6 6,5.55228475 6,5 C6,4.44771525 6.44771525,4 7,4 C7.55228475,4 8,4.44771525 8,5 C8,5.55228475 7.55228475,6 7,6 Z M7,10 C6.44771525,10 6,9.55228475 6,9 C6,8.44771525 6.44771525,8 7,8 C7.55228475,8 8,8.44771525 8,9 C8,9.55228475 7.55228475,10 7,10 Z",displayName:"DragHandleIcon"}),SB=bc({viewBox:"0 0 14 14",path:x.jsx("g",{fill:"currentColor",children:x.jsx("polygon",{points:"5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039"})})}),Oce=bc({d:"M0,12a1.5,1.5,0,0,0,1.5,1.5h8.75a.25.25,0,0,1,.25.25V22.5a1.5,1.5,0,0,0,3,0V13.75a.25.25,0,0,1,.25-.25H22.5a1.5,1.5,0,0,0,0-3H13.75a.25.25,0,0,1-.25-.25V1.5a1.5,1.5,0,0,0-3,0v8.75a.25.25,0,0,1-.25.25H1.5A1.5,1.5,0,0,0,0,12Z",displayName:"AddIcon"});const ks=({height:e="2.5rem",title:t,onClick:r,isDisabled:n,isSelected:i,isLoading:o,icon:a,dataTestId:l})=>x.jsx(Lo,{"data-testid":l,_hover:{color:"gray.400"},_disabled:i?{backgroundColor:"gray.50",cursor:"not-allowed"}:void 0,alignSelf:"flex-start",color:"gray.300",fontWeight:"500",height:e,isDisabled:n||i,isLoading:o,variant:"ghost",onClick:r,children:x.jsxs(je,{alignItems:"center",gap:"0.5rem",children:[a,x.jsx(bt,{children:t})]})}),Af=e=>x.jsx(ks,{...e,icon:x.jsx(Oce,{boxSize:3})}),Qm=({height:e="2.5rem",loading:t,isDisabled:r,onClick:n,title:i,dataTestId:o})=>x.jsxs(Lo,{"data-testid":o,_hover:{backgroundColor:"gray.50"},alignSelf:"flex-start",color:"gray.400",height:e,isLoading:t,isDisabled:r,variant:"ghost",onClick:n,width:"48px",children:[x.jsx(SB,{boxSize:3,mr:i?2:0}),i]}),Z0=({height:e="2.5rem",onClick:t,isDisabled:r,dataTestId:n})=>x.jsx(Lo,{"data-testid":n,isDisabled:r,_hover:{backgroundColor:"gray.50"},alignSelf:"flex-start",color:"gray.400",height:e,variant:"ghost",onClick:t,width:"48px",children:x.jsx(Cce,{boxSize:3})});var _B={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},SA=Re.createContext&&Re.createContext(_B),Rce=["attr","size","title"];function Ice(e,t){if(e==null)return{};var r=kce(e,t),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function kce(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Db(){return Db=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Db.apply(this,arguments)}function _A(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Mb(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?_A(Object(r),!0).forEach(function(n){jce(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_A(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function jce(e,t,r){return t=$ce(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $ce(e){var t=Ace(e,"string");return typeof t=="symbol"?t:t+""}function Ace(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function xB(e){return e&&e.map((t,r)=>Re.createElement(t.tag,Mb({key:r},t.attr),xB(t.child)))}function Hr(e){return t=>Re.createElement(Dce,Db({attr:Mb({},e.attr)},t),xB(e.child))}function Dce(e){var t=r=>{var{attr:n,size:i,title:o}=e,a=Ice(e,Rce),l=i||r.size||"1em",c;return r.className&&(c=r.className),e.className&&(c=(c?c+" ":"")+e.className),Re.createElement("svg",Db({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,a,{className:c,style:Mb(Mb({color:e.color||r.color},r.style),e.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),o&&Re.createElement("title",null,o),e.children)};return SA!==void 0?Re.createElement(SA.Consumer,null,r=>t(r)):t(_B)}function PB(e){return Hr({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M228,128a100,100,0,0,1-98.66,100H128a99.39,99.39,0,0,1-68.62-27.29,12,12,0,0,1,16.48-17.45,76,76,0,1,0-1.57-109c-.13.13-.25.25-.39.37L54.89,92H72a12,12,0,0,1,0,24H24a12,12,0,0,1-12-12V56a12,12,0,0,1,24,0V76.72L57.48,57.06A100,100,0,0,1,228,128Z"},child:[]}]})(e)}function HE(e){return Hr({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M156,128a28,28,0,1,1-28-28A28,28,0,0,1,156,128Z"},child:[]}]})(e)}function CB(e){return Hr({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M216,104v8a56.06,56.06,0,0,1-48.44,55.47A39.8,39.8,0,0,1,176,192v40a8,8,0,0,1-8,8H104a8,8,0,0,1-8-8V216H72a40,40,0,0,1-40-40A24,24,0,0,0,8,152a8,8,0,0,1,0-16,40,40,0,0,1,40,40,24,24,0,0,0,24,24H96v-8a39.8,39.8,0,0,1,8.44-24.53A56.06,56.06,0,0,1,56,112v-8a58.14,58.14,0,0,1,7.69-28.32A59.78,59.78,0,0,1,69.07,28,8,8,0,0,1,76,24a59.75,59.75,0,0,1,48,24h24a59.75,59.75,0,0,1,48-24,8,8,0,0,1,6.93,4,59.74,59.74,0,0,1,5.37,47.68A58,58,0,0,1,216,104Z"},child:[]}]})(e)}function EB(e){return Hr({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M128,24A104,104,0,1,0,232,128,104,104,0,0,0,128,24Zm0,184A80,80,0,1,1,181.34,68.37a8,8,0,0,1-10.67,11.92A64,64,0,1,0,191.5,136H128a8,8,0,0,1,0-16h72a8,8,0,0,1,8,8A80.09,80.09,0,0,1,128,208Z"},child:[]}]})(e)}function xA(e){return Hr({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z"},child:[]}]})(e)}function Mce(e){return Hr({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Zm34.83-86.83a4,4,0,0,1,0,5.66l-32,32a4,4,0,0,1-5.66,0l-32-32a4,4,0,0,1,5.66-5.66L124,158.34V88a4,4,0,0,1,8,0v70.34l25.17-25.17A4,4,0,0,1,162.83,133.17Z"},child:[]}]})(e)}function Nce(e){return Hr({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Zm42.83-94.83a4,4,0,0,1,0,5.66l-32,32a4,4,0,0,1-5.66-5.66L158.34,132H88a4,4,0,0,1,0-8h70.34L133.17,98.83a4,4,0,0,1,5.66-5.66Z"},child:[]}]})(e)}function Fce(e){return Hr({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M202.83,146.83l-72,72a4,4,0,0,1-5.66,0l-72-72a4,4,0,0,1,5.66-5.66L124,206.34V40a4,4,0,0,1,8,0V206.34l65.17-65.17a4,4,0,0,1,5.66,5.66Z"},child:[]}]})(e)}function Lce(e){return Hr({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M218.83,130.83l-72,72a4,4,0,0,1-5.66-5.66L206.34,132H40a4,4,0,0,1,0-8H206.34L141.17,58.83a4,4,0,0,1,5.66-5.66l72,72A4,4,0,0,1,218.83,130.83Z"},child:[]}]})(e)}function Bce(e){return Hr({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M35.89,128C52,136.23,52,155.64,52,172c0,24.8,1.35,40,28,40a4,4,0,0,1,0,8c-36,0-36-26.61-36-48,0-24.8-1.35-40-28-40a4,4,0,0,1,0-8c26.65,0,28-15.2,28-40,0-21.39,0-48,36-48a4,4,0,0,1,0,8C53.35,44,52,59.2,52,84,52,100.36,52,119.77,35.89,128ZM240,124c-26.65,0-28-15.2-28-40,0-21.39,0-48-36-48a4,4,0,0,0,0,8c26.65,0,28,15.2,28,40,0,16.36,0,35.77,16.11,44C204,136.23,204,155.64,204,172c0,24.8-1.35,40-28,40a4,4,0,0,0,0,8c36,0,36-26.61,36-48,0-24.8,1.35-40,28-40a4,4,0,0,0,0-8Z"},child:[]}]})(e)}function Vce(e){return Hr({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M162.83,205.17a4,4,0,0,1-5.66,5.66l-80-80a4,4,0,0,1,0-5.66l80-80a4,4,0,1,1,5.66,5.66L85.66,128Z"},child:[]}]})(e)}function zce(e){return Hr({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M155.87,36.06a4,4,0,0,1-3.87,3,4.29,4.29,0,0,1-1-.13,92,92,0,0,0-46,0,4,4,0,0,1-2-7.74,100.09,100.09,0,0,1,50,0A4,4,0,0,1,155.87,36.06ZM56.65,57.94a100.18,100.18,0,0,0-25,43.29,4,4,0,0,0,7.71,2.14,92.06,92.06,0,0,1,23-39.82,4,4,0,1,0-5.7-5.61ZM39.36,152.62a4,4,0,0,0-7.71,2.14,100.08,100.08,0,0,0,25,43.31,4,4,0,1,0,5.71-5.61A91.91,91.91,0,0,1,39.36,152.62ZM151,217.09a92,92,0,0,1-46,0,4,4,0,0,0-2,7.75,100,100,0,0,0,50,0,4,4,0,1,0-2-7.74Zm70.58-67.25a4,4,0,0,0-4.92,2.79,92.12,92.12,0,0,1-23,39.82,4,4,0,1,0,5.7,5.61,100.18,100.18,0,0,0,25-43.29A4,4,0,0,0,221.58,149.84Zm-4.94-46.46a4,4,0,0,0,7.71-2.14,100.08,100.08,0,0,0-25-43.31,4,4,0,1,0-5.71,5.61A91.91,91.91,0,0,1,216.64,103.38Z"},child:[]}]})(e)}function PA(e){return Hr({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Z"},child:[]}]})(e)}function qce(e){return Hr({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M192.14,42.55C174.94,33.17,152.16,28,128,28S81.06,33.17,63.86,42.55C45.89,52.35,36,65.65,36,80v96c0,14.35,9.89,27.65,27.86,37.45,17.2,9.38,40,14.55,64.14,14.55s46.94-5.17,64.14-14.55c18-9.8,27.86-23.1,27.86-37.45V80C220,65.65,210.11,52.35,192.14,42.55ZM212,176c0,11.29-8.41,22.1-23.69,30.43C172.27,215.18,150.85,220,128,220s-44.27-4.82-60.31-13.57C52.41,198.1,44,187.29,44,176V149.48c4.69,5.93,11.37,11.34,19.86,16,17.2,9.38,40,14.55,64.14,14.55s46.94-5.17,64.14-14.55c8.49-4.63,15.17-10,19.86-16Zm0-48c0,11.29-8.41,22.1-23.69,30.43C172.27,167.18,150.85,172,128,172s-44.27-4.82-60.31-13.57C52.41,150.1,44,139.29,44,128V101.48c4.69,5.93,11.37,11.34,19.86,16,17.2,9.38,40,14.55,64.14,14.55s46.94-5.17,64.14-14.55c8.49-4.63,15.17-10,19.86-16Zm-23.69-17.57C172.27,119.18,150.85,124,128,124s-44.27-4.82-60.31-13.57C52.41,102.1,44,91.29,44,80s8.41-22.1,23.69-30.43C83.73,40.82,105.15,36,128,36s44.27,4.82,60.31,13.57C203.59,57.9,212,68.71,212,80S203.59,102.1,188.31,110.43Z"},child:[]}]})(e)}function Uce(e){return Hr({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M128,100a28,28,0,1,0,28,28A28,28,0,0,0,128,100Zm0,48a20,20,0,1,1,20-20A20,20,0,0,1,128,148Z"},child:[]}]})(e)}function TB(e){return Hr({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M243.66,126.38c-.34-.76-8.52-18.89-26.83-37.2C199.87,72.22,170.7,52,128,52S56.13,72.22,39.17,89.18c-18.31,18.31-26.49,36.44-26.83,37.2a4.08,4.08,0,0,0,0,3.25c.34.77,8.52,18.89,26.83,37.2,17,17,46.14,37.17,88.83,37.17s71.87-20.21,88.83-37.17c18.31-18.31,26.49-36.43,26.83-37.2A4.08,4.08,0,0,0,243.66,126.38Zm-32.7,35c-23.07,23-51,34.62-83,34.62s-59.89-11.65-83-34.62A135.71,135.71,0,0,1,20.44,128,135.69,135.69,0,0,1,45,94.62C68.11,71.65,96,60,128,60s59.89,11.65,83,34.62A135.79,135.79,0,0,1,235.56,128,135.71,135.71,0,0,1,211,161.38ZM128,84a44,44,0,1,0,44,44A44.05,44.05,0,0,0,128,84Zm0,80a36,36,0,1,1,36-36A36,36,0,0,1,128,164Z"},child:[]}]})(e)}function OB(e){return Hr({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M236,88.12a50.44,50.44,0,0,1-14.81,34.31l-34.75,34.74A50.33,50.33,0,0,1,150.62,172h-.05A50.63,50.63,0,0,1,100,120a4,4,0,0,1,4-3.89h.11a4,4,0,0,1,3.89,4.11A42.64,42.64,0,0,0,150.58,164h0a42.32,42.32,0,0,0,30.14-12.49l34.75-34.74a42.63,42.63,0,1,0-60.29-60.28l-11,11a4,4,0,0,1-5.66-5.65l11-11A50.64,50.64,0,0,1,236,88.12ZM111.78,188.49l-11,11A42.33,42.33,0,0,1,70.6,212h0a42.63,42.63,0,0,1-30.11-72.77l34.75-34.74A42.63,42.63,0,0,1,148,135.82a4,4,0,0,0,8,.23A50.64,50.64,0,0,0,69.55,98.83L34.8,133.57A50.63,50.63,0,0,0,70.56,220h0a50.33,50.33,0,0,0,35.81-14.83l11-11a4,4,0,1,0-5.65-5.66Z"},child:[]}]})(e)}function Hce(e){return Hr({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M234.83,21.17a4,4,0,0,0-5.66,0L173.94,76.4l-8.2-8.2a28,28,0,0,0-39.6,0L100,94.34l-9.17-9.17a4,4,0,0,0-5.66,5.66L94.34,100,68.2,126.14a28,28,0,0,0,0,39.6l8.2,8.2L21.17,229.17a4,4,0,0,0,5.66,5.66L82.06,179.6l8.2,8.2a28,28,0,0,0,39.6,0L156,161.66l9.17,9.17a4,4,0,0,0,5.66-5.66L161.66,156l26.14-26.14a28,28,0,0,0,0-39.6l-8.2-8.2,55.23-55.23A4,4,0,0,0,234.83,21.17Zm-110.63,161a20,20,0,0,1-28.28,0L73.86,160.08a20,20,0,0,1,0-28.28L100,105.66,150.34,156Zm57.94-57.94L156,150.34,105.66,100,131.8,73.86a20,20,0,0,1,28.28,0l22.06,22.06A20,20,0,0,1,182.14,124.2ZM92.29,33.49a4,4,0,1,1,7.42-3l8,20a4,4,0,0,1-2.22,5.2A3.91,3.91,0,0,1,104,56a4,4,0,0,1-3.71-2.51Zm-64,61a4,4,0,0,1,5.2-2.22l20,8A4,4,0,0,1,52,108a3.91,3.91,0,0,1-1.49-.29l-20-8A4,4,0,0,1,28.29,94.51Zm199.42,67A4,4,0,0,1,224,164a3.91,3.91,0,0,1-1.49-.29l-20-8a4,4,0,1,1,3-7.42l20,8A4,4,0,0,1,227.71,161.49Zm-64,61a4,4,0,0,1-2.22,5.2A3.91,3.91,0,0,1,160,228a4,4,0,0,1-3.71-2.51l-8-20a4,4,0,0,1,7.42-3Z"},child:[]}]})(e)}function Wce(e){return Hr({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M146.83,141.17a4,4,0,0,0-5.66,0L120,162.34,93.66,136l21.17-21.17a4,4,0,0,0-5.66-5.66L88,130.34,66.83,109.17a4,4,0,0,0-5.66,5.66L70.34,124,44.2,150.14a28,28,0,0,0,0,39.6l8.2,8.2L21.17,229.17a4,4,0,0,0,5.66,5.66L58.06,203.6l8.2,8.2a28,28,0,0,0,39.6,0L132,185.66l9.17,9.17a4,4,0,0,0,5.66-5.66L125.66,168l21.17-21.17A4,4,0,0,0,146.83,141.17Zm-46.63,65a20,20,0,0,1-28.28,0L49.86,184.08a20,20,0,0,1,0-28.28L76,129.66,126.34,180Zm134.63-185a4,4,0,0,0-5.66,0L197.94,52.4l-8.2-8.2a28,28,0,0,0-39.6,0L124,70.34l-9.17-9.17a4,4,0,0,0-5.66,5.66l80,80a4,4,0,0,0,5.66-5.66L185.66,132l26.14-26.14a28,28,0,0,0,0-39.6l-8.2-8.2,31.23-31.23A4,4,0,0,0,234.83,21.17ZM212,86.06a19.86,19.86,0,0,1-5.86,14.14L180,126.34,129.66,76,155.8,49.86a20,20,0,0,1,28.28,0l22.06,22.06A19.85,19.85,0,0,1,212,86.06Z"},child:[]}]})(e)}function Kce(e){return Hr({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M234.83,109.17l-80-80A4,4,0,0,0,148,32V76.09c-54,2.44-120.43,53.55-127.94,119a7.87,7.87,0,0,0,4.58,8.16,8,8,0,0,0,3.41.77,7.9,7.9,0,0,0,5.79-2.55h0c11.53-12.27,53.29-51.73,114.16-53.4V192a4,4,0,0,0,6.83,2.83l80-80A4,4,0,0,0,234.83,109.17ZM156,182.33V144a4,4,0,0,0-4-4c-27.39,0-54.08,7.17-79.34,21.3A189.91,189.91,0,0,0,28,196l2.92,2.74L28,196c3.36-29.21,19.55-57.48,45.6-79.57C97.53,96.11,126.83,84,152,84a4,4,0,0,0,4-4V41.66L226.34,112Z"},child:[]}]})(e)}function Gce(e){return Hr({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M176,148h32a12,12,0,0,0,12-12V104a12,12,0,0,0-12-12H176a12,12,0,0,0-12,12v12H84V76H96a12,12,0,0,0,12-12V32A12,12,0,0,0,96,20H64A12,12,0,0,0,52,32V64A12,12,0,0,0,64,76H76V192a20,20,0,0,0,20,20h68v12a12,12,0,0,0,12,12h32a12,12,0,0,0,12-12V192a12,12,0,0,0-12-12H176a12,12,0,0,0-12,12v12H96a12,12,0,0,1-12-12V124h80v12A12,12,0,0,0,176,148ZM60,64V32a4,4,0,0,1,4-4H96a4,4,0,0,1,4,4V64a4,4,0,0,1-4,4H64A4,4,0,0,1,60,64ZM172,192a4,4,0,0,1,4-4h32a4,4,0,0,1,4,4v32a4,4,0,0,1-4,4H176a4,4,0,0,1-4-4Zm0-88a4,4,0,0,1,4-4h32a4,4,0,0,1,4,4v32a4,4,0,0,1-4,4H176a4,4,0,0,1-4-4Z"},child:[]}]})(e)}function Qce(e){return Hr({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M236,136v64a12,12,0,0,1-12,12H32a12,12,0,0,1-12-12V136a12,12,0,0,1,12-12H80a4,4,0,0,1,0,8H32a4,4,0,0,0-4,4v64a4,4,0,0,0,4,4H224a4,4,0,0,0,4-4V136a4,4,0,0,0-4-4H176a4,4,0,0,1,0-8h48A12,12,0,0,1,236,136ZM82.83,74.83,124,33.66V128a4,4,0,0,0,8,0V33.66l41.17,41.17a4,4,0,1,0,5.66-5.66l-48-48a4,4,0,0,0-5.66,0l-48,48a4,4,0,0,0,5.66,5.66ZM196,168a8,8,0,1,0-8,8A8,8,0,0,0,196,168Z"},child:[]}]})(e)}function WE(e){return Hr({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M233.34,190.09,145.88,38.22h0a20.75,20.75,0,0,0-35.76,0L22.66,190.09a19.52,19.52,0,0,0,0,19.71A20.36,20.36,0,0,0,40.54,220H215.46a20.36,20.36,0,0,0,17.86-10.2A19.52,19.52,0,0,0,233.34,190.09ZM226.4,205.8a12.47,12.47,0,0,1-10.94,6.2H40.54a12.47,12.47,0,0,1-10.94-6.2,11.45,11.45,0,0,1,0-11.72L117.05,42.21a12.76,12.76,0,0,1,21.9,0L226.4,194.08A11.45,11.45,0,0,1,226.4,205.8ZM124,144V104a4,4,0,0,1,8,0v40a4,4,0,0,1-8,0Zm12,36a8,8,0,1,1-8-8A8,8,0,0,1,136,180Z"},child:[]}]})(e)}const js=({value:e,placeholder:t,autoFocus:r,onChange:n,onBlur:i,onEnter:o,width:a,height:l,type:c,dataTestId:d,autoComplete:f})=>{const p=RB();return x.jsx(C0,{autoComplete:f,"data-testid":d,borderColor:"gray.100",borderStyle:"solid",borderWidth:"1px",padding:"0 9px",placeholder:t,ref:r?p:void 0,value:e,variant:"unstyled",onChange:n,onBlur:i,width:a,height:l,type:c,onKeyDown:o?m=>{m.key==="Enter"&&o()}:void 0})},{ToastContainer:CA,toast:KE}=VZ(),Yce=H5({uri:_ce("REACT_APP_GRAPHQL_SERVER_URL")}),Xce=wce(async()=>({headers:{Authorization:`Bearer ${localStorage.getItem("token")}`}})),Jce=hB(({graphQLErrors:e})=>{if(e)for(const t of e)KE({status:"error",variant:"left-accent",colorScheme:"red",duration:3e3,isClosable:!0,position:"top",description:t.message})}),xr=new cB({connectToDevTools:!0,link:sue([Xce,Jce,Yce]),cache:new aB({typePolicies:{TableModel:{keyFields:["versionId"]},RowModel:{keyFields:["versionId"]}}}),defaultOptions:{watchQuery:{fetchPolicy:"cache-and-network"}}});xr.cache;const RB=()=>O.useCallback(e=>{e&&e.focus()},[]),Df=(e,...t)=>{const r=O.useRef(null),[n,i]=O.useState(t),o=O.useMemo(()=>n.length!==t.length||n.some((a,l)=>a!==t[l])?(i(t),t):n,[t,n]);return r.current||(r.current=dt.get(e)),O.useEffect(()=>{var l;const a=r.current;return(l=a==null?void 0:a.init)==null||l.call(a,...o),()=>{var c;(c=a==null?void 0:a.dispose)==null||c.call(a)}},[o]),r.current};class Zce{constructor(){Pe(this,"registrations",new Map)}register(t,r,n){this.registrations.set(t,{factory:r,scope:n.scope})}get(t){const r=this.registrations.get(t);if(!r)throw new Error(`No provider found for ${t.name}`);return r.scope==="singleton"?(r.instance||(r.instance=r.factory()),r.instance):r.factory()}}const dt=new Zce;class GE{constructor(t){Pe(this,"values");this.values=t,st(this,{},{autoBind:!0})}setValue(t,r){this.values[t]=r}get isValid(){return Object.values(this.values).every(t=>!!t)}}const QE=JSON,ede=e=>e.toUpperCase(),tde=e=>{const t={};return e.forEach((r,n)=>{t[n]=r}),t},rde=(e,t,r)=>e.document?e:{document:e,variables:t,requestHeaders:r,signal:void 0},nde=(e,t,r)=>e.query?e:{query:e,variables:t,requestHeaders:r,signal:void 0},ide=(e,t)=>e.documents?e:{documents:e,requestHeaders:t,signal:void 0},EA=e=>{var n,i;let t;const r=e.definitions.filter(o=>o.kind==="OperationDefinition");return r.length===1&&(t=(i=(n=r[0])==null?void 0:n.name)==null?void 0:i.value),t},y_=e=>{if(typeof e=="string"){let r;try{const n=u5(e);r=EA(n)}catch{}return{query:e,operationName:r}}const t=EA(e);return{query:d5(e),operationName:t}};class Sp extends Error{constructor(t,r){const n=`${Sp.extractMessage(t)}: ${JSON.stringify({response:t,request:r})}`;super(n),Object.setPrototypeOf(this,Sp.prototype),this.response=t,this.request=r,typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Sp)}static extractMessage(t){var r,n;return((n=(r=t.errors)==null?void 0:r[0])==null?void 0:n.message)??`GraphQL Error (Code: ${t.status})`}}var Jh={exports:{}},ode=Jh.exports,TA;function ade(){return TA||(TA=1,function(e,t){var r=typeof self<"u"?self:ode,n=function(){function o(){this.fetch=!1,this.DOMException=r.DOMException}return o.prototype=r,new o}();(function(o){(function(a){var l={searchParams:"URLSearchParams"in o,iterable:"Symbol"in o&&"iterator"in Symbol,blob:"FileReader"in o&&"Blob"in o&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in o,arrayBuffer:"ArrayBuffer"in o};function c(N){return N&&DataView.prototype.isPrototypeOf(N)}if(l.arrayBuffer)var d=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],f=ArrayBuffer.isView||function(N){return N&&d.indexOf(Object.prototype.toString.call(N))>-1};function p(N){if(typeof N!="string"&&(N=String(N)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(N))throw new TypeError("Invalid character in header field name");return N.toLowerCase()}function m(N){return typeof N!="string"&&(N=String(N)),N}function g(N){var X={next:function(){var ce=N.shift();return{done:ce===void 0,value:ce}}};return l.iterable&&(X[Symbol.iterator]=function(){return X}),X}function b(N){this.map={},N instanceof b?N.forEach(function(X,ce){this.append(ce,X)},this):Array.isArray(N)?N.forEach(function(X){this.append(X[0],X[1])},this):N&&Object.getOwnPropertyNames(N).forEach(function(X){this.append(X,N[X])},this)}b.prototype.append=function(N,X){N=p(N),X=m(X);var ce=this.map[N];this.map[N]=ce?ce+", "+X:X},b.prototype.delete=function(N){delete this.map[p(N)]},b.prototype.get=function(N){return N=p(N),this.has(N)?this.map[N]:null},b.prototype.has=function(N){return this.map.hasOwnProperty(p(N))},b.prototype.set=function(N,X){this.map[p(N)]=m(X)},b.prototype.forEach=function(N,X){for(var ce in this.map)this.map.hasOwnProperty(ce)&&N.call(X,this.map[ce],ce,this)},b.prototype.keys=function(){var N=[];return this.forEach(function(X,ce){N.push(ce)}),g(N)},b.prototype.values=function(){var N=[];return this.forEach(function(X){N.push(X)}),g(N)},b.prototype.entries=function(){var N=[];return this.forEach(function(X,ce){N.push([ce,X])}),g(N)},l.iterable&&(b.prototype[Symbol.iterator]=b.prototype.entries);function y(N){if(N.bodyUsed)return Promise.reject(new TypeError("Already read"));N.bodyUsed=!0}function w(N){return new Promise(function(X,ce){N.onload=function(){X(N.result)},N.onerror=function(){ce(N.error)}})}function _(N){var X=new FileReader,ce=w(X);return X.readAsArrayBuffer(N),ce}function S(N){var X=new FileReader,ce=w(X);return X.readAsText(N),ce}function C(N){for(var X=new Uint8Array(N),ce=new Array(X.length),ne=0;ne<X.length;ne++)ce[ne]=String.fromCharCode(X[ne]);return ce.join("")}function k(N){if(N.slice)return N.slice(0);var X=new Uint8Array(N.byteLength);return X.set(new Uint8Array(N)),X.buffer}function E(){return this.bodyUsed=!1,this._initBody=function(N){this._bodyInit=N,N?typeof N=="string"?this._bodyText=N:l.blob&&Blob.prototype.isPrototypeOf(N)?this._bodyBlob=N:l.formData&&FormData.prototype.isPrototypeOf(N)?this._bodyFormData=N:l.searchParams&&URLSearchParams.prototype.isPrototypeOf(N)?this._bodyText=N.toString():l.arrayBuffer&&l.blob&&c(N)?(this._bodyArrayBuffer=k(N.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):l.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(N)||f(N))?this._bodyArrayBuffer=k(N):this._bodyText=N=Object.prototype.toString.call(N):this._bodyText="",this.headers.get("content-type")||(typeof N=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):l.searchParams&&URLSearchParams.prototype.isPrototypeOf(N)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},l.blob&&(this.blob=function(){var N=y(this);if(N)return N;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?y(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(_)}),this.text=function(){var N=y(this);if(N)return N;if(this._bodyBlob)return S(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(C(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},l.formData&&(this.formData=function(){return this.text().then(M)}),this.json=function(){return this.text().then(JSON.parse)},this}var R=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function T(N){var X=N.toUpperCase();return R.indexOf(X)>-1?X:N}function A(N,X){X=X||{};var ce=X.body;if(N instanceof A){if(N.bodyUsed)throw new TypeError("Already read");this.url=N.url,this.credentials=N.credentials,X.headers||(this.headers=new b(N.headers)),this.method=N.method,this.mode=N.mode,this.signal=N.signal,!ce&&N._bodyInit!=null&&(ce=N._bodyInit,N.bodyUsed=!0)}else this.url=String(N);if(this.credentials=X.credentials||this.credentials||"same-origin",(X.headers||!this.headers)&&(this.headers=new b(X.headers)),this.method=T(X.method||this.method||"GET"),this.mode=X.mode||this.mode||null,this.signal=X.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&ce)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(ce)}A.prototype.clone=function(){return new A(this,{body:this._bodyInit})};function M(N){var X=new FormData;return N.trim().split("&").forEach(function(ce){if(ce){var ne=ce.split("="),ee=ne.shift().replace(/\+/g," "),ge=ne.join("=").replace(/\+/g," ");X.append(decodeURIComponent(ee),decodeURIComponent(ge))}}),X}function B(N){var X=new b,ce=N.replace(/\r?\n[\t ]+/g," ");return ce.split(/\r?\n/).forEach(function(ne){var ee=ne.split(":"),ge=ee.shift().trim();if(ge){var Z=ee.join(":").trim();X.append(ge,Z)}}),X}E.call(A.prototype);function Q(N,X){X||(X={}),this.type="default",this.status=X.status===void 0?200:X.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in X?X.statusText:"OK",this.headers=new b(X.headers),this.url=X.url||"",this._initBody(N)}E.call(Q.prototype),Q.prototype.clone=function(){return new Q(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new b(this.headers),url:this.url})},Q.error=function(){var N=new Q(null,{status:0,statusText:""});return N.type="error",N};var se=[301,302,303,307,308];Q.redirect=function(N,X){if(se.indexOf(X)===-1)throw new RangeError("Invalid status code");return new Q(null,{status:X,headers:{location:N}})},a.DOMException=o.DOMException;try{new a.DOMException}catch{a.DOMException=function(X,ce){this.message=X,this.name=ce;var ne=Error(X);this.stack=ne.stack},a.DOMException.prototype=Object.create(Error.prototype),a.DOMException.prototype.constructor=a.DOMException}function ie(N,X){return new Promise(function(ce,ne){var ee=new A(N,X);if(ee.signal&&ee.signal.aborted)return ne(new a.DOMException("Aborted","AbortError"));var ge=new XMLHttpRequest;function Z(){ge.abort()}ge.onload=function(){var j={status:ge.status,statusText:ge.statusText,headers:B(ge.getAllResponseHeaders()||"")};j.url="responseURL"in ge?ge.responseURL:j.headers.get("X-Request-URL");var U="response"in ge?ge.response:ge.responseText;ce(new Q(U,j))},ge.onerror=function(){ne(new TypeError("Network request failed"))},ge.ontimeout=function(){ne(new TypeError("Network request failed"))},ge.onabort=function(){ne(new a.DOMException("Aborted","AbortError"))},ge.open(ee.method,ee.url,!0),ee.credentials==="include"?ge.withCredentials=!0:ee.credentials==="omit"&&(ge.withCredentials=!1),"responseType"in ge&&l.blob&&(ge.responseType="blob"),ee.headers.forEach(function(j,U){ge.setRequestHeader(U,j)}),ee.signal&&(ee.signal.addEventListener("abort",Z),ge.onreadystatechange=function(){ge.readyState===4&&ee.signal.removeEventListener("abort",Z)}),ge.send(typeof ee._bodyInit>"u"?null:ee._bodyInit)})}return ie.polyfill=!0,o.fetch||(o.fetch=ie,o.Headers=b,o.Request=A,o.Response=Q),a.Headers=b,a.Request=A,a.Response=Q,a.fetch=ie,Object.defineProperty(a,"__esModule",{value:!0}),a})({})})(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;t=i.fetch,t.default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t}(Jh,Jh.exports)),Jh.exports}var Nb=ade();const tb=mc(Nb),sde=o0({__proto__:null,default:tb},[Nb]),hd=e=>{let t={};return e&&(typeof Headers<"u"&&e instanceof Headers||sde&&Nb.Headers&&e instanceof Nb.Headers?t=tde(e):Array.isArray(e)?e.forEach(([r,n])=>{r&&n!==void 0&&(t[r]=n)}):t=e),t},OA=e=>e.replace(/([\s,]|#[^\n\r]+)+/g," ").trim(),lde=e=>{if(!Array.isArray(e.query)){const n=e,i=[`query=${encodeURIComponent(OA(n.query))}`];return e.variables&&i.push(`variables=${encodeURIComponent(n.jsonSerializer.stringify(n.variables))}`),n.operationName&&i.push(`operationName=${encodeURIComponent(n.operationName)}`),i.join("&")}if(typeof e.variables<"u"&&!Array.isArray(e.variables))throw new Error("Cannot create query with given variable type, array expected");const t=e,r=e.query.reduce((n,i,o)=>(n.push({query:OA(i),variables:t.variables?t.jsonSerializer.stringify(t.variables[o]):void 0}),n),[]);return`query=${encodeURIComponent(t.jsonSerializer.stringify(r))}`},ude=e=>async t=>{const{url:r,query:n,variables:i,operationName:o,fetch:a,fetchOptions:l,middleware:c}=t,d={...t.headers};let f="",p;e==="POST"?(p=dde(n,i,o,l.jsonSerializer),typeof p=="string"&&(d["Content-Type"]="application/json")):f=lde({query:n,variables:i,operationName:o,jsonSerializer:l.jsonSerializer??QE});const m={method:e,headers:d,body:p,...l};let g=r,b=m;if(c){const y=await Promise.resolve(c({...m,url:r,operationName:o,variables:i})),{url:w,..._}=y;g=w,b=_}return f&&(g=`${g}?${f}`),await a(g,b)};class cde{constructor(t,r={}){this.url=t,this.requestConfig=r,this.rawRequest=async(...n)=>{const[i,o,a]=n,l=nde(i,o,a),{headers:c,fetch:d=tb,method:f="POST",requestMiddleware:p,responseMiddleware:m,...g}=this.requestConfig,{url:b}=this;l.signal!==void 0&&(g.signal=l.signal);const{operationName:y}=y_(l.query);return b_({url:b,query:l.query,variables:l.variables,headers:{...hd(w_(c)),...hd(l.requestHeaders)},operationName:y,fetch:d,method:f,fetchOptions:g,middleware:p}).then(w=>(m&&m(w),w)).catch(w=>{throw m&&m(w),w})}}async request(t,...r){const[n,i]=r,o=rde(t,n,i),{headers:a,fetch:l=tb,method:c="POST",requestMiddleware:d,responseMiddleware:f,...p}=this.requestConfig,{url:m}=this;o.signal!==void 0&&(p.signal=o.signal);const{query:g,operationName:b}=y_(o.document);return b_({url:m,query:g,variables:o.variables,headers:{...hd(w_(a)),...hd(o.requestHeaders)},operationName:b,fetch:l,method:c,fetchOptions:p,middleware:d}).then(y=>(f&&f(y),y.data)).catch(y=>{throw f&&f(y),y})}batchRequests(t,r){const n=ide(t,r),{headers:i,...o}=this.requestConfig;n.signal!==void 0&&(o.signal=n.signal);const a=n.documents.map(({document:c})=>y_(c).query),l=n.documents.map(({variables:c})=>c);return b_({url:this.url,query:a,variables:l,headers:{...hd(w_(i)),...hd(n.requestHeaders)},operationName:void 0,fetch:this.requestConfig.fetch??tb,method:this.requestConfig.method||"POST",fetchOptions:o,middleware:this.requestConfig.requestMiddleware}).then(c=>(this.requestConfig.responseMiddleware&&this.requestConfig.responseMiddleware(c),c.data)).catch(c=>{throw this.requestConfig.responseMiddleware&&this.requestConfig.responseMiddleware(c),c})}setHeaders(t){return this.requestConfig.headers=t,this}setHeader(t,r){const{headers:n}=this.requestConfig;return n?n[t]=r:this.requestConfig.headers={[t]:r},this}setEndpoint(t){return this.url=t,this}}const b_=async e=>{const{query:t,variables:r,fetchOptions:n}=e,i=ude(ede(e.method??"post")),o=Array.isArray(e.query),a=await i(e),l=await fde(a,n.jsonSerializer??QE),c=Array.isArray(l)?!l.some(({data:f})=>!f):!!l.data,d=Array.isArray(l)||!l.errors||Array.isArray(l.errors)&&!l.errors.length||n.errorPolicy==="all"||n.errorPolicy==="ignore";if(a.ok&&d&&c){const{errors:f,...p}=(Array.isArray(l),l),m=n.errorPolicy==="ignore"?p:l;return{...o?{data:m}:m,headers:a.headers,status:a.status}}else{const f=typeof l=="string"?{error:l}:l;throw new Sp({...f,status:a.status,headers:a.headers},{query:t,variables:r})}},dde=(e,t,r,n)=>{const i=n??QE;if(!Array.isArray(e))return i.stringify({query:e,variables:t,operationName:r});if(typeof t<"u"&&!Array.isArray(t))throw new Error("Cannot create request body with given variable type, array expected");const o=e.reduce((a,l,c)=>(a.push({query:l,variables:t?t[c]:void 0}),a),[]);return i.stringify(o)},fde=async(e,t)=>{let r;return e.headers.forEach((n,i)=>{i.toLowerCase()==="content-type"&&(r=n)}),r&&(r.toLowerCase().startsWith("application/json")||r.toLowerCase().startsWith("application/graphql+json")||r.toLowerCase().startsWith("application/graphql-response+json"))?t.parse(await e.text()):e.text()},w_=e=>typeof e=="function"?e():e;Ne`
|
443
443
|
fragment PageInfo on PageInfo {
|
444
444
|
startCursor
|
445
445
|
hasNextPage
|
@@ -987,7 +987,7 @@ this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):a
|
|
987
987
|
}
|
988
988
|
${au}
|
989
989
|
${ns}
|
990
|
-
`,efe=(e,t,r,n)=>e();function tfe(e,t=efe){return{confirmEmailCode(r,n){return t(i=>e.request(gde,r,{...n,...i}),"confirmEmailCode","mutation",r)},loginGithub(r,n){return t(i=>e.request(yde,r,{...n,...i}),"loginGithub","mutation",r)},loginGoogle(r,n){return t(i=>e.request(bde,r,{...n,...i}),"loginGoogle","mutation",r)},login(r,n){return t(i=>e.request(wde,r,{...n,...i}),"login","mutation",r)},signUp(r,n){return t(i=>e.request(Sde,r,{...n,...i}),"signUp","mutation",r)},setUsername(r,n){return t(i=>e.request(_de,r,{...n,...i}),"setUsername","mutation",r)},configuration(r,n){return t(i=>e.request(xde,r,{...n,...i}),"configuration","query",r)},getMe(r,n){return t(i=>e.request(Pde,r,{...n,...i}),"getMe","query",r)},CreateBranchByRevisionIdMst(r,n){return t(i=>e.request(Cde,r,{...n,...i}),"CreateBranchByRevisionIdMst","mutation",r)},CreateEndpointMst(r,n){return t(i=>e.request(Ede,r,{...n,...i}),"CreateEndpointMst","mutation",r)},CreateProjectMst(r,n){return t(i=>e.request(Tde,r,{...n,...i}),"CreateProjectMst","mutation",r)},CreateRevisionMst(r,n){return t(i=>e.request(Ode,r,{...n,...i}),"CreateRevisionMst","mutation",r)},CreateRowMst(r,n){return t(i=>e.request(Rde,r,{...n,...i}),"CreateRowMst","mutation",r)},CreateTableMst(r,n){return t(i=>e.request(Ide,r,{...n,...i}),"CreateTableMst","mutation",r)},DeleteEndpointMst(r,n){return t(i=>e.request(kde,r,{...n,...i}),"DeleteEndpointMst","mutation",r)},DeleteProjectMst(r,n){return t(i=>e.request(jde,r,{...n,...i}),"DeleteProjectMst","mutation",r)},DeleteRowMst(r,n){return t(i=>e.request($de,r,{...n,...i}),"DeleteRowMst","mutation",r)},DeleteTableMst(r,n){return t(i=>e.request(Ade,r,{...n,...i}),"DeleteTableMst","mutation",r)},RenameRowMst(r,n){return t(i=>e.request(Dde,r,{...n,...i}),"RenameRowMst","mutation",r)},RenameTableMst(r,n){return t(i=>e.request(Mde,r,{...n,...i}),"RenameTableMst","mutation",r)},RevertChangesMst(r,n){return t(i=>e.request(Nde,r,{...n,...i}),"RevertChangesMst","mutation",r)},UpdateRowMst(r,n){return t(i=>e.request(Fde,r,{...n,...i}),"UpdateRowMst","mutation",r)},UpdateTableMst(r,n){return t(i=>e.request(Lde,r,{...n,...i}),"UpdateTableMst","mutation",r)},BranchMst(r,n){return t(i=>e.request(Bde,r,{...n,...i}),"BranchMst","query",r)},BranchesMst(r,n){return t(i=>e.request(Vde,r,{...n,...i}),"BranchesMst","query",r)},GetRowCountForeignKeysTo(r,n){return t(i=>e.request(zde,r,{...n,...i}),"GetRowCountForeignKeysTo","query",r)},meProjectsMst(r,n){return t(i=>e.request(qde,r,{...n,...i}),"meProjectsMst","query",r)},ProjectMst(r,n){return t(i=>e.request(Ude,r,{...n,...i}),"ProjectMst","query",r)},ProjectsMst(r,n){return t(i=>e.request(Hde,r,{...n,...i}),"ProjectsMst","query",r)},RevisionMst(r,n){return t(i=>e.request(Wde,r,{...n,...i}),"RevisionMst","query",r)},RevisionsMst(r,n){return t(i=>e.request(Kde,r,{...n,...i}),"RevisionsMst","query",r)},RowForeignKeysBy(r,n){return t(i=>e.request(Gde,r,{...n,...i}),"RowForeignKeysBy","query",r)},RowMst(r,n){return t(i=>e.request(Qde,r,{...n,...i}),"RowMst","query",r)},RowsMst(r,n){return t(i=>e.request(Yde,r,{...n,...i}),"RowsMst","query",r)},TableForeignKeysBy(r,n){return t(i=>e.request(Xde,r,{...n,...i}),"TableForeignKeysBy","query",r)},TableMst(r,n){return t(i=>e.request(Jde,r,{...n,...i}),"TableMst","query",r)},TablesMst(r,n){return t(i=>e.request(Zde,r,{...n,...i}),"TablesMst","query",r)}}}const rfe={BASE_URL:"/",DEV:!1,GIT_BRANCH_NAME:"HEAD",GIT_COMMIT_HASH:"
|
990
|
+
`,efe=(e,t,r,n)=>e();function tfe(e,t=efe){return{confirmEmailCode(r,n){return t(i=>e.request(gde,r,{...n,...i}),"confirmEmailCode","mutation",r)},loginGithub(r,n){return t(i=>e.request(yde,r,{...n,...i}),"loginGithub","mutation",r)},loginGoogle(r,n){return t(i=>e.request(bde,r,{...n,...i}),"loginGoogle","mutation",r)},login(r,n){return t(i=>e.request(wde,r,{...n,...i}),"login","mutation",r)},signUp(r,n){return t(i=>e.request(Sde,r,{...n,...i}),"signUp","mutation",r)},setUsername(r,n){return t(i=>e.request(_de,r,{...n,...i}),"setUsername","mutation",r)},configuration(r,n){return t(i=>e.request(xde,r,{...n,...i}),"configuration","query",r)},getMe(r,n){return t(i=>e.request(Pde,r,{...n,...i}),"getMe","query",r)},CreateBranchByRevisionIdMst(r,n){return t(i=>e.request(Cde,r,{...n,...i}),"CreateBranchByRevisionIdMst","mutation",r)},CreateEndpointMst(r,n){return t(i=>e.request(Ede,r,{...n,...i}),"CreateEndpointMst","mutation",r)},CreateProjectMst(r,n){return t(i=>e.request(Tde,r,{...n,...i}),"CreateProjectMst","mutation",r)},CreateRevisionMst(r,n){return t(i=>e.request(Ode,r,{...n,...i}),"CreateRevisionMst","mutation",r)},CreateRowMst(r,n){return t(i=>e.request(Rde,r,{...n,...i}),"CreateRowMst","mutation",r)},CreateTableMst(r,n){return t(i=>e.request(Ide,r,{...n,...i}),"CreateTableMst","mutation",r)},DeleteEndpointMst(r,n){return t(i=>e.request(kde,r,{...n,...i}),"DeleteEndpointMst","mutation",r)},DeleteProjectMst(r,n){return t(i=>e.request(jde,r,{...n,...i}),"DeleteProjectMst","mutation",r)},DeleteRowMst(r,n){return t(i=>e.request($de,r,{...n,...i}),"DeleteRowMst","mutation",r)},DeleteTableMst(r,n){return t(i=>e.request(Ade,r,{...n,...i}),"DeleteTableMst","mutation",r)},RenameRowMst(r,n){return t(i=>e.request(Dde,r,{...n,...i}),"RenameRowMst","mutation",r)},RenameTableMst(r,n){return t(i=>e.request(Mde,r,{...n,...i}),"RenameTableMst","mutation",r)},RevertChangesMst(r,n){return t(i=>e.request(Nde,r,{...n,...i}),"RevertChangesMst","mutation",r)},UpdateRowMst(r,n){return t(i=>e.request(Fde,r,{...n,...i}),"UpdateRowMst","mutation",r)},UpdateTableMst(r,n){return t(i=>e.request(Lde,r,{...n,...i}),"UpdateTableMst","mutation",r)},BranchMst(r,n){return t(i=>e.request(Bde,r,{...n,...i}),"BranchMst","query",r)},BranchesMst(r,n){return t(i=>e.request(Vde,r,{...n,...i}),"BranchesMst","query",r)},GetRowCountForeignKeysTo(r,n){return t(i=>e.request(zde,r,{...n,...i}),"GetRowCountForeignKeysTo","query",r)},meProjectsMst(r,n){return t(i=>e.request(qde,r,{...n,...i}),"meProjectsMst","query",r)},ProjectMst(r,n){return t(i=>e.request(Ude,r,{...n,...i}),"ProjectMst","query",r)},ProjectsMst(r,n){return t(i=>e.request(Hde,r,{...n,...i}),"ProjectsMst","query",r)},RevisionMst(r,n){return t(i=>e.request(Wde,r,{...n,...i}),"RevisionMst","query",r)},RevisionsMst(r,n){return t(i=>e.request(Kde,r,{...n,...i}),"RevisionsMst","query",r)},RowForeignKeysBy(r,n){return t(i=>e.request(Gde,r,{...n,...i}),"RowForeignKeysBy","query",r)},RowMst(r,n){return t(i=>e.request(Qde,r,{...n,...i}),"RowMst","query",r)},RowsMst(r,n){return t(i=>e.request(Yde,r,{...n,...i}),"RowsMst","query",r)},TableForeignKeysBy(r,n){return t(i=>e.request(Xde,r,{...n,...i}),"TableForeignKeysBy","query",r)},TableMst(r,n){return t(i=>e.request(Jde,r,{...n,...i}),"TableMst","query",r)},TablesMst(r,n){return t(i=>e.request(Zde,r,{...n,...i}),"TablesMst","query",r)}}}const rfe={BASE_URL:"/",DEV:!1,GIT_BRANCH_NAME:"HEAD",GIT_COMMIT_HASH:"f61b09c",MODE:"production",PACKAGE_VERSION:"1.0.0",PROD:!0,REACT_APP_ENDPOINT_HOST:"",REACT_APP_ENDPOINT_PORT:"",REACT_APP_ENDPOINT_SERVER_URL:"/endpoint",REACT_APP_GRAPHQL_SERVER_URL:"/graphql",REACT_APP_SWAGGER_SERVER_URL:"/api",SSR:!1};class Fb{constructor(){}get(t){var i;const r=(i=window.__env__)==null?void 0:i[t],n=rfe[t];return r||n}}dt.register(Fb,()=>new Fb,{scope:"singleton"});class es{constructor(t){Pe(this,"graphQLClient");Pe(this,"client");this.environmentService=t;const r=this.environmentService.get("REACT_APP_GRAPHQL_SERVER_URL");if(!r)throw new Error("Invalid REACT_APP_GRAPHQL_SERVER_URL");this.graphQLClient=new cde(r,{responseMiddleware:n=>{var o;const i=(o=n.response)==null?void 0:o.errors[0].message;return i&&KE({status:"error",variant:"left-accent",colorScheme:"red",duration:3e3,isClosable:!0,position:"top",description:i}),n}}),this.client=tfe(this.graphQLClient)}setToken(t){this.graphQLClient.setHeaders(t?{Authorization:`Bearer ${t}`}:{})}}dt.register(es,()=>{const e=dt.get(Fb);return new es(e)},{scope:"singleton"});const S_="token";class qi{constructor(t,r){Pe(this,"isLoaded",!1);Pe(this,"user",null);Pe(this,"token",null);this.storage=t,this.apiService=r,st(this),this.init()}async setToken(t){this.token=t,this.apiService.setToken(this.token),this.token&&await this.fetchMe()}async init(){await this.setToken(this.loadToken()),this.signToToken(),this.setIsChecked(!0)}loadToken(){return this.storage.getItem(S_)}async fetchMe(){try{const t=await this.apiService.client.getMe();this.user=t.me}catch(t){console.error(t),Hp(()=>{this.token=null})}}setIsChecked(t){this.isLoaded=t}signToToken(){Ya(()=>this.token,t=>{t?this.storage.setItem(S_,t):this.storage.removeItem(S_)})}logout(){this.token=null,this.user=null,this.apiService.setToken(null)}}dt.register(qi,()=>{const e=dt.get(es);return new qi(localStorage,e)},{scope:"singleton"});class dc{constructor(t){Pe(this,"isLoaded",!1);Pe(this,"error",null);Pe(this,"data",null);this.apiService=t,st(this),this.init()}get availableSignUp(){return this.availableEmailSignUp||this.availableGoogleOauth||this.availableGithubOauth}get availableEmailSignUp(){var t;return(t=this.data)==null?void 0:t.availableEmailSignUp}get availableGoogleOauth(){var t;return!!((t=this.data)!=null&&t.google.available)}get googleOauthClientId(){var t,r;if(!((t=this.data)!=null&&t.google.clientId))throw new Error("Invalid Google client id");return(r=this.data)==null?void 0:r.google.clientId}get availableGithubOauth(){var t;return!!((t=this.data)!=null&&t.github.available)}get githubOauthClientId(){var t,r;if(!((t=this.data)!=null&&t.github.clientId))throw new Error("Invalid Github client id");return(r=this.data)==null?void 0:r.github.clientId}async init(){await this.request()}async request(){try{const t=await this.apiService.client.configuration();this.setData(t.configuration)}catch(t){this.setError(t),console.error(t)}finally{this.setIsLoaded(!0)}}setData(t){this.data=t}setError(t){this.error=t}setIsLoaded(t){this.isLoaded=t}}dt.register(dc,()=>{const e=dt.get(es);return new dc(e)},{scope:"singleton"});class Lb{constructor(t,r){this.authService=t,this.configurationService=r,st(this)}get isLoaded(){return this.authService.isLoaded&&this.configurationService.isLoaded}}dt.register(Lb,()=>{const e=dt.get(qi),t=dt.get(dc);return new Lb(e,t)},{scope:"singleton"});var RA={},nfe="warn";function ife(){return nfe}var jn;(function(e){e.afterCreate="afterCreate",e.afterAttach="afterAttach",e.afterCreationFinalization="afterCreationFinalization",e.beforeDetach="beforeDetach",e.beforeDestroy="beforeDestroy"})(jn||(jn={}));/*! *****************************************************************************
|
991
991
|
Copyright (c) Microsoft Corporation.
|
992
992
|
|
993
993
|
Permission to use, copy, modify, and/or distribute this software for any
|
@@ -1000,10 +1000,10 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
1000
1000
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
1001
1001
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
1002
1002
|
PERFORMANCE OF THIS SOFTWARE.
|
1003
|
-
***************************************************************************** */var TP=function(e,t){return TP=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},TP(e,t)};function Wr(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");TP(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var Fi=function(){return Fi=Object.assign||function(t){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},Fi.apply(this,arguments)};function ofe(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function _p(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function YE(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(l){a={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o}function Pc(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(YE(arguments[t]));return e}function IB(e){return _r(e).type}function I2(e,t){_r(e).applyPatches(zB(t))}function kB(e,t){t===void 0&&(t=!0);var r=_r(e);return t?r.snapshot:r.type.getSnapshot(r,!1)}function afe(e){return _r(e).root.storedValue}function sfe(e){return _r(e).path}function lfe(e){return _r(e).identifier}function Og(e,t){t===void 0&&(t=!0);try{var r=e();if(r==null)return;if(Xr(r))return t?ufe(r)?r:void 0:r;throw rt("The reference to be checked is not one of node, null or undefined")}catch(n){if(n instanceof iV)return;throw n}}function ufe(e){return _r(e).observableIsAlive}var jB=function(){function e(t,r,n,i){Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"environment",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"_escapedSubpath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_subpath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_subpathUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pathUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"storedValue",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"aliveAtom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_state",{enumerable:!0,configurable:!0,writable:!0,value:Xn.INITIALIZING}),Object.defineProperty(this,"_hookSubscribers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"pathAtom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.environment=i,this.baseSetParent(r,n)}return Object.defineProperty(e.prototype,"subpath",{get:function(){return this._subpath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subpathUponDeath",{get:function(){return this._subpathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pathUponDeath",{get:function(){return this._pathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.type.getValue(this)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._state},set:function(t){var r=this.isAlive;this._state=t;var n=this.isAlive;this.aliveAtom&&r!==n&&this.aliveAtom.reportChanged()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fireInternalHook",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this._hookSubscribers&&this._hookSubscribers.emit(t,this,t)}}),Object.defineProperty(e.prototype,"registerHook",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return this._hookSubscribers||(this._hookSubscribers=new HB),this._hookSubscribers.register(t,r)}}),Object.defineProperty(e.prototype,"parent",{get:function(){return this._parent},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getReconciliationType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type}}),Object.defineProperty(e.prototype,"baseSetParent",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){this._parent=t,this._subpath=r,this._escapedSubpath=void 0,this.pathAtom&&this.pathAtom.reportChanged()}}),Object.defineProperty(e.prototype,"path",{get:function(){return this.getEscapedPath(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getEscapedPath",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t&&(this.pathAtom||(this.pathAtom=_b("path")),this.pathAtom.reportObserved()),this.parent?(this._escapedSubpath===void 0&&(this._escapedSubpath=this._subpath?Xu(this._subpath):""),this.parent.getEscapedPath(t)+"/"+this._escapedSubpath):""}}),Object.defineProperty(e.prototype,"isRoot",{get:function(){return this.parent===null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isAlive",{get:function(){return this.state!==Xn.DEAD},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isDetaching",{get:function(){return this.state===Xn.DETACHING},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"observableIsAlive",{get:function(){return this.aliveAtom||(this.aliveAtom=_b("alive")),this.aliveAtom.reportObserved(),this.isAlive},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseFinalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(this.state===Xn.CREATED){if(this.parent){if(this.parent.state!==Xn.FINALIZED)return;this.fireHook(jn.afterAttach)}this.state=Xn.FINALIZED,t&&t()}}}),Object.defineProperty(e.prototype,"baseFinalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._hookSubscribers&&this._hookSubscribers.clearAll(),this._subpathUponDeath=this._subpath,this._pathUponDeath=this.getEscapedPath(!1),this.baseSetParent(null,""),this.state=Xn.DEAD}}),Object.defineProperty(e.prototype,"baseAboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.fireHook(jn.beforeDestroy)}}),e}(),nm=function(e){Wr(t,e);function t(r,n,i,o,a){var l=e.call(this,r,n,i,o)||this;try{l.storedValue=r.createNewInstance(a)}catch(c){throw l.state=Xn.DEAD,c}return l.state=Xn.CREATED,l.finalizeCreation(),l}return Object.defineProperty(t.prototype,"root",{get:function(){if(!this.parent)throw rt("This scalar node is not part of a tree");return this.parent.root},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this.parent!==r,o=this.subpath!==n;!i&&!o||(this.environment=void 0,this.baseSetParent(this.parent,n))}}),Object.defineProperty(t.prototype,"snapshot",{get:function(){return this.getSnapshot()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(t.prototype,"toString",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=(this.isAlive?this.path:this.pathUponDeath)||"<root>";return this.type.name+"@"+r+(this.isAlive?"":" [dead]")}}),Object.defineProperty(t.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===Xn.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(t.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeCreation()}}),Object.defineProperty(t.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseAboutToDie()}}),Object.defineProperty(t.prototype,"finalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeDeath()}}),Object.defineProperty(t.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.fireInternalHook(r)}}),t}(jB);nm.prototype.die=Sr(nm.prototype.die);var cfe=1,dfe={onError:function(e){throw e}},Ui=function(e){Wr(t,e);function t(r,n,i,o,a){var l=e.call(this,r,n,i,o)||this;if(Object.defineProperty(l,"nodeId",{enumerable:!0,configurable:!0,writable:!0,value:++cfe}),Object.defineProperty(l,"identifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"identifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"unnormalizedIdentifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"identifierCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"isProtectionEnabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(l,"middlewares",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"hasSnapshotPostProcessor",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(l,"_applyPatches",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_applySnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_autoUnbox",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(l,"_isRunningAction",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(l,"_hasSnapshotReaction",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(l,"_observableInstanceState",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(l,"_childNodes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_initialSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_cachedInitialSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_cachedInitialSnapshotCreated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(l,"_snapshotComputed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_snapshotUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_internalEvents",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),l._snapshotComputed=dn(function(){return l.getSnapshot()}),l.unbox=l.unbox.bind(l),l._initialSnapshot=a,l.identifierAttribute=r.identifierAttribute,n||(l.identifierCache=new _fe),l._childNodes=r.initializeChildNodes(l,l._initialSnapshot),l.identifier=null,l.unnormalizedIdentifier=null,l.identifierAttribute&&l._initialSnapshot){var c=l._initialSnapshot[l.identifierAttribute];if(c===void 0){var d=l._childNodes[l.identifierAttribute];d&&(c=d.value)}if(typeof c!="string"&&typeof c!="number")throw rt("Instance identifier '"+l.identifierAttribute+"' for type '"+l.type.name+"' must be a string or a number");l.identifier=Xm(c),l.unnormalizedIdentifier=c}return n?n.root.identifierCache.addNodeToCache(l):l.identifierCache.addNodeToCache(l),l}return Object.defineProperty(t.prototype,"applyPatches",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.createObservableInstanceIfNeeded(),this._applyPatches(r)}}),Object.defineProperty(t.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.createObservableInstanceIfNeeded(),this._applySnapshot(r)}}),Object.defineProperty(t.prototype,"createObservableInstanceIfNeeded",{enumerable:!1,configurable:!0,writable:!0,value:function(r){r===void 0&&(r=!0),this._observableInstanceState===0&&this.createObservableInstance(r)}}),Object.defineProperty(t.prototype,"createObservableInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n,i,o,a;r===void 0&&(r=!0),this._observableInstanceState=1;for(var l=[],c=this.parent;c&&c._observableInstanceState===0;)l.unshift(c),c=c.parent;try{for(var d=_p(l),f=d.next();!f.done;f=d.next()){var p=f.value;p.createObservableInstanceIfNeeded(!1)}}catch(y){n={error:y}}finally{try{f&&!f.done&&(i=d.return)&&i.call(d)}finally{if(n)throw n.error}}var m=this.type;try{this.storedValue=m.createNewInstance(this._childNodes),this.preboot(),this._isRunningAction=!0,m.finalizeNewInstance(this,this.storedValue)}catch(y){throw this.state=Xn.DEAD,y}finally{this._isRunningAction=!1}if(this._observableInstanceState=2,this._snapshotComputed.trackAndCompute(),this.isRoot&&this._addSnapshotReaction(),this._childNodes=wf,this.state=Xn.CREATED,r){this.fireHook(jn.afterCreate),this.finalizeCreation();try{for(var g=_p(l.reverse()),b=g.next();!b.done;b=g.next()){var p=b.value;p.fireHook(jn.afterCreate),p.finalizeCreation()}}catch(y){o={error:y}}finally{try{b&&!b.done&&(a=g.return)&&a.call(g)}finally{if(o)throw o.error}}}}}),Object.defineProperty(t.prototype,"root",{get:function(){var r=this.parent;return r?r.root:this},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clearParent",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.parent){this.fireHook(jn.beforeDetach);var r=this.state;this.state=Xn.DETACHING;var n=this.root,i=n.environment,o=n.identifierCache.splitCache(this);try{this.parent.removeChild(this.subpath),this.baseSetParent(null,""),this.environment=i,this.identifierCache=o}finally{this.state=r}}}}),Object.defineProperty(t.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=r!==this.parent,o=n!==this.subpath;!i&&!o||(i?(this.environment=void 0,r.root.identifierCache.mergeCache(this),this.baseSetParent(r,n),this.fireHook(jn.afterAttach)):o&&this.baseSetParent(this.parent,n))}}),Object.defineProperty(t.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;this.fireInternalHook(r);var i=this.storedValue&&typeof this.storedValue=="object"&&this.storedValue[r];typeof i=="function"&&(Hp?Hp(function(){i.apply(n.storedValue)}):i.apply(this.storedValue))}}),Object.defineProperty(t.prototype,"snapshot",{get:function(){return this.hasSnapshotPostProcessor&&this.createObservableInstanceIfNeeded(),this._snapshotComputed.get()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.isAlive?this._observableInstanceState===2?this._getActualSnapshot():this._getCachedInitialSnapshot():this._snapshotUponDeath}}),Object.defineProperty(t.prototype,"_getActualSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(t.prototype,"_getCachedInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this._cachedInitialSnapshotCreated){var r=this.type,n=this._childNodes,i=this._initialSnapshot;this._cachedInitialSnapshot=r.processInitialSnapshot(n,i),this._cachedInitialSnapshotCreated=!0}return this._cachedInitialSnapshot}}),Object.defineProperty(t.prototype,"isRunningAction",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._isRunningAction?!0:this.isRoot?!1:this.parent.isRunningAction()}}),Object.defineProperty(t.prototype,"assertAlive",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=ife();if(!this.isAlive&&n!=="ignore"){var i=this._getAssertAliveError(r);switch(n){case"error":throw rt(i);case"warn":Afe(i)}}}}),Object.defineProperty(t.prototype,"_getAssertAliveError",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.getEscapedPath(!1)||this.pathUponDeath||"",i=r.subpath&&Xu(r.subpath)||"",o=r.actionContext||DB();o&&o.type!=="action"&&o.parentActionEvent&&(o=o.parentActionEvent);var a="";if(o&&o.name!=null){var l=o&&o.context&&sfe(o.context)||n;a=l+"."+o.name+"()"}return"You are trying to read or write to an object that is no longer part of a state tree. (Object type: '"+this.type.name+"', Path upon death: '"+n+"', Subpath: '"+i+"', Action: '"+a+"'). Either detach nodes first, or don't use objects after removing / replacing them in the tree."}}),Object.defineProperty(t.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.assertAlive({subpath:r}),this._autoUnbox=!1;try{return this._observableInstanceState===2?this.type.getChildNode(this,r):this._childNodes[r]}finally{this._autoUnbox=!0}}}),Object.defineProperty(t.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.assertAlive(wf),this._autoUnbox=!1;try{return this._observableInstanceState===2?this.type.getChildren(this):BB(this._childNodes)}finally{this._autoUnbox=!0}}}),Object.defineProperty(t.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.type.getChildType(r)}}),Object.defineProperty(t.prototype,"isProtected",{get:function(){return this.root.isProtectionEnabled},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"assertWritable",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(this.assertAlive(r),!this.isRunningAction()&&this.isProtected)throw rt("Cannot modify '"+this+"', the object is protected and can only be modified by using an action.")}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.type.removeChild(this,r)}}),Object.defineProperty(t.prototype,"unbox",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r&&(this.assertAlive({subpath:r.subpath||r.subpathUponDeath}),this._autoUnbox?r.value:r)}}),Object.defineProperty(t.prototype,"toString",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=(this.isAlive?this.path:this.pathUponDeath)||"<root>",n=this.identifier?"(id: "+this.identifier+")":"";return this.type.name+"@"+r+n+(this.isAlive?"":" [dead]")}}),Object.defineProperty(t.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;this.baseFinalizeCreation(function(){var n,i;try{for(var o=_p(r.getChildren()),a=o.next();!a.done;a=o.next()){var l=a.value;l.finalizeCreation()}}catch(c){n={error:c}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}r.fireInternalHook(jn.afterCreationFinalization)})}}),Object.defineProperty(t.prototype,"detach",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this.isAlive)throw rt("Error while detaching, node is not alive.");this.clearParent()}}),Object.defineProperty(t.prototype,"preboot",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;this._applyPatches=im(this.storedValue,"@APPLY_PATCHES",function(n){n.forEach(function(i){if(!i.path){r.type.applySnapshot(r,i.value);return}var o=zfe(i.path),a=Cfe(r,o.slice(0,-1));a.applyPatchLocally(o[o.length-1],i)})}),this._applySnapshot=im(this.storedValue,"@APPLY_SNAPSHOT",function(n){if(n!==r.snapshot)return r.type.applySnapshot(r,n)}),Yu(this.storedValue,"$treenode",this),Yu(this.storedValue,"toJSON",Pfe)}}),Object.defineProperty(t.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===Xn.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(t.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._observableInstanceState!==0&&(this.getChildren().forEach(function(r){r.aboutToDie()}),this.baseAboutToDie(),this._internalEventsEmit("dispose"),this._internalEventsClear("dispose"))}}),Object.defineProperty(t.prototype,"finalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.getChildren().forEach(function(n){n.finalizeDeath()}),this.root.identifierCache.notifyDied(this);var r=this.snapshot;this._snapshotUponDeath=r,this._internalEventsClearAll(),this.baseFinalizeDeath()}}),Object.defineProperty(t.prototype,"onSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._addSnapshotReaction(),this._internalEventsRegister("snapshot",r)}}),Object.defineProperty(t.prototype,"emitSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this._internalEventsEmit("snapshot",r)}}),Object.defineProperty(t.prototype,"onPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._internalEventsRegister("patch",r)}}),Object.defineProperty(t.prototype,"emitPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this._internalEventsHasSubscribers("patch")){var i=kfe({},r,{path:n.path.substr(this.path.length)+"/"+r.path}),o=YE(Nfe(i),2),a=o[0],l=o[1];this._internalEventsEmit("patch",a,l)}this.parent&&this.parent.emitPatch(r,n)}}),Object.defineProperty(t.prototype,"hasDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._internalEventsHas("dispose",r)}}),Object.defineProperty(t.prototype,"addDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!this.hasDisposer(r)){this._internalEventsRegister("dispose",r,!0);return}throw rt("cannot add a disposer when it is already registered for execution")}}),Object.defineProperty(t.prototype,"removeDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!this._internalEventsHas("dispose",r))throw rt("cannot remove a disposer which was never registered for execution");this._internalEventsUnregister("dispose",r)}}),Object.defineProperty(t.prototype,"removeMiddleware",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(this.middlewares){var n=this.middlewares.indexOf(r);n>=0&&this.middlewares.splice(n,1)}}}),Object.defineProperty(t.prototype,"addMiddleWare",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this;n===void 0&&(n=!0);var o={handler:r,includeHooks:n};return this.middlewares?this.middlewares.push(o):this.middlewares=[o],function(){i.removeMiddleware(o)}}}),Object.defineProperty(t.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){this.assertWritable({subpath:r}),this.createObservableInstanceIfNeeded(),this.type.applyPatchLocally(this,r,n)}}),Object.defineProperty(t.prototype,"_addSnapshotReaction",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;if(!this._hasSnapshotReaction){var n=Ya(function(){return r.snapshot},function(i){return r.emitSnapshot(i)},dfe);this.addDisposer(n),this._hasSnapshotReaction=!0}}}),Object.defineProperty(t.prototype,"_internalEventsHasSubscribers",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return!!this._internalEvents&&this._internalEvents.hasSubscribers(r)}}),Object.defineProperty(t.prototype,"_internalEventsRegister",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){return i===void 0&&(i=!1),this._internalEvents||(this._internalEvents=new HB),this._internalEvents.register(r,n,i)}}),Object.defineProperty(t.prototype,"_internalEventsHas",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return!!this._internalEvents&&this._internalEvents.has(r,n)}}),Object.defineProperty(t.prototype,"_internalEventsUnregister",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){this._internalEvents&&this._internalEvents.unregister(r,n)}}),Object.defineProperty(t.prototype,"_internalEventsEmit",{enumerable:!1,configurable:!0,writable:!0,value:function(r){for(var n,i=[],o=1;o<arguments.length;o++)i[o-1]=arguments[o];this._internalEvents&&(n=this._internalEvents).emit.apply(n,Pc([r],i))}}),Object.defineProperty(t.prototype,"_internalEventsClear",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this._internalEvents&&this._internalEvents.clear(r)}}),Object.defineProperty(t.prototype,"_internalEventsClearAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._internalEvents&&this._internalEvents.clearAll()}}),t}(jB);Ui.prototype.createObservableInstance=Sr(Ui.prototype.createObservableInstance);Ui.prototype.detach=Sr(Ui.prototype.detach);Ui.prototype.die=Sr(Ui.prototype.die);var $B,rr;(function(e){e[e.String=1]="String",e[e.Number=2]="Number",e[e.Boolean=4]="Boolean",e[e.Date=8]="Date",e[e.Literal=16]="Literal",e[e.Array=32]="Array",e[e.Map=64]="Map",e[e.Object=128]="Object",e[e.Frozen=256]="Frozen",e[e.Optional=512]="Optional",e[e.Reference=1024]="Reference",e[e.Identifier=2048]="Identifier",e[e.Late=4096]="Late",e[e.Refinement=8192]="Refinement",e[e.Union=16384]="Union",e[e.Null=32768]="Null",e[e.Undefined=65536]="Undefined",e[e.Integer=131072]="Integer",e[e.Custom=262144]="Custom",e[e.SnapshotProcessor=524288]="SnapshotProcessor",e[e.Lazy=1048576]="Lazy",e[e.Finite=2097152]="Finite",e[e.Float=4194304]="Float"})(rr||(rr={}));var AB="cannotDetermine",ffe=Symbol("$type"),Vs=function(){function e(t){Object.defineProperty(this,$B,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"C",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"S",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"T",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"N",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"isType",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=t}return Object.defineProperty(e.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return $s(this,t),this.instantiate(null,"",r,t).value}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){throw rt("unimplemented method")}}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t===this}}),Object.defineProperty(e.prototype,"validate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=LB(t);if(n){var i=IB(t);return this.isAssignableFrom(i)?Hi():Qi(r,t)}return this.isValidSnapshot(t,r)}}),Object.defineProperty(e.prototype,"is",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.validate(t,[{path:"",type:this}]).length===0}}),Object.defineProperty(e.prototype,"Type",{get:function(){throw rt("Factory.Type should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.Type`")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"TypeWithoutSTN",{get:function(){throw rt("Factory.TypeWithoutSTN should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.TypeWithoutSTN`")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"SnapshotType",{get:function(){throw rt("Factory.SnapshotType should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.SnapshotType`")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"CreationType",{get:function(){throw rt("Factory.CreationType should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.CreationType`")},enumerable:!1,configurable:!0}),e}();$B=ffe;Vs.prototype.create=Sr(Vs.prototype.create);var yf=function(e){Wr(t,e);function t(r){var n=e.call(this,r)||this;return Object.defineProperty(n,"identifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),n}return Object.defineProperty(t.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return r===void 0&&(r=this.getDefaultSnapshot()),e.prototype.create.call(this,r,n)}}),Object.defineProperty(t.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.createObservableInstanceIfNeeded(),r.storedValue}}),Object.defineProperty(t.prototype,"isMatchingSnapshotId",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return!r.identifierAttribute||r.identifier===Xm(n[r.identifierAttribute])}}),Object.defineProperty(t.prototype,"tryToReconcileNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return r.isDetaching?!1:r.snapshot===n||Xr(n)&&_r(n)===r?!0:r.type===this&&qB(n)&&!Xr(n)&&this.isMatchingSnapshotId(r,n)?(r.applySnapshot(n),!0):!1}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){var a=this.tryToReconcileNode(r,n);if(a)return r.setParent(i,o),r;if(r.die(),Xr(n)&&this.isAssignableFrom(IB(n))){var l=_r(n);return l.setParent(i,o),l}return this.instantiate(i,o,void 0,n)}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),t}(Vs);yf.prototype.create=Sr(yf.prototype.create);var Cc=function(e){Wr(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r}}),Object.defineProperty(t.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){if(!r.isDetaching&&r.type===this&&r.storedValue===n)return r;var a=this.instantiate(i,o,void 0,n);return r.die(),a}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),t}(Vs);function Xl(e){return typeof e=="object"&&e&&e.isType===!0}var hfe=1,xp;function DB(){return xp}function MB(){return hfe++}function OP(e,t){var r=_r(e.context);e.type==="action"&&r.assertAlive({actionContext:e});var n=r._isRunningAction;r._isRunningAction=!0;var i=xp;xp=e;try{return mfe(r,e,t)}finally{xp=i,r._isRunningAction=n}}function NB(e){if(e)return e.type==="action"?e:e.parentActionEvent}function im(e,t,r){var n=function(){var i=MB(),o=xp,a=NB(o);return OP({type:"action",name:t,id:i,args:WB(arguments),context:e,tree:afe(e),rootId:o?o.rootId:i,parentId:o?o.id:0,allParentIds:o?Pc(o.allParentIds,[o.id]):[],parentEvent:o,parentActionEvent:a},r)};return n._isMSTAction=!0,n._isFlowAction=r._isFlowAction,n}var pfe=function(){function e(t,r){Object.defineProperty(this,"arrayIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"inArrayIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"middlewares",{enumerable:!0,configurable:!0,writable:!0,value:[]}),r.$mst_middleware&&this.middlewares.push(r.$mst_middleware);for(var n=t;n;)n.middlewares&&this.middlewares.push(n.middlewares),n=n.parent}return Object.defineProperty(e.prototype,"isEmpty",{get:function(){return this.middlewares.length<=0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getNextMiddleware",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this.middlewares[this.arrayIndex];if(t){var r=t[this.inArrayIndex++];return r||(this.arrayIndex++,this.inArrayIndex=0,this.getNextMiddleware())}}}),e}();function mfe(e,t,r){var n=new pfe(e,r);if(n.isEmpty)return Sr(r).apply(null,t.args);var i=null;function o(a){var l=n.getNextMiddleware(),c=l&&l.handler;if(!c)return Sr(r).apply(null,a.args);if(!l.includeHooks&&jn[a.name])return o(a);function d(p,m){i=o(p),m&&(i=m(i))}function f(p){i=p}return c(a,d,f),i}return o(t)}function vfe(e){try{return JSON.stringify(e)}catch(t){return"<Unserializable: "+t+">"}}function FB(e){return typeof e=="function"?"<function"+(e.name?" "+e.name:"")+">":Xr(e)?"<"+e+">":"`"+vfe(e)+"`"}function gfe(e){return e.length<280?e:e.substring(0,272)+"......"+e.substring(e.length-8)}function yfe(e){var t=e.value,r=e.context[e.context.length-1].type,n=e.context.map(function(l){var c=l.path;return c}).filter(function(l){return l.length>0}).join("/"),i=n.length>0?'at path "/'+n+'" ':"",o=Xr(t)?"value of type "+_r(t).type.name+":":om(t)?"value":"snapshot",a=r&&Xr(t)&&r.is(_r(t).snapshot);return""+i+o+" "+FB(t)+" is not assignable "+(r?"to type: `"+r.name+"`":"")+(e.message?" ("+e.message+")":"")+(r?ihe(r)||om(t)?".":", expected an instance of `"+r.name+"` or a snapshot like `"+r.describe()+"` instead."+(a?" (Note that a snapshot of the provided value is compatible with the targeted type)":""):".")}function XE(e,t,r){return e.concat([{path:t,type:r}])}function Hi(){return bf}function Qi(e,t,r){return[{context:e,value:t,message:r}]}function rw(e){return e.reduce(function(t,r){return t.concat(r)},[])}function $s(e,t){Dfe()&&bfe(e,t)}function bfe(e,t){var r=e.validate(t,[{path:"",type:e}]);if(r.length>0)throw rt(wfe(e,t,r))}function wfe(e,t,r){if(r.length!==0)return"Error while converting "+gfe(FB(t))+" to `"+e.name+`\`:
|
1003
|
+
***************************************************************************** */var TP=function(e,t){return TP=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},TP(e,t)};function Wr(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");TP(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var Fi=function(){return Fi=Object.assign||function(t){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},Fi.apply(this,arguments)};function ofe(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function _p(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function YE(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(l){a={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o}function Pc(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(YE(arguments[t]));return e}function IB(e){return _r(e).type}function IA(e,t){_r(e).applyPatches(zB(t))}function kB(e,t){t===void 0&&(t=!0);var r=_r(e);return t?r.snapshot:r.type.getSnapshot(r,!1)}function afe(e){return _r(e).root.storedValue}function sfe(e){return _r(e).path}function lfe(e){return _r(e).identifier}function Og(e,t){t===void 0&&(t=!0);try{var r=e();if(r==null)return;if(Xr(r))return t?ufe(r)?r:void 0:r;throw rt("The reference to be checked is not one of node, null or undefined")}catch(n){if(n instanceof iV)return;throw n}}function ufe(e){return _r(e).observableIsAlive}var jB=function(){function e(t,r,n,i){Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"environment",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"_escapedSubpath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_subpath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_subpathUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pathUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"storedValue",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"aliveAtom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_state",{enumerable:!0,configurable:!0,writable:!0,value:Xn.INITIALIZING}),Object.defineProperty(this,"_hookSubscribers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"pathAtom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.environment=i,this.baseSetParent(r,n)}return Object.defineProperty(e.prototype,"subpath",{get:function(){return this._subpath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subpathUponDeath",{get:function(){return this._subpathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pathUponDeath",{get:function(){return this._pathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.type.getValue(this)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._state},set:function(t){var r=this.isAlive;this._state=t;var n=this.isAlive;this.aliveAtom&&r!==n&&this.aliveAtom.reportChanged()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fireInternalHook",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this._hookSubscribers&&this._hookSubscribers.emit(t,this,t)}}),Object.defineProperty(e.prototype,"registerHook",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return this._hookSubscribers||(this._hookSubscribers=new HB),this._hookSubscribers.register(t,r)}}),Object.defineProperty(e.prototype,"parent",{get:function(){return this._parent},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getReconciliationType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type}}),Object.defineProperty(e.prototype,"baseSetParent",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){this._parent=t,this._subpath=r,this._escapedSubpath=void 0,this.pathAtom&&this.pathAtom.reportChanged()}}),Object.defineProperty(e.prototype,"path",{get:function(){return this.getEscapedPath(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getEscapedPath",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t&&(this.pathAtom||(this.pathAtom=_b("path")),this.pathAtom.reportObserved()),this.parent?(this._escapedSubpath===void 0&&(this._escapedSubpath=this._subpath?Xu(this._subpath):""),this.parent.getEscapedPath(t)+"/"+this._escapedSubpath):""}}),Object.defineProperty(e.prototype,"isRoot",{get:function(){return this.parent===null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isAlive",{get:function(){return this.state!==Xn.DEAD},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isDetaching",{get:function(){return this.state===Xn.DETACHING},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"observableIsAlive",{get:function(){return this.aliveAtom||(this.aliveAtom=_b("alive")),this.aliveAtom.reportObserved(),this.isAlive},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseFinalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(this.state===Xn.CREATED){if(this.parent){if(this.parent.state!==Xn.FINALIZED)return;this.fireHook(jn.afterAttach)}this.state=Xn.FINALIZED,t&&t()}}}),Object.defineProperty(e.prototype,"baseFinalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._hookSubscribers&&this._hookSubscribers.clearAll(),this._subpathUponDeath=this._subpath,this._pathUponDeath=this.getEscapedPath(!1),this.baseSetParent(null,""),this.state=Xn.DEAD}}),Object.defineProperty(e.prototype,"baseAboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.fireHook(jn.beforeDestroy)}}),e}(),nm=function(e){Wr(t,e);function t(r,n,i,o,a){var l=e.call(this,r,n,i,o)||this;try{l.storedValue=r.createNewInstance(a)}catch(c){throw l.state=Xn.DEAD,c}return l.state=Xn.CREATED,l.finalizeCreation(),l}return Object.defineProperty(t.prototype,"root",{get:function(){if(!this.parent)throw rt("This scalar node is not part of a tree");return this.parent.root},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this.parent!==r,o=this.subpath!==n;!i&&!o||(this.environment=void 0,this.baseSetParent(this.parent,n))}}),Object.defineProperty(t.prototype,"snapshot",{get:function(){return this.getSnapshot()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(t.prototype,"toString",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=(this.isAlive?this.path:this.pathUponDeath)||"<root>";return this.type.name+"@"+r+(this.isAlive?"":" [dead]")}}),Object.defineProperty(t.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===Xn.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(t.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeCreation()}}),Object.defineProperty(t.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseAboutToDie()}}),Object.defineProperty(t.prototype,"finalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeDeath()}}),Object.defineProperty(t.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.fireInternalHook(r)}}),t}(jB);nm.prototype.die=Sr(nm.prototype.die);var cfe=1,dfe={onError:function(e){throw e}},Ui=function(e){Wr(t,e);function t(r,n,i,o,a){var l=e.call(this,r,n,i,o)||this;if(Object.defineProperty(l,"nodeId",{enumerable:!0,configurable:!0,writable:!0,value:++cfe}),Object.defineProperty(l,"identifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"identifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"unnormalizedIdentifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"identifierCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"isProtectionEnabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(l,"middlewares",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"hasSnapshotPostProcessor",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(l,"_applyPatches",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_applySnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_autoUnbox",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(l,"_isRunningAction",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(l,"_hasSnapshotReaction",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(l,"_observableInstanceState",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(l,"_childNodes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_initialSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_cachedInitialSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_cachedInitialSnapshotCreated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(l,"_snapshotComputed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_snapshotUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_internalEvents",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),l._snapshotComputed=dn(function(){return l.getSnapshot()}),l.unbox=l.unbox.bind(l),l._initialSnapshot=a,l.identifierAttribute=r.identifierAttribute,n||(l.identifierCache=new _fe),l._childNodes=r.initializeChildNodes(l,l._initialSnapshot),l.identifier=null,l.unnormalizedIdentifier=null,l.identifierAttribute&&l._initialSnapshot){var c=l._initialSnapshot[l.identifierAttribute];if(c===void 0){var d=l._childNodes[l.identifierAttribute];d&&(c=d.value)}if(typeof c!="string"&&typeof c!="number")throw rt("Instance identifier '"+l.identifierAttribute+"' for type '"+l.type.name+"' must be a string or a number");l.identifier=Xm(c),l.unnormalizedIdentifier=c}return n?n.root.identifierCache.addNodeToCache(l):l.identifierCache.addNodeToCache(l),l}return Object.defineProperty(t.prototype,"applyPatches",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.createObservableInstanceIfNeeded(),this._applyPatches(r)}}),Object.defineProperty(t.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.createObservableInstanceIfNeeded(),this._applySnapshot(r)}}),Object.defineProperty(t.prototype,"createObservableInstanceIfNeeded",{enumerable:!1,configurable:!0,writable:!0,value:function(r){r===void 0&&(r=!0),this._observableInstanceState===0&&this.createObservableInstance(r)}}),Object.defineProperty(t.prototype,"createObservableInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n,i,o,a;r===void 0&&(r=!0),this._observableInstanceState=1;for(var l=[],c=this.parent;c&&c._observableInstanceState===0;)l.unshift(c),c=c.parent;try{for(var d=_p(l),f=d.next();!f.done;f=d.next()){var p=f.value;p.createObservableInstanceIfNeeded(!1)}}catch(y){n={error:y}}finally{try{f&&!f.done&&(i=d.return)&&i.call(d)}finally{if(n)throw n.error}}var m=this.type;try{this.storedValue=m.createNewInstance(this._childNodes),this.preboot(),this._isRunningAction=!0,m.finalizeNewInstance(this,this.storedValue)}catch(y){throw this.state=Xn.DEAD,y}finally{this._isRunningAction=!1}if(this._observableInstanceState=2,this._snapshotComputed.trackAndCompute(),this.isRoot&&this._addSnapshotReaction(),this._childNodes=wf,this.state=Xn.CREATED,r){this.fireHook(jn.afterCreate),this.finalizeCreation();try{for(var g=_p(l.reverse()),b=g.next();!b.done;b=g.next()){var p=b.value;p.fireHook(jn.afterCreate),p.finalizeCreation()}}catch(y){o={error:y}}finally{try{b&&!b.done&&(a=g.return)&&a.call(g)}finally{if(o)throw o.error}}}}}),Object.defineProperty(t.prototype,"root",{get:function(){var r=this.parent;return r?r.root:this},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clearParent",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.parent){this.fireHook(jn.beforeDetach);var r=this.state;this.state=Xn.DETACHING;var n=this.root,i=n.environment,o=n.identifierCache.splitCache(this);try{this.parent.removeChild(this.subpath),this.baseSetParent(null,""),this.environment=i,this.identifierCache=o}finally{this.state=r}}}}),Object.defineProperty(t.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=r!==this.parent,o=n!==this.subpath;!i&&!o||(i?(this.environment=void 0,r.root.identifierCache.mergeCache(this),this.baseSetParent(r,n),this.fireHook(jn.afterAttach)):o&&this.baseSetParent(this.parent,n))}}),Object.defineProperty(t.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;this.fireInternalHook(r);var i=this.storedValue&&typeof this.storedValue=="object"&&this.storedValue[r];typeof i=="function"&&(Hp?Hp(function(){i.apply(n.storedValue)}):i.apply(this.storedValue))}}),Object.defineProperty(t.prototype,"snapshot",{get:function(){return this.hasSnapshotPostProcessor&&this.createObservableInstanceIfNeeded(),this._snapshotComputed.get()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.isAlive?this._observableInstanceState===2?this._getActualSnapshot():this._getCachedInitialSnapshot():this._snapshotUponDeath}}),Object.defineProperty(t.prototype,"_getActualSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(t.prototype,"_getCachedInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this._cachedInitialSnapshotCreated){var r=this.type,n=this._childNodes,i=this._initialSnapshot;this._cachedInitialSnapshot=r.processInitialSnapshot(n,i),this._cachedInitialSnapshotCreated=!0}return this._cachedInitialSnapshot}}),Object.defineProperty(t.prototype,"isRunningAction",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._isRunningAction?!0:this.isRoot?!1:this.parent.isRunningAction()}}),Object.defineProperty(t.prototype,"assertAlive",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=ife();if(!this.isAlive&&n!=="ignore"){var i=this._getAssertAliveError(r);switch(n){case"error":throw rt(i);case"warn":Afe(i)}}}}),Object.defineProperty(t.prototype,"_getAssertAliveError",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.getEscapedPath(!1)||this.pathUponDeath||"",i=r.subpath&&Xu(r.subpath)||"",o=r.actionContext||DB();o&&o.type!=="action"&&o.parentActionEvent&&(o=o.parentActionEvent);var a="";if(o&&o.name!=null){var l=o&&o.context&&sfe(o.context)||n;a=l+"."+o.name+"()"}return"You are trying to read or write to an object that is no longer part of a state tree. (Object type: '"+this.type.name+"', Path upon death: '"+n+"', Subpath: '"+i+"', Action: '"+a+"'). Either detach nodes first, or don't use objects after removing / replacing them in the tree."}}),Object.defineProperty(t.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.assertAlive({subpath:r}),this._autoUnbox=!1;try{return this._observableInstanceState===2?this.type.getChildNode(this,r):this._childNodes[r]}finally{this._autoUnbox=!0}}}),Object.defineProperty(t.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.assertAlive(wf),this._autoUnbox=!1;try{return this._observableInstanceState===2?this.type.getChildren(this):BB(this._childNodes)}finally{this._autoUnbox=!0}}}),Object.defineProperty(t.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.type.getChildType(r)}}),Object.defineProperty(t.prototype,"isProtected",{get:function(){return this.root.isProtectionEnabled},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"assertWritable",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(this.assertAlive(r),!this.isRunningAction()&&this.isProtected)throw rt("Cannot modify '"+this+"', the object is protected and can only be modified by using an action.")}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.type.removeChild(this,r)}}),Object.defineProperty(t.prototype,"unbox",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r&&(this.assertAlive({subpath:r.subpath||r.subpathUponDeath}),this._autoUnbox?r.value:r)}}),Object.defineProperty(t.prototype,"toString",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=(this.isAlive?this.path:this.pathUponDeath)||"<root>",n=this.identifier?"(id: "+this.identifier+")":"";return this.type.name+"@"+r+n+(this.isAlive?"":" [dead]")}}),Object.defineProperty(t.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;this.baseFinalizeCreation(function(){var n,i;try{for(var o=_p(r.getChildren()),a=o.next();!a.done;a=o.next()){var l=a.value;l.finalizeCreation()}}catch(c){n={error:c}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}r.fireInternalHook(jn.afterCreationFinalization)})}}),Object.defineProperty(t.prototype,"detach",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this.isAlive)throw rt("Error while detaching, node is not alive.");this.clearParent()}}),Object.defineProperty(t.prototype,"preboot",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;this._applyPatches=im(this.storedValue,"@APPLY_PATCHES",function(n){n.forEach(function(i){if(!i.path){r.type.applySnapshot(r,i.value);return}var o=zfe(i.path),a=Cfe(r,o.slice(0,-1));a.applyPatchLocally(o[o.length-1],i)})}),this._applySnapshot=im(this.storedValue,"@APPLY_SNAPSHOT",function(n){if(n!==r.snapshot)return r.type.applySnapshot(r,n)}),Yu(this.storedValue,"$treenode",this),Yu(this.storedValue,"toJSON",Pfe)}}),Object.defineProperty(t.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===Xn.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(t.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._observableInstanceState!==0&&(this.getChildren().forEach(function(r){r.aboutToDie()}),this.baseAboutToDie(),this._internalEventsEmit("dispose"),this._internalEventsClear("dispose"))}}),Object.defineProperty(t.prototype,"finalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.getChildren().forEach(function(n){n.finalizeDeath()}),this.root.identifierCache.notifyDied(this);var r=this.snapshot;this._snapshotUponDeath=r,this._internalEventsClearAll(),this.baseFinalizeDeath()}}),Object.defineProperty(t.prototype,"onSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._addSnapshotReaction(),this._internalEventsRegister("snapshot",r)}}),Object.defineProperty(t.prototype,"emitSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this._internalEventsEmit("snapshot",r)}}),Object.defineProperty(t.prototype,"onPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._internalEventsRegister("patch",r)}}),Object.defineProperty(t.prototype,"emitPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this._internalEventsHasSubscribers("patch")){var i=kfe({},r,{path:n.path.substr(this.path.length)+"/"+r.path}),o=YE(Nfe(i),2),a=o[0],l=o[1];this._internalEventsEmit("patch",a,l)}this.parent&&this.parent.emitPatch(r,n)}}),Object.defineProperty(t.prototype,"hasDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._internalEventsHas("dispose",r)}}),Object.defineProperty(t.prototype,"addDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!this.hasDisposer(r)){this._internalEventsRegister("dispose",r,!0);return}throw rt("cannot add a disposer when it is already registered for execution")}}),Object.defineProperty(t.prototype,"removeDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!this._internalEventsHas("dispose",r))throw rt("cannot remove a disposer which was never registered for execution");this._internalEventsUnregister("dispose",r)}}),Object.defineProperty(t.prototype,"removeMiddleware",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(this.middlewares){var n=this.middlewares.indexOf(r);n>=0&&this.middlewares.splice(n,1)}}}),Object.defineProperty(t.prototype,"addMiddleWare",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this;n===void 0&&(n=!0);var o={handler:r,includeHooks:n};return this.middlewares?this.middlewares.push(o):this.middlewares=[o],function(){i.removeMiddleware(o)}}}),Object.defineProperty(t.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){this.assertWritable({subpath:r}),this.createObservableInstanceIfNeeded(),this.type.applyPatchLocally(this,r,n)}}),Object.defineProperty(t.prototype,"_addSnapshotReaction",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;if(!this._hasSnapshotReaction){var n=Ya(function(){return r.snapshot},function(i){return r.emitSnapshot(i)},dfe);this.addDisposer(n),this._hasSnapshotReaction=!0}}}),Object.defineProperty(t.prototype,"_internalEventsHasSubscribers",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return!!this._internalEvents&&this._internalEvents.hasSubscribers(r)}}),Object.defineProperty(t.prototype,"_internalEventsRegister",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){return i===void 0&&(i=!1),this._internalEvents||(this._internalEvents=new HB),this._internalEvents.register(r,n,i)}}),Object.defineProperty(t.prototype,"_internalEventsHas",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return!!this._internalEvents&&this._internalEvents.has(r,n)}}),Object.defineProperty(t.prototype,"_internalEventsUnregister",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){this._internalEvents&&this._internalEvents.unregister(r,n)}}),Object.defineProperty(t.prototype,"_internalEventsEmit",{enumerable:!1,configurable:!0,writable:!0,value:function(r){for(var n,i=[],o=1;o<arguments.length;o++)i[o-1]=arguments[o];this._internalEvents&&(n=this._internalEvents).emit.apply(n,Pc([r],i))}}),Object.defineProperty(t.prototype,"_internalEventsClear",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this._internalEvents&&this._internalEvents.clear(r)}}),Object.defineProperty(t.prototype,"_internalEventsClearAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._internalEvents&&this._internalEvents.clearAll()}}),t}(jB);Ui.prototype.createObservableInstance=Sr(Ui.prototype.createObservableInstance);Ui.prototype.detach=Sr(Ui.prototype.detach);Ui.prototype.die=Sr(Ui.prototype.die);var $B,rr;(function(e){e[e.String=1]="String",e[e.Number=2]="Number",e[e.Boolean=4]="Boolean",e[e.Date=8]="Date",e[e.Literal=16]="Literal",e[e.Array=32]="Array",e[e.Map=64]="Map",e[e.Object=128]="Object",e[e.Frozen=256]="Frozen",e[e.Optional=512]="Optional",e[e.Reference=1024]="Reference",e[e.Identifier=2048]="Identifier",e[e.Late=4096]="Late",e[e.Refinement=8192]="Refinement",e[e.Union=16384]="Union",e[e.Null=32768]="Null",e[e.Undefined=65536]="Undefined",e[e.Integer=131072]="Integer",e[e.Custom=262144]="Custom",e[e.SnapshotProcessor=524288]="SnapshotProcessor",e[e.Lazy=1048576]="Lazy",e[e.Finite=2097152]="Finite",e[e.Float=4194304]="Float"})(rr||(rr={}));var AB="cannotDetermine",ffe=Symbol("$type"),Vs=function(){function e(t){Object.defineProperty(this,$B,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"C",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"S",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"T",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"N",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"isType",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=t}return Object.defineProperty(e.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return $s(this,t),this.instantiate(null,"",r,t).value}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){throw rt("unimplemented method")}}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t===this}}),Object.defineProperty(e.prototype,"validate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=LB(t);if(n){var i=IB(t);return this.isAssignableFrom(i)?Hi():Qi(r,t)}return this.isValidSnapshot(t,r)}}),Object.defineProperty(e.prototype,"is",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.validate(t,[{path:"",type:this}]).length===0}}),Object.defineProperty(e.prototype,"Type",{get:function(){throw rt("Factory.Type should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.Type`")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"TypeWithoutSTN",{get:function(){throw rt("Factory.TypeWithoutSTN should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.TypeWithoutSTN`")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"SnapshotType",{get:function(){throw rt("Factory.SnapshotType should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.SnapshotType`")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"CreationType",{get:function(){throw rt("Factory.CreationType should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.CreationType`")},enumerable:!1,configurable:!0}),e}();$B=ffe;Vs.prototype.create=Sr(Vs.prototype.create);var yf=function(e){Wr(t,e);function t(r){var n=e.call(this,r)||this;return Object.defineProperty(n,"identifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),n}return Object.defineProperty(t.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return r===void 0&&(r=this.getDefaultSnapshot()),e.prototype.create.call(this,r,n)}}),Object.defineProperty(t.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.createObservableInstanceIfNeeded(),r.storedValue}}),Object.defineProperty(t.prototype,"isMatchingSnapshotId",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return!r.identifierAttribute||r.identifier===Xm(n[r.identifierAttribute])}}),Object.defineProperty(t.prototype,"tryToReconcileNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return r.isDetaching?!1:r.snapshot===n||Xr(n)&&_r(n)===r?!0:r.type===this&&qB(n)&&!Xr(n)&&this.isMatchingSnapshotId(r,n)?(r.applySnapshot(n),!0):!1}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){var a=this.tryToReconcileNode(r,n);if(a)return r.setParent(i,o),r;if(r.die(),Xr(n)&&this.isAssignableFrom(IB(n))){var l=_r(n);return l.setParent(i,o),l}return this.instantiate(i,o,void 0,n)}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),t}(Vs);yf.prototype.create=Sr(yf.prototype.create);var Cc=function(e){Wr(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r}}),Object.defineProperty(t.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){if(!r.isDetaching&&r.type===this&&r.storedValue===n)return r;var a=this.instantiate(i,o,void 0,n);return r.die(),a}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),t}(Vs);function Xl(e){return typeof e=="object"&&e&&e.isType===!0}var hfe=1,xp;function DB(){return xp}function MB(){return hfe++}function OP(e,t){var r=_r(e.context);e.type==="action"&&r.assertAlive({actionContext:e});var n=r._isRunningAction;r._isRunningAction=!0;var i=xp;xp=e;try{return mfe(r,e,t)}finally{xp=i,r._isRunningAction=n}}function NB(e){if(e)return e.type==="action"?e:e.parentActionEvent}function im(e,t,r){var n=function(){var i=MB(),o=xp,a=NB(o);return OP({type:"action",name:t,id:i,args:WB(arguments),context:e,tree:afe(e),rootId:o?o.rootId:i,parentId:o?o.id:0,allParentIds:o?Pc(o.allParentIds,[o.id]):[],parentEvent:o,parentActionEvent:a},r)};return n._isMSTAction=!0,n._isFlowAction=r._isFlowAction,n}var pfe=function(){function e(t,r){Object.defineProperty(this,"arrayIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"inArrayIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"middlewares",{enumerable:!0,configurable:!0,writable:!0,value:[]}),r.$mst_middleware&&this.middlewares.push(r.$mst_middleware);for(var n=t;n;)n.middlewares&&this.middlewares.push(n.middlewares),n=n.parent}return Object.defineProperty(e.prototype,"isEmpty",{get:function(){return this.middlewares.length<=0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getNextMiddleware",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this.middlewares[this.arrayIndex];if(t){var r=t[this.inArrayIndex++];return r||(this.arrayIndex++,this.inArrayIndex=0,this.getNextMiddleware())}}}),e}();function mfe(e,t,r){var n=new pfe(e,r);if(n.isEmpty)return Sr(r).apply(null,t.args);var i=null;function o(a){var l=n.getNextMiddleware(),c=l&&l.handler;if(!c)return Sr(r).apply(null,a.args);if(!l.includeHooks&&jn[a.name])return o(a);function d(p,m){i=o(p),m&&(i=m(i))}function f(p){i=p}return c(a,d,f),i}return o(t)}function vfe(e){try{return JSON.stringify(e)}catch(t){return"<Unserializable: "+t+">"}}function FB(e){return typeof e=="function"?"<function"+(e.name?" "+e.name:"")+">":Xr(e)?"<"+e+">":"`"+vfe(e)+"`"}function gfe(e){return e.length<280?e:e.substring(0,272)+"......"+e.substring(e.length-8)}function yfe(e){var t=e.value,r=e.context[e.context.length-1].type,n=e.context.map(function(l){var c=l.path;return c}).filter(function(l){return l.length>0}).join("/"),i=n.length>0?'at path "/'+n+'" ':"",o=Xr(t)?"value of type "+_r(t).type.name+":":om(t)?"value":"snapshot",a=r&&Xr(t)&&r.is(_r(t).snapshot);return""+i+o+" "+FB(t)+" is not assignable "+(r?"to type: `"+r.name+"`":"")+(e.message?" ("+e.message+")":"")+(r?ihe(r)||om(t)?".":", expected an instance of `"+r.name+"` or a snapshot like `"+r.describe()+"` instead."+(a?" (Note that a snapshot of the provided value is compatible with the targeted type)":""):".")}function XE(e,t,r){return e.concat([{path:t,type:r}])}function Hi(){return bf}function Qi(e,t,r){return[{context:e,value:t,message:r}]}function rw(e){return e.reduce(function(t,r){return t.concat(r)},[])}function $s(e,t){Dfe()&&bfe(e,t)}function bfe(e,t){var r=e.validate(t,[{path:"",type:e}]);if(r.length>0)throw rt(wfe(e,t,r))}function wfe(e,t,r){if(r.length!==0)return"Error while converting "+gfe(FB(t))+" to `"+e.name+`\`:
|
1004
1004
|
|
1005
1005
|
`+r.map(yfe).join(`
|
1006
|
-
`)}var Sfe=0,_fe=function(){function e(){Object.defineProperty(this,"cacheId",{enumerable:!0,configurable:!0,writable:!0,value:Sfe++}),Object.defineProperty(this,"cache",{enumerable:!0,configurable:!0,writable:!0,value:er.map()}),Object.defineProperty(this,"lastCacheModificationPerId",{enumerable:!0,configurable:!0,writable:!0,value:er.map()})}return Object.defineProperty(e.prototype,"updateLastCacheModificationPerId",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this.lastCacheModificationPerId.get(t);this.lastCacheModificationPerId.set(t,r===void 0?1:r+1)}}),Object.defineProperty(e.prototype,"getLastCacheModificationPerId",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this.lastCacheModificationPerId.get(t)||0;return this.cacheId+"-"+r}}),Object.defineProperty(e.prototype,"addNodeToCache",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){if(r===void 0&&(r=!0),t.identifierAttribute){var n=t.identifier;this.cache.has(n)||this.cache.set(n,er.array([],nw));var i=this.cache.get(n);if(i.indexOf(t)!==-1)throw rt("Already registered");i.push(t),r&&this.updateLastCacheModificationPerId(n)}}}),Object.defineProperty(e.prototype,"mergeCache",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this;gL(t.identifierCache.cache).forEach(function(n){return n.forEach(function(i){r.addNodeToCache(i)})})}}),Object.defineProperty(e.prototype,"notifyDied",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(t.identifierAttribute){var r=t.identifier,n=this.cache.get(r);n&&(n.remove(t),n.length||this.cache.delete(r),this.updateLastCacheModificationPerId(t.identifier))}}}),Object.defineProperty(e.prototype,"splitCache",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this,n=new e,i=t.path+"/";return Mie(this.cache).forEach(function(o){for(var a=YE(o,2),l=a[0],c=a[1],d=!1,f=c.length-1;f>=0;f--){var p=c[f];(p===t||p.path.indexOf(i)===0)&&(n.addNodeToCache(p,!1),c.splice(f,1),c.length||r.cache.delete(l),d=!0)}d&&r.updateLastCacheModificationPerId(l)}),n}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=this.cache.get(r);return n?n.some(function(i){return t.isAssignableFrom(i.type)}):!1}}),Object.defineProperty(e.prototype,"resolve",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=this.cache.get(r);if(!n)return null;var i=n.filter(function(o){return t.isAssignableFrom(o.type)});switch(i.length){case 0:return null;case 1:return i[0];default:throw rt("Cannot resolve a reference to type '"+t.name+"' with id: '"+r+"' unambigously, there are multiple candidates: "+i.map(function(o){return o.path}).join(", "))}}}),e}();function JE(e,t,r,n,i){var o=LB(i);if(o){if(o.parent)throw rt("Cannot add an object to a state tree if it is already part of the same or another state tree. Tried to assign an object to '"+(t?t.path:"")+"/"+r+"', but it lives already at '"+o.path+"'");return t&&o.setParent(t,r),o}return new Ui(e,t,r,n,i)}function su(e,t,r,n,i){return new nm(e,t,r,n,i)}function xfe(e){return e instanceof nm||e instanceof Ui}var Xn;(function(e){e[e.INITIALIZING=0]="INITIALIZING",e[e.CREATED=1]="CREATED",e[e.FINALIZED=2]="FINALIZED",e[e.DETACHING=3]="DETACHING",e[e.DEAD=4]="DEAD"})(Xn||(Xn={}));function Xr(e){return!!(e&&e.$treenode)}function _r(e){if(!Xr(e))throw rt("Value "+e+" is no MST Node");return e.$treenode}function LB(e){return e&&e.$treenode||null}function Pfe(){return _r(this).snapshot}function Cfe(e,t,r){r===void 0&&(r=!0);var n=e;try{for(var i=0;i<t.length;i++){var o=t[i];if(o===".."){if(n=n.parent,n)continue}else{if(o===".")continue;if(n){if(n instanceof nm){var a=n.value;Xr(a)&&(n=_r(a))}if(n instanceof Ui){var l=n.getChildType(o);if(l&&(n=n.getChildNode(o),n))continue}}}throw rt("Could not resolve '"+o+"' in path '"+(k2(t.slice(0,i))||"/")+"' while resolving '"+k2(t)+"'")}}catch(c){if(!r)return;throw c}return n}function BB(e){if(!e)return bf;var t=Object.keys(e);if(!t.length)return bf;var r=new Array(t.length);return t.forEach(function(n,i){r[i]=e[n]}),r}var Efe=Object.toString(),bf=Object.freeze([]),wf=Object.freeze({}),nw=lie().useProxies?{deep:!1}:{deep:!1,proxy:!1};Object.freeze(nw);function rt(e){return e===void 0&&(e="Illegal state"),new Error("[mobx-state-tree] "+e)}function Tfe(e){return e}var Ofe=Number.isInteger;function Rfe(e){return Number(e)===e&&e%1!==0}function Ife(e){return Number.isFinite(e)}function VB(e){return Array.isArray(e)||Uo(e)}function zB(e){return e?VB(e)?e:[e]:bf}function kfe(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];for(var n=0;n<t.length;n++){var i=t[n];for(var o in i)e[o]=i[o]}return e}function zd(e){var t;if(e===null||typeof e!="object")return!1;var r=Object.getPrototypeOf(e);return r==null?!0:((t=r.constructor)===null||t===void 0?void 0:t.toString())===Efe}function qB(e){return e!==null&&typeof e=="object"&&!(e instanceof Date)&&!(e instanceof RegExp)}function om(e,t){return t===void 0&&(t=!0),e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"||t&&e instanceof Date}function UB(e){return typeof e!="function"}function jfe(e,t,r){Gi(e)?bL(e,t,r):Object.defineProperty(e,t,r)}function Yu(e,t,r){jfe(e,t,{enumerable:!1,writable:!1,configurable:!0,value:r})}var $fe=function(){function e(){Object.defineProperty(this,"handlers",{enumerable:!0,configurable:!0,writable:!0,value:[]})}return Object.defineProperty(e.prototype,"hasSubscribers",{get:function(){return this.handlers.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=this;return r===void 0&&(r=!1),r?this.handlers.unshift(t):this.handlers.push(t),function(){n.unregister(t)}}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.handlers.indexOf(t)>=0}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this.handlers.indexOf(t);r>=0&&this.handlers.splice(r,1)}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.handlers.length=0}}),Object.defineProperty(e.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=this.handlers.slice();n.forEach(function(i){return i.apply(void 0,Pc(t))})}}),e}(),HB=function(){function e(){Object.defineProperty(this,"eventHandlers",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}return Object.defineProperty(e.prototype,"hasSubscribers",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this.eventHandlers&&this.eventHandlers[t];return!!r&&r.hasSubscribers}}),Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,n){n===void 0&&(n=!1),this.eventHandlers||(this.eventHandlers={});var i=this.eventHandlers[t];return i||(i=this.eventHandlers[t]=new $fe),i.register(r,n)}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=this.eventHandlers&&this.eventHandlers[t];return!!n&&n.has(r)}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=this.eventHandlers&&this.eventHandlers[t];n&&n.unregister(r)}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.eventHandlers&&delete this.eventHandlers[t]}}),Object.defineProperty(e.prototype,"clearAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.eventHandlers=void 0}}),Object.defineProperty(e.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(t){for(var r,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var o=this.eventHandlers&&this.eventHandlers[t];o&&(r=o).emit.apply(r,Pc(n))}}),e}();function WB(e){for(var t=new Array(e.length),r=0;r<e.length;r++)t[r]=e[r];return t}function __(e,t){return e.indexOf(t)===0}function Afe(e){console.warn(new Error("[mobx-state-tree] "+e))}function Dfe(){return typeof process<"u"&&R2&&R2.ENABLE_TYPE_CHECK==="true"}function x_(e){typeof queueMicrotask=="function"?queueMicrotask(e):typeof setImmediate=="function"?setImmediate(e):setTimeout(e,1)}function io(e){return Mfe(e.name,e)}function Mfe(e,t){var r=function(){var i=MB(),o=DB();if(!o)throw rt("a mst flow must always have a parent context");var a=NB(o);if(!a)throw rt("a mst flow must always have a parent action context");var l={name:e,id:i,tree:o.tree,context:o.context,parentId:o.id,allParentIds:Pc(o.allParentIds,[o.id]),rootId:o.rootId,parentEvent:o,parentActionEvent:a},c=arguments;function d(f,p,m){return f.$mst_middleware=r.$mst_middleware,OP(Fi(Fi({},l),{type:p,args:[m]}),f)}return new Promise(function(f,p){var m,g=function(){m=t.apply(null,arguments),b(void 0)};g.$mst_middleware=r.$mst_middleware,OP(Fi(Fi({},l),{type:"flow_spawn",args:WB(c)}),g);function b(_){var S;try{var C=d(function(k){S=m.next(k)},"flow_resume",_);C instanceof Error&&(S=m.throw(C))}catch(k){x_(function(){d(function(E){p(k)},"flow_throw",k)});return}w(S)}function y(_){var S;try{d(function(C){S=m.throw(C)},"flow_resume_error",_)}catch(C){x_(function(){d(function(k){p(C)},"flow_throw",C)});return}w(S)}function w(_){if(_.done){x_(function(){d(function(S){f(S)},"flow_return",_.value)});return}if(!_.value||typeof _.value.then!="function")throw rt("Only promises can be yielded to `async`, got: "+_);return _.value.then(b,y)}})};return r._isFlowAction=!0,r}function Nfe(e){if(!("oldValue"in e))throw rt("Patches without `oldValue` field cannot be inversed");return[Ffe(e),Lfe(e)]}function Ffe(e){switch(e.op){case"add":return{op:"add",path:e.path,value:e.value};case"remove":return{op:"remove",path:e.path};case"replace":return{op:"replace",path:e.path,value:e.value}}}function Lfe(e){switch(e.op){case"add":return{op:"remove",path:e.path};case"remove":return{op:"add",path:e.path,value:e.oldValue};case"replace":return{op:"replace",path:e.path,value:e.oldValue}}}function Bfe(e){return typeof e=="number"}function Xu(e){return Bfe(e)===!0?""+e:e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function Vfe(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function k2(e){if(e.length===0)return"";var t=function(r){return r.map(Xu).join("/")};return e[0]==="."||e[0]===".."?t(e):"/"+t(e)}function zfe(e){var t=e.split("/").map(Vfe),r=e===""||e==="."||e===".."||__(e,"/")||__(e,"./")||__(e,"../");if(!r)throw rt("a json path must be either rooted, empty or relative, but got '"+e+"'");return t[0]===""&&t.shift(),t}var P_=Symbol("$preProcessorFailed"),qfe=function(e){Wr(t,e);function t(r,n,i){var o=e.call(this,i||r.name)||this;return Object.defineProperty(o,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(o,"_processors",{enumerable:!0,configurable:!0,writable:!0,value:n}),o}return Object.defineProperty(t.prototype,"flags",{get:function(){return this._subtype.flags|rr.SnapshotProcessor},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"snapshotProcessor("+this._subtype.describe()+")"}}),Object.defineProperty(t.prototype,"preProcessSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._processors.preProcessor?this._processors.preProcessor.call(null,r):r}}),Object.defineProperty(t.prototype,"preProcessSnapshotSafe",{enumerable:!1,configurable:!0,writable:!0,value:function(r){try{return this.preProcessSnapshot(r)}catch{return P_}}}),Object.defineProperty(t.prototype,"postProcessSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return this._processors.postProcessor?this._processors.postProcessor.call(null,r,n.storedValue):r}}),Object.defineProperty(t.prototype,"_fixNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;Ufe(r.type,this,"create"),r instanceof Ui&&(r.hasSnapshotPostProcessor=!!this._processors.postProcessor);var i=r.getSnapshot;r.getSnapshot=function(){return n.postProcessSnapshot(i.call(r),r)},che(this._subtype)||(r.getReconciliationType=function(){return n})}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){var a=Xr(o)?o:this.preProcessSnapshot(o),l=this._subtype.instantiate(r,n,i,a);return this._fixNode(l),l}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){var a=this._subtype.reconcile(r,Xr(n)?n:this.preProcessSnapshot(n),i,o);return a!==r&&this._fixNode(a),a}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){n===void 0&&(n=!0);var i=this._subtype.getSnapshot(r);return n?this.postProcessSnapshot(i,r):i}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this.preProcessSnapshotSafe(r);return i===P_?Qi(n,r,"Failed to preprocess value"):this._subtype.validate(i,n)}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),Object.defineProperty(t.prototype,"is",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=Xl(r)?this._subtype:Xr(r)?kB(r,!1):this.preProcessSnapshotSafe(r);return n===P_?!1:this._subtype.validate(n,[{path:"",type:this._subtype}]).length===0}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._subtype.isAssignableFrom(r)}}),Object.defineProperty(t.prototype,"isMatchingSnapshotId",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(!(this._subtype instanceof yf))return!1;var i=this.preProcessSnapshot(n);return this._subtype.isMatchingSnapshotId(r,i)}}),t}(Vs);function Ufe(e,t){for(var r,n,i=[],o=2;o<arguments.length;o++)i[o-2]=arguments[o];try{for(var a=_p(i),l=a.next();!l.done;l=a.next()){var c=l.value;e[c]=t[c].bind(t)}}catch(d){r={error:d}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}}function Hfe(e,t,r){return new qfe(e,t,r)}var j2="Map.put can only be used to store complex values that have an identifier type attribute";function KB(e,t){var r,n,i=e.getSubTypes();if(i===AB)return!1;if(i){var o=zB(i);try{for(var a=_p(o),l=a.next();!l.done;l=a.next()){var c=l.value;if(!KB(c,t))return!1}}catch(d){r={error:d}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}}return e instanceof am&&t.push(e),!0}var Rl;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.YES=1]="YES",e[e.NO=2]="NO"})(Rl||(Rl={}));var Wfe=function(e){Wr(t,e);function t(r,n){return e.call(this,r,er.ref.enhancer,n)||this}return Object.defineProperty(t.prototype,"get",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return e.prototype.get.call(this,""+r)}}),Object.defineProperty(t.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return e.prototype.has.call(this,""+r)}}),Object.defineProperty(t.prototype,"delete",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return e.prototype.delete.call(this,""+r)}}),Object.defineProperty(t.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return e.prototype.set.call(this,""+r,n)}}),Object.defineProperty(t.prototype,"put",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!r)throw rt("Map.put cannot be used to set empty values");if(Xr(r)){var n=_r(r);if(n.identifier===null)throw rt(j2);return this.set(n.identifier,r),r}else if(qB(r)){var i=_r(this),o=i.type;if(o.identifierMode!==Rl.YES)throw rt(j2);var a=o.mapIdentifierAttribute,l=r[a];if(!ZE(l)){var c=this.put(o.getChildType().create(r,i.environment));return this.put(kB(c))}var d=Xm(l);return this.set(d,r),this.get(d)}else throw rt("Map.put can only be used to store complex values")}}),t}(M0),Bb=function(e){Wr(t,e);function t(r,n,i){i===void 0&&(i=[]);var o=e.call(this,r)||this;return Object.defineProperty(o,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"identifierMode",{enumerable:!0,configurable:!0,writable:!0,value:Rl.UNKNOWN}),Object.defineProperty(o,"mapIdentifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"flags",{enumerable:!0,configurable:!0,writable:!0,value:rr.Map}),Object.defineProperty(o,"hookInitializers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),o._determineIdentifierMode(),o.hookInitializers=i,o}return Object.defineProperty(t.prototype,"hooks",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.hookInitializers.length>0?this.hookInitializers.concat(r):[r];return new t(this.name,this._subType,n)}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){return this._determineIdentifierMode(),JE(this,r,n,i,o)}}),Object.defineProperty(t.prototype,"_determineIdentifierMode",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.identifierMode===Rl.UNKNOWN){var r=[];if(KB(this._subType,r)){var n=r.reduce(function(i,o){if(!o.identifierAttribute)return i;if(i&&i!==o.identifierAttribute)throw rt("The objects in a map should all have the same identifier attribute, expected '"+i+"', but child of type '"+o.name+"' declared attribute '"+o.identifierAttribute+"' as identifier");return o.identifierAttribute},void 0);n?(this.identifierMode=Rl.YES,this.mapIdentifierAttribute=n):this.identifierMode=Rl.NO}}}}),Object.defineProperty(t.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){n===void 0&&(n={});var i=r.type._subType,o={};return Object.keys(n).forEach(function(a){o[a]=i.instantiate(r,a,void 0,n[a])}),o}}),Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return new Wfe(r,this.name)}}),Object.defineProperty(t.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){mL(n,r.unbox);var i=r.type;i.hookInitializers.forEach(function(o){var a=o(n);Object.keys(a).forEach(function(l){var c=a[l],d=im(n,l,c);Yu(n,l,d)})}),uE(n,this.willChange),A0(n,this.didChange)}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return gL(r.storedValue)}}),Object.defineProperty(t.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=r.storedValue.get(""+n);if(!i)throw rt("Not a child "+n);return i}}),Object.defineProperty(t.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=_r(r.object),i=r.name;n.assertWritable({subpath:i});var o=n.type,a=o._subType;switch(r.type){case"update":{var l=r.newValue,c=r.object.get(i);if(l===c)return null;$s(a,l),r.newValue=a.reconcile(n.getChildNode(i),r.newValue,n,i),o.processIdentifier(i,r.newValue)}break;case"add":$s(a,r.newValue),r.newValue=a.instantiate(n,i,void 0,r.newValue),o.processIdentifier(i,r.newValue);break}return r}}),Object.defineProperty(t.prototype,"processIdentifier",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this.identifierMode===Rl.YES&&n instanceof Ui){var i=n.identifier;if(i!==r)throw rt("A map of objects containing an identifier should always store the object under their own identifier. Trying to store key '"+i+"', but expected: '"+r+"'")}}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n={};return r.getChildren().forEach(function(i){n[i.subpath]=i.snapshot}),n}}),Object.defineProperty(t.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n={};return Object.keys(r).forEach(function(i){n[i]=r[i].getSnapshot()}),n}}),Object.defineProperty(t.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=_r(r.object);switch(r.type){case"update":return void n.emitPatch({op:"replace",path:Xu(r.name),value:r.newValue.snapshot,oldValue:r.oldValue?r.oldValue.snapshot:void 0},n);case"add":return void n.emitPatch({op:"add",path:Xu(r.name),value:r.newValue.snapshot,oldValue:void 0},n);case"delete":var i=r.oldValue.snapshot;return r.oldValue.die(),void n.emitPatch({op:"remove",path:Xu(r.name),oldValue:i},n)}}}),Object.defineProperty(t.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){var o=r.storedValue;switch(i.op){case"add":case"replace":o.set(n,i.value);break;case"remove":o.delete(n);break}}}),Object.defineProperty(t.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){$s(this,n);var i=r.storedValue,o={};if(Array.from(i.keys()).forEach(function(l){o[l]=!1}),n)for(var a in n)i.set(a,n[a]),o[""+a]=!0;Object.keys(o).forEach(function(l){o[l]===!1&&i.delete(l)})}}),Object.defineProperty(t.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subType}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this;return zd(r)?rw(Object.keys(r).map(function(o){return i._subType.validate(r[o],XE(n,o,i._subType))})):Qi(n,r,"Value is not a plain object")}}),Object.defineProperty(t.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return wf}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue.delete(n)}}),t}(yf);Bb.prototype.applySnapshot=Sr(Bb.prototype.applySnapshot);function Kfe(e){return new Bb("Map<string, "+e.name+">",e)}var Vb=function(e){Wr(t,e);function t(r,n,i){i===void 0&&(i=[]);var o=e.call(this,r)||this;return Object.defineProperty(o,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"flags",{enumerable:!0,configurable:!0,writable:!0,value:rr.Array}),Object.defineProperty(o,"hookInitializers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),o.hookInitializers=i,o}return Object.defineProperty(t.prototype,"hooks",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.hookInitializers.length>0?this.hookInitializers.concat(r):[r];return new t(this.name,this._subType,n)}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){return JE(this,r,n,i,o)}}),Object.defineProperty(t.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){n===void 0&&(n=[]);var i=r.type._subType,o={};return n.forEach(function(a,l){var c=""+l;o[c]=i.instantiate(r,c,void 0,a)}),o}}),Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=Fi(Fi({},nw),{name:this.name});return er.array(BB(r),n)}}),Object.defineProperty(t.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){ma(n).dehancer=r.unbox;var i=r.type;i.hookInitializers.forEach(function(o){var a=o(n);Object.keys(a).forEach(function(l){var c=a[l],d=im(n,l,c);Yu(n,l,d)})}),uE(n,this.willChange),A0(n,this.didChange)}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue.slice()}}),Object.defineProperty(t.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=Number(n);if(i<r.storedValue.length)return r.storedValue[i];throw rt("Not a child: "+n)}}),Object.defineProperty(t.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=_r(r.object);n.assertWritable({subpath:""+r.index});var i=n.type._subType,o=n.getChildren();switch(r.type){case"update":{if(r.newValue===r.object[r.index])return null;var a=$2(n,i,[o[r.index]],[r.newValue],[r.index]);if(!a)return null;r.newValue=a[0]}break;case"splice":{var l=r.index,c=r.removedCount,d=r.added,f=$2(n,i,o.slice(l,l+c),d,d.map(function(m,g){return l+g}));if(!f)return null;r.added=f;for(var p=l+c;p<o.length;p++)o[p].setParent(n,""+(p+d.length-c))}break}return r}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.getChildren().map(function(n){return n.snapshot})}}),Object.defineProperty(t.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=[];return Object.keys(r).forEach(function(i){n.push(r[i].getSnapshot())}),n}}),Object.defineProperty(t.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=_r(r.object);switch(r.type){case"update":return void n.emitPatch({op:"replace",path:""+r.index,value:r.newValue.snapshot,oldValue:r.oldValue?r.oldValue.snapshot:void 0},n);case"splice":for(var i=r.removedCount-1;i>=0;i--)n.emitPatch({op:"remove",path:""+(r.index+i),oldValue:r.removed[i].snapshot},n);for(var i=0;i<r.addedCount;i++)n.emitPatch({op:"add",path:""+(r.index+i),value:n.getChildNode(""+(r.index+i)).snapshot,oldValue:void 0},n);return}}}),Object.defineProperty(t.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){var o=r.storedValue,a=n==="-"?o.length:Number(n);switch(i.op){case"replace":o[a]=i.value;break;case"add":o.splice(a,0,i.value);break;case"remove":o.splice(a,1);break}}}),Object.defineProperty(t.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){$s(this,n);var i=r.storedValue;i.replace(n)}}),Object.defineProperty(t.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subType}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this;return VB(r)?rw(r.map(function(o,a){return i._subType.validate(o,XE(n,""+a,i._subType))})):Qi(n,r,"Value is not an array")}}),Object.defineProperty(t.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return bf}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue.splice(Number(n),1)}}),t}(yf);Vb.prototype.applySnapshot=Sr(Vb.prototype.applySnapshot);function Gfe(e){return new Vb(e.name+"[]",e)}function $2(e,t,r,n,i){for(var o=!0,a=0;;a++){var l=a<=n.length-1,c=r[a],d=l?n[a]:void 0,f=""+i[a];if(xfe(d)&&(d=d.storedValue),!c&&!l)break;if(!l)o=!1,r.splice(a,1),c instanceof Ui&&c.createObservableInstanceIfNeeded(),c.die(),a--;else if(c)if(A2(c,d))r[a]=C_(t,e,f,d,c);else{for(var m=void 0,g=a;g<r.length;g++)if(A2(r[g],d)){m=r.splice(g,1)[0];break}o=!1;var p=C_(t,e,f,d,m);r.splice(a,0,p)}else{if(Xr(d)&&_r(d).parent===e)throw rt("Cannot add an object to a state tree if it is already part of the same or another state tree. Tried to assign an object to '"+e.path+"/"+f+"', but it lives already at '"+_r(d).path+"'");o=!1;var p=C_(t,e,f,d);r.splice(a,0,p)}}return o?null:r}function C_(e,t,r,n,i){$s(e,n);function o(){if(Xr(n)){var l=_r(n);if(l.assertAlive(wf),l.parent!==null&&l.parent===t)return l.setParent(t,r),l}return i?e.reconcile(i,n,t,r):e.instantiate(t,r,void 0,n)}var a=o();return i&&i!==a&&(i instanceof Ui&&i.createObservableInstanceIfNeeded(),i.die()),a}function A2(e,t){if(!e.isAlive)return!1;if(Xr(t)){var r=_r(t);return r.isAlive&&r===e}if(e.snapshot===t)return!0;if(!(e instanceof Ui))return!1;var n=e.getReconciliationType();return e.identifier!==null&&e.identifierAttribute&&zd(t)&&n.is(t)&&n.isMatchingSnapshotId(e,t)}var D2="preProcessSnapshot",M2="postProcessSnapshot";function Qfe(){return _r(this).toString()}var N2={name:"AnonymousModel",properties:{},initializers:bf};function Yfe(e){var t=Object.keys(e),r=new Set;return t.forEach(function(n){if(r.has(n))throw rt(n+" is declared twice in the model. Model should not contain the same keys");r.add(n)}),t.reduce(function(n,i){if(i in jn)throw rt("Hook '"+i+"' was defined as property. Hooks should be defined as part of the actions");var o=Object.getOwnPropertyDescriptor(e,i);if("get"in o)throw rt("Getters are not supported as properties. Please use views instead");var a=o.value;if(a==null)throw rt("The default value of an attribute cannot be null or undefined as the type cannot be inferred. Did you mean `types.maybe(someType)`?");if(om(a))n[i]=Ju(nhe(a),a);else if(a instanceof Bb)n[i]=Ju(a,{});else if(a instanceof Vb)n[i]=Ju(a,[]);else if(!Xl(a))throw rt("Invalid type definition for property '"+i+"', cannot infer a type from a value like '"+a+"' ("+typeof a+")");return n},Fi({},e))}var am=function(e){Wr(t,e);function t(r){var n=e.call(this,r.name||N2.name)||this;return Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:rr.Object}),Object.defineProperty(n,"initializers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"properties",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"preProcessor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"postProcessor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"propertyNames",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"named",{enumerable:!0,configurable:!0,writable:!0,value:function(i){return n.cloneAndEnhance({name:i})}}),Object.defineProperty(n,"props",{enumerable:!0,configurable:!0,writable:!0,value:function(i){return n.cloneAndEnhance({properties:i})}}),Object.defineProperty(n,"preProcessSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:function(i){var o=n.preProcessor;return o?n.cloneAndEnhance({preProcessor:function(a){return o(i(a))}}):n.cloneAndEnhance({preProcessor:i})}}),Object.defineProperty(n,"postProcessSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:function(i){var o=n.postProcessor;return o?n.cloneAndEnhance({postProcessor:function(a){return i(o(a))}}):n.cloneAndEnhance({postProcessor:i})}}),Object.assign(n,N2,r),n.properties=Yfe(n.properties),n.properties,n.propertyNames=Object.keys(n.properties),n.identifierAttribute=n._getIdentifierAttribute(),n}return Object.defineProperty(t.prototype,"_getIdentifierAttribute",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=void 0;return this.forAllProps(function(n,i){if(i.flags&rr.Identifier){if(r)throw rt("Cannot define property '"+n+"' as object identifier, property '"+r+"' is already defined as identifier property");r=n}}),r}}),Object.defineProperty(t.prototype,"cloneAndEnhance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return new t({name:r.name||this.name,properties:Object.assign({},this.properties,r.properties),initializers:this.initializers.concat(r.initializers||[]),preProcessor:r.preProcessor||this.preProcessor,postProcessor:r.postProcessor||this.postProcessor})}}),Object.defineProperty(t.prototype,"actions",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this,i=function(o){return n.instantiateActions(o,r(o)),o};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(t.prototype,"instantiateActions",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(!zd(n))throw rt("actions initializer should return a plain object containing actions");Object.keys(n).forEach(function(i){if(i===D2)throw rt("Cannot define action '"+D2+"', it should be defined using 'type.preProcessSnapshot(fn)' instead");if(i===M2)throw rt("Cannot define action '"+M2+"', it should be defined using 'type.postProcessSnapshot(fn)' instead");var o=n[i],a=r[i];if(i in jn&&a){var l=o;o=function(){a.apply(null,arguments),l.apply(null,arguments)}}var c=o.$mst_middleware,d=o.bind(n);d._isFlowAction=o._isFlowAction||!1,d.$mst_middleware=c;var f=im(r,i,d);n[i]=f,Yu(r,i,f)})}}),Object.defineProperty(t.prototype,"volatile",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;if(typeof r!="function")throw rt("You passed an "+typeof r+" to volatile state as an argument, when function is expected");var i=function(o){return n.instantiateVolatileState(o,r(o)),o};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(t.prototype,"instantiateVolatileState",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(!zd(n))throw rt("volatile state initializer should return a plain object containing state");yL(r,n)}}),Object.defineProperty(t.prototype,"extend",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this,i=function(o){var a=r(o),l=a.actions,c=a.views,d=a.state,f=ofe(a,["actions","views","state"]);for(var p in f)throw rt("The `extend` function should return an object with a subset of the fields 'actions', 'views' and 'state'. Found invalid key '"+p+"'");return d&&n.instantiateVolatileState(o,d),c&&n.instantiateViews(o,c),l&&n.instantiateActions(o,l),o};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(t.prototype,"views",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this,i=function(o){return n.instantiateViews(o,r(o)),o};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(t.prototype,"instantiateViews",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(!zd(n))throw rt("views initializer should return a plain object containing views");Object.getOwnPropertyNames(n).forEach(function(i){var o,a=Object.getOwnPropertyDescriptor(n,i);if("get"in a)bL(r,i,a),D0(r,(o={},o[i]=dn,o));else if(typeof a.value=="function")Yu(r,i,a.value);else throw rt("A view member should either be a function or getter based property")})}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){var a=Xr(o)?o:this.applySnapshotPreProcessor(o);return JE(this,r,n,i,a)}}),Object.defineProperty(t.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){n===void 0&&(n={});var i=r.type,o={};return i.forAllProps(function(a,l){o[a]=l.instantiate(r,a,void 0,n[a])}),o}}),Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=Fi(Fi({},nw),{name:this.name});return er.object(r,wf,n)}}),Object.defineProperty(t.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){Yu(n,"toString",Qfe),this.forAllProps(function(i){mL(n,i,r.unbox)}),this.initializers.reduce(function(i,o){return o(i)},n),uE(n,this.willChange),A0(n,this.didChange)}}),Object.defineProperty(t.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=r,i=_r(n.object),o=n.name;i.assertWritable({subpath:o});var a=i.type.properties[o];return a&&($s(a,n.newValue),n.newValue=a.reconcile(i.getChildNode(o),n.newValue,i,o)),n}}),Object.defineProperty(t.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=r,i=_r(n.object),o=i.type.properties[n.name];if(o){var a=n.oldValue?n.oldValue.snapshot:void 0;i.emitPatch({op:"replace",path:Xu(n.name),value:n.newValue.snapshot,oldValue:a},i)}}}),Object.defineProperty(t.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this,i=[];return this.forAllProps(function(o){i.push(n.getChildNode(r,o))}),i}}),Object.defineProperty(t.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i;if(!(n in this.properties))throw rt("Not a value property: "+n);var o=ma(r.storedValue,n),a=(i=o.raw)===null||i===void 0?void 0:i.call(o);if(!a)throw rt("Node not available for property "+n);return a}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this;n===void 0&&(n=!0);var o={};return this.forAllProps(function(a,l){try{var c=sc(r.storedValue,a);c.reportObserved()}catch{throw rt(a+" property is declared twice")}o[a]=i.getChildNode(r,a).snapshot}),n?this.applySnapshotPostProcessor(o):o}}),Object.defineProperty(t.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n={};return Object.keys(r).forEach(function(i){n[i]=r[i].getSnapshot()}),this.applySnapshotPostProcessor(n)}}),Object.defineProperty(t.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){if(!(i.op==="replace"||i.op==="add"))throw rt("object does not support operation "+i.op);r.storedValue[n]=i.value}}),Object.defineProperty(t.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){$s(this,n);var i=this.applySnapshotPreProcessor(n);this.forAllProps(function(o){r.storedValue[o]=i[o]})}}),Object.defineProperty(t.prototype,"applySnapshotPreProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.preProcessor;return n?n.call(null,r):r}}),Object.defineProperty(t.prototype,"applySnapshotPostProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.postProcessor;return n?n.call(null,r):r}}),Object.defineProperty(t.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.properties[r]}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this,o=this.applySnapshotPreProcessor(r);return zd(o)?rw(this.propertyNames.map(function(a){return i.properties[a].validate(o[a],XE(n,a,i.properties[a]))})):Qi(n,o,"Value is not a plain object")}}),Object.defineProperty(t.prototype,"forAllProps",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;this.propertyNames.forEach(function(i){return r(i,n.properties[i])})}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;return"{ "+this.propertyNames.map(function(n){return n+": "+r.properties[n].describe()}).join("; ")+" }"}}),Object.defineProperty(t.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return wf}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue[n]=void 0}}),t}(yf);am.prototype.applySnapshot=Sr(am.prototype.applySnapshot);function Xfe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=typeof e[0]=="string"?e.shift():"AnonymousModel",n=e.shift()||{};return new am({name:r,properties:n})}function Jfe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=typeof e[0]=="string",n=r?e[0]:"AnonymousModel";return r&&e.shift(),e.reduce(function(i,o){return i.cloneAndEnhance({name:i.name+"_"+o.name,properties:o.properties,initializers:o.initializers,preProcessor:function(a){return o.applySnapshotPreProcessor(i.applySnapshotPreProcessor(a))},postProcessor:function(a){return o.applySnapshotPostProcessor(i.applySnapshotPostProcessor(a))}})}).named(n)}function Zfe(e){return Xl(e)&&(e.flags&rr.Object)>0}var Gs=function(e){Wr(t,e);function t(r,n,i,o){o===void 0&&(o=Tfe);var a=e.call(this,r)||this;return Object.defineProperty(a,"flags",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"checker",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(a,"initializer",{enumerable:!0,configurable:!0,writable:!0,value:o}),a.flags=n,a}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){return su(this,r,n,i,o)}}),Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.initializer(r)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(om(r)&&this.checker(r))return Hi();var i=this.name==="Date"?"Date or a unix milliseconds timestamp":this.name;return Qi(n,r,"Value is not a "+i)}}),t}(Cc),GB=new Gs("string",rr.String,function(e){return typeof e=="string"}),QB=new Gs("number",rr.Number,function(e){return typeof e=="number"}),ehe=new Gs("integer",rr.Integer,function(e){return Ofe(e)}),the=new Gs("float",rr.Float,function(e){return Rfe(e)}),rhe=new Gs("finite",rr.Finite,function(e){return Ife(e)}),YB=new Gs("boolean",rr.Boolean,function(e){return typeof e=="boolean"}),XB=new Gs("null",rr.Null,function(e){return e===null}),JB=new Gs("undefined",rr.Undefined,function(e){return e===void 0}),ZB=new Gs("Date",rr.Date,function(e){return typeof e=="number"||e instanceof Date},function(e){return e instanceof Date?e:new Date(e)});ZB.getSnapshot=function(e){return e.storedValue.getTime()};var eV=ZB;function nhe(e){switch(typeof e){case"string":return GB;case"number":return QB;case"boolean":return YB;case"object":if(e instanceof Date)return eV}throw rt("Cannot determine primitive type from value "+e)}function ihe(e){return Xl(e)&&(e.flags&(rr.String|rr.Number|rr.Integer|rr.Boolean|rr.Date))>0}var ohe=function(e){Wr(t,e);function t(r){var n=e.call(this,JSON.stringify(r))||this;return Object.defineProperty(n,"value",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:rr.Literal}),n.value=r,n}return Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){return su(this,r,n,i,o)}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return JSON.stringify(this.value)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return om(r)&&r===this.value?Hi():Qi(n,r,"Value is not a literal "+JSON.stringify(this.value))}}),t}(Cc);function tV(e){return new ohe(e)}var ahe=function(e){Wr(t,e);function t(r,n,i,o){var a=e.call(this,r)||this;return Object.defineProperty(a,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"_predicate",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(a,"_message",{enumerable:!0,configurable:!0,writable:!0,value:o}),a}return Object.defineProperty(t.prototype,"flags",{get:function(){return this._subtype.flags|rr.Refinement},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){return this._subtype.instantiate(r,n,i,o)}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._subtype.isAssignableFrom(r)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this._subtype.validate(r,n);if(i.length>0)return i;var o=Xr(r)?_r(r).snapshot:r;return this._predicate(o)?Hi():Qi(n,r,this._message(r))}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){return this._subtype.reconcile(r,n,i,o)}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),t}(Vs);function she(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=typeof e[0]=="string"?e.shift():Xl(e[0])?e[0].name:null,n=e[0],i=e[1],o=e[2]?e[2]:function(a){return"Value does not respect the refinement predicate"};return new ahe(r,n,i,o)}function lhe(e,t){var r=typeof e=="string"?t:e,n=iw.apply(void 0,Pc(r.map(function(i){return tV(""+i)})));return typeof e=="string"&&(n.name=e),n}var uhe=function(e){Wr(t,e);function t(r,n,i){var o=e.call(this,r)||this;return Object.defineProperty(o,"_types",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"_dispatcher",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"_eager",{enumerable:!0,configurable:!0,writable:!0,value:!0}),i=Fi({eager:!0,dispatcher:void 0},i),o._dispatcher=i.dispatcher,i.eager||(o._eager=!1),o}return Object.defineProperty(t.prototype,"flags",{get:function(){var r=rr.Union;return this._types.forEach(function(n){r|=n.flags}),r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._types.some(function(n){return n.isAssignableFrom(r)})}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"("+this._types.map(function(r){return r.describe()}).join(" | ")+")"}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){var a=this.determineType(o,void 0);if(!a)throw rt("No matching type for union "+this.describe());return a.instantiate(r,n,i,o)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){var a=this.determineType(n,r.getReconciliationType());if(!a)throw rt("No matching type for union "+this.describe());return a.reconcile(r,n,i,o)}}),Object.defineProperty(t.prototype,"determineType",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return this._dispatcher?this._dispatcher(r):n?n.is(r)?n:this._types.filter(function(i){return i!==n}).find(function(i){return i.is(r)}):this._types.find(function(i){return i.is(r)})}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this._dispatcher)return this._dispatcher(r).validate(r,n);for(var i=[],o=0,a=0;a<this._types.length;a++){var l=this._types[a],c=l.validate(r,n);if(c.length===0){if(this._eager)return Hi();o++}else i.push(c)}return o===1?Hi():Qi(n,r,"No type is applicable for the union").concat(rw(i))}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._types}}),t}(Vs);function iw(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=Xl(e)?void 0:e,i=Xl(e)?Pc([e],t):t,o="("+i.map(function(a){return a.name}).join(" | ")+")";return new uhe(o,i,n)}function che(e){return(e.flags&rr.Union)>0}var dhe=function(e){Wr(t,e);function t(r,n,i){var o=e.call(this,r.name)||this;return Object.defineProperty(o,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(o,"_defaultValue",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"optionalValues",{enumerable:!0,configurable:!0,writable:!0,value:i}),o}return Object.defineProperty(t.prototype,"flags",{get:function(){return this._subtype.flags|rr.Optional},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype.describe()+"?"}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){if(this.optionalValues.indexOf(o)>=0){var a=this.getDefaultInstanceOrSnapshot();return this._subtype.instantiate(r,n,i,a)}return this._subtype.instantiate(r,n,i,o)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){return this._subtype.reconcile(r,this.optionalValues.indexOf(n)<0&&this._subtype.is(n)?n:this.getDefaultInstanceOrSnapshot(),i,o)}}),Object.defineProperty(t.prototype,"getDefaultInstanceOrSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=typeof this._defaultValue=="function"?this._defaultValue():this._defaultValue;return typeof this._defaultValue=="function"&&$s(this,r),r}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return this.optionalValues.indexOf(r)>=0?Hi():this._subtype.validate(r,n)}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._subtype.isAssignableFrom(r)}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),t}(Vs);function fhe(e,t){if(typeof t!="function"&&Xr(t))throw rt("default value cannot be an instance, pass a snapshot or a function that creates an instance/snapshot instead")}function Ju(e,t,r){return fhe(e,t),new dhe(e,t,r||hhe)}var hhe=[void 0],phe=Ju(JB,void 0),mhe=Ju(XB,null);function rV(e){return iw(e,phe)}function vhe(e){return iw(e,mhe)}var ghe=function(e){Wr(t,e);function t(r,n){var i=e.call(this,r)||this;return Object.defineProperty(i,"_definition",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),i}return Object.defineProperty(t.prototype,"flags",{get:function(){return(this._subType?this._subType.flags:0)|rr.Late},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getSubType",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!this._subType){var n=void 0;try{n=this._definition()}catch(i){if(i instanceof ReferenceError)n=void 0;else throw i}if(r&&n===void 0)throw rt("Late type seems to be used too early, the definition (still) returns undefined");n&&(this._subType=n)}return this._subType}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){return this.getSubType(!0).instantiate(r,n,i,o)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){return this.getSubType(!0).reconcile(r,n,i,o)}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this.getSubType(!1);return r?r.name:"<uknown late type>"}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this.getSubType(!1);return i?i.validate(r,n):Hi()}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.getSubType(!1);return n?n.isAssignableFrom(r):!1}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this.getSubType(!1);return r||AB}}),t}(Vs);function yhe(e,t){var r=typeof e=="string"?e:"late("+e.toString()+")",n=typeof e=="string"?t:e;return new ghe(r,n)}function bhe(e,t){return new whe(e,t)}var whe=function(e){Wr(t,e);function t(r,n){var i=e.call(this,r)||this;return Object.defineProperty(i,"options",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"flags",{enumerable:!0,configurable:!0,writable:!0,value:rr.Lazy}),Object.defineProperty(i,"loadedType",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(i,"pendingNodeList",{enumerable:!0,configurable:!0,writable:!0,value:er.array()}),Bj(function(){return i.pendingNodeList.length>0&&i.pendingNodeList.some(function(o){return o.isAlive&&i.options.shouldLoadPredicate(o.parent?o.parent.value:null)})},function(){i.options.loadType().then(Sr(function(o){i.loadedType=o,i.pendingNodeList.forEach(function(a){a.parent&&i.loadedType&&a.parent.applyPatches([{op:"replace",path:"/"+a.subpath,value:a.snapshot}])})}))}),i}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"<lazy "+this.name+">"}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){var a=this;if(this.loadedType)return this.loadedType.instantiate(r,n,i,o);var l=su(this,r,n,i,o);return this.pendingNodeList.push(l),Bj(function(){return!l.isAlive},function(){return a.pendingNodeList.splice(a.pendingNodeList.indexOf(l),1)}),l}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return this.loadedType?this.loadedType.validate(r,n):UB(r)?Hi():Qi(n,r,"Value is not serializable and cannot be lazy")}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){return this.loadedType?(r.die(),this.loadedType.instantiate(i,o,i.environment,n)):e.prototype.reconcile.call(this,r,n,i,o)}}),t}(Cc),nV=function(e){Wr(t,e);function t(r){var n=e.call(this,r?"frozen("+r.name+")":"frozen")||this;return Object.defineProperty(n,"subType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:rr.Frozen}),n}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"<any immutable value>"}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){return su(this,r,n,i,o)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return UB(r)?this.subType?this.subType.validate(r,n):Hi():Qi(n,r,"Value is not serializable and cannot be frozen")}}),t}(Cc),F2=new nV;function She(e){return arguments.length===0?F2:Xl(e)?new nV(e):Ju(F2,e)}function _he(e){switch(e){case jn.beforeDestroy:return"destroy";case jn.beforeDetach:return"detach";default:return}}var xhe=function(){function e(t,r){if(Object.defineProperty(this,"targetType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"identifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"node",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"resolvedReference",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),ZE(t))this.identifier=t;else if(Xr(t)){var n=_r(t);if(!n.identifierAttribute)throw rt("Can only store references with a defined identifier attribute.");var i=n.unnormalizedIdentifier;if(i==null)throw rt("Can only store references to tree nodes with a defined identifier.");this.identifier=i}else throw rt("Can only store references to tree nodes or identifiers, got: '"+t+"'")}return Object.defineProperty(e.prototype,"updateResolvedReference",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=Xm(this.identifier),n=t.root,i=n.identifierCache.getLastCacheModificationPerId(r);if(!this.resolvedReference||this.resolvedReference.lastCacheModification!==i){var o=this.targetType,a=n.identifierCache.resolve(o,r);if(!a)throw new iV("[mobx-state-tree] Failed to resolve reference '"+this.identifier+"' to type '"+this.targetType.name+"' (from node: "+t.path+")");this.resolvedReference={node:a,lastCacheModification:i}}}}),Object.defineProperty(e.prototype,"resolvedValue",{get:function(){return this.updateResolvedReference(this.node),this.resolvedReference.node.value},enumerable:!1,configurable:!0}),e}(),iV=function(e){Wr(t,e);function t(r){var n=e.call(this,r)||this;return Object.setPrototypeOf(n,t.prototype),n}return t}(Error),oV=function(e){Wr(t,e);function t(r,n){var i=e.call(this,"reference("+r.name+")")||this;return Object.defineProperty(i,"targetType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(i,"onInvalidated",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"flags",{enumerable:!0,configurable:!0,writable:!0,value:rr.Reference}),i}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.targetType.isAssignableFrom(r)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return ZE(r)?Hi():Qi(n,r,"Value is not a valid identifier, which is a string or a number")}}),Object.defineProperty(t.prototype,"fireInvalidated",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){var a=n.parent;if(!(!a||!a.isAlive)){var l=a.storedValue;l&&this.onInvalidated({cause:r,parent:l,invalidTarget:o?o.storedValue:void 0,invalidId:i,replaceRef:function(c){I2(n.root.storedValue,{op:"replace",value:c,path:n.path})},removeRef:function(){Zfe(a.type)?this.replaceRef(void 0):I2(n.root.storedValue,{op:"remove",path:n.path})}})}}}),Object.defineProperty(t.prototype,"addTargetNodeWatcher",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this,o=this.getValue(r);if(o){var a=_r(o),l=function(f,p){var m=_he(p);m&&i.fireInvalidated(m,r,n,a)},c=a.registerHook(jn.beforeDetach,l),d=a.registerHook(jn.beforeDestroy,l);return function(){c(),d()}}}}),Object.defineProperty(t.prototype,"watchTargetNodeForInvalidations",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){var o=this;if(this.onInvalidated){var a;r.registerHook(jn.beforeDestroy,function(){a&&a()});var l=function(c){a&&a();var d=r.parent,f=d&&d.storedValue;if(d&&d.isAlive&&f){var p=void 0;i?p=!!i.get(n,f):p=r.root.identifierCache.has(o.targetType,Xm(n)),p?a=o.addTargetNodeWatcher(r,n):c||o.fireInvalidated("invalidSnapshotReference",r,n,null)}};r.state===Xn.FINALIZED?l(!0):(r.isRoot||r.root.registerHook(jn.afterCreationFinalization,function(){r.parent&&r.parent.createObservableInstanceIfNeeded()}),r.registerHook(jn.afterAttach,function(){l(!1)}))}}}),t}(Cc),Phe=function(e){Wr(t,e);function t(r,n){return e.call(this,r,n)||this}return Object.defineProperty(t.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(r.isAlive){var n=r.storedValue;return n.resolvedValue}}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=r.storedValue;return n.identifier}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){var a=Xr(o)?lfe(o):o,l=new xhe(o,this.targetType),c=su(this,r,n,i,l);return l.node=c,this.watchTargetNodeForInvalidations(c,a,void 0),c}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){if(!r.isDetaching&&r.type===this){var a=Xr(n),l=r.storedValue;if(!a&&l.identifier===n||a&&l.resolvedValue===n)return r.setParent(i,o),r}var c=this.instantiate(i,o,void 0,n);return r.die(),c}}),t}(oV),Che=function(e){Wr(t,e);function t(r,n,i){var o=e.call(this,r,i)||this;return Object.defineProperty(o,"options",{enumerable:!0,configurable:!0,writable:!0,value:n}),o}return Object.defineProperty(t.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(r.isAlive){var n=this.options.get(r.storedValue,r.parent?r.parent.storedValue:null);return n}}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){var a=Xr(o)?this.options.set(o,r?r.storedValue:null):o,l=su(this,r,n,i,a);return this.watchTargetNodeForInvalidations(l,a,this.options),l}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){var a=Xr(n)?this.options.set(n,r?r.storedValue:null):n;if(!r.isDetaching&&r.type===this&&r.storedValue===a)return r.setParent(i,o),r;var l=this.instantiate(i,o,void 0,a);return r.die(),l}}),t}(oV);function aV(e,t){var r=t||void 0,n=t?t.onInvalidated:void 0;return r&&(r.get||r.set)?new Che(e,{get:r.get,set:r.set},n):new Phe(e,n)}function Ehe(e,t){var r=aV(e,Fi(Fi({},t),{onInvalidated:function(n){t&&t.onInvalidated&&t.onInvalidated(n),n.removeRef()}}));return t&&t.acceptsUndefined===!1?r:rV(r)}var sV=function(e){Wr(t,e);function t(r,n){var i=e.call(this,r)||this;return Object.defineProperty(i,"validType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"flags",{enumerable:!0,configurable:!0,writable:!0,value:rr.Identifier}),i}return Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){if(!r||!(r.type instanceof am))throw rt("Identifier types can only be instantiated as direct child of a model type");return su(this,r,n,i,o)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){if(r.storedValue!==n)throw rt("Tried to change identifier from '"+r.storedValue+"' to '"+n+"'. Changing identifiers is not allowed.");return r.setParent(i,o),r}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return typeof r!==this.validType?Qi(n,r,"Value is not a valid "+this.describe()+", expected a "+this.validType):Hi()}}),t}(Cc),The=function(e){Wr(t,e);function t(){var r=e.call(this,"identifier","string")||this;return Object.defineProperty(r,"flags",{enumerable:!0,configurable:!0,writable:!0,value:rr.Identifier}),r}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifier"}}),t}(sV),Ohe=function(e){Wr(t,e);function t(){return e.call(this,"identifierNumber","number")||this}return Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifierNumber"}}),t}(sV),Rhe=new The,Ihe=new Ohe;function Xm(e){return""+e}function ZE(e){return typeof e=="string"||typeof e=="number"}function khe(e){return new jhe(e)}var jhe=function(e){Wr(t,e);function t(r){var n=e.call(this,r.name)||this;return Object.defineProperty(n,"options",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:rr.Custom}),n}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this.options.isTargetType(r))return Hi();var i=this.options.getValidationMessage(r);return i?Qi(n,r,"Invalid value for type '"+this.name+"': "+i):Hi()}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.options.toSnapshot(r.storedValue)}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){var a=this.options.isTargetType(o)?o:this.options.fromSnapshot(o,r&&r.root.environment);return su(this,r,n,i,a)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){var a=!this.options.isTargetType(n);if(!r.isDetaching){var l=r.type===this&&(a?n===r.snapshot:n===r.storedValue);if(l)return r.setParent(i,o),r}var c=a?this.options.fromSnapshot(n,i.root.environment):n,d=this.instantiate(i,o,void 0,c);return r.die(),d}}),t}(Cc),be={enumeration:lhe,model:Xfe,compose:Jfe,custom:khe,reference:aV,safeReference:Ehe,union:iw,optional:Ju,literal:tV,maybe:rV,maybeNull:vhe,refinement:she,string:GB,boolean:YB,number:QB,integer:ehe,float:the,finite:rhe,Date:eV,map:Kfe,array:Gfe,frozen:She,identifier:Rhe,identifierNumber:Ihe,late:yhe,lazy:bhe,undefined:JB,null:XB,snapshotProcessor:Hfe};const Ec=(e,t)=>be.model(e,{totalCount:0,hasNextPage:!1,countLoaded:0,edges:be.array(be.model({cursor:be.string,node:be.reference(t)}))}).views(r=>({get startCursor(){var n;return((n=r.edges[0])==null?void 0:n.cursor)||null},get endCursor(){var n;return((n=r.edges[r.edges.length-1])==null?void 0:n.cursor)||null},get availableNextPage(){return r.hasNextPage||r.countLoaded===0}})).actions(r=>({reset(){r.totalCount=0,r.countLoaded=0,r.hasNextPage=!1,r.edges=[]},onLoad(n){r.countLoaded+=1,r.totalCount=n.totalCount,r.hasNextPage=n.hasNextPage,r.edges.push(...n.edges)},removeEdge(n){const i=r.edges.find(o=>o.cursor===n);i&&(r.totalCount-=1,r.edges.remove(i))},replaceNode(n,i){const o=r.edges.find(a=>a.cursor===n);o&&(o.node=i)}})),$he=Ec("OrganizationProjectsConnection",be.late(()=>sm)),eT=be.model("OrganizationModel",{id:be.identifier,projectsConnection:be.optional($he,{})}),Ahe=Ec("ProjectBranchesConnection",be.late(()=>lm)),sm=be.model("ProjectModel",{id:be.identifier,organization:be.reference(be.late(()=>eT)),name:be.string,isPublic:be.boolean,createdAt:be.late(()=>Jl),rootBranch:be.reference(be.late(()=>lm)),branchesConnection:be.optional(Ahe,{})}),lm=be.model("BranchModel",{id:be.identifier,name:be.string,createdAt:be.late(()=>Jl),touched:be.boolean,start:be.reference(be.late(()=>Zu)),head:be.reference(be.late(()=>Zu)),draft:be.reference(be.late(()=>Zu)),parentBranch:be.maybe(be.model({branchName:be.string,fromRevisionId:be.string}))}).actions(e=>({updateTouched(t){e.touched=t}})),Dhe=Ec("RevisionTablesConnection",be.late(()=>um)),Zu=be.model("RevisionModel",{id:be.identifier,createdAt:be.late(()=>Jl),comment:"",parent:be.maybe(be.reference(be.late(()=>Zu))),isThereParent:be.optional(be.boolean,!1),child:be.maybe(be.reference(be.late(()=>Zu))),isThereChild:be.optional(be.boolean,!1),childBranches:be.array(be.model({branchName:be.string,revisionStartId:be.string})),endpoints:be.array(be.reference(be.late(()=>lV))),tablesConnection:be.optional(Dhe,{})}).actions(e=>({addEndpoint(t){e.endpoints.push(t)},removeEndpoint(t){const r=e.endpoints.find(n=>n.id===t);r&&e.endpoints.remove(r)},update(t){t.comment&&(e.comment=t.comment),t.parent&&(e.parent=t.parent),t.child&&(e.child=t.child),t.childBranches&&(e.childBranches=t.childBranches),t.endpoints&&(e.endpoints=[],e.endpoints.push(...t.endpoints))}})).views(e=>({getParentsDetails(t){const r=[];if(!e.isThereParent)return{isAllLoaded:!0,loadedSequence:r};let n=Og(()=>e.parent);if(!n)return{isAllLoaded:!1,loadedSequence:r};r.push(n);for(let i=1;i<t;i++){if(!n.isThereParent)return{isAllLoaded:!0,loadedSequence:r};if(n=Og(()=>n.parent),!n)return{isAllLoaded:!1,loadedSequence:r};r.push(n)}return{isAllLoaded:!0,loadedSequence:r}},getChildrenDetails(t){const r=[];if(!e.isThereChild)return{isAllLoaded:!0,loadedSequence:r};let n=Og(()=>e.child);if(!n)return{isAllLoaded:!1,loadedSequence:r};r.push(n);for(let i=1;i<t;i++){if(!n.isThereChild)return{isAllLoaded:!0,loadedSequence:r};if(n=Og(()=>n.child),!n)return{isAllLoaded:!1,loadedSequence:r};r.push(n)}return{isAllLoaded:!0,loadedSequence:r}}})),lV=be.model("EndpointModel",{id:be.identifier,createdAt:be.late(()=>Jl),type:be.enumeration("EndpointType",["GRAPHQL","REST_API"])}),Mhe=Ec("TableRowsConnection",be.late(()=>cm)),Nhe=Ec("foreignKeysByConnection",be.late(()=>um)),um=be.model("TableModel",{createdId:be.string,id:be.string,versionId:be.identifier,count:be.integer,readonly:be.boolean,createdAt:be.late(()=>Jl),updatedAt:be.late(()=>Jl),schema:be.frozen({}),rowsConnection:be.optional(Mhe,{}),foreignKeysByConnection:be.optional(Nhe,{})}).actions(e=>({update(t){for(const[r,n]of Object.entries(t))e[r]=n}})),L2=Ec("RowForeignKeysByConnection",be.late(()=>cm)),cm=be.model("RowModel",{createdId:be.string,id:be.string,versionId:be.identifier,createdAt:be.late(()=>Jl),updatedAt:be.late(()=>Jl),readonly:be.boolean,data:be.frozen({}),rowForeignKeysByConnection:be.map(be.optional(L2,{}))}).actions(e=>({update(t){for(const[r,n]of Object.entries(t))e[r]=n},getOrCreateRowForeignKeysByConnection(t){return e.rowForeignKeysByConnection.has(t)||e.rowForeignKeysByConnection.set(t,L2.create()),e.rowForeignKeysByConnection.get(t)}})),Jl=be.custom({name:"ISODate",fromSnapshot(e){return new Date(e)},toSnapshot(e){return e.toISOString()},isTargetType(e){return e instanceof Date},getValidationMessage(e){return typeof e=="string"&&!isNaN(Date.parse(e))?"":`'${e}' is not a valid ISO date string`}});be.frozen();let nn=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,r)=>(r&=63,r<36?t+=r.toString(36):r<62?t+=(r-26).toString(36).toUpperCase():r>62?t+="-":t+="_",t),"");be.model({startCursor:be.maybeNull(be.string),endCursor:be.maybeNull(be.string),hasNextPage:!1,hasPreviousPage:!1});const E_=be.model("RowForeignKeysByModel",{id:be.identifier,countForeignKeysBy:be.optional(be.integer,0)}).actions(e=>({update(t){for(const[r,n]of Object.entries(t))e[r]=n}})),$a=e=>JSON.stringify(e),Fhe=Ec("MeProjectsConnection",be.late(()=>sm)),uV=be.model({id:be.identifier,meProjectsConnection:be.optional(Fhe,{}),organization:be.map(be.late(()=>eT)),project:be.map(be.late(()=>sm)),projectByVariables:be.map(be.reference(be.late(()=>sm))),branch:be.map(be.late(()=>lm)),branchByVariables:be.map(be.reference(be.late(()=>lm))),revision:be.map(be.late(()=>Zu)),endpoint:be.map(be.late(()=>lV)),table:be.map(be.late(()=>um)),tableByVariables:be.map(be.reference(be.late(()=>um))),row:be.map(be.late(()=>cm)),rowByVariables:be.map(be.reference(be.late(()=>cm))),rowForeignKeysBy:be.map(be.late(()=>E_)),rowForeignKeysByByVariables:be.map(be.reference(be.late(()=>E_)))}).views(e=>({getOrganization(t){return dn(()=>e.organization.get(t)).get()},getProject(t){return dn(()=>e.project.get(t)).get()},getProjectByVariables({organizationId:t,projectName:r}){return dn(()=>e.projectByVariables.get($a({organizationId:t,projectName:r}))).get()},getBranch(t){return dn(()=>e.branch.get(t)).get()},getBranchByVariables({organizationId:t,projectName:r,branchName:n}){return dn(()=>e.branchByVariables.get($a({organizationId:t,projectName:r,branchName:n}))).get()},getRevision(t){return dn(()=>e.revision.get(t)).get()},getEndpoint(t){return dn(()=>e.endpoint.get(t)).get()},getTable(t){return dn(()=>e.table.get(t)).get()},getTableByVariables({revisionId:t,tableId:r}){return dn(()=>e.tableByVariables.get($a({revisionId:t,tableId:r}))).get()},getRow(t){return dn(()=>e.row.get(t)).get()},getRowByVariables({revisionId:t,tableId:r,rowId:n}){return dn(()=>e.rowByVariables.get($a({revisionId:t,tableId:r,rowId:n}))).get()},getRowForeignKeysByVariables({revisionId:t,tableId:r,rowId:n}){return dn(()=>e.rowForeignKeysByByVariables.get($a({revisionId:t,tableId:r,rowId:n}))).get()}})).actions(e=>({addOrganization(t){const r=e.organization.get(t.id);return r||e.organization.put(t)},addProject(t){const r=e.project.get(t.id);return r||e.project.put(t)},addProjectByVariables({organizationId:t,projectName:r},n){e.projectByVariables.set($a({organizationId:t,projectName:r}),n)},addOrUpdateBranch(t){const r=e.branch.get(t.id);return r?(r.touched=t.touched,r.start=t.start,r.head=t.head,r.draft=t.draft,r):e.branch.put(t)},addBranchByVariables({organizationId:t,projectName:r,branchName:n},i){e.branchByVariables.set($a({organizationId:t,projectName:r,branchName:n}),i)},addOrUpdateRevision(t){const r=e.revision.get(t.id);return r?(r.update(t),r):e.revision.put(t)},addEndpoint(t){const r=e.endpoint.get(t.id);return r||e.endpoint.put(t)},addOrTable(t){const r=e.table.get(t.versionId);return r?(r.readonly=t.readonly,r.createdAt=t.createdAt,r.id=t.id,t.count&&(r.count=t.count),t.schema&&(r.schema=t.schema),r):e.table.put(t)},addTableByVariables({revisionId:t,tableId:r},n){e.tableByVariables.set($a({revisionId:t,tableId:r}),n)},addRow(t){const r=e.row.get(t.versionId);return r?(r.update(t),r):e.row.put(t)},addRowByVariables({revisionId:t,tableId:r,rowId:n},i){e.rowByVariables.set($a({revisionId:t,tableId:r,rowId:n}),i)},createRowForeignKeysByByVariables({revisionId:t,tableId:r,rowId:n}){const i=E_.create({id:nn(),countForeignKeysBy:0});return e.rowForeignKeysBy.put(i),e.rowForeignKeysByByVariables.set($a({revisionId:t,tableId:r,rowId:n}),i.id),i}})),cV=e=>({id:e.id,createdAt:e.createdAt,type:e.type}),Lhe=e=>{var t,r,n,i;return{id:e.id,createdAt:e.createdAt,comment:e.comment,parent:(t=e.parent)==null?void 0:t.id,isThereParent:!!((r=e.parent)!=null&&r.id),child:(n=e.child)==null?void 0:n.id,isThereChild:!!((i=e.child)!=null&&i.id),childBranches:e.childBranches.map(o=>({branchName:o.branch.name,revisionStartId:o.revision.id})),endpoints:e.endpoints.map(o=>o.id)}},Pp=(e,t)=>(t.endpoints.map(r=>e.addEndpoint(cV(r))),e.addOrUpdateRevision(Lhe(t))),Bhe=(e,t)=>({id:e.id,name:e.name,touched:e.touched,createdAt:e.createdAt,start:e.start.id,head:e.head.id,draft:e.draft.id,parentBranch:t}),Jm=(e,t)=>{Pp(e,t.start),Pp(e,t.head),Pp(e,{...t.draft,childBranches:[]});const r=t.parent,n=r?{branchName:r.branch.name,fromRevisionId:r.revision.id}:void 0,i=Bhe(t,n);return e.addOrUpdateBranch(i)},dV=e=>({id:e.id,organization:e.organizationId,name:e.name,createdAt:e.createdAt,isPublic:e.isPublic,rootBranch:e.rootBranch.id}),fV=(e,t)=>(e.addOrganization({id:t.organizationId}),Jm(e,t.rootBranch),e.addProject(dV(t))),hV=e=>({startCursor:e.endCursor||null,endCursor:e.endCursor||null,hasPreviousPage:e.hasPreviousPage,hasNextPage:e.hasNextPage}),pV=e=>({totalCount:e.totalCount,pageInfo:hV(e.pageInfo),edges:e.edges.map(({cursor:t,node:r})=>({cursor:t,node:r.id}))}),ow=e=>({totalCount:e.totalCount,pageInfo:hV(e.pageInfo),edges:e.edges.map(({cursor:t,node:r})=>({cursor:t,node:r.versionId}))}),Vhe=dt.get(es);function zhe(e){return function*(r){const n=yield Vhe.client.meProjectsMst({data:r}),i=pV(n.meProjects);n.meProjects.edges.forEach(({node:o})=>{e.cache.addProjectByVariables({organizationId:o.organizationId,projectName:o.name},o.id),fV(e.cache,o)}),r.after||e.cache.meProjectsConnection.reset(),e.cache.meProjectsConnection.onLoad({edges:i.edges,hasNextPage:i.pageInfo.hasNextPage,totalCount:i.totalCount})}}const Zm=Ne`
|
1006
|
+
`)}var Sfe=0,_fe=function(){function e(){Object.defineProperty(this,"cacheId",{enumerable:!0,configurable:!0,writable:!0,value:Sfe++}),Object.defineProperty(this,"cache",{enumerable:!0,configurable:!0,writable:!0,value:er.map()}),Object.defineProperty(this,"lastCacheModificationPerId",{enumerable:!0,configurable:!0,writable:!0,value:er.map()})}return Object.defineProperty(e.prototype,"updateLastCacheModificationPerId",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this.lastCacheModificationPerId.get(t);this.lastCacheModificationPerId.set(t,r===void 0?1:r+1)}}),Object.defineProperty(e.prototype,"getLastCacheModificationPerId",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this.lastCacheModificationPerId.get(t)||0;return this.cacheId+"-"+r}}),Object.defineProperty(e.prototype,"addNodeToCache",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){if(r===void 0&&(r=!0),t.identifierAttribute){var n=t.identifier;this.cache.has(n)||this.cache.set(n,er.array([],nw));var i=this.cache.get(n);if(i.indexOf(t)!==-1)throw rt("Already registered");i.push(t),r&&this.updateLastCacheModificationPerId(n)}}}),Object.defineProperty(e.prototype,"mergeCache",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this;gL(t.identifierCache.cache).forEach(function(n){return n.forEach(function(i){r.addNodeToCache(i)})})}}),Object.defineProperty(e.prototype,"notifyDied",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(t.identifierAttribute){var r=t.identifier,n=this.cache.get(r);n&&(n.remove(t),n.length||this.cache.delete(r),this.updateLastCacheModificationPerId(t.identifier))}}}),Object.defineProperty(e.prototype,"splitCache",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this,n=new e,i=t.path+"/";return Mie(this.cache).forEach(function(o){for(var a=YE(o,2),l=a[0],c=a[1],d=!1,f=c.length-1;f>=0;f--){var p=c[f];(p===t||p.path.indexOf(i)===0)&&(n.addNodeToCache(p,!1),c.splice(f,1),c.length||r.cache.delete(l),d=!0)}d&&r.updateLastCacheModificationPerId(l)}),n}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=this.cache.get(r);return n?n.some(function(i){return t.isAssignableFrom(i.type)}):!1}}),Object.defineProperty(e.prototype,"resolve",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=this.cache.get(r);if(!n)return null;var i=n.filter(function(o){return t.isAssignableFrom(o.type)});switch(i.length){case 0:return null;case 1:return i[0];default:throw rt("Cannot resolve a reference to type '"+t.name+"' with id: '"+r+"' unambigously, there are multiple candidates: "+i.map(function(o){return o.path}).join(", "))}}}),e}();function JE(e,t,r,n,i){var o=LB(i);if(o){if(o.parent)throw rt("Cannot add an object to a state tree if it is already part of the same or another state tree. Tried to assign an object to '"+(t?t.path:"")+"/"+r+"', but it lives already at '"+o.path+"'");return t&&o.setParent(t,r),o}return new Ui(e,t,r,n,i)}function su(e,t,r,n,i){return new nm(e,t,r,n,i)}function xfe(e){return e instanceof nm||e instanceof Ui}var Xn;(function(e){e[e.INITIALIZING=0]="INITIALIZING",e[e.CREATED=1]="CREATED",e[e.FINALIZED=2]="FINALIZED",e[e.DETACHING=3]="DETACHING",e[e.DEAD=4]="DEAD"})(Xn||(Xn={}));function Xr(e){return!!(e&&e.$treenode)}function _r(e){if(!Xr(e))throw rt("Value "+e+" is no MST Node");return e.$treenode}function LB(e){return e&&e.$treenode||null}function Pfe(){return _r(this).snapshot}function Cfe(e,t,r){r===void 0&&(r=!0);var n=e;try{for(var i=0;i<t.length;i++){var o=t[i];if(o===".."){if(n=n.parent,n)continue}else{if(o===".")continue;if(n){if(n instanceof nm){var a=n.value;Xr(a)&&(n=_r(a))}if(n instanceof Ui){var l=n.getChildType(o);if(l&&(n=n.getChildNode(o),n))continue}}}throw rt("Could not resolve '"+o+"' in path '"+(kA(t.slice(0,i))||"/")+"' while resolving '"+kA(t)+"'")}}catch(c){if(!r)return;throw c}return n}function BB(e){if(!e)return bf;var t=Object.keys(e);if(!t.length)return bf;var r=new Array(t.length);return t.forEach(function(n,i){r[i]=e[n]}),r}var Efe=Object.toString(),bf=Object.freeze([]),wf=Object.freeze({}),nw=lie().useProxies?{deep:!1}:{deep:!1,proxy:!1};Object.freeze(nw);function rt(e){return e===void 0&&(e="Illegal state"),new Error("[mobx-state-tree] "+e)}function Tfe(e){return e}var Ofe=Number.isInteger;function Rfe(e){return Number(e)===e&&e%1!==0}function Ife(e){return Number.isFinite(e)}function VB(e){return Array.isArray(e)||Uo(e)}function zB(e){return e?VB(e)?e:[e]:bf}function kfe(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];for(var n=0;n<t.length;n++){var i=t[n];for(var o in i)e[o]=i[o]}return e}function zd(e){var t;if(e===null||typeof e!="object")return!1;var r=Object.getPrototypeOf(e);return r==null?!0:((t=r.constructor)===null||t===void 0?void 0:t.toString())===Efe}function qB(e){return e!==null&&typeof e=="object"&&!(e instanceof Date)&&!(e instanceof RegExp)}function om(e,t){return t===void 0&&(t=!0),e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"||t&&e instanceof Date}function UB(e){return typeof e!="function"}function jfe(e,t,r){Gi(e)?bL(e,t,r):Object.defineProperty(e,t,r)}function Yu(e,t,r){jfe(e,t,{enumerable:!1,writable:!1,configurable:!0,value:r})}var $fe=function(){function e(){Object.defineProperty(this,"handlers",{enumerable:!0,configurable:!0,writable:!0,value:[]})}return Object.defineProperty(e.prototype,"hasSubscribers",{get:function(){return this.handlers.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=this;return r===void 0&&(r=!1),r?this.handlers.unshift(t):this.handlers.push(t),function(){n.unregister(t)}}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.handlers.indexOf(t)>=0}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this.handlers.indexOf(t);r>=0&&this.handlers.splice(r,1)}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.handlers.length=0}}),Object.defineProperty(e.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=this.handlers.slice();n.forEach(function(i){return i.apply(void 0,Pc(t))})}}),e}(),HB=function(){function e(){Object.defineProperty(this,"eventHandlers",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}return Object.defineProperty(e.prototype,"hasSubscribers",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this.eventHandlers&&this.eventHandlers[t];return!!r&&r.hasSubscribers}}),Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,n){n===void 0&&(n=!1),this.eventHandlers||(this.eventHandlers={});var i=this.eventHandlers[t];return i||(i=this.eventHandlers[t]=new $fe),i.register(r,n)}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=this.eventHandlers&&this.eventHandlers[t];return!!n&&n.has(r)}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=this.eventHandlers&&this.eventHandlers[t];n&&n.unregister(r)}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.eventHandlers&&delete this.eventHandlers[t]}}),Object.defineProperty(e.prototype,"clearAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.eventHandlers=void 0}}),Object.defineProperty(e.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(t){for(var r,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var o=this.eventHandlers&&this.eventHandlers[t];o&&(r=o).emit.apply(r,Pc(n))}}),e}();function WB(e){for(var t=new Array(e.length),r=0;r<e.length;r++)t[r]=e[r];return t}function __(e,t){return e.indexOf(t)===0}function Afe(e){console.warn(new Error("[mobx-state-tree] "+e))}function Dfe(){return typeof process<"u"&&RA&&RA.ENABLE_TYPE_CHECK==="true"}function x_(e){typeof queueMicrotask=="function"?queueMicrotask(e):typeof setImmediate=="function"?setImmediate(e):setTimeout(e,1)}function io(e){return Mfe(e.name,e)}function Mfe(e,t){var r=function(){var i=MB(),o=DB();if(!o)throw rt("a mst flow must always have a parent context");var a=NB(o);if(!a)throw rt("a mst flow must always have a parent action context");var l={name:e,id:i,tree:o.tree,context:o.context,parentId:o.id,allParentIds:Pc(o.allParentIds,[o.id]),rootId:o.rootId,parentEvent:o,parentActionEvent:a},c=arguments;function d(f,p,m){return f.$mst_middleware=r.$mst_middleware,OP(Fi(Fi({},l),{type:p,args:[m]}),f)}return new Promise(function(f,p){var m,g=function(){m=t.apply(null,arguments),b(void 0)};g.$mst_middleware=r.$mst_middleware,OP(Fi(Fi({},l),{type:"flow_spawn",args:WB(c)}),g);function b(_){var S;try{var C=d(function(k){S=m.next(k)},"flow_resume",_);C instanceof Error&&(S=m.throw(C))}catch(k){x_(function(){d(function(E){p(k)},"flow_throw",k)});return}w(S)}function y(_){var S;try{d(function(C){S=m.throw(C)},"flow_resume_error",_)}catch(C){x_(function(){d(function(k){p(C)},"flow_throw",C)});return}w(S)}function w(_){if(_.done){x_(function(){d(function(S){f(S)},"flow_return",_.value)});return}if(!_.value||typeof _.value.then!="function")throw rt("Only promises can be yielded to `async`, got: "+_);return _.value.then(b,y)}})};return r._isFlowAction=!0,r}function Nfe(e){if(!("oldValue"in e))throw rt("Patches without `oldValue` field cannot be inversed");return[Ffe(e),Lfe(e)]}function Ffe(e){switch(e.op){case"add":return{op:"add",path:e.path,value:e.value};case"remove":return{op:"remove",path:e.path};case"replace":return{op:"replace",path:e.path,value:e.value}}}function Lfe(e){switch(e.op){case"add":return{op:"remove",path:e.path};case"remove":return{op:"add",path:e.path,value:e.oldValue};case"replace":return{op:"replace",path:e.path,value:e.oldValue}}}function Bfe(e){return typeof e=="number"}function Xu(e){return Bfe(e)===!0?""+e:e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function Vfe(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function kA(e){if(e.length===0)return"";var t=function(r){return r.map(Xu).join("/")};return e[0]==="."||e[0]===".."?t(e):"/"+t(e)}function zfe(e){var t=e.split("/").map(Vfe),r=e===""||e==="."||e===".."||__(e,"/")||__(e,"./")||__(e,"../");if(!r)throw rt("a json path must be either rooted, empty or relative, but got '"+e+"'");return t[0]===""&&t.shift(),t}var P_=Symbol("$preProcessorFailed"),qfe=function(e){Wr(t,e);function t(r,n,i){var o=e.call(this,i||r.name)||this;return Object.defineProperty(o,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(o,"_processors",{enumerable:!0,configurable:!0,writable:!0,value:n}),o}return Object.defineProperty(t.prototype,"flags",{get:function(){return this._subtype.flags|rr.SnapshotProcessor},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"snapshotProcessor("+this._subtype.describe()+")"}}),Object.defineProperty(t.prototype,"preProcessSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._processors.preProcessor?this._processors.preProcessor.call(null,r):r}}),Object.defineProperty(t.prototype,"preProcessSnapshotSafe",{enumerable:!1,configurable:!0,writable:!0,value:function(r){try{return this.preProcessSnapshot(r)}catch{return P_}}}),Object.defineProperty(t.prototype,"postProcessSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return this._processors.postProcessor?this._processors.postProcessor.call(null,r,n.storedValue):r}}),Object.defineProperty(t.prototype,"_fixNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;Ufe(r.type,this,"create"),r instanceof Ui&&(r.hasSnapshotPostProcessor=!!this._processors.postProcessor);var i=r.getSnapshot;r.getSnapshot=function(){return n.postProcessSnapshot(i.call(r),r)},che(this._subtype)||(r.getReconciliationType=function(){return n})}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){var a=Xr(o)?o:this.preProcessSnapshot(o),l=this._subtype.instantiate(r,n,i,a);return this._fixNode(l),l}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){var a=this._subtype.reconcile(r,Xr(n)?n:this.preProcessSnapshot(n),i,o);return a!==r&&this._fixNode(a),a}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){n===void 0&&(n=!0);var i=this._subtype.getSnapshot(r);return n?this.postProcessSnapshot(i,r):i}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this.preProcessSnapshotSafe(r);return i===P_?Qi(n,r,"Failed to preprocess value"):this._subtype.validate(i,n)}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),Object.defineProperty(t.prototype,"is",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=Xl(r)?this._subtype:Xr(r)?kB(r,!1):this.preProcessSnapshotSafe(r);return n===P_?!1:this._subtype.validate(n,[{path:"",type:this._subtype}]).length===0}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._subtype.isAssignableFrom(r)}}),Object.defineProperty(t.prototype,"isMatchingSnapshotId",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(!(this._subtype instanceof yf))return!1;var i=this.preProcessSnapshot(n);return this._subtype.isMatchingSnapshotId(r,i)}}),t}(Vs);function Ufe(e,t){for(var r,n,i=[],o=2;o<arguments.length;o++)i[o-2]=arguments[o];try{for(var a=_p(i),l=a.next();!l.done;l=a.next()){var c=l.value;e[c]=t[c].bind(t)}}catch(d){r={error:d}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}}function Hfe(e,t,r){return new qfe(e,t,r)}var jA="Map.put can only be used to store complex values that have an identifier type attribute";function KB(e,t){var r,n,i=e.getSubTypes();if(i===AB)return!1;if(i){var o=zB(i);try{for(var a=_p(o),l=a.next();!l.done;l=a.next()){var c=l.value;if(!KB(c,t))return!1}}catch(d){r={error:d}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}}return e instanceof am&&t.push(e),!0}var Rl;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.YES=1]="YES",e[e.NO=2]="NO"})(Rl||(Rl={}));var Wfe=function(e){Wr(t,e);function t(r,n){return e.call(this,r,er.ref.enhancer,n)||this}return Object.defineProperty(t.prototype,"get",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return e.prototype.get.call(this,""+r)}}),Object.defineProperty(t.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return e.prototype.has.call(this,""+r)}}),Object.defineProperty(t.prototype,"delete",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return e.prototype.delete.call(this,""+r)}}),Object.defineProperty(t.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return e.prototype.set.call(this,""+r,n)}}),Object.defineProperty(t.prototype,"put",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!r)throw rt("Map.put cannot be used to set empty values");if(Xr(r)){var n=_r(r);if(n.identifier===null)throw rt(jA);return this.set(n.identifier,r),r}else if(qB(r)){var i=_r(this),o=i.type;if(o.identifierMode!==Rl.YES)throw rt(jA);var a=o.mapIdentifierAttribute,l=r[a];if(!ZE(l)){var c=this.put(o.getChildType().create(r,i.environment));return this.put(kB(c))}var d=Xm(l);return this.set(d,r),this.get(d)}else throw rt("Map.put can only be used to store complex values")}}),t}(M0),Bb=function(e){Wr(t,e);function t(r,n,i){i===void 0&&(i=[]);var o=e.call(this,r)||this;return Object.defineProperty(o,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"identifierMode",{enumerable:!0,configurable:!0,writable:!0,value:Rl.UNKNOWN}),Object.defineProperty(o,"mapIdentifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"flags",{enumerable:!0,configurable:!0,writable:!0,value:rr.Map}),Object.defineProperty(o,"hookInitializers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),o._determineIdentifierMode(),o.hookInitializers=i,o}return Object.defineProperty(t.prototype,"hooks",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.hookInitializers.length>0?this.hookInitializers.concat(r):[r];return new t(this.name,this._subType,n)}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){return this._determineIdentifierMode(),JE(this,r,n,i,o)}}),Object.defineProperty(t.prototype,"_determineIdentifierMode",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.identifierMode===Rl.UNKNOWN){var r=[];if(KB(this._subType,r)){var n=r.reduce(function(i,o){if(!o.identifierAttribute)return i;if(i&&i!==o.identifierAttribute)throw rt("The objects in a map should all have the same identifier attribute, expected '"+i+"', but child of type '"+o.name+"' declared attribute '"+o.identifierAttribute+"' as identifier");return o.identifierAttribute},void 0);n?(this.identifierMode=Rl.YES,this.mapIdentifierAttribute=n):this.identifierMode=Rl.NO}}}}),Object.defineProperty(t.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){n===void 0&&(n={});var i=r.type._subType,o={};return Object.keys(n).forEach(function(a){o[a]=i.instantiate(r,a,void 0,n[a])}),o}}),Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return new Wfe(r,this.name)}}),Object.defineProperty(t.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){mL(n,r.unbox);var i=r.type;i.hookInitializers.forEach(function(o){var a=o(n);Object.keys(a).forEach(function(l){var c=a[l],d=im(n,l,c);Yu(n,l,d)})}),uE(n,this.willChange),A0(n,this.didChange)}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return gL(r.storedValue)}}),Object.defineProperty(t.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=r.storedValue.get(""+n);if(!i)throw rt("Not a child "+n);return i}}),Object.defineProperty(t.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=_r(r.object),i=r.name;n.assertWritable({subpath:i});var o=n.type,a=o._subType;switch(r.type){case"update":{var l=r.newValue,c=r.object.get(i);if(l===c)return null;$s(a,l),r.newValue=a.reconcile(n.getChildNode(i),r.newValue,n,i),o.processIdentifier(i,r.newValue)}break;case"add":$s(a,r.newValue),r.newValue=a.instantiate(n,i,void 0,r.newValue),o.processIdentifier(i,r.newValue);break}return r}}),Object.defineProperty(t.prototype,"processIdentifier",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this.identifierMode===Rl.YES&&n instanceof Ui){var i=n.identifier;if(i!==r)throw rt("A map of objects containing an identifier should always store the object under their own identifier. Trying to store key '"+i+"', but expected: '"+r+"'")}}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n={};return r.getChildren().forEach(function(i){n[i.subpath]=i.snapshot}),n}}),Object.defineProperty(t.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n={};return Object.keys(r).forEach(function(i){n[i]=r[i].getSnapshot()}),n}}),Object.defineProperty(t.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=_r(r.object);switch(r.type){case"update":return void n.emitPatch({op:"replace",path:Xu(r.name),value:r.newValue.snapshot,oldValue:r.oldValue?r.oldValue.snapshot:void 0},n);case"add":return void n.emitPatch({op:"add",path:Xu(r.name),value:r.newValue.snapshot,oldValue:void 0},n);case"delete":var i=r.oldValue.snapshot;return r.oldValue.die(),void n.emitPatch({op:"remove",path:Xu(r.name),oldValue:i},n)}}}),Object.defineProperty(t.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){var o=r.storedValue;switch(i.op){case"add":case"replace":o.set(n,i.value);break;case"remove":o.delete(n);break}}}),Object.defineProperty(t.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){$s(this,n);var i=r.storedValue,o={};if(Array.from(i.keys()).forEach(function(l){o[l]=!1}),n)for(var a in n)i.set(a,n[a]),o[""+a]=!0;Object.keys(o).forEach(function(l){o[l]===!1&&i.delete(l)})}}),Object.defineProperty(t.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subType}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this;return zd(r)?rw(Object.keys(r).map(function(o){return i._subType.validate(r[o],XE(n,o,i._subType))})):Qi(n,r,"Value is not a plain object")}}),Object.defineProperty(t.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return wf}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue.delete(n)}}),t}(yf);Bb.prototype.applySnapshot=Sr(Bb.prototype.applySnapshot);function Kfe(e){return new Bb("Map<string, "+e.name+">",e)}var Vb=function(e){Wr(t,e);function t(r,n,i){i===void 0&&(i=[]);var o=e.call(this,r)||this;return Object.defineProperty(o,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"flags",{enumerable:!0,configurable:!0,writable:!0,value:rr.Array}),Object.defineProperty(o,"hookInitializers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),o.hookInitializers=i,o}return Object.defineProperty(t.prototype,"hooks",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.hookInitializers.length>0?this.hookInitializers.concat(r):[r];return new t(this.name,this._subType,n)}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){return JE(this,r,n,i,o)}}),Object.defineProperty(t.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){n===void 0&&(n=[]);var i=r.type._subType,o={};return n.forEach(function(a,l){var c=""+l;o[c]=i.instantiate(r,c,void 0,a)}),o}}),Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=Fi(Fi({},nw),{name:this.name});return er.array(BB(r),n)}}),Object.defineProperty(t.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){ma(n).dehancer=r.unbox;var i=r.type;i.hookInitializers.forEach(function(o){var a=o(n);Object.keys(a).forEach(function(l){var c=a[l],d=im(n,l,c);Yu(n,l,d)})}),uE(n,this.willChange),A0(n,this.didChange)}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue.slice()}}),Object.defineProperty(t.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=Number(n);if(i<r.storedValue.length)return r.storedValue[i];throw rt("Not a child: "+n)}}),Object.defineProperty(t.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=_r(r.object);n.assertWritable({subpath:""+r.index});var i=n.type._subType,o=n.getChildren();switch(r.type){case"update":{if(r.newValue===r.object[r.index])return null;var a=$A(n,i,[o[r.index]],[r.newValue],[r.index]);if(!a)return null;r.newValue=a[0]}break;case"splice":{var l=r.index,c=r.removedCount,d=r.added,f=$A(n,i,o.slice(l,l+c),d,d.map(function(m,g){return l+g}));if(!f)return null;r.added=f;for(var p=l+c;p<o.length;p++)o[p].setParent(n,""+(p+d.length-c))}break}return r}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.getChildren().map(function(n){return n.snapshot})}}),Object.defineProperty(t.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=[];return Object.keys(r).forEach(function(i){n.push(r[i].getSnapshot())}),n}}),Object.defineProperty(t.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=_r(r.object);switch(r.type){case"update":return void n.emitPatch({op:"replace",path:""+r.index,value:r.newValue.snapshot,oldValue:r.oldValue?r.oldValue.snapshot:void 0},n);case"splice":for(var i=r.removedCount-1;i>=0;i--)n.emitPatch({op:"remove",path:""+(r.index+i),oldValue:r.removed[i].snapshot},n);for(var i=0;i<r.addedCount;i++)n.emitPatch({op:"add",path:""+(r.index+i),value:n.getChildNode(""+(r.index+i)).snapshot,oldValue:void 0},n);return}}}),Object.defineProperty(t.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){var o=r.storedValue,a=n==="-"?o.length:Number(n);switch(i.op){case"replace":o[a]=i.value;break;case"add":o.splice(a,0,i.value);break;case"remove":o.splice(a,1);break}}}),Object.defineProperty(t.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){$s(this,n);var i=r.storedValue;i.replace(n)}}),Object.defineProperty(t.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subType}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this;return VB(r)?rw(r.map(function(o,a){return i._subType.validate(o,XE(n,""+a,i._subType))})):Qi(n,r,"Value is not an array")}}),Object.defineProperty(t.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return bf}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue.splice(Number(n),1)}}),t}(yf);Vb.prototype.applySnapshot=Sr(Vb.prototype.applySnapshot);function Gfe(e){return new Vb(e.name+"[]",e)}function $A(e,t,r,n,i){for(var o=!0,a=0;;a++){var l=a<=n.length-1,c=r[a],d=l?n[a]:void 0,f=""+i[a];if(xfe(d)&&(d=d.storedValue),!c&&!l)break;if(!l)o=!1,r.splice(a,1),c instanceof Ui&&c.createObservableInstanceIfNeeded(),c.die(),a--;else if(c)if(AA(c,d))r[a]=C_(t,e,f,d,c);else{for(var m=void 0,g=a;g<r.length;g++)if(AA(r[g],d)){m=r.splice(g,1)[0];break}o=!1;var p=C_(t,e,f,d,m);r.splice(a,0,p)}else{if(Xr(d)&&_r(d).parent===e)throw rt("Cannot add an object to a state tree if it is already part of the same or another state tree. Tried to assign an object to '"+e.path+"/"+f+"', but it lives already at '"+_r(d).path+"'");o=!1;var p=C_(t,e,f,d);r.splice(a,0,p)}}return o?null:r}function C_(e,t,r,n,i){$s(e,n);function o(){if(Xr(n)){var l=_r(n);if(l.assertAlive(wf),l.parent!==null&&l.parent===t)return l.setParent(t,r),l}return i?e.reconcile(i,n,t,r):e.instantiate(t,r,void 0,n)}var a=o();return i&&i!==a&&(i instanceof Ui&&i.createObservableInstanceIfNeeded(),i.die()),a}function AA(e,t){if(!e.isAlive)return!1;if(Xr(t)){var r=_r(t);return r.isAlive&&r===e}if(e.snapshot===t)return!0;if(!(e instanceof Ui))return!1;var n=e.getReconciliationType();return e.identifier!==null&&e.identifierAttribute&&zd(t)&&n.is(t)&&n.isMatchingSnapshotId(e,t)}var DA="preProcessSnapshot",MA="postProcessSnapshot";function Qfe(){return _r(this).toString()}var NA={name:"AnonymousModel",properties:{},initializers:bf};function Yfe(e){var t=Object.keys(e),r=new Set;return t.forEach(function(n){if(r.has(n))throw rt(n+" is declared twice in the model. Model should not contain the same keys");r.add(n)}),t.reduce(function(n,i){if(i in jn)throw rt("Hook '"+i+"' was defined as property. Hooks should be defined as part of the actions");var o=Object.getOwnPropertyDescriptor(e,i);if("get"in o)throw rt("Getters are not supported as properties. Please use views instead");var a=o.value;if(a==null)throw rt("The default value of an attribute cannot be null or undefined as the type cannot be inferred. Did you mean `types.maybe(someType)`?");if(om(a))n[i]=Ju(nhe(a),a);else if(a instanceof Bb)n[i]=Ju(a,{});else if(a instanceof Vb)n[i]=Ju(a,[]);else if(!Xl(a))throw rt("Invalid type definition for property '"+i+"', cannot infer a type from a value like '"+a+"' ("+typeof a+")");return n},Fi({},e))}var am=function(e){Wr(t,e);function t(r){var n=e.call(this,r.name||NA.name)||this;return Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:rr.Object}),Object.defineProperty(n,"initializers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"properties",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"preProcessor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"postProcessor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"propertyNames",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"named",{enumerable:!0,configurable:!0,writable:!0,value:function(i){return n.cloneAndEnhance({name:i})}}),Object.defineProperty(n,"props",{enumerable:!0,configurable:!0,writable:!0,value:function(i){return n.cloneAndEnhance({properties:i})}}),Object.defineProperty(n,"preProcessSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:function(i){var o=n.preProcessor;return o?n.cloneAndEnhance({preProcessor:function(a){return o(i(a))}}):n.cloneAndEnhance({preProcessor:i})}}),Object.defineProperty(n,"postProcessSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:function(i){var o=n.postProcessor;return o?n.cloneAndEnhance({postProcessor:function(a){return i(o(a))}}):n.cloneAndEnhance({postProcessor:i})}}),Object.assign(n,NA,r),n.properties=Yfe(n.properties),n.properties,n.propertyNames=Object.keys(n.properties),n.identifierAttribute=n._getIdentifierAttribute(),n}return Object.defineProperty(t.prototype,"_getIdentifierAttribute",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=void 0;return this.forAllProps(function(n,i){if(i.flags&rr.Identifier){if(r)throw rt("Cannot define property '"+n+"' as object identifier, property '"+r+"' is already defined as identifier property");r=n}}),r}}),Object.defineProperty(t.prototype,"cloneAndEnhance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return new t({name:r.name||this.name,properties:Object.assign({},this.properties,r.properties),initializers:this.initializers.concat(r.initializers||[]),preProcessor:r.preProcessor||this.preProcessor,postProcessor:r.postProcessor||this.postProcessor})}}),Object.defineProperty(t.prototype,"actions",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this,i=function(o){return n.instantiateActions(o,r(o)),o};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(t.prototype,"instantiateActions",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(!zd(n))throw rt("actions initializer should return a plain object containing actions");Object.keys(n).forEach(function(i){if(i===DA)throw rt("Cannot define action '"+DA+"', it should be defined using 'type.preProcessSnapshot(fn)' instead");if(i===MA)throw rt("Cannot define action '"+MA+"', it should be defined using 'type.postProcessSnapshot(fn)' instead");var o=n[i],a=r[i];if(i in jn&&a){var l=o;o=function(){a.apply(null,arguments),l.apply(null,arguments)}}var c=o.$mst_middleware,d=o.bind(n);d._isFlowAction=o._isFlowAction||!1,d.$mst_middleware=c;var f=im(r,i,d);n[i]=f,Yu(r,i,f)})}}),Object.defineProperty(t.prototype,"volatile",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;if(typeof r!="function")throw rt("You passed an "+typeof r+" to volatile state as an argument, when function is expected");var i=function(o){return n.instantiateVolatileState(o,r(o)),o};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(t.prototype,"instantiateVolatileState",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(!zd(n))throw rt("volatile state initializer should return a plain object containing state");yL(r,n)}}),Object.defineProperty(t.prototype,"extend",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this,i=function(o){var a=r(o),l=a.actions,c=a.views,d=a.state,f=ofe(a,["actions","views","state"]);for(var p in f)throw rt("The `extend` function should return an object with a subset of the fields 'actions', 'views' and 'state'. Found invalid key '"+p+"'");return d&&n.instantiateVolatileState(o,d),c&&n.instantiateViews(o,c),l&&n.instantiateActions(o,l),o};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(t.prototype,"views",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this,i=function(o){return n.instantiateViews(o,r(o)),o};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(t.prototype,"instantiateViews",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(!zd(n))throw rt("views initializer should return a plain object containing views");Object.getOwnPropertyNames(n).forEach(function(i){var o,a=Object.getOwnPropertyDescriptor(n,i);if("get"in a)bL(r,i,a),D0(r,(o={},o[i]=dn,o));else if(typeof a.value=="function")Yu(r,i,a.value);else throw rt("A view member should either be a function or getter based property")})}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){var a=Xr(o)?o:this.applySnapshotPreProcessor(o);return JE(this,r,n,i,a)}}),Object.defineProperty(t.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){n===void 0&&(n={});var i=r.type,o={};return i.forAllProps(function(a,l){o[a]=l.instantiate(r,a,void 0,n[a])}),o}}),Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=Fi(Fi({},nw),{name:this.name});return er.object(r,wf,n)}}),Object.defineProperty(t.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){Yu(n,"toString",Qfe),this.forAllProps(function(i){mL(n,i,r.unbox)}),this.initializers.reduce(function(i,o){return o(i)},n),uE(n,this.willChange),A0(n,this.didChange)}}),Object.defineProperty(t.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=r,i=_r(n.object),o=n.name;i.assertWritable({subpath:o});var a=i.type.properties[o];return a&&($s(a,n.newValue),n.newValue=a.reconcile(i.getChildNode(o),n.newValue,i,o)),n}}),Object.defineProperty(t.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=r,i=_r(n.object),o=i.type.properties[n.name];if(o){var a=n.oldValue?n.oldValue.snapshot:void 0;i.emitPatch({op:"replace",path:Xu(n.name),value:n.newValue.snapshot,oldValue:a},i)}}}),Object.defineProperty(t.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this,i=[];return this.forAllProps(function(o){i.push(n.getChildNode(r,o))}),i}}),Object.defineProperty(t.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i;if(!(n in this.properties))throw rt("Not a value property: "+n);var o=ma(r.storedValue,n),a=(i=o.raw)===null||i===void 0?void 0:i.call(o);if(!a)throw rt("Node not available for property "+n);return a}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this;n===void 0&&(n=!0);var o={};return this.forAllProps(function(a,l){try{var c=sc(r.storedValue,a);c.reportObserved()}catch{throw rt(a+" property is declared twice")}o[a]=i.getChildNode(r,a).snapshot}),n?this.applySnapshotPostProcessor(o):o}}),Object.defineProperty(t.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n={};return Object.keys(r).forEach(function(i){n[i]=r[i].getSnapshot()}),this.applySnapshotPostProcessor(n)}}),Object.defineProperty(t.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){if(!(i.op==="replace"||i.op==="add"))throw rt("object does not support operation "+i.op);r.storedValue[n]=i.value}}),Object.defineProperty(t.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){$s(this,n);var i=this.applySnapshotPreProcessor(n);this.forAllProps(function(o){r.storedValue[o]=i[o]})}}),Object.defineProperty(t.prototype,"applySnapshotPreProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.preProcessor;return n?n.call(null,r):r}}),Object.defineProperty(t.prototype,"applySnapshotPostProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.postProcessor;return n?n.call(null,r):r}}),Object.defineProperty(t.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.properties[r]}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this,o=this.applySnapshotPreProcessor(r);return zd(o)?rw(this.propertyNames.map(function(a){return i.properties[a].validate(o[a],XE(n,a,i.properties[a]))})):Qi(n,o,"Value is not a plain object")}}),Object.defineProperty(t.prototype,"forAllProps",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;this.propertyNames.forEach(function(i){return r(i,n.properties[i])})}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;return"{ "+this.propertyNames.map(function(n){return n+": "+r.properties[n].describe()}).join("; ")+" }"}}),Object.defineProperty(t.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return wf}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue[n]=void 0}}),t}(yf);am.prototype.applySnapshot=Sr(am.prototype.applySnapshot);function Xfe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=typeof e[0]=="string"?e.shift():"AnonymousModel",n=e.shift()||{};return new am({name:r,properties:n})}function Jfe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=typeof e[0]=="string",n=r?e[0]:"AnonymousModel";return r&&e.shift(),e.reduce(function(i,o){return i.cloneAndEnhance({name:i.name+"_"+o.name,properties:o.properties,initializers:o.initializers,preProcessor:function(a){return o.applySnapshotPreProcessor(i.applySnapshotPreProcessor(a))},postProcessor:function(a){return o.applySnapshotPostProcessor(i.applySnapshotPostProcessor(a))}})}).named(n)}function Zfe(e){return Xl(e)&&(e.flags&rr.Object)>0}var Gs=function(e){Wr(t,e);function t(r,n,i,o){o===void 0&&(o=Tfe);var a=e.call(this,r)||this;return Object.defineProperty(a,"flags",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"checker",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(a,"initializer",{enumerable:!0,configurable:!0,writable:!0,value:o}),a.flags=n,a}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){return su(this,r,n,i,o)}}),Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.initializer(r)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(om(r)&&this.checker(r))return Hi();var i=this.name==="Date"?"Date or a unix milliseconds timestamp":this.name;return Qi(n,r,"Value is not a "+i)}}),t}(Cc),GB=new Gs("string",rr.String,function(e){return typeof e=="string"}),QB=new Gs("number",rr.Number,function(e){return typeof e=="number"}),ehe=new Gs("integer",rr.Integer,function(e){return Ofe(e)}),the=new Gs("float",rr.Float,function(e){return Rfe(e)}),rhe=new Gs("finite",rr.Finite,function(e){return Ife(e)}),YB=new Gs("boolean",rr.Boolean,function(e){return typeof e=="boolean"}),XB=new Gs("null",rr.Null,function(e){return e===null}),JB=new Gs("undefined",rr.Undefined,function(e){return e===void 0}),ZB=new Gs("Date",rr.Date,function(e){return typeof e=="number"||e instanceof Date},function(e){return e instanceof Date?e:new Date(e)});ZB.getSnapshot=function(e){return e.storedValue.getTime()};var eV=ZB;function nhe(e){switch(typeof e){case"string":return GB;case"number":return QB;case"boolean":return YB;case"object":if(e instanceof Date)return eV}throw rt("Cannot determine primitive type from value "+e)}function ihe(e){return Xl(e)&&(e.flags&(rr.String|rr.Number|rr.Integer|rr.Boolean|rr.Date))>0}var ohe=function(e){Wr(t,e);function t(r){var n=e.call(this,JSON.stringify(r))||this;return Object.defineProperty(n,"value",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:rr.Literal}),n.value=r,n}return Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){return su(this,r,n,i,o)}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return JSON.stringify(this.value)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return om(r)&&r===this.value?Hi():Qi(n,r,"Value is not a literal "+JSON.stringify(this.value))}}),t}(Cc);function tV(e){return new ohe(e)}var ahe=function(e){Wr(t,e);function t(r,n,i,o){var a=e.call(this,r)||this;return Object.defineProperty(a,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"_predicate",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(a,"_message",{enumerable:!0,configurable:!0,writable:!0,value:o}),a}return Object.defineProperty(t.prototype,"flags",{get:function(){return this._subtype.flags|rr.Refinement},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){return this._subtype.instantiate(r,n,i,o)}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._subtype.isAssignableFrom(r)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this._subtype.validate(r,n);if(i.length>0)return i;var o=Xr(r)?_r(r).snapshot:r;return this._predicate(o)?Hi():Qi(n,r,this._message(r))}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){return this._subtype.reconcile(r,n,i,o)}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),t}(Vs);function she(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=typeof e[0]=="string"?e.shift():Xl(e[0])?e[0].name:null,n=e[0],i=e[1],o=e[2]?e[2]:function(a){return"Value does not respect the refinement predicate"};return new ahe(r,n,i,o)}function lhe(e,t){var r=typeof e=="string"?t:e,n=iw.apply(void 0,Pc(r.map(function(i){return tV(""+i)})));return typeof e=="string"&&(n.name=e),n}var uhe=function(e){Wr(t,e);function t(r,n,i){var o=e.call(this,r)||this;return Object.defineProperty(o,"_types",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"_dispatcher",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"_eager",{enumerable:!0,configurable:!0,writable:!0,value:!0}),i=Fi({eager:!0,dispatcher:void 0},i),o._dispatcher=i.dispatcher,i.eager||(o._eager=!1),o}return Object.defineProperty(t.prototype,"flags",{get:function(){var r=rr.Union;return this._types.forEach(function(n){r|=n.flags}),r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._types.some(function(n){return n.isAssignableFrom(r)})}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"("+this._types.map(function(r){return r.describe()}).join(" | ")+")"}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){var a=this.determineType(o,void 0);if(!a)throw rt("No matching type for union "+this.describe());return a.instantiate(r,n,i,o)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){var a=this.determineType(n,r.getReconciliationType());if(!a)throw rt("No matching type for union "+this.describe());return a.reconcile(r,n,i,o)}}),Object.defineProperty(t.prototype,"determineType",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return this._dispatcher?this._dispatcher(r):n?n.is(r)?n:this._types.filter(function(i){return i!==n}).find(function(i){return i.is(r)}):this._types.find(function(i){return i.is(r)})}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this._dispatcher)return this._dispatcher(r).validate(r,n);for(var i=[],o=0,a=0;a<this._types.length;a++){var l=this._types[a],c=l.validate(r,n);if(c.length===0){if(this._eager)return Hi();o++}else i.push(c)}return o===1?Hi():Qi(n,r,"No type is applicable for the union").concat(rw(i))}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._types}}),t}(Vs);function iw(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=Xl(e)?void 0:e,i=Xl(e)?Pc([e],t):t,o="("+i.map(function(a){return a.name}).join(" | ")+")";return new uhe(o,i,n)}function che(e){return(e.flags&rr.Union)>0}var dhe=function(e){Wr(t,e);function t(r,n,i){var o=e.call(this,r.name)||this;return Object.defineProperty(o,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(o,"_defaultValue",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"optionalValues",{enumerable:!0,configurable:!0,writable:!0,value:i}),o}return Object.defineProperty(t.prototype,"flags",{get:function(){return this._subtype.flags|rr.Optional},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype.describe()+"?"}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){if(this.optionalValues.indexOf(o)>=0){var a=this.getDefaultInstanceOrSnapshot();return this._subtype.instantiate(r,n,i,a)}return this._subtype.instantiate(r,n,i,o)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){return this._subtype.reconcile(r,this.optionalValues.indexOf(n)<0&&this._subtype.is(n)?n:this.getDefaultInstanceOrSnapshot(),i,o)}}),Object.defineProperty(t.prototype,"getDefaultInstanceOrSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=typeof this._defaultValue=="function"?this._defaultValue():this._defaultValue;return typeof this._defaultValue=="function"&&$s(this,r),r}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return this.optionalValues.indexOf(r)>=0?Hi():this._subtype.validate(r,n)}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._subtype.isAssignableFrom(r)}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),t}(Vs);function fhe(e,t){if(typeof t!="function"&&Xr(t))throw rt("default value cannot be an instance, pass a snapshot or a function that creates an instance/snapshot instead")}function Ju(e,t,r){return fhe(e,t),new dhe(e,t,r||hhe)}var hhe=[void 0],phe=Ju(JB,void 0),mhe=Ju(XB,null);function rV(e){return iw(e,phe)}function vhe(e){return iw(e,mhe)}var ghe=function(e){Wr(t,e);function t(r,n){var i=e.call(this,r)||this;return Object.defineProperty(i,"_definition",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),i}return Object.defineProperty(t.prototype,"flags",{get:function(){return(this._subType?this._subType.flags:0)|rr.Late},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getSubType",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!this._subType){var n=void 0;try{n=this._definition()}catch(i){if(i instanceof ReferenceError)n=void 0;else throw i}if(r&&n===void 0)throw rt("Late type seems to be used too early, the definition (still) returns undefined");n&&(this._subType=n)}return this._subType}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){return this.getSubType(!0).instantiate(r,n,i,o)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){return this.getSubType(!0).reconcile(r,n,i,o)}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this.getSubType(!1);return r?r.name:"<uknown late type>"}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this.getSubType(!1);return i?i.validate(r,n):Hi()}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.getSubType(!1);return n?n.isAssignableFrom(r):!1}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this.getSubType(!1);return r||AB}}),t}(Vs);function yhe(e,t){var r=typeof e=="string"?e:"late("+e.toString()+")",n=typeof e=="string"?t:e;return new ghe(r,n)}function bhe(e,t){return new whe(e,t)}var whe=function(e){Wr(t,e);function t(r,n){var i=e.call(this,r)||this;return Object.defineProperty(i,"options",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"flags",{enumerable:!0,configurable:!0,writable:!0,value:rr.Lazy}),Object.defineProperty(i,"loadedType",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(i,"pendingNodeList",{enumerable:!0,configurable:!0,writable:!0,value:er.array()}),Bj(function(){return i.pendingNodeList.length>0&&i.pendingNodeList.some(function(o){return o.isAlive&&i.options.shouldLoadPredicate(o.parent?o.parent.value:null)})},function(){i.options.loadType().then(Sr(function(o){i.loadedType=o,i.pendingNodeList.forEach(function(a){a.parent&&i.loadedType&&a.parent.applyPatches([{op:"replace",path:"/"+a.subpath,value:a.snapshot}])})}))}),i}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"<lazy "+this.name+">"}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){var a=this;if(this.loadedType)return this.loadedType.instantiate(r,n,i,o);var l=su(this,r,n,i,o);return this.pendingNodeList.push(l),Bj(function(){return!l.isAlive},function(){return a.pendingNodeList.splice(a.pendingNodeList.indexOf(l),1)}),l}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return this.loadedType?this.loadedType.validate(r,n):UB(r)?Hi():Qi(n,r,"Value is not serializable and cannot be lazy")}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){return this.loadedType?(r.die(),this.loadedType.instantiate(i,o,i.environment,n)):e.prototype.reconcile.call(this,r,n,i,o)}}),t}(Cc),nV=function(e){Wr(t,e);function t(r){var n=e.call(this,r?"frozen("+r.name+")":"frozen")||this;return Object.defineProperty(n,"subType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:rr.Frozen}),n}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"<any immutable value>"}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){return su(this,r,n,i,o)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return UB(r)?this.subType?this.subType.validate(r,n):Hi():Qi(n,r,"Value is not serializable and cannot be frozen")}}),t}(Cc),FA=new nV;function She(e){return arguments.length===0?FA:Xl(e)?new nV(e):Ju(FA,e)}function _he(e){switch(e){case jn.beforeDestroy:return"destroy";case jn.beforeDetach:return"detach";default:return}}var xhe=function(){function e(t,r){if(Object.defineProperty(this,"targetType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"identifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"node",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"resolvedReference",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),ZE(t))this.identifier=t;else if(Xr(t)){var n=_r(t);if(!n.identifierAttribute)throw rt("Can only store references with a defined identifier attribute.");var i=n.unnormalizedIdentifier;if(i==null)throw rt("Can only store references to tree nodes with a defined identifier.");this.identifier=i}else throw rt("Can only store references to tree nodes or identifiers, got: '"+t+"'")}return Object.defineProperty(e.prototype,"updateResolvedReference",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=Xm(this.identifier),n=t.root,i=n.identifierCache.getLastCacheModificationPerId(r);if(!this.resolvedReference||this.resolvedReference.lastCacheModification!==i){var o=this.targetType,a=n.identifierCache.resolve(o,r);if(!a)throw new iV("[mobx-state-tree] Failed to resolve reference '"+this.identifier+"' to type '"+this.targetType.name+"' (from node: "+t.path+")");this.resolvedReference={node:a,lastCacheModification:i}}}}),Object.defineProperty(e.prototype,"resolvedValue",{get:function(){return this.updateResolvedReference(this.node),this.resolvedReference.node.value},enumerable:!1,configurable:!0}),e}(),iV=function(e){Wr(t,e);function t(r){var n=e.call(this,r)||this;return Object.setPrototypeOf(n,t.prototype),n}return t}(Error),oV=function(e){Wr(t,e);function t(r,n){var i=e.call(this,"reference("+r.name+")")||this;return Object.defineProperty(i,"targetType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(i,"onInvalidated",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"flags",{enumerable:!0,configurable:!0,writable:!0,value:rr.Reference}),i}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.targetType.isAssignableFrom(r)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return ZE(r)?Hi():Qi(n,r,"Value is not a valid identifier, which is a string or a number")}}),Object.defineProperty(t.prototype,"fireInvalidated",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){var a=n.parent;if(!(!a||!a.isAlive)){var l=a.storedValue;l&&this.onInvalidated({cause:r,parent:l,invalidTarget:o?o.storedValue:void 0,invalidId:i,replaceRef:function(c){IA(n.root.storedValue,{op:"replace",value:c,path:n.path})},removeRef:function(){Zfe(a.type)?this.replaceRef(void 0):IA(n.root.storedValue,{op:"remove",path:n.path})}})}}}),Object.defineProperty(t.prototype,"addTargetNodeWatcher",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this,o=this.getValue(r);if(o){var a=_r(o),l=function(f,p){var m=_he(p);m&&i.fireInvalidated(m,r,n,a)},c=a.registerHook(jn.beforeDetach,l),d=a.registerHook(jn.beforeDestroy,l);return function(){c(),d()}}}}),Object.defineProperty(t.prototype,"watchTargetNodeForInvalidations",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){var o=this;if(this.onInvalidated){var a;r.registerHook(jn.beforeDestroy,function(){a&&a()});var l=function(c){a&&a();var d=r.parent,f=d&&d.storedValue;if(d&&d.isAlive&&f){var p=void 0;i?p=!!i.get(n,f):p=r.root.identifierCache.has(o.targetType,Xm(n)),p?a=o.addTargetNodeWatcher(r,n):c||o.fireInvalidated("invalidSnapshotReference",r,n,null)}};r.state===Xn.FINALIZED?l(!0):(r.isRoot||r.root.registerHook(jn.afterCreationFinalization,function(){r.parent&&r.parent.createObservableInstanceIfNeeded()}),r.registerHook(jn.afterAttach,function(){l(!1)}))}}}),t}(Cc),Phe=function(e){Wr(t,e);function t(r,n){return e.call(this,r,n)||this}return Object.defineProperty(t.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(r.isAlive){var n=r.storedValue;return n.resolvedValue}}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=r.storedValue;return n.identifier}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){var a=Xr(o)?lfe(o):o,l=new xhe(o,this.targetType),c=su(this,r,n,i,l);return l.node=c,this.watchTargetNodeForInvalidations(c,a,void 0),c}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){if(!r.isDetaching&&r.type===this){var a=Xr(n),l=r.storedValue;if(!a&&l.identifier===n||a&&l.resolvedValue===n)return r.setParent(i,o),r}var c=this.instantiate(i,o,void 0,n);return r.die(),c}}),t}(oV),Che=function(e){Wr(t,e);function t(r,n,i){var o=e.call(this,r,i)||this;return Object.defineProperty(o,"options",{enumerable:!0,configurable:!0,writable:!0,value:n}),o}return Object.defineProperty(t.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(r.isAlive){var n=this.options.get(r.storedValue,r.parent?r.parent.storedValue:null);return n}}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){var a=Xr(o)?this.options.set(o,r?r.storedValue:null):o,l=su(this,r,n,i,a);return this.watchTargetNodeForInvalidations(l,a,this.options),l}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){var a=Xr(n)?this.options.set(n,r?r.storedValue:null):n;if(!r.isDetaching&&r.type===this&&r.storedValue===a)return r.setParent(i,o),r;var l=this.instantiate(i,o,void 0,a);return r.die(),l}}),t}(oV);function aV(e,t){var r=t||void 0,n=t?t.onInvalidated:void 0;return r&&(r.get||r.set)?new Che(e,{get:r.get,set:r.set},n):new Phe(e,n)}function Ehe(e,t){var r=aV(e,Fi(Fi({},t),{onInvalidated:function(n){t&&t.onInvalidated&&t.onInvalidated(n),n.removeRef()}}));return t&&t.acceptsUndefined===!1?r:rV(r)}var sV=function(e){Wr(t,e);function t(r,n){var i=e.call(this,r)||this;return Object.defineProperty(i,"validType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"flags",{enumerable:!0,configurable:!0,writable:!0,value:rr.Identifier}),i}return Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){if(!r||!(r.type instanceof am))throw rt("Identifier types can only be instantiated as direct child of a model type");return su(this,r,n,i,o)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){if(r.storedValue!==n)throw rt("Tried to change identifier from '"+r.storedValue+"' to '"+n+"'. Changing identifiers is not allowed.");return r.setParent(i,o),r}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return typeof r!==this.validType?Qi(n,r,"Value is not a valid "+this.describe()+", expected a "+this.validType):Hi()}}),t}(Cc),The=function(e){Wr(t,e);function t(){var r=e.call(this,"identifier","string")||this;return Object.defineProperty(r,"flags",{enumerable:!0,configurable:!0,writable:!0,value:rr.Identifier}),r}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifier"}}),t}(sV),Ohe=function(e){Wr(t,e);function t(){return e.call(this,"identifierNumber","number")||this}return Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifierNumber"}}),t}(sV),Rhe=new The,Ihe=new Ohe;function Xm(e){return""+e}function ZE(e){return typeof e=="string"||typeof e=="number"}function khe(e){return new jhe(e)}var jhe=function(e){Wr(t,e);function t(r){var n=e.call(this,r.name)||this;return Object.defineProperty(n,"options",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:rr.Custom}),n}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this.options.isTargetType(r))return Hi();var i=this.options.getValidationMessage(r);return i?Qi(n,r,"Invalid value for type '"+this.name+"': "+i):Hi()}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.options.toSnapshot(r.storedValue)}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){var a=this.options.isTargetType(o)?o:this.options.fromSnapshot(o,r&&r.root.environment);return su(this,r,n,i,a)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){var a=!this.options.isTargetType(n);if(!r.isDetaching){var l=r.type===this&&(a?n===r.snapshot:n===r.storedValue);if(l)return r.setParent(i,o),r}var c=a?this.options.fromSnapshot(n,i.root.environment):n,d=this.instantiate(i,o,void 0,c);return r.die(),d}}),t}(Cc),be={enumeration:lhe,model:Xfe,compose:Jfe,custom:khe,reference:aV,safeReference:Ehe,union:iw,optional:Ju,literal:tV,maybe:rV,maybeNull:vhe,refinement:she,string:GB,boolean:YB,number:QB,integer:ehe,float:the,finite:rhe,Date:eV,map:Kfe,array:Gfe,frozen:She,identifier:Rhe,identifierNumber:Ihe,late:yhe,lazy:bhe,undefined:JB,null:XB,snapshotProcessor:Hfe};const Ec=(e,t)=>be.model(e,{totalCount:0,hasNextPage:!1,countLoaded:0,edges:be.array(be.model({cursor:be.string,node:be.reference(t)}))}).views(r=>({get startCursor(){var n;return((n=r.edges[0])==null?void 0:n.cursor)||null},get endCursor(){var n;return((n=r.edges[r.edges.length-1])==null?void 0:n.cursor)||null},get availableNextPage(){return r.hasNextPage||r.countLoaded===0}})).actions(r=>({reset(){r.totalCount=0,r.countLoaded=0,r.hasNextPage=!1,r.edges=[]},onLoad(n){r.countLoaded+=1,r.totalCount=n.totalCount,r.hasNextPage=n.hasNextPage,r.edges.push(...n.edges)},removeEdge(n){const i=r.edges.find(o=>o.cursor===n);i&&(r.totalCount-=1,r.edges.remove(i))},replaceNode(n,i){const o=r.edges.find(a=>a.cursor===n);o&&(o.node=i)}})),$he=Ec("OrganizationProjectsConnection",be.late(()=>sm)),eT=be.model("OrganizationModel",{id:be.identifier,projectsConnection:be.optional($he,{})}),Ahe=Ec("ProjectBranchesConnection",be.late(()=>lm)),sm=be.model("ProjectModel",{id:be.identifier,organization:be.reference(be.late(()=>eT)),name:be.string,isPublic:be.boolean,createdAt:be.late(()=>Jl),rootBranch:be.reference(be.late(()=>lm)),branchesConnection:be.optional(Ahe,{})}),lm=be.model("BranchModel",{id:be.identifier,name:be.string,createdAt:be.late(()=>Jl),touched:be.boolean,start:be.reference(be.late(()=>Zu)),head:be.reference(be.late(()=>Zu)),draft:be.reference(be.late(()=>Zu)),parentBranch:be.maybe(be.model({branchName:be.string,fromRevisionId:be.string}))}).actions(e=>({updateTouched(t){e.touched=t}})),Dhe=Ec("RevisionTablesConnection",be.late(()=>um)),Zu=be.model("RevisionModel",{id:be.identifier,createdAt:be.late(()=>Jl),comment:"",parent:be.maybe(be.reference(be.late(()=>Zu))),isThereParent:be.optional(be.boolean,!1),child:be.maybe(be.reference(be.late(()=>Zu))),isThereChild:be.optional(be.boolean,!1),childBranches:be.array(be.model({branchName:be.string,revisionStartId:be.string})),endpoints:be.array(be.reference(be.late(()=>lV))),tablesConnection:be.optional(Dhe,{})}).actions(e=>({addEndpoint(t){e.endpoints.push(t)},removeEndpoint(t){const r=e.endpoints.find(n=>n.id===t);r&&e.endpoints.remove(r)},update(t){t.comment&&(e.comment=t.comment),t.parent&&(e.parent=t.parent),t.child&&(e.child=t.child),t.childBranches&&(e.childBranches=t.childBranches),t.endpoints&&(e.endpoints=[],e.endpoints.push(...t.endpoints))}})).views(e=>({getParentsDetails(t){const r=[];if(!e.isThereParent)return{isAllLoaded:!0,loadedSequence:r};let n=Og(()=>e.parent);if(!n)return{isAllLoaded:!1,loadedSequence:r};r.push(n);for(let i=1;i<t;i++){if(!n.isThereParent)return{isAllLoaded:!0,loadedSequence:r};if(n=Og(()=>n.parent),!n)return{isAllLoaded:!1,loadedSequence:r};r.push(n)}return{isAllLoaded:!0,loadedSequence:r}},getChildrenDetails(t){const r=[];if(!e.isThereChild)return{isAllLoaded:!0,loadedSequence:r};let n=Og(()=>e.child);if(!n)return{isAllLoaded:!1,loadedSequence:r};r.push(n);for(let i=1;i<t;i++){if(!n.isThereChild)return{isAllLoaded:!0,loadedSequence:r};if(n=Og(()=>n.child),!n)return{isAllLoaded:!1,loadedSequence:r};r.push(n)}return{isAllLoaded:!0,loadedSequence:r}}})),lV=be.model("EndpointModel",{id:be.identifier,createdAt:be.late(()=>Jl),type:be.enumeration("EndpointType",["GRAPHQL","REST_API"])}),Mhe=Ec("TableRowsConnection",be.late(()=>cm)),Nhe=Ec("foreignKeysByConnection",be.late(()=>um)),um=be.model("TableModel",{createdId:be.string,id:be.string,versionId:be.identifier,count:be.integer,readonly:be.boolean,createdAt:be.late(()=>Jl),updatedAt:be.late(()=>Jl),schema:be.frozen({}),rowsConnection:be.optional(Mhe,{}),foreignKeysByConnection:be.optional(Nhe,{})}).actions(e=>({update(t){for(const[r,n]of Object.entries(t))e[r]=n}})),LA=Ec("RowForeignKeysByConnection",be.late(()=>cm)),cm=be.model("RowModel",{createdId:be.string,id:be.string,versionId:be.identifier,createdAt:be.late(()=>Jl),updatedAt:be.late(()=>Jl),readonly:be.boolean,data:be.frozen({}),rowForeignKeysByConnection:be.map(be.optional(LA,{}))}).actions(e=>({update(t){for(const[r,n]of Object.entries(t))e[r]=n},getOrCreateRowForeignKeysByConnection(t){return e.rowForeignKeysByConnection.has(t)||e.rowForeignKeysByConnection.set(t,LA.create()),e.rowForeignKeysByConnection.get(t)}})),Jl=be.custom({name:"ISODate",fromSnapshot(e){return new Date(e)},toSnapshot(e){return e.toISOString()},isTargetType(e){return e instanceof Date},getValidationMessage(e){return typeof e=="string"&&!isNaN(Date.parse(e))?"":`'${e}' is not a valid ISO date string`}});be.frozen();let nn=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,r)=>(r&=63,r<36?t+=r.toString(36):r<62?t+=(r-26).toString(36).toUpperCase():r>62?t+="-":t+="_",t),"");be.model({startCursor:be.maybeNull(be.string),endCursor:be.maybeNull(be.string),hasNextPage:!1,hasPreviousPage:!1});const E_=be.model("RowForeignKeysByModel",{id:be.identifier,countForeignKeysBy:be.optional(be.integer,0)}).actions(e=>({update(t){for(const[r,n]of Object.entries(t))e[r]=n}})),$a=e=>JSON.stringify(e),Fhe=Ec("MeProjectsConnection",be.late(()=>sm)),uV=be.model({id:be.identifier,meProjectsConnection:be.optional(Fhe,{}),organization:be.map(be.late(()=>eT)),project:be.map(be.late(()=>sm)),projectByVariables:be.map(be.reference(be.late(()=>sm))),branch:be.map(be.late(()=>lm)),branchByVariables:be.map(be.reference(be.late(()=>lm))),revision:be.map(be.late(()=>Zu)),endpoint:be.map(be.late(()=>lV)),table:be.map(be.late(()=>um)),tableByVariables:be.map(be.reference(be.late(()=>um))),row:be.map(be.late(()=>cm)),rowByVariables:be.map(be.reference(be.late(()=>cm))),rowForeignKeysBy:be.map(be.late(()=>E_)),rowForeignKeysByByVariables:be.map(be.reference(be.late(()=>E_)))}).views(e=>({getOrganization(t){return dn(()=>e.organization.get(t)).get()},getProject(t){return dn(()=>e.project.get(t)).get()},getProjectByVariables({organizationId:t,projectName:r}){return dn(()=>e.projectByVariables.get($a({organizationId:t,projectName:r}))).get()},getBranch(t){return dn(()=>e.branch.get(t)).get()},getBranchByVariables({organizationId:t,projectName:r,branchName:n}){return dn(()=>e.branchByVariables.get($a({organizationId:t,projectName:r,branchName:n}))).get()},getRevision(t){return dn(()=>e.revision.get(t)).get()},getEndpoint(t){return dn(()=>e.endpoint.get(t)).get()},getTable(t){return dn(()=>e.table.get(t)).get()},getTableByVariables({revisionId:t,tableId:r}){return dn(()=>e.tableByVariables.get($a({revisionId:t,tableId:r}))).get()},getRow(t){return dn(()=>e.row.get(t)).get()},getRowByVariables({revisionId:t,tableId:r,rowId:n}){return dn(()=>e.rowByVariables.get($a({revisionId:t,tableId:r,rowId:n}))).get()},getRowForeignKeysByVariables({revisionId:t,tableId:r,rowId:n}){return dn(()=>e.rowForeignKeysByByVariables.get($a({revisionId:t,tableId:r,rowId:n}))).get()}})).actions(e=>({addOrganization(t){const r=e.organization.get(t.id);return r||e.organization.put(t)},addProject(t){const r=e.project.get(t.id);return r||e.project.put(t)},addProjectByVariables({organizationId:t,projectName:r},n){e.projectByVariables.set($a({organizationId:t,projectName:r}),n)},addOrUpdateBranch(t){const r=e.branch.get(t.id);return r?(r.touched=t.touched,r.start=t.start,r.head=t.head,r.draft=t.draft,r):e.branch.put(t)},addBranchByVariables({organizationId:t,projectName:r,branchName:n},i){e.branchByVariables.set($a({organizationId:t,projectName:r,branchName:n}),i)},addOrUpdateRevision(t){const r=e.revision.get(t.id);return r?(r.update(t),r):e.revision.put(t)},addEndpoint(t){const r=e.endpoint.get(t.id);return r||e.endpoint.put(t)},addOrTable(t){const r=e.table.get(t.versionId);return r?(r.readonly=t.readonly,r.createdAt=t.createdAt,r.id=t.id,t.count&&(r.count=t.count),t.schema&&(r.schema=t.schema),r):e.table.put(t)},addTableByVariables({revisionId:t,tableId:r},n){e.tableByVariables.set($a({revisionId:t,tableId:r}),n)},addRow(t){const r=e.row.get(t.versionId);return r?(r.update(t),r):e.row.put(t)},addRowByVariables({revisionId:t,tableId:r,rowId:n},i){e.rowByVariables.set($a({revisionId:t,tableId:r,rowId:n}),i)},createRowForeignKeysByByVariables({revisionId:t,tableId:r,rowId:n}){const i=E_.create({id:nn(),countForeignKeysBy:0});return e.rowForeignKeysBy.put(i),e.rowForeignKeysByByVariables.set($a({revisionId:t,tableId:r,rowId:n}),i.id),i}})),cV=e=>({id:e.id,createdAt:e.createdAt,type:e.type}),Lhe=e=>{var t,r,n,i;return{id:e.id,createdAt:e.createdAt,comment:e.comment,parent:(t=e.parent)==null?void 0:t.id,isThereParent:!!((r=e.parent)!=null&&r.id),child:(n=e.child)==null?void 0:n.id,isThereChild:!!((i=e.child)!=null&&i.id),childBranches:e.childBranches.map(o=>({branchName:o.branch.name,revisionStartId:o.revision.id})),endpoints:e.endpoints.map(o=>o.id)}},Pp=(e,t)=>(t.endpoints.map(r=>e.addEndpoint(cV(r))),e.addOrUpdateRevision(Lhe(t))),Bhe=(e,t)=>({id:e.id,name:e.name,touched:e.touched,createdAt:e.createdAt,start:e.start.id,head:e.head.id,draft:e.draft.id,parentBranch:t}),Jm=(e,t)=>{Pp(e,t.start),Pp(e,t.head),Pp(e,{...t.draft,childBranches:[]});const r=t.parent,n=r?{branchName:r.branch.name,fromRevisionId:r.revision.id}:void 0,i=Bhe(t,n);return e.addOrUpdateBranch(i)},dV=e=>({id:e.id,organization:e.organizationId,name:e.name,createdAt:e.createdAt,isPublic:e.isPublic,rootBranch:e.rootBranch.id}),fV=(e,t)=>(e.addOrganization({id:t.organizationId}),Jm(e,t.rootBranch),e.addProject(dV(t))),hV=e=>({startCursor:e.endCursor||null,endCursor:e.endCursor||null,hasPreviousPage:e.hasPreviousPage,hasNextPage:e.hasNextPage}),pV=e=>({totalCount:e.totalCount,pageInfo:hV(e.pageInfo),edges:e.edges.map(({cursor:t,node:r})=>({cursor:t,node:r.id}))}),ow=e=>({totalCount:e.totalCount,pageInfo:hV(e.pageInfo),edges:e.edges.map(({cursor:t,node:r})=>({cursor:t,node:r.versionId}))}),Vhe=dt.get(es);function zhe(e){return function*(r){const n=yield Vhe.client.meProjectsMst({data:r}),i=pV(n.meProjects);n.meProjects.edges.forEach(({node:o})=>{e.cache.addProjectByVariables({organizationId:o.organizationId,projectName:o.name},o.id),fV(e.cache,o)}),r.after||e.cache.meProjectsConnection.reset(),e.cache.meProjectsConnection.onLoad({edges:i.edges,hasNextPage:i.pageInfo.hasNextPage,totalCount:i.totalCount})}}const Zm=Ne`
|
1007
1007
|
fragment EndpointMst on EndpointModel {
|
1008
1008
|
id
|
1009
1009
|
type
|
@@ -1300,7 +1300,7 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
1300
1300
|
}
|
1301
1301
|
${Nf}
|
1302
1302
|
${Ff}
|
1303
|
-
`,Tpe=async e=>(await xr.query({query:Epe,variables:e})).data;class Ope{constructor(t){this.store=t}async execute(t){const r=await Tpe({data:{...t}}),n=ow(r.rows);r.rows.edges.forEach(({node:o})=>{const a=this.store.cache.addRow(o);this.store.cache.addRowByVariables({revisionId:t.revisionId,tableId:t.tableId,rowId:a.id},a.versionId)});const i=this.store.cache.getTableByVariables({revisionId:t.revisionId,tableId:t.tableId});t.after||i==null||i.rowsConnection.reset(),i==null||i.rowsConnection.onLoad({edges:n.edges,hasNextPage:n.pageInfo.hasNextPage,totalCount:n.totalCount})}}const vV=be.model({organization:be.maybeNull(be.reference(be.late(()=>eT))),project:be.maybeNull(be.reference(be.late(()=>sm))),branch:be.maybeNull(be.reference(be.late(()=>lm))),table:be.maybeNull(be.reference(be.late(()=>um))),row:be.maybeNull(be.reference(be.late(()=>cm))),revision:be.maybeNull(be.reference(be.late(()=>Zu))),cache:uV,backend:cpe}).views(e=>({get organizationOrThrow(){if(!e.organization)throw new Error("Not found organization");return e.organization},get projectOrThrow(){if(!e.project)throw new Error("Not found project");return e.project},get branchOrThrow(){if(!e.branch)throw new Error("Not found branch");return e.branch},get revisionOrThrow(){if(!e.revision)throw new Error("Not found revision");return e.revision},get tableOrThrow(){if(!e.table)throw new Error("Not found table");return e.table},get rowOrThrow(){if(!e.row)throw new Error("Not found row");return e.row}})).actions(e=>({selectOrganization(t){e.organization=t},selectProject(t){e.project=t},selectBranch(t){e.branch=t},selectRevision(t){e.revision=t},selectTable(t){e.table=t},selectRow(t){e.row=t}})).actions(e=>{const t=e,r={queryRevisions:new Ghe(t),queryTable:new _pe(t),queryTableForeignKeysBy:new Cpe(t),queryTables:new Xhe(t),queryRow:new vpe(t),queryRowForeignKeysBy:new bpe(t),queryGetRowCountForeignKeysBy:new hpe(t),queryRows:new Ope(t)};return{queryRevisions:io(function*(n){return yield r.queryRevisions.execute(n)}),queryTable:io(function*(n){return yield r.queryTable.execute(n)}),queryTableForeignKeysBy:io(function*(n){return yield r.queryTableForeignKeysBy.execute(n)}),queryTables:io(function*(n){return yield r.queryTables.execute(n)}),queryRow:io(function*(n){return yield r.queryRow.execute(n)}),queryRowForeignKeysBy:io(function*(n){return yield r.queryRowForeignKeysBy.execute(n)}),queryGetRowCountForeignKeysBy:io(function*(n){return yield r.queryGetRowCountForeignKeysBy.execute(n)}),queryRows:io(function*(n){return yield r.queryRows.execute(n)})}});let ct=vV.create({cache:{id:"1"},backend:{cache:"1"}});const Rpe=()=>{ct=vV.create({cache:{id:"1"},backend:{cache:"1"}})},Bf=async e=>_V(()=>ct.cache.getBranchByVariables(rT(e))),gV=async e=>_V(()=>ct.cache.getRevision(wV(e).revisionId)),yV=e=>{const{organizationId:t}=e;if(!t)throw new Error("Not found organizationId in route params");return{organizationId:t}},bV=e=>{const{projectName:t}=e;if(!t)throw new Error("Not found projectName in route params");return{...yV(e),projectName:t}},rT=e=>{const{branchName:t}=e;if(!t)throw new Error("Not found branchName in route params");return{...bV(e),branchName:t}},wV=e=>{const{revisionId:t}=e;if(!t)throw new Error("Not found revisionId in route params");return{revisionId:t}},SV=(e,t)=>{const{tableId:r}=e;if(!r)throw new Error("Not found tableId in route params");return{revisionId:t,tableId:r}},nT=(e,t)=>{const{rowId:r}=e;if(!r)throw new Error("Not found rowId in route params");return{...SV(e,t),rowId:r}},Ipe=e=>new Promise(t=>{const r=Ya(e,n=>{n&&(r(),t(n))})}),_V=async e=>{const t=e();return t||Ipe(e)},Mo=12,kpe=async({params:e})=>{const t=rT(e),r=ct.cache.getBranchByVariables(t)||await ct.backend.queryBranch(t);return r.start.getChildrenDetails(Mo).isAllLoaded||await ct.queryRevisions({branch:t,revisions:{first:Mo,after:r.start.id}}),r.head.getParentsDetails(Mo).isAllLoaded||await ct.queryRevisions({branch:t,revisions:{first:Mo,before:r.head.id}}),r},zb=async()=>{const e=dt.get(qi),t=dt.get(dc);return e.user?e.user.username?!0:hf(`/${mB}`):hf(t.availableSignUp?`/${Y0}`:`/${xc}`)},jpe=async()=>dt.get(qi).user?hf("/"):!0,$pe=async()=>{const e=dt.get(qi),t=dt.get(dc);return e.user||!t.availableSignUp?hf("/"):!0},RP=(...e)=>async t=>{let r;for(const n of e)if(r=await n(t),r&&typeof r=="object"&&"status"in r&&r.status===302)return r;return r},Ape=async()=>(ct.cache.meProjectsConnection.countLoaded||await ct.backend.queryMeProjects({first:100}),!0),Dpe=async({params:e})=>{const{organizationId:t}=yV(e);return ct.cache.getOrganization(t)||ct.cache.addOrganization({id:t})},Mpe=async({params:e})=>{const t=bV(e),r=ct.cache.getProjectByVariables(t)||await ct.backend.queryProject(t);return r.branchesConnection.countLoaded||await ct.backend.queryBranches({...t,first:100}),r},Npe=async({params:e})=>{const r=(await Bf(e)).draft;return r.tablesConnection.countLoaded===0&&await ct.queryTables({revisionId:r.id,first:50}),r},Fpe=async({params:e})=>{const r=(await Bf(e)).head;return r.tablesConnection.countLoaded===0&&await ct.queryTables({revisionId:r.id,first:50}),r},Lpe=async({params:e})=>{const t=wV(e),r=rT(e),n=ct.cache.getRevision(t.revisionId)||await ct.backend.queryRevision(t);return n.getChildrenDetails(Mo).isAllLoaded||await ct.queryRevisions({branch:r,revisions:{first:Mo,after:n.id}}),n.getParentsDetails(Mo).isAllLoaded||await ct.queryRevisions({branch:r,revisions:{first:Mo,before:n.id}}),n.tablesConnection.countLoaded===0&&await ct.queryTables({revisionId:n.id,first:50}),n},iT=async e=>{await ct.queryTableForeignKeysBy({data:{revisionId:e.revisionId,tableId:e.tableId},foreignKeyData:{first:100}});const t=ct.cache.getTableByVariables({revisionId:e.revisionId,tableId:e.tableId});for(const r of(t==null?void 0:t.foreignKeysByConnection.edges)||[])await ct.queryRowForeignKeysBy({data:e,foreignKeyData:{first:100,foreignKeyTableId:r.node.id}})};class sw extends Error{}const Bpe=async({params:e})=>{const r=(await Bf(e)).draft,n=nT(e,r.id),i=ct.cache.getRowByVariables(n)||await ct.queryRow(n);if(!i)throw new sw(e.rowId);return await ct.queryGetRowCountForeignKeysBy(n),await iT(n),i},Vpe=async({params:e})=>{const r=(await Bf(e)).head,n=nT(e,r.id),i=ct.cache.getRowByVariables(n)||await ct.queryRow(n);if(!i)throw new sw(e.rowId);return ct.cache.getRowForeignKeysByVariables(n)||await ct.queryGetRowCountForeignKeysBy(n),await iT(n),i},zpe=async({params:e})=>{const t=await gV(e),r=nT(e,t.id),n=ct.cache.getRowByVariables(r)||await ct.queryRow(r);if(!n)throw new sw(e.rowId);return ct.cache.getRowForeignKeysByVariables(r)||await ct.queryGetRowCountForeignKeysBy(r),await iT(r),n};class xV extends Error{}const oT=async(e,t)=>{const r=SV(e,t),n=ct.cache.getTableByVariables(r)||await ct.queryTable({data:r});if(!n)throw new xV(e.tableId);return n.rowsConnection.countLoaded||await ct.queryRows({revisionId:t,tableId:n.id,first:50}),n},qpe=async({params:e})=>{const t=await Bf(e);return oT(e,t.draft.id)},Upe=async({params:e})=>{const t=await Bf(e);return oT(e,t.head.id)},Hpe=async({params:e})=>{const t=await gV(e);return oT(e,t.id)};class Wpe{constructor(t){this.projectPageModel=t,st(this)}get organization(){return this.projectPageModel.organization}get project(){return this.projectPageModel.project}get branch(){return this.projectPageModel.branchOrThrow}get revision(){return this.projectPageModel.revisionOrThrow}get currentBaseLink(){return B2(this.organization.id,this.project.name,this.branch.name,this.getCurrentOptions())}get parentForTableOrRow(){const t=this.currentBaseLink,r=this.projectPageModel.routeTableId,n=this.projectPageModel.routeRowId;if(r&&n)return ao(`${t}/${wp}`,{tableId:r});if(r)return ao(`${t}`)}getCurrentOptions(){return this.projectPageModel.isDraftRevision?{isDraft:!0}:this.projectPageModel.isHeadRevision?{isHead:!0}:{id:this.revision.id}}make(t){const r=t.tableId||this.projectPageModel.routeTableId,n=t.rowId||this.projectPageModel.routeRowId,i=B2(this.organization.id,this.project.name,this.branch.name,t);return r&&n?ao(`${i}/${wp}/${wB}`,{tableId:r,rowId:n}):r?ao(`${i}/${wp}`,{tableId:r}):i}init(){}dispose(){}}const B2=(e,t,r,n)=>n.isHead?ao(`/${Fl}/${Ll}/${Bl}/${Vl}`,{organizationId:e,projectName:t,branchName:r}):n.isDraft?ao(`/${Fl}/${Ll}/${Bl}/${Vl}/${X0}`,{organizationId:e,projectName:t,branchName:r}):ao(`/${Fl}/${Ll}/${Bl}/${Vl}/${bB}`,{organizationId:e,projectName:t,branchName:r,revisionId:n.id}),Kpe=()=>Ho(zr.DraftRow)||null,Gpe=()=>Ho(zr.HeadRow)||null,Qpe=()=>Ho(zr.SpecificRow)||null,Ype=()=>{const e=Kpe(),t=Gpe(),r=Qpe();return e||t||r},Xpe=()=>Ho(zr.Branch)||null,Jpe=()=>{const e=Ho(zr.Organization);if(!e)throw new Error("Not found organization from route loader");return e},Zpe=()=>{const e=Ho(zr.Project);if(!e)throw new Error("Not found project from route loader");return e},eme=()=>Ho(zr.DraftRevision)||null,tme=()=>Ho(zr.HeadRevision)||null,rme=()=>Ho(zr.SpecificRevision)||null,nme=()=>{const e=eme(),t=tme(),r=rme();return e||t||r},ime=()=>Ho(zr.DraftTable)||null,ome=()=>Ho(zr.HeadTable)||null,ame=()=>Ho(zr.SpecificTable)||null,sme=()=>{const e=ime(),t=ome(),r=ame();return e||t||r};class lme{constructor(t,r,n,i,o,a,l,c,d){this.cache=t,this.revalidateLoaders=r,this.params=n,this.organization=i,this.project=o,this.branch=a,this.revision=l,this.table=c,this.row=d,st(this)}get branchOrThrow(){if(!this.branch)throw new Error("Not found branch from route loader");return this.branch}get revisionOrThrow(){if(!this.revision)throw new Error("Not found revision from route loader");return this.revision}get tableOrThrow(){if(!this.table)throw new Error("Not found table from route loader");return this.table}get isStartRevision(){return this.branchOrThrow.start.id===this.revisionOrThrow.id}get isHeadRevision(){return this.branchOrThrow.head.id===this.revisionOrThrow.id}get isDraftRevision(){return this.branchOrThrow.draft.id===this.revisionOrThrow.id}get isStartAndHeadSameRevision(){return this.branchOrThrow.head.id===this.branchOrThrow.start.id}get isEditableRevision(){return this.isDraftRevision||!this.branchOrThrow.touched&&this.isHeadRevision}get rowOrThrow(){if(!this.row)throw new Error("Not found row from route loader");return this.row}get rowRefsBy(){if(this.revision&&this.table&&this.row)return this.cache.getRowForeignKeysByVariables({revisionId:this.revision.id,tableId:this.table.id,rowId:this.row.id})}get routeOrganizationId(){return this.params.organizationId}get routeProjectName(){return this.params.projectName}get routeBranchName(){return this.params.branchName}get routeRevisionId(){return this.params.revisionId}get routeTableId(){return this.params.tableId}get routeRowId(){return this.params.rowId}update(t){for(const[r,n]of Object.entries(t))this[r]!==n&&(this[r]=n)}init(){}dispose(){}}const Zn=()=>{const e=Cae(),t=vae(),r=Jpe(),n=Zpe(),i=Xpe(),o=nme(),a=sme(),l=Ype(),[c]=O.useState(()=>new lme(ct.cache,e.revalidate,t,r,n,i,o,a,l));return O.useEffect(()=>(c.init(),()=>c.dispose()),[c]),O.useEffect(()=>{c.update({params:t,organization:r,project:n,branch:i,revision:o,table:a,row:l})},[c,t,r,n,i,o,a,l]),c},Tc=()=>{const e=Zn(),[t]=O.useState(()=>new Wpe(e));return O.useEffect(()=>(t.init(),()=>t.dispose()),[t]),t};class ume{constructor(t,r,n){Pe(this,"disposer",null);this.navigateFunction=t,this.linkMaker=r,this.projectPageModel=n,st(this)}toDraftRoute(){var t;(t=this.navigateFunction)==null||t.call(this,this.linkMaker.make({isDraft:!0}))}toHeadRoute(){var t;(t=this.navigateFunction)==null||t.call(this,this.linkMaker.make({isHead:!0}))}init(){this.listenToBranch()}dispose(){var t;(t=this.disposer)==null||t.call(this),this.disposer=null}listenToBranch(){this.disposer=Ya(()=>({branch:this.branch,touched:this.branch.touched}),(t,r)=>{t.branch&&r.branch&&t.branch.id===r.branch.id&&(t.branch.touched?this.toDraftRoute():this.toHeadRoute())})}get branch(){return this.projectPageModel.branchOrThrow}}const cme=()=>{const e=Tc(),t=ou(),r=Zn(),[n]=O.useState(()=>new ume(t,e,r));return O.useEffect(()=>(n.init(),()=>n.dispose()),[n]),n},dme=({onClick:e})=>{const[t,r]=O.useState(""),{onOpen:n,onClose:i,isOpen:o}=Z4(),[a,l]=O.useState(!1),c=O.useCallback(async()=>{l(!0),await(e==null?void 0:e(t)),l(!1)},[t,e]),d=O.useCallback(f=>{r(f.currentTarget.value)},[]);return x.jsxs(ZC,{isOpen:o,onOpen:n,onClose:i,children:[x.jsx(JC,{children:x.jsx(Ci,{"data-testid":"create-revision-button",_hover:{backgroundColor:"gray.50"},isLoading:a,"aria-label":"",icon:x.jsx(SB,{boxSize:3}),variant:"ghost",color:"gray.300"})}),x.jsx(tE,{children:x.jsx(eE,{p:"1rem",children:x.jsxs(je,{flexDirection:"column",alignItems:"end",justifyContent:"flex-start",gap:"0.5rem",children:[x.jsx(TF,{_placeholder:{color:"gray.300"},placeholder:"Comment (optional)",onChange:d}),x.jsx("div",{children:x.jsx(ks,{onClick:c,title:"Commit"})})]})})})]})},fme=({onClick:e})=>{const[t,r]=O.useState(!1),n=O.useCallback(async()=>{r(!0),await(e==null?void 0:e()),r(!1)},[e]);return x.jsx(Ci,{"data-testid":"revert-revision-button",_hover:{backgroundColor:"gray.50"},isLoading:t,"aria-label":"",icon:x.jsx(PB,{size:"16"}),variant:"ghost",onClick:n,color:"gray.300"})},hme=Ne`
|
1303
|
+
`,Tpe=async e=>(await xr.query({query:Epe,variables:e})).data;class Ope{constructor(t){this.store=t}async execute(t){const r=await Tpe({data:{...t}}),n=ow(r.rows);r.rows.edges.forEach(({node:o})=>{const a=this.store.cache.addRow(o);this.store.cache.addRowByVariables({revisionId:t.revisionId,tableId:t.tableId,rowId:a.id},a.versionId)});const i=this.store.cache.getTableByVariables({revisionId:t.revisionId,tableId:t.tableId});t.after||i==null||i.rowsConnection.reset(),i==null||i.rowsConnection.onLoad({edges:n.edges,hasNextPage:n.pageInfo.hasNextPage,totalCount:n.totalCount})}}const vV=be.model({organization:be.maybeNull(be.reference(be.late(()=>eT))),project:be.maybeNull(be.reference(be.late(()=>sm))),branch:be.maybeNull(be.reference(be.late(()=>lm))),table:be.maybeNull(be.reference(be.late(()=>um))),row:be.maybeNull(be.reference(be.late(()=>cm))),revision:be.maybeNull(be.reference(be.late(()=>Zu))),cache:uV,backend:cpe}).views(e=>({get organizationOrThrow(){if(!e.organization)throw new Error("Not found organization");return e.organization},get projectOrThrow(){if(!e.project)throw new Error("Not found project");return e.project},get branchOrThrow(){if(!e.branch)throw new Error("Not found branch");return e.branch},get revisionOrThrow(){if(!e.revision)throw new Error("Not found revision");return e.revision},get tableOrThrow(){if(!e.table)throw new Error("Not found table");return e.table},get rowOrThrow(){if(!e.row)throw new Error("Not found row");return e.row}})).actions(e=>({selectOrganization(t){e.organization=t},selectProject(t){e.project=t},selectBranch(t){e.branch=t},selectRevision(t){e.revision=t},selectTable(t){e.table=t},selectRow(t){e.row=t}})).actions(e=>{const t=e,r={queryRevisions:new Ghe(t),queryTable:new _pe(t),queryTableForeignKeysBy:new Cpe(t),queryTables:new Xhe(t),queryRow:new vpe(t),queryRowForeignKeysBy:new bpe(t),queryGetRowCountForeignKeysBy:new hpe(t),queryRows:new Ope(t)};return{queryRevisions:io(function*(n){return yield r.queryRevisions.execute(n)}),queryTable:io(function*(n){return yield r.queryTable.execute(n)}),queryTableForeignKeysBy:io(function*(n){return yield r.queryTableForeignKeysBy.execute(n)}),queryTables:io(function*(n){return yield r.queryTables.execute(n)}),queryRow:io(function*(n){return yield r.queryRow.execute(n)}),queryRowForeignKeysBy:io(function*(n){return yield r.queryRowForeignKeysBy.execute(n)}),queryGetRowCountForeignKeysBy:io(function*(n){return yield r.queryGetRowCountForeignKeysBy.execute(n)}),queryRows:io(function*(n){return yield r.queryRows.execute(n)})}});let ct=vV.create({cache:{id:"1"},backend:{cache:"1"}});const Rpe=()=>{ct=vV.create({cache:{id:"1"},backend:{cache:"1"}})},Bf=async e=>_V(()=>ct.cache.getBranchByVariables(rT(e))),gV=async e=>_V(()=>ct.cache.getRevision(wV(e).revisionId)),yV=e=>{const{organizationId:t}=e;if(!t)throw new Error("Not found organizationId in route params");return{organizationId:t}},bV=e=>{const{projectName:t}=e;if(!t)throw new Error("Not found projectName in route params");return{...yV(e),projectName:t}},rT=e=>{const{branchName:t}=e;if(!t)throw new Error("Not found branchName in route params");return{...bV(e),branchName:t}},wV=e=>{const{revisionId:t}=e;if(!t)throw new Error("Not found revisionId in route params");return{revisionId:t}},SV=(e,t)=>{const{tableId:r}=e;if(!r)throw new Error("Not found tableId in route params");return{revisionId:t,tableId:r}},nT=(e,t)=>{const{rowId:r}=e;if(!r)throw new Error("Not found rowId in route params");return{...SV(e,t),rowId:r}},Ipe=e=>new Promise(t=>{const r=Ya(e,n=>{n&&(r(),t(n))})}),_V=async e=>{const t=e();return t||Ipe(e)},Mo=12,kpe=async({params:e})=>{const t=rT(e),r=ct.cache.getBranchByVariables(t)||await ct.backend.queryBranch(t);return r.start.getChildrenDetails(Mo).isAllLoaded||await ct.queryRevisions({branch:t,revisions:{first:Mo,after:r.start.id}}),r.head.getParentsDetails(Mo).isAllLoaded||await ct.queryRevisions({branch:t,revisions:{first:Mo,before:r.head.id}}),r},zb=async()=>{const e=dt.get(qi),t=dt.get(dc);return e.user?e.user.username?!0:hf(`/${mB}`):hf(t.availableSignUp?`/${Y0}`:`/${xc}`)},jpe=async()=>dt.get(qi).user?hf("/"):!0,$pe=async()=>{const e=dt.get(qi),t=dt.get(dc);return e.user||!t.availableSignUp?hf("/"):!0},RP=(...e)=>async t=>{let r;for(const n of e)if(r=await n(t),r&&typeof r=="object"&&"status"in r&&r.status===302)return r;return r},Ape=async()=>(ct.cache.meProjectsConnection.countLoaded||await ct.backend.queryMeProjects({first:100}),!0),Dpe=async({params:e})=>{const{organizationId:t}=yV(e);return ct.cache.getOrganization(t)||ct.cache.addOrganization({id:t})},Mpe=async({params:e})=>{const t=bV(e),r=ct.cache.getProjectByVariables(t)||await ct.backend.queryProject(t);return r.branchesConnection.countLoaded||await ct.backend.queryBranches({...t,first:100}),r},Npe=async({params:e})=>{const r=(await Bf(e)).draft;return r.tablesConnection.countLoaded===0&&await ct.queryTables({revisionId:r.id,first:50}),r},Fpe=async({params:e})=>{const r=(await Bf(e)).head;return r.tablesConnection.countLoaded===0&&await ct.queryTables({revisionId:r.id,first:50}),r},Lpe=async({params:e})=>{const t=wV(e),r=rT(e),n=ct.cache.getRevision(t.revisionId)||await ct.backend.queryRevision(t);return n.getChildrenDetails(Mo).isAllLoaded||await ct.queryRevisions({branch:r,revisions:{first:Mo,after:n.id}}),n.getParentsDetails(Mo).isAllLoaded||await ct.queryRevisions({branch:r,revisions:{first:Mo,before:n.id}}),n.tablesConnection.countLoaded===0&&await ct.queryTables({revisionId:n.id,first:50}),n},iT=async e=>{await ct.queryTableForeignKeysBy({data:{revisionId:e.revisionId,tableId:e.tableId},foreignKeyData:{first:100}});const t=ct.cache.getTableByVariables({revisionId:e.revisionId,tableId:e.tableId});for(const r of(t==null?void 0:t.foreignKeysByConnection.edges)||[])await ct.queryRowForeignKeysBy({data:e,foreignKeyData:{first:100,foreignKeyTableId:r.node.id}})};class sw extends Error{}const Bpe=async({params:e})=>{const r=(await Bf(e)).draft,n=nT(e,r.id),i=ct.cache.getRowByVariables(n)||await ct.queryRow(n);if(!i)throw new sw(e.rowId);return await ct.queryGetRowCountForeignKeysBy(n),await iT(n),i},Vpe=async({params:e})=>{const r=(await Bf(e)).head,n=nT(e,r.id),i=ct.cache.getRowByVariables(n)||await ct.queryRow(n);if(!i)throw new sw(e.rowId);return ct.cache.getRowForeignKeysByVariables(n)||await ct.queryGetRowCountForeignKeysBy(n),await iT(n),i},zpe=async({params:e})=>{const t=await gV(e),r=nT(e,t.id),n=ct.cache.getRowByVariables(r)||await ct.queryRow(r);if(!n)throw new sw(e.rowId);return ct.cache.getRowForeignKeysByVariables(r)||await ct.queryGetRowCountForeignKeysBy(r),await iT(r),n};class xV extends Error{}const oT=async(e,t)=>{const r=SV(e,t),n=ct.cache.getTableByVariables(r)||await ct.queryTable({data:r});if(!n)throw new xV(e.tableId);return n.rowsConnection.countLoaded||await ct.queryRows({revisionId:t,tableId:n.id,first:50}),n},qpe=async({params:e})=>{const t=await Bf(e);return oT(e,t.draft.id)},Upe=async({params:e})=>{const t=await Bf(e);return oT(e,t.head.id)},Hpe=async({params:e})=>{const t=await gV(e);return oT(e,t.id)};class Wpe{constructor(t){this.projectPageModel=t,st(this)}get organization(){return this.projectPageModel.organization}get project(){return this.projectPageModel.project}get branch(){return this.projectPageModel.branchOrThrow}get revision(){return this.projectPageModel.revisionOrThrow}get currentBaseLink(){return BA(this.organization.id,this.project.name,this.branch.name,this.getCurrentOptions())}get parentForTableOrRow(){const t=this.currentBaseLink,r=this.projectPageModel.routeTableId,n=this.projectPageModel.routeRowId;if(r&&n)return ao(`${t}/${wp}`,{tableId:r});if(r)return ao(`${t}`)}getCurrentOptions(){return this.projectPageModel.isDraftRevision?{isDraft:!0}:this.projectPageModel.isHeadRevision?{isHead:!0}:{id:this.revision.id}}make(t){const r=t.tableId||this.projectPageModel.routeTableId,n=t.rowId||this.projectPageModel.routeRowId,i=BA(this.organization.id,this.project.name,this.branch.name,t);return r&&n?ao(`${i}/${wp}/${wB}`,{tableId:r,rowId:n}):r?ao(`${i}/${wp}`,{tableId:r}):i}init(){}dispose(){}}const BA=(e,t,r,n)=>n.isHead?ao(`/${Fl}/${Ll}/${Bl}/${Vl}`,{organizationId:e,projectName:t,branchName:r}):n.isDraft?ao(`/${Fl}/${Ll}/${Bl}/${Vl}/${X0}`,{organizationId:e,projectName:t,branchName:r}):ao(`/${Fl}/${Ll}/${Bl}/${Vl}/${bB}`,{organizationId:e,projectName:t,branchName:r,revisionId:n.id}),Kpe=()=>Ho(zr.DraftRow)||null,Gpe=()=>Ho(zr.HeadRow)||null,Qpe=()=>Ho(zr.SpecificRow)||null,Ype=()=>{const e=Kpe(),t=Gpe(),r=Qpe();return e||t||r},Xpe=()=>Ho(zr.Branch)||null,Jpe=()=>{const e=Ho(zr.Organization);if(!e)throw new Error("Not found organization from route loader");return e},Zpe=()=>{const e=Ho(zr.Project);if(!e)throw new Error("Not found project from route loader");return e},eme=()=>Ho(zr.DraftRevision)||null,tme=()=>Ho(zr.HeadRevision)||null,rme=()=>Ho(zr.SpecificRevision)||null,nme=()=>{const e=eme(),t=tme(),r=rme();return e||t||r},ime=()=>Ho(zr.DraftTable)||null,ome=()=>Ho(zr.HeadTable)||null,ame=()=>Ho(zr.SpecificTable)||null,sme=()=>{const e=ime(),t=ome(),r=ame();return e||t||r};class lme{constructor(t,r,n,i,o,a,l,c,d){this.cache=t,this.revalidateLoaders=r,this.params=n,this.organization=i,this.project=o,this.branch=a,this.revision=l,this.table=c,this.row=d,st(this)}get branchOrThrow(){if(!this.branch)throw new Error("Not found branch from route loader");return this.branch}get revisionOrThrow(){if(!this.revision)throw new Error("Not found revision from route loader");return this.revision}get tableOrThrow(){if(!this.table)throw new Error("Not found table from route loader");return this.table}get isStartRevision(){return this.branchOrThrow.start.id===this.revisionOrThrow.id}get isHeadRevision(){return this.branchOrThrow.head.id===this.revisionOrThrow.id}get isDraftRevision(){return this.branchOrThrow.draft.id===this.revisionOrThrow.id}get isStartAndHeadSameRevision(){return this.branchOrThrow.head.id===this.branchOrThrow.start.id}get isEditableRevision(){return this.isDraftRevision||!this.branchOrThrow.touched&&this.isHeadRevision}get rowOrThrow(){if(!this.row)throw new Error("Not found row from route loader");return this.row}get rowRefsBy(){if(this.revision&&this.table&&this.row)return this.cache.getRowForeignKeysByVariables({revisionId:this.revision.id,tableId:this.table.id,rowId:this.row.id})}get routeOrganizationId(){return this.params.organizationId}get routeProjectName(){return this.params.projectName}get routeBranchName(){return this.params.branchName}get routeRevisionId(){return this.params.revisionId}get routeTableId(){return this.params.tableId}get routeRowId(){return this.params.rowId}update(t){for(const[r,n]of Object.entries(t))this[r]!==n&&(this[r]=n)}init(){}dispose(){}}const Zn=()=>{const e=Cae(),t=vae(),r=Jpe(),n=Zpe(),i=Xpe(),o=nme(),a=sme(),l=Ype(),[c]=O.useState(()=>new lme(ct.cache,e.revalidate,t,r,n,i,o,a,l));return O.useEffect(()=>(c.init(),()=>c.dispose()),[c]),O.useEffect(()=>{c.update({params:t,organization:r,project:n,branch:i,revision:o,table:a,row:l})},[c,t,r,n,i,o,a,l]),c},Tc=()=>{const e=Zn(),[t]=O.useState(()=>new Wpe(e));return O.useEffect(()=>(t.init(),()=>t.dispose()),[t]),t};class ume{constructor(t,r,n){Pe(this,"disposer",null);this.navigateFunction=t,this.linkMaker=r,this.projectPageModel=n,st(this)}toDraftRoute(){var t;(t=this.navigateFunction)==null||t.call(this,this.linkMaker.make({isDraft:!0}))}toHeadRoute(){var t;(t=this.navigateFunction)==null||t.call(this,this.linkMaker.make({isHead:!0}))}init(){this.listenToBranch()}dispose(){var t;(t=this.disposer)==null||t.call(this),this.disposer=null}listenToBranch(){this.disposer=Ya(()=>({branch:this.branch,touched:this.branch.touched}),(t,r)=>{t.branch&&r.branch&&t.branch.id===r.branch.id&&(t.branch.touched?this.toDraftRoute():this.toHeadRoute())})}get branch(){return this.projectPageModel.branchOrThrow}}const cme=()=>{const e=Tc(),t=ou(),r=Zn(),[n]=O.useState(()=>new ume(t,e,r));return O.useEffect(()=>(n.init(),()=>n.dispose()),[n]),n},dme=({onClick:e})=>{const[t,r]=O.useState(""),{onOpen:n,onClose:i,isOpen:o}=Z4(),[a,l]=O.useState(!1),c=O.useCallback(async()=>{l(!0),await(e==null?void 0:e(t)),l(!1)},[t,e]),d=O.useCallback(f=>{r(f.currentTarget.value)},[]);return x.jsxs(ZC,{isOpen:o,onOpen:n,onClose:i,children:[x.jsx(JC,{children:x.jsx(Ci,{"data-testid":"create-revision-button",_hover:{backgroundColor:"gray.50"},isLoading:a,"aria-label":"",icon:x.jsx(SB,{boxSize:3}),variant:"ghost",color:"gray.300"})}),x.jsx(tE,{children:x.jsx(eE,{p:"1rem",children:x.jsxs(je,{flexDirection:"column",alignItems:"end",justifyContent:"flex-start",gap:"0.5rem",children:[x.jsx(TF,{_placeholder:{color:"gray.300"},placeholder:"Comment (optional)",onChange:d}),x.jsx("div",{children:x.jsx(ks,{onClick:c,title:"Commit"})})]})})})]})},fme=({onClick:e})=>{const[t,r]=O.useState(!1),n=O.useCallback(async()=>{r(!0),await(e==null?void 0:e()),r(!1)},[e]);return x.jsx(Ci,{"data-testid":"revert-revision-button",_hover:{backgroundColor:"gray.50"},isLoading:t,"aria-label":"",icon:x.jsx(PB,{size:"16"}),variant:"ghost",onClick:n,color:"gray.300"})},hme=Ne`
|
1304
1304
|
mutation CreateBranchByRevisionIdMst($data: CreateBranchByRevisionIdInput!) {
|
1305
1305
|
createBranchByRevisionId(data: $data) {
|
1306
1306
|
...BranchMst
|
@@ -1325,7 +1325,7 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
1325
1325
|
}
|
1326
1326
|
}
|
1327
1327
|
${Qs}
|
1328
|
-
`,wme=async e=>{const t=await xr.mutate({mutation:bme,variables:e});if(!t.data)throw t.errors;return t.data};class Sme{constructor(t){this.projectPageModel=t}get organization(){return this.projectPageModel.organization}get project(){return this.projectPageModel.project}get branch(){return this.projectPageModel.branchOrThrow}async execute(){return await this.revertChangesRequest(),this.resetTablesConnection(),this.branch.updateTouched(!1),!0}revertChangesRequest(){return wme({data:{organizationId:this.organization.id,projectName:this.project.name,branchName:this.branch.name}})}resetTablesConnection(){this.branch.draft.tablesConnection.reset()}}class _me{constructor(t,r){this.rootStore=t,this.projectPageModel=r,st(this,{},{autoBind:!0})}get showCreateBranchCard(){if(this.revision){const t=this.branch.start.id!==this.branch.head.id,r=this.branch.touched;return(t||r)&&this.revision.id!==this.branch.draft.id}}get showActions(){if(this.revision)return this.branch.touched&&this.revision.id===this.branch.draft.id}get branch(){return this.projectPageModel.branchOrThrow}get revision(){return this.projectPageModel.revision}init(){}dispose(){}async createBranchByRevisionId(t){if(!this.revision)throw new Error("Not found revision");try{await new mme(this.rootStore,this.projectPageModel,t).execute()}catch(r){console.error(r)}}async revertChanges(){try{await new Sme(this.projectPageModel).execute()}catch(t){console.log(t)}}async createRevision(t){try{await new yme(this.rootStore,this.projectPageModel,t).execute()}catch(r){console.error(r)}}}const xme=()=>{const e=Zn(),[t]=O.useState(()=>new _me(ct,e));return O.useEffect(()=>(t.init(),()=>t.dispose()),[t]),t};function Pme(){var e=O.useRef(!0);return e.current?(e.current=!1,!0):e.current}var Cme=function(e,t){var r=Pme();O.useEffect(function(){if(!r)return e()},t)},
|
1328
|
+
`,wme=async e=>{const t=await xr.mutate({mutation:bme,variables:e});if(!t.data)throw t.errors;return t.data};class Sme{constructor(t){this.projectPageModel=t}get organization(){return this.projectPageModel.organization}get project(){return this.projectPageModel.project}get branch(){return this.projectPageModel.branchOrThrow}async execute(){return await this.revertChangesRequest(),this.resetTablesConnection(),this.branch.updateTouched(!1),!0}revertChangesRequest(){return wme({data:{organizationId:this.organization.id,projectName:this.project.name,branchName:this.branch.name}})}resetTablesConnection(){this.branch.draft.tablesConnection.reset()}}class _me{constructor(t,r){this.rootStore=t,this.projectPageModel=r,st(this,{},{autoBind:!0})}get showCreateBranchCard(){if(this.revision){const t=this.branch.start.id!==this.branch.head.id,r=this.branch.touched;return(t||r)&&this.revision.id!==this.branch.draft.id}}get showActions(){if(this.revision)return this.branch.touched&&this.revision.id===this.branch.draft.id}get branch(){return this.projectPageModel.branchOrThrow}get revision(){return this.projectPageModel.revision}init(){}dispose(){}async createBranchByRevisionId(t){if(!this.revision)throw new Error("Not found revision");try{await new mme(this.rootStore,this.projectPageModel,t).execute()}catch(r){console.error(r)}}async revertChanges(){try{await new Sme(this.projectPageModel).execute()}catch(t){console.log(t)}}async createRevision(t){try{await new yme(this.rootStore,this.projectPageModel,t).execute()}catch(r){console.error(r)}}}const xme=()=>{const e=Zn(),[t]=O.useState(()=>new _me(ct,e));return O.useEffect(()=>(t.init(),()=>t.dispose()),[t]),t};function Pme(){var e=O.useRef(!0);return e.current?(e.current=!1,!0):e.current}var Cme=function(e,t){var r=Pme();O.useEffect(function(){if(!r)return e()},t)},VA=function(){},Eme=typeof window<"u",Tme=function(e,t){return typeof t=="boolean"?t:!e},PV=function(e){return O.useReducer(Tme,e)},CV=function(e){O.useEffect(e,[])},Ome=function(e,t,r){if(!Eme)return[t,VA,VA];var n=JSON.parse,i=O.useRef(function(f){try{var p=r?r.raw?String:r.serializer:JSON.stringify,m=localStorage.getItem(f);return m!==null?n(m):(t&&localStorage.setItem(f,p(t)),t)}catch{return t}}),o=O.useState(function(){return i.current(e)}),a=o[0],l=o[1];O.useLayoutEffect(function(){return l(i.current(e))},[e]);var c=O.useCallback(function(f){try{var p=typeof f=="function"?f(a):f;if(typeof p>"u")return;var m=void 0;r||(m=JSON.stringify(p)),localStorage.setItem(e,m),l(n(m))}catch{}},[e,l]),d=O.useCallback(function(){try{localStorage.removeItem(e),l(void 0)}catch{}},[e,l]);return[a,c,d]};const Rme=({onCancel:e,onAdd:t})=>{const[r,n]=O.useState(!1),i=RB(),[o,a]=O.useState(""),l=O.useCallback(async()=>{n(!0),await(t==null?void 0:t(o)),n(!1)},[o,t]),c=O.useCallback(d=>{a(d.currentTarget.value)},[]);return x.jsxs(je,{alignSelf:"flex-start",gap:"0.5rem",children:[x.jsx(C0,{"data-testid":"create-branch-name-input",borderColor:"gray.100",borderStyle:"solid",borderWidth:"1px",padding:"0 0.5rem",placeholder:"branch-name",ref:i,variant:"unstyled",onChange:c,onKeyDown:d=>{d.key==="Enter"&&l()}}),x.jsx(Z0,{dataTestId:"create-branch-close-button",onClick:e}),x.jsx(Qm,{dataTestId:"create-branch-approve-button",isDisabled:!o,loading:r,onClick:l})]})},Ime=({onCreate:e})=>{const[t,r]=PV(!1),n=O.useCallback(async i=>{await e(i),r()},[e,r]);return t?x.jsx(Rme,{onAdd:n,onCancel:r}):x.jsx(Af,{dataTestId:"create-branch-button",title:"Branch",onClick:r})},kme=Ot(()=>{const e=xme();return x.jsxs(je,{gap:"0.5rem",alignItems:"center",children:[e.showActions&&x.jsxs(x.Fragment,{children:[x.jsx(dme,{onClick:e.createRevision}),x.jsx(fme,{onClick:e.revertChanges})]}),e.showCreateBranchCard&&x.jsx(Ime,{onCreate:e.createBranchByRevisionId})]})});class jme{constructor(t,r){this.projectPageModel=t,this.linkMaker=r,st(this,{},{autoBind:!0})}get breadcrumbs(){const t=[];t.push({title:this.branch.name,href:this.linkMaker.currentBaseLink,isCurrentPage:!1,dataTestId:`breadcrumb-branch-${this.branch.name}`});const r=this.projectPageModel.routeTableId;r&&t.push({title:r,href:ao(`${this.linkMaker.currentBaseLink}/${wp}`,{tableId:r}),isCurrentPage:!1,dataTestId:`breadcrumb-table-${r}`});const n=this.projectPageModel.routeRowId;n&&t.push({title:n,href:"",isCurrentPage:!1,dataTestId:`breadcrumb-row-${n}`});const i=t.slice().pop();return i&&(i.isCurrentPage=!0),t}get branchName(){return this.branch.name}get title(){return this.isDraftRevision||this.isHeadRevision?"":`[${this.revision.id.slice(0,6)}]`}get isDraftRevision(){return this.projectPageModel.isDraftRevision}get isHeadRevision(){return this.projectPageModel.isHeadRevision}get branch(){return this.projectPageModel.branchOrThrow}get revision(){return this.projectPageModel.revisionOrThrow}init(){}dispose(){}}const $me=()=>{const e=Zn(),t=Tc(),[r]=O.useState(()=>new jme(e,t));return O.useEffect(()=>(r.init(),()=>r.dispose()),[r]),r},Ame="_Root_t8kot_1",Dme={Root:Ame},Mme=Ot(()=>{const e=$me();return x.jsxs(je,{alignItems:"center",gap:"4px",flex:1,height:"40px",className:Dme.Root,children:[x.jsx(V4,{spacing:"8px",separator:"/",color:"gray",fontWeight:"600",fontSize:"16px",children:e.breadcrumbs.map(t=>x.jsx(B4,{isCurrentPage:t.isCurrentPage,children:x.jsx(MC,{"data-testid":t.dataTestId,to:t.href,as:t.isCurrentPage?void 0:qo,children:t.title})},t.href))}),e.title&&x.jsxs(bt,{color:"gray",opacity:"0.3",fontWeight:"400",fontSize:"16px",children:["- ",e.title]})]})});var zs=(e=>(e.GRAPHQL="GRAPHQL",e.REST_API="REST_API",e))(zs||{});class Nme{constructor(t){this.projectPageModel=t,st(this,{},{autoBind:!0})}get branchTitle(){const r=`Branch: ${this.projectPageModel.branchOrThrow.name}`;return this.projectPageModel.isHeadRevision?`${r}[head]`:this.projectPageModel.isDraftRevision?`${r}[draft]`:`${r}[${this.projectPageModel.revisionOrThrow.id.substring(0,6)}]`}get isThereEndpoint(){return!!this.projectPageModel.revisionOrThrow.endpoints.length}init(){}dispose(){}}const Fme=()=>{const e=Zn(),[t]=O.useState(()=>new Nme(e));return O.useEffect(()=>(t.init(),()=>t.dispose()),[t]),t};function Lme(e){return Hr({attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12,0C5.372,0 0,5.373 0,12 0,18.628 5.372,24 12,24 18.627,24 24,18.628 24,12A12.014,12.014 0 0 0 23.527,8.657 0.6,0.6 0 0 0 22.4,9.066H22.398C22.663,10.009 22.8,10.994 22.8,12A10.73,10.73 0 0 1 19.637,19.637 10.729,10.729 0 0 1 12,22.8 10.73,10.73 0 0 1 4.363,19.637 10.728,10.728 0 0 1 1.2,12 10.73,10.73 0 0 1 4.363,4.363 10.728,10.728 0 0 1 12,1.2C14.576,1.2 17.013,2.096 18.958,3.74A1.466,1.466 0 1 0 19.82,2.9 11.953,11.953 0 0 0 12,0ZM10.56,5.88 6.36,16.782H8.99L9.677,14.934H13.646L12.927,12.892H10.314L12.014,8.201 15.038,16.781H17.669L13.47,5.88Z"},child:[]}]})(e)}function Bme(e){return Hr({attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 0C5.383 0 0 5.383 0 12s5.383 12 12 12c6.616 0 12-5.383 12-12S18.616 0 12 0zm0 1.144c5.995 0 10.856 4.86 10.856 10.856 0 5.995-4.86 10.856-10.856 10.856-5.996 0-10.856-4.86-10.856-10.856C1.144 6.004 6.004 1.144 12 1.144zM8.37 5.868a6.707 6.707 0 0 0-.423.005c-.983.056-1.573.517-1.735 1.472-.115.665-.096 1.348-.143 2.017-.013.35-.05.697-.115 1.038-.134.609-.397.798-1.016.83a2.65 2.65 0 0 0-.244.042v1.463c1.126.055 1.278.452 1.37 1.629.033.429-.013.858.015 1.287.018.406.073.808.156 1.2.259 1.075 1.307 1.435 2.575 1.218v-1.283c-.203 0-.383.005-.558 0-.43-.013-.591-.12-.632-.535-.056-.535-.042-1.08-.075-1.62-.064-1.001-.175-1.988-1.153-2.625.503-.37.868-.812.983-1.398.083-.41.134-.821.166-1.237.028-.415-.023-.84.014-1.25.06-.665.102-.937.9-.91.12 0 .235-.017.369-.027v-1.31c-.16 0-.31-.004-.454-.006zm7.593.009a4.247 4.247 0 0 0-.813.06v1.274c.245 0 .434 0 .623.005.328.004.577.13.61.494.032.332.031.669.064 1.006.065.669.101 1.347.217 2.007.102.544.475.95.941 1.283-.817.549-1.057 1.333-1.098 2.215-.023.604-.037 1.213-.069 1.822-.028.554-.222.734-.78.748-.157.004-.31.018-.484.028v1.305c.327 0 .627.019.927 0 .932-.055 1.495-.507 1.68-1.412.078-.498.124-1 .138-1.504.032-.461.028-.927.074-1.384.069-.715.397-1.01 1.112-1.057a.972.972 0 0 0 .199-.046v-1.463c-.12-.014-.204-.027-.291-.032-.536-.023-.804-.203-.937-.71a5.146 5.146 0 0 1-.152-.993c-.037-.618-.033-1.241-.074-1.86-.08-1.192-.794-1.753-1.887-1.786zm-6.89 5.28a.844.844 0 0 0-.083 1.684h.055a.83.83 0 0 0 .877-.78v-.046a.845.845 0 0 0-.83-.858zm2.911 0a.808.808 0 0 0-.834.78c0 .027 0 .05.004.078 0 .503.342.826.859.826.507 0 .826-.332.826-.853-.005-.503-.342-.836-.855-.831zm2.963 0a.861.861 0 0 0-.876.835c0 .47.378.849.849.849h.009c.425.074.853-.337.881-.83.023-.457-.392-.854-.863-.854z"},child:[]}]})(e)}const Vme={[zs.GRAPHQL]:"GraphQL",[zs.REST_API]:"Swagger"},EV=e=>Vme[e],zme=Ne`
|
1329
1329
|
mutation CreateEndpointMst($data: CreateEndpointInput!) {
|
1330
1330
|
createEndpoint(data: $data) {
|
1331
1331
|
...EndpointMst
|
@@ -1336,7 +1336,7 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
1336
1336
|
mutation DeleteEndpointMst($data: DeleteEndpointInput!) {
|
1337
1337
|
deleteEndpoint(data: $data)
|
1338
1338
|
}
|
1339
|
-
`,Wme=async e=>{const t=await xr.mutate({mutation:Hme,variables:e});if(!t.data)throw t.errors;return t.data};class Kme{constructor(t,r){this.projectPageModel=t,this.endpointId=r}get revision(){return this.projectPageModel.revisionOrThrow}async execute(){const t=await this.deleteEndpointRequest();return this.updateRevision(),t}async deleteEndpointRequest(){return(await Wme({data:{endpointId:this.endpointId}})).deleteEndpoint}updateRevision(){this.revision.removeEndpoint(this.endpointId)}}const Gme=Oy("REACT_APP_ENDPOINT_SERVER_URL"),Qme={[zs.GRAPHQL]:"graphql",[zs.REST_API]:"swagger"};class Yme{constructor(t,r){this.projectPageModel=t,this.endpointType=r,st(this,{},{autoBind:!0})}get href(){if(!this.endpoint)return;const t=`${this.baseUrl}/${this.organization.id}/${this.project.name}/${this.branch.name}`;return this.projectPageModel.isDraftRevision?`${t}/draft`:this.projectPageModel.isHeadRevision?`${t}/head`:`${t}/${this.revision.id}`}async switch(){try{return this.endpoint?await new Kme(this.projectPageModel,this.endpoint.id).execute():new Ume(ct,this.projectPageModel,this.endpointType).execute()}catch(t){console.log(t)}}init(){}dispose(){}get endpoint(){return this.revision.endpoints.find(t=>t.type===this.endpointType)}get organization(){return this.projectPageModel.organization}get project(){return this.projectPageModel.project}get branch(){return this.projectPageModel.branchOrThrow}get revision(){return this.projectPageModel.revisionOrThrow}get baseUrl(){return`${Gme}/${Qme[this.endpointType]}`}}const Xme=e=>{const t=Zn(),[r]=O.useState(()=>new Yme(t,e));return O.useEffect(()=>(r.init(),()=>r.dispose()),[r]),r},Jme={[zs.GRAPHQL]:x.jsx(Lme,{size:20}),[zs.REST_API]:x.jsx(Bme,{size:20})},z2=Ot(({type:e})=>{const t=Xme(e);return x.jsxs(je,{alignItems:"center",gap:"0.5rem",minWidth:"90px",height:"25px",children:[x.jsx(wt,{color:t.href?"gray.400":"gray.300",children:Jme[e]}),x.jsx(bt,{width:"140px",color:"gray.400",children:EV(e)}),x.jsxs(je,{width:"120px",gap:"0.5rem",alignItems:"center",children:[x.jsx(EF,{"data-testid":`endpoint-switch-${e}`,colorScheme:"gray",isChecked:!!t.href,onChange:t.switch}),t.href&&x.jsx(Cf,{isExternal:!0,href:t.href,children:x.jsx(Lo,{"data-testid":`endpoint-button-${e}`,size:"sm","aria-label":"removeRow",color:"gray.500",isDisabled:!t.href,variant:"ghost",padding:0,minWidth:"20px",minHeight:"20px",height:"20px",paddingBottom:"3px",children:x.jsx(Kce,{size:"20px"})})})]})]})}),Zme="_Root_t8kot_1",eve="_Action_t8kot_1",TV={Root:Zme,Action:eve},tve=Ot(()=>{const{onOpen:e,onClose:t,isOpen:r}=Z4(),n=Fme();return x.jsxs(ZC,{trigger:"click",isOpen:r,onOpen:e,onClose:t,children:[x.jsx(JC,{children:x.jsx(Ci,{"data-testid":"revision-endpoint-button",className:r?void 0:TV.Action,"aria-label":"",icon:n.isThereEndpoint?x.jsx(Hce,{size:"24"}):x.jsx(Wce,{size:"24"}),opacity:.5,_hover:{opacity:1},variant:"ghost"})}),x.jsxs(tE,{maxWidth:"240px",children:[x.jsx(xF,{}),x.jsx(eE,{children:x.jsxs(je,{flexDirection:"column",gap:"1rem",children:[x.jsx(z2,{type:zs.GRAPHQL}),x.jsx(z2,{type:zs.REST_API})]})}),x.jsx(CF,{justifyContent:"center",children:x.jsx(bt,{color:"gray.400",opacity:"0.7",fontSize:"xs",as:"samp",children:n.branchTitle})})]})]})});var In=(e=>(e.Revision="Revision",e.Parent="Parent",e.Draft="Draft",e.Start="Start",e.Head="Head",e.Child="Child",e.PreviousPage="PreviousPage",e.NextPage="NextPage",e))(In||{});const IP=["PreviousPage","NextPage"];class rve{constructor(t){this.projectPageModel=t,st(this)}async queryNextPage(t){t.getChildrenDetails(Mo).isAllLoaded||await ct.queryRevisions({branch:this.branchVariables,revisions:{first:Mo,after:t.id}})}async queryPreviousPage(t){t.getParentsDetails(Mo).isAllLoaded||await ct.queryRevisions({branch:this.branchVariables,revisions:{first:Mo,before:t.id}})}get branchVariables(){return{organizationId:this.projectPageModel.organization.id,projectName:this.projectPageModel.project.name,branchName:this.projectPageModel.branchOrThrow.name}}}var Il=(e=>(e.None="None",e.Left="Left",e.Right="Right",e))(Il||{});class nve{constructor(t,r,n,i,o){Pe(this,"disposers",[]);this.cache=t,this.projectPageModel=r,this.revisionsCardItemsModel=n,this.middleRevisions=i,this.revisionsPageQueries=o,st(this,{},{autoBind:!0}),this.updateWithDesiredCurrentRevision()}get items(){return this.revisionsCardItemsModel.items}get branch(){return this.projectPageModel.branchOrThrow}get revision(){return this.projectPageModel.revisionOrThrow}init(){this.middleRevisions.resetDefaultMaxItems(),this.disposers.push(Ya(()=>this.projectPageModel.branch,this.onSelectBranch)),this.disposers.push(Ya(()=>{var t;return(t=this.projectPageModel.branch)==null?void 0:t.head},this.onCreatedNewRevision)),this.disposers.push(Ya(()=>this.projectPageModel.revision,this.onSelectRevision))}dispose(){for(const t of this.disposers)t();this.disposers=[]}async previousPage(t){var n;const r=(n=this.cache.revision.get(t))==null?void 0:n.child;if(!r)throw new Error(`Not found revision ${t}`);await this.revisionsPageQueries.queryPreviousPage(r),this.middleRevisions.select({desiredRevision:r,priority:Il.Left})}async nextPage(t){var n;const r=(n=this.cache.revision.get(t))==null?void 0:n.parent;if(!r)throw new Error(`Not found revision ${t}`);await this.revisionsPageQueries.queryNextPage(r),this.middleRevisions.select({desiredRevision:r,priority:Il.Right})}updateWithDesiredCurrentRevision(){this.middleRevisions.select({desiredRevision:this.revision,priority:Il.None})}onSelectBranch(){this.dispose(),this.init(),this.updateWithDesiredCurrentRevision()}onCreatedNewRevision(){this.middleRevisions.increaseMaxItemsForNewRevision(),this.middleRevisions.select({desiredRevision:this.branch.head,priority:Il.None})}onSelectRevision(t){(t===this.branch.start||t===this.branch.head||t===this.branch.draft)&&this.middleRevisions.select({desiredRevision:t,priority:Il.None})}}class ive{constructor(t){this.projectPageModel=t}get branch(){return this.projectPageModel.branchOrThrow}find({targetRevision:t,priority:r,maxItems:n}){const i=[],{rawRightPartRevisions:o,rawLeftPartRevisions:a}=this.getParts({targetRevision:t,priority:r,maxItems:n});return i.push(...a),i.push(t),i.push(...o),i}getParts({targetRevision:t,priority:r,maxItems:n}){const i=this.getLeftPartRevisions({targetRevision:t,maxLength:n+1}),o=this.getRightPartRevisions({targetRevision:t,maxLength:n+1}),a=[],l=[],c=i.slice(),d=o.slice().reverse();let f=0;for(;f<n;){const p=r===Il.Right&&d.length&&a.length>0?void 0:c.pop();if(p&&(a.unshift(p),f+=1),f>=n)break;const m=r===Il.Left&&c.length&&l.length>0?void 0:d.pop();if(m&&(l.push(m),f+=1),!c.length&&!d.length)break}return{rawLeftPartRevisions:a,rawRightPartRevisions:l}}getLeftPartRevisions({targetRevision:t,maxLength:r}){const n=[];if(t!==this.branch.start&&t.parent!==this.branch.start){let i=t.parent;for(;i&&(i!==this.branch.head&&n.push(i),i=i.parent,!(this.branch.start===i||n.length>=r)););}return n.reverse()}getRightPartRevisions({targetRevision:t,maxLength:r}){const n=[];if(t!==this.branch.head&&t!==this.branch.draft&&t.child!==this.branch.head){let i=t.child;for(;i&&(n.push(i),i=i.child,!(this.branch.head===i||n.length>=r)););}return n}}const ove={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},ave=(e,t,r)=>{let n;const i=ove[e];return typeof i=="string"?n=i:t===1?n=i.one:n=i.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function T_(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const sve={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},lve={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},uve={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},cve={date:T_({formats:sve,defaultWidth:"full"}),time:T_({formats:lve,defaultWidth:"full"}),dateTime:T_({formats:uve,defaultWidth:"full"})},dve={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},fve=(e,t,r,n)=>dve[e];function Nh(e){return(t,r)=>{const n=r!=null&&r.context?String(r.context):"standalone";let i;if(n==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,l=r!=null&&r.width?String(r.width):a;i=e.formattingValues[l]||e.formattingValues[a]}else{const a=e.defaultWidth,l=r!=null&&r.width?String(r.width):e.defaultWidth;i=e.values[l]||e.values[a]}const o=e.argumentCallback?e.argumentCallback(t):t;return i[o]}}const hve={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},pve={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},mve={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},vve={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},gve={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},yve={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},bve=(e,t)=>{const r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},wve={ordinalNumber:bve,era:Nh({values:hve,defaultWidth:"wide"}),quarter:Nh({values:pve,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Nh({values:mve,defaultWidth:"wide"}),day:Nh({values:vve,defaultWidth:"wide"}),dayPeriod:Nh({values:gve,defaultWidth:"wide",formattingValues:yve,defaultFormattingWidth:"wide"})};function Fh(e){return(t,r={})=>{const n=r.width,i=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;const a=o[0],l=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?_ve(l,p=>p.test(a)):Sve(l,p=>p.test(a));let d;d=e.valueCallback?e.valueCallback(c):c,d=r.valueCallback?r.valueCallback(d):d;const f=t.slice(a.length);return{value:d,rest:f}}}function Sve(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function _ve(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}function xve(e){return(t,r={})=>{const n=t.match(e.matchPattern);if(!n)return null;const i=n[0],o=t.match(e.parsePattern);if(!o)return null;let a=e.valueCallback?e.valueCallback(o[0]):o[0];a=r.valueCallback?r.valueCallback(a):a;const l=t.slice(i.length);return{value:a,rest:l}}}const Pve=/^(\d+)(th|st|nd|rd)?/i,Cve=/\d+/i,Eve={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Tve={any:[/^b/i,/^(a|c)/i]},Ove={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Rve={any:[/1/i,/2/i,/3/i,/4/i]},Ive={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},kve={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},jve={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},$ve={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Ave={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Dve={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Mve={ordinalNumber:xve({matchPattern:Pve,parsePattern:Cve,valueCallback:e=>parseInt(e,10)}),era:Fh({matchPatterns:Eve,defaultMatchWidth:"wide",parsePatterns:Tve,defaultParseWidth:"any"}),quarter:Fh({matchPatterns:Ove,defaultMatchWidth:"wide",parsePatterns:Rve,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Fh({matchPatterns:Ive,defaultMatchWidth:"wide",parsePatterns:kve,defaultParseWidth:"any"}),day:Fh({matchPatterns:jve,defaultMatchWidth:"wide",parsePatterns:$ve,defaultParseWidth:"any"}),dayPeriod:Fh({matchPatterns:Ave,defaultMatchWidth:"any",parsePatterns:Dve,defaultParseWidth:"any"})},Nve={code:"en-US",formatDistance:ave,formatLong:cve,formatRelative:fve,localize:wve,match:Mve,options:{weekStartsOn:0,firstWeekContainsDate:1}};let Fve={};function lw(){return Fve}const OV=6048e5,Lve=864e5;function ba(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function q2(e){const t=ba(e);return t.setHours(0,0,0,0),t}function U2(e){const t=ba(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function Bve(e,t){const r=q2(e),n=q2(t),i=+r-U2(r),o=+n-U2(n);return Math.round((i-o)/Lve)}function fc(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function Vve(e){const t=ba(e),r=fc(e,0);return r.setFullYear(t.getFullYear(),0,1),r.setHours(0,0,0,0),r}function zve(e){const t=ba(e);return Bve(t,Vve(t))+1}function dm(e,t){var l,c,d,f;const r=lw(),n=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??r.weekStartsOn??((f=(d=r.locale)==null?void 0:d.options)==null?void 0:f.weekStartsOn)??0,i=ba(e),o=i.getDay(),a=(o<n?7:0)+o-n;return i.setDate(i.getDate()-a),i.setHours(0,0,0,0),i}function qb(e){return dm(e,{weekStartsOn:1})}function RV(e){const t=ba(e),r=t.getFullYear(),n=fc(e,0);n.setFullYear(r+1,0,4),n.setHours(0,0,0,0);const i=qb(n),o=fc(e,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);const a=qb(o);return t.getTime()>=i.getTime()?r+1:t.getTime()>=a.getTime()?r:r-1}function qve(e){const t=RV(e),r=fc(e,0);return r.setFullYear(t,0,4),r.setHours(0,0,0,0),qb(r)}function Uve(e){const t=ba(e),r=+qb(t)-+qve(t);return Math.round(r/OV)+1}function IV(e,t){var f,p,m,g;const r=ba(e),n=r.getFullYear(),i=lw(),o=(t==null?void 0:t.firstWeekContainsDate)??((p=(f=t==null?void 0:t.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??i.firstWeekContainsDate??((g=(m=i.locale)==null?void 0:m.options)==null?void 0:g.firstWeekContainsDate)??1,a=fc(e,0);a.setFullYear(n+1,0,o),a.setHours(0,0,0,0);const l=dm(a,t),c=fc(e,0);c.setFullYear(n,0,o),c.setHours(0,0,0,0);const d=dm(c,t);return r.getTime()>=l.getTime()?n+1:r.getTime()>=d.getTime()?n:n-1}function Hve(e,t){var l,c,d,f;const r=lw(),n=(t==null?void 0:t.firstWeekContainsDate)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??r.firstWeekContainsDate??((f=(d=r.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??1,i=IV(e,t),o=fc(e,0);return o.setFullYear(i,0,n),o.setHours(0,0,0,0),dm(o,t)}function Wve(e,t){const r=ba(e),n=+dm(r,t)-+Hve(r,t);return Math.round(n/OV)+1}function Cr(e,t){const r=e<0?"-":"",n=Math.abs(e).toString().padStart(t,"0");return r+n}const bl={y(e,t){const r=e.getFullYear(),n=r>0?r:1-r;return Cr(t==="yy"?n%100:n,t.length)},M(e,t){const r=e.getMonth();return t==="M"?String(r+1):Cr(r+1,2)},d(e,t){return Cr(e.getDate(),t.length)},a(e,t){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(e,t){return Cr(e.getHours()%12||12,t.length)},H(e,t){return Cr(e.getHours(),t.length)},m(e,t){return Cr(e.getMinutes(),t.length)},s(e,t){return Cr(e.getSeconds(),t.length)},S(e,t){const r=t.length,n=e.getMilliseconds(),i=Math.trunc(n*Math.pow(10,r-3));return Cr(i,t.length)}},pd={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},H2={G:function(e,t,r){const n=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if(t==="yo"){const n=e.getFullYear(),i=n>0?n:1-n;return r.ordinalNumber(i,{unit:"year"})}return bl.y(e,t)},Y:function(e,t,r,n){const i=IV(e,n),o=i>0?i:1-i;if(t==="YY"){const a=o%100;return Cr(a,2)}return t==="Yo"?r.ordinalNumber(o,{unit:"year"}):Cr(o,t.length)},R:function(e,t){const r=RV(e);return Cr(r,t.length)},u:function(e,t){const r=e.getFullYear();return Cr(r,t.length)},Q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return Cr(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return Cr(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){const n=e.getMonth();switch(t){case"M":case"MM":return bl.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){const n=e.getMonth();switch(t){case"L":return String(n+1);case"LL":return Cr(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){const i=Wve(e,n);return t==="wo"?r.ordinalNumber(i,{unit:"week"}):Cr(i,t.length)},I:function(e,t,r){const n=Uve(e);return t==="Io"?r.ordinalNumber(n,{unit:"week"}):Cr(n,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getDate(),{unit:"date"}):bl.d(e,t)},D:function(e,t,r){const n=zve(e);return t==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):Cr(n,t.length)},E:function(e,t,r){const n=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){const i=e.getDay(),o=(i-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return Cr(o,2);case"eo":return r.ordinalNumber(o,{unit:"day"});case"eee":return r.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(i,{width:"short",context:"formatting"});case"eeee":default:return r.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){const i=e.getDay(),o=(i-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return Cr(o,t.length);case"co":return r.ordinalNumber(o,{unit:"day"});case"ccc":return r.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(i,{width:"narrow",context:"standalone"});case"cccccc":return r.day(i,{width:"short",context:"standalone"});case"cccc":default:return r.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,r){const n=e.getDay(),i=n===0?7:n;switch(t){case"i":return String(i);case"ii":return Cr(i,t.length);case"io":return r.ordinalNumber(i,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,r){const n=e.getHours();let i;switch(n===12?i=pd.noon:n===0?i=pd.midnight:i=n/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,r){const n=e.getHours();let i;switch(n>=17?i=pd.evening:n>=12?i=pd.afternoon:n>=4?i=pd.morning:i=pd.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,r){if(t==="ho"){let n=e.getHours()%12;return n===0&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return bl.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getHours(),{unit:"hour"}):bl.H(e,t)},K:function(e,t,r){const n=e.getHours()%12;return t==="Ko"?r.ordinalNumber(n,{unit:"hour"}):Cr(n,t.length)},k:function(e,t,r){let n=e.getHours();return n===0&&(n=24),t==="ko"?r.ordinalNumber(n,{unit:"hour"}):Cr(n,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):bl.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getSeconds(),{unit:"second"}):bl.s(e,t)},S:function(e,t){return bl.S(e,t)},X:function(e,t,r){const n=e.getTimezoneOffset();if(n===0)return"Z";switch(t){case"X":return K2(n);case"XXXX":case"XX":return Du(n);case"XXXXX":case"XXX":default:return Du(n,":")}},x:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"x":return K2(n);case"xxxx":case"xx":return Du(n);case"xxxxx":case"xxx":default:return Du(n,":")}},O:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+W2(n,":");case"OOOO":default:return"GMT"+Du(n,":")}},z:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+W2(n,":");case"zzzz":default:return"GMT"+Du(n,":")}},t:function(e,t,r){const n=Math.trunc(e.getTime()/1e3);return Cr(n,t.length)},T:function(e,t,r){const n=e.getTime();return Cr(n,t.length)}};function W2(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=Math.trunc(n/60),o=n%60;return o===0?r+String(i):r+String(i)+t+Cr(o,2)}function K2(e,t){return e%60===0?(e>0?"-":"+")+Cr(Math.abs(e)/60,2):Du(e,t)}function Du(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=Cr(Math.trunc(n/60),2),o=Cr(n%60,2);return r+i+t+o}const G2=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},kV=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Kve=(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],i=r[2];if(!i)return G2(e,t);let o;switch(n){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",G2(n,t)).replace("{{time}}",kV(i,t))},Gve={p:kV,P:Kve},Qve=/^D+$/,Yve=/^Y+$/,Xve=["D","DD","YY","YYYY"];function Jve(e){return Qve.test(e)}function Zve(e){return Yve.test(e)}function ege(e,t,r){const n=tge(e,t,r);if(console.warn(n),Xve.includes(e))throw new RangeError(n)}function tge(e,t,r){const n=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function rge(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function nge(e){if(!rge(e)&&typeof e!="number")return!1;const t=ba(e);return!isNaN(Number(t))}const ige=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,oge=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,age=/^'([^]*?)'?$/,sge=/''/g,lge=/[a-zA-Z]/;function uge(e,t,r){var f,p,m,g;const n=lw(),i=n.locale??Nve,o=n.firstWeekContainsDate??((p=(f=n.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,a=n.weekStartsOn??((g=(m=n.locale)==null?void 0:m.options)==null?void 0:g.weekStartsOn)??0,l=ba(e);if(!nge(l))throw new RangeError("Invalid time value");let c=t.match(oge).map(b=>{const y=b[0];if(y==="p"||y==="P"){const w=Gve[y];return w(b,i.formatLong)}return b}).join("").match(ige).map(b=>{if(b==="''")return{isToken:!1,value:"'"};const y=b[0];if(y==="'")return{isToken:!1,value:cge(b)};if(H2[y])return{isToken:!0,value:b};if(y.match(lge))throw new RangeError("Format string contains an unescaped latin alphabet character `"+y+"`");return{isToken:!1,value:b}});i.localize.preprocessor&&(c=i.localize.preprocessor(l,c));const d={firstWeekContainsDate:o,weekStartsOn:a,locale:i};return c.map(b=>{if(!b.isToken)return b.value;const y=b.value;(Zve(y)||Jve(y))&&ege(y,t,String(e));const w=H2[y[0]];return w(l,y,i.localize,d)}).join("")}function cge(e){const t=e.match(age);return t?t[1].replace(sge,"'"):e}class dge{constructor(t,r){Pe(this,"index",0);this.projectPageModel=t,this.childBranch=r,st(this)}get id(){return this.childBranch.branchName}get children(){return[]}get disabled(){return!1}get icon(){return In.Child}get dataTestId(){return`revision-child-branch-${this.childBranch.branchName}`}get link(){return ao(`/${Fl}/${Ll}/${Bl}/${Vl}/-/${this.childBranch.revisionStartId}`,{organizationId:this.projectPageModel.organization.id,projectName:this.projectPageModel.project.name,branchName:this.childBranch.branchName})}get tooltip(){return[`Branch: ${this.childBranch.branchName}`]}get hidden(){return!1}}class md{constructor(t,r,n){Pe(this,"index",0);this.projectPageModel=t,this.linkMaker=r,this.revision=n,st(this)}get id(){return this.revision.id}get isThereEndpoint(){return!!this.revision.endpoints.length}get children(){return this.revision.childBranches.map(t=>new dge(this.projectPageModel,t))}get disabled(){return this.revision.id===this.projectPageModel.revisionOrThrow.id}get icon(){return this.checkIsHeadRevision()?In.Head:this.checkIsStartRevision()?In.Start:this.checkIsDraftRevision()?In.Draft:In.Revision}get dataTestId(){return this.checkIsHeadRevision()?"revision-head":this.checkIsStartRevision()?"revision-start":this.checkIsDraftRevision()?"revision-draft":`revision_index_${this.index}`}get link(){return this.linkMaker.make(this.revisionLinkOption)}get tooltip(){if(this.checkIsDraftRevision())return["Draft revision"];const t=this.revision.comment?[this.revision.comment]:[],r=uge(new Date(this.revision.createdAt),"dd MMM yyyy, HH:mm:ss"),n=[...t,this.revision.id,r],i=this.revision.endpoints.map(o=>`${EV(o.type)}`);return i.length&&(n.push("".padEnd(25,"-")),n.push("Active endpoints:"),n.push(i.join(", "))),this.checkIsHeadRevision()&&n.unshift("Head revision:"),this.checkIsStartRevision()&&n.unshift("Init revision:"),n}get hidden(){return!1}get revisionLinkOption(){return this.checkIsHeadRevision()?{isHead:!0}:this.checkIsDraftRevision()?{isDraft:!0}:{id:this.revision.id}}checkIsStartRevision(){return this.projectPageModel.branchOrThrow.start.id===this.revision.id}checkIsDraftRevision(){return this.projectPageModel.branchOrThrow.draft.id===this.revision.id}checkIsHeadRevision(){return this.projectPageModel.branchOrThrow.head.id===this.revision.id}}class fge{constructor(t){Pe(this,"index",0);this.revision=t,st(this)}get id(){return this.revision.id}get children(){return[]}get disabled(){return!1}get icon(){return In.NextPage}get dataTestId(){return"revision-next-page"}get link(){return""}get tooltip(){return["Next page"]}get hidden(){return!1}}class hge{constructor(t,r){Pe(this,"index",0);this.projectPageModel=t,this.parentBranch=r,st(this)}get id(){return this.parentBranch.branchName}get children(){return[]}get disabled(){return!1}get icon(){return In.Parent}get dataTestId(){return`revision-parent-branch-${this.parentBranch.branchName}`}get link(){return ao(`/${Fl}/${Ll}/${Bl}/${Vl}/-/${this.parentBranch.fromRevisionId}`,{organizationId:this.projectPageModel.organization.id,projectName:this.projectPageModel.project.name,branchName:this.parentBranch.branchName})}get tooltip(){return[`Branch: ${this.parentBranch.branchName}`]}get hidden(){return!1}}class pge{constructor(t){Pe(this,"index",0);this.revision=t,st(this)}get id(){return this.revision.id}get children(){return[]}get disabled(){return!1}get icon(){return In.PreviousPage}get dataTestId(){return"revision-previous-page"}get link(){return""}get tooltip(){return["Previous page"]}get hidden(){return!1}}class mge{constructor(t,r,n){this.projectPageModel=t,this.linkMaker=r,this.middleRevisions=n,st(this,{},{autoBind:!0})}get items(){const t=[];this.branch.parentBranch&&t.push(this.createParentBranchItem(this.branch.parentBranch)),this.shouldAddStartRevision()&&t.push(this.createStartItem());const r=this.middleRevisions.data.slice(),n=r.shift(),i=r.pop();n&&t.push(this.createFirstMiddleItem(n));for(const o of r)t.push(this.createMiddleItem(o));return i&&t.push(this.createLastMiddleItem(i)),t.push(this.createHeadItem()),this.branch.touched&&t.push(this.createDraftItem()),t.length===1&&!this.branch.head.tablesConnection.totalCount?[]:(t.forEach((o,a)=>{o.index=a}),t)}get branch(){return this.projectPageModel.branchOrThrow}createParentBranchItem(t){return new hge(this.projectPageModel,t)}createStartItem(){return new md(this.projectPageModel,this.linkMaker,this.branch.start)}createFirstMiddleItem(t){return t.parent===this.branch.start?new md(this.projectPageModel,this.linkMaker,t):new pge(t)}createMiddleItem(t){return new md(this.projectPageModel,this.linkMaker,t)}createLastMiddleItem(t){return t.child===this.branch.head?new md(this.projectPageModel,this.linkMaker,t):new fge(t)}createHeadItem(){return new md(this.projectPageModel,this.linkMaker,this.branch.head)}createDraftItem(){return new md(this.projectPageModel,this.linkMaker,this.branch.draft)}shouldAddStartRevision(){return this.branch.start!==this.branch.head}}const O_=8;class vge{constructor(t,r){Pe(this,"data",[]);Pe(this,"currentDefaultMaxItems",O_);this.projectPageModel=t,this.middleRevisionsFinder=r,st(this)}get branch(){return this.projectPageModel.branchOrThrow}select({desiredRevision:t,priority:r}){this.shouldResetDefaultMaxItems(t)&&this.resetDefaultMaxItems(),this.isNoChangesForDefaultBranch()&&(this.data=[]);const n=[];if(this.shouldAddMiddleRevisions()){const i=this.middleRevisionsFinder.find({targetRevision:this.getTargetRevision(t),priority:r,maxItems:this.currentDefaultMaxItems});n.push(...i)}this.data=n}resetDefaultMaxItems(){this.currentDefaultMaxItems=O_}increaseMaxItemsForNewRevision(){this.currentDefaultMaxItems=O_+1}isNoChangesForDefaultBranch(){return!this.branch.parentBranch&&this.branch.start===this.branch.head&&!this.branch.touched}shouldAddMiddleRevisions(){return this.branch.start!==this.branch.head&&this.branch.start.child!==this.branch.head}getTargetRevision(t){return t===this.branch.start?this.branch.start.child:t===this.branch.head||t===this.branch.draft?this.branch.head.parent:t}shouldResetDefaultMaxItems(t){return t!==this.branch.head}}const gge=()=>{const e=Tc(),t=Zn(),[r]=O.useState(()=>{const n=new ive(t),i=new vge(t,n),o=new mge(t,e,i),a=new rve(t);return new nve(ct.cache,t,o,i,a)});return O.useEffect(()=>(r.init(),()=>r.dispose()),[r]),r},yge=e=>{switch(e){case In.Child:return x.jsx(Mce,{size:"24"});case In.Draft:return x.jsx(zce,{size:"24"});case In.Start:return x.jsx(P2,{size:"24"});case In.Head:return x.jsx(qce,{size:"24"});case In.Revision:return x.jsx(P2,{size:"24"});case In.Parent:return x.jsx(Nce,{size:"24"});case In.PreviousPage:return x.jsx(x2,{size:"24"});case In.NextPage:return x.jsx(x2,{size:"24"})}},jV=Ot(({data:e,onClick:t})=>{const[r,n]=O.useState(!1),i=O.useCallback(async()=>{IP.includes(e.icon)?(n(!0),await(t==null?void 0:t()),n(!1)):t==null||t()},[e.icon,t]);return x.jsx(OF,{textAlign:"center",label:x.jsx(Bp,{children:e.tooltip.map((o,a)=>x.jsx("span",{children:o},a))}),openDelay:750,children:x.jsxs(wt,{position:"relative",children:[x.jsx(Ci,{"data-testid":e.dataTestId,isLoading:r,onClick:i,_disabled:r?{opacity:.2}:{opacity:1},_hover:e.disabled?{opacity:1}:{opacity:.4},"aria-label":"",icon:yge(e.icon),isDisabled:e.disabled,opacity:IP.includes(e.icon)?.7:.2,variant:"ghost"}),e.isThereEndpoint&&x.jsx(wt,{position:"absolute",right:"0px",top:"0px",opacity:"0.4",children:x.jsx(Uce,{})})]})})}),Q2=Ot(({data:e})=>x.jsx(qo,{to:e.link,children:x.jsx(jV,{data:e})})),Y2=({data:e,onSelect:t})=>{const r=O.useCallback(async()=>{await t(e.id)},[e.id,t]);return x.jsx(jV,{data:e,onClick:r})},bge=Ot(({endpointSlot:e})=>{const t=gge();return t.items.length?x.jsxs(je,{alignItems:"flex-start",justifyContent:"space-between",paddingBottom:"1rem",children:[x.jsx(je,{flexDirection:"column",flex:1,gap:"1rem",children:x.jsx(je,{"data-testid":"revision-endpoint-widget",children:t.items.map((r,n)=>x.jsxs(Re.Fragment,{children:[x.jsxs(je,{alignItems:"center",flexDirection:"column",children:[r.icon===In.PreviousPage&&x.jsx(Y2,{data:r,onSelect:t.previousPage}),r.icon===In.NextPage&&x.jsx(Y2,{data:r,onSelect:t.nextPage}),!IP.includes(r.icon)&&x.jsx(Q2,{data:r}),r.children.length?x.jsx(Fce,{opacity:"0.15"}):null,r.children.map(i=>x.jsx(Q2,{data:i},i.id))]}),n!==t.items.length-1&&x.jsx(je,{alignItems:"center",height:"40px",children:x.jsx(Lce,{opacity:"0.15"})})]},r.id))})}),x.jsx(je,{children:e})]}):null}),wge=()=>x.jsx(wt,{className:TV.Root,children:x.jsx(bge,{endpointSlot:x.jsx(tve,{})})});class Sge{constructor(t){this.projectPageModel=t,st(this)}get hasNextPage(){return this.project.branchesConnection.availableNextPage}get organizationId(){return this.organization.id}get projectName(){return this.project.name}get items(){return this.project.branchesConnection.edges.map(({node:t})=>{var n;const r=t.name===((n=this.branch)==null?void 0:n.name);return{id:t.id,name:t.name,link:r?"":`${xge(this.organizationId,this.projectName,t.name)}${_ge(t)}`,title:`${t.name}`,isActive:r,touched:t.touched}})}init(){}dispose(){}get organization(){return this.projectPageModel.organization}get project(){return this.projectPageModel.project}get branch(){return this.projectPageModel.branch}}const _ge=e=>e.touched?ao(`/${X0}`):"",xge=(e,t,r)=>ao(`/${Fl}/${Ll}/${Bl}/${Vl}`,{organizationId:e,projectName:t,branchName:r}),Pge=()=>{const e=Zn(),[t]=O.useState(()=>new Sge(e));return O.useEffect(()=>(t.init(),()=>{t.dispose()}),[t]),t},Cge=Ot(()=>{const e=Pge();return x.jsxs(Bp,{alignItems:"flex-start",gap:"1rem",children:[x.jsx(qo,{to:"/",children:x.jsx(Lo,{variant:"link","data-testid":"sidebar-back-to-projects-button",children:x.jsx(rF,{color:"gray",size:"md",children:x.jsx("b",{children:e.projectName})})})}),x.jsxs(Bp,{alignItems:"flex-start",borderTop:"1px solid",borderTopColor:"gray.100",gap:"0.25rem",pb:"1rem",pt:"1rem",width:"100%",children:[x.jsx(bt,{color:"gray",fontSize:"sm",mb:"0.5rem",children:"Branches:"}),e.items.map(t=>x.jsxs(je,{_hover:t.isActive?{}:{backgroundColor:"gray.200"},alignItems:"center",backgroundColor:t.isActive?"gray.100":void 0,borderRadius:"0.25rem",height:"32px",paddingLeft:"0.5rem",width:"100%",children:[t.isActive?x.jsx(bt,{color:"gray.500",fontWeight:"600",children:t.title}):x.jsx(Lo,{minWidth:0,variant:"link",children:x.jsx(bt,{children:x.jsx(qo,{to:t.link,"data-testid":`sidebar-branch-${t.name}`,children:t.title},t.id)})}),t.touched&&x.jsx(bt,{color:"gray.600",children:"*"})]},t.id))]})]})});class Ege{constructor(t,r){this.projectPageModel=t,this.linkMaker=r,st(this)}get hasNextPage(){return this.project.branchesConnection.availableNextPage}get items(){return this.revision.tablesConnection.edges.map(({node:t})=>{var n;const r=t.id===((n=this.table)==null?void 0:n.id);return{id:t.id,versionId:t.versionId,link:r?"":`${this.linkMaker.currentBaseLink}/${t.id}`,isActive:r,touched:!t.readonly}})}get project(){return this.projectPageModel.project}get revision(){return this.projectPageModel.revisionOrThrow}get table(){return this.projectPageModel.table}init(){}dispose(){}}const Tge=()=>{const e=Zn(),t=Tc(),[r]=O.useState(()=>new Ege(e,t));return O.useEffect(()=>(r.init(),()=>{r.dispose()}),[r]),r},Oge=Ot(()=>{const e=Tge();return x.jsxs(Bp,{alignItems:"flex-start",gap:"0.25rem",width:"100%",children:[x.jsx(bt,{color:"gray",fontSize:"sm",mb:"0.5rem",children:"Tables:"}),e.items.map(t=>x.jsxs(je,{_hover:{backgroundColor:"gray.200"},alignItems:"center",backgroundColor:t.isActive?"gray.100":void 0,borderRadius:"0.25rem",height:"32px",paddingLeft:"0.5rem",paddingRight:"0.5rem",width:"100%",children:[t.isActive?x.jsx(bt,{color:"gray.500",fontWeight:"600",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:t.id}):x.jsx(Lo,{minWidth:0,variant:"link",children:x.jsx(bt,{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:x.jsx(qo,{to:t.link,"data-testid":`sidebar-table-${t.id}`,children:t.id},t.id)})}),t.touched&&x.jsx(bt,{color:"gray.600",children:"*"})]},t.versionId))]})}),Rge=Ot(()=>{const e=Zn();return x.jsxs(x.Fragment,{children:[x.jsx(wt,{minHeight:"120px",children:x.jsx(Cge,{})}),e.table&&x.jsx(wt,{borderTop:"1px solid",borderTopColor:"gray.100",paddingTop:"1rem",children:x.jsx(Oge,{})})]})}),Ige=Ot(()=>(cme(),x.jsx($f,{actions:x.jsx(kme,{}),sidebar:x.jsx(Rge,{}),title:x.jsx(Mme,{}),children:x.jsxs(je,{flex:1,flexDirection:"column",gap:"1rem",children:[x.jsx(wge,{}),x.jsx(je,{flexDirection:"column",gap:"0.5rem",flex:1,children:x.jsx(Ib,{})})]})})));class kP{constructor(t,r,n){Pe(this,"isLoading",!1);this.authService=t,this.routerService=r,this.apiService=n,st(this)}async confirmEmailCode(t){t?(await this.request(t),await this.routerService.navigate(UE)):console.error("Invalid code")}init(){}dispose(){}async request(t){this.setIsLoading(!0);try{const r=await this.apiService.client.confirmEmailCode({data:{code:t}});return await this.authService.setToken(r.confirmEmailCode.accessToken),!0}catch(r){console.error(r)}finally{this.setIsLoading(!1)}}setIsLoading(t){this.isLoading=t}}dt.register(kP,()=>{const e=dt.get(qi),t=dt.get(Us),r=dt.get(es);return new kP(e,t,r)},{scope:"request"});const kge=Ot(()=>{const[e]=Yae({code:""}),t=Df(kP);return O.useEffect(()=>{t.confirmEmailCode(e.get("code"))},[t,e]),t.isLoading?x.jsx(LC,{w:"100%",h:"100%",children:x.jsx(Rm,{})}):null}),jge=()=>null;class jP{constructor(t,r,n){Pe(this,"isLoading",!1);this.routerService=t,this.apiService=r,this.authService=n,st(this)}async login(t){t?(await this.loginRequest(t),await this.routerService.navigate("/")):console.error("Invalid code")}dispose(){}init(){}async loginRequest(t){this.setIsLoading(!0);try{const r=await this.apiService.client.loginGithub({data:{code:t}});return await this.authService.setToken(r.loginGithub.accessToken),!0}catch(r){console.error(r)}finally{this.setIsLoading(!1)}}setIsLoading(t){this.isLoading=t}}dt.register(jP,()=>{const e=dt.get(Us),t=dt.get(es),r=dt.get(qi);return new jP(e,t,r)},{scope:"request"});const $ge=async({request:e})=>{const n=new URL(e.url).searchParams.get("code");if(!n)throw new Error("Invalid code");return await dt.get(jP).login(n),hf("/")},Age=Ne`
|
1339
|
+
`,Wme=async e=>{const t=await xr.mutate({mutation:Hme,variables:e});if(!t.data)throw t.errors;return t.data};class Kme{constructor(t,r){this.projectPageModel=t,this.endpointId=r}get revision(){return this.projectPageModel.revisionOrThrow}async execute(){const t=await this.deleteEndpointRequest();return this.updateRevision(),t}async deleteEndpointRequest(){return(await Wme({data:{endpointId:this.endpointId}})).deleteEndpoint}updateRevision(){this.revision.removeEndpoint(this.endpointId)}}const Gme=Oy("REACT_APP_ENDPOINT_SERVER_URL"),Qme={[zs.GRAPHQL]:"graphql",[zs.REST_API]:"swagger"};class Yme{constructor(t,r){this.projectPageModel=t,this.endpointType=r,st(this,{},{autoBind:!0})}get href(){if(!this.endpoint)return;const t=`${this.baseUrl}/${this.organization.id}/${this.project.name}/${this.branch.name}`;return this.projectPageModel.isDraftRevision?`${t}/draft`:this.projectPageModel.isHeadRevision?`${t}/head`:`${t}/${this.revision.id}`}async switch(){try{return this.endpoint?await new Kme(this.projectPageModel,this.endpoint.id).execute():new Ume(ct,this.projectPageModel,this.endpointType).execute()}catch(t){console.log(t)}}init(){}dispose(){}get endpoint(){return this.revision.endpoints.find(t=>t.type===this.endpointType)}get organization(){return this.projectPageModel.organization}get project(){return this.projectPageModel.project}get branch(){return this.projectPageModel.branchOrThrow}get revision(){return this.projectPageModel.revisionOrThrow}get baseUrl(){return`${Gme}/${Qme[this.endpointType]}`}}const Xme=e=>{const t=Zn(),[r]=O.useState(()=>new Yme(t,e));return O.useEffect(()=>(r.init(),()=>r.dispose()),[r]),r},Jme={[zs.GRAPHQL]:x.jsx(Lme,{size:20}),[zs.REST_API]:x.jsx(Bme,{size:20})},zA=Ot(({type:e})=>{const t=Xme(e);return x.jsxs(je,{alignItems:"center",gap:"0.5rem",minWidth:"90px",height:"25px",children:[x.jsx(wt,{color:t.href?"gray.400":"gray.300",children:Jme[e]}),x.jsx(bt,{width:"140px",color:"gray.400",children:EV(e)}),x.jsxs(je,{width:"120px",gap:"0.5rem",alignItems:"center",children:[x.jsx(EF,{"data-testid":`endpoint-switch-${e}`,colorScheme:"gray",isChecked:!!t.href,onChange:t.switch}),t.href&&x.jsx(Cf,{isExternal:!0,href:t.href,children:x.jsx(Lo,{"data-testid":`endpoint-button-${e}`,size:"sm","aria-label":"removeRow",color:"gray.500",isDisabled:!t.href,variant:"ghost",padding:0,minWidth:"20px",minHeight:"20px",height:"20px",paddingBottom:"3px",children:x.jsx(Kce,{size:"20px"})})})]})]})}),Zme="_Root_t8kot_1",eve="_Action_t8kot_1",TV={Root:Zme,Action:eve},tve=Ot(()=>{const{onOpen:e,onClose:t,isOpen:r}=Z4(),n=Fme();return x.jsxs(ZC,{trigger:"click",isOpen:r,onOpen:e,onClose:t,children:[x.jsx(JC,{children:x.jsx(Ci,{"data-testid":"revision-endpoint-button",className:r?void 0:TV.Action,"aria-label":"",icon:n.isThereEndpoint?x.jsx(Hce,{size:"24"}):x.jsx(Wce,{size:"24"}),opacity:.5,_hover:{opacity:1},variant:"ghost"})}),x.jsxs(tE,{maxWidth:"240px",children:[x.jsx(xF,{}),x.jsx(eE,{children:x.jsxs(je,{flexDirection:"column",gap:"1rem",children:[x.jsx(zA,{type:zs.GRAPHQL}),x.jsx(zA,{type:zs.REST_API})]})}),x.jsx(CF,{justifyContent:"center",children:x.jsx(bt,{color:"gray.400",opacity:"0.7",fontSize:"xs",as:"samp",children:n.branchTitle})})]})]})});var In=(e=>(e.Revision="Revision",e.Parent="Parent",e.Draft="Draft",e.Start="Start",e.Head="Head",e.Child="Child",e.PreviousPage="PreviousPage",e.NextPage="NextPage",e))(In||{});const IP=["PreviousPage","NextPage"];class rve{constructor(t){this.projectPageModel=t,st(this)}async queryNextPage(t){t.getChildrenDetails(Mo).isAllLoaded||await ct.queryRevisions({branch:this.branchVariables,revisions:{first:Mo,after:t.id}})}async queryPreviousPage(t){t.getParentsDetails(Mo).isAllLoaded||await ct.queryRevisions({branch:this.branchVariables,revisions:{first:Mo,before:t.id}})}get branchVariables(){return{organizationId:this.projectPageModel.organization.id,projectName:this.projectPageModel.project.name,branchName:this.projectPageModel.branchOrThrow.name}}}var Il=(e=>(e.None="None",e.Left="Left",e.Right="Right",e))(Il||{});class nve{constructor(t,r,n,i,o){Pe(this,"disposers",[]);this.cache=t,this.projectPageModel=r,this.revisionsCardItemsModel=n,this.middleRevisions=i,this.revisionsPageQueries=o,st(this,{},{autoBind:!0}),this.updateWithDesiredCurrentRevision()}get items(){return this.revisionsCardItemsModel.items}get branch(){return this.projectPageModel.branchOrThrow}get revision(){return this.projectPageModel.revisionOrThrow}init(){this.middleRevisions.resetDefaultMaxItems(),this.disposers.push(Ya(()=>this.projectPageModel.branch,this.onSelectBranch)),this.disposers.push(Ya(()=>{var t;return(t=this.projectPageModel.branch)==null?void 0:t.head},this.onCreatedNewRevision)),this.disposers.push(Ya(()=>this.projectPageModel.revision,this.onSelectRevision))}dispose(){for(const t of this.disposers)t();this.disposers=[]}async previousPage(t){var n;const r=(n=this.cache.revision.get(t))==null?void 0:n.child;if(!r)throw new Error(`Not found revision ${t}`);await this.revisionsPageQueries.queryPreviousPage(r),this.middleRevisions.select({desiredRevision:r,priority:Il.Left})}async nextPage(t){var n;const r=(n=this.cache.revision.get(t))==null?void 0:n.parent;if(!r)throw new Error(`Not found revision ${t}`);await this.revisionsPageQueries.queryNextPage(r),this.middleRevisions.select({desiredRevision:r,priority:Il.Right})}updateWithDesiredCurrentRevision(){this.middleRevisions.select({desiredRevision:this.revision,priority:Il.None})}onSelectBranch(){this.dispose(),this.init(),this.updateWithDesiredCurrentRevision()}onCreatedNewRevision(){this.middleRevisions.increaseMaxItemsForNewRevision(),this.middleRevisions.select({desiredRevision:this.branch.head,priority:Il.None})}onSelectRevision(t){(t===this.branch.start||t===this.branch.head||t===this.branch.draft)&&this.middleRevisions.select({desiredRevision:t,priority:Il.None})}}class ive{constructor(t){this.projectPageModel=t}get branch(){return this.projectPageModel.branchOrThrow}find({targetRevision:t,priority:r,maxItems:n}){const i=[],{rawRightPartRevisions:o,rawLeftPartRevisions:a}=this.getParts({targetRevision:t,priority:r,maxItems:n});return i.push(...a),i.push(t),i.push(...o),i}getParts({targetRevision:t,priority:r,maxItems:n}){const i=this.getLeftPartRevisions({targetRevision:t,maxLength:n+1}),o=this.getRightPartRevisions({targetRevision:t,maxLength:n+1}),a=[],l=[],c=i.slice(),d=o.slice().reverse();let f=0;for(;f<n;){const p=r===Il.Right&&d.length&&a.length>0?void 0:c.pop();if(p&&(a.unshift(p),f+=1),f>=n)break;const m=r===Il.Left&&c.length&&l.length>0?void 0:d.pop();if(m&&(l.push(m),f+=1),!c.length&&!d.length)break}return{rawLeftPartRevisions:a,rawRightPartRevisions:l}}getLeftPartRevisions({targetRevision:t,maxLength:r}){const n=[];if(t!==this.branch.start&&t.parent!==this.branch.start){let i=t.parent;for(;i&&(i!==this.branch.head&&n.push(i),i=i.parent,!(this.branch.start===i||n.length>=r)););}return n.reverse()}getRightPartRevisions({targetRevision:t,maxLength:r}){const n=[];if(t!==this.branch.head&&t!==this.branch.draft&&t.child!==this.branch.head){let i=t.child;for(;i&&(n.push(i),i=i.child,!(this.branch.head===i||n.length>=r)););}return n}}const ove={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},ave=(e,t,r)=>{let n;const i=ove[e];return typeof i=="string"?n=i:t===1?n=i.one:n=i.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function T_(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const sve={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},lve={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},uve={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},cve={date:T_({formats:sve,defaultWidth:"full"}),time:T_({formats:lve,defaultWidth:"full"}),dateTime:T_({formats:uve,defaultWidth:"full"})},dve={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},fve=(e,t,r,n)=>dve[e];function Nh(e){return(t,r)=>{const n=r!=null&&r.context?String(r.context):"standalone";let i;if(n==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,l=r!=null&&r.width?String(r.width):a;i=e.formattingValues[l]||e.formattingValues[a]}else{const a=e.defaultWidth,l=r!=null&&r.width?String(r.width):e.defaultWidth;i=e.values[l]||e.values[a]}const o=e.argumentCallback?e.argumentCallback(t):t;return i[o]}}const hve={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},pve={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},mve={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},vve={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},gve={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},yve={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},bve=(e,t)=>{const r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},wve={ordinalNumber:bve,era:Nh({values:hve,defaultWidth:"wide"}),quarter:Nh({values:pve,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Nh({values:mve,defaultWidth:"wide"}),day:Nh({values:vve,defaultWidth:"wide"}),dayPeriod:Nh({values:gve,defaultWidth:"wide",formattingValues:yve,defaultFormattingWidth:"wide"})};function Fh(e){return(t,r={})=>{const n=r.width,i=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;const a=o[0],l=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?_ve(l,p=>p.test(a)):Sve(l,p=>p.test(a));let d;d=e.valueCallback?e.valueCallback(c):c,d=r.valueCallback?r.valueCallback(d):d;const f=t.slice(a.length);return{value:d,rest:f}}}function Sve(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function _ve(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}function xve(e){return(t,r={})=>{const n=t.match(e.matchPattern);if(!n)return null;const i=n[0],o=t.match(e.parsePattern);if(!o)return null;let a=e.valueCallback?e.valueCallback(o[0]):o[0];a=r.valueCallback?r.valueCallback(a):a;const l=t.slice(i.length);return{value:a,rest:l}}}const Pve=/^(\d+)(th|st|nd|rd)?/i,Cve=/\d+/i,Eve={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Tve={any:[/^b/i,/^(a|c)/i]},Ove={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Rve={any:[/1/i,/2/i,/3/i,/4/i]},Ive={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},kve={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},jve={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},$ve={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Ave={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Dve={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Mve={ordinalNumber:xve({matchPattern:Pve,parsePattern:Cve,valueCallback:e=>parseInt(e,10)}),era:Fh({matchPatterns:Eve,defaultMatchWidth:"wide",parsePatterns:Tve,defaultParseWidth:"any"}),quarter:Fh({matchPatterns:Ove,defaultMatchWidth:"wide",parsePatterns:Rve,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Fh({matchPatterns:Ive,defaultMatchWidth:"wide",parsePatterns:kve,defaultParseWidth:"any"}),day:Fh({matchPatterns:jve,defaultMatchWidth:"wide",parsePatterns:$ve,defaultParseWidth:"any"}),dayPeriod:Fh({matchPatterns:Ave,defaultMatchWidth:"any",parsePatterns:Dve,defaultParseWidth:"any"})},Nve={code:"en-US",formatDistance:ave,formatLong:cve,formatRelative:fve,localize:wve,match:Mve,options:{weekStartsOn:0,firstWeekContainsDate:1}};let Fve={};function lw(){return Fve}const OV=6048e5,Lve=864e5;function ba(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function qA(e){const t=ba(e);return t.setHours(0,0,0,0),t}function UA(e){const t=ba(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function Bve(e,t){const r=qA(e),n=qA(t),i=+r-UA(r),o=+n-UA(n);return Math.round((i-o)/Lve)}function fc(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function Vve(e){const t=ba(e),r=fc(e,0);return r.setFullYear(t.getFullYear(),0,1),r.setHours(0,0,0,0),r}function zve(e){const t=ba(e);return Bve(t,Vve(t))+1}function dm(e,t){var l,c,d,f;const r=lw(),n=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??r.weekStartsOn??((f=(d=r.locale)==null?void 0:d.options)==null?void 0:f.weekStartsOn)??0,i=ba(e),o=i.getDay(),a=(o<n?7:0)+o-n;return i.setDate(i.getDate()-a),i.setHours(0,0,0,0),i}function qb(e){return dm(e,{weekStartsOn:1})}function RV(e){const t=ba(e),r=t.getFullYear(),n=fc(e,0);n.setFullYear(r+1,0,4),n.setHours(0,0,0,0);const i=qb(n),o=fc(e,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);const a=qb(o);return t.getTime()>=i.getTime()?r+1:t.getTime()>=a.getTime()?r:r-1}function qve(e){const t=RV(e),r=fc(e,0);return r.setFullYear(t,0,4),r.setHours(0,0,0,0),qb(r)}function Uve(e){const t=ba(e),r=+qb(t)-+qve(t);return Math.round(r/OV)+1}function IV(e,t){var f,p,m,g;const r=ba(e),n=r.getFullYear(),i=lw(),o=(t==null?void 0:t.firstWeekContainsDate)??((p=(f=t==null?void 0:t.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??i.firstWeekContainsDate??((g=(m=i.locale)==null?void 0:m.options)==null?void 0:g.firstWeekContainsDate)??1,a=fc(e,0);a.setFullYear(n+1,0,o),a.setHours(0,0,0,0);const l=dm(a,t),c=fc(e,0);c.setFullYear(n,0,o),c.setHours(0,0,0,0);const d=dm(c,t);return r.getTime()>=l.getTime()?n+1:r.getTime()>=d.getTime()?n:n-1}function Hve(e,t){var l,c,d,f;const r=lw(),n=(t==null?void 0:t.firstWeekContainsDate)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??r.firstWeekContainsDate??((f=(d=r.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??1,i=IV(e,t),o=fc(e,0);return o.setFullYear(i,0,n),o.setHours(0,0,0,0),dm(o,t)}function Wve(e,t){const r=ba(e),n=+dm(r,t)-+Hve(r,t);return Math.round(n/OV)+1}function Cr(e,t){const r=e<0?"-":"",n=Math.abs(e).toString().padStart(t,"0");return r+n}const bl={y(e,t){const r=e.getFullYear(),n=r>0?r:1-r;return Cr(t==="yy"?n%100:n,t.length)},M(e,t){const r=e.getMonth();return t==="M"?String(r+1):Cr(r+1,2)},d(e,t){return Cr(e.getDate(),t.length)},a(e,t){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(e,t){return Cr(e.getHours()%12||12,t.length)},H(e,t){return Cr(e.getHours(),t.length)},m(e,t){return Cr(e.getMinutes(),t.length)},s(e,t){return Cr(e.getSeconds(),t.length)},S(e,t){const r=t.length,n=e.getMilliseconds(),i=Math.trunc(n*Math.pow(10,r-3));return Cr(i,t.length)}},pd={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},HA={G:function(e,t,r){const n=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if(t==="yo"){const n=e.getFullYear(),i=n>0?n:1-n;return r.ordinalNumber(i,{unit:"year"})}return bl.y(e,t)},Y:function(e,t,r,n){const i=IV(e,n),o=i>0?i:1-i;if(t==="YY"){const a=o%100;return Cr(a,2)}return t==="Yo"?r.ordinalNumber(o,{unit:"year"}):Cr(o,t.length)},R:function(e,t){const r=RV(e);return Cr(r,t.length)},u:function(e,t){const r=e.getFullYear();return Cr(r,t.length)},Q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return Cr(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return Cr(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){const n=e.getMonth();switch(t){case"M":case"MM":return bl.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){const n=e.getMonth();switch(t){case"L":return String(n+1);case"LL":return Cr(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){const i=Wve(e,n);return t==="wo"?r.ordinalNumber(i,{unit:"week"}):Cr(i,t.length)},I:function(e,t,r){const n=Uve(e);return t==="Io"?r.ordinalNumber(n,{unit:"week"}):Cr(n,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getDate(),{unit:"date"}):bl.d(e,t)},D:function(e,t,r){const n=zve(e);return t==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):Cr(n,t.length)},E:function(e,t,r){const n=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){const i=e.getDay(),o=(i-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return Cr(o,2);case"eo":return r.ordinalNumber(o,{unit:"day"});case"eee":return r.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(i,{width:"short",context:"formatting"});case"eeee":default:return r.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){const i=e.getDay(),o=(i-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return Cr(o,t.length);case"co":return r.ordinalNumber(o,{unit:"day"});case"ccc":return r.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(i,{width:"narrow",context:"standalone"});case"cccccc":return r.day(i,{width:"short",context:"standalone"});case"cccc":default:return r.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,r){const n=e.getDay(),i=n===0?7:n;switch(t){case"i":return String(i);case"ii":return Cr(i,t.length);case"io":return r.ordinalNumber(i,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,r){const n=e.getHours();let i;switch(n===12?i=pd.noon:n===0?i=pd.midnight:i=n/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,r){const n=e.getHours();let i;switch(n>=17?i=pd.evening:n>=12?i=pd.afternoon:n>=4?i=pd.morning:i=pd.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,r){if(t==="ho"){let n=e.getHours()%12;return n===0&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return bl.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getHours(),{unit:"hour"}):bl.H(e,t)},K:function(e,t,r){const n=e.getHours()%12;return t==="Ko"?r.ordinalNumber(n,{unit:"hour"}):Cr(n,t.length)},k:function(e,t,r){let n=e.getHours();return n===0&&(n=24),t==="ko"?r.ordinalNumber(n,{unit:"hour"}):Cr(n,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):bl.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getSeconds(),{unit:"second"}):bl.s(e,t)},S:function(e,t){return bl.S(e,t)},X:function(e,t,r){const n=e.getTimezoneOffset();if(n===0)return"Z";switch(t){case"X":return KA(n);case"XXXX":case"XX":return Du(n);case"XXXXX":case"XXX":default:return Du(n,":")}},x:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"x":return KA(n);case"xxxx":case"xx":return Du(n);case"xxxxx":case"xxx":default:return Du(n,":")}},O:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+WA(n,":");case"OOOO":default:return"GMT"+Du(n,":")}},z:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+WA(n,":");case"zzzz":default:return"GMT"+Du(n,":")}},t:function(e,t,r){const n=Math.trunc(e.getTime()/1e3);return Cr(n,t.length)},T:function(e,t,r){const n=e.getTime();return Cr(n,t.length)}};function WA(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=Math.trunc(n/60),o=n%60;return o===0?r+String(i):r+String(i)+t+Cr(o,2)}function KA(e,t){return e%60===0?(e>0?"-":"+")+Cr(Math.abs(e)/60,2):Du(e,t)}function Du(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=Cr(Math.trunc(n/60),2),o=Cr(n%60,2);return r+i+t+o}const GA=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},kV=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Kve=(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],i=r[2];if(!i)return GA(e,t);let o;switch(n){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",GA(n,t)).replace("{{time}}",kV(i,t))},Gve={p:kV,P:Kve},Qve=/^D+$/,Yve=/^Y+$/,Xve=["D","DD","YY","YYYY"];function Jve(e){return Qve.test(e)}function Zve(e){return Yve.test(e)}function ege(e,t,r){const n=tge(e,t,r);if(console.warn(n),Xve.includes(e))throw new RangeError(n)}function tge(e,t,r){const n=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function rge(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function nge(e){if(!rge(e)&&typeof e!="number")return!1;const t=ba(e);return!isNaN(Number(t))}const ige=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,oge=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,age=/^'([^]*?)'?$/,sge=/''/g,lge=/[a-zA-Z]/;function uge(e,t,r){var f,p,m,g;const n=lw(),i=n.locale??Nve,o=n.firstWeekContainsDate??((p=(f=n.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,a=n.weekStartsOn??((g=(m=n.locale)==null?void 0:m.options)==null?void 0:g.weekStartsOn)??0,l=ba(e);if(!nge(l))throw new RangeError("Invalid time value");let c=t.match(oge).map(b=>{const y=b[0];if(y==="p"||y==="P"){const w=Gve[y];return w(b,i.formatLong)}return b}).join("").match(ige).map(b=>{if(b==="''")return{isToken:!1,value:"'"};const y=b[0];if(y==="'")return{isToken:!1,value:cge(b)};if(HA[y])return{isToken:!0,value:b};if(y.match(lge))throw new RangeError("Format string contains an unescaped latin alphabet character `"+y+"`");return{isToken:!1,value:b}});i.localize.preprocessor&&(c=i.localize.preprocessor(l,c));const d={firstWeekContainsDate:o,weekStartsOn:a,locale:i};return c.map(b=>{if(!b.isToken)return b.value;const y=b.value;(Zve(y)||Jve(y))&&ege(y,t,String(e));const w=HA[y[0]];return w(l,y,i.localize,d)}).join("")}function cge(e){const t=e.match(age);return t?t[1].replace(sge,"'"):e}class dge{constructor(t,r){Pe(this,"index",0);this.projectPageModel=t,this.childBranch=r,st(this)}get id(){return this.childBranch.branchName}get children(){return[]}get disabled(){return!1}get icon(){return In.Child}get dataTestId(){return`revision-child-branch-${this.childBranch.branchName}`}get link(){return ao(`/${Fl}/${Ll}/${Bl}/${Vl}/-/${this.childBranch.revisionStartId}`,{organizationId:this.projectPageModel.organization.id,projectName:this.projectPageModel.project.name,branchName:this.childBranch.branchName})}get tooltip(){return[`Branch: ${this.childBranch.branchName}`]}get hidden(){return!1}}class md{constructor(t,r,n){Pe(this,"index",0);this.projectPageModel=t,this.linkMaker=r,this.revision=n,st(this)}get id(){return this.revision.id}get isThereEndpoint(){return!!this.revision.endpoints.length}get children(){return this.revision.childBranches.map(t=>new dge(this.projectPageModel,t))}get disabled(){return this.revision.id===this.projectPageModel.revisionOrThrow.id}get icon(){return this.checkIsHeadRevision()?In.Head:this.checkIsStartRevision()?In.Start:this.checkIsDraftRevision()?In.Draft:In.Revision}get dataTestId(){return this.checkIsHeadRevision()?"revision-head":this.checkIsStartRevision()?"revision-start":this.checkIsDraftRevision()?"revision-draft":`revision_index_${this.index}`}get link(){return this.linkMaker.make(this.revisionLinkOption)}get tooltip(){if(this.checkIsDraftRevision())return["Draft revision"];const t=this.revision.comment?[this.revision.comment]:[],r=uge(new Date(this.revision.createdAt),"dd MMM yyyy, HH:mm:ss"),n=[...t,this.revision.id,r],i=this.revision.endpoints.map(o=>`${EV(o.type)}`);return i.length&&(n.push("".padEnd(25,"-")),n.push("Active endpoints:"),n.push(i.join(", "))),this.checkIsHeadRevision()&&n.unshift("Head revision:"),this.checkIsStartRevision()&&n.unshift("Init revision:"),n}get hidden(){return!1}get revisionLinkOption(){return this.checkIsHeadRevision()?{isHead:!0}:this.checkIsDraftRevision()?{isDraft:!0}:{id:this.revision.id}}checkIsStartRevision(){return this.projectPageModel.branchOrThrow.start.id===this.revision.id}checkIsDraftRevision(){return this.projectPageModel.branchOrThrow.draft.id===this.revision.id}checkIsHeadRevision(){return this.projectPageModel.branchOrThrow.head.id===this.revision.id}}class fge{constructor(t){Pe(this,"index",0);this.revision=t,st(this)}get id(){return this.revision.id}get children(){return[]}get disabled(){return!1}get icon(){return In.NextPage}get dataTestId(){return"revision-next-page"}get link(){return""}get tooltip(){return["Next page"]}get hidden(){return!1}}class hge{constructor(t,r){Pe(this,"index",0);this.projectPageModel=t,this.parentBranch=r,st(this)}get id(){return this.parentBranch.branchName}get children(){return[]}get disabled(){return!1}get icon(){return In.Parent}get dataTestId(){return`revision-parent-branch-${this.parentBranch.branchName}`}get link(){return ao(`/${Fl}/${Ll}/${Bl}/${Vl}/-/${this.parentBranch.fromRevisionId}`,{organizationId:this.projectPageModel.organization.id,projectName:this.projectPageModel.project.name,branchName:this.parentBranch.branchName})}get tooltip(){return[`Branch: ${this.parentBranch.branchName}`]}get hidden(){return!1}}class pge{constructor(t){Pe(this,"index",0);this.revision=t,st(this)}get id(){return this.revision.id}get children(){return[]}get disabled(){return!1}get icon(){return In.PreviousPage}get dataTestId(){return"revision-previous-page"}get link(){return""}get tooltip(){return["Previous page"]}get hidden(){return!1}}class mge{constructor(t,r,n){this.projectPageModel=t,this.linkMaker=r,this.middleRevisions=n,st(this,{},{autoBind:!0})}get items(){const t=[];this.branch.parentBranch&&t.push(this.createParentBranchItem(this.branch.parentBranch)),this.shouldAddStartRevision()&&t.push(this.createStartItem());const r=this.middleRevisions.data.slice(),n=r.shift(),i=r.pop();n&&t.push(this.createFirstMiddleItem(n));for(const o of r)t.push(this.createMiddleItem(o));return i&&t.push(this.createLastMiddleItem(i)),t.push(this.createHeadItem()),this.branch.touched&&t.push(this.createDraftItem()),t.length===1&&!this.branch.head.tablesConnection.totalCount?[]:(t.forEach((o,a)=>{o.index=a}),t)}get branch(){return this.projectPageModel.branchOrThrow}createParentBranchItem(t){return new hge(this.projectPageModel,t)}createStartItem(){return new md(this.projectPageModel,this.linkMaker,this.branch.start)}createFirstMiddleItem(t){return t.parent===this.branch.start?new md(this.projectPageModel,this.linkMaker,t):new pge(t)}createMiddleItem(t){return new md(this.projectPageModel,this.linkMaker,t)}createLastMiddleItem(t){return t.child===this.branch.head?new md(this.projectPageModel,this.linkMaker,t):new fge(t)}createHeadItem(){return new md(this.projectPageModel,this.linkMaker,this.branch.head)}createDraftItem(){return new md(this.projectPageModel,this.linkMaker,this.branch.draft)}shouldAddStartRevision(){return this.branch.start!==this.branch.head}}const O_=8;class vge{constructor(t,r){Pe(this,"data",[]);Pe(this,"currentDefaultMaxItems",O_);this.projectPageModel=t,this.middleRevisionsFinder=r,st(this)}get branch(){return this.projectPageModel.branchOrThrow}select({desiredRevision:t,priority:r}){this.shouldResetDefaultMaxItems(t)&&this.resetDefaultMaxItems(),this.isNoChangesForDefaultBranch()&&(this.data=[]);const n=[];if(this.shouldAddMiddleRevisions()){const i=this.middleRevisionsFinder.find({targetRevision:this.getTargetRevision(t),priority:r,maxItems:this.currentDefaultMaxItems});n.push(...i)}this.data=n}resetDefaultMaxItems(){this.currentDefaultMaxItems=O_}increaseMaxItemsForNewRevision(){this.currentDefaultMaxItems=O_+1}isNoChangesForDefaultBranch(){return!this.branch.parentBranch&&this.branch.start===this.branch.head&&!this.branch.touched}shouldAddMiddleRevisions(){return this.branch.start!==this.branch.head&&this.branch.start.child!==this.branch.head}getTargetRevision(t){return t===this.branch.start?this.branch.start.child:t===this.branch.head||t===this.branch.draft?this.branch.head.parent:t}shouldResetDefaultMaxItems(t){return t!==this.branch.head}}const gge=()=>{const e=Tc(),t=Zn(),[r]=O.useState(()=>{const n=new ive(t),i=new vge(t,n),o=new mge(t,e,i),a=new rve(t);return new nve(ct.cache,t,o,i,a)});return O.useEffect(()=>(r.init(),()=>r.dispose()),[r]),r},yge=e=>{switch(e){case In.Child:return x.jsx(Mce,{size:"24"});case In.Draft:return x.jsx(zce,{size:"24"});case In.Start:return x.jsx(PA,{size:"24"});case In.Head:return x.jsx(qce,{size:"24"});case In.Revision:return x.jsx(PA,{size:"24"});case In.Parent:return x.jsx(Nce,{size:"24"});case In.PreviousPage:return x.jsx(xA,{size:"24"});case In.NextPage:return x.jsx(xA,{size:"24"})}},jV=Ot(({data:e,onClick:t})=>{const[r,n]=O.useState(!1),i=O.useCallback(async()=>{IP.includes(e.icon)?(n(!0),await(t==null?void 0:t()),n(!1)):t==null||t()},[e.icon,t]);return x.jsx(OF,{textAlign:"center",label:x.jsx(Bp,{children:e.tooltip.map((o,a)=>x.jsx("span",{children:o},a))}),openDelay:750,children:x.jsxs(wt,{position:"relative",children:[x.jsx(Ci,{"data-testid":e.dataTestId,isLoading:r,onClick:i,_disabled:r?{opacity:.2}:{opacity:1},_hover:e.disabled?{opacity:1}:{opacity:.4},"aria-label":"",icon:yge(e.icon),isDisabled:e.disabled,opacity:IP.includes(e.icon)?.7:.2,variant:"ghost"}),e.isThereEndpoint&&x.jsx(wt,{position:"absolute",right:"0px",top:"0px",opacity:"0.4",children:x.jsx(Uce,{})})]})})}),QA=Ot(({data:e})=>x.jsx(qo,{to:e.link,children:x.jsx(jV,{data:e})})),YA=({data:e,onSelect:t})=>{const r=O.useCallback(async()=>{await t(e.id)},[e.id,t]);return x.jsx(jV,{data:e,onClick:r})},bge=Ot(({endpointSlot:e})=>{const t=gge();return t.items.length?x.jsxs(je,{alignItems:"flex-start",justifyContent:"space-between",paddingBottom:"1rem",children:[x.jsx(je,{flexDirection:"column",flex:1,gap:"1rem",children:x.jsx(je,{"data-testid":"revision-endpoint-widget",children:t.items.map((r,n)=>x.jsxs(Re.Fragment,{children:[x.jsxs(je,{alignItems:"center",flexDirection:"column",children:[r.icon===In.PreviousPage&&x.jsx(YA,{data:r,onSelect:t.previousPage}),r.icon===In.NextPage&&x.jsx(YA,{data:r,onSelect:t.nextPage}),!IP.includes(r.icon)&&x.jsx(QA,{data:r}),r.children.length?x.jsx(Fce,{opacity:"0.15"}):null,r.children.map(i=>x.jsx(QA,{data:i},i.id))]}),n!==t.items.length-1&&x.jsx(je,{alignItems:"center",height:"40px",children:x.jsx(Lce,{opacity:"0.15"})})]},r.id))})}),x.jsx(je,{children:e})]}):null}),wge=()=>x.jsx(wt,{className:TV.Root,children:x.jsx(bge,{endpointSlot:x.jsx(tve,{})})});class Sge{constructor(t){this.projectPageModel=t,st(this)}get hasNextPage(){return this.project.branchesConnection.availableNextPage}get organizationId(){return this.organization.id}get projectName(){return this.project.name}get items(){return this.project.branchesConnection.edges.map(({node:t})=>{var n;const r=t.name===((n=this.branch)==null?void 0:n.name);return{id:t.id,name:t.name,link:r?"":`${xge(this.organizationId,this.projectName,t.name)}${_ge(t)}`,title:`${t.name}`,isActive:r,touched:t.touched}})}init(){}dispose(){}get organization(){return this.projectPageModel.organization}get project(){return this.projectPageModel.project}get branch(){return this.projectPageModel.branch}}const _ge=e=>e.touched?ao(`/${X0}`):"",xge=(e,t,r)=>ao(`/${Fl}/${Ll}/${Bl}/${Vl}`,{organizationId:e,projectName:t,branchName:r}),Pge=()=>{const e=Zn(),[t]=O.useState(()=>new Sge(e));return O.useEffect(()=>(t.init(),()=>{t.dispose()}),[t]),t},Cge=Ot(()=>{const e=Pge();return x.jsxs(Bp,{alignItems:"flex-start",gap:"1rem",children:[x.jsx(qo,{to:"/",children:x.jsx(Lo,{variant:"link","data-testid":"sidebar-back-to-projects-button",children:x.jsx(rF,{color:"gray",size:"md",children:x.jsx("b",{children:e.projectName})})})}),x.jsxs(Bp,{alignItems:"flex-start",borderTop:"1px solid",borderTopColor:"gray.100",gap:"0.25rem",pb:"1rem",pt:"1rem",width:"100%",children:[x.jsx(bt,{color:"gray",fontSize:"sm",mb:"0.5rem",children:"Branches:"}),e.items.map(t=>x.jsxs(je,{_hover:t.isActive?{}:{backgroundColor:"gray.200"},alignItems:"center",backgroundColor:t.isActive?"gray.100":void 0,borderRadius:"0.25rem",height:"32px",paddingLeft:"0.5rem",width:"100%",children:[t.isActive?x.jsx(bt,{color:"gray.500",fontWeight:"600",children:t.title}):x.jsx(Lo,{minWidth:0,variant:"link",children:x.jsx(bt,{children:x.jsx(qo,{to:t.link,"data-testid":`sidebar-branch-${t.name}`,children:t.title},t.id)})}),t.touched&&x.jsx(bt,{color:"gray.600",children:"*"})]},t.id))]})]})});class Ege{constructor(t,r){this.projectPageModel=t,this.linkMaker=r,st(this)}get hasNextPage(){return this.project.branchesConnection.availableNextPage}get items(){return this.revision.tablesConnection.edges.map(({node:t})=>{var n;const r=t.id===((n=this.table)==null?void 0:n.id);return{id:t.id,versionId:t.versionId,link:r?"":`${this.linkMaker.currentBaseLink}/${t.id}`,isActive:r,touched:!t.readonly}})}get project(){return this.projectPageModel.project}get revision(){return this.projectPageModel.revisionOrThrow}get table(){return this.projectPageModel.table}init(){}dispose(){}}const Tge=()=>{const e=Zn(),t=Tc(),[r]=O.useState(()=>new Ege(e,t));return O.useEffect(()=>(r.init(),()=>{r.dispose()}),[r]),r},Oge=Ot(()=>{const e=Tge();return x.jsxs(Bp,{alignItems:"flex-start",gap:"0.25rem",width:"100%",children:[x.jsx(bt,{color:"gray",fontSize:"sm",mb:"0.5rem",children:"Tables:"}),e.items.map(t=>x.jsxs(je,{_hover:{backgroundColor:"gray.200"},alignItems:"center",backgroundColor:t.isActive?"gray.100":void 0,borderRadius:"0.25rem",height:"32px",paddingLeft:"0.5rem",paddingRight:"0.5rem",width:"100%",children:[t.isActive?x.jsx(bt,{color:"gray.500",fontWeight:"600",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:t.id}):x.jsx(Lo,{minWidth:0,variant:"link",children:x.jsx(bt,{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:x.jsx(qo,{to:t.link,"data-testid":`sidebar-table-${t.id}`,children:t.id},t.id)})}),t.touched&&x.jsx(bt,{color:"gray.600",children:"*"})]},t.versionId))]})}),Rge=Ot(()=>{const e=Zn();return x.jsxs(x.Fragment,{children:[x.jsx(wt,{minHeight:"120px",children:x.jsx(Cge,{})}),e.table&&x.jsx(wt,{borderTop:"1px solid",borderTopColor:"gray.100",paddingTop:"1rem",children:x.jsx(Oge,{})})]})}),Ige=Ot(()=>(cme(),x.jsx($f,{actions:x.jsx(kme,{}),sidebar:x.jsx(Rge,{}),title:x.jsx(Mme,{}),children:x.jsxs(je,{flex:1,flexDirection:"column",gap:"1rem",children:[x.jsx(wge,{}),x.jsx(je,{flexDirection:"column",gap:"0.5rem",flex:1,children:x.jsx(Ib,{})})]})})));class kP{constructor(t,r,n){Pe(this,"isLoading",!1);this.authService=t,this.routerService=r,this.apiService=n,st(this)}async confirmEmailCode(t){t?(await this.request(t),await this.routerService.navigate(UE)):console.error("Invalid code")}init(){}dispose(){}async request(t){this.setIsLoading(!0);try{const r=await this.apiService.client.confirmEmailCode({data:{code:t}});return await this.authService.setToken(r.confirmEmailCode.accessToken),!0}catch(r){console.error(r)}finally{this.setIsLoading(!1)}}setIsLoading(t){this.isLoading=t}}dt.register(kP,()=>{const e=dt.get(qi),t=dt.get(Us),r=dt.get(es);return new kP(e,t,r)},{scope:"request"});const kge=Ot(()=>{const[e]=Yae({code:""}),t=Df(kP);return O.useEffect(()=>{t.confirmEmailCode(e.get("code"))},[t,e]),t.isLoading?x.jsx(LC,{w:"100%",h:"100%",children:x.jsx(Rm,{})}):null}),jge=()=>null;class jP{constructor(t,r,n){Pe(this,"isLoading",!1);this.routerService=t,this.apiService=r,this.authService=n,st(this)}async login(t){t?(await this.loginRequest(t),await this.routerService.navigate("/")):console.error("Invalid code")}dispose(){}init(){}async loginRequest(t){this.setIsLoading(!0);try{const r=await this.apiService.client.loginGithub({data:{code:t}});return await this.authService.setToken(r.loginGithub.accessToken),!0}catch(r){console.error(r)}finally{this.setIsLoading(!1)}}setIsLoading(t){this.isLoading=t}}dt.register(jP,()=>{const e=dt.get(Us),t=dt.get(es),r=dt.get(qi);return new jP(e,t,r)},{scope:"request"});const $ge=async({request:e})=>{const n=new URL(e.url).searchParams.get("code");if(!n)throw new Error("Invalid code");return await dt.get(jP).login(n),hf("/")},Age=Ne`
|
1340
1340
|
mutation login($data: LoginInput!) {
|
1341
1341
|
login(data: $data) {
|
1342
1342
|
accessToken
|
@@ -1349,11 +1349,11 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
1349
1349
|
}
|
1350
1350
|
}
|
1351
1351
|
${mV}
|
1352
|
-
`,Vge=async e=>{const t=await xr.mutate({mutation:Bge,variables:e});if(!t.data)throw t.errors;return t.data};class zge{constructor(t,r,n,i,o){this.rootStore=t,this.organizationId=r,this.projectName=n,this.branchName=i,this.fromRevisionId=o}get projectVariables(){return{organizationId:this.organizationId,projectName:this.projectName,branchName:this.branchName,fromRevisionId:this.fromRevisionId}}async execute(){const t=await this.createProjectRequest();return await this.refetchProjectsConnection(),t}async createProjectRequest(){const{createProject:t}=await Vge({data:this.projectVariables});return this.addProjectToCache(t)}addProjectToCache(t){const r=this.rootStore.cache.addProject(dV(t));return this.rootStore.cache.addProjectByVariables(this.projectVariables,r.id),r}async refetchProjectsConnection(){await this.rootStore.backend.queryMeProjects({first:100})}}class qge{constructor(t,r){Pe(this,"projectName","");Pe(this,"branchName","");Pe(this,"fromRevisionId","");Pe(this,"showingSettings",!1);this.rootStore=t,this.authService=r,st(this)}get organizationId(){var r;const t=(r=this.authService.user)==null?void 0:r.organizationId;if(!t)throw new Error("Not found organizationId");return t}setProjectName(t){this.projectName=t}setBranchName(t){this.branchName=t}setFromRevisionId(t){this.fromRevisionId=t}setShowingSettings(t){this.showingSettings=t}async create(){try{await new zge(this.rootStore,this.organizationId,this.projectName,this.branchName,this.fromRevisionId).execute()}catch(t){console.error(t)}}init(){}dispose(){}}const Uge=()=>{const[e]=O.useState(()=>{const t=dt.get(qi);return new qge(ct,t)});return O.useEffect(()=>(e.init(),()=>e.dispose()),[e]),e},MV=({onClick:e,color:t,dataTestId:r})=>{const[n,i]=O.useState(!1),o=O.useCallback(async()=>{i(!0),await(e==null?void 0:e()),i(!1)},[e]);return x.jsx(Ci,{_hover:{backgroundColor:"gray.100"},"data-testid":r,"aria-label":"",color:t||"gray.400",icon:x.jsx(Pce,{}),isLoading:n,variant:"ghost",onClick:o})},Hge=Ot(({onCancel:e,onAdd:t})=>{const r=Uge(),[n,i]=O.useState(!1),o=O.useCallback(async()=>{i(!0),await r.create(),i(!1),t==null||t()},[t,r]),a=O.useCallback(f=>{r.setProjectName(f.currentTarget.value)},[r]),l=O.useCallback(f=>{r.setBranchName(f.currentTarget.value)},[r]),c=O.useCallback(f=>{r.setFromRevisionId(f.currentTarget.value)},[r]),d=O.useCallback(()=>{r.setShowingSettings(!r.showingSettings)},[r]);return x.jsxs(je,{alignSelf:"flex-start",gap:"0.5rem",children:[x.jsx(Z0,{onClick:e}),x.jsxs(je,{flexDirection:"column",gap:"0.5rem",children:[x.jsx(js,{dataTestId:"create-project-name-input",autoFocus:!0,height:"40px",placeholder:"project name",value:r.projectName,onChange:a,onEnter:o}),r.projectName&&r.showingSettings&&x.jsxs(x.Fragment,{children:[x.jsx(js,{dataTestId:"create-project-branch-name-input",height:"40px",placeholder:"branch name",value:r.branchName,onChange:l,onEnter:o}),x.jsx(js,{dataTestId:"create-project-from-revision-id-input",height:"40px",placeholder:"from revisionId",value:r.fromRevisionId,onChange:c,onEnter:o})]})]}),r.projectName&&x.jsxs(x.Fragment,{children:[x.jsx(Qm,{dataTestId:"create-project-approve-button",loading:n,onClick:o}),x.jsx(MV,{dataTestId:"create-project-settings-button",color:r.showingSettings?"gray.400":"gray.200",onClick:d})]})]})}),uw=0,lu=1,Vf=2,NV=4;function FV(e,t){return r=>e(t(r))}function Wge(e,t){return t(e)}function LV(e,t){return r=>e(t,r)}function X2(e,t){return()=>e(t)}function cw(e,t){return t(e),e}function Kr(...e){return e}function Kge(e){e()}function J2(e){return()=>e}function Gge(...e){return()=>{e.map(Kge)}}function aT(e){return e!==void 0}function Oc(){}function Er(e,t){return e(lu,t)}function Nt(e,t){e(uw,t)}function sT(e){e(Vf)}function di(e){return e(NV)}function lt(e,t){return Er(e,LV(t,uw))}function ts(e,t){const r=e(lu,n=>{r(),t(n)});return r}function tr(){const e=[];return(t,r)=>{switch(t){case Vf:e.splice(0,e.length);return;case lu:return e.push(r),()=>{const n=e.indexOf(r);n>-1&&e.splice(n,1)};case uw:e.slice().forEach(n=>{n(r)});return;default:throw new Error(`unrecognized action ${t}`)}}}function Ve(e){let t=e;const r=tr();return(n,i)=>{switch(n){case lu:i(t);break;case uw:t=i;break;case NV:return t}return r(n,i)}}function Qge(e){let t,r;const n=()=>t&&t();return function(i,o){switch(i){case lu:return o?r===o?void 0:(n(),r=o,t=Er(e,o),t):(n(),Oc);case Vf:n(),r=null;return;default:throw new Error(`unrecognized action ${i}`)}}}function uo(e){return cw(tr(),t=>lt(e,t))}function fi(e,t){return cw(Ve(t),r=>lt(e,r))}function Yge(...e){return t=>e.reduceRight(Wge,t)}function De(e,...t){const r=Yge(...t);return(n,i)=>{switch(n){case lu:return Er(e,r(i));case Vf:sT(e);return}}}function BV(e,t){return e===t}function Ur(e=BV){let t;return r=>n=>{e(t,n)||(t=n,r(n))}}function Rt(e){return t=>r=>{e(r)&&t(r)}}function Qe(e){return t=>FV(t,e)}function Fa(e){return t=>()=>t(e)}function qa(e,t){return r=>n=>r(t=e(t,n))}function Sf(e){return t=>r=>{e>0?e--:t(r)}}function jl(e){let t=null,r;return n=>i=>{t=i,!r&&(r=setTimeout(()=>{r=void 0,n(t)},e))}}function Z2(e){let t,r;return n=>i=>{t=i,r&&clearTimeout(r),r=setTimeout(()=>{n(t)},e)}}function Ut(...e){const t=new Array(e.length);let r=0,n=null;const i=Math.pow(2,e.length)-1;return e.forEach((o,a)=>{const l=Math.pow(2,a);Er(o,c=>{const d=r;r=r|l,t[a]=c,d!==i&&r===i&&n&&(n(),n=null)})}),o=>a=>{const l=()=>o([a].concat(t));r===i?l():n=l}}function eA(...e){return function(t,r){switch(t){case lu:return Gge(...e.map(n=>Er(n,r)));case Vf:return;default:throw new Error(`unrecognized action ${t}`)}}}function kt(e,t=BV){return De(e,Ur(t))}function Vn(...e){const t=tr(),r=new Array(e.length);let n=0;const i=Math.pow(2,e.length)-1;return e.forEach((o,a)=>{const l=Math.pow(2,a);Er(o,c=>{r[a]=c,n=n|l,n===i&&Nt(t,r)})}),function(o,a){switch(o){case lu:return n===i&&a(r),Er(t,a);case Vf:return sT(t);default:throw new Error(`unrecognized action ${o}`)}}}function yr(e,t=[],{singleton:r}={singleton:!0}){return{id:Xge(),constructor:e,dependencies:t,singleton:r}}const Xge=()=>Symbol();function Jge(e){const t=new Map,r=({id:n,constructor:i,dependencies:o,singleton:a})=>{if(a&&t.has(n))return t.get(n);const l=i(o.map(c=>r(c)));return a&&t.set(n,l),l};return r(e)}function Zge(e,t){const r={},n={};let i=0;const o=e.length;for(;i<o;)n[e[i]]=1,i+=1;for(const a in t)n.hasOwnProperty(a)||(r[a]=t[a]);return r}const Rg=typeof document<"u"?Re.useLayoutEffect:Re.useEffect;function VV(e,t,r){const n=Object.keys(t.required||{}),i=Object.keys(t.optional||{}),o=Object.keys(t.methods||{}),a=Object.keys(t.events||{}),l=Re.createContext({});function c(_,S){_.propsReady&&Nt(_.propsReady,!1);for(const C of n){const k=_[t.required[C]];Nt(k,S[C])}for(const C of i)if(C in S){const k=_[t.optional[C]];Nt(k,S[C])}_.propsReady&&Nt(_.propsReady,!0)}function d(_){return o.reduce((S,C)=>(S[C]=k=>{const E=_[t.methods[C]];Nt(E,k)},S),{})}function f(_){return a.reduce((S,C)=>(S[C]=Qge(_[t.events[C]]),S),{})}const p=Re.forwardRef((_,S)=>{const{children:C,...k}=_,[E]=Re.useState(()=>cw(Jge(e),T=>c(T,k))),[R]=Re.useState(X2(f,E));return Rg(()=>{for(const T of a)T in k&&Er(R[T],k[T]);return()=>{Object.values(R).map(sT)}},[k,R,E]),Rg(()=>{c(E,k)}),Re.useImperativeHandle(S,J2(d(E))),Re.createElement(l.Provider,{value:E},r?Re.createElement(r,Zge([...n,...i,...a],k),C):C)}),m=_=>Re.useCallback(LV(Nt,Re.useContext(l)[_]),[_]),g=_=>{const C=Re.useContext(l)[_],k=Re.useCallback(E=>Er(C,E),[C]);return Re.useSyncExternalStore(k,()=>di(C),()=>di(C))},b=_=>{const C=Re.useContext(l)[_],[k,E]=Re.useState(X2(di,C));return Rg(()=>Er(C,R=>{R!==k&&E(J2(R))}),[C,k]),k},y=Re.version.startsWith("18")?g:b;return{Component:p,usePublisher:m,useEmitterValue:y,useEmitter:(_,S)=>{const k=Re.useContext(l)[_];Rg(()=>Er(k,S),[S,k])}}}const eye=typeof document<"u"?Re.useLayoutEffect:Re.useEffect,tye=eye;var co=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e))(co||{});const rye={0:"debug",1:"log",2:"warn",3:"error"},nye=()=>typeof globalThis>"u"?window:globalThis,uu=yr(()=>{const e=Ve(3);return{log:Ve((r,n,i=1)=>{var o;const a=(o=nye().VIRTUOSO_LOG_LEVEL)!=null?o:di(e);i>=a&&console[rye[i]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",r,n)}),logLevel:e}},[],{singleton:!0});function lT(e,t=!0){const r=Re.useRef(null);let n=i=>{};if(typeof ResizeObserver<"u"){const i=Re.useMemo(()=>new ResizeObserver(o=>{requestAnimationFrame(()=>{const a=o[0].target;a.offsetParent!==null&&e(a)})}),[e]);n=o=>{o&&t?(i.observe(o),r.current=o):(r.current&&i.unobserve(r.current),r.current=null)}}return{ref:r,callbackRef:n}}function Rc(e,t=!0){return lT(e,t).callbackRef}function iye(e,t,r,n,i,o,a){const l=Re.useCallback(c=>{const d=oye(c.children,t,"offsetHeight",i);let f=c.parentElement;for(;!f.dataset.virtuosoScroller;)f=f.parentElement;const p=f.lastElementChild.dataset.viewportType==="window",m=a?a.scrollTop:p?window.pageYOffset||document.documentElement.scrollTop:f.scrollTop,g=a?a.scrollHeight:p?document.documentElement.scrollHeight:f.scrollHeight,b=a?a.offsetHeight:p?window.innerHeight:f.offsetHeight;n({scrollTop:Math.max(m,0),scrollHeight:g,viewportHeight:b}),o==null||o(aye("row-gap",getComputedStyle(c).rowGap,i)),d!==null&&e(d)},[e,t,i,o,a,n]);return lT(l,r)}function oye(e,t,r,n){const i=e.length;if(i===0)return null;const o=[];for(let a=0;a<i;a++){const l=e.item(a);if(!l||l.dataset.index===void 0)continue;const c=parseInt(l.dataset.index),d=parseFloat(l.dataset.knownSize),f=t(l,r);if(f===0&&n("Zero-sized element, this should not happen",{child:l},co.ERROR),f===d)continue;const p=o[o.length-1];o.length===0||p.size!==f||p.endIndex!==c-1?o.push({startIndex:c,endIndex:c,size:f}):o[o.length-1].endIndex++}return o}function aye(e,t,r){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&r(`${e} was not resolved to pixel value correctly`,t,co.WARN),t==="normal"?0:parseInt(t??"0",10)}function Zl(e,t){return Math.round(e.getBoundingClientRect()[t])}function zV(e,t){return Math.abs(e-t)<1.01}function qV(e,t,r,n=Oc,i){const o=Re.useRef(null),a=Re.useRef(null),l=Re.useRef(null),c=Re.useCallback(p=>{const m=p.target,g=m===window||m===document,b=g?window.pageYOffset||document.documentElement.scrollTop:m.scrollTop,y=g?document.documentElement.scrollHeight:m.scrollHeight,w=g?window.innerHeight:m.offsetHeight,_=()=>{e({scrollTop:Math.max(b,0),scrollHeight:y,viewportHeight:w})};p.suppressFlushSync?_():OM.flushSync(_),a.current!==null&&(b===a.current||b<=0||b===y-w)&&(a.current=null,t(!0),l.current&&(clearTimeout(l.current),l.current=null))},[e,t]);Re.useEffect(()=>{const p=i||o.current;return n(i||o.current),c({target:p,suppressFlushSync:!0}),p.addEventListener("scroll",c,{passive:!0}),()=>{n(null),p.removeEventListener("scroll",c)}},[o,c,r,n,i]);function d(p){const m=o.current;if(!m||"offsetHeight"in m&&m.offsetHeight===0)return;const g=p.behavior==="smooth";let b,y,w;m===window?(y=Math.max(Zl(document.documentElement,"height"),document.documentElement.scrollHeight),b=window.innerHeight,w=document.documentElement.scrollTop):(y=m.scrollHeight,b=Zl(m,"height"),w=m.scrollTop);const _=y-b;if(p.top=Math.ceil(Math.max(Math.min(_,p.top),0)),zV(b,y)||p.top===w){e({scrollTop:w,scrollHeight:y,viewportHeight:b}),g&&t(!0);return}g?(a.current=p.top,l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{l.current=null,a.current=null,t(!0)},1e3)):a.current=null,m.scrollTo(p)}function f(p){o.current.scrollBy(p)}return{scrollerRef:o,scrollByCallback:f,scrollToCallback:d}}const Ti=yr(()=>{const e=tr(),t=tr(),r=Ve(0),n=tr(),i=Ve(0),o=tr(),a=tr(),l=Ve(0),c=Ve(0),d=Ve(0),f=Ve(0),p=tr(),m=tr(),g=Ve(!1);return lt(De(e,Qe(({scrollTop:b})=>b)),t),lt(De(e,Qe(({scrollHeight:b})=>b)),a),lt(t,i),{scrollContainerState:e,scrollTop:t,viewportHeight:o,headerHeight:l,fixedHeaderHeight:c,fixedFooterHeight:d,footerHeight:f,scrollHeight:a,smoothScrollTargetReached:n,scrollTo:p,scrollBy:m,statefulScrollTop:i,deviation:r,scrollingInProgress:g}},[],{singleton:!0}),fm={lvl:0};function UV(e,t,r,n=fm,i=fm){return{k:e,v:t,lvl:r,l:n,r:i}}function jr(e){return e===fm}function Jd(){return fm}function DP(e,t){if(jr(e))return fm;const{k:r,l:n,r:i}=e;if(t===r){if(jr(n))return i;if(jr(i))return n;{const[o,a]=HV(n);return rb(kn(e,{k:o,v:a,l:WV(n)}))}}else return t<r?rb(kn(e,{l:DP(n,t)})):rb(kn(e,{r:DP(i,t)}))}function hm(e,t){if(!jr(e))return t===e.k?e.v:t<e.k?hm(e.l,t):hm(e.r,t)}function va(e,t,r="k"){if(jr(e))return[-1/0,void 0];if(Number(e[r])===t)return[e.k,e.v];if(Number(e[r])<t){const n=va(e.r,t,r);return n[0]===-1/0?[e.k,e.v]:n}return va(e.l,t,r)}function oo(e,t,r){return jr(e)?UV(t,r,1):t===e.k?kn(e,{k:t,v:r}):t<e.k?tA(kn(e,{l:oo(e.l,t,r)})):tA(kn(e,{r:oo(e.r,t,r)}))}function MP(e,t,r){if(jr(e))return[];const{k:n,v:i,l:o,r:a}=e;let l=[];return n>t&&(l=l.concat(MP(o,t,r))),n>=t&&n<=r&&l.push({k:n,v:i}),n<=r&&(l=l.concat(MP(a,t,r))),l}function Uu(e){return jr(e)?[]:[...Uu(e.l),{k:e.k,v:e.v},...Uu(e.r)]}function HV(e){return jr(e.r)?[e.k,e.v]:HV(e.r)}function WV(e){return jr(e.r)?e.l:rb(kn(e,{r:WV(e.r)}))}function kn(e,t){return UV(t.k!==void 0?t.k:e.k,t.v!==void 0?t.v:e.v,t.lvl!==void 0?t.lvl:e.lvl,t.l!==void 0?t.l:e.l,t.r!==void 0?t.r:e.r)}function R_(e){return jr(e)||e.lvl>e.r.lvl}function tA(e){return NP(GV(e))}function rb(e){const{l:t,r,lvl:n}=e;if(r.lvl>=n-1&&t.lvl>=n-1)return e;if(n>r.lvl+1){if(R_(t))return GV(kn(e,{lvl:n-1}));if(!jr(t)&&!jr(t.r))return kn(t.r,{l:kn(t,{r:t.r.l}),r:kn(e,{l:t.r.r,lvl:n-1}),lvl:n});throw new Error("Unexpected empty nodes")}else{if(R_(e))return NP(kn(e,{lvl:n-1}));if(!jr(r)&&!jr(r.l)){const i=r.l,o=R_(i)?r.lvl-1:r.lvl;return kn(i,{l:kn(e,{r:i.l,lvl:n-1}),r:NP(kn(r,{l:i.r,lvl:o})),lvl:i.lvl+1})}else throw new Error("Unexpected empty nodes")}}function dw(e,t,r){if(jr(e))return[];const n=va(e,t)[0];return sye(MP(e,n,r))}function KV(e,t){const r=e.length;if(r===0)return[];let{index:n,value:i}=t(e[0]);const o=[];for(let a=1;a<r;a++){const{index:l,value:c}=t(e[a]);o.push({start:n,end:l-1,value:i}),n=l,i=c}return o.push({start:n,end:1/0,value:i}),o}function sye(e){return KV(e,({k:t,v:r})=>({index:t,value:r}))}function NP(e){const{r:t,lvl:r}=e;return!jr(t)&&!jr(t.r)&&t.lvl===r&&t.r.lvl===r?kn(t,{l:kn(e,{r:t.l}),lvl:r+1}):e}function GV(e){const{l:t}=e;return!jr(t)&&t.lvl===e.lvl?kn(t,{r:kn(e,{l:t.r})}):e}function Ub(e,t,r,n=0){let i=e.length-1;for(;n<=i;){const o=Math.floor((n+i)/2),a=e[o],l=r(a,t);if(l===0)return o;if(l===-1){if(i-n<2)return o-1;i=o-1}else{if(i===n)return o;n=o+1}}throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function QV(e,t,r){return e[Ub(e,t,r)]}function lye(e,t,r,n){const i=Ub(e,t,n),o=Ub(e,r,n,i);return e.slice(i,o+1)}const uT=yr(()=>({recalcInProgress:Ve(!1)}),[],{singleton:!0});function uye(e){const{size:t,startIndex:r,endIndex:n}=e;return i=>i.start===r&&(i.end===n||i.end===1/0)&&i.value===t}function rA(e,t){let r=0,n=0;for(;r<e;)r+=t[n+1]-t[n]-1,n++;return n-(r===e?0:1)}function cye(e,t){let r=jr(e)?0:1/0;for(const n of t){const{size:i,startIndex:o,endIndex:a}=n;if(r=Math.min(r,o),jr(e)){e=oo(e,0,i);continue}const l=dw(e,o-1,a+1);if(l.some(uye(n)))continue;let c=!1,d=!1;for(const{start:f,end:p,value:m}of l)c?(a>=f||i===m)&&(e=DP(e,f)):(d=m!==i,c=!0),p>a&&a>=f&&m!==i&&(e=oo(e,a+1,m));d&&(e=oo(e,o,i))}return[e,r]}function dye(){return{offsetTree:[],sizeTree:Jd(),groupOffsetTree:Jd(),lastIndex:0,lastOffset:0,lastSize:0,groupIndices:[]}}function cT({index:e},t){return t===e?0:t<e?-1:1}function fye({offset:e},t){return t===e?0:t<e?-1:1}function hye(e){return{index:e.index,value:e}}function pye(e,t,r,n=0){return n>0&&(t=Math.max(t,QV(e,n,cT).offset)),KV(lye(e,t,r,fye),hye)}function FP(e,t,r,n){let i=e,o=0,a=0,l=0,c=0;if(t!==0){c=Ub(i,t-1,cT),l=i[c].offset;const f=va(r,t-1);o=f[0],a=f[1],i.length&&i[c].size===va(r,t)[1]&&(c-=1),i=i.slice(0,c+1)}else i=[];for(const{start:d,value:f}of dw(r,t,1/0)){const p=d-o,m=p*a+l+p*n;i.push({offset:m,size:f,index:d}),o=d,l=m,a=f}return{offsetTree:i,lastIndex:o,lastOffset:l,lastSize:a}}function mye(e,[t,r,n,i]){t.length>0&&n("received item sizes",t,co.DEBUG);const o=e.sizeTree;let a=o,l=0;if(r.length>0&&jr(o)&&t.length===2){const m=t[0].size,g=t[1].size;a=r.reduce((b,y)=>oo(oo(b,y,m),y+1,g),a)}else[a,l]=cye(a,t);if(a===o)return e;const{offsetTree:c,lastIndex:d,lastSize:f,lastOffset:p}=FP(e.offsetTree,l,a,i);return{sizeTree:a,offsetTree:c,lastIndex:d,lastOffset:p,lastSize:f,groupOffsetTree:r.reduce((m,g)=>oo(m,g,pm(g,c,i)),Jd()),groupIndices:r}}function pm(e,t,r){if(t.length===0)return 0;const{offset:n,index:i,size:o}=QV(t,e,cT),a=e-i,l=o*a+(a-1)*r+n;return l>0?l+r:l}function vye(e){return typeof e.groupIndex<"u"}function YV(e,t,r){if(vye(e))return t.groupIndices[e.groupIndex]+1;{const n=e.index==="LAST"?r:e.index;let i=XV(n,t);return i=Math.max(0,i,Math.min(r,i)),i}}function XV(e,t){if(!fw(t))return e;let r=0;for(;t.groupIndices[r]<=e+r;)r++;return e+r}function fw(e){return!jr(e.groupOffsetTree)}function gye(e){return Uu(e).map(({k:t,v:r},n,i)=>{const o=i[n+1],a=o?o.k-1:1/0;return{startIndex:t,endIndex:a,size:r}})}const yye={offsetHeight:"height",offsetWidth:"width"},os=yr(([{log:e},{recalcInProgress:t}])=>{const r=tr(),n=tr(),i=fi(n,0),o=tr(),a=tr(),l=Ve(0),c=Ve([]),d=Ve(void 0),f=Ve(void 0),p=Ve((E,R)=>Zl(E,yye[R])),m=Ve(void 0),g=Ve(0),b=dye(),y=fi(De(r,Ut(c,e,g),qa(mye,b),Ur()),b),w=fi(De(c,Ur(),qa((E,R)=>({prev:E.current,current:R}),{prev:[],current:[]}),Qe(({prev:E})=>E)),[]);lt(De(c,Rt(E=>E.length>0),Ut(y,g),Qe(([E,R,T])=>{const A=E.reduce((M,B,Q)=>oo(M,B,pm(B,R.offsetTree,T)||Q),Jd());return{...R,groupIndices:E,groupOffsetTree:A}})),y),lt(De(n,Ut(y),Rt(([E,{lastIndex:R}])=>E<R),Qe(([E,{lastIndex:R,lastSize:T}])=>[{startIndex:E,endIndex:R,size:T}])),r),lt(d,f);const _=fi(De(d,Qe(E=>E===void 0)),!0);lt(De(f,Rt(E=>E!==void 0&&jr(di(y).sizeTree)),Qe(E=>[{startIndex:0,endIndex:0,size:E}])),r);const S=uo(De(r,Ut(y),qa(({sizes:E},[R,T])=>({changed:T!==E,sizes:T}),{changed:!1,sizes:b}),Qe(E=>E.changed)));Er(De(l,qa((E,R)=>({diff:E.prev-R,prev:R}),{diff:0,prev:0}),Qe(E=>E.diff)),E=>{const{groupIndices:R}=di(y);if(E>0)Nt(t,!0),Nt(o,E+rA(E,R));else if(E<0){const T=di(w);T.length>0&&(E-=rA(-E,T)),Nt(a,E)}}),Er(De(l,Ut(e)),([E,R])=>{E<0&&R("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:l},co.ERROR)});const C=uo(o);lt(De(o,Ut(y),Qe(([E,R])=>{const T=R.groupIndices.length>0,A=[],M=R.lastSize;if(T){const B=hm(R.sizeTree,0);let Q=0,se=0;for(;Q<E;){const X=R.groupIndices[se],ce=R.groupIndices.length===se+1?1/0:R.groupIndices[se+1]-X-1;A.push({startIndex:X,endIndex:X,size:B}),A.push({startIndex:X+1,endIndex:X+1+ce-1,size:M}),se++,Q+=ce+1}const ie=Uu(R.sizeTree);return Q!==E&&ie.shift(),ie.reduce((X,{k:ce,v:ne})=>{let ee=X.ranges;return X.prevSize!==0&&(ee=[...X.ranges,{startIndex:X.prevIndex,endIndex:ce+E-1,size:X.prevSize}]),{ranges:ee,prevIndex:ce+E,prevSize:ne}},{ranges:A,prevIndex:E,prevSize:0}).ranges}return Uu(R.sizeTree).reduce((B,{k:Q,v:se})=>({ranges:[...B.ranges,{startIndex:B.prevIndex,endIndex:Q+E-1,size:B.prevSize}],prevIndex:Q+E,prevSize:se}),{ranges:[],prevIndex:0,prevSize:M}).ranges})),r);const k=uo(De(a,Ut(y,g),Qe(([E,{offsetTree:R},T])=>{const A=-E;return pm(A,R,T)})));return lt(De(a,Ut(y,g),Qe(([E,R,T])=>{if(R.groupIndices.length>0){if(jr(R.sizeTree))return R;let M=Jd();const B=di(w);let Q=0,se=0,ie=0;for(;Q<-E;){ie=B[se];const X=B[se+1]-ie-1;se++,Q+=X+1}if(M=Uu(R.sizeTree).reduce((X,{k:ce,v:ne})=>oo(X,Math.max(0,ce+E),ne),M),Q!==-E){const X=hm(R.sizeTree,ie);M=oo(M,0,X);const ce=va(R.sizeTree,-E+1)[1];M=oo(M,1,ce)}return{...R,sizeTree:M,...FP(R.offsetTree,0,M,T)}}else{const M=Uu(R.sizeTree).reduce((B,{k:Q,v:se})=>oo(B,Math.max(0,Q+E),se),Jd());return{...R,sizeTree:M,...FP(R.offsetTree,0,M,T)}}})),y),{data:m,totalCount:n,sizeRanges:r,groupIndices:c,defaultItemSize:f,fixedItemSize:d,unshiftWith:o,shiftWith:a,shiftWithOffset:k,beforeUnshiftWith:C,firstItemIndex:l,gap:g,sizes:y,listRefresh:S,statefulTotalCount:i,trackItemSizes:_,itemSize:p}},Kr(uu,uT),{singleton:!0}),bye=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function JV(e){const t=typeof e=="number"?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!bye)&&(t.behavior="auto"),t.offset||(t.offset=0),t}const ev=yr(([{sizes:e,totalCount:t,listRefresh:r,gap:n},{scrollingInProgress:i,viewportHeight:o,scrollTo:a,smoothScrollTargetReached:l,headerHeight:c,footerHeight:d,fixedHeaderHeight:f,fixedFooterHeight:p},{log:m}])=>{const g=tr(),b=tr(),y=Ve(0);let w=null,_=null,S=null;function C(){w&&(w(),w=null),S&&(S(),S=null),_&&(clearTimeout(_),_=null),Nt(i,!1)}return lt(De(g,Ut(e,o,t,y,c,d,m),Ut(n,f,p),Qe(([[k,E,R,T,A,M,B,Q],se,ie,N])=>{const X=JV(k),{align:ce,behavior:ne,offset:ee}=X,ge=T-1,Z=YV(X,E,ge);let j=pm(Z,E.offsetTree,se)+M;ce==="end"?(j+=ie+va(E.sizeTree,Z)[1]-R+N,Z===ge&&(j+=B)):ce==="center"?j+=(ie+va(E.sizeTree,Z)[1]-R+N)/2:j-=A,ee&&(j+=ee);const U=q=>{C(),q?(Q("retrying to scroll to",{location:k},co.DEBUG),Nt(g,k)):(Nt(b,!0),Q("list did not change, scroll successful",{},co.DEBUG))};if(C(),ne==="smooth"){let q=!1;S=Er(r,$=>{q=q||$}),w=ts(l,()=>{U(q)})}else w=ts(De(r,wye(150)),U);return _=setTimeout(()=>{C()},1200),Nt(i,!0),Q("scrolling from index to",{index:Z,top:j,behavior:ne},co.DEBUG),{top:j,behavior:ne}})),a),{scrollToIndex:g,scrollTargetReached:b,topListHeight:y}},Kr(os,Ti,uu),{singleton:!0});function wye(e){return t=>{const r=setTimeout(()=>{t(!1)},e);return n=>{n&&(t(!0),clearTimeout(r))}}}const mm="up",Cp="down",Sye="none",_ye={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollTop:0,viewportHeight:0,scrollHeight:0}},xye=0,tv=yr(([{scrollContainerState:e,scrollTop:t,viewportHeight:r,headerHeight:n,footerHeight:i,scrollBy:o}])=>{const a=Ve(!1),l=Ve(!0),c=tr(),d=tr(),f=Ve(4),p=Ve(xye),m=fi(De(eA(De(kt(t),Sf(1),Fa(!0)),De(kt(t),Sf(1),Fa(!1),Z2(100))),Ur()),!1),g=fi(De(eA(De(o,Fa(!0)),De(o,Fa(!1),Z2(200))),Ur()),!1);lt(De(Vn(kt(t),kt(p)),Qe(([S,C])=>S<=C),Ur()),l),lt(De(l,jl(50)),d);const b=uo(De(Vn(e,kt(r),kt(n),kt(i),kt(f)),qa((S,[{scrollTop:C,scrollHeight:k},E,R,T,A])=>{const M=C+E-k>-A,B={viewportHeight:E,scrollTop:C,scrollHeight:k};if(M){let se,ie;return C>S.state.scrollTop?(se="SCROLLED_DOWN",ie=S.state.scrollTop-C):(se="SIZE_DECREASED",ie=S.state.scrollTop-C||S.scrollTopDelta),{atBottom:!0,state:B,atBottomBecause:se,scrollTopDelta:ie}}let Q;return B.scrollHeight>S.state.scrollHeight?Q="SIZE_INCREASED":E<S.state.viewportHeight?Q="VIEWPORT_HEIGHT_DECREASING":C<S.state.scrollTop?Q="SCROLLING_UPWARDS":Q="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:Q,state:B}},_ye),Ur((S,C)=>S&&S.atBottom===C.atBottom))),y=fi(De(e,qa((S,{scrollTop:C,scrollHeight:k,viewportHeight:E})=>{if(zV(S.scrollHeight,k))return{scrollTop:C,scrollHeight:k,jump:0,changed:!1};{const R=k-(C+E)<1;return S.scrollTop!==C&&R?{scrollHeight:k,scrollTop:C,jump:S.scrollTop-C,changed:!0}:{scrollHeight:k,scrollTop:C,jump:0,changed:!0}}},{scrollHeight:0,jump:0,scrollTop:0,changed:!1}),Rt(S=>S.changed),Qe(S=>S.jump)),0);lt(De(b,Qe(S=>S.atBottom)),a),lt(De(a,jl(50)),c);const w=Ve(Cp);lt(De(e,Qe(({scrollTop:S})=>S),Ur(),qa((S,C)=>di(g)?{direction:S.direction,prevScrollTop:C}:{direction:C<S.prevScrollTop?mm:Cp,prevScrollTop:C},{direction:Cp,prevScrollTop:0}),Qe(S=>S.direction)),w),lt(De(e,jl(50),Fa(Sye)),w);const _=Ve(0);return lt(De(m,Rt(S=>!S),Fa(0)),_),lt(De(t,jl(100),Ut(m),Rt(([S,C])=>!!C),qa(([S,C],[k])=>[C,k],[0,0]),Qe(([S,C])=>C-S)),_),{isScrolling:m,isAtTop:l,isAtBottom:a,atBottomState:b,atTopStateChange:d,atBottomStateChange:c,scrollDirection:w,atBottomThreshold:f,atTopThreshold:p,scrollVelocity:_,lastJumpDueToItemResize:y}},Kr(Ti)),cu=yr(([{log:e}])=>{const t=Ve(!1),r=uo(De(t,Rt(n=>n),Ur()));return Er(t,n=>{n&&di(e)("props updated",{},co.DEBUG)}),{propsReady:t,didMount:r}},Kr(uu),{singleton:!0});function dT(e,t){e==0?t():requestAnimationFrame(()=>dT(e-1,t))}function fT(e,t){const r=t-1;return typeof e=="number"?e:e.index==="LAST"?r:e.index}const rv=yr(([{sizes:e,listRefresh:t,defaultItemSize:r},{scrollTop:n},{scrollToIndex:i,scrollTargetReached:o},{didMount:a}])=>{const l=Ve(!0),c=Ve(0),d=Ve(!0);return lt(De(a,Ut(c),Rt(([f,p])=>!!p),Fa(!1)),l),lt(De(a,Ut(c),Rt(([f,p])=>!!p),Fa(!1)),d),Er(De(Vn(t,a),Ut(l,e,r,d),Rt(([[,f],p,{sizeTree:m},g,b])=>f&&(!jr(m)||aT(g))&&!p&&!b),Ut(c)),([,f])=>{ts(o,()=>{Nt(d,!0)}),dT(4,()=>{ts(n,()=>{Nt(l,!0)}),Nt(i,f)})}),{scrolledToInitialItem:l,initialTopMostItemIndex:c,initialItemFinalLocationReached:d}},Kr(os,Ti,ev,cu),{singleton:!0});function nA(e){return e?e==="smooth"?"smooth":"auto":!1}const Pye=(e,t)=>typeof e=="function"?nA(e(t)):t&&nA(e),Cye=yr(([{totalCount:e,listRefresh:t},{isAtBottom:r,atBottomState:n},{scrollToIndex:i},{scrolledToInitialItem:o},{propsReady:a,didMount:l},{log:c},{scrollingInProgress:d}])=>{const f=Ve(!1),p=tr();let m=null;function g(y){Nt(i,{index:"LAST",align:"end",behavior:y})}Er(De(Vn(De(kt(e),Sf(1)),l),Ut(kt(f),r,o,d),Qe(([[y,w],_,S,C,k])=>{let E=w&&C,R="auto";return E&&(R=Pye(_,S||k),E=E&&!!R),{totalCount:y,shouldFollow:E,followOutputBehavior:R}}),Rt(({shouldFollow:y})=>y)),({totalCount:y,followOutputBehavior:w})=>{m&&(m(),m=null),m=ts(t,()=>{di(c)("following output to ",{totalCount:y},co.DEBUG),g(w),m=null})});function b(y){const w=ts(n,_=>{y&&!_.atBottom&&_.notAtBottomBecause==="SIZE_INCREASED"&&!m&&(di(c)("scrolling to bottom due to increased size",{},co.DEBUG),g("auto"))});setTimeout(w,100)}return Er(De(Vn(kt(f),e,a),Rt(([y,,w])=>y&&w),qa(({value:y},[,w])=>({refreshed:y===w,value:w}),{refreshed:!1,value:0}),Rt(({refreshed:y})=>y),Ut(f,e)),([,y])=>{di(o)&&b(y!==!1)}),Er(p,()=>{b(di(f)!==!1)}),Er(Vn(kt(f),n),([y,w])=>{y&&!w.atBottom&&w.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&g("auto")}),{followOutput:f,autoscrollToBottom:p}},Kr(os,tv,ev,rv,cu,uu,Ti));function Eye(e){return e.reduce((t,r)=>(t.groupIndices.push(t.totalCount),t.totalCount+=r+1,t),{totalCount:0,groupIndices:[]})}const ZV=yr(([{totalCount:e,groupIndices:t,sizes:r},{scrollTop:n,headerHeight:i}])=>{const o=tr(),a=tr(),l=uo(De(o,Qe(Eye)));return lt(De(l,Qe(c=>c.totalCount)),e),lt(De(l,Qe(c=>c.groupIndices)),t),lt(De(Vn(n,r,i),Rt(([c,d])=>fw(d)),Qe(([c,d,f])=>va(d.groupOffsetTree,Math.max(c-f,0),"v")[0]),Ur(),Qe(c=>[c])),a),{groupCounts:o,topItemsIndexes:a}},Kr(os,Ti));function vm(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}function e3(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}const Hb="top",Wb="bottom",iA="none";function oA(e,t,r){return typeof e=="number"?r===mm&&t===Hb||r===Cp&&t===Wb?e:0:r===mm?t===Hb?e.main:e.reverse:t===Wb?e.main:e.reverse}function aA(e,t){return typeof e=="number"?e:e[t]||0}const hT=yr(([{scrollTop:e,viewportHeight:t,deviation:r,headerHeight:n,fixedHeaderHeight:i}])=>{const o=tr(),a=Ve(0),l=Ve(0),c=Ve(0),d=fi(De(Vn(kt(e),kt(t),kt(n),kt(o,vm),kt(c),kt(a),kt(i),kt(r),kt(l)),Qe(([f,p,m,[g,b],y,w,_,S,C])=>{const k=f-S,E=w+_,R=Math.max(m-k,0);let T=iA;const A=aA(C,Hb),M=aA(C,Wb);return g-=S,g+=m+_,b+=m+_,b-=S,g>f+E-A&&(T=mm),b<f-R+p+M&&(T=Cp),T!==iA?[Math.max(k-m-oA(y,Hb,T)-A,0),k-R-_+p+oA(y,Wb,T)+M]:null}),Rt(f=>f!=null),Ur(vm)),[0,0]);return{listBoundary:o,overscan:c,topListHeight:a,increaseViewportBy:l,visibleRange:d}},Kr(Ti),{singleton:!0});function Tye(e,t,r){if(fw(t)){const n=XV(e,t);return[{index:va(t.groupOffsetTree,n)[0],size:0,offset:0},{index:n,size:0,offset:0,data:r&&r[0]}]}return[{index:e,size:0,offset:0,data:r&&r[0]}]}const I_={items:[],topItems:[],offsetTop:0,offsetBottom:0,top:0,bottom:0,topListHeight:0,totalCount:0,firstItemIndex:0};function sA(e,t,r){if(e.length===0)return[];if(!fw(t))return e.map(d=>({...d,index:d.index+r,originalIndex:d.index}));const n=e[0].index,i=e[e.length-1].index,o=[],a=dw(t.groupOffsetTree,n,i);let l,c=0;for(const d of e){(!l||l.end<d.index)&&(l=a.shift(),c=t.groupIndices.indexOf(l.start));let f;d.index===l.start?f={type:"group",index:c}:f={index:d.index-(c+1)+r,groupIndex:c},o.push({...f,size:d.size,offset:d.offset,originalIndex:d.index,data:d.data})}return o}function nb(e,t,r,n,i,o){const{lastSize:a,lastOffset:l,lastIndex:c}=i;let d=0,f=0;if(e.length>0){d=e[0].offset;const y=e[e.length-1];f=y.offset+y.size}const p=r-c,m=l+p*a+(p-1)*n,g=d,b=m-f;return{items:sA(e,i,o),topItems:sA(t,i,o),topListHeight:t.reduce((y,w)=>w.size+y,0),offsetTop:d,offsetBottom:b,top:g,bottom:f,totalCount:r,firstItemIndex:o}}function t3(e,t,r,n,i,o){let a=0;if(r.groupIndices.length>0)for(const f of r.groupIndices){if(f-a>=e)break;a++}const l=e+a,c=fT(t,l),d=Array.from({length:l}).map((f,p)=>({index:p+c,size:0,offset:0,data:o[p+c]}));return nb(d,[],l,i,r,n)}const Ic=yr(([{sizes:e,totalCount:t,data:r,firstItemIndex:n,gap:i},o,{visibleRange:a,listBoundary:l,topListHeight:c},{scrolledToInitialItem:d,initialTopMostItemIndex:f},{topListHeight:p},m,{didMount:g},{recalcInProgress:b}])=>{const y=Ve([]),w=Ve(0),_=tr();lt(o.topItemsIndexes,y);const S=fi(De(Vn(g,b,kt(a,vm),kt(t),kt(e),kt(f),d,kt(y),kt(n),kt(i),r),Rt(([R,T,,A,,,,,,,M])=>{const B=M&&M.length!==A;return R&&!T&&!B}),Qe(([,,[R,T],A,M,B,Q,se,ie,N,X])=>{const ce=M,{sizeTree:ne,offsetTree:ee}=ce,ge=di(w);if(A===0)return{...I_,totalCount:A};if(R===0&&T===0)return ge===0?{...I_,totalCount:A}:t3(ge,B,M,ie,N,X||[]);if(jr(ne))return ge>0?null:nb(Tye(fT(B,A),ce,X),[],A,N,ce,ie);const Z=[];if(se.length>0){const F=se[0],V=se[se.length-1];let de=0;for(const pe of dw(ne,F,V)){const Ee=pe.value,Me=Math.max(pe.start,F),Y=Math.min(pe.end,V);for(let K=Me;K<=Y;K++)Z.push({index:K,size:Ee,offset:de,data:X&&X[K]}),de+=Ee}}if(!Q)return nb([],Z,A,N,ce,ie);const j=se.length>0?se[se.length-1]+1:0,U=pye(ee,R,T,j);if(U.length===0)return null;const q=A-1,$=cw([],F=>{for(const V of U){const de=V.value;let pe=de.offset,Ee=V.start;const Me=de.size;if(de.offset<R){Ee+=Math.floor((R-de.offset+N)/(Me+N));const K=Ee-V.start;pe+=K*Me+K*N}Ee<j&&(pe+=(j-Ee)*Me,Ee=j);const Y=Math.min(V.end,q);for(let K=Ee;K<=Y&&!(pe>=T);K++)F.push({index:K,size:Me,offset:pe,data:X&&X[K]}),pe+=Me+N}});return nb($,Z,A,N,ce,ie)}),Rt(R=>R!==null),Ur()),I_);lt(De(r,Rt(aT),Qe(R=>R==null?void 0:R.length)),t),lt(De(S,Qe(R=>R.topListHeight)),p),lt(p,c),lt(De(S,Qe(R=>[R.top,R.bottom])),l),lt(De(S,Qe(R=>R.items)),_);const C=uo(De(S,Rt(({items:R})=>R.length>0),Ut(t,r),Rt(([{items:R},T])=>R[R.length-1].originalIndex===T-1),Qe(([,R,T])=>[R-1,T]),Ur(vm),Qe(([R])=>R))),k=uo(De(S,jl(200),Rt(({items:R,topItems:T})=>R.length>0&&R[0].originalIndex===T.length),Qe(({items:R})=>R[0].index),Ur())),E=uo(De(S,Rt(({items:R})=>R.length>0),Qe(({items:R})=>{let T=0,A=R.length-1;for(;R[T].type==="group"&&T<A;)T++;for(;R[A].type==="group"&&A>T;)A--;return{startIndex:R[T].index,endIndex:R[A].index}}),Ur(e3)));return{listState:S,topItemsIndexes:y,endReached:C,startReached:k,rangeChanged:E,itemsRendered:_,initialItemCount:w,...m}},Kr(os,ZV,hT,rv,ev,tv,cu,uT),{singleton:!0}),Oye=yr(([{sizes:e,firstItemIndex:t,data:r,gap:n},{initialTopMostItemIndex:i},{initialItemCount:o,listState:a},{didMount:l}])=>(lt(De(l,Ut(o),Rt(([,c])=>c!==0),Ut(i,e,t,n,r),Qe(([[,c],d,f,p,m,g=[]])=>t3(c,d,f,p,m,g))),a),{}),Kr(os,rv,Ic,cu),{singleton:!0}),r3=yr(([{scrollVelocity:e}])=>{const t=Ve(!1),r=tr(),n=Ve(!1);return lt(De(e,Ut(n,t,r),Rt(([i,o])=>!!o),Qe(([i,o,a,l])=>{const{exit:c,enter:d}=o;if(a){if(c(i,l))return!1}else if(d(i,l))return!0;return a}),Ur()),t),Er(De(Vn(t,e,r),Ut(n)),([[i,o,a],l])=>i&&l&&l.change&&l.change(o,a)),{isSeeking:t,scrollSeekConfiguration:n,scrollVelocity:e,scrollSeekRangeChanged:r}},Kr(tv),{singleton:!0}),Rye=yr(([{topItemsIndexes:e}])=>{const t=Ve(0);return lt(De(t,Rt(r=>r>0),Qe(r=>Array.from({length:r}).map((n,i)=>i))),e),{topItemCount:t}},Kr(Ic)),n3=yr(([{footerHeight:e,headerHeight:t,fixedHeaderHeight:r,fixedFooterHeight:n},{listState:i}])=>{const o=tr(),a=fi(De(Vn(e,n,t,r,i),Qe(([l,c,d,f,p])=>l+c+d+f+p.offsetBottom+p.bottom)),0);return lt(kt(a),o),{totalListHeight:a,totalListHeightChanged:o}},Kr(Ti,Ic),{singleton:!0});function i3(e){let t=!1,r;return()=>(t||(t=!0,r=e()),r)}const Iye=i3(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),kye=yr(([{scrollBy:e,scrollTop:t,deviation:r,scrollingInProgress:n},{isScrolling:i,isAtBottom:o,scrollDirection:a,lastJumpDueToItemResize:l},{listState:c},{beforeUnshiftWith:d,shiftWithOffset:f,sizes:p,gap:m},{log:g},{recalcInProgress:b}])=>{const y=uo(De(c,Ut(l),qa(([,_,S,C],[{items:k,totalCount:E,bottom:R,offsetBottom:T},A])=>{const M=R+T;let B=0;return S===E&&_.length>0&&k.length>0&&(k[0].originalIndex===0&&_[0].originalIndex===0||(B=M-C,B!==0&&(B+=A))),[B,k,E,M]},[0,[],0,0]),Rt(([_])=>_!==0),Ut(t,a,n,o,g,b),Rt(([,_,S,C,,,k])=>!k&&!C&&_!==0&&S===mm),Qe(([[_],,,,,S])=>(S("Upward scrolling compensation",{amount:_},co.DEBUG),_))));function w(_){_>0?(Nt(e,{top:-_,behavior:"auto"}),Nt(r,0)):(Nt(r,0),Nt(e,{top:-_,behavior:"auto"}))}return Er(De(y,Ut(r,i)),([_,S,C])=>{C&&Iye()?Nt(r,S-_):w(-_)}),Er(De(Vn(fi(i,!1),r,b),Rt(([_,S,C])=>!_&&!C&&S!==0),Qe(([_,S])=>S),jl(1)),w),lt(De(f,Qe(_=>({top:-_}))),e),Er(De(d,Ut(p,m),Qe(([_,{lastSize:S,groupIndices:C,sizeTree:k},E])=>{function R(T){return T*(S+E)}if(C.length===0)return R(_);{let T=0;const A=hm(k,0);let M=0,B=0;for(;M<_;){M++,T+=A;let Q=C.length===B+1?1/0:C[B+1]-C[B]-1;M+Q>_&&(T-=A,Q=_-M+1),M+=Q,T+=R(Q),B++}return T}})),_=>{Nt(r,_),requestAnimationFrame(()=>{Nt(e,{top:_}),requestAnimationFrame(()=>{Nt(r,0),Nt(b,!1)})})}),{deviation:r}},Kr(Ti,tv,Ic,os,uu,uT)),jye=yr(([{didMount:e},{scrollTo:t},{listState:r}])=>{const n=Ve(0);return Er(De(e,Ut(n),Rt(([,i])=>i!==0),Qe(([,i])=>({top:i}))),i=>{ts(De(r,Sf(1),Rt(o=>o.items.length>1)),()=>{requestAnimationFrame(()=>{Nt(t,i)})})}),{initialScrollTop:n}},Kr(cu,Ti,Ic),{singleton:!0}),$ye=yr(([{viewportHeight:e},{totalListHeight:t}])=>{const r=Ve(!1),n=fi(De(Vn(r,e,t),Rt(([i])=>i),Qe(([,i,o])=>Math.max(0,i-o)),jl(0),Ur()),0);return{alignToBottom:r,paddingTopAddition:n}},Kr(Ti,n3),{singleton:!0}),pT=yr(([{scrollTo:e,scrollContainerState:t}])=>{const r=tr(),n=tr(),i=tr(),o=Ve(!1),a=Ve(void 0);return lt(De(Vn(r,n),Qe(([{viewportHeight:l,scrollTop:c,scrollHeight:d},{offsetTop:f}])=>({scrollTop:Math.max(0,c-f),scrollHeight:d,viewportHeight:l}))),t),lt(De(e,Ut(n),Qe(([l,{offsetTop:c}])=>({...l,top:l.top+c}))),i),{useWindowScroll:o,customScrollParent:a,windowScrollContainerState:r,windowViewportRect:n,windowScrollTo:i}},Kr(Ti)),Aye=({itemTop:e,itemBottom:t,viewportTop:r,viewportBottom:n,locationParams:{behavior:i,align:o,...a}})=>e<r?{...a,behavior:i,align:o??"start"}:t>n?{...a,behavior:i,align:o??"end"}:null,Dye=yr(([{sizes:e,totalCount:t,gap:r},{scrollTop:n,viewportHeight:i,headerHeight:o,fixedHeaderHeight:a,fixedFooterHeight:l,scrollingInProgress:c},{scrollToIndex:d}])=>{const f=tr();return lt(De(f,Ut(e,i,t,o,a,l,n),Ut(r),Qe(([[p,m,g,b,y,w,_,S],C])=>{const{done:k,behavior:E,align:R,calculateViewLocation:T=Aye,...A}=p,M=YV(p,m,b-1),B=pm(M,m.offsetTree,C)+y+w,Q=B+va(m.sizeTree,M)[1],se=S+w,ie=S+g-_,N=T({itemTop:B,itemBottom:Q,viewportTop:se,viewportBottom:ie,locationParams:{behavior:E,align:R,...A}});return N?k&&ts(De(c,Rt(X=>X===!1),Sf(di(c)?1:2)),k):k&&k(),N}),Rt(p=>p!==null)),d),{scrollIntoView:f}},Kr(os,Ti,ev,Ic,uu),{singleton:!0}),Mye=yr(([{sizes:e,sizeRanges:t},{scrollTop:r},{initialTopMostItemIndex:n},{didMount:i},{useWindowScroll:o,windowScrollContainerState:a,windowViewportRect:l}])=>{const c=tr(),d=Ve(void 0),f=Ve(null),p=Ve(null);return lt(a,f),lt(l,p),Er(De(c,Ut(e,r,o,f,p)),([m,g,b,y,w,_])=>{const S=gye(g.sizeTree);y&&w!==null&&_!==null&&(b=w.scrollTop-_.offsetTop),m({ranges:S,scrollTop:b})}),lt(De(d,Rt(aT),Qe(Nye)),n),lt(De(i,Ut(d),Rt(([,m])=>m!==void 0),Ur(),Qe(([,m])=>m.ranges)),t),{getState:c,restoreStateFrom:d}},Kr(os,Ti,rv,cu,pT));function Nye(e){return{offset:e.scrollTop,index:0,align:"start"}}const Fye=yr(([e,t,r,n,i,o,a,l,c,d])=>({...e,...t,...r,...n,...i,...o,...a,...l,...c,...d}),Kr(hT,Oye,cu,r3,n3,jye,$ye,pT,Dye,uu)),o3=yr(([{totalCount:e,sizeRanges:t,fixedItemSize:r,defaultItemSize:n,trackItemSizes:i,itemSize:o,data:a,firstItemIndex:l,groupIndices:c,statefulTotalCount:d,gap:f,sizes:p},{initialTopMostItemIndex:m,scrolledToInitialItem:g,initialItemFinalLocationReached:b},y,w,_,{listState:S,topItemsIndexes:C,...k},{scrollToIndex:E},R,{topItemCount:T},{groupCounts:A},M])=>(lt(k.rangeChanged,M.scrollSeekRangeChanged),lt(De(M.windowViewportRect,Qe(B=>B.visibleHeight)),y.viewportHeight),{totalCount:e,data:a,firstItemIndex:l,sizeRanges:t,initialTopMostItemIndex:m,scrolledToInitialItem:g,initialItemFinalLocationReached:b,topItemsIndexes:C,topItemCount:T,groupCounts:A,fixedItemHeight:r,defaultItemHeight:n,gap:f,..._,statefulTotalCount:d,listState:S,scrollToIndex:E,trackItemSizes:i,itemSize:o,groupIndices:c,...k,...M,...y,sizes:p,...w}),Kr(os,rv,Ti,Mye,Cye,Ic,ev,kye,Rye,ZV,Fye)),k_="-webkit-sticky",lA="sticky",a3=i3(()=>{if(typeof document>"u")return lA;const e=document.createElement("div");return e.style.position=k_,e.style.position===k_?k_:lA});function s3(e,t){const r=Re.useRef(null),n=Re.useCallback(l=>{if(l===null||!l.offsetParent)return;const c=l.getBoundingClientRect(),d=c.width;let f,p;if(t){const m=t.getBoundingClientRect(),g=c.top-m.top;f=m.height-Math.max(0,g),p=g+t.scrollTop}else f=window.innerHeight-Math.max(0,c.top),p=c.top+window.pageYOffset;r.current={offsetTop:p,visibleHeight:f,visibleWidth:d},e(r.current)},[e,t]),{callbackRef:i,ref:o}=lT(n),a=Re.useCallback(()=>{n(o.current)},[n,o]);return Re.useEffect(()=>{if(t){t.addEventListener("scroll",a);const l=new ResizeObserver(()=>{requestAnimationFrame(a)});return l.observe(t),()=>{t.removeEventListener("scroll",a),l.unobserve(t)}}else return window.addEventListener("scroll",a),window.addEventListener("resize",a),()=>{window.removeEventListener("scroll",a),window.removeEventListener("resize",a)}},[a,t]),i}const l3=Re.createContext(void 0),u3=Re.createContext(void 0);function mT(e){return e}const Lye=yr(()=>{const e=Ve(c=>`Item ${c}`),t=Ve(null),r=Ve(c=>`Group ${c}`),n=Ve({}),i=Ve(mT),o=Ve("div"),a=Ve(Oc),l=(c,d=null)=>fi(De(n,Qe(f=>f[c]),Ur()),d);return{context:t,itemContent:e,groupContent:r,components:n,computeItemKey:i,headerFooterTag:o,scrollerRef:a,FooterComponent:l("Footer"),HeaderComponent:l("Header"),TopItemListComponent:l("TopItemList"),ListComponent:l("List","div"),ItemComponent:l("Item","div"),GroupComponent:l("Group","div"),ScrollerComponent:l("Scroller","div"),EmptyPlaceholder:l("EmptyPlaceholder"),ScrollSeekPlaceholder:l("ScrollSeekPlaceholder")}}),Bye=yr(([e,t])=>({...e,...t}),Kr(o3,Lye)),Vye=({height:e})=>Re.createElement("div",{style:{height:e}}),zye={position:a3(),zIndex:1,overflowAnchor:"none"},qye={overflowAnchor:"none"},uA=Re.memo(function({showTopList:t=!1}){const r=Xt("listState"),n=No("sizeRanges"),i=Xt("useWindowScroll"),o=Xt("customScrollParent"),a=No("windowScrollContainerState"),l=No("scrollContainerState"),c=o||i?a:l,d=Xt("itemContent"),f=Xt("context"),p=Xt("groupContent"),m=Xt("trackItemSizes"),g=Xt("itemSize"),b=Xt("log"),y=No("gap"),{callbackRef:w}=iye(n,g,m,t?Oc:c,b,y,o),[_,S]=Re.useState(0);vT("deviation",N=>{_!==N&&S(N)});const C=Xt("EmptyPlaceholder"),k=Xt("ScrollSeekPlaceholder")||Vye,E=Xt("ListComponent"),R=Xt("ItemComponent"),T=Xt("GroupComponent"),A=Xt("computeItemKey"),M=Xt("isSeeking"),B=Xt("groupIndices").length>0,Q=Xt("alignToBottom"),se=Xt("initialItemFinalLocationReached"),ie=t?{}:{boxSizing:"border-box",paddingTop:r.offsetTop,paddingBottom:r.offsetBottom,marginTop:_!==0?_:Q?"auto":0,...se?{}:{visibility:"hidden"}};return!t&&r.totalCount===0&&C?Re.createElement(C,_i(C,f)):Re.createElement(E,{..._i(E,f),ref:w,style:ie,"data-testid":t?"virtuoso-top-item-list":"virtuoso-item-list"},(t?r.topItems:r.items).map(N=>{const X=N.originalIndex,ce=A(X+r.firstItemIndex,N.data,f);return M?Re.createElement(k,{..._i(k,f),key:ce,index:N.index,height:N.size,type:N.type||"item",...N.type==="group"?{}:{groupIndex:N.groupIndex}}):N.type==="group"?Re.createElement(T,{..._i(T,f),key:ce,"data-index":X,"data-known-size":N.size,"data-item-index":N.index,style:zye},p(N.index,f)):Re.createElement(R,{..._i(R,f),...Wye(R,N.data),key:ce,"data-index":X,"data-known-size":N.size,"data-item-index":N.index,"data-item-group-index":N.groupIndex,style:qye},B?d(N.index,N.groupIndex,N.data,f):d(N.index,N.data,f))}))}),Uye={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},hw=e=>({width:"100%",height:"100%",position:"absolute",top:0,...e?{display:"flex",flexDirection:"column"}:{}}),Hye={width:"100%",position:a3(),top:0,zIndex:1};function _i(e,t){if(typeof e!="string")return{context:t}}function Wye(e,t){return{item:typeof e=="string"?void 0:t}}const Kye=Re.memo(function(){const t=Xt("HeaderComponent"),r=No("headerHeight"),n=Xt("headerFooterTag"),i=Rc(a=>r(Zl(a,"height"))),o=Xt("context");return t?Re.createElement(n,{ref:i},Re.createElement(t,_i(t,o))):null}),Gye=Re.memo(function(){const t=Xt("FooterComponent"),r=No("footerHeight"),n=Xt("headerFooterTag"),i=Rc(a=>r(Zl(a,"height"))),o=Xt("context");return t?Re.createElement(n,{ref:i},Re.createElement(t,_i(t,o))):null});function c3({usePublisher:e,useEmitter:t,useEmitterValue:r}){return Re.memo(function({style:o,children:a,...l}){const c=e("scrollContainerState"),d=r("ScrollerComponent"),f=e("smoothScrollTargetReached"),p=r("scrollerRef"),m=r("context"),{scrollerRef:g,scrollByCallback:b,scrollToCallback:y}=qV(c,f,d,p);return t("scrollTo",y),t("scrollBy",b),Re.createElement(d,{ref:g,style:{...Uye,...o},"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,tabIndex:0,...l,..._i(d,m)},a)})}function d3({usePublisher:e,useEmitter:t,useEmitterValue:r}){return Re.memo(function({style:o,children:a,...l}){const c=e("windowScrollContainerState"),d=r("ScrollerComponent"),f=e("smoothScrollTargetReached"),p=r("totalListHeight"),m=r("deviation"),g=r("customScrollParent"),b=r("context"),{scrollerRef:y,scrollByCallback:w,scrollToCallback:_}=qV(c,f,d,Oc,g);return tye(()=>(y.current=g||window,()=>{y.current=null}),[y,g]),t("windowScrollTo",_),t("scrollBy",w),Re.createElement(d,{style:{position:"relative",...o,...p!==0?{height:p+m}:{}},"data-virtuoso-scroller":!0,...l,..._i(d,b)},a)})}const Qye=({children:e})=>{const t=Re.useContext(l3),r=No("viewportHeight"),n=No("fixedItemHeight"),i=Xt("alignToBottom"),o=Rc(FV(r,a=>Zl(a,"height")));return Re.useEffect(()=>{t&&(r(t.viewportHeight),n(t.itemHeight))},[t,r,n]),Re.createElement("div",{style:hw(i),ref:o,"data-viewport-type":"element"},e)},Yye=({children:e})=>{const t=Re.useContext(l3),r=No("windowViewportRect"),n=No("fixedItemHeight"),i=Xt("customScrollParent"),o=s3(r,i),a=Xt("alignToBottom");return Re.useEffect(()=>{t&&(n(t.itemHeight),r({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,r,n]),Re.createElement("div",{ref:o,style:hw(a),"data-viewport-type":"window"},e)},Xye=({children:e})=>{const t=Xt("TopItemListComponent")||"div",r=Xt("headerHeight"),n={...Hye,marginTop:`${r}px`},i=Xt("context");return Re.createElement(t,{style:n,..._i(t,i)},e)},Jye=Re.memo(function(t){const r=Xt("useWindowScroll"),n=Xt("topItemsIndexes").length>0,i=Xt("customScrollParent"),o=i||r?tbe:ebe,a=i||r?Yye:Qye;return Re.createElement(o,{...t},n&&Re.createElement(Xye,null,Re.createElement(uA,{showTopList:!0})),Re.createElement(a,null,Re.createElement(Kye,null),Re.createElement(uA,null),Re.createElement(Gye,null)))}),{Component:Zye,usePublisher:No,useEmitterValue:Xt,useEmitter:vT}=VV(Bye,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},Jye),ebe=c3({usePublisher:No,useEmitterValue:Xt,useEmitter:vT}),tbe=d3({usePublisher:No,useEmitterValue:Xt,useEmitter:vT}),pw=Zye,cA={items:[],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},rbe={items:[{index:0}],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},{round:dA,ceil:fA,floor:Kb,min:j_,max:Ep}=Math;function nbe(e){return{...rbe,items:e}}function hA(e,t,r){return Array.from({length:t-e+1}).map((n,i)=>{const o=r===null?null:r[i+e];return{index:i+e,data:o}})}function ibe(e,t){return e&&e.column===t.column&&e.row===t.row}function Ig(e,t){return e&&e.width===t.width&&e.height===t.height}const obe=yr(([{overscan:e,visibleRange:t,listBoundary:r},{scrollTop:n,viewportHeight:i,scrollBy:o,scrollTo:a,smoothScrollTargetReached:l,scrollContainerState:c,footerHeight:d,headerHeight:f},p,m,{propsReady:g,didMount:b},{windowViewportRect:y,useWindowScroll:w,customScrollParent:_,windowScrollContainerState:S,windowScrollTo:C},k])=>{const E=Ve(0),R=Ve(0),T=Ve(cA),A=Ve({height:0,width:0}),M=Ve({height:0,width:0}),B=tr(),Q=tr(),se=Ve(0),ie=Ve(null),N=Ve({row:0,column:0}),X=tr(),ce=tr(),ne=Ve(!1),ee=Ve(0),ge=Ve(!0),Z=Ve(!1);Er(De(b,Ut(ee),Rt(([V,de])=>!!de)),()=>{Nt(ge,!1),Nt(R,0)}),Er(De(Vn(b,ge,M,A,ee,Z),Rt(([V,de,pe,Ee,,Me])=>V&&!de&&pe.height!==0&&Ee.height!==0&&!Me)),([,,,,V])=>{Nt(Z,!0),dT(1,()=>{Nt(B,V)}),ts(De(n),()=>{Nt(r,[0,0]),Nt(ge,!0)})}),lt(De(ce,Rt(V=>V!=null&&V.scrollTop>0),Fa(0)),R),Er(De(b,Ut(ce),Rt(([,V])=>V!=null)),([,V])=>{V&&(Nt(A,V.viewport),Nt(M,V==null?void 0:V.item),Nt(N,V.gap),V.scrollTop>0&&(Nt(ne,!0),ts(De(n,Sf(1)),de=>{Nt(ne,!1)}),Nt(a,{top:V.scrollTop})))}),lt(De(A,Qe(({height:V})=>V)),i),lt(De(Vn(kt(A,Ig),kt(M,Ig),kt(N,(V,de)=>V&&V.column===de.column&&V.row===de.row),kt(n)),Qe(([V,de,pe,Ee])=>({viewport:V,item:de,gap:pe,scrollTop:Ee}))),X),lt(De(Vn(kt(E),t,kt(N,ibe),kt(M,Ig),kt(A,Ig),kt(ie),kt(R),kt(ne),kt(ge),kt(ee)),Rt(([,,,,,,,V])=>!V),Qe(([V,[de,pe],Ee,Me,Y,K,we,,Te,he])=>{const{row:Ce,column:Ge}=Ee,{height:$t,width:Kt}=Me,{width:It}=Y;if(we===0&&(V===0||It===0))return cA;if(Kt===0){const an=fT(he,V),sn=an===0?Math.max(we-1,0):an;return nbe(hA(an,sn,K))}const jt=f3(It,Kt,Ge);let Lt,ht;Te?de===0&&pe===0&&we>0?(Lt=0,ht=we-1):(Lt=jt*Kb((de+Ce)/($t+Ce)),ht=jt*fA((pe+Ce)/($t+Ce))-1,ht=j_(V-1,Ep(ht,jt-1)),Lt=j_(ht,Ep(0,Lt))):(Lt=0,ht=-1);const on=hA(Lt,ht,K),{top:mn,bottom:Ir}=pA(Y,Ee,Me,on),Jr=fA(V/jt),Nr=Jr*$t+(Jr-1)*Ce-Ir;return{items:on,offsetTop:mn,offsetBottom:Nr,top:mn,bottom:Ir,itemHeight:$t,itemWidth:Kt}})),T),lt(De(ie,Rt(V=>V!==null),Qe(V=>V.length)),E),lt(De(Vn(A,M,T,N),Rt(([V,de,{items:pe}])=>pe.length>0&&de.height!==0&&V.height!==0),Qe(([V,de,{items:pe},Ee])=>{const{top:Me,bottom:Y}=pA(V,Ee,de,pe);return[Me,Y]}),Ur(vm)),r);const j=Ve(!1);lt(De(n,Ut(j),Qe(([V,de])=>de||V!==0)),j);const U=uo(De(kt(T),Rt(({items:V})=>V.length>0),Ut(E,j),Rt(([{items:V},de,pe])=>pe&&V[V.length-1].index===de-1),Qe(([,V])=>V-1),Ur())),q=uo(De(kt(T),Rt(({items:V})=>V.length>0&&V[0].index===0),Fa(0),Ur())),$=uo(De(kt(T),Ut(ne),Rt(([{items:V},de])=>V.length>0&&!de),Qe(([{items:V}])=>({startIndex:V[0].index,endIndex:V[V.length-1].index})),Ur(e3),jl(0)));lt($,m.scrollSeekRangeChanged),lt(De(B,Ut(A,M,E,N),Qe(([V,de,pe,Ee,Me])=>{const Y=JV(V),{align:K,behavior:we,offset:Te}=Y;let he=Y.index;he==="LAST"&&(he=Ee-1),he=Ep(0,he,j_(Ee-1,he));let Ce=LP(de,Me,pe,he);return K==="end"?Ce=dA(Ce-de.height+pe.height):K==="center"&&(Ce=dA(Ce-de.height/2+pe.height/2)),Te&&(Ce+=Te),{top:Ce,behavior:we}})),a);const F=fi(De(T,Qe(V=>V.offsetBottom+V.bottom)),0);return lt(De(y,Qe(V=>({width:V.visibleWidth,height:V.visibleHeight}))),A),{data:ie,totalCount:E,viewportDimensions:A,itemDimensions:M,scrollTop:n,scrollHeight:Q,overscan:e,scrollBy:o,scrollTo:a,scrollToIndex:B,smoothScrollTargetReached:l,windowViewportRect:y,windowScrollTo:C,useWindowScroll:w,customScrollParent:_,windowScrollContainerState:S,deviation:se,scrollContainerState:c,footerHeight:d,headerHeight:f,initialItemCount:R,gap:N,restoreStateFrom:ce,...m,initialTopMostItemIndex:ee,gridState:T,totalListHeight:F,...p,startReached:q,endReached:U,rangeChanged:$,stateChanged:X,propsReady:g,stateRestoreInProgress:ne,...k}},Kr(hT,Ti,tv,r3,cu,pT,uu));function pA(e,t,r,n){const{height:i}=r;if(i===void 0||n.length===0)return{top:0,bottom:0};const o=LP(e,t,r,n[0].index),a=LP(e,t,r,n[n.length-1].index)+i;return{top:o,bottom:a}}function LP(e,t,r,n){const i=f3(e.width,r.width,t.column),o=Kb(n/i),a=o*r.height+Ep(0,o-1)*t.row;return a>0?a+t.row:a}function f3(e,t,r){return Ep(1,Kb((e+r)/(Kb(t)+r)))}const abe=yr(()=>{const e=Ve(d=>`Item ${d}`),t=Ve({}),r=Ve(null),n=Ve("virtuoso-grid-item"),i=Ve("virtuoso-grid-list"),o=Ve(mT),a=Ve("div"),l=Ve(Oc),c=(d,f=null)=>fi(De(t,Qe(p=>p[d]),Ur()),f);return{context:r,itemContent:e,components:t,computeItemKey:o,itemClassName:n,listClassName:i,headerFooterTag:a,scrollerRef:l,FooterComponent:c("Footer"),HeaderComponent:c("Header"),ListComponent:c("List","div"),ItemComponent:c("Item","div"),ScrollerComponent:c("Scroller","div"),ScrollSeekPlaceholder:c("ScrollSeekPlaceholder","div")}}),sbe=yr(([e,t])=>({...e,...t}),Kr(obe,abe)),lbe=Re.memo(function(){const t=tn("gridState"),r=tn("listClassName"),n=tn("itemClassName"),i=tn("itemContent"),o=tn("computeItemKey"),a=tn("isSeeking"),l=pa("scrollHeight"),c=tn("ItemComponent"),d=tn("ListComponent"),f=tn("ScrollSeekPlaceholder"),p=tn("context"),m=pa("itemDimensions"),g=pa("gap"),b=tn("log"),y=tn("stateRestoreInProgress"),w=Rc(_=>{const S=_.parentElement.parentElement.scrollHeight;l(S);const C=_.firstChild;if(C){const{width:k,height:E}=C.getBoundingClientRect();m({width:k,height:E})}g({row:mA("row-gap",getComputedStyle(_).rowGap,b),column:mA("column-gap",getComputedStyle(_).columnGap,b)})});return y?null:Re.createElement(d,{ref:w,className:r,..._i(d,p),style:{paddingTop:t.offsetTop,paddingBottom:t.offsetBottom},"data-testid":"virtuoso-item-list"},t.items.map(_=>{const S=o(_.index,_.data,p);return a?Re.createElement(f,{key:S,..._i(f,p),index:_.index,height:t.itemHeight,width:t.itemWidth}):Re.createElement(c,{..._i(c,p),className:n,"data-index":_.index,key:S},i(_.index,_.data,p))}))}),ube=Re.memo(function(){const t=tn("HeaderComponent"),r=pa("headerHeight"),n=tn("headerFooterTag"),i=Rc(a=>r(Zl(a,"height"))),o=tn("context");return t?Re.createElement(n,{ref:i},Re.createElement(t,_i(t,o))):null}),cbe=Re.memo(function(){const t=tn("FooterComponent"),r=pa("footerHeight"),n=tn("headerFooterTag"),i=Rc(a=>r(Zl(a,"height"))),o=tn("context");return t?Re.createElement(n,{ref:i},Re.createElement(t,_i(t,o))):null}),dbe=({children:e})=>{const t=Re.useContext(u3),r=pa("itemDimensions"),n=pa("viewportDimensions"),i=Rc(o=>{n(o.getBoundingClientRect())});return Re.useEffect(()=>{t&&(n({height:t.viewportHeight,width:t.viewportWidth}),r({height:t.itemHeight,width:t.itemWidth}))},[t,n,r]),Re.createElement("div",{style:hw(!1),ref:i},e)},fbe=({children:e})=>{const t=Re.useContext(u3),r=pa("windowViewportRect"),n=pa("itemDimensions"),i=tn("customScrollParent"),o=s3(r,i);return Re.useEffect(()=>{t&&(n({height:t.itemHeight,width:t.itemWidth}),r({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,r,n]),Re.createElement("div",{ref:o,style:hw(!1)},e)},hbe=Re.memo(function({...t}){const r=tn("useWindowScroll"),n=tn("customScrollParent"),i=n||r?mbe:pbe,o=n||r?fbe:dbe;return Re.createElement(i,{...t},Re.createElement(o,null,Re.createElement(ube,null),Re.createElement(lbe,null),Re.createElement(cbe,null)))}),{usePublisher:pa,useEmitterValue:tn,useEmitter:h3}=VV(sbe,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged"}},hbe),pbe=c3({usePublisher:pa,useEmitterValue:tn,useEmitter:h3}),mbe=d3({usePublisher:pa,useEmitterValue:tn,useEmitter:h3});function mA(e,t,r){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&r(`${e} was not resolved to pixel value correctly`,t,co.WARN),t==="normal"?0:parseInt(t??"0",10)}const vbe=yr(()=>{const e=Ve(c=>Re.createElement("td",null,"Item $",c)),t=Ve(null),r=Ve(null),n=Ve(null),i=Ve({}),o=Ve(mT),a=Ve(Oc),l=(c,d=null)=>fi(De(i,Qe(f=>f[c]),Ur()),d);return{context:t,itemContent:e,fixedHeaderContent:r,fixedFooterContent:n,components:i,computeItemKey:o,scrollerRef:a,TableComponent:l("Table","table"),TableHeadComponent:l("TableHead","thead"),TableFooterComponent:l("TableFoot","tfoot"),TableBodyComponent:l("TableBody","tbody"),TableRowComponent:l("TableRow","tr"),ScrollerComponent:l("Scroller","div"),EmptyPlaceholder:l("EmptyPlaceholder"),ScrollSeekPlaceholder:l("ScrollSeekPlaceholder"),FillerRow:l("FillerRow")}});Kr(o3,vbe);const gbe=Ne`
|
1352
|
+
`,Vge=async e=>{const t=await xr.mutate({mutation:Bge,variables:e});if(!t.data)throw t.errors;return t.data};class zge{constructor(t,r,n,i,o){this.rootStore=t,this.organizationId=r,this.projectName=n,this.branchName=i,this.fromRevisionId=o}get projectVariables(){return{organizationId:this.organizationId,projectName:this.projectName,branchName:this.branchName,fromRevisionId:this.fromRevisionId}}async execute(){const t=await this.createProjectRequest();return await this.refetchProjectsConnection(),t}async createProjectRequest(){const{createProject:t}=await Vge({data:this.projectVariables});return this.addProjectToCache(t)}addProjectToCache(t){const r=this.rootStore.cache.addProject(dV(t));return this.rootStore.cache.addProjectByVariables(this.projectVariables,r.id),r}async refetchProjectsConnection(){await this.rootStore.backend.queryMeProjects({first:100})}}class qge{constructor(t,r){Pe(this,"projectName","");Pe(this,"branchName","");Pe(this,"fromRevisionId","");Pe(this,"showingSettings",!1);this.rootStore=t,this.authService=r,st(this)}get organizationId(){var r;const t=(r=this.authService.user)==null?void 0:r.organizationId;if(!t)throw new Error("Not found organizationId");return t}setProjectName(t){this.projectName=t}setBranchName(t){this.branchName=t}setFromRevisionId(t){this.fromRevisionId=t}setShowingSettings(t){this.showingSettings=t}async create(){try{await new zge(this.rootStore,this.organizationId,this.projectName,this.branchName,this.fromRevisionId).execute()}catch(t){console.error(t)}}init(){}dispose(){}}const Uge=()=>{const[e]=O.useState(()=>{const t=dt.get(qi);return new qge(ct,t)});return O.useEffect(()=>(e.init(),()=>e.dispose()),[e]),e},MV=({onClick:e,color:t,dataTestId:r})=>{const[n,i]=O.useState(!1),o=O.useCallback(async()=>{i(!0),await(e==null?void 0:e()),i(!1)},[e]);return x.jsx(Ci,{_hover:{backgroundColor:"gray.100"},"data-testid":r,"aria-label":"",color:t||"gray.400",icon:x.jsx(Pce,{}),isLoading:n,variant:"ghost",onClick:o})},Hge=Ot(({onCancel:e,onAdd:t})=>{const r=Uge(),[n,i]=O.useState(!1),o=O.useCallback(async()=>{i(!0),await r.create(),i(!1),t==null||t()},[t,r]),a=O.useCallback(f=>{r.setProjectName(f.currentTarget.value)},[r]),l=O.useCallback(f=>{r.setBranchName(f.currentTarget.value)},[r]),c=O.useCallback(f=>{r.setFromRevisionId(f.currentTarget.value)},[r]),d=O.useCallback(()=>{r.setShowingSettings(!r.showingSettings)},[r]);return x.jsxs(je,{alignSelf:"flex-start",gap:"0.5rem",children:[x.jsx(Z0,{onClick:e}),x.jsxs(je,{flexDirection:"column",gap:"0.5rem",children:[x.jsx(js,{dataTestId:"create-project-name-input",autoFocus:!0,height:"40px",placeholder:"project name",value:r.projectName,onChange:a,onEnter:o}),r.projectName&&r.showingSettings&&x.jsxs(x.Fragment,{children:[x.jsx(js,{dataTestId:"create-project-branch-name-input",height:"40px",placeholder:"branch name",value:r.branchName,onChange:l,onEnter:o}),x.jsx(js,{dataTestId:"create-project-from-revision-id-input",height:"40px",placeholder:"from revisionId",value:r.fromRevisionId,onChange:c,onEnter:o})]})]}),r.projectName&&x.jsxs(x.Fragment,{children:[x.jsx(Qm,{dataTestId:"create-project-approve-button",loading:n,onClick:o}),x.jsx(MV,{dataTestId:"create-project-settings-button",color:r.showingSettings?"gray.400":"gray.200",onClick:d})]})]})}),uw=0,lu=1,Vf=2,NV=4;function FV(e,t){return r=>e(t(r))}function Wge(e,t){return t(e)}function LV(e,t){return r=>e(t,r)}function XA(e,t){return()=>e(t)}function cw(e,t){return t(e),e}function Kr(...e){return e}function Kge(e){e()}function JA(e){return()=>e}function Gge(...e){return()=>{e.map(Kge)}}function aT(e){return e!==void 0}function Oc(){}function Er(e,t){return e(lu,t)}function Nt(e,t){e(uw,t)}function sT(e){e(Vf)}function di(e){return e(NV)}function lt(e,t){return Er(e,LV(t,uw))}function ts(e,t){const r=e(lu,n=>{r(),t(n)});return r}function tr(){const e=[];return(t,r)=>{switch(t){case Vf:e.splice(0,e.length);return;case lu:return e.push(r),()=>{const n=e.indexOf(r);n>-1&&e.splice(n,1)};case uw:e.slice().forEach(n=>{n(r)});return;default:throw new Error(`unrecognized action ${t}`)}}}function Ve(e){let t=e;const r=tr();return(n,i)=>{switch(n){case lu:i(t);break;case uw:t=i;break;case NV:return t}return r(n,i)}}function Qge(e){let t,r;const n=()=>t&&t();return function(i,o){switch(i){case lu:return o?r===o?void 0:(n(),r=o,t=Er(e,o),t):(n(),Oc);case Vf:n(),r=null;return;default:throw new Error(`unrecognized action ${i}`)}}}function uo(e){return cw(tr(),t=>lt(e,t))}function fi(e,t){return cw(Ve(t),r=>lt(e,r))}function Yge(...e){return t=>e.reduceRight(Wge,t)}function De(e,...t){const r=Yge(...t);return(n,i)=>{switch(n){case lu:return Er(e,r(i));case Vf:sT(e);return}}}function BV(e,t){return e===t}function Ur(e=BV){let t;return r=>n=>{e(t,n)||(t=n,r(n))}}function Rt(e){return t=>r=>{e(r)&&t(r)}}function Qe(e){return t=>FV(t,e)}function Fa(e){return t=>()=>t(e)}function qa(e,t){return r=>n=>r(t=e(t,n))}function Sf(e){return t=>r=>{e>0?e--:t(r)}}function jl(e){let t=null,r;return n=>i=>{t=i,!r&&(r=setTimeout(()=>{r=void 0,n(t)},e))}}function ZA(e){let t,r;return n=>i=>{t=i,r&&clearTimeout(r),r=setTimeout(()=>{n(t)},e)}}function Ut(...e){const t=new Array(e.length);let r=0,n=null;const i=Math.pow(2,e.length)-1;return e.forEach((o,a)=>{const l=Math.pow(2,a);Er(o,c=>{const d=r;r=r|l,t[a]=c,d!==i&&r===i&&n&&(n(),n=null)})}),o=>a=>{const l=()=>o([a].concat(t));r===i?l():n=l}}function e2(...e){return function(t,r){switch(t){case lu:return Gge(...e.map(n=>Er(n,r)));case Vf:return;default:throw new Error(`unrecognized action ${t}`)}}}function kt(e,t=BV){return De(e,Ur(t))}function Vn(...e){const t=tr(),r=new Array(e.length);let n=0;const i=Math.pow(2,e.length)-1;return e.forEach((o,a)=>{const l=Math.pow(2,a);Er(o,c=>{r[a]=c,n=n|l,n===i&&Nt(t,r)})}),function(o,a){switch(o){case lu:return n===i&&a(r),Er(t,a);case Vf:return sT(t);default:throw new Error(`unrecognized action ${o}`)}}}function yr(e,t=[],{singleton:r}={singleton:!0}){return{id:Xge(),constructor:e,dependencies:t,singleton:r}}const Xge=()=>Symbol();function Jge(e){const t=new Map,r=({id:n,constructor:i,dependencies:o,singleton:a})=>{if(a&&t.has(n))return t.get(n);const l=i(o.map(c=>r(c)));return a&&t.set(n,l),l};return r(e)}function Zge(e,t){const r={},n={};let i=0;const o=e.length;for(;i<o;)n[e[i]]=1,i+=1;for(const a in t)n.hasOwnProperty(a)||(r[a]=t[a]);return r}const Rg=typeof document<"u"?Re.useLayoutEffect:Re.useEffect;function VV(e,t,r){const n=Object.keys(t.required||{}),i=Object.keys(t.optional||{}),o=Object.keys(t.methods||{}),a=Object.keys(t.events||{}),l=Re.createContext({});function c(_,S){_.propsReady&&Nt(_.propsReady,!1);for(const C of n){const k=_[t.required[C]];Nt(k,S[C])}for(const C of i)if(C in S){const k=_[t.optional[C]];Nt(k,S[C])}_.propsReady&&Nt(_.propsReady,!0)}function d(_){return o.reduce((S,C)=>(S[C]=k=>{const E=_[t.methods[C]];Nt(E,k)},S),{})}function f(_){return a.reduce((S,C)=>(S[C]=Qge(_[t.events[C]]),S),{})}const p=Re.forwardRef((_,S)=>{const{children:C,...k}=_,[E]=Re.useState(()=>cw(Jge(e),T=>c(T,k))),[R]=Re.useState(XA(f,E));return Rg(()=>{for(const T of a)T in k&&Er(R[T],k[T]);return()=>{Object.values(R).map(sT)}},[k,R,E]),Rg(()=>{c(E,k)}),Re.useImperativeHandle(S,JA(d(E))),Re.createElement(l.Provider,{value:E},r?Re.createElement(r,Zge([...n,...i,...a],k),C):C)}),m=_=>Re.useCallback(LV(Nt,Re.useContext(l)[_]),[_]),g=_=>{const C=Re.useContext(l)[_],k=Re.useCallback(E=>Er(C,E),[C]);return Re.useSyncExternalStore(k,()=>di(C),()=>di(C))},b=_=>{const C=Re.useContext(l)[_],[k,E]=Re.useState(XA(di,C));return Rg(()=>Er(C,R=>{R!==k&&E(JA(R))}),[C,k]),k},y=Re.version.startsWith("18")?g:b;return{Component:p,usePublisher:m,useEmitterValue:y,useEmitter:(_,S)=>{const k=Re.useContext(l)[_];Rg(()=>Er(k,S),[S,k])}}}const eye=typeof document<"u"?Re.useLayoutEffect:Re.useEffect,tye=eye;var co=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e))(co||{});const rye={0:"debug",1:"log",2:"warn",3:"error"},nye=()=>typeof globalThis>"u"?window:globalThis,uu=yr(()=>{const e=Ve(3);return{log:Ve((r,n,i=1)=>{var o;const a=(o=nye().VIRTUOSO_LOG_LEVEL)!=null?o:di(e);i>=a&&console[rye[i]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",r,n)}),logLevel:e}},[],{singleton:!0});function lT(e,t=!0){const r=Re.useRef(null);let n=i=>{};if(typeof ResizeObserver<"u"){const i=Re.useMemo(()=>new ResizeObserver(o=>{requestAnimationFrame(()=>{const a=o[0].target;a.offsetParent!==null&&e(a)})}),[e]);n=o=>{o&&t?(i.observe(o),r.current=o):(r.current&&i.unobserve(r.current),r.current=null)}}return{ref:r,callbackRef:n}}function Rc(e,t=!0){return lT(e,t).callbackRef}function iye(e,t,r,n,i,o,a){const l=Re.useCallback(c=>{const d=oye(c.children,t,"offsetHeight",i);let f=c.parentElement;for(;!f.dataset.virtuosoScroller;)f=f.parentElement;const p=f.lastElementChild.dataset.viewportType==="window",m=a?a.scrollTop:p?window.pageYOffset||document.documentElement.scrollTop:f.scrollTop,g=a?a.scrollHeight:p?document.documentElement.scrollHeight:f.scrollHeight,b=a?a.offsetHeight:p?window.innerHeight:f.offsetHeight;n({scrollTop:Math.max(m,0),scrollHeight:g,viewportHeight:b}),o==null||o(aye("row-gap",getComputedStyle(c).rowGap,i)),d!==null&&e(d)},[e,t,i,o,a,n]);return lT(l,r)}function oye(e,t,r,n){const i=e.length;if(i===0)return null;const o=[];for(let a=0;a<i;a++){const l=e.item(a);if(!l||l.dataset.index===void 0)continue;const c=parseInt(l.dataset.index),d=parseFloat(l.dataset.knownSize),f=t(l,r);if(f===0&&n("Zero-sized element, this should not happen",{child:l},co.ERROR),f===d)continue;const p=o[o.length-1];o.length===0||p.size!==f||p.endIndex!==c-1?o.push({startIndex:c,endIndex:c,size:f}):o[o.length-1].endIndex++}return o}function aye(e,t,r){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&r(`${e} was not resolved to pixel value correctly`,t,co.WARN),t==="normal"?0:parseInt(t??"0",10)}function Zl(e,t){return Math.round(e.getBoundingClientRect()[t])}function zV(e,t){return Math.abs(e-t)<1.01}function qV(e,t,r,n=Oc,i){const o=Re.useRef(null),a=Re.useRef(null),l=Re.useRef(null),c=Re.useCallback(p=>{const m=p.target,g=m===window||m===document,b=g?window.pageYOffset||document.documentElement.scrollTop:m.scrollTop,y=g?document.documentElement.scrollHeight:m.scrollHeight,w=g?window.innerHeight:m.offsetHeight,_=()=>{e({scrollTop:Math.max(b,0),scrollHeight:y,viewportHeight:w})};p.suppressFlushSync?_():OM.flushSync(_),a.current!==null&&(b===a.current||b<=0||b===y-w)&&(a.current=null,t(!0),l.current&&(clearTimeout(l.current),l.current=null))},[e,t]);Re.useEffect(()=>{const p=i||o.current;return n(i||o.current),c({target:p,suppressFlushSync:!0}),p.addEventListener("scroll",c,{passive:!0}),()=>{n(null),p.removeEventListener("scroll",c)}},[o,c,r,n,i]);function d(p){const m=o.current;if(!m||"offsetHeight"in m&&m.offsetHeight===0)return;const g=p.behavior==="smooth";let b,y,w;m===window?(y=Math.max(Zl(document.documentElement,"height"),document.documentElement.scrollHeight),b=window.innerHeight,w=document.documentElement.scrollTop):(y=m.scrollHeight,b=Zl(m,"height"),w=m.scrollTop);const _=y-b;if(p.top=Math.ceil(Math.max(Math.min(_,p.top),0)),zV(b,y)||p.top===w){e({scrollTop:w,scrollHeight:y,viewportHeight:b}),g&&t(!0);return}g?(a.current=p.top,l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{l.current=null,a.current=null,t(!0)},1e3)):a.current=null,m.scrollTo(p)}function f(p){o.current.scrollBy(p)}return{scrollerRef:o,scrollByCallback:f,scrollToCallback:d}}const Ti=yr(()=>{const e=tr(),t=tr(),r=Ve(0),n=tr(),i=Ve(0),o=tr(),a=tr(),l=Ve(0),c=Ve(0),d=Ve(0),f=Ve(0),p=tr(),m=tr(),g=Ve(!1);return lt(De(e,Qe(({scrollTop:b})=>b)),t),lt(De(e,Qe(({scrollHeight:b})=>b)),a),lt(t,i),{scrollContainerState:e,scrollTop:t,viewportHeight:o,headerHeight:l,fixedHeaderHeight:c,fixedFooterHeight:d,footerHeight:f,scrollHeight:a,smoothScrollTargetReached:n,scrollTo:p,scrollBy:m,statefulScrollTop:i,deviation:r,scrollingInProgress:g}},[],{singleton:!0}),fm={lvl:0};function UV(e,t,r,n=fm,i=fm){return{k:e,v:t,lvl:r,l:n,r:i}}function jr(e){return e===fm}function Jd(){return fm}function DP(e,t){if(jr(e))return fm;const{k:r,l:n,r:i}=e;if(t===r){if(jr(n))return i;if(jr(i))return n;{const[o,a]=HV(n);return rb(kn(e,{k:o,v:a,l:WV(n)}))}}else return t<r?rb(kn(e,{l:DP(n,t)})):rb(kn(e,{r:DP(i,t)}))}function hm(e,t){if(!jr(e))return t===e.k?e.v:t<e.k?hm(e.l,t):hm(e.r,t)}function va(e,t,r="k"){if(jr(e))return[-1/0,void 0];if(Number(e[r])===t)return[e.k,e.v];if(Number(e[r])<t){const n=va(e.r,t,r);return n[0]===-1/0?[e.k,e.v]:n}return va(e.l,t,r)}function oo(e,t,r){return jr(e)?UV(t,r,1):t===e.k?kn(e,{k:t,v:r}):t<e.k?t2(kn(e,{l:oo(e.l,t,r)})):t2(kn(e,{r:oo(e.r,t,r)}))}function MP(e,t,r){if(jr(e))return[];const{k:n,v:i,l:o,r:a}=e;let l=[];return n>t&&(l=l.concat(MP(o,t,r))),n>=t&&n<=r&&l.push({k:n,v:i}),n<=r&&(l=l.concat(MP(a,t,r))),l}function Uu(e){return jr(e)?[]:[...Uu(e.l),{k:e.k,v:e.v},...Uu(e.r)]}function HV(e){return jr(e.r)?[e.k,e.v]:HV(e.r)}function WV(e){return jr(e.r)?e.l:rb(kn(e,{r:WV(e.r)}))}function kn(e,t){return UV(t.k!==void 0?t.k:e.k,t.v!==void 0?t.v:e.v,t.lvl!==void 0?t.lvl:e.lvl,t.l!==void 0?t.l:e.l,t.r!==void 0?t.r:e.r)}function R_(e){return jr(e)||e.lvl>e.r.lvl}function t2(e){return NP(GV(e))}function rb(e){const{l:t,r,lvl:n}=e;if(r.lvl>=n-1&&t.lvl>=n-1)return e;if(n>r.lvl+1){if(R_(t))return GV(kn(e,{lvl:n-1}));if(!jr(t)&&!jr(t.r))return kn(t.r,{l:kn(t,{r:t.r.l}),r:kn(e,{l:t.r.r,lvl:n-1}),lvl:n});throw new Error("Unexpected empty nodes")}else{if(R_(e))return NP(kn(e,{lvl:n-1}));if(!jr(r)&&!jr(r.l)){const i=r.l,o=R_(i)?r.lvl-1:r.lvl;return kn(i,{l:kn(e,{r:i.l,lvl:n-1}),r:NP(kn(r,{l:i.r,lvl:o})),lvl:i.lvl+1})}else throw new Error("Unexpected empty nodes")}}function dw(e,t,r){if(jr(e))return[];const n=va(e,t)[0];return sye(MP(e,n,r))}function KV(e,t){const r=e.length;if(r===0)return[];let{index:n,value:i}=t(e[0]);const o=[];for(let a=1;a<r;a++){const{index:l,value:c}=t(e[a]);o.push({start:n,end:l-1,value:i}),n=l,i=c}return o.push({start:n,end:1/0,value:i}),o}function sye(e){return KV(e,({k:t,v:r})=>({index:t,value:r}))}function NP(e){const{r:t,lvl:r}=e;return!jr(t)&&!jr(t.r)&&t.lvl===r&&t.r.lvl===r?kn(t,{l:kn(e,{r:t.l}),lvl:r+1}):e}function GV(e){const{l:t}=e;return!jr(t)&&t.lvl===e.lvl?kn(t,{r:kn(e,{l:t.r})}):e}function Ub(e,t,r,n=0){let i=e.length-1;for(;n<=i;){const o=Math.floor((n+i)/2),a=e[o],l=r(a,t);if(l===0)return o;if(l===-1){if(i-n<2)return o-1;i=o-1}else{if(i===n)return o;n=o+1}}throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function QV(e,t,r){return e[Ub(e,t,r)]}function lye(e,t,r,n){const i=Ub(e,t,n),o=Ub(e,r,n,i);return e.slice(i,o+1)}const uT=yr(()=>({recalcInProgress:Ve(!1)}),[],{singleton:!0});function uye(e){const{size:t,startIndex:r,endIndex:n}=e;return i=>i.start===r&&(i.end===n||i.end===1/0)&&i.value===t}function r2(e,t){let r=0,n=0;for(;r<e;)r+=t[n+1]-t[n]-1,n++;return n-(r===e?0:1)}function cye(e,t){let r=jr(e)?0:1/0;for(const n of t){const{size:i,startIndex:o,endIndex:a}=n;if(r=Math.min(r,o),jr(e)){e=oo(e,0,i);continue}const l=dw(e,o-1,a+1);if(l.some(uye(n)))continue;let c=!1,d=!1;for(const{start:f,end:p,value:m}of l)c?(a>=f||i===m)&&(e=DP(e,f)):(d=m!==i,c=!0),p>a&&a>=f&&m!==i&&(e=oo(e,a+1,m));d&&(e=oo(e,o,i))}return[e,r]}function dye(){return{offsetTree:[],sizeTree:Jd(),groupOffsetTree:Jd(),lastIndex:0,lastOffset:0,lastSize:0,groupIndices:[]}}function cT({index:e},t){return t===e?0:t<e?-1:1}function fye({offset:e},t){return t===e?0:t<e?-1:1}function hye(e){return{index:e.index,value:e}}function pye(e,t,r,n=0){return n>0&&(t=Math.max(t,QV(e,n,cT).offset)),KV(lye(e,t,r,fye),hye)}function FP(e,t,r,n){let i=e,o=0,a=0,l=0,c=0;if(t!==0){c=Ub(i,t-1,cT),l=i[c].offset;const f=va(r,t-1);o=f[0],a=f[1],i.length&&i[c].size===va(r,t)[1]&&(c-=1),i=i.slice(0,c+1)}else i=[];for(const{start:d,value:f}of dw(r,t,1/0)){const p=d-o,m=p*a+l+p*n;i.push({offset:m,size:f,index:d}),o=d,l=m,a=f}return{offsetTree:i,lastIndex:o,lastOffset:l,lastSize:a}}function mye(e,[t,r,n,i]){t.length>0&&n("received item sizes",t,co.DEBUG);const o=e.sizeTree;let a=o,l=0;if(r.length>0&&jr(o)&&t.length===2){const m=t[0].size,g=t[1].size;a=r.reduce((b,y)=>oo(oo(b,y,m),y+1,g),a)}else[a,l]=cye(a,t);if(a===o)return e;const{offsetTree:c,lastIndex:d,lastSize:f,lastOffset:p}=FP(e.offsetTree,l,a,i);return{sizeTree:a,offsetTree:c,lastIndex:d,lastOffset:p,lastSize:f,groupOffsetTree:r.reduce((m,g)=>oo(m,g,pm(g,c,i)),Jd()),groupIndices:r}}function pm(e,t,r){if(t.length===0)return 0;const{offset:n,index:i,size:o}=QV(t,e,cT),a=e-i,l=o*a+(a-1)*r+n;return l>0?l+r:l}function vye(e){return typeof e.groupIndex<"u"}function YV(e,t,r){if(vye(e))return t.groupIndices[e.groupIndex]+1;{const n=e.index==="LAST"?r:e.index;let i=XV(n,t);return i=Math.max(0,i,Math.min(r,i)),i}}function XV(e,t){if(!fw(t))return e;let r=0;for(;t.groupIndices[r]<=e+r;)r++;return e+r}function fw(e){return!jr(e.groupOffsetTree)}function gye(e){return Uu(e).map(({k:t,v:r},n,i)=>{const o=i[n+1],a=o?o.k-1:1/0;return{startIndex:t,endIndex:a,size:r}})}const yye={offsetHeight:"height",offsetWidth:"width"},os=yr(([{log:e},{recalcInProgress:t}])=>{const r=tr(),n=tr(),i=fi(n,0),o=tr(),a=tr(),l=Ve(0),c=Ve([]),d=Ve(void 0),f=Ve(void 0),p=Ve((E,R)=>Zl(E,yye[R])),m=Ve(void 0),g=Ve(0),b=dye(),y=fi(De(r,Ut(c,e,g),qa(mye,b),Ur()),b),w=fi(De(c,Ur(),qa((E,R)=>({prev:E.current,current:R}),{prev:[],current:[]}),Qe(({prev:E})=>E)),[]);lt(De(c,Rt(E=>E.length>0),Ut(y,g),Qe(([E,R,T])=>{const A=E.reduce((M,B,Q)=>oo(M,B,pm(B,R.offsetTree,T)||Q),Jd());return{...R,groupIndices:E,groupOffsetTree:A}})),y),lt(De(n,Ut(y),Rt(([E,{lastIndex:R}])=>E<R),Qe(([E,{lastIndex:R,lastSize:T}])=>[{startIndex:E,endIndex:R,size:T}])),r),lt(d,f);const _=fi(De(d,Qe(E=>E===void 0)),!0);lt(De(f,Rt(E=>E!==void 0&&jr(di(y).sizeTree)),Qe(E=>[{startIndex:0,endIndex:0,size:E}])),r);const S=uo(De(r,Ut(y),qa(({sizes:E},[R,T])=>({changed:T!==E,sizes:T}),{changed:!1,sizes:b}),Qe(E=>E.changed)));Er(De(l,qa((E,R)=>({diff:E.prev-R,prev:R}),{diff:0,prev:0}),Qe(E=>E.diff)),E=>{const{groupIndices:R}=di(y);if(E>0)Nt(t,!0),Nt(o,E+r2(E,R));else if(E<0){const T=di(w);T.length>0&&(E-=r2(-E,T)),Nt(a,E)}}),Er(De(l,Ut(e)),([E,R])=>{E<0&&R("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:l},co.ERROR)});const C=uo(o);lt(De(o,Ut(y),Qe(([E,R])=>{const T=R.groupIndices.length>0,A=[],M=R.lastSize;if(T){const B=hm(R.sizeTree,0);let Q=0,se=0;for(;Q<E;){const X=R.groupIndices[se],ce=R.groupIndices.length===se+1?1/0:R.groupIndices[se+1]-X-1;A.push({startIndex:X,endIndex:X,size:B}),A.push({startIndex:X+1,endIndex:X+1+ce-1,size:M}),se++,Q+=ce+1}const ie=Uu(R.sizeTree);return Q!==E&&ie.shift(),ie.reduce((X,{k:ce,v:ne})=>{let ee=X.ranges;return X.prevSize!==0&&(ee=[...X.ranges,{startIndex:X.prevIndex,endIndex:ce+E-1,size:X.prevSize}]),{ranges:ee,prevIndex:ce+E,prevSize:ne}},{ranges:A,prevIndex:E,prevSize:0}).ranges}return Uu(R.sizeTree).reduce((B,{k:Q,v:se})=>({ranges:[...B.ranges,{startIndex:B.prevIndex,endIndex:Q+E-1,size:B.prevSize}],prevIndex:Q+E,prevSize:se}),{ranges:[],prevIndex:0,prevSize:M}).ranges})),r);const k=uo(De(a,Ut(y,g),Qe(([E,{offsetTree:R},T])=>{const A=-E;return pm(A,R,T)})));return lt(De(a,Ut(y,g),Qe(([E,R,T])=>{if(R.groupIndices.length>0){if(jr(R.sizeTree))return R;let M=Jd();const B=di(w);let Q=0,se=0,ie=0;for(;Q<-E;){ie=B[se];const X=B[se+1]-ie-1;se++,Q+=X+1}if(M=Uu(R.sizeTree).reduce((X,{k:ce,v:ne})=>oo(X,Math.max(0,ce+E),ne),M),Q!==-E){const X=hm(R.sizeTree,ie);M=oo(M,0,X);const ce=va(R.sizeTree,-E+1)[1];M=oo(M,1,ce)}return{...R,sizeTree:M,...FP(R.offsetTree,0,M,T)}}else{const M=Uu(R.sizeTree).reduce((B,{k:Q,v:se})=>oo(B,Math.max(0,Q+E),se),Jd());return{...R,sizeTree:M,...FP(R.offsetTree,0,M,T)}}})),y),{data:m,totalCount:n,sizeRanges:r,groupIndices:c,defaultItemSize:f,fixedItemSize:d,unshiftWith:o,shiftWith:a,shiftWithOffset:k,beforeUnshiftWith:C,firstItemIndex:l,gap:g,sizes:y,listRefresh:S,statefulTotalCount:i,trackItemSizes:_,itemSize:p}},Kr(uu,uT),{singleton:!0}),bye=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function JV(e){const t=typeof e=="number"?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!bye)&&(t.behavior="auto"),t.offset||(t.offset=0),t}const ev=yr(([{sizes:e,totalCount:t,listRefresh:r,gap:n},{scrollingInProgress:i,viewportHeight:o,scrollTo:a,smoothScrollTargetReached:l,headerHeight:c,footerHeight:d,fixedHeaderHeight:f,fixedFooterHeight:p},{log:m}])=>{const g=tr(),b=tr(),y=Ve(0);let w=null,_=null,S=null;function C(){w&&(w(),w=null),S&&(S(),S=null),_&&(clearTimeout(_),_=null),Nt(i,!1)}return lt(De(g,Ut(e,o,t,y,c,d,m),Ut(n,f,p),Qe(([[k,E,R,T,A,M,B,Q],se,ie,N])=>{const X=JV(k),{align:ce,behavior:ne,offset:ee}=X,ge=T-1,Z=YV(X,E,ge);let j=pm(Z,E.offsetTree,se)+M;ce==="end"?(j+=ie+va(E.sizeTree,Z)[1]-R+N,Z===ge&&(j+=B)):ce==="center"?j+=(ie+va(E.sizeTree,Z)[1]-R+N)/2:j-=A,ee&&(j+=ee);const U=q=>{C(),q?(Q("retrying to scroll to",{location:k},co.DEBUG),Nt(g,k)):(Nt(b,!0),Q("list did not change, scroll successful",{},co.DEBUG))};if(C(),ne==="smooth"){let q=!1;S=Er(r,$=>{q=q||$}),w=ts(l,()=>{U(q)})}else w=ts(De(r,wye(150)),U);return _=setTimeout(()=>{C()},1200),Nt(i,!0),Q("scrolling from index to",{index:Z,top:j,behavior:ne},co.DEBUG),{top:j,behavior:ne}})),a),{scrollToIndex:g,scrollTargetReached:b,topListHeight:y}},Kr(os,Ti,uu),{singleton:!0});function wye(e){return t=>{const r=setTimeout(()=>{t(!1)},e);return n=>{n&&(t(!0),clearTimeout(r))}}}const mm="up",Cp="down",Sye="none",_ye={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollTop:0,viewportHeight:0,scrollHeight:0}},xye=0,tv=yr(([{scrollContainerState:e,scrollTop:t,viewportHeight:r,headerHeight:n,footerHeight:i,scrollBy:o}])=>{const a=Ve(!1),l=Ve(!0),c=tr(),d=tr(),f=Ve(4),p=Ve(xye),m=fi(De(e2(De(kt(t),Sf(1),Fa(!0)),De(kt(t),Sf(1),Fa(!1),ZA(100))),Ur()),!1),g=fi(De(e2(De(o,Fa(!0)),De(o,Fa(!1),ZA(200))),Ur()),!1);lt(De(Vn(kt(t),kt(p)),Qe(([S,C])=>S<=C),Ur()),l),lt(De(l,jl(50)),d);const b=uo(De(Vn(e,kt(r),kt(n),kt(i),kt(f)),qa((S,[{scrollTop:C,scrollHeight:k},E,R,T,A])=>{const M=C+E-k>-A,B={viewportHeight:E,scrollTop:C,scrollHeight:k};if(M){let se,ie;return C>S.state.scrollTop?(se="SCROLLED_DOWN",ie=S.state.scrollTop-C):(se="SIZE_DECREASED",ie=S.state.scrollTop-C||S.scrollTopDelta),{atBottom:!0,state:B,atBottomBecause:se,scrollTopDelta:ie}}let Q;return B.scrollHeight>S.state.scrollHeight?Q="SIZE_INCREASED":E<S.state.viewportHeight?Q="VIEWPORT_HEIGHT_DECREASING":C<S.state.scrollTop?Q="SCROLLING_UPWARDS":Q="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:Q,state:B}},_ye),Ur((S,C)=>S&&S.atBottom===C.atBottom))),y=fi(De(e,qa((S,{scrollTop:C,scrollHeight:k,viewportHeight:E})=>{if(zV(S.scrollHeight,k))return{scrollTop:C,scrollHeight:k,jump:0,changed:!1};{const R=k-(C+E)<1;return S.scrollTop!==C&&R?{scrollHeight:k,scrollTop:C,jump:S.scrollTop-C,changed:!0}:{scrollHeight:k,scrollTop:C,jump:0,changed:!0}}},{scrollHeight:0,jump:0,scrollTop:0,changed:!1}),Rt(S=>S.changed),Qe(S=>S.jump)),0);lt(De(b,Qe(S=>S.atBottom)),a),lt(De(a,jl(50)),c);const w=Ve(Cp);lt(De(e,Qe(({scrollTop:S})=>S),Ur(),qa((S,C)=>di(g)?{direction:S.direction,prevScrollTop:C}:{direction:C<S.prevScrollTop?mm:Cp,prevScrollTop:C},{direction:Cp,prevScrollTop:0}),Qe(S=>S.direction)),w),lt(De(e,jl(50),Fa(Sye)),w);const _=Ve(0);return lt(De(m,Rt(S=>!S),Fa(0)),_),lt(De(t,jl(100),Ut(m),Rt(([S,C])=>!!C),qa(([S,C],[k])=>[C,k],[0,0]),Qe(([S,C])=>C-S)),_),{isScrolling:m,isAtTop:l,isAtBottom:a,atBottomState:b,atTopStateChange:d,atBottomStateChange:c,scrollDirection:w,atBottomThreshold:f,atTopThreshold:p,scrollVelocity:_,lastJumpDueToItemResize:y}},Kr(Ti)),cu=yr(([{log:e}])=>{const t=Ve(!1),r=uo(De(t,Rt(n=>n),Ur()));return Er(t,n=>{n&&di(e)("props updated",{},co.DEBUG)}),{propsReady:t,didMount:r}},Kr(uu),{singleton:!0});function dT(e,t){e==0?t():requestAnimationFrame(()=>dT(e-1,t))}function fT(e,t){const r=t-1;return typeof e=="number"?e:e.index==="LAST"?r:e.index}const rv=yr(([{sizes:e,listRefresh:t,defaultItemSize:r},{scrollTop:n},{scrollToIndex:i,scrollTargetReached:o},{didMount:a}])=>{const l=Ve(!0),c=Ve(0),d=Ve(!0);return lt(De(a,Ut(c),Rt(([f,p])=>!!p),Fa(!1)),l),lt(De(a,Ut(c),Rt(([f,p])=>!!p),Fa(!1)),d),Er(De(Vn(t,a),Ut(l,e,r,d),Rt(([[,f],p,{sizeTree:m},g,b])=>f&&(!jr(m)||aT(g))&&!p&&!b),Ut(c)),([,f])=>{ts(o,()=>{Nt(d,!0)}),dT(4,()=>{ts(n,()=>{Nt(l,!0)}),Nt(i,f)})}),{scrolledToInitialItem:l,initialTopMostItemIndex:c,initialItemFinalLocationReached:d}},Kr(os,Ti,ev,cu),{singleton:!0});function n2(e){return e?e==="smooth"?"smooth":"auto":!1}const Pye=(e,t)=>typeof e=="function"?n2(e(t)):t&&n2(e),Cye=yr(([{totalCount:e,listRefresh:t},{isAtBottom:r,atBottomState:n},{scrollToIndex:i},{scrolledToInitialItem:o},{propsReady:a,didMount:l},{log:c},{scrollingInProgress:d}])=>{const f=Ve(!1),p=tr();let m=null;function g(y){Nt(i,{index:"LAST",align:"end",behavior:y})}Er(De(Vn(De(kt(e),Sf(1)),l),Ut(kt(f),r,o,d),Qe(([[y,w],_,S,C,k])=>{let E=w&&C,R="auto";return E&&(R=Pye(_,S||k),E=E&&!!R),{totalCount:y,shouldFollow:E,followOutputBehavior:R}}),Rt(({shouldFollow:y})=>y)),({totalCount:y,followOutputBehavior:w})=>{m&&(m(),m=null),m=ts(t,()=>{di(c)("following output to ",{totalCount:y},co.DEBUG),g(w),m=null})});function b(y){const w=ts(n,_=>{y&&!_.atBottom&&_.notAtBottomBecause==="SIZE_INCREASED"&&!m&&(di(c)("scrolling to bottom due to increased size",{},co.DEBUG),g("auto"))});setTimeout(w,100)}return Er(De(Vn(kt(f),e,a),Rt(([y,,w])=>y&&w),qa(({value:y},[,w])=>({refreshed:y===w,value:w}),{refreshed:!1,value:0}),Rt(({refreshed:y})=>y),Ut(f,e)),([,y])=>{di(o)&&b(y!==!1)}),Er(p,()=>{b(di(f)!==!1)}),Er(Vn(kt(f),n),([y,w])=>{y&&!w.atBottom&&w.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&g("auto")}),{followOutput:f,autoscrollToBottom:p}},Kr(os,tv,ev,rv,cu,uu,Ti));function Eye(e){return e.reduce((t,r)=>(t.groupIndices.push(t.totalCount),t.totalCount+=r+1,t),{totalCount:0,groupIndices:[]})}const ZV=yr(([{totalCount:e,groupIndices:t,sizes:r},{scrollTop:n,headerHeight:i}])=>{const o=tr(),a=tr(),l=uo(De(o,Qe(Eye)));return lt(De(l,Qe(c=>c.totalCount)),e),lt(De(l,Qe(c=>c.groupIndices)),t),lt(De(Vn(n,r,i),Rt(([c,d])=>fw(d)),Qe(([c,d,f])=>va(d.groupOffsetTree,Math.max(c-f,0),"v")[0]),Ur(),Qe(c=>[c])),a),{groupCounts:o,topItemsIndexes:a}},Kr(os,Ti));function vm(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}function e3(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}const Hb="top",Wb="bottom",i2="none";function o2(e,t,r){return typeof e=="number"?r===mm&&t===Hb||r===Cp&&t===Wb?e:0:r===mm?t===Hb?e.main:e.reverse:t===Wb?e.main:e.reverse}function a2(e,t){return typeof e=="number"?e:e[t]||0}const hT=yr(([{scrollTop:e,viewportHeight:t,deviation:r,headerHeight:n,fixedHeaderHeight:i}])=>{const o=tr(),a=Ve(0),l=Ve(0),c=Ve(0),d=fi(De(Vn(kt(e),kt(t),kt(n),kt(o,vm),kt(c),kt(a),kt(i),kt(r),kt(l)),Qe(([f,p,m,[g,b],y,w,_,S,C])=>{const k=f-S,E=w+_,R=Math.max(m-k,0);let T=i2;const A=a2(C,Hb),M=a2(C,Wb);return g-=S,g+=m+_,b+=m+_,b-=S,g>f+E-A&&(T=mm),b<f-R+p+M&&(T=Cp),T!==i2?[Math.max(k-m-o2(y,Hb,T)-A,0),k-R-_+p+o2(y,Wb,T)+M]:null}),Rt(f=>f!=null),Ur(vm)),[0,0]);return{listBoundary:o,overscan:c,topListHeight:a,increaseViewportBy:l,visibleRange:d}},Kr(Ti),{singleton:!0});function Tye(e,t,r){if(fw(t)){const n=XV(e,t);return[{index:va(t.groupOffsetTree,n)[0],size:0,offset:0},{index:n,size:0,offset:0,data:r&&r[0]}]}return[{index:e,size:0,offset:0,data:r&&r[0]}]}const I_={items:[],topItems:[],offsetTop:0,offsetBottom:0,top:0,bottom:0,topListHeight:0,totalCount:0,firstItemIndex:0};function s2(e,t,r){if(e.length===0)return[];if(!fw(t))return e.map(d=>({...d,index:d.index+r,originalIndex:d.index}));const n=e[0].index,i=e[e.length-1].index,o=[],a=dw(t.groupOffsetTree,n,i);let l,c=0;for(const d of e){(!l||l.end<d.index)&&(l=a.shift(),c=t.groupIndices.indexOf(l.start));let f;d.index===l.start?f={type:"group",index:c}:f={index:d.index-(c+1)+r,groupIndex:c},o.push({...f,size:d.size,offset:d.offset,originalIndex:d.index,data:d.data})}return o}function nb(e,t,r,n,i,o){const{lastSize:a,lastOffset:l,lastIndex:c}=i;let d=0,f=0;if(e.length>0){d=e[0].offset;const y=e[e.length-1];f=y.offset+y.size}const p=r-c,m=l+p*a+(p-1)*n,g=d,b=m-f;return{items:s2(e,i,o),topItems:s2(t,i,o),topListHeight:t.reduce((y,w)=>w.size+y,0),offsetTop:d,offsetBottom:b,top:g,bottom:f,totalCount:r,firstItemIndex:o}}function t3(e,t,r,n,i,o){let a=0;if(r.groupIndices.length>0)for(const f of r.groupIndices){if(f-a>=e)break;a++}const l=e+a,c=fT(t,l),d=Array.from({length:l}).map((f,p)=>({index:p+c,size:0,offset:0,data:o[p+c]}));return nb(d,[],l,i,r,n)}const Ic=yr(([{sizes:e,totalCount:t,data:r,firstItemIndex:n,gap:i},o,{visibleRange:a,listBoundary:l,topListHeight:c},{scrolledToInitialItem:d,initialTopMostItemIndex:f},{topListHeight:p},m,{didMount:g},{recalcInProgress:b}])=>{const y=Ve([]),w=Ve(0),_=tr();lt(o.topItemsIndexes,y);const S=fi(De(Vn(g,b,kt(a,vm),kt(t),kt(e),kt(f),d,kt(y),kt(n),kt(i),r),Rt(([R,T,,A,,,,,,,M])=>{const B=M&&M.length!==A;return R&&!T&&!B}),Qe(([,,[R,T],A,M,B,Q,se,ie,N,X])=>{const ce=M,{sizeTree:ne,offsetTree:ee}=ce,ge=di(w);if(A===0)return{...I_,totalCount:A};if(R===0&&T===0)return ge===0?{...I_,totalCount:A}:t3(ge,B,M,ie,N,X||[]);if(jr(ne))return ge>0?null:nb(Tye(fT(B,A),ce,X),[],A,N,ce,ie);const Z=[];if(se.length>0){const F=se[0],V=se[se.length-1];let de=0;for(const pe of dw(ne,F,V)){const Ee=pe.value,Me=Math.max(pe.start,F),Y=Math.min(pe.end,V);for(let K=Me;K<=Y;K++)Z.push({index:K,size:Ee,offset:de,data:X&&X[K]}),de+=Ee}}if(!Q)return nb([],Z,A,N,ce,ie);const j=se.length>0?se[se.length-1]+1:0,U=pye(ee,R,T,j);if(U.length===0)return null;const q=A-1,$=cw([],F=>{for(const V of U){const de=V.value;let pe=de.offset,Ee=V.start;const Me=de.size;if(de.offset<R){Ee+=Math.floor((R-de.offset+N)/(Me+N));const K=Ee-V.start;pe+=K*Me+K*N}Ee<j&&(pe+=(j-Ee)*Me,Ee=j);const Y=Math.min(V.end,q);for(let K=Ee;K<=Y&&!(pe>=T);K++)F.push({index:K,size:Me,offset:pe,data:X&&X[K]}),pe+=Me+N}});return nb($,Z,A,N,ce,ie)}),Rt(R=>R!==null),Ur()),I_);lt(De(r,Rt(aT),Qe(R=>R==null?void 0:R.length)),t),lt(De(S,Qe(R=>R.topListHeight)),p),lt(p,c),lt(De(S,Qe(R=>[R.top,R.bottom])),l),lt(De(S,Qe(R=>R.items)),_);const C=uo(De(S,Rt(({items:R})=>R.length>0),Ut(t,r),Rt(([{items:R},T])=>R[R.length-1].originalIndex===T-1),Qe(([,R,T])=>[R-1,T]),Ur(vm),Qe(([R])=>R))),k=uo(De(S,jl(200),Rt(({items:R,topItems:T})=>R.length>0&&R[0].originalIndex===T.length),Qe(({items:R})=>R[0].index),Ur())),E=uo(De(S,Rt(({items:R})=>R.length>0),Qe(({items:R})=>{let T=0,A=R.length-1;for(;R[T].type==="group"&&T<A;)T++;for(;R[A].type==="group"&&A>T;)A--;return{startIndex:R[T].index,endIndex:R[A].index}}),Ur(e3)));return{listState:S,topItemsIndexes:y,endReached:C,startReached:k,rangeChanged:E,itemsRendered:_,initialItemCount:w,...m}},Kr(os,ZV,hT,rv,ev,tv,cu,uT),{singleton:!0}),Oye=yr(([{sizes:e,firstItemIndex:t,data:r,gap:n},{initialTopMostItemIndex:i},{initialItemCount:o,listState:a},{didMount:l}])=>(lt(De(l,Ut(o),Rt(([,c])=>c!==0),Ut(i,e,t,n,r),Qe(([[,c],d,f,p,m,g=[]])=>t3(c,d,f,p,m,g))),a),{}),Kr(os,rv,Ic,cu),{singleton:!0}),r3=yr(([{scrollVelocity:e}])=>{const t=Ve(!1),r=tr(),n=Ve(!1);return lt(De(e,Ut(n,t,r),Rt(([i,o])=>!!o),Qe(([i,o,a,l])=>{const{exit:c,enter:d}=o;if(a){if(c(i,l))return!1}else if(d(i,l))return!0;return a}),Ur()),t),Er(De(Vn(t,e,r),Ut(n)),([[i,o,a],l])=>i&&l&&l.change&&l.change(o,a)),{isSeeking:t,scrollSeekConfiguration:n,scrollVelocity:e,scrollSeekRangeChanged:r}},Kr(tv),{singleton:!0}),Rye=yr(([{topItemsIndexes:e}])=>{const t=Ve(0);return lt(De(t,Rt(r=>r>0),Qe(r=>Array.from({length:r}).map((n,i)=>i))),e),{topItemCount:t}},Kr(Ic)),n3=yr(([{footerHeight:e,headerHeight:t,fixedHeaderHeight:r,fixedFooterHeight:n},{listState:i}])=>{const o=tr(),a=fi(De(Vn(e,n,t,r,i),Qe(([l,c,d,f,p])=>l+c+d+f+p.offsetBottom+p.bottom)),0);return lt(kt(a),o),{totalListHeight:a,totalListHeightChanged:o}},Kr(Ti,Ic),{singleton:!0});function i3(e){let t=!1,r;return()=>(t||(t=!0,r=e()),r)}const Iye=i3(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),kye=yr(([{scrollBy:e,scrollTop:t,deviation:r,scrollingInProgress:n},{isScrolling:i,isAtBottom:o,scrollDirection:a,lastJumpDueToItemResize:l},{listState:c},{beforeUnshiftWith:d,shiftWithOffset:f,sizes:p,gap:m},{log:g},{recalcInProgress:b}])=>{const y=uo(De(c,Ut(l),qa(([,_,S,C],[{items:k,totalCount:E,bottom:R,offsetBottom:T},A])=>{const M=R+T;let B=0;return S===E&&_.length>0&&k.length>0&&(k[0].originalIndex===0&&_[0].originalIndex===0||(B=M-C,B!==0&&(B+=A))),[B,k,E,M]},[0,[],0,0]),Rt(([_])=>_!==0),Ut(t,a,n,o,g,b),Rt(([,_,S,C,,,k])=>!k&&!C&&_!==0&&S===mm),Qe(([[_],,,,,S])=>(S("Upward scrolling compensation",{amount:_},co.DEBUG),_))));function w(_){_>0?(Nt(e,{top:-_,behavior:"auto"}),Nt(r,0)):(Nt(r,0),Nt(e,{top:-_,behavior:"auto"}))}return Er(De(y,Ut(r,i)),([_,S,C])=>{C&&Iye()?Nt(r,S-_):w(-_)}),Er(De(Vn(fi(i,!1),r,b),Rt(([_,S,C])=>!_&&!C&&S!==0),Qe(([_,S])=>S),jl(1)),w),lt(De(f,Qe(_=>({top:-_}))),e),Er(De(d,Ut(p,m),Qe(([_,{lastSize:S,groupIndices:C,sizeTree:k},E])=>{function R(T){return T*(S+E)}if(C.length===0)return R(_);{let T=0;const A=hm(k,0);let M=0,B=0;for(;M<_;){M++,T+=A;let Q=C.length===B+1?1/0:C[B+1]-C[B]-1;M+Q>_&&(T-=A,Q=_-M+1),M+=Q,T+=R(Q),B++}return T}})),_=>{Nt(r,_),requestAnimationFrame(()=>{Nt(e,{top:_}),requestAnimationFrame(()=>{Nt(r,0),Nt(b,!1)})})}),{deviation:r}},Kr(Ti,tv,Ic,os,uu,uT)),jye=yr(([{didMount:e},{scrollTo:t},{listState:r}])=>{const n=Ve(0);return Er(De(e,Ut(n),Rt(([,i])=>i!==0),Qe(([,i])=>({top:i}))),i=>{ts(De(r,Sf(1),Rt(o=>o.items.length>1)),()=>{requestAnimationFrame(()=>{Nt(t,i)})})}),{initialScrollTop:n}},Kr(cu,Ti,Ic),{singleton:!0}),$ye=yr(([{viewportHeight:e},{totalListHeight:t}])=>{const r=Ve(!1),n=fi(De(Vn(r,e,t),Rt(([i])=>i),Qe(([,i,o])=>Math.max(0,i-o)),jl(0),Ur()),0);return{alignToBottom:r,paddingTopAddition:n}},Kr(Ti,n3),{singleton:!0}),pT=yr(([{scrollTo:e,scrollContainerState:t}])=>{const r=tr(),n=tr(),i=tr(),o=Ve(!1),a=Ve(void 0);return lt(De(Vn(r,n),Qe(([{viewportHeight:l,scrollTop:c,scrollHeight:d},{offsetTop:f}])=>({scrollTop:Math.max(0,c-f),scrollHeight:d,viewportHeight:l}))),t),lt(De(e,Ut(n),Qe(([l,{offsetTop:c}])=>({...l,top:l.top+c}))),i),{useWindowScroll:o,customScrollParent:a,windowScrollContainerState:r,windowViewportRect:n,windowScrollTo:i}},Kr(Ti)),Aye=({itemTop:e,itemBottom:t,viewportTop:r,viewportBottom:n,locationParams:{behavior:i,align:o,...a}})=>e<r?{...a,behavior:i,align:o??"start"}:t>n?{...a,behavior:i,align:o??"end"}:null,Dye=yr(([{sizes:e,totalCount:t,gap:r},{scrollTop:n,viewportHeight:i,headerHeight:o,fixedHeaderHeight:a,fixedFooterHeight:l,scrollingInProgress:c},{scrollToIndex:d}])=>{const f=tr();return lt(De(f,Ut(e,i,t,o,a,l,n),Ut(r),Qe(([[p,m,g,b,y,w,_,S],C])=>{const{done:k,behavior:E,align:R,calculateViewLocation:T=Aye,...A}=p,M=YV(p,m,b-1),B=pm(M,m.offsetTree,C)+y+w,Q=B+va(m.sizeTree,M)[1],se=S+w,ie=S+g-_,N=T({itemTop:B,itemBottom:Q,viewportTop:se,viewportBottom:ie,locationParams:{behavior:E,align:R,...A}});return N?k&&ts(De(c,Rt(X=>X===!1),Sf(di(c)?1:2)),k):k&&k(),N}),Rt(p=>p!==null)),d),{scrollIntoView:f}},Kr(os,Ti,ev,Ic,uu),{singleton:!0}),Mye=yr(([{sizes:e,sizeRanges:t},{scrollTop:r},{initialTopMostItemIndex:n},{didMount:i},{useWindowScroll:o,windowScrollContainerState:a,windowViewportRect:l}])=>{const c=tr(),d=Ve(void 0),f=Ve(null),p=Ve(null);return lt(a,f),lt(l,p),Er(De(c,Ut(e,r,o,f,p)),([m,g,b,y,w,_])=>{const S=gye(g.sizeTree);y&&w!==null&&_!==null&&(b=w.scrollTop-_.offsetTop),m({ranges:S,scrollTop:b})}),lt(De(d,Rt(aT),Qe(Nye)),n),lt(De(i,Ut(d),Rt(([,m])=>m!==void 0),Ur(),Qe(([,m])=>m.ranges)),t),{getState:c,restoreStateFrom:d}},Kr(os,Ti,rv,cu,pT));function Nye(e){return{offset:e.scrollTop,index:0,align:"start"}}const Fye=yr(([e,t,r,n,i,o,a,l,c,d])=>({...e,...t,...r,...n,...i,...o,...a,...l,...c,...d}),Kr(hT,Oye,cu,r3,n3,jye,$ye,pT,Dye,uu)),o3=yr(([{totalCount:e,sizeRanges:t,fixedItemSize:r,defaultItemSize:n,trackItemSizes:i,itemSize:o,data:a,firstItemIndex:l,groupIndices:c,statefulTotalCount:d,gap:f,sizes:p},{initialTopMostItemIndex:m,scrolledToInitialItem:g,initialItemFinalLocationReached:b},y,w,_,{listState:S,topItemsIndexes:C,...k},{scrollToIndex:E},R,{topItemCount:T},{groupCounts:A},M])=>(lt(k.rangeChanged,M.scrollSeekRangeChanged),lt(De(M.windowViewportRect,Qe(B=>B.visibleHeight)),y.viewportHeight),{totalCount:e,data:a,firstItemIndex:l,sizeRanges:t,initialTopMostItemIndex:m,scrolledToInitialItem:g,initialItemFinalLocationReached:b,topItemsIndexes:C,topItemCount:T,groupCounts:A,fixedItemHeight:r,defaultItemHeight:n,gap:f,..._,statefulTotalCount:d,listState:S,scrollToIndex:E,trackItemSizes:i,itemSize:o,groupIndices:c,...k,...M,...y,sizes:p,...w}),Kr(os,rv,Ti,Mye,Cye,Ic,ev,kye,Rye,ZV,Fye)),k_="-webkit-sticky",l2="sticky",a3=i3(()=>{if(typeof document>"u")return l2;const e=document.createElement("div");return e.style.position=k_,e.style.position===k_?k_:l2});function s3(e,t){const r=Re.useRef(null),n=Re.useCallback(l=>{if(l===null||!l.offsetParent)return;const c=l.getBoundingClientRect(),d=c.width;let f,p;if(t){const m=t.getBoundingClientRect(),g=c.top-m.top;f=m.height-Math.max(0,g),p=g+t.scrollTop}else f=window.innerHeight-Math.max(0,c.top),p=c.top+window.pageYOffset;r.current={offsetTop:p,visibleHeight:f,visibleWidth:d},e(r.current)},[e,t]),{callbackRef:i,ref:o}=lT(n),a=Re.useCallback(()=>{n(o.current)},[n,o]);return Re.useEffect(()=>{if(t){t.addEventListener("scroll",a);const l=new ResizeObserver(()=>{requestAnimationFrame(a)});return l.observe(t),()=>{t.removeEventListener("scroll",a),l.unobserve(t)}}else return window.addEventListener("scroll",a),window.addEventListener("resize",a),()=>{window.removeEventListener("scroll",a),window.removeEventListener("resize",a)}},[a,t]),i}const l3=Re.createContext(void 0),u3=Re.createContext(void 0);function mT(e){return e}const Lye=yr(()=>{const e=Ve(c=>`Item ${c}`),t=Ve(null),r=Ve(c=>`Group ${c}`),n=Ve({}),i=Ve(mT),o=Ve("div"),a=Ve(Oc),l=(c,d=null)=>fi(De(n,Qe(f=>f[c]),Ur()),d);return{context:t,itemContent:e,groupContent:r,components:n,computeItemKey:i,headerFooterTag:o,scrollerRef:a,FooterComponent:l("Footer"),HeaderComponent:l("Header"),TopItemListComponent:l("TopItemList"),ListComponent:l("List","div"),ItemComponent:l("Item","div"),GroupComponent:l("Group","div"),ScrollerComponent:l("Scroller","div"),EmptyPlaceholder:l("EmptyPlaceholder"),ScrollSeekPlaceholder:l("ScrollSeekPlaceholder")}}),Bye=yr(([e,t])=>({...e,...t}),Kr(o3,Lye)),Vye=({height:e})=>Re.createElement("div",{style:{height:e}}),zye={position:a3(),zIndex:1,overflowAnchor:"none"},qye={overflowAnchor:"none"},u2=Re.memo(function({showTopList:t=!1}){const r=Xt("listState"),n=No("sizeRanges"),i=Xt("useWindowScroll"),o=Xt("customScrollParent"),a=No("windowScrollContainerState"),l=No("scrollContainerState"),c=o||i?a:l,d=Xt("itemContent"),f=Xt("context"),p=Xt("groupContent"),m=Xt("trackItemSizes"),g=Xt("itemSize"),b=Xt("log"),y=No("gap"),{callbackRef:w}=iye(n,g,m,t?Oc:c,b,y,o),[_,S]=Re.useState(0);vT("deviation",N=>{_!==N&&S(N)});const C=Xt("EmptyPlaceholder"),k=Xt("ScrollSeekPlaceholder")||Vye,E=Xt("ListComponent"),R=Xt("ItemComponent"),T=Xt("GroupComponent"),A=Xt("computeItemKey"),M=Xt("isSeeking"),B=Xt("groupIndices").length>0,Q=Xt("alignToBottom"),se=Xt("initialItemFinalLocationReached"),ie=t?{}:{boxSizing:"border-box",paddingTop:r.offsetTop,paddingBottom:r.offsetBottom,marginTop:_!==0?_:Q?"auto":0,...se?{}:{visibility:"hidden"}};return!t&&r.totalCount===0&&C?Re.createElement(C,_i(C,f)):Re.createElement(E,{..._i(E,f),ref:w,style:ie,"data-testid":t?"virtuoso-top-item-list":"virtuoso-item-list"},(t?r.topItems:r.items).map(N=>{const X=N.originalIndex,ce=A(X+r.firstItemIndex,N.data,f);return M?Re.createElement(k,{..._i(k,f),key:ce,index:N.index,height:N.size,type:N.type||"item",...N.type==="group"?{}:{groupIndex:N.groupIndex}}):N.type==="group"?Re.createElement(T,{..._i(T,f),key:ce,"data-index":X,"data-known-size":N.size,"data-item-index":N.index,style:zye},p(N.index,f)):Re.createElement(R,{..._i(R,f),...Wye(R,N.data),key:ce,"data-index":X,"data-known-size":N.size,"data-item-index":N.index,"data-item-group-index":N.groupIndex,style:qye},B?d(N.index,N.groupIndex,N.data,f):d(N.index,N.data,f))}))}),Uye={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},hw=e=>({width:"100%",height:"100%",position:"absolute",top:0,...e?{display:"flex",flexDirection:"column"}:{}}),Hye={width:"100%",position:a3(),top:0,zIndex:1};function _i(e,t){if(typeof e!="string")return{context:t}}function Wye(e,t){return{item:typeof e=="string"?void 0:t}}const Kye=Re.memo(function(){const t=Xt("HeaderComponent"),r=No("headerHeight"),n=Xt("headerFooterTag"),i=Rc(a=>r(Zl(a,"height"))),o=Xt("context");return t?Re.createElement(n,{ref:i},Re.createElement(t,_i(t,o))):null}),Gye=Re.memo(function(){const t=Xt("FooterComponent"),r=No("footerHeight"),n=Xt("headerFooterTag"),i=Rc(a=>r(Zl(a,"height"))),o=Xt("context");return t?Re.createElement(n,{ref:i},Re.createElement(t,_i(t,o))):null});function c3({usePublisher:e,useEmitter:t,useEmitterValue:r}){return Re.memo(function({style:o,children:a,...l}){const c=e("scrollContainerState"),d=r("ScrollerComponent"),f=e("smoothScrollTargetReached"),p=r("scrollerRef"),m=r("context"),{scrollerRef:g,scrollByCallback:b,scrollToCallback:y}=qV(c,f,d,p);return t("scrollTo",y),t("scrollBy",b),Re.createElement(d,{ref:g,style:{...Uye,...o},"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,tabIndex:0,...l,..._i(d,m)},a)})}function d3({usePublisher:e,useEmitter:t,useEmitterValue:r}){return Re.memo(function({style:o,children:a,...l}){const c=e("windowScrollContainerState"),d=r("ScrollerComponent"),f=e("smoothScrollTargetReached"),p=r("totalListHeight"),m=r("deviation"),g=r("customScrollParent"),b=r("context"),{scrollerRef:y,scrollByCallback:w,scrollToCallback:_}=qV(c,f,d,Oc,g);return tye(()=>(y.current=g||window,()=>{y.current=null}),[y,g]),t("windowScrollTo",_),t("scrollBy",w),Re.createElement(d,{style:{position:"relative",...o,...p!==0?{height:p+m}:{}},"data-virtuoso-scroller":!0,...l,..._i(d,b)},a)})}const Qye=({children:e})=>{const t=Re.useContext(l3),r=No("viewportHeight"),n=No("fixedItemHeight"),i=Xt("alignToBottom"),o=Rc(FV(r,a=>Zl(a,"height")));return Re.useEffect(()=>{t&&(r(t.viewportHeight),n(t.itemHeight))},[t,r,n]),Re.createElement("div",{style:hw(i),ref:o,"data-viewport-type":"element"},e)},Yye=({children:e})=>{const t=Re.useContext(l3),r=No("windowViewportRect"),n=No("fixedItemHeight"),i=Xt("customScrollParent"),o=s3(r,i),a=Xt("alignToBottom");return Re.useEffect(()=>{t&&(n(t.itemHeight),r({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,r,n]),Re.createElement("div",{ref:o,style:hw(a),"data-viewport-type":"window"},e)},Xye=({children:e})=>{const t=Xt("TopItemListComponent")||"div",r=Xt("headerHeight"),n={...Hye,marginTop:`${r}px`},i=Xt("context");return Re.createElement(t,{style:n,..._i(t,i)},e)},Jye=Re.memo(function(t){const r=Xt("useWindowScroll"),n=Xt("topItemsIndexes").length>0,i=Xt("customScrollParent"),o=i||r?tbe:ebe,a=i||r?Yye:Qye;return Re.createElement(o,{...t},n&&Re.createElement(Xye,null,Re.createElement(u2,{showTopList:!0})),Re.createElement(a,null,Re.createElement(Kye,null),Re.createElement(u2,null),Re.createElement(Gye,null)))}),{Component:Zye,usePublisher:No,useEmitterValue:Xt,useEmitter:vT}=VV(Bye,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},Jye),ebe=c3({usePublisher:No,useEmitterValue:Xt,useEmitter:vT}),tbe=d3({usePublisher:No,useEmitterValue:Xt,useEmitter:vT}),pw=Zye,c2={items:[],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},rbe={items:[{index:0}],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},{round:d2,ceil:f2,floor:Kb,min:j_,max:Ep}=Math;function nbe(e){return{...rbe,items:e}}function h2(e,t,r){return Array.from({length:t-e+1}).map((n,i)=>{const o=r===null?null:r[i+e];return{index:i+e,data:o}})}function ibe(e,t){return e&&e.column===t.column&&e.row===t.row}function Ig(e,t){return e&&e.width===t.width&&e.height===t.height}const obe=yr(([{overscan:e,visibleRange:t,listBoundary:r},{scrollTop:n,viewportHeight:i,scrollBy:o,scrollTo:a,smoothScrollTargetReached:l,scrollContainerState:c,footerHeight:d,headerHeight:f},p,m,{propsReady:g,didMount:b},{windowViewportRect:y,useWindowScroll:w,customScrollParent:_,windowScrollContainerState:S,windowScrollTo:C},k])=>{const E=Ve(0),R=Ve(0),T=Ve(c2),A=Ve({height:0,width:0}),M=Ve({height:0,width:0}),B=tr(),Q=tr(),se=Ve(0),ie=Ve(null),N=Ve({row:0,column:0}),X=tr(),ce=tr(),ne=Ve(!1),ee=Ve(0),ge=Ve(!0),Z=Ve(!1);Er(De(b,Ut(ee),Rt(([V,de])=>!!de)),()=>{Nt(ge,!1),Nt(R,0)}),Er(De(Vn(b,ge,M,A,ee,Z),Rt(([V,de,pe,Ee,,Me])=>V&&!de&&pe.height!==0&&Ee.height!==0&&!Me)),([,,,,V])=>{Nt(Z,!0),dT(1,()=>{Nt(B,V)}),ts(De(n),()=>{Nt(r,[0,0]),Nt(ge,!0)})}),lt(De(ce,Rt(V=>V!=null&&V.scrollTop>0),Fa(0)),R),Er(De(b,Ut(ce),Rt(([,V])=>V!=null)),([,V])=>{V&&(Nt(A,V.viewport),Nt(M,V==null?void 0:V.item),Nt(N,V.gap),V.scrollTop>0&&(Nt(ne,!0),ts(De(n,Sf(1)),de=>{Nt(ne,!1)}),Nt(a,{top:V.scrollTop})))}),lt(De(A,Qe(({height:V})=>V)),i),lt(De(Vn(kt(A,Ig),kt(M,Ig),kt(N,(V,de)=>V&&V.column===de.column&&V.row===de.row),kt(n)),Qe(([V,de,pe,Ee])=>({viewport:V,item:de,gap:pe,scrollTop:Ee}))),X),lt(De(Vn(kt(E),t,kt(N,ibe),kt(M,Ig),kt(A,Ig),kt(ie),kt(R),kt(ne),kt(ge),kt(ee)),Rt(([,,,,,,,V])=>!V),Qe(([V,[de,pe],Ee,Me,Y,K,we,,Te,he])=>{const{row:Ce,column:Ge}=Ee,{height:$t,width:Kt}=Me,{width:It}=Y;if(we===0&&(V===0||It===0))return c2;if(Kt===0){const an=fT(he,V),sn=an===0?Math.max(we-1,0):an;return nbe(h2(an,sn,K))}const jt=f3(It,Kt,Ge);let Lt,ht;Te?de===0&&pe===0&&we>0?(Lt=0,ht=we-1):(Lt=jt*Kb((de+Ce)/($t+Ce)),ht=jt*f2((pe+Ce)/($t+Ce))-1,ht=j_(V-1,Ep(ht,jt-1)),Lt=j_(ht,Ep(0,Lt))):(Lt=0,ht=-1);const on=h2(Lt,ht,K),{top:mn,bottom:Ir}=p2(Y,Ee,Me,on),Jr=f2(V/jt),Nr=Jr*$t+(Jr-1)*Ce-Ir;return{items:on,offsetTop:mn,offsetBottom:Nr,top:mn,bottom:Ir,itemHeight:$t,itemWidth:Kt}})),T),lt(De(ie,Rt(V=>V!==null),Qe(V=>V.length)),E),lt(De(Vn(A,M,T,N),Rt(([V,de,{items:pe}])=>pe.length>0&&de.height!==0&&V.height!==0),Qe(([V,de,{items:pe},Ee])=>{const{top:Me,bottom:Y}=p2(V,Ee,de,pe);return[Me,Y]}),Ur(vm)),r);const j=Ve(!1);lt(De(n,Ut(j),Qe(([V,de])=>de||V!==0)),j);const U=uo(De(kt(T),Rt(({items:V})=>V.length>0),Ut(E,j),Rt(([{items:V},de,pe])=>pe&&V[V.length-1].index===de-1),Qe(([,V])=>V-1),Ur())),q=uo(De(kt(T),Rt(({items:V})=>V.length>0&&V[0].index===0),Fa(0),Ur())),$=uo(De(kt(T),Ut(ne),Rt(([{items:V},de])=>V.length>0&&!de),Qe(([{items:V}])=>({startIndex:V[0].index,endIndex:V[V.length-1].index})),Ur(e3),jl(0)));lt($,m.scrollSeekRangeChanged),lt(De(B,Ut(A,M,E,N),Qe(([V,de,pe,Ee,Me])=>{const Y=JV(V),{align:K,behavior:we,offset:Te}=Y;let he=Y.index;he==="LAST"&&(he=Ee-1),he=Ep(0,he,j_(Ee-1,he));let Ce=LP(de,Me,pe,he);return K==="end"?Ce=d2(Ce-de.height+pe.height):K==="center"&&(Ce=d2(Ce-de.height/2+pe.height/2)),Te&&(Ce+=Te),{top:Ce,behavior:we}})),a);const F=fi(De(T,Qe(V=>V.offsetBottom+V.bottom)),0);return lt(De(y,Qe(V=>({width:V.visibleWidth,height:V.visibleHeight}))),A),{data:ie,totalCount:E,viewportDimensions:A,itemDimensions:M,scrollTop:n,scrollHeight:Q,overscan:e,scrollBy:o,scrollTo:a,scrollToIndex:B,smoothScrollTargetReached:l,windowViewportRect:y,windowScrollTo:C,useWindowScroll:w,customScrollParent:_,windowScrollContainerState:S,deviation:se,scrollContainerState:c,footerHeight:d,headerHeight:f,initialItemCount:R,gap:N,restoreStateFrom:ce,...m,initialTopMostItemIndex:ee,gridState:T,totalListHeight:F,...p,startReached:q,endReached:U,rangeChanged:$,stateChanged:X,propsReady:g,stateRestoreInProgress:ne,...k}},Kr(hT,Ti,tv,r3,cu,pT,uu));function p2(e,t,r,n){const{height:i}=r;if(i===void 0||n.length===0)return{top:0,bottom:0};const o=LP(e,t,r,n[0].index),a=LP(e,t,r,n[n.length-1].index)+i;return{top:o,bottom:a}}function LP(e,t,r,n){const i=f3(e.width,r.width,t.column),o=Kb(n/i),a=o*r.height+Ep(0,o-1)*t.row;return a>0?a+t.row:a}function f3(e,t,r){return Ep(1,Kb((e+r)/(Kb(t)+r)))}const abe=yr(()=>{const e=Ve(d=>`Item ${d}`),t=Ve({}),r=Ve(null),n=Ve("virtuoso-grid-item"),i=Ve("virtuoso-grid-list"),o=Ve(mT),a=Ve("div"),l=Ve(Oc),c=(d,f=null)=>fi(De(t,Qe(p=>p[d]),Ur()),f);return{context:r,itemContent:e,components:t,computeItemKey:o,itemClassName:n,listClassName:i,headerFooterTag:a,scrollerRef:l,FooterComponent:c("Footer"),HeaderComponent:c("Header"),ListComponent:c("List","div"),ItemComponent:c("Item","div"),ScrollerComponent:c("Scroller","div"),ScrollSeekPlaceholder:c("ScrollSeekPlaceholder","div")}}),sbe=yr(([e,t])=>({...e,...t}),Kr(obe,abe)),lbe=Re.memo(function(){const t=tn("gridState"),r=tn("listClassName"),n=tn("itemClassName"),i=tn("itemContent"),o=tn("computeItemKey"),a=tn("isSeeking"),l=pa("scrollHeight"),c=tn("ItemComponent"),d=tn("ListComponent"),f=tn("ScrollSeekPlaceholder"),p=tn("context"),m=pa("itemDimensions"),g=pa("gap"),b=tn("log"),y=tn("stateRestoreInProgress"),w=Rc(_=>{const S=_.parentElement.parentElement.scrollHeight;l(S);const C=_.firstChild;if(C){const{width:k,height:E}=C.getBoundingClientRect();m({width:k,height:E})}g({row:m2("row-gap",getComputedStyle(_).rowGap,b),column:m2("column-gap",getComputedStyle(_).columnGap,b)})});return y?null:Re.createElement(d,{ref:w,className:r,..._i(d,p),style:{paddingTop:t.offsetTop,paddingBottom:t.offsetBottom},"data-testid":"virtuoso-item-list"},t.items.map(_=>{const S=o(_.index,_.data,p);return a?Re.createElement(f,{key:S,..._i(f,p),index:_.index,height:t.itemHeight,width:t.itemWidth}):Re.createElement(c,{..._i(c,p),className:n,"data-index":_.index,key:S},i(_.index,_.data,p))}))}),ube=Re.memo(function(){const t=tn("HeaderComponent"),r=pa("headerHeight"),n=tn("headerFooterTag"),i=Rc(a=>r(Zl(a,"height"))),o=tn("context");return t?Re.createElement(n,{ref:i},Re.createElement(t,_i(t,o))):null}),cbe=Re.memo(function(){const t=tn("FooterComponent"),r=pa("footerHeight"),n=tn("headerFooterTag"),i=Rc(a=>r(Zl(a,"height"))),o=tn("context");return t?Re.createElement(n,{ref:i},Re.createElement(t,_i(t,o))):null}),dbe=({children:e})=>{const t=Re.useContext(u3),r=pa("itemDimensions"),n=pa("viewportDimensions"),i=Rc(o=>{n(o.getBoundingClientRect())});return Re.useEffect(()=>{t&&(n({height:t.viewportHeight,width:t.viewportWidth}),r({height:t.itemHeight,width:t.itemWidth}))},[t,n,r]),Re.createElement("div",{style:hw(!1),ref:i},e)},fbe=({children:e})=>{const t=Re.useContext(u3),r=pa("windowViewportRect"),n=pa("itemDimensions"),i=tn("customScrollParent"),o=s3(r,i);return Re.useEffect(()=>{t&&(n({height:t.itemHeight,width:t.itemWidth}),r({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,r,n]),Re.createElement("div",{ref:o,style:hw(!1)},e)},hbe=Re.memo(function({...t}){const r=tn("useWindowScroll"),n=tn("customScrollParent"),i=n||r?mbe:pbe,o=n||r?fbe:dbe;return Re.createElement(i,{...t},Re.createElement(o,null,Re.createElement(ube,null),Re.createElement(lbe,null),Re.createElement(cbe,null)))}),{usePublisher:pa,useEmitterValue:tn,useEmitter:h3}=VV(sbe,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged"}},hbe),pbe=c3({usePublisher:pa,useEmitterValue:tn,useEmitter:h3}),mbe=d3({usePublisher:pa,useEmitterValue:tn,useEmitter:h3});function m2(e,t,r){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&r(`${e} was not resolved to pixel value correctly`,t,co.WARN),t==="normal"?0:parseInt(t??"0",10)}const vbe=yr(()=>{const e=Ve(c=>Re.createElement("td",null,"Item $",c)),t=Ve(null),r=Ve(null),n=Ve(null),i=Ve({}),o=Ve(mT),a=Ve(Oc),l=(c,d=null)=>fi(De(i,Qe(f=>f[c]),Ur()),d);return{context:t,itemContent:e,fixedHeaderContent:r,fixedFooterContent:n,components:i,computeItemKey:o,scrollerRef:a,TableComponent:l("Table","table"),TableHeadComponent:l("TableHead","thead"),TableFooterComponent:l("TableFoot","tfoot"),TableBodyComponent:l("TableBody","tbody"),TableRowComponent:l("TableRow","tr"),ScrollerComponent:l("Scroller","div"),EmptyPlaceholder:l("EmptyPlaceholder"),ScrollSeekPlaceholder:l("ScrollSeekPlaceholder"),FillerRow:l("FillerRow")}});Kr(o3,vbe);const gbe=Ne`
|
1353
1353
|
mutation DeleteProjectMst($data: DeleteProjectInput!) {
|
1354
1354
|
deleteProject(data: $data)
|
1355
1355
|
}
|
1356
|
-
`,ybe=async e=>{const t=await xr.mutate({mutation:gbe,variables:e});if(!t.data)throw t.errors;return t.data};class bbe{constructor(t,r,n){this.rootStore=t,this.organizationId=r,this.projectName=n}async execute(){const t=await this.deleteProjectRequest();return await this.updateProjectsConnection(),t}async deleteProjectRequest(){const{deleteProject:t}=await ybe({data:{organizationId:this.organizationId,projectName:this.projectName}});return t}async updateProjectsConnection(){const t=this.rootStore.cache.organization.get(this.organizationId),r=t==null?void 0:t.projectsConnection.edges.find(n=>n.node.name===this.projectName);t==null||t.projectsConnection.removeEdge(r==null?void 0:r.cursor)}}class wbe{constructor(t){this.rootStore=t}async delete(t,r){try{return await new bbe(this.rootStore,t,r).execute()}catch(n){return console.error(n),!1}}init(){}dispose(){}}const Sbe=()=>{const[e]=O.useState(()=>new wbe(ct));return O.useEffect(()=>(e.init(),()=>e.dispose()),[e]),e},_be=Ot(({organizationId:e,projectName:t})=>{const r=Sbe(),[n,i]=O.useState(!1),o=O.useCallback(async()=>{i(!0),await r.delete(e,t),i(!1)},[r,e,t]);return x.jsx(Ci,{"data-testid":`remove-project-${t}-button`,_hover:{backgroundColor:"gray.100"},"aria-label":"removeTable",color:"gray.400",icon:x.jsx(J0,{}),isLoading:n,variant:"ghost",onClick:o})});class xbe{constructor(t){this.rootStore=t,st(this,{},{autoBind:!0}),this.init()}get totalCount(){return this.meProjects.edges.length}get hasNextPage(){return this.meProjects.availableNextPage}get items(){return this.meProjects.edges.map(({node:t})=>({id:t.id,name:t.name,organizationId:t.organization.id,touched:t.rootBranch.touched,link:Pbe(t)}))}get meProjects(){return this.rootStore.cache.meProjectsConnection}tryToFetchNextPage(){this.hasNextPage&&this.rootStore.backend.queryMeProjects({first:100})}init(){}dispose(){}}const Pbe=e=>ao(`/${Fl}/${Ll}/${Bl}/${Vl}${e.rootBranch.touched?`/${X0}`:""}`,{organizationId:e.organization.id,projectName:e.name,branchName:e.rootBranch.name}),Cbe=()=>{const[e]=O.useState(()=>new xbe(ct));return O.useEffect(()=>(e.init(),()=>e.dispose()),[e]),e},Ebe="_Row_1lkxi_1",Tbe="_RemoveRowButton_1lkxi_1",vA={Row:Ebe,RemoveRowButton:Tbe},Obe=Ot(()=>{const e=Cbe();return x.jsx(pw,{useWindowScroll:!0,totalCount:e.totalCount,defaultItemHeight:40,endReached:e.hasNextPage?e.tryToFetchNextPage:void 0,itemContent:t=>{const r=e.items[t];return x.jsx(wt,{height:"2.5rem",width:"100%",children:x.jsx(je,{_hover:{backgroundColor:"gray.50"},alignItems:"center",className:vA.Row,gap:"4px",paddingLeft:"1rem","data-testid":`project-${r.name}`,children:x.jsxs(je,{alignItems:"center",flex:1,justifyContent:"space-between",minHeight:"40px",children:[x.jsxs(je,{minWidth:"150px",children:[x.jsxs(je,{gap:"4px",children:[x.jsx(bt,{color:"gray.300",children:r.organizationId}),x.jsx(bt,{color:"gray.300",children:"/"}),x.jsx(bt,{_hover:{textDecoration:"underline"},children:x.jsx(qo,{to:r.link,"data-testid":`project-${r.organizationId}-${r.name}-link`,children:r.name})})]}),r.touched?"*":""]}),x.jsx(wt,{className:vA.RemoveRowButton,children:x.jsx(_be,{organizationId:r.organizationId,projectName:r.name})})]})})},r.id)}})}),Rbe=()=>{const[e,t]=PV(!1),r=O.useCallback(()=>{t()},[t]);return x.jsx($f,{title:x.jsx(wt,{height:"40px"}),children:x.jsx(je,{flexDirection:"column",gap:"0.5rem",paddingBottom:"1rem",children:e?x.jsx(Hge,{onAdd:r,onCancel:t}):x.jsxs(x.Fragment,{children:[x.jsx(Lge,{onClick:t}),x.jsx(Obe,{})]})})})};var Le=(e=>(e.String="string",e.Number="number",e.Boolean="boolean",e.Object="object",e.Array="array",e))(Le||{}),zn=(e=>(e.Tree="Tree",e.Json="Json",e.RefBy="RefBy",e))(zn||{}),hc=(e=>(e.File="urn:jsonschema:io:revisium:file-schema:1.0.0",e))(hc||{});const nv=e=>{if(e==="urn:jsonschema:io:revisium:file-schema:1.0.0")return"File"},Ibe={type:Le.Object,properties:{status:{type:Le.String,default:"",readOnly:!0},fileId:{type:Le.String,default:"",readOnly:!0},url:{type:Le.String,default:"",readOnly:!0},fileName:{type:Le.String,default:""},hash:{type:Le.String,default:"",readOnly:!0},extension:{type:Le.String,default:"",readOnly:!0},mimeType:{type:Le.String,default:"",readOnly:!0},size:{type:Le.Number,default:0,readOnly:!0},width:{type:Le.Number,default:0,readOnly:!0},height:{type:Le.Number,default:0,readOnly:!0}},required:["status","fileId","url","fileName","hash","extension","mimeType","size","width","height"],additionalProperties:!1},p3={[hc.File]:Ibe};function kbe(e){throw new Error("[mobx-utils] "+e)}function Gb(e,t){t===void 0&&(t="Illegal state"),e||kbe(t)}var m3=function(e){return e&&e!==Object.prototype&&Object.getOwnPropertyNames(e).concat(m3(Object.getPrototypeOf(e))||[])},jbe=function(e){var t=m3(e),r=t.filter(function(n,i){return t.indexOf(n)===i});return r},gA=function(e){return jbe(e).filter(function(t){return t!=="constructor"&&!~t.indexOf("__")})},BP="pending",Qb="fulfilled",gT="rejected";function $be(e){switch(this.state){case BP:return e.pending&&e.pending(this.value);case gT:return e.rejected&&e.rejected(this.value);case Qb:return e.fulfilled?e.fulfilled(this.value):this.value}}function yA(e,t){if(Gb(arguments.length<=2,"fromPromise expects up to two arguments"),Gb(typeof e=="function"||typeof e=="object"&&e&&typeof e.then=="function","Please pass a promise or function to fromPromise"),e.isPromiseBasedObservable===!0)return e;typeof e=="function"&&(e=new Promise(e));var r=e;e.then(Sr("observableFromPromise-resolve",function(i){r.value=i,r.state=Qb}),Sr("observableFromPromise-reject",function(i){r.value=i,r.state=gT})),r.isPromiseBasedObservable=!0,r.case=$be;var n=t&&(t.state===Qb||t.state===BP)?t.value:void 0;return lE(r,{value:n,state:BP},{},{deep:!1}),r}(function(e){e.reject=Sr("fromPromise.reject",function(r){var n=e(Promise.reject(r));return n.state=gT,n.value=r,n});function t(r){r===void 0&&(r=void 0);var n=e(Promise.resolve(r));return n.state=Qb,n.value=r,n}e.resolve=Sr("fromPromise.resolve",t)})(yA||(yA={}));var kg=function(e,t,r,n){var i=arguments.length,o=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(o=(i<3?a(o):i>3?a(t,r,o):a(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o};(function(){function e(t,r){var n=this;Object.defineProperty(this,"current",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"subscription",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),D0(this),Hp(function(){n.current=r,n.subscription=t.subscribe(n)})}return Object.defineProperty(e.prototype,"dispose",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.subscription&&this.subscription.unsubscribe()}}),Object.defineProperty(e.prototype,"next",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.current=t}}),Object.defineProperty(e.prototype,"complete",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.dispose()}}),Object.defineProperty(e.prototype,"error",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.current=t,this.dispose()}}),kg([er.ref],e.prototype,"current",void 0),kg([Sr.bound],e.prototype,"next",null),kg([Sr.bound],e.prototype,"complete",null),kg([Sr.bound],e.prototype,"error",null),e})();var Yb=function(){return Yb=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Yb.apply(this,arguments)},Lh=function(e,t,r,n){var i=arguments.length,o=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(o=(i<3?a(o):i>3?a(t,r,o):a(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o},Abe=["model","reset","submit","isDirty","isPropertyDirty","resetProperty"],Dbe=function(){function e(t){var r=this;Object.defineProperty(this,"model",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"localValues",{enumerable:!0,configurable:!0,writable:!0,value:er.map({})}),Object.defineProperty(this,"localComputedValues",{enumerable:!0,configurable:!0,writable:!0,value:er.map({})}),Object.defineProperty(this,"isPropertyDirty",{enumerable:!0,configurable:!0,writable:!0,value:function(i){return r.localValues.has(i)}}),D0(this),Gb(Gi(t),"createViewModel expects an observable object");var n=gA(this);gA(t).forEach(function(i){var o;if(!n.includes(i)&&!(i===ut||i==="__mobxDidRunLazyInitializers")){if(Gb(Abe.indexOf(i)===-1,"The propertyname "+i+" is reserved and cannot be used with viewModels"),H1(t,i)){var a=ma(t,i),l=a.derivation.bind(r),c=(o=a.setter_)===null||o===void 0?void 0:o.bind(r);r.localComputedValues.set(i,dn(l,{set:c}))}var d=Object.getOwnPropertyDescriptor(t,i),f=d?{enumerable:d.enumerable}:{};Object.defineProperty(r,i,Yb(Yb({},f),{configurable:!0,get:function(){return H1(t,i)?r.localComputedValues.get(i).get():r.isPropertyDirty(i)?r.localValues.get(i):r.model[i]},set:Sr(function(p){H1(t,i)?r.localComputedValues.get(i).set(p):p!==r.model[i]?r.localValues.set(i,p):r.localValues.delete(i)})}))}})}return Object.defineProperty(e.prototype,"isDirty",{get:function(){return this.localValues.size>0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"changedValues",{get:function(){return new Map(this.localValues)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"submit",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this;Kp(this.localValues).forEach(function(r){var n=t.localValues.get(r),i=t.model[r];Uo(i)?i.replace(n):Ki(i)?(i.clear(),i.merge(n)):Aie(n)||(t.model[r]=n)}),this.localValues.clear()}}),Object.defineProperty(e.prototype,"reset",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.localValues.clear()}}),Object.defineProperty(e.prototype,"resetProperty",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.localValues.delete(t)}}),Lh([dn],e.prototype,"isDirty",null),Lh([dn],e.prototype,"changedValues",null),Lh([Sr.bound],e.prototype,"submit",null),Lh([Sr.bound],e.prototype,"reset",null),Lh([Sr.bound],e.prototype,"resetProperty",null),e}();function kc(e){return new Dbe(e)}var Mbe=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();(function(e){Mbe(t,e);function t(r,n,i){var o=i===void 0?{}:i,a=o.name,l=a===void 0?"ogm"+(Math.random()*1e3|0):a,c=o.keyToName,d=c===void 0?function(m){return""+m}:c,f=e.call(this)||this;Object.defineProperty(f,"_base",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(f,"_ogmInfoKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(f,"_groupBy",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(f,"_keyToName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(f,"_disposeBaseObserver",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),f._keyToName=d,f._groupBy=n,f._ogmInfoKey=Symbol("ogmInfo"+l),f._base=r;for(var p=0;p<r.length;p++)f._addItem(r[p]);return f._disposeBaseObserver=A0(f._base,function(m){if(m.type==="splice")la(function(){for(var g=0,b=m.removed;g<b.length;g++){var y=b[g];f._removeItem(y)}for(var w=0,_=m.added;w<_.length;w++){var S=_[w];f._addItem(S)}});else if(m.type==="update")la(function(){f._removeItem(m.oldValue),f._addItem(m.newValue)});else throw new Error("illegal state")}),f}return Object.defineProperty(t.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){throw new Error("not supported")}}),Object.defineProperty(t.prototype,"delete",{enumerable:!1,configurable:!0,writable:!0,value:function(r){throw new Error("not supported")}}),Object.defineProperty(t.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){throw new Error("not supported")}}),Object.defineProperty(t.prototype,"dispose",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._disposeBaseObserver();for(var r=0;r<this._base.length;r++){var n=this._base[r],i=n[this._ogmInfoKey];i.reaction(),delete n[this._ogmInfoKey]}}}),Object.defineProperty(t.prototype,"_getGroupArr",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=e.prototype.get.call(this,r);return n===void 0&&(n=er([],{name:"GroupArray["+this._keyToName(r)+"]",deep:!1}),e.prototype.set.call(this,r,n)),n}}),Object.defineProperty(t.prototype,"_removeFromGroupArr",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=e.prototype.get.call(this,r);i.length===1?e.prototype.delete.call(this,r):(n===i.length-1||(i[n]=i[i.length-1],i[n][this._ogmInfoKey].groupArrIndex=n),i.length--)}}),Object.defineProperty(t.prototype,"_addItem",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this,i=this._groupBy(r),o=this._getGroupArr(i),a={groupByValue:i,groupArrIndex:o.length,reaction:Ya(function(){return n._groupBy(r)},function(l,c){var d=r[n._ogmInfoKey];n._removeFromGroupArr(d.groupByValue,d.groupArrIndex);var f=n._getGroupArr(l),p=f.length;f.push(r),d.groupByValue=l,d.groupArrIndex=p})};Object.defineProperty(r,this._ogmInfoKey,{configurable:!0,enumerable:!1,value:a}),o.push(r)}}),Object.defineProperty(t.prototype,"_removeItem",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=r[this._ogmInfoKey];this._removeFromGroupArr(n.groupByValue,n.groupArrIndex),n.reaction(),delete r[this._ogmInfoKey]}}),t})(M0);var qs=(e=>(e.Object="object",e.Array="array",e.String="string",e.StringForeignKey="stringForeignKey",e.Number="number",e.Boolean="boolean",e))(qs||{});class pn{constructor(){Pe(this,"nodeId",nn());Pe(this,"type",qs.Object);Pe(this,"$ref","");Pe(this,"state");st(this,{},{autoBind:!0}),this.state=kc(er({id:"",properties:[],parent:null,connectedToParent:!1}))}get isDisabled(){var t;return!!((t=this.draftParent)!=null&&t.$ref)}get label(){return nv(this.$ref)??this.type}setNodeId(t){this.nodeId=t}get id(){return this.state.model.id}get draftId(){return this.state.id}get parent(){return this.state.model.parent}get draftParent(){return this.state.parent}get connectedToParent(){return this.state.model.connectedToParent}get draftConnectedToParent(){return this.state.connectedToParent}get properties(){return this.state.model.properties}get draftProperties(){return this.state.properties}get addedProperties(){return this.draftProperties.filter(t=>!t.parent&&!this.properties.find(r=>r.nodeId===t.nodeId))}get removedProperties(){return this.properties.filter(t=>{const r=!this.draftProperties.find(n=>n.nodeId===t.nodeId);return!t.draftConnectedToParent&&r})}get notChangedProperties(){return this.properties.filter(t=>this.draftProperties.find(r=>r===t))}get replacedProperties(){return this.properties.filter(t=>this.draftProperties.find(r=>r.nodeId===t.nodeId&&r!==t)).map(t=>{const r=this.draftProperties.find(n=>n.nodeId===t.nodeId);if(!r)throw new Error("Invalid replacedProperties");return{previousProperty:t,currentProperty:r}})}get movedProperties(){return this.draftProperties.filter(t=>t.parent&&t.parent!==this)}get changedIdProperties(){return this.draftProperties.filter(t=>{const r=this.properties.find(n=>n.nodeId===t.nodeId);return r&&t.draftId!==r.id}).map(t=>{const r=this.properties.find(n=>n.nodeId===t.nodeId);if(!r)throw new Error("Invalid replacedProperties");return{previousProperty:r,currentProperty:t}})}getSchema(t){if(this.$ref)return{$ref:this.$ref};const r={},n=[];t!=null&&t.skipObjectProperties||this.state.properties.forEach(o=>{t!=null&&t.skipMovedBetweenParentsNodes&&o.parent!==o.draftParent||(o instanceof Jn||o instanceof pn?r[o.draftId]=o.getSchema(t):r[o.draftId]=o.getSchema(),n.push(o.draftId))});const i=n.sort((o,a)=>o.localeCompare(a));return{type:Le.Object,additionalProperties:!1,required:i,properties:r}}get isValid(){const t=new Set(this.state.properties.map(n=>n.draftId)).size===this.state.properties.length,r=this.state.properties.every(n=>n.isValid&&!!n.draftId);return t&&r}get isDirtyItself(){return this.state.isDirty}get isDirty(){return this.isDirtyItself||this.state.properties.some(t=>t.isDirty)}get showingCreateField(){return this.$ref?!1:!!this.state.id||!!this.state.parent}get isDisabledCreateField(){var n;const t=!!this.state.id||!this.state.id&&((n=this.state.parent)==null?void 0:n.type)===qs.Array,r=this.state.properties.every(i=>!!i.draftId);return!t||!r}setId(t){this.state.id=t}setParent(t){this.state.parent=t,this.state.connectedToParent=!0}onRemoveFromParent(){this.state.connectedToParent=!1}removeProperty(t){const r=this.state.properties.findIndex(n=>n.nodeId===t);r!==-1&&(this.state.properties[r].onRemoveFromParent(),this.createIfNeededNextProperties(),this.state.properties.splice(r,1),this.resetIfNeededProperties())}addProperty(t,r=null){if(t.draftParent instanceof pn)t.draftParent.removeProperty(t.nodeId);else if(t.draftParent instanceof Jn)throw new Error("Invalid parent");t.setParent(this),this.createIfNeededNextProperties();const n=this.state.properties.findIndex(o=>o===(r==null?void 0:r.beforeNode)),i=this.state.properties.findIndex(o=>o===(r==null?void 0:r.afterNode));n!==-1?this.state.properties.splice(n,0,t):i!==-1?this.state.properties.splice(i+1,0,t):this.state.properties.push(t)}getProperty(t){const r=this.properties.find(n=>n.id===t);if(!r)throw new Error("Invalid id");return r}getDraftProperty(t){const r=this.draftProperties.find(n=>n.id===t);if(!r)throw new Error("Invalid id");return r}hasProperty(t){return!!this.state.properties.find(n=>n===t)}replaceProperty(t,r){const n=this.state.properties.findIndex(i=>i.nodeId===t.nodeId);n!==-1&&(t.onRemoveFromParent(),t.parent&&(r.setId(t.id),r.setParent(t.parent),r.submitChanges()),r.setId(t.draftId),r.setNodeId(t.nodeId),r.setParent(this),this.createIfNeededNextProperties(),this.state.properties.splice(n,1,r))}submitChanges(){this.state.submit();for(const t of this.state.properties)t.submitChanges()}resetChanges(){this.state.reset();for(const t of this.state.properties)t.resetChanges()}createIfNeededNextProperties(){this.state.isPropertyDirty("properties")||(this.state.properties=this.state.properties.slice())}resetIfNeededProperties(){const t=this.state.model.properties.map(n=>n.nodeId),r=this.state.properties.map(n=>n.nodeId);if(t.length===r.length){for(let n=0;n<t.length;n++)if(t[n]!==r[n])return;this.state.resetProperty("properties")}}}class Jn{constructor(t){Pe(this,"nodeId",nn());Pe(this,"type",qs.Array);Pe(this,"$ref","");Pe(this,"state");st(this,{},{autoBind:!0}),t.setParent(this),t.submitChanges(),this.state=kc(er({id:"",items:t,parent:null,connectedToParent:!1}))}get isDisabled(){var t;return!!((t=this.draftParent)!=null&&t.$ref)}get label(){return nv(this.$ref)??this.type}setNodeId(t){this.nodeId=t}get id(){return this.state.model.id}get draftId(){return this.state.id}get parent(){return this.state.model.parent}get draftParent(){return this.state.parent}get connectedToParent(){return this.state.model.connectedToParent}get draftConnectedToParent(){return this.state.connectedToParent}get items(){return this.state.model.items}get draftItems(){return this.state.items}getSchema(t){return this.$ref?{$ref:this.$ref}:{type:Le.Array,items:this.getItemsSchema(t)}}getItemsSchema(t){return this.state.items instanceof Jn?this.state.items.getSchema(t):this.state.items instanceof pn?this.state.items.getSchema(t):this.state.items.getSchema()}get isValid(){return this.state.items.isValid}get isDirtyItself(){return this.state.isDirty}get isDirty(){return this.isDirtyItself||this.state.items.isDirty}setId(t){this.state.id=t}setParent(t){this.state.parent=t,this.state.connectedToParent=!0}onRemoveFromParent(){this.state.connectedToParent=!1}replaceItems(t){t.draftParent instanceof pn&&t.draftParent.removeProperty(t.nodeId),t.setNodeId(this.state.items.nodeId),t.setParent(this),this.state.items=t}submitChanges(){this.state.submit(),this.state.items.submitChanges()}resetChanges(){this.state.reset(),this.state.items.resetChanges()}}class Nbe{constructor(){Pe(this,"nodeId",nn());Pe(this,"type",qs.Boolean);Pe(this,"$ref","");Pe(this,"state");st(this,{},{autoBind:!0}),this.state=kc(er({id:"",parent:null,connectedToParent:!1}))}get isDisabled(){var t;return!!((t=this.draftParent)!=null&&t.$ref)}get label(){return nv(this.$ref)??this.type}setNodeId(t){this.nodeId=t}get id(){return this.state.model.id}get draftId(){return this.state.id}get parent(){return this.state.model.parent}get draftParent(){return this.state.parent}get connectedToParent(){return this.state.model.connectedToParent}get draftConnectedToParent(){return this.state.connectedToParent}getSchema(){return this.$ref?{$ref:this.$ref}:{type:Le.Boolean,default:!1}}get isValid(){return!0}get isDirtyItself(){return this.state.isDirty}get isDirty(){return this.isDirtyItself}setId(t){this.state.id=t}setParent(t){this.state.parent=t,this.state.connectedToParent=!0}onRemoveFromParent(){this.state.connectedToParent=!1}submitChanges(){this.state.submit()}resetChanges(){this.state.reset()}}class Fbe{constructor(){Pe(this,"nodeId",nn());Pe(this,"type",qs.Number);Pe(this,"$ref","");Pe(this,"state");st(this,{},{autoBind:!0}),this.state=kc(er({id:"",parent:null,connectedToParent:!1}))}get isDisabled(){var t;return!!((t=this.draftParent)!=null&&t.$ref)}get label(){return nv(this.$ref)??this.type}setNodeId(t){this.nodeId=t}get id(){return this.state.model.id}get draftId(){return this.state.id}get parent(){return this.state.model.parent}get draftParent(){return this.state.parent}get connectedToParent(){return this.state.model.connectedToParent}get draftConnectedToParent(){return this.state.connectedToParent}getSchema(){return this.$ref?{$ref:this.$ref}:{type:Le.Number,default:0}}get isValid(){return!0}get isDirtyItself(){return this.state.isDirty}get isDirty(){return this.isDirtyItself}setId(t){this.state.id=t}setParent(t){this.state.parent=t,this.state.connectedToParent=!0}onRemoveFromParent(){this.state.connectedToParent=!1}submitChanges(){this.state.submit()}resetChanges(){this.state.reset()}}class ec{constructor(){Pe(this,"nodeId",nn());Pe(this,"type",qs.String);Pe(this,"$ref","");Pe(this,"state");st(this,{},{autoBind:!0}),this.state=kc(er({id:"",foreignKey:null,parent:null,connectedToParent:!1}))}get isDisabled(){var t;return!!((t=this.draftParent)!=null&&t.$ref)}get label(){return this.draftForeignKey?"foreign key":nv(this.$ref)??this.type}setNodeId(t){this.nodeId=t}get id(){return this.state.model.id}get draftId(){return this.state.id}get parent(){return this.state.model.parent}get draftParent(){return this.state.parent}get connectedToParent(){return this.state.model.connectedToParent}get draftConnectedToParent(){return this.state.connectedToParent}get foreignKey(){return this.state.model.foreignKey}get draftForeignKey(){return this.state.foreignKey}getSchema(){var r,n;if(this.$ref)return{$ref:this.$ref};const t={type:Le.String,default:""};return(r=this.state.foreignKey)!=null&&r.draftForeignKey&&(t.foreignKey=(n=this.state.foreignKey)==null?void 0:n.draftForeignKey),t}get isValid(){return!(this.state.foreignKey&&!this.state.foreignKey.draftForeignKey)}get isDirtyItself(){return this.state.isDirty||!!(this.state.foreignKey&&this.state.foreignKey.isDirtyItself)}get isDirty(){return this.isDirtyItself}setId(t){this.state.id=t}setParent(t){this.state.parent=t,this.state.connectedToParent=!0}onRemoveFromParent(){this.state.connectedToParent=!1}setForeignKey(t){this.state.foreignKey=t,t&&t.setParent(this)}submitChanges(){this.state.submit(),this.state.foreignKey&&this.state.foreignKey.submitChanges()}resetChanges(){this.state.reset(),this.state.foreignKey&&this.state.foreignKey.resetChanges()}}class Lbe{constructor(){Pe(this,"nodeId",nn());Pe(this,"type",qs.StringForeignKey);Pe(this,"state");st(this,{},{autoBind:!0}),this.state=kc(er({foreignKey:null,parent:null,connectedToParent:!1}))}get isDisabled(){var t;return!!((t=this.draftParent)!=null&&t.$ref)}get parent(){return this.state.model.parent}get draftParent(){return this.state.parent}get connectedToParent(){return this.state.model.connectedToParent}get draftConnectedToParent(){return this.state.connectedToParent}setNodeId(t){this.nodeId=t}get foreignKey(){return this.state.model.foreignKey}get draftForeignKey(){return this.state.foreignKey}get isDirtyItself(){return this.state.isDirty}setForeignKey(t){this.state.foreignKey=t}setParent(t){this.state.parent=t,this.state.connectedToParent=!0}onRemoveFromParent(){this.state.connectedToParent=!1}submitChanges(){this.state.submit()}resetChanges(){this.state.reset()}}const v3=e=>{if("$ref"in e){const t=p3[e.$ref];if(!t)throw new Error(`Schema refs must be defined ref$=${e.$ref}`);const r=v3(t);return r.$ref=e.$ref,r}switch(e.type){case Le.Object:{const t=new pn;return Object.entries(e.properties).forEach(([r,n])=>{const i=Ba(n);i.setId(r),t.addProperty(i)}),t}case Le.Array:{const t=Ba(e.items);return new Jn(t)}case Le.String:{const t=new ec;if(e.foreignKey!==void 0){const r=new Lbe;r.setForeignKey(e.foreignKey),t.setForeignKey(r)}return t}case Le.Number:return new Fbe;case Le.Boolean:return new Nbe}},Ba=e=>v3(e),Bbe=(e,t=!1)=>{let r="",n=e;for(;n.draftParent;)n.draftParent instanceof pn?r=`/properties/${n===e&&t?n.id:n.draftId}${r}`:n.draftParent instanceof Jn&&(r=`/items${r}`),n=n.draftParent;return r};function*Xb(e,t,r){if(yield*t(e),e instanceof pn)for(const n of e.draftProperties)yield*Xb(n,t);else e instanceof Jn&&(yield*Xb(e.draftItems,t))}function VP(e,t,r){let n=!0;if(r||(n=t(e)),!n)return!1;if(e instanceof pn)for(const i of e.draftProperties)VP(i,t);else e instanceof Jn&&VP(e.draftItems,t)}const Vbe=e=>[...Xb(e,function*(t){(t instanceof pn||t instanceof Jn)&&(yield t)})],g3=(e,t)=>e.draftParent?e===t?!0:g3(e.draftParent,t):!1,bA=e=>{const t=[];let r=e.draftParent;for(;r;)t.push(r),r=r.draftParent;return t},zbe=(e,t)=>{const r=bA(t),n=bA(e),i=r.find(a=>a instanceof Jn);return i?!n.find(a=>a===i):!1},Zh=(e,t)=>!(!t.draftParent||e===t||e===t.draftParent||g3(e,t)||zbe(e,t)),Tu=(e,t)=>{const r=[e];let n=e,i=Jb(e,t==null?void 0:t.preferDraftParent);for(;i;)r.push(i),n=i,i=Jb(n,t==null?void 0:t.preferDraftParent);return r},Bh=e=>{let t="",r=e[0];for(let n=1;n<e.length;n++){const i=e[n];i instanceof pn?t=`/properties/${y3(r,!1)}${t}`:i instanceof Jn&&(t=`/items${t}`),r=i}return t},wA=(e,t)=>{let r="",n=e,i=Jb(e,t==null?void 0:t.preferDraftParent);for(;i;)i instanceof pn?r=`/properties/${n===e&&t.preferStartWithNotDraftId?n.id:y3(n,t==null?void 0:t.preferDraftId)}${r}`:i instanceof Jn&&(r=`/items${r}`),n=i,i=Jb(n,t==null?void 0:t.preferDraftParent);return r},Jb=(e,t)=>t?e.draftParent||e.parent:e.parent||e.draftParent,y3=(e,t)=>t?e.draftId||e.id:e.id||e.draftId;class qbe{constructor(){Pe(this,"stack",[]);Pe(this,"setIdMap",new Set)}add(t){this.stack.push({node:t,op:"add",sequence:Tu(t,{preferDraftParent:!0})})}remove(t){const r=this.stack.findIndex(n=>n.node===t&&n.op==="add");this.deepRemovePatches(t),r===-1&&this.stack.push({node:t,op:"remove",sequence:Tu(t,{preferDraftParent:!0})})}replace(t,r){if(this.checkIfStringDuplicationInReplace(r))return;this.stack.findIndex(i=>i.node.nodeId===r.nodeId&&i.op==="add")!==-1?(this.deepRemovePatches(t,!1),this.stack.push({node:r,op:"add",sequence:Tu(r,{preferDraftParent:!0})})):(this.deepRemovePatches(t,!0),this.stack.push({node:r,op:"replace",sequence:Tu(r,{preferDraftParent:!0})}))}move(t){const r=this.stack.findIndex(i=>i.node===t&&i.op==="move");r!==-1&&this.stack.splice(r,1),t.parent===t.draftParent&&t.id===t.draftId||this.stack.push({node:t,op:"move",fromSequence:Tu(t,{preferDraftParent:!1}),toSequence:Tu(t,{preferDraftParent:!0})})}reset(){this.stack.length=0,this.setIdMap.clear()}getPatches(t){return[...this.getStackPatches(),...this.getMoveIdPatches(t)]}setId(t){this.setIdMap.add(t.nodeId)}getMoveIdPatches(t){const r=this;return[...Xb(t,function*(i){r.setIdMap.has(i.nodeId)&&i.draftParent instanceof pn&&(yield{op:"move",from:wA(i,{preferDraftParent:!0,preferDraftId:!0,preferStartWithNotDraftId:!0}),path:wA(i,{preferDraftParent:!0,preferDraftId:!0})})})]}getStackPatches(){return this.stack.map(t=>{switch(t.op){case"add":return{op:"add",path:Bh(t.sequence),value:t.node.getSchema({skipMovedBetweenParentsNodes:!0})};case"replace":return{op:"replace",path:Bh(t.sequence),value:t.node.getSchema({skipMovedBetweenParentsNodes:!0})};case"remove":return{op:"remove",path:Bh(t.sequence)};case"move":return{op:"move",from:Bh(t.fromSequence),path:Bh(t.toSequence)}}})}checkIfStringDuplicationInReplace(t){return!!(t.type===qs.String&&this.stack.find(n=>n.node===t))}deepRemovePatches(t,r){VP(t,n=>{let i=this.stack.findIndex(a=>a.node.nodeId===n.nodeId&&a.op!=="move");for(;i!==-1;)this.stack.splice(i,1),i=this.stack.findIndex(a=>a.node.nodeId===n.nodeId&&a.op!=="move");const o=this.stack.findIndex(a=>a.node.nodeId===n.nodeId&&a.op==="move");return o!==-1?(this.stack.splice(o,1,{node:n,op:"remove",sequence:Tu(n,{preferDraftParent:!1})}),this.deepRemovePatches(n,!0),!1):!0},r)}}class SA{constructor(t=new pn,r=""){Pe(this,"viewMode",zn.Tree);Pe(this,"state");Pe(this,"history",new qbe);st(this,{},{autoBind:!0}),this.state=kc(er({node:t,tableId:r}))}get node(){return this.state.node}get tableId(){return this.state.tableId}get draftTableId(){return this.state.node.draftId}get isApproveDisabled(){return!this.state.node.isValid||!this.state.node.isDirty}get isDirty(){return this.state.node.isDirty}get isDirtyItself(){return this.state.node.isDirtyItself}getPlainSchema(){return this.state.node.getSchema()}setViewMode(t){this.viewMode=t}getPatches(){return this.state.node!==this.state.model.node?[{op:"replace",path:"",value:this.state.node.getSchema()}]:[...this.history.getPatches(this.state.node)]}areThereDropTargets(t){return dn(()=>!!Vbe(this.state.node).filter(n=>Zh(n,t)).length).get()}replaceNode(t){this.state.node=t}submitChanges(){this.node.submitChanges(),this.state.tableId=this.node.id,this.state.submit(),this.history.reset()}resetChanges(){this.node.resetChanges(),this.history.reset()}setId(t,r){t.setId(r),t.parent&&this.history.setId(t)}addProperty(t,r,n=null){t.addProperty(r,n),r.parent?this.history.move(r):this.history.add(r)}removeProperty(t,r){t.removeProperty(r.nodeId),this.history.remove(r)}replaceProperty(t,r,n){t.replaceProperty(r,n),this.history.replace(r,n)}replaceItems(t,r){const n=t.draftItems;t.replaceItems(r),r.parent?this.history.move(r):this.history.replace(n,r)}setForeignKey(t,r){t.setForeignKey(r),this.history.replace(t,t)}setForeignKeyValue(t,r){t&&t.draftParent&&(t.setForeignKey(r),this.history.replace(t.draftParent,t.draftParent))}}const Ube=Ne`
|
1356
|
+
`,ybe=async e=>{const t=await xr.mutate({mutation:gbe,variables:e});if(!t.data)throw t.errors;return t.data};class bbe{constructor(t,r,n){this.rootStore=t,this.organizationId=r,this.projectName=n}async execute(){const t=await this.deleteProjectRequest();return await this.updateProjectsConnection(),t}async deleteProjectRequest(){const{deleteProject:t}=await ybe({data:{organizationId:this.organizationId,projectName:this.projectName}});return t}async updateProjectsConnection(){const t=this.rootStore.cache.organization.get(this.organizationId),r=t==null?void 0:t.projectsConnection.edges.find(n=>n.node.name===this.projectName);t==null||t.projectsConnection.removeEdge(r==null?void 0:r.cursor)}}class wbe{constructor(t){this.rootStore=t}async delete(t,r){try{return await new bbe(this.rootStore,t,r).execute()}catch(n){return console.error(n),!1}}init(){}dispose(){}}const Sbe=()=>{const[e]=O.useState(()=>new wbe(ct));return O.useEffect(()=>(e.init(),()=>e.dispose()),[e]),e},_be=Ot(({organizationId:e,projectName:t})=>{const r=Sbe(),[n,i]=O.useState(!1),o=O.useCallback(async()=>{i(!0),await r.delete(e,t),i(!1)},[r,e,t]);return x.jsx(Ci,{"data-testid":`remove-project-${t}-button`,_hover:{backgroundColor:"gray.100"},"aria-label":"removeTable",color:"gray.400",icon:x.jsx(J0,{}),isLoading:n,variant:"ghost",onClick:o})});class xbe{constructor(t){this.rootStore=t,st(this,{},{autoBind:!0}),this.init()}get totalCount(){return this.meProjects.edges.length}get hasNextPage(){return this.meProjects.availableNextPage}get items(){return this.meProjects.edges.map(({node:t})=>({id:t.id,name:t.name,organizationId:t.organization.id,touched:t.rootBranch.touched,link:Pbe(t)}))}get meProjects(){return this.rootStore.cache.meProjectsConnection}tryToFetchNextPage(){this.hasNextPage&&this.rootStore.backend.queryMeProjects({first:100})}init(){}dispose(){}}const Pbe=e=>ao(`/${Fl}/${Ll}/${Bl}/${Vl}${e.rootBranch.touched?`/${X0}`:""}`,{organizationId:e.organization.id,projectName:e.name,branchName:e.rootBranch.name}),Cbe=()=>{const[e]=O.useState(()=>new xbe(ct));return O.useEffect(()=>(e.init(),()=>e.dispose()),[e]),e},Ebe="_Row_1lkxi_1",Tbe="_RemoveRowButton_1lkxi_1",v2={Row:Ebe,RemoveRowButton:Tbe},Obe=Ot(()=>{const e=Cbe();return x.jsx(pw,{useWindowScroll:!0,totalCount:e.totalCount,defaultItemHeight:40,endReached:e.hasNextPage?e.tryToFetchNextPage:void 0,itemContent:t=>{const r=e.items[t];return x.jsx(wt,{height:"2.5rem",width:"100%",children:x.jsx(je,{_hover:{backgroundColor:"gray.50"},alignItems:"center",className:v2.Row,gap:"4px",paddingLeft:"1rem","data-testid":`project-${r.name}`,children:x.jsxs(je,{alignItems:"center",flex:1,justifyContent:"space-between",minHeight:"40px",children:[x.jsxs(je,{minWidth:"150px",children:[x.jsxs(je,{gap:"4px",children:[x.jsx(bt,{color:"gray.300",children:r.organizationId}),x.jsx(bt,{color:"gray.300",children:"/"}),x.jsx(bt,{_hover:{textDecoration:"underline"},children:x.jsx(qo,{to:r.link,"data-testid":`project-${r.organizationId}-${r.name}-link`,children:r.name})})]}),r.touched?"*":""]}),x.jsx(wt,{className:v2.RemoveRowButton,children:x.jsx(_be,{organizationId:r.organizationId,projectName:r.name})})]})})},r.id)}})}),Rbe=()=>{const[e,t]=PV(!1),r=O.useCallback(()=>{t()},[t]);return x.jsx($f,{title:x.jsx(wt,{height:"40px"}),children:x.jsx(je,{flexDirection:"column",gap:"0.5rem",paddingBottom:"1rem",children:e?x.jsx(Hge,{onAdd:r,onCancel:t}):x.jsxs(x.Fragment,{children:[x.jsx(Lge,{onClick:t}),x.jsx(Obe,{})]})})})};var Le=(e=>(e.String="string",e.Number="number",e.Boolean="boolean",e.Object="object",e.Array="array",e))(Le||{}),zn=(e=>(e.Tree="Tree",e.Json="Json",e.RefBy="RefBy",e))(zn||{}),hc=(e=>(e.File="urn:jsonschema:io:revisium:file-schema:1.0.0",e))(hc||{});const nv=e=>{if(e==="urn:jsonschema:io:revisium:file-schema:1.0.0")return"File"},Ibe={type:Le.Object,properties:{status:{type:Le.String,default:"",readOnly:!0},fileId:{type:Le.String,default:"",readOnly:!0},url:{type:Le.String,default:"",readOnly:!0},fileName:{type:Le.String,default:""},hash:{type:Le.String,default:"",readOnly:!0},extension:{type:Le.String,default:"",readOnly:!0},mimeType:{type:Le.String,default:"",readOnly:!0},size:{type:Le.Number,default:0,readOnly:!0},width:{type:Le.Number,default:0,readOnly:!0},height:{type:Le.Number,default:0,readOnly:!0}},required:["status","fileId","url","fileName","hash","extension","mimeType","size","width","height"],additionalProperties:!1},p3={[hc.File]:Ibe};function kbe(e){throw new Error("[mobx-utils] "+e)}function Gb(e,t){t===void 0&&(t="Illegal state"),e||kbe(t)}var m3=function(e){return e&&e!==Object.prototype&&Object.getOwnPropertyNames(e).concat(m3(Object.getPrototypeOf(e))||[])},jbe=function(e){var t=m3(e),r=t.filter(function(n,i){return t.indexOf(n)===i});return r},g2=function(e){return jbe(e).filter(function(t){return t!=="constructor"&&!~t.indexOf("__")})},BP="pending",Qb="fulfilled",gT="rejected";function $be(e){switch(this.state){case BP:return e.pending&&e.pending(this.value);case gT:return e.rejected&&e.rejected(this.value);case Qb:return e.fulfilled?e.fulfilled(this.value):this.value}}function y2(e,t){if(Gb(arguments.length<=2,"fromPromise expects up to two arguments"),Gb(typeof e=="function"||typeof e=="object"&&e&&typeof e.then=="function","Please pass a promise or function to fromPromise"),e.isPromiseBasedObservable===!0)return e;typeof e=="function"&&(e=new Promise(e));var r=e;e.then(Sr("observableFromPromise-resolve",function(i){r.value=i,r.state=Qb}),Sr("observableFromPromise-reject",function(i){r.value=i,r.state=gT})),r.isPromiseBasedObservable=!0,r.case=$be;var n=t&&(t.state===Qb||t.state===BP)?t.value:void 0;return lE(r,{value:n,state:BP},{},{deep:!1}),r}(function(e){e.reject=Sr("fromPromise.reject",function(r){var n=e(Promise.reject(r));return n.state=gT,n.value=r,n});function t(r){r===void 0&&(r=void 0);var n=e(Promise.resolve(r));return n.state=Qb,n.value=r,n}e.resolve=Sr("fromPromise.resolve",t)})(y2||(y2={}));var kg=function(e,t,r,n){var i=arguments.length,o=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(o=(i<3?a(o):i>3?a(t,r,o):a(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o};(function(){function e(t,r){var n=this;Object.defineProperty(this,"current",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"subscription",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),D0(this),Hp(function(){n.current=r,n.subscription=t.subscribe(n)})}return Object.defineProperty(e.prototype,"dispose",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.subscription&&this.subscription.unsubscribe()}}),Object.defineProperty(e.prototype,"next",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.current=t}}),Object.defineProperty(e.prototype,"complete",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.dispose()}}),Object.defineProperty(e.prototype,"error",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.current=t,this.dispose()}}),kg([er.ref],e.prototype,"current",void 0),kg([Sr.bound],e.prototype,"next",null),kg([Sr.bound],e.prototype,"complete",null),kg([Sr.bound],e.prototype,"error",null),e})();var Yb=function(){return Yb=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Yb.apply(this,arguments)},Lh=function(e,t,r,n){var i=arguments.length,o=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(o=(i<3?a(o):i>3?a(t,r,o):a(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o},Abe=["model","reset","submit","isDirty","isPropertyDirty","resetProperty"],Dbe=function(){function e(t){var r=this;Object.defineProperty(this,"model",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"localValues",{enumerable:!0,configurable:!0,writable:!0,value:er.map({})}),Object.defineProperty(this,"localComputedValues",{enumerable:!0,configurable:!0,writable:!0,value:er.map({})}),Object.defineProperty(this,"isPropertyDirty",{enumerable:!0,configurable:!0,writable:!0,value:function(i){return r.localValues.has(i)}}),D0(this),Gb(Gi(t),"createViewModel expects an observable object");var n=g2(this);g2(t).forEach(function(i){var o;if(!n.includes(i)&&!(i===ut||i==="__mobxDidRunLazyInitializers")){if(Gb(Abe.indexOf(i)===-1,"The propertyname "+i+" is reserved and cannot be used with viewModels"),H1(t,i)){var a=ma(t,i),l=a.derivation.bind(r),c=(o=a.setter_)===null||o===void 0?void 0:o.bind(r);r.localComputedValues.set(i,dn(l,{set:c}))}var d=Object.getOwnPropertyDescriptor(t,i),f=d?{enumerable:d.enumerable}:{};Object.defineProperty(r,i,Yb(Yb({},f),{configurable:!0,get:function(){return H1(t,i)?r.localComputedValues.get(i).get():r.isPropertyDirty(i)?r.localValues.get(i):r.model[i]},set:Sr(function(p){H1(t,i)?r.localComputedValues.get(i).set(p):p!==r.model[i]?r.localValues.set(i,p):r.localValues.delete(i)})}))}})}return Object.defineProperty(e.prototype,"isDirty",{get:function(){return this.localValues.size>0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"changedValues",{get:function(){return new Map(this.localValues)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"submit",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this;Kp(this.localValues).forEach(function(r){var n=t.localValues.get(r),i=t.model[r];Uo(i)?i.replace(n):Ki(i)?(i.clear(),i.merge(n)):Aie(n)||(t.model[r]=n)}),this.localValues.clear()}}),Object.defineProperty(e.prototype,"reset",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.localValues.clear()}}),Object.defineProperty(e.prototype,"resetProperty",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.localValues.delete(t)}}),Lh([dn],e.prototype,"isDirty",null),Lh([dn],e.prototype,"changedValues",null),Lh([Sr.bound],e.prototype,"submit",null),Lh([Sr.bound],e.prototype,"reset",null),Lh([Sr.bound],e.prototype,"resetProperty",null),e}();function kc(e){return new Dbe(e)}var Mbe=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();(function(e){Mbe(t,e);function t(r,n,i){var o=i===void 0?{}:i,a=o.name,l=a===void 0?"ogm"+(Math.random()*1e3|0):a,c=o.keyToName,d=c===void 0?function(m){return""+m}:c,f=e.call(this)||this;Object.defineProperty(f,"_base",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(f,"_ogmInfoKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(f,"_groupBy",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(f,"_keyToName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(f,"_disposeBaseObserver",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),f._keyToName=d,f._groupBy=n,f._ogmInfoKey=Symbol("ogmInfo"+l),f._base=r;for(var p=0;p<r.length;p++)f._addItem(r[p]);return f._disposeBaseObserver=A0(f._base,function(m){if(m.type==="splice")la(function(){for(var g=0,b=m.removed;g<b.length;g++){var y=b[g];f._removeItem(y)}for(var w=0,_=m.added;w<_.length;w++){var S=_[w];f._addItem(S)}});else if(m.type==="update")la(function(){f._removeItem(m.oldValue),f._addItem(m.newValue)});else throw new Error("illegal state")}),f}return Object.defineProperty(t.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){throw new Error("not supported")}}),Object.defineProperty(t.prototype,"delete",{enumerable:!1,configurable:!0,writable:!0,value:function(r){throw new Error("not supported")}}),Object.defineProperty(t.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){throw new Error("not supported")}}),Object.defineProperty(t.prototype,"dispose",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._disposeBaseObserver();for(var r=0;r<this._base.length;r++){var n=this._base[r],i=n[this._ogmInfoKey];i.reaction(),delete n[this._ogmInfoKey]}}}),Object.defineProperty(t.prototype,"_getGroupArr",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=e.prototype.get.call(this,r);return n===void 0&&(n=er([],{name:"GroupArray["+this._keyToName(r)+"]",deep:!1}),e.prototype.set.call(this,r,n)),n}}),Object.defineProperty(t.prototype,"_removeFromGroupArr",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=e.prototype.get.call(this,r);i.length===1?e.prototype.delete.call(this,r):(n===i.length-1||(i[n]=i[i.length-1],i[n][this._ogmInfoKey].groupArrIndex=n),i.length--)}}),Object.defineProperty(t.prototype,"_addItem",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this,i=this._groupBy(r),o=this._getGroupArr(i),a={groupByValue:i,groupArrIndex:o.length,reaction:Ya(function(){return n._groupBy(r)},function(l,c){var d=r[n._ogmInfoKey];n._removeFromGroupArr(d.groupByValue,d.groupArrIndex);var f=n._getGroupArr(l),p=f.length;f.push(r),d.groupByValue=l,d.groupArrIndex=p})};Object.defineProperty(r,this._ogmInfoKey,{configurable:!0,enumerable:!1,value:a}),o.push(r)}}),Object.defineProperty(t.prototype,"_removeItem",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=r[this._ogmInfoKey];this._removeFromGroupArr(n.groupByValue,n.groupArrIndex),n.reaction(),delete r[this._ogmInfoKey]}}),t})(M0);var qs=(e=>(e.Object="object",e.Array="array",e.String="string",e.StringForeignKey="stringForeignKey",e.Number="number",e.Boolean="boolean",e))(qs||{});class pn{constructor(){Pe(this,"nodeId",nn());Pe(this,"type",qs.Object);Pe(this,"$ref","");Pe(this,"state");st(this,{},{autoBind:!0}),this.state=kc(er({id:"",properties:[],parent:null,connectedToParent:!1}))}get isDisabled(){var t;return!!((t=this.draftParent)!=null&&t.$ref)}get label(){return nv(this.$ref)??this.type}setNodeId(t){this.nodeId=t}get id(){return this.state.model.id}get draftId(){return this.state.id}get parent(){return this.state.model.parent}get draftParent(){return this.state.parent}get connectedToParent(){return this.state.model.connectedToParent}get draftConnectedToParent(){return this.state.connectedToParent}get properties(){return this.state.model.properties}get draftProperties(){return this.state.properties}get addedProperties(){return this.draftProperties.filter(t=>!t.parent&&!this.properties.find(r=>r.nodeId===t.nodeId))}get removedProperties(){return this.properties.filter(t=>{const r=!this.draftProperties.find(n=>n.nodeId===t.nodeId);return!t.draftConnectedToParent&&r})}get notChangedProperties(){return this.properties.filter(t=>this.draftProperties.find(r=>r===t))}get replacedProperties(){return this.properties.filter(t=>this.draftProperties.find(r=>r.nodeId===t.nodeId&&r!==t)).map(t=>{const r=this.draftProperties.find(n=>n.nodeId===t.nodeId);if(!r)throw new Error("Invalid replacedProperties");return{previousProperty:t,currentProperty:r}})}get movedProperties(){return this.draftProperties.filter(t=>t.parent&&t.parent!==this)}get changedIdProperties(){return this.draftProperties.filter(t=>{const r=this.properties.find(n=>n.nodeId===t.nodeId);return r&&t.draftId!==r.id}).map(t=>{const r=this.properties.find(n=>n.nodeId===t.nodeId);if(!r)throw new Error("Invalid replacedProperties");return{previousProperty:r,currentProperty:t}})}getSchema(t){if(this.$ref)return{$ref:this.$ref};const r={},n=[];t!=null&&t.skipObjectProperties||this.state.properties.forEach(o=>{t!=null&&t.skipMovedBetweenParentsNodes&&o.parent!==o.draftParent||(o instanceof Jn||o instanceof pn?r[o.draftId]=o.getSchema(t):r[o.draftId]=o.getSchema(),n.push(o.draftId))});const i=n.sort((o,a)=>o.localeCompare(a));return{type:Le.Object,additionalProperties:!1,required:i,properties:r}}get isValid(){const t=new Set(this.state.properties.map(n=>n.draftId)).size===this.state.properties.length,r=this.state.properties.every(n=>n.isValid&&!!n.draftId);return t&&r}get isDirtyItself(){return this.state.isDirty}get isDirty(){return this.isDirtyItself||this.state.properties.some(t=>t.isDirty)}get showingCreateField(){return this.$ref?!1:!!this.state.id||!!this.state.parent}get isDisabledCreateField(){var n;const t=!!this.state.id||!this.state.id&&((n=this.state.parent)==null?void 0:n.type)===qs.Array,r=this.state.properties.every(i=>!!i.draftId);return!t||!r}setId(t){this.state.id=t}setParent(t){this.state.parent=t,this.state.connectedToParent=!0}onRemoveFromParent(){this.state.connectedToParent=!1}removeProperty(t){const r=this.state.properties.findIndex(n=>n.nodeId===t);r!==-1&&(this.state.properties[r].onRemoveFromParent(),this.createIfNeededNextProperties(),this.state.properties.splice(r,1),this.resetIfNeededProperties())}addProperty(t,r=null){if(t.draftParent instanceof pn)t.draftParent.removeProperty(t.nodeId);else if(t.draftParent instanceof Jn)throw new Error("Invalid parent");t.setParent(this),this.createIfNeededNextProperties();const n=this.state.properties.findIndex(o=>o===(r==null?void 0:r.beforeNode)),i=this.state.properties.findIndex(o=>o===(r==null?void 0:r.afterNode));n!==-1?this.state.properties.splice(n,0,t):i!==-1?this.state.properties.splice(i+1,0,t):this.state.properties.push(t)}getProperty(t){const r=this.properties.find(n=>n.id===t);if(!r)throw new Error("Invalid id");return r}getDraftProperty(t){const r=this.draftProperties.find(n=>n.id===t);if(!r)throw new Error("Invalid id");return r}hasProperty(t){return!!this.state.properties.find(n=>n===t)}replaceProperty(t,r){const n=this.state.properties.findIndex(i=>i.nodeId===t.nodeId);n!==-1&&(t.onRemoveFromParent(),t.parent&&(r.setId(t.id),r.setParent(t.parent),r.submitChanges()),r.setId(t.draftId),r.setNodeId(t.nodeId),r.setParent(this),this.createIfNeededNextProperties(),this.state.properties.splice(n,1,r))}submitChanges(){this.state.submit();for(const t of this.state.properties)t.submitChanges()}resetChanges(){this.state.reset();for(const t of this.state.properties)t.resetChanges()}createIfNeededNextProperties(){this.state.isPropertyDirty("properties")||(this.state.properties=this.state.properties.slice())}resetIfNeededProperties(){const t=this.state.model.properties.map(n=>n.nodeId),r=this.state.properties.map(n=>n.nodeId);if(t.length===r.length){for(let n=0;n<t.length;n++)if(t[n]!==r[n])return;this.state.resetProperty("properties")}}}class Jn{constructor(t){Pe(this,"nodeId",nn());Pe(this,"type",qs.Array);Pe(this,"$ref","");Pe(this,"state");st(this,{},{autoBind:!0}),t.setParent(this),t.submitChanges(),this.state=kc(er({id:"",items:t,parent:null,connectedToParent:!1}))}get isDisabled(){var t;return!!((t=this.draftParent)!=null&&t.$ref)}get label(){return nv(this.$ref)??this.type}setNodeId(t){this.nodeId=t}get id(){return this.state.model.id}get draftId(){return this.state.id}get parent(){return this.state.model.parent}get draftParent(){return this.state.parent}get connectedToParent(){return this.state.model.connectedToParent}get draftConnectedToParent(){return this.state.connectedToParent}get items(){return this.state.model.items}get draftItems(){return this.state.items}getSchema(t){return this.$ref?{$ref:this.$ref}:{type:Le.Array,items:this.getItemsSchema(t)}}getItemsSchema(t){return this.state.items instanceof Jn?this.state.items.getSchema(t):this.state.items instanceof pn?this.state.items.getSchema(t):this.state.items.getSchema()}get isValid(){return this.state.items.isValid}get isDirtyItself(){return this.state.isDirty}get isDirty(){return this.isDirtyItself||this.state.items.isDirty}setId(t){this.state.id=t}setParent(t){this.state.parent=t,this.state.connectedToParent=!0}onRemoveFromParent(){this.state.connectedToParent=!1}replaceItems(t){t.draftParent instanceof pn&&t.draftParent.removeProperty(t.nodeId),t.setNodeId(this.state.items.nodeId),t.setParent(this),this.state.items=t}submitChanges(){this.state.submit(),this.state.items.submitChanges()}resetChanges(){this.state.reset(),this.state.items.resetChanges()}}class Nbe{constructor(){Pe(this,"nodeId",nn());Pe(this,"type",qs.Boolean);Pe(this,"$ref","");Pe(this,"state");st(this,{},{autoBind:!0}),this.state=kc(er({id:"",parent:null,connectedToParent:!1}))}get isDisabled(){var t;return!!((t=this.draftParent)!=null&&t.$ref)}get label(){return nv(this.$ref)??this.type}setNodeId(t){this.nodeId=t}get id(){return this.state.model.id}get draftId(){return this.state.id}get parent(){return this.state.model.parent}get draftParent(){return this.state.parent}get connectedToParent(){return this.state.model.connectedToParent}get draftConnectedToParent(){return this.state.connectedToParent}getSchema(){return this.$ref?{$ref:this.$ref}:{type:Le.Boolean,default:!1}}get isValid(){return!0}get isDirtyItself(){return this.state.isDirty}get isDirty(){return this.isDirtyItself}setId(t){this.state.id=t}setParent(t){this.state.parent=t,this.state.connectedToParent=!0}onRemoveFromParent(){this.state.connectedToParent=!1}submitChanges(){this.state.submit()}resetChanges(){this.state.reset()}}class Fbe{constructor(){Pe(this,"nodeId",nn());Pe(this,"type",qs.Number);Pe(this,"$ref","");Pe(this,"state");st(this,{},{autoBind:!0}),this.state=kc(er({id:"",parent:null,connectedToParent:!1}))}get isDisabled(){var t;return!!((t=this.draftParent)!=null&&t.$ref)}get label(){return nv(this.$ref)??this.type}setNodeId(t){this.nodeId=t}get id(){return this.state.model.id}get draftId(){return this.state.id}get parent(){return this.state.model.parent}get draftParent(){return this.state.parent}get connectedToParent(){return this.state.model.connectedToParent}get draftConnectedToParent(){return this.state.connectedToParent}getSchema(){return this.$ref?{$ref:this.$ref}:{type:Le.Number,default:0}}get isValid(){return!0}get isDirtyItself(){return this.state.isDirty}get isDirty(){return this.isDirtyItself}setId(t){this.state.id=t}setParent(t){this.state.parent=t,this.state.connectedToParent=!0}onRemoveFromParent(){this.state.connectedToParent=!1}submitChanges(){this.state.submit()}resetChanges(){this.state.reset()}}class ec{constructor(){Pe(this,"nodeId",nn());Pe(this,"type",qs.String);Pe(this,"$ref","");Pe(this,"state");st(this,{},{autoBind:!0}),this.state=kc(er({id:"",foreignKey:null,parent:null,connectedToParent:!1}))}get isDisabled(){var t;return!!((t=this.draftParent)!=null&&t.$ref)}get label(){return this.draftForeignKey?"foreign key":nv(this.$ref)??this.type}setNodeId(t){this.nodeId=t}get id(){return this.state.model.id}get draftId(){return this.state.id}get parent(){return this.state.model.parent}get draftParent(){return this.state.parent}get connectedToParent(){return this.state.model.connectedToParent}get draftConnectedToParent(){return this.state.connectedToParent}get foreignKey(){return this.state.model.foreignKey}get draftForeignKey(){return this.state.foreignKey}getSchema(){var r,n;if(this.$ref)return{$ref:this.$ref};const t={type:Le.String,default:""};return(r=this.state.foreignKey)!=null&&r.draftForeignKey&&(t.foreignKey=(n=this.state.foreignKey)==null?void 0:n.draftForeignKey),t}get isValid(){return!(this.state.foreignKey&&!this.state.foreignKey.draftForeignKey)}get isDirtyItself(){return this.state.isDirty||!!(this.state.foreignKey&&this.state.foreignKey.isDirtyItself)}get isDirty(){return this.isDirtyItself}setId(t){this.state.id=t}setParent(t){this.state.parent=t,this.state.connectedToParent=!0}onRemoveFromParent(){this.state.connectedToParent=!1}setForeignKey(t){this.state.foreignKey=t,t&&t.setParent(this)}submitChanges(){this.state.submit(),this.state.foreignKey&&this.state.foreignKey.submitChanges()}resetChanges(){this.state.reset(),this.state.foreignKey&&this.state.foreignKey.resetChanges()}}class Lbe{constructor(){Pe(this,"nodeId",nn());Pe(this,"type",qs.StringForeignKey);Pe(this,"state");st(this,{},{autoBind:!0}),this.state=kc(er({foreignKey:null,parent:null,connectedToParent:!1}))}get isDisabled(){var t;return!!((t=this.draftParent)!=null&&t.$ref)}get parent(){return this.state.model.parent}get draftParent(){return this.state.parent}get connectedToParent(){return this.state.model.connectedToParent}get draftConnectedToParent(){return this.state.connectedToParent}setNodeId(t){this.nodeId=t}get foreignKey(){return this.state.model.foreignKey}get draftForeignKey(){return this.state.foreignKey}get isDirtyItself(){return this.state.isDirty}setForeignKey(t){this.state.foreignKey=t}setParent(t){this.state.parent=t,this.state.connectedToParent=!0}onRemoveFromParent(){this.state.connectedToParent=!1}submitChanges(){this.state.submit()}resetChanges(){this.state.reset()}}const v3=e=>{if("$ref"in e){const t=p3[e.$ref];if(!t)throw new Error(`Schema refs must be defined ref$=${e.$ref}`);const r=v3(t);return r.$ref=e.$ref,r}switch(e.type){case Le.Object:{const t=new pn;return Object.entries(e.properties).forEach(([r,n])=>{const i=Ba(n);i.setId(r),t.addProperty(i)}),t}case Le.Array:{const t=Ba(e.items);return new Jn(t)}case Le.String:{const t=new ec;if(e.foreignKey!==void 0){const r=new Lbe;r.setForeignKey(e.foreignKey),t.setForeignKey(r)}return t}case Le.Number:return new Fbe;case Le.Boolean:return new Nbe}},Ba=e=>v3(e),Bbe=(e,t=!1)=>{let r="",n=e;for(;n.draftParent;)n.draftParent instanceof pn?r=`/properties/${n===e&&t?n.id:n.draftId}${r}`:n.draftParent instanceof Jn&&(r=`/items${r}`),n=n.draftParent;return r};function*Xb(e,t,r){if(yield*t(e),e instanceof pn)for(const n of e.draftProperties)yield*Xb(n,t);else e instanceof Jn&&(yield*Xb(e.draftItems,t))}function VP(e,t,r){let n=!0;if(r||(n=t(e)),!n)return!1;if(e instanceof pn)for(const i of e.draftProperties)VP(i,t);else e instanceof Jn&&VP(e.draftItems,t)}const Vbe=e=>[...Xb(e,function*(t){(t instanceof pn||t instanceof Jn)&&(yield t)})],g3=(e,t)=>e.draftParent?e===t?!0:g3(e.draftParent,t):!1,b2=e=>{const t=[];let r=e.draftParent;for(;r;)t.push(r),r=r.draftParent;return t},zbe=(e,t)=>{const r=b2(t),n=b2(e),i=r.find(a=>a instanceof Jn);return i?!n.find(a=>a===i):!1},Zh=(e,t)=>!(!t.draftParent||e===t||e===t.draftParent||g3(e,t)||zbe(e,t)),Tu=(e,t)=>{const r=[e];let n=e,i=Jb(e,t==null?void 0:t.preferDraftParent);for(;i;)r.push(i),n=i,i=Jb(n,t==null?void 0:t.preferDraftParent);return r},Bh=e=>{let t="",r=e[0];for(let n=1;n<e.length;n++){const i=e[n];i instanceof pn?t=`/properties/${y3(r,!1)}${t}`:i instanceof Jn&&(t=`/items${t}`),r=i}return t},w2=(e,t)=>{let r="",n=e,i=Jb(e,t==null?void 0:t.preferDraftParent);for(;i;)i instanceof pn?r=`/properties/${n===e&&t.preferStartWithNotDraftId?n.id:y3(n,t==null?void 0:t.preferDraftId)}${r}`:i instanceof Jn&&(r=`/items${r}`),n=i,i=Jb(n,t==null?void 0:t.preferDraftParent);return r},Jb=(e,t)=>t?e.draftParent||e.parent:e.parent||e.draftParent,y3=(e,t)=>t?e.draftId||e.id:e.id||e.draftId;class qbe{constructor(){Pe(this,"stack",[]);Pe(this,"setIdMap",new Set)}add(t){this.stack.push({node:t,op:"add",sequence:Tu(t,{preferDraftParent:!0})})}remove(t){const r=this.stack.findIndex(n=>n.node===t&&n.op==="add");this.deepRemovePatches(t),r===-1&&this.stack.push({node:t,op:"remove",sequence:Tu(t,{preferDraftParent:!0})})}replace(t,r){if(this.checkIfStringDuplicationInReplace(r))return;this.stack.findIndex(i=>i.node.nodeId===r.nodeId&&i.op==="add")!==-1?(this.deepRemovePatches(t,!1),this.stack.push({node:r,op:"add",sequence:Tu(r,{preferDraftParent:!0})})):(this.deepRemovePatches(t,!0),this.stack.push({node:r,op:"replace",sequence:Tu(r,{preferDraftParent:!0})}))}move(t){const r=this.stack.findIndex(i=>i.node===t&&i.op==="move");r!==-1&&this.stack.splice(r,1),t.parent===t.draftParent&&t.id===t.draftId||this.stack.push({node:t,op:"move",fromSequence:Tu(t,{preferDraftParent:!1}),toSequence:Tu(t,{preferDraftParent:!0})})}reset(){this.stack.length=0,this.setIdMap.clear()}getPatches(t){return[...this.getStackPatches(),...this.getMoveIdPatches(t)]}setId(t){this.setIdMap.add(t.nodeId)}getMoveIdPatches(t){const r=this;return[...Xb(t,function*(i){r.setIdMap.has(i.nodeId)&&i.draftParent instanceof pn&&(yield{op:"move",from:w2(i,{preferDraftParent:!0,preferDraftId:!0,preferStartWithNotDraftId:!0}),path:w2(i,{preferDraftParent:!0,preferDraftId:!0})})})]}getStackPatches(){return this.stack.map(t=>{switch(t.op){case"add":return{op:"add",path:Bh(t.sequence),value:t.node.getSchema({skipMovedBetweenParentsNodes:!0})};case"replace":return{op:"replace",path:Bh(t.sequence),value:t.node.getSchema({skipMovedBetweenParentsNodes:!0})};case"remove":return{op:"remove",path:Bh(t.sequence)};case"move":return{op:"move",from:Bh(t.fromSequence),path:Bh(t.toSequence)}}})}checkIfStringDuplicationInReplace(t){return!!(t.type===qs.String&&this.stack.find(n=>n.node===t))}deepRemovePatches(t,r){VP(t,n=>{let i=this.stack.findIndex(a=>a.node.nodeId===n.nodeId&&a.op!=="move");for(;i!==-1;)this.stack.splice(i,1),i=this.stack.findIndex(a=>a.node.nodeId===n.nodeId&&a.op!=="move");const o=this.stack.findIndex(a=>a.node.nodeId===n.nodeId&&a.op==="move");return o!==-1?(this.stack.splice(o,1,{node:n,op:"remove",sequence:Tu(n,{preferDraftParent:!1})}),this.deepRemovePatches(n,!0),!1):!0},r)}}class S2{constructor(t=new pn,r=""){Pe(this,"viewMode",zn.Tree);Pe(this,"state");Pe(this,"history",new qbe);st(this,{},{autoBind:!0}),this.state=kc(er({node:t,tableId:r}))}get node(){return this.state.node}get tableId(){return this.state.tableId}get draftTableId(){return this.state.node.draftId}get isApproveDisabled(){return!this.state.node.isValid||!this.state.node.isDirty}get isDirty(){return this.state.node.isDirty}get isDirtyItself(){return this.state.node.isDirtyItself}getPlainSchema(){return this.state.node.getSchema()}setViewMode(t){this.viewMode=t}getPatches(){return this.state.node!==this.state.model.node?[{op:"replace",path:"",value:this.state.node.getSchema()}]:[...this.history.getPatches(this.state.node)]}areThereDropTargets(t){return dn(()=>!!Vbe(this.state.node).filter(n=>Zh(n,t)).length).get()}replaceNode(t){this.state.node=t}submitChanges(){this.node.submitChanges(),this.state.tableId=this.node.id,this.state.submit(),this.history.reset()}resetChanges(){this.node.resetChanges(),this.history.reset()}setId(t,r){t.setId(r),t.parent&&this.history.setId(t)}addProperty(t,r,n=null){t.addProperty(r,n),r.parent?this.history.move(r):this.history.add(r)}removeProperty(t,r){t.removeProperty(r.nodeId),this.history.remove(r)}replaceProperty(t,r,n){t.replaceProperty(r,n),this.history.replace(r,n)}replaceItems(t,r){const n=t.draftItems;t.replaceItems(r),r.parent?this.history.move(r):this.history.replace(n,r)}setForeignKey(t,r){t.setForeignKey(r),this.history.replace(t,t)}setForeignKeyValue(t,r){t&&t.draftParent&&(t.setForeignKey(r),this.history.replace(t.draftParent,t.draftParent))}}const Ube=Ne`
|
1357
1357
|
mutation CreateTableMst($data: CreateTableInput!) {
|
1358
1358
|
createTable(data: $data) {
|
1359
1359
|
branch {
|
@@ -1386,10 +1386,10 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
1386
1386
|
}
|
1387
1387
|
}
|
1388
1388
|
${is}
|
1389
|
-
`,Ybe=async e=>{const t=await xr.mutate({mutation:Qbe,variables:e});if(!t.data)throw t.errors;return t.data};class Xbe{constructor(t,r,n){this.rootStore=t,this.branch=r,this.store=n}async execute(){const t=await this.updateTableRequest();this.resetRowsConnectionCache(),this.branch.touched||this.branch.updateTouched(!0),t&&await this.refetchTablesConnection()}async updateTableRequest(){let t=!1;if(this.store.tableId!==this.store.draftTableId){const n=await Gbe({data:{revisionId:this.branch.draft.id,tableId:this.store.tableId,nextTableId:this.store.draftTableId}});this.addVersionedTableToCache(n.renameTable.table),t=!0}if(this.store.getPatches().length){const n=await Ybe({data:{revisionId:this.branch.draft.id,tableId:this.store.draftTableId,patches:this.store.getPatches()}}),i=this.addVersionedTableToCache(n.updateTable.table),o=n.updateTable.previousVersionTableId;t=t||i.versionId!==o}return t}addVersionedTableToCache(t){return this.addTableToCache(t)}addTableToCache(t){const r=this.rootStore.cache.addOrTable(Lf(t));return this.rootStore.cache.addTableByVariables({revisionId:this.branch.draft.id,tableId:this.store.draftTableId},r.versionId),r}resetRowsConnectionCache(){const t=this.rootStore.cache.getTableByVariables({tableId:this.store.draftTableId,revisionId:this.branch.draft.id});t&&t.rowsConnection.reset()}async refetchTablesConnection(){await this.rootStore.queryTables({revisionId:this.branch.draft.id,first:50})}}var Qn=(e=>(e.List="List",e.CreatingTable="CreatingTable",e.ConnectingForeignKeyTable="ConnectingForeignKeyTable",e.UpdatingTable="UpdatingTable",e))(Qn||{});class _A{constructor(t,r,n){Pe(this,"id",nn());this.rootStore=t,this.projectPageModel=r,this.state=n,st(this,{},{autoBind:!0})}get currentForeignKeyPath(){return this.state.type==="ConnectingForeignKeyTable"&&this.state.foreignKeyNode.draftParent?Bbe(this.state.foreignKeyNode.draftParent):""}get title(){return this.revision.id===this.branch.draft.id?`Branch - ${this.branch.name}[draft]`:this.revision.id===this.branch.head.id?`Branch - ${this.branch.name}`:`Branch - ${this.branch.name}[rev:${this.revision.id.slice(0,6)}]`}toList(){this.state={type:"List",isSelectingForeignKey:this.state.isSelectingForeignKey}}toConnectingForeignKeyTable(t){if(this.state.type==="CreatingTable"||this.state.type==="UpdatingTable")this.state={type:"ConnectingForeignKeyTable",previousType:this.state.type,store:this.state.store,isSelectingForeignKey:this.state.isSelectingForeignKey,foreignKeyNode:t};else throw new Error("Invalid state")}toCreatingTable(){const t=this.state.type==="ConnectingForeignKeyTable"?this.state.store:new SA;this.state={type:"CreatingTable",store:t,isSelectingForeignKey:this.state.isSelectingForeignKey}}toUpdatingTableFromConnectingForeignKeyTable(){if(this.state.type!=="ConnectingForeignKeyTable")throw new Error("Invalid state");const t=this.state.store;this.state={type:"UpdatingTable",store:t,isSelectingForeignKey:this.state.isSelectingForeignKey}}toUpdatingTableFromCreatingTable(){if(this.state.type!=="CreatingTable")throw new Error("Invalid state");const t=this.state.store;this.state={type:"UpdatingTable",store:t,isSelectingForeignKey:!1}}toUpdatingTable(t){const r=this.rootStore.cache.getTable(t);if(!r)throw new Error(`Not found table.versionId ${t}`);const n=Ba(r.schema);n.setId(r.id),n.submitChanges();const i=new SA(n,r.id);this.state={type:"UpdatingTable",store:i,isSelectingForeignKey:this.state.isSelectingForeignKey}}get branch(){return this.projectPageModel.branchOrThrow}get revision(){return this.projectPageModel.revisionOrThrow}init(){}dispose(){}async createTable(t,r){try{return await new Wbe(this.rootStore,this.branch,t,r).execute(),!0}catch(n){return console.log(n),!1}}async updateTable(t){try{return await new Xbe(this.rootStore,this.branch,t).execute(),!0}catch(r){return console.error(r),!1}}}class Jbe{constructor(t,r){Pe(this,"stack");this.rootStore=t,this.projectPageModel=r,st(this,{},{autoBind:!0}),this.stack=[this.createFirstStackItem()]}init(){}dispose(){}selectForeignKey(t,r){t.toConnectingForeignKeyTable(r),this.stack.push(new _A(this.rootStore,this.projectPageModel,{type:Qn.List,isSelectingForeignKey:!0}))}onSelectedForeignKey(t,r){const n=this.stack.findIndex(o=>o===t),i=this.stack[n-1];i.state.type===Qn.ConnectingForeignKeyTable&&(i.state.store.setForeignKeyValue(i.state.foreignKeyNode,r),i.state.previousType===Qn.CreatingTable?i.toCreatingTable():i.state.previousType===Qn.UpdatingTable&&i.toUpdatingTableFromConnectingForeignKeyTable()),this.stack.splice(n)}cancelSelectingForeignKey(t){const r=this.stack.findIndex(n=>n===t);r!==-1&&this.stack.splice(r+1),t.state.type===Qn.ConnectingForeignKeyTable&&(t.state.previousType===Qn.CreatingTable?t.toCreatingTable():t.state.previousType===Qn.UpdatingTable&&t.toUpdatingTableFromConnectingForeignKeyTable())}createFirstStackItem(){const t={type:Qn.List,isSelectingForeignKey:!1};return new _A(this.rootStore,this.projectPageModel,t)}}const Zbe=()=>{const e=Zn(),[t]=O.useState(()=>new Jbe(ct,e));return O.useEffect(()=>(t.init(),()=>t.dispose()),[t]),t},b3=O.createContext(null),e0e=()=>{const e=O.useContext(b3);if(!e)throw new Error("Invalid TableStackModelContext");return e},t0e=Ot(({onClick:e})=>{const t=Zn();return x.jsx(Af,{dataTestId:"create-table-button",isDisabled:!t.isEditableRevision,title:"Table",onClick:e})});var pc=(e=>(e.Creating="Creating",e.Updating="Updating",e.Reading="Reading",e))(pc||{});const w3=O.createContext(null),mw=()=>{const e=O.useContext(w3);if(!e)throw new Error("Invalid SchemaEditorActions context");return e},r0e=({isSelected:e,onClick:t,icon:r,dataTestId:n})=>x.jsx(Lo,{"data-testid":n,_disabled:e?{backgroundColor:"gray.50",cursor:"not-allowed"}:void 0,_hover:{backgroundColor:"gray.50"},isDisabled:e,alignSelf:"flex-start",variant:"ghost",onClick:t,width:"48px",children:r}),n0e=[{mode:zn.Tree,icon:x.jsx(Gce,{}),dataTestId:"row-editor-mode-tree"},{mode:zn.Json,icon:x.jsx(Bce,{}),dataTestId:"row-editor-mode-json"},{mode:zn.RefBy,icon:x.jsx(OB,{}),dataTestId:"row-editor-mode-refs"}],yT=({mode:e,onChange:t,availableRefByMode:r})=>{const n=O.useMemo(()=>n0e.filter(i=>!(i.mode===zn.RefBy&&!r)),[r]);return x.jsx(je,{gap:"4px",children:n.map(i=>x.jsx(r0e,{dataTestId:i.dataTestId,isSelected:i.mode===e,onClick:()=>{t==null||t(i.mode)},icon:i.icon},i.mode))})};var $_={},Vh={},xA;function S3(){if(xA)return Vh;xA=1,Object.defineProperty(Vh,"__esModule",{value:!0}),Vh.bind=void 0;function e(t,r){var n=r.type,i=r.listener,o=r.options;return t.addEventListener(n,i,o),function(){t.removeEventListener(n,i,o)}}return Vh.bind=e,Vh}var Ou={},PA;function i0e(){if(PA)return Ou;PA=1;var e=Ou&&Ou.__assign||function(){return e=Object.assign||function(o){for(var a,l=1,c=arguments.length;l<c;l++){a=arguments[l];for(var d in a)Object.prototype.hasOwnProperty.call(a,d)&&(o[d]=a[d])}return o},e.apply(this,arguments)};Object.defineProperty(Ou,"__esModule",{value:!0}),Ou.bindAll=void 0;var t=S3();function r(o){if(!(typeof o>"u"))return typeof o=="boolean"?{capture:o}:o}function n(o,a){if(a==null)return o;var l=e(e({},o),{options:e(e({},r(a)),r(o.options))});return l}function i(o,a,l){var c=a.map(function(d){var f=n(d,l);return(0,t.bind)(o,f)});return function(){c.forEach(function(f){return f()})}}return Ou.bindAll=i,Ou}var CA;function o0e(){return CA||(CA=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.bindAll=e.bind=void 0;var t=S3();Object.defineProperty(e,"bind",{enumerable:!0,get:function(){return t.bind}});var r=i0e();Object.defineProperty(e,"bindAll",{enumerable:!0,get:function(){return r.bindAll}})}($_)),$_}var vw=o0e(),Tp={isSafari:!1,leavingWindow:Symbol("leaving"),enteringWindow:Symbol("entering")};function a0e(e){var t=e.dragLeave;return t.type!=="dragleave"?!1:Tp.isSafari?t.hasOwnProperty(Tp.leavingWindow):t.relatedTarget==null}(function(){if(typeof window>"u")return;var t=navigator,r=t.userAgent,n=r.includes("AppleWebKit")&&!r.includes("Chrome");if(!n)return;Tp.isSafari=!0;function i(){return{enterCount:0,isOverWindow:!1}}var o=i();function a(){o=i()}vw.bindAll(window,[{type:"dragstart",listener:function(){o.enterCount=0,o.isOverWindow=!0}},{type:"drop",listener:a},{type:"dragend",listener:a},{type:"dragenter",listener:function(c){!o.isOverWindow&&o.enterCount===0&&(c[Tp.enteringWindow]=!0),o.isOverWindow=!0,o.enterCount++}},{type:"dragleave",listener:function(c){o.enterCount--,o.isOverWindow&&o.enterCount===0&&(c[Tp.leavingWindow]=!0,o.isOverWindow=!1)}}],{capture:!0})})();function s0e(e,t){var r=t.property,n=t.rule,i=t.priority,o=i===void 0?"":i,a=e.style.getPropertyValue(r),l=e.style.getPropertyPriority(r);return e.style.setProperty(r,n,o),function(){e.style.setProperty(r,a,l)}}function l0e(e){var t=e.current,r=document.elementFromPoint(t.input.clientX,t.input.clientY);return r instanceof HTMLElement?s0e(r,{property:"pointer-events",rule:"auto",priority:"important"}):null}function u0e(){var e,t=document.createElement("style");return t.setAttribute("pdnd-post-drag-fix","true"),document.head.appendChild(t),(e=t.sheet)===null||e===void 0||e.insertRule("* { pointer-events: none !important; }"),function(){document.head.removeChild(t)}}function EA(e){var t=e.current;queueMicrotask(function(){var r=l0e({current:t}),n=u0e();function i(){o(),r==null||r(),n()}var o=vw.bindAll(window,[{type:"pointerdown",listener:i},{type:"pointermove",listener:i},{type:"focusin",listener:i},{type:"focusout",listener:i},{type:"dragstart",listener:i}],{capture:!0})})}function bT(e){return{altKey:e.altKey,button:e.button,buttons:e.buttons,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey,clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY}}var c0e=function(t){var r=[],n=null,i=function(){for(var a=arguments.length,l=new Array(a),c=0;c<a;c++)l[c]=arguments[c];r=l,!n&&(n=requestAnimationFrame(function(){n=null,t.apply(void 0,r)}))};return i.cancel=function(){n&&(cancelAnimationFrame(n),n=null)},i},A_=c0e(function(e){return e()}),jg=function(){var e=null;function t(n){var i=requestAnimationFrame(function(){e=null,n()});e={frameId:i,fn:n}}function r(){e&&(cancelAnimationFrame(e.frameId),e.fn(),e=null)}return{schedule:t,flush:r}}();function d0e(e){var t=e.source,r=e.initial,n=e.dispatchEvent,i={dropTargets:[]};function o(l){n(l),i={dropTargets:l.payload.location.current.dropTargets}}var a={start:function(c){var d=c.nativeSetDragImage,f={current:r,previous:i,initial:r};o({eventName:"onGenerateDragPreview",payload:{source:t,location:f,nativeSetDragImage:d}}),jg.schedule(function(){o({eventName:"onDragStart",payload:{source:t,location:f}})})},dragUpdate:function(c){var d=c.current;jg.flush(),A_.cancel(),o({eventName:"onDropTargetChange",payload:{source:t,location:{initial:r,previous:i,current:d}}})},drag:function(c){var d=c.current;A_(function(){jg.flush();var f={initial:r,previous:i,current:d};o({eventName:"onDrag",payload:{source:t,location:f}})})},drop:function(c){var d=c.current,f=c.updatedExternalPayload;jg.flush(),A_.cancel(),o({eventName:"onDrop",payload:{source:f??t,location:{current:d,previous:i,initial:r}}})}};return a}var zP=!1;function _3(){return!zP}function f0e(e){return e.dataTransfer?e.dataTransfer.setDragImage.bind(e.dataTransfer):null}function h0e(e){var t=e.current,r=e.next;if(t.length!==r.length)return!0;for(var n=0;n<t.length;n++)if(t[n].element!==r[n].element)return!0;return!1}function p0e(e){var t=e.event,r=e.dragInterface,n=e.getDropTargetsOver,i=e.dispatchEvent;if(!_3())return;zP=!0;var o=m0e({event:t,dragInterface:r,getDropTargetsOver:n}),a=o;D_({event:t,current:o.dropTargets});var l=d0e({source:r.payload,dispatchEvent:i,initial:o});function c(b){var y=h0e({current:a.dropTargets,next:b.dropTargets});a=b,y&&l.dragUpdate({current:a})}function d(b){var y=bT(b),w=n({target:b.target,input:y,source:r.payload,current:a.dropTargets});w.length&&(b.preventDefault(),D_({event:b,current:w})),c({dropTargets:w,input:y})}function f(b){var y=b.updatedExternalPayload;l.drop({current:a,updatedExternalPayload:y})}function p(){a.dropTargets.length&&c({dropTargets:[],input:a.input}),f({updatedExternalPayload:null}),m()}function m(){zP=!1,g()}var g=vw.bindAll(window,[{type:"dragover",listener:function(y){d(y),l.drag({current:a})}},{type:"dragenter",listener:d},{type:"dragleave",listener:function(y){a0e({dragLeave:y})&&(c({input:a.input,dropTargets:[]}),r.startedFrom==="external"&&p())}},{type:"drop",listener:function(y){var w;y.preventDefault(),D_({event:y,current:a.dropTargets}),f({updatedExternalPayload:r.startedFrom==="external"&&((w=r.getDropPayload)===null||w===void 0?void 0:w.call(r,y))||null}),m(),r.startedFrom==="internal"&&EA({current:a})}},{type:"dragend",listener:function(){p(),r.startedFrom==="internal"&&EA({current:a})}},{type:"pointermove",listener:function(){var b=0;return function(){if(b<20){b++;return}p()}}()},{type:"pointerdown",listener:p}],{capture:!0});l.start({nativeSetDragImage:f0e(t)})}function D_(e){var t,r=e.event,n=e.current,i=(t=n[0])===null||t===void 0?void 0:t.dropEffect;i!=null&&r.dataTransfer&&(r.dataTransfer.dropEffect=i)}function m0e(e){var t=e.event,r=e.dragInterface,n=e.getDropTargetsOver,i=bT(t);if(r.startedFrom==="external")return{input:i,dropTargets:[]};var o=n({input:i,source:r.payload,target:t.target,current:[]});return{input:i,dropTargets:o}}var TA={canStart:_3,start:p0e},qP=new Map;function v0e(e){var t=e.typeKey,r=e.mount,n=qP.get(t);if(n)return n.usageCount++,n;var i={typeKey:t,unmount:r(),usageCount:1};return qP.set(t,i),i}function g0e(e){var t=v0e(e);return function(){t.usageCount--,!(t.usageCount>0)&&(t.unmount(),qP.delete(e.typeKey))}}function UP(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function y0e(e){if(Array.isArray(e))return UP(e)}function b0e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function w0e(e,t){if(e){if(typeof e=="string")return UP(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?UP(e,t):void 0}}function S0e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
1390
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _0e(e){return y0e(e)||b0e(e)||w0e(e)||S0e()}function x3(e,t){var r=t.attribute,n=t.value;return e.setAttribute(r,n),function(){return e.removeAttribute(r)}}function P3(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(){t.forEach(function(i){return i()})}}function
|
1391
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,l;return{s:function(){r=r.call(e)},n:function(){var d=r.next();return o=d.done,d},e:function(d){a=!0,l=d},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw l}}}}function x0e(e,t){if(e){if(typeof e=="string")return
|
1392
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,l;return{s:function(){r=r.call(e)},n:function(){var d=r.next();return o=d.done,d},e:function(d){a=!0,l=d},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw l}}}}function E0e(e,t){if(e){if(typeof e=="string")return IA(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return IA(e,t)}}function IA(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function kA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function T0e(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?kA(Object(r),!0).forEach(function(n){W4(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kA(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function O0e(){var e=new Set,t=null;function r(o){t&&(!o.canMonitor||o.canMonitor(t.canMonitorArgs))&&t.active.add(o)}function n(o){var a=T0e({},o);return e.add(a),r(a),function(){e.delete(a),t&&t.active.delete(a)}}function i(o){var a=o.eventName,l=o.payload;if(a==="onGenerateDragPreview"){t={canMonitorArgs:{initial:l.location.initial,source:l.source},active:new Set};var c=C0e(e),d;try{for(c.s();!(d=c.n()).done;){var f=d.value;r(f)}}catch(w){c.e(w)}finally{c.f()}}if(t){for(var p=Array.from(t.active),m=0,g=p;m<g.length;m++){var b=g[m];if(t.active.has(b)){var y;(y=b[a])===null||y===void 0||y.call(b,l)}}a==="onDrop"&&(t.active.clear(),t=null)}}return{dispatchEvent:i,monitorForConsumers:n}}function R0e(e){var t=e.typeKey,r=e.mount,n=e.dispatchEventToSource,i=e.defaultDropEffect,o=O0e(),a=P0e({typeKey:t,defaultDropEffect:i});function l(f){n==null||n(f),a.dispatchEvent(f),o.dispatchEvent(f)}function c(f){var p=f.event,m=f.dragInterface;TA.start({event:p,dragInterface:m,getDropTargetsOver:a.getIsOver,dispatchEvent:l})}function d(){function f(){var p={canStart:TA.canStart,start:c};return r(p)}return g0e({typeKey:t,mount:f})}return{registerUsage:d,dropTarget:a.dropTargetForConsumers,monitor:o.monitorForConsumers}}var Zb=new WeakMap;function I0e(e){return Zb.set(e.element,e),function(){Zb.delete(e.element)}}var wT=R0e({typeKey:"element",defaultDropEffect:"move",mount:function(t){return vw.bind(window,{type:"dragstart",listener:function(n){var i,o,a,l;if(t.canStart(n)){var c=n.target;if(!(c instanceof HTMLElement))return null;var d=Zb.get(c);if(!d)return null;var f=bT(n),p={element:d.element,dragHandle:(i=d.dragHandle)!==null&&i!==void 0?i:null,input:f};if(d.canDrag&&!d.canDrag(p))return n.preventDefault(),null;if(d.dragHandle){var m=document.elementFromPoint(f.clientX,f.clientY);if(!d.dragHandle.contains(m))return n.preventDefault(),null}try{var g;(g=n.dataTransfer)===null||g===void 0||g.setData("application/vnd.pdnd","")}catch{}var b={element:d.element,dragHandle:(o=d.dragHandle)!==null&&o!==void 0?o:null,data:(a=(l=d.getInitialData)===null||l===void 0?void 0:l.call(d,p))!==null&&a!==void 0?a:{}},y={key:"element",startedFrom:"internal",payload:b};t.start({event:n,dragInterface:y})}}})},dispatchEventToSource:function(t){var r,n,i=t.eventName,o=t.payload;(r=Zb.get(o.source.element))===null||r===void 0||(n=r[i])===null||n===void 0||n.call(r,o)}}),k0e=wT.dropTarget,j0e=wT.monitor;function $0e(e){return P3(wT.registerUsage(),I0e(e),x3(e.element,{attribute:"draggable",value:"true"}))}const C3=(e,t,r)=>{const n=O.useRef(null),[i,o]=O.useState(!1),[a,l]=O.useState(!1),[c,d]=O.useState(!1);return O.useEffect(()=>{let f=null;if(t){if(!n.current)return;f=$0e({element:n.current,getInitialData:()=>({store:e})})}return()=>f==null?void 0:f()},[e,t]),O.useEffect(()=>{if(!n.current)return;let f=null;return(e instanceof pn||e instanceof Jn)&&(f=k0e({element:n.current,onDrop:p=>{const m=p.source.data.store;Zh(e,m)&&r(m),d(!1),o(!1)},onDragEnter:p=>{const m=p.source.data.store;d(Zh(e,m))},onDragLeave:()=>d(!1)})),()=>f==null?void 0:f()},[r,e]),O.useEffect(()=>j0e({onDragStart:f=>{const p=f.source.data.store;(e instanceof pn||e instanceof Jn)&&Zh(e,p)?o(Zh(e,p)):l(!0)},onDrop:()=>{o(!1),l(!1)}}),[e]),{dragAndDropRef:n,isDrop:i,isDisabledDrop:a,isDraggedOver:c}},A0e=[{id:"String",label:Le.String,getSchemaNode:()=>Ba({type:Le.String,default:""})},{id:"Number",label:Le.Number,getSchemaNode:()=>Ba({type:Le.Number,default:0})},{id:"Boolean",label:Le.Boolean,getSchemaNode:()=>Ba({type:Le.Boolean,default:!1})},{id:"Object",label:Le.Object,getSchemaNode:()=>Ba({type:Le.Object,properties:{},required:[],additionalProperties:!1})},{id:"Array",label:Le.Array,getSchemaNode:e=>{let t={type:Le.String,default:""};return"$ref"in e||(e.type===Le.Number||e.type===Le.Boolean||e.type===Le.String)&&(t=e),Ba({type:Le.Array,items:t})}}],D0e=[{id:"ForeignKeyString",label:Le.String,getSchemaNode:e=>{let t={type:Le.String,default:"",foreignKey:""};return!("$ref"in e)&&e.type===Le.Array&&!("$ref"in e.items)&&e.items.type===Le.String&&e.items.foreignKey!==void 0&&(t=e.items),Ba(t)}}],M0e=[{id:"File",label:"File",getSchemaNode:()=>{const e={$ref:hc.File};return Ba(e)}}],E3=[{id:nn(),label:"Types",options:A0e},{id:nn(),label:"Foreign key",options:D0e},{id:nn(),label:"Schemas",options:M0e}],N0e=(e,t)=>{var r;return(r=E3.flatMap(n=>n.options).find(n=>n.id===e))==null?void 0:r.getSchemaNode(t)},T3=Ot(({currentSchema:e,menuButton:t,onSelect:r,dataTestId:n})=>{const i=O.useCallback(async o=>{if(!Array.isArray(o)){const a=N0e(o,e);a&&r(a)}},[e,r]);return x.jsxs(yF,{children:[t,x.jsx(xf,{children:x.jsx(wF,{width:"100px",children:E3.map(o=>x.jsx(_F,{value:"",title:o.label,onChange:i,children:o.options.map(a=>x.jsx(XC,{"data-testid":`${n}-menu-type-${a.id}`,value:a.id,children:a.label},a.id))},o.id))})})]})}),F0e=["Backspace","Escape","Enter","ArrowRight","ArrowLeft","Delete"],gw=({initValue:e,placeholder:t,autoFocus:r,onBlur:n,onChange:i,onEscape:o,onEnter:a,onFocus:l,focusIfDependencyList:c,restrict:d,prefix:f,postfix:p,dataTestId:m})=>{const g=O.useRef(null),b=O.useRef(null);O.useEffect(()=>{var k;r&&((k=g.current)==null||k.focus())},[r]),O.useLayoutEffect(()=>{if(window.getSelection()&&b.current!==null&&g.current){const E=(g.current.textContent||"").length,R=Math.min(E,b.current),T=document.createRange(),A=window.getSelection(),M=g.current.childNodes.length?g.current.childNodes[0]:g.current;T.setStart(M,R),T.collapse(!0),A&&(A.removeAllRanges(),A.addRange(T))}}),Cme(()=>{var k;if(c){(k=g.current)==null||k.focus();const E=window.getSelection();if(g.current&&E){const R=document.createRange();R.selectNodeContents(g.current),R.collapse(!1),E.removeAllRanges(),E.addRange(R)}}},[...c||[]]);const y=O.useCallback(k=>{const E=window.getSelection();E&&E.rangeCount>0&&(b.current=E.getRangeAt(0).startOffset),i==null||i(k.currentTarget.innerText)},[i]),w=O.useCallback(()=>{n==null||n(),b.current=null},[n]),_=O.useCallback(k=>{var E,R;k.key==="Enter"&&(k.preventDefault(),e&&((E=g.current)==null||E.blur(),a==null||a())),k.key==="Escape"&&(k.preventDefault(),e&&((R=g.current)==null||R.blur()),o==null||o()),d&&!F0e.includes(k.key)&&!d.test(k.key)&&k.preventDefault()},[e,a,o,d]),S=O.useCallback(()=>{var k;(k=g.current)==null||k.focus()},[]),C=!e&&t;return x.jsxs(je,{minWidth:0,width:C?"100%":void 0,position:"relative",onClick:S,children:[!C&&f,x.jsx(wt,{"data-testid":m,autoFocus:!0,ref:g,contentEditable:!0,spellCheck:"false",dangerouslySetInnerHTML:{__html:e},outline:0,width:"100%",onBlur:w,onFocus:l,onChange:y,onInput:y,onKeyDown:_}),!C&&p,C&&x.jsx(bt,{cursor:"text",userSelect:"none",pointerEvents:"none",whiteSpace:"nowrap",color:"gray.400",position:"absolute",children:t})]})},O3=({dataTestId:e,...t})=>x.jsx(Ci,{"data-testid":e,_hover:{backgroundColor:"gray.50"},color:"gray.400",icon:x.jsx(J0,{}),variant:"ghost",...t}),R3=Ot(({store:e,typeClassName:t,onBlur:r,onEnter:n,onRemove:i,onSelect:o,dataTestId:a})=>{const{root:l,mode:c}=mw(),[d,f]=O.useState(!1),p=O.useCallback(A=>{e instanceof pn?l.addProperty(e,A,{beforeNode:e.draftProperties[0]}):e instanceof Jn&&l.replaceItems(e,A)},[l,e]),m=!!(l.areThereDropTargets(e)&&e.draftId),{dragAndDropRef:g,isDrop:b,isDraggedOver:y,isDisabledDrop:w}=C3(e,m,p),_=O.useCallback(()=>{f(!1),r==null||r(e)},[r,e]),S=O.useCallback(()=>{f(!0)},[]),C=O.useCallback(()=>{n==null||n(e)},[n,e]),k=O.useCallback(()=>{i==null||i(e)},[i,e]),E=O.useCallback(A=>{l.setId(e,A)},[l,e]),R=O.useCallback(A=>{o(e,A)},[o,e]),T=!d;return e.isDisabled?x.jsxs(je,{gap:"0.5rem",width:"100%",justifyContent:"flex-start",outline:0,children:[x.jsx(je,{flex:0,position:"relative",borderWidth:1,borderStyle:"dashed",borderColor:"#00000000",color:"gray.300",whiteSpace:"nowrap",children:x.jsx(wt,{userSelect:"none",children:e.draftId})}),x.jsx(bt,{color:"gray.300",className:t,children:e.label})]}):x.jsxs(je,{gap:"0.5rem",width:"100%",justifyContent:"flex-start",outline:0,children:[x.jsxs(je,{"data-testid":b&&`${a}-drop`,flex:e.draftId?0:1,ref:g,position:"relative",borderWidth:1,borderStyle:"dashed",borderColor:b?"gray.400":"#00000000",backgroundColor:y?"gray.200":void 0,color:w?"gray.300":void 0,whiteSpace:"nowrap",children:[e.isDisabled?x.jsx(wt,{userSelect:"none",children:e.draftId}):x.jsxs(x.Fragment,{children:[m&&x.jsx(je,{"data-testid":`${a}-drag-button`,position:"absolute",left:"-34px",className:T?t:void 0,cursor:"grab",_hover:{backgroundColor:"gray.100"},height:"100%",alignItems:"center",justifyContent:"center",borderRadius:"4px",pl:"2px",pr:"2px",children:x.jsx(Tce,{boxSize:"14px",color:"gray.300"})}),x.jsx(gw,{dataTestId:a,autoFocus:!e.draftId,initValue:e.draftId,placeholder:e.draftParent?"Enter the name of the field":"Enter the name of the table",onBlur:_,onFocus:S,onChange:E,onEnter:C,focusIfDependencyList:[e.type]})]}),c===pc.Updating&&e.draftId&&e.isDirtyItself&&x.jsx(wt,{cursor:"default",children:"*"})]}),e.draftId&&x.jsx(T3,{dataTestId:a,currentSchema:e.getSchema({skipObjectProperties:!0}),onSelect:R,menuButton:x.jsx(YC,{"data-testid":`${a}-select-type-button`,as:bt,color:"gray.300",textDecoration:"underline",cursor:"pointer",className:T?t:void 0,children:e.label})}),i&&e.draftId&&x.jsx(O3,{"data-testid":`${a}-remove-button`,height:"26px","aria-label":"remove",color:"gray.200",_hover:{color:"gray.400"},className:T?t:void 0,onClick:k})]})}),ST=({field:e,fieldClassName:t,children:r})=>x.jsxs(je,{flexDirection:"column",alignSelf:"flex-start",width:"100%",children:[x.jsxs(je,{gap:"4px",alignItems:"center",height:"30px",mt:"2px",mb:"2px",className:t,position:"relative",children:[x.jsx(wt,{position:"absolute",ml:"-200px",height:"100%",width:"200px"}),x.jsx(wt,{color:"gray.300",children:x.jsx(HE,{})}),e]}),r&&x.jsx(je,{ml:"7px",pl:"18px",borderLeftWidth:1,borderLeftStyle:"solid",borderLeftColor:"white",_hover:{borderLeftColor:"blackAlpha.200"},children:r})]}),L0e=Ot(({node:e,dataTestId:t})=>{const{mode:r,root:n}=mw(),i=O.useCallback(f=>{const p=e.draftItems;p instanceof pn?n.addProperty(p,f,{beforeNode:p.draftProperties[0]}):p instanceof Jn&&n.replaceItems(p,f)},[e.draftItems,n]),{dragAndDropRef:o,isDrop:a,isDraggedOver:l,isDisabledDrop:c}=C3(e.draftItems,!0,i),d=O.useCallback(f=>{n.replaceItems(e,f),f instanceof pn&&!f.$ref&&n.addProperty(f,new ec)},[e,n]);return x.jsx(je,{flexDirection:"column",width:"100%",children:x.jsx(ST,{field:x.jsx(T3,{dataTestId:t,currentSchema:e.draftItems.getSchema({skipObjectProperties:!0}),onSelect:d,menuButton:x.jsx(wt,{"data-testid":a&&`${t}-drop`,ref:o,borderWidth:1,borderStyle:"dashed",borderColor:a?"gray.400":"#00000000",backgroundColor:l?"gray.200":void 0,color:c?"gray.300":void 0,children:x.jsxs(YC,{"data-testid":`${t}-select-type-button`,as:bt,color:a?void 0:"gray.300",cursor:"pointer",outline:0,_hover:{textDecoration:"underline",textDecorationColor:"gray.300"},children:[e.draftItems.label,r===pc.Updating&&e.draftItems.isDirtyItself&&x.jsx("span",{children:"*"})]})})}),children:x.jsx(_T,{dataTestId:`${t}-0`,node:e.draftItems})})})}),B0e="_Root_1ypkj_1",V0e="_Field_1ypkj_1",e0={Root:B0e,Field:V0e},z0e=Ot(({node:e,dataTestId:t})=>{const{root:r}=mw(),n=O.useCallback(()=>{r.addProperty(e,new ec)},[e,r]),i=O.useCallback(c=>{c.draftId||r.removeProperty(e,c)},[e,r]),o=O.useCallback(c=>{r.removeProperty(e,c)},[e,r]),a=O.useCallback((c,d)=>{r.replaceProperty(e,c,d)},[e,r]),l=O.useCallback(c=>{c instanceof pn?r.addProperty(c,new ec,{beforeNode:c.draftProperties[0]}):r.addProperty(e,new ec,{afterNode:c})},[e,r]);return x.jsxs(je,{flexDirection:"column",width:"100%",children:[e.draftProperties.map((c,d)=>x.jsx(ST,{fieldClassName:e0.Root,field:x.jsx(R3,{dataTestId:`${t}-${d}`,store:c,typeClassName:e0.Field,onSelect:a,onBlur:i,onRemove:o,onEnter:l}),children:x.jsx(_T,{dataTestId:`${t}-${d}`,node:c})},c.nodeId)),e.showingCreateField&&x.jsx(wt,{ml:"-14px",children:x.jsx(Af,{dataTestId:`${t}-create-field-button`,title:"Field",isDisabled:e.isDisabledCreateField,onClick:n})})]})}),q0e=Ot(({node:e,dataTestId:t})=>{const r=mw(),n=O.useCallback(()=>{r.onSelectForeignKey(e)},[r,e]);return x.jsxs(je,{gap:"4px",alignItems:"center",height:"30px",mt:"2px",mb:"2px",children:[x.jsx(wt,{color:"gray.300",children:x.jsx(HE,{})}),x.jsx(je,{gap:"0.5rem",width:"100%",justifyContent:"flex-start",outline:0,_hover:{textDecoration:"underline",textDecorationColor:"gray.300"},onClick:n,children:x.jsx(bt,{color:"gray.300",cursor:"pointer","data-testid":`${t}-connect-foreign-key`,children:e.draftForeignKey||"<Connect table>"})})]})}),U0e=Ot(({node:e,dataTestId:t})=>e.draftForeignKey?x.jsx(je,{flexDirection:"column",width:"100%",children:x.jsx(q0e,{dataTestId:`${t}-0`,node:e.draftForeignKey})}):null),_T=({node:e,dataTestId:t})=>{if(e instanceof pn)return x.jsx(z0e,{dataTestId:t,node:e});if(e instanceof Jn)return x.jsx(L0e,{dataTestId:t,node:e});if(e instanceof ec)return x.jsx(U0e,{dataTestId:t,node:e})},H0e=Ot(({store:e})=>{const t=O.useCallback((n,i)=>{i.setId(n.draftId),e.replaceNode(i)},[e]),r=O.useCallback(n=>{n instanceof pn&&n.addProperty(new ec,{beforeNode:n.draftProperties[0]})},[]);return x.jsx(ST,{fieldClassName:e0.Root,field:x.jsx(R3,{dataTestId:"0",store:e.node,typeClassName:e0.Field,onSelect:t,onEnter:r}),children:x.jsx(_T,{dataTestId:"0",node:e.node})})}),I3=({height:e="2.5rem",onClick:t,isDisabled:r,dataTestId:n})=>x.jsx(Lo,{"data-testid":n,isDisabled:r,_hover:{backgroundColor:"gray.50"},alignSelf:"flex-start",height:e,variant:"ghost",onClick:t,children:x.jsx(Vce,{})}),W0e=({dataTestId:e,...t})=>x.jsx(Ci,{"data-testid":e,_hover:{backgroundColor:"gray.100"},color:"gray.400",icon:x.jsx(Ece,{}),variant:"ghost",...t}),K0e="_JsonCard_15gzu_1",G0e="_CopyButton_15gzu_1",jA={JsonCard:K0e,CopyButton:G0e},k3=({data:e})=>{const t=JSON.stringify(e,null,3),r=O.useCallback(async()=>{const n="text/plain",i=new Blob([t],{type:n}),o=[new ClipboardItem({[n]:i})];await navigator.clipboard.write(o),KE({status:"success",variant:"subtle",icon:!1,colorScheme:"gray",duration:1500,isClosable:!0,position:"top",description:"Copied to clipboard"})},[t]);return x.jsxs(wt,{width:"100%",position:"relative",className:jA.JsonCard,children:[x.jsx(W0e,{dataTestId:"json-card-copy-button","aria-label":"",position:"absolute",top:"8px",right:"8px",className:jA.CopyButton,onClick:r}),x.jsx(BC,{whiteSpace:"pre-wrap",backgroundColor:"gray.50",padding:"24px",width:"100%",borderRadius:"8px",children:t})]})},j3=({onClick:e,isDisabled:t,dataTestId:r})=>x.jsx(Lo,{"data-testid":r,isDisabled:t,_hover:{backgroundColor:"gray.50"},alignSelf:"flex-start",color:"gray.400",height:"2.5rem",variant:"ghost",onClick:e,children:x.jsx(PB,{size:"16"})}),Q0e="_Root_1k7pa_1",Y0e="_Actions_1k7pa_1",$A={Root:Q0e,Actions:Y0e},AA=Ot(({store:e,mode:t,onApprove:r,onCancel:n,onSelectForeignKey:i})=>{const[o,a]=O.useState(!1),l=O.useCallback(async()=>{a(!0),await r(),a(!1)},[r]);return x.jsx(w3.Provider,{value:{onSelectForeignKey:i,mode:t,root:e},children:x.jsxs(je,{flex:1,flexDirection:"column",gap:"0.5rem",className:$A.Root,"date-testid":"schema-data-card",children:[x.jsxs(je,{justifyContent:"space-between",width:"100%",alignItems:"center",paddingBottom:"8px",children:[x.jsxs(wt,{children:[t===pc.Creating?x.jsx(Z0,{dataTestId:"close-create-table-button",onClick:n}):x.jsx(I3,{dataTestId:"back-to-table-list-button",onClick:n}),x.jsx(Qm,{dataTestId:"schema-editor-approve-button",onClick:l,isDisabled:e.isApproveDisabled,loading:o}),t===pc.Updating&&e.isDirty&&x.jsx(j3,{dataTestId:"schema-editor-revert-button",onClick:e.resetChanges})]}),x.jsx(wt,{className:$A.Actions,children:x.jsx(yT,{availableRefByMode:!1,mode:e.viewMode||zn.Tree,onChange:e.setViewMode})})]}),e.viewMode===zn.Tree&&x.jsx(wt,{paddingBottom:"4rem",children:x.jsx(H0e,{store:e})}),e.viewMode===zn.Json&&x.jsx(k3,{data:e.getPlainSchema()})]})})}),F_=()=>x.jsx(je,{width:"100%",borderStyle:"solid",borderTopWidth:1,borderColor:"gray.100",justifyContent:"center",color:"gray.400",fontWeight:"300",pt:"0.5rem",pb:"0.5rem",children:x.jsx(wt,{backgroundColor:"gray.50",pl:"5px",pr:"5px",borderRadius:"5px",children:"Select or create a table to be referenced by the above table"})}),X0e=({previousType:e,tableId:t,foreignKeyPath:r,onCancel:n})=>{const i=O.useMemo(()=>e===Qn.UpdatingTable?"updating":e===Qn.CreatingTable?"creating":"",[e]);return x.jsx(wt,{width:"100%",borderStyle:"solid",borderLeftWidth:2,borderColor:"gray.200",pl:"1rem",mb:"1rem",children:x.jsxs(je,{gap:"4px",alignItems:"center",height:"30px",mt:"2px",mb:"2px",color:"gray.400",fontWeight:"300",children:[x.jsx(bt,{textDecoration:"underline",cursor:"pointer",onClick:n,children:"Back"}),x.jsxs(bt,{whiteSpace:"nowrap",children:["- ",i,' "',t,'" -']}),x.jsxs(bt,{minWidth:0,dir:"rtl",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:["path: ",r]})]})})},J0e=Ne`
|
1389
|
+
`,Ybe=async e=>{const t=await xr.mutate({mutation:Qbe,variables:e});if(!t.data)throw t.errors;return t.data};class Xbe{constructor(t,r,n){this.rootStore=t,this.branch=r,this.store=n}async execute(){const t=await this.updateTableRequest();this.resetRowsConnectionCache(),this.branch.touched||this.branch.updateTouched(!0),t&&await this.refetchTablesConnection()}async updateTableRequest(){let t=!1;if(this.store.tableId!==this.store.draftTableId){const n=await Gbe({data:{revisionId:this.branch.draft.id,tableId:this.store.tableId,nextTableId:this.store.draftTableId}});this.addVersionedTableToCache(n.renameTable.table),t=!0}if(this.store.getPatches().length){const n=await Ybe({data:{revisionId:this.branch.draft.id,tableId:this.store.draftTableId,patches:this.store.getPatches()}}),i=this.addVersionedTableToCache(n.updateTable.table),o=n.updateTable.previousVersionTableId;t=t||i.versionId!==o}return t}addVersionedTableToCache(t){return this.addTableToCache(t)}addTableToCache(t){const r=this.rootStore.cache.addOrTable(Lf(t));return this.rootStore.cache.addTableByVariables({revisionId:this.branch.draft.id,tableId:this.store.draftTableId},r.versionId),r}resetRowsConnectionCache(){const t=this.rootStore.cache.getTableByVariables({tableId:this.store.draftTableId,revisionId:this.branch.draft.id});t&&t.rowsConnection.reset()}async refetchTablesConnection(){await this.rootStore.queryTables({revisionId:this.branch.draft.id,first:50})}}var Qn=(e=>(e.List="List",e.CreatingTable="CreatingTable",e.ConnectingForeignKeyTable="ConnectingForeignKeyTable",e.UpdatingTable="UpdatingTable",e))(Qn||{});class _2{constructor(t,r,n){Pe(this,"id",nn());this.rootStore=t,this.projectPageModel=r,this.state=n,st(this,{},{autoBind:!0})}get currentForeignKeyPath(){return this.state.type==="ConnectingForeignKeyTable"&&this.state.foreignKeyNode.draftParent?Bbe(this.state.foreignKeyNode.draftParent):""}get title(){return this.revision.id===this.branch.draft.id?`Branch - ${this.branch.name}[draft]`:this.revision.id===this.branch.head.id?`Branch - ${this.branch.name}`:`Branch - ${this.branch.name}[rev:${this.revision.id.slice(0,6)}]`}toList(){this.state={type:"List",isSelectingForeignKey:this.state.isSelectingForeignKey}}toConnectingForeignKeyTable(t){if(this.state.type==="CreatingTable"||this.state.type==="UpdatingTable")this.state={type:"ConnectingForeignKeyTable",previousType:this.state.type,store:this.state.store,isSelectingForeignKey:this.state.isSelectingForeignKey,foreignKeyNode:t};else throw new Error("Invalid state")}toCreatingTable(){const t=this.state.type==="ConnectingForeignKeyTable"?this.state.store:new S2;this.state={type:"CreatingTable",store:t,isSelectingForeignKey:this.state.isSelectingForeignKey}}toUpdatingTableFromConnectingForeignKeyTable(){if(this.state.type!=="ConnectingForeignKeyTable")throw new Error("Invalid state");const t=this.state.store;this.state={type:"UpdatingTable",store:t,isSelectingForeignKey:this.state.isSelectingForeignKey}}toUpdatingTableFromCreatingTable(){if(this.state.type!=="CreatingTable")throw new Error("Invalid state");const t=this.state.store;this.state={type:"UpdatingTable",store:t,isSelectingForeignKey:!1}}toUpdatingTable(t){const r=this.rootStore.cache.getTable(t);if(!r)throw new Error(`Not found table.versionId ${t}`);const n=Ba(r.schema);n.setId(r.id),n.submitChanges();const i=new S2(n,r.id);this.state={type:"UpdatingTable",store:i,isSelectingForeignKey:this.state.isSelectingForeignKey}}get branch(){return this.projectPageModel.branchOrThrow}get revision(){return this.projectPageModel.revisionOrThrow}init(){}dispose(){}async createTable(t,r){try{return await new Wbe(this.rootStore,this.branch,t,r).execute(),!0}catch(n){return console.log(n),!1}}async updateTable(t){try{return await new Xbe(this.rootStore,this.branch,t).execute(),!0}catch(r){return console.error(r),!1}}}class Jbe{constructor(t,r){Pe(this,"stack");this.rootStore=t,this.projectPageModel=r,st(this,{},{autoBind:!0}),this.stack=[this.createFirstStackItem()]}init(){}dispose(){}selectForeignKey(t,r){t.toConnectingForeignKeyTable(r),this.stack.push(new _2(this.rootStore,this.projectPageModel,{type:Qn.List,isSelectingForeignKey:!0}))}onSelectedForeignKey(t,r){const n=this.stack.findIndex(o=>o===t),i=this.stack[n-1];i.state.type===Qn.ConnectingForeignKeyTable&&(i.state.store.setForeignKeyValue(i.state.foreignKeyNode,r),i.state.previousType===Qn.CreatingTable?i.toCreatingTable():i.state.previousType===Qn.UpdatingTable&&i.toUpdatingTableFromConnectingForeignKeyTable()),this.stack.splice(n)}cancelSelectingForeignKey(t){const r=this.stack.findIndex(n=>n===t);r!==-1&&this.stack.splice(r+1),t.state.type===Qn.ConnectingForeignKeyTable&&(t.state.previousType===Qn.CreatingTable?t.toCreatingTable():t.state.previousType===Qn.UpdatingTable&&t.toUpdatingTableFromConnectingForeignKeyTable())}createFirstStackItem(){const t={type:Qn.List,isSelectingForeignKey:!1};return new _2(this.rootStore,this.projectPageModel,t)}}const Zbe=()=>{const e=Zn(),[t]=O.useState(()=>new Jbe(ct,e));return O.useEffect(()=>(t.init(),()=>t.dispose()),[t]),t},b3=O.createContext(null),e0e=()=>{const e=O.useContext(b3);if(!e)throw new Error("Invalid TableStackModelContext");return e},t0e=Ot(({onClick:e})=>{const t=Zn();return x.jsx(Af,{dataTestId:"create-table-button",isDisabled:!t.isEditableRevision,title:"Table",onClick:e})});var pc=(e=>(e.Creating="Creating",e.Updating="Updating",e.Reading="Reading",e))(pc||{});const w3=O.createContext(null),mw=()=>{const e=O.useContext(w3);if(!e)throw new Error("Invalid SchemaEditorActions context");return e},r0e=({isSelected:e,onClick:t,icon:r,dataTestId:n})=>x.jsx(Lo,{"data-testid":n,_disabled:e?{backgroundColor:"gray.50",cursor:"not-allowed"}:void 0,_hover:{backgroundColor:"gray.50"},isDisabled:e,alignSelf:"flex-start",variant:"ghost",onClick:t,width:"48px",children:r}),n0e=[{mode:zn.Tree,icon:x.jsx(Gce,{}),dataTestId:"row-editor-mode-tree"},{mode:zn.Json,icon:x.jsx(Bce,{}),dataTestId:"row-editor-mode-json"},{mode:zn.RefBy,icon:x.jsx(OB,{}),dataTestId:"row-editor-mode-refs"}],yT=({mode:e,onChange:t,availableRefByMode:r})=>{const n=O.useMemo(()=>n0e.filter(i=>!(i.mode===zn.RefBy&&!r)),[r]);return x.jsx(je,{gap:"4px",children:n.map(i=>x.jsx(r0e,{dataTestId:i.dataTestId,isSelected:i.mode===e,onClick:()=>{t==null||t(i.mode)},icon:i.icon},i.mode))})};var $_={},Vh={},x2;function S3(){if(x2)return Vh;x2=1,Object.defineProperty(Vh,"__esModule",{value:!0}),Vh.bind=void 0;function e(t,r){var n=r.type,i=r.listener,o=r.options;return t.addEventListener(n,i,o),function(){t.removeEventListener(n,i,o)}}return Vh.bind=e,Vh}var Ou={},P2;function i0e(){if(P2)return Ou;P2=1;var e=Ou&&Ou.__assign||function(){return e=Object.assign||function(o){for(var a,l=1,c=arguments.length;l<c;l++){a=arguments[l];for(var d in a)Object.prototype.hasOwnProperty.call(a,d)&&(o[d]=a[d])}return o},e.apply(this,arguments)};Object.defineProperty(Ou,"__esModule",{value:!0}),Ou.bindAll=void 0;var t=S3();function r(o){if(!(typeof o>"u"))return typeof o=="boolean"?{capture:o}:o}function n(o,a){if(a==null)return o;var l=e(e({},o),{options:e(e({},r(a)),r(o.options))});return l}function i(o,a,l){var c=a.map(function(d){var f=n(d,l);return(0,t.bind)(o,f)});return function(){c.forEach(function(f){return f()})}}return Ou.bindAll=i,Ou}var C2;function o0e(){return C2||(C2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.bindAll=e.bind=void 0;var t=S3();Object.defineProperty(e,"bind",{enumerable:!0,get:function(){return t.bind}});var r=i0e();Object.defineProperty(e,"bindAll",{enumerable:!0,get:function(){return r.bindAll}})}($_)),$_}var vw=o0e(),Tp={isSafari:!1,leavingWindow:Symbol("leaving"),enteringWindow:Symbol("entering")};function a0e(e){var t=e.dragLeave;return t.type!=="dragleave"?!1:Tp.isSafari?t.hasOwnProperty(Tp.leavingWindow):t.relatedTarget==null}(function(){if(typeof window>"u")return;var t=navigator,r=t.userAgent,n=r.includes("AppleWebKit")&&!r.includes("Chrome");if(!n)return;Tp.isSafari=!0;function i(){return{enterCount:0,isOverWindow:!1}}var o=i();function a(){o=i()}vw.bindAll(window,[{type:"dragstart",listener:function(){o.enterCount=0,o.isOverWindow=!0}},{type:"drop",listener:a},{type:"dragend",listener:a},{type:"dragenter",listener:function(c){!o.isOverWindow&&o.enterCount===0&&(c[Tp.enteringWindow]=!0),o.isOverWindow=!0,o.enterCount++}},{type:"dragleave",listener:function(c){o.enterCount--,o.isOverWindow&&o.enterCount===0&&(c[Tp.leavingWindow]=!0,o.isOverWindow=!1)}}],{capture:!0})})();function s0e(e,t){var r=t.property,n=t.rule,i=t.priority,o=i===void 0?"":i,a=e.style.getPropertyValue(r),l=e.style.getPropertyPriority(r);return e.style.setProperty(r,n,o),function(){e.style.setProperty(r,a,l)}}function l0e(e){var t=e.current,r=document.elementFromPoint(t.input.clientX,t.input.clientY);return r instanceof HTMLElement?s0e(r,{property:"pointer-events",rule:"auto",priority:"important"}):null}function u0e(){var e,t=document.createElement("style");return t.setAttribute("pdnd-post-drag-fix","true"),document.head.appendChild(t),(e=t.sheet)===null||e===void 0||e.insertRule("* { pointer-events: none !important; }"),function(){document.head.removeChild(t)}}function E2(e){var t=e.current;queueMicrotask(function(){var r=l0e({current:t}),n=u0e();function i(){o(),r==null||r(),n()}var o=vw.bindAll(window,[{type:"pointerdown",listener:i},{type:"pointermove",listener:i},{type:"focusin",listener:i},{type:"focusout",listener:i},{type:"dragstart",listener:i}],{capture:!0})})}function bT(e){return{altKey:e.altKey,button:e.button,buttons:e.buttons,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey,clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY}}var c0e=function(t){var r=[],n=null,i=function(){for(var a=arguments.length,l=new Array(a),c=0;c<a;c++)l[c]=arguments[c];r=l,!n&&(n=requestAnimationFrame(function(){n=null,t.apply(void 0,r)}))};return i.cancel=function(){n&&(cancelAnimationFrame(n),n=null)},i},A_=c0e(function(e){return e()}),jg=function(){var e=null;function t(n){var i=requestAnimationFrame(function(){e=null,n()});e={frameId:i,fn:n}}function r(){e&&(cancelAnimationFrame(e.frameId),e.fn(),e=null)}return{schedule:t,flush:r}}();function d0e(e){var t=e.source,r=e.initial,n=e.dispatchEvent,i={dropTargets:[]};function o(l){n(l),i={dropTargets:l.payload.location.current.dropTargets}}var a={start:function(c){var d=c.nativeSetDragImage,f={current:r,previous:i,initial:r};o({eventName:"onGenerateDragPreview",payload:{source:t,location:f,nativeSetDragImage:d}}),jg.schedule(function(){o({eventName:"onDragStart",payload:{source:t,location:f}})})},dragUpdate:function(c){var d=c.current;jg.flush(),A_.cancel(),o({eventName:"onDropTargetChange",payload:{source:t,location:{initial:r,previous:i,current:d}}})},drag:function(c){var d=c.current;A_(function(){jg.flush();var f={initial:r,previous:i,current:d};o({eventName:"onDrag",payload:{source:t,location:f}})})},drop:function(c){var d=c.current,f=c.updatedExternalPayload;jg.flush(),A_.cancel(),o({eventName:"onDrop",payload:{source:f??t,location:{current:d,previous:i,initial:r}}})}};return a}var zP=!1;function _3(){return!zP}function f0e(e){return e.dataTransfer?e.dataTransfer.setDragImage.bind(e.dataTransfer):null}function h0e(e){var t=e.current,r=e.next;if(t.length!==r.length)return!0;for(var n=0;n<t.length;n++)if(t[n].element!==r[n].element)return!0;return!1}function p0e(e){var t=e.event,r=e.dragInterface,n=e.getDropTargetsOver,i=e.dispatchEvent;if(!_3())return;zP=!0;var o=m0e({event:t,dragInterface:r,getDropTargetsOver:n}),a=o;D_({event:t,current:o.dropTargets});var l=d0e({source:r.payload,dispatchEvent:i,initial:o});function c(b){var y=h0e({current:a.dropTargets,next:b.dropTargets});a=b,y&&l.dragUpdate({current:a})}function d(b){var y=bT(b),w=n({target:b.target,input:y,source:r.payload,current:a.dropTargets});w.length&&(b.preventDefault(),D_({event:b,current:w})),c({dropTargets:w,input:y})}function f(b){var y=b.updatedExternalPayload;l.drop({current:a,updatedExternalPayload:y})}function p(){a.dropTargets.length&&c({dropTargets:[],input:a.input}),f({updatedExternalPayload:null}),m()}function m(){zP=!1,g()}var g=vw.bindAll(window,[{type:"dragover",listener:function(y){d(y),l.drag({current:a})}},{type:"dragenter",listener:d},{type:"dragleave",listener:function(y){a0e({dragLeave:y})&&(c({input:a.input,dropTargets:[]}),r.startedFrom==="external"&&p())}},{type:"drop",listener:function(y){var w;y.preventDefault(),D_({event:y,current:a.dropTargets}),f({updatedExternalPayload:r.startedFrom==="external"&&((w=r.getDropPayload)===null||w===void 0?void 0:w.call(r,y))||null}),m(),r.startedFrom==="internal"&&E2({current:a})}},{type:"dragend",listener:function(){p(),r.startedFrom==="internal"&&E2({current:a})}},{type:"pointermove",listener:function(){var b=0;return function(){if(b<20){b++;return}p()}}()},{type:"pointerdown",listener:p}],{capture:!0});l.start({nativeSetDragImage:f0e(t)})}function D_(e){var t,r=e.event,n=e.current,i=(t=n[0])===null||t===void 0?void 0:t.dropEffect;i!=null&&r.dataTransfer&&(r.dataTransfer.dropEffect=i)}function m0e(e){var t=e.event,r=e.dragInterface,n=e.getDropTargetsOver,i=bT(t);if(r.startedFrom==="external")return{input:i,dropTargets:[]};var o=n({input:i,source:r.payload,target:t.target,current:[]});return{input:i,dropTargets:o}}var T2={canStart:_3,start:p0e},qP=new Map;function v0e(e){var t=e.typeKey,r=e.mount,n=qP.get(t);if(n)return n.usageCount++,n;var i={typeKey:t,unmount:r(),usageCount:1};return qP.set(t,i),i}function g0e(e){var t=v0e(e);return function(){t.usageCount--,!(t.usageCount>0)&&(t.unmount(),qP.delete(e.typeKey))}}function UP(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function y0e(e){if(Array.isArray(e))return UP(e)}function b0e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function w0e(e,t){if(e){if(typeof e=="string")return UP(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?UP(e,t):void 0}}function S0e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
1390
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _0e(e){return y0e(e)||b0e(e)||w0e(e)||S0e()}function x3(e,t){var r=t.attribute,n=t.value;return e.setAttribute(r,n),function(){return e.removeAttribute(r)}}function P3(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(){t.forEach(function(i){return i()})}}function O2(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function vd(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?O2(Object(r),!0).forEach(function(n){W4(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O2(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function M_(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=x0e(e))||t){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(d){throw d},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
1391
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,l;return{s:function(){r=r.call(e)},n:function(){var d=r.next();return o=d.done,d},e:function(d){a=!0,l=d},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw l}}}}function x0e(e,t){if(e){if(typeof e=="string")return R2(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return R2(e,t)}}function R2(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function N_(e){return e.slice(0).reverse()}function P0e(e){var t=e.typeKey,r=e.defaultDropEffect,n=new WeakMap,i="data-drop-target-for-".concat(t),o="[".concat(i,"]");function a(g){return n.set(g.element,g),function(){return n.delete(g.element)}}function l(g){return P3(x3(g.element,{attribute:i,value:"true"}),a(g))}function c(g){var b,y,w,_,S,C=g.source,k=g.target,E=g.input,R=g.result,T=R===void 0?[]:R;if(!(k instanceof Element))return T;var A=k.closest(o);if(A==null)return T;var M=n.get(A);if(M==null)return T;var B={input:E,source:C,element:M.element};if(M.canDrop&&!M.canDrop(B))return c({source:C,target:M.element.parentElement,input:E,result:T});var Q=(b=(y=M.getData)===null||y===void 0?void 0:y.call(M,B))!==null&&b!==void 0?b:{},se=(w=(_=M.getDropEffect)===null||_===void 0?void 0:_.call(M,B))!==null&&w!==void 0?w:r,ie=!!(!((S=M.getIsSticky)===null||S===void 0)&&S.call(M,B)),N={data:Q,element:M.element,dropEffect:se,sticky:ie};return c({source:C,target:M.element.parentElement,input:E,result:[].concat(_0e(T),[N])})}function d(g){var b=g.eventName,y=g.payload,w=M_(y.location.current.dropTargets),_;try{for(w.s();!(_=w.n()).done;){var S,C=_.value,k=n.get(C.element),E=vd(vd({},y),{},{self:C});k==null||(S=k[b])===null||S===void 0||S.call(k,E)}}catch(R){w.e(R)}finally{w.f()}}var f={onGenerateDragPreview:d,onDrag:d,onDragStart:d,onDrop:d,onDropTargetChange:function(b){var y=b.payload,w=new Set(y.location.current.dropTargets.map(function(ne){return ne.element})),_=new Set,S=M_(y.location.previous.dropTargets),C;try{for(S.s();!(C=S.n()).done;){var k,E=C.value;_.add(E.element);var R=n.get(E.element),T=w.has(E.element),A=vd(vd({},y),{},{self:E});if(R==null||(k=R.onDropTargetChange)===null||k===void 0||k.call(R,A),!T){var M;R==null||(M=R.onDragLeave)===null||M===void 0||M.call(R,A)}}}catch(ne){S.e(ne)}finally{S.f()}var B=M_(y.location.current.dropTargets),Q;try{for(B.s();!(Q=B.n()).done;){var se,ie,N=Q.value;if(!_.has(N.element)){var X=vd(vd({},y),{},{self:N}),ce=n.get(N.element);ce==null||(se=ce.onDropTargetChange)===null||se===void 0||se.call(ce,X),ce==null||(ie=ce.onDragEnter)===null||ie===void 0||ie.call(ce,X)}}}catch(ne){B.e(ne)}finally{B.f()}}};function p(g){f[g.eventName](g)}function m(g){var b=g.source,y=g.target,w=g.input,_=g.current,S=c({source:b,target:y,input:w});if(S.length>=_.length)return S;for(var C=N_(_),k=N_(S),E=[],R=0;R<C.length;R++){var T=C[R],A=k[R];if(A!=null){E.push(A);continue}if(!T.sticky)break;var M=E[R-1],B=C[R-1];if((M==null?void 0:M.element)===(B==null?void 0:B.element)){E.push(T);continue}break}return N_(E)}return{dropTargetForConsumers:l,getIsOver:m,dispatchEvent:p}}function C0e(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=E0e(e))||t){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(d){throw d},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
1392
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,l;return{s:function(){r=r.call(e)},n:function(){var d=r.next();return o=d.done,d},e:function(d){a=!0,l=d},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw l}}}}function E0e(e,t){if(e){if(typeof e=="string")return I2(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return I2(e,t)}}function I2(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function k2(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function T0e(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?k2(Object(r),!0).forEach(function(n){W4(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):k2(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function O0e(){var e=new Set,t=null;function r(o){t&&(!o.canMonitor||o.canMonitor(t.canMonitorArgs))&&t.active.add(o)}function n(o){var a=T0e({},o);return e.add(a),r(a),function(){e.delete(a),t&&t.active.delete(a)}}function i(o){var a=o.eventName,l=o.payload;if(a==="onGenerateDragPreview"){t={canMonitorArgs:{initial:l.location.initial,source:l.source},active:new Set};var c=C0e(e),d;try{for(c.s();!(d=c.n()).done;){var f=d.value;r(f)}}catch(w){c.e(w)}finally{c.f()}}if(t){for(var p=Array.from(t.active),m=0,g=p;m<g.length;m++){var b=g[m];if(t.active.has(b)){var y;(y=b[a])===null||y===void 0||y.call(b,l)}}a==="onDrop"&&(t.active.clear(),t=null)}}return{dispatchEvent:i,monitorForConsumers:n}}function R0e(e){var t=e.typeKey,r=e.mount,n=e.dispatchEventToSource,i=e.defaultDropEffect,o=O0e(),a=P0e({typeKey:t,defaultDropEffect:i});function l(f){n==null||n(f),a.dispatchEvent(f),o.dispatchEvent(f)}function c(f){var p=f.event,m=f.dragInterface;T2.start({event:p,dragInterface:m,getDropTargetsOver:a.getIsOver,dispatchEvent:l})}function d(){function f(){var p={canStart:T2.canStart,start:c};return r(p)}return g0e({typeKey:t,mount:f})}return{registerUsage:d,dropTarget:a.dropTargetForConsumers,monitor:o.monitorForConsumers}}var Zb=new WeakMap;function I0e(e){return Zb.set(e.element,e),function(){Zb.delete(e.element)}}var wT=R0e({typeKey:"element",defaultDropEffect:"move",mount:function(t){return vw.bind(window,{type:"dragstart",listener:function(n){var i,o,a,l;if(t.canStart(n)){var c=n.target;if(!(c instanceof HTMLElement))return null;var d=Zb.get(c);if(!d)return null;var f=bT(n),p={element:d.element,dragHandle:(i=d.dragHandle)!==null&&i!==void 0?i:null,input:f};if(d.canDrag&&!d.canDrag(p))return n.preventDefault(),null;if(d.dragHandle){var m=document.elementFromPoint(f.clientX,f.clientY);if(!d.dragHandle.contains(m))return n.preventDefault(),null}try{var g;(g=n.dataTransfer)===null||g===void 0||g.setData("application/vnd.pdnd","")}catch{}var b={element:d.element,dragHandle:(o=d.dragHandle)!==null&&o!==void 0?o:null,data:(a=(l=d.getInitialData)===null||l===void 0?void 0:l.call(d,p))!==null&&a!==void 0?a:{}},y={key:"element",startedFrom:"internal",payload:b};t.start({event:n,dragInterface:y})}}})},dispatchEventToSource:function(t){var r,n,i=t.eventName,o=t.payload;(r=Zb.get(o.source.element))===null||r===void 0||(n=r[i])===null||n===void 0||n.call(r,o)}}),k0e=wT.dropTarget,j0e=wT.monitor;function $0e(e){return P3(wT.registerUsage(),I0e(e),x3(e.element,{attribute:"draggable",value:"true"}))}const C3=(e,t,r)=>{const n=O.useRef(null),[i,o]=O.useState(!1),[a,l]=O.useState(!1),[c,d]=O.useState(!1);return O.useEffect(()=>{let f=null;if(t){if(!n.current)return;f=$0e({element:n.current,getInitialData:()=>({store:e})})}return()=>f==null?void 0:f()},[e,t]),O.useEffect(()=>{if(!n.current)return;let f=null;return(e instanceof pn||e instanceof Jn)&&(f=k0e({element:n.current,onDrop:p=>{const m=p.source.data.store;Zh(e,m)&&r(m),d(!1),o(!1)},onDragEnter:p=>{const m=p.source.data.store;d(Zh(e,m))},onDragLeave:()=>d(!1)})),()=>f==null?void 0:f()},[r,e]),O.useEffect(()=>j0e({onDragStart:f=>{const p=f.source.data.store;(e instanceof pn||e instanceof Jn)&&Zh(e,p)?o(Zh(e,p)):l(!0)},onDrop:()=>{o(!1),l(!1)}}),[e]),{dragAndDropRef:n,isDrop:i,isDisabledDrop:a,isDraggedOver:c}},A0e=[{id:"String",label:Le.String,getSchemaNode:()=>Ba({type:Le.String,default:""})},{id:"Number",label:Le.Number,getSchemaNode:()=>Ba({type:Le.Number,default:0})},{id:"Boolean",label:Le.Boolean,getSchemaNode:()=>Ba({type:Le.Boolean,default:!1})},{id:"Object",label:Le.Object,getSchemaNode:()=>Ba({type:Le.Object,properties:{},required:[],additionalProperties:!1})},{id:"Array",label:Le.Array,getSchemaNode:e=>{let t={type:Le.String,default:""};return"$ref"in e||(e.type===Le.Number||e.type===Le.Boolean||e.type===Le.String)&&(t=e),Ba({type:Le.Array,items:t})}}],D0e=[{id:"ForeignKeyString",label:Le.String,getSchemaNode:e=>{let t={type:Le.String,default:"",foreignKey:""};return!("$ref"in e)&&e.type===Le.Array&&!("$ref"in e.items)&&e.items.type===Le.String&&e.items.foreignKey!==void 0&&(t=e.items),Ba(t)}}],M0e=[{id:"File",label:"File",getSchemaNode:()=>{const e={$ref:hc.File};return Ba(e)}}],E3=[{id:nn(),label:"Types",options:A0e},{id:nn(),label:"Foreign key",options:D0e},{id:nn(),label:"Schemas",options:M0e}],N0e=(e,t)=>{var r;return(r=E3.flatMap(n=>n.options).find(n=>n.id===e))==null?void 0:r.getSchemaNode(t)},T3=Ot(({currentSchema:e,menuButton:t,onSelect:r,dataTestId:n})=>{const i=O.useCallback(async o=>{if(!Array.isArray(o)){const a=N0e(o,e);a&&r(a)}},[e,r]);return x.jsxs(yF,{children:[t,x.jsx(xf,{children:x.jsx(wF,{width:"100px",children:E3.map(o=>x.jsx(_F,{value:"",title:o.label,onChange:i,children:o.options.map(a=>x.jsx(XC,{"data-testid":`${n}-menu-type-${a.id}`,value:a.id,children:a.label},a.id))},o.id))})})]})}),F0e=["Backspace","Escape","Enter","ArrowRight","ArrowLeft","Delete"],gw=({initValue:e,placeholder:t,autoFocus:r,onBlur:n,onChange:i,onEscape:o,onEnter:a,onFocus:l,focusIfDependencyList:c,restrict:d,prefix:f,postfix:p,dataTestId:m})=>{const g=O.useRef(null),b=O.useRef(null);O.useEffect(()=>{var k;r&&((k=g.current)==null||k.focus())},[r]),O.useLayoutEffect(()=>{if(window.getSelection()&&b.current!==null&&g.current){const E=(g.current.textContent||"").length,R=Math.min(E,b.current),T=document.createRange(),A=window.getSelection(),M=g.current.childNodes.length?g.current.childNodes[0]:g.current;T.setStart(M,R),T.collapse(!0),A&&(A.removeAllRanges(),A.addRange(T))}}),Cme(()=>{var k;if(c){(k=g.current)==null||k.focus();const E=window.getSelection();if(g.current&&E){const R=document.createRange();R.selectNodeContents(g.current),R.collapse(!1),E.removeAllRanges(),E.addRange(R)}}},[...c||[]]);const y=O.useCallback(k=>{const E=window.getSelection();E&&E.rangeCount>0&&(b.current=E.getRangeAt(0).startOffset),i==null||i(k.currentTarget.innerText)},[i]),w=O.useCallback(()=>{n==null||n(),b.current=null},[n]),_=O.useCallback(k=>{var E,R;k.key==="Enter"&&(k.preventDefault(),e&&((E=g.current)==null||E.blur(),a==null||a())),k.key==="Escape"&&(k.preventDefault(),e&&((R=g.current)==null||R.blur()),o==null||o()),d&&!F0e.includes(k.key)&&!d.test(k.key)&&k.preventDefault()},[e,a,o,d]),S=O.useCallback(()=>{var k;(k=g.current)==null||k.focus()},[]),C=!e&&t;return x.jsxs(je,{minWidth:0,width:C?"100%":void 0,position:"relative",onClick:S,children:[!C&&f,x.jsx(wt,{"data-testid":m,autoFocus:!0,ref:g,contentEditable:!0,spellCheck:"false",dangerouslySetInnerHTML:{__html:e},outline:0,width:"100%",onBlur:w,onFocus:l,onChange:y,onInput:y,onKeyDown:_}),!C&&p,C&&x.jsx(bt,{cursor:"text",userSelect:"none",pointerEvents:"none",whiteSpace:"nowrap",color:"gray.400",position:"absolute",children:t})]})},O3=({dataTestId:e,...t})=>x.jsx(Ci,{"data-testid":e,_hover:{backgroundColor:"gray.50"},color:"gray.400",icon:x.jsx(J0,{}),variant:"ghost",...t}),R3=Ot(({store:e,typeClassName:t,onBlur:r,onEnter:n,onRemove:i,onSelect:o,dataTestId:a})=>{const{root:l,mode:c}=mw(),[d,f]=O.useState(!1),p=O.useCallback(A=>{e instanceof pn?l.addProperty(e,A,{beforeNode:e.draftProperties[0]}):e instanceof Jn&&l.replaceItems(e,A)},[l,e]),m=!!(l.areThereDropTargets(e)&&e.draftId),{dragAndDropRef:g,isDrop:b,isDraggedOver:y,isDisabledDrop:w}=C3(e,m,p),_=O.useCallback(()=>{f(!1),r==null||r(e)},[r,e]),S=O.useCallback(()=>{f(!0)},[]),C=O.useCallback(()=>{n==null||n(e)},[n,e]),k=O.useCallback(()=>{i==null||i(e)},[i,e]),E=O.useCallback(A=>{l.setId(e,A)},[l,e]),R=O.useCallback(A=>{o(e,A)},[o,e]),T=!d;return e.isDisabled?x.jsxs(je,{gap:"0.5rem",width:"100%",justifyContent:"flex-start",outline:0,children:[x.jsx(je,{flex:0,position:"relative",borderWidth:1,borderStyle:"dashed",borderColor:"#00000000",color:"gray.300",whiteSpace:"nowrap",children:x.jsx(wt,{userSelect:"none",children:e.draftId})}),x.jsx(bt,{color:"gray.300",className:t,children:e.label})]}):x.jsxs(je,{gap:"0.5rem",width:"100%",justifyContent:"flex-start",outline:0,children:[x.jsxs(je,{"data-testid":b&&`${a}-drop`,flex:e.draftId?0:1,ref:g,position:"relative",borderWidth:1,borderStyle:"dashed",borderColor:b?"gray.400":"#00000000",backgroundColor:y?"gray.200":void 0,color:w?"gray.300":void 0,whiteSpace:"nowrap",children:[e.isDisabled?x.jsx(wt,{userSelect:"none",children:e.draftId}):x.jsxs(x.Fragment,{children:[m&&x.jsx(je,{"data-testid":`${a}-drag-button`,position:"absolute",left:"-34px",className:T?t:void 0,cursor:"grab",_hover:{backgroundColor:"gray.100"},height:"100%",alignItems:"center",justifyContent:"center",borderRadius:"4px",pl:"2px",pr:"2px",children:x.jsx(Tce,{boxSize:"14px",color:"gray.300"})}),x.jsx(gw,{dataTestId:a,autoFocus:!e.draftId,initValue:e.draftId,placeholder:e.draftParent?"Enter the name of the field":"Enter the name of the table",onBlur:_,onFocus:S,onChange:E,onEnter:C,focusIfDependencyList:[e.type]})]}),c===pc.Updating&&e.draftId&&e.isDirtyItself&&x.jsx(wt,{cursor:"default",children:"*"})]}),e.draftId&&x.jsx(T3,{dataTestId:a,currentSchema:e.getSchema({skipObjectProperties:!0}),onSelect:R,menuButton:x.jsx(YC,{"data-testid":`${a}-select-type-button`,as:bt,color:"gray.300",textDecoration:"underline",cursor:"pointer",className:T?t:void 0,children:e.label})}),i&&e.draftId&&x.jsx(O3,{"data-testid":`${a}-remove-button`,height:"26px","aria-label":"remove",color:"gray.200",_hover:{color:"gray.400"},className:T?t:void 0,onClick:k})]})}),ST=({field:e,fieldClassName:t,children:r})=>x.jsxs(je,{flexDirection:"column",alignSelf:"flex-start",width:"100%",children:[x.jsxs(je,{gap:"4px",alignItems:"center",height:"30px",mt:"2px",mb:"2px",className:t,position:"relative",children:[x.jsx(wt,{position:"absolute",ml:"-200px",height:"100%",width:"200px"}),x.jsx(wt,{color:"gray.300",children:x.jsx(HE,{})}),e]}),r&&x.jsx(je,{ml:"7px",pl:"18px",borderLeftWidth:1,borderLeftStyle:"solid",borderLeftColor:"white",_hover:{borderLeftColor:"blackAlpha.200"},children:r})]}),L0e=Ot(({node:e,dataTestId:t})=>{const{mode:r,root:n}=mw(),i=O.useCallback(f=>{const p=e.draftItems;p instanceof pn?n.addProperty(p,f,{beforeNode:p.draftProperties[0]}):p instanceof Jn&&n.replaceItems(p,f)},[e.draftItems,n]),{dragAndDropRef:o,isDrop:a,isDraggedOver:l,isDisabledDrop:c}=C3(e.draftItems,!0,i),d=O.useCallback(f=>{n.replaceItems(e,f),f instanceof pn&&!f.$ref&&n.addProperty(f,new ec)},[e,n]);return x.jsx(je,{flexDirection:"column",width:"100%",children:x.jsx(ST,{field:x.jsx(T3,{dataTestId:t,currentSchema:e.draftItems.getSchema({skipObjectProperties:!0}),onSelect:d,menuButton:x.jsx(wt,{"data-testid":a&&`${t}-drop`,ref:o,borderWidth:1,borderStyle:"dashed",borderColor:a?"gray.400":"#00000000",backgroundColor:l?"gray.200":void 0,color:c?"gray.300":void 0,children:x.jsxs(YC,{"data-testid":`${t}-select-type-button`,as:bt,color:a?void 0:"gray.300",cursor:"pointer",outline:0,_hover:{textDecoration:"underline",textDecorationColor:"gray.300"},children:[e.draftItems.label,r===pc.Updating&&e.draftItems.isDirtyItself&&x.jsx("span",{children:"*"})]})})}),children:x.jsx(_T,{dataTestId:`${t}-0`,node:e.draftItems})})})}),B0e="_Root_1ypkj_1",V0e="_Field_1ypkj_1",e0={Root:B0e,Field:V0e},z0e=Ot(({node:e,dataTestId:t})=>{const{root:r}=mw(),n=O.useCallback(()=>{r.addProperty(e,new ec)},[e,r]),i=O.useCallback(c=>{c.draftId||r.removeProperty(e,c)},[e,r]),o=O.useCallback(c=>{r.removeProperty(e,c)},[e,r]),a=O.useCallback((c,d)=>{r.replaceProperty(e,c,d)},[e,r]),l=O.useCallback(c=>{c instanceof pn?r.addProperty(c,new ec,{beforeNode:c.draftProperties[0]}):r.addProperty(e,new ec,{afterNode:c})},[e,r]);return x.jsxs(je,{flexDirection:"column",width:"100%",children:[e.draftProperties.map((c,d)=>x.jsx(ST,{fieldClassName:e0.Root,field:x.jsx(R3,{dataTestId:`${t}-${d}`,store:c,typeClassName:e0.Field,onSelect:a,onBlur:i,onRemove:o,onEnter:l}),children:x.jsx(_T,{dataTestId:`${t}-${d}`,node:c})},c.nodeId)),e.showingCreateField&&x.jsx(wt,{ml:"-14px",children:x.jsx(Af,{dataTestId:`${t}-create-field-button`,title:"Field",isDisabled:e.isDisabledCreateField,onClick:n})})]})}),q0e=Ot(({node:e,dataTestId:t})=>{const r=mw(),n=O.useCallback(()=>{r.onSelectForeignKey(e)},[r,e]);return x.jsxs(je,{gap:"4px",alignItems:"center",height:"30px",mt:"2px",mb:"2px",children:[x.jsx(wt,{color:"gray.300",children:x.jsx(HE,{})}),x.jsx(je,{gap:"0.5rem",width:"100%",justifyContent:"flex-start",outline:0,_hover:{textDecoration:"underline",textDecorationColor:"gray.300"},onClick:n,children:x.jsx(bt,{color:"gray.300",cursor:"pointer","data-testid":`${t}-connect-foreign-key`,children:e.draftForeignKey||"<Connect table>"})})]})}),U0e=Ot(({node:e,dataTestId:t})=>e.draftForeignKey?x.jsx(je,{flexDirection:"column",width:"100%",children:x.jsx(q0e,{dataTestId:`${t}-0`,node:e.draftForeignKey})}):null),_T=({node:e,dataTestId:t})=>{if(e instanceof pn)return x.jsx(z0e,{dataTestId:t,node:e});if(e instanceof Jn)return x.jsx(L0e,{dataTestId:t,node:e});if(e instanceof ec)return x.jsx(U0e,{dataTestId:t,node:e})},H0e=Ot(({store:e})=>{const t=O.useCallback((n,i)=>{i.setId(n.draftId),e.replaceNode(i)},[e]),r=O.useCallback(n=>{n instanceof pn&&n.addProperty(new ec,{beforeNode:n.draftProperties[0]})},[]);return x.jsx(ST,{fieldClassName:e0.Root,field:x.jsx(R3,{dataTestId:"0",store:e.node,typeClassName:e0.Field,onSelect:t,onEnter:r}),children:x.jsx(_T,{dataTestId:"0",node:e.node})})}),I3=({height:e="2.5rem",onClick:t,isDisabled:r,dataTestId:n})=>x.jsx(Lo,{"data-testid":n,isDisabled:r,_hover:{backgroundColor:"gray.50"},alignSelf:"flex-start",height:e,variant:"ghost",onClick:t,children:x.jsx(Vce,{})}),W0e=({dataTestId:e,...t})=>x.jsx(Ci,{"data-testid":e,_hover:{backgroundColor:"gray.100"},color:"gray.400",icon:x.jsx(Ece,{}),variant:"ghost",...t}),K0e="_JsonCard_15gzu_1",G0e="_CopyButton_15gzu_1",j2={JsonCard:K0e,CopyButton:G0e},k3=({data:e})=>{const t=JSON.stringify(e,null,3),r=O.useCallback(async()=>{const n="text/plain",i=new Blob([t],{type:n}),o=[new ClipboardItem({[n]:i})];await navigator.clipboard.write(o),KE({status:"success",variant:"subtle",icon:!1,colorScheme:"gray",duration:1500,isClosable:!0,position:"top",description:"Copied to clipboard"})},[t]);return x.jsxs(wt,{width:"100%",position:"relative",className:j2.JsonCard,children:[x.jsx(W0e,{dataTestId:"json-card-copy-button","aria-label":"",position:"absolute",top:"8px",right:"8px",className:j2.CopyButton,onClick:r}),x.jsx(BC,{whiteSpace:"pre-wrap",backgroundColor:"gray.50",padding:"24px",width:"100%",borderRadius:"8px",children:t})]})},j3=({onClick:e,isDisabled:t,dataTestId:r})=>x.jsx(Lo,{"data-testid":r,isDisabled:t,_hover:{backgroundColor:"gray.50"},alignSelf:"flex-start",color:"gray.400",height:"2.5rem",variant:"ghost",onClick:e,children:x.jsx(PB,{size:"16"})}),Q0e="_Root_1k7pa_1",Y0e="_Actions_1k7pa_1",$2={Root:Q0e,Actions:Y0e},A2=Ot(({store:e,mode:t,onApprove:r,onCancel:n,onSelectForeignKey:i})=>{const[o,a]=O.useState(!1),l=O.useCallback(async()=>{a(!0),await r(),a(!1)},[r]);return x.jsx(w3.Provider,{value:{onSelectForeignKey:i,mode:t,root:e},children:x.jsxs(je,{flex:1,flexDirection:"column",gap:"0.5rem",className:$2.Root,"date-testid":"schema-data-card",children:[x.jsxs(je,{justifyContent:"space-between",width:"100%",alignItems:"center",paddingBottom:"8px",children:[x.jsxs(wt,{children:[t===pc.Creating?x.jsx(Z0,{dataTestId:"close-create-table-button",onClick:n}):x.jsx(I3,{dataTestId:"back-to-table-list-button",onClick:n}),x.jsx(Qm,{dataTestId:"schema-editor-approve-button",onClick:l,isDisabled:e.isApproveDisabled,loading:o}),t===pc.Updating&&e.isDirty&&x.jsx(j3,{dataTestId:"schema-editor-revert-button",onClick:e.resetChanges})]}),x.jsx(wt,{className:$2.Actions,children:x.jsx(yT,{availableRefByMode:!1,mode:e.viewMode||zn.Tree,onChange:e.setViewMode})})]}),e.viewMode===zn.Tree&&x.jsx(wt,{paddingBottom:"4rem",children:x.jsx(H0e,{store:e})}),e.viewMode===zn.Json&&x.jsx(k3,{data:e.getPlainSchema()})]})})}),F_=()=>x.jsx(je,{width:"100%",borderStyle:"solid",borderTopWidth:1,borderColor:"gray.100",justifyContent:"center",color:"gray.400",fontWeight:"300",pt:"0.5rem",pb:"0.5rem",children:x.jsx(wt,{backgroundColor:"gray.50",pl:"5px",pr:"5px",borderRadius:"5px",children:"Select or create a table to be referenced by the above table"})}),X0e=({previousType:e,tableId:t,foreignKeyPath:r,onCancel:n})=>{const i=O.useMemo(()=>e===Qn.UpdatingTable?"updating":e===Qn.CreatingTable?"creating":"",[e]);return x.jsx(wt,{width:"100%",borderStyle:"solid",borderLeftWidth:2,borderColor:"gray.200",pl:"1rem",mb:"1rem",children:x.jsxs(je,{gap:"4px",alignItems:"center",height:"30px",mt:"2px",mb:"2px",color:"gray.400",fontWeight:"300",children:[x.jsx(bt,{textDecoration:"underline",cursor:"pointer",onClick:n,children:"Back"}),x.jsxs(bt,{whiteSpace:"nowrap",children:["- ",i,' "',t,'" -']}),x.jsxs(bt,{minWidth:0,dir:"rtl",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:["path: ",r]})]})})},J0e=Ne`
|
1393
1393
|
mutation DeleteTableMst($data: RemoveTableInput!) {
|
1394
1394
|
removeTable(data: $data) {
|
1395
1395
|
branch {
|
@@ -1398,11 +1398,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
1398
1398
|
}
|
1399
1399
|
}
|
1400
1400
|
${Qs}
|
1401
|
-
`,Z0e=async e=>{const t=await xr.mutate({mutation:J0e,variables:e});if(!t.data)throw t.errors;return t.data};class ewe{constructor(t,r){this.projectPageModel=t,this.tableId=r}get branch(){return this.projectPageModel.branchOrThrow}async execute(){const t=await this.deleteTableRequest();return await this.updateTablesConnection(),this.branch.updateTouched(t),!0}async deleteTableRequest(){return(await Z0e({data:{revisionId:this.branch.draft.id,tableId:this.tableId}})).removeTable.branch.touched}async updateTablesConnection(){const t=this.branch.draft,r=t.tablesConnection.edges.find(n=>n.node.id===this.tableId);t.tablesConnection.removeEdge(r==null?void 0:r.cursor)}}class twe{constructor(t,r){this.rootStore=t,this.projectPageModel=r,st(this,{},{autoBind:!0}),this.init()}get totalCount(){return this.items.length}get hasNextPage(){return this.revision.tablesConnection.availableNextPage}get isEditableRevision(){return this.projectPageModel.isEditableRevision}get items(){return this.revision.tablesConnection.edges.map(({node:t})=>({id:t.id,versionId:t.versionId,readonly:t.readonly,title:t.id,count:t.count,link:""}))}dispose(){}tryToFetchNextPage(){this.hasNextPage&&this.rootStore.queryTables({revisionId:this.revision.id,first:50,after:this.revision.tablesConnection.endCursor||void 0})}async deleteTable(t){try{return await new ewe(this.projectPageModel,t).execute()}catch(r){return console.log(r),!1}}init(){}get revision(){return this.projectPageModel.revisionOrThrow}}const rwe=()=>{const e=Zn(),[t]=O.useState(()=>new twe(ct,e));return O.useEffect(()=>(t.init(),()=>t.dispose()),[t]),t},nwe=({onRemove:e,dataTestId:t})=>{const[r,n]=O.useState(!1),i=O.useCallback(async()=>{n(!0),await(e==null?void 0:e()),n(!1)},[e]);return x.jsx(Ci,{"data-testid":t,_hover:{backgroundColor:"gray.100"},"aria-label":"",color:"gray.400",icon:x.jsx(J0,{}),isLoading:r,variant:"ghost",onClick:i})},iwe="_Row_1lkxi_1",owe="_RemoveRowButton_1lkxi_1",DA={Row:iwe,RemoveRowButton:owe},awe=({table:e,store:t,onSettings:r,onSelect:n})=>{const i=O.useCallback(async()=>{r(e.versionId)},[r,e.versionId]),o=O.useCallback(()=>t.deleteTable(e.id),[t,e.id]),a=O.useCallback(()=>{n==null||n(e.id)},[n,e.id]),l=!!n;return x.jsx(wt,{height:"2.5rem",width:"100%","data-testid":`table-${e.id}`,children:x.jsxs(je,{_hover:{backgroundColor:"gray.50"},alignItems:"center",className:DA.Row,gap:"4px",paddingLeft:"1rem",children:[x.jsxs(je,{width:"150px",children:[n?x.jsx(bt,{maxWidth:"140px",textDecoration:"underline",cursor:"pointer",onClick:a,"data-testid":`table-${e.id}-select`,textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:e.id}):x.jsx(qo,{to:`${e.id}`,"data-testid":`table-${e.id}-link`,children:x.jsx(bt,{maxWidth:"140px",textDecoration:"underline",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:e.id})}),!e.readonly&&t.isEditableRevision&&x.jsx(bt,{children:"*"})]}),x.jsxs(je,{alignItems:"center",flex:1,justifyContent:"space-between",minHeight:"40px",children:[x.jsxs(bt,{color:"gray.400",fontWeight:"300",ml:"16px",children:[e.count," rows"]}),!l&&t.isEditableRevision&&x.jsxs(je,{className:DA.RemoveRowButton,children:[x.jsx(MV,{dataTestId:`table-settings-button-${e.id}`,onClick:i}),x.jsx(nwe,{dataTestId:`remove-table-button-${e.id}`,onRemove:o})]})]})]})},e.versionId)},swe=Ot(({onSettings:e,onSelect:t})=>{const r=rwe();return x.jsx(pw,{useWindowScroll:!0,totalCount:r.totalCount,defaultItemHeight:40,increaseViewportBy:40*100,endReached:r.hasNextPage?r.tryToFetchNextPage:void 0,itemContent:n=>{const i=r.items[n];if(i)return x.jsx(awe,{table:i,store:r,onSettings:e,onSelect:t},i.versionId)}})}),lwe=Ot(()=>{const{root:e,item:t}=e0e(),r=O.useCallback(l=>{e.selectForeignKey(t,l)},[t,e]),n=O.useCallback(()=>{e.cancelSelectingForeignKey(t)},[t,e]),i=O.useCallback(async()=>{if(t.state.type===Qn.CreatingTable){const l=t.state.store;await t.createTable(l.draftTableId,l.getPlainSchema())&&(l.submitChanges(),t.state.isSelectingForeignKey?e.onSelectedForeignKey(t,l.draftTableId):t.toUpdatingTableFromCreatingTable())}},[t,e]),o=O.useCallback(async()=>{if(t.state.type===Qn.UpdatingTable){const l=t.state.store;await t.updateTable(l)&&l.submitChanges()}},[t]),a=O.useCallback(l=>{e.onSelectedForeignKey(t,l)},[t,e]);if(t.state.type===Qn.ConnectingForeignKeyTable){const l=t.state.store;return x.jsx(x.Fragment,{children:x.jsx(X0e,{previousType:t.state.previousType,foreignKeyPath:t.currentForeignKeyPath,onCancel:n,tableId:l.draftTableId})})}if(t.state.type===Qn.List)return x.jsxs(x.Fragment,{children:[t.state.isSelectingForeignKey&&x.jsx(F_,{}),x.jsx(t0e,{onClick:t.toCreatingTable}),x.jsx(wt,{paddingTop:"0.5rem",paddingBottom:"1rem",children:x.jsx(swe,{onSettings:t.toUpdatingTable,onSelect:t.state.isSelectingForeignKey?a:void 0})})]});if(t.state.type===Qn.CreatingTable){const l=t.state.store;return x.jsxs(x.Fragment,{children:[t.state.isSelectingForeignKey&&x.jsx(F_,{}),x.jsx(AA,{store:l,mode:pc.Creating,onApprove:i,onCancel:t.toList,onSelectForeignKey:r})]})}if(t.state.type===Qn.UpdatingTable){const l=t.state.store;return x.jsxs(x.Fragment,{children:[t.state.isSelectingForeignKey&&x.jsx(F_,{}),x.jsx(AA,{store:l,mode:pc.Updating,onApprove:o,onCancel:t.toList,onSelectForeignKey:r})]})}return null}),L_=Ot(()=>{const e=Zbe();return x.jsx(x.Fragment,{children:e.stack.map(t=>x.jsx(b3.Provider,{value:{root:e,item:t},children:x.jsx(lwe,{})},t.id))})}),uwe="_Root_1k7pa_1",cwe="_Actions_1k7pa_1",t0={Root:uwe,Actions:cwe},dwe="row-edit-mode",fwe=({data:e})=>{const[t,r]=Ome(dwe,zn.Tree);return x.jsxs(je,{alignItems:"flex-start",flexDirection:"column",gap:"1rem",className:t0.Root,flex:1,children:[x.jsxs(je,{justifyContent:"space-between",width:"100%",alignItems:"center",children:[x.jsx(je,{minHeight:"40px"}),x.jsx(wt,{className:t0.Actions,children:x.jsx(yT,{mode:t||zn.Tree,onChange:r})})]}),t===zn.Tree&&x.jsxs(je,{alignItems:"center",flex:1,gap:"1rem",justifyContent:"center",width:"100%",children:[x.jsx(WE,{color:"gray"}),x.jsx(bt,{color:"gray.400",children:"Unsupported schema, use JSON mode"})]}),t===zn.Json&&x.jsx(BC,{whiteSpace:"pre-wrap",backgroundColor:"gray.50",padding:"1rem",paddingRight:"5rem",children:JSON.stringify(e,null,4)})]})};var $g={exports:{}},B_={},ys={},Ru={},V_={},z_={},q_={},MA;function r0(){return MA||(MA=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends t{constructor(S){if(super(),!e.IDENTIFIER.test(S))throw new Error("CodeGen: name must be a valid identifier");this.str=S}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class n extends t{constructor(S){super(),this._items=typeof S=="string"?[S]:S}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const S=this._items[0];return S===""||S==='""'}get str(){var S;return(S=this._str)!==null&&S!==void 0?S:this._str=this._items.reduce((C,k)=>`${C}${k}`,"")}get names(){var S;return(S=this._names)!==null&&S!==void 0?S:this._names=this._items.reduce((C,k)=>(k instanceof r&&(C[k.str]=(C[k.str]||0)+1),C),{})}}e._Code=n,e.nil=new n("");function i(_,...S){const C=[_[0]];let k=0;for(;k<S.length;)l(C,S[k]),C.push(_[++k]);return new n(C)}e._=i;const o=new n("+");function a(_,...S){const C=[g(_[0])];let k=0;for(;k<S.length;)C.push(o),l(C,S[k]),C.push(o,g(_[++k]));return c(C),new n(C)}e.str=a;function l(_,S){S instanceof n?_.push(...S._items):S instanceof r?_.push(S):_.push(p(S))}e.addCodeArg=l;function c(_){let S=1;for(;S<_.length-1;){if(_[S]===o){const C=d(_[S-1],_[S+1]);if(C!==void 0){_.splice(S-1,3,C);continue}_[S++]="+"}S++}}function d(_,S){if(S==='""')return _;if(_==='""')return S;if(typeof _=="string")return S instanceof r||_[_.length-1]!=='"'?void 0:typeof S!="string"?`${_.slice(0,-1)}${S}"`:S[0]==='"'?_.slice(0,-1)+S.slice(1):void 0;if(typeof S=="string"&&S[0]==='"'&&!(_ instanceof r))return`"${_}${S.slice(1)}`}function f(_,S){return S.emptyStr()?_:_.emptyStr()?S:a`${_}${S}`}e.strConcat=f;function p(_){return typeof _=="number"||typeof _=="boolean"||_===null?_:g(Array.isArray(_)?_.join(","):_)}function m(_){return new n(g(_))}e.stringify=m;function g(_){return JSON.stringify(_).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=g;function b(_){return typeof _=="string"&&e.IDENTIFIER.test(_)?new n(`.${_}`):i`[${_}]`}e.getProperty=b;function y(_){if(typeof _=="string"&&e.IDENTIFIER.test(_))return new n(`${_}`);throw new Error(`CodeGen: invalid export name: ${_}, use explicit $id name mapping`)}e.getEsmExportName=y;function w(_){return new n(_.toString())}e.regexpCode=w}(q_)),q_}var U_={},NA;function FA(){return NA||(NA=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=r0();class r extends Error{constructor(d){super(`CodeGen: "code" for ${d} not defined`),this.value=d.value}}var n;(function(c){c[c.Started=0]="Started",c[c.Completed=1]="Completed"})(n||(e.UsedValueState=n={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class i{constructor({prefixes:d,parent:f}={}){this._names={},this._prefixes=d,this._parent=f}toName(d){return d instanceof t.Name?d:this.name(d)}name(d){return new t.Name(this._newName(d))}_newName(d){const f=this._names[d]||this._nameGroup(d);return`${d}${f.index++}`}_nameGroup(d){var f,p;if(!((p=(f=this._parent)===null||f===void 0?void 0:f._prefixes)===null||p===void 0)&&p.has(d)||this._prefixes&&!this._prefixes.has(d))throw new Error(`CodeGen: prefix "${d}" is not allowed in this scope`);return this._names[d]={prefix:d,index:0}}}e.Scope=i;class o extends t.Name{constructor(d,f){super(f),this.prefix=d}setValue(d,{property:f,itemIndex:p}){this.value=d,this.scopePath=(0,t._)`.${new t.Name(f)}[${p}]`}}e.ValueScopeName=o;const a=(0,t._)`\n`;class l extends i{constructor(d){super(d),this._values={},this._scope=d.scope,this.opts={...d,_n:d.lines?a:t.nil}}get(){return this._scope}name(d){return new o(d,this._newName(d))}value(d,f){var p;if(f.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const m=this.toName(d),{prefix:g}=m,b=(p=f.key)!==null&&p!==void 0?p:f.ref;let y=this._values[g];if(y){const S=y.get(b);if(S)return S}else y=this._values[g]=new Map;y.set(b,m);const w=this._scope[g]||(this._scope[g]=[]),_=w.length;return w[_]=f.ref,m.setValue(f,{property:g,itemIndex:_}),m}getValue(d,f){const p=this._values[d];if(p)return p.get(f)}scopeRefs(d,f=this._values){return this._reduceValues(f,p=>{if(p.scopePath===void 0)throw new Error(`CodeGen: name "${p}" has no value`);return(0,t._)`${d}${p.scopePath}`})}scopeCode(d=this._values,f,p){return this._reduceValues(d,m=>{if(m.value===void 0)throw new Error(`CodeGen: name "${m}" has no value`);return m.value.code},f,p)}_reduceValues(d,f,p={},m){let g=t.nil;for(const b in d){const y=d[b];if(!y)continue;const w=p[b]=p[b]||new Map;y.forEach(_=>{if(w.has(_))return;w.set(_,n.Started);let S=f(_);if(S){const C=this.opts.es5?e.varKinds.var:e.varKinds.const;g=(0,t._)`${g}${C} ${_} = ${S};${this.opts._n}`}else if(S=m==null?void 0:m(_))g=(0,t._)`${g}${S}${this.opts._n}`;else throw new r(_);w.set(_,n.Completed)})}return g}}e.ValueScope=l}(U_)),U_}var LA;function Dt(){return LA||(LA=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=r0(),r=FA();var n=r0();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}});var i=FA();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return i.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return i.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return i.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return i.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class o{optimizeNodes(){return this}optimizeNames($,F){return this}}class a extends o{constructor($,F,V){super(),this.varKind=$,this.name=F,this.rhs=V}render({es5:$,_n:F}){const V=$?r.varKinds.var:this.varKind,de=this.rhs===void 0?"":` = ${this.rhs}`;return`${V} ${this.name}${de};`+F}optimizeNames($,F){if($[this.name.str])return this.rhs&&(this.rhs=N(this.rhs,$,F)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class l extends o{constructor($,F,V){super(),this.lhs=$,this.rhs=F,this.sideEffects=V}render({_n:$}){return`${this.lhs} = ${this.rhs};`+$}optimizeNames($,F){if(!(this.lhs instanceof t.Name&&!$[this.lhs.str]&&!this.sideEffects))return this.rhs=N(this.rhs,$,F),this}get names(){const $=this.lhs instanceof t.Name?{}:{...this.lhs.names};return ie($,this.rhs)}}class c extends l{constructor($,F,V,de){super($,V,de),this.op=F}render({_n:$}){return`${this.lhs} ${this.op}= ${this.rhs};`+$}}class d extends o{constructor($){super(),this.label=$,this.names={}}render({_n:$}){return`${this.label}:`+$}}class f extends o{constructor($){super(),this.label=$,this.names={}}render({_n:$}){return`break${this.label?` ${this.label}`:""};`+$}}class p extends o{constructor($){super(),this.error=$}render({_n:$}){return`throw ${this.error};`+$}get names(){return this.error.names}}class m extends o{constructor($){super(),this.code=$}render({_n:$}){return`${this.code};`+$}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames($,F){return this.code=N(this.code,$,F),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class g extends o{constructor($=[]){super(),this.nodes=$}render($){return this.nodes.reduce((F,V)=>F+V.render($),"")}optimizeNodes(){const{nodes:$}=this;let F=$.length;for(;F--;){const V=$[F].optimizeNodes();Array.isArray(V)?$.splice(F,1,...V):V?$[F]=V:$.splice(F,1)}return $.length>0?this:void 0}optimizeNames($,F){const{nodes:V}=this;let de=V.length;for(;de--;){const pe=V[de];pe.optimizeNames($,F)||(X($,pe.names),V.splice(de,1))}return V.length>0?this:void 0}get names(){return this.nodes.reduce(($,F)=>se($,F.names),{})}}class b extends g{render($){return"{"+$._n+super.render($)+"}"+$._n}}class y extends g{}class w extends b{}w.kind="else";class _ extends b{constructor($,F){super(F),this.condition=$}render($){let F=`if(${this.condition})`+super.render($);return this.else&&(F+="else "+this.else.render($)),F}optimizeNodes(){super.optimizeNodes();const $=this.condition;if($===!0)return this.nodes;let F=this.else;if(F){const V=F.optimizeNodes();F=this.else=Array.isArray(V)?new w(V):V}if(F)return $===!1?F instanceof _?F:F.nodes:this.nodes.length?this:new _(ce($),F instanceof _?[F]:F.nodes);if(!($===!1||!this.nodes.length))return this}optimizeNames($,F){var V;if(this.else=(V=this.else)===null||V===void 0?void 0:V.optimizeNames($,F),!!(super.optimizeNames($,F)||this.else))return this.condition=N(this.condition,$,F),this}get names(){const $=super.names;return ie($,this.condition),this.else&&se($,this.else.names),$}}_.kind="if";class S extends b{}S.kind="for";class C extends S{constructor($){super(),this.iteration=$}render($){return`for(${this.iteration})`+super.render($)}optimizeNames($,F){if(super.optimizeNames($,F))return this.iteration=N(this.iteration,$,F),this}get names(){return se(super.names,this.iteration.names)}}class k extends S{constructor($,F,V,de){super(),this.varKind=$,this.name=F,this.from=V,this.to=de}render($){const F=$.es5?r.varKinds.var:this.varKind,{name:V,from:de,to:pe}=this;return`for(${F} ${V}=${de}; ${V}<${pe}; ${V}++)`+super.render($)}get names(){const $=ie(super.names,this.from);return ie($,this.to)}}class E extends S{constructor($,F,V,de){super(),this.loop=$,this.varKind=F,this.name=V,this.iterable=de}render($){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render($)}optimizeNames($,F){if(super.optimizeNames($,F))return this.iterable=N(this.iterable,$,F),this}get names(){return se(super.names,this.iterable.names)}}class R extends b{constructor($,F,V){super(),this.name=$,this.args=F,this.async=V}render($){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render($)}}R.kind="func";class T extends g{render($){return"return "+super.render($)}}T.kind="return";class A extends b{render($){let F="try"+super.render($);return this.catch&&(F+=this.catch.render($)),this.finally&&(F+=this.finally.render($)),F}optimizeNodes(){var $,F;return super.optimizeNodes(),($=this.catch)===null||$===void 0||$.optimizeNodes(),(F=this.finally)===null||F===void 0||F.optimizeNodes(),this}optimizeNames($,F){var V,de;return super.optimizeNames($,F),(V=this.catch)===null||V===void 0||V.optimizeNames($,F),(de=this.finally)===null||de===void 0||de.optimizeNames($,F),this}get names(){const $=super.names;return this.catch&&se($,this.catch.names),this.finally&&se($,this.finally.names),$}}class M extends b{constructor($){super(),this.error=$}render($){return`catch(${this.error})`+super.render($)}}M.kind="catch";class B extends b{render($){return"finally"+super.render($)}}B.kind="finally";class Q{constructor($,F={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...F,_n:F.lines?`
|
1402
|
-
`:""},this._extScope=$,this._scope=new r.Scope({parent:$}),this._nodes=[new y]}toString(){return this._root.render(this.opts)}name($){return this._scope.name($)}scopeName($){return this._extScope.name($)}scopeValue($,F){const V=this._extScope.value($,F);return(this._values[V.prefix]||(this._values[V.prefix]=new Set)).add(V),V}getScopeValue($,F){return this._extScope.getValue($,F)}scopeRefs($){return this._extScope.scopeRefs($,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def($,F,V,de){const pe=this._scope.toName(F);return V!==void 0&&de&&(this._constants[pe.str]=V),this._leafNode(new a($,pe,V)),pe}const($,F,V){return this._def(r.varKinds.const,$,F,V)}let($,F,V){return this._def(r.varKinds.let,$,F,V)}var($,F,V){return this._def(r.varKinds.var,$,F,V)}assign($,F,V){return this._leafNode(new l($,F,V))}add($,F){return this._leafNode(new c($,e.operators.ADD,F))}code($){return typeof $=="function"?$():$!==t.nil&&this._leafNode(new m($)),this}object(...$){const F=["{"];for(const[V,de]of $)F.length>1&&F.push(","),F.push(V),(V!==de||this.opts.es5)&&(F.push(":"),(0,t.addCodeArg)(F,de));return F.push("}"),new t._Code(F)}if($,F,V){if(this._blockNode(new _($)),F&&V)this.code(F).else().code(V).endIf();else if(F)this.code(F).endIf();else if(V)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf($){return this._elseNode(new _($))}else(){return this._elseNode(new w)}endIf(){return this._endBlockNode(_,w)}_for($,F){return this._blockNode($),F&&this.code(F).endFor(),this}for($,F){return this._for(new C($),F)}forRange($,F,V,de,pe=this.opts.es5?r.varKinds.var:r.varKinds.let){const Ee=this._scope.toName($);return this._for(new k(pe,Ee,F,V),()=>de(Ee))}forOf($,F,V,de=r.varKinds.const){const pe=this._scope.toName($);if(this.opts.es5){const Ee=F instanceof t.Name?F:this.var("_arr",F);return this.forRange("_i",0,(0,t._)`${Ee}.length`,Me=>{this.var(pe,(0,t._)`${Ee}[${Me}]`),V(pe)})}return this._for(new E("of",de,pe,F),()=>V(pe))}forIn($,F,V,de=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf($,(0,t._)`Object.keys(${F})`,V);const pe=this._scope.toName($);return this._for(new E("in",de,pe,F),()=>V(pe))}endFor(){return this._endBlockNode(S)}label($){return this._leafNode(new d($))}break($){return this._leafNode(new f($))}return($){const F=new T;if(this._blockNode(F),this.code($),F.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(T)}try($,F,V){if(!F&&!V)throw new Error('CodeGen: "try" without "catch" and "finally"');const de=new A;if(this._blockNode(de),this.code($),F){const pe=this.name("e");this._currNode=de.catch=new M(pe),F(pe)}return V&&(this._currNode=de.finally=new B,this.code(V)),this._endBlockNode(M,B)}throw($){return this._leafNode(new p($))}block($,F){return this._blockStarts.push(this._nodes.length),$&&this.code($).endBlock(F),this}endBlock($){const F=this._blockStarts.pop();if(F===void 0)throw new Error("CodeGen: not in self-balancing block");const V=this._nodes.length-F;if(V<0||$!==void 0&&V!==$)throw new Error(`CodeGen: wrong number of nodes: ${V} vs ${$} expected`);return this._nodes.length=F,this}func($,F=t.nil,V,de){return this._blockNode(new R($,F,V)),de&&this.code(de).endFunc(),this}endFunc(){return this._endBlockNode(R)}optimize($=1){for(;$-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode($){return this._currNode.nodes.push($),this}_blockNode($){this._currNode.nodes.push($),this._nodes.push($)}_endBlockNode($,F){const V=this._currNode;if(V instanceof $||F&&V instanceof F)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${F?`${$.kind}/${F.kind}`:$.kind}"`)}_elseNode($){const F=this._currNode;if(!(F instanceof _))throw new Error('CodeGen: "else" without "if"');return this._currNode=F.else=$,this}get _root(){return this._nodes[0]}get _currNode(){const $=this._nodes;return $[$.length-1]}set _currNode($){const F=this._nodes;F[F.length-1]=$}}e.CodeGen=Q;function se(q,$){for(const F in $)q[F]=(q[F]||0)+($[F]||0);return q}function ie(q,$){return $ instanceof t._CodeOrName?se(q,$.names):q}function N(q,$,F){if(q instanceof t.Name)return V(q);if(!de(q))return q;return new t._Code(q._items.reduce((pe,Ee)=>(Ee instanceof t.Name&&(Ee=V(Ee)),Ee instanceof t._Code?pe.push(...Ee._items):pe.push(Ee),pe),[]));function V(pe){const Ee=F[pe.str];return Ee===void 0||$[pe.str]!==1?pe:(delete $[pe.str],Ee)}function de(pe){return pe instanceof t._Code&&pe._items.some(Ee=>Ee instanceof t.Name&&$[Ee.str]===1&&F[Ee.str]!==void 0)}}function X(q,$){for(const F in $)q[F]=(q[F]||0)-($[F]||0)}function ce(q){return typeof q=="boolean"||typeof q=="number"||q===null?!q:(0,t._)`!${U(q)}`}e.not=ce;const ne=j(e.operators.AND);function ee(...q){return q.reduce(ne)}e.and=ee;const ge=j(e.operators.OR);function Z(...q){return q.reduce(ge)}e.or=Z;function j(q){return($,F)=>$===t.nil?F:F===t.nil?$:(0,t._)`${U($)} ${q} ${U(F)}`}function U(q){return q instanceof t.Name?q:(0,t._)`(${q})`}}(z_)),z_}var Vt={},BA;function Jt(){if(BA)return Vt;BA=1,Object.defineProperty(Vt,"__esModule",{value:!0}),Vt.checkStrictMode=Vt.getErrorPath=Vt.Type=Vt.useFunc=Vt.setEvaluated=Vt.evaluatedPropsToName=Vt.mergeEvaluated=Vt.eachItem=Vt.unescapeJsonPointer=Vt.escapeJsonPointer=Vt.escapeFragment=Vt.unescapeFragment=Vt.schemaRefOrVal=Vt.schemaHasRulesButRef=Vt.schemaHasRules=Vt.checkUnknownRules=Vt.alwaysValidSchema=Vt.toHash=void 0;const e=Dt(),t=r0();function r(E){const R={};for(const T of E)R[T]=!0;return R}Vt.toHash=r;function n(E,R){return typeof R=="boolean"?R:Object.keys(R).length===0?!0:(i(E,R),!o(R,E.self.RULES.all))}Vt.alwaysValidSchema=n;function i(E,R=E.schema){const{opts:T,self:A}=E;if(!T.strictSchema||typeof R=="boolean")return;const M=A.RULES.keywords;for(const B in R)M[B]||k(E,`unknown keyword: "${B}"`)}Vt.checkUnknownRules=i;function o(E,R){if(typeof E=="boolean")return!E;for(const T in E)if(R[T])return!0;return!1}Vt.schemaHasRules=o;function a(E,R){if(typeof E=="boolean")return!E;for(const T in E)if(T!=="$ref"&&R.all[T])return!0;return!1}Vt.schemaHasRulesButRef=a;function l({topSchemaRef:E,schemaPath:R},T,A,M){if(!M){if(typeof T=="number"||typeof T=="boolean")return T;if(typeof T=="string")return(0,e._)`${T}`}return(0,e._)`${E}${R}${(0,e.getProperty)(A)}`}Vt.schemaRefOrVal=l;function c(E){return p(decodeURIComponent(E))}Vt.unescapeFragment=c;function d(E){return encodeURIComponent(f(E))}Vt.escapeFragment=d;function f(E){return typeof E=="number"?`${E}`:E.replace(/~/g,"~0").replace(/\//g,"~1")}Vt.escapeJsonPointer=f;function p(E){return E.replace(/~1/g,"/").replace(/~0/g,"~")}Vt.unescapeJsonPointer=p;function m(E,R){if(Array.isArray(E))for(const T of E)R(T);else R(E)}Vt.eachItem=m;function g({mergeNames:E,mergeToName:R,mergeValues:T,resultToName:A}){return(M,B,Q,se)=>{const ie=Q===void 0?B:Q instanceof e.Name?(B instanceof e.Name?E(M,B,Q):R(M,B,Q),Q):B instanceof e.Name?(R(M,Q,B),B):T(B,Q);return se===e.Name&&!(ie instanceof e.Name)?A(M,ie):ie}}Vt.mergeEvaluated={props:g({mergeNames:(E,R,T)=>E.if((0,e._)`${T} !== true && ${R} !== undefined`,()=>{E.if((0,e._)`${R} === true`,()=>E.assign(T,!0),()=>E.assign(T,(0,e._)`${T} || {}`).code((0,e._)`Object.assign(${T}, ${R})`))}),mergeToName:(E,R,T)=>E.if((0,e._)`${T} !== true`,()=>{R===!0?E.assign(T,!0):(E.assign(T,(0,e._)`${T} || {}`),y(E,T,R))}),mergeValues:(E,R)=>E===!0?!0:{...E,...R},resultToName:b}),items:g({mergeNames:(E,R,T)=>E.if((0,e._)`${T} !== true && ${R} !== undefined`,()=>E.assign(T,(0,e._)`${R} === true ? true : ${T} > ${R} ? ${T} : ${R}`)),mergeToName:(E,R,T)=>E.if((0,e._)`${T} !== true`,()=>E.assign(T,R===!0?!0:(0,e._)`${T} > ${R} ? ${T} : ${R}`)),mergeValues:(E,R)=>E===!0?!0:Math.max(E,R),resultToName:(E,R)=>E.var("items",R)})};function b(E,R){if(R===!0)return E.var("props",!0);const T=E.var("props",(0,e._)`{}`);return R!==void 0&&y(E,T,R),T}Vt.evaluatedPropsToName=b;function y(E,R,T){Object.keys(T).forEach(A=>E.assign((0,e._)`${R}${(0,e.getProperty)(A)}`,!0))}Vt.setEvaluated=y;const w={};function _(E,R){return E.scopeValue("func",{ref:R,code:w[R.code]||(w[R.code]=new t._Code(R.code))})}Vt.useFunc=_;var S;(function(E){E[E.Num=0]="Num",E[E.Str=1]="Str"})(S||(Vt.Type=S={}));function C(E,R,T){if(E instanceof e.Name){const A=R===S.Num;return T?A?(0,e._)`"[" + ${E} + "]"`:(0,e._)`"['" + ${E} + "']"`:A?(0,e._)`"/" + ${E}`:(0,e._)`"/" + ${E}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return T?(0,e.getProperty)(E).toString():"/"+f(E)}Vt.getErrorPath=C;function k(E,R,T=E.opts.strictSchema){if(T){if(R=`strict mode: ${R}`,T===!0)throw new Error(R);E.self.logger.warn(R)}}return Vt.checkStrictMode=k,Vt}var Ag={},VA;function wa(){if(VA)return Ag;VA=1,Object.defineProperty(Ag,"__esModule",{value:!0});const e=Dt(),t={data:new e.Name("data"),valCxt:new e.Name("valCxt"),instancePath:new e.Name("instancePath"),parentData:new e.Name("parentData"),parentDataProperty:new e.Name("parentDataProperty"),rootData:new e.Name("rootData"),dynamicAnchors:new e.Name("dynamicAnchors"),vErrors:new e.Name("vErrors"),errors:new e.Name("errors"),this:new e.Name("this"),self:new e.Name("self"),scope:new e.Name("scope"),json:new e.Name("json"),jsonPos:new e.Name("jsonPos"),jsonLen:new e.Name("jsonLen"),jsonPart:new e.Name("jsonPart")};return Ag.default=t,Ag}var zA;function yw(){return zA||(zA=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=Dt(),r=Jt(),n=wa();e.keywordError={message:({keyword:w})=>(0,t.str)`must pass "${w}" keyword validation`},e.keyword$DataError={message:({keyword:w,schemaType:_})=>_?(0,t.str)`"${w}" keyword must be ${_} ($data)`:(0,t.str)`"${w}" keyword is invalid ($data)`};function i(w,_=e.keywordError,S,C){const{it:k}=w,{gen:E,compositeRule:R,allErrors:T}=k,A=p(w,_,S);C??(R||T)?c(E,A):d(k,(0,t._)`[${A}]`)}e.reportError=i;function o(w,_=e.keywordError,S){const{it:C}=w,{gen:k,compositeRule:E,allErrors:R}=C,T=p(w,_,S);c(k,T),E||R||d(C,n.default.vErrors)}e.reportExtraError=o;function a(w,_){w.assign(n.default.errors,_),w.if((0,t._)`${n.default.vErrors} !== null`,()=>w.if(_,()=>w.assign((0,t._)`${n.default.vErrors}.length`,_),()=>w.assign(n.default.vErrors,null)))}e.resetErrorsCount=a;function l({gen:w,keyword:_,schemaValue:S,data:C,errsCount:k,it:E}){if(k===void 0)throw new Error("ajv implementation error");const R=w.name("err");w.forRange("i",k,n.default.errors,T=>{w.const(R,(0,t._)`${n.default.vErrors}[${T}]`),w.if((0,t._)`${R}.instancePath === undefined`,()=>w.assign((0,t._)`${R}.instancePath`,(0,t.strConcat)(n.default.instancePath,E.errorPath))),w.assign((0,t._)`${R}.schemaPath`,(0,t.str)`${E.errSchemaPath}/${_}`),E.opts.verbose&&(w.assign((0,t._)`${R}.schema`,S),w.assign((0,t._)`${R}.data`,C))})}e.extendErrors=l;function c(w,_){const S=w.const("err",_);w.if((0,t._)`${n.default.vErrors} === null`,()=>w.assign(n.default.vErrors,(0,t._)`[${S}]`),(0,t._)`${n.default.vErrors}.push(${S})`),w.code((0,t._)`${n.default.errors}++`)}function d(w,_){const{gen:S,validateName:C,schemaEnv:k}=w;k.$async?S.throw((0,t._)`new ${w.ValidationError}(${_})`):(S.assign((0,t._)`${C}.errors`,_),S.return(!1))}const f={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function p(w,_,S){const{createErrors:C}=w.it;return C===!1?(0,t._)`{}`:m(w,_,S)}function m(w,_,S={}){const{gen:C,it:k}=w,E=[g(k,S),b(w,S)];return y(w,_,E),C.object(...E)}function g({errorPath:w},{instancePath:_}){const S=_?(0,t.str)`${w}${(0,r.getErrorPath)(_,r.Type.Str)}`:w;return[n.default.instancePath,(0,t.strConcat)(n.default.instancePath,S)]}function b({keyword:w,it:{errSchemaPath:_}},{schemaPath:S,parentSchema:C}){let k=C?_:(0,t.str)`${_}/${w}`;return S&&(k=(0,t.str)`${k}${(0,r.getErrorPath)(S,r.Type.Str)}`),[f.schemaPath,k]}function y(w,{params:_,message:S},C){const{keyword:k,data:E,schemaValue:R,it:T}=w,{opts:A,propertyName:M,topSchemaRef:B,schemaPath:Q}=T;C.push([f.keyword,k],[f.params,typeof _=="function"?_(w):_||(0,t._)`{}`]),A.messages&&C.push([f.message,typeof S=="function"?S(w):S]),A.verbose&&C.push([f.schema,R],[f.parentSchema,(0,t._)`${B}${Q}`],[n.default.data,E]),M&&C.push([f.propertyName,M])}}(V_)),V_}var qA;function hwe(){if(qA)return Ru;qA=1,Object.defineProperty(Ru,"__esModule",{value:!0}),Ru.boolOrEmptySchema=Ru.topBoolOrEmptySchema=void 0;const e=yw(),t=Dt(),r=wa(),n={message:"boolean schema is false"};function i(l){const{gen:c,schema:d,validateName:f}=l;d===!1?a(l,!1):typeof d=="object"&&d.$async===!0?c.return(r.default.data):(c.assign((0,t._)`${f}.errors`,null),c.return(!0))}Ru.topBoolOrEmptySchema=i;function o(l,c){const{gen:d,schema:f}=l;f===!1?(d.var(c,!1),a(l)):d.var(c,!0)}Ru.boolOrEmptySchema=o;function a(l,c){const{gen:d,data:f}=l,p={gen:d,keyword:"false schema",data:f,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:l};(0,e.reportError)(p,n,void 0,c)}return Ru}var Gn={},Iu={},UA;function $3(){if(UA)return Iu;UA=1,Object.defineProperty(Iu,"__esModule",{value:!0}),Iu.getRules=Iu.isJSONType=void 0;const e=["string","number","integer","boolean","null","object","array"],t=new Set(e);function r(i){return typeof i=="string"&&t.has(i)}Iu.isJSONType=r;function n(){const i={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...i,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},i.number,i.string,i.array,i.object],post:{rules:[]},all:{},keywords:{}}}return Iu.getRules=n,Iu}var bs={},HA;function A3(){if(HA)return bs;HA=1,Object.defineProperty(bs,"__esModule",{value:!0}),bs.shouldUseRule=bs.shouldUseGroup=bs.schemaHasRulesForType=void 0;function e({schema:n,self:i},o){const a=i.RULES.types[o];return a&&a!==!0&&t(n,a)}bs.schemaHasRulesForType=e;function t(n,i){return i.rules.some(o=>r(n,o))}bs.shouldUseGroup=t;function r(n,i){var o;return n[i.keyword]!==void 0||((o=i.definition.implements)===null||o===void 0?void 0:o.some(a=>n[a]!==void 0))}return bs.shouldUseRule=r,bs}var WA;function n0(){if(WA)return Gn;WA=1,Object.defineProperty(Gn,"__esModule",{value:!0}),Gn.reportTypeError=Gn.checkDataTypes=Gn.checkDataType=Gn.coerceAndCheckDataType=Gn.getJSONTypes=Gn.getSchemaTypes=Gn.DataType=void 0;const e=$3(),t=A3(),r=yw(),n=Dt(),i=Jt();var o;(function(S){S[S.Correct=0]="Correct",S[S.Wrong=1]="Wrong"})(o||(Gn.DataType=o={}));function a(S){const C=l(S.type);if(C.includes("null")){if(S.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!C.length&&S.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');S.nullable===!0&&C.push("null")}return C}Gn.getSchemaTypes=a;function l(S){const C=Array.isArray(S)?S:S?[S]:[];if(C.every(e.isJSONType))return C;throw new Error("type must be JSONType or JSONType[]: "+C.join(","))}Gn.getJSONTypes=l;function c(S,C){const{gen:k,data:E,opts:R}=S,T=f(C,R.coerceTypes),A=C.length>0&&!(T.length===0&&C.length===1&&(0,t.schemaHasRulesForType)(S,C[0]));if(A){const M=b(C,E,R.strictNumbers,o.Wrong);k.if(M,()=>{T.length?p(S,C,T):w(S)})}return A}Gn.coerceAndCheckDataType=c;const d=new Set(["string","number","integer","boolean","null"]);function f(S,C){return C?S.filter(k=>d.has(k)||C==="array"&&k==="array"):[]}function p(S,C,k){const{gen:E,data:R,opts:T}=S,A=E.let("dataType",(0,n._)`typeof ${R}`),M=E.let("coerced",(0,n._)`undefined`);T.coerceTypes==="array"&&E.if((0,n._)`${A} == 'object' && Array.isArray(${R}) && ${R}.length == 1`,()=>E.assign(R,(0,n._)`${R}[0]`).assign(A,(0,n._)`typeof ${R}`).if(b(C,R,T.strictNumbers),()=>E.assign(M,R))),E.if((0,n._)`${M} !== undefined`);for(const Q of k)(d.has(Q)||Q==="array"&&T.coerceTypes==="array")&&B(Q);E.else(),w(S),E.endIf(),E.if((0,n._)`${M} !== undefined`,()=>{E.assign(R,M),m(S,M)});function B(Q){switch(Q){case"string":E.elseIf((0,n._)`${A} == "number" || ${A} == "boolean"`).assign(M,(0,n._)`"" + ${R}`).elseIf((0,n._)`${R} === null`).assign(M,(0,n._)`""`);return;case"number":E.elseIf((0,n._)`${A} == "boolean" || ${R} === null
|
1401
|
+
`,Z0e=async e=>{const t=await xr.mutate({mutation:J0e,variables:e});if(!t.data)throw t.errors;return t.data};class ewe{constructor(t,r){this.projectPageModel=t,this.tableId=r}get branch(){return this.projectPageModel.branchOrThrow}async execute(){const t=await this.deleteTableRequest();return await this.updateTablesConnection(),this.branch.updateTouched(t),!0}async deleteTableRequest(){return(await Z0e({data:{revisionId:this.branch.draft.id,tableId:this.tableId}})).removeTable.branch.touched}async updateTablesConnection(){const t=this.branch.draft,r=t.tablesConnection.edges.find(n=>n.node.id===this.tableId);t.tablesConnection.removeEdge(r==null?void 0:r.cursor)}}class twe{constructor(t,r){this.rootStore=t,this.projectPageModel=r,st(this,{},{autoBind:!0}),this.init()}get totalCount(){return this.items.length}get hasNextPage(){return this.revision.tablesConnection.availableNextPage}get isEditableRevision(){return this.projectPageModel.isEditableRevision}get items(){return this.revision.tablesConnection.edges.map(({node:t})=>({id:t.id,versionId:t.versionId,readonly:t.readonly,title:t.id,count:t.count,link:""}))}dispose(){}tryToFetchNextPage(){this.hasNextPage&&this.rootStore.queryTables({revisionId:this.revision.id,first:50,after:this.revision.tablesConnection.endCursor||void 0})}async deleteTable(t){try{return await new ewe(this.projectPageModel,t).execute()}catch(r){return console.log(r),!1}}init(){}get revision(){return this.projectPageModel.revisionOrThrow}}const rwe=()=>{const e=Zn(),[t]=O.useState(()=>new twe(ct,e));return O.useEffect(()=>(t.init(),()=>t.dispose()),[t]),t},nwe=({onRemove:e,dataTestId:t})=>{const[r,n]=O.useState(!1),i=O.useCallback(async()=>{n(!0),await(e==null?void 0:e()),n(!1)},[e]);return x.jsx(Ci,{"data-testid":t,_hover:{backgroundColor:"gray.100"},"aria-label":"",color:"gray.400",icon:x.jsx(J0,{}),isLoading:r,variant:"ghost",onClick:i})},iwe="_Row_1lkxi_1",owe="_RemoveRowButton_1lkxi_1",D2={Row:iwe,RemoveRowButton:owe},awe=({table:e,store:t,onSettings:r,onSelect:n})=>{const i=O.useCallback(async()=>{r(e.versionId)},[r,e.versionId]),o=O.useCallback(()=>t.deleteTable(e.id),[t,e.id]),a=O.useCallback(()=>{n==null||n(e.id)},[n,e.id]),l=!!n;return x.jsx(wt,{height:"2.5rem",width:"100%","data-testid":`table-${e.id}`,children:x.jsxs(je,{_hover:{backgroundColor:"gray.50"},alignItems:"center",className:D2.Row,gap:"4px",paddingLeft:"1rem",children:[x.jsxs(je,{width:"150px",children:[n?x.jsx(bt,{maxWidth:"140px",textDecoration:"underline",cursor:"pointer",onClick:a,"data-testid":`table-${e.id}-select`,textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:e.id}):x.jsx(qo,{to:`${e.id}`,"data-testid":`table-${e.id}-link`,children:x.jsx(bt,{maxWidth:"140px",textDecoration:"underline",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:e.id})}),!e.readonly&&t.isEditableRevision&&x.jsx(bt,{children:"*"})]}),x.jsxs(je,{alignItems:"center",flex:1,justifyContent:"space-between",minHeight:"40px",children:[x.jsxs(bt,{color:"gray.400",fontWeight:"300",ml:"16px",children:[e.count," rows"]}),!l&&t.isEditableRevision&&x.jsxs(je,{className:D2.RemoveRowButton,children:[x.jsx(MV,{dataTestId:`table-settings-button-${e.id}`,onClick:i}),x.jsx(nwe,{dataTestId:`remove-table-button-${e.id}`,onRemove:o})]})]})]})},e.versionId)},swe=Ot(({onSettings:e,onSelect:t})=>{const r=rwe();return x.jsx(pw,{useWindowScroll:!0,totalCount:r.totalCount,defaultItemHeight:40,increaseViewportBy:40*100,endReached:r.hasNextPage?r.tryToFetchNextPage:void 0,itemContent:n=>{const i=r.items[n];if(i)return x.jsx(awe,{table:i,store:r,onSettings:e,onSelect:t},i.versionId)}})}),lwe=Ot(()=>{const{root:e,item:t}=e0e(),r=O.useCallback(l=>{e.selectForeignKey(t,l)},[t,e]),n=O.useCallback(()=>{e.cancelSelectingForeignKey(t)},[t,e]),i=O.useCallback(async()=>{if(t.state.type===Qn.CreatingTable){const l=t.state.store;await t.createTable(l.draftTableId,l.getPlainSchema())&&(l.submitChanges(),t.state.isSelectingForeignKey?e.onSelectedForeignKey(t,l.draftTableId):t.toUpdatingTableFromCreatingTable())}},[t,e]),o=O.useCallback(async()=>{if(t.state.type===Qn.UpdatingTable){const l=t.state.store;await t.updateTable(l)&&l.submitChanges()}},[t]),a=O.useCallback(l=>{e.onSelectedForeignKey(t,l)},[t,e]);if(t.state.type===Qn.ConnectingForeignKeyTable){const l=t.state.store;return x.jsx(x.Fragment,{children:x.jsx(X0e,{previousType:t.state.previousType,foreignKeyPath:t.currentForeignKeyPath,onCancel:n,tableId:l.draftTableId})})}if(t.state.type===Qn.List)return x.jsxs(x.Fragment,{children:[t.state.isSelectingForeignKey&&x.jsx(F_,{}),x.jsx(t0e,{onClick:t.toCreatingTable}),x.jsx(wt,{paddingTop:"0.5rem",paddingBottom:"1rem",children:x.jsx(swe,{onSettings:t.toUpdatingTable,onSelect:t.state.isSelectingForeignKey?a:void 0})})]});if(t.state.type===Qn.CreatingTable){const l=t.state.store;return x.jsxs(x.Fragment,{children:[t.state.isSelectingForeignKey&&x.jsx(F_,{}),x.jsx(A2,{store:l,mode:pc.Creating,onApprove:i,onCancel:t.toList,onSelectForeignKey:r})]})}if(t.state.type===Qn.UpdatingTable){const l=t.state.store;return x.jsxs(x.Fragment,{children:[t.state.isSelectingForeignKey&&x.jsx(F_,{}),x.jsx(A2,{store:l,mode:pc.Updating,onApprove:o,onCancel:t.toList,onSelectForeignKey:r})]})}return null}),L_=Ot(()=>{const e=Zbe();return x.jsx(x.Fragment,{children:e.stack.map(t=>x.jsx(b3.Provider,{value:{root:e,item:t},children:x.jsx(lwe,{})},t.id))})}),uwe="_Root_1k7pa_1",cwe="_Actions_1k7pa_1",t0={Root:uwe,Actions:cwe},dwe="row-edit-mode",fwe=({data:e})=>{const[t,r]=Ome(dwe,zn.Tree);return x.jsxs(je,{alignItems:"flex-start",flexDirection:"column",gap:"1rem",className:t0.Root,flex:1,children:[x.jsxs(je,{justifyContent:"space-between",width:"100%",alignItems:"center",children:[x.jsx(je,{minHeight:"40px"}),x.jsx(wt,{className:t0.Actions,children:x.jsx(yT,{mode:t||zn.Tree,onChange:r})})]}),t===zn.Tree&&x.jsxs(je,{alignItems:"center",flex:1,gap:"1rem",justifyContent:"center",width:"100%",children:[x.jsx(WE,{color:"gray"}),x.jsx(bt,{color:"gray.400",children:"Unsupported schema, use JSON mode"})]}),t===zn.Json&&x.jsx(BC,{whiteSpace:"pre-wrap",backgroundColor:"gray.50",padding:"1rem",paddingRight:"5rem",children:JSON.stringify(e,null,4)})]})};var $g={exports:{}},B_={},ys={},Ru={},V_={},z_={},q_={},M2;function r0(){return M2||(M2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends t{constructor(S){if(super(),!e.IDENTIFIER.test(S))throw new Error("CodeGen: name must be a valid identifier");this.str=S}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class n extends t{constructor(S){super(),this._items=typeof S=="string"?[S]:S}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const S=this._items[0];return S===""||S==='""'}get str(){var S;return(S=this._str)!==null&&S!==void 0?S:this._str=this._items.reduce((C,k)=>`${C}${k}`,"")}get names(){var S;return(S=this._names)!==null&&S!==void 0?S:this._names=this._items.reduce((C,k)=>(k instanceof r&&(C[k.str]=(C[k.str]||0)+1),C),{})}}e._Code=n,e.nil=new n("");function i(_,...S){const C=[_[0]];let k=0;for(;k<S.length;)l(C,S[k]),C.push(_[++k]);return new n(C)}e._=i;const o=new n("+");function a(_,...S){const C=[g(_[0])];let k=0;for(;k<S.length;)C.push(o),l(C,S[k]),C.push(o,g(_[++k]));return c(C),new n(C)}e.str=a;function l(_,S){S instanceof n?_.push(...S._items):S instanceof r?_.push(S):_.push(p(S))}e.addCodeArg=l;function c(_){let S=1;for(;S<_.length-1;){if(_[S]===o){const C=d(_[S-1],_[S+1]);if(C!==void 0){_.splice(S-1,3,C);continue}_[S++]="+"}S++}}function d(_,S){if(S==='""')return _;if(_==='""')return S;if(typeof _=="string")return S instanceof r||_[_.length-1]!=='"'?void 0:typeof S!="string"?`${_.slice(0,-1)}${S}"`:S[0]==='"'?_.slice(0,-1)+S.slice(1):void 0;if(typeof S=="string"&&S[0]==='"'&&!(_ instanceof r))return`"${_}${S.slice(1)}`}function f(_,S){return S.emptyStr()?_:_.emptyStr()?S:a`${_}${S}`}e.strConcat=f;function p(_){return typeof _=="number"||typeof _=="boolean"||_===null?_:g(Array.isArray(_)?_.join(","):_)}function m(_){return new n(g(_))}e.stringify=m;function g(_){return JSON.stringify(_).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=g;function b(_){return typeof _=="string"&&e.IDENTIFIER.test(_)?new n(`.${_}`):i`[${_}]`}e.getProperty=b;function y(_){if(typeof _=="string"&&e.IDENTIFIER.test(_))return new n(`${_}`);throw new Error(`CodeGen: invalid export name: ${_}, use explicit $id name mapping`)}e.getEsmExportName=y;function w(_){return new n(_.toString())}e.regexpCode=w}(q_)),q_}var U_={},N2;function F2(){return N2||(N2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=r0();class r extends Error{constructor(d){super(`CodeGen: "code" for ${d} not defined`),this.value=d.value}}var n;(function(c){c[c.Started=0]="Started",c[c.Completed=1]="Completed"})(n||(e.UsedValueState=n={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class i{constructor({prefixes:d,parent:f}={}){this._names={},this._prefixes=d,this._parent=f}toName(d){return d instanceof t.Name?d:this.name(d)}name(d){return new t.Name(this._newName(d))}_newName(d){const f=this._names[d]||this._nameGroup(d);return`${d}${f.index++}`}_nameGroup(d){var f,p;if(!((p=(f=this._parent)===null||f===void 0?void 0:f._prefixes)===null||p===void 0)&&p.has(d)||this._prefixes&&!this._prefixes.has(d))throw new Error(`CodeGen: prefix "${d}" is not allowed in this scope`);return this._names[d]={prefix:d,index:0}}}e.Scope=i;class o extends t.Name{constructor(d,f){super(f),this.prefix=d}setValue(d,{property:f,itemIndex:p}){this.value=d,this.scopePath=(0,t._)`.${new t.Name(f)}[${p}]`}}e.ValueScopeName=o;const a=(0,t._)`\n`;class l extends i{constructor(d){super(d),this._values={},this._scope=d.scope,this.opts={...d,_n:d.lines?a:t.nil}}get(){return this._scope}name(d){return new o(d,this._newName(d))}value(d,f){var p;if(f.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const m=this.toName(d),{prefix:g}=m,b=(p=f.key)!==null&&p!==void 0?p:f.ref;let y=this._values[g];if(y){const S=y.get(b);if(S)return S}else y=this._values[g]=new Map;y.set(b,m);const w=this._scope[g]||(this._scope[g]=[]),_=w.length;return w[_]=f.ref,m.setValue(f,{property:g,itemIndex:_}),m}getValue(d,f){const p=this._values[d];if(p)return p.get(f)}scopeRefs(d,f=this._values){return this._reduceValues(f,p=>{if(p.scopePath===void 0)throw new Error(`CodeGen: name "${p}" has no value`);return(0,t._)`${d}${p.scopePath}`})}scopeCode(d=this._values,f,p){return this._reduceValues(d,m=>{if(m.value===void 0)throw new Error(`CodeGen: name "${m}" has no value`);return m.value.code},f,p)}_reduceValues(d,f,p={},m){let g=t.nil;for(const b in d){const y=d[b];if(!y)continue;const w=p[b]=p[b]||new Map;y.forEach(_=>{if(w.has(_))return;w.set(_,n.Started);let S=f(_);if(S){const C=this.opts.es5?e.varKinds.var:e.varKinds.const;g=(0,t._)`${g}${C} ${_} = ${S};${this.opts._n}`}else if(S=m==null?void 0:m(_))g=(0,t._)`${g}${S}${this.opts._n}`;else throw new r(_);w.set(_,n.Completed)})}return g}}e.ValueScope=l}(U_)),U_}var L2;function Dt(){return L2||(L2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=r0(),r=F2();var n=r0();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}});var i=F2();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return i.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return i.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return i.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return i.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class o{optimizeNodes(){return this}optimizeNames($,F){return this}}class a extends o{constructor($,F,V){super(),this.varKind=$,this.name=F,this.rhs=V}render({es5:$,_n:F}){const V=$?r.varKinds.var:this.varKind,de=this.rhs===void 0?"":` = ${this.rhs}`;return`${V} ${this.name}${de};`+F}optimizeNames($,F){if($[this.name.str])return this.rhs&&(this.rhs=N(this.rhs,$,F)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class l extends o{constructor($,F,V){super(),this.lhs=$,this.rhs=F,this.sideEffects=V}render({_n:$}){return`${this.lhs} = ${this.rhs};`+$}optimizeNames($,F){if(!(this.lhs instanceof t.Name&&!$[this.lhs.str]&&!this.sideEffects))return this.rhs=N(this.rhs,$,F),this}get names(){const $=this.lhs instanceof t.Name?{}:{...this.lhs.names};return ie($,this.rhs)}}class c extends l{constructor($,F,V,de){super($,V,de),this.op=F}render({_n:$}){return`${this.lhs} ${this.op}= ${this.rhs};`+$}}class d extends o{constructor($){super(),this.label=$,this.names={}}render({_n:$}){return`${this.label}:`+$}}class f extends o{constructor($){super(),this.label=$,this.names={}}render({_n:$}){return`break${this.label?` ${this.label}`:""};`+$}}class p extends o{constructor($){super(),this.error=$}render({_n:$}){return`throw ${this.error};`+$}get names(){return this.error.names}}class m extends o{constructor($){super(),this.code=$}render({_n:$}){return`${this.code};`+$}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames($,F){return this.code=N(this.code,$,F),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class g extends o{constructor($=[]){super(),this.nodes=$}render($){return this.nodes.reduce((F,V)=>F+V.render($),"")}optimizeNodes(){const{nodes:$}=this;let F=$.length;for(;F--;){const V=$[F].optimizeNodes();Array.isArray(V)?$.splice(F,1,...V):V?$[F]=V:$.splice(F,1)}return $.length>0?this:void 0}optimizeNames($,F){const{nodes:V}=this;let de=V.length;for(;de--;){const pe=V[de];pe.optimizeNames($,F)||(X($,pe.names),V.splice(de,1))}return V.length>0?this:void 0}get names(){return this.nodes.reduce(($,F)=>se($,F.names),{})}}class b extends g{render($){return"{"+$._n+super.render($)+"}"+$._n}}class y extends g{}class w extends b{}w.kind="else";class _ extends b{constructor($,F){super(F),this.condition=$}render($){let F=`if(${this.condition})`+super.render($);return this.else&&(F+="else "+this.else.render($)),F}optimizeNodes(){super.optimizeNodes();const $=this.condition;if($===!0)return this.nodes;let F=this.else;if(F){const V=F.optimizeNodes();F=this.else=Array.isArray(V)?new w(V):V}if(F)return $===!1?F instanceof _?F:F.nodes:this.nodes.length?this:new _(ce($),F instanceof _?[F]:F.nodes);if(!($===!1||!this.nodes.length))return this}optimizeNames($,F){var V;if(this.else=(V=this.else)===null||V===void 0?void 0:V.optimizeNames($,F),!!(super.optimizeNames($,F)||this.else))return this.condition=N(this.condition,$,F),this}get names(){const $=super.names;return ie($,this.condition),this.else&&se($,this.else.names),$}}_.kind="if";class S extends b{}S.kind="for";class C extends S{constructor($){super(),this.iteration=$}render($){return`for(${this.iteration})`+super.render($)}optimizeNames($,F){if(super.optimizeNames($,F))return this.iteration=N(this.iteration,$,F),this}get names(){return se(super.names,this.iteration.names)}}class k extends S{constructor($,F,V,de){super(),this.varKind=$,this.name=F,this.from=V,this.to=de}render($){const F=$.es5?r.varKinds.var:this.varKind,{name:V,from:de,to:pe}=this;return`for(${F} ${V}=${de}; ${V}<${pe}; ${V}++)`+super.render($)}get names(){const $=ie(super.names,this.from);return ie($,this.to)}}class E extends S{constructor($,F,V,de){super(),this.loop=$,this.varKind=F,this.name=V,this.iterable=de}render($){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render($)}optimizeNames($,F){if(super.optimizeNames($,F))return this.iterable=N(this.iterable,$,F),this}get names(){return se(super.names,this.iterable.names)}}class R extends b{constructor($,F,V){super(),this.name=$,this.args=F,this.async=V}render($){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render($)}}R.kind="func";class T extends g{render($){return"return "+super.render($)}}T.kind="return";class A extends b{render($){let F="try"+super.render($);return this.catch&&(F+=this.catch.render($)),this.finally&&(F+=this.finally.render($)),F}optimizeNodes(){var $,F;return super.optimizeNodes(),($=this.catch)===null||$===void 0||$.optimizeNodes(),(F=this.finally)===null||F===void 0||F.optimizeNodes(),this}optimizeNames($,F){var V,de;return super.optimizeNames($,F),(V=this.catch)===null||V===void 0||V.optimizeNames($,F),(de=this.finally)===null||de===void 0||de.optimizeNames($,F),this}get names(){const $=super.names;return this.catch&&se($,this.catch.names),this.finally&&se($,this.finally.names),$}}class M extends b{constructor($){super(),this.error=$}render($){return`catch(${this.error})`+super.render($)}}M.kind="catch";class B extends b{render($){return"finally"+super.render($)}}B.kind="finally";class Q{constructor($,F={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...F,_n:F.lines?`
|
1402
|
+
`:""},this._extScope=$,this._scope=new r.Scope({parent:$}),this._nodes=[new y]}toString(){return this._root.render(this.opts)}name($){return this._scope.name($)}scopeName($){return this._extScope.name($)}scopeValue($,F){const V=this._extScope.value($,F);return(this._values[V.prefix]||(this._values[V.prefix]=new Set)).add(V),V}getScopeValue($,F){return this._extScope.getValue($,F)}scopeRefs($){return this._extScope.scopeRefs($,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def($,F,V,de){const pe=this._scope.toName(F);return V!==void 0&&de&&(this._constants[pe.str]=V),this._leafNode(new a($,pe,V)),pe}const($,F,V){return this._def(r.varKinds.const,$,F,V)}let($,F,V){return this._def(r.varKinds.let,$,F,V)}var($,F,V){return this._def(r.varKinds.var,$,F,V)}assign($,F,V){return this._leafNode(new l($,F,V))}add($,F){return this._leafNode(new c($,e.operators.ADD,F))}code($){return typeof $=="function"?$():$!==t.nil&&this._leafNode(new m($)),this}object(...$){const F=["{"];for(const[V,de]of $)F.length>1&&F.push(","),F.push(V),(V!==de||this.opts.es5)&&(F.push(":"),(0,t.addCodeArg)(F,de));return F.push("}"),new t._Code(F)}if($,F,V){if(this._blockNode(new _($)),F&&V)this.code(F).else().code(V).endIf();else if(F)this.code(F).endIf();else if(V)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf($){return this._elseNode(new _($))}else(){return this._elseNode(new w)}endIf(){return this._endBlockNode(_,w)}_for($,F){return this._blockNode($),F&&this.code(F).endFor(),this}for($,F){return this._for(new C($),F)}forRange($,F,V,de,pe=this.opts.es5?r.varKinds.var:r.varKinds.let){const Ee=this._scope.toName($);return this._for(new k(pe,Ee,F,V),()=>de(Ee))}forOf($,F,V,de=r.varKinds.const){const pe=this._scope.toName($);if(this.opts.es5){const Ee=F instanceof t.Name?F:this.var("_arr",F);return this.forRange("_i",0,(0,t._)`${Ee}.length`,Me=>{this.var(pe,(0,t._)`${Ee}[${Me}]`),V(pe)})}return this._for(new E("of",de,pe,F),()=>V(pe))}forIn($,F,V,de=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf($,(0,t._)`Object.keys(${F})`,V);const pe=this._scope.toName($);return this._for(new E("in",de,pe,F),()=>V(pe))}endFor(){return this._endBlockNode(S)}label($){return this._leafNode(new d($))}break($){return this._leafNode(new f($))}return($){const F=new T;if(this._blockNode(F),this.code($),F.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(T)}try($,F,V){if(!F&&!V)throw new Error('CodeGen: "try" without "catch" and "finally"');const de=new A;if(this._blockNode(de),this.code($),F){const pe=this.name("e");this._currNode=de.catch=new M(pe),F(pe)}return V&&(this._currNode=de.finally=new B,this.code(V)),this._endBlockNode(M,B)}throw($){return this._leafNode(new p($))}block($,F){return this._blockStarts.push(this._nodes.length),$&&this.code($).endBlock(F),this}endBlock($){const F=this._blockStarts.pop();if(F===void 0)throw new Error("CodeGen: not in self-balancing block");const V=this._nodes.length-F;if(V<0||$!==void 0&&V!==$)throw new Error(`CodeGen: wrong number of nodes: ${V} vs ${$} expected`);return this._nodes.length=F,this}func($,F=t.nil,V,de){return this._blockNode(new R($,F,V)),de&&this.code(de).endFunc(),this}endFunc(){return this._endBlockNode(R)}optimize($=1){for(;$-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode($){return this._currNode.nodes.push($),this}_blockNode($){this._currNode.nodes.push($),this._nodes.push($)}_endBlockNode($,F){const V=this._currNode;if(V instanceof $||F&&V instanceof F)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${F?`${$.kind}/${F.kind}`:$.kind}"`)}_elseNode($){const F=this._currNode;if(!(F instanceof _))throw new Error('CodeGen: "else" without "if"');return this._currNode=F.else=$,this}get _root(){return this._nodes[0]}get _currNode(){const $=this._nodes;return $[$.length-1]}set _currNode($){const F=this._nodes;F[F.length-1]=$}}e.CodeGen=Q;function se(q,$){for(const F in $)q[F]=(q[F]||0)+($[F]||0);return q}function ie(q,$){return $ instanceof t._CodeOrName?se(q,$.names):q}function N(q,$,F){if(q instanceof t.Name)return V(q);if(!de(q))return q;return new t._Code(q._items.reduce((pe,Ee)=>(Ee instanceof t.Name&&(Ee=V(Ee)),Ee instanceof t._Code?pe.push(...Ee._items):pe.push(Ee),pe),[]));function V(pe){const Ee=F[pe.str];return Ee===void 0||$[pe.str]!==1?pe:(delete $[pe.str],Ee)}function de(pe){return pe instanceof t._Code&&pe._items.some(Ee=>Ee instanceof t.Name&&$[Ee.str]===1&&F[Ee.str]!==void 0)}}function X(q,$){for(const F in $)q[F]=(q[F]||0)-($[F]||0)}function ce(q){return typeof q=="boolean"||typeof q=="number"||q===null?!q:(0,t._)`!${U(q)}`}e.not=ce;const ne=j(e.operators.AND);function ee(...q){return q.reduce(ne)}e.and=ee;const ge=j(e.operators.OR);function Z(...q){return q.reduce(ge)}e.or=Z;function j(q){return($,F)=>$===t.nil?F:F===t.nil?$:(0,t._)`${U($)} ${q} ${U(F)}`}function U(q){return q instanceof t.Name?q:(0,t._)`(${q})`}}(z_)),z_}var Vt={},B2;function Jt(){if(B2)return Vt;B2=1,Object.defineProperty(Vt,"__esModule",{value:!0}),Vt.checkStrictMode=Vt.getErrorPath=Vt.Type=Vt.useFunc=Vt.setEvaluated=Vt.evaluatedPropsToName=Vt.mergeEvaluated=Vt.eachItem=Vt.unescapeJsonPointer=Vt.escapeJsonPointer=Vt.escapeFragment=Vt.unescapeFragment=Vt.schemaRefOrVal=Vt.schemaHasRulesButRef=Vt.schemaHasRules=Vt.checkUnknownRules=Vt.alwaysValidSchema=Vt.toHash=void 0;const e=Dt(),t=r0();function r(E){const R={};for(const T of E)R[T]=!0;return R}Vt.toHash=r;function n(E,R){return typeof R=="boolean"?R:Object.keys(R).length===0?!0:(i(E,R),!o(R,E.self.RULES.all))}Vt.alwaysValidSchema=n;function i(E,R=E.schema){const{opts:T,self:A}=E;if(!T.strictSchema||typeof R=="boolean")return;const M=A.RULES.keywords;for(const B in R)M[B]||k(E,`unknown keyword: "${B}"`)}Vt.checkUnknownRules=i;function o(E,R){if(typeof E=="boolean")return!E;for(const T in E)if(R[T])return!0;return!1}Vt.schemaHasRules=o;function a(E,R){if(typeof E=="boolean")return!E;for(const T in E)if(T!=="$ref"&&R.all[T])return!0;return!1}Vt.schemaHasRulesButRef=a;function l({topSchemaRef:E,schemaPath:R},T,A,M){if(!M){if(typeof T=="number"||typeof T=="boolean")return T;if(typeof T=="string")return(0,e._)`${T}`}return(0,e._)`${E}${R}${(0,e.getProperty)(A)}`}Vt.schemaRefOrVal=l;function c(E){return p(decodeURIComponent(E))}Vt.unescapeFragment=c;function d(E){return encodeURIComponent(f(E))}Vt.escapeFragment=d;function f(E){return typeof E=="number"?`${E}`:E.replace(/~/g,"~0").replace(/\//g,"~1")}Vt.escapeJsonPointer=f;function p(E){return E.replace(/~1/g,"/").replace(/~0/g,"~")}Vt.unescapeJsonPointer=p;function m(E,R){if(Array.isArray(E))for(const T of E)R(T);else R(E)}Vt.eachItem=m;function g({mergeNames:E,mergeToName:R,mergeValues:T,resultToName:A}){return(M,B,Q,se)=>{const ie=Q===void 0?B:Q instanceof e.Name?(B instanceof e.Name?E(M,B,Q):R(M,B,Q),Q):B instanceof e.Name?(R(M,Q,B),B):T(B,Q);return se===e.Name&&!(ie instanceof e.Name)?A(M,ie):ie}}Vt.mergeEvaluated={props:g({mergeNames:(E,R,T)=>E.if((0,e._)`${T} !== true && ${R} !== undefined`,()=>{E.if((0,e._)`${R} === true`,()=>E.assign(T,!0),()=>E.assign(T,(0,e._)`${T} || {}`).code((0,e._)`Object.assign(${T}, ${R})`))}),mergeToName:(E,R,T)=>E.if((0,e._)`${T} !== true`,()=>{R===!0?E.assign(T,!0):(E.assign(T,(0,e._)`${T} || {}`),y(E,T,R))}),mergeValues:(E,R)=>E===!0?!0:{...E,...R},resultToName:b}),items:g({mergeNames:(E,R,T)=>E.if((0,e._)`${T} !== true && ${R} !== undefined`,()=>E.assign(T,(0,e._)`${R} === true ? true : ${T} > ${R} ? ${T} : ${R}`)),mergeToName:(E,R,T)=>E.if((0,e._)`${T} !== true`,()=>E.assign(T,R===!0?!0:(0,e._)`${T} > ${R} ? ${T} : ${R}`)),mergeValues:(E,R)=>E===!0?!0:Math.max(E,R),resultToName:(E,R)=>E.var("items",R)})};function b(E,R){if(R===!0)return E.var("props",!0);const T=E.var("props",(0,e._)`{}`);return R!==void 0&&y(E,T,R),T}Vt.evaluatedPropsToName=b;function y(E,R,T){Object.keys(T).forEach(A=>E.assign((0,e._)`${R}${(0,e.getProperty)(A)}`,!0))}Vt.setEvaluated=y;const w={};function _(E,R){return E.scopeValue("func",{ref:R,code:w[R.code]||(w[R.code]=new t._Code(R.code))})}Vt.useFunc=_;var S;(function(E){E[E.Num=0]="Num",E[E.Str=1]="Str"})(S||(Vt.Type=S={}));function C(E,R,T){if(E instanceof e.Name){const A=R===S.Num;return T?A?(0,e._)`"[" + ${E} + "]"`:(0,e._)`"['" + ${E} + "']"`:A?(0,e._)`"/" + ${E}`:(0,e._)`"/" + ${E}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return T?(0,e.getProperty)(E).toString():"/"+f(E)}Vt.getErrorPath=C;function k(E,R,T=E.opts.strictSchema){if(T){if(R=`strict mode: ${R}`,T===!0)throw new Error(R);E.self.logger.warn(R)}}return Vt.checkStrictMode=k,Vt}var Ag={},V2;function wa(){if(V2)return Ag;V2=1,Object.defineProperty(Ag,"__esModule",{value:!0});const e=Dt(),t={data:new e.Name("data"),valCxt:new e.Name("valCxt"),instancePath:new e.Name("instancePath"),parentData:new e.Name("parentData"),parentDataProperty:new e.Name("parentDataProperty"),rootData:new e.Name("rootData"),dynamicAnchors:new e.Name("dynamicAnchors"),vErrors:new e.Name("vErrors"),errors:new e.Name("errors"),this:new e.Name("this"),self:new e.Name("self"),scope:new e.Name("scope"),json:new e.Name("json"),jsonPos:new e.Name("jsonPos"),jsonLen:new e.Name("jsonLen"),jsonPart:new e.Name("jsonPart")};return Ag.default=t,Ag}var z2;function yw(){return z2||(z2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=Dt(),r=Jt(),n=wa();e.keywordError={message:({keyword:w})=>(0,t.str)`must pass "${w}" keyword validation`},e.keyword$DataError={message:({keyword:w,schemaType:_})=>_?(0,t.str)`"${w}" keyword must be ${_} ($data)`:(0,t.str)`"${w}" keyword is invalid ($data)`};function i(w,_=e.keywordError,S,C){const{it:k}=w,{gen:E,compositeRule:R,allErrors:T}=k,A=p(w,_,S);C??(R||T)?c(E,A):d(k,(0,t._)`[${A}]`)}e.reportError=i;function o(w,_=e.keywordError,S){const{it:C}=w,{gen:k,compositeRule:E,allErrors:R}=C,T=p(w,_,S);c(k,T),E||R||d(C,n.default.vErrors)}e.reportExtraError=o;function a(w,_){w.assign(n.default.errors,_),w.if((0,t._)`${n.default.vErrors} !== null`,()=>w.if(_,()=>w.assign((0,t._)`${n.default.vErrors}.length`,_),()=>w.assign(n.default.vErrors,null)))}e.resetErrorsCount=a;function l({gen:w,keyword:_,schemaValue:S,data:C,errsCount:k,it:E}){if(k===void 0)throw new Error("ajv implementation error");const R=w.name("err");w.forRange("i",k,n.default.errors,T=>{w.const(R,(0,t._)`${n.default.vErrors}[${T}]`),w.if((0,t._)`${R}.instancePath === undefined`,()=>w.assign((0,t._)`${R}.instancePath`,(0,t.strConcat)(n.default.instancePath,E.errorPath))),w.assign((0,t._)`${R}.schemaPath`,(0,t.str)`${E.errSchemaPath}/${_}`),E.opts.verbose&&(w.assign((0,t._)`${R}.schema`,S),w.assign((0,t._)`${R}.data`,C))})}e.extendErrors=l;function c(w,_){const S=w.const("err",_);w.if((0,t._)`${n.default.vErrors} === null`,()=>w.assign(n.default.vErrors,(0,t._)`[${S}]`),(0,t._)`${n.default.vErrors}.push(${S})`),w.code((0,t._)`${n.default.errors}++`)}function d(w,_){const{gen:S,validateName:C,schemaEnv:k}=w;k.$async?S.throw((0,t._)`new ${w.ValidationError}(${_})`):(S.assign((0,t._)`${C}.errors`,_),S.return(!1))}const f={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function p(w,_,S){const{createErrors:C}=w.it;return C===!1?(0,t._)`{}`:m(w,_,S)}function m(w,_,S={}){const{gen:C,it:k}=w,E=[g(k,S),b(w,S)];return y(w,_,E),C.object(...E)}function g({errorPath:w},{instancePath:_}){const S=_?(0,t.str)`${w}${(0,r.getErrorPath)(_,r.Type.Str)}`:w;return[n.default.instancePath,(0,t.strConcat)(n.default.instancePath,S)]}function b({keyword:w,it:{errSchemaPath:_}},{schemaPath:S,parentSchema:C}){let k=C?_:(0,t.str)`${_}/${w}`;return S&&(k=(0,t.str)`${k}${(0,r.getErrorPath)(S,r.Type.Str)}`),[f.schemaPath,k]}function y(w,{params:_,message:S},C){const{keyword:k,data:E,schemaValue:R,it:T}=w,{opts:A,propertyName:M,topSchemaRef:B,schemaPath:Q}=T;C.push([f.keyword,k],[f.params,typeof _=="function"?_(w):_||(0,t._)`{}`]),A.messages&&C.push([f.message,typeof S=="function"?S(w):S]),A.verbose&&C.push([f.schema,R],[f.parentSchema,(0,t._)`${B}${Q}`],[n.default.data,E]),M&&C.push([f.propertyName,M])}}(V_)),V_}var q2;function hwe(){if(q2)return Ru;q2=1,Object.defineProperty(Ru,"__esModule",{value:!0}),Ru.boolOrEmptySchema=Ru.topBoolOrEmptySchema=void 0;const e=yw(),t=Dt(),r=wa(),n={message:"boolean schema is false"};function i(l){const{gen:c,schema:d,validateName:f}=l;d===!1?a(l,!1):typeof d=="object"&&d.$async===!0?c.return(r.default.data):(c.assign((0,t._)`${f}.errors`,null),c.return(!0))}Ru.topBoolOrEmptySchema=i;function o(l,c){const{gen:d,schema:f}=l;f===!1?(d.var(c,!1),a(l)):d.var(c,!0)}Ru.boolOrEmptySchema=o;function a(l,c){const{gen:d,data:f}=l,p={gen:d,keyword:"false schema",data:f,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:l};(0,e.reportError)(p,n,void 0,c)}return Ru}var Gn={},Iu={},U2;function $3(){if(U2)return Iu;U2=1,Object.defineProperty(Iu,"__esModule",{value:!0}),Iu.getRules=Iu.isJSONType=void 0;const e=["string","number","integer","boolean","null","object","array"],t=new Set(e);function r(i){return typeof i=="string"&&t.has(i)}Iu.isJSONType=r;function n(){const i={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...i,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},i.number,i.string,i.array,i.object],post:{rules:[]},all:{},keywords:{}}}return Iu.getRules=n,Iu}var bs={},H2;function A3(){if(H2)return bs;H2=1,Object.defineProperty(bs,"__esModule",{value:!0}),bs.shouldUseRule=bs.shouldUseGroup=bs.schemaHasRulesForType=void 0;function e({schema:n,self:i},o){const a=i.RULES.types[o];return a&&a!==!0&&t(n,a)}bs.schemaHasRulesForType=e;function t(n,i){return i.rules.some(o=>r(n,o))}bs.shouldUseGroup=t;function r(n,i){var o;return n[i.keyword]!==void 0||((o=i.definition.implements)===null||o===void 0?void 0:o.some(a=>n[a]!==void 0))}return bs.shouldUseRule=r,bs}var W2;function n0(){if(W2)return Gn;W2=1,Object.defineProperty(Gn,"__esModule",{value:!0}),Gn.reportTypeError=Gn.checkDataTypes=Gn.checkDataType=Gn.coerceAndCheckDataType=Gn.getJSONTypes=Gn.getSchemaTypes=Gn.DataType=void 0;const e=$3(),t=A3(),r=yw(),n=Dt(),i=Jt();var o;(function(S){S[S.Correct=0]="Correct",S[S.Wrong=1]="Wrong"})(o||(Gn.DataType=o={}));function a(S){const C=l(S.type);if(C.includes("null")){if(S.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!C.length&&S.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');S.nullable===!0&&C.push("null")}return C}Gn.getSchemaTypes=a;function l(S){const C=Array.isArray(S)?S:S?[S]:[];if(C.every(e.isJSONType))return C;throw new Error("type must be JSONType or JSONType[]: "+C.join(","))}Gn.getJSONTypes=l;function c(S,C){const{gen:k,data:E,opts:R}=S,T=f(C,R.coerceTypes),A=C.length>0&&!(T.length===0&&C.length===1&&(0,t.schemaHasRulesForType)(S,C[0]));if(A){const M=b(C,E,R.strictNumbers,o.Wrong);k.if(M,()=>{T.length?p(S,C,T):w(S)})}return A}Gn.coerceAndCheckDataType=c;const d=new Set(["string","number","integer","boolean","null"]);function f(S,C){return C?S.filter(k=>d.has(k)||C==="array"&&k==="array"):[]}function p(S,C,k){const{gen:E,data:R,opts:T}=S,A=E.let("dataType",(0,n._)`typeof ${R}`),M=E.let("coerced",(0,n._)`undefined`);T.coerceTypes==="array"&&E.if((0,n._)`${A} == 'object' && Array.isArray(${R}) && ${R}.length == 1`,()=>E.assign(R,(0,n._)`${R}[0]`).assign(A,(0,n._)`typeof ${R}`).if(b(C,R,T.strictNumbers),()=>E.assign(M,R))),E.if((0,n._)`${M} !== undefined`);for(const Q of k)(d.has(Q)||Q==="array"&&T.coerceTypes==="array")&&B(Q);E.else(),w(S),E.endIf(),E.if((0,n._)`${M} !== undefined`,()=>{E.assign(R,M),m(S,M)});function B(Q){switch(Q){case"string":E.elseIf((0,n._)`${A} == "number" || ${A} == "boolean"`).assign(M,(0,n._)`"" + ${R}`).elseIf((0,n._)`${R} === null`).assign(M,(0,n._)`""`);return;case"number":E.elseIf((0,n._)`${A} == "boolean" || ${R} === null
|
1403
1403
|
|| (${A} == "string" && ${R} && ${R} == +${R})`).assign(M,(0,n._)`+${R}`);return;case"integer":E.elseIf((0,n._)`${A} === "boolean" || ${R} === null
|
1404
1404
|
|| (${A} === "string" && ${R} && ${R} == +${R} && !(${R} % 1))`).assign(M,(0,n._)`+${R}`);return;case"boolean":E.elseIf((0,n._)`${R} === "false" || ${R} === 0 || ${R} === null`).assign(M,!1).elseIf((0,n._)`${R} === "true" || ${R} === 1`).assign(M,!0);return;case"null":E.elseIf((0,n._)`${R} === "" || ${R} === 0 || ${R} === false`),E.assign(M,null);return;case"array":E.elseIf((0,n._)`${A} === "string" || ${A} === "number"
|
1405
|
-
|| ${A} === "boolean" || ${R} === null`).assign(M,(0,n._)`[${R}]`)}}}function m({gen:S,parentData:C,parentDataProperty:k},E){S.if((0,n._)`${C} !== undefined`,()=>S.assign((0,n._)`${C}[${k}]`,E))}function g(S,C,k,E=o.Correct){const R=E===o.Correct?n.operators.EQ:n.operators.NEQ;let T;switch(S){case"null":return(0,n._)`${C} ${R} null`;case"array":T=(0,n._)`Array.isArray(${C})`;break;case"object":T=(0,n._)`${C} && typeof ${C} == "object" && !Array.isArray(${C})`;break;case"integer":T=A((0,n._)`!(${C} % 1) && !isNaN(${C})`);break;case"number":T=A();break;default:return(0,n._)`typeof ${C} ${R} ${S}`}return E===o.Correct?T:(0,n.not)(T);function A(M=n.nil){return(0,n.and)((0,n._)`typeof ${C} == "number"`,M,k?(0,n._)`isFinite(${C})`:n.nil)}}Gn.checkDataType=g;function b(S,C,k,E){if(S.length===1)return g(S[0],C,k,E);let R;const T=(0,i.toHash)(S);if(T.array&&T.object){const A=(0,n._)`typeof ${C} != "object"`;R=T.null?A:(0,n._)`!${C} || ${A}`,delete T.null,delete T.array,delete T.object}else R=n.nil;T.number&&delete T.integer;for(const A in T)R=(0,n.and)(R,g(A,C,k,E));return R}Gn.checkDataTypes=b;const y={message:({schema:S})=>`must be ${S}`,params:({schema:S,schemaValue:C})=>typeof S=="string"?(0,n._)`{type: ${S}}`:(0,n._)`{type: ${C}}`};function w(S){const C=_(S);(0,r.reportError)(C,y)}Gn.reportTypeError=w;function _(S){const{gen:C,data:k,schema:E}=S,R=(0,i.schemaRefOrVal)(S,E,"type");return{gen:C,keyword:"type",data:k,schema:E.type,schemaCode:R,schemaValue:R,parentSchema:E,params:{},it:S}}return Gn}var zh={},KA;function pwe(){if(KA)return zh;KA=1,Object.defineProperty(zh,"__esModule",{value:!0}),zh.assignDefaults=void 0;const e=Dt(),t=Jt();function r(i,o){const{properties:a,items:l}=i.schema;if(o==="object"&&a)for(const c in a)n(i,c,a[c].default);else o==="array"&&Array.isArray(l)&&l.forEach((c,d)=>n(i,d,c.default))}zh.assignDefaults=r;function n(i,o,a){const{gen:l,compositeRule:c,data:d,opts:f}=i;if(a===void 0)return;const p=(0,e._)`${d}${(0,e.getProperty)(o)}`;if(c){(0,t.checkStrictMode)(i,`default is ignored for: ${p}`);return}let m=(0,e._)`${p} === undefined`;f.useDefaults==="empty"&&(m=(0,e._)`${m} || ${p} === null || ${p} === ""`),l.if(m,(0,e._)`${p} = ${(0,e.stringify)(a)}`)}return zh}var ia={},Pr={},GA;function Sa(){if(GA)return Pr;GA=1,Object.defineProperty(Pr,"__esModule",{value:!0}),Pr.validateUnion=Pr.validateArray=Pr.usePattern=Pr.callValidateCode=Pr.schemaProperties=Pr.allSchemaProperties=Pr.noPropertyInData=Pr.propertyInData=Pr.isOwnProperty=Pr.hasPropFunc=Pr.reportMissingProp=Pr.checkMissingProp=Pr.checkReportMissingProp=void 0;const e=Dt(),t=Jt(),r=wa(),n=Jt();function i(S,C){const{gen:k,data:E,it:R}=S;k.if(f(k,E,C,R.opts.ownProperties),()=>{S.setParams({missingProperty:(0,e._)`${C}`},!0),S.error()})}Pr.checkReportMissingProp=i;function o({gen:S,data:C,it:{opts:k}},E,R){return(0,e.or)(...E.map(T=>(0,e.and)(f(S,C,T,k.ownProperties),(0,e._)`${R} = ${T}`)))}Pr.checkMissingProp=o;function a(S,C){S.setParams({missingProperty:C},!0),S.error()}Pr.reportMissingProp=a;function l(S){return S.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,e._)`Object.prototype.hasOwnProperty`})}Pr.hasPropFunc=l;function c(S,C,k){return(0,e._)`${l(S)}.call(${C}, ${k})`}Pr.isOwnProperty=c;function d(S,C,k,E){const R=(0,e._)`${C}${(0,e.getProperty)(k)} !== undefined`;return E?(0,e._)`${R} && ${c(S,C,k)}`:R}Pr.propertyInData=d;function f(S,C,k,E){const R=(0,e._)`${C}${(0,e.getProperty)(k)} === undefined`;return E?(0,e.or)(R,(0,e.not)(c(S,C,k))):R}Pr.noPropertyInData=f;function p(S){return S?Object.keys(S).filter(C=>C!=="__proto__"):[]}Pr.allSchemaProperties=p;function m(S,C){return p(C).filter(k=>!(0,t.alwaysValidSchema)(S,C[k]))}Pr.schemaProperties=m;function g({schemaCode:S,data:C,it:{gen:k,topSchemaRef:E,schemaPath:R,errorPath:T},it:A},M,B,Q){const se=Q?(0,e._)`${S}, ${C}, ${E}${R}`:C,ie=[[r.default.instancePath,(0,e.strConcat)(r.default.instancePath,T)],[r.default.parentData,A.parentData],[r.default.parentDataProperty,A.parentDataProperty],[r.default.rootData,r.default.rootData]];A.opts.dynamicRef&&ie.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);const N=(0,e._)`${se}, ${k.object(...ie)}`;return B!==e.nil?(0,e._)`${M}.call(${B}, ${N})`:(0,e._)`${M}(${N})`}Pr.callValidateCode=g;const b=(0,e._)`new RegExp`;function y({gen:S,it:{opts:C}},k){const E=C.unicodeRegExp?"u":"",{regExp:R}=C.code,T=R(k,E);return S.scopeValue("pattern",{key:T.toString(),ref:T,code:(0,e._)`${R.code==="new RegExp"?b:(0,n.useFunc)(S,R)}(${k}, ${E})`})}Pr.usePattern=y;function w(S){const{gen:C,data:k,keyword:E,it:R}=S,T=C.name("valid");if(R.allErrors){const M=C.let("valid",!0);return A(()=>C.assign(M,!1)),M}return C.var(T,!0),A(()=>C.break()),T;function A(M){const B=C.const("len",(0,e._)`${k}.length`);C.forRange("i",0,B,Q=>{S.subschema({keyword:E,dataProp:Q,dataPropType:t.Type.Num},T),C.if((0,e.not)(T),M)})}}Pr.validateArray=w;function _(S){const{gen:C,schema:k,keyword:E,it:R}=S;if(!Array.isArray(k))throw new Error("ajv implementation error");if(k.some(B=>(0,t.alwaysValidSchema)(R,B))&&!R.opts.unevaluated)return;const A=C.let("valid",!1),M=C.name("_valid");C.block(()=>k.forEach((B,Q)=>{const se=S.subschema({keyword:E,schemaProp:Q,compositeRule:!0},M);C.assign(A,(0,e._)`${A} || ${M}`),S.mergeValidEvaluated(se,M)||C.if((0,e.not)(A))})),S.result(A,()=>S.reset(),()=>S.error(!0))}return Pr.validateUnion=_,Pr}var QA;function mwe(){if(QA)return ia;QA=1,Object.defineProperty(ia,"__esModule",{value:!0}),ia.validateKeywordUsage=ia.validSchemaType=ia.funcKeywordCode=ia.macroKeywordCode=void 0;const e=Dt(),t=wa(),r=Sa(),n=yw();function i(m,g){const{gen:b,keyword:y,schema:w,parentSchema:_,it:S}=m,C=g.macro.call(S.self,w,_,S),k=d(b,y,C);S.opts.validateSchema!==!1&&S.self.validateSchema(C,!0);const E=b.name("valid");m.subschema({schema:C,schemaPath:e.nil,errSchemaPath:`${S.errSchemaPath}/${y}`,topSchemaRef:k,compositeRule:!0},E),m.pass(E,()=>m.error(!0))}ia.macroKeywordCode=i;function o(m,g){var b;const{gen:y,keyword:w,schema:_,parentSchema:S,$data:C,it:k}=m;c(k,g);const E=!C&&g.compile?g.compile.call(k.self,_,S,k):g.validate,R=d(y,w,E),T=y.let("valid");m.block$data(T,A),m.ok((b=g.valid)!==null&&b!==void 0?b:T);function A(){if(g.errors===!1)Q(),g.modifying&&a(m),se(()=>m.error());else{const ie=g.async?M():B();g.modifying&&a(m),se(()=>l(m,ie))}}function M(){const ie=y.let("ruleErrs",null);return y.try(()=>Q((0,e._)`await `),N=>y.assign(T,!1).if((0,e._)`${N} instanceof ${k.ValidationError}`,()=>y.assign(ie,(0,e._)`${N}.errors`),()=>y.throw(N))),ie}function B(){const ie=(0,e._)`${R}.errors`;return y.assign(ie,null),Q(e.nil),ie}function Q(ie=g.async?(0,e._)`await `:e.nil){const N=k.opts.passContext?t.default.this:t.default.self,X=!("compile"in g&&!C||g.schema===!1);y.assign(T,(0,e._)`${ie}${(0,r.callValidateCode)(m,R,N,X)}`,g.modifying)}function se(ie){var N;y.if((0,e.not)((N=g.valid)!==null&&N!==void 0?N:T),ie)}}ia.funcKeywordCode=o;function a(m){const{gen:g,data:b,it:y}=m;g.if(y.parentData,()=>g.assign(b,(0,e._)`${y.parentData}[${y.parentDataProperty}]`))}function l(m,g){const{gen:b}=m;b.if((0,e._)`Array.isArray(${g})`,()=>{b.assign(t.default.vErrors,(0,e._)`${t.default.vErrors} === null ? ${g} : ${t.default.vErrors}.concat(${g})`).assign(t.default.errors,(0,e._)`${t.default.vErrors}.length`),(0,n.extendErrors)(m)},()=>m.error())}function c({schemaEnv:m},g){if(g.async&&!m.$async)throw new Error("async keyword in sync schema")}function d(m,g,b){if(b===void 0)throw new Error(`keyword "${g}" failed to compile`);return m.scopeValue("keyword",typeof b=="function"?{ref:b}:{ref:b,code:(0,e.stringify)(b)})}function f(m,g,b=!1){return!g.length||g.some(y=>y==="array"?Array.isArray(m):y==="object"?m&&typeof m=="object"&&!Array.isArray(m):typeof m==y||b&&typeof m>"u")}ia.validSchemaType=f;function p({schema:m,opts:g,self:b,errSchemaPath:y},w,_){if(Array.isArray(w.keyword)?!w.keyword.includes(_):w.keyword!==_)throw new Error("ajv implementation error");const S=w.dependencies;if(S!=null&&S.some(C=>!Object.prototype.hasOwnProperty.call(m,C)))throw new Error(`parent schema must have dependencies of ${_}: ${S.join(",")}`);if(w.validateSchema&&!w.validateSchema(m[_])){const k=`keyword "${_}" value is invalid at path "${y}": `+b.errorsText(w.validateSchema.errors);if(g.validateSchema==="log")b.logger.error(k);else throw new Error(k)}}return ia.validateKeywordUsage=p,ia}var ws={},YA;function vwe(){if(YA)return ws;YA=1,Object.defineProperty(ws,"__esModule",{value:!0}),ws.extendSubschemaMode=ws.extendSubschemaData=ws.getSubschema=void 0;const e=Dt(),t=Jt();function r(o,{keyword:a,schemaProp:l,schema:c,schemaPath:d,errSchemaPath:f,topSchemaRef:p}){if(a!==void 0&&c!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(a!==void 0){const m=o.schema[a];return l===void 0?{schema:m,schemaPath:(0,e._)`${o.schemaPath}${(0,e.getProperty)(a)}`,errSchemaPath:`${o.errSchemaPath}/${a}`}:{schema:m[l],schemaPath:(0,e._)`${o.schemaPath}${(0,e.getProperty)(a)}${(0,e.getProperty)(l)}`,errSchemaPath:`${o.errSchemaPath}/${a}/${(0,t.escapeFragment)(l)}`}}if(c!==void 0){if(d===void 0||f===void 0||p===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:c,schemaPath:d,topSchemaRef:p,errSchemaPath:f}}throw new Error('either "keyword" or "schema" must be passed')}ws.getSubschema=r;function n(o,a,{dataProp:l,dataPropType:c,data:d,dataTypes:f,propertyName:p}){if(d!==void 0&&l!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:m}=a;if(l!==void 0){const{errorPath:b,dataPathArr:y,opts:w}=a,_=m.let("data",(0,e._)`${a.data}${(0,e.getProperty)(l)}`,!0);g(_),o.errorPath=(0,e.str)`${b}${(0,t.getErrorPath)(l,c,w.jsPropertySyntax)}`,o.parentDataProperty=(0,e._)`${l}`,o.dataPathArr=[...y,o.parentDataProperty]}if(d!==void 0){const b=d instanceof e.Name?d:m.let("data",d,!0);g(b),p!==void 0&&(o.propertyName=p)}f&&(o.dataTypes=f);function g(b){o.data=b,o.dataLevel=a.dataLevel+1,o.dataTypes=[],a.definedProperties=new Set,o.parentData=a.data,o.dataNames=[...a.dataNames,b]}}ws.extendSubschemaData=n;function i(o,{jtdDiscriminator:a,jtdMetadata:l,compositeRule:c,createErrors:d,allErrors:f}){c!==void 0&&(o.compositeRule=c),d!==void 0&&(o.createErrors=d),f!==void 0&&(o.allErrors=f),o.jtdDiscriminator=a,o.jtdMetadata=l}return ws.extendSubschemaMode=i,ws}var wi={},H_,XA;function D3(){return XA||(XA=1,H_=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,i,o;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!e(t[i],r[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(o=Object.keys(t),n=o.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;i--!==0;){var a=o[i];if(!e(t[a],r[a]))return!1}return!0}return t!==t&&r!==r}),H_}var W_={exports:{}},JA;function gwe(){if(JA)return W_.exports;JA=1;var e=W_.exports=function(n,i,o){typeof i=="function"&&(o=i,i={}),o=i.cb||o;var a=typeof o=="function"?o:o.pre||function(){},l=o.post||function(){};t(i,a,l,n,"",n)};e.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},e.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},e.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},e.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function t(n,i,o,a,l,c,d,f,p,m){if(a&&typeof a=="object"&&!Array.isArray(a)){i(a,l,c,d,f,p,m);for(var g in a){var b=a[g];if(Array.isArray(b)){if(g in e.arrayKeywords)for(var y=0;y<b.length;y++)t(n,i,o,b[y],l+"/"+g+"/"+y,c,l,g,a,y)}else if(g in e.propsKeywords){if(b&&typeof b=="object")for(var w in b)t(n,i,o,b[w],l+"/"+g+"/"+r(w),c,l,g,a,w)}else(g in e.keywords||n.allKeys&&!(g in e.skipKeywords))&&t(n,i,o,b,l+"/"+g,c,l,g,a)}o(a,l,c,d,f,p,m)}}function r(n){return n.replace(/~/g,"~0").replace(/\//g,"~1")}return W_.exports}var ZA;function bw(){if(ZA)return wi;ZA=1,Object.defineProperty(wi,"__esModule",{value:!0}),wi.getSchemaRefs=wi.resolveUrl=wi.normalizeId=wi._getFullPath=wi.getFullPath=wi.inlineRef=void 0;const e=Jt(),t=D3(),r=gwe(),n=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function i(y,w=!0){return typeof y=="boolean"?!0:w===!0?!a(y):w?l(y)<=w:!1}wi.inlineRef=i;const o=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function a(y){for(const w in y){if(o.has(w))return!0;const _=y[w];if(Array.isArray(_)&&_.some(a)||typeof _=="object"&&a(_))return!0}return!1}function l(y){let w=0;for(const _ in y){if(_==="$ref")return 1/0;if(w++,!n.has(_)&&(typeof y[_]=="object"&&(0,e.eachItem)(y[_],S=>w+=l(S)),w===1/0))return 1/0}return w}function c(y,w="",_){_!==!1&&(w=p(w));const S=y.parse(w);return d(y,S)}wi.getFullPath=c;function d(y,w){return y.serialize(w).split("#")[0]+"#"}wi._getFullPath=d;const f=/#\/?$/;function p(y){return y?y.replace(f,""):""}wi.normalizeId=p;function m(y,w,_){return _=p(_),y.resolve(w,_)}wi.resolveUrl=m;const g=/^[a-z_][-a-z0-9._]*$/i;function b(y,w){if(typeof y=="boolean")return{};const{schemaId:_,uriResolver:S}=this.opts,C=p(y[_]||w),k={"":C},E=c(S,C,!1),R={},T=new Set;return r(y,{allKeys:!0},(B,Q,se,ie)=>{if(ie===void 0)return;const N=E+Q;let X=k[ie];typeof B[_]=="string"&&(X=ce.call(this,B[_])),ne.call(this,B.$anchor),ne.call(this,B.$dynamicAnchor),k[Q]=X;function ce(ee){const ge=this.opts.uriResolver.resolve;if(ee=p(X?ge(X,ee):ee),T.has(ee))throw M(ee);T.add(ee);let Z=this.refs[ee];return typeof Z=="string"&&(Z=this.refs[Z]),typeof Z=="object"?A(B,Z.schema,ee):ee!==p(N)&&(ee[0]==="#"?(A(B,R[ee],ee),R[ee]=B):this.refs[ee]=N),ee}function ne(ee){if(typeof ee=="string"){if(!g.test(ee))throw new Error(`invalid anchor "${ee}"`);ce.call(this,`#${ee}`)}}}),R;function A(B,Q,se){if(Q!==void 0&&!t(B,Q))throw M(se)}function M(B){return new Error(`reference "${B}" resolves to more than one schema`)}}return wi.getSchemaRefs=b,wi}var eD;function ww(){if(eD)return ys;eD=1,Object.defineProperty(ys,"__esModule",{value:!0}),ys.getData=ys.KeywordCxt=ys.validateFunctionCode=void 0;const e=hwe(),t=n0(),r=A3(),n=n0(),i=pwe(),o=mwe(),a=vwe(),l=Dt(),c=wa(),d=bw(),f=Jt(),p=yw();function m(Y){if(E(Y)&&(T(Y),k(Y))){w(Y);return}g(Y,()=>(0,e.topBoolOrEmptySchema)(Y))}ys.validateFunctionCode=m;function g({gen:Y,validateName:K,schema:we,schemaEnv:Te,opts:he},Ce){he.code.es5?Y.func(K,(0,l._)`${c.default.data}, ${c.default.valCxt}`,Te.$async,()=>{Y.code((0,l._)`"use strict"; ${S(we,he)}`),y(Y,he),Y.code(Ce)}):Y.func(K,(0,l._)`${c.default.data}, ${b(he)}`,Te.$async,()=>Y.code(S(we,he)).code(Ce))}function b(Y){return(0,l._)`{${c.default.instancePath}="", ${c.default.parentData}, ${c.default.parentDataProperty}, ${c.default.rootData}=${c.default.data}${Y.dynamicRef?(0,l._)`, ${c.default.dynamicAnchors}={}`:l.nil}}={}`}function y(Y,K){Y.if(c.default.valCxt,()=>{Y.var(c.default.instancePath,(0,l._)`${c.default.valCxt}.${c.default.instancePath}`),Y.var(c.default.parentData,(0,l._)`${c.default.valCxt}.${c.default.parentData}`),Y.var(c.default.parentDataProperty,(0,l._)`${c.default.valCxt}.${c.default.parentDataProperty}`),Y.var(c.default.rootData,(0,l._)`${c.default.valCxt}.${c.default.rootData}`),K.dynamicRef&&Y.var(c.default.dynamicAnchors,(0,l._)`${c.default.valCxt}.${c.default.dynamicAnchors}`)},()=>{Y.var(c.default.instancePath,(0,l._)`""`),Y.var(c.default.parentData,(0,l._)`undefined`),Y.var(c.default.parentDataProperty,(0,l._)`undefined`),Y.var(c.default.rootData,c.default.data),K.dynamicRef&&Y.var(c.default.dynamicAnchors,(0,l._)`{}`)})}function w(Y){const{schema:K,opts:we,gen:Te}=Y;g(Y,()=>{we.$comment&&K.$comment&&ie(Y),B(Y),Te.let(c.default.vErrors,null),Te.let(c.default.errors,0),we.unevaluated&&_(Y),A(Y),N(Y)})}function _(Y){const{gen:K,validateName:we}=Y;Y.evaluated=K.const("evaluated",(0,l._)`${we}.evaluated`),K.if((0,l._)`${Y.evaluated}.dynamicProps`,()=>K.assign((0,l._)`${Y.evaluated}.props`,(0,l._)`undefined`)),K.if((0,l._)`${Y.evaluated}.dynamicItems`,()=>K.assign((0,l._)`${Y.evaluated}.items`,(0,l._)`undefined`))}function S(Y,K){const we=typeof Y=="object"&&Y[K.schemaId];return we&&(K.code.source||K.code.process)?(0,l._)`/*# sourceURL=${we} */`:l.nil}function C(Y,K){if(E(Y)&&(T(Y),k(Y))){R(Y,K);return}(0,e.boolOrEmptySchema)(Y,K)}function k({schema:Y,self:K}){if(typeof Y=="boolean")return!Y;for(const we in Y)if(K.RULES.all[we])return!0;return!1}function E(Y){return typeof Y.schema!="boolean"}function R(Y,K){const{schema:we,gen:Te,opts:he}=Y;he.$comment&&we.$comment&&ie(Y),Q(Y),se(Y);const Ce=Te.const("_errs",c.default.errors);A(Y,Ce),Te.var(K,(0,l._)`${Ce} === ${c.default.errors}`)}function T(Y){(0,f.checkUnknownRules)(Y),M(Y)}function A(Y,K){if(Y.opts.jtd)return ce(Y,[],!1,K);const we=(0,t.getSchemaTypes)(Y.schema),Te=(0,t.coerceAndCheckDataType)(Y,we);ce(Y,we,!Te,K)}function M(Y){const{schema:K,errSchemaPath:we,opts:Te,self:he}=Y;K.$ref&&Te.ignoreKeywordsWithRef&&(0,f.schemaHasRulesButRef)(K,he.RULES)&&he.logger.warn(`$ref: keywords ignored in schema at path "${we}"`)}function B(Y){const{schema:K,opts:we}=Y;K.default!==void 0&&we.useDefaults&&we.strictSchema&&(0,f.checkStrictMode)(Y,"default is ignored in the schema root")}function Q(Y){const K=Y.schema[Y.opts.schemaId];K&&(Y.baseId=(0,d.resolveUrl)(Y.opts.uriResolver,Y.baseId,K))}function se(Y){if(Y.schema.$async&&!Y.schemaEnv.$async)throw new Error("async schema in sync schema")}function ie({gen:Y,schemaEnv:K,schema:we,errSchemaPath:Te,opts:he}){const Ce=we.$comment;if(he.$comment===!0)Y.code((0,l._)`${c.default.self}.logger.log(${Ce})`);else if(typeof he.$comment=="function"){const Ge=(0,l.str)`${Te}/$comment`,$t=Y.scopeValue("root",{ref:K.root});Y.code((0,l._)`${c.default.self}.opts.$comment(${Ce}, ${Ge}, ${$t}.schema)`)}}function N(Y){const{gen:K,schemaEnv:we,validateName:Te,ValidationError:he,opts:Ce}=Y;we.$async?K.if((0,l._)`${c.default.errors} === 0`,()=>K.return(c.default.data),()=>K.throw((0,l._)`new ${he}(${c.default.vErrors})`)):(K.assign((0,l._)`${Te}.errors`,c.default.vErrors),Ce.unevaluated&&X(Y),K.return((0,l._)`${c.default.errors} === 0`))}function X({gen:Y,evaluated:K,props:we,items:Te}){we instanceof l.Name&&Y.assign((0,l._)`${K}.props`,we),Te instanceof l.Name&&Y.assign((0,l._)`${K}.items`,Te)}function ce(Y,K,we,Te){const{gen:he,schema:Ce,data:Ge,allErrors:$t,opts:Kt,self:It}=Y,{RULES:jt}=It;if(Ce.$ref&&(Kt.ignoreKeywordsWithRef||!(0,f.schemaHasRulesButRef)(Ce,jt))){he.block(()=>de(Y,"$ref",jt.all.$ref.definition));return}Kt.jtd||ee(Y,K),he.block(()=>{for(const ht of jt.rules)Lt(ht);Lt(jt.post)});function Lt(ht){(0,r.shouldUseGroup)(Ce,ht)&&(ht.type?(he.if((0,n.checkDataType)(ht.type,Ge,Kt.strictNumbers)),ne(Y,ht),K.length===1&&K[0]===ht.type&&we&&(he.else(),(0,n.reportTypeError)(Y)),he.endIf()):ne(Y,ht),$t||he.if((0,l._)`${c.default.errors} === ${Te||0}`))}}function ne(Y,K){const{gen:we,schema:Te,opts:{useDefaults:he}}=Y;he&&(0,i.assignDefaults)(Y,K.type),we.block(()=>{for(const Ce of K.rules)(0,r.shouldUseRule)(Te,Ce)&&de(Y,Ce.keyword,Ce.definition,K.type)})}function ee(Y,K){Y.schemaEnv.meta||!Y.opts.strictTypes||(ge(Y,K),Y.opts.allowUnionTypes||Z(Y,K),j(Y,Y.dataTypes))}function ge(Y,K){if(K.length){if(!Y.dataTypes.length){Y.dataTypes=K;return}K.forEach(we=>{q(Y.dataTypes,we)||F(Y,`type "${we}" not allowed by context "${Y.dataTypes.join(",")}"`)}),$(Y,K)}}function Z(Y,K){K.length>1&&!(K.length===2&&K.includes("null"))&&F(Y,"use allowUnionTypes to allow union type keyword")}function j(Y,K){const we=Y.self.RULES.all;for(const Te in we){const he=we[Te];if(typeof he=="object"&&(0,r.shouldUseRule)(Y.schema,he)){const{type:Ce}=he.definition;Ce.length&&!Ce.some(Ge=>U(K,Ge))&&F(Y,`missing type "${Ce.join(",")}" for keyword "${Te}"`)}}}function U(Y,K){return Y.includes(K)||K==="number"&&Y.includes("integer")}function q(Y,K){return Y.includes(K)||K==="integer"&&Y.includes("number")}function $(Y,K){const we=[];for(const Te of Y.dataTypes)q(K,Te)?we.push(Te):K.includes("integer")&&Te==="number"&&we.push("integer");Y.dataTypes=we}function F(Y,K){const we=Y.schemaEnv.baseId+Y.errSchemaPath;K+=` at "${we}" (strictTypes)`,(0,f.checkStrictMode)(Y,K,Y.opts.strictTypes)}class V{constructor(K,we,Te){if((0,o.validateKeywordUsage)(K,we,Te),this.gen=K.gen,this.allErrors=K.allErrors,this.keyword=Te,this.data=K.data,this.schema=K.schema[Te],this.$data=we.$data&&K.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,f.schemaRefOrVal)(K,this.schema,Te,this.$data),this.schemaType=we.schemaType,this.parentSchema=K.schema,this.params={},this.it=K,this.def=we,this.$data)this.schemaCode=K.gen.const("vSchema",Me(this.$data,K));else if(this.schemaCode=this.schemaValue,!(0,o.validSchemaType)(this.schema,we.schemaType,we.allowUndefined))throw new Error(`${Te} value must be ${JSON.stringify(we.schemaType)}`);("code"in we?we.trackErrors:we.errors!==!1)&&(this.errsCount=K.gen.const("_errs",c.default.errors))}result(K,we,Te){this.failResult((0,l.not)(K),we,Te)}failResult(K,we,Te){this.gen.if(K),Te?Te():this.error(),we?(this.gen.else(),we(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(K,we){this.failResult((0,l.not)(K),void 0,we)}fail(K){if(K===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(K),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(K){if(!this.$data)return this.fail(K);const{schemaCode:we}=this;this.fail((0,l._)`${we} !== undefined && (${(0,l.or)(this.invalid$data(),K)})`)}error(K,we,Te){if(we){this.setParams(we),this._error(K,Te),this.setParams({});return}this._error(K,Te)}_error(K,we){(K?p.reportExtraError:p.reportError)(this,this.def.error,we)}$dataError(){(0,p.reportError)(this,this.def.$dataError||p.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,p.resetErrorsCount)(this.gen,this.errsCount)}ok(K){this.allErrors||this.gen.if(K)}setParams(K,we){we?Object.assign(this.params,K):this.params=K}block$data(K,we,Te=l.nil){this.gen.block(()=>{this.check$data(K,Te),we()})}check$data(K=l.nil,we=l.nil){if(!this.$data)return;const{gen:Te,schemaCode:he,schemaType:Ce,def:Ge}=this;Te.if((0,l.or)((0,l._)`${he} === undefined`,we)),K!==l.nil&&Te.assign(K,!0),(Ce.length||Ge.validateSchema)&&(Te.elseIf(this.invalid$data()),this.$dataError(),K!==l.nil&&Te.assign(K,!1)),Te.else()}invalid$data(){const{gen:K,schemaCode:we,schemaType:Te,def:he,it:Ce}=this;return(0,l.or)(Ge(),$t());function Ge(){if(Te.length){if(!(we instanceof l.Name))throw new Error("ajv implementation error");const Kt=Array.isArray(Te)?Te:[Te];return(0,l._)`${(0,n.checkDataTypes)(Kt,we,Ce.opts.strictNumbers,n.DataType.Wrong)}`}return l.nil}function $t(){if(he.validateSchema){const Kt=K.scopeValue("validate$data",{ref:he.validateSchema});return(0,l._)`!${Kt}(${we})`}return l.nil}}subschema(K,we){const Te=(0,a.getSubschema)(this.it,K);(0,a.extendSubschemaData)(Te,this.it,K),(0,a.extendSubschemaMode)(Te,K);const he={...this.it,...Te,items:void 0,props:void 0};return C(he,we),he}mergeEvaluated(K,we){const{it:Te,gen:he}=this;Te.opts.unevaluated&&(Te.props!==!0&&K.props!==void 0&&(Te.props=f.mergeEvaluated.props(he,K.props,Te.props,we)),Te.items!==!0&&K.items!==void 0&&(Te.items=f.mergeEvaluated.items(he,K.items,Te.items,we)))}mergeValidEvaluated(K,we){const{it:Te,gen:he}=this;if(Te.opts.unevaluated&&(Te.props!==!0||Te.items!==!0))return he.if(we,()=>this.mergeEvaluated(K,l.Name)),!0}}ys.KeywordCxt=V;function de(Y,K,we,Te){const he=new V(Y,we,K);"code"in we?we.code(he,Te):he.$data&&we.validate?(0,o.funcKeywordCode)(he,we):"macro"in we?(0,o.macroKeywordCode)(he,we):(we.compile||we.validate)&&(0,o.funcKeywordCode)(he,we)}const pe=/^\/(?:[^~]|~0|~1)*$/,Ee=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Me(Y,{dataLevel:K,dataNames:we,dataPathArr:Te}){let he,Ce;if(Y==="")return c.default.rootData;if(Y[0]==="/"){if(!pe.test(Y))throw new Error(`Invalid JSON-pointer: ${Y}`);he=Y,Ce=c.default.rootData}else{const It=Ee.exec(Y);if(!It)throw new Error(`Invalid JSON-pointer: ${Y}`);const jt=+It[1];if(he=It[2],he==="#"){if(jt>=K)throw new Error(Kt("property/index",jt));return Te[K-jt]}if(jt>K)throw new Error(Kt("data",jt));if(Ce=we[K-jt],!he)return Ce}let Ge=Ce;const $t=he.split("/");for(const It of $t)It&&(Ce=(0,l._)`${Ce}${(0,l.getProperty)((0,f.unescapeJsonPointer)(It))}`,Ge=(0,l._)`${Ge} && ${Ce}`);return Ge;function Kt(It,jt){return`Cannot access ${It} ${jt} levels up, current level is ${K}`}}return ys.getData=Me,ys}var Dg={},tD;function xT(){if(tD)return Dg;tD=1,Object.defineProperty(Dg,"__esModule",{value:!0});class e extends Error{constructor(r){super("validation failed"),this.errors=r,this.ajv=this.validation=!0}}return Dg.default=e,Dg}var Mg={},rD;function Sw(){if(rD)return Mg;rD=1,Object.defineProperty(Mg,"__esModule",{value:!0});const e=bw();class t extends Error{constructor(n,i,o,a){super(a||`can't resolve reference ${o} from id ${i}`),this.missingRef=(0,e.resolveUrl)(n,i,o),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(n,this.missingRef))}}return Mg.default=t,Mg}var ro={},nD;function _w(){if(nD)return ro;nD=1,Object.defineProperty(ro,"__esModule",{value:!0}),ro.resolveSchema=ro.getCompilingSchema=ro.resolveRef=ro.compileSchema=ro.SchemaEnv=void 0;const e=Dt(),t=xT(),r=wa(),n=bw(),i=Jt(),o=ww();class a{constructor(_){var S;this.refs={},this.dynamicAnchors={};let C;typeof _.schema=="object"&&(C=_.schema),this.schema=_.schema,this.schemaId=_.schemaId,this.root=_.root||this,this.baseId=(S=_.baseId)!==null&&S!==void 0?S:(0,n.normalizeId)(C==null?void 0:C[_.schemaId||"$id"]),this.schemaPath=_.schemaPath,this.localRefs=_.localRefs,this.meta=_.meta,this.$async=C==null?void 0:C.$async,this.refs={}}}ro.SchemaEnv=a;function l(w){const _=f.call(this,w);if(_)return _;const S=(0,n.getFullPath)(this.opts.uriResolver,w.root.baseId),{es5:C,lines:k}=this.opts.code,{ownProperties:E}=this.opts,R=new e.CodeGen(this.scope,{es5:C,lines:k,ownProperties:E});let T;w.$async&&(T=R.scopeValue("Error",{ref:t.default,code:(0,e._)`require("ajv/dist/runtime/validation_error").default`}));const A=R.scopeName("validate");w.validateName=A;const M={gen:R,allErrors:this.opts.allErrors,data:r.default.data,parentData:r.default.parentData,parentDataProperty:r.default.parentDataProperty,dataNames:[r.default.data],dataPathArr:[e.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:R.scopeValue("schema",this.opts.code.source===!0?{ref:w.schema,code:(0,e.stringify)(w.schema)}:{ref:w.schema}),validateName:A,ValidationError:T,schema:w.schema,schemaEnv:w,rootId:S,baseId:w.baseId||S,schemaPath:e.nil,errSchemaPath:w.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,e._)`""`,opts:this.opts,self:this};let B;try{this._compilations.add(w),(0,o.validateFunctionCode)(M),R.optimize(this.opts.code.optimize);const Q=R.toString();B=`${R.scopeRefs(r.default.scope)}return ${Q}`,this.opts.code.process&&(B=this.opts.code.process(B,w));const ie=new Function(`${r.default.self}`,`${r.default.scope}`,B)(this,this.scope.get());if(this.scope.value(A,{ref:ie}),ie.errors=null,ie.schema=w.schema,ie.schemaEnv=w,w.$async&&(ie.$async=!0),this.opts.code.source===!0&&(ie.source={validateName:A,validateCode:Q,scopeValues:R._values}),this.opts.unevaluated){const{props:N,items:X}=M;ie.evaluated={props:N instanceof e.Name?void 0:N,items:X instanceof e.Name?void 0:X,dynamicProps:N instanceof e.Name,dynamicItems:X instanceof e.Name},ie.source&&(ie.source.evaluated=(0,e.stringify)(ie.evaluated))}return w.validate=ie,w}catch(Q){throw delete w.validate,delete w.validateName,B&&this.logger.error("Error compiling schema, function code:",B),Q}finally{this._compilations.delete(w)}}ro.compileSchema=l;function c(w,_,S){var C;S=(0,n.resolveUrl)(this.opts.uriResolver,_,S);const k=w.refs[S];if(k)return k;let E=m.call(this,w,S);if(E===void 0){const R=(C=w.localRefs)===null||C===void 0?void 0:C[S],{schemaId:T}=this.opts;R&&(E=new a({schema:R,schemaId:T,root:w,baseId:_}))}if(E!==void 0)return w.refs[S]=d.call(this,E)}ro.resolveRef=c;function d(w){return(0,n.inlineRef)(w.schema,this.opts.inlineRefs)?w.schema:w.validate?w:l.call(this,w)}function f(w){for(const _ of this._compilations)if(p(_,w))return _}ro.getCompilingSchema=f;function p(w,_){return w.schema===_.schema&&w.root===_.root&&w.baseId===_.baseId}function m(w,_){let S;for(;typeof(S=this.refs[_])=="string";)_=S;return S||this.schemas[_]||g.call(this,w,_)}function g(w,_){const S=this.opts.uriResolver.parse(_),C=(0,n._getFullPath)(this.opts.uriResolver,S);let k=(0,n.getFullPath)(this.opts.uriResolver,w.baseId,void 0);if(Object.keys(w.schema).length>0&&C===k)return y.call(this,S,w);const E=(0,n.normalizeId)(C),R=this.refs[E]||this.schemas[E];if(typeof R=="string"){const T=g.call(this,w,R);return typeof(T==null?void 0:T.schema)!="object"?void 0:y.call(this,S,T)}if(typeof(R==null?void 0:R.schema)=="object"){if(R.validate||l.call(this,R),E===(0,n.normalizeId)(_)){const{schema:T}=R,{schemaId:A}=this.opts,M=T[A];return M&&(k=(0,n.resolveUrl)(this.opts.uriResolver,k,M)),new a({schema:T,schemaId:A,root:w,baseId:k})}return y.call(this,S,R)}}ro.resolveSchema=g;const b=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function y(w,{baseId:_,schema:S,root:C}){var k;if(((k=w.fragment)===null||k===void 0?void 0:k[0])!=="/")return;for(const T of w.fragment.slice(1).split("/")){if(typeof S=="boolean")return;const A=S[(0,i.unescapeFragment)(T)];if(A===void 0)return;S=A;const M=typeof S=="object"&&S[this.opts.schemaId];!b.has(T)&&M&&(_=(0,n.resolveUrl)(this.opts.uriResolver,_,M))}let E;if(typeof S!="boolean"&&S.$ref&&!(0,i.schemaHasRulesButRef)(S,this.RULES)){const T=(0,n.resolveUrl)(this.opts.uriResolver,_,S.$ref);E=g.call(this,C,T)}const{schemaId:R}=this.opts;if(E=E||new a({schema:S,schemaId:R,root:C,baseId:_}),E.schema!==E.root.schema)return E}return ro}const ywe="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",bwe="Meta-schema for $data reference (JSON AnySchema extension proposal)",wwe="object",Swe=["$data"],_we={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},xwe=!1,Pwe={$id:ywe,description:bwe,type:wwe,required:Swe,properties:_we,additionalProperties:xwe};var Ng={},ep={exports:{}};/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */var Cwe=ep.exports,iD;function Ewe(){return iD||(iD=1,function(e,t){(function(r,n){n(t)})(Cwe,function(r){function n(){for(var H=arguments.length,L=Array(H),G=0;G<H;G++)L[G]=arguments[G];if(L.length>1){L[0]=L[0].slice(0,-1);for(var te=L.length-1,ue=1;ue<te;++ue)L[ue]=L[ue].slice(1,-1);return L[te]=L[te].slice(1),L.join("")}else return L[0]}function i(H){return"(?:"+H+")"}function o(H){return H===void 0?"undefined":H===null?"null":Object.prototype.toString.call(H).split(" ").pop().split("]").shift().toLowerCase()}function a(H){return H.toUpperCase()}function l(H){return H!=null?H instanceof Array?H:typeof H.length!="number"||H.split||H.setInterval||H.call?[H]:Array.prototype.slice.call(H):[]}function c(H,L){var G=H;if(L)for(var te in L)G[te]=L[te];return G}function d(H){var L="[A-Za-z]",G="[0-9]",te=n(G,"[A-Fa-f]"),ue=i(i("%[EFef]"+te+"%"+te+te+"%"+te+te)+"|"+i("%[89A-Fa-f]"+te+"%"+te+te)+"|"+i("%"+te+te)),ze="[\\:\\/\\?\\#\\[\\]\\@]",Ye="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",ot=n(ze,Ye),Wt=H?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",nr=H?"[\\uE000-\\uF8FF]":"[]",Pt=n(L,G,"[\\-\\.\\_\\~]",Wt);i(L+n(L,G,"[\\+\\-\\.]")+"*"),i(i(ue+"|"+n(Pt,Ye,"[\\:]"))+"*");var At=i(i("25[0-5]")+"|"+i("2[0-4]"+G)+"|"+i("1"+G+G)+"|"+i("0?[1-9]"+G)+"|0?0?"+G),cr=i(At+"\\."+At+"\\."+At+"\\."+At),ft=i(te+"{1,4}"),Gt=i(i(ft+"\\:"+ft)+"|"+cr),it=i(i(ft+"\\:")+"{6}"+Gt),Ct=i("\\:\\:"+i(ft+"\\:")+"{5}"+Gt),Et=i(i(ft)+"?\\:\\:"+i(ft+"\\:")+"{4}"+Gt),ar=i(i(i(ft+"\\:")+"{0,1}"+ft)+"?\\:\\:"+i(ft+"\\:")+"{3}"+Gt),Fr=i(i(i(ft+"\\:")+"{0,2}"+ft)+"?\\:\\:"+i(ft+"\\:")+"{2}"+Gt),mi=i(i(i(ft+"\\:")+"{0,3}"+ft)+"?\\:\\:"+ft+"\\:"+Gt),ei=i(i(i(ft+"\\:")+"{0,4}"+ft)+"?\\:\\:"+Gt),ti=i(i(i(ft+"\\:")+"{0,5}"+ft)+"?\\:\\:"+ft),vi=i(i(i(ft+"\\:")+"{0,6}"+ft)+"?\\:\\:"),gi=i([it,Ct,Et,ar,Fr,mi,ei,ti,vi].join("|")),ln=i(i(Pt+"|"+ue)+"+");i("[vV]"+te+"+\\."+n(Pt,Ye,"[\\:]")+"+"),i(i(ue+"|"+n(Pt,Ye))+"*");var as=i(ue+"|"+n(Pt,Ye,"[\\:\\@]"));return i(i(ue+"|"+n(Pt,Ye,"[\\@]"))+"+"),i(i(as+"|"+n("[\\/\\?]",nr))+"*"),{NOT_SCHEME:new RegExp(n("[^]",L,G,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(n("[^\\%\\:]",Pt,Ye),"g"),NOT_HOST:new RegExp(n("[^\\%\\[\\]\\:]",Pt,Ye),"g"),NOT_PATH:new RegExp(n("[^\\%\\/\\:\\@]",Pt,Ye),"g"),NOT_PATH_NOSCHEME:new RegExp(n("[^\\%\\/\\@]",Pt,Ye),"g"),NOT_QUERY:new RegExp(n("[^\\%]",Pt,Ye,"[\\:\\@\\/\\?]",nr),"g"),NOT_FRAGMENT:new RegExp(n("[^\\%]",Pt,Ye,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(n("[^]",Pt,Ye),"g"),UNRESERVED:new RegExp(Pt,"g"),OTHER_CHARS:new RegExp(n("[^\\%]",Pt,ot),"g"),PCT_ENCODED:new RegExp(ue,"g"),IPV4ADDRESS:new RegExp("^("+cr+")$"),IPV6ADDRESS:new RegExp("^\\[?("+gi+")"+i(i("\\%25|\\%(?!"+te+"{2})")+"("+ln+")")+"?\\]?$")}}var f=d(!1),p=d(!0),m=function(){function H(L,G){var te=[],ue=!0,ze=!1,Ye=void 0;try{for(var ot=L[Symbol.iterator](),Wt;!(ue=(Wt=ot.next()).done)&&(te.push(Wt.value),!(G&&te.length===G));ue=!0);}catch(nr){ze=!0,Ye=nr}finally{try{!ue&&ot.return&&ot.return()}finally{if(ze)throw Ye}}return te}return function(L,G){if(Array.isArray(L))return L;if(Symbol.iterator in Object(L))return H(L,G);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),g=function(H){if(Array.isArray(H)){for(var L=0,G=Array(H.length);L<H.length;L++)G[L]=H[L];return G}else return Array.from(H)},b=2147483647,y=36,w=1,_=26,S=38,C=700,k=72,E=128,R="-",T=/^xn--/,A=/[^\0-\x7E]/,M=/[\x2E\u3002\uFF0E\uFF61]/g,B={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Q=y-w,se=Math.floor,ie=String.fromCharCode;function N(H){throw new RangeError(B[H])}function X(H,L){for(var G=[],te=H.length;te--;)G[te]=L(H[te]);return G}function ce(H,L){var G=H.split("@"),te="";G.length>1&&(te=G[0]+"@",H=G[1]),H=H.replace(M,".");var ue=H.split("."),ze=X(ue,L).join(".");return te+ze}function ne(H){for(var L=[],G=0,te=H.length;G<te;){var ue=H.charCodeAt(G++);if(ue>=55296&&ue<=56319&&G<te){var ze=H.charCodeAt(G++);(ze&64512)==56320?L.push(((ue&1023)<<10)+(ze&1023)+65536):(L.push(ue),G--)}else L.push(ue)}return L}var ee=function(L){return String.fromCodePoint.apply(String,g(L))},ge=function(L){return L-48<10?L-22:L-65<26?L-65:L-97<26?L-97:y},Z=function(L,G){return L+22+75*(L<26)-((G!=0)<<5)},j=function(L,G,te){var ue=0;for(L=te?se(L/C):L>>1,L+=se(L/G);L>Q*_>>1;ue+=y)L=se(L/Q);return se(ue+(Q+1)*L/(L+S))},U=function(L){var G=[],te=L.length,ue=0,ze=E,Ye=k,ot=L.lastIndexOf(R);ot<0&&(ot=0);for(var Wt=0;Wt<ot;++Wt)L.charCodeAt(Wt)>=128&&N("not-basic"),G.push(L.charCodeAt(Wt));for(var nr=ot>0?ot+1:0;nr<te;){for(var Pt=ue,At=1,cr=y;;cr+=y){nr>=te&&N("invalid-input");var ft=ge(L.charCodeAt(nr++));(ft>=y||ft>se((b-ue)/At))&&N("overflow"),ue+=ft*At;var Gt=cr<=Ye?w:cr>=Ye+_?_:cr-Ye;if(ft<Gt)break;var it=y-Gt;At>se(b/it)&&N("overflow"),At*=it}var Ct=G.length+1;Ye=j(ue-Pt,Ct,Pt==0),se(ue/Ct)>b-ze&&N("overflow"),ze+=se(ue/Ct),ue%=Ct,G.splice(ue++,0,ze)}return String.fromCodePoint.apply(String,G)},q=function(L){var G=[];L=ne(L);var te=L.length,ue=E,ze=0,Ye=k,ot=!0,Wt=!1,nr=void 0;try{for(var Pt=L[Symbol.iterator](),At;!(ot=(At=Pt.next()).done);ot=!0){var cr=At.value;cr<128&&G.push(ie(cr))}}catch(go){Wt=!0,nr=go}finally{try{!ot&&Pt.return&&Pt.return()}finally{if(Wt)throw nr}}var ft=G.length,Gt=ft;for(ft&&G.push(R);Gt<te;){var it=b,Ct=!0,Et=!1,ar=void 0;try{for(var Fr=L[Symbol.iterator](),mi;!(Ct=(mi=Fr.next()).done);Ct=!0){var ei=mi.value;ei>=ue&&ei<it&&(it=ei)}}catch(go){Et=!0,ar=go}finally{try{!Ct&&Fr.return&&Fr.return()}finally{if(Et)throw ar}}var ti=Gt+1;it-ue>se((b-ze)/ti)&&N("overflow"),ze+=(it-ue)*ti,ue=it;var vi=!0,gi=!1,ln=void 0;try{for(var as=L[Symbol.iterator](),ri;!(vi=(ri=as.next()).done);vi=!0){var jc=ri.value;if(jc<ue&&++ze>b&&N("overflow"),jc==ue){for(var Ys=ze,Xs=y;;Xs+=y){var Go=Xs<=Ye?w:Xs>=Ye+_?_:Xs-Ye;if(Ys<Go)break;var ss=Ys-Go,Ca=y-Go;G.push(ie(Z(Go+ss%Ca,0))),Ys=se(ss/Ca)}G.push(ie(Z(Ys,0))),Ye=j(ze,ti,Gt==ft),ze=0,++Gt}}}catch(go){gi=!0,ln=go}finally{try{!vi&&as.return&&as.return()}finally{if(gi)throw ln}}++ze,++ue}return G.join("")},$=function(L){return ce(L,function(G){return T.test(G)?U(G.slice(4).toLowerCase()):G})},F=function(L){return ce(L,function(G){return A.test(G)?"xn--"+q(G):G})},V={version:"2.1.0",ucs2:{decode:ne,encode:ee},decode:U,encode:q,toASCII:F,toUnicode:$},de={};function pe(H){var L=H.charCodeAt(0),G=void 0;return L<16?G="%0"+L.toString(16).toUpperCase():L<128?G="%"+L.toString(16).toUpperCase():L<2048?G="%"+(L>>6|192).toString(16).toUpperCase()+"%"+(L&63|128).toString(16).toUpperCase():G="%"+(L>>12|224).toString(16).toUpperCase()+"%"+(L>>6&63|128).toString(16).toUpperCase()+"%"+(L&63|128).toString(16).toUpperCase(),G}function Ee(H){for(var L="",G=0,te=H.length;G<te;){var ue=parseInt(H.substr(G+1,2),16);if(ue<128)L+=String.fromCharCode(ue),G+=3;else if(ue>=194&&ue<224){if(te-G>=6){var ze=parseInt(H.substr(G+4,2),16);L+=String.fromCharCode((ue&31)<<6|ze&63)}else L+=H.substr(G,6);G+=6}else if(ue>=224){if(te-G>=9){var Ye=parseInt(H.substr(G+4,2),16),ot=parseInt(H.substr(G+7,2),16);L+=String.fromCharCode((ue&15)<<12|(Ye&63)<<6|ot&63)}else L+=H.substr(G,9);G+=9}else L+=H.substr(G,3),G+=3}return L}function Me(H,L){function G(te){var ue=Ee(te);return ue.match(L.UNRESERVED)?ue:te}return H.scheme&&(H.scheme=String(H.scheme).replace(L.PCT_ENCODED,G).toLowerCase().replace(L.NOT_SCHEME,"")),H.userinfo!==void 0&&(H.userinfo=String(H.userinfo).replace(L.PCT_ENCODED,G).replace(L.NOT_USERINFO,pe).replace(L.PCT_ENCODED,a)),H.host!==void 0&&(H.host=String(H.host).replace(L.PCT_ENCODED,G).toLowerCase().replace(L.NOT_HOST,pe).replace(L.PCT_ENCODED,a)),H.path!==void 0&&(H.path=String(H.path).replace(L.PCT_ENCODED,G).replace(H.scheme?L.NOT_PATH:L.NOT_PATH_NOSCHEME,pe).replace(L.PCT_ENCODED,a)),H.query!==void 0&&(H.query=String(H.query).replace(L.PCT_ENCODED,G).replace(L.NOT_QUERY,pe).replace(L.PCT_ENCODED,a)),H.fragment!==void 0&&(H.fragment=String(H.fragment).replace(L.PCT_ENCODED,G).replace(L.NOT_FRAGMENT,pe).replace(L.PCT_ENCODED,a)),H}function Y(H){return H.replace(/^0*(.*)/,"$1")||"0"}function K(H,L){var G=H.match(L.IPV4ADDRESS)||[],te=m(G,2),ue=te[1];return ue?ue.split(".").map(Y).join("."):H}function we(H,L){var G=H.match(L.IPV6ADDRESS)||[],te=m(G,3),ue=te[1],ze=te[2];if(ue){for(var Ye=ue.toLowerCase().split("::").reverse(),ot=m(Ye,2),Wt=ot[0],nr=ot[1],Pt=nr?nr.split(":").map(Y):[],At=Wt.split(":").map(Y),cr=L.IPV4ADDRESS.test(At[At.length-1]),ft=cr?7:8,Gt=At.length-ft,it=Array(ft),Ct=0;Ct<ft;++Ct)it[Ct]=Pt[Ct]||At[Gt+Ct]||"";cr&&(it[ft-1]=K(it[ft-1],L));var Et=it.reduce(function(ti,vi,gi){if(!vi||vi==="0"){var ln=ti[ti.length-1];ln&&ln.index+ln.length===gi?ln.length++:ti.push({index:gi,length:1})}return ti},[]),ar=Et.sort(function(ti,vi){return vi.length-ti.length})[0],Fr=void 0;if(ar&&ar.length>1){var mi=it.slice(0,ar.index),ei=it.slice(ar.index+ar.length);Fr=mi.join(":")+"::"+ei.join(":")}else Fr=it.join(":");return ze&&(Fr+="%"+ze),Fr}else return H}var Te=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,he="".match(/(){0}/)[1]===void 0;function Ce(H){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},G={},te=L.iri!==!1?p:f;L.reference==="suffix"&&(H=(L.scheme?L.scheme+":":"")+"//"+H);var ue=H.match(Te);if(ue){he?(G.scheme=ue[1],G.userinfo=ue[3],G.host=ue[4],G.port=parseInt(ue[5],10),G.path=ue[6]||"",G.query=ue[7],G.fragment=ue[8],isNaN(G.port)&&(G.port=ue[5])):(G.scheme=ue[1]||void 0,G.userinfo=H.indexOf("@")!==-1?ue[3]:void 0,G.host=H.indexOf("//")!==-1?ue[4]:void 0,G.port=parseInt(ue[5],10),G.path=ue[6]||"",G.query=H.indexOf("?")!==-1?ue[7]:void 0,G.fragment=H.indexOf("#")!==-1?ue[8]:void 0,isNaN(G.port)&&(G.port=H.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?ue[4]:void 0)),G.host&&(G.host=we(K(G.host,te),te)),G.scheme===void 0&&G.userinfo===void 0&&G.host===void 0&&G.port===void 0&&!G.path&&G.query===void 0?G.reference="same-document":G.scheme===void 0?G.reference="relative":G.fragment===void 0?G.reference="absolute":G.reference="uri",L.reference&&L.reference!=="suffix"&&L.reference!==G.reference&&(G.error=G.error||"URI is not a "+L.reference+" reference.");var ze=de[(L.scheme||G.scheme||"").toLowerCase()];if(!L.unicodeSupport&&(!ze||!ze.unicodeSupport)){if(G.host&&(L.domainHost||ze&&ze.domainHost))try{G.host=V.toASCII(G.host.replace(te.PCT_ENCODED,Ee).toLowerCase())}catch(Ye){G.error=G.error||"Host's domain name can not be converted to ASCII via punycode: "+Ye}Me(G,f)}else Me(G,te);ze&&ze.parse&&ze.parse(G,L)}else G.error=G.error||"URI can not be parsed.";return G}function Ge(H,L){var G=L.iri!==!1?p:f,te=[];return H.userinfo!==void 0&&(te.push(H.userinfo),te.push("@")),H.host!==void 0&&te.push(we(K(String(H.host),G),G).replace(G.IPV6ADDRESS,function(ue,ze,Ye){return"["+ze+(Ye?"%25"+Ye:"")+"]"})),(typeof H.port=="number"||typeof H.port=="string")&&(te.push(":"),te.push(String(H.port))),te.length?te.join(""):void 0}var $t=/^\.\.?\//,Kt=/^\/\.(\/|$)/,It=/^\/\.\.(\/|$)/,jt=/^\/?(?:.|\n)*?(?=\/|$)/;function Lt(H){for(var L=[];H.length;)if(H.match($t))H=H.replace($t,"");else if(H.match(Kt))H=H.replace(Kt,"/");else if(H.match(It))H=H.replace(It,"/"),L.pop();else if(H==="."||H==="..")H="";else{var G=H.match(jt);if(G){var te=G[0];H=H.slice(te.length),L.push(te)}else throw new Error("Unexpected dot segment condition")}return L.join("")}function ht(H){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},G=L.iri?p:f,te=[],ue=de[(L.scheme||H.scheme||"").toLowerCase()];if(ue&&ue.serialize&&ue.serialize(H,L),H.host&&!G.IPV6ADDRESS.test(H.host)){if(L.domainHost||ue&&ue.domainHost)try{H.host=L.iri?V.toUnicode(H.host):V.toASCII(H.host.replace(G.PCT_ENCODED,Ee).toLowerCase())}catch(ot){H.error=H.error||"Host's domain name can not be converted to "+(L.iri?"Unicode":"ASCII")+" via punycode: "+ot}}Me(H,G),L.reference!=="suffix"&&H.scheme&&(te.push(H.scheme),te.push(":"));var ze=Ge(H,L);if(ze!==void 0&&(L.reference!=="suffix"&&te.push("//"),te.push(ze),H.path&&H.path.charAt(0)!=="/"&&te.push("/")),H.path!==void 0){var Ye=H.path;!L.absolutePath&&(!ue||!ue.absolutePath)&&(Ye=Lt(Ye)),ze===void 0&&(Ye=Ye.replace(/^\/\//,"/%2F")),te.push(Ye)}return H.query!==void 0&&(te.push("?"),te.push(H.query)),H.fragment!==void 0&&(te.push("#"),te.push(H.fragment)),te.join("")}function on(H,L){var G=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},te=arguments[3],ue={};return te||(H=Ce(ht(H,G),G),L=Ce(ht(L,G),G)),G=G||{},!G.tolerant&&L.scheme?(ue.scheme=L.scheme,ue.userinfo=L.userinfo,ue.host=L.host,ue.port=L.port,ue.path=Lt(L.path||""),ue.query=L.query):(L.userinfo!==void 0||L.host!==void 0||L.port!==void 0?(ue.userinfo=L.userinfo,ue.host=L.host,ue.port=L.port,ue.path=Lt(L.path||""),ue.query=L.query):(L.path?(L.path.charAt(0)==="/"?ue.path=Lt(L.path):((H.userinfo!==void 0||H.host!==void 0||H.port!==void 0)&&!H.path?ue.path="/"+L.path:H.path?ue.path=H.path.slice(0,H.path.lastIndexOf("/")+1)+L.path:ue.path=L.path,ue.path=Lt(ue.path)),ue.query=L.query):(ue.path=H.path,L.query!==void 0?ue.query=L.query:ue.query=H.query),ue.userinfo=H.userinfo,ue.host=H.host,ue.port=H.port),ue.scheme=H.scheme),ue.fragment=L.fragment,ue}function mn(H,L,G){var te=c({scheme:"null"},G);return ht(on(Ce(H,te),Ce(L,te),te,!0),te)}function Ir(H,L){return typeof H=="string"?H=ht(Ce(H,L),L):o(H)==="object"&&(H=Ce(ht(H,L),L)),H}function Jr(H,L,G){return typeof H=="string"?H=ht(Ce(H,G),G):o(H)==="object"&&(H=ht(H,G)),typeof L=="string"?L=ht(Ce(L,G),G):o(L)==="object"&&(L=ht(L,G)),H===L}function vn(H,L){return H&&H.toString().replace(!L||!L.iri?f.ESCAPE:p.ESCAPE,pe)}function Nr(H,L){return H&&H.toString().replace(!L||!L.iri?f.PCT_ENCODED:p.PCT_ENCODED,Ee)}var an={scheme:"http",domainHost:!0,parse:function(L,G){return L.host||(L.error=L.error||"HTTP URIs must have a host."),L},serialize:function(L,G){var te=String(L.scheme).toLowerCase()==="https";return(L.port===(te?443:80)||L.port==="")&&(L.port=void 0),L.path||(L.path="/"),L}},sn={scheme:"https",domainHost:an.domainHost,parse:an.parse,serialize:an.serialize};function _a(H){return typeof H.secure=="boolean"?H.secure:String(H.scheme).toLowerCase()==="wss"}var Yi={scheme:"ws",domainHost:!0,parse:function(L,G){var te=L;return te.secure=_a(te),te.resourceName=(te.path||"/")+(te.query?"?"+te.query:""),te.path=void 0,te.query=void 0,te},serialize:function(L,G){if((L.port===(_a(L)?443:80)||L.port==="")&&(L.port=void 0),typeof L.secure=="boolean"&&(L.scheme=L.secure?"wss":"ws",L.secure=void 0),L.resourceName){var te=L.resourceName.split("?"),ue=m(te,2),ze=ue[0],Ye=ue[1];L.path=ze&&ze!=="/"?ze:void 0,L.query=Ye,L.resourceName=void 0}return L.fragment=void 0,L}},xa={scheme:"wss",domainHost:Yi.domainHost,parse:Yi.parse,serialize:Yi.serialize},Xi={},Oi="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",gn="[0-9A-Fa-f]",Wo=i(i("%[EFef]"+gn+"%"+gn+gn+"%"+gn+gn)+"|"+i("%[89A-Fa-f]"+gn+"%"+gn+gn)+"|"+i("%"+gn+gn)),Ko="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",Pa="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",qn=n(Pa,'[\\"\\\\]'),vo="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",pi=new RegExp(Oi,"g"),Ji=new RegExp(Wo,"g"),le=new RegExp(n("[^]",Ko,"[\\.]",'[\\"]',qn),"g"),ye=new RegExp(n("[^]",Oi,vo),"g"),xe=ye;function $e(H){var L=Ee(H);return L.match(pi)?L:H}var Be={scheme:"mailto",parse:function(L,G){var te=L,ue=te.to=te.path?te.path.split(","):[];if(te.path=void 0,te.query){for(var ze=!1,Ye={},ot=te.query.split("&"),Wt=0,nr=ot.length;Wt<nr;++Wt){var Pt=ot[Wt].split("=");switch(Pt[0]){case"to":for(var At=Pt[1].split(","),cr=0,ft=At.length;cr<ft;++cr)ue.push(At[cr]);break;case"subject":te.subject=Nr(Pt[1],G);break;case"body":te.body=Nr(Pt[1],G);break;default:ze=!0,Ye[Nr(Pt[0],G)]=Nr(Pt[1],G);break}}ze&&(te.headers=Ye)}te.query=void 0;for(var Gt=0,it=ue.length;Gt<it;++Gt){var Ct=ue[Gt].split("@");if(Ct[0]=Nr(Ct[0]),G.unicodeSupport)Ct[1]=Nr(Ct[1],G).toLowerCase();else try{Ct[1]=V.toASCII(Nr(Ct[1],G).toLowerCase())}catch(Et){te.error=te.error||"Email address's domain name can not be converted to ASCII via punycode: "+Et}ue[Gt]=Ct.join("@")}return te},serialize:function(L,G){var te=L,ue=l(L.to);if(ue){for(var ze=0,Ye=ue.length;ze<Ye;++ze){var ot=String(ue[ze]),Wt=ot.lastIndexOf("@"),nr=ot.slice(0,Wt).replace(Ji,$e).replace(Ji,a).replace(le,pe),Pt=ot.slice(Wt+1);try{Pt=G.iri?V.toUnicode(Pt):V.toASCII(Nr(Pt,G).toLowerCase())}catch(Gt){te.error=te.error||"Email address's domain name can not be converted to "+(G.iri?"Unicode":"ASCII")+" via punycode: "+Gt}ue[ze]=nr+"@"+Pt}te.path=ue.join(",")}var At=L.headers=L.headers||{};L.subject&&(At.subject=L.subject),L.body&&(At.body=L.body);var cr=[];for(var ft in At)At[ft]!==Xi[ft]&&cr.push(ft.replace(Ji,$e).replace(Ji,a).replace(ye,pe)+"="+At[ft].replace(Ji,$e).replace(Ji,a).replace(xe,pe));return cr.length&&(te.query=cr.join("&")),te}},pt=/^([^\:]+)\:(.*)/,tt={scheme:"urn",parse:function(L,G){var te=L.path&&L.path.match(pt),ue=L;if(te){var ze=G.scheme||ue.scheme||"urn",Ye=te[1].toLowerCase(),ot=te[2],Wt=ze+":"+(G.nid||Ye),nr=de[Wt];ue.nid=Ye,ue.nss=ot,ue.path=void 0,nr&&(ue=nr.parse(ue,G))}else ue.error=ue.error||"URN can not be parsed.";return ue},serialize:function(L,G){var te=G.scheme||L.scheme||"urn",ue=L.nid,ze=te+":"+(G.nid||ue),Ye=de[ze];Ye&&(L=Ye.serialize(L,G));var ot=L,Wt=L.nss;return ot.path=(ue||G.nid)+":"+Wt,ot}},Ue=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,xt={scheme:"urn:uuid",parse:function(L,G){var te=L;return te.uuid=te.nss,te.nss=void 0,!G.tolerant&&(!te.uuid||!te.uuid.match(Ue))&&(te.error=te.error||"UUID is not valid."),te},serialize:function(L,G){var te=L;return te.nss=(L.uuid||"").toLowerCase(),te}};de[an.scheme]=an,de[sn.scheme]=sn,de[Yi.scheme]=Yi,de[xa.scheme]=xa,de[Be.scheme]=Be,de[tt.scheme]=tt,de[xt.scheme]=xt,r.SCHEMES=de,r.pctEncChar=pe,r.pctDecChars=Ee,r.parse=Ce,r.removeDotSegments=Lt,r.serialize=ht,r.resolveComponents=on,r.resolve=mn,r.normalize=Ir,r.equal=Jr,r.escapeComponent=vn,r.unescapeComponent=Nr,Object.defineProperty(r,"__esModule",{value:!0})})}(ep,ep.exports)),ep.exports}var oD;function Twe(){if(oD)return Ng;oD=1,Object.defineProperty(Ng,"__esModule",{value:!0});const e=Ewe();return e.code='require("ajv/dist/runtime/uri").default',Ng.default=e,Ng}var aD;function Owe(){return aD||(aD=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=ww();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=Dt();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});const n=xT(),i=Sw(),o=$3(),a=_w(),l=Dt(),c=bw(),d=n0(),f=Jt(),p=Pwe,m=Twe(),g=(Z,j)=>new RegExp(Z,j);g.code="new RegExp";const b=["removeAdditional","useDefaults","coerceTypes"],y=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),w={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},_={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},S=200;function C(Z){var j,U,q,$,F,V,de,pe,Ee,Me,Y,K,we,Te,he,Ce,Ge,$t,Kt,It,jt,Lt,ht,on,mn;const Ir=Z.strict,Jr=(j=Z.code)===null||j===void 0?void 0:j.optimize,vn=Jr===!0||Jr===void 0?1:Jr||0,Nr=(q=(U=Z.code)===null||U===void 0?void 0:U.regExp)!==null&&q!==void 0?q:g,an=($=Z.uriResolver)!==null&&$!==void 0?$:m.default;return{strictSchema:(V=(F=Z.strictSchema)!==null&&F!==void 0?F:Ir)!==null&&V!==void 0?V:!0,strictNumbers:(pe=(de=Z.strictNumbers)!==null&&de!==void 0?de:Ir)!==null&&pe!==void 0?pe:!0,strictTypes:(Me=(Ee=Z.strictTypes)!==null&&Ee!==void 0?Ee:Ir)!==null&&Me!==void 0?Me:"log",strictTuples:(K=(Y=Z.strictTuples)!==null&&Y!==void 0?Y:Ir)!==null&&K!==void 0?K:"log",strictRequired:(Te=(we=Z.strictRequired)!==null&&we!==void 0?we:Ir)!==null&&Te!==void 0?Te:!1,code:Z.code?{...Z.code,optimize:vn,regExp:Nr}:{optimize:vn,regExp:Nr},loopRequired:(he=Z.loopRequired)!==null&&he!==void 0?he:S,loopEnum:(Ce=Z.loopEnum)!==null&&Ce!==void 0?Ce:S,meta:(Ge=Z.meta)!==null&&Ge!==void 0?Ge:!0,messages:($t=Z.messages)!==null&&$t!==void 0?$t:!0,inlineRefs:(Kt=Z.inlineRefs)!==null&&Kt!==void 0?Kt:!0,schemaId:(It=Z.schemaId)!==null&&It!==void 0?It:"$id",addUsedSchema:(jt=Z.addUsedSchema)!==null&&jt!==void 0?jt:!0,validateSchema:(Lt=Z.validateSchema)!==null&&Lt!==void 0?Lt:!0,validateFormats:(ht=Z.validateFormats)!==null&&ht!==void 0?ht:!0,unicodeRegExp:(on=Z.unicodeRegExp)!==null&&on!==void 0?on:!0,int32range:(mn=Z.int32range)!==null&&mn!==void 0?mn:!0,uriResolver:an}}class k{constructor(j={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,j=this.opts={...j,...C(j)};const{es5:U,lines:q}=this.opts.code;this.scope=new l.ValueScope({scope:{},prefixes:y,es5:U,lines:q}),this.logger=se(j.logger);const $=j.validateFormats;j.validateFormats=!1,this.RULES=(0,o.getRules)(),E.call(this,w,j,"NOT SUPPORTED"),E.call(this,_,j,"DEPRECATED","warn"),this._metaOpts=B.call(this),j.formats&&A.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),j.keywords&&M.call(this,j.keywords),typeof j.meta=="object"&&this.addMetaSchema(j.meta),T.call(this),j.validateFormats=$}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:j,meta:U,schemaId:q}=this.opts;let $=p;q==="id"&&($={...p},$.id=$.$id,delete $.$id),U&&j&&this.addMetaSchema($,$[q],!1)}defaultMeta(){const{meta:j,schemaId:U}=this.opts;return this.opts.defaultMeta=typeof j=="object"?j[U]||j:void 0}validate(j,U){let q;if(typeof j=="string"){if(q=this.getSchema(j),!q)throw new Error(`no schema with key or ref "${j}"`)}else q=this.compile(j);const $=q(U);return"$async"in q||(this.errors=q.errors),$}compile(j,U){const q=this._addSchema(j,U);return q.validate||this._compileSchemaEnv(q)}compileAsync(j,U){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:q}=this.opts;return $.call(this,j,U);async function $(Me,Y){await F.call(this,Me.$schema);const K=this._addSchema(Me,Y);return K.validate||V.call(this,K)}async function F(Me){Me&&!this.getSchema(Me)&&await $.call(this,{$ref:Me},!0)}async function V(Me){try{return this._compileSchemaEnv(Me)}catch(Y){if(!(Y instanceof i.default))throw Y;return de.call(this,Y),await pe.call(this,Y.missingSchema),V.call(this,Me)}}function de({missingSchema:Me,missingRef:Y}){if(this.refs[Me])throw new Error(`AnySchema ${Me} is loaded but ${Y} cannot be resolved`)}async function pe(Me){const Y=await Ee.call(this,Me);this.refs[Me]||await F.call(this,Y.$schema),this.refs[Me]||this.addSchema(Y,Me,U)}async function Ee(Me){const Y=this._loading[Me];if(Y)return Y;try{return await(this._loading[Me]=q(Me))}finally{delete this._loading[Me]}}}addSchema(j,U,q,$=this.opts.validateSchema){if(Array.isArray(j)){for(const V of j)this.addSchema(V,void 0,q,$);return this}let F;if(typeof j=="object"){const{schemaId:V}=this.opts;if(F=j[V],F!==void 0&&typeof F!="string")throw new Error(`schema ${V} must be string`)}return U=(0,c.normalizeId)(U||F),this._checkUnique(U),this.schemas[U]=this._addSchema(j,q,U,$,!0),this}addMetaSchema(j,U,q=this.opts.validateSchema){return this.addSchema(j,U,!0,q),this}validateSchema(j,U){if(typeof j=="boolean")return!0;let q;if(q=j.$schema,q!==void 0&&typeof q!="string")throw new Error("$schema must be a string");if(q=q||this.opts.defaultMeta||this.defaultMeta(),!q)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const $=this.validate(q,j);if(!$&&U){const F="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(F);else throw new Error(F)}return $}getSchema(j){let U;for(;typeof(U=R.call(this,j))=="string";)j=U;if(U===void 0){const{schemaId:q}=this.opts,$=new a.SchemaEnv({schema:{},schemaId:q});if(U=a.resolveSchema.call(this,$,j),!U)return;this.refs[j]=U}return U.validate||this._compileSchemaEnv(U)}removeSchema(j){if(j instanceof RegExp)return this._removeAllSchemas(this.schemas,j),this._removeAllSchemas(this.refs,j),this;switch(typeof j){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const U=R.call(this,j);return typeof U=="object"&&this._cache.delete(U.schema),delete this.schemas[j],delete this.refs[j],this}case"object":{const U=j;this._cache.delete(U);let q=j[this.opts.schemaId];return q&&(q=(0,c.normalizeId)(q),delete this.schemas[q],delete this.refs[q]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(j){for(const U of j)this.addKeyword(U);return this}addKeyword(j,U){let q;if(typeof j=="string")q=j,typeof U=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),U.keyword=q);else if(typeof j=="object"&&U===void 0){if(U=j,q=U.keyword,Array.isArray(q)&&!q.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(N.call(this,q,U),!U)return(0,f.eachItem)(q,F=>X.call(this,F)),this;ne.call(this,U);const $={...U,type:(0,d.getJSONTypes)(U.type),schemaType:(0,d.getJSONTypes)(U.schemaType)};return(0,f.eachItem)(q,$.type.length===0?F=>X.call(this,F,$):F=>$.type.forEach(V=>X.call(this,F,$,V))),this}getKeyword(j){const U=this.RULES.all[j];return typeof U=="object"?U.definition:!!U}removeKeyword(j){const{RULES:U}=this;delete U.keywords[j],delete U.all[j];for(const q of U.rules){const $=q.rules.findIndex(F=>F.keyword===j);$>=0&&q.rules.splice($,1)}return this}addFormat(j,U){return typeof U=="string"&&(U=new RegExp(U)),this.formats[j]=U,this}errorsText(j=this.errors,{separator:U=", ",dataVar:q="data"}={}){return!j||j.length===0?"No errors":j.map($=>`${q}${$.instancePath} ${$.message}`).reduce(($,F)=>$+U+F)}$dataMetaSchema(j,U){const q=this.RULES.all;j=JSON.parse(JSON.stringify(j));for(const $ of U){const F=$.split("/").slice(1);let V=j;for(const de of F)V=V[de];for(const de in q){const pe=q[de];if(typeof pe!="object")continue;const{$data:Ee}=pe.definition,Me=V[de];Ee&&Me&&(V[de]=ge(Me))}}return j}_removeAllSchemas(j,U){for(const q in j){const $=j[q];(!U||U.test(q))&&(typeof $=="string"?delete j[q]:$&&!$.meta&&(this._cache.delete($.schema),delete j[q]))}}_addSchema(j,U,q,$=this.opts.validateSchema,F=this.opts.addUsedSchema){let V;const{schemaId:de}=this.opts;if(typeof j=="object")V=j[de];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof j!="boolean")throw new Error("schema must be object or boolean")}let pe=this._cache.get(j);if(pe!==void 0)return pe;q=(0,c.normalizeId)(V||q);const Ee=c.getSchemaRefs.call(this,j,q);return pe=new a.SchemaEnv({schema:j,schemaId:de,meta:U,baseId:q,localRefs:Ee}),this._cache.set(pe.schema,pe),F&&!q.startsWith("#")&&(q&&this._checkUnique(q),this.refs[q]=pe),$&&this.validateSchema(j,!0),pe}_checkUnique(j){if(this.schemas[j]||this.refs[j])throw new Error(`schema with key or id "${j}" already exists`)}_compileSchemaEnv(j){if(j.meta?this._compileMetaSchema(j):a.compileSchema.call(this,j),!j.validate)throw new Error("ajv implementation error");return j.validate}_compileMetaSchema(j){const U=this.opts;this.opts=this._metaOpts;try{a.compileSchema.call(this,j)}finally{this.opts=U}}}k.ValidationError=n.default,k.MissingRefError=i.default,e.default=k;function E(Z,j,U,q="error"){for(const $ in Z){const F=$;F in j&&this.logger[q](`${U}: option ${$}. ${Z[F]}`)}}function R(Z){return Z=(0,c.normalizeId)(Z),this.schemas[Z]||this.refs[Z]}function T(){const Z=this.opts.schemas;if(Z)if(Array.isArray(Z))this.addSchema(Z);else for(const j in Z)this.addSchema(Z[j],j)}function A(){for(const Z in this.opts.formats){const j=this.opts.formats[Z];j&&this.addFormat(Z,j)}}function M(Z){if(Array.isArray(Z)){this.addVocabulary(Z);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const j in Z){const U=Z[j];U.keyword||(U.keyword=j),this.addKeyword(U)}}function B(){const Z={...this.opts};for(const j of b)delete Z[j];return Z}const Q={log(){},warn(){},error(){}};function se(Z){if(Z===!1)return Q;if(Z===void 0)return console;if(Z.log&&Z.warn&&Z.error)return Z;throw new Error("logger must implement log, warn and error methods")}const ie=/^[a-z_$][a-z0-9_$:-]*$/i;function N(Z,j){const{RULES:U}=this;if((0,f.eachItem)(Z,q=>{if(U.keywords[q])throw new Error(`Keyword ${q} is already defined`);if(!ie.test(q))throw new Error(`Keyword ${q} has invalid name`)}),!!j&&j.$data&&!("code"in j||"validate"in j))throw new Error('$data keyword must have "code" or "validate" function')}function X(Z,j,U){var q;const $=j==null?void 0:j.post;if(U&&$)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:F}=this;let V=$?F.post:F.rules.find(({type:pe})=>pe===U);if(V||(V={type:U,rules:[]},F.rules.push(V)),F.keywords[Z]=!0,!j)return;const de={keyword:Z,definition:{...j,type:(0,d.getJSONTypes)(j.type),schemaType:(0,d.getJSONTypes)(j.schemaType)}};j.before?ce.call(this,V,de,j.before):V.rules.push(de),F.all[Z]=de,(q=j.implements)===null||q===void 0||q.forEach(pe=>this.addKeyword(pe))}function ce(Z,j,U){const q=Z.rules.findIndex($=>$.keyword===U);q>=0?Z.rules.splice(q,0,j):(Z.rules.push(j),this.logger.warn(`rule ${U} is not defined`))}function ne(Z){let{metaSchema:j}=Z;j!==void 0&&(Z.$data&&this.opts.$data&&(j=ge(j)),Z.validateSchema=this.compile(j,!0))}const ee={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function ge(Z){return{anyOf:[Z,ee]}}}(B_)),B_}var Fg={},Lg={},Bg={},sD;function Rwe(){if(sD)return Bg;sD=1,Object.defineProperty(Bg,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return Bg.default=e,Bg}var wl={},lD;function PT(){if(lD)return wl;lD=1,Object.defineProperty(wl,"__esModule",{value:!0}),wl.callRef=wl.getValidate=void 0;const e=Sw(),t=Sa(),r=Dt(),n=wa(),i=_w(),o=Jt(),a={keyword:"$ref",schemaType:"string",code(d){const{gen:f,schema:p,it:m}=d,{baseId:g,schemaEnv:b,validateName:y,opts:w,self:_}=m,{root:S}=b;if((p==="#"||p==="#/")&&g===S.baseId)return k();const C=i.resolveRef.call(_,S,g,p);if(C===void 0)throw new e.default(m.opts.uriResolver,g,p);if(C instanceof i.SchemaEnv)return E(C);return R(C);function k(){if(b===S)return c(d,y,b,b.$async);const T=f.scopeValue("root",{ref:S});return c(d,(0,r._)`${T}.validate`,S,S.$async)}function E(T){const A=l(d,T);c(d,A,T,T.$async)}function R(T){const A=f.scopeValue("schema",w.code.source===!0?{ref:T,code:(0,r.stringify)(T)}:{ref:T}),M=f.name("valid"),B=d.subschema({schema:T,dataTypes:[],schemaPath:r.nil,topSchemaRef:A,errSchemaPath:p},M);d.mergeEvaluated(B),d.ok(M)}}};function l(d,f){const{gen:p}=d;return f.validate?p.scopeValue("validate",{ref:f.validate}):(0,r._)`${p.scopeValue("wrapper",{ref:f})}.validate`}wl.getValidate=l;function c(d,f,p,m){const{gen:g,it:b}=d,{allErrors:y,schemaEnv:w,opts:_}=b,S=_.passContext?n.default.this:r.nil;m?C():k();function C(){if(!w.$async)throw new Error("async schema referenced by sync schema");const T=g.let("valid");g.try(()=>{g.code((0,r._)`await ${(0,t.callValidateCode)(d,f,S)}`),R(f),y||g.assign(T,!0)},A=>{g.if((0,r._)`!(${A} instanceof ${b.ValidationError})`,()=>g.throw(A)),E(A),y||g.assign(T,!1)}),d.ok(T)}function k(){d.result((0,t.callValidateCode)(d,f,S),()=>R(f),()=>E(f))}function E(T){const A=(0,r._)`${T}.errors`;g.assign(n.default.vErrors,(0,r._)`${n.default.vErrors} === null ? ${A} : ${n.default.vErrors}.concat(${A})`),g.assign(n.default.errors,(0,r._)`${n.default.vErrors}.length`)}function R(T){var A;if(!b.opts.unevaluated)return;const M=(A=p==null?void 0:p.validate)===null||A===void 0?void 0:A.evaluated;if(b.props!==!0)if(M&&!M.dynamicProps)M.props!==void 0&&(b.props=o.mergeEvaluated.props(g,M.props,b.props));else{const B=g.var("props",(0,r._)`${T}.evaluated.props`);b.props=o.mergeEvaluated.props(g,B,b.props,r.Name)}if(b.items!==!0)if(M&&!M.dynamicItems)M.items!==void 0&&(b.items=o.mergeEvaluated.items(g,M.items,b.items));else{const B=g.var("items",(0,r._)`${T}.evaluated.items`);b.items=o.mergeEvaluated.items(g,B,b.items,r.Name)}}}return wl.callRef=c,wl.default=a,wl}var uD;function Iwe(){if(uD)return Lg;uD=1,Object.defineProperty(Lg,"__esModule",{value:!0});const e=Rwe(),t=PT(),r=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,t.default];return Lg.default=r,Lg}var Vg={},zg={},cD;function kwe(){if(cD)return zg;cD=1,Object.defineProperty(zg,"__esModule",{value:!0});const e=Dt(),t=e.operators,r={maximum:{okStr:"<=",ok:t.LTE,fail:t.GT},minimum:{okStr:">=",ok:t.GTE,fail:t.LT},exclusiveMaximum:{okStr:"<",ok:t.LT,fail:t.GTE},exclusiveMinimum:{okStr:">",ok:t.GT,fail:t.LTE}},n={message:({keyword:o,schemaCode:a})=>(0,e.str)`must be ${r[o].okStr} ${a}`,params:({keyword:o,schemaCode:a})=>(0,e._)`{comparison: ${r[o].okStr}, limit: ${a}}`},i={keyword:Object.keys(r),type:"number",schemaType:"number",$data:!0,error:n,code(o){const{keyword:a,data:l,schemaCode:c}=o;o.fail$data((0,e._)`${l} ${r[a].fail} ${c} || isNaN(${l})`)}};return zg.default=i,zg}var qg={},dD;function jwe(){if(dD)return qg;dD=1,Object.defineProperty(qg,"__esModule",{value:!0});const e=Dt(),r={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:n})=>(0,e.str)`must be multiple of ${n}`,params:({schemaCode:n})=>(0,e._)`{multipleOf: ${n}}`},code(n){const{gen:i,data:o,schemaCode:a,it:l}=n,c=l.opts.multipleOfPrecision,d=i.let("res"),f=c?(0,e._)`Math.abs(Math.round(${d}) - ${d}) > 1e-${c}`:(0,e._)`${d} !== parseInt(${d})`;n.fail$data((0,e._)`(${a} === 0 || (${d} = ${o}/${a}, ${f}))`)}};return qg.default=r,qg}var Ug={},Hg={},fD;function $we(){if(fD)return Hg;fD=1,Object.defineProperty(Hg,"__esModule",{value:!0});function e(t){const r=t.length;let n=0,i=0,o;for(;i<r;)n++,o=t.charCodeAt(i++),o>=55296&&o<=56319&&i<r&&(o=t.charCodeAt(i),(o&64512)===56320&&i++);return n}return Hg.default=e,e.code='require("ajv/dist/runtime/ucs2length").default',Hg}var hD;function Awe(){if(hD)return Ug;hD=1,Object.defineProperty(Ug,"__esModule",{value:!0});const e=Dt(),t=Jt(),r=$we(),i={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:o,schemaCode:a}){const l=o==="maxLength"?"more":"fewer";return(0,e.str)`must NOT have ${l} than ${a} characters`},params:({schemaCode:o})=>(0,e._)`{limit: ${o}}`},code(o){const{keyword:a,data:l,schemaCode:c,it:d}=o,f=a==="maxLength"?e.operators.GT:e.operators.LT,p=d.opts.unicode===!1?(0,e._)`${l}.length`:(0,e._)`${(0,t.useFunc)(o.gen,r.default)}(${l})`;o.fail$data((0,e._)`${p} ${f} ${c}`)}};return Ug.default=i,Ug}var Wg={},pD;function Dwe(){if(pD)return Wg;pD=1,Object.defineProperty(Wg,"__esModule",{value:!0});const e=Sa(),t=Dt(),n={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:i})=>(0,t.str)`must match pattern "${i}"`,params:({schemaCode:i})=>(0,t._)`{pattern: ${i}}`},code(i){const{data:o,$data:a,schema:l,schemaCode:c,it:d}=i,f=d.opts.unicodeRegExp?"u":"",p=a?(0,t._)`(new RegExp(${c}, ${f}))`:(0,e.usePattern)(i,l);i.fail$data((0,t._)`!${p}.test(${o})`)}};return Wg.default=n,Wg}var Kg={},mD;function Mwe(){if(mD)return Kg;mD=1,Object.defineProperty(Kg,"__esModule",{value:!0});const e=Dt(),r={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:i}){const o=n==="maxProperties"?"more":"fewer";return(0,e.str)`must NOT have ${o} than ${i} properties`},params:({schemaCode:n})=>(0,e._)`{limit: ${n}}`},code(n){const{keyword:i,data:o,schemaCode:a}=n,l=i==="maxProperties"?e.operators.GT:e.operators.LT;n.fail$data((0,e._)`Object.keys(${o}).length ${l} ${a}`)}};return Kg.default=r,Kg}var Gg={},vD;function Nwe(){if(vD)return Gg;vD=1,Object.defineProperty(Gg,"__esModule",{value:!0});const e=Sa(),t=Dt(),r=Jt(),i={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:o}})=>(0,t.str)`must have required property '${o}'`,params:({params:{missingProperty:o}})=>(0,t._)`{missingProperty: ${o}}`},code(o){const{gen:a,schema:l,schemaCode:c,data:d,$data:f,it:p}=o,{opts:m}=p;if(!f&&l.length===0)return;const g=l.length>=m.loopRequired;if(p.allErrors?b():y(),m.strictRequired){const S=o.parentSchema.properties,{definedProperties:C}=o.it;for(const k of l)if((S==null?void 0:S[k])===void 0&&!C.has(k)){const E=p.schemaEnv.baseId+p.errSchemaPath,R=`required property "${k}" is not defined at "${E}" (strictRequired)`;(0,r.checkStrictMode)(p,R,p.opts.strictRequired)}}function b(){if(g||f)o.block$data(t.nil,w);else for(const S of l)(0,e.checkReportMissingProp)(o,S)}function y(){const S=a.let("missing");if(g||f){const C=a.let("valid",!0);o.block$data(C,()=>_(S,C)),o.ok(C)}else a.if((0,e.checkMissingProp)(o,l,S)),(0,e.reportMissingProp)(o,S),a.else()}function w(){a.forOf("prop",c,S=>{o.setParams({missingProperty:S}),a.if((0,e.noPropertyInData)(a,d,S,m.ownProperties),()=>o.error())})}function _(S,C){o.setParams({missingProperty:S}),a.forOf(S,c,()=>{a.assign(C,(0,e.propertyInData)(a,d,S,m.ownProperties)),a.if((0,t.not)(C),()=>{o.error(),a.break()})},t.nil)}}};return Gg.default=i,Gg}var Qg={},gD;function Fwe(){if(gD)return Qg;gD=1,Object.defineProperty(Qg,"__esModule",{value:!0});const e=Dt(),r={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:i}){const o=n==="maxItems"?"more":"fewer";return(0,e.str)`must NOT have ${o} than ${i} items`},params:({schemaCode:n})=>(0,e._)`{limit: ${n}}`},code(n){const{keyword:i,data:o,schemaCode:a}=n,l=i==="maxItems"?e.operators.GT:e.operators.LT;n.fail$data((0,e._)`${o}.length ${l} ${a}`)}};return Qg.default=r,Qg}var Yg={},Xg={},yD;function CT(){if(yD)return Xg;yD=1,Object.defineProperty(Xg,"__esModule",{value:!0});const e=D3();return e.code='require("ajv/dist/runtime/equal").default',Xg.default=e,Xg}var bD;function Lwe(){if(bD)return Yg;bD=1,Object.defineProperty(Yg,"__esModule",{value:!0});const e=n0(),t=Dt(),r=Jt(),n=CT(),o={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:a,j:l}})=>(0,t.str)`must NOT have duplicate items (items ## ${l} and ${a} are identical)`,params:({params:{i:a,j:l}})=>(0,t._)`{i: ${a}, j: ${l}}`},code(a){const{gen:l,data:c,$data:d,schema:f,parentSchema:p,schemaCode:m,it:g}=a;if(!d&&!f)return;const b=l.let("valid"),y=p.items?(0,e.getSchemaTypes)(p.items):[];a.block$data(b,w,(0,t._)`${m} === false`),a.ok(b);function w(){const k=l.let("i",(0,t._)`${c}.length`),E=l.let("j");a.setParams({i:k,j:E}),l.assign(b,!0),l.if((0,t._)`${k} > 1`,()=>(_()?S:C)(k,E))}function _(){return y.length>0&&!y.some(k=>k==="object"||k==="array")}function S(k,E){const R=l.name("item"),T=(0,e.checkDataTypes)(y,R,g.opts.strictNumbers,e.DataType.Wrong),A=l.const("indices",(0,t._)`{}`);l.for((0,t._)`;${k}--;`,()=>{l.let(R,(0,t._)`${c}[${k}]`),l.if(T,(0,t._)`continue`),y.length>1&&l.if((0,t._)`typeof ${R} == "string"`,(0,t._)`${R} += "_"`),l.if((0,t._)`typeof ${A}[${R}] == "number"`,()=>{l.assign(E,(0,t._)`${A}[${R}]`),a.error(),l.assign(b,!1).break()}).code((0,t._)`${A}[${R}] = ${k}`)})}function C(k,E){const R=(0,r.useFunc)(l,n.default),T=l.name("outer");l.label(T).for((0,t._)`;${k}--;`,()=>l.for((0,t._)`${E} = ${k}; ${E}--;`,()=>l.if((0,t._)`${R}(${c}[${k}], ${c}[${E}])`,()=>{a.error(),l.assign(b,!1).break(T)})))}}};return Yg.default=o,Yg}var Jg={},wD;function Bwe(){if(wD)return Jg;wD=1,Object.defineProperty(Jg,"__esModule",{value:!0});const e=Dt(),t=Jt(),r=CT(),i={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:o})=>(0,e._)`{allowedValue: ${o}}`},code(o){const{gen:a,data:l,$data:c,schemaCode:d,schema:f}=o;c||f&&typeof f=="object"?o.fail$data((0,e._)`!${(0,t.useFunc)(a,r.default)}(${l}, ${d})`):o.fail((0,e._)`${f} !== ${l}`)}};return Jg.default=i,Jg}var Zg={},SD;function Vwe(){if(SD)return Zg;SD=1,Object.defineProperty(Zg,"__esModule",{value:!0});const e=Dt(),t=Jt(),r=CT(),i={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:o})=>(0,e._)`{allowedValues: ${o}}`},code(o){const{gen:a,data:l,$data:c,schema:d,schemaCode:f,it:p}=o;if(!c&&d.length===0)throw new Error("enum must have non-empty array");const m=d.length>=p.opts.loopEnum;let g;const b=()=>g??(g=(0,t.useFunc)(a,r.default));let y;if(m||c)y=a.let("valid"),o.block$data(y,w);else{if(!Array.isArray(d))throw new Error("ajv implementation error");const S=a.const("vSchema",f);y=(0,e.or)(...d.map((C,k)=>_(S,k)))}o.pass(y);function w(){a.assign(y,!1),a.forOf("v",f,S=>a.if((0,e._)`${b()}(${l}, ${S})`,()=>a.assign(y,!0).break()))}function _(S,C){const k=d[C];return typeof k=="object"&&k!==null?(0,e._)`${b()}(${l}, ${S}[${C}])`:(0,e._)`${l} === ${k}`}}};return Zg.default=i,Zg}var _D;function zwe(){if(_D)return Vg;_D=1,Object.defineProperty(Vg,"__esModule",{value:!0});const e=kwe(),t=jwe(),r=Awe(),n=Dwe(),i=Mwe(),o=Nwe(),a=Fwe(),l=Lwe(),c=Bwe(),d=Vwe(),f=[e.default,t.default,r.default,n.default,i.default,o.default,a.default,l.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},c.default,d.default];return Vg.default=f,Vg}var ey={},gd={},xD;function M3(){if(xD)return gd;xD=1,Object.defineProperty(gd,"__esModule",{value:!0}),gd.validateAdditionalItems=void 0;const e=Dt(),t=Jt(),n={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:o}})=>(0,e.str)`must NOT have more than ${o} items`,params:({params:{len:o}})=>(0,e._)`{limit: ${o}}`},code(o){const{parentSchema:a,it:l}=o,{items:c}=a;if(!Array.isArray(c)){(0,t.checkStrictMode)(l,'"additionalItems" is ignored when "items" is not an array of schemas');return}i(o,c)}};function i(o,a){const{gen:l,schema:c,data:d,keyword:f,it:p}=o;p.items=!0;const m=l.const("len",(0,e._)`${d}.length`);if(c===!1)o.setParams({len:a.length}),o.pass((0,e._)`${m} <= ${a.length}`);else if(typeof c=="object"&&!(0,t.alwaysValidSchema)(p,c)){const b=l.var("valid",(0,e._)`${m} <= ${a.length}`);l.if((0,e.not)(b),()=>g(b)),o.ok(b)}function g(b){l.forRange("i",a.length,m,y=>{o.subschema({keyword:f,dataProp:y,dataPropType:t.Type.Num},b),p.allErrors||l.if((0,e.not)(b),()=>l.break())})}}return gd.validateAdditionalItems=i,gd.default=n,gd}var ty={},yd={},PD;function N3(){if(PD)return yd;PD=1,Object.defineProperty(yd,"__esModule",{value:!0}),yd.validateTuple=void 0;const e=Dt(),t=Jt(),r=Sa(),n={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(o){const{schema:a,it:l}=o;if(Array.isArray(a))return i(o,"additionalItems",a);l.items=!0,!(0,t.alwaysValidSchema)(l,a)&&o.ok((0,r.validateArray)(o))}};function i(o,a,l=o.schema){const{gen:c,parentSchema:d,data:f,keyword:p,it:m}=o;y(d),m.opts.unevaluated&&l.length&&m.items!==!0&&(m.items=t.mergeEvaluated.items(c,l.length,m.items));const g=c.name("valid"),b=c.const("len",(0,e._)`${f}.length`);l.forEach((w,_)=>{(0,t.alwaysValidSchema)(m,w)||(c.if((0,e._)`${b} > ${_}`,()=>o.subschema({keyword:p,schemaProp:_,dataProp:_},g)),o.ok(g))});function y(w){const{opts:_,errSchemaPath:S}=m,C=l.length,k=C===w.minItems&&(C===w.maxItems||w[a]===!1);if(_.strictTuples&&!k){const E=`"${p}" is ${C}-tuple, but minItems or maxItems/${a} are not specified or different at path "${S}"`;(0,t.checkStrictMode)(m,E,_.strictTuples)}}}return yd.validateTuple=i,yd.default=n,yd}var CD;function qwe(){if(CD)return ty;CD=1,Object.defineProperty(ty,"__esModule",{value:!0});const e=N3(),t={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:r=>(0,e.validateTuple)(r,"items")};return ty.default=t,ty}var ry={},ED;function Uwe(){if(ED)return ry;ED=1,Object.defineProperty(ry,"__esModule",{value:!0});const e=Dt(),t=Jt(),r=Sa(),n=M3(),o={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:a}})=>(0,e.str)`must NOT have more than ${a} items`,params:({params:{len:a}})=>(0,e._)`{limit: ${a}}`},code(a){const{schema:l,parentSchema:c,it:d}=a,{prefixItems:f}=c;d.items=!0,!(0,t.alwaysValidSchema)(d,l)&&(f?(0,n.validateAdditionalItems)(a,f):a.ok((0,r.validateArray)(a)))}};return ry.default=o,ry}var ny={},TD;function Hwe(){if(TD)return ny;TD=1,Object.defineProperty(ny,"__esModule",{value:!0});const e=Dt(),t=Jt(),n={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:i,max:o}})=>o===void 0?(0,e.str)`must contain at least ${i} valid item(s)`:(0,e.str)`must contain at least ${i} and no more than ${o} valid item(s)`,params:({params:{min:i,max:o}})=>o===void 0?(0,e._)`{minContains: ${i}}`:(0,e._)`{minContains: ${i}, maxContains: ${o}}`},code(i){const{gen:o,schema:a,parentSchema:l,data:c,it:d}=i;let f,p;const{minContains:m,maxContains:g}=l;d.opts.next?(f=m===void 0?1:m,p=g):f=1;const b=o.const("len",(0,e._)`${c}.length`);if(i.setParams({min:f,max:p}),p===void 0&&f===0){(0,t.checkStrictMode)(d,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(p!==void 0&&f>p){(0,t.checkStrictMode)(d,'"minContains" > "maxContains" is always invalid'),i.fail();return}if((0,t.alwaysValidSchema)(d,a)){let C=(0,e._)`${b} >= ${f}`;p!==void 0&&(C=(0,e._)`${C} && ${b} <= ${p}`),i.pass(C);return}d.items=!0;const y=o.name("valid");p===void 0&&f===1?_(y,()=>o.if(y,()=>o.break())):f===0?(o.let(y,!0),p!==void 0&&o.if((0,e._)`${c}.length > 0`,w)):(o.let(y,!1),w()),i.result(y,()=>i.reset());function w(){const C=o.name("_valid"),k=o.let("count",0);_(C,()=>o.if(C,()=>S(k)))}function _(C,k){o.forRange("i",0,b,E=>{i.subschema({keyword:"contains",dataProp:E,dataPropType:t.Type.Num,compositeRule:!0},C),k()})}function S(C){o.code((0,e._)`${C}++`),p===void 0?o.if((0,e._)`${C} >= ${f}`,()=>o.assign(y,!0).break()):(o.if((0,e._)`${C} > ${p}`,()=>o.assign(y,!1).break()),f===1?o.assign(y,!0):o.if((0,e._)`${C} >= ${f}`,()=>o.assign(y,!0)))}}};return ny.default=n,ny}var K_={},OD;function ET(){return OD||(OD=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=Dt(),r=Jt(),n=Sa();e.error={message:({params:{property:c,depsCount:d,deps:f}})=>{const p=d===1?"property":"properties";return(0,t.str)`must have ${p} ${f} when property ${c} is present`},params:({params:{property:c,depsCount:d,deps:f,missingProperty:p}})=>(0,t._)`{property: ${c},
|
1405
|
+
|| ${A} === "boolean" || ${R} === null`).assign(M,(0,n._)`[${R}]`)}}}function m({gen:S,parentData:C,parentDataProperty:k},E){S.if((0,n._)`${C} !== undefined`,()=>S.assign((0,n._)`${C}[${k}]`,E))}function g(S,C,k,E=o.Correct){const R=E===o.Correct?n.operators.EQ:n.operators.NEQ;let T;switch(S){case"null":return(0,n._)`${C} ${R} null`;case"array":T=(0,n._)`Array.isArray(${C})`;break;case"object":T=(0,n._)`${C} && typeof ${C} == "object" && !Array.isArray(${C})`;break;case"integer":T=A((0,n._)`!(${C} % 1) && !isNaN(${C})`);break;case"number":T=A();break;default:return(0,n._)`typeof ${C} ${R} ${S}`}return E===o.Correct?T:(0,n.not)(T);function A(M=n.nil){return(0,n.and)((0,n._)`typeof ${C} == "number"`,M,k?(0,n._)`isFinite(${C})`:n.nil)}}Gn.checkDataType=g;function b(S,C,k,E){if(S.length===1)return g(S[0],C,k,E);let R;const T=(0,i.toHash)(S);if(T.array&&T.object){const A=(0,n._)`typeof ${C} != "object"`;R=T.null?A:(0,n._)`!${C} || ${A}`,delete T.null,delete T.array,delete T.object}else R=n.nil;T.number&&delete T.integer;for(const A in T)R=(0,n.and)(R,g(A,C,k,E));return R}Gn.checkDataTypes=b;const y={message:({schema:S})=>`must be ${S}`,params:({schema:S,schemaValue:C})=>typeof S=="string"?(0,n._)`{type: ${S}}`:(0,n._)`{type: ${C}}`};function w(S){const C=_(S);(0,r.reportError)(C,y)}Gn.reportTypeError=w;function _(S){const{gen:C,data:k,schema:E}=S,R=(0,i.schemaRefOrVal)(S,E,"type");return{gen:C,keyword:"type",data:k,schema:E.type,schemaCode:R,schemaValue:R,parentSchema:E,params:{},it:S}}return Gn}var zh={},K2;function pwe(){if(K2)return zh;K2=1,Object.defineProperty(zh,"__esModule",{value:!0}),zh.assignDefaults=void 0;const e=Dt(),t=Jt();function r(i,o){const{properties:a,items:l}=i.schema;if(o==="object"&&a)for(const c in a)n(i,c,a[c].default);else o==="array"&&Array.isArray(l)&&l.forEach((c,d)=>n(i,d,c.default))}zh.assignDefaults=r;function n(i,o,a){const{gen:l,compositeRule:c,data:d,opts:f}=i;if(a===void 0)return;const p=(0,e._)`${d}${(0,e.getProperty)(o)}`;if(c){(0,t.checkStrictMode)(i,`default is ignored for: ${p}`);return}let m=(0,e._)`${p} === undefined`;f.useDefaults==="empty"&&(m=(0,e._)`${m} || ${p} === null || ${p} === ""`),l.if(m,(0,e._)`${p} = ${(0,e.stringify)(a)}`)}return zh}var ia={},Pr={},G2;function Sa(){if(G2)return Pr;G2=1,Object.defineProperty(Pr,"__esModule",{value:!0}),Pr.validateUnion=Pr.validateArray=Pr.usePattern=Pr.callValidateCode=Pr.schemaProperties=Pr.allSchemaProperties=Pr.noPropertyInData=Pr.propertyInData=Pr.isOwnProperty=Pr.hasPropFunc=Pr.reportMissingProp=Pr.checkMissingProp=Pr.checkReportMissingProp=void 0;const e=Dt(),t=Jt(),r=wa(),n=Jt();function i(S,C){const{gen:k,data:E,it:R}=S;k.if(f(k,E,C,R.opts.ownProperties),()=>{S.setParams({missingProperty:(0,e._)`${C}`},!0),S.error()})}Pr.checkReportMissingProp=i;function o({gen:S,data:C,it:{opts:k}},E,R){return(0,e.or)(...E.map(T=>(0,e.and)(f(S,C,T,k.ownProperties),(0,e._)`${R} = ${T}`)))}Pr.checkMissingProp=o;function a(S,C){S.setParams({missingProperty:C},!0),S.error()}Pr.reportMissingProp=a;function l(S){return S.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,e._)`Object.prototype.hasOwnProperty`})}Pr.hasPropFunc=l;function c(S,C,k){return(0,e._)`${l(S)}.call(${C}, ${k})`}Pr.isOwnProperty=c;function d(S,C,k,E){const R=(0,e._)`${C}${(0,e.getProperty)(k)} !== undefined`;return E?(0,e._)`${R} && ${c(S,C,k)}`:R}Pr.propertyInData=d;function f(S,C,k,E){const R=(0,e._)`${C}${(0,e.getProperty)(k)} === undefined`;return E?(0,e.or)(R,(0,e.not)(c(S,C,k))):R}Pr.noPropertyInData=f;function p(S){return S?Object.keys(S).filter(C=>C!=="__proto__"):[]}Pr.allSchemaProperties=p;function m(S,C){return p(C).filter(k=>!(0,t.alwaysValidSchema)(S,C[k]))}Pr.schemaProperties=m;function g({schemaCode:S,data:C,it:{gen:k,topSchemaRef:E,schemaPath:R,errorPath:T},it:A},M,B,Q){const se=Q?(0,e._)`${S}, ${C}, ${E}${R}`:C,ie=[[r.default.instancePath,(0,e.strConcat)(r.default.instancePath,T)],[r.default.parentData,A.parentData],[r.default.parentDataProperty,A.parentDataProperty],[r.default.rootData,r.default.rootData]];A.opts.dynamicRef&&ie.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);const N=(0,e._)`${se}, ${k.object(...ie)}`;return B!==e.nil?(0,e._)`${M}.call(${B}, ${N})`:(0,e._)`${M}(${N})`}Pr.callValidateCode=g;const b=(0,e._)`new RegExp`;function y({gen:S,it:{opts:C}},k){const E=C.unicodeRegExp?"u":"",{regExp:R}=C.code,T=R(k,E);return S.scopeValue("pattern",{key:T.toString(),ref:T,code:(0,e._)`${R.code==="new RegExp"?b:(0,n.useFunc)(S,R)}(${k}, ${E})`})}Pr.usePattern=y;function w(S){const{gen:C,data:k,keyword:E,it:R}=S,T=C.name("valid");if(R.allErrors){const M=C.let("valid",!0);return A(()=>C.assign(M,!1)),M}return C.var(T,!0),A(()=>C.break()),T;function A(M){const B=C.const("len",(0,e._)`${k}.length`);C.forRange("i",0,B,Q=>{S.subschema({keyword:E,dataProp:Q,dataPropType:t.Type.Num},T),C.if((0,e.not)(T),M)})}}Pr.validateArray=w;function _(S){const{gen:C,schema:k,keyword:E,it:R}=S;if(!Array.isArray(k))throw new Error("ajv implementation error");if(k.some(B=>(0,t.alwaysValidSchema)(R,B))&&!R.opts.unevaluated)return;const A=C.let("valid",!1),M=C.name("_valid");C.block(()=>k.forEach((B,Q)=>{const se=S.subschema({keyword:E,schemaProp:Q,compositeRule:!0},M);C.assign(A,(0,e._)`${A} || ${M}`),S.mergeValidEvaluated(se,M)||C.if((0,e.not)(A))})),S.result(A,()=>S.reset(),()=>S.error(!0))}return Pr.validateUnion=_,Pr}var Q2;function mwe(){if(Q2)return ia;Q2=1,Object.defineProperty(ia,"__esModule",{value:!0}),ia.validateKeywordUsage=ia.validSchemaType=ia.funcKeywordCode=ia.macroKeywordCode=void 0;const e=Dt(),t=wa(),r=Sa(),n=yw();function i(m,g){const{gen:b,keyword:y,schema:w,parentSchema:_,it:S}=m,C=g.macro.call(S.self,w,_,S),k=d(b,y,C);S.opts.validateSchema!==!1&&S.self.validateSchema(C,!0);const E=b.name("valid");m.subschema({schema:C,schemaPath:e.nil,errSchemaPath:`${S.errSchemaPath}/${y}`,topSchemaRef:k,compositeRule:!0},E),m.pass(E,()=>m.error(!0))}ia.macroKeywordCode=i;function o(m,g){var b;const{gen:y,keyword:w,schema:_,parentSchema:S,$data:C,it:k}=m;c(k,g);const E=!C&&g.compile?g.compile.call(k.self,_,S,k):g.validate,R=d(y,w,E),T=y.let("valid");m.block$data(T,A),m.ok((b=g.valid)!==null&&b!==void 0?b:T);function A(){if(g.errors===!1)Q(),g.modifying&&a(m),se(()=>m.error());else{const ie=g.async?M():B();g.modifying&&a(m),se(()=>l(m,ie))}}function M(){const ie=y.let("ruleErrs",null);return y.try(()=>Q((0,e._)`await `),N=>y.assign(T,!1).if((0,e._)`${N} instanceof ${k.ValidationError}`,()=>y.assign(ie,(0,e._)`${N}.errors`),()=>y.throw(N))),ie}function B(){const ie=(0,e._)`${R}.errors`;return y.assign(ie,null),Q(e.nil),ie}function Q(ie=g.async?(0,e._)`await `:e.nil){const N=k.opts.passContext?t.default.this:t.default.self,X=!("compile"in g&&!C||g.schema===!1);y.assign(T,(0,e._)`${ie}${(0,r.callValidateCode)(m,R,N,X)}`,g.modifying)}function se(ie){var N;y.if((0,e.not)((N=g.valid)!==null&&N!==void 0?N:T),ie)}}ia.funcKeywordCode=o;function a(m){const{gen:g,data:b,it:y}=m;g.if(y.parentData,()=>g.assign(b,(0,e._)`${y.parentData}[${y.parentDataProperty}]`))}function l(m,g){const{gen:b}=m;b.if((0,e._)`Array.isArray(${g})`,()=>{b.assign(t.default.vErrors,(0,e._)`${t.default.vErrors} === null ? ${g} : ${t.default.vErrors}.concat(${g})`).assign(t.default.errors,(0,e._)`${t.default.vErrors}.length`),(0,n.extendErrors)(m)},()=>m.error())}function c({schemaEnv:m},g){if(g.async&&!m.$async)throw new Error("async keyword in sync schema")}function d(m,g,b){if(b===void 0)throw new Error(`keyword "${g}" failed to compile`);return m.scopeValue("keyword",typeof b=="function"?{ref:b}:{ref:b,code:(0,e.stringify)(b)})}function f(m,g,b=!1){return!g.length||g.some(y=>y==="array"?Array.isArray(m):y==="object"?m&&typeof m=="object"&&!Array.isArray(m):typeof m==y||b&&typeof m>"u")}ia.validSchemaType=f;function p({schema:m,opts:g,self:b,errSchemaPath:y},w,_){if(Array.isArray(w.keyword)?!w.keyword.includes(_):w.keyword!==_)throw new Error("ajv implementation error");const S=w.dependencies;if(S!=null&&S.some(C=>!Object.prototype.hasOwnProperty.call(m,C)))throw new Error(`parent schema must have dependencies of ${_}: ${S.join(",")}`);if(w.validateSchema&&!w.validateSchema(m[_])){const k=`keyword "${_}" value is invalid at path "${y}": `+b.errorsText(w.validateSchema.errors);if(g.validateSchema==="log")b.logger.error(k);else throw new Error(k)}}return ia.validateKeywordUsage=p,ia}var ws={},Y2;function vwe(){if(Y2)return ws;Y2=1,Object.defineProperty(ws,"__esModule",{value:!0}),ws.extendSubschemaMode=ws.extendSubschemaData=ws.getSubschema=void 0;const e=Dt(),t=Jt();function r(o,{keyword:a,schemaProp:l,schema:c,schemaPath:d,errSchemaPath:f,topSchemaRef:p}){if(a!==void 0&&c!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(a!==void 0){const m=o.schema[a];return l===void 0?{schema:m,schemaPath:(0,e._)`${o.schemaPath}${(0,e.getProperty)(a)}`,errSchemaPath:`${o.errSchemaPath}/${a}`}:{schema:m[l],schemaPath:(0,e._)`${o.schemaPath}${(0,e.getProperty)(a)}${(0,e.getProperty)(l)}`,errSchemaPath:`${o.errSchemaPath}/${a}/${(0,t.escapeFragment)(l)}`}}if(c!==void 0){if(d===void 0||f===void 0||p===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:c,schemaPath:d,topSchemaRef:p,errSchemaPath:f}}throw new Error('either "keyword" or "schema" must be passed')}ws.getSubschema=r;function n(o,a,{dataProp:l,dataPropType:c,data:d,dataTypes:f,propertyName:p}){if(d!==void 0&&l!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:m}=a;if(l!==void 0){const{errorPath:b,dataPathArr:y,opts:w}=a,_=m.let("data",(0,e._)`${a.data}${(0,e.getProperty)(l)}`,!0);g(_),o.errorPath=(0,e.str)`${b}${(0,t.getErrorPath)(l,c,w.jsPropertySyntax)}`,o.parentDataProperty=(0,e._)`${l}`,o.dataPathArr=[...y,o.parentDataProperty]}if(d!==void 0){const b=d instanceof e.Name?d:m.let("data",d,!0);g(b),p!==void 0&&(o.propertyName=p)}f&&(o.dataTypes=f);function g(b){o.data=b,o.dataLevel=a.dataLevel+1,o.dataTypes=[],a.definedProperties=new Set,o.parentData=a.data,o.dataNames=[...a.dataNames,b]}}ws.extendSubschemaData=n;function i(o,{jtdDiscriminator:a,jtdMetadata:l,compositeRule:c,createErrors:d,allErrors:f}){c!==void 0&&(o.compositeRule=c),d!==void 0&&(o.createErrors=d),f!==void 0&&(o.allErrors=f),o.jtdDiscriminator=a,o.jtdMetadata=l}return ws.extendSubschemaMode=i,ws}var wi={},H_,X2;function D3(){return X2||(X2=1,H_=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,i,o;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!e(t[i],r[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(o=Object.keys(t),n=o.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;i--!==0;){var a=o[i];if(!e(t[a],r[a]))return!1}return!0}return t!==t&&r!==r}),H_}var W_={exports:{}},J2;function gwe(){if(J2)return W_.exports;J2=1;var e=W_.exports=function(n,i,o){typeof i=="function"&&(o=i,i={}),o=i.cb||o;var a=typeof o=="function"?o:o.pre||function(){},l=o.post||function(){};t(i,a,l,n,"",n)};e.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},e.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},e.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},e.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function t(n,i,o,a,l,c,d,f,p,m){if(a&&typeof a=="object"&&!Array.isArray(a)){i(a,l,c,d,f,p,m);for(var g in a){var b=a[g];if(Array.isArray(b)){if(g in e.arrayKeywords)for(var y=0;y<b.length;y++)t(n,i,o,b[y],l+"/"+g+"/"+y,c,l,g,a,y)}else if(g in e.propsKeywords){if(b&&typeof b=="object")for(var w in b)t(n,i,o,b[w],l+"/"+g+"/"+r(w),c,l,g,a,w)}else(g in e.keywords||n.allKeys&&!(g in e.skipKeywords))&&t(n,i,o,b,l+"/"+g,c,l,g,a)}o(a,l,c,d,f,p,m)}}function r(n){return n.replace(/~/g,"~0").replace(/\//g,"~1")}return W_.exports}var Z2;function bw(){if(Z2)return wi;Z2=1,Object.defineProperty(wi,"__esModule",{value:!0}),wi.getSchemaRefs=wi.resolveUrl=wi.normalizeId=wi._getFullPath=wi.getFullPath=wi.inlineRef=void 0;const e=Jt(),t=D3(),r=gwe(),n=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function i(y,w=!0){return typeof y=="boolean"?!0:w===!0?!a(y):w?l(y)<=w:!1}wi.inlineRef=i;const o=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function a(y){for(const w in y){if(o.has(w))return!0;const _=y[w];if(Array.isArray(_)&&_.some(a)||typeof _=="object"&&a(_))return!0}return!1}function l(y){let w=0;for(const _ in y){if(_==="$ref")return 1/0;if(w++,!n.has(_)&&(typeof y[_]=="object"&&(0,e.eachItem)(y[_],S=>w+=l(S)),w===1/0))return 1/0}return w}function c(y,w="",_){_!==!1&&(w=p(w));const S=y.parse(w);return d(y,S)}wi.getFullPath=c;function d(y,w){return y.serialize(w).split("#")[0]+"#"}wi._getFullPath=d;const f=/#\/?$/;function p(y){return y?y.replace(f,""):""}wi.normalizeId=p;function m(y,w,_){return _=p(_),y.resolve(w,_)}wi.resolveUrl=m;const g=/^[a-z_][-a-z0-9._]*$/i;function b(y,w){if(typeof y=="boolean")return{};const{schemaId:_,uriResolver:S}=this.opts,C=p(y[_]||w),k={"":C},E=c(S,C,!1),R={},T=new Set;return r(y,{allKeys:!0},(B,Q,se,ie)=>{if(ie===void 0)return;const N=E+Q;let X=k[ie];typeof B[_]=="string"&&(X=ce.call(this,B[_])),ne.call(this,B.$anchor),ne.call(this,B.$dynamicAnchor),k[Q]=X;function ce(ee){const ge=this.opts.uriResolver.resolve;if(ee=p(X?ge(X,ee):ee),T.has(ee))throw M(ee);T.add(ee);let Z=this.refs[ee];return typeof Z=="string"&&(Z=this.refs[Z]),typeof Z=="object"?A(B,Z.schema,ee):ee!==p(N)&&(ee[0]==="#"?(A(B,R[ee],ee),R[ee]=B):this.refs[ee]=N),ee}function ne(ee){if(typeof ee=="string"){if(!g.test(ee))throw new Error(`invalid anchor "${ee}"`);ce.call(this,`#${ee}`)}}}),R;function A(B,Q,se){if(Q!==void 0&&!t(B,Q))throw M(se)}function M(B){return new Error(`reference "${B}" resolves to more than one schema`)}}return wi.getSchemaRefs=b,wi}var eD;function ww(){if(eD)return ys;eD=1,Object.defineProperty(ys,"__esModule",{value:!0}),ys.getData=ys.KeywordCxt=ys.validateFunctionCode=void 0;const e=hwe(),t=n0(),r=A3(),n=n0(),i=pwe(),o=mwe(),a=vwe(),l=Dt(),c=wa(),d=bw(),f=Jt(),p=yw();function m(Y){if(E(Y)&&(T(Y),k(Y))){w(Y);return}g(Y,()=>(0,e.topBoolOrEmptySchema)(Y))}ys.validateFunctionCode=m;function g({gen:Y,validateName:K,schema:we,schemaEnv:Te,opts:he},Ce){he.code.es5?Y.func(K,(0,l._)`${c.default.data}, ${c.default.valCxt}`,Te.$async,()=>{Y.code((0,l._)`"use strict"; ${S(we,he)}`),y(Y,he),Y.code(Ce)}):Y.func(K,(0,l._)`${c.default.data}, ${b(he)}`,Te.$async,()=>Y.code(S(we,he)).code(Ce))}function b(Y){return(0,l._)`{${c.default.instancePath}="", ${c.default.parentData}, ${c.default.parentDataProperty}, ${c.default.rootData}=${c.default.data}${Y.dynamicRef?(0,l._)`, ${c.default.dynamicAnchors}={}`:l.nil}}={}`}function y(Y,K){Y.if(c.default.valCxt,()=>{Y.var(c.default.instancePath,(0,l._)`${c.default.valCxt}.${c.default.instancePath}`),Y.var(c.default.parentData,(0,l._)`${c.default.valCxt}.${c.default.parentData}`),Y.var(c.default.parentDataProperty,(0,l._)`${c.default.valCxt}.${c.default.parentDataProperty}`),Y.var(c.default.rootData,(0,l._)`${c.default.valCxt}.${c.default.rootData}`),K.dynamicRef&&Y.var(c.default.dynamicAnchors,(0,l._)`${c.default.valCxt}.${c.default.dynamicAnchors}`)},()=>{Y.var(c.default.instancePath,(0,l._)`""`),Y.var(c.default.parentData,(0,l._)`undefined`),Y.var(c.default.parentDataProperty,(0,l._)`undefined`),Y.var(c.default.rootData,c.default.data),K.dynamicRef&&Y.var(c.default.dynamicAnchors,(0,l._)`{}`)})}function w(Y){const{schema:K,opts:we,gen:Te}=Y;g(Y,()=>{we.$comment&&K.$comment&&ie(Y),B(Y),Te.let(c.default.vErrors,null),Te.let(c.default.errors,0),we.unevaluated&&_(Y),A(Y),N(Y)})}function _(Y){const{gen:K,validateName:we}=Y;Y.evaluated=K.const("evaluated",(0,l._)`${we}.evaluated`),K.if((0,l._)`${Y.evaluated}.dynamicProps`,()=>K.assign((0,l._)`${Y.evaluated}.props`,(0,l._)`undefined`)),K.if((0,l._)`${Y.evaluated}.dynamicItems`,()=>K.assign((0,l._)`${Y.evaluated}.items`,(0,l._)`undefined`))}function S(Y,K){const we=typeof Y=="object"&&Y[K.schemaId];return we&&(K.code.source||K.code.process)?(0,l._)`/*# sourceURL=${we} */`:l.nil}function C(Y,K){if(E(Y)&&(T(Y),k(Y))){R(Y,K);return}(0,e.boolOrEmptySchema)(Y,K)}function k({schema:Y,self:K}){if(typeof Y=="boolean")return!Y;for(const we in Y)if(K.RULES.all[we])return!0;return!1}function E(Y){return typeof Y.schema!="boolean"}function R(Y,K){const{schema:we,gen:Te,opts:he}=Y;he.$comment&&we.$comment&&ie(Y),Q(Y),se(Y);const Ce=Te.const("_errs",c.default.errors);A(Y,Ce),Te.var(K,(0,l._)`${Ce} === ${c.default.errors}`)}function T(Y){(0,f.checkUnknownRules)(Y),M(Y)}function A(Y,K){if(Y.opts.jtd)return ce(Y,[],!1,K);const we=(0,t.getSchemaTypes)(Y.schema),Te=(0,t.coerceAndCheckDataType)(Y,we);ce(Y,we,!Te,K)}function M(Y){const{schema:K,errSchemaPath:we,opts:Te,self:he}=Y;K.$ref&&Te.ignoreKeywordsWithRef&&(0,f.schemaHasRulesButRef)(K,he.RULES)&&he.logger.warn(`$ref: keywords ignored in schema at path "${we}"`)}function B(Y){const{schema:K,opts:we}=Y;K.default!==void 0&&we.useDefaults&&we.strictSchema&&(0,f.checkStrictMode)(Y,"default is ignored in the schema root")}function Q(Y){const K=Y.schema[Y.opts.schemaId];K&&(Y.baseId=(0,d.resolveUrl)(Y.opts.uriResolver,Y.baseId,K))}function se(Y){if(Y.schema.$async&&!Y.schemaEnv.$async)throw new Error("async schema in sync schema")}function ie({gen:Y,schemaEnv:K,schema:we,errSchemaPath:Te,opts:he}){const Ce=we.$comment;if(he.$comment===!0)Y.code((0,l._)`${c.default.self}.logger.log(${Ce})`);else if(typeof he.$comment=="function"){const Ge=(0,l.str)`${Te}/$comment`,$t=Y.scopeValue("root",{ref:K.root});Y.code((0,l._)`${c.default.self}.opts.$comment(${Ce}, ${Ge}, ${$t}.schema)`)}}function N(Y){const{gen:K,schemaEnv:we,validateName:Te,ValidationError:he,opts:Ce}=Y;we.$async?K.if((0,l._)`${c.default.errors} === 0`,()=>K.return(c.default.data),()=>K.throw((0,l._)`new ${he}(${c.default.vErrors})`)):(K.assign((0,l._)`${Te}.errors`,c.default.vErrors),Ce.unevaluated&&X(Y),K.return((0,l._)`${c.default.errors} === 0`))}function X({gen:Y,evaluated:K,props:we,items:Te}){we instanceof l.Name&&Y.assign((0,l._)`${K}.props`,we),Te instanceof l.Name&&Y.assign((0,l._)`${K}.items`,Te)}function ce(Y,K,we,Te){const{gen:he,schema:Ce,data:Ge,allErrors:$t,opts:Kt,self:It}=Y,{RULES:jt}=It;if(Ce.$ref&&(Kt.ignoreKeywordsWithRef||!(0,f.schemaHasRulesButRef)(Ce,jt))){he.block(()=>de(Y,"$ref",jt.all.$ref.definition));return}Kt.jtd||ee(Y,K),he.block(()=>{for(const ht of jt.rules)Lt(ht);Lt(jt.post)});function Lt(ht){(0,r.shouldUseGroup)(Ce,ht)&&(ht.type?(he.if((0,n.checkDataType)(ht.type,Ge,Kt.strictNumbers)),ne(Y,ht),K.length===1&&K[0]===ht.type&&we&&(he.else(),(0,n.reportTypeError)(Y)),he.endIf()):ne(Y,ht),$t||he.if((0,l._)`${c.default.errors} === ${Te||0}`))}}function ne(Y,K){const{gen:we,schema:Te,opts:{useDefaults:he}}=Y;he&&(0,i.assignDefaults)(Y,K.type),we.block(()=>{for(const Ce of K.rules)(0,r.shouldUseRule)(Te,Ce)&&de(Y,Ce.keyword,Ce.definition,K.type)})}function ee(Y,K){Y.schemaEnv.meta||!Y.opts.strictTypes||(ge(Y,K),Y.opts.allowUnionTypes||Z(Y,K),j(Y,Y.dataTypes))}function ge(Y,K){if(K.length){if(!Y.dataTypes.length){Y.dataTypes=K;return}K.forEach(we=>{q(Y.dataTypes,we)||F(Y,`type "${we}" not allowed by context "${Y.dataTypes.join(",")}"`)}),$(Y,K)}}function Z(Y,K){K.length>1&&!(K.length===2&&K.includes("null"))&&F(Y,"use allowUnionTypes to allow union type keyword")}function j(Y,K){const we=Y.self.RULES.all;for(const Te in we){const he=we[Te];if(typeof he=="object"&&(0,r.shouldUseRule)(Y.schema,he)){const{type:Ce}=he.definition;Ce.length&&!Ce.some(Ge=>U(K,Ge))&&F(Y,`missing type "${Ce.join(",")}" for keyword "${Te}"`)}}}function U(Y,K){return Y.includes(K)||K==="number"&&Y.includes("integer")}function q(Y,K){return Y.includes(K)||K==="integer"&&Y.includes("number")}function $(Y,K){const we=[];for(const Te of Y.dataTypes)q(K,Te)?we.push(Te):K.includes("integer")&&Te==="number"&&we.push("integer");Y.dataTypes=we}function F(Y,K){const we=Y.schemaEnv.baseId+Y.errSchemaPath;K+=` at "${we}" (strictTypes)`,(0,f.checkStrictMode)(Y,K,Y.opts.strictTypes)}class V{constructor(K,we,Te){if((0,o.validateKeywordUsage)(K,we,Te),this.gen=K.gen,this.allErrors=K.allErrors,this.keyword=Te,this.data=K.data,this.schema=K.schema[Te],this.$data=we.$data&&K.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,f.schemaRefOrVal)(K,this.schema,Te,this.$data),this.schemaType=we.schemaType,this.parentSchema=K.schema,this.params={},this.it=K,this.def=we,this.$data)this.schemaCode=K.gen.const("vSchema",Me(this.$data,K));else if(this.schemaCode=this.schemaValue,!(0,o.validSchemaType)(this.schema,we.schemaType,we.allowUndefined))throw new Error(`${Te} value must be ${JSON.stringify(we.schemaType)}`);("code"in we?we.trackErrors:we.errors!==!1)&&(this.errsCount=K.gen.const("_errs",c.default.errors))}result(K,we,Te){this.failResult((0,l.not)(K),we,Te)}failResult(K,we,Te){this.gen.if(K),Te?Te():this.error(),we?(this.gen.else(),we(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(K,we){this.failResult((0,l.not)(K),void 0,we)}fail(K){if(K===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(K),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(K){if(!this.$data)return this.fail(K);const{schemaCode:we}=this;this.fail((0,l._)`${we} !== undefined && (${(0,l.or)(this.invalid$data(),K)})`)}error(K,we,Te){if(we){this.setParams(we),this._error(K,Te),this.setParams({});return}this._error(K,Te)}_error(K,we){(K?p.reportExtraError:p.reportError)(this,this.def.error,we)}$dataError(){(0,p.reportError)(this,this.def.$dataError||p.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,p.resetErrorsCount)(this.gen,this.errsCount)}ok(K){this.allErrors||this.gen.if(K)}setParams(K,we){we?Object.assign(this.params,K):this.params=K}block$data(K,we,Te=l.nil){this.gen.block(()=>{this.check$data(K,Te),we()})}check$data(K=l.nil,we=l.nil){if(!this.$data)return;const{gen:Te,schemaCode:he,schemaType:Ce,def:Ge}=this;Te.if((0,l.or)((0,l._)`${he} === undefined`,we)),K!==l.nil&&Te.assign(K,!0),(Ce.length||Ge.validateSchema)&&(Te.elseIf(this.invalid$data()),this.$dataError(),K!==l.nil&&Te.assign(K,!1)),Te.else()}invalid$data(){const{gen:K,schemaCode:we,schemaType:Te,def:he,it:Ce}=this;return(0,l.or)(Ge(),$t());function Ge(){if(Te.length){if(!(we instanceof l.Name))throw new Error("ajv implementation error");const Kt=Array.isArray(Te)?Te:[Te];return(0,l._)`${(0,n.checkDataTypes)(Kt,we,Ce.opts.strictNumbers,n.DataType.Wrong)}`}return l.nil}function $t(){if(he.validateSchema){const Kt=K.scopeValue("validate$data",{ref:he.validateSchema});return(0,l._)`!${Kt}(${we})`}return l.nil}}subschema(K,we){const Te=(0,a.getSubschema)(this.it,K);(0,a.extendSubschemaData)(Te,this.it,K),(0,a.extendSubschemaMode)(Te,K);const he={...this.it,...Te,items:void 0,props:void 0};return C(he,we),he}mergeEvaluated(K,we){const{it:Te,gen:he}=this;Te.opts.unevaluated&&(Te.props!==!0&&K.props!==void 0&&(Te.props=f.mergeEvaluated.props(he,K.props,Te.props,we)),Te.items!==!0&&K.items!==void 0&&(Te.items=f.mergeEvaluated.items(he,K.items,Te.items,we)))}mergeValidEvaluated(K,we){const{it:Te,gen:he}=this;if(Te.opts.unevaluated&&(Te.props!==!0||Te.items!==!0))return he.if(we,()=>this.mergeEvaluated(K,l.Name)),!0}}ys.KeywordCxt=V;function de(Y,K,we,Te){const he=new V(Y,we,K);"code"in we?we.code(he,Te):he.$data&&we.validate?(0,o.funcKeywordCode)(he,we):"macro"in we?(0,o.macroKeywordCode)(he,we):(we.compile||we.validate)&&(0,o.funcKeywordCode)(he,we)}const pe=/^\/(?:[^~]|~0|~1)*$/,Ee=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Me(Y,{dataLevel:K,dataNames:we,dataPathArr:Te}){let he,Ce;if(Y==="")return c.default.rootData;if(Y[0]==="/"){if(!pe.test(Y))throw new Error(`Invalid JSON-pointer: ${Y}`);he=Y,Ce=c.default.rootData}else{const It=Ee.exec(Y);if(!It)throw new Error(`Invalid JSON-pointer: ${Y}`);const jt=+It[1];if(he=It[2],he==="#"){if(jt>=K)throw new Error(Kt("property/index",jt));return Te[K-jt]}if(jt>K)throw new Error(Kt("data",jt));if(Ce=we[K-jt],!he)return Ce}let Ge=Ce;const $t=he.split("/");for(const It of $t)It&&(Ce=(0,l._)`${Ce}${(0,l.getProperty)((0,f.unescapeJsonPointer)(It))}`,Ge=(0,l._)`${Ge} && ${Ce}`);return Ge;function Kt(It,jt){return`Cannot access ${It} ${jt} levels up, current level is ${K}`}}return ys.getData=Me,ys}var Dg={},tD;function xT(){if(tD)return Dg;tD=1,Object.defineProperty(Dg,"__esModule",{value:!0});class e extends Error{constructor(r){super("validation failed"),this.errors=r,this.ajv=this.validation=!0}}return Dg.default=e,Dg}var Mg={},rD;function Sw(){if(rD)return Mg;rD=1,Object.defineProperty(Mg,"__esModule",{value:!0});const e=bw();class t extends Error{constructor(n,i,o,a){super(a||`can't resolve reference ${o} from id ${i}`),this.missingRef=(0,e.resolveUrl)(n,i,o),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(n,this.missingRef))}}return Mg.default=t,Mg}var ro={},nD;function _w(){if(nD)return ro;nD=1,Object.defineProperty(ro,"__esModule",{value:!0}),ro.resolveSchema=ro.getCompilingSchema=ro.resolveRef=ro.compileSchema=ro.SchemaEnv=void 0;const e=Dt(),t=xT(),r=wa(),n=bw(),i=Jt(),o=ww();class a{constructor(_){var S;this.refs={},this.dynamicAnchors={};let C;typeof _.schema=="object"&&(C=_.schema),this.schema=_.schema,this.schemaId=_.schemaId,this.root=_.root||this,this.baseId=(S=_.baseId)!==null&&S!==void 0?S:(0,n.normalizeId)(C==null?void 0:C[_.schemaId||"$id"]),this.schemaPath=_.schemaPath,this.localRefs=_.localRefs,this.meta=_.meta,this.$async=C==null?void 0:C.$async,this.refs={}}}ro.SchemaEnv=a;function l(w){const _=f.call(this,w);if(_)return _;const S=(0,n.getFullPath)(this.opts.uriResolver,w.root.baseId),{es5:C,lines:k}=this.opts.code,{ownProperties:E}=this.opts,R=new e.CodeGen(this.scope,{es5:C,lines:k,ownProperties:E});let T;w.$async&&(T=R.scopeValue("Error",{ref:t.default,code:(0,e._)`require("ajv/dist/runtime/validation_error").default`}));const A=R.scopeName("validate");w.validateName=A;const M={gen:R,allErrors:this.opts.allErrors,data:r.default.data,parentData:r.default.parentData,parentDataProperty:r.default.parentDataProperty,dataNames:[r.default.data],dataPathArr:[e.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:R.scopeValue("schema",this.opts.code.source===!0?{ref:w.schema,code:(0,e.stringify)(w.schema)}:{ref:w.schema}),validateName:A,ValidationError:T,schema:w.schema,schemaEnv:w,rootId:S,baseId:w.baseId||S,schemaPath:e.nil,errSchemaPath:w.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,e._)`""`,opts:this.opts,self:this};let B;try{this._compilations.add(w),(0,o.validateFunctionCode)(M),R.optimize(this.opts.code.optimize);const Q=R.toString();B=`${R.scopeRefs(r.default.scope)}return ${Q}`,this.opts.code.process&&(B=this.opts.code.process(B,w));const ie=new Function(`${r.default.self}`,`${r.default.scope}`,B)(this,this.scope.get());if(this.scope.value(A,{ref:ie}),ie.errors=null,ie.schema=w.schema,ie.schemaEnv=w,w.$async&&(ie.$async=!0),this.opts.code.source===!0&&(ie.source={validateName:A,validateCode:Q,scopeValues:R._values}),this.opts.unevaluated){const{props:N,items:X}=M;ie.evaluated={props:N instanceof e.Name?void 0:N,items:X instanceof e.Name?void 0:X,dynamicProps:N instanceof e.Name,dynamicItems:X instanceof e.Name},ie.source&&(ie.source.evaluated=(0,e.stringify)(ie.evaluated))}return w.validate=ie,w}catch(Q){throw delete w.validate,delete w.validateName,B&&this.logger.error("Error compiling schema, function code:",B),Q}finally{this._compilations.delete(w)}}ro.compileSchema=l;function c(w,_,S){var C;S=(0,n.resolveUrl)(this.opts.uriResolver,_,S);const k=w.refs[S];if(k)return k;let E=m.call(this,w,S);if(E===void 0){const R=(C=w.localRefs)===null||C===void 0?void 0:C[S],{schemaId:T}=this.opts;R&&(E=new a({schema:R,schemaId:T,root:w,baseId:_}))}if(E!==void 0)return w.refs[S]=d.call(this,E)}ro.resolveRef=c;function d(w){return(0,n.inlineRef)(w.schema,this.opts.inlineRefs)?w.schema:w.validate?w:l.call(this,w)}function f(w){for(const _ of this._compilations)if(p(_,w))return _}ro.getCompilingSchema=f;function p(w,_){return w.schema===_.schema&&w.root===_.root&&w.baseId===_.baseId}function m(w,_){let S;for(;typeof(S=this.refs[_])=="string";)_=S;return S||this.schemas[_]||g.call(this,w,_)}function g(w,_){const S=this.opts.uriResolver.parse(_),C=(0,n._getFullPath)(this.opts.uriResolver,S);let k=(0,n.getFullPath)(this.opts.uriResolver,w.baseId,void 0);if(Object.keys(w.schema).length>0&&C===k)return y.call(this,S,w);const E=(0,n.normalizeId)(C),R=this.refs[E]||this.schemas[E];if(typeof R=="string"){const T=g.call(this,w,R);return typeof(T==null?void 0:T.schema)!="object"?void 0:y.call(this,S,T)}if(typeof(R==null?void 0:R.schema)=="object"){if(R.validate||l.call(this,R),E===(0,n.normalizeId)(_)){const{schema:T}=R,{schemaId:A}=this.opts,M=T[A];return M&&(k=(0,n.resolveUrl)(this.opts.uriResolver,k,M)),new a({schema:T,schemaId:A,root:w,baseId:k})}return y.call(this,S,R)}}ro.resolveSchema=g;const b=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function y(w,{baseId:_,schema:S,root:C}){var k;if(((k=w.fragment)===null||k===void 0?void 0:k[0])!=="/")return;for(const T of w.fragment.slice(1).split("/")){if(typeof S=="boolean")return;const A=S[(0,i.unescapeFragment)(T)];if(A===void 0)return;S=A;const M=typeof S=="object"&&S[this.opts.schemaId];!b.has(T)&&M&&(_=(0,n.resolveUrl)(this.opts.uriResolver,_,M))}let E;if(typeof S!="boolean"&&S.$ref&&!(0,i.schemaHasRulesButRef)(S,this.RULES)){const T=(0,n.resolveUrl)(this.opts.uriResolver,_,S.$ref);E=g.call(this,C,T)}const{schemaId:R}=this.opts;if(E=E||new a({schema:S,schemaId:R,root:C,baseId:_}),E.schema!==E.root.schema)return E}return ro}const ywe="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",bwe="Meta-schema for $data reference (JSON AnySchema extension proposal)",wwe="object",Swe=["$data"],_we={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},xwe=!1,Pwe={$id:ywe,description:bwe,type:wwe,required:Swe,properties:_we,additionalProperties:xwe};var Ng={},ep={exports:{}};/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */var Cwe=ep.exports,iD;function Ewe(){return iD||(iD=1,function(e,t){(function(r,n){n(t)})(Cwe,function(r){function n(){for(var H=arguments.length,L=Array(H),G=0;G<H;G++)L[G]=arguments[G];if(L.length>1){L[0]=L[0].slice(0,-1);for(var te=L.length-1,ue=1;ue<te;++ue)L[ue]=L[ue].slice(1,-1);return L[te]=L[te].slice(1),L.join("")}else return L[0]}function i(H){return"(?:"+H+")"}function o(H){return H===void 0?"undefined":H===null?"null":Object.prototype.toString.call(H).split(" ").pop().split("]").shift().toLowerCase()}function a(H){return H.toUpperCase()}function l(H){return H!=null?H instanceof Array?H:typeof H.length!="number"||H.split||H.setInterval||H.call?[H]:Array.prototype.slice.call(H):[]}function c(H,L){var G=H;if(L)for(var te in L)G[te]=L[te];return G}function d(H){var L="[A-Za-z]",G="[0-9]",te=n(G,"[A-Fa-f]"),ue=i(i("%[EFef]"+te+"%"+te+te+"%"+te+te)+"|"+i("%[89A-Fa-f]"+te+"%"+te+te)+"|"+i("%"+te+te)),ze="[\\:\\/\\?\\#\\[\\]\\@]",Ye="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",ot=n(ze,Ye),Wt=H?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",nr=H?"[\\uE000-\\uF8FF]":"[]",Pt=n(L,G,"[\\-\\.\\_\\~]",Wt);i(L+n(L,G,"[\\+\\-\\.]")+"*"),i(i(ue+"|"+n(Pt,Ye,"[\\:]"))+"*");var At=i(i("25[0-5]")+"|"+i("2[0-4]"+G)+"|"+i("1"+G+G)+"|"+i("0?[1-9]"+G)+"|0?0?"+G),cr=i(At+"\\."+At+"\\."+At+"\\."+At),ft=i(te+"{1,4}"),Gt=i(i(ft+"\\:"+ft)+"|"+cr),it=i(i(ft+"\\:")+"{6}"+Gt),Ct=i("\\:\\:"+i(ft+"\\:")+"{5}"+Gt),Et=i(i(ft)+"?\\:\\:"+i(ft+"\\:")+"{4}"+Gt),ar=i(i(i(ft+"\\:")+"{0,1}"+ft)+"?\\:\\:"+i(ft+"\\:")+"{3}"+Gt),Fr=i(i(i(ft+"\\:")+"{0,2}"+ft)+"?\\:\\:"+i(ft+"\\:")+"{2}"+Gt),mi=i(i(i(ft+"\\:")+"{0,3}"+ft)+"?\\:\\:"+ft+"\\:"+Gt),ei=i(i(i(ft+"\\:")+"{0,4}"+ft)+"?\\:\\:"+Gt),ti=i(i(i(ft+"\\:")+"{0,5}"+ft)+"?\\:\\:"+ft),vi=i(i(i(ft+"\\:")+"{0,6}"+ft)+"?\\:\\:"),gi=i([it,Ct,Et,ar,Fr,mi,ei,ti,vi].join("|")),ln=i(i(Pt+"|"+ue)+"+");i("[vV]"+te+"+\\."+n(Pt,Ye,"[\\:]")+"+"),i(i(ue+"|"+n(Pt,Ye))+"*");var as=i(ue+"|"+n(Pt,Ye,"[\\:\\@]"));return i(i(ue+"|"+n(Pt,Ye,"[\\@]"))+"+"),i(i(as+"|"+n("[\\/\\?]",nr))+"*"),{NOT_SCHEME:new RegExp(n("[^]",L,G,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(n("[^\\%\\:]",Pt,Ye),"g"),NOT_HOST:new RegExp(n("[^\\%\\[\\]\\:]",Pt,Ye),"g"),NOT_PATH:new RegExp(n("[^\\%\\/\\:\\@]",Pt,Ye),"g"),NOT_PATH_NOSCHEME:new RegExp(n("[^\\%\\/\\@]",Pt,Ye),"g"),NOT_QUERY:new RegExp(n("[^\\%]",Pt,Ye,"[\\:\\@\\/\\?]",nr),"g"),NOT_FRAGMENT:new RegExp(n("[^\\%]",Pt,Ye,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(n("[^]",Pt,Ye),"g"),UNRESERVED:new RegExp(Pt,"g"),OTHER_CHARS:new RegExp(n("[^\\%]",Pt,ot),"g"),PCT_ENCODED:new RegExp(ue,"g"),IPV4ADDRESS:new RegExp("^("+cr+")$"),IPV6ADDRESS:new RegExp("^\\[?("+gi+")"+i(i("\\%25|\\%(?!"+te+"{2})")+"("+ln+")")+"?\\]?$")}}var f=d(!1),p=d(!0),m=function(){function H(L,G){var te=[],ue=!0,ze=!1,Ye=void 0;try{for(var ot=L[Symbol.iterator](),Wt;!(ue=(Wt=ot.next()).done)&&(te.push(Wt.value),!(G&&te.length===G));ue=!0);}catch(nr){ze=!0,Ye=nr}finally{try{!ue&&ot.return&&ot.return()}finally{if(ze)throw Ye}}return te}return function(L,G){if(Array.isArray(L))return L;if(Symbol.iterator in Object(L))return H(L,G);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),g=function(H){if(Array.isArray(H)){for(var L=0,G=Array(H.length);L<H.length;L++)G[L]=H[L];return G}else return Array.from(H)},b=2147483647,y=36,w=1,_=26,S=38,C=700,k=72,E=128,R="-",T=/^xn--/,A=/[^\0-\x7E]/,M=/[\x2E\u3002\uFF0E\uFF61]/g,B={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Q=y-w,se=Math.floor,ie=String.fromCharCode;function N(H){throw new RangeError(B[H])}function X(H,L){for(var G=[],te=H.length;te--;)G[te]=L(H[te]);return G}function ce(H,L){var G=H.split("@"),te="";G.length>1&&(te=G[0]+"@",H=G[1]),H=H.replace(M,".");var ue=H.split("."),ze=X(ue,L).join(".");return te+ze}function ne(H){for(var L=[],G=0,te=H.length;G<te;){var ue=H.charCodeAt(G++);if(ue>=55296&&ue<=56319&&G<te){var ze=H.charCodeAt(G++);(ze&64512)==56320?L.push(((ue&1023)<<10)+(ze&1023)+65536):(L.push(ue),G--)}else L.push(ue)}return L}var ee=function(L){return String.fromCodePoint.apply(String,g(L))},ge=function(L){return L-48<10?L-22:L-65<26?L-65:L-97<26?L-97:y},Z=function(L,G){return L+22+75*(L<26)-((G!=0)<<5)},j=function(L,G,te){var ue=0;for(L=te?se(L/C):L>>1,L+=se(L/G);L>Q*_>>1;ue+=y)L=se(L/Q);return se(ue+(Q+1)*L/(L+S))},U=function(L){var G=[],te=L.length,ue=0,ze=E,Ye=k,ot=L.lastIndexOf(R);ot<0&&(ot=0);for(var Wt=0;Wt<ot;++Wt)L.charCodeAt(Wt)>=128&&N("not-basic"),G.push(L.charCodeAt(Wt));for(var nr=ot>0?ot+1:0;nr<te;){for(var Pt=ue,At=1,cr=y;;cr+=y){nr>=te&&N("invalid-input");var ft=ge(L.charCodeAt(nr++));(ft>=y||ft>se((b-ue)/At))&&N("overflow"),ue+=ft*At;var Gt=cr<=Ye?w:cr>=Ye+_?_:cr-Ye;if(ft<Gt)break;var it=y-Gt;At>se(b/it)&&N("overflow"),At*=it}var Ct=G.length+1;Ye=j(ue-Pt,Ct,Pt==0),se(ue/Ct)>b-ze&&N("overflow"),ze+=se(ue/Ct),ue%=Ct,G.splice(ue++,0,ze)}return String.fromCodePoint.apply(String,G)},q=function(L){var G=[];L=ne(L);var te=L.length,ue=E,ze=0,Ye=k,ot=!0,Wt=!1,nr=void 0;try{for(var Pt=L[Symbol.iterator](),At;!(ot=(At=Pt.next()).done);ot=!0){var cr=At.value;cr<128&&G.push(ie(cr))}}catch(go){Wt=!0,nr=go}finally{try{!ot&&Pt.return&&Pt.return()}finally{if(Wt)throw nr}}var ft=G.length,Gt=ft;for(ft&&G.push(R);Gt<te;){var it=b,Ct=!0,Et=!1,ar=void 0;try{for(var Fr=L[Symbol.iterator](),mi;!(Ct=(mi=Fr.next()).done);Ct=!0){var ei=mi.value;ei>=ue&&ei<it&&(it=ei)}}catch(go){Et=!0,ar=go}finally{try{!Ct&&Fr.return&&Fr.return()}finally{if(Et)throw ar}}var ti=Gt+1;it-ue>se((b-ze)/ti)&&N("overflow"),ze+=(it-ue)*ti,ue=it;var vi=!0,gi=!1,ln=void 0;try{for(var as=L[Symbol.iterator](),ri;!(vi=(ri=as.next()).done);vi=!0){var jc=ri.value;if(jc<ue&&++ze>b&&N("overflow"),jc==ue){for(var Ys=ze,Xs=y;;Xs+=y){var Go=Xs<=Ye?w:Xs>=Ye+_?_:Xs-Ye;if(Ys<Go)break;var ss=Ys-Go,Ca=y-Go;G.push(ie(Z(Go+ss%Ca,0))),Ys=se(ss/Ca)}G.push(ie(Z(Ys,0))),Ye=j(ze,ti,Gt==ft),ze=0,++Gt}}}catch(go){gi=!0,ln=go}finally{try{!vi&&as.return&&as.return()}finally{if(gi)throw ln}}++ze,++ue}return G.join("")},$=function(L){return ce(L,function(G){return T.test(G)?U(G.slice(4).toLowerCase()):G})},F=function(L){return ce(L,function(G){return A.test(G)?"xn--"+q(G):G})},V={version:"2.1.0",ucs2:{decode:ne,encode:ee},decode:U,encode:q,toASCII:F,toUnicode:$},de={};function pe(H){var L=H.charCodeAt(0),G=void 0;return L<16?G="%0"+L.toString(16).toUpperCase():L<128?G="%"+L.toString(16).toUpperCase():L<2048?G="%"+(L>>6|192).toString(16).toUpperCase()+"%"+(L&63|128).toString(16).toUpperCase():G="%"+(L>>12|224).toString(16).toUpperCase()+"%"+(L>>6&63|128).toString(16).toUpperCase()+"%"+(L&63|128).toString(16).toUpperCase(),G}function Ee(H){for(var L="",G=0,te=H.length;G<te;){var ue=parseInt(H.substr(G+1,2),16);if(ue<128)L+=String.fromCharCode(ue),G+=3;else if(ue>=194&&ue<224){if(te-G>=6){var ze=parseInt(H.substr(G+4,2),16);L+=String.fromCharCode((ue&31)<<6|ze&63)}else L+=H.substr(G,6);G+=6}else if(ue>=224){if(te-G>=9){var Ye=parseInt(H.substr(G+4,2),16),ot=parseInt(H.substr(G+7,2),16);L+=String.fromCharCode((ue&15)<<12|(Ye&63)<<6|ot&63)}else L+=H.substr(G,9);G+=9}else L+=H.substr(G,3),G+=3}return L}function Me(H,L){function G(te){var ue=Ee(te);return ue.match(L.UNRESERVED)?ue:te}return H.scheme&&(H.scheme=String(H.scheme).replace(L.PCT_ENCODED,G).toLowerCase().replace(L.NOT_SCHEME,"")),H.userinfo!==void 0&&(H.userinfo=String(H.userinfo).replace(L.PCT_ENCODED,G).replace(L.NOT_USERINFO,pe).replace(L.PCT_ENCODED,a)),H.host!==void 0&&(H.host=String(H.host).replace(L.PCT_ENCODED,G).toLowerCase().replace(L.NOT_HOST,pe).replace(L.PCT_ENCODED,a)),H.path!==void 0&&(H.path=String(H.path).replace(L.PCT_ENCODED,G).replace(H.scheme?L.NOT_PATH:L.NOT_PATH_NOSCHEME,pe).replace(L.PCT_ENCODED,a)),H.query!==void 0&&(H.query=String(H.query).replace(L.PCT_ENCODED,G).replace(L.NOT_QUERY,pe).replace(L.PCT_ENCODED,a)),H.fragment!==void 0&&(H.fragment=String(H.fragment).replace(L.PCT_ENCODED,G).replace(L.NOT_FRAGMENT,pe).replace(L.PCT_ENCODED,a)),H}function Y(H){return H.replace(/^0*(.*)/,"$1")||"0"}function K(H,L){var G=H.match(L.IPV4ADDRESS)||[],te=m(G,2),ue=te[1];return ue?ue.split(".").map(Y).join("."):H}function we(H,L){var G=H.match(L.IPV6ADDRESS)||[],te=m(G,3),ue=te[1],ze=te[2];if(ue){for(var Ye=ue.toLowerCase().split("::").reverse(),ot=m(Ye,2),Wt=ot[0],nr=ot[1],Pt=nr?nr.split(":").map(Y):[],At=Wt.split(":").map(Y),cr=L.IPV4ADDRESS.test(At[At.length-1]),ft=cr?7:8,Gt=At.length-ft,it=Array(ft),Ct=0;Ct<ft;++Ct)it[Ct]=Pt[Ct]||At[Gt+Ct]||"";cr&&(it[ft-1]=K(it[ft-1],L));var Et=it.reduce(function(ti,vi,gi){if(!vi||vi==="0"){var ln=ti[ti.length-1];ln&&ln.index+ln.length===gi?ln.length++:ti.push({index:gi,length:1})}return ti},[]),ar=Et.sort(function(ti,vi){return vi.length-ti.length})[0],Fr=void 0;if(ar&&ar.length>1){var mi=it.slice(0,ar.index),ei=it.slice(ar.index+ar.length);Fr=mi.join(":")+"::"+ei.join(":")}else Fr=it.join(":");return ze&&(Fr+="%"+ze),Fr}else return H}var Te=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,he="".match(/(){0}/)[1]===void 0;function Ce(H){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},G={},te=L.iri!==!1?p:f;L.reference==="suffix"&&(H=(L.scheme?L.scheme+":":"")+"//"+H);var ue=H.match(Te);if(ue){he?(G.scheme=ue[1],G.userinfo=ue[3],G.host=ue[4],G.port=parseInt(ue[5],10),G.path=ue[6]||"",G.query=ue[7],G.fragment=ue[8],isNaN(G.port)&&(G.port=ue[5])):(G.scheme=ue[1]||void 0,G.userinfo=H.indexOf("@")!==-1?ue[3]:void 0,G.host=H.indexOf("//")!==-1?ue[4]:void 0,G.port=parseInt(ue[5],10),G.path=ue[6]||"",G.query=H.indexOf("?")!==-1?ue[7]:void 0,G.fragment=H.indexOf("#")!==-1?ue[8]:void 0,isNaN(G.port)&&(G.port=H.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?ue[4]:void 0)),G.host&&(G.host=we(K(G.host,te),te)),G.scheme===void 0&&G.userinfo===void 0&&G.host===void 0&&G.port===void 0&&!G.path&&G.query===void 0?G.reference="same-document":G.scheme===void 0?G.reference="relative":G.fragment===void 0?G.reference="absolute":G.reference="uri",L.reference&&L.reference!=="suffix"&&L.reference!==G.reference&&(G.error=G.error||"URI is not a "+L.reference+" reference.");var ze=de[(L.scheme||G.scheme||"").toLowerCase()];if(!L.unicodeSupport&&(!ze||!ze.unicodeSupport)){if(G.host&&(L.domainHost||ze&&ze.domainHost))try{G.host=V.toASCII(G.host.replace(te.PCT_ENCODED,Ee).toLowerCase())}catch(Ye){G.error=G.error||"Host's domain name can not be converted to ASCII via punycode: "+Ye}Me(G,f)}else Me(G,te);ze&&ze.parse&&ze.parse(G,L)}else G.error=G.error||"URI can not be parsed.";return G}function Ge(H,L){var G=L.iri!==!1?p:f,te=[];return H.userinfo!==void 0&&(te.push(H.userinfo),te.push("@")),H.host!==void 0&&te.push(we(K(String(H.host),G),G).replace(G.IPV6ADDRESS,function(ue,ze,Ye){return"["+ze+(Ye?"%25"+Ye:"")+"]"})),(typeof H.port=="number"||typeof H.port=="string")&&(te.push(":"),te.push(String(H.port))),te.length?te.join(""):void 0}var $t=/^\.\.?\//,Kt=/^\/\.(\/|$)/,It=/^\/\.\.(\/|$)/,jt=/^\/?(?:.|\n)*?(?=\/|$)/;function Lt(H){for(var L=[];H.length;)if(H.match($t))H=H.replace($t,"");else if(H.match(Kt))H=H.replace(Kt,"/");else if(H.match(It))H=H.replace(It,"/"),L.pop();else if(H==="."||H==="..")H="";else{var G=H.match(jt);if(G){var te=G[0];H=H.slice(te.length),L.push(te)}else throw new Error("Unexpected dot segment condition")}return L.join("")}function ht(H){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},G=L.iri?p:f,te=[],ue=de[(L.scheme||H.scheme||"").toLowerCase()];if(ue&&ue.serialize&&ue.serialize(H,L),H.host&&!G.IPV6ADDRESS.test(H.host)){if(L.domainHost||ue&&ue.domainHost)try{H.host=L.iri?V.toUnicode(H.host):V.toASCII(H.host.replace(G.PCT_ENCODED,Ee).toLowerCase())}catch(ot){H.error=H.error||"Host's domain name can not be converted to "+(L.iri?"Unicode":"ASCII")+" via punycode: "+ot}}Me(H,G),L.reference!=="suffix"&&H.scheme&&(te.push(H.scheme),te.push(":"));var ze=Ge(H,L);if(ze!==void 0&&(L.reference!=="suffix"&&te.push("//"),te.push(ze),H.path&&H.path.charAt(0)!=="/"&&te.push("/")),H.path!==void 0){var Ye=H.path;!L.absolutePath&&(!ue||!ue.absolutePath)&&(Ye=Lt(Ye)),ze===void 0&&(Ye=Ye.replace(/^\/\//,"/%2F")),te.push(Ye)}return H.query!==void 0&&(te.push("?"),te.push(H.query)),H.fragment!==void 0&&(te.push("#"),te.push(H.fragment)),te.join("")}function on(H,L){var G=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},te=arguments[3],ue={};return te||(H=Ce(ht(H,G),G),L=Ce(ht(L,G),G)),G=G||{},!G.tolerant&&L.scheme?(ue.scheme=L.scheme,ue.userinfo=L.userinfo,ue.host=L.host,ue.port=L.port,ue.path=Lt(L.path||""),ue.query=L.query):(L.userinfo!==void 0||L.host!==void 0||L.port!==void 0?(ue.userinfo=L.userinfo,ue.host=L.host,ue.port=L.port,ue.path=Lt(L.path||""),ue.query=L.query):(L.path?(L.path.charAt(0)==="/"?ue.path=Lt(L.path):((H.userinfo!==void 0||H.host!==void 0||H.port!==void 0)&&!H.path?ue.path="/"+L.path:H.path?ue.path=H.path.slice(0,H.path.lastIndexOf("/")+1)+L.path:ue.path=L.path,ue.path=Lt(ue.path)),ue.query=L.query):(ue.path=H.path,L.query!==void 0?ue.query=L.query:ue.query=H.query),ue.userinfo=H.userinfo,ue.host=H.host,ue.port=H.port),ue.scheme=H.scheme),ue.fragment=L.fragment,ue}function mn(H,L,G){var te=c({scheme:"null"},G);return ht(on(Ce(H,te),Ce(L,te),te,!0),te)}function Ir(H,L){return typeof H=="string"?H=ht(Ce(H,L),L):o(H)==="object"&&(H=Ce(ht(H,L),L)),H}function Jr(H,L,G){return typeof H=="string"?H=ht(Ce(H,G),G):o(H)==="object"&&(H=ht(H,G)),typeof L=="string"?L=ht(Ce(L,G),G):o(L)==="object"&&(L=ht(L,G)),H===L}function vn(H,L){return H&&H.toString().replace(!L||!L.iri?f.ESCAPE:p.ESCAPE,pe)}function Nr(H,L){return H&&H.toString().replace(!L||!L.iri?f.PCT_ENCODED:p.PCT_ENCODED,Ee)}var an={scheme:"http",domainHost:!0,parse:function(L,G){return L.host||(L.error=L.error||"HTTP URIs must have a host."),L},serialize:function(L,G){var te=String(L.scheme).toLowerCase()==="https";return(L.port===(te?443:80)||L.port==="")&&(L.port=void 0),L.path||(L.path="/"),L}},sn={scheme:"https",domainHost:an.domainHost,parse:an.parse,serialize:an.serialize};function _a(H){return typeof H.secure=="boolean"?H.secure:String(H.scheme).toLowerCase()==="wss"}var Yi={scheme:"ws",domainHost:!0,parse:function(L,G){var te=L;return te.secure=_a(te),te.resourceName=(te.path||"/")+(te.query?"?"+te.query:""),te.path=void 0,te.query=void 0,te},serialize:function(L,G){if((L.port===(_a(L)?443:80)||L.port==="")&&(L.port=void 0),typeof L.secure=="boolean"&&(L.scheme=L.secure?"wss":"ws",L.secure=void 0),L.resourceName){var te=L.resourceName.split("?"),ue=m(te,2),ze=ue[0],Ye=ue[1];L.path=ze&&ze!=="/"?ze:void 0,L.query=Ye,L.resourceName=void 0}return L.fragment=void 0,L}},xa={scheme:"wss",domainHost:Yi.domainHost,parse:Yi.parse,serialize:Yi.serialize},Xi={},Oi="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",gn="[0-9A-Fa-f]",Wo=i(i("%[EFef]"+gn+"%"+gn+gn+"%"+gn+gn)+"|"+i("%[89A-Fa-f]"+gn+"%"+gn+gn)+"|"+i("%"+gn+gn)),Ko="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",Pa="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",qn=n(Pa,'[\\"\\\\]'),vo="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",pi=new RegExp(Oi,"g"),Ji=new RegExp(Wo,"g"),le=new RegExp(n("[^]",Ko,"[\\.]",'[\\"]',qn),"g"),ye=new RegExp(n("[^]",Oi,vo),"g"),xe=ye;function $e(H){var L=Ee(H);return L.match(pi)?L:H}var Be={scheme:"mailto",parse:function(L,G){var te=L,ue=te.to=te.path?te.path.split(","):[];if(te.path=void 0,te.query){for(var ze=!1,Ye={},ot=te.query.split("&"),Wt=0,nr=ot.length;Wt<nr;++Wt){var Pt=ot[Wt].split("=");switch(Pt[0]){case"to":for(var At=Pt[1].split(","),cr=0,ft=At.length;cr<ft;++cr)ue.push(At[cr]);break;case"subject":te.subject=Nr(Pt[1],G);break;case"body":te.body=Nr(Pt[1],G);break;default:ze=!0,Ye[Nr(Pt[0],G)]=Nr(Pt[1],G);break}}ze&&(te.headers=Ye)}te.query=void 0;for(var Gt=0,it=ue.length;Gt<it;++Gt){var Ct=ue[Gt].split("@");if(Ct[0]=Nr(Ct[0]),G.unicodeSupport)Ct[1]=Nr(Ct[1],G).toLowerCase();else try{Ct[1]=V.toASCII(Nr(Ct[1],G).toLowerCase())}catch(Et){te.error=te.error||"Email address's domain name can not be converted to ASCII via punycode: "+Et}ue[Gt]=Ct.join("@")}return te},serialize:function(L,G){var te=L,ue=l(L.to);if(ue){for(var ze=0,Ye=ue.length;ze<Ye;++ze){var ot=String(ue[ze]),Wt=ot.lastIndexOf("@"),nr=ot.slice(0,Wt).replace(Ji,$e).replace(Ji,a).replace(le,pe),Pt=ot.slice(Wt+1);try{Pt=G.iri?V.toUnicode(Pt):V.toASCII(Nr(Pt,G).toLowerCase())}catch(Gt){te.error=te.error||"Email address's domain name can not be converted to "+(G.iri?"Unicode":"ASCII")+" via punycode: "+Gt}ue[ze]=nr+"@"+Pt}te.path=ue.join(",")}var At=L.headers=L.headers||{};L.subject&&(At.subject=L.subject),L.body&&(At.body=L.body);var cr=[];for(var ft in At)At[ft]!==Xi[ft]&&cr.push(ft.replace(Ji,$e).replace(Ji,a).replace(ye,pe)+"="+At[ft].replace(Ji,$e).replace(Ji,a).replace(xe,pe));return cr.length&&(te.query=cr.join("&")),te}},pt=/^([^\:]+)\:(.*)/,tt={scheme:"urn",parse:function(L,G){var te=L.path&&L.path.match(pt),ue=L;if(te){var ze=G.scheme||ue.scheme||"urn",Ye=te[1].toLowerCase(),ot=te[2],Wt=ze+":"+(G.nid||Ye),nr=de[Wt];ue.nid=Ye,ue.nss=ot,ue.path=void 0,nr&&(ue=nr.parse(ue,G))}else ue.error=ue.error||"URN can not be parsed.";return ue},serialize:function(L,G){var te=G.scheme||L.scheme||"urn",ue=L.nid,ze=te+":"+(G.nid||ue),Ye=de[ze];Ye&&(L=Ye.serialize(L,G));var ot=L,Wt=L.nss;return ot.path=(ue||G.nid)+":"+Wt,ot}},Ue=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,xt={scheme:"urn:uuid",parse:function(L,G){var te=L;return te.uuid=te.nss,te.nss=void 0,!G.tolerant&&(!te.uuid||!te.uuid.match(Ue))&&(te.error=te.error||"UUID is not valid."),te},serialize:function(L,G){var te=L;return te.nss=(L.uuid||"").toLowerCase(),te}};de[an.scheme]=an,de[sn.scheme]=sn,de[Yi.scheme]=Yi,de[xa.scheme]=xa,de[Be.scheme]=Be,de[tt.scheme]=tt,de[xt.scheme]=xt,r.SCHEMES=de,r.pctEncChar=pe,r.pctDecChars=Ee,r.parse=Ce,r.removeDotSegments=Lt,r.serialize=ht,r.resolveComponents=on,r.resolve=mn,r.normalize=Ir,r.equal=Jr,r.escapeComponent=vn,r.unescapeComponent=Nr,Object.defineProperty(r,"__esModule",{value:!0})})}(ep,ep.exports)),ep.exports}var oD;function Twe(){if(oD)return Ng;oD=1,Object.defineProperty(Ng,"__esModule",{value:!0});const e=Ewe();return e.code='require("ajv/dist/runtime/uri").default',Ng.default=e,Ng}var aD;function Owe(){return aD||(aD=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=ww();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=Dt();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});const n=xT(),i=Sw(),o=$3(),a=_w(),l=Dt(),c=bw(),d=n0(),f=Jt(),p=Pwe,m=Twe(),g=(Z,j)=>new RegExp(Z,j);g.code="new RegExp";const b=["removeAdditional","useDefaults","coerceTypes"],y=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),w={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},_={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},S=200;function C(Z){var j,U,q,$,F,V,de,pe,Ee,Me,Y,K,we,Te,he,Ce,Ge,$t,Kt,It,jt,Lt,ht,on,mn;const Ir=Z.strict,Jr=(j=Z.code)===null||j===void 0?void 0:j.optimize,vn=Jr===!0||Jr===void 0?1:Jr||0,Nr=(q=(U=Z.code)===null||U===void 0?void 0:U.regExp)!==null&&q!==void 0?q:g,an=($=Z.uriResolver)!==null&&$!==void 0?$:m.default;return{strictSchema:(V=(F=Z.strictSchema)!==null&&F!==void 0?F:Ir)!==null&&V!==void 0?V:!0,strictNumbers:(pe=(de=Z.strictNumbers)!==null&&de!==void 0?de:Ir)!==null&&pe!==void 0?pe:!0,strictTypes:(Me=(Ee=Z.strictTypes)!==null&&Ee!==void 0?Ee:Ir)!==null&&Me!==void 0?Me:"log",strictTuples:(K=(Y=Z.strictTuples)!==null&&Y!==void 0?Y:Ir)!==null&&K!==void 0?K:"log",strictRequired:(Te=(we=Z.strictRequired)!==null&&we!==void 0?we:Ir)!==null&&Te!==void 0?Te:!1,code:Z.code?{...Z.code,optimize:vn,regExp:Nr}:{optimize:vn,regExp:Nr},loopRequired:(he=Z.loopRequired)!==null&&he!==void 0?he:S,loopEnum:(Ce=Z.loopEnum)!==null&&Ce!==void 0?Ce:S,meta:(Ge=Z.meta)!==null&&Ge!==void 0?Ge:!0,messages:($t=Z.messages)!==null&&$t!==void 0?$t:!0,inlineRefs:(Kt=Z.inlineRefs)!==null&&Kt!==void 0?Kt:!0,schemaId:(It=Z.schemaId)!==null&&It!==void 0?It:"$id",addUsedSchema:(jt=Z.addUsedSchema)!==null&&jt!==void 0?jt:!0,validateSchema:(Lt=Z.validateSchema)!==null&&Lt!==void 0?Lt:!0,validateFormats:(ht=Z.validateFormats)!==null&&ht!==void 0?ht:!0,unicodeRegExp:(on=Z.unicodeRegExp)!==null&&on!==void 0?on:!0,int32range:(mn=Z.int32range)!==null&&mn!==void 0?mn:!0,uriResolver:an}}class k{constructor(j={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,j=this.opts={...j,...C(j)};const{es5:U,lines:q}=this.opts.code;this.scope=new l.ValueScope({scope:{},prefixes:y,es5:U,lines:q}),this.logger=se(j.logger);const $=j.validateFormats;j.validateFormats=!1,this.RULES=(0,o.getRules)(),E.call(this,w,j,"NOT SUPPORTED"),E.call(this,_,j,"DEPRECATED","warn"),this._metaOpts=B.call(this),j.formats&&A.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),j.keywords&&M.call(this,j.keywords),typeof j.meta=="object"&&this.addMetaSchema(j.meta),T.call(this),j.validateFormats=$}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:j,meta:U,schemaId:q}=this.opts;let $=p;q==="id"&&($={...p},$.id=$.$id,delete $.$id),U&&j&&this.addMetaSchema($,$[q],!1)}defaultMeta(){const{meta:j,schemaId:U}=this.opts;return this.opts.defaultMeta=typeof j=="object"?j[U]||j:void 0}validate(j,U){let q;if(typeof j=="string"){if(q=this.getSchema(j),!q)throw new Error(`no schema with key or ref "${j}"`)}else q=this.compile(j);const $=q(U);return"$async"in q||(this.errors=q.errors),$}compile(j,U){const q=this._addSchema(j,U);return q.validate||this._compileSchemaEnv(q)}compileAsync(j,U){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:q}=this.opts;return $.call(this,j,U);async function $(Me,Y){await F.call(this,Me.$schema);const K=this._addSchema(Me,Y);return K.validate||V.call(this,K)}async function F(Me){Me&&!this.getSchema(Me)&&await $.call(this,{$ref:Me},!0)}async function V(Me){try{return this._compileSchemaEnv(Me)}catch(Y){if(!(Y instanceof i.default))throw Y;return de.call(this,Y),await pe.call(this,Y.missingSchema),V.call(this,Me)}}function de({missingSchema:Me,missingRef:Y}){if(this.refs[Me])throw new Error(`AnySchema ${Me} is loaded but ${Y} cannot be resolved`)}async function pe(Me){const Y=await Ee.call(this,Me);this.refs[Me]||await F.call(this,Y.$schema),this.refs[Me]||this.addSchema(Y,Me,U)}async function Ee(Me){const Y=this._loading[Me];if(Y)return Y;try{return await(this._loading[Me]=q(Me))}finally{delete this._loading[Me]}}}addSchema(j,U,q,$=this.opts.validateSchema){if(Array.isArray(j)){for(const V of j)this.addSchema(V,void 0,q,$);return this}let F;if(typeof j=="object"){const{schemaId:V}=this.opts;if(F=j[V],F!==void 0&&typeof F!="string")throw new Error(`schema ${V} must be string`)}return U=(0,c.normalizeId)(U||F),this._checkUnique(U),this.schemas[U]=this._addSchema(j,q,U,$,!0),this}addMetaSchema(j,U,q=this.opts.validateSchema){return this.addSchema(j,U,!0,q),this}validateSchema(j,U){if(typeof j=="boolean")return!0;let q;if(q=j.$schema,q!==void 0&&typeof q!="string")throw new Error("$schema must be a string");if(q=q||this.opts.defaultMeta||this.defaultMeta(),!q)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const $=this.validate(q,j);if(!$&&U){const F="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(F);else throw new Error(F)}return $}getSchema(j){let U;for(;typeof(U=R.call(this,j))=="string";)j=U;if(U===void 0){const{schemaId:q}=this.opts,$=new a.SchemaEnv({schema:{},schemaId:q});if(U=a.resolveSchema.call(this,$,j),!U)return;this.refs[j]=U}return U.validate||this._compileSchemaEnv(U)}removeSchema(j){if(j instanceof RegExp)return this._removeAllSchemas(this.schemas,j),this._removeAllSchemas(this.refs,j),this;switch(typeof j){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const U=R.call(this,j);return typeof U=="object"&&this._cache.delete(U.schema),delete this.schemas[j],delete this.refs[j],this}case"object":{const U=j;this._cache.delete(U);let q=j[this.opts.schemaId];return q&&(q=(0,c.normalizeId)(q),delete this.schemas[q],delete this.refs[q]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(j){for(const U of j)this.addKeyword(U);return this}addKeyword(j,U){let q;if(typeof j=="string")q=j,typeof U=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),U.keyword=q);else if(typeof j=="object"&&U===void 0){if(U=j,q=U.keyword,Array.isArray(q)&&!q.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(N.call(this,q,U),!U)return(0,f.eachItem)(q,F=>X.call(this,F)),this;ne.call(this,U);const $={...U,type:(0,d.getJSONTypes)(U.type),schemaType:(0,d.getJSONTypes)(U.schemaType)};return(0,f.eachItem)(q,$.type.length===0?F=>X.call(this,F,$):F=>$.type.forEach(V=>X.call(this,F,$,V))),this}getKeyword(j){const U=this.RULES.all[j];return typeof U=="object"?U.definition:!!U}removeKeyword(j){const{RULES:U}=this;delete U.keywords[j],delete U.all[j];for(const q of U.rules){const $=q.rules.findIndex(F=>F.keyword===j);$>=0&&q.rules.splice($,1)}return this}addFormat(j,U){return typeof U=="string"&&(U=new RegExp(U)),this.formats[j]=U,this}errorsText(j=this.errors,{separator:U=", ",dataVar:q="data"}={}){return!j||j.length===0?"No errors":j.map($=>`${q}${$.instancePath} ${$.message}`).reduce(($,F)=>$+U+F)}$dataMetaSchema(j,U){const q=this.RULES.all;j=JSON.parse(JSON.stringify(j));for(const $ of U){const F=$.split("/").slice(1);let V=j;for(const de of F)V=V[de];for(const de in q){const pe=q[de];if(typeof pe!="object")continue;const{$data:Ee}=pe.definition,Me=V[de];Ee&&Me&&(V[de]=ge(Me))}}return j}_removeAllSchemas(j,U){for(const q in j){const $=j[q];(!U||U.test(q))&&(typeof $=="string"?delete j[q]:$&&!$.meta&&(this._cache.delete($.schema),delete j[q]))}}_addSchema(j,U,q,$=this.opts.validateSchema,F=this.opts.addUsedSchema){let V;const{schemaId:de}=this.opts;if(typeof j=="object")V=j[de];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof j!="boolean")throw new Error("schema must be object or boolean")}let pe=this._cache.get(j);if(pe!==void 0)return pe;q=(0,c.normalizeId)(V||q);const Ee=c.getSchemaRefs.call(this,j,q);return pe=new a.SchemaEnv({schema:j,schemaId:de,meta:U,baseId:q,localRefs:Ee}),this._cache.set(pe.schema,pe),F&&!q.startsWith("#")&&(q&&this._checkUnique(q),this.refs[q]=pe),$&&this.validateSchema(j,!0),pe}_checkUnique(j){if(this.schemas[j]||this.refs[j])throw new Error(`schema with key or id "${j}" already exists`)}_compileSchemaEnv(j){if(j.meta?this._compileMetaSchema(j):a.compileSchema.call(this,j),!j.validate)throw new Error("ajv implementation error");return j.validate}_compileMetaSchema(j){const U=this.opts;this.opts=this._metaOpts;try{a.compileSchema.call(this,j)}finally{this.opts=U}}}k.ValidationError=n.default,k.MissingRefError=i.default,e.default=k;function E(Z,j,U,q="error"){for(const $ in Z){const F=$;F in j&&this.logger[q](`${U}: option ${$}. ${Z[F]}`)}}function R(Z){return Z=(0,c.normalizeId)(Z),this.schemas[Z]||this.refs[Z]}function T(){const Z=this.opts.schemas;if(Z)if(Array.isArray(Z))this.addSchema(Z);else for(const j in Z)this.addSchema(Z[j],j)}function A(){for(const Z in this.opts.formats){const j=this.opts.formats[Z];j&&this.addFormat(Z,j)}}function M(Z){if(Array.isArray(Z)){this.addVocabulary(Z);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const j in Z){const U=Z[j];U.keyword||(U.keyword=j),this.addKeyword(U)}}function B(){const Z={...this.opts};for(const j of b)delete Z[j];return Z}const Q={log(){},warn(){},error(){}};function se(Z){if(Z===!1)return Q;if(Z===void 0)return console;if(Z.log&&Z.warn&&Z.error)return Z;throw new Error("logger must implement log, warn and error methods")}const ie=/^[a-z_$][a-z0-9_$:-]*$/i;function N(Z,j){const{RULES:U}=this;if((0,f.eachItem)(Z,q=>{if(U.keywords[q])throw new Error(`Keyword ${q} is already defined`);if(!ie.test(q))throw new Error(`Keyword ${q} has invalid name`)}),!!j&&j.$data&&!("code"in j||"validate"in j))throw new Error('$data keyword must have "code" or "validate" function')}function X(Z,j,U){var q;const $=j==null?void 0:j.post;if(U&&$)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:F}=this;let V=$?F.post:F.rules.find(({type:pe})=>pe===U);if(V||(V={type:U,rules:[]},F.rules.push(V)),F.keywords[Z]=!0,!j)return;const de={keyword:Z,definition:{...j,type:(0,d.getJSONTypes)(j.type),schemaType:(0,d.getJSONTypes)(j.schemaType)}};j.before?ce.call(this,V,de,j.before):V.rules.push(de),F.all[Z]=de,(q=j.implements)===null||q===void 0||q.forEach(pe=>this.addKeyword(pe))}function ce(Z,j,U){const q=Z.rules.findIndex($=>$.keyword===U);q>=0?Z.rules.splice(q,0,j):(Z.rules.push(j),this.logger.warn(`rule ${U} is not defined`))}function ne(Z){let{metaSchema:j}=Z;j!==void 0&&(Z.$data&&this.opts.$data&&(j=ge(j)),Z.validateSchema=this.compile(j,!0))}const ee={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function ge(Z){return{anyOf:[Z,ee]}}}(B_)),B_}var Fg={},Lg={},Bg={},sD;function Rwe(){if(sD)return Bg;sD=1,Object.defineProperty(Bg,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return Bg.default=e,Bg}var wl={},lD;function PT(){if(lD)return wl;lD=1,Object.defineProperty(wl,"__esModule",{value:!0}),wl.callRef=wl.getValidate=void 0;const e=Sw(),t=Sa(),r=Dt(),n=wa(),i=_w(),o=Jt(),a={keyword:"$ref",schemaType:"string",code(d){const{gen:f,schema:p,it:m}=d,{baseId:g,schemaEnv:b,validateName:y,opts:w,self:_}=m,{root:S}=b;if((p==="#"||p==="#/")&&g===S.baseId)return k();const C=i.resolveRef.call(_,S,g,p);if(C===void 0)throw new e.default(m.opts.uriResolver,g,p);if(C instanceof i.SchemaEnv)return E(C);return R(C);function k(){if(b===S)return c(d,y,b,b.$async);const T=f.scopeValue("root",{ref:S});return c(d,(0,r._)`${T}.validate`,S,S.$async)}function E(T){const A=l(d,T);c(d,A,T,T.$async)}function R(T){const A=f.scopeValue("schema",w.code.source===!0?{ref:T,code:(0,r.stringify)(T)}:{ref:T}),M=f.name("valid"),B=d.subschema({schema:T,dataTypes:[],schemaPath:r.nil,topSchemaRef:A,errSchemaPath:p},M);d.mergeEvaluated(B),d.ok(M)}}};function l(d,f){const{gen:p}=d;return f.validate?p.scopeValue("validate",{ref:f.validate}):(0,r._)`${p.scopeValue("wrapper",{ref:f})}.validate`}wl.getValidate=l;function c(d,f,p,m){const{gen:g,it:b}=d,{allErrors:y,schemaEnv:w,opts:_}=b,S=_.passContext?n.default.this:r.nil;m?C():k();function C(){if(!w.$async)throw new Error("async schema referenced by sync schema");const T=g.let("valid");g.try(()=>{g.code((0,r._)`await ${(0,t.callValidateCode)(d,f,S)}`),R(f),y||g.assign(T,!0)},A=>{g.if((0,r._)`!(${A} instanceof ${b.ValidationError})`,()=>g.throw(A)),E(A),y||g.assign(T,!1)}),d.ok(T)}function k(){d.result((0,t.callValidateCode)(d,f,S),()=>R(f),()=>E(f))}function E(T){const A=(0,r._)`${T}.errors`;g.assign(n.default.vErrors,(0,r._)`${n.default.vErrors} === null ? ${A} : ${n.default.vErrors}.concat(${A})`),g.assign(n.default.errors,(0,r._)`${n.default.vErrors}.length`)}function R(T){var A;if(!b.opts.unevaluated)return;const M=(A=p==null?void 0:p.validate)===null||A===void 0?void 0:A.evaluated;if(b.props!==!0)if(M&&!M.dynamicProps)M.props!==void 0&&(b.props=o.mergeEvaluated.props(g,M.props,b.props));else{const B=g.var("props",(0,r._)`${T}.evaluated.props`);b.props=o.mergeEvaluated.props(g,B,b.props,r.Name)}if(b.items!==!0)if(M&&!M.dynamicItems)M.items!==void 0&&(b.items=o.mergeEvaluated.items(g,M.items,b.items));else{const B=g.var("items",(0,r._)`${T}.evaluated.items`);b.items=o.mergeEvaluated.items(g,B,b.items,r.Name)}}}return wl.callRef=c,wl.default=a,wl}var uD;function Iwe(){if(uD)return Lg;uD=1,Object.defineProperty(Lg,"__esModule",{value:!0});const e=Rwe(),t=PT(),r=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,t.default];return Lg.default=r,Lg}var Vg={},zg={},cD;function kwe(){if(cD)return zg;cD=1,Object.defineProperty(zg,"__esModule",{value:!0});const e=Dt(),t=e.operators,r={maximum:{okStr:"<=",ok:t.LTE,fail:t.GT},minimum:{okStr:">=",ok:t.GTE,fail:t.LT},exclusiveMaximum:{okStr:"<",ok:t.LT,fail:t.GTE},exclusiveMinimum:{okStr:">",ok:t.GT,fail:t.LTE}},n={message:({keyword:o,schemaCode:a})=>(0,e.str)`must be ${r[o].okStr} ${a}`,params:({keyword:o,schemaCode:a})=>(0,e._)`{comparison: ${r[o].okStr}, limit: ${a}}`},i={keyword:Object.keys(r),type:"number",schemaType:"number",$data:!0,error:n,code(o){const{keyword:a,data:l,schemaCode:c}=o;o.fail$data((0,e._)`${l} ${r[a].fail} ${c} || isNaN(${l})`)}};return zg.default=i,zg}var qg={},dD;function jwe(){if(dD)return qg;dD=1,Object.defineProperty(qg,"__esModule",{value:!0});const e=Dt(),r={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:n})=>(0,e.str)`must be multiple of ${n}`,params:({schemaCode:n})=>(0,e._)`{multipleOf: ${n}}`},code(n){const{gen:i,data:o,schemaCode:a,it:l}=n,c=l.opts.multipleOfPrecision,d=i.let("res"),f=c?(0,e._)`Math.abs(Math.round(${d}) - ${d}) > 1e-${c}`:(0,e._)`${d} !== parseInt(${d})`;n.fail$data((0,e._)`(${a} === 0 || (${d} = ${o}/${a}, ${f}))`)}};return qg.default=r,qg}var Ug={},Hg={},fD;function $we(){if(fD)return Hg;fD=1,Object.defineProperty(Hg,"__esModule",{value:!0});function e(t){const r=t.length;let n=0,i=0,o;for(;i<r;)n++,o=t.charCodeAt(i++),o>=55296&&o<=56319&&i<r&&(o=t.charCodeAt(i),(o&64512)===56320&&i++);return n}return Hg.default=e,e.code='require("ajv/dist/runtime/ucs2length").default',Hg}var hD;function Awe(){if(hD)return Ug;hD=1,Object.defineProperty(Ug,"__esModule",{value:!0});const e=Dt(),t=Jt(),r=$we(),i={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:o,schemaCode:a}){const l=o==="maxLength"?"more":"fewer";return(0,e.str)`must NOT have ${l} than ${a} characters`},params:({schemaCode:o})=>(0,e._)`{limit: ${o}}`},code(o){const{keyword:a,data:l,schemaCode:c,it:d}=o,f=a==="maxLength"?e.operators.GT:e.operators.LT,p=d.opts.unicode===!1?(0,e._)`${l}.length`:(0,e._)`${(0,t.useFunc)(o.gen,r.default)}(${l})`;o.fail$data((0,e._)`${p} ${f} ${c}`)}};return Ug.default=i,Ug}var Wg={},pD;function Dwe(){if(pD)return Wg;pD=1,Object.defineProperty(Wg,"__esModule",{value:!0});const e=Sa(),t=Dt(),n={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:i})=>(0,t.str)`must match pattern "${i}"`,params:({schemaCode:i})=>(0,t._)`{pattern: ${i}}`},code(i){const{data:o,$data:a,schema:l,schemaCode:c,it:d}=i,f=d.opts.unicodeRegExp?"u":"",p=a?(0,t._)`(new RegExp(${c}, ${f}))`:(0,e.usePattern)(i,l);i.fail$data((0,t._)`!${p}.test(${o})`)}};return Wg.default=n,Wg}var Kg={},mD;function Mwe(){if(mD)return Kg;mD=1,Object.defineProperty(Kg,"__esModule",{value:!0});const e=Dt(),r={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:i}){const o=n==="maxProperties"?"more":"fewer";return(0,e.str)`must NOT have ${o} than ${i} properties`},params:({schemaCode:n})=>(0,e._)`{limit: ${n}}`},code(n){const{keyword:i,data:o,schemaCode:a}=n,l=i==="maxProperties"?e.operators.GT:e.operators.LT;n.fail$data((0,e._)`Object.keys(${o}).length ${l} ${a}`)}};return Kg.default=r,Kg}var Gg={},vD;function Nwe(){if(vD)return Gg;vD=1,Object.defineProperty(Gg,"__esModule",{value:!0});const e=Sa(),t=Dt(),r=Jt(),i={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:o}})=>(0,t.str)`must have required property '${o}'`,params:({params:{missingProperty:o}})=>(0,t._)`{missingProperty: ${o}}`},code(o){const{gen:a,schema:l,schemaCode:c,data:d,$data:f,it:p}=o,{opts:m}=p;if(!f&&l.length===0)return;const g=l.length>=m.loopRequired;if(p.allErrors?b():y(),m.strictRequired){const S=o.parentSchema.properties,{definedProperties:C}=o.it;for(const k of l)if((S==null?void 0:S[k])===void 0&&!C.has(k)){const E=p.schemaEnv.baseId+p.errSchemaPath,R=`required property "${k}" is not defined at "${E}" (strictRequired)`;(0,r.checkStrictMode)(p,R,p.opts.strictRequired)}}function b(){if(g||f)o.block$data(t.nil,w);else for(const S of l)(0,e.checkReportMissingProp)(o,S)}function y(){const S=a.let("missing");if(g||f){const C=a.let("valid",!0);o.block$data(C,()=>_(S,C)),o.ok(C)}else a.if((0,e.checkMissingProp)(o,l,S)),(0,e.reportMissingProp)(o,S),a.else()}function w(){a.forOf("prop",c,S=>{o.setParams({missingProperty:S}),a.if((0,e.noPropertyInData)(a,d,S,m.ownProperties),()=>o.error())})}function _(S,C){o.setParams({missingProperty:S}),a.forOf(S,c,()=>{a.assign(C,(0,e.propertyInData)(a,d,S,m.ownProperties)),a.if((0,t.not)(C),()=>{o.error(),a.break()})},t.nil)}}};return Gg.default=i,Gg}var Qg={},gD;function Fwe(){if(gD)return Qg;gD=1,Object.defineProperty(Qg,"__esModule",{value:!0});const e=Dt(),r={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:i}){const o=n==="maxItems"?"more":"fewer";return(0,e.str)`must NOT have ${o} than ${i} items`},params:({schemaCode:n})=>(0,e._)`{limit: ${n}}`},code(n){const{keyword:i,data:o,schemaCode:a}=n,l=i==="maxItems"?e.operators.GT:e.operators.LT;n.fail$data((0,e._)`${o}.length ${l} ${a}`)}};return Qg.default=r,Qg}var Yg={},Xg={},yD;function CT(){if(yD)return Xg;yD=1,Object.defineProperty(Xg,"__esModule",{value:!0});const e=D3();return e.code='require("ajv/dist/runtime/equal").default',Xg.default=e,Xg}var bD;function Lwe(){if(bD)return Yg;bD=1,Object.defineProperty(Yg,"__esModule",{value:!0});const e=n0(),t=Dt(),r=Jt(),n=CT(),o={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:a,j:l}})=>(0,t.str)`must NOT have duplicate items (items ## ${l} and ${a} are identical)`,params:({params:{i:a,j:l}})=>(0,t._)`{i: ${a}, j: ${l}}`},code(a){const{gen:l,data:c,$data:d,schema:f,parentSchema:p,schemaCode:m,it:g}=a;if(!d&&!f)return;const b=l.let("valid"),y=p.items?(0,e.getSchemaTypes)(p.items):[];a.block$data(b,w,(0,t._)`${m} === false`),a.ok(b);function w(){const k=l.let("i",(0,t._)`${c}.length`),E=l.let("j");a.setParams({i:k,j:E}),l.assign(b,!0),l.if((0,t._)`${k} > 1`,()=>(_()?S:C)(k,E))}function _(){return y.length>0&&!y.some(k=>k==="object"||k==="array")}function S(k,E){const R=l.name("item"),T=(0,e.checkDataTypes)(y,R,g.opts.strictNumbers,e.DataType.Wrong),A=l.const("indices",(0,t._)`{}`);l.for((0,t._)`;${k}--;`,()=>{l.let(R,(0,t._)`${c}[${k}]`),l.if(T,(0,t._)`continue`),y.length>1&&l.if((0,t._)`typeof ${R} == "string"`,(0,t._)`${R} += "_"`),l.if((0,t._)`typeof ${A}[${R}] == "number"`,()=>{l.assign(E,(0,t._)`${A}[${R}]`),a.error(),l.assign(b,!1).break()}).code((0,t._)`${A}[${R}] = ${k}`)})}function C(k,E){const R=(0,r.useFunc)(l,n.default),T=l.name("outer");l.label(T).for((0,t._)`;${k}--;`,()=>l.for((0,t._)`${E} = ${k}; ${E}--;`,()=>l.if((0,t._)`${R}(${c}[${k}], ${c}[${E}])`,()=>{a.error(),l.assign(b,!1).break(T)})))}}};return Yg.default=o,Yg}var Jg={},wD;function Bwe(){if(wD)return Jg;wD=1,Object.defineProperty(Jg,"__esModule",{value:!0});const e=Dt(),t=Jt(),r=CT(),i={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:o})=>(0,e._)`{allowedValue: ${o}}`},code(o){const{gen:a,data:l,$data:c,schemaCode:d,schema:f}=o;c||f&&typeof f=="object"?o.fail$data((0,e._)`!${(0,t.useFunc)(a,r.default)}(${l}, ${d})`):o.fail((0,e._)`${f} !== ${l}`)}};return Jg.default=i,Jg}var Zg={},SD;function Vwe(){if(SD)return Zg;SD=1,Object.defineProperty(Zg,"__esModule",{value:!0});const e=Dt(),t=Jt(),r=CT(),i={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:o})=>(0,e._)`{allowedValues: ${o}}`},code(o){const{gen:a,data:l,$data:c,schema:d,schemaCode:f,it:p}=o;if(!c&&d.length===0)throw new Error("enum must have non-empty array");const m=d.length>=p.opts.loopEnum;let g;const b=()=>g??(g=(0,t.useFunc)(a,r.default));let y;if(m||c)y=a.let("valid"),o.block$data(y,w);else{if(!Array.isArray(d))throw new Error("ajv implementation error");const S=a.const("vSchema",f);y=(0,e.or)(...d.map((C,k)=>_(S,k)))}o.pass(y);function w(){a.assign(y,!1),a.forOf("v",f,S=>a.if((0,e._)`${b()}(${l}, ${S})`,()=>a.assign(y,!0).break()))}function _(S,C){const k=d[C];return typeof k=="object"&&k!==null?(0,e._)`${b()}(${l}, ${S}[${C}])`:(0,e._)`${l} === ${k}`}}};return Zg.default=i,Zg}var _D;function zwe(){if(_D)return Vg;_D=1,Object.defineProperty(Vg,"__esModule",{value:!0});const e=kwe(),t=jwe(),r=Awe(),n=Dwe(),i=Mwe(),o=Nwe(),a=Fwe(),l=Lwe(),c=Bwe(),d=Vwe(),f=[e.default,t.default,r.default,n.default,i.default,o.default,a.default,l.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},c.default,d.default];return Vg.default=f,Vg}var ey={},gd={},xD;function M3(){if(xD)return gd;xD=1,Object.defineProperty(gd,"__esModule",{value:!0}),gd.validateAdditionalItems=void 0;const e=Dt(),t=Jt(),n={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:o}})=>(0,e.str)`must NOT have more than ${o} items`,params:({params:{len:o}})=>(0,e._)`{limit: ${o}}`},code(o){const{parentSchema:a,it:l}=o,{items:c}=a;if(!Array.isArray(c)){(0,t.checkStrictMode)(l,'"additionalItems" is ignored when "items" is not an array of schemas');return}i(o,c)}};function i(o,a){const{gen:l,schema:c,data:d,keyword:f,it:p}=o;p.items=!0;const m=l.const("len",(0,e._)`${d}.length`);if(c===!1)o.setParams({len:a.length}),o.pass((0,e._)`${m} <= ${a.length}`);else if(typeof c=="object"&&!(0,t.alwaysValidSchema)(p,c)){const b=l.var("valid",(0,e._)`${m} <= ${a.length}`);l.if((0,e.not)(b),()=>g(b)),o.ok(b)}function g(b){l.forRange("i",a.length,m,y=>{o.subschema({keyword:f,dataProp:y,dataPropType:t.Type.Num},b),p.allErrors||l.if((0,e.not)(b),()=>l.break())})}}return gd.validateAdditionalItems=i,gd.default=n,gd}var ty={},yd={},PD;function N3(){if(PD)return yd;PD=1,Object.defineProperty(yd,"__esModule",{value:!0}),yd.validateTuple=void 0;const e=Dt(),t=Jt(),r=Sa(),n={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(o){const{schema:a,it:l}=o;if(Array.isArray(a))return i(o,"additionalItems",a);l.items=!0,!(0,t.alwaysValidSchema)(l,a)&&o.ok((0,r.validateArray)(o))}};function i(o,a,l=o.schema){const{gen:c,parentSchema:d,data:f,keyword:p,it:m}=o;y(d),m.opts.unevaluated&&l.length&&m.items!==!0&&(m.items=t.mergeEvaluated.items(c,l.length,m.items));const g=c.name("valid"),b=c.const("len",(0,e._)`${f}.length`);l.forEach((w,_)=>{(0,t.alwaysValidSchema)(m,w)||(c.if((0,e._)`${b} > ${_}`,()=>o.subschema({keyword:p,schemaProp:_,dataProp:_},g)),o.ok(g))});function y(w){const{opts:_,errSchemaPath:S}=m,C=l.length,k=C===w.minItems&&(C===w.maxItems||w[a]===!1);if(_.strictTuples&&!k){const E=`"${p}" is ${C}-tuple, but minItems or maxItems/${a} are not specified or different at path "${S}"`;(0,t.checkStrictMode)(m,E,_.strictTuples)}}}return yd.validateTuple=i,yd.default=n,yd}var CD;function qwe(){if(CD)return ty;CD=1,Object.defineProperty(ty,"__esModule",{value:!0});const e=N3(),t={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:r=>(0,e.validateTuple)(r,"items")};return ty.default=t,ty}var ry={},ED;function Uwe(){if(ED)return ry;ED=1,Object.defineProperty(ry,"__esModule",{value:!0});const e=Dt(),t=Jt(),r=Sa(),n=M3(),o={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:a}})=>(0,e.str)`must NOT have more than ${a} items`,params:({params:{len:a}})=>(0,e._)`{limit: ${a}}`},code(a){const{schema:l,parentSchema:c,it:d}=a,{prefixItems:f}=c;d.items=!0,!(0,t.alwaysValidSchema)(d,l)&&(f?(0,n.validateAdditionalItems)(a,f):a.ok((0,r.validateArray)(a)))}};return ry.default=o,ry}var ny={},TD;function Hwe(){if(TD)return ny;TD=1,Object.defineProperty(ny,"__esModule",{value:!0});const e=Dt(),t=Jt(),n={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:i,max:o}})=>o===void 0?(0,e.str)`must contain at least ${i} valid item(s)`:(0,e.str)`must contain at least ${i} and no more than ${o} valid item(s)`,params:({params:{min:i,max:o}})=>o===void 0?(0,e._)`{minContains: ${i}}`:(0,e._)`{minContains: ${i}, maxContains: ${o}}`},code(i){const{gen:o,schema:a,parentSchema:l,data:c,it:d}=i;let f,p;const{minContains:m,maxContains:g}=l;d.opts.next?(f=m===void 0?1:m,p=g):f=1;const b=o.const("len",(0,e._)`${c}.length`);if(i.setParams({min:f,max:p}),p===void 0&&f===0){(0,t.checkStrictMode)(d,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(p!==void 0&&f>p){(0,t.checkStrictMode)(d,'"minContains" > "maxContains" is always invalid'),i.fail();return}if((0,t.alwaysValidSchema)(d,a)){let C=(0,e._)`${b} >= ${f}`;p!==void 0&&(C=(0,e._)`${C} && ${b} <= ${p}`),i.pass(C);return}d.items=!0;const y=o.name("valid");p===void 0&&f===1?_(y,()=>o.if(y,()=>o.break())):f===0?(o.let(y,!0),p!==void 0&&o.if((0,e._)`${c}.length > 0`,w)):(o.let(y,!1),w()),i.result(y,()=>i.reset());function w(){const C=o.name("_valid"),k=o.let("count",0);_(C,()=>o.if(C,()=>S(k)))}function _(C,k){o.forRange("i",0,b,E=>{i.subschema({keyword:"contains",dataProp:E,dataPropType:t.Type.Num,compositeRule:!0},C),k()})}function S(C){o.code((0,e._)`${C}++`),p===void 0?o.if((0,e._)`${C} >= ${f}`,()=>o.assign(y,!0).break()):(o.if((0,e._)`${C} > ${p}`,()=>o.assign(y,!1).break()),f===1?o.assign(y,!0):o.if((0,e._)`${C} >= ${f}`,()=>o.assign(y,!0)))}}};return ny.default=n,ny}var K_={},OD;function ET(){return OD||(OD=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=Dt(),r=Jt(),n=Sa();e.error={message:({params:{property:c,depsCount:d,deps:f}})=>{const p=d===1?"property":"properties";return(0,t.str)`must have ${p} ${f} when property ${c} is present`},params:({params:{property:c,depsCount:d,deps:f,missingProperty:p}})=>(0,t._)`{property: ${c},
|
1406
1406
|
missingProperty: ${p},
|
1407
1407
|
depsCount: ${d},
|
1408
1408
|
deps: ${f}}`};const i={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(c){const[d,f]=o(c);a(c,d),l(c,f)}};function o({schema:c}){const d={},f={};for(const p in c){if(p==="__proto__")continue;const m=Array.isArray(c[p])?d:f;m[p]=c[p]}return[d,f]}function a(c,d=c.schema){const{gen:f,data:p,it:m}=c;if(Object.keys(d).length===0)return;const g=f.let("missing");for(const b in d){const y=d[b];if(y.length===0)continue;const w=(0,n.propertyInData)(f,p,b,m.opts.ownProperties);c.setParams({property:b,depsCount:y.length,deps:y.join(", ")}),m.allErrors?f.if(w,()=>{for(const _ of y)(0,n.checkReportMissingProp)(c,_)}):(f.if((0,t._)`${w} && (${(0,n.checkMissingProp)(c,y,g)})`),(0,n.reportMissingProp)(c,g),f.else())}}e.validatePropertyDeps=a;function l(c,d=c.schema){const{gen:f,data:p,keyword:m,it:g}=c,b=f.name("valid");for(const y in d)(0,r.alwaysValidSchema)(g,d[y])||(f.if((0,n.propertyInData)(f,p,y,g.opts.ownProperties),()=>{const w=c.subschema({keyword:m,schemaProp:y},b);c.mergeValidEvaluated(w,b)},()=>f.var(b,!0)),c.ok(b))}e.validateSchemaDeps=l,e.default=i}(K_)),K_}var iy={},RD;function Wwe(){if(RD)return iy;RD=1,Object.defineProperty(iy,"__esModule",{value:!0});const e=Dt(),t=Jt(),n={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:i})=>(0,e._)`{propertyName: ${i.propertyName}}`},code(i){const{gen:o,schema:a,data:l,it:c}=i;if((0,t.alwaysValidSchema)(c,a))return;const d=o.name("valid");o.forIn("key",l,f=>{i.setParams({propertyName:f}),i.subschema({keyword:"propertyNames",data:f,dataTypes:["string"],propertyName:f,compositeRule:!0},d),o.if((0,e.not)(d),()=>{i.error(!0),c.allErrors||o.break()})}),i.ok(d)}};return iy.default=n,iy}var oy={},ID;function F3(){if(ID)return oy;ID=1,Object.defineProperty(oy,"__esModule",{value:!0});const e=Sa(),t=Dt(),r=wa(),n=Jt(),o={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:a})=>(0,t._)`{additionalProperty: ${a.additionalProperty}}`},code(a){const{gen:l,schema:c,parentSchema:d,data:f,errsCount:p,it:m}=a;if(!p)throw new Error("ajv implementation error");const{allErrors:g,opts:b}=m;if(m.props=!0,b.removeAdditional!=="all"&&(0,n.alwaysValidSchema)(m,c))return;const y=(0,e.allSchemaProperties)(d.properties),w=(0,e.allSchemaProperties)(d.patternProperties);_(),a.ok((0,t._)`${p} === ${r.default.errors}`);function _(){l.forIn("key",f,R=>{!y.length&&!w.length?k(R):l.if(S(R),()=>k(R))})}function S(R){let T;if(y.length>8){const A=(0,n.schemaRefOrVal)(m,d.properties,"properties");T=(0,e.isOwnProperty)(l,A,R)}else y.length?T=(0,t.or)(...y.map(A=>(0,t._)`${R} === ${A}`)):T=t.nil;return w.length&&(T=(0,t.or)(T,...w.map(A=>(0,t._)`${(0,e.usePattern)(a,A)}.test(${R})`))),(0,t.not)(T)}function C(R){l.code((0,t._)`delete ${f}[${R}]`)}function k(R){if(b.removeAdditional==="all"||b.removeAdditional&&c===!1){C(R);return}if(c===!1){a.setParams({additionalProperty:R}),a.error(),g||l.break();return}if(typeof c=="object"&&!(0,n.alwaysValidSchema)(m,c)){const T=l.name("valid");b.removeAdditional==="failing"?(E(R,T,!1),l.if((0,t.not)(T),()=>{a.reset(),C(R)})):(E(R,T),g||l.if((0,t.not)(T),()=>l.break()))}}function E(R,T,A){const M={keyword:"additionalProperties",dataProp:R,dataPropType:n.Type.Str};A===!1&&Object.assign(M,{compositeRule:!0,createErrors:!1,allErrors:!1}),a.subschema(M,T)}}};return oy.default=o,oy}var ay={},kD;function Kwe(){if(kD)return ay;kD=1,Object.defineProperty(ay,"__esModule",{value:!0});const e=ww(),t=Sa(),r=Jt(),n=F3(),i={keyword:"properties",type:"object",schemaType:"object",code(o){const{gen:a,schema:l,parentSchema:c,data:d,it:f}=o;f.opts.removeAdditional==="all"&&c.additionalProperties===void 0&&n.default.code(new e.KeywordCxt(f,n.default,"additionalProperties"));const p=(0,t.allSchemaProperties)(l);for(const w of p)f.definedProperties.add(w);f.opts.unevaluated&&p.length&&f.props!==!0&&(f.props=r.mergeEvaluated.props(a,(0,r.toHash)(p),f.props));const m=p.filter(w=>!(0,r.alwaysValidSchema)(f,l[w]));if(m.length===0)return;const g=a.name("valid");for(const w of m)b(w)?y(w):(a.if((0,t.propertyInData)(a,d,w,f.opts.ownProperties)),y(w),f.allErrors||a.else().var(g,!0),a.endIf()),o.it.definedProperties.add(w),o.ok(g);function b(w){return f.opts.useDefaults&&!f.compositeRule&&l[w].default!==void 0}function y(w){o.subschema({keyword:"properties",schemaProp:w,dataProp:w},g)}}};return ay.default=i,ay}var sy={},jD;function Gwe(){if(jD)return sy;jD=1,Object.defineProperty(sy,"__esModule",{value:!0});const e=Sa(),t=Dt(),r=Jt(),n=Jt(),i={keyword:"patternProperties",type:"object",schemaType:"object",code(o){const{gen:a,schema:l,data:c,parentSchema:d,it:f}=o,{opts:p}=f,m=(0,e.allSchemaProperties)(l),g=m.filter(k=>(0,r.alwaysValidSchema)(f,l[k]));if(m.length===0||g.length===m.length&&(!f.opts.unevaluated||f.props===!0))return;const b=p.strictSchema&&!p.allowMatchingProperties&&d.properties,y=a.name("valid");f.props!==!0&&!(f.props instanceof t.Name)&&(f.props=(0,n.evaluatedPropsToName)(a,f.props));const{props:w}=f;_();function _(){for(const k of m)b&&S(k),f.allErrors?C(k):(a.var(y,!0),C(k),a.if(y))}function S(k){for(const E in b)new RegExp(k).test(E)&&(0,r.checkStrictMode)(f,`property ${E} matches pattern ${k} (use allowMatchingProperties)`)}function C(k){a.forIn("key",c,E=>{a.if((0,t._)`${(0,e.usePattern)(o,k)}.test(${E})`,()=>{const R=g.includes(k);R||o.subschema({keyword:"patternProperties",schemaProp:k,dataProp:E,dataPropType:n.Type.Str},y),f.opts.unevaluated&&w!==!0?a.assign((0,t._)`${w}[${E}]`,!0):!R&&!f.allErrors&&a.if((0,t.not)(y),()=>a.break())})})}}};return sy.default=i,sy}var ly={},$D;function Qwe(){if($D)return ly;$D=1,Object.defineProperty(ly,"__esModule",{value:!0});const e=Jt(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(r){const{gen:n,schema:i,it:o}=r;if((0,e.alwaysValidSchema)(o,i)){r.fail();return}const a=n.name("valid");r.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},a),r.failResult(a,()=>r.reset(),()=>r.error())},error:{message:"must NOT be valid"}};return ly.default=t,ly}var uy={},AD;function Ywe(){if(AD)return uy;AD=1,Object.defineProperty(uy,"__esModule",{value:!0});const t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Sa().validateUnion,error:{message:"must match a schema in anyOf"}};return uy.default=t,uy}var cy={},DD;function Xwe(){if(DD)return cy;DD=1,Object.defineProperty(cy,"__esModule",{value:!0});const e=Dt(),t=Jt(),n={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:i})=>(0,e._)`{passingSchemas: ${i.passing}}`},code(i){const{gen:o,schema:a,parentSchema:l,it:c}=i;if(!Array.isArray(a))throw new Error("ajv implementation error");if(c.opts.discriminator&&l.discriminator)return;const d=a,f=o.let("valid",!1),p=o.let("passing",null),m=o.name("_valid");i.setParams({passing:p}),o.block(g),i.result(f,()=>i.reset(),()=>i.error(!0));function g(){d.forEach((b,y)=>{let w;(0,t.alwaysValidSchema)(c,b)?o.var(m,!0):w=i.subschema({keyword:"oneOf",schemaProp:y,compositeRule:!0},m),y>0&&o.if((0,e._)`${m} && ${f}`).assign(f,!1).assign(p,(0,e._)`[${p}, ${y}]`).else(),o.if(m,()=>{o.assign(f,!0),o.assign(p,y),w&&i.mergeEvaluated(w,e.Name)})})}}};return cy.default=n,cy}var dy={},MD;function Jwe(){if(MD)return dy;MD=1,Object.defineProperty(dy,"__esModule",{value:!0});const e=Jt(),t={keyword:"allOf",schemaType:"array",code(r){const{gen:n,schema:i,it:o}=r;if(!Array.isArray(i))throw new Error("ajv implementation error");const a=n.name("valid");i.forEach((l,c)=>{if((0,e.alwaysValidSchema)(o,l))return;const d=r.subschema({keyword:"allOf",schemaProp:c},a);r.ok(a),r.mergeEvaluated(d)})}};return dy.default=t,dy}var fy={},ND;function Zwe(){if(ND)return fy;ND=1,Object.defineProperty(fy,"__esModule",{value:!0});const e=Dt(),t=Jt(),n={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:o})=>(0,e.str)`must match "${o.ifClause}" schema`,params:({params:o})=>(0,e._)`{failingKeyword: ${o.ifClause}}`},code(o){const{gen:a,parentSchema:l,it:c}=o;l.then===void 0&&l.else===void 0&&(0,t.checkStrictMode)(c,'"if" without "then" and "else" is ignored');const d=i(c,"then"),f=i(c,"else");if(!d&&!f)return;const p=a.let("valid",!0),m=a.name("_valid");if(g(),o.reset(),d&&f){const y=a.let("ifClause");o.setParams({ifClause:y}),a.if(m,b("then",y),b("else",y))}else d?a.if(m,b("then")):a.if((0,e.not)(m),b("else"));o.pass(p,()=>o.error(!0));function g(){const y=o.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},m);o.mergeEvaluated(y)}function b(y,w){return()=>{const _=o.subschema({keyword:y},m);a.assign(p,m),o.mergeValidEvaluated(_,p),w?a.assign(w,(0,e._)`${y}`):o.setParams({ifClause:y})}}}};function i(o,a){const l=o.schema[a];return l!==void 0&&!(0,t.alwaysValidSchema)(o,l)}return fy.default=n,fy}var hy={},FD;function eSe(){if(FD)return hy;FD=1,Object.defineProperty(hy,"__esModule",{value:!0});const e=Jt(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:r,parentSchema:n,it:i}){n.if===void 0&&(0,e.checkStrictMode)(i,`"${r}" without "if" is ignored`)}};return hy.default=t,hy}var LD;function tSe(){if(LD)return ey;LD=1,Object.defineProperty(ey,"__esModule",{value:!0});const e=M3(),t=qwe(),r=N3(),n=Uwe(),i=Hwe(),o=ET(),a=Wwe(),l=F3(),c=Kwe(),d=Gwe(),f=Qwe(),p=Ywe(),m=Xwe(),g=Jwe(),b=Zwe(),y=eSe();function w(_=!1){const S=[f.default,p.default,m.default,g.default,b.default,y.default,a.default,l.default,o.default,c.default,d.default];return _?S.push(t.default,n.default):S.push(e.default,r.default),S.push(i.default),S}return ey.default=w,ey}var py={},bd={},BD;function L3(){if(BD)return bd;BD=1,Object.defineProperty(bd,"__esModule",{value:!0}),bd.dynamicAnchor=void 0;const e=Dt(),t=wa(),r=_w(),n=PT(),i={keyword:"$dynamicAnchor",schemaType:"string",code:l=>o(l,l.schema)};function o(l,c){const{gen:d,it:f}=l;f.schemaEnv.root.dynamicAnchors[c]=!0;const p=(0,e._)`${t.default.dynamicAnchors}${(0,e.getProperty)(c)}`,m=f.errSchemaPath==="#"?f.validateName:a(l);d.if((0,e._)`!${p}`,()=>d.assign(p,m))}bd.dynamicAnchor=o;function a(l){const{schemaEnv:c,schema:d,self:f}=l.it,{root:p,baseId:m,localRefs:g,meta:b}=c.root,{schemaId:y}=f.opts,w=new r.SchemaEnv({schema:d,schemaId:y,root:p,baseId:m,localRefs:g,meta:b});return r.compileSchema.call(f,w),(0,n.getValidate)(l,w)}return bd.default=i,bd}var wd={},VD;function B3(){if(VD)return wd;VD=1,Object.defineProperty(wd,"__esModule",{value:!0}),wd.dynamicRef=void 0;const e=Dt(),t=wa(),r=PT(),n={keyword:"$dynamicRef",schemaType:"string",code:o=>i(o,o.schema)};function i(o,a){const{gen:l,keyword:c,it:d}=o;if(a[0]!=="#")throw new Error(`"${c}" only supports hash fragment reference`);const f=a.slice(1);if(d.allErrors)p();else{const g=l.let("valid",!1);p(g),o.ok(g)}function p(g){if(d.schemaEnv.root.dynamicAnchors[f]){const b=l.let("_v",(0,e._)`${t.default.dynamicAnchors}${(0,e.getProperty)(f)}`);l.if(b,m(b,g),m(d.validateName,g))}else m(d.validateName,g)()}function m(g,b){return b?()=>l.block(()=>{(0,r.callRef)(o,g),l.let(b,!0)}):()=>(0,r.callRef)(o,g)}}return wd.dynamicRef=i,wd.default=n,wd}var my={},zD;function rSe(){if(zD)return my;zD=1,Object.defineProperty(my,"__esModule",{value:!0});const e=L3(),t=Jt(),r={keyword:"$recursiveAnchor",schemaType:"boolean",code(n){n.schema?(0,e.dynamicAnchor)(n,""):(0,t.checkStrictMode)(n.it,"$recursiveAnchor: false is ignored")}};return my.default=r,my}var vy={},qD;function nSe(){if(qD)return vy;qD=1,Object.defineProperty(vy,"__esModule",{value:!0});const e=B3(),t={keyword:"$recursiveRef",schemaType:"string",code:r=>(0,e.dynamicRef)(r,r.schema)};return vy.default=t,vy}var UD;function iSe(){if(UD)return py;UD=1,Object.defineProperty(py,"__esModule",{value:!0});const e=L3(),t=B3(),r=rSe(),n=nSe(),i=[e.default,t.default,r.default,n.default];return py.default=i,py}var gy={},yy={},HD;function oSe(){if(HD)return yy;HD=1,Object.defineProperty(yy,"__esModule",{value:!0});const e=ET(),t={keyword:"dependentRequired",type:"object",schemaType:"object",error:e.error,code:r=>(0,e.validatePropertyDeps)(r)};return yy.default=t,yy}var by={},WD;function aSe(){if(WD)return by;WD=1,Object.defineProperty(by,"__esModule",{value:!0});const e=ET(),t={keyword:"dependentSchemas",type:"object",schemaType:"object",code:r=>(0,e.validateSchemaDeps)(r)};return by.default=t,by}var wy={},KD;function sSe(){if(KD)return wy;KD=1,Object.defineProperty(wy,"__esModule",{value:!0});const e=Jt(),t={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:r,parentSchema:n,it:i}){n.contains===void 0&&(0,e.checkStrictMode)(i,`"${r}" without "contains" is ignored`)}};return wy.default=t,wy}var GD;function lSe(){if(GD)return gy;GD=1,Object.defineProperty(gy,"__esModule",{value:!0});const e=oSe(),t=aSe(),r=sSe(),n=[e.default,t.default,r.default];return gy.default=n,gy}var Sy={},_y={},QD;function uSe(){if(QD)return _y;QD=1,Object.defineProperty(_y,"__esModule",{value:!0});const e=Dt(),t=Jt(),r=wa(),i={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:o})=>(0,e._)`{unevaluatedProperty: ${o.unevaluatedProperty}}`},code(o){const{gen:a,schema:l,data:c,errsCount:d,it:f}=o;if(!d)throw new Error("ajv implementation error");const{allErrors:p,props:m}=f;m instanceof e.Name?a.if((0,e._)`${m} !== true`,()=>a.forIn("key",c,w=>a.if(b(m,w),()=>g(w)))):m!==!0&&a.forIn("key",c,w=>m===void 0?g(w):a.if(y(m,w),()=>g(w))),f.props=!0,o.ok((0,e._)`${d} === ${r.default.errors}`);function g(w){if(l===!1){o.setParams({unevaluatedProperty:w}),o.error(),p||a.break();return}if(!(0,t.alwaysValidSchema)(f,l)){const _=a.name("valid");o.subschema({keyword:"unevaluatedProperties",dataProp:w,dataPropType:t.Type.Str},_),p||a.if((0,e.not)(_),()=>a.break())}}function b(w,_){return(0,e._)`!${w} || !${w}[${_}]`}function y(w,_){const S=[];for(const C in w)w[C]===!0&&S.push((0,e._)`${_} !== ${C}`);return(0,e.and)(...S)}}};return _y.default=i,_y}var xy={},YD;function cSe(){if(YD)return xy;YD=1,Object.defineProperty(xy,"__esModule",{value:!0});const e=Dt(),t=Jt(),n={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:{message:({params:{len:i}})=>(0,e.str)`must NOT have more than ${i} items`,params:({params:{len:i}})=>(0,e._)`{limit: ${i}}`},code(i){const{gen:o,schema:a,data:l,it:c}=i,d=c.items||0;if(d===!0)return;const f=o.const("len",(0,e._)`${l}.length`);if(a===!1)i.setParams({len:d}),i.fail((0,e._)`${f} > ${d}`);else if(typeof a=="object"&&!(0,t.alwaysValidSchema)(c,a)){const m=o.var("valid",(0,e._)`${f} <= ${d}`);o.if((0,e.not)(m),()=>p(m,d)),i.ok(m)}c.items=!0;function p(m,g){o.forRange("i",g,f,b=>{i.subschema({keyword:"unevaluatedItems",dataProp:b,dataPropType:t.Type.Num},m),c.allErrors||o.if((0,e.not)(m),()=>o.break())})}}};return xy.default=n,xy}var XD;function dSe(){if(XD)return Sy;XD=1,Object.defineProperty(Sy,"__esModule",{value:!0});const e=uSe(),t=cSe(),r=[e.default,t.default];return Sy.default=r,Sy}var Py={},Cy={},JD;function fSe(){if(JD)return Cy;JD=1,Object.defineProperty(Cy,"__esModule",{value:!0});const e=Dt(),r={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:n})=>(0,e.str)`must match format "${n}"`,params:({schemaCode:n})=>(0,e._)`{format: ${n}}`},code(n,i){const{gen:o,data:a,$data:l,schema:c,schemaCode:d,it:f}=n,{opts:p,errSchemaPath:m,schemaEnv:g,self:b}=f;if(!p.validateFormats)return;l?y():w();function y(){const _=o.scopeValue("formats",{ref:b.formats,code:p.code.formats}),S=o.const("fDef",(0,e._)`${_}[${d}]`),C=o.let("fType"),k=o.let("format");o.if((0,e._)`typeof ${S} == "object" && !(${S} instanceof RegExp)`,()=>o.assign(C,(0,e._)`${S}.type || "string"`).assign(k,(0,e._)`${S}.validate`),()=>o.assign(C,(0,e._)`"string"`).assign(k,S)),n.fail$data((0,e.or)(E(),R()));function E(){return p.strictSchema===!1?e.nil:(0,e._)`${d} && !${k}`}function R(){const T=g.$async?(0,e._)`(${S}.async ? await ${k}(${a}) : ${k}(${a}))`:(0,e._)`${k}(${a})`,A=(0,e._)`(typeof ${k} == "function" ? ${T} : ${k}.test(${a}))`;return(0,e._)`${k} && ${k} !== true && ${C} === ${i} && !${A}`}}function w(){const _=b.formats[c];if(!_){E();return}if(_===!0)return;const[S,C,k]=R(_);S===i&&n.pass(T());function E(){if(p.strictSchema===!1){b.logger.warn(A());return}throw new Error(A());function A(){return`unknown format "${c}" ignored in schema at path "${m}"`}}function R(A){const M=A instanceof RegExp?(0,e.regexpCode)(A):p.code.formats?(0,e._)`${p.code.formats}${(0,e.getProperty)(c)}`:void 0,B=o.scopeValue("formats",{key:c,ref:A,code:M});return typeof A=="object"&&!(A instanceof RegExp)?[A.type||"string",A.validate,(0,e._)`${B}.validate`]:["string",A,B]}function T(){if(typeof _=="object"&&!(_ instanceof RegExp)&&_.async){if(!g.$async)throw new Error("async format in sync schema");return(0,e._)`await ${k}(${a})`}return typeof C=="function"?(0,e._)`${k}(${a})`:(0,e._)`${k}.test(${a})`}}}};return Cy.default=r,Cy}var ZD;function hSe(){if(ZD)return Py;ZD=1,Object.defineProperty(Py,"__esModule",{value:!0});const t=[fSe().default];return Py.default=t,Py}var ku={},eM;function pSe(){return eM||(eM=1,Object.defineProperty(ku,"__esModule",{value:!0}),ku.contentVocabulary=ku.metadataVocabulary=void 0,ku.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],ku.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),ku}var tM;function mSe(){if(tM)return Fg;tM=1,Object.defineProperty(Fg,"__esModule",{value:!0});const e=Iwe(),t=zwe(),r=tSe(),n=iSe(),i=lSe(),o=dSe(),a=hSe(),l=pSe(),c=[n.default,e.default,t.default,(0,r.default)(!0),a.default,l.metadataVocabulary,l.contentVocabulary,i.default,o.default];return Fg.default=c,Fg}var Ey={},qh={},rM;function vSe(){if(rM)return qh;rM=1,Object.defineProperty(qh,"__esModule",{value:!0}),qh.DiscrError=void 0;var e;return function(t){t.Tag="tag",t.Mapping="mapping"}(e||(qh.DiscrError=e={})),qh}var nM;function gSe(){if(nM)return Ey;nM=1,Object.defineProperty(Ey,"__esModule",{value:!0});const e=Dt(),t=vSe(),r=_w(),n=Sw(),i=Jt(),a={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:l,tagName:c}})=>l===t.DiscrError.Tag?`tag "${c}" must be string`:`value of tag "${c}" must be in oneOf`,params:({params:{discrError:l,tag:c,tagName:d}})=>(0,e._)`{error: ${l}, tag: ${d}, tagValue: ${c}}`},code(l){const{gen:c,data:d,schema:f,parentSchema:p,it:m}=l,{oneOf:g}=p;if(!m.opts.discriminator)throw new Error("discriminator: requires discriminator option");const b=f.propertyName;if(typeof b!="string")throw new Error("discriminator: requires propertyName");if(f.mapping)throw new Error("discriminator: mapping is not supported");if(!g)throw new Error("discriminator: requires oneOf keyword");const y=c.let("valid",!1),w=c.const("tag",(0,e._)`${d}${(0,e.getProperty)(b)}`);c.if((0,e._)`typeof ${w} == "string"`,()=>_(),()=>l.error(!1,{discrError:t.DiscrError.Tag,tag:w,tagName:b})),l.ok(y);function _(){const k=C();c.if(!1);for(const E in k)c.elseIf((0,e._)`${w} === ${E}`),c.assign(y,S(k[E]));c.else(),l.error(!1,{discrError:t.DiscrError.Mapping,tag:w,tagName:b}),c.endIf()}function S(k){const E=c.name("valid"),R=l.subschema({keyword:"oneOf",schemaProp:k},E);return l.mergeEvaluated(R,e.Name),E}function C(){var k;const E={},R=A(p);let T=!0;for(let Q=0;Q<g.length;Q++){let se=g[Q];if(se!=null&&se.$ref&&!(0,i.schemaHasRulesButRef)(se,m.self.RULES)){const N=se.$ref;if(se=r.resolveRef.call(m.self,m.schemaEnv.root,m.baseId,N),se instanceof r.SchemaEnv&&(se=se.schema),se===void 0)throw new n.default(m.opts.uriResolver,m.baseId,N)}const ie=(k=se==null?void 0:se.properties)===null||k===void 0?void 0:k[b];if(typeof ie!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${b}"`);T=T&&(R||A(se)),M(ie,Q)}if(!T)throw new Error(`discriminator: "${b}" must be required`);return E;function A({required:Q}){return Array.isArray(Q)&&Q.includes(b)}function M(Q,se){if(Q.const)B(Q.const,se);else if(Q.enum)for(const ie of Q.enum)B(ie,se);else throw new Error(`discriminator: "properties/${b}" must have "const" or "enum"`)}function B(Q,se){if(typeof Q!="string"||Q in E)throw new Error(`discriminator: "${b}" values must be unique strings`);E[Q]=se}}}};return Ey.default=a,Ey}var Ty={};const ySe="https://json-schema.org/draft/2020-12/schema",bSe="https://json-schema.org/draft/2020-12/schema",wSe={"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},SSe="meta",_Se="Core and Validation specifications meta-schema",xSe=[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],PSe=["object","boolean"],CSe="This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",ESe={definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}},TSe={$schema:ySe,$id:bSe,$vocabulary:wSe,$dynamicAnchor:SSe,title:_Se,allOf:xSe,type:PSe,$comment:CSe,properties:ESe},OSe="https://json-schema.org/draft/2020-12/schema",RSe="https://json-schema.org/draft/2020-12/meta/applicator",ISe={"https://json-schema.org/draft/2020-12/vocab/applicator":!0},kSe="meta",jSe="Applicator vocabulary meta-schema",$Se=["object","boolean"],ASe={prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},DSe={schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}},MSe={$schema:OSe,$id:RSe,$vocabulary:ISe,$dynamicAnchor:kSe,title:jSe,type:$Se,properties:ASe,$defs:DSe},NSe="https://json-schema.org/draft/2020-12/schema",FSe="https://json-schema.org/draft/2020-12/meta/unevaluated",LSe={"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},BSe="meta",VSe="Unevaluated applicator vocabulary meta-schema",zSe=["object","boolean"],qSe={unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}},USe={$schema:NSe,$id:FSe,$vocabulary:LSe,$dynamicAnchor:BSe,title:VSe,type:zSe,properties:qSe},HSe="https://json-schema.org/draft/2020-12/schema",WSe="https://json-schema.org/draft/2020-12/meta/content",KSe={"https://json-schema.org/draft/2020-12/vocab/content":!0},GSe="meta",QSe="Content vocabulary meta-schema",YSe=["object","boolean"],XSe={contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}},JSe={$schema:HSe,$id:WSe,$vocabulary:KSe,$dynamicAnchor:GSe,title:QSe,type:YSe,properties:XSe},ZSe="https://json-schema.org/draft/2020-12/schema",e1e="https://json-schema.org/draft/2020-12/meta/core",t1e={"https://json-schema.org/draft/2020-12/vocab/core":!0},r1e="meta",n1e="Core vocabulary meta-schema",i1e=["object","boolean"],o1e={$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},a1e={anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}},s1e={$schema:ZSe,$id:e1e,$vocabulary:t1e,$dynamicAnchor:r1e,title:n1e,type:i1e,properties:o1e,$defs:a1e},l1e="https://json-schema.org/draft/2020-12/schema",u1e="https://json-schema.org/draft/2020-12/meta/format-annotation",c1e={"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},d1e="meta",f1e="Format vocabulary meta-schema for annotation results",h1e=["object","boolean"],p1e={format:{type:"string"}},m1e={$schema:l1e,$id:u1e,$vocabulary:c1e,$dynamicAnchor:d1e,title:f1e,type:h1e,properties:p1e},v1e="https://json-schema.org/draft/2020-12/schema",g1e="https://json-schema.org/draft/2020-12/meta/meta-data",y1e={"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},b1e="meta",w1e="Meta-data vocabulary meta-schema",S1e=["object","boolean"],_1e={title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}},x1e={$schema:v1e,$id:g1e,$vocabulary:y1e,$dynamicAnchor:b1e,title:w1e,type:S1e,properties:_1e},P1e="https://json-schema.org/draft/2020-12/schema",C1e="https://json-schema.org/draft/2020-12/meta/validation",E1e={"https://json-schema.org/draft/2020-12/vocab/validation":!0},T1e="meta",O1e="Validation vocabulary meta-schema",R1e=["object","boolean"],I1e={type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},k1e={nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},j1e={$schema:P1e,$id:C1e,$vocabulary:E1e,$dynamicAnchor:T1e,title:O1e,type:R1e,properties:I1e,$defs:k1e};var iM;function $1e(){if(iM)return Ty;iM=1,Object.defineProperty(Ty,"__esModule",{value:!0});const e=TSe,t=MSe,r=USe,n=JSe,i=s1e,o=m1e,a=x1e,l=j1e,c=["/properties"];function d(f){return[e,t,r,n,i,p(this,o),a,p(this,l)].forEach(m=>this.addMetaSchema(m,void 0,!1)),this;function p(m,g){return f?m.$dataMetaSchema(g,c):g}}return Ty.default=d,Ty}var oM;function A1e(){return oM||(oM=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv2020=void 0;const r=Owe(),n=mSe(),i=gSe(),o=$1e(),a="https://json-schema.org/draft/2020-12/schema";class l extends r.default{constructor(g={}){super({...g,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),n.default.forEach(g=>this.addVocabulary(g)),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();const{$data:g,meta:b}=this.opts;b&&(o.default.call(this,g),this.refs["http://json-schema.org/schema"]=a)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(a)?a:void 0)}}t.Ajv2020=l,e.exports=t=l,e.exports.Ajv2020=l,Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var c=ww();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var d=Dt();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return d.CodeGen}});var f=xT();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return f.default}});var p=Sw();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return p.default}})}($g,$g.exports)),$g.exports}var D1e=A1e();const M1e=mc(D1e),N1e={type:"object",properties:{$ref:{type:"string"}},additionalProperties:!1,required:["$ref"]},F1e={type:"object",properties:{type:{const:"string"},default:{type:"string"},foreignKey:{type:"string"}},additionalProperties:!1,required:["type","default"]},L1e={type:"object",properties:{type:{const:"number"},default:{type:"number"}},additionalProperties:!1,required:["type","default"]},B1e={type:"object",properties:{type:{const:"boolean"},default:{type:"boolean"}},additionalProperties:!1,required:["type","default"]},V1e={type:"object",properties:{type:{const:"object"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},additionalProperties:{const:!1},required:{$ref:"#/$defs/stringArray"}},additionalProperties:!1,required:["type","properties","additionalProperties","required"]},z1e={type:"object",properties:{type:{const:"array"},items:{oneOf:[{$ref:"#/$defs/refSchema"},{$ref:"#/$defs/objectSchema"},{$ref:"#/$defs/arraySchema"},{$ref:"#/$defs/stringSchema"},{$ref:"#/$defs/numberSchema"},{$ref:"#/$defs/booleanSchema"}]}},additionalProperties:!1,required:["type","items"]},q1e={type:"object",$dynamicAnchor:"meta",oneOf:[{$ref:"#/$defs/refSchema"},{$ref:"#/$defs/objectSchema"},{$ref:"#/$defs/arraySchema"},{$ref:"#/$defs/stringSchema"},{$ref:"#/$defs/numberSchema"},{$ref:"#/$defs/booleanSchema"}],$defs:{stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]},refSchema:N1e,objectSchema:V1e,stringSchema:F1e,numberSchema:L1e,booleanSchema:B1e,arraySchema:z1e}},V3=e=>new M1e().validate(q1e,e);class U1e{constructor(t){this.projectPageModel=t,st(this,{},{autoBind:!0})}get row(){return this.projectPageModel.rowOrThrow}get isValidSchema(){const t=this.projectPageModel.tableOrThrow.schema;return V3(t)}init(){}dispose(){}}const H1e=()=>{const e=Zn(),[t]=O.useState(()=>new U1e(e));return O.useEffect(()=>(t.init(),()=>t.dispose()),[t]),t};class W1e{constructor(t,r=nn()){Pe(this,"type",Le.Array);Pe(this,"$ref","");this.items=t,this.nodeId=r,st(this)}getPlainSchema(){return Wx({type:this.type,items:this.items.getPlainSchema()})}}class K1e{constructor(t=nn()){Pe(this,"type",Le.Boolean);Pe(this,"$ref","");Pe(this,"default",!1);Pe(this,"readOnly");this.nodeId=t,st(this)}getPlainSchema(){return{type:this.type,default:this.default}}}class G1e{constructor(t=nn()){Pe(this,"type",Le.Number);Pe(this,"$ref","");Pe(this,"default",0);Pe(this,"readOnly");this.nodeId=t,st(this)}getPlainSchema(){return{type:this.type,default:this.default}}}class z3{constructor(t=nn()){Pe(this,"type",Le.Object);Pe(this,"$ref","");Pe(this,"additionalProperties",!1);Pe(this,"required",[]);Pe(this,"properties",{});this.nodeId=t,st(this)}get empty(){return Object.keys(this.properties).length===0}addPropertyWithStore(t,r){if(this.properties[t]||this.required.includes(t))throw new Error("this name already exists");return this.required.push(t),this.properties[t]=r}getPlainSchema(){return Wx({type:this.type,additionalProperties:this.additionalProperties,required:Wx(this.required).sort(),properties:Object.entries(this.properties).reduce((t,[r,n])=>(t[r]=n.getPlainSchema(),t),{})})}}class q3{constructor(t=nn()){Pe(this,"type",Le.String);Pe(this,"$ref","");Pe(this,"default","");Pe(this,"foreignKey");Pe(this,"readOnly");this.nodeId=t,st(this)}getPlainSchema(){const t={type:this.type,default:this.default};return this.foreignKey&&(t.foreignKey=this.foreignKey),t}}const gm=e=>{if("$ref"in e){const t=p3[e.$ref];if(!t)throw new Error(`Schema refs must be defined ref$=${e.$ref}`);const r=gm(t);return r.$ref=e.$ref,r}else return e.type===Le.Object?Q1e(e):e.type===Le.Array?new W1e(gm(e.items)):Y1e(e)},Q1e=e=>{const t=new z3;return Object.entries(e.properties).forEach(([r,n])=>{t.addPropertyWithStore(r,gm(n))}),t},Y1e=e=>{if(e.type===Le.String){const t=new q3;return t.foreignKey=e.foreignKey,t.readOnly=e.readOnly,t}else if(e.type===Le.Number){const t=new G1e;return t.readOnly=e.readOnly,t}else if(e.type===Le.Boolean){const t=new K1e;return t.readOnly=e.readOnly,t}else throw new Error("this type is not allowed")};class U3{constructor(t){Pe(this,"id","");Pe(this,"parent",null);Pe(this,"nodeId",nn());Pe(this,"type",Le.String);Pe(this,"baseValue","");Pe(this,"value",null);this.schema=t,st(this)}get $ref(){return this.schema.$ref}get readOnly(){return this.schema.readOnly}get foreignKey(){return this.schema.foreignKey}get touched(){return this.baseValue!==this.value}get isValid(){return!(this.schema.foreignKey&&!this.value)}getPlainValue(){return this.value??this.schema.default}setValue(t){this.value=t}updateBaseValue(t){this.baseValue=t,this.value=t}}class H3{constructor(t,r,n=null,i){Pe(this,"name",new U3(new q3));Pe(this,"root");Pe(this,"overNode",null);Pe(this,"viewMode",zn.Tree);Pe(this,"scrollPosition",null);Pe(this,"originData",null);var o;this.originRow=n,this.projectPageModel=i,this.root=t,this.name.baseValue=r,this.name.value=r,this.originData=((o=this.originRow)==null?void 0:o.data)||null,this.reset(),st(this,{},{autoBind:!0})}get touched(){return this.root.touched||this.name.touched}get isValid(){return this.root.isValid||this.name.isValid}get isComplexStructure(){return this.root.type===Le.Object?Object.values(this.root.value).some(t=>t.type===Le.Object||t.type===Le.Array):this.root.type===Le.Array?this.root.items.type===Le.Object||this.root.items.type===Le.Array:!1}get areThereForeignKeysBy(){var t,r;return!!((r=(t=this.projectPageModel)==null?void 0:t.rowRefsBy)!=null&&r.countForeignKeysBy)}setOverNode(t){this.overNode=t}setViewMode(t){this.viewMode=t}setScrollPosition(t){this.scrollPosition=t}reset(){this.originData&&(this.root.updateBaseValue(this.originData),this.name.value=this.name.baseValue)}save(){this.originData=this.root.getPlainValue(),this.root.updateBaseValue(this.originData),this.name.updateBaseValue(this.name.value)}}class X1e{constructor(t){Pe(this,"id","");Pe(this,"parent",null);Pe(this,"nodeId",nn());Pe(this,"type",Le.Array);Pe(this,"baseValue",[]);Pe(this,"value",[]);this.schema=t,st(this)}get $ref(){return this.schema.$ref}get touched(){return this.value!==this.baseValue?!0:this.value.some(t=>t.touched)}get isValid(){return this.value.every(t=>t.isValid)}get items(){return this.schema.items}getPlainValue(){return this.value.map(t=>t.getPlainValue())}createItem(){this.value===this.baseValue&&(this.value=this.baseValue.slice());const t=ym(this.schema.items);return this.value.push(t),t.parent=this,t.id=(this.value.length-1).toString(),t}removeItem(t){this.value===this.baseValue&&(this.value=this.baseValue.slice());const r=this.value[t];r.parent=null,r.id="",this.value.splice(t,1)}updateBaseValue(t){this.baseValue.length=0,t.forEach((n,i)=>{const o=ym(this.schema.items);o.parent=this,o.id=i.toString(),o.updateBaseValue(n),this.baseValue.push(o)}),this.value=this.baseValue}}class J1e{constructor(t){Pe(this,"id","");Pe(this,"parent",null);Pe(this,"nodeId",nn());Pe(this,"type",Le.Boolean);Pe(this,"baseValue",null);Pe(this,"value",null);this.schema=t,st(this)}get $ref(){return this.schema.$ref}get readOnly(){return this.schema.readOnly}get touched(){return this.baseValue!==this.value}get isValid(){return!0}getPlainValue(){return this.value??this.schema.default}setValue(t){this.value=t}updateBaseValue(t){this.baseValue=t,this.value=t}}class Z1e{constructor(t){Pe(this,"id","");Pe(this,"parent",null);Pe(this,"nodeId",nn());Pe(this,"type",Le.Number);Pe(this,"baseValue",null);Pe(this,"value",null);this.schema=t,st(this)}get $ref(){return this.schema.$ref}get readOnly(){return this.schema.readOnly}get touched(){return this.baseValue!==this.value}get isValid(){return!0}get default(){return this.schema.default}getPlainValue(){return this.value??this.default}setValue(t){this.value=t}updateBaseValue(t){this.baseValue=t,this.value=t}}class e_e{constructor(t){Pe(this,"id","");Pe(this,"parent",null);Pe(this,"nodeId",nn());Pe(this,"type",Le.Object);Pe(this,"value",{});this.schema=t,st(this),this.init()}get $ref(){return this.schema.$ref}get touched(){return Object.values(this.value).some(t=>t.touched)}get isValid(){return Object.values(this.value).every(t=>t.isValid)}getPlainValue(){return Object.entries(this.value).reduce((t,[r,n])=>(t[r]=n.getPlainValue(),t),{})}updateBaseValue(t){Object.entries(this.value).map(([r,n])=>{r in t&&n.updateBaseValue(t[r])})}init(){Object.entries(this.schema.properties).forEach(([t,r])=>{const n=ym(r);n.parent=this,n.id=t,this.value[t]=n})}}const ym=e=>{switch(e.type){case Le.Object:return new e_e(e);case Le.Array:return new X1e(e);case Le.String:return new U3(e);case Le.Number:return new Z1e(e);case Le.Boolean:return new J1e(e)}},W3=e=>{let t=e,r="";for(;t.parent;)t.parent.type===Le.Object?t.type===Le.Array?r=`${t.id}${r}`:r?r=`${t.id}.${r}`:r=t.id:t.parent.type===Le.Array&&(r&&t.type===Le.Array?r=`[${t.id}]${r}`:r?r=`[${t.id}].${r}`:r=`[${t.id}]`),t=t.parent;return r?`"${r}"`:""},t_e=Ne`
|
@@ -1463,4 +1463,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
1463
1463
|
}
|
1464
1464
|
${Qs}
|
1465
1465
|
${is}
|
1466
|
-
`,$_e=async e=>{const t=await xr.mutate({mutation:j_e,variables:e});if(!t.data)throw t.errors;return t.data};class A_e{constructor(t,r){this.rootStore=t,this.projectPageModel=r}get branch(){return this.projectPageModel.branchOrThrow}get table(){return this.projectPageModel.tableOrThrow}async execute(t){const{table:r,previousVersionTableId:n,isBranchTouched:i}=await this.updateRowRequest(t),o=r&&n&&r.versionId!==n,a=!r;return o&&this.updateTablesConnection(r),o?await this.refetchRowsConnectionInDraftTable():(this.updateRowsConnectionInDraftTable(t),a&&await this.refetchDraftTables()),this.branch.updateTouched(i),o&&this.projectPageModel.revalidateLoaders(),!0}async updateRowRequest(t){var n,i;const r=await $_e({data:{revisionId:this.branch.draft.id,tableId:this.table.id,rowId:t}});return{table:this.addVersionedTableToCache((n=r.removeRow)==null?void 0:n.table),previousVersionTableId:(i=r.removeRow)==null?void 0:i.previousVersionTableId,isBranchTouched:r.removeRow.branch.touched}}addVersionedTableToCache(t){return t?this.addTableToCache(t):null}addTableToCache(t){const r=this.rootStore.cache.addOrTable(Lf(t));return this.rootStore.cache.addTableByVariables({revisionId:this.branch.draft.id,tableId:this.table.id},r.versionId),r}updateTablesConnection(t){const r=this.branch.draft,n=r.tablesConnection.edges.find(i=>i.node.id===t.id);n&&r.tablesConnection.replaceNode(n.cursor,t)}async refetchDraftTables(){return this.rootStore.queryTables({revisionId:this.branch.draft.id,first:50})}async refetchRowsConnectionInDraftTable(){return this.rootStore.queryRows({revisionId:this.branch.draft.id,tableId:this.table.id,first:50})}updateRowsConnectionInDraftTable(t){const r=this.rootStore.cache.getTableByVariables({revisionId:this.branch.draft.id,tableId:this.table.id}),n=r==null?void 0:r.rowsConnection.edges.find(i=>i.node.id===t);r==null||r.rowsConnection.removeEdge(n==null?void 0:n.cursor)}}class D_e{constructor(t,r,n){this.rootStore=t,this.projectPageModel=r,this.table=n,st(this,{},{autoBind:!0})}get totalCount(){return this.items.length}get hasNextPage(){return this.table.rowsConnection.availableNextPage}get isEdit(){return this.projectPageModel.isEditableRevision}get items(){return this.table.rowsConnection.edges.map(({node:t})=>({id:t.id,versionId:t.versionId,readonly:t.readonly,title:t.id,data:JSON.stringify(t.data,null,2).replaceAll("\\n",""),link:""}))}setTable(t){this.table=t}dispose(){}tryToFetchNextPage(){this.hasNextPage&&this.rootStore.queryRows({revisionId:this.revision.id,tableId:this.table.id,first:50,after:this.table.rowsConnection.endCursor||void 0})}async deleteRow(t){try{return await new A_e(this.rootStore,this.projectPageModel).execute(t)}catch(r){return console.error(r),!1}}init(){}get revision(){return this.projectPageModel.revisionOrThrow}}const M_e=e=>{const t=Zn(),[r]=O.useState(()=>new D_e(ct,t,e));return O.useEffect(()=>(r.init(),r.setTable(e),()=>r.dispose()),[r,e]),r},N_e=({rowId:e,onRemove:t,dataTestId:r})=>{const[n,i]=O.useState(!1),o=O.useCallback(async()=>{i(!0),await(t==null?void 0:t(e)),i(!1)},[e,t]);return x.jsx(Ci,{"data-testid":r,"aria-label":"",color:"gray.400",icon:x.jsx(J0,{}),isLoading:n,variant:"ghost",onClick:o})},F_e=({row:e,store:t,onSelect:r})=>{const n=O.useCallback(()=>{r==null||r(e.id)},[r,e.id]),i=!!r;return x.jsxs(je,{_hover:{backgroundColor:"gray.50"},alignItems:"center",className:WP.Row,gap:"4px",paddingLeft:"1rem",minHeight:"2.5rem",width:"100%","data-testid":`row-${e.id}`,children:[x.jsxs(je,{width:"150px",children:[r?x.jsx(bt,{maxWidth:"140px",textDecoration:"underline",cursor:"pointer",onClick:n,"data-testid":`row-${e.id}-select`,textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:e.id}):x.jsx(qo,{to:`${e.id}`,"data-testid":`row-${e.id}-link`,children:x.jsx(bt,{maxWidth:"140px",color:"gray.400",textDecoration:"underline",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:e.id})}),!e.readonly&&t.isEdit&&x.jsx(bt,{color:"gray.400",children:"*"})]}),x.jsxs(je,{alignItems:"center",justifyContent:"space-between",minHeight:"40px",width:"100%",minWidth:0,children:[x.jsx(bt,{ml:"16px",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",color:"gray.400",fontWeight:"300",children:e.data}),!i&&t.isEdit&&x.jsx(wt,{className:WP.RemoveRowButton,children:x.jsx(N_e,{rowId:e.id,onRemove:t.deleteRow,dataTestId:`remove-row-${e.id}`})})]})]},e.versionId)},L_e=Ot(({table:e,onSelect:t})=>{const r=M_e(e);return x.jsx(pw,{useWindowScroll:!0,totalCount:r.totalCount,defaultItemHeight:40,increaseViewportBy:40*100,endReached:r.hasNextPage?r.tryToFetchNextPage:void 0,itemContent:n=>{const i=r.items[n];if(i)return x.jsx(F_e,{row:i,store:r,onSelect:t})}})}),X_=({tableId:e})=>x.jsx(je,{width:"100%",borderStyle:"solid",borderTopWidth:1,borderColor:"gray.100",justifyContent:"center",color:"gray.400",fontWeight:"300",pt:"0.5rem",pb:"0.5rem",children:x.jsxs(wt,{backgroundColor:"gray.50",pl:"5px",pr:"5px",borderRadius:"5px",children:['Select or create a row in "',e,'" to be referenced by the above row']})}),B_e=({previousType:e,tableId:t,rowId:r,foreignKeyPath:n,onCancel:i})=>{const o=O.useMemo(()=>e===Rn.UpdatingRow?"updating":e===Rn.CreatingRow?"creating":"",[e]);return x.jsx(x.Fragment,{children:x.jsx(wt,{width:"100%",borderStyle:"solid",borderLeftWidth:2,borderColor:"gray.200",pl:"1rem",mb:"1rem",children:x.jsxs(je,{gap:"4px",alignItems:"center",height:"30px",mt:"2px",mb:"2px",color:"gray.400",fontWeight:"300",children:[x.jsx(bt,{textDecoration:"underline",cursor:"pointer",onClick:i,children:"Back"}),x.jsxs(bt,{children:["- ",o,' "',t," - ",r,'":']}),x.jsx(bt,{children:n})]})})})},V_e=Ot(()=>{const e=ou(),t=Tc(),{root:r,item:n}=f_e(),i=O.useCallback(async f=>{await r.selectForeignKey(n,f)},[n,r]),o=O.useCallback(()=>{r.cancelSelectingForeignKey(n)},[n,r]),a=O.useCallback(f=>{r.onSelectedForeignKey(n,f)},[n,r]),l=O.useCallback(async()=>{if(n.state.type===Rn.CreatingRow){const f=n.state.store,p=await n.createRow(f.name.getPlainValue(),f.root.getPlainValue());p&&(n.state.isSelectingForeignKey?r.onSelectedForeignKey(n,f.name.getPlainValue()):e(t.make({isDraft:!0,rowId:p.id})))}},[n,t,e,r]),c=O.useCallback(async()=>{if(n.state.type===Rn.UpdatingRow){const f=n.state.store;await n.updateRow(f)&&(f.save(),r.updateStore(),e(t.make({isDraft:!0,rowId:f.name.getPlainValue()})))}},[n,t,e,r]),d=O.useCallback(async(f,p)=>{if(n.state.type===Rn.UpdatingRow){const m=n.state.store;await n.uploadFile(m,f,p)&&(r.updateStore(),e(t.make({isDraft:!0,rowId:m.name.getPlainValue()})))}},[n,t,e,r]);if(n.state.type===Rn.ConnectingForeignKeyRow){const f=n.state.store;return x.jsx(x.Fragment,{children:x.jsx(B_e,{previousType:n.state.previousType,foreignKeyPath:n.currentForeignKeyPath,onCancel:o,tableId:n.table.id,rowId:f.name.getPlainValue()})})}return n.state.type===Rn.List?x.jsxs(x.Fragment,{children:[n.state.isSelectingForeignKey&&x.jsx(X_,{tableId:n.table.id}),x.jsx(h_e,{onClick:n.toCreatingRow}),x.jsx(wt,{paddingTop:"0.5rem",paddingBottom:"1rem",children:x.jsx(L_e,{table:n.table,onSelect:n.state.isSelectingForeignKey?a:void 0})})]}):n.state.type===Rn.CreatingRow?x.jsxs(x.Fragment,{children:[n.state.isSelectingForeignKey&&x.jsx(X_,{tableId:n.table.id}),x.jsx(I_e,{store:n.state.store,onAdd:l,onCancel:n.toList,onSelectForeignKey:i})]}):n.state.type===Rn.UpdatingRow?x.jsxs(x.Fragment,{children:[n.state.isSelectingForeignKey&&x.jsx(X_,{tableId:n.table.id}),x.jsx(k_e,{isEdit:n.isEditableRevision,store:n.state.store,onUpdate:c,onSelectForeignKey:i,onUploadFile:d})]}):null}),Y3=Ot(({startWithUpdating:e})=>{const t=d_e(e);return x.jsx(x.Fragment,{children:t.stack.map(r=>x.jsx(G3.Provider,{value:{root:t,item:r},children:x.jsx(V_e,{})},r.id))})}),z_e=Ot(()=>{const e=H1e();return e.isValidSchema?x.jsx(Y3,{startWithUpdating:!0}):x.jsx(fwe,{data:e.row.data})}),q_e=()=>x.jsx($f,{hideSidebar:!0,children:x.jsxs(je,{alignItems:"center",flexDirection:"column",justifyContent:"center",flex:1,gap:"8px",children:[x.jsx(bt,{color:"gray.400",children:"Check your email to confirm your account"}),x.jsx(Cf,{color:"gray.400",alignSelf:"center",as:qo,to:`/${xc}`,children:"Log in"})]})}),U_e=()=>null;class KP{constructor(t,r,n){Pe(this,"isLoading",!1);this.routerService=t,this.apiService=r,this.authService=n,st(this)}async login(t){t?(await this.loginRequest(t),await this.routerService.navigate("/")):console.error("Invalid code")}dispose(){}init(){}async loginRequest(t){this.setIsLoading(!0);try{const r=await this.apiService.client.loginGoogle({data:{code:t,redirectUrl:AV()}});return await this.authService.setToken(r.loginGoogle.accessToken),!0}catch(r){console.error(r)}finally{this.setIsLoading(!1)}}setIsLoading(t){this.isLoading=t}}dt.register(KP,()=>{const e=dt.get(Us),t=dt.get(es),r=dt.get(qi);return new KP(e,t,r)},{scope:"request"});const H_e=async({request:e})=>{const n=new URL(e.url).searchParams.get("code");if(!n)throw new Error("Invalid code");return await dt.get(KP).login(n),hf("/")};class GP{constructor(t,r,n){Pe(this,"isLoading",!1);Pe(this,"form",new GE({email:"",username:"",password:""}));this.routerService=t,this.apiService=r,this.configurationService=n,st(this)}get disableSubmitButton(){return!this.form.isValid}get availableEmailSignUp(){return this.configurationService.availableEmailSignUp}get availableOauth(){return this.configurationService.availableGoogleOauth}get availableGoogleOauth(){return this.configurationService.availableGoogleOauth}get availableGithubOauth(){return this.configurationService.availableGithubOauth}toGoogleOauth(){DV(this.configurationService.googleOauthClientId)}toGithubOauth(){$V(this.configurationService.githubOauthClientId)}async submit(){await this.signUp()&&await this.routerService.navigate(`/${Y0}/${yB}`)}dispose(){}init(){}async signUp(){this.setIsLoading(!0);try{return await this.apiService.client.signUp({data:this.form.values}),!0}finally{this.setIsLoading(!1)}}setIsLoading(t){this.isLoading=t}}dt.register(GP,()=>{const e=dt.get(Us),t=dt.get(es),r=dt.get(dc);return new GP(e,t,r)},{scope:"request"});const W_e=Ot(()=>{const e=Df(GP),t=O.useCallback(l=>{e.form.setValue("username",l.currentTarget.value)},[e.form]),r=O.useCallback(l=>{e.form.setValue("email",l.currentTarget.value)},[e.form]),n=O.useCallback(l=>{e.form.setValue("password",l.currentTarget.value)},[e.form]),i=O.useCallback(async()=>{await e.submit()},[e]),o=O.useCallback(()=>{e.toGithubOauth()},[e]),a=O.useCallback(()=>{e.toGoogleOauth()},[e]);return x.jsxs($f,{hideSidebar:!0,children:[x.jsxs(je,{width:"100%",gap:"8px",justifyContent:"flex-end",children:[x.jsx(bt,{color:"gray.300",children:"Already have an account?"}),x.jsx(Cf,{color:"gray.300",alignSelf:"center",as:qo,to:`/${xc}`,children:"Log in"})]}),x.jsx(je,{alignItems:"center",justifyContent:"center",flex:1,children:x.jsxs(je,{flexDirection:"column",width:"16rem",gap:"1rem",alignItems:"center",children:[e.availableOauth&&x.jsxs(x.Fragment,{children:[x.jsxs(je,{flexDirection:"column",gap:"2px",children:[e.availableGithubOauth&&x.jsx(ks,{icon:x.jsx(CB,{}),onClick:o,title:"Continue with Github"}),e.availableGoogleOauth&&x.jsx(ks,{icon:x.jsx(EB,{}),onClick:a,title:"Continue with Google"})]}),e.availableEmailSignUp&&x.jsxs(je,{width:"100%",alignItems:"center",gap:"16px",children:[x.jsx(wt,{backgroundColor:"gray.100",flex:1,height:"1px"}),x.jsx(bt,{color:"gray.300",fontSize:"12px",children:"OR"}),x.jsx(wt,{backgroundColor:"gray.100",flex:1,height:"1px"})]})]}),e.availableEmailSignUp&&x.jsxs(x.Fragment,{children:[x.jsx(js,{dataTestId:"signup-username-input",autoFocus:!0,height:"40px",placeholder:"enter your username",autoComplete:"new-password",value:e.form.values.username,onChange:t}),x.jsx(js,{dataTestId:"signup-email-input",height:"40px",placeholder:"enter your email",type:"email",autoComplete:"new-password",value:e.form.values.email,onChange:r}),x.jsx(js,{dataTestId:"signup-password-input",height:"40px",placeholder:"create a password",type:"password",autoComplete:"new-password",value:e.form.values.password,onChange:n,onEnter:i}),x.jsx(wt,{visibility:e.disableSubmitButton?"hidden":"visible",children:x.jsx(ks,{onClick:i,isDisabled:e.disableSubmitButton,isLoading:e.isLoading,title:"Sign up"})})]})]})})]})}),K_e=()=>x.jsx(Y3,{});class QP{constructor(t,r,n){Pe(this,"isLoading",!1);Pe(this,"form",new GE({username:""}));this.authService=t,this.apiService=r,this.routerService=n,st(this)}get disableSubmitButton(){return!this.form.isValid}async submit(){await this.request()&&(await this.authService.fetchMe(),await this.routerService.navigate(UE))}dispose(){}init(){}async request(){this.setIsLoading(!0);try{return await this.apiService.client.setUsername({data:{username:this.form.values.username}}),!0}catch(t){console.error(t)}finally{this.setIsLoading(!1)}}setIsLoading(t){this.isLoading=t}}dt.register(QP,()=>{const e=dt.get(qi),t=dt.get(es),r=dt.get(Us);return new QP(e,t,r)},{scope:"request"});const G_e=Ot(()=>{const e=Df(QP),t=O.useCallback(n=>{e.form.setValue("username",n.currentTarget.value)},[e.form]),r=O.useCallback(async()=>{await e.submit()},[e]);return x.jsx($f,{hideSidebar:!0,children:x.jsx(je,{alignItems:"center",justifyContent:"center",flex:1,children:x.jsxs(je,{flexDirection:"column",width:"16rem",gap:"1rem",alignItems:"center",children:[x.jsx(js,{dataTestId:"login-emailOrUsername-input",autoFocus:!0,height:"40px",placeholder:"set username",value:e.form.values.username,onChange:t,onEnter:r}),x.jsx(wt,{visibility:e.disableSubmitButton?"hidden":"visible",children:x.jsx(ks,{onClick:r,isLoading:e.isLoading,title:"Set username"})})]})})})}),Q_e=()=>{const e=wE(),t=O.useMemo(()=>(console.error(e),"Unexpected error"),[e]);return x.jsxs(je,{alignItems:"center",flex:1,gap:"1rem",justifyContent:"center",width:"100%",height:"100%",children:[x.jsx(WE,{color:"gray"}),x.jsx(bt,{color:"gray.400",children:t})]})},J_=()=>{const e=wE(),t=O.useMemo(()=>e instanceof xV?`Not found table "${e.message}" in this revision`:e instanceof sw?`Not found row "${e.message}" in this revision`:(console.error(e),"Unexpected error"),[e]);return x.jsxs(je,{alignItems:"center",flex:1,gap:"1rem",justifyContent:"center",width:"100%",children:[x.jsx(WE,{color:"gray"}),x.jsx(bt,{color:"gray.400",children:t})]})};function no(){return(no=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var Y_e=function(){};function X3(e,t){return Math.random()*(t-e+1)+e}function lM(e,t){return Math.floor(X3(e,t))}var X_e=O.forwardRef(function(e,t){var r=e.progress,n=e.height,i=n===void 0?2:n,o=e.className,a=o===void 0?"":o,l=e.color,c=l===void 0?"red":l,d=e.background,f=d===void 0?"transparent":d,p=e.onLoaderFinished,m=e.transitionTime,g=m===void 0?300:m,b=e.loaderSpeed,y=b===void 0?500:b,w=e.waitingTime,_=w===void 0?1e3:w,S=e.shadow,C=S===void 0||S,k=e.containerStyle,E=k===void 0?{}:k,R=e.style,T=R===void 0?{}:R,A=e.shadowStyle,M=A===void 0?{}:A,B=e.containerClassName,Q=B===void 0?"":B,se=O.useRef(!1),ie=O.useState(0),N=ie[0],X=ie[1],ce=O.useRef({active:!1,refreshRate:1e3}),ne=O.useState(!1),ee=ne[0],ge=ne[1],Z=O.useState({active:!1,value:20}),j=Z[0],U=Z[1],q={position:"fixed",top:0,left:0,height:i,background:f,zIndex:99999999999,width:"100%"},$={boxShadow:"0 0 10px "+c+", 0 0 10px "+c,width:"5%",opacity:1,position:"absolute",height:"100%",transition:"all "+y+"ms ease",transform:"rotate(3deg) translate(0px, -4px)",left:"-10rem"},F=O.useState({height:"100%",background:c,transition:"all "+y+"ms ease",width:"0%"}),V=F[0],de=F[1],pe=O.useState($),Ee=pe[0],Me=pe[1];O.useEffect(function(){return se.current=!0,function(){se.current=!1}},[]),O.useImperativeHandle(t,function(){return{continuousStart:function(he,Ce){if(Ce===void 0&&(Ce=1e3),!j.active)if(ee)console.warn("react-top-loading-bar: You can't use both controlling by props and ref methods to control the bar!");else{var Ge=he||lM(10,20);ce.current={active:!0,refreshRate:Ce},X(Ge),Te(Ge)}},staticStart:function(he){if(!ce.current.active)if(ee)console.warn("react-top-loading-bar: You can't use both controlling by props and ref methods to control the bar!");else{var Ce=he||lM(30,50);U({active:!0,value:Ce}),X(Ce),Te(Ce)}},complete:function(){ee?console.warn("react-top-loading-bar: You can't use both controlling by props and ref methods to control the bar!"):(X(100),Te(100))}}}),O.useEffect(function(){de(no({},V,{background:c})),Me(no({},Ee,{boxShadow:"0 0 10px "+c+", 0 0 5px "+c}))},[c]),O.useEffect(function(){if(t){if(t&&r!==void 0)return void console.warn(`react-top-loading-bar: You can't use both controlling by props and ref methods to control the bar! Please use only props or only ref methods! Ref methods will override props if "ref" property is available.`);Te(N),ge(!1)}else r&&Te(r),ge(!0)},[r]);var Y,K,we,Te=function he(Ce){Ce>=100?(de(no({},V,{width:"100%"})),C&&Me(no({},Ee,{left:Ce-10+"%"})),setTimeout(function(){se.current&&(de(no({},V,{opacity:0,width:"100%",transition:"all "+g+"ms ease-out",color:c})),setTimeout(function(){se.current&&(ce.current.active&&(ce.current=no({},ce.current,{active:!1}),X(0),he(0)),j.active&&(U(no({},j,{active:!1})),X(0),he(0)),p&&p(),X(0),he(0))},g))},_)):(de(function(Ge){return no({},Ge,{width:Ce+"%",opacity:1,transition:Ce>0?"all "+y+"ms ease":""})}),C&&Me(no({},Ee,{left:Ce-5.5+"%",transition:Ce>0?"all "+y+"ms ease":""})))};return Y=function(){var he=X3(Math.min(10,(100-N)/5),Math.min(20,(100-N)/3));N+he<95&&(X(N+he),Te(N+he))},K=ce.current.active?ce.current.refreshRate:null,we=O.useRef(Y_e),O.useEffect(function(){we.current=Y}),O.useEffect(function(){},[void 0]),O.useEffect(function(){if(K!==null&&K!==!1){var he=setInterval(function(){return we.current()},K);return function(){return clearInterval(he)}}},[K]),O.createElement("div",{className:Q,style:no({},q,E)},O.createElement("div",{className:a,style:no({},V,T)},C?O.createElement("div",{style:no({},Ee,M)}):null))});const J_e=(e=300)=>{const t=O.useRef(null),r=Pae();return O.useEffect(()=>{const n=t.current;let i=NaN,o=!1;return r.state==="loading"&&(i=setTimeout(()=>{o=!0,n==null||n.continuousStart()},e)),()=>{o&&(n==null||n.complete()),clearTimeout(i)}},[e,r.state]),t},Z_e=()=>{const e=J_e(150);return x.jsxs(x.Fragment,{children:[x.jsx(X_e,{ref:e,color:"#1fa3ff",height:1,waitingTime:500}),x.jsx(Ib,{})]})},Z_=({tableLoader:e,tableId:t,rowLoader:r,rowId:n})=>({path:wp,loader:e,id:t,children:[{index:!0,element:x.jsx(K_e,{})},{path:wB,loader:r,id:n,element:x.jsx(z_e,{})}]}),exe={path:Ll,element:x.jsx(Ib,{}),loader:RP(zb,Dpe),id:zr.Organization,children:[{path:Bl,element:x.jsx(Ib,{}),loader:RP(zb,Mpe),id:zr.Project,children:[{path:Vl,element:x.jsx(Ige,{}),loader:kpe,id:zr.Branch,children:[{loader:Fpe,id:zr.HeadRevision,errorElement:x.jsx(J_,{}),children:[{index:!0,element:x.jsx(L_,{})},Z_({tableLoader:Upe,tableId:zr.HeadTable,rowLoader:Vpe,rowId:zr.HeadRow})]},{path:X0,loader:Npe,id:zr.DraftRevision,errorElement:x.jsx(J_,{}),children:[{index:!0,element:x.jsx(L_,{})},Z_({tableLoader:qpe,tableId:zr.DraftTable,rowLoader:Bpe,rowId:zr.DraftRow})]},{path:bB,loader:Lpe,id:zr.SpecificRevision,errorElement:x.jsx(J_,{}),children:[{index:!0,element:x.jsx(L_,{})},Z_({tableLoader:Hpe,tableId:zr.SpecificTable,rowLoader:zpe,rowId:zr.SpecificRow})]}]}]}]},txe=[{path:"/",element:x.jsx(Z_e,{}),errorElement:x.jsx(Q_e,{}),children:[{index:!0,element:x.jsx(Rbe,{}),loader:RP(zb,Ape)},{path:mB,element:x.jsx(G_e,{})},{path:xc,loader:jpe,children:[{index:!0,element:x.jsx(Nge,{})},{path:gB,loader:H_e,element:x.jsx(U_e,{})},{path:vB,loader:$ge,element:x.jsx(jge,{})}]},{path:pB,element:x.jsx(Fge,{}),loader:zb},{path:Y0,loader:$pe,children:[{index:!0,element:x.jsx(W_e,{})},{path:yB,element:x.jsx(q_e,{})},{path:xce,element:x.jsx(kge,{})}]},{path:Fl,children:[exe]}]}];class Us{constructor(t){Pe(this,"_router",null);this.bootstrapService=t,this.init()}get router(){if(!this._router)throw new Error("Router not found");return this._router}navigate(...t){return this.router.navigate(...t)}init(){Ya(()=>this.bootstrapService.isLoaded,t=>{t&&(this._router=Mae(txe))})}}dt.register(Us,()=>{const e=dt.get(Lb);return new Us(e)},{scope:"singleton"});class YP{constructor(t,r){this.bootstrapService=t,this.routerService=r,st(this)}get isLoaded(){return this.bootstrapService.isLoaded}get router(){return this.routerService.router}async init(){}dispose(){}}dt.register(YP,()=>{const e=dt.get(Lb),t=dt.get(Us);return new YP(e,t)},{scope:"request"});const rxe=({children:e})=>x.jsx(bce,{client:xr,children:e}),nxe=Ot(()=>{const e=Df(YP);return!e.isLoaded||!e.router?x.jsxs(fj,{children:[x.jsx(LC,{w:"100%",h:"100%",children:x.jsx(Rm,{})}),x.jsx(C2,{})]}):x.jsx(rxe,{children:x.jsxs(fj,{children:[x.jsx(Hae,{router:e.router}),x.jsx(C2,{})]})})}),uM=document.getElementById("root");uM&&D6.createRoot(uM).render(x.jsx(O.StrictMode,{children:x.jsx(nxe,{})}));const ixe=`ver: ${Oy("PACKAGE_VERSION")} - ${Oy("GIT_BRANCH_NAME")}:${Oy("GIT_COMMIT_HASH")}`;console.info(ixe)});export default oxe();
|
1466
|
+
`,$_e=async e=>{const t=await xr.mutate({mutation:j_e,variables:e});if(!t.data)throw t.errors;return t.data};class A_e{constructor(t,r){this.rootStore=t,this.projectPageModel=r}get branch(){return this.projectPageModel.branchOrThrow}get table(){return this.projectPageModel.tableOrThrow}async execute(t){const{table:r,previousVersionTableId:n,isBranchTouched:i}=await this.updateRowRequest(t),o=r&&n&&r.versionId!==n,a=!r;return o&&this.updateTablesConnection(r),o?await this.refetchRowsConnectionInDraftTable():(this.updateRowsConnectionInDraftTable(t),a&&await this.refetchDraftTables()),this.branch.updateTouched(i),o&&this.projectPageModel.revalidateLoaders(),!0}async updateRowRequest(t){var n,i;const r=await $_e({data:{revisionId:this.branch.draft.id,tableId:this.table.id,rowId:t}});return{table:this.addVersionedTableToCache((n=r.removeRow)==null?void 0:n.table),previousVersionTableId:(i=r.removeRow)==null?void 0:i.previousVersionTableId,isBranchTouched:r.removeRow.branch.touched}}addVersionedTableToCache(t){return t?this.addTableToCache(t):null}addTableToCache(t){const r=this.rootStore.cache.addOrTable(Lf(t));return this.rootStore.cache.addTableByVariables({revisionId:this.branch.draft.id,tableId:this.table.id},r.versionId),r}updateTablesConnection(t){const r=this.branch.draft,n=r.tablesConnection.edges.find(i=>i.node.id===t.id);n&&r.tablesConnection.replaceNode(n.cursor,t)}async refetchDraftTables(){return this.rootStore.queryTables({revisionId:this.branch.draft.id,first:50})}async refetchRowsConnectionInDraftTable(){return this.rootStore.queryRows({revisionId:this.branch.draft.id,tableId:this.table.id,first:50})}updateRowsConnectionInDraftTable(t){const r=this.rootStore.cache.getTableByVariables({revisionId:this.branch.draft.id,tableId:this.table.id}),n=r==null?void 0:r.rowsConnection.edges.find(i=>i.node.id===t);r==null||r.rowsConnection.removeEdge(n==null?void 0:n.cursor)}}class D_e{constructor(t,r,n){this.rootStore=t,this.projectPageModel=r,this.table=n,st(this,{},{autoBind:!0})}get totalCount(){return this.items.length}get hasNextPage(){return this.table.rowsConnection.availableNextPage}get isEdit(){return this.projectPageModel.isEditableRevision}get items(){return this.table.rowsConnection.edges.map(({node:t})=>({id:t.id,versionId:t.versionId,readonly:t.readonly,title:t.id,data:JSON.stringify(t.data,null,2).replaceAll("\\n",""),link:""}))}setTable(t){this.table=t}dispose(){}tryToFetchNextPage(){this.hasNextPage&&this.rootStore.queryRows({revisionId:this.revision.id,tableId:this.table.id,first:50,after:this.table.rowsConnection.endCursor||void 0})}async deleteRow(t){try{return await new A_e(this.rootStore,this.projectPageModel).execute(t)}catch(r){return console.error(r),!1}}init(){}get revision(){return this.projectPageModel.revisionOrThrow}}const M_e=e=>{const t=Zn(),[r]=O.useState(()=>new D_e(ct,t,e));return O.useEffect(()=>(r.init(),r.setTable(e),()=>r.dispose()),[r,e]),r},N_e=({rowId:e,onRemove:t,dataTestId:r})=>{const[n,i]=O.useState(!1),o=O.useCallback(async()=>{i(!0),await(t==null?void 0:t(e)),i(!1)},[e,t]);return x.jsx(Ci,{"data-testid":r,"aria-label":"",color:"gray.400",icon:x.jsx(J0,{}),isLoading:n,variant:"ghost",onClick:o})},F_e=({row:e,store:t,onSelect:r})=>{const n=O.useCallback(()=>{r==null||r(e.id)},[r,e.id]),i=!!r;return x.jsxs(je,{_hover:{backgroundColor:"gray.50"},alignItems:"center",className:WP.Row,gap:"4px",paddingLeft:"1rem",minHeight:"2.5rem",width:"100%","data-testid":`row-${e.id}`,children:[x.jsxs(je,{width:"150px",children:[r?x.jsx(bt,{maxWidth:"140px",textDecoration:"underline",cursor:"pointer",onClick:n,"data-testid":`row-${e.id}-select`,textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:e.id}):x.jsx(qo,{to:`${e.id}`,"data-testid":`row-${e.id}-link`,children:x.jsx(bt,{maxWidth:"140px",color:"gray.400",textDecoration:"underline",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:e.id})}),!e.readonly&&t.isEdit&&x.jsx(bt,{color:"gray.400",children:"*"})]}),x.jsxs(je,{alignItems:"center",justifyContent:"space-between",minHeight:"40px",width:"100%",minWidth:0,children:[x.jsx(bt,{ml:"16px",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",color:"gray.400",fontWeight:"300",children:e.data}),!i&&t.isEdit&&x.jsx(wt,{className:WP.RemoveRowButton,children:x.jsx(N_e,{rowId:e.id,onRemove:t.deleteRow,dataTestId:`remove-row-${e.id}`})})]})]},e.versionId)},L_e=Ot(({table:e,onSelect:t})=>{const r=M_e(e);return x.jsx(pw,{useWindowScroll:!0,totalCount:r.totalCount,defaultItemHeight:40,increaseViewportBy:40*100,endReached:r.hasNextPage?r.tryToFetchNextPage:void 0,itemContent:n=>{const i=r.items[n];if(i)return x.jsx(F_e,{row:i,store:r,onSelect:t})}})}),X_=({tableId:e})=>x.jsx(je,{width:"100%",borderStyle:"solid",borderTopWidth:1,borderColor:"gray.100",justifyContent:"center",color:"gray.400",fontWeight:"300",pt:"0.5rem",pb:"0.5rem",children:x.jsxs(wt,{backgroundColor:"gray.50",pl:"5px",pr:"5px",borderRadius:"5px",children:['Select or create a row in "',e,'" to be referenced by the above row']})}),B_e=({previousType:e,tableId:t,rowId:r,foreignKeyPath:n,onCancel:i})=>{const o=O.useMemo(()=>e===Rn.UpdatingRow?"updating":e===Rn.CreatingRow?"creating":"",[e]);return x.jsx(x.Fragment,{children:x.jsx(wt,{width:"100%",borderStyle:"solid",borderLeftWidth:2,borderColor:"gray.200",pl:"1rem",mb:"1rem",children:x.jsxs(je,{gap:"4px",alignItems:"center",height:"30px",mt:"2px",mb:"2px",color:"gray.400",fontWeight:"300",children:[x.jsx(bt,{textDecoration:"underline",cursor:"pointer",onClick:i,children:"Back"}),x.jsxs(bt,{children:["- ",o,' "',t," - ",r,'":']}),x.jsx(bt,{children:n})]})})})},V_e=Ot(()=>{const e=ou(),t=Tc(),{root:r,item:n}=f_e(),i=O.useCallback(async f=>{await r.selectForeignKey(n,f)},[n,r]),o=O.useCallback(()=>{r.cancelSelectingForeignKey(n)},[n,r]),a=O.useCallback(f=>{r.onSelectedForeignKey(n,f)},[n,r]),l=O.useCallback(async()=>{if(n.state.type===Rn.CreatingRow){const f=n.state.store,p=await n.createRow(f.name.getPlainValue(),f.root.getPlainValue());p&&(n.state.isSelectingForeignKey?r.onSelectedForeignKey(n,f.name.getPlainValue()):e(t.make({isDraft:!0,rowId:p.id})))}},[n,t,e,r]),c=O.useCallback(async()=>{if(n.state.type===Rn.UpdatingRow){const f=n.state.store;await n.updateRow(f)&&(f.save(),r.updateStore(),e(t.make({isDraft:!0,rowId:f.name.getPlainValue()})))}},[n,t,e,r]),d=O.useCallback(async(f,p)=>{if(n.state.type===Rn.UpdatingRow){const m=n.state.store;await n.uploadFile(m,f,p)&&(r.updateStore(),e(t.make({isDraft:!0,rowId:m.name.getPlainValue()})))}},[n,t,e,r]);if(n.state.type===Rn.ConnectingForeignKeyRow){const f=n.state.store;return x.jsx(x.Fragment,{children:x.jsx(B_e,{previousType:n.state.previousType,foreignKeyPath:n.currentForeignKeyPath,onCancel:o,tableId:n.table.id,rowId:f.name.getPlainValue()})})}return n.state.type===Rn.List?x.jsxs(x.Fragment,{children:[n.state.isSelectingForeignKey&&x.jsx(X_,{tableId:n.table.id}),x.jsx(h_e,{onClick:n.toCreatingRow}),x.jsx(wt,{paddingTop:"0.5rem",paddingBottom:"1rem",children:x.jsx(L_e,{table:n.table,onSelect:n.state.isSelectingForeignKey?a:void 0})})]}):n.state.type===Rn.CreatingRow?x.jsxs(x.Fragment,{children:[n.state.isSelectingForeignKey&&x.jsx(X_,{tableId:n.table.id}),x.jsx(I_e,{store:n.state.store,onAdd:l,onCancel:n.toList,onSelectForeignKey:i})]}):n.state.type===Rn.UpdatingRow?x.jsxs(x.Fragment,{children:[n.state.isSelectingForeignKey&&x.jsx(X_,{tableId:n.table.id}),x.jsx(k_e,{isEdit:n.isEditableRevision,store:n.state.store,onUpdate:c,onSelectForeignKey:i,onUploadFile:d})]}):null}),Y3=Ot(({startWithUpdating:e})=>{const t=d_e(e);return x.jsx(x.Fragment,{children:t.stack.map(r=>x.jsx(G3.Provider,{value:{root:t,item:r},children:x.jsx(V_e,{})},r.id))})}),z_e=Ot(()=>{const e=H1e();return e.isValidSchema?x.jsx(Y3,{startWithUpdating:!0}):x.jsx(fwe,{data:e.row.data})}),q_e=()=>x.jsx($f,{hideSidebar:!0,children:x.jsxs(je,{alignItems:"center",flexDirection:"column",justifyContent:"center",flex:1,gap:"8px",children:[x.jsx(bt,{color:"gray.400",children:"Check your email to confirm your account"}),x.jsx(Cf,{color:"gray.400",alignSelf:"center",as:qo,to:`/${xc}`,children:"Log in"})]})}),U_e=()=>null;class KP{constructor(t,r,n){Pe(this,"isLoading",!1);this.routerService=t,this.apiService=r,this.authService=n,st(this)}async login(t){t?(await this.loginRequest(t),await this.routerService.navigate("/")):console.error("Invalid code")}dispose(){}init(){}async loginRequest(t){this.setIsLoading(!0);try{const r=await this.apiService.client.loginGoogle({data:{code:t,redirectUrl:AV()}});return await this.authService.setToken(r.loginGoogle.accessToken),!0}catch(r){console.error(r)}finally{this.setIsLoading(!1)}}setIsLoading(t){this.isLoading=t}}dt.register(KP,()=>{const e=dt.get(Us),t=dt.get(es),r=dt.get(qi);return new KP(e,t,r)},{scope:"request"});const H_e=async({request:e})=>{const n=new URL(e.url).searchParams.get("code");if(!n)throw new Error("Invalid code");return await dt.get(KP).login(n),hf("/")};class GP{constructor(t,r,n){Pe(this,"isLoading",!1);Pe(this,"form",new GE({email:"",username:"",password:""}));this.routerService=t,this.apiService=r,this.configurationService=n,st(this)}get disableSubmitButton(){return!this.form.isValid}get availableEmailSignUp(){return this.configurationService.availableEmailSignUp}get availableOauth(){return this.configurationService.availableGoogleOauth}get availableGoogleOauth(){return this.configurationService.availableGoogleOauth}get availableGithubOauth(){return this.configurationService.availableGithubOauth}toGoogleOauth(){DV(this.configurationService.googleOauthClientId)}toGithubOauth(){$V(this.configurationService.githubOauthClientId)}async submit(){await this.signUp()&&await this.routerService.navigate(`/${Y0}/${yB}`)}dispose(){}init(){}async signUp(){this.setIsLoading(!0);try{return await this.apiService.client.signUp({data:this.form.values}),!0}finally{this.setIsLoading(!1)}}setIsLoading(t){this.isLoading=t}}dt.register(GP,()=>{const e=dt.get(Us),t=dt.get(es),r=dt.get(dc);return new GP(e,t,r)},{scope:"request"});const W_e=Ot(()=>{const e=Df(GP),t=O.useCallback(l=>{e.form.setValue("username",l.currentTarget.value)},[e.form]),r=O.useCallback(l=>{e.form.setValue("email",l.currentTarget.value)},[e.form]),n=O.useCallback(l=>{e.form.setValue("password",l.currentTarget.value)},[e.form]),i=O.useCallback(async()=>{await e.submit()},[e]),o=O.useCallback(()=>{e.toGithubOauth()},[e]),a=O.useCallback(()=>{e.toGoogleOauth()},[e]);return x.jsxs($f,{hideSidebar:!0,children:[x.jsxs(je,{width:"100%",gap:"8px",justifyContent:"flex-end",children:[x.jsx(bt,{color:"gray.300",children:"Already have an account?"}),x.jsx(Cf,{color:"gray.300",alignSelf:"center",as:qo,to:`/${xc}`,children:"Log in"})]}),x.jsx(je,{alignItems:"center",justifyContent:"center",flex:1,children:x.jsxs(je,{flexDirection:"column",width:"16rem",gap:"1rem",alignItems:"center",children:[e.availableOauth&&x.jsxs(x.Fragment,{children:[x.jsxs(je,{flexDirection:"column",gap:"2px",children:[e.availableGithubOauth&&x.jsx(ks,{icon:x.jsx(CB,{}),onClick:o,title:"Continue with Github"}),e.availableGoogleOauth&&x.jsx(ks,{icon:x.jsx(EB,{}),onClick:a,title:"Continue with Google"})]}),e.availableEmailSignUp&&x.jsxs(je,{width:"100%",alignItems:"center",gap:"16px",children:[x.jsx(wt,{backgroundColor:"gray.100",flex:1,height:"1px"}),x.jsx(bt,{color:"gray.300",fontSize:"12px",children:"OR"}),x.jsx(wt,{backgroundColor:"gray.100",flex:1,height:"1px"})]})]}),e.availableEmailSignUp&&x.jsxs(x.Fragment,{children:[x.jsx(js,{dataTestId:"signup-username-input",autoFocus:!0,height:"40px",placeholder:"enter your username",autoComplete:"new-password",value:e.form.values.username,onChange:t}),x.jsx(js,{dataTestId:"signup-email-input",height:"40px",placeholder:"enter your email",type:"email",autoComplete:"new-password",value:e.form.values.email,onChange:r}),x.jsx(js,{dataTestId:"signup-password-input",height:"40px",placeholder:"create a password",type:"password",autoComplete:"new-password",value:e.form.values.password,onChange:n,onEnter:i}),x.jsx(wt,{visibility:e.disableSubmitButton?"hidden":"visible",children:x.jsx(ks,{onClick:i,isDisabled:e.disableSubmitButton,isLoading:e.isLoading,title:"Sign up"})})]})]})})]})}),K_e=()=>x.jsx(Y3,{});class QP{constructor(t,r,n){Pe(this,"isLoading",!1);Pe(this,"form",new GE({username:""}));this.authService=t,this.apiService=r,this.routerService=n,st(this)}get disableSubmitButton(){return!this.form.isValid}async submit(){await this.request()&&(await this.authService.fetchMe(),await this.routerService.navigate(UE))}dispose(){}init(){}async request(){this.setIsLoading(!0);try{return await this.apiService.client.setUsername({data:{username:this.form.values.username}}),!0}catch(t){console.error(t)}finally{this.setIsLoading(!1)}}setIsLoading(t){this.isLoading=t}}dt.register(QP,()=>{const e=dt.get(qi),t=dt.get(es),r=dt.get(Us);return new QP(e,t,r)},{scope:"request"});const G_e=Ot(()=>{const e=Df(QP),t=O.useCallback(n=>{e.form.setValue("username",n.currentTarget.value)},[e.form]),r=O.useCallback(async()=>{await e.submit()},[e]);return x.jsx($f,{hideSidebar:!0,children:x.jsx(je,{alignItems:"center",justifyContent:"center",flex:1,children:x.jsxs(je,{flexDirection:"column",width:"16rem",gap:"1rem",alignItems:"center",children:[x.jsx(js,{dataTestId:"login-emailOrUsername-input",autoFocus:!0,height:"40px",placeholder:"set username",value:e.form.values.username,onChange:t,onEnter:r}),x.jsx(wt,{visibility:e.disableSubmitButton?"hidden":"visible",children:x.jsx(ks,{onClick:r,isLoading:e.isLoading,title:"Set username"})})]})})})}),Q_e=()=>{const e=wE(),t=O.useMemo(()=>(console.error(e),"Unexpected error"),[e]);return x.jsxs(je,{alignItems:"center",flex:1,gap:"1rem",justifyContent:"center",width:"100%",height:"100%",children:[x.jsx(WE,{color:"gray"}),x.jsx(bt,{color:"gray.400",children:t})]})},J_=()=>{const e=wE(),t=O.useMemo(()=>e instanceof xV?`Not found table "${e.message}" in this revision`:e instanceof sw?`Not found row "${e.message}" in this revision`:(console.error(e),"Unexpected error"),[e]);return x.jsxs(je,{alignItems:"center",flex:1,gap:"1rem",justifyContent:"center",width:"100%",children:[x.jsx(WE,{color:"gray"}),x.jsx(bt,{color:"gray.400",children:t})]})};function no(){return(no=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var Y_e=function(){};function X3(e,t){return Math.random()*(t-e+1)+e}function lM(e,t){return Math.floor(X3(e,t))}var X_e=O.forwardRef(function(e,t){var r=e.progress,n=e.height,i=n===void 0?2:n,o=e.className,a=o===void 0?"":o,l=e.color,c=l===void 0?"red":l,d=e.background,f=d===void 0?"transparent":d,p=e.onLoaderFinished,m=e.transitionTime,g=m===void 0?300:m,b=e.loaderSpeed,y=b===void 0?500:b,w=e.waitingTime,_=w===void 0?1e3:w,S=e.shadow,C=S===void 0||S,k=e.containerStyle,E=k===void 0?{}:k,R=e.style,T=R===void 0?{}:R,A=e.shadowStyle,M=A===void 0?{}:A,B=e.containerClassName,Q=B===void 0?"":B,se=O.useRef(!1),ie=O.useState(0),N=ie[0],X=ie[1],ce=O.useRef({active:!1,refreshRate:1e3}),ne=O.useState(!1),ee=ne[0],ge=ne[1],Z=O.useState({active:!1,value:20}),j=Z[0],U=Z[1],q={position:"fixed",top:0,left:0,height:i,background:f,zIndex:99999999999,width:"100%"},$={boxShadow:"0 0 10px "+c+", 0 0 10px "+c,width:"5%",opacity:1,position:"absolute",height:"100%",transition:"all "+y+"ms ease",transform:"rotate(3deg) translate(0px, -4px)",left:"-10rem"},F=O.useState({height:"100%",background:c,transition:"all "+y+"ms ease",width:"0%"}),V=F[0],de=F[1],pe=O.useState($),Ee=pe[0],Me=pe[1];O.useEffect(function(){return se.current=!0,function(){se.current=!1}},[]),O.useImperativeHandle(t,function(){return{continuousStart:function(he,Ce){if(Ce===void 0&&(Ce=1e3),!j.active)if(ee)console.warn("react-top-loading-bar: You can't use both controlling by props and ref methods to control the bar!");else{var Ge=he||lM(10,20);ce.current={active:!0,refreshRate:Ce},X(Ge),Te(Ge)}},staticStart:function(he){if(!ce.current.active)if(ee)console.warn("react-top-loading-bar: You can't use both controlling by props and ref methods to control the bar!");else{var Ce=he||lM(30,50);U({active:!0,value:Ce}),X(Ce),Te(Ce)}},complete:function(){ee?console.warn("react-top-loading-bar: You can't use both controlling by props and ref methods to control the bar!"):(X(100),Te(100))}}}),O.useEffect(function(){de(no({},V,{background:c})),Me(no({},Ee,{boxShadow:"0 0 10px "+c+", 0 0 5px "+c}))},[c]),O.useEffect(function(){if(t){if(t&&r!==void 0)return void console.warn(`react-top-loading-bar: You can't use both controlling by props and ref methods to control the bar! Please use only props or only ref methods! Ref methods will override props if "ref" property is available.`);Te(N),ge(!1)}else r&&Te(r),ge(!0)},[r]);var Y,K,we,Te=function he(Ce){Ce>=100?(de(no({},V,{width:"100%"})),C&&Me(no({},Ee,{left:Ce-10+"%"})),setTimeout(function(){se.current&&(de(no({},V,{opacity:0,width:"100%",transition:"all "+g+"ms ease-out",color:c})),setTimeout(function(){se.current&&(ce.current.active&&(ce.current=no({},ce.current,{active:!1}),X(0),he(0)),j.active&&(U(no({},j,{active:!1})),X(0),he(0)),p&&p(),X(0),he(0))},g))},_)):(de(function(Ge){return no({},Ge,{width:Ce+"%",opacity:1,transition:Ce>0?"all "+y+"ms ease":""})}),C&&Me(no({},Ee,{left:Ce-5.5+"%",transition:Ce>0?"all "+y+"ms ease":""})))};return Y=function(){var he=X3(Math.min(10,(100-N)/5),Math.min(20,(100-N)/3));N+he<95&&(X(N+he),Te(N+he))},K=ce.current.active?ce.current.refreshRate:null,we=O.useRef(Y_e),O.useEffect(function(){we.current=Y}),O.useEffect(function(){},[void 0]),O.useEffect(function(){if(K!==null&&K!==!1){var he=setInterval(function(){return we.current()},K);return function(){return clearInterval(he)}}},[K]),O.createElement("div",{className:Q,style:no({},q,E)},O.createElement("div",{className:a,style:no({},V,T)},C?O.createElement("div",{style:no({},Ee,M)}):null))});const J_e=(e=300)=>{const t=O.useRef(null),r=Pae();return O.useEffect(()=>{const n=t.current;let i=NaN,o=!1;return r.state==="loading"&&(i=setTimeout(()=>{o=!0,n==null||n.continuousStart()},e)),()=>{o&&(n==null||n.complete()),clearTimeout(i)}},[e,r.state]),t},Z_e=()=>{const e=J_e(150);return x.jsxs(x.Fragment,{children:[x.jsx(X_e,{ref:e,color:"#1fa3ff",height:1,waitingTime:500}),x.jsx(Ib,{})]})},Z_=({tableLoader:e,tableId:t,rowLoader:r,rowId:n})=>({path:wp,loader:e,id:t,children:[{index:!0,element:x.jsx(K_e,{})},{path:wB,loader:r,id:n,element:x.jsx(z_e,{})}]}),exe={path:Ll,element:x.jsx(Ib,{}),loader:RP(zb,Dpe),id:zr.Organization,children:[{path:Bl,element:x.jsx(Ib,{}),loader:RP(zb,Mpe),id:zr.Project,children:[{path:Vl,element:x.jsx(Ige,{}),loader:kpe,id:zr.Branch,children:[{loader:Fpe,id:zr.HeadRevision,errorElement:x.jsx(J_,{}),children:[{index:!0,element:x.jsx(L_,{})},Z_({tableLoader:Upe,tableId:zr.HeadTable,rowLoader:Vpe,rowId:zr.HeadRow})]},{path:X0,loader:Npe,id:zr.DraftRevision,errorElement:x.jsx(J_,{}),children:[{index:!0,element:x.jsx(L_,{})},Z_({tableLoader:qpe,tableId:zr.DraftTable,rowLoader:Bpe,rowId:zr.DraftRow})]},{path:bB,loader:Lpe,id:zr.SpecificRevision,errorElement:x.jsx(J_,{}),children:[{index:!0,element:x.jsx(L_,{})},Z_({tableLoader:Hpe,tableId:zr.SpecificTable,rowLoader:zpe,rowId:zr.SpecificRow})]}]}]}]},txe=[{path:"/",element:x.jsx(Z_e,{}),errorElement:x.jsx(Q_e,{}),children:[{index:!0,element:x.jsx(Rbe,{}),loader:RP(zb,Ape)},{path:mB,element:x.jsx(G_e,{})},{path:xc,loader:jpe,children:[{index:!0,element:x.jsx(Nge,{})},{path:gB,loader:H_e,element:x.jsx(U_e,{})},{path:vB,loader:$ge,element:x.jsx(jge,{})}]},{path:pB,element:x.jsx(Fge,{}),loader:zb},{path:Y0,loader:$pe,children:[{index:!0,element:x.jsx(W_e,{})},{path:yB,element:x.jsx(q_e,{})},{path:xce,element:x.jsx(kge,{})}]},{path:Fl,children:[exe]}]}];class Us{constructor(t){Pe(this,"_router",null);this.bootstrapService=t,this.init()}get router(){if(!this._router)throw new Error("Router not found");return this._router}navigate(...t){return this.router.navigate(...t)}init(){Ya(()=>this.bootstrapService.isLoaded,t=>{t&&(this._router=Mae(txe))})}}dt.register(Us,()=>{const e=dt.get(Lb);return new Us(e)},{scope:"singleton"});class YP{constructor(t,r){this.bootstrapService=t,this.routerService=r,st(this)}get isLoaded(){return this.bootstrapService.isLoaded}get router(){return this.routerService.router}async init(){}dispose(){}}dt.register(YP,()=>{const e=dt.get(Lb),t=dt.get(Us);return new YP(e,t)},{scope:"request"});const rxe=({children:e})=>x.jsx(bce,{client:xr,children:e}),nxe=Ot(()=>{const e=Df(YP);return!e.isLoaded||!e.router?x.jsxs(fj,{children:[x.jsx(LC,{w:"100%",h:"100%",children:x.jsx(Rm,{})}),x.jsx(CA,{})]}):x.jsx(rxe,{children:x.jsxs(fj,{children:[x.jsx(Hae,{router:e.router}),x.jsx(CA,{})]})})}),uM=document.getElementById("root");uM&&D6.createRoot(uM).render(x.jsx(O.StrictMode,{children:x.jsx(nxe,{})}));const ixe=`ver: ${Oy("PACKAGE_VERSION")} - ${Oy("GIT_BRANCH_NAME")}:${Oy("GIT_COMMIT_HASH")}`;console.info(ixe)});export default oxe();
|