@signalwire/cfb 0.1.0-dev.202305031320.d5fc4b0.0 → 0.1.0-dev.202305031642.efcb970.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.
Files changed (2) hide show
  1. package/dist/main.js +9 -9
  2. package/package.json +2 -2
package/dist/main.js CHANGED
@@ -1,5 +1,5 @@
1
1
  (function(Ir,bo){typeof exports=="object"&&typeof module<"u"?bo(exports):typeof define=="function"&&define.amd?define(["exports"],bo):(Ir=typeof globalThis<"u"?globalThis:Ir||self,bo(Ir.CFB={}))})(this,function(Ir){"use strict";/**
2
- * Visual Builder v0.0.0 [d5fc4b0] (https://signalwire.com)
2
+ * Visual Builder v0.0.0 [efcb970] (https://signalwire.com)
3
3
  * Copyright 2018-2023 SignalWire.
4
4
  */
5
5
  function bo(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in e)){const i=Object.getOwnPropertyDescriptor(r,o);i&&Object.defineProperty(e,o,i.get?i:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function fd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Lo={},H0={get exports(){return Lo},set exports(e){Lo=e}},us={},O={},j0={get exports(){return O},set exports(e){O=e}},Z={};/**
@@ -38,10 +38,10 @@ function bo(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&
38
38
  `+Ma+e}var Ua=!1;function Fa(e,t){if(!e||Ua)return"";Ua=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var o=u.stack.split(`
39
39
  `),i=r.stack.split(`
40
40
  `),s=o.length-1,l=i.length-1;1<=s&&0<=l&&o[s]!==i[l];)l--;for(;1<=s&&0<=l;s--,l--)if(o[s]!==i[l]){if(s!==1||l!==1)do if(s--,l--,0>l||o[s]!==i[l]){var a=`
41
- `+o[s].replace(" at new "," at ");return e.displayName&&a.includes("<anonymous>")&&(a=a.replace("<anonymous>",e.displayName)),a}while(1<=s&&0<=l);break}}}finally{Ua=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Mo(e):""}function yE(e){switch(e.tag){case 5:return Mo(e.type);case 16:return Mo("Lazy");case 13:return Mo("Suspense");case 19:return Mo("SuspenseList");case 0:case 2:case 15:return e=Fa(e.type,!1),e;case 11:return e=Fa(e.type.render,!1),e;case 1:return e=Fa(e.type,!0),e;default:return""}}function Va(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Dr:return"Fragment";case Lr:return"Portal";case ba:return"Profiler";case Aa:return"StrictMode";case Da:return"Suspense";case ka:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Ad:return(e.displayName||"Context")+".Consumer";case Cd:return(e._context.displayName||"Context")+".Provider";case La:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Pa:return t=e.displayName||null,t!==null?t:Va(e.type)||"Memo";case yn:t=e._payload,e=e._init;try{return Va(e(t))}catch{}}return null}function EE(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Va(t);case 8:return t===Aa?"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 t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function En(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Dd(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function SE(e){var t=Dd(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){r=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function hs(e){e._valueTracker||(e._valueTracker=SE(e))}function kd(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Dd(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function gs(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Ba(e,t){var n=t.checked;return ue({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Pd(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=En(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Md(e,t){t=t.checked,t!=null&&Ca(e,"checked",t,!1)}function $a(e,t){Md(e,t);var n=En(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?za(e,t.type,n):t.hasOwnProperty("defaultValue")&&za(e,t.type,En(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ud(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function za(e,t,n){(t!=="number"||gs(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Uo=Array.isArray;function kr(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+En(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function Ha(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(H(91));return ue({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Fd(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(H(92));if(Uo(n)){if(1<n.length)throw Error(H(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:En(n)}}function Vd(e,t){var n=En(t.value),r=En(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function Bd(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function $d(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ja(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?$d(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var ms,zd=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(ms=ms||document.createElement("div"),ms.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ms.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Fo(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Vo={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},_E=["Webkit","ms","Moz","O"];Object.keys(Vo).forEach(function(e){_E.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Vo[t]=Vo[e]})});function Hd(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Vo.hasOwnProperty(e)&&Vo[e]?(""+t).trim():t+"px"}function jd(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=Hd(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var wE=ue({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 Wa(e,t){if(t){if(wE[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(H(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(H(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(H(61))}if(t.style!=null&&typeof t.style!="object")throw Error(H(62))}}function Ga(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){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 Ya=null;function Ka(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Qa=null,Pr=null,Mr=null;function Wd(e){if(e=li(e)){if(typeof Qa!="function")throw Error(H(280));var t=e.stateNode;t&&(t=Vs(t),Qa(e.stateNode,e.type,t))}}function Gd(e){Pr?Mr?Mr.push(e):Mr=[e]:Pr=e}function Yd(){if(Pr){var e=Pr,t=Mr;if(Mr=Pr=null,Wd(e),t)for(e=0;e<t.length;e++)Wd(t[e])}}function Kd(e,t){return e(t)}function Qd(){}var Xa=!1;function Xd(e,t,n){if(Xa)return e(t,n);Xa=!0;try{return Kd(e,t,n)}finally{Xa=!1,(Pr!==null||Mr!==null)&&(Qd(),Yd())}}function Bo(e,t){var n=e.stateNode;if(n===null)return null;var r=Vs(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(H(231,t,typeof n));return n}var qa=!1;if(Zt)try{var $o={};Object.defineProperty($o,"passive",{get:function(){qa=!0}}),window.addEventListener("test",$o,$o),window.removeEventListener("test",$o,$o)}catch{qa=!1}function RE(e,t,n,r,o,i,s,l,a){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(c){this.onError(c)}}var zo=!1,vs=null,ys=!1,Za=null,NE={onError:function(e){zo=!0,vs=e}};function OE(e,t,n,r,o,i,s,l,a){zo=!1,vs=null,RE.apply(NE,arguments)}function xE(e,t,n,r,o,i,s,l,a){if(OE.apply(this,arguments),zo){if(zo){var u=vs;zo=!1,vs=null}else throw Error(H(198));ys||(ys=!0,Za=u)}}function nr(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function qd(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Zd(e){if(nr(e)!==e)throw Error(H(188))}function TE(e){var t=e.alternate;if(!t){if(t=nr(e),t===null)throw Error(H(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var i=o.alternate;if(i===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===n)return Zd(o),e;if(i===r)return Zd(o),t;i=i.sibling}throw Error(H(188))}if(n.return!==r.return)n=o,r=i;else{for(var s=!1,l=o.child;l;){if(l===n){s=!0,n=o,r=i;break}if(l===r){s=!0,r=o,n=i;break}l=l.sibling}if(!s){for(l=i.child;l;){if(l===n){s=!0,n=i,r=o;break}if(l===r){s=!0,r=i,n=o;break}l=l.sibling}if(!s)throw Error(H(189))}}if(n.alternate!==r)throw Error(H(190))}if(n.tag!==3)throw Error(H(188));return n.stateNode.current===n?e:t}function Jd(e){return e=TE(e),e!==null?ep(e):null}function ep(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=ep(e);if(t!==null)return t;e=e.sibling}return null}var tp=tt.unstable_scheduleCallback,np=tt.unstable_cancelCallback,IE=tt.unstable_shouldYield,CE=tt.unstable_requestPaint,me=tt.unstable_now,AE=tt.unstable_getCurrentPriorityLevel,Ja=tt.unstable_ImmediatePriority,rp=tt.unstable_UserBlockingPriority,Es=tt.unstable_NormalPriority,bE=tt.unstable_LowPriority,op=tt.unstable_IdlePriority,Ss=null,Ut=null;function LE(e){if(Ut&&typeof Ut.onCommitFiberRoot=="function")try{Ut.onCommitFiberRoot(Ss,e,void 0,(e.current.flags&128)===128)}catch{}}var _t=Math.clz32?Math.clz32:PE,DE=Math.log,kE=Math.LN2;function PE(e){return e>>>=0,e===0?32:31-(DE(e)/kE|0)|0}var _s=64,ws=4194304;function Ho(e){switch(e&-e){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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Rs(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,s=n&268435455;if(s!==0){var l=s&~o;l!==0?r=Ho(l):(i&=s,i!==0&&(r=Ho(i)))}else s=n&~o,s!==0?r=Ho(s):i!==0&&(r=Ho(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-_t(t),o=1<<n,r|=e[n],t&=~o;return r}function ME(e,t){switch(e){case 1:case 2:case 4:return t+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 t+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 UE(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var s=31-_t(i),l=1<<s,a=o[s];a===-1?(!(l&n)||l&r)&&(o[s]=ME(l,t)):a<=t&&(e.expiredLanes|=l),i&=~l}}function eu(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function ip(){var e=_s;return _s<<=1,!(_s&4194240)&&(_s=64),e}function tu(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function jo(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-_t(t),e[t]=n}function FE(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-_t(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function nu(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-_t(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var re=0;function sp(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var lp,ru,ap,up,cp,ou=!1,Ns=[],Sn=null,_n=null,wn=null,Wo=new Map,Go=new Map,Rn=[],VE="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 fp(e,t){switch(e){case"focusin":case"focusout":Sn=null;break;case"dragenter":case"dragleave":_n=null;break;case"mouseover":case"mouseout":wn=null;break;case"pointerover":case"pointerout":Wo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Go.delete(t.pointerId)}}function Yo(e,t,n,r,o,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},t!==null&&(t=li(t),t!==null&&ru(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function BE(e,t,n,r,o){switch(t){case"focusin":return Sn=Yo(Sn,e,t,n,r,o),!0;case"dragenter":return _n=Yo(_n,e,t,n,r,o),!0;case"mouseover":return wn=Yo(wn,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return Wo.set(i,Yo(Wo.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,Go.set(i,Yo(Go.get(i)||null,e,t,n,r,o)),!0}return!1}function dp(e){var t=rr(e.target);if(t!==null){var n=nr(t);if(n!==null){if(t=n.tag,t===13){if(t=qd(n),t!==null){e.blockedOn=t,cp(e.priority,function(){ap(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Os(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=su(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Ya=r,n.target.dispatchEvent(r),Ya=null}else return t=li(n),t!==null&&ru(t),e.blockedOn=n,!1;t.shift()}return!0}function pp(e,t,n){Os(e)&&n.delete(t)}function $E(){ou=!1,Sn!==null&&Os(Sn)&&(Sn=null),_n!==null&&Os(_n)&&(_n=null),wn!==null&&Os(wn)&&(wn=null),Wo.forEach(pp),Go.forEach(pp)}function Ko(e,t){e.blockedOn===t&&(e.blockedOn=null,ou||(ou=!0,tt.unstable_scheduleCallback(tt.unstable_NormalPriority,$E)))}function Qo(e){function t(o){return Ko(o,e)}if(0<Ns.length){Ko(Ns[0],e);for(var n=1;n<Ns.length;n++){var r=Ns[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Sn!==null&&Ko(Sn,e),_n!==null&&Ko(_n,e),wn!==null&&Ko(wn,e),Wo.forEach(t),Go.forEach(t),n=0;n<Rn.length;n++)r=Rn[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Rn.length&&(n=Rn[0],n.blockedOn===null);)dp(n),n.blockedOn===null&&Rn.shift()}var Ur=Jt.ReactCurrentBatchConfig,xs=!0;function zE(e,t,n,r){var o=re,i=Ur.transition;Ur.transition=null;try{re=1,iu(e,t,n,r)}finally{re=o,Ur.transition=i}}function HE(e,t,n,r){var o=re,i=Ur.transition;Ur.transition=null;try{re=4,iu(e,t,n,r)}finally{re=o,Ur.transition=i}}function iu(e,t,n,r){if(xs){var o=su(e,t,n,r);if(o===null)Ru(e,t,r,Ts,n),fp(e,r);else if(BE(o,e,t,n,r))r.stopPropagation();else if(fp(e,r),t&4&&-1<VE.indexOf(e)){for(;o!==null;){var i=li(o);if(i!==null&&lp(i),i=su(e,t,n,r),i===null&&Ru(e,t,r,Ts,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else Ru(e,t,r,null,n)}}var Ts=null;function su(e,t,n,r){if(Ts=null,e=Ka(r),e=rr(e),e!==null)if(t=nr(e),t===null)e=null;else if(n=t.tag,n===13){if(e=qd(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Ts=e,null}function hp(e){switch(e){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(AE()){case Ja:return 1;case rp:return 4;case Es:case bE:return 16;case op:return 536870912;default:return 16}default:return 16}}var Nn=null,lu=null,Is=null;function gp(){if(Is)return Is;var e,t=lu,n=t.length,r,o="value"in Nn?Nn.value:Nn.textContent,i=o.length;for(e=0;e<n&&t[e]===o[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===o[i-r];r++);return Is=o.slice(e,1<r?1-r:void 0)}function Cs(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function As(){return!0}function mp(){return!1}function nt(e){function t(n,r,o,i,s){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=i,this.target=s,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?As:mp,this.isPropagationStopped=mp,this}return ue(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=As)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=As)},persist:function(){},isPersistent:As}),t}var Fr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},au=nt(Fr),Xo=ue({},Fr,{view:0,detail:0}),jE=nt(Xo),uu,cu,qo,bs=ue({},Xo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:du,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==qo&&(qo&&e.type==="mousemove"?(uu=e.screenX-qo.screenX,cu=e.screenY-qo.screenY):cu=uu=0,qo=e),uu)},movementY:function(e){return"movementY"in e?e.movementY:cu}}),vp=nt(bs),WE=ue({},bs,{dataTransfer:0}),GE=nt(WE),YE=ue({},Xo,{relatedTarget:0}),fu=nt(YE),KE=ue({},Fr,{animationName:0,elapsedTime:0,pseudoElement:0}),QE=nt(KE),XE=ue({},Fr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),qE=nt(XE),ZE=ue({},Fr,{data:0}),yp=nt(ZE),JE={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},eS={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"},tS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function nS(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=tS[e])?!!t[e]:!1}function du(){return nS}var rS=ue({},Xo,{key:function(e){if(e.key){var t=JE[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Cs(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?eS[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:du,charCode:function(e){return e.type==="keypress"?Cs(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Cs(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),oS=nt(rS),iS=ue({},bs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ep=nt(iS),sS=ue({},Xo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:du}),lS=nt(sS),aS=ue({},Fr,{propertyName:0,elapsedTime:0,pseudoElement:0}),uS=nt(aS),cS=ue({},bs,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),fS=nt(cS),dS=[9,13,27,32],pu=Zt&&"CompositionEvent"in window,Zo=null;Zt&&"documentMode"in document&&(Zo=document.documentMode);var pS=Zt&&"TextEvent"in window&&!Zo,Sp=Zt&&(!pu||Zo&&8<Zo&&11>=Zo),_p=String.fromCharCode(32),wp=!1;function Rp(e,t){switch(e){case"keyup":return dS.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Np(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Vr=!1;function hS(e,t){switch(e){case"compositionend":return Np(t);case"keypress":return t.which!==32?null:(wp=!0,_p);case"textInput":return e=t.data,e===_p&&wp?null:e;default:return null}}function gS(e,t){if(Vr)return e==="compositionend"||!pu&&Rp(e,t)?(e=gp(),Is=lu=Nn=null,Vr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Sp&&t.locale!=="ko"?null:t.data;default:return null}}var mS={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 Op(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!mS[e.type]:t==="textarea"}function xp(e,t,n,r){Gd(r),t=Ms(t,"onChange"),0<t.length&&(n=new au("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Jo=null,ei=null;function vS(e){jp(e,0)}function Ls(e){var t=jr(e);if(kd(t))return e}function yS(e,t){if(e==="change")return t}var Tp=!1;if(Zt){var hu;if(Zt){var gu="oninput"in document;if(!gu){var Ip=document.createElement("div");Ip.setAttribute("oninput","return;"),gu=typeof Ip.oninput=="function"}hu=gu}else hu=!1;Tp=hu&&(!document.documentMode||9<document.documentMode)}function Cp(){Jo&&(Jo.detachEvent("onpropertychange",Ap),ei=Jo=null)}function Ap(e){if(e.propertyName==="value"&&Ls(ei)){var t=[];xp(t,ei,e,Ka(e)),Xd(vS,t)}}function ES(e,t,n){e==="focusin"?(Cp(),Jo=t,ei=n,Jo.attachEvent("onpropertychange",Ap)):e==="focusout"&&Cp()}function SS(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ls(ei)}function _S(e,t){if(e==="click")return Ls(t)}function wS(e,t){if(e==="input"||e==="change")return Ls(t)}function RS(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var wt=typeof Object.is=="function"?Object.is:RS;function ti(e,t){if(wt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!xa.call(t,o)||!wt(e[o],t[o]))return!1}return!0}function bp(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Lp(e,t){var n=bp(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=bp(n)}}function Dp(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Dp(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function kp(){for(var e=window,t=gs();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=gs(e.document)}return t}function mu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function NS(e){var t=kp(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Dp(n.ownerDocument.documentElement,n)){if(r!==null&&mu(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=Lp(n,i);var s=Lp(n,r);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var OS=Zt&&"documentMode"in document&&11>=document.documentMode,Br=null,vu=null,ni=null,yu=!1;function Pp(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;yu||Br==null||Br!==gs(r)||(r=Br,"selectionStart"in r&&mu(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ni&&ti(ni,r)||(ni=r,r=Ms(vu,"onSelect"),0<r.length&&(t=new au("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Br)))}function Ds(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var $r={animationend:Ds("Animation","AnimationEnd"),animationiteration:Ds("Animation","AnimationIteration"),animationstart:Ds("Animation","AnimationStart"),transitionend:Ds("Transition","TransitionEnd")},Eu={},Mp={};Zt&&(Mp=document.createElement("div").style,"AnimationEvent"in window||(delete $r.animationend.animation,delete $r.animationiteration.animation,delete $r.animationstart.animation),"TransitionEvent"in window||delete $r.transitionend.transition);function ks(e){if(Eu[e])return Eu[e];if(!$r[e])return e;var t=$r[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Mp)return Eu[e]=t[n];return e}var Up=ks("animationend"),Fp=ks("animationiteration"),Vp=ks("animationstart"),Bp=ks("transitionend"),$p=new Map,zp="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 On(e,t){$p.set(e,t),tr(t,[e])}for(var Su=0;Su<zp.length;Su++){var _u=zp[Su],xS=_u.toLowerCase(),TS=_u[0].toUpperCase()+_u.slice(1);On(xS,"on"+TS)}On(Up,"onAnimationEnd"),On(Fp,"onAnimationIteration"),On(Vp,"onAnimationStart"),On("dblclick","onDoubleClick"),On("focusin","onFocus"),On("focusout","onBlur"),On(Bp,"onTransitionEnd"),br("onMouseEnter",["mouseout","mouseover"]),br("onMouseLeave",["mouseout","mouseover"]),br("onPointerEnter",["pointerout","pointerover"]),br("onPointerLeave",["pointerout","pointerover"]),tr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),tr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),tr("onBeforeInput",["compositionend","keypress","textInput","paste"]),tr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),tr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),tr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ri="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(" "),IS=new Set("cancel close invalid load scroll toggle".split(" ").concat(ri));function Hp(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,xE(r,t,void 0,e),e.currentTarget=null}function jp(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var s=r.length-1;0<=s;s--){var l=r[s],a=l.instance,u=l.currentTarget;if(l=l.listener,a!==i&&o.isPropagationStopped())break e;Hp(o,l,u),i=a}else for(s=0;s<r.length;s++){if(l=r[s],a=l.instance,u=l.currentTarget,l=l.listener,a!==i&&o.isPropagationStopped())break e;Hp(o,l,u),i=a}}}if(ys)throw e=Za,ys=!1,Za=null,e}function se(e,t){var n=t[Cu];n===void 0&&(n=t[Cu]=new Set);var r=e+"__bubble";n.has(r)||(Wp(t,e,2,!1),n.add(r))}function wu(e,t,n){var r=0;t&&(r|=4),Wp(n,e,r,t)}var Ps="_reactListening"+Math.random().toString(36).slice(2);function oi(e){if(!e[Ps]){e[Ps]=!0,xd.forEach(function(n){n!=="selectionchange"&&(IS.has(n)||wu(n,!1,e),wu(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ps]||(t[Ps]=!0,wu("selectionchange",!1,t))}}function Wp(e,t,n,r){switch(hp(t)){case 1:var o=zE;break;case 4:o=HE;break;default:o=iu}n=o.bind(null,t,n,e),o=void 0,!qa||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function Ru(e,t,n,r,o){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var l=r.stateNode.containerInfo;if(l===o||l.nodeType===8&&l.parentNode===o)break;if(s===4)for(s=r.return;s!==null;){var a=s.tag;if((a===3||a===4)&&(a=s.stateNode.containerInfo,a===o||a.nodeType===8&&a.parentNode===o))return;s=s.return}for(;l!==null;){if(s=rr(l),s===null)return;if(a=s.tag,a===5||a===6){r=i=s;continue e}l=l.parentNode}}r=r.return}Xd(function(){var u=i,c=Ka(n),f=[];e:{var p=$p.get(e);if(p!==void 0){var h=au,v=e;switch(e){case"keypress":if(Cs(n)===0)break e;case"keydown":case"keyup":h=oS;break;case"focusin":v="focus",h=fu;break;case"focusout":v="blur",h=fu;break;case"beforeblur":case"afterblur":h=fu;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=vp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=GE;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=lS;break;case Up:case Fp:case Vp:h=QE;break;case Bp:h=uS;break;case"scroll":h=jE;break;case"wheel":h=fS;break;case"copy":case"cut":case"paste":h=qE;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=Ep}var m=(t&4)!==0,E=!m&&e==="scroll",d=m?p!==null?p+"Capture":null:p;m=[];for(var g=u,y;g!==null;){y=g;var S=y.stateNode;if(y.tag===5&&S!==null&&(y=S,d!==null&&(S=Bo(g,d),S!=null&&m.push(ii(g,S,y)))),E)break;g=g.return}0<m.length&&(p=new h(p,v,null,n,c),f.push({event:p,listeners:m}))}}if(!(t&7)){e:{if(p=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",p&&n!==Ya&&(v=n.relatedTarget||n.fromElement)&&(rr(v)||v[en]))break e;if((h||p)&&(p=c.window===c?c:(p=c.ownerDocument)?p.defaultView||p.parentWindow:window,h?(v=n.relatedTarget||n.toElement,h=u,v=v?rr(v):null,v!==null&&(E=nr(v),v!==E||v.tag!==5&&v.tag!==6)&&(v=null)):(h=null,v=u),h!==v)){if(m=vp,S="onMouseLeave",d="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(m=Ep,S="onPointerLeave",d="onPointerEnter",g="pointer"),E=h==null?p:jr(h),y=v==null?p:jr(v),p=new m(S,g+"leave",h,n,c),p.target=E,p.relatedTarget=y,S=null,rr(c)===u&&(m=new m(d,g+"enter",v,n,c),m.target=y,m.relatedTarget=E,S=m),E=S,h&&v)t:{for(m=h,d=v,g=0,y=m;y;y=zr(y))g++;for(y=0,S=d;S;S=zr(S))y++;for(;0<g-y;)m=zr(m),g--;for(;0<y-g;)d=zr(d),y--;for(;g--;){if(m===d||d!==null&&m===d.alternate)break t;m=zr(m),d=zr(d)}m=null}else m=null;h!==null&&Gp(f,p,h,m,!1),v!==null&&E!==null&&Gp(f,E,v,m,!0)}}e:{if(p=u?jr(u):window,h=p.nodeName&&p.nodeName.toLowerCase(),h==="select"||h==="input"&&p.type==="file")var w=yS;else if(Op(p))if(Tp)w=wS;else{w=SS;var N=ES}else(h=p.nodeName)&&h.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(w=_S);if(w&&(w=w(e,u))){xp(f,w,n,c);break e}N&&N(e,p,u),e==="focusout"&&(N=p._wrapperState)&&N.controlled&&p.type==="number"&&za(p,"number",p.value)}switch(N=u?jr(u):window,e){case"focusin":(Op(N)||N.contentEditable==="true")&&(Br=N,vu=u,ni=null);break;case"focusout":ni=vu=Br=null;break;case"mousedown":yu=!0;break;case"contextmenu":case"mouseup":case"dragend":yu=!1,Pp(f,n,c);break;case"selectionchange":if(OS)break;case"keydown":case"keyup":Pp(f,n,c)}var T;if(pu)e:{switch(e){case"compositionstart":var b="onCompositionStart";break e;case"compositionend":b="onCompositionEnd";break e;case"compositionupdate":b="onCompositionUpdate";break e}b=void 0}else Vr?Rp(e,n)&&(b="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(b="onCompositionStart");b&&(Sp&&n.locale!=="ko"&&(Vr||b!=="onCompositionStart"?b==="onCompositionEnd"&&Vr&&(T=gp()):(Nn=c,lu="value"in Nn?Nn.value:Nn.textContent,Vr=!0)),N=Ms(u,b),0<N.length&&(b=new yp(b,e,null,n,c),f.push({event:b,listeners:N}),T?b.data=T:(T=Np(n),T!==null&&(b.data=T)))),(T=pS?hS(e,n):gS(e,n))&&(u=Ms(u,"onBeforeInput"),0<u.length&&(c=new yp("onBeforeInput","beforeinput",null,n,c),f.push({event:c,listeners:u}),c.data=T))}jp(f,t)})}function ii(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ms(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=Bo(e,n),i!=null&&r.unshift(ii(e,i,o)),i=Bo(e,t),i!=null&&r.push(ii(e,i,o))),e=e.return}return r}function zr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Gp(e,t,n,r,o){for(var i=t._reactName,s=[];n!==null&&n!==r;){var l=n,a=l.alternate,u=l.stateNode;if(a!==null&&a===r)break;l.tag===5&&u!==null&&(l=u,o?(a=Bo(n,i),a!=null&&s.unshift(ii(n,a,l))):o||(a=Bo(n,i),a!=null&&s.push(ii(n,a,l)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var CS=/\r\n?/g,AS=/\u0000|\uFFFD/g;function Yp(e){return(typeof e=="string"?e:""+e).replace(CS,`
42
- `).replace(AS,"")}function Us(e,t,n){if(t=Yp(t),Yp(e)!==t&&n)throw Error(H(425))}function Fs(){}var Nu=null,Ou=null;function xu(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Tu=typeof setTimeout=="function"?setTimeout:void 0,bS=typeof clearTimeout=="function"?clearTimeout:void 0,Kp=typeof Promise=="function"?Promise:void 0,LS=typeof queueMicrotask=="function"?queueMicrotask:typeof Kp<"u"?function(e){return Kp.resolve(null).then(e).catch(DS)}:Tu;function DS(e){setTimeout(function(){throw e})}function Iu(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){e.removeChild(o),Qo(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);Qo(t)}function xn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Qp(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Hr=Math.random().toString(36).slice(2),Ft="__reactFiber$"+Hr,si="__reactProps$"+Hr,en="__reactContainer$"+Hr,Cu="__reactEvents$"+Hr,kS="__reactListeners$"+Hr,PS="__reactHandles$"+Hr;function rr(e){var t=e[Ft];if(t)return t;for(var n=e.parentNode;n;){if(t=n[en]||n[Ft]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Qp(e);e!==null;){if(n=e[Ft])return n;e=Qp(e)}return t}e=n,n=e.parentNode}return null}function li(e){return e=e[Ft]||e[en],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function jr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(H(33))}function Vs(e){return e[si]||null}var Au=[],Wr=-1;function Tn(e){return{current:e}}function le(e){0>Wr||(e.current=Au[Wr],Au[Wr]=null,Wr--)}function oe(e,t){Wr++,Au[Wr]=e.current,e.current=t}var In={},be=Tn(In),He=Tn(!1),or=In;function Gr(e,t){var n=e.type.contextTypes;if(!n)return In;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function je(e){return e=e.childContextTypes,e!=null}function Bs(){le(He),le(be)}function Xp(e,t,n){if(be.current!==In)throw Error(H(168));oe(be,t),oe(He,n)}function qp(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(H(108,EE(e)||"Unknown",o));return ue({},n,r)}function $s(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||In,or=be.current,oe(be,e),oe(He,He.current),!0}function Zp(e,t,n){var r=e.stateNode;if(!r)throw Error(H(169));n?(e=qp(e,t,or),r.__reactInternalMemoizedMergedChildContext=e,le(He),le(be),oe(be,e)):le(He),oe(He,n)}var tn=null,zs=!1,bu=!1;function Jp(e){tn===null?tn=[e]:tn.push(e)}function MS(e){zs=!0,Jp(e)}function Cn(){if(!bu&&tn!==null){bu=!0;var e=0,t=re;try{var n=tn;for(re=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}tn=null,zs=!1}catch(o){throw tn!==null&&(tn=tn.slice(e+1)),tp(Ja,Cn),o}finally{re=t,bu=!1}}return null}var Yr=[],Kr=0,Hs=null,js=0,ct=[],ft=0,ir=null,nn=1,rn="";function sr(e,t){Yr[Kr++]=js,Yr[Kr++]=Hs,Hs=e,js=t}function eh(e,t,n){ct[ft++]=nn,ct[ft++]=rn,ct[ft++]=ir,ir=e;var r=nn;e=rn;var o=32-_t(r)-1;r&=~(1<<o),n+=1;var i=32-_t(t)+o;if(30<i){var s=o-o%5;i=(r&(1<<s)-1).toString(32),r>>=s,o-=s,nn=1<<32-_t(t)+o|n<<o|r,rn=i+e}else nn=1<<i|n<<o|r,rn=e}function Lu(e){e.return!==null&&(sr(e,1),eh(e,1,0))}function Du(e){for(;e===Hs;)Hs=Yr[--Kr],Yr[Kr]=null,js=Yr[--Kr],Yr[Kr]=null;for(;e===ir;)ir=ct[--ft],ct[ft]=null,rn=ct[--ft],ct[ft]=null,nn=ct[--ft],ct[ft]=null}var rt=null,ot=null,ae=!1,Rt=null;function th(e,t){var n=gt(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function nh(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,rt=e,ot=xn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,rt=e,ot=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=ir!==null?{id:nn,overflow:rn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=gt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,rt=e,ot=null,!0):!1;default:return!1}}function ku(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Pu(e){if(ae){var t=ot;if(t){var n=t;if(!nh(e,t)){if(ku(e))throw Error(H(418));t=xn(n.nextSibling);var r=rt;t&&nh(e,t)?th(r,n):(e.flags=e.flags&-4097|2,ae=!1,rt=e)}}else{if(ku(e))throw Error(H(418));e.flags=e.flags&-4097|2,ae=!1,rt=e}}}function rh(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;rt=e}function Ws(e){if(e!==rt)return!1;if(!ae)return rh(e),ae=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!xu(e.type,e.memoizedProps)),t&&(t=ot)){if(ku(e))throw oh(),Error(H(418));for(;t;)th(e,t),t=xn(t.nextSibling)}if(rh(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(H(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){ot=xn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}ot=null}}else ot=rt?xn(e.stateNode.nextSibling):null;return!0}function oh(){for(var e=ot;e;)e=xn(e.nextSibling)}function Qr(){ot=rt=null,ae=!1}function Mu(e){Rt===null?Rt=[e]:Rt.push(e)}var US=Jt.ReactCurrentBatchConfig;function Nt(e,t){if(e&&e.defaultProps){t=ue({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}var Gs=Tn(null),Ys=null,Xr=null,Uu=null;function Fu(){Uu=Xr=Ys=null}function Vu(e){var t=Gs.current;le(Gs),e._currentValue=t}function Bu(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function qr(e,t){Ys=e,Uu=Xr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(We=!0),e.firstContext=null)}function dt(e){var t=e._currentValue;if(Uu!==e)if(e={context:e,memoizedValue:t,next:null},Xr===null){if(Ys===null)throw Error(H(308));Xr=e,Ys.dependencies={lanes:0,firstContext:e}}else Xr=Xr.next=e;return t}var lr=null;function $u(e){lr===null?lr=[e]:lr.push(e)}function ih(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,$u(t)):(n.next=o.next,o.next=n),t.interleaved=n,on(e,r)}function on(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var An=!1;function zu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function sh(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function sn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function bn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,te&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,on(e,n)}return o=r.interleaved,o===null?(t.next=t,$u(r)):(t.next=o.next,o.next=t),r.interleaved=t,on(e,n)}function Ks(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,nu(e,n)}}function lh(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=s:i=i.next=s,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Qs(e,t,n,r){var o=e.updateQueue;An=!1;var i=o.firstBaseUpdate,s=o.lastBaseUpdate,l=o.shared.pending;if(l!==null){o.shared.pending=null;var a=l,u=a.next;a.next=null,s===null?i=u:s.next=u,s=a;var c=e.alternate;c!==null&&(c=c.updateQueue,l=c.lastBaseUpdate,l!==s&&(l===null?c.firstBaseUpdate=u:l.next=u,c.lastBaseUpdate=a))}if(i!==null){var f=o.baseState;s=0,c=u=a=null,l=i;do{var p=l.lane,h=l.eventTime;if((r&p)===p){c!==null&&(c=c.next={eventTime:h,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var v=e,m=l;switch(p=t,h=n,m.tag){case 1:if(v=m.payload,typeof v=="function"){f=v.call(h,f,p);break e}f=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=m.payload,p=typeof v=="function"?v.call(h,f,p):v,p==null)break e;f=ue({},f,p);break e;case 2:An=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,p=o.effects,p===null?o.effects=[l]:p.push(l))}else h={eventTime:h,lane:p,tag:l.tag,payload:l.payload,callback:l.callback,next:null},c===null?(u=c=h,a=f):c=c.next=h,s|=p;if(l=l.next,l===null){if(l=o.shared.pending,l===null)break;p=l,l=p.next,p.next=null,o.lastBaseUpdate=p,o.shared.pending=null}}while(1);if(c===null&&(a=f),o.baseState=a,o.firstBaseUpdate=u,o.lastBaseUpdate=c,t=o.shared.interleaved,t!==null){o=t;do s|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);cr|=s,e.lanes=s,e.memoizedState=f}}function ah(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=n,typeof o!="function")throw Error(H(191,o));o.call(r)}}}var uh=new Od.Component().refs;function Hu(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:ue({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Xs={isMounted:function(e){return(e=e._reactInternals)?nr(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Ve(),o=Pn(e),i=sn(r,o);i.payload=t,n!=null&&(i.callback=n),t=bn(e,i,o),t!==null&&(Tt(t,e,o,r),Ks(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Ve(),o=Pn(e),i=sn(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=bn(e,i,o),t!==null&&(Tt(t,e,o,r),Ks(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ve(),r=Pn(e),o=sn(n,r);o.tag=2,t!=null&&(o.callback=t),t=bn(e,o,r),t!==null&&(Tt(t,e,r,n),Ks(t,e,r))}};function ch(e,t,n,r,o,i,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,s):t.prototype&&t.prototype.isPureReactComponent?!ti(n,r)||!ti(o,i):!0}function fh(e,t,n){var r=!1,o=In,i=t.contextType;return typeof i=="object"&&i!==null?i=dt(i):(o=je(t)?or:be.current,r=t.contextTypes,i=(r=r!=null)?Gr(e,o):In),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Xs,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function dh(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Xs.enqueueReplaceState(t,t.state,null)}function ju(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs=uh,zu(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=dt(i):(i=je(t)?or:be.current,o.context=Gr(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Hu(e,t,i,n),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&Xs.enqueueReplaceState(o,o.state,null),Qs(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function ai(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(H(309));var r=n.stateNode}if(!r)throw Error(H(147,e));var o=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(s){var l=o.refs;l===uh&&(l=o.refs={}),s===null?delete l[i]:l[i]=s},t._stringRef=i,t)}if(typeof e!="string")throw Error(H(284));if(!n._owner)throw Error(H(290,e))}return e}function qs(e,t){throw e=Object.prototype.toString.call(t),Error(H(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function ph(e){var t=e._init;return t(e._payload)}function hh(e){function t(d,g){if(e){var y=d.deletions;y===null?(d.deletions=[g],d.flags|=16):y.push(g)}}function n(d,g){if(!e)return null;for(;g!==null;)t(d,g),g=g.sibling;return null}function r(d,g){for(d=new Map;g!==null;)g.key!==null?d.set(g.key,g):d.set(g.index,g),g=g.sibling;return d}function o(d,g){return d=Un(d,g),d.index=0,d.sibling=null,d}function i(d,g,y){return d.index=y,e?(y=d.alternate,y!==null?(y=y.index,y<g?(d.flags|=2,g):y):(d.flags|=2,g)):(d.flags|=1048576,g)}function s(d){return e&&d.alternate===null&&(d.flags|=2),d}function l(d,g,y,S){return g===null||g.tag!==6?(g=Tc(y,d.mode,S),g.return=d,g):(g=o(g,y),g.return=d,g)}function a(d,g,y,S){var w=y.type;return w===Dr?c(d,g,y.props.children,S,y.key):g!==null&&(g.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===yn&&ph(w)===g.type)?(S=o(g,y.props),S.ref=ai(d,g,y),S.return=d,S):(S=ml(y.type,y.key,y.props,null,d.mode,S),S.ref=ai(d,g,y),S.return=d,S)}function u(d,g,y,S){return g===null||g.tag!==4||g.stateNode.containerInfo!==y.containerInfo||g.stateNode.implementation!==y.implementation?(g=Ic(y,d.mode,S),g.return=d,g):(g=o(g,y.children||[]),g.return=d,g)}function c(d,g,y,S,w){return g===null||g.tag!==7?(g=hr(y,d.mode,S,w),g.return=d,g):(g=o(g,y),g.return=d,g)}function f(d,g,y){if(typeof g=="string"&&g!==""||typeof g=="number")return g=Tc(""+g,d.mode,y),g.return=d,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case ps:return y=ml(g.type,g.key,g.props,null,d.mode,y),y.ref=ai(d,null,g),y.return=d,y;case Lr:return g=Ic(g,d.mode,y),g.return=d,g;case yn:var S=g._init;return f(d,S(g._payload),y)}if(Uo(g)||Po(g))return g=hr(g,d.mode,y,null),g.return=d,g;qs(d,g)}return null}function p(d,g,y,S){var w=g!==null?g.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return w!==null?null:l(d,g,""+y,S);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case ps:return y.key===w?a(d,g,y,S):null;case Lr:return y.key===w?u(d,g,y,S):null;case yn:return w=y._init,p(d,g,w(y._payload),S)}if(Uo(y)||Po(y))return w!==null?null:c(d,g,y,S,null);qs(d,y)}return null}function h(d,g,y,S,w){if(typeof S=="string"&&S!==""||typeof S=="number")return d=d.get(y)||null,l(g,d,""+S,w);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case ps:return d=d.get(S.key===null?y:S.key)||null,a(g,d,S,w);case Lr:return d=d.get(S.key===null?y:S.key)||null,u(g,d,S,w);case yn:var N=S._init;return h(d,g,y,N(S._payload),w)}if(Uo(S)||Po(S))return d=d.get(y)||null,c(g,d,S,w,null);qs(g,S)}return null}function v(d,g,y,S){for(var w=null,N=null,T=g,b=g=0,D=null;T!==null&&b<y.length;b++){T.index>b?(D=T,T=null):D=T.sibling;var k=p(d,T,y[b],S);if(k===null){T===null&&(T=D);break}e&&T&&k.alternate===null&&t(d,T),g=i(k,g,b),N===null?w=k:N.sibling=k,N=k,T=D}if(b===y.length)return n(d,T),ae&&sr(d,b),w;if(T===null){for(;b<y.length;b++)T=f(d,y[b],S),T!==null&&(g=i(T,g,b),N===null?w=T:N.sibling=T,N=T);return ae&&sr(d,b),w}for(T=r(d,T);b<y.length;b++)D=h(T,d,b,y[b],S),D!==null&&(e&&D.alternate!==null&&T.delete(D.key===null?b:D.key),g=i(D,g,b),N===null?w=D:N.sibling=D,N=D);return e&&T.forEach(function(B){return t(d,B)}),ae&&sr(d,b),w}function m(d,g,y,S){var w=Po(y);if(typeof w!="function")throw Error(H(150));if(y=w.call(y),y==null)throw Error(H(151));for(var N=w=null,T=g,b=g=0,D=null,k=y.next();T!==null&&!k.done;b++,k=y.next()){T.index>b?(D=T,T=null):D=T.sibling;var B=p(d,T,k.value,S);if(B===null){T===null&&(T=D);break}e&&T&&B.alternate===null&&t(d,T),g=i(B,g,b),N===null?w=B:N.sibling=B,N=B,T=D}if(k.done)return n(d,T),ae&&sr(d,b),w;if(T===null){for(;!k.done;b++,k=y.next())k=f(d,k.value,S),k!==null&&(g=i(k,g,b),N===null?w=k:N.sibling=k,N=k);return ae&&sr(d,b),w}for(T=r(d,T);!k.done;b++,k=y.next())k=h(T,d,b,k.value,S),k!==null&&(e&&k.alternate!==null&&T.delete(k.key===null?b:k.key),g=i(k,g,b),N===null?w=k:N.sibling=k,N=k);return e&&T.forEach(function(F){return t(d,F)}),ae&&sr(d,b),w}function E(d,g,y,S){if(typeof y=="object"&&y!==null&&y.type===Dr&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case ps:e:{for(var w=y.key,N=g;N!==null;){if(N.key===w){if(w=y.type,w===Dr){if(N.tag===7){n(d,N.sibling),g=o(N,y.props.children),g.return=d,d=g;break e}}else if(N.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===yn&&ph(w)===N.type){n(d,N.sibling),g=o(N,y.props),g.ref=ai(d,N,y),g.return=d,d=g;break e}n(d,N);break}else t(d,N);N=N.sibling}y.type===Dr?(g=hr(y.props.children,d.mode,S,y.key),g.return=d,d=g):(S=ml(y.type,y.key,y.props,null,d.mode,S),S.ref=ai(d,g,y),S.return=d,d=S)}return s(d);case Lr:e:{for(N=y.key;g!==null;){if(g.key===N)if(g.tag===4&&g.stateNode.containerInfo===y.containerInfo&&g.stateNode.implementation===y.implementation){n(d,g.sibling),g=o(g,y.children||[]),g.return=d,d=g;break e}else{n(d,g);break}else t(d,g);g=g.sibling}g=Ic(y,d.mode,S),g.return=d,d=g}return s(d);case yn:return N=y._init,E(d,g,N(y._payload),S)}if(Uo(y))return v(d,g,y,S);if(Po(y))return m(d,g,y,S);qs(d,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,g!==null&&g.tag===6?(n(d,g.sibling),g=o(g,y),g.return=d,d=g):(n(d,g),g=Tc(y,d.mode,S),g.return=d,d=g),s(d)):n(d,g)}return E}var Zr=hh(!0),gh=hh(!1),ui={},Vt=Tn(ui),ci=Tn(ui),fi=Tn(ui);function ar(e){if(e===ui)throw Error(H(174));return e}function Wu(e,t){switch(oe(fi,t),oe(ci,e),oe(Vt,ui),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ja(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=ja(t,e)}le(Vt),oe(Vt,t)}function Jr(){le(Vt),le(ci),le(fi)}function mh(e){ar(fi.current);var t=ar(Vt.current),n=ja(t,e.type);t!==n&&(oe(ci,e),oe(Vt,n))}function Gu(e){ci.current===e&&(le(Vt),le(ci))}var ce=Tn(0);function Zs(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Yu=[];function Ku(){for(var e=0;e<Yu.length;e++)Yu[e]._workInProgressVersionPrimary=null;Yu.length=0}var Js=Jt.ReactCurrentDispatcher,Qu=Jt.ReactCurrentBatchConfig,ur=0,fe=null,Ee=null,Re=null,el=!1,di=!1,pi=0,FS=0;function Le(){throw Error(H(321))}function Xu(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!wt(e[n],t[n]))return!1;return!0}function qu(e,t,n,r,o,i){if(ur=i,fe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Js.current=e===null||e.memoizedState===null?zS:HS,e=n(r,o),di){i=0;do{if(di=!1,pi=0,25<=i)throw Error(H(301));i+=1,Re=Ee=null,t.updateQueue=null,Js.current=jS,e=n(r,o)}while(di)}if(Js.current=rl,t=Ee!==null&&Ee.next!==null,ur=0,Re=Ee=fe=null,el=!1,t)throw Error(H(300));return e}function Zu(){var e=pi!==0;return pi=0,e}function Bt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Re===null?fe.memoizedState=Re=e:Re=Re.next=e,Re}function pt(){if(Ee===null){var e=fe.alternate;e=e!==null?e.memoizedState:null}else e=Ee.next;var t=Re===null?fe.memoizedState:Re.next;if(t!==null)Re=t,Ee=e;else{if(e===null)throw Error(H(310));Ee=e,e={memoizedState:Ee.memoizedState,baseState:Ee.baseState,baseQueue:Ee.baseQueue,queue:Ee.queue,next:null},Re===null?fe.memoizedState=Re=e:Re=Re.next=e}return Re}function hi(e,t){return typeof t=="function"?t(e):t}function Ju(e){var t=pt(),n=t.queue;if(n===null)throw Error(H(311));n.lastRenderedReducer=e;var r=Ee,o=r.baseQueue,i=n.pending;if(i!==null){if(o!==null){var s=o.next;o.next=i.next,i.next=s}r.baseQueue=o=i,n.pending=null}if(o!==null){i=o.next,r=r.baseState;var l=s=null,a=null,u=i;do{var c=u.lane;if((ur&c)===c)a!==null&&(a=a.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var f={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};a===null?(l=a=f,s=r):a=a.next=f,fe.lanes|=c,cr|=c}u=u.next}while(u!==null&&u!==i);a===null?s=r:a.next=l,wt(r,t.memoizedState)||(We=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=a,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do i=o.lane,fe.lanes|=i,cr|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function ec(e){var t=pt(),n=t.queue;if(n===null)throw Error(H(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,i=t.memoizedState;if(o!==null){n.pending=null;var s=o=o.next;do i=e(i,s.action),s=s.next;while(s!==o);wt(i,t.memoizedState)||(We=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function vh(){}function yh(e,t){var n=fe,r=pt(),o=t(),i=!wt(r.memoizedState,o);if(i&&(r.memoizedState=o,We=!0),r=r.queue,tc(_h.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||Re!==null&&Re.memoizedState.tag&1){if(n.flags|=2048,gi(9,Sh.bind(null,n,r,o,t),void 0,null),Ne===null)throw Error(H(349));ur&30||Eh(n,t,o)}return o}function Eh(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=fe.updateQueue,t===null?(t={lastEffect:null,stores:null},fe.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Sh(e,t,n,r){t.value=n,t.getSnapshot=r,wh(t)&&Rh(e)}function _h(e,t,n){return n(function(){wh(t)&&Rh(e)})}function wh(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!wt(e,n)}catch{return!0}}function Rh(e){var t=on(e,1);t!==null&&Tt(t,e,1,-1)}function Nh(e){var t=Bt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:hi,lastRenderedState:e},t.queue=e,e=e.dispatch=$S.bind(null,fe,e),[t.memoizedState,e]}function gi(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=fe.updateQueue,t===null?(t={lastEffect:null,stores:null},fe.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Oh(){return pt().memoizedState}function tl(e,t,n,r){var o=Bt();fe.flags|=e,o.memoizedState=gi(1|t,n,void 0,r===void 0?null:r)}function nl(e,t,n,r){var o=pt();r=r===void 0?null:r;var i=void 0;if(Ee!==null){var s=Ee.memoizedState;if(i=s.destroy,r!==null&&Xu(r,s.deps)){o.memoizedState=gi(t,n,i,r);return}}fe.flags|=e,o.memoizedState=gi(1|t,n,i,r)}function xh(e,t){return tl(8390656,8,e,t)}function tc(e,t){return nl(2048,8,e,t)}function Th(e,t){return nl(4,2,e,t)}function Ih(e,t){return nl(4,4,e,t)}function Ch(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Ah(e,t,n){return n=n!=null?n.concat([e]):null,nl(4,4,Ch.bind(null,t,e),n)}function nc(){}function bh(e,t){var n=pt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Xu(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Lh(e,t){var n=pt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Xu(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Dh(e,t,n){return ur&21?(wt(n,t)||(n=ip(),fe.lanes|=n,cr|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,We=!0),e.memoizedState=n)}function VS(e,t){var n=re;re=n!==0&&4>n?n:4,e(!0);var r=Qu.transition;Qu.transition={};try{e(!1),t()}finally{re=n,Qu.transition=r}}function kh(){return pt().memoizedState}function BS(e,t,n){var r=Pn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Ph(e))Mh(t,n);else if(n=ih(e,t,n,r),n!==null){var o=Ve();Tt(n,e,r,o),Uh(n,t,r)}}function $S(e,t,n){var r=Pn(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ph(e))Mh(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,l=i(s,n);if(o.hasEagerState=!0,o.eagerState=l,wt(l,s)){var a=t.interleaved;a===null?(o.next=o,$u(t)):(o.next=a.next,a.next=o),t.interleaved=o;return}}catch{}finally{}n=ih(e,t,o,r),n!==null&&(o=Ve(),Tt(n,e,r,o),Uh(n,t,r))}}function Ph(e){var t=e.alternate;return e===fe||t!==null&&t===fe}function Mh(e,t){di=el=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Uh(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,nu(e,n)}}var rl={readContext:dt,useCallback:Le,useContext:Le,useEffect:Le,useImperativeHandle:Le,useInsertionEffect:Le,useLayoutEffect:Le,useMemo:Le,useReducer:Le,useRef:Le,useState:Le,useDebugValue:Le,useDeferredValue:Le,useTransition:Le,useMutableSource:Le,useSyncExternalStore:Le,useId:Le,unstable_isNewReconciler:!1},zS={readContext:dt,useCallback:function(e,t){return Bt().memoizedState=[e,t===void 0?null:t],e},useContext:dt,useEffect:xh,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,tl(4194308,4,Ch.bind(null,t,e),n)},useLayoutEffect:function(e,t){return tl(4194308,4,e,t)},useInsertionEffect:function(e,t){return tl(4,2,e,t)},useMemo:function(e,t){var n=Bt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Bt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=BS.bind(null,fe,e),[r.memoizedState,e]},useRef:function(e){var t=Bt();return e={current:e},t.memoizedState=e},useState:Nh,useDebugValue:nc,useDeferredValue:function(e){return Bt().memoizedState=e},useTransition:function(){var e=Nh(!1),t=e[0];return e=VS.bind(null,e[1]),Bt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=fe,o=Bt();if(ae){if(n===void 0)throw Error(H(407));n=n()}else{if(n=t(),Ne===null)throw Error(H(349));ur&30||Eh(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,xh(_h.bind(null,r,i,e),[e]),r.flags|=2048,gi(9,Sh.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Bt(),t=Ne.identifierPrefix;if(ae){var n=rn,r=nn;n=(r&~(1<<32-_t(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=pi++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=FS++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},HS={readContext:dt,useCallback:bh,useContext:dt,useEffect:tc,useImperativeHandle:Ah,useInsertionEffect:Th,useLayoutEffect:Ih,useMemo:Lh,useReducer:Ju,useRef:Oh,useState:function(){return Ju(hi)},useDebugValue:nc,useDeferredValue:function(e){var t=pt();return Dh(t,Ee.memoizedState,e)},useTransition:function(){var e=Ju(hi)[0],t=pt().memoizedState;return[e,t]},useMutableSource:vh,useSyncExternalStore:yh,useId:kh,unstable_isNewReconciler:!1},jS={readContext:dt,useCallback:bh,useContext:dt,useEffect:tc,useImperativeHandle:Ah,useInsertionEffect:Th,useLayoutEffect:Ih,useMemo:Lh,useReducer:ec,useRef:Oh,useState:function(){return ec(hi)},useDebugValue:nc,useDeferredValue:function(e){var t=pt();return Ee===null?t.memoizedState=e:Dh(t,Ee.memoizedState,e)},useTransition:function(){var e=ec(hi)[0],t=pt().memoizedState;return[e,t]},useMutableSource:vh,useSyncExternalStore:yh,useId:kh,unstable_isNewReconciler:!1};function eo(e,t){try{var n="",r=t;do n+=yE(r),r=r.return;while(r);var o=n}catch(i){o=`
41
+ `+o[s].replace(" at new "," at ");return e.displayName&&a.includes("<anonymous>")&&(a=a.replace("<anonymous>",e.displayName)),a}while(1<=s&&0<=l);break}}}finally{Ua=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Mo(e):""}function yE(e){switch(e.tag){case 5:return Mo(e.type);case 16:return Mo("Lazy");case 13:return Mo("Suspense");case 19:return Mo("SuspenseList");case 0:case 2:case 15:return e=Fa(e.type,!1),e;case 11:return e=Fa(e.type.render,!1),e;case 1:return e=Fa(e.type,!0),e;default:return""}}function Va(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Dr:return"Fragment";case Lr:return"Portal";case ba:return"Profiler";case Aa:return"StrictMode";case Da:return"Suspense";case ka:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Ad:return(e.displayName||"Context")+".Consumer";case Cd:return(e._context.displayName||"Context")+".Provider";case La:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Pa:return t=e.displayName||null,t!==null?t:Va(e.type)||"Memo";case yn:t=e._payload,e=e._init;try{return Va(e(t))}catch{}}return null}function EE(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Va(t);case 8:return t===Aa?"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 t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function En(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Dd(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function SE(e){var t=Dd(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){r=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function hs(e){e._valueTracker||(e._valueTracker=SE(e))}function kd(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Dd(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function gs(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Ba(e,t){var n=t.checked;return ue({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Pd(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=En(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Md(e,t){t=t.checked,t!=null&&Ca(e,"checked",t,!1)}function $a(e,t){Md(e,t);var n=En(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?za(e,t.type,n):t.hasOwnProperty("defaultValue")&&za(e,t.type,En(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ud(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function za(e,t,n){(t!=="number"||gs(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Uo=Array.isArray;function kr(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+En(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function Ha(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(H(91));return ue({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Fd(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(H(92));if(Uo(n)){if(1<n.length)throw Error(H(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:En(n)}}function Vd(e,t){var n=En(t.value),r=En(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function Bd(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function $d(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ja(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?$d(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var ms,zd=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(ms=ms||document.createElement("div"),ms.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ms.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Fo(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Vo={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},_E=["Webkit","ms","Moz","O"];Object.keys(Vo).forEach(function(e){_E.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Vo[t]=Vo[e]})});function Hd(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Vo.hasOwnProperty(e)&&Vo[e]?(""+t).trim():t+"px"}function jd(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=Hd(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var wE=ue({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 Wa(e,t){if(t){if(wE[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(H(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(H(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(H(61))}if(t.style!=null&&typeof t.style!="object")throw Error(H(62))}}function Ga(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){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 Ya=null;function Ka(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Qa=null,Pr=null,Mr=null;function Wd(e){if(e=li(e)){if(typeof Qa!="function")throw Error(H(280));var t=e.stateNode;t&&(t=Vs(t),Qa(e.stateNode,e.type,t))}}function Gd(e){Pr?Mr?Mr.push(e):Mr=[e]:Pr=e}function Yd(){if(Pr){var e=Pr,t=Mr;if(Mr=Pr=null,Wd(e),t)for(e=0;e<t.length;e++)Wd(t[e])}}function Kd(e,t){return e(t)}function Qd(){}var Xa=!1;function Xd(e,t,n){if(Xa)return e(t,n);Xa=!0;try{return Kd(e,t,n)}finally{Xa=!1,(Pr!==null||Mr!==null)&&(Qd(),Yd())}}function Bo(e,t){var n=e.stateNode;if(n===null)return null;var r=Vs(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(H(231,t,typeof n));return n}var qa=!1;if(Zt)try{var $o={};Object.defineProperty($o,"passive",{get:function(){qa=!0}}),window.addEventListener("test",$o,$o),window.removeEventListener("test",$o,$o)}catch{qa=!1}function RE(e,t,n,r,o,i,s,l,a){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(c){this.onError(c)}}var zo=!1,vs=null,ys=!1,Za=null,NE={onError:function(e){zo=!0,vs=e}};function OE(e,t,n,r,o,i,s,l,a){zo=!1,vs=null,RE.apply(NE,arguments)}function xE(e,t,n,r,o,i,s,l,a){if(OE.apply(this,arguments),zo){if(zo){var u=vs;zo=!1,vs=null}else throw Error(H(198));ys||(ys=!0,Za=u)}}function nr(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function qd(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Zd(e){if(nr(e)!==e)throw Error(H(188))}function TE(e){var t=e.alternate;if(!t){if(t=nr(e),t===null)throw Error(H(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var i=o.alternate;if(i===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===n)return Zd(o),e;if(i===r)return Zd(o),t;i=i.sibling}throw Error(H(188))}if(n.return!==r.return)n=o,r=i;else{for(var s=!1,l=o.child;l;){if(l===n){s=!0,n=o,r=i;break}if(l===r){s=!0,r=o,n=i;break}l=l.sibling}if(!s){for(l=i.child;l;){if(l===n){s=!0,n=i,r=o;break}if(l===r){s=!0,r=i,n=o;break}l=l.sibling}if(!s)throw Error(H(189))}}if(n.alternate!==r)throw Error(H(190))}if(n.tag!==3)throw Error(H(188));return n.stateNode.current===n?e:t}function Jd(e){return e=TE(e),e!==null?ep(e):null}function ep(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=ep(e);if(t!==null)return t;e=e.sibling}return null}var tp=tt.unstable_scheduleCallback,np=tt.unstable_cancelCallback,IE=tt.unstable_shouldYield,CE=tt.unstable_requestPaint,me=tt.unstable_now,AE=tt.unstable_getCurrentPriorityLevel,Ja=tt.unstable_ImmediatePriority,rp=tt.unstable_UserBlockingPriority,Es=tt.unstable_NormalPriority,bE=tt.unstable_LowPriority,op=tt.unstable_IdlePriority,Ss=null,Mt=null;function LE(e){if(Mt&&typeof Mt.onCommitFiberRoot=="function")try{Mt.onCommitFiberRoot(Ss,e,void 0,(e.current.flags&128)===128)}catch{}}var _t=Math.clz32?Math.clz32:PE,DE=Math.log,kE=Math.LN2;function PE(e){return e>>>=0,e===0?32:31-(DE(e)/kE|0)|0}var _s=64,ws=4194304;function Ho(e){switch(e&-e){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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Rs(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,s=n&268435455;if(s!==0){var l=s&~o;l!==0?r=Ho(l):(i&=s,i!==0&&(r=Ho(i)))}else s=n&~o,s!==0?r=Ho(s):i!==0&&(r=Ho(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-_t(t),o=1<<n,r|=e[n],t&=~o;return r}function ME(e,t){switch(e){case 1:case 2:case 4:return t+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 t+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 UE(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var s=31-_t(i),l=1<<s,a=o[s];a===-1?(!(l&n)||l&r)&&(o[s]=ME(l,t)):a<=t&&(e.expiredLanes|=l),i&=~l}}function eu(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function ip(){var e=_s;return _s<<=1,!(_s&4194240)&&(_s=64),e}function tu(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function jo(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-_t(t),e[t]=n}function FE(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-_t(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function nu(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-_t(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var re=0;function sp(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var lp,ru,ap,up,cp,ou=!1,Ns=[],Sn=null,_n=null,wn=null,Wo=new Map,Go=new Map,Rn=[],VE="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 fp(e,t){switch(e){case"focusin":case"focusout":Sn=null;break;case"dragenter":case"dragleave":_n=null;break;case"mouseover":case"mouseout":wn=null;break;case"pointerover":case"pointerout":Wo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Go.delete(t.pointerId)}}function Yo(e,t,n,r,o,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},t!==null&&(t=li(t),t!==null&&ru(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function BE(e,t,n,r,o){switch(t){case"focusin":return Sn=Yo(Sn,e,t,n,r,o),!0;case"dragenter":return _n=Yo(_n,e,t,n,r,o),!0;case"mouseover":return wn=Yo(wn,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return Wo.set(i,Yo(Wo.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,Go.set(i,Yo(Go.get(i)||null,e,t,n,r,o)),!0}return!1}function dp(e){var t=rr(e.target);if(t!==null){var n=nr(t);if(n!==null){if(t=n.tag,t===13){if(t=qd(n),t!==null){e.blockedOn=t,cp(e.priority,function(){ap(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Os(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=su(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Ya=r,n.target.dispatchEvent(r),Ya=null}else return t=li(n),t!==null&&ru(t),e.blockedOn=n,!1;t.shift()}return!0}function pp(e,t,n){Os(e)&&n.delete(t)}function $E(){ou=!1,Sn!==null&&Os(Sn)&&(Sn=null),_n!==null&&Os(_n)&&(_n=null),wn!==null&&Os(wn)&&(wn=null),Wo.forEach(pp),Go.forEach(pp)}function Ko(e,t){e.blockedOn===t&&(e.blockedOn=null,ou||(ou=!0,tt.unstable_scheduleCallback(tt.unstable_NormalPriority,$E)))}function Qo(e){function t(o){return Ko(o,e)}if(0<Ns.length){Ko(Ns[0],e);for(var n=1;n<Ns.length;n++){var r=Ns[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Sn!==null&&Ko(Sn,e),_n!==null&&Ko(_n,e),wn!==null&&Ko(wn,e),Wo.forEach(t),Go.forEach(t),n=0;n<Rn.length;n++)r=Rn[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Rn.length&&(n=Rn[0],n.blockedOn===null);)dp(n),n.blockedOn===null&&Rn.shift()}var Ur=Jt.ReactCurrentBatchConfig,xs=!0;function zE(e,t,n,r){var o=re,i=Ur.transition;Ur.transition=null;try{re=1,iu(e,t,n,r)}finally{re=o,Ur.transition=i}}function HE(e,t,n,r){var o=re,i=Ur.transition;Ur.transition=null;try{re=4,iu(e,t,n,r)}finally{re=o,Ur.transition=i}}function iu(e,t,n,r){if(xs){var o=su(e,t,n,r);if(o===null)Ru(e,t,r,Ts,n),fp(e,r);else if(BE(o,e,t,n,r))r.stopPropagation();else if(fp(e,r),t&4&&-1<VE.indexOf(e)){for(;o!==null;){var i=li(o);if(i!==null&&lp(i),i=su(e,t,n,r),i===null&&Ru(e,t,r,Ts,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else Ru(e,t,r,null,n)}}var Ts=null;function su(e,t,n,r){if(Ts=null,e=Ka(r),e=rr(e),e!==null)if(t=nr(e),t===null)e=null;else if(n=t.tag,n===13){if(e=qd(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Ts=e,null}function hp(e){switch(e){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(AE()){case Ja:return 1;case rp:return 4;case Es:case bE:return 16;case op:return 536870912;default:return 16}default:return 16}}var Nn=null,lu=null,Is=null;function gp(){if(Is)return Is;var e,t=lu,n=t.length,r,o="value"in Nn?Nn.value:Nn.textContent,i=o.length;for(e=0;e<n&&t[e]===o[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===o[i-r];r++);return Is=o.slice(e,1<r?1-r:void 0)}function Cs(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function As(){return!0}function mp(){return!1}function nt(e){function t(n,r,o,i,s){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=i,this.target=s,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?As:mp,this.isPropagationStopped=mp,this}return ue(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=As)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=As)},persist:function(){},isPersistent:As}),t}var Fr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},au=nt(Fr),Xo=ue({},Fr,{view:0,detail:0}),jE=nt(Xo),uu,cu,qo,bs=ue({},Xo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:du,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==qo&&(qo&&e.type==="mousemove"?(uu=e.screenX-qo.screenX,cu=e.screenY-qo.screenY):cu=uu=0,qo=e),uu)},movementY:function(e){return"movementY"in e?e.movementY:cu}}),vp=nt(bs),WE=ue({},bs,{dataTransfer:0}),GE=nt(WE),YE=ue({},Xo,{relatedTarget:0}),fu=nt(YE),KE=ue({},Fr,{animationName:0,elapsedTime:0,pseudoElement:0}),QE=nt(KE),XE=ue({},Fr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),qE=nt(XE),ZE=ue({},Fr,{data:0}),yp=nt(ZE),JE={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},eS={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"},tS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function nS(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=tS[e])?!!t[e]:!1}function du(){return nS}var rS=ue({},Xo,{key:function(e){if(e.key){var t=JE[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Cs(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?eS[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:du,charCode:function(e){return e.type==="keypress"?Cs(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Cs(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),oS=nt(rS),iS=ue({},bs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ep=nt(iS),sS=ue({},Xo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:du}),lS=nt(sS),aS=ue({},Fr,{propertyName:0,elapsedTime:0,pseudoElement:0}),uS=nt(aS),cS=ue({},bs,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),fS=nt(cS),dS=[9,13,27,32],pu=Zt&&"CompositionEvent"in window,Zo=null;Zt&&"documentMode"in document&&(Zo=document.documentMode);var pS=Zt&&"TextEvent"in window&&!Zo,Sp=Zt&&(!pu||Zo&&8<Zo&&11>=Zo),_p=String.fromCharCode(32),wp=!1;function Rp(e,t){switch(e){case"keyup":return dS.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Np(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Vr=!1;function hS(e,t){switch(e){case"compositionend":return Np(t);case"keypress":return t.which!==32?null:(wp=!0,_p);case"textInput":return e=t.data,e===_p&&wp?null:e;default:return null}}function gS(e,t){if(Vr)return e==="compositionend"||!pu&&Rp(e,t)?(e=gp(),Is=lu=Nn=null,Vr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Sp&&t.locale!=="ko"?null:t.data;default:return null}}var mS={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 Op(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!mS[e.type]:t==="textarea"}function xp(e,t,n,r){Gd(r),t=Ms(t,"onChange"),0<t.length&&(n=new au("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Jo=null,ei=null;function vS(e){jp(e,0)}function Ls(e){var t=jr(e);if(kd(t))return e}function yS(e,t){if(e==="change")return t}var Tp=!1;if(Zt){var hu;if(Zt){var gu="oninput"in document;if(!gu){var Ip=document.createElement("div");Ip.setAttribute("oninput","return;"),gu=typeof Ip.oninput=="function"}hu=gu}else hu=!1;Tp=hu&&(!document.documentMode||9<document.documentMode)}function Cp(){Jo&&(Jo.detachEvent("onpropertychange",Ap),ei=Jo=null)}function Ap(e){if(e.propertyName==="value"&&Ls(ei)){var t=[];xp(t,ei,e,Ka(e)),Xd(vS,t)}}function ES(e,t,n){e==="focusin"?(Cp(),Jo=t,ei=n,Jo.attachEvent("onpropertychange",Ap)):e==="focusout"&&Cp()}function SS(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ls(ei)}function _S(e,t){if(e==="click")return Ls(t)}function wS(e,t){if(e==="input"||e==="change")return Ls(t)}function RS(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var wt=typeof Object.is=="function"?Object.is:RS;function ti(e,t){if(wt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!xa.call(t,o)||!wt(e[o],t[o]))return!1}return!0}function bp(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Lp(e,t){var n=bp(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=bp(n)}}function Dp(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Dp(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function kp(){for(var e=window,t=gs();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=gs(e.document)}return t}function mu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function NS(e){var t=kp(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Dp(n.ownerDocument.documentElement,n)){if(r!==null&&mu(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=Lp(n,i);var s=Lp(n,r);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var OS=Zt&&"documentMode"in document&&11>=document.documentMode,Br=null,vu=null,ni=null,yu=!1;function Pp(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;yu||Br==null||Br!==gs(r)||(r=Br,"selectionStart"in r&&mu(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ni&&ti(ni,r)||(ni=r,r=Ms(vu,"onSelect"),0<r.length&&(t=new au("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Br)))}function Ds(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var $r={animationend:Ds("Animation","AnimationEnd"),animationiteration:Ds("Animation","AnimationIteration"),animationstart:Ds("Animation","AnimationStart"),transitionend:Ds("Transition","TransitionEnd")},Eu={},Mp={};Zt&&(Mp=document.createElement("div").style,"AnimationEvent"in window||(delete $r.animationend.animation,delete $r.animationiteration.animation,delete $r.animationstart.animation),"TransitionEvent"in window||delete $r.transitionend.transition);function ks(e){if(Eu[e])return Eu[e];if(!$r[e])return e;var t=$r[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Mp)return Eu[e]=t[n];return e}var Up=ks("animationend"),Fp=ks("animationiteration"),Vp=ks("animationstart"),Bp=ks("transitionend"),$p=new Map,zp="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 On(e,t){$p.set(e,t),tr(t,[e])}for(var Su=0;Su<zp.length;Su++){var _u=zp[Su],xS=_u.toLowerCase(),TS=_u[0].toUpperCase()+_u.slice(1);On(xS,"on"+TS)}On(Up,"onAnimationEnd"),On(Fp,"onAnimationIteration"),On(Vp,"onAnimationStart"),On("dblclick","onDoubleClick"),On("focusin","onFocus"),On("focusout","onBlur"),On(Bp,"onTransitionEnd"),br("onMouseEnter",["mouseout","mouseover"]),br("onMouseLeave",["mouseout","mouseover"]),br("onPointerEnter",["pointerout","pointerover"]),br("onPointerLeave",["pointerout","pointerover"]),tr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),tr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),tr("onBeforeInput",["compositionend","keypress","textInput","paste"]),tr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),tr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),tr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ri="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(" "),IS=new Set("cancel close invalid load scroll toggle".split(" ").concat(ri));function Hp(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,xE(r,t,void 0,e),e.currentTarget=null}function jp(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var s=r.length-1;0<=s;s--){var l=r[s],a=l.instance,u=l.currentTarget;if(l=l.listener,a!==i&&o.isPropagationStopped())break e;Hp(o,l,u),i=a}else for(s=0;s<r.length;s++){if(l=r[s],a=l.instance,u=l.currentTarget,l=l.listener,a!==i&&o.isPropagationStopped())break e;Hp(o,l,u),i=a}}}if(ys)throw e=Za,ys=!1,Za=null,e}function se(e,t){var n=t[Cu];n===void 0&&(n=t[Cu]=new Set);var r=e+"__bubble";n.has(r)||(Wp(t,e,2,!1),n.add(r))}function wu(e,t,n){var r=0;t&&(r|=4),Wp(n,e,r,t)}var Ps="_reactListening"+Math.random().toString(36).slice(2);function oi(e){if(!e[Ps]){e[Ps]=!0,xd.forEach(function(n){n!=="selectionchange"&&(IS.has(n)||wu(n,!1,e),wu(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ps]||(t[Ps]=!0,wu("selectionchange",!1,t))}}function Wp(e,t,n,r){switch(hp(t)){case 1:var o=zE;break;case 4:o=HE;break;default:o=iu}n=o.bind(null,t,n,e),o=void 0,!qa||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function Ru(e,t,n,r,o){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var l=r.stateNode.containerInfo;if(l===o||l.nodeType===8&&l.parentNode===o)break;if(s===4)for(s=r.return;s!==null;){var a=s.tag;if((a===3||a===4)&&(a=s.stateNode.containerInfo,a===o||a.nodeType===8&&a.parentNode===o))return;s=s.return}for(;l!==null;){if(s=rr(l),s===null)return;if(a=s.tag,a===5||a===6){r=i=s;continue e}l=l.parentNode}}r=r.return}Xd(function(){var u=i,c=Ka(n),f=[];e:{var p=$p.get(e);if(p!==void 0){var h=au,v=e;switch(e){case"keypress":if(Cs(n)===0)break e;case"keydown":case"keyup":h=oS;break;case"focusin":v="focus",h=fu;break;case"focusout":v="blur",h=fu;break;case"beforeblur":case"afterblur":h=fu;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=vp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=GE;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=lS;break;case Up:case Fp:case Vp:h=QE;break;case Bp:h=uS;break;case"scroll":h=jE;break;case"wheel":h=fS;break;case"copy":case"cut":case"paste":h=qE;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=Ep}var m=(t&4)!==0,E=!m&&e==="scroll",d=m?p!==null?p+"Capture":null:p;m=[];for(var g=u,y;g!==null;){y=g;var S=y.stateNode;if(y.tag===5&&S!==null&&(y=S,d!==null&&(S=Bo(g,d),S!=null&&m.push(ii(g,S,y)))),E)break;g=g.return}0<m.length&&(p=new h(p,v,null,n,c),f.push({event:p,listeners:m}))}}if(!(t&7)){e:{if(p=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",p&&n!==Ya&&(v=n.relatedTarget||n.fromElement)&&(rr(v)||v[en]))break e;if((h||p)&&(p=c.window===c?c:(p=c.ownerDocument)?p.defaultView||p.parentWindow:window,h?(v=n.relatedTarget||n.toElement,h=u,v=v?rr(v):null,v!==null&&(E=nr(v),v!==E||v.tag!==5&&v.tag!==6)&&(v=null)):(h=null,v=u),h!==v)){if(m=vp,S="onMouseLeave",d="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(m=Ep,S="onPointerLeave",d="onPointerEnter",g="pointer"),E=h==null?p:jr(h),y=v==null?p:jr(v),p=new m(S,g+"leave",h,n,c),p.target=E,p.relatedTarget=y,S=null,rr(c)===u&&(m=new m(d,g+"enter",v,n,c),m.target=y,m.relatedTarget=E,S=m),E=S,h&&v)t:{for(m=h,d=v,g=0,y=m;y;y=zr(y))g++;for(y=0,S=d;S;S=zr(S))y++;for(;0<g-y;)m=zr(m),g--;for(;0<y-g;)d=zr(d),y--;for(;g--;){if(m===d||d!==null&&m===d.alternate)break t;m=zr(m),d=zr(d)}m=null}else m=null;h!==null&&Gp(f,p,h,m,!1),v!==null&&E!==null&&Gp(f,E,v,m,!0)}}e:{if(p=u?jr(u):window,h=p.nodeName&&p.nodeName.toLowerCase(),h==="select"||h==="input"&&p.type==="file")var w=yS;else if(Op(p))if(Tp)w=wS;else{w=SS;var N=ES}else(h=p.nodeName)&&h.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(w=_S);if(w&&(w=w(e,u))){xp(f,w,n,c);break e}N&&N(e,p,u),e==="focusout"&&(N=p._wrapperState)&&N.controlled&&p.type==="number"&&za(p,"number",p.value)}switch(N=u?jr(u):window,e){case"focusin":(Op(N)||N.contentEditable==="true")&&(Br=N,vu=u,ni=null);break;case"focusout":ni=vu=Br=null;break;case"mousedown":yu=!0;break;case"contextmenu":case"mouseup":case"dragend":yu=!1,Pp(f,n,c);break;case"selectionchange":if(OS)break;case"keydown":case"keyup":Pp(f,n,c)}var T;if(pu)e:{switch(e){case"compositionstart":var b="onCompositionStart";break e;case"compositionend":b="onCompositionEnd";break e;case"compositionupdate":b="onCompositionUpdate";break e}b=void 0}else Vr?Rp(e,n)&&(b="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(b="onCompositionStart");b&&(Sp&&n.locale!=="ko"&&(Vr||b!=="onCompositionStart"?b==="onCompositionEnd"&&Vr&&(T=gp()):(Nn=c,lu="value"in Nn?Nn.value:Nn.textContent,Vr=!0)),N=Ms(u,b),0<N.length&&(b=new yp(b,e,null,n,c),f.push({event:b,listeners:N}),T?b.data=T:(T=Np(n),T!==null&&(b.data=T)))),(T=pS?hS(e,n):gS(e,n))&&(u=Ms(u,"onBeforeInput"),0<u.length&&(c=new yp("onBeforeInput","beforeinput",null,n,c),f.push({event:c,listeners:u}),c.data=T))}jp(f,t)})}function ii(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ms(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=Bo(e,n),i!=null&&r.unshift(ii(e,i,o)),i=Bo(e,t),i!=null&&r.push(ii(e,i,o))),e=e.return}return r}function zr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Gp(e,t,n,r,o){for(var i=t._reactName,s=[];n!==null&&n!==r;){var l=n,a=l.alternate,u=l.stateNode;if(a!==null&&a===r)break;l.tag===5&&u!==null&&(l=u,o?(a=Bo(n,i),a!=null&&s.unshift(ii(n,a,l))):o||(a=Bo(n,i),a!=null&&s.push(ii(n,a,l)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var CS=/\r\n?/g,AS=/\u0000|\uFFFD/g;function Yp(e){return(typeof e=="string"?e:""+e).replace(CS,`
42
+ `).replace(AS,"")}function Us(e,t,n){if(t=Yp(t),Yp(e)!==t&&n)throw Error(H(425))}function Fs(){}var Nu=null,Ou=null;function xu(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Tu=typeof setTimeout=="function"?setTimeout:void 0,bS=typeof clearTimeout=="function"?clearTimeout:void 0,Kp=typeof Promise=="function"?Promise:void 0,LS=typeof queueMicrotask=="function"?queueMicrotask:typeof Kp<"u"?function(e){return Kp.resolve(null).then(e).catch(DS)}:Tu;function DS(e){setTimeout(function(){throw e})}function Iu(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){e.removeChild(o),Qo(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);Qo(t)}function xn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Qp(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Hr=Math.random().toString(36).slice(2),Ut="__reactFiber$"+Hr,si="__reactProps$"+Hr,en="__reactContainer$"+Hr,Cu="__reactEvents$"+Hr,kS="__reactListeners$"+Hr,PS="__reactHandles$"+Hr;function rr(e){var t=e[Ut];if(t)return t;for(var n=e.parentNode;n;){if(t=n[en]||n[Ut]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Qp(e);e!==null;){if(n=e[Ut])return n;e=Qp(e)}return t}e=n,n=e.parentNode}return null}function li(e){return e=e[Ut]||e[en],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function jr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(H(33))}function Vs(e){return e[si]||null}var Au=[],Wr=-1;function Tn(e){return{current:e}}function le(e){0>Wr||(e.current=Au[Wr],Au[Wr]=null,Wr--)}function oe(e,t){Wr++,Au[Wr]=e.current,e.current=t}var In={},be=Tn(In),He=Tn(!1),or=In;function Gr(e,t){var n=e.type.contextTypes;if(!n)return In;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function je(e){return e=e.childContextTypes,e!=null}function Bs(){le(He),le(be)}function Xp(e,t,n){if(be.current!==In)throw Error(H(168));oe(be,t),oe(He,n)}function qp(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(H(108,EE(e)||"Unknown",o));return ue({},n,r)}function $s(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||In,or=be.current,oe(be,e),oe(He,He.current),!0}function Zp(e,t,n){var r=e.stateNode;if(!r)throw Error(H(169));n?(e=qp(e,t,or),r.__reactInternalMemoizedMergedChildContext=e,le(He),le(be),oe(be,e)):le(He),oe(He,n)}var tn=null,zs=!1,bu=!1;function Jp(e){tn===null?tn=[e]:tn.push(e)}function MS(e){zs=!0,Jp(e)}function Cn(){if(!bu&&tn!==null){bu=!0;var e=0,t=re;try{var n=tn;for(re=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}tn=null,zs=!1}catch(o){throw tn!==null&&(tn=tn.slice(e+1)),tp(Ja,Cn),o}finally{re=t,bu=!1}}return null}var Yr=[],Kr=0,Hs=null,js=0,ct=[],ft=0,ir=null,nn=1,rn="";function sr(e,t){Yr[Kr++]=js,Yr[Kr++]=Hs,Hs=e,js=t}function eh(e,t,n){ct[ft++]=nn,ct[ft++]=rn,ct[ft++]=ir,ir=e;var r=nn;e=rn;var o=32-_t(r)-1;r&=~(1<<o),n+=1;var i=32-_t(t)+o;if(30<i){var s=o-o%5;i=(r&(1<<s)-1).toString(32),r>>=s,o-=s,nn=1<<32-_t(t)+o|n<<o|r,rn=i+e}else nn=1<<i|n<<o|r,rn=e}function Lu(e){e.return!==null&&(sr(e,1),eh(e,1,0))}function Du(e){for(;e===Hs;)Hs=Yr[--Kr],Yr[Kr]=null,js=Yr[--Kr],Yr[Kr]=null;for(;e===ir;)ir=ct[--ft],ct[ft]=null,rn=ct[--ft],ct[ft]=null,nn=ct[--ft],ct[ft]=null}var rt=null,ot=null,ae=!1,Rt=null;function th(e,t){var n=gt(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function nh(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,rt=e,ot=xn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,rt=e,ot=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=ir!==null?{id:nn,overflow:rn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=gt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,rt=e,ot=null,!0):!1;default:return!1}}function ku(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Pu(e){if(ae){var t=ot;if(t){var n=t;if(!nh(e,t)){if(ku(e))throw Error(H(418));t=xn(n.nextSibling);var r=rt;t&&nh(e,t)?th(r,n):(e.flags=e.flags&-4097|2,ae=!1,rt=e)}}else{if(ku(e))throw Error(H(418));e.flags=e.flags&-4097|2,ae=!1,rt=e}}}function rh(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;rt=e}function Ws(e){if(e!==rt)return!1;if(!ae)return rh(e),ae=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!xu(e.type,e.memoizedProps)),t&&(t=ot)){if(ku(e))throw oh(),Error(H(418));for(;t;)th(e,t),t=xn(t.nextSibling)}if(rh(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(H(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){ot=xn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}ot=null}}else ot=rt?xn(e.stateNode.nextSibling):null;return!0}function oh(){for(var e=ot;e;)e=xn(e.nextSibling)}function Qr(){ot=rt=null,ae=!1}function Mu(e){Rt===null?Rt=[e]:Rt.push(e)}var US=Jt.ReactCurrentBatchConfig;function Nt(e,t){if(e&&e.defaultProps){t=ue({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}var Gs=Tn(null),Ys=null,Xr=null,Uu=null;function Fu(){Uu=Xr=Ys=null}function Vu(e){var t=Gs.current;le(Gs),e._currentValue=t}function Bu(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function qr(e,t){Ys=e,Uu=Xr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(We=!0),e.firstContext=null)}function dt(e){var t=e._currentValue;if(Uu!==e)if(e={context:e,memoizedValue:t,next:null},Xr===null){if(Ys===null)throw Error(H(308));Xr=e,Ys.dependencies={lanes:0,firstContext:e}}else Xr=Xr.next=e;return t}var lr=null;function $u(e){lr===null?lr=[e]:lr.push(e)}function ih(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,$u(t)):(n.next=o.next,o.next=n),t.interleaved=n,on(e,r)}function on(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var An=!1;function zu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function sh(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function sn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function bn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,te&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,on(e,n)}return o=r.interleaved,o===null?(t.next=t,$u(r)):(t.next=o.next,o.next=t),r.interleaved=t,on(e,n)}function Ks(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,nu(e,n)}}function lh(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=s:i=i.next=s,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Qs(e,t,n,r){var o=e.updateQueue;An=!1;var i=o.firstBaseUpdate,s=o.lastBaseUpdate,l=o.shared.pending;if(l!==null){o.shared.pending=null;var a=l,u=a.next;a.next=null,s===null?i=u:s.next=u,s=a;var c=e.alternate;c!==null&&(c=c.updateQueue,l=c.lastBaseUpdate,l!==s&&(l===null?c.firstBaseUpdate=u:l.next=u,c.lastBaseUpdate=a))}if(i!==null){var f=o.baseState;s=0,c=u=a=null,l=i;do{var p=l.lane,h=l.eventTime;if((r&p)===p){c!==null&&(c=c.next={eventTime:h,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var v=e,m=l;switch(p=t,h=n,m.tag){case 1:if(v=m.payload,typeof v=="function"){f=v.call(h,f,p);break e}f=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=m.payload,p=typeof v=="function"?v.call(h,f,p):v,p==null)break e;f=ue({},f,p);break e;case 2:An=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,p=o.effects,p===null?o.effects=[l]:p.push(l))}else h={eventTime:h,lane:p,tag:l.tag,payload:l.payload,callback:l.callback,next:null},c===null?(u=c=h,a=f):c=c.next=h,s|=p;if(l=l.next,l===null){if(l=o.shared.pending,l===null)break;p=l,l=p.next,p.next=null,o.lastBaseUpdate=p,o.shared.pending=null}}while(1);if(c===null&&(a=f),o.baseState=a,o.firstBaseUpdate=u,o.lastBaseUpdate=c,t=o.shared.interleaved,t!==null){o=t;do s|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);cr|=s,e.lanes=s,e.memoizedState=f}}function ah(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=n,typeof o!="function")throw Error(H(191,o));o.call(r)}}}var uh=new Od.Component().refs;function Hu(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:ue({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Xs={isMounted:function(e){return(e=e._reactInternals)?nr(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Ve(),o=Pn(e),i=sn(r,o);i.payload=t,n!=null&&(i.callback=n),t=bn(e,i,o),t!==null&&(Tt(t,e,o,r),Ks(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Ve(),o=Pn(e),i=sn(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=bn(e,i,o),t!==null&&(Tt(t,e,o,r),Ks(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ve(),r=Pn(e),o=sn(n,r);o.tag=2,t!=null&&(o.callback=t),t=bn(e,o,r),t!==null&&(Tt(t,e,r,n),Ks(t,e,r))}};function ch(e,t,n,r,o,i,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,s):t.prototype&&t.prototype.isPureReactComponent?!ti(n,r)||!ti(o,i):!0}function fh(e,t,n){var r=!1,o=In,i=t.contextType;return typeof i=="object"&&i!==null?i=dt(i):(o=je(t)?or:be.current,r=t.contextTypes,i=(r=r!=null)?Gr(e,o):In),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Xs,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function dh(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Xs.enqueueReplaceState(t,t.state,null)}function ju(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs=uh,zu(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=dt(i):(i=je(t)?or:be.current,o.context=Gr(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Hu(e,t,i,n),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&Xs.enqueueReplaceState(o,o.state,null),Qs(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function ai(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(H(309));var r=n.stateNode}if(!r)throw Error(H(147,e));var o=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(s){var l=o.refs;l===uh&&(l=o.refs={}),s===null?delete l[i]:l[i]=s},t._stringRef=i,t)}if(typeof e!="string")throw Error(H(284));if(!n._owner)throw Error(H(290,e))}return e}function qs(e,t){throw e=Object.prototype.toString.call(t),Error(H(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function ph(e){var t=e._init;return t(e._payload)}function hh(e){function t(d,g){if(e){var y=d.deletions;y===null?(d.deletions=[g],d.flags|=16):y.push(g)}}function n(d,g){if(!e)return null;for(;g!==null;)t(d,g),g=g.sibling;return null}function r(d,g){for(d=new Map;g!==null;)g.key!==null?d.set(g.key,g):d.set(g.index,g),g=g.sibling;return d}function o(d,g){return d=Un(d,g),d.index=0,d.sibling=null,d}function i(d,g,y){return d.index=y,e?(y=d.alternate,y!==null?(y=y.index,y<g?(d.flags|=2,g):y):(d.flags|=2,g)):(d.flags|=1048576,g)}function s(d){return e&&d.alternate===null&&(d.flags|=2),d}function l(d,g,y,S){return g===null||g.tag!==6?(g=Tc(y,d.mode,S),g.return=d,g):(g=o(g,y),g.return=d,g)}function a(d,g,y,S){var w=y.type;return w===Dr?c(d,g,y.props.children,S,y.key):g!==null&&(g.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===yn&&ph(w)===g.type)?(S=o(g,y.props),S.ref=ai(d,g,y),S.return=d,S):(S=ml(y.type,y.key,y.props,null,d.mode,S),S.ref=ai(d,g,y),S.return=d,S)}function u(d,g,y,S){return g===null||g.tag!==4||g.stateNode.containerInfo!==y.containerInfo||g.stateNode.implementation!==y.implementation?(g=Ic(y,d.mode,S),g.return=d,g):(g=o(g,y.children||[]),g.return=d,g)}function c(d,g,y,S,w){return g===null||g.tag!==7?(g=hr(y,d.mode,S,w),g.return=d,g):(g=o(g,y),g.return=d,g)}function f(d,g,y){if(typeof g=="string"&&g!==""||typeof g=="number")return g=Tc(""+g,d.mode,y),g.return=d,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case ps:return y=ml(g.type,g.key,g.props,null,d.mode,y),y.ref=ai(d,null,g),y.return=d,y;case Lr:return g=Ic(g,d.mode,y),g.return=d,g;case yn:var S=g._init;return f(d,S(g._payload),y)}if(Uo(g)||Po(g))return g=hr(g,d.mode,y,null),g.return=d,g;qs(d,g)}return null}function p(d,g,y,S){var w=g!==null?g.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return w!==null?null:l(d,g,""+y,S);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case ps:return y.key===w?a(d,g,y,S):null;case Lr:return y.key===w?u(d,g,y,S):null;case yn:return w=y._init,p(d,g,w(y._payload),S)}if(Uo(y)||Po(y))return w!==null?null:c(d,g,y,S,null);qs(d,y)}return null}function h(d,g,y,S,w){if(typeof S=="string"&&S!==""||typeof S=="number")return d=d.get(y)||null,l(g,d,""+S,w);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case ps:return d=d.get(S.key===null?y:S.key)||null,a(g,d,S,w);case Lr:return d=d.get(S.key===null?y:S.key)||null,u(g,d,S,w);case yn:var N=S._init;return h(d,g,y,N(S._payload),w)}if(Uo(S)||Po(S))return d=d.get(y)||null,c(g,d,S,w,null);qs(g,S)}return null}function v(d,g,y,S){for(var w=null,N=null,T=g,b=g=0,D=null;T!==null&&b<y.length;b++){T.index>b?(D=T,T=null):D=T.sibling;var k=p(d,T,y[b],S);if(k===null){T===null&&(T=D);break}e&&T&&k.alternate===null&&t(d,T),g=i(k,g,b),N===null?w=k:N.sibling=k,N=k,T=D}if(b===y.length)return n(d,T),ae&&sr(d,b),w;if(T===null){for(;b<y.length;b++)T=f(d,y[b],S),T!==null&&(g=i(T,g,b),N===null?w=T:N.sibling=T,N=T);return ae&&sr(d,b),w}for(T=r(d,T);b<y.length;b++)D=h(T,d,b,y[b],S),D!==null&&(e&&D.alternate!==null&&T.delete(D.key===null?b:D.key),g=i(D,g,b),N===null?w=D:N.sibling=D,N=D);return e&&T.forEach(function(B){return t(d,B)}),ae&&sr(d,b),w}function m(d,g,y,S){var w=Po(y);if(typeof w!="function")throw Error(H(150));if(y=w.call(y),y==null)throw Error(H(151));for(var N=w=null,T=g,b=g=0,D=null,k=y.next();T!==null&&!k.done;b++,k=y.next()){T.index>b?(D=T,T=null):D=T.sibling;var B=p(d,T,k.value,S);if(B===null){T===null&&(T=D);break}e&&T&&B.alternate===null&&t(d,T),g=i(B,g,b),N===null?w=B:N.sibling=B,N=B,T=D}if(k.done)return n(d,T),ae&&sr(d,b),w;if(T===null){for(;!k.done;b++,k=y.next())k=f(d,k.value,S),k!==null&&(g=i(k,g,b),N===null?w=k:N.sibling=k,N=k);return ae&&sr(d,b),w}for(T=r(d,T);!k.done;b++,k=y.next())k=h(T,d,b,k.value,S),k!==null&&(e&&k.alternate!==null&&T.delete(k.key===null?b:k.key),g=i(k,g,b),N===null?w=k:N.sibling=k,N=k);return e&&T.forEach(function(F){return t(d,F)}),ae&&sr(d,b),w}function E(d,g,y,S){if(typeof y=="object"&&y!==null&&y.type===Dr&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case ps:e:{for(var w=y.key,N=g;N!==null;){if(N.key===w){if(w=y.type,w===Dr){if(N.tag===7){n(d,N.sibling),g=o(N,y.props.children),g.return=d,d=g;break e}}else if(N.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===yn&&ph(w)===N.type){n(d,N.sibling),g=o(N,y.props),g.ref=ai(d,N,y),g.return=d,d=g;break e}n(d,N);break}else t(d,N);N=N.sibling}y.type===Dr?(g=hr(y.props.children,d.mode,S,y.key),g.return=d,d=g):(S=ml(y.type,y.key,y.props,null,d.mode,S),S.ref=ai(d,g,y),S.return=d,d=S)}return s(d);case Lr:e:{for(N=y.key;g!==null;){if(g.key===N)if(g.tag===4&&g.stateNode.containerInfo===y.containerInfo&&g.stateNode.implementation===y.implementation){n(d,g.sibling),g=o(g,y.children||[]),g.return=d,d=g;break e}else{n(d,g);break}else t(d,g);g=g.sibling}g=Ic(y,d.mode,S),g.return=d,d=g}return s(d);case yn:return N=y._init,E(d,g,N(y._payload),S)}if(Uo(y))return v(d,g,y,S);if(Po(y))return m(d,g,y,S);qs(d,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,g!==null&&g.tag===6?(n(d,g.sibling),g=o(g,y),g.return=d,d=g):(n(d,g),g=Tc(y,d.mode,S),g.return=d,d=g),s(d)):n(d,g)}return E}var Zr=hh(!0),gh=hh(!1),ui={},Ft=Tn(ui),ci=Tn(ui),fi=Tn(ui);function ar(e){if(e===ui)throw Error(H(174));return e}function Wu(e,t){switch(oe(fi,t),oe(ci,e),oe(Ft,ui),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ja(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=ja(t,e)}le(Ft),oe(Ft,t)}function Jr(){le(Ft),le(ci),le(fi)}function mh(e){ar(fi.current);var t=ar(Ft.current),n=ja(t,e.type);t!==n&&(oe(ci,e),oe(Ft,n))}function Gu(e){ci.current===e&&(le(Ft),le(ci))}var ce=Tn(0);function Zs(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Yu=[];function Ku(){for(var e=0;e<Yu.length;e++)Yu[e]._workInProgressVersionPrimary=null;Yu.length=0}var Js=Jt.ReactCurrentDispatcher,Qu=Jt.ReactCurrentBatchConfig,ur=0,fe=null,Ee=null,Re=null,el=!1,di=!1,pi=0,FS=0;function Le(){throw Error(H(321))}function Xu(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!wt(e[n],t[n]))return!1;return!0}function qu(e,t,n,r,o,i){if(ur=i,fe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Js.current=e===null||e.memoizedState===null?zS:HS,e=n(r,o),di){i=0;do{if(di=!1,pi=0,25<=i)throw Error(H(301));i+=1,Re=Ee=null,t.updateQueue=null,Js.current=jS,e=n(r,o)}while(di)}if(Js.current=rl,t=Ee!==null&&Ee.next!==null,ur=0,Re=Ee=fe=null,el=!1,t)throw Error(H(300));return e}function Zu(){var e=pi!==0;return pi=0,e}function Vt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Re===null?fe.memoizedState=Re=e:Re=Re.next=e,Re}function pt(){if(Ee===null){var e=fe.alternate;e=e!==null?e.memoizedState:null}else e=Ee.next;var t=Re===null?fe.memoizedState:Re.next;if(t!==null)Re=t,Ee=e;else{if(e===null)throw Error(H(310));Ee=e,e={memoizedState:Ee.memoizedState,baseState:Ee.baseState,baseQueue:Ee.baseQueue,queue:Ee.queue,next:null},Re===null?fe.memoizedState=Re=e:Re=Re.next=e}return Re}function hi(e,t){return typeof t=="function"?t(e):t}function Ju(e){var t=pt(),n=t.queue;if(n===null)throw Error(H(311));n.lastRenderedReducer=e;var r=Ee,o=r.baseQueue,i=n.pending;if(i!==null){if(o!==null){var s=o.next;o.next=i.next,i.next=s}r.baseQueue=o=i,n.pending=null}if(o!==null){i=o.next,r=r.baseState;var l=s=null,a=null,u=i;do{var c=u.lane;if((ur&c)===c)a!==null&&(a=a.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var f={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};a===null?(l=a=f,s=r):a=a.next=f,fe.lanes|=c,cr|=c}u=u.next}while(u!==null&&u!==i);a===null?s=r:a.next=l,wt(r,t.memoizedState)||(We=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=a,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do i=o.lane,fe.lanes|=i,cr|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function ec(e){var t=pt(),n=t.queue;if(n===null)throw Error(H(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,i=t.memoizedState;if(o!==null){n.pending=null;var s=o=o.next;do i=e(i,s.action),s=s.next;while(s!==o);wt(i,t.memoizedState)||(We=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function vh(){}function yh(e,t){var n=fe,r=pt(),o=t(),i=!wt(r.memoizedState,o);if(i&&(r.memoizedState=o,We=!0),r=r.queue,tc(_h.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||Re!==null&&Re.memoizedState.tag&1){if(n.flags|=2048,gi(9,Sh.bind(null,n,r,o,t),void 0,null),Ne===null)throw Error(H(349));ur&30||Eh(n,t,o)}return o}function Eh(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=fe.updateQueue,t===null?(t={lastEffect:null,stores:null},fe.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Sh(e,t,n,r){t.value=n,t.getSnapshot=r,wh(t)&&Rh(e)}function _h(e,t,n){return n(function(){wh(t)&&Rh(e)})}function wh(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!wt(e,n)}catch{return!0}}function Rh(e){var t=on(e,1);t!==null&&Tt(t,e,1,-1)}function Nh(e){var t=Vt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:hi,lastRenderedState:e},t.queue=e,e=e.dispatch=$S.bind(null,fe,e),[t.memoizedState,e]}function gi(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=fe.updateQueue,t===null?(t={lastEffect:null,stores:null},fe.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Oh(){return pt().memoizedState}function tl(e,t,n,r){var o=Vt();fe.flags|=e,o.memoizedState=gi(1|t,n,void 0,r===void 0?null:r)}function nl(e,t,n,r){var o=pt();r=r===void 0?null:r;var i=void 0;if(Ee!==null){var s=Ee.memoizedState;if(i=s.destroy,r!==null&&Xu(r,s.deps)){o.memoizedState=gi(t,n,i,r);return}}fe.flags|=e,o.memoizedState=gi(1|t,n,i,r)}function xh(e,t){return tl(8390656,8,e,t)}function tc(e,t){return nl(2048,8,e,t)}function Th(e,t){return nl(4,2,e,t)}function Ih(e,t){return nl(4,4,e,t)}function Ch(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Ah(e,t,n){return n=n!=null?n.concat([e]):null,nl(4,4,Ch.bind(null,t,e),n)}function nc(){}function bh(e,t){var n=pt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Xu(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Lh(e,t){var n=pt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Xu(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Dh(e,t,n){return ur&21?(wt(n,t)||(n=ip(),fe.lanes|=n,cr|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,We=!0),e.memoizedState=n)}function VS(e,t){var n=re;re=n!==0&&4>n?n:4,e(!0);var r=Qu.transition;Qu.transition={};try{e(!1),t()}finally{re=n,Qu.transition=r}}function kh(){return pt().memoizedState}function BS(e,t,n){var r=Pn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Ph(e))Mh(t,n);else if(n=ih(e,t,n,r),n!==null){var o=Ve();Tt(n,e,r,o),Uh(n,t,r)}}function $S(e,t,n){var r=Pn(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ph(e))Mh(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,l=i(s,n);if(o.hasEagerState=!0,o.eagerState=l,wt(l,s)){var a=t.interleaved;a===null?(o.next=o,$u(t)):(o.next=a.next,a.next=o),t.interleaved=o;return}}catch{}finally{}n=ih(e,t,o,r),n!==null&&(o=Ve(),Tt(n,e,r,o),Uh(n,t,r))}}function Ph(e){var t=e.alternate;return e===fe||t!==null&&t===fe}function Mh(e,t){di=el=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Uh(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,nu(e,n)}}var rl={readContext:dt,useCallback:Le,useContext:Le,useEffect:Le,useImperativeHandle:Le,useInsertionEffect:Le,useLayoutEffect:Le,useMemo:Le,useReducer:Le,useRef:Le,useState:Le,useDebugValue:Le,useDeferredValue:Le,useTransition:Le,useMutableSource:Le,useSyncExternalStore:Le,useId:Le,unstable_isNewReconciler:!1},zS={readContext:dt,useCallback:function(e,t){return Vt().memoizedState=[e,t===void 0?null:t],e},useContext:dt,useEffect:xh,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,tl(4194308,4,Ch.bind(null,t,e),n)},useLayoutEffect:function(e,t){return tl(4194308,4,e,t)},useInsertionEffect:function(e,t){return tl(4,2,e,t)},useMemo:function(e,t){var n=Vt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Vt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=BS.bind(null,fe,e),[r.memoizedState,e]},useRef:function(e){var t=Vt();return e={current:e},t.memoizedState=e},useState:Nh,useDebugValue:nc,useDeferredValue:function(e){return Vt().memoizedState=e},useTransition:function(){var e=Nh(!1),t=e[0];return e=VS.bind(null,e[1]),Vt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=fe,o=Vt();if(ae){if(n===void 0)throw Error(H(407));n=n()}else{if(n=t(),Ne===null)throw Error(H(349));ur&30||Eh(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,xh(_h.bind(null,r,i,e),[e]),r.flags|=2048,gi(9,Sh.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Vt(),t=Ne.identifierPrefix;if(ae){var n=rn,r=nn;n=(r&~(1<<32-_t(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=pi++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=FS++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},HS={readContext:dt,useCallback:bh,useContext:dt,useEffect:tc,useImperativeHandle:Ah,useInsertionEffect:Th,useLayoutEffect:Ih,useMemo:Lh,useReducer:Ju,useRef:Oh,useState:function(){return Ju(hi)},useDebugValue:nc,useDeferredValue:function(e){var t=pt();return Dh(t,Ee.memoizedState,e)},useTransition:function(){var e=Ju(hi)[0],t=pt().memoizedState;return[e,t]},useMutableSource:vh,useSyncExternalStore:yh,useId:kh,unstable_isNewReconciler:!1},jS={readContext:dt,useCallback:bh,useContext:dt,useEffect:tc,useImperativeHandle:Ah,useInsertionEffect:Th,useLayoutEffect:Ih,useMemo:Lh,useReducer:ec,useRef:Oh,useState:function(){return ec(hi)},useDebugValue:nc,useDeferredValue:function(e){var t=pt();return Ee===null?t.memoizedState=e:Dh(t,Ee.memoizedState,e)},useTransition:function(){var e=ec(hi)[0],t=pt().memoizedState;return[e,t]},useMutableSource:vh,useSyncExternalStore:yh,useId:kh,unstable_isNewReconciler:!1};function eo(e,t){try{var n="",r=t;do n+=yE(r),r=r.return;while(r);var o=n}catch(i){o=`
43
43
  Error generating stack: `+i.message+`
44
- `+i.stack}return{value:e,source:t,stack:o,digest:null}}function rc(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function oc(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var WS=typeof WeakMap=="function"?WeakMap:Map;function Fh(e,t,n){n=sn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){cl||(cl=!0,Ec=r),oc(e,t)},n}function Vh(e,t,n){n=sn(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){oc(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){oc(e,t),typeof r!="function"&&(Dn===null?Dn=new Set([this]):Dn.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function Bh(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new WS;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=i_.bind(null,e,t,n),t.then(e,e))}function $h(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function zh(e,t,n,r,o){return e.mode&1?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=sn(-1,1),t.tag=2,bn(n,t,1))),n.lanes|=1),e)}var GS=Jt.ReactCurrentOwner,We=!1;function Fe(e,t,n,r){t.child=e===null?gh(t,null,n,r):Zr(t,e.child,n,r)}function Hh(e,t,n,r,o){n=n.render;var i=t.ref;return qr(t,o),r=qu(e,t,n,r,i,o),n=Zu(),e!==null&&!We?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,ln(e,t,o)):(ae&&n&&Lu(t),t.flags|=1,Fe(e,t,r,o),t.child)}function jh(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!xc(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,Wh(e,t,i,r,o)):(e=ml(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&o)){var s=i.memoizedProps;if(n=n.compare,n=n!==null?n:ti,n(s,r)&&e.ref===t.ref)return ln(e,t,o)}return t.flags|=1,e=Un(i,r),e.ref=t.ref,e.return=t,t.child=e}function Wh(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(ti(i,r)&&e.ref===t.ref)if(We=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&(We=!0);else return t.lanes=e.lanes,ln(e,t,o)}return ic(e,t,n,r,o)}function Gh(e,t,n){var r=t.pendingProps,o=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},oe(no,it),it|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,oe(no,it),it|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,oe(no,it),it|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,oe(no,it),it|=r;return Fe(e,t,o,n),t.child}function Yh(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function ic(e,t,n,r,o){var i=je(n)?or:be.current;return i=Gr(t,i),qr(t,o),n=qu(e,t,n,r,i,o),r=Zu(),e!==null&&!We?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,ln(e,t,o)):(ae&&r&&Lu(t),t.flags|=1,Fe(e,t,n,o),t.child)}function Kh(e,t,n,r,o){if(je(n)){var i=!0;$s(t)}else i=!1;if(qr(t,o),t.stateNode===null)il(e,t),fh(t,n,r),ju(t,n,r,o),r=!0;else if(e===null){var s=t.stateNode,l=t.memoizedProps;s.props=l;var a=s.context,u=n.contextType;typeof u=="object"&&u!==null?u=dt(u):(u=je(n)?or:be.current,u=Gr(t,u));var c=n.getDerivedStateFromProps,f=typeof c=="function"||typeof s.getSnapshotBeforeUpdate=="function";f||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==r||a!==u)&&dh(t,s,r,u),An=!1;var p=t.memoizedState;s.state=p,Qs(t,r,s,o),a=t.memoizedState,l!==r||p!==a||He.current||An?(typeof c=="function"&&(Hu(t,n,c,r),a=t.memoizedState),(l=An||ch(t,n,l,r,p,a,u))?(f||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=a),s.props=r,s.state=a,s.context=u,r=l):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,sh(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:Nt(t.type,l),s.props=u,f=t.pendingProps,p=s.context,a=n.contextType,typeof a=="object"&&a!==null?a=dt(a):(a=je(n)?or:be.current,a=Gr(t,a));var h=n.getDerivedStateFromProps;(c=typeof h=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==f||p!==a)&&dh(t,s,r,a),An=!1,p=t.memoizedState,s.state=p,Qs(t,r,s,o);var v=t.memoizedState;l!==f||p!==v||He.current||An?(typeof h=="function"&&(Hu(t,n,h,r),v=t.memoizedState),(u=An||ch(t,n,u,r,p,v,a)||!1)?(c||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,v,a),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,v,a)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=v),s.props=r,s.state=v,s.context=a,r=u):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),r=!1)}return sc(e,t,n,r,i,o)}function sc(e,t,n,r,o,i){Yh(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&Zp(t,n,!1),ln(e,t,i);r=t.stateNode,GS.current=t;var l=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=Zr(t,e.child,null,i),t.child=Zr(t,null,l,i)):Fe(e,t,l,i),t.memoizedState=r.state,o&&Zp(t,n,!0),t.child}function Qh(e){var t=e.stateNode;t.pendingContext?Xp(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Xp(e,t.context,!1),Wu(e,t.containerInfo)}function Xh(e,t,n,r,o){return Qr(),Mu(o),t.flags|=256,Fe(e,t,n,r),t.child}var lc={dehydrated:null,treeContext:null,retryLane:0};function ac(e){return{baseLanes:e,cachePool:null,transitions:null}}function qh(e,t,n){var r=t.pendingProps,o=ce.current,i=!1,s=(t.flags&128)!==0,l;if((l=s)||(l=e!==null&&e.memoizedState===null?!1:(o&2)!==0),l?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),oe(ce,o&1),e===null)return Pu(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=r.children,e=r.fallback,i?(r=t.mode,i=t.child,s={mode:"hidden",children:s},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=s):i=vl(s,r,0,null),e=hr(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=ac(n),t.memoizedState=lc,e):uc(t,s));if(o=e.memoizedState,o!==null&&(l=o.dehydrated,l!==null))return YS(e,t,s,r,l,o,n);if(i){i=r.fallback,s=t.mode,o=e.child,l=o.sibling;var a={mode:"hidden",children:r.children};return!(s&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=a,t.deletions=null):(r=Un(o,a),r.subtreeFlags=o.subtreeFlags&14680064),l!==null?i=Un(l,i):(i=hr(i,s,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,s=e.child.memoizedState,s=s===null?ac(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~n,t.memoizedState=lc,r}return i=e.child,e=i.sibling,r=Un(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function uc(e,t){return t=vl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function ol(e,t,n,r){return r!==null&&Mu(r),Zr(t,e.child,null,n),e=uc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function YS(e,t,n,r,o,i,s){if(n)return t.flags&256?(t.flags&=-257,r=rc(Error(H(422))),ol(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=vl({mode:"visible",children:r.children},o,0,null),i=hr(i,o,s,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&Zr(t,e.child,null,s),t.child.memoizedState=ac(s),t.memoizedState=lc,i);if(!(t.mode&1))return ol(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,i=Error(H(419)),r=rc(i,r,void 0),ol(e,t,s,r)}if(l=(s&e.childLanes)!==0,We||l){if(r=Ne,r!==null){switch(s&-s){case 4:o=2;break;case 16:o=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:o=32;break;case 536870912:o=268435456;break;default:o=0}o=o&(r.suspendedLanes|s)?0:o,o!==0&&o!==i.retryLane&&(i.retryLane=o,on(e,o),Tt(r,e,o,-1))}return Oc(),r=rc(Error(H(421))),ol(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=s_.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,ot=xn(o.nextSibling),rt=t,ae=!0,Rt=null,e!==null&&(ct[ft++]=nn,ct[ft++]=rn,ct[ft++]=ir,nn=e.id,rn=e.overflow,ir=t),t=uc(t,r.children),t.flags|=4096,t)}function Zh(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Bu(e.return,t,n)}function cc(e,t,n,r,o){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function Jh(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(Fe(e,t,r.children,n),r=ce.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Zh(e,n,t);else if(e.tag===19)Zh(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(oe(ce,r),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&Zs(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),cc(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&Zs(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}cc(t,!0,n,null,i);break;case"together":cc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function il(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function ln(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),cr|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(H(153));if(t.child!==null){for(e=t.child,n=Un(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Un(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function KS(e,t,n){switch(t.tag){case 3:Qh(t),Qr();break;case 5:mh(t);break;case 1:je(t.type)&&$s(t);break;case 4:Wu(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;oe(Gs,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(oe(ce,ce.current&1),t.flags|=128,null):n&t.child.childLanes?qh(e,t,n):(oe(ce,ce.current&1),e=ln(e,t,n),e!==null?e.sibling:null);oe(ce,ce.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Jh(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),oe(ce,ce.current),r)break;return null;case 22:case 23:return t.lanes=0,Gh(e,t,n)}return ln(e,t,n)}var eg,fc,tg,ng;eg=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},fc=function(){},tg=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,ar(Vt.current);var i=null;switch(n){case"input":o=Ba(e,o),r=Ba(e,r),i=[];break;case"select":o=ue({},o,{value:void 0}),r=ue({},r,{value:void 0}),i=[];break;case"textarea":o=Ha(e,o),r=Ha(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Fs)}Wa(n,r);var s;n=null;for(u in o)if(!r.hasOwnProperty(u)&&o.hasOwnProperty(u)&&o[u]!=null)if(u==="style"){var l=o[u];for(s in l)l.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(ko.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var a=r[u];if(l=o!=null?o[u]:void 0,r.hasOwnProperty(u)&&a!==l&&(a!=null||l!=null))if(u==="style")if(l){for(s in l)!l.hasOwnProperty(s)||a&&a.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in a)a.hasOwnProperty(s)&&l[s]!==a[s]&&(n||(n={}),n[s]=a[s])}else n||(i||(i=[]),i.push(u,n)),n=a;else u==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,l=l?l.__html:void 0,a!=null&&l!==a&&(i=i||[]).push(u,a)):u==="children"?typeof a!="string"&&typeof a!="number"||(i=i||[]).push(u,""+a):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(ko.hasOwnProperty(u)?(a!=null&&u==="onScroll"&&se("scroll",e),i||l===a||(i=[])):(i=i||[]).push(u,a))}n&&(i=i||[]).push("style",n);var u=i;(t.updateQueue=u)&&(t.flags|=4)}},ng=function(e,t,n,r){n!==r&&(t.flags|=4)};function mi(e,t){if(!ae)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function De(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function QS(e,t,n){var r=t.pendingProps;switch(Du(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return De(t),null;case 1:return je(t.type)&&Bs(),De(t),null;case 3:return r=t.stateNode,Jr(),le(He),le(be),Ku(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Ws(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Rt!==null&&(wc(Rt),Rt=null))),fc(e,t),De(t),null;case 5:Gu(t);var o=ar(fi.current);if(n=t.type,e!==null&&t.stateNode!=null)tg(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(H(166));return De(t),null}if(e=ar(Vt.current),Ws(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Ft]=t,r[si]=i,e=(t.mode&1)!==0,n){case"dialog":se("cancel",r),se("close",r);break;case"iframe":case"object":case"embed":se("load",r);break;case"video":case"audio":for(o=0;o<ri.length;o++)se(ri[o],r);break;case"source":se("error",r);break;case"img":case"image":case"link":se("error",r),se("load",r);break;case"details":se("toggle",r);break;case"input":Pd(r,i),se("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},se("invalid",r);break;case"textarea":Fd(r,i),se("invalid",r)}Wa(n,i),o=null;for(var s in i)if(i.hasOwnProperty(s)){var l=i[s];s==="children"?typeof l=="string"?r.textContent!==l&&(i.suppressHydrationWarning!==!0&&Us(r.textContent,l,e),o=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&Us(r.textContent,l,e),o=["children",""+l]):ko.hasOwnProperty(s)&&l!=null&&s==="onScroll"&&se("scroll",r)}switch(n){case"input":hs(r),Ud(r,i,!0);break;case"textarea":hs(r),Bd(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=Fs)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=$d(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[Ft]=t,e[si]=r,eg(e,t,!1,!1),t.stateNode=e;e:{switch(s=Ga(n,r),n){case"dialog":se("cancel",e),se("close",e),o=r;break;case"iframe":case"object":case"embed":se("load",e),o=r;break;case"video":case"audio":for(o=0;o<ri.length;o++)se(ri[o],e);o=r;break;case"source":se("error",e),o=r;break;case"img":case"image":case"link":se("error",e),se("load",e),o=r;break;case"details":se("toggle",e),o=r;break;case"input":Pd(e,r),o=Ba(e,r),se("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=ue({},r,{value:void 0}),se("invalid",e);break;case"textarea":Fd(e,r),o=Ha(e,r),se("invalid",e);break;default:o=r}Wa(n,o),l=o;for(i in l)if(l.hasOwnProperty(i)){var a=l[i];i==="style"?jd(e,a):i==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&zd(e,a)):i==="children"?typeof a=="string"?(n!=="textarea"||a!=="")&&Fo(e,a):typeof a=="number"&&Fo(e,""+a):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(ko.hasOwnProperty(i)?a!=null&&i==="onScroll"&&se("scroll",e):a!=null&&Ca(e,i,a,s))}switch(n){case"input":hs(e),Ud(e,r,!1);break;case"textarea":hs(e),Bd(e);break;case"option":r.value!=null&&e.setAttribute("value",""+En(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?kr(e,!!r.multiple,i,!1):r.defaultValue!=null&&kr(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Fs)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return De(t),null;case 6:if(e&&t.stateNode!=null)ng(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(H(166));if(n=ar(fi.current),ar(Vt.current),Ws(t)){if(r=t.stateNode,n=t.memoizedProps,r[Ft]=t,(i=r.nodeValue!==n)&&(e=rt,e!==null))switch(e.tag){case 3:Us(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Us(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Ft]=t,t.stateNode=r}return De(t),null;case 13:if(le(ce),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ae&&ot!==null&&t.mode&1&&!(t.flags&128))oh(),Qr(),t.flags|=98560,i=!1;else if(i=Ws(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(H(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(H(317));i[Ft]=t}else Qr(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;De(t),i=!1}else Rt!==null&&(wc(Rt),Rt=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||ce.current&1?Se===0&&(Se=3):Oc())),t.updateQueue!==null&&(t.flags|=4),De(t),null);case 4:return Jr(),fc(e,t),e===null&&oi(t.stateNode.containerInfo),De(t),null;case 10:return Vu(t.type._context),De(t),null;case 17:return je(t.type)&&Bs(),De(t),null;case 19:if(le(ce),i=t.memoizedState,i===null)return De(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)mi(i,!1);else{if(Se!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=Zs(e),s!==null){for(t.flags|=128,mi(i,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,s=i.alternate,s===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,e=s.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return oe(ce,ce.current&1|2),t.child}e=e.sibling}i.tail!==null&&me()>ro&&(t.flags|=128,r=!0,mi(i,!1),t.lanes=4194304)}else{if(!r)if(e=Zs(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),mi(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!ae)return De(t),null}else 2*me()-i.renderingStartTime>ro&&n!==1073741824&&(t.flags|=128,r=!0,mi(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(n=i.last,n!==null?n.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=me(),t.sibling=null,n=ce.current,oe(ce,r?n&1|2:n&1),t):(De(t),null);case 22:case 23:return Nc(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?it&1073741824&&(De(t),t.subtreeFlags&6&&(t.flags|=8192)):De(t),null;case 24:return null;case 25:return null}throw Error(H(156,t.tag))}function XS(e,t){switch(Du(t),t.tag){case 1:return je(t.type)&&Bs(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Jr(),le(He),le(be),Ku(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Gu(t),null;case 13:if(le(ce),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(H(340));Qr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return le(ce),null;case 4:return Jr(),null;case 10:return Vu(t.type._context),null;case 22:case 23:return Nc(),null;case 24:return null;default:return null}}var sl=!1,ke=!1,qS=typeof WeakSet=="function"?WeakSet:Set,W=null;function to(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){pe(e,t,r)}else n.current=null}function dc(e,t,n){try{n()}catch(r){pe(e,t,r)}}var rg=!1;function ZS(e,t){if(Nu=xs,e=kp(),mu(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,l=-1,a=-1,u=0,c=0,f=e,p=null;t:for(;;){for(var h;f!==n||o!==0&&f.nodeType!==3||(l=s+o),f!==i||r!==0&&f.nodeType!==3||(a=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(h=f.firstChild)!==null;)p=f,f=h;for(;;){if(f===e)break t;if(p===n&&++u===o&&(l=s),p===i&&++c===r&&(a=s),(h=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=h}n=l===-1||a===-1?null:{start:l,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ou={focusedElem:e,selectionRange:n},xs=!1,W=t;W!==null;)if(t=W,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,W=e;else for(;W!==null;){t=W;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var m=v.memoizedProps,E=v.memoizedState,d=t.stateNode,g=d.getSnapshotBeforeUpdate(t.elementType===t.type?m:Nt(t.type,m),E);d.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(H(163))}}catch(S){pe(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,W=e;break}W=t.return}return v=rg,rg=!1,v}function vi(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&dc(t,n,i)}o=o.next}while(o!==r)}}function ll(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function pc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function og(e){var t=e.alternate;t!==null&&(e.alternate=null,og(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ft],delete t[si],delete t[Cu],delete t[kS],delete t[PS])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function ig(e){return e.tag===5||e.tag===3||e.tag===4}function sg(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ig(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function hc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Fs));else if(r!==4&&(e=e.child,e!==null))for(hc(e,t,n),e=e.sibling;e!==null;)hc(e,t,n),e=e.sibling}function gc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(gc(e,t,n),e=e.sibling;e!==null;)gc(e,t,n),e=e.sibling}var Te=null,Ot=!1;function Ln(e,t,n){for(n=n.child;n!==null;)lg(e,t,n),n=n.sibling}function lg(e,t,n){if(Ut&&typeof Ut.onCommitFiberUnmount=="function")try{Ut.onCommitFiberUnmount(Ss,n)}catch{}switch(n.tag){case 5:ke||to(n,t);case 6:var r=Te,o=Ot;Te=null,Ln(e,t,n),Te=r,Ot=o,Te!==null&&(Ot?(e=Te,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Te.removeChild(n.stateNode));break;case 18:Te!==null&&(Ot?(e=Te,n=n.stateNode,e.nodeType===8?Iu(e.parentNode,n):e.nodeType===1&&Iu(e,n),Qo(e)):Iu(Te,n.stateNode));break;case 4:r=Te,o=Ot,Te=n.stateNode.containerInfo,Ot=!0,Ln(e,t,n),Te=r,Ot=o;break;case 0:case 11:case 14:case 15:if(!ke&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&dc(n,t,s),o=o.next}while(o!==r)}Ln(e,t,n);break;case 1:if(!ke&&(to(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){pe(n,t,l)}Ln(e,t,n);break;case 21:Ln(e,t,n);break;case 22:n.mode&1?(ke=(r=ke)||n.memoizedState!==null,Ln(e,t,n),ke=r):Ln(e,t,n);break;default:Ln(e,t,n)}}function ag(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new qS),t.forEach(function(r){var o=l_.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function xt(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var i=e,s=t,l=s;e:for(;l!==null;){switch(l.tag){case 5:Te=l.stateNode,Ot=!1;break e;case 3:Te=l.stateNode.containerInfo,Ot=!0;break e;case 4:Te=l.stateNode.containerInfo,Ot=!0;break e}l=l.return}if(Te===null)throw Error(H(160));lg(i,s,o),Te=null,Ot=!1;var a=o.alternate;a!==null&&(a.return=null),o.return=null}catch(u){pe(o,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)ug(t,e),t=t.sibling}function ug(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(xt(t,e),$t(e),r&4){try{vi(3,e,e.return),ll(3,e)}catch(m){pe(e,e.return,m)}try{vi(5,e,e.return)}catch(m){pe(e,e.return,m)}}break;case 1:xt(t,e),$t(e),r&512&&n!==null&&to(n,n.return);break;case 5:if(xt(t,e),$t(e),r&512&&n!==null&&to(n,n.return),e.flags&32){var o=e.stateNode;try{Fo(o,"")}catch(m){pe(e,e.return,m)}}if(r&4&&(o=e.stateNode,o!=null)){var i=e.memoizedProps,s=n!==null?n.memoizedProps:i,l=e.type,a=e.updateQueue;if(e.updateQueue=null,a!==null)try{l==="input"&&i.type==="radio"&&i.name!=null&&Md(o,i),Ga(l,s);var u=Ga(l,i);for(s=0;s<a.length;s+=2){var c=a[s],f=a[s+1];c==="style"?jd(o,f):c==="dangerouslySetInnerHTML"?zd(o,f):c==="children"?Fo(o,f):Ca(o,c,f,u)}switch(l){case"input":$a(o,i);break;case"textarea":Vd(o,i);break;case"select":var p=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var h=i.value;h!=null?kr(o,!!i.multiple,h,!1):p!==!!i.multiple&&(i.defaultValue!=null?kr(o,!!i.multiple,i.defaultValue,!0):kr(o,!!i.multiple,i.multiple?[]:"",!1))}o[si]=i}catch(m){pe(e,e.return,m)}}break;case 6:if(xt(t,e),$t(e),r&4){if(e.stateNode===null)throw Error(H(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(m){pe(e,e.return,m)}}break;case 3:if(xt(t,e),$t(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Qo(t.containerInfo)}catch(m){pe(e,e.return,m)}break;case 4:xt(t,e),$t(e);break;case 13:xt(t,e),$t(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(yc=me())),r&4&&ag(e);break;case 22:if(c=n!==null&&n.memoizedState!==null,e.mode&1?(ke=(u=ke)||c,xt(t,e),ke=u):xt(t,e),$t(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!c&&e.mode&1)for(W=e,c=e.child;c!==null;){for(f=W=c;W!==null;){switch(p=W,h=p.child,p.tag){case 0:case 11:case 14:case 15:vi(4,p,p.return);break;case 1:to(p,p.return);var v=p.stateNode;if(typeof v.componentWillUnmount=="function"){r=p,n=p.return;try{t=r,v.props=t.memoizedProps,v.state=t.memoizedState,v.componentWillUnmount()}catch(m){pe(r,n,m)}}break;case 5:to(p,p.return);break;case 22:if(p.memoizedState!==null){dg(f);continue}}h!==null?(h.return=p,W=h):dg(f)}c=c.sibling}e:for(c=null,f=e;;){if(f.tag===5){if(c===null){c=f;try{o=f.stateNode,u?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(l=f.stateNode,a=f.memoizedProps.style,s=a!=null&&a.hasOwnProperty("display")?a.display:null,l.style.display=Hd("display",s))}catch(m){pe(e,e.return,m)}}}else if(f.tag===6){if(c===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(m){pe(e,e.return,m)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;c===f&&(c=null),f=f.return}c===f&&(c=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:xt(t,e),$t(e),r&4&&ag(e);break;case 21:break;default:xt(t,e),$t(e)}}function $t(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(ig(n)){var r=n;break e}n=n.return}throw Error(H(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(Fo(o,""),r.flags&=-33);var i=sg(e);gc(e,i,o);break;case 3:case 4:var s=r.stateNode.containerInfo,l=sg(e);hc(e,l,s);break;default:throw Error(H(161))}}catch(a){pe(e,e.return,a)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function JS(e,t,n){W=e,cg(e)}function cg(e,t,n){for(var r=(e.mode&1)!==0;W!==null;){var o=W,i=o.child;if(o.tag===22&&r){var s=o.memoizedState!==null||sl;if(!s){var l=o.alternate,a=l!==null&&l.memoizedState!==null||ke;l=sl;var u=ke;if(sl=s,(ke=a)&&!u)for(W=o;W!==null;)s=W,a=s.child,s.tag===22&&s.memoizedState!==null?pg(o):a!==null?(a.return=s,W=a):pg(o);for(;i!==null;)W=i,cg(i),i=i.sibling;W=o,sl=l,ke=u}fg(e)}else o.subtreeFlags&8772&&i!==null?(i.return=o,W=i):fg(e)}}function fg(e){for(;W!==null;){var t=W;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:ke||ll(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!ke)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:Nt(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&ah(t,i,r);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}ah(t,s,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var a=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break;case"img":a.src&&(n.src=a.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var c=u.memoizedState;if(c!==null){var f=c.dehydrated;f!==null&&Qo(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(H(163))}ke||t.flags&512&&pc(t)}catch(p){pe(t,t.return,p)}}if(t===e){W=null;break}if(n=t.sibling,n!==null){n.return=t.return,W=n;break}W=t.return}}function dg(e){for(;W!==null;){var t=W;if(t===e){W=null;break}var n=t.sibling;if(n!==null){n.return=t.return,W=n;break}W=t.return}}function pg(e){for(;W!==null;){var t=W;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{ll(4,t)}catch(a){pe(t,n,a)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(a){pe(t,o,a)}}var i=t.return;try{pc(t)}catch(a){pe(t,i,a)}break;case 5:var s=t.return;try{pc(t)}catch(a){pe(t,s,a)}}}catch(a){pe(t,t.return,a)}if(t===e){W=null;break}var l=t.sibling;if(l!==null){l.return=t.return,W=l;break}W=t.return}}var e_=Math.ceil,al=Jt.ReactCurrentDispatcher,mc=Jt.ReactCurrentOwner,ht=Jt.ReactCurrentBatchConfig,te=0,Ne=null,ve=null,Ie=0,it=0,no=Tn(0),Se=0,yi=null,cr=0,ul=0,vc=0,Ei=null,Ge=null,yc=0,ro=1/0,an=null,cl=!1,Ec=null,Dn=null,fl=!1,kn=null,dl=0,Si=0,Sc=null,pl=-1,hl=0;function Ve(){return te&6?me():pl!==-1?pl:pl=me()}function Pn(e){return e.mode&1?te&2&&Ie!==0?Ie&-Ie:US.transition!==null?(hl===0&&(hl=ip()),hl):(e=re,e!==0||(e=window.event,e=e===void 0?16:hp(e.type)),e):1}function Tt(e,t,n,r){if(50<Si)throw Si=0,Sc=null,Error(H(185));jo(e,n,r),(!(te&2)||e!==Ne)&&(e===Ne&&(!(te&2)&&(ul|=n),Se===4&&Mn(e,Ie)),Ye(e,r),n===1&&te===0&&!(t.mode&1)&&(ro=me()+500,zs&&Cn()))}function Ye(e,t){var n=e.callbackNode;UE(e,t);var r=Rs(e,e===Ne?Ie:0);if(r===0)n!==null&&np(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&np(n),t===1)e.tag===0?MS(gg.bind(null,e)):Jp(gg.bind(null,e)),LS(function(){!(te&6)&&Cn()}),n=null;else{switch(sp(r)){case 1:n=Ja;break;case 4:n=rp;break;case 16:n=Es;break;case 536870912:n=op;break;default:n=Es}n=Rg(n,hg.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function hg(e,t){if(pl=-1,hl=0,te&6)throw Error(H(327));var n=e.callbackNode;if(oo()&&e.callbackNode!==n)return null;var r=Rs(e,e===Ne?Ie:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=gl(e,r);else{t=r;var o=te;te|=2;var i=vg();(Ne!==e||Ie!==t)&&(an=null,ro=me()+500,dr(e,t));do try{r_();break}catch(l){mg(e,l)}while(1);Fu(),al.current=i,te=o,ve!==null?t=0:(Ne=null,Ie=0,t=Se)}if(t!==0){if(t===2&&(o=eu(e),o!==0&&(r=o,t=_c(e,o))),t===1)throw n=yi,dr(e,0),Mn(e,r),Ye(e,me()),n;if(t===6)Mn(e,r);else{if(o=e.current.alternate,!(r&30)&&!t_(o)&&(t=gl(e,r),t===2&&(i=eu(e),i!==0&&(r=i,t=_c(e,i))),t===1))throw n=yi,dr(e,0),Mn(e,r),Ye(e,me()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(H(345));case 2:pr(e,Ge,an);break;case 3:if(Mn(e,r),(r&130023424)===r&&(t=yc+500-me(),10<t)){if(Rs(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){Ve(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Tu(pr.bind(null,e,Ge,an),t);break}pr(e,Ge,an);break;case 4:if(Mn(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-_t(r);i=1<<s,s=t[s],s>o&&(o=s),r&=~i}if(r=o,r=me()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*e_(r/1960))-r,10<r){e.timeoutHandle=Tu(pr.bind(null,e,Ge,an),r);break}pr(e,Ge,an);break;case 5:pr(e,Ge,an);break;default:throw Error(H(329))}}}return Ye(e,me()),e.callbackNode===n?hg.bind(null,e):null}function _c(e,t){var n=Ei;return e.current.memoizedState.isDehydrated&&(dr(e,t).flags|=256),e=gl(e,t),e!==2&&(t=Ge,Ge=n,t!==null&&wc(t)),e}function wc(e){Ge===null?Ge=e:Ge.push.apply(Ge,e)}function t_(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var o=n[r],i=o.getSnapshot;o=o.value;try{if(!wt(i(),o))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Mn(e,t){for(t&=~vc,t&=~ul,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-_t(t),r=1<<n;e[n]=-1,t&=~r}}function gg(e){if(te&6)throw Error(H(327));oo();var t=Rs(e,0);if(!(t&1))return Ye(e,me()),null;var n=gl(e,t);if(e.tag!==0&&n===2){var r=eu(e);r!==0&&(t=r,n=_c(e,r))}if(n===1)throw n=yi,dr(e,0),Mn(e,t),Ye(e,me()),n;if(n===6)throw Error(H(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,pr(e,Ge,an),Ye(e,me()),null}function Rc(e,t){var n=te;te|=1;try{return e(t)}finally{te=n,te===0&&(ro=me()+500,zs&&Cn())}}function fr(e){kn!==null&&kn.tag===0&&!(te&6)&&oo();var t=te;te|=1;var n=ht.transition,r=re;try{if(ht.transition=null,re=1,e)return e()}finally{re=r,ht.transition=n,te=t,!(te&6)&&Cn()}}function Nc(){it=no.current,le(no)}function dr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,bS(n)),ve!==null)for(n=ve.return;n!==null;){var r=n;switch(Du(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Bs();break;case 3:Jr(),le(He),le(be),Ku();break;case 5:Gu(r);break;case 4:Jr();break;case 13:le(ce);break;case 19:le(ce);break;case 10:Vu(r.type._context);break;case 22:case 23:Nc()}n=n.return}if(Ne=e,ve=e=Un(e.current,null),Ie=it=t,Se=0,yi=null,vc=ul=cr=0,Ge=Ei=null,lr!==null){for(t=0;t<lr.length;t++)if(n=lr[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,i=n.pending;if(i!==null){var s=i.next;i.next=o,r.next=s}n.pending=r}lr=null}return e}function mg(e,t){do{var n=ve;try{if(Fu(),Js.current=rl,el){for(var r=fe.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}el=!1}if(ur=0,Re=Ee=fe=null,di=!1,pi=0,mc.current=null,n===null||n.return===null){Se=1,yi=t,ve=null;break}e:{var i=e,s=n.return,l=n,a=t;if(t=Ie,l.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){var u=a,c=l,f=c.tag;if(!(c.mode&1)&&(f===0||f===11||f===15)){var p=c.alternate;p?(c.updateQueue=p.updateQueue,c.memoizedState=p.memoizedState,c.lanes=p.lanes):(c.updateQueue=null,c.memoizedState=null)}var h=$h(s);if(h!==null){h.flags&=-257,zh(h,s,l,i,t),h.mode&1&&Bh(i,u,t),t=h,a=u;var v=t.updateQueue;if(v===null){var m=new Set;m.add(a),t.updateQueue=m}else v.add(a);break e}else{if(!(t&1)){Bh(i,u,t),Oc();break e}a=Error(H(426))}}else if(ae&&l.mode&1){var E=$h(s);if(E!==null){!(E.flags&65536)&&(E.flags|=256),zh(E,s,l,i,t),Mu(eo(a,l));break e}}i=a=eo(a,l),Se!==4&&(Se=2),Ei===null?Ei=[i]:Ei.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var d=Fh(i,a,t);lh(i,d);break e;case 1:l=a;var g=i.type,y=i.stateNode;if(!(i.flags&128)&&(typeof g.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(Dn===null||!Dn.has(y)))){i.flags|=65536,t&=-t,i.lanes|=t;var S=Vh(i,l,t);lh(i,S);break e}}i=i.return}while(i!==null)}Eg(n)}catch(w){t=w,ve===n&&n!==null&&(ve=n=n.return);continue}break}while(1)}function vg(){var e=al.current;return al.current=rl,e===null?rl:e}function Oc(){(Se===0||Se===3||Se===2)&&(Se=4),Ne===null||!(cr&268435455)&&!(ul&268435455)||Mn(Ne,Ie)}function gl(e,t){var n=te;te|=2;var r=vg();(Ne!==e||Ie!==t)&&(an=null,dr(e,t));do try{n_();break}catch(o){mg(e,o)}while(1);if(Fu(),te=n,al.current=r,ve!==null)throw Error(H(261));return Ne=null,Ie=0,Se}function n_(){for(;ve!==null;)yg(ve)}function r_(){for(;ve!==null&&!IE();)yg(ve)}function yg(e){var t=wg(e.alternate,e,it);e.memoizedProps=e.pendingProps,t===null?Eg(e):ve=t,mc.current=null}function Eg(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=XS(n,t),n!==null){n.flags&=32767,ve=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Se=6,ve=null;return}}else if(n=QS(n,t,it),n!==null){ve=n;return}if(t=t.sibling,t!==null){ve=t;return}ve=t=e}while(t!==null);Se===0&&(Se=5)}function pr(e,t,n){var r=re,o=ht.transition;try{ht.transition=null,re=1,o_(e,t,n,r)}finally{ht.transition=o,re=r}return null}function o_(e,t,n,r){do oo();while(kn!==null);if(te&6)throw Error(H(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(H(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(FE(e,i),e===Ne&&(ve=Ne=null,Ie=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||fl||(fl=!0,Rg(Es,function(){return oo(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=ht.transition,ht.transition=null;var s=re;re=1;var l=te;te|=4,mc.current=null,ZS(e,n),ug(n,e),NS(Ou),xs=!!Nu,Ou=Nu=null,e.current=n,JS(n),CE(),te=l,re=s,ht.transition=i}else e.current=n;if(fl&&(fl=!1,kn=e,dl=o),i=e.pendingLanes,i===0&&(Dn=null),LE(n.stateNode),Ye(e,me()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(cl)throw cl=!1,e=Ec,Ec=null,e;return dl&1&&e.tag!==0&&oo(),i=e.pendingLanes,i&1?e===Sc?Si++:(Si=0,Sc=e):Si=0,Cn(),null}function oo(){if(kn!==null){var e=sp(dl),t=ht.transition,n=re;try{if(ht.transition=null,re=16>e?16:e,kn===null)var r=!1;else{if(e=kn,kn=null,dl=0,te&6)throw Error(H(331));var o=te;for(te|=4,W=e.current;W!==null;){var i=W,s=i.child;if(W.flags&16){var l=i.deletions;if(l!==null){for(var a=0;a<l.length;a++){var u=l[a];for(W=u;W!==null;){var c=W;switch(c.tag){case 0:case 11:case 15:vi(8,c,i)}var f=c.child;if(f!==null)f.return=c,W=f;else for(;W!==null;){c=W;var p=c.sibling,h=c.return;if(og(c),c===u){W=null;break}if(p!==null){p.return=h,W=p;break}W=h}}}var v=i.alternate;if(v!==null){var m=v.child;if(m!==null){v.child=null;do{var E=m.sibling;m.sibling=null,m=E}while(m!==null)}}W=i}}if(i.subtreeFlags&2064&&s!==null)s.return=i,W=s;else e:for(;W!==null;){if(i=W,i.flags&2048)switch(i.tag){case 0:case 11:case 15:vi(9,i,i.return)}var d=i.sibling;if(d!==null){d.return=i.return,W=d;break e}W=i.return}}var g=e.current;for(W=g;W!==null;){s=W;var y=s.child;if(s.subtreeFlags&2064&&y!==null)y.return=s,W=y;else e:for(s=g;W!==null;){if(l=W,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:ll(9,l)}}catch(w){pe(l,l.return,w)}if(l===s){W=null;break e}var S=l.sibling;if(S!==null){S.return=l.return,W=S;break e}W=l.return}}if(te=o,Cn(),Ut&&typeof Ut.onPostCommitFiberRoot=="function")try{Ut.onPostCommitFiberRoot(Ss,e)}catch{}r=!0}return r}finally{re=n,ht.transition=t}}return!1}function Sg(e,t,n){t=eo(n,t),t=Fh(e,t,1),e=bn(e,t,1),t=Ve(),e!==null&&(jo(e,1,t),Ye(e,t))}function pe(e,t,n){if(e.tag===3)Sg(e,e,n);else for(;t!==null;){if(t.tag===3){Sg(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Dn===null||!Dn.has(r))){e=eo(n,e),e=Vh(t,e,1),t=bn(t,e,1),e=Ve(),t!==null&&(jo(t,1,e),Ye(t,e));break}}t=t.return}}function i_(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Ve(),e.pingedLanes|=e.suspendedLanes&n,Ne===e&&(Ie&n)===n&&(Se===4||Se===3&&(Ie&130023424)===Ie&&500>me()-yc?dr(e,0):vc|=n),Ye(e,t)}function _g(e,t){t===0&&(e.mode&1?(t=ws,ws<<=1,!(ws&130023424)&&(ws=4194304)):t=1);var n=Ve();e=on(e,t),e!==null&&(jo(e,t,n),Ye(e,n))}function s_(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),_g(e,n)}function l_(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(H(314))}r!==null&&r.delete(t),_g(e,n)}var wg;wg=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||He.current)We=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return We=!1,KS(e,t,n);We=!!(e.flags&131072)}else We=!1,ae&&t.flags&1048576&&eh(t,js,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;il(e,t),e=t.pendingProps;var o=Gr(t,be.current);qr(t,n),o=qu(null,t,r,e,o,n);var i=Zu();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,je(r)?(i=!0,$s(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,zu(t),o.updater=Xs,t.stateNode=o,o._reactInternals=t,ju(t,r,e,n),t=sc(null,t,r,!0,i,n)):(t.tag=0,ae&&i&&Lu(t),Fe(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(il(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=u_(r),e=Nt(r,e),o){case 0:t=ic(null,t,r,e,n);break e;case 1:t=Kh(null,t,r,e,n);break e;case 11:t=Hh(null,t,r,e,n);break e;case 14:t=jh(null,t,r,Nt(r.type,e),n);break e}throw Error(H(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Nt(r,o),ic(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Nt(r,o),Kh(e,t,r,o,n);case 3:e:{if(Qh(t),e===null)throw Error(H(387));r=t.pendingProps,i=t.memoizedState,o=i.element,sh(e,t),Qs(t,r,null,n);var s=t.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=eo(Error(H(423)),t),t=Xh(e,t,r,n,o);break e}else if(r!==o){o=eo(Error(H(424)),t),t=Xh(e,t,r,n,o);break e}else for(ot=xn(t.stateNode.containerInfo.firstChild),rt=t,ae=!0,Rt=null,n=gh(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Qr(),r===o){t=ln(e,t,n);break e}Fe(e,t,r,n)}t=t.child}return t;case 5:return mh(t),e===null&&Pu(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,xu(r,o)?s=null:i!==null&&xu(r,i)&&(t.flags|=32),Yh(e,t),Fe(e,t,s,n),t.child;case 6:return e===null&&Pu(t),null;case 13:return qh(e,t,n);case 4:return Wu(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Zr(t,null,r,n):Fe(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Nt(r,o),Hh(e,t,r,o,n);case 7:return Fe(e,t,t.pendingProps,n),t.child;case 8:return Fe(e,t,t.pendingProps.children,n),t.child;case 12:return Fe(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value,oe(Gs,r._currentValue),r._currentValue=s,i!==null)if(wt(i.value,s)){if(i.children===o.children&&!He.current){t=ln(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){s=i.child;for(var a=l.firstContext;a!==null;){if(a.context===r){if(i.tag===1){a=sn(-1,n&-n),a.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?a.next=a:(a.next=c.next,c.next=a),u.pending=a}}i.lanes|=n,a=i.alternate,a!==null&&(a.lanes|=n),Bu(i.return,n,t),l.lanes|=n;break}a=a.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(H(341));s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),Bu(s,n,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}Fe(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,qr(t,n),o=dt(o),r=r(o),t.flags|=1,Fe(e,t,r,n),t.child;case 14:return r=t.type,o=Nt(r,t.pendingProps),o=Nt(r.type,o),jh(e,t,r,o,n);case 15:return Wh(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Nt(r,o),il(e,t),t.tag=1,je(r)?(e=!0,$s(t)):e=!1,qr(t,n),fh(t,r,o),ju(t,r,o,n),sc(null,t,r,!0,e,n);case 19:return Jh(e,t,n);case 22:return Gh(e,t,n)}throw Error(H(156,t.tag))};function Rg(e,t){return tp(e,t)}function a_(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function gt(e,t,n,r){return new a_(e,t,n,r)}function xc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function u_(e){if(typeof e=="function")return xc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===La)return 11;if(e===Pa)return 14}return 2}function Un(e,t){var n=e.alternate;return n===null?(n=gt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function ml(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")xc(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Dr:return hr(n.children,o,i,t);case Aa:s=8,o|=8;break;case ba:return e=gt(12,n,t,o|2),e.elementType=ba,e.lanes=i,e;case Da:return e=gt(13,n,t,o),e.elementType=Da,e.lanes=i,e;case ka:return e=gt(19,n,t,o),e.elementType=ka,e.lanes=i,e;case bd:return vl(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Cd:s=10;break e;case Ad:s=9;break e;case La:s=11;break e;case Pa:s=14;break e;case yn:s=16,r=null;break e}throw Error(H(130,e==null?e:typeof e,""))}return t=gt(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function hr(e,t,n,r){return e=gt(7,e,r,t),e.lanes=n,e}function vl(e,t,n,r){return e=gt(22,e,r,t),e.elementType=bd,e.lanes=n,e.stateNode={isHidden:!1},e}function Tc(e,t,n){return e=gt(6,e,null,t),e.lanes=n,e}function Ic(e,t,n){return t=gt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function c_(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=tu(0),this.expirationTimes=tu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=tu(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Cc(e,t,n,r,o,i,s,l,a){return e=new c_(e,t,n,l,a),t===1?(t=1,i===!0&&(t|=8)):t=0,i=gt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},zu(i),e}function f_(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Lr,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Ng(e){if(!e)return In;e=e._reactInternals;e:{if(nr(e)!==e||e.tag!==1)throw Error(H(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(je(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(H(171))}if(e.tag===1){var n=e.type;if(je(n))return qp(e,n,t)}return t}function Og(e,t,n,r,o,i,s,l,a){return e=Cc(n,r,!0,e,o,i,s,l,a),e.context=Ng(null),n=e.current,r=Ve(),o=Pn(n),i=sn(r,o),i.callback=t??null,bn(n,i,o),e.current.lanes=o,jo(e,o,r),Ye(e,r),e}function yl(e,t,n,r){var o=t.current,i=Ve(),s=Pn(o);return n=Ng(n),t.context===null?t.context=n:t.pendingContext=n,t=sn(i,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=bn(o,t,s),e!==null&&(Tt(e,o,s,i),Ks(e,o,s)),s}function El(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function xg(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Ac(e,t){xg(e,t),(e=e.alternate)&&xg(e,t)}function d_(){return null}var Tg=typeof reportError=="function"?reportError:function(e){console.error(e)};function bc(e){this._internalRoot=e}Sl.prototype.render=bc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(H(409));yl(e,t,null,null)},Sl.prototype.unmount=bc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;fr(function(){yl(null,e,null,null)}),t[en]=null}};function Sl(e){this._internalRoot=e}Sl.prototype.unstable_scheduleHydration=function(e){if(e){var t=up();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Rn.length&&t!==0&&t<Rn[n].priority;n++);Rn.splice(n,0,e),n===0&&dp(e)}};function Lc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function _l(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Ig(){}function p_(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var u=El(s);i.call(u)}}var s=Og(t,r,e,0,null,!1,!1,"",Ig);return e._reactRootContainer=s,e[en]=s.current,oi(e.nodeType===8?e.parentNode:e),fr(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var l=r;r=function(){var u=El(a);l.call(u)}}var a=Cc(e,0,!1,null,null,!1,!1,"",Ig);return e._reactRootContainer=a,e[en]=a.current,oi(e.nodeType===8?e.parentNode:e),fr(function(){yl(t,a,n,r)}),a}function wl(e,t,n,r,o){var i=n._reactRootContainer;if(i){var s=i;if(typeof o=="function"){var l=o;o=function(){var a=El(s);l.call(a)}}yl(t,s,e,o)}else s=p_(n,t,e,o,r);return El(s)}lp=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Ho(t.pendingLanes);n!==0&&(nu(t,n|1),Ye(t,me()),!(te&6)&&(ro=me()+500,Cn()))}break;case 13:fr(function(){var r=on(e,1);if(r!==null){var o=Ve();Tt(r,e,1,o)}}),Ac(e,1)}},ru=function(e){if(e.tag===13){var t=on(e,134217728);if(t!==null){var n=Ve();Tt(t,e,134217728,n)}Ac(e,134217728)}},ap=function(e){if(e.tag===13){var t=Pn(e),n=on(e,t);if(n!==null){var r=Ve();Tt(n,e,t,r)}Ac(e,t)}},up=function(){return re},cp=function(e,t){var n=re;try{return re=e,t()}finally{re=n}},Qa=function(e,t,n){switch(t){case"input":if($a(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=Vs(r);if(!o)throw Error(H(90));kd(r),$a(r,o)}}}break;case"textarea":Vd(e,n);break;case"select":t=n.value,t!=null&&kr(e,!!n.multiple,t,!1)}},Kd=Rc,Qd=fr;var h_={usingClientEntryPoint:!1,Events:[li,jr,Vs,Gd,Yd,Rc]},_i={findFiberByHostInstance:rr,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},g_={bundleType:_i.bundleType,version:_i.version,rendererPackageName:_i.rendererPackageName,rendererConfig:_i.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Jt.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Jd(e),e===null?null:e.stateNode},findFiberByHostInstance:_i.findFiberByHostInstance||d_,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Rl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Rl.isDisabled&&Rl.supportsFiber)try{Ss=Rl.inject(g_),Ut=Rl}catch{}}et.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=h_,et.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Lc(t))throw Error(H(200));return f_(e,t,null,n)},et.createRoot=function(e,t){if(!Lc(e))throw Error(H(299));var n=!1,r="",o=Tg;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Cc(e,1,!1,null,null,n,!1,r,o),e[en]=t.current,oi(e.nodeType===8?e.parentNode:e),new bc(t)},et.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(H(188)):(e=Object.keys(e).join(","),Error(H(268,e)));return e=Jd(t),e=e===null?null:e.stateNode,e},et.flushSync=function(e){return fr(e)},et.hydrate=function(e,t,n){if(!_l(t))throw Error(H(200));return wl(null,e,t,!0,n)},et.hydrateRoot=function(e,t,n){if(!Lc(e))throw Error(H(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",s=Tg;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=Og(t,null,e,1,n??null,o,!1,i,s),e[en]=t.current,oi(e),r)for(e=0;e<r.length;e++)n=r[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new Sl(t)},et.render=function(e,t,n){if(!_l(t))throw Error(H(200));return wl(null,e,t,!1,n)},et.unmountComponentAtNode=function(e){if(!_l(e))throw Error(H(40));return e._reactRootContainer?(fr(function(){wl(null,null,e,!1,function(){e._reactRootContainer=null,e[en]=null})}),!0):!1},et.unstable_batchedUpdates=Rc,et.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!_l(n))throw Error(H(200));if(e==null||e._reactInternals===void 0)throw Error(H(38));return wl(e,t,n,!1,r)},et.version="18.2.0-next-9e3b772b8-20220608",function(e){function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(n){console.error(n)}}t(),e.exports=et}(dE);var Cg=Ar;Na.createRoot=Cg.createRoot,Na.hydrateRoot=Cg.hydrateRoot;var m_=Object.create,Dc=Object.defineProperty,v_=Object.getOwnPropertyDescriptor,y_=Object.getOwnPropertyNames,E_=Object.getPrototypeOf,S_=Object.prototype.hasOwnProperty,__=(e,t,n)=>t in e?Dc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,w_=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),R_=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of y_(t))!S_.call(e,o)&&o!==n&&Dc(e,o,{get:()=>t[o],enumerable:!(r=v_(t,o))||r.enumerable});return e},N_=(e,t,n)=>(n=e!=null?m_(E_(e)):{},R_(t||!e||!e.__esModule?Dc(n,"default",{value:e,enumerable:!0}):n,e)),Ag=(e,t,n)=>(__(e,typeof t!="symbol"?t+"":t,n),n),O_=w_((e,t)=>{(function(n,r){typeof define=="function"&&define.amd?define(r):typeof t=="object"&&t.exports?t.exports=r():n.log=r()})(e,function(){var n=function(){},r="undefined",o=typeof window!==r&&typeof window.navigator!==r&&/Trident\/|MSIE /.test(window.navigator.userAgent),i=["trace","debug","info","warn","error"];function s(E,d){var g=E[d];if(typeof g.bind=="function")return g.bind(E);try{return Function.prototype.bind.call(g,E)}catch{return function(){return Function.prototype.apply.apply(g,[E,arguments])}}}function l(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function a(E){return E==="debug"&&(E="log"),typeof console===r?!1:E==="trace"&&o?l:console[E]!==void 0?s(console,E):console.log!==void 0?s(console,"log"):n}function u(E,d){for(var g=0;g<i.length;g++){var y=i[g];this[y]=g<E?n:this.methodFactory(y,E,d)}this.log=this.debug}function c(E,d,g){return function(){typeof console!==r&&(u.call(this,d,g),this[E].apply(this,arguments))}}function f(E,d,g){return a(E)||c.apply(this,arguments)}function p(E,d,g){var y=this,S;d=d??"WARN";var w="loglevel";typeof E=="string"?w+=":"+E:typeof E=="symbol"&&(w=void 0);function N(k){var B=(i[k]||"silent").toUpperCase();if(!(typeof window===r||!w)){try{window.localStorage[w]=B;return}catch{}try{window.document.cookie=encodeURIComponent(w)+"="+B+";"}catch{}}}function T(){var k;if(!(typeof window===r||!w)){try{k=window.localStorage[w]}catch{}if(typeof k===r)try{var B=window.document.cookie,F=B.indexOf(encodeURIComponent(w)+"=");F!==-1&&(k=/^([^;]+)/.exec(B.slice(F))[1])}catch{}return y.levels[k]===void 0&&(k=void 0),k}}function b(){if(!(typeof window===r||!w)){try{window.localStorage.removeItem(w);return}catch{}try{window.document.cookie=encodeURIComponent(w)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}y.name=E,y.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},y.methodFactory=g||f,y.getLevel=function(){return S},y.setLevel=function(k,B){if(typeof k=="string"&&y.levels[k.toUpperCase()]!==void 0&&(k=y.levels[k.toUpperCase()]),typeof k=="number"&&k>=0&&k<=y.levels.SILENT){if(S=k,B!==!1&&N(k),u.call(y,k,E),typeof console===r&&k<y.levels.SILENT)return"No console available for logging"}else throw"log.setLevel() called with invalid level: "+k},y.setDefaultLevel=function(k){d=k,T()||y.setLevel(k,!1)},y.resetLevel=function(){y.setLevel(d,!1),b()},y.enableAll=function(k){y.setLevel(y.levels.TRACE,k)},y.disableAll=function(k){y.setLevel(y.levels.SILENT,k)};var D=T();D==null&&(D=d),y.setLevel(D,!1)}var h=new p,v={};h.getLogger=function(E){if(typeof E!="symbol"&&typeof E!="string"||E==="")throw new TypeError("You must supply a name when creating a logger.");var d=v[E];return d||(d=v[E]=new p(E,h.getLevel(),h.methodFactory)),d};var m=typeof window!==r?window.log:void 0;return h.noConflict=function(){return typeof window!==r&&window.log===h&&(window.log=m),h},h.getLoggers=function(){return v},h.default=h,h})}),x_=N_(O_(),1),T_=()=>new Date().toISOString(),wi=x_.default.getLogger("signalwire"),I_=wi.methodFactory;wi.methodFactory=(e,t,n)=>{let r=I_(e,t,n);return function(...o){o.unshift(T_(),"-"),r(...o)}};var C_=wi.getLevel();wi.setLevel(C_);var It=()=>wi,A_=e=>({id:e.id,type:e.type,data:e.data,position:e.position}),b_=e=>({id:e.id,source:e.source,sourceHandle:e.sourceHandle,target:e.target,targetHandle:e.targetHandle}),bg=e=>{var t;return(t=e==null?void 0:e.trim())==null?void 0:t.toLowerCase()},Nl=e=>e.replace(/\s/g,""),L_={answer:({data:{maxDuration:e}})=>e?{answer:{max_duration:e}}:"answer",hangup:({data:{reason:e}})=>e?{hangup:{reason:e}}:"hangup",play:({data:{text:e,url:t,volume:n}})=>{let r=t||`say:${e||"Unknown TTS"}`;return n?{play:{volume:n,url:r}}:{play:{url:r}}},forwardAddress:({data:e})=>kc(e),forwardPhone:({data:e})=>kc(e),forwardResource:({data:e})=>kc(e),promptPlay:({data:e})=>{let t={play:"say:Unknown value"};e.text&&(t.play=`say:${e.text}`),e.url&&(t.play=e.url);let n=e.options.reduce((r,o)=>{let i=bg(o.command);i&&r.speechHints.push(i);let s=Nl(o.digit);return s&&(r.maxDigits=Math.max(r.maxDigits,s.length)),r},{speechHints:[],maxDigits:0});return n.speechHints.length&&(t.speech_hints=n.speechHints,t.speech_language="en-US"),n.maxDigits>1&&(t.max_digits=n.maxDigits),[{prompt:t},{switch:{variable:"prompt_result",case:{failed:[{play:"say:Error while gathering input."},"hangup"],no_input:[],no_match:[]},default:[{switch:{variable:"prompt_value",case:{},default:[]}}]}}]},handleCall:()=>"start",record:({data:e})=>[{record:{beep:e.beep,direction:e.direction,end_silence_timeout:e.endSilenceTimeout,format:e.format,initial_timeout:e.initialTimeout,input_sensitivity:e.inputSensitivity,stereo:e.stereo,terminators:e.terminators}},{if:{condition:"'${record_result}' == 'success'",then:[],else:[]}}],recordCallStart:({data:e})=>[{record_call:{beep:e.beep,control_id:e.controlId,direction:e.direction,end_silence_timeout:e.endSilenceTimeout,format:e.format,initial_timeout:e.initialTimeout,input_sensitivity:e.inputSensitivity,stereo:e.stereo,terminators:e.terminators}},{if:{condition:"'${record_result}' == 'success'",then:[],else:[]}}],recordCallStop:({data:e})=>({stop_record_call:e.controlId}),sendSms:({data:e})=>{let{fromNumber:t,toNumber:n,body:r}=e;return{send_sms:{from_number:Nl(t),to_number:Nl(n),body:r}}},set:({data:{variables:e}})=>{let t={};return e.forEach(({key:n,value:r})=>{t[n]=r}),{set:t}},unset:({data:{variables:e}})=>({unset:e.map(({key:t})=>t)}),request:({data:e})=>[{request:{url:e.url,method:e.method,timeout:e.timeout,connect_timeout:e.connectTimeout,save_variables:e.saveVariables,headers:e.headers&&Object.keys(e.headers).length?e.headers:void 0,body:e.body?e.body:void 0}},{if:{condition:"'${request_result}' === 'success'",then:[],else:[]}}],cond:()=>({cond:[]})},Ri=e=>{try{return L_[e.__type](e.node)}catch(t){throw It().error("Unknown Verb",e),t}},kc=({destinations:e,sessionTimeout:t,type:n})=>{let r=t&&t>0?t:void 0,o=e.map(s=>({from:"${call.from}",to:Nl(s),session_timeout:r}));if(!o.length)throw It().error("Invalid destinations",e),new Error("Invalid Destinations");let i={if:{condition:"'${connect_result}' == 'connected'",then:[],else:[{switch:{variable:"connect_failed_reason",case:{busy:[],noAnswer:[],decline:[],error:[]},default:["hangup"]}}]}};switch(n){case"single":return[{connect:o[0]},i];case"serial":return[{connect:{serial:o}},i];case"parallel":return[{connect:{parallel:o}},i];default:return It().warn(`The type '${n}' is not supported yet.`),[{connect:o[0]},i]}},D_=e=>{let t=It(),n=new Set,r=new Map,o=new Set,i=new Map([["main",[]]]),s=new Map,l="",a=y=>i.has(y),u=y=>o.has(y),c=y=>o.add(y);e.nodes.forEach(y=>{r.set(y.id,{node:y,children:[]}),y.type==="handleCall"&&(l=y.id)}),e.edges.forEach(y=>{let S=r.get(y.source),w=r.get(y.target);if(!S||!w)return t.warn("Invalid edge:",y);S.children.push(y.target),y.sourceHandle&&s.set(y.sourceHandle,w),n.has(y.target)&&i.set(y.target,[]),n.add(y.target)});let f=[...i.keys()],p=(y,S)=>{let w=s.get(S.id);if(w){let N=[];i.set(S.id,N),S.digit&&(y[S.digit]=N);let T=bg(S.command);T&&(y[T]=N);let b=a(w.node.id);if(b){let D={transfer:w.node.id};S.digit&&y[S.digit].push(D),T&&!y[T].includes(D)&&y[T].push(D)}E({sectionName:b?w.node.id:S.id,current:w})}return y},h=(y,S)=>{let w=s.get(S.id);if(w){let N=[];i.set(S.id,N),y[S.result]=N;let T=a(w.node.id);T&&y[S.result].push({transfer:w.node.id}),E({sectionName:T?w.node.id:S.id,current:w})}return y},v={then:(y,S)=>{if(S.result!=="success")return y;let w=s.get(S.id);if(w){let N=[];i.set(S.id,N),y=N;let T=a(w.node.id);T&&y.push({transfer:w.node.id}),E({sectionName:T?w.node.id:S.id,current:w})}return y},else:(y,S)=>{if(S.result==="success")return y;let w=s.get(S.id);if(w){let N=[];i.set(S.id,N),y=N;let T=a(w.node.id);T&&y.push({transfer:w.node.id}),E({sectionName:T?w.node.id:S.id,current:w})}return y}},m={options:(y,S)=>{let w=s.get(S.id),N={when:S.value,then:[]};if(w){let T=[];i.set(S.id,T),N.then=T;let b=a(w.node.id);b&&N.then.push({transfer:w.node.id}),y.push(N),E({sectionName:b?w.node.id:S.id,current:w})}return y},fallback:y=>{let S=s.get(y),w={else:[]};if(S){let N=[];i.set(y,N),w.else=N;let T=a(S.node.id);T&&w.else.push({transfer:S.node.id}),E({sectionName:T?S.node.id:y,current:S})}return w}},E=({sectionName:y,current:S})=>{var N,T,b;if(u(S.node.id))return;c(S.node.id);let w=i.get(y);if(!w){t.warn("Unknown section name:",y);return}switch(S.node.type){case"promptPlay":{let D=Ri({__type:S.node.type,node:S.node});if(!Array.isArray(D)){t.warn("Invalid gather node",D);return}(T=(N=S.node.data)==null?void 0:N.results)!=null&&T.length&&(D[1].switch.case={...D[1].switch.case,...S.node.data.results.reduce(h,{})}),D[1].switch.default[0].switch.case=S.node.data.options.reduce(p,{}),(b=D[1].switch.case)!=null&&b.no_match&&(D[1].switch.default[0].switch.default=D[1].switch.case.no_match),w.push(...D);return}case"cond":{let D=Ri({__type:S.node.type,node:S.node});D.cond=S.node.data.options.reduce(m.options,[]),D.cond.push(m.fallback(S.node.data.fallback)),w.push(D);return}case"forwardPhone":case"forwardAddress":case"forwardResource":{let D=Ri({__type:S.node.type,node:S.node});if(!Array.isArray(D)){t.warn("Invalid connect node",D);return}S.node.data.options.length&&(D[1].if.then=S.node.data.options.reduce(v.then,[]),D[1].if.else[0].switch.case=S.node.data.options.reduce(h,{})),w.push(...D);return}case"record":case"recordCallStart":case"request":{let D=Ri({__type:S.node.type,node:S.node});if(!Array.isArray(D)){t.warn("Invalid record node",D);return}D[1].if.then=S.node.data.options.reduce(v.then,[]),D[1].if.else=S.node.data.options.reduce(v.else,[]),w.push(...D);return}default:{let D=Ri({__type:S.node.type,node:S.node});S.node.type!=="handleCall"&&w.push(D),S.children.forEach(k=>{let B=r.get(k);if(!B)return t.warn("Invalid Child Node",k);let F=a(k);F&&w.push({transfer:k}),E({sectionName:F?k:y,current:B})});break}}},d=r.get(l);d&&E({sectionName:"main",current:d});let g={};return f.forEach(y=>{let S=i.get(y);S&&(g[y]=S)}),t.debug("sections",JSON.stringify(g)),{sections:g}},Lg=class extends Error{constructor(t,n){super(n),this.code=t,this.message=n,Ag(this,"name","AuthError"),Object.setPrototypeOf(this,Lg.prototype)}},Dg=class extends Error{constructor(e,t,n){super(t),this.code=e,this.message=t,this.response=n,Ag(this,"name","HttpError"),Object.setPrototypeOf(this,Dg.prototype)}};async function k_(e,t){let n=await fetch(e,t);if(!n.ok){if(n.status===401)throw new Lg(n.status,"Unauthorized");let r;try{r=await n.json()}catch{}let o=r!=null&&r.errors?JSON.stringify(r.errors):`Error Code: ${n.status}`;throw new Dg(n.status,o,r)}try{n.parsedBody=await n.json()}catch{}return n}var P_=({timeout:e=3e4,...t},n=k_)=>async(r,o)=>{let i={...o!=null&&o.body?{"Content-Type":"application/json"}:{},...t.headers,...o==null?void 0:o.headers},s=U_({...t,...o,headers:i});s.credentials="same-origin";let l;if(e){let a=new AbortController,u=a.signal;s.signal=u,l=setTimeout(()=>{a.abort()},e)}try{return{body:(await n(F_({url:r,searchParams:o==null?void 0:o.searchParams}),s)).parsedBody}}finally{l&&clearTimeout(l)}},M_=e=>typeof e=="string"?e:JSON.stringify(e),U_=e=>Object.entries(e).reduce((t,[n,r])=>n==="body"?{...t,body:M_(r)}:r!=null?{...t,[n]:r}:t,{}),F_=({url:e,searchParams:t})=>{let n=new URL(e);return t&&Object.entries(t).forEach(([r,o])=>{o!=null&&n.searchParams.append(r,o)}),n.toString()},V_=e=>{let t=It(),n=P_(e);return{getFlow:async()=>{var r;try{let{body:o}=await n(e.getFlowURL);switch(t.info("getFlow",o),(r=o==null?void 0:o.flow_data)==null?void 0:r.builderVersion){default:return o}}catch{return t.error("Could not load flow. URL:",e.getFlowURL),{}}},putFlow:async r=>{let o={type:"call_flow",document_version:r.documentVersion+1,flow_data:{builderVersion:r.builderVersion,nodes:r.nodes.map(A_),edges:r.edges.map(b_)},relayml:D_({nodes:r.nodes,edges:r.edges})},i=await n(e.updateFlowURL,{method:"PUT",body:o});return t.info("putFlow",i.body),i.body}}};function Ke(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=Ke(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}const kg=e=>{let t;const n=new Set,r=(a,u)=>{const c=typeof a=="function"?a(t):a;if(!Object.is(c,t)){const f=t;t=u??typeof c!="object"?c:Object.assign({},t,c),n.forEach(p=>p(t,f))}},o=()=>t,l={setState:r,getState:o,subscribe:a=>(n.add(a),()=>n.delete(a)),destroy:()=>{var a;((a={VITE_BASE_URL:"",VITE_BASIC_AUTH:"signalwire:1aG93uXk",VITE_DEFAULT_STYLE_HREF:"https://cdn.swire.io/npm/@signalwire/cfb@dev/dist/style.css",BASE_URL:"/cfb/",MODE:"staging",DEV:!1,PROD:!0,SSR:!1})==null?void 0:a.MODE)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return t=e(r,o,l),l},Pg=e=>e?kg(e):kg;var Pc={},B_={get exports(){return Pc},set exports(e){Pc=e}},Mg={},Mc={},$_={get exports(){return Mc},set exports(e){Mc=e}},Ug={};/**
44
+ `+i.stack}return{value:e,source:t,stack:o,digest:null}}function rc(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function oc(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var WS=typeof WeakMap=="function"?WeakMap:Map;function Fh(e,t,n){n=sn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){cl||(cl=!0,Ec=r),oc(e,t)},n}function Vh(e,t,n){n=sn(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){oc(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){oc(e,t),typeof r!="function"&&(Dn===null?Dn=new Set([this]):Dn.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function Bh(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new WS;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=i_.bind(null,e,t,n),t.then(e,e))}function $h(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function zh(e,t,n,r,o){return e.mode&1?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=sn(-1,1),t.tag=2,bn(n,t,1))),n.lanes|=1),e)}var GS=Jt.ReactCurrentOwner,We=!1;function Fe(e,t,n,r){t.child=e===null?gh(t,null,n,r):Zr(t,e.child,n,r)}function Hh(e,t,n,r,o){n=n.render;var i=t.ref;return qr(t,o),r=qu(e,t,n,r,i,o),n=Zu(),e!==null&&!We?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,ln(e,t,o)):(ae&&n&&Lu(t),t.flags|=1,Fe(e,t,r,o),t.child)}function jh(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!xc(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,Wh(e,t,i,r,o)):(e=ml(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&o)){var s=i.memoizedProps;if(n=n.compare,n=n!==null?n:ti,n(s,r)&&e.ref===t.ref)return ln(e,t,o)}return t.flags|=1,e=Un(i,r),e.ref=t.ref,e.return=t,t.child=e}function Wh(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(ti(i,r)&&e.ref===t.ref)if(We=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&(We=!0);else return t.lanes=e.lanes,ln(e,t,o)}return ic(e,t,n,r,o)}function Gh(e,t,n){var r=t.pendingProps,o=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},oe(no,it),it|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,oe(no,it),it|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,oe(no,it),it|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,oe(no,it),it|=r;return Fe(e,t,o,n),t.child}function Yh(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function ic(e,t,n,r,o){var i=je(n)?or:be.current;return i=Gr(t,i),qr(t,o),n=qu(e,t,n,r,i,o),r=Zu(),e!==null&&!We?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,ln(e,t,o)):(ae&&r&&Lu(t),t.flags|=1,Fe(e,t,n,o),t.child)}function Kh(e,t,n,r,o){if(je(n)){var i=!0;$s(t)}else i=!1;if(qr(t,o),t.stateNode===null)il(e,t),fh(t,n,r),ju(t,n,r,o),r=!0;else if(e===null){var s=t.stateNode,l=t.memoizedProps;s.props=l;var a=s.context,u=n.contextType;typeof u=="object"&&u!==null?u=dt(u):(u=je(n)?or:be.current,u=Gr(t,u));var c=n.getDerivedStateFromProps,f=typeof c=="function"||typeof s.getSnapshotBeforeUpdate=="function";f||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==r||a!==u)&&dh(t,s,r,u),An=!1;var p=t.memoizedState;s.state=p,Qs(t,r,s,o),a=t.memoizedState,l!==r||p!==a||He.current||An?(typeof c=="function"&&(Hu(t,n,c,r),a=t.memoizedState),(l=An||ch(t,n,l,r,p,a,u))?(f||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=a),s.props=r,s.state=a,s.context=u,r=l):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,sh(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:Nt(t.type,l),s.props=u,f=t.pendingProps,p=s.context,a=n.contextType,typeof a=="object"&&a!==null?a=dt(a):(a=je(n)?or:be.current,a=Gr(t,a));var h=n.getDerivedStateFromProps;(c=typeof h=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==f||p!==a)&&dh(t,s,r,a),An=!1,p=t.memoizedState,s.state=p,Qs(t,r,s,o);var v=t.memoizedState;l!==f||p!==v||He.current||An?(typeof h=="function"&&(Hu(t,n,h,r),v=t.memoizedState),(u=An||ch(t,n,u,r,p,v,a)||!1)?(c||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,v,a),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,v,a)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=v),s.props=r,s.state=v,s.context=a,r=u):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),r=!1)}return sc(e,t,n,r,i,o)}function sc(e,t,n,r,o,i){Yh(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&Zp(t,n,!1),ln(e,t,i);r=t.stateNode,GS.current=t;var l=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=Zr(t,e.child,null,i),t.child=Zr(t,null,l,i)):Fe(e,t,l,i),t.memoizedState=r.state,o&&Zp(t,n,!0),t.child}function Qh(e){var t=e.stateNode;t.pendingContext?Xp(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Xp(e,t.context,!1),Wu(e,t.containerInfo)}function Xh(e,t,n,r,o){return Qr(),Mu(o),t.flags|=256,Fe(e,t,n,r),t.child}var lc={dehydrated:null,treeContext:null,retryLane:0};function ac(e){return{baseLanes:e,cachePool:null,transitions:null}}function qh(e,t,n){var r=t.pendingProps,o=ce.current,i=!1,s=(t.flags&128)!==0,l;if((l=s)||(l=e!==null&&e.memoizedState===null?!1:(o&2)!==0),l?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),oe(ce,o&1),e===null)return Pu(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=r.children,e=r.fallback,i?(r=t.mode,i=t.child,s={mode:"hidden",children:s},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=s):i=vl(s,r,0,null),e=hr(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=ac(n),t.memoizedState=lc,e):uc(t,s));if(o=e.memoizedState,o!==null&&(l=o.dehydrated,l!==null))return YS(e,t,s,r,l,o,n);if(i){i=r.fallback,s=t.mode,o=e.child,l=o.sibling;var a={mode:"hidden",children:r.children};return!(s&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=a,t.deletions=null):(r=Un(o,a),r.subtreeFlags=o.subtreeFlags&14680064),l!==null?i=Un(l,i):(i=hr(i,s,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,s=e.child.memoizedState,s=s===null?ac(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~n,t.memoizedState=lc,r}return i=e.child,e=i.sibling,r=Un(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function uc(e,t){return t=vl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function ol(e,t,n,r){return r!==null&&Mu(r),Zr(t,e.child,null,n),e=uc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function YS(e,t,n,r,o,i,s){if(n)return t.flags&256?(t.flags&=-257,r=rc(Error(H(422))),ol(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=vl({mode:"visible",children:r.children},o,0,null),i=hr(i,o,s,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&Zr(t,e.child,null,s),t.child.memoizedState=ac(s),t.memoizedState=lc,i);if(!(t.mode&1))return ol(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,i=Error(H(419)),r=rc(i,r,void 0),ol(e,t,s,r)}if(l=(s&e.childLanes)!==0,We||l){if(r=Ne,r!==null){switch(s&-s){case 4:o=2;break;case 16:o=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:o=32;break;case 536870912:o=268435456;break;default:o=0}o=o&(r.suspendedLanes|s)?0:o,o!==0&&o!==i.retryLane&&(i.retryLane=o,on(e,o),Tt(r,e,o,-1))}return Oc(),r=rc(Error(H(421))),ol(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=s_.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,ot=xn(o.nextSibling),rt=t,ae=!0,Rt=null,e!==null&&(ct[ft++]=nn,ct[ft++]=rn,ct[ft++]=ir,nn=e.id,rn=e.overflow,ir=t),t=uc(t,r.children),t.flags|=4096,t)}function Zh(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Bu(e.return,t,n)}function cc(e,t,n,r,o){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function Jh(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(Fe(e,t,r.children,n),r=ce.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Zh(e,n,t);else if(e.tag===19)Zh(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(oe(ce,r),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&Zs(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),cc(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&Zs(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}cc(t,!0,n,null,i);break;case"together":cc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function il(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function ln(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),cr|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(H(153));if(t.child!==null){for(e=t.child,n=Un(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Un(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function KS(e,t,n){switch(t.tag){case 3:Qh(t),Qr();break;case 5:mh(t);break;case 1:je(t.type)&&$s(t);break;case 4:Wu(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;oe(Gs,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(oe(ce,ce.current&1),t.flags|=128,null):n&t.child.childLanes?qh(e,t,n):(oe(ce,ce.current&1),e=ln(e,t,n),e!==null?e.sibling:null);oe(ce,ce.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Jh(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),oe(ce,ce.current),r)break;return null;case 22:case 23:return t.lanes=0,Gh(e,t,n)}return ln(e,t,n)}var eg,fc,tg,ng;eg=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},fc=function(){},tg=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,ar(Ft.current);var i=null;switch(n){case"input":o=Ba(e,o),r=Ba(e,r),i=[];break;case"select":o=ue({},o,{value:void 0}),r=ue({},r,{value:void 0}),i=[];break;case"textarea":o=Ha(e,o),r=Ha(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Fs)}Wa(n,r);var s;n=null;for(u in o)if(!r.hasOwnProperty(u)&&o.hasOwnProperty(u)&&o[u]!=null)if(u==="style"){var l=o[u];for(s in l)l.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(ko.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var a=r[u];if(l=o!=null?o[u]:void 0,r.hasOwnProperty(u)&&a!==l&&(a!=null||l!=null))if(u==="style")if(l){for(s in l)!l.hasOwnProperty(s)||a&&a.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in a)a.hasOwnProperty(s)&&l[s]!==a[s]&&(n||(n={}),n[s]=a[s])}else n||(i||(i=[]),i.push(u,n)),n=a;else u==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,l=l?l.__html:void 0,a!=null&&l!==a&&(i=i||[]).push(u,a)):u==="children"?typeof a!="string"&&typeof a!="number"||(i=i||[]).push(u,""+a):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(ko.hasOwnProperty(u)?(a!=null&&u==="onScroll"&&se("scroll",e),i||l===a||(i=[])):(i=i||[]).push(u,a))}n&&(i=i||[]).push("style",n);var u=i;(t.updateQueue=u)&&(t.flags|=4)}},ng=function(e,t,n,r){n!==r&&(t.flags|=4)};function mi(e,t){if(!ae)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function De(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function QS(e,t,n){var r=t.pendingProps;switch(Du(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return De(t),null;case 1:return je(t.type)&&Bs(),De(t),null;case 3:return r=t.stateNode,Jr(),le(He),le(be),Ku(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Ws(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Rt!==null&&(wc(Rt),Rt=null))),fc(e,t),De(t),null;case 5:Gu(t);var o=ar(fi.current);if(n=t.type,e!==null&&t.stateNode!=null)tg(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(H(166));return De(t),null}if(e=ar(Ft.current),Ws(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Ut]=t,r[si]=i,e=(t.mode&1)!==0,n){case"dialog":se("cancel",r),se("close",r);break;case"iframe":case"object":case"embed":se("load",r);break;case"video":case"audio":for(o=0;o<ri.length;o++)se(ri[o],r);break;case"source":se("error",r);break;case"img":case"image":case"link":se("error",r),se("load",r);break;case"details":se("toggle",r);break;case"input":Pd(r,i),se("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},se("invalid",r);break;case"textarea":Fd(r,i),se("invalid",r)}Wa(n,i),o=null;for(var s in i)if(i.hasOwnProperty(s)){var l=i[s];s==="children"?typeof l=="string"?r.textContent!==l&&(i.suppressHydrationWarning!==!0&&Us(r.textContent,l,e),o=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&Us(r.textContent,l,e),o=["children",""+l]):ko.hasOwnProperty(s)&&l!=null&&s==="onScroll"&&se("scroll",r)}switch(n){case"input":hs(r),Ud(r,i,!0);break;case"textarea":hs(r),Bd(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=Fs)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=$d(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[Ut]=t,e[si]=r,eg(e,t,!1,!1),t.stateNode=e;e:{switch(s=Ga(n,r),n){case"dialog":se("cancel",e),se("close",e),o=r;break;case"iframe":case"object":case"embed":se("load",e),o=r;break;case"video":case"audio":for(o=0;o<ri.length;o++)se(ri[o],e);o=r;break;case"source":se("error",e),o=r;break;case"img":case"image":case"link":se("error",e),se("load",e),o=r;break;case"details":se("toggle",e),o=r;break;case"input":Pd(e,r),o=Ba(e,r),se("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=ue({},r,{value:void 0}),se("invalid",e);break;case"textarea":Fd(e,r),o=Ha(e,r),se("invalid",e);break;default:o=r}Wa(n,o),l=o;for(i in l)if(l.hasOwnProperty(i)){var a=l[i];i==="style"?jd(e,a):i==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&zd(e,a)):i==="children"?typeof a=="string"?(n!=="textarea"||a!=="")&&Fo(e,a):typeof a=="number"&&Fo(e,""+a):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(ko.hasOwnProperty(i)?a!=null&&i==="onScroll"&&se("scroll",e):a!=null&&Ca(e,i,a,s))}switch(n){case"input":hs(e),Ud(e,r,!1);break;case"textarea":hs(e),Bd(e);break;case"option":r.value!=null&&e.setAttribute("value",""+En(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?kr(e,!!r.multiple,i,!1):r.defaultValue!=null&&kr(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Fs)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return De(t),null;case 6:if(e&&t.stateNode!=null)ng(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(H(166));if(n=ar(fi.current),ar(Ft.current),Ws(t)){if(r=t.stateNode,n=t.memoizedProps,r[Ut]=t,(i=r.nodeValue!==n)&&(e=rt,e!==null))switch(e.tag){case 3:Us(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Us(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Ut]=t,t.stateNode=r}return De(t),null;case 13:if(le(ce),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ae&&ot!==null&&t.mode&1&&!(t.flags&128))oh(),Qr(),t.flags|=98560,i=!1;else if(i=Ws(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(H(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(H(317));i[Ut]=t}else Qr(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;De(t),i=!1}else Rt!==null&&(wc(Rt),Rt=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||ce.current&1?Se===0&&(Se=3):Oc())),t.updateQueue!==null&&(t.flags|=4),De(t),null);case 4:return Jr(),fc(e,t),e===null&&oi(t.stateNode.containerInfo),De(t),null;case 10:return Vu(t.type._context),De(t),null;case 17:return je(t.type)&&Bs(),De(t),null;case 19:if(le(ce),i=t.memoizedState,i===null)return De(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)mi(i,!1);else{if(Se!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=Zs(e),s!==null){for(t.flags|=128,mi(i,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,s=i.alternate,s===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,e=s.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return oe(ce,ce.current&1|2),t.child}e=e.sibling}i.tail!==null&&me()>ro&&(t.flags|=128,r=!0,mi(i,!1),t.lanes=4194304)}else{if(!r)if(e=Zs(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),mi(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!ae)return De(t),null}else 2*me()-i.renderingStartTime>ro&&n!==1073741824&&(t.flags|=128,r=!0,mi(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(n=i.last,n!==null?n.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=me(),t.sibling=null,n=ce.current,oe(ce,r?n&1|2:n&1),t):(De(t),null);case 22:case 23:return Nc(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?it&1073741824&&(De(t),t.subtreeFlags&6&&(t.flags|=8192)):De(t),null;case 24:return null;case 25:return null}throw Error(H(156,t.tag))}function XS(e,t){switch(Du(t),t.tag){case 1:return je(t.type)&&Bs(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Jr(),le(He),le(be),Ku(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Gu(t),null;case 13:if(le(ce),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(H(340));Qr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return le(ce),null;case 4:return Jr(),null;case 10:return Vu(t.type._context),null;case 22:case 23:return Nc(),null;case 24:return null;default:return null}}var sl=!1,ke=!1,qS=typeof WeakSet=="function"?WeakSet:Set,W=null;function to(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){pe(e,t,r)}else n.current=null}function dc(e,t,n){try{n()}catch(r){pe(e,t,r)}}var rg=!1;function ZS(e,t){if(Nu=xs,e=kp(),mu(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,l=-1,a=-1,u=0,c=0,f=e,p=null;t:for(;;){for(var h;f!==n||o!==0&&f.nodeType!==3||(l=s+o),f!==i||r!==0&&f.nodeType!==3||(a=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(h=f.firstChild)!==null;)p=f,f=h;for(;;){if(f===e)break t;if(p===n&&++u===o&&(l=s),p===i&&++c===r&&(a=s),(h=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=h}n=l===-1||a===-1?null:{start:l,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ou={focusedElem:e,selectionRange:n},xs=!1,W=t;W!==null;)if(t=W,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,W=e;else for(;W!==null;){t=W;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var m=v.memoizedProps,E=v.memoizedState,d=t.stateNode,g=d.getSnapshotBeforeUpdate(t.elementType===t.type?m:Nt(t.type,m),E);d.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(H(163))}}catch(S){pe(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,W=e;break}W=t.return}return v=rg,rg=!1,v}function vi(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&dc(t,n,i)}o=o.next}while(o!==r)}}function ll(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function pc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function og(e){var t=e.alternate;t!==null&&(e.alternate=null,og(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ut],delete t[si],delete t[Cu],delete t[kS],delete t[PS])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function ig(e){return e.tag===5||e.tag===3||e.tag===4}function sg(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ig(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function hc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Fs));else if(r!==4&&(e=e.child,e!==null))for(hc(e,t,n),e=e.sibling;e!==null;)hc(e,t,n),e=e.sibling}function gc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(gc(e,t,n),e=e.sibling;e!==null;)gc(e,t,n),e=e.sibling}var Te=null,Ot=!1;function Ln(e,t,n){for(n=n.child;n!==null;)lg(e,t,n),n=n.sibling}function lg(e,t,n){if(Mt&&typeof Mt.onCommitFiberUnmount=="function")try{Mt.onCommitFiberUnmount(Ss,n)}catch{}switch(n.tag){case 5:ke||to(n,t);case 6:var r=Te,o=Ot;Te=null,Ln(e,t,n),Te=r,Ot=o,Te!==null&&(Ot?(e=Te,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Te.removeChild(n.stateNode));break;case 18:Te!==null&&(Ot?(e=Te,n=n.stateNode,e.nodeType===8?Iu(e.parentNode,n):e.nodeType===1&&Iu(e,n),Qo(e)):Iu(Te,n.stateNode));break;case 4:r=Te,o=Ot,Te=n.stateNode.containerInfo,Ot=!0,Ln(e,t,n),Te=r,Ot=o;break;case 0:case 11:case 14:case 15:if(!ke&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&dc(n,t,s),o=o.next}while(o!==r)}Ln(e,t,n);break;case 1:if(!ke&&(to(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){pe(n,t,l)}Ln(e,t,n);break;case 21:Ln(e,t,n);break;case 22:n.mode&1?(ke=(r=ke)||n.memoizedState!==null,Ln(e,t,n),ke=r):Ln(e,t,n);break;default:Ln(e,t,n)}}function ag(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new qS),t.forEach(function(r){var o=l_.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function xt(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var i=e,s=t,l=s;e:for(;l!==null;){switch(l.tag){case 5:Te=l.stateNode,Ot=!1;break e;case 3:Te=l.stateNode.containerInfo,Ot=!0;break e;case 4:Te=l.stateNode.containerInfo,Ot=!0;break e}l=l.return}if(Te===null)throw Error(H(160));lg(i,s,o),Te=null,Ot=!1;var a=o.alternate;a!==null&&(a.return=null),o.return=null}catch(u){pe(o,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)ug(t,e),t=t.sibling}function ug(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(xt(t,e),Bt(e),r&4){try{vi(3,e,e.return),ll(3,e)}catch(m){pe(e,e.return,m)}try{vi(5,e,e.return)}catch(m){pe(e,e.return,m)}}break;case 1:xt(t,e),Bt(e),r&512&&n!==null&&to(n,n.return);break;case 5:if(xt(t,e),Bt(e),r&512&&n!==null&&to(n,n.return),e.flags&32){var o=e.stateNode;try{Fo(o,"")}catch(m){pe(e,e.return,m)}}if(r&4&&(o=e.stateNode,o!=null)){var i=e.memoizedProps,s=n!==null?n.memoizedProps:i,l=e.type,a=e.updateQueue;if(e.updateQueue=null,a!==null)try{l==="input"&&i.type==="radio"&&i.name!=null&&Md(o,i),Ga(l,s);var u=Ga(l,i);for(s=0;s<a.length;s+=2){var c=a[s],f=a[s+1];c==="style"?jd(o,f):c==="dangerouslySetInnerHTML"?zd(o,f):c==="children"?Fo(o,f):Ca(o,c,f,u)}switch(l){case"input":$a(o,i);break;case"textarea":Vd(o,i);break;case"select":var p=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var h=i.value;h!=null?kr(o,!!i.multiple,h,!1):p!==!!i.multiple&&(i.defaultValue!=null?kr(o,!!i.multiple,i.defaultValue,!0):kr(o,!!i.multiple,i.multiple?[]:"",!1))}o[si]=i}catch(m){pe(e,e.return,m)}}break;case 6:if(xt(t,e),Bt(e),r&4){if(e.stateNode===null)throw Error(H(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(m){pe(e,e.return,m)}}break;case 3:if(xt(t,e),Bt(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Qo(t.containerInfo)}catch(m){pe(e,e.return,m)}break;case 4:xt(t,e),Bt(e);break;case 13:xt(t,e),Bt(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(yc=me())),r&4&&ag(e);break;case 22:if(c=n!==null&&n.memoizedState!==null,e.mode&1?(ke=(u=ke)||c,xt(t,e),ke=u):xt(t,e),Bt(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!c&&e.mode&1)for(W=e,c=e.child;c!==null;){for(f=W=c;W!==null;){switch(p=W,h=p.child,p.tag){case 0:case 11:case 14:case 15:vi(4,p,p.return);break;case 1:to(p,p.return);var v=p.stateNode;if(typeof v.componentWillUnmount=="function"){r=p,n=p.return;try{t=r,v.props=t.memoizedProps,v.state=t.memoizedState,v.componentWillUnmount()}catch(m){pe(r,n,m)}}break;case 5:to(p,p.return);break;case 22:if(p.memoizedState!==null){dg(f);continue}}h!==null?(h.return=p,W=h):dg(f)}c=c.sibling}e:for(c=null,f=e;;){if(f.tag===5){if(c===null){c=f;try{o=f.stateNode,u?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(l=f.stateNode,a=f.memoizedProps.style,s=a!=null&&a.hasOwnProperty("display")?a.display:null,l.style.display=Hd("display",s))}catch(m){pe(e,e.return,m)}}}else if(f.tag===6){if(c===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(m){pe(e,e.return,m)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;c===f&&(c=null),f=f.return}c===f&&(c=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:xt(t,e),Bt(e),r&4&&ag(e);break;case 21:break;default:xt(t,e),Bt(e)}}function Bt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(ig(n)){var r=n;break e}n=n.return}throw Error(H(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(Fo(o,""),r.flags&=-33);var i=sg(e);gc(e,i,o);break;case 3:case 4:var s=r.stateNode.containerInfo,l=sg(e);hc(e,l,s);break;default:throw Error(H(161))}}catch(a){pe(e,e.return,a)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function JS(e,t,n){W=e,cg(e)}function cg(e,t,n){for(var r=(e.mode&1)!==0;W!==null;){var o=W,i=o.child;if(o.tag===22&&r){var s=o.memoizedState!==null||sl;if(!s){var l=o.alternate,a=l!==null&&l.memoizedState!==null||ke;l=sl;var u=ke;if(sl=s,(ke=a)&&!u)for(W=o;W!==null;)s=W,a=s.child,s.tag===22&&s.memoizedState!==null?pg(o):a!==null?(a.return=s,W=a):pg(o);for(;i!==null;)W=i,cg(i),i=i.sibling;W=o,sl=l,ke=u}fg(e)}else o.subtreeFlags&8772&&i!==null?(i.return=o,W=i):fg(e)}}function fg(e){for(;W!==null;){var t=W;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:ke||ll(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!ke)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:Nt(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&ah(t,i,r);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}ah(t,s,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var a=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break;case"img":a.src&&(n.src=a.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var c=u.memoizedState;if(c!==null){var f=c.dehydrated;f!==null&&Qo(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(H(163))}ke||t.flags&512&&pc(t)}catch(p){pe(t,t.return,p)}}if(t===e){W=null;break}if(n=t.sibling,n!==null){n.return=t.return,W=n;break}W=t.return}}function dg(e){for(;W!==null;){var t=W;if(t===e){W=null;break}var n=t.sibling;if(n!==null){n.return=t.return,W=n;break}W=t.return}}function pg(e){for(;W!==null;){var t=W;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{ll(4,t)}catch(a){pe(t,n,a)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(a){pe(t,o,a)}}var i=t.return;try{pc(t)}catch(a){pe(t,i,a)}break;case 5:var s=t.return;try{pc(t)}catch(a){pe(t,s,a)}}}catch(a){pe(t,t.return,a)}if(t===e){W=null;break}var l=t.sibling;if(l!==null){l.return=t.return,W=l;break}W=t.return}}var e_=Math.ceil,al=Jt.ReactCurrentDispatcher,mc=Jt.ReactCurrentOwner,ht=Jt.ReactCurrentBatchConfig,te=0,Ne=null,ve=null,Ie=0,it=0,no=Tn(0),Se=0,yi=null,cr=0,ul=0,vc=0,Ei=null,Ge=null,yc=0,ro=1/0,an=null,cl=!1,Ec=null,Dn=null,fl=!1,kn=null,dl=0,Si=0,Sc=null,pl=-1,hl=0;function Ve(){return te&6?me():pl!==-1?pl:pl=me()}function Pn(e){return e.mode&1?te&2&&Ie!==0?Ie&-Ie:US.transition!==null?(hl===0&&(hl=ip()),hl):(e=re,e!==0||(e=window.event,e=e===void 0?16:hp(e.type)),e):1}function Tt(e,t,n,r){if(50<Si)throw Si=0,Sc=null,Error(H(185));jo(e,n,r),(!(te&2)||e!==Ne)&&(e===Ne&&(!(te&2)&&(ul|=n),Se===4&&Mn(e,Ie)),Ye(e,r),n===1&&te===0&&!(t.mode&1)&&(ro=me()+500,zs&&Cn()))}function Ye(e,t){var n=e.callbackNode;UE(e,t);var r=Rs(e,e===Ne?Ie:0);if(r===0)n!==null&&np(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&np(n),t===1)e.tag===0?MS(gg.bind(null,e)):Jp(gg.bind(null,e)),LS(function(){!(te&6)&&Cn()}),n=null;else{switch(sp(r)){case 1:n=Ja;break;case 4:n=rp;break;case 16:n=Es;break;case 536870912:n=op;break;default:n=Es}n=Rg(n,hg.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function hg(e,t){if(pl=-1,hl=0,te&6)throw Error(H(327));var n=e.callbackNode;if(oo()&&e.callbackNode!==n)return null;var r=Rs(e,e===Ne?Ie:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=gl(e,r);else{t=r;var o=te;te|=2;var i=vg();(Ne!==e||Ie!==t)&&(an=null,ro=me()+500,dr(e,t));do try{r_();break}catch(l){mg(e,l)}while(1);Fu(),al.current=i,te=o,ve!==null?t=0:(Ne=null,Ie=0,t=Se)}if(t!==0){if(t===2&&(o=eu(e),o!==0&&(r=o,t=_c(e,o))),t===1)throw n=yi,dr(e,0),Mn(e,r),Ye(e,me()),n;if(t===6)Mn(e,r);else{if(o=e.current.alternate,!(r&30)&&!t_(o)&&(t=gl(e,r),t===2&&(i=eu(e),i!==0&&(r=i,t=_c(e,i))),t===1))throw n=yi,dr(e,0),Mn(e,r),Ye(e,me()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(H(345));case 2:pr(e,Ge,an);break;case 3:if(Mn(e,r),(r&130023424)===r&&(t=yc+500-me(),10<t)){if(Rs(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){Ve(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Tu(pr.bind(null,e,Ge,an),t);break}pr(e,Ge,an);break;case 4:if(Mn(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-_t(r);i=1<<s,s=t[s],s>o&&(o=s),r&=~i}if(r=o,r=me()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*e_(r/1960))-r,10<r){e.timeoutHandle=Tu(pr.bind(null,e,Ge,an),r);break}pr(e,Ge,an);break;case 5:pr(e,Ge,an);break;default:throw Error(H(329))}}}return Ye(e,me()),e.callbackNode===n?hg.bind(null,e):null}function _c(e,t){var n=Ei;return e.current.memoizedState.isDehydrated&&(dr(e,t).flags|=256),e=gl(e,t),e!==2&&(t=Ge,Ge=n,t!==null&&wc(t)),e}function wc(e){Ge===null?Ge=e:Ge.push.apply(Ge,e)}function t_(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var o=n[r],i=o.getSnapshot;o=o.value;try{if(!wt(i(),o))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Mn(e,t){for(t&=~vc,t&=~ul,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-_t(t),r=1<<n;e[n]=-1,t&=~r}}function gg(e){if(te&6)throw Error(H(327));oo();var t=Rs(e,0);if(!(t&1))return Ye(e,me()),null;var n=gl(e,t);if(e.tag!==0&&n===2){var r=eu(e);r!==0&&(t=r,n=_c(e,r))}if(n===1)throw n=yi,dr(e,0),Mn(e,t),Ye(e,me()),n;if(n===6)throw Error(H(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,pr(e,Ge,an),Ye(e,me()),null}function Rc(e,t){var n=te;te|=1;try{return e(t)}finally{te=n,te===0&&(ro=me()+500,zs&&Cn())}}function fr(e){kn!==null&&kn.tag===0&&!(te&6)&&oo();var t=te;te|=1;var n=ht.transition,r=re;try{if(ht.transition=null,re=1,e)return e()}finally{re=r,ht.transition=n,te=t,!(te&6)&&Cn()}}function Nc(){it=no.current,le(no)}function dr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,bS(n)),ve!==null)for(n=ve.return;n!==null;){var r=n;switch(Du(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Bs();break;case 3:Jr(),le(He),le(be),Ku();break;case 5:Gu(r);break;case 4:Jr();break;case 13:le(ce);break;case 19:le(ce);break;case 10:Vu(r.type._context);break;case 22:case 23:Nc()}n=n.return}if(Ne=e,ve=e=Un(e.current,null),Ie=it=t,Se=0,yi=null,vc=ul=cr=0,Ge=Ei=null,lr!==null){for(t=0;t<lr.length;t++)if(n=lr[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,i=n.pending;if(i!==null){var s=i.next;i.next=o,r.next=s}n.pending=r}lr=null}return e}function mg(e,t){do{var n=ve;try{if(Fu(),Js.current=rl,el){for(var r=fe.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}el=!1}if(ur=0,Re=Ee=fe=null,di=!1,pi=0,mc.current=null,n===null||n.return===null){Se=1,yi=t,ve=null;break}e:{var i=e,s=n.return,l=n,a=t;if(t=Ie,l.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){var u=a,c=l,f=c.tag;if(!(c.mode&1)&&(f===0||f===11||f===15)){var p=c.alternate;p?(c.updateQueue=p.updateQueue,c.memoizedState=p.memoizedState,c.lanes=p.lanes):(c.updateQueue=null,c.memoizedState=null)}var h=$h(s);if(h!==null){h.flags&=-257,zh(h,s,l,i,t),h.mode&1&&Bh(i,u,t),t=h,a=u;var v=t.updateQueue;if(v===null){var m=new Set;m.add(a),t.updateQueue=m}else v.add(a);break e}else{if(!(t&1)){Bh(i,u,t),Oc();break e}a=Error(H(426))}}else if(ae&&l.mode&1){var E=$h(s);if(E!==null){!(E.flags&65536)&&(E.flags|=256),zh(E,s,l,i,t),Mu(eo(a,l));break e}}i=a=eo(a,l),Se!==4&&(Se=2),Ei===null?Ei=[i]:Ei.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var d=Fh(i,a,t);lh(i,d);break e;case 1:l=a;var g=i.type,y=i.stateNode;if(!(i.flags&128)&&(typeof g.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(Dn===null||!Dn.has(y)))){i.flags|=65536,t&=-t,i.lanes|=t;var S=Vh(i,l,t);lh(i,S);break e}}i=i.return}while(i!==null)}Eg(n)}catch(w){t=w,ve===n&&n!==null&&(ve=n=n.return);continue}break}while(1)}function vg(){var e=al.current;return al.current=rl,e===null?rl:e}function Oc(){(Se===0||Se===3||Se===2)&&(Se=4),Ne===null||!(cr&268435455)&&!(ul&268435455)||Mn(Ne,Ie)}function gl(e,t){var n=te;te|=2;var r=vg();(Ne!==e||Ie!==t)&&(an=null,dr(e,t));do try{n_();break}catch(o){mg(e,o)}while(1);if(Fu(),te=n,al.current=r,ve!==null)throw Error(H(261));return Ne=null,Ie=0,Se}function n_(){for(;ve!==null;)yg(ve)}function r_(){for(;ve!==null&&!IE();)yg(ve)}function yg(e){var t=wg(e.alternate,e,it);e.memoizedProps=e.pendingProps,t===null?Eg(e):ve=t,mc.current=null}function Eg(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=XS(n,t),n!==null){n.flags&=32767,ve=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Se=6,ve=null;return}}else if(n=QS(n,t,it),n!==null){ve=n;return}if(t=t.sibling,t!==null){ve=t;return}ve=t=e}while(t!==null);Se===0&&(Se=5)}function pr(e,t,n){var r=re,o=ht.transition;try{ht.transition=null,re=1,o_(e,t,n,r)}finally{ht.transition=o,re=r}return null}function o_(e,t,n,r){do oo();while(kn!==null);if(te&6)throw Error(H(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(H(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(FE(e,i),e===Ne&&(ve=Ne=null,Ie=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||fl||(fl=!0,Rg(Es,function(){return oo(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=ht.transition,ht.transition=null;var s=re;re=1;var l=te;te|=4,mc.current=null,ZS(e,n),ug(n,e),NS(Ou),xs=!!Nu,Ou=Nu=null,e.current=n,JS(n),CE(),te=l,re=s,ht.transition=i}else e.current=n;if(fl&&(fl=!1,kn=e,dl=o),i=e.pendingLanes,i===0&&(Dn=null),LE(n.stateNode),Ye(e,me()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(cl)throw cl=!1,e=Ec,Ec=null,e;return dl&1&&e.tag!==0&&oo(),i=e.pendingLanes,i&1?e===Sc?Si++:(Si=0,Sc=e):Si=0,Cn(),null}function oo(){if(kn!==null){var e=sp(dl),t=ht.transition,n=re;try{if(ht.transition=null,re=16>e?16:e,kn===null)var r=!1;else{if(e=kn,kn=null,dl=0,te&6)throw Error(H(331));var o=te;for(te|=4,W=e.current;W!==null;){var i=W,s=i.child;if(W.flags&16){var l=i.deletions;if(l!==null){for(var a=0;a<l.length;a++){var u=l[a];for(W=u;W!==null;){var c=W;switch(c.tag){case 0:case 11:case 15:vi(8,c,i)}var f=c.child;if(f!==null)f.return=c,W=f;else for(;W!==null;){c=W;var p=c.sibling,h=c.return;if(og(c),c===u){W=null;break}if(p!==null){p.return=h,W=p;break}W=h}}}var v=i.alternate;if(v!==null){var m=v.child;if(m!==null){v.child=null;do{var E=m.sibling;m.sibling=null,m=E}while(m!==null)}}W=i}}if(i.subtreeFlags&2064&&s!==null)s.return=i,W=s;else e:for(;W!==null;){if(i=W,i.flags&2048)switch(i.tag){case 0:case 11:case 15:vi(9,i,i.return)}var d=i.sibling;if(d!==null){d.return=i.return,W=d;break e}W=i.return}}var g=e.current;for(W=g;W!==null;){s=W;var y=s.child;if(s.subtreeFlags&2064&&y!==null)y.return=s,W=y;else e:for(s=g;W!==null;){if(l=W,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:ll(9,l)}}catch(w){pe(l,l.return,w)}if(l===s){W=null;break e}var S=l.sibling;if(S!==null){S.return=l.return,W=S;break e}W=l.return}}if(te=o,Cn(),Mt&&typeof Mt.onPostCommitFiberRoot=="function")try{Mt.onPostCommitFiberRoot(Ss,e)}catch{}r=!0}return r}finally{re=n,ht.transition=t}}return!1}function Sg(e,t,n){t=eo(n,t),t=Fh(e,t,1),e=bn(e,t,1),t=Ve(),e!==null&&(jo(e,1,t),Ye(e,t))}function pe(e,t,n){if(e.tag===3)Sg(e,e,n);else for(;t!==null;){if(t.tag===3){Sg(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Dn===null||!Dn.has(r))){e=eo(n,e),e=Vh(t,e,1),t=bn(t,e,1),e=Ve(),t!==null&&(jo(t,1,e),Ye(t,e));break}}t=t.return}}function i_(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Ve(),e.pingedLanes|=e.suspendedLanes&n,Ne===e&&(Ie&n)===n&&(Se===4||Se===3&&(Ie&130023424)===Ie&&500>me()-yc?dr(e,0):vc|=n),Ye(e,t)}function _g(e,t){t===0&&(e.mode&1?(t=ws,ws<<=1,!(ws&130023424)&&(ws=4194304)):t=1);var n=Ve();e=on(e,t),e!==null&&(jo(e,t,n),Ye(e,n))}function s_(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),_g(e,n)}function l_(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(H(314))}r!==null&&r.delete(t),_g(e,n)}var wg;wg=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||He.current)We=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return We=!1,KS(e,t,n);We=!!(e.flags&131072)}else We=!1,ae&&t.flags&1048576&&eh(t,js,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;il(e,t),e=t.pendingProps;var o=Gr(t,be.current);qr(t,n),o=qu(null,t,r,e,o,n);var i=Zu();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,je(r)?(i=!0,$s(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,zu(t),o.updater=Xs,t.stateNode=o,o._reactInternals=t,ju(t,r,e,n),t=sc(null,t,r,!0,i,n)):(t.tag=0,ae&&i&&Lu(t),Fe(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(il(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=u_(r),e=Nt(r,e),o){case 0:t=ic(null,t,r,e,n);break e;case 1:t=Kh(null,t,r,e,n);break e;case 11:t=Hh(null,t,r,e,n);break e;case 14:t=jh(null,t,r,Nt(r.type,e),n);break e}throw Error(H(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Nt(r,o),ic(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Nt(r,o),Kh(e,t,r,o,n);case 3:e:{if(Qh(t),e===null)throw Error(H(387));r=t.pendingProps,i=t.memoizedState,o=i.element,sh(e,t),Qs(t,r,null,n);var s=t.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=eo(Error(H(423)),t),t=Xh(e,t,r,n,o);break e}else if(r!==o){o=eo(Error(H(424)),t),t=Xh(e,t,r,n,o);break e}else for(ot=xn(t.stateNode.containerInfo.firstChild),rt=t,ae=!0,Rt=null,n=gh(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Qr(),r===o){t=ln(e,t,n);break e}Fe(e,t,r,n)}t=t.child}return t;case 5:return mh(t),e===null&&Pu(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,xu(r,o)?s=null:i!==null&&xu(r,i)&&(t.flags|=32),Yh(e,t),Fe(e,t,s,n),t.child;case 6:return e===null&&Pu(t),null;case 13:return qh(e,t,n);case 4:return Wu(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Zr(t,null,r,n):Fe(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Nt(r,o),Hh(e,t,r,o,n);case 7:return Fe(e,t,t.pendingProps,n),t.child;case 8:return Fe(e,t,t.pendingProps.children,n),t.child;case 12:return Fe(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value,oe(Gs,r._currentValue),r._currentValue=s,i!==null)if(wt(i.value,s)){if(i.children===o.children&&!He.current){t=ln(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){s=i.child;for(var a=l.firstContext;a!==null;){if(a.context===r){if(i.tag===1){a=sn(-1,n&-n),a.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?a.next=a:(a.next=c.next,c.next=a),u.pending=a}}i.lanes|=n,a=i.alternate,a!==null&&(a.lanes|=n),Bu(i.return,n,t),l.lanes|=n;break}a=a.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(H(341));s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),Bu(s,n,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}Fe(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,qr(t,n),o=dt(o),r=r(o),t.flags|=1,Fe(e,t,r,n),t.child;case 14:return r=t.type,o=Nt(r,t.pendingProps),o=Nt(r.type,o),jh(e,t,r,o,n);case 15:return Wh(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Nt(r,o),il(e,t),t.tag=1,je(r)?(e=!0,$s(t)):e=!1,qr(t,n),fh(t,r,o),ju(t,r,o,n),sc(null,t,r,!0,e,n);case 19:return Jh(e,t,n);case 22:return Gh(e,t,n)}throw Error(H(156,t.tag))};function Rg(e,t){return tp(e,t)}function a_(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function gt(e,t,n,r){return new a_(e,t,n,r)}function xc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function u_(e){if(typeof e=="function")return xc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===La)return 11;if(e===Pa)return 14}return 2}function Un(e,t){var n=e.alternate;return n===null?(n=gt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function ml(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")xc(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Dr:return hr(n.children,o,i,t);case Aa:s=8,o|=8;break;case ba:return e=gt(12,n,t,o|2),e.elementType=ba,e.lanes=i,e;case Da:return e=gt(13,n,t,o),e.elementType=Da,e.lanes=i,e;case ka:return e=gt(19,n,t,o),e.elementType=ka,e.lanes=i,e;case bd:return vl(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Cd:s=10;break e;case Ad:s=9;break e;case La:s=11;break e;case Pa:s=14;break e;case yn:s=16,r=null;break e}throw Error(H(130,e==null?e:typeof e,""))}return t=gt(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function hr(e,t,n,r){return e=gt(7,e,r,t),e.lanes=n,e}function vl(e,t,n,r){return e=gt(22,e,r,t),e.elementType=bd,e.lanes=n,e.stateNode={isHidden:!1},e}function Tc(e,t,n){return e=gt(6,e,null,t),e.lanes=n,e}function Ic(e,t,n){return t=gt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function c_(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=tu(0),this.expirationTimes=tu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=tu(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Cc(e,t,n,r,o,i,s,l,a){return e=new c_(e,t,n,l,a),t===1?(t=1,i===!0&&(t|=8)):t=0,i=gt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},zu(i),e}function f_(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Lr,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Ng(e){if(!e)return In;e=e._reactInternals;e:{if(nr(e)!==e||e.tag!==1)throw Error(H(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(je(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(H(171))}if(e.tag===1){var n=e.type;if(je(n))return qp(e,n,t)}return t}function Og(e,t,n,r,o,i,s,l,a){return e=Cc(n,r,!0,e,o,i,s,l,a),e.context=Ng(null),n=e.current,r=Ve(),o=Pn(n),i=sn(r,o),i.callback=t??null,bn(n,i,o),e.current.lanes=o,jo(e,o,r),Ye(e,r),e}function yl(e,t,n,r){var o=t.current,i=Ve(),s=Pn(o);return n=Ng(n),t.context===null?t.context=n:t.pendingContext=n,t=sn(i,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=bn(o,t,s),e!==null&&(Tt(e,o,s,i),Ks(e,o,s)),s}function El(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function xg(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Ac(e,t){xg(e,t),(e=e.alternate)&&xg(e,t)}function d_(){return null}var Tg=typeof reportError=="function"?reportError:function(e){console.error(e)};function bc(e){this._internalRoot=e}Sl.prototype.render=bc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(H(409));yl(e,t,null,null)},Sl.prototype.unmount=bc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;fr(function(){yl(null,e,null,null)}),t[en]=null}};function Sl(e){this._internalRoot=e}Sl.prototype.unstable_scheduleHydration=function(e){if(e){var t=up();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Rn.length&&t!==0&&t<Rn[n].priority;n++);Rn.splice(n,0,e),n===0&&dp(e)}};function Lc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function _l(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Ig(){}function p_(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var u=El(s);i.call(u)}}var s=Og(t,r,e,0,null,!1,!1,"",Ig);return e._reactRootContainer=s,e[en]=s.current,oi(e.nodeType===8?e.parentNode:e),fr(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var l=r;r=function(){var u=El(a);l.call(u)}}var a=Cc(e,0,!1,null,null,!1,!1,"",Ig);return e._reactRootContainer=a,e[en]=a.current,oi(e.nodeType===8?e.parentNode:e),fr(function(){yl(t,a,n,r)}),a}function wl(e,t,n,r,o){var i=n._reactRootContainer;if(i){var s=i;if(typeof o=="function"){var l=o;o=function(){var a=El(s);l.call(a)}}yl(t,s,e,o)}else s=p_(n,t,e,o,r);return El(s)}lp=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Ho(t.pendingLanes);n!==0&&(nu(t,n|1),Ye(t,me()),!(te&6)&&(ro=me()+500,Cn()))}break;case 13:fr(function(){var r=on(e,1);if(r!==null){var o=Ve();Tt(r,e,1,o)}}),Ac(e,1)}},ru=function(e){if(e.tag===13){var t=on(e,134217728);if(t!==null){var n=Ve();Tt(t,e,134217728,n)}Ac(e,134217728)}},ap=function(e){if(e.tag===13){var t=Pn(e),n=on(e,t);if(n!==null){var r=Ve();Tt(n,e,t,r)}Ac(e,t)}},up=function(){return re},cp=function(e,t){var n=re;try{return re=e,t()}finally{re=n}},Qa=function(e,t,n){switch(t){case"input":if($a(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=Vs(r);if(!o)throw Error(H(90));kd(r),$a(r,o)}}}break;case"textarea":Vd(e,n);break;case"select":t=n.value,t!=null&&kr(e,!!n.multiple,t,!1)}},Kd=Rc,Qd=fr;var h_={usingClientEntryPoint:!1,Events:[li,jr,Vs,Gd,Yd,Rc]},_i={findFiberByHostInstance:rr,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},g_={bundleType:_i.bundleType,version:_i.version,rendererPackageName:_i.rendererPackageName,rendererConfig:_i.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Jt.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Jd(e),e===null?null:e.stateNode},findFiberByHostInstance:_i.findFiberByHostInstance||d_,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Rl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Rl.isDisabled&&Rl.supportsFiber)try{Ss=Rl.inject(g_),Mt=Rl}catch{}}et.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=h_,et.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Lc(t))throw Error(H(200));return f_(e,t,null,n)},et.createRoot=function(e,t){if(!Lc(e))throw Error(H(299));var n=!1,r="",o=Tg;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Cc(e,1,!1,null,null,n,!1,r,o),e[en]=t.current,oi(e.nodeType===8?e.parentNode:e),new bc(t)},et.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(H(188)):(e=Object.keys(e).join(","),Error(H(268,e)));return e=Jd(t),e=e===null?null:e.stateNode,e},et.flushSync=function(e){return fr(e)},et.hydrate=function(e,t,n){if(!_l(t))throw Error(H(200));return wl(null,e,t,!0,n)},et.hydrateRoot=function(e,t,n){if(!Lc(e))throw Error(H(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",s=Tg;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=Og(t,null,e,1,n??null,o,!1,i,s),e[en]=t.current,oi(e),r)for(e=0;e<r.length;e++)n=r[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new Sl(t)},et.render=function(e,t,n){if(!_l(t))throw Error(H(200));return wl(null,e,t,!1,n)},et.unmountComponentAtNode=function(e){if(!_l(e))throw Error(H(40));return e._reactRootContainer?(fr(function(){wl(null,null,e,!1,function(){e._reactRootContainer=null,e[en]=null})}),!0):!1},et.unstable_batchedUpdates=Rc,et.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!_l(n))throw Error(H(200));if(e==null||e._reactInternals===void 0)throw Error(H(38));return wl(e,t,n,!1,r)},et.version="18.2.0-next-9e3b772b8-20220608",function(e){function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(n){console.error(n)}}t(),e.exports=et}(dE);var Cg=Ar;Na.createRoot=Cg.createRoot,Na.hydrateRoot=Cg.hydrateRoot;var m_=Object.create,Dc=Object.defineProperty,v_=Object.getOwnPropertyDescriptor,y_=Object.getOwnPropertyNames,E_=Object.getPrototypeOf,S_=Object.prototype.hasOwnProperty,__=(e,t,n)=>t in e?Dc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,w_=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),R_=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of y_(t))!S_.call(e,o)&&o!==n&&Dc(e,o,{get:()=>t[o],enumerable:!(r=v_(t,o))||r.enumerable});return e},N_=(e,t,n)=>(n=e!=null?m_(E_(e)):{},R_(t||!e||!e.__esModule?Dc(n,"default",{value:e,enumerable:!0}):n,e)),Ag=(e,t,n)=>(__(e,typeof t!="symbol"?t+"":t,n),n),O_=w_((e,t)=>{(function(n,r){typeof define=="function"&&define.amd?define(r):typeof t=="object"&&t.exports?t.exports=r():n.log=r()})(e,function(){var n=function(){},r="undefined",o=typeof window!==r&&typeof window.navigator!==r&&/Trident\/|MSIE /.test(window.navigator.userAgent),i=["trace","debug","info","warn","error"];function s(E,d){var g=E[d];if(typeof g.bind=="function")return g.bind(E);try{return Function.prototype.bind.call(g,E)}catch{return function(){return Function.prototype.apply.apply(g,[E,arguments])}}}function l(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function a(E){return E==="debug"&&(E="log"),typeof console===r?!1:E==="trace"&&o?l:console[E]!==void 0?s(console,E):console.log!==void 0?s(console,"log"):n}function u(E,d){for(var g=0;g<i.length;g++){var y=i[g];this[y]=g<E?n:this.methodFactory(y,E,d)}this.log=this.debug}function c(E,d,g){return function(){typeof console!==r&&(u.call(this,d,g),this[E].apply(this,arguments))}}function f(E,d,g){return a(E)||c.apply(this,arguments)}function p(E,d,g){var y=this,S;d=d??"WARN";var w="loglevel";typeof E=="string"?w+=":"+E:typeof E=="symbol"&&(w=void 0);function N(k){var B=(i[k]||"silent").toUpperCase();if(!(typeof window===r||!w)){try{window.localStorage[w]=B;return}catch{}try{window.document.cookie=encodeURIComponent(w)+"="+B+";"}catch{}}}function T(){var k;if(!(typeof window===r||!w)){try{k=window.localStorage[w]}catch{}if(typeof k===r)try{var B=window.document.cookie,F=B.indexOf(encodeURIComponent(w)+"=");F!==-1&&(k=/^([^;]+)/.exec(B.slice(F))[1])}catch{}return y.levels[k]===void 0&&(k=void 0),k}}function b(){if(!(typeof window===r||!w)){try{window.localStorage.removeItem(w);return}catch{}try{window.document.cookie=encodeURIComponent(w)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}y.name=E,y.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},y.methodFactory=g||f,y.getLevel=function(){return S},y.setLevel=function(k,B){if(typeof k=="string"&&y.levels[k.toUpperCase()]!==void 0&&(k=y.levels[k.toUpperCase()]),typeof k=="number"&&k>=0&&k<=y.levels.SILENT){if(S=k,B!==!1&&N(k),u.call(y,k,E),typeof console===r&&k<y.levels.SILENT)return"No console available for logging"}else throw"log.setLevel() called with invalid level: "+k},y.setDefaultLevel=function(k){d=k,T()||y.setLevel(k,!1)},y.resetLevel=function(){y.setLevel(d,!1),b()},y.enableAll=function(k){y.setLevel(y.levels.TRACE,k)},y.disableAll=function(k){y.setLevel(y.levels.SILENT,k)};var D=T();D==null&&(D=d),y.setLevel(D,!1)}var h=new p,v={};h.getLogger=function(E){if(typeof E!="symbol"&&typeof E!="string"||E==="")throw new TypeError("You must supply a name when creating a logger.");var d=v[E];return d||(d=v[E]=new p(E,h.getLevel(),h.methodFactory)),d};var m=typeof window!==r?window.log:void 0;return h.noConflict=function(){return typeof window!==r&&window.log===h&&(window.log=m),h},h.getLoggers=function(){return v},h.default=h,h})}),x_=N_(O_(),1),T_=()=>new Date().toISOString(),wi=x_.default.getLogger("signalwire"),I_=wi.methodFactory;wi.methodFactory=(e,t,n)=>{let r=I_(e,t,n);return function(...o){o.unshift(T_(),"-"),r(...o)}};var C_=wi.getLevel();wi.setLevel(C_);var $t=()=>wi,A_=e=>({id:e.id,type:e.type,data:e.data,position:e.position}),b_=e=>({id:e.id,source:e.source,sourceHandle:e.sourceHandle,target:e.target,targetHandle:e.targetHandle}),bg=e=>{var t;return(t=e==null?void 0:e.trim())==null?void 0:t.toLowerCase()},Nl=e=>e.replace(/\s/g,""),L_={answer:({data:{maxDuration:e}})=>e?{answer:{max_duration:e}}:"answer",hangup:({data:{reason:e}})=>e?{hangup:{reason:e}}:"hangup",play:({data:{text:e,url:t,volume:n}})=>{let r=t||`say:${e||"Unknown TTS"}`;return n?{play:{volume:n,url:r}}:{play:{url:r}}},forwardAddress:({data:e})=>kc(e),forwardPhone:({data:e})=>kc(e),forwardResource:({data:e})=>kc(e),promptPlay:({data:e})=>{let t={play:"say:Unknown value"};e.text&&(t.play=`say:${e.text}`),e.url&&(t.play=e.url);let n=e.options.reduce((r,o)=>{let i=bg(o.command);i&&r.speechHints.push(i);let s=Nl(o.digit);return s&&(r.maxDigits=Math.max(r.maxDigits,s.length)),r},{speechHints:[],maxDigits:0});return n.speechHints.length&&(t.speech_hints=n.speechHints,t.speech_language="en-US"),n.maxDigits>1&&(t.max_digits=n.maxDigits),[{prompt:t},{switch:{variable:"prompt_result",case:{failed:[{play:"say:Error while gathering input."},"hangup"],no_input:[],no_match:[]},default:[{switch:{variable:"prompt_value",case:{},default:[]}}]}}]},handleCall:()=>"start",record:({data:e})=>[{record:{beep:e.beep,direction:e.direction,end_silence_timeout:e.endSilenceTimeout,format:e.format,initial_timeout:e.initialTimeout,input_sensitivity:e.inputSensitivity,stereo:e.stereo,terminators:e.terminators}},{if:{condition:"'${record_result}' == 'success'",then:[],else:[]}}],recordCallStart:({data:e})=>[{record_call:{beep:e.beep,control_id:e.controlId,direction:e.direction,end_silence_timeout:e.endSilenceTimeout,format:e.format,initial_timeout:e.initialTimeout,input_sensitivity:e.inputSensitivity,stereo:e.stereo,terminators:e.terminators}},{if:{condition:"'${record_result}' == 'success'",then:[],else:[]}}],recordCallStop:({data:e})=>({stop_record_call:e.controlId}),sendSms:({data:e})=>{let{fromNumber:t,toNumber:n,body:r}=e;return{send_sms:{from_number:Nl(t),to_number:Nl(n),body:r}}},set:({data:{variables:e}})=>{let t={};return e.forEach(({key:n,value:r})=>{t[n]=r}),{set:t}},unset:({data:{variables:e}})=>({unset:e.map(({key:t})=>t)}),request:({data:e})=>[{request:{url:e.url,method:e.method,timeout:e.timeout,connect_timeout:e.connectTimeout,save_variables:e.saveVariables,headers:e.headers&&Object.keys(e.headers).length?e.headers:void 0,body:e.body?e.body:void 0}},{if:{condition:"'${request_result}' === 'success'",then:[],else:[]}}],cond:()=>({cond:[]})},Ri=e=>{try{return L_[e.__type](e.node)}catch(t){throw $t().error("Unknown Verb",e),t}},kc=({destinations:e,sessionTimeout:t,type:n})=>{let r=t&&t>0?t:void 0,o=e.map(s=>({from:"${call.from}",to:Nl(s),session_timeout:r}));o.length||o.push({from:"${call.from}",to:"",session_timeout:r});let i={if:{condition:"'${connect_result}' == 'connected'",then:[],else:[{switch:{variable:"connect_failed_reason",case:{busy:[],noAnswer:[],decline:[],error:[]},default:["hangup"]}}]}};switch(n){case"single":return[{connect:o[0]},i];case"serial":return[{connect:{serial:o}},i];case"parallel":return[{connect:{parallel:o}},i];default:return $t().warn(`The type '${n}' is not supported yet.`),[{connect:o[0]},i]}},D_=e=>{let t=$t(),n=new Set,r=new Map,o=new Set,i=new Map([["main",[]]]),s=new Map,l="",a=y=>i.has(y),u=y=>o.has(y),c=y=>o.add(y);e.nodes.forEach(y=>{r.set(y.id,{node:y,children:[]}),y.type==="handleCall"&&(l=y.id)}),e.edges.forEach(y=>{let S=r.get(y.source),w=r.get(y.target);if(!S||!w)return t.warn("Invalid edge:",y);S.children.push(y.target),y.sourceHandle&&s.set(y.sourceHandle,w),n.has(y.target)&&i.set(y.target,[]),n.add(y.target)});let f=[...i.keys()],p=(y,S)=>{let w=s.get(S.id);if(w){let N=[];i.set(S.id,N),S.digit&&(y[S.digit]=N);let T=bg(S.command);T&&(y[T]=N);let b=a(w.node.id);if(b){let D={transfer:w.node.id};S.digit&&y[S.digit].push(D),T&&!y[T].includes(D)&&y[T].push(D)}E({sectionName:b?w.node.id:S.id,current:w})}return y},h=(y,S)=>{let w=s.get(S.id);if(w){let N=[];i.set(S.id,N),y[S.result]=N;let T=a(w.node.id);T&&y[S.result].push({transfer:w.node.id}),E({sectionName:T?w.node.id:S.id,current:w})}return y},v={then:(y,S)=>{if(S.result!=="success")return y;let w=s.get(S.id);if(w){let N=[];i.set(S.id,N),y=N;let T=a(w.node.id);T&&y.push({transfer:w.node.id}),E({sectionName:T?w.node.id:S.id,current:w})}return y},else:(y,S)=>{if(S.result==="success")return y;let w=s.get(S.id);if(w){let N=[];i.set(S.id,N),y=N;let T=a(w.node.id);T&&y.push({transfer:w.node.id}),E({sectionName:T?w.node.id:S.id,current:w})}return y}},m={options:(y,S)=>{let w=s.get(S.id),N={when:S.value,then:[]};if(w){let T=[];i.set(S.id,T),N.then=T;let b=a(w.node.id);b&&N.then.push({transfer:w.node.id}),y.push(N),E({sectionName:b?w.node.id:S.id,current:w})}return y},fallback:y=>{let S=s.get(y),w={else:[]};if(S){let N=[];i.set(y,N),w.else=N;let T=a(S.node.id);T&&w.else.push({transfer:S.node.id}),E({sectionName:T?S.node.id:y,current:S})}return w}},E=({sectionName:y,current:S})=>{var N,T,b;if(u(S.node.id))return;c(S.node.id);let w=i.get(y);if(!w){t.warn("Unknown section name:",y);return}switch(S.node.type){case"promptPlay":{let D=Ri({__type:S.node.type,node:S.node});if(!Array.isArray(D)){t.warn("Invalid gather node",D);return}(T=(N=S.node.data)==null?void 0:N.results)!=null&&T.length&&(D[1].switch.case={...D[1].switch.case,...S.node.data.results.reduce(h,{})}),D[1].switch.default[0].switch.case=S.node.data.options.reduce(p,{}),(b=D[1].switch.case)!=null&&b.no_match&&(D[1].switch.default[0].switch.default=D[1].switch.case.no_match),w.push(...D);return}case"cond":{let D=Ri({__type:S.node.type,node:S.node});D.cond=S.node.data.options.reduce(m.options,[]),D.cond.push(m.fallback(S.node.data.fallback)),w.push(D);return}case"forwardPhone":case"forwardAddress":case"forwardResource":{let D=Ri({__type:S.node.type,node:S.node});if(!Array.isArray(D)){t.warn("Invalid connect node",D);return}S.node.data.options.length&&(D[1].if.then=S.node.data.options.reduce(v.then,[]),D[1].if.else[0].switch.case=S.node.data.options.reduce(h,{})),w.push(...D);return}case"record":case"recordCallStart":case"request":{let D=Ri({__type:S.node.type,node:S.node});if(!Array.isArray(D)){t.warn("Invalid record node",D);return}D[1].if.then=S.node.data.options.reduce(v.then,[]),D[1].if.else=S.node.data.options.reduce(v.else,[]),w.push(...D);return}default:{let D=Ri({__type:S.node.type,node:S.node});S.node.type!=="handleCall"&&w.push(D),S.children.forEach(k=>{let B=r.get(k);if(!B)return t.warn("Invalid Child Node",k);let F=a(k);F&&w.push({transfer:k}),E({sectionName:F?k:y,current:B})});break}}},d=r.get(l);d&&E({sectionName:"main",current:d});let g={};return f.forEach(y=>{let S=i.get(y);S&&(g[y]=S)}),t.debug("sections",JSON.stringify(g)),{sections:g}},Lg=class extends Error{constructor(t,n){super(n),this.code=t,this.message=n,Ag(this,"name","AuthError"),Object.setPrototypeOf(this,Lg.prototype)}},Dg=class extends Error{constructor(e,t,n){super(t),this.code=e,this.message=t,this.response=n,Ag(this,"name","HttpError"),Object.setPrototypeOf(this,Dg.prototype)}};async function k_(e,t){let n=await fetch(e,t);if(!n.ok){if(n.status===401)throw new Lg(n.status,"Unauthorized");let r;try{r=await n.json()}catch{}let o=r!=null&&r.errors?JSON.stringify(r.errors):`Error Code: ${n.status}`;throw new Dg(n.status,o,r)}try{n.parsedBody=await n.json()}catch{}return n}var P_=({timeout:e=3e4,...t},n=k_)=>async(r,o)=>{let i={...o!=null&&o.body?{"Content-Type":"application/json"}:{},...t.headers,...o==null?void 0:o.headers},s=U_({...t,...o,headers:i});s.credentials="same-origin";let l;if(e){let a=new AbortController,u=a.signal;s.signal=u,l=setTimeout(()=>{a.abort()},e)}try{return{body:(await n(F_({url:r,searchParams:o==null?void 0:o.searchParams}),s)).parsedBody}}finally{l&&clearTimeout(l)}},M_=e=>typeof e=="string"?e:JSON.stringify(e),U_=e=>Object.entries(e).reduce((t,[n,r])=>n==="body"?{...t,body:M_(r)}:r!=null?{...t,[n]:r}:t,{}),F_=({url:e,searchParams:t})=>{let n=new URL(e);return t&&Object.entries(t).forEach(([r,o])=>{o!=null&&n.searchParams.append(r,o)}),n.toString()},V_=e=>{let t=$t(),n=P_(e);return{getFlow:async()=>{var r;try{let{body:o}=await n(e.getFlowURL);switch(t.info("getFlow",o),(r=o==null?void 0:o.flow_data)==null?void 0:r.builderVersion){default:return o}}catch{return t.error("Could not load flow. URL:",e.getFlowURL),{}}},putFlow:async r=>{let o={type:"call_flow",document_version:r.documentVersion+1,flow_data:{builderVersion:r.builderVersion,nodes:r.nodes.map(A_),edges:r.edges.map(b_)},relayml:D_({nodes:r.nodes,edges:r.edges})},i=await n(e.updateFlowURL,{method:"PUT",body:o});return t.info("putFlow",i.body),i.body}}};function Ke(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=Ke(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}const kg=e=>{let t;const n=new Set,r=(a,u)=>{const c=typeof a=="function"?a(t):a;if(!Object.is(c,t)){const f=t;t=u??typeof c!="object"?c:Object.assign({},t,c),n.forEach(p=>p(t,f))}},o=()=>t,l={setState:r,getState:o,subscribe:a=>(n.add(a),()=>n.delete(a)),destroy:()=>{var a;((a={VITE_BASE_URL:"",VITE_BASIC_AUTH:"signalwire:1aG93uXk",VITE_DEFAULT_STYLE_HREF:"https://cdn.swire.io/npm/@signalwire/cfb@dev/dist/style.css",BASE_URL:"/cfb/",MODE:"staging",DEV:!1,PROD:!0,SSR:!1})==null?void 0:a.MODE)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return t=e(r,o,l),l},Pg=e=>e?kg(e):kg;var Pc={},B_={get exports(){return Pc},set exports(e){Pc=e}},Mg={},Mc={},$_={get exports(){return Mc},set exports(e){Mc=e}},Ug={};/**
45
45
  * @license React
46
46
  * use-sync-external-store-shim.production.min.js
47
47
  *
@@ -57,13 +57,13 @@ Error generating stack: `+i.message+`
57
57
  *
58
58
  * This source code is licensed under the MIT license found in the
59
59
  * LICENSE file in the root directory of this source tree.
60
- */var Ol=O,q_=Mc;function Z_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var J_=typeof Object.is=="function"?Object.is:Z_,ew=q_.useSyncExternalStore,tw=Ol.useRef,nw=Ol.useEffect,rw=Ol.useMemo,ow=Ol.useDebugValue;Mg.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=tw(null);if(i.current===null){var s={hasValue:!1,value:null};i.current=s}else s=i.current;i=rw(function(){function a(h){if(!u){if(u=!0,c=h,h=r(h),o!==void 0&&s.hasValue){var v=s.value;if(o(v,h))return f=v}return f=h}if(v=f,J_(c,h))return v;var m=r(h);return o!==void 0&&o(v,m)?v:(c=h,f=m)}var u=!1,c,f,p=n===void 0?null:n;return[function(){return a(t())},p===null?void 0:function(){return a(p())}]},[t,n,r,o]);var l=ew(e,i[0],i[1]);return nw(function(){s.hasValue=!0,s.value=l},[l]),ow(l),l},function(e){e.exports=Mg}(B_);const iw=fd(Pc),{useSyncExternalStoreWithSelector:sw}=iw;function Fg(e,t=e.getState,n){const r=sw(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return O.useDebugValue(r),r}const Vg=e=>{var t;((t={VITE_BASE_URL:"",VITE_BASIC_AUTH:"signalwire:1aG93uXk",VITE_DEFAULT_STYLE_HREF:"https://cdn.swire.io/npm/@signalwire/cfb@dev/dist/style.css",BASE_URL:"/cfb/",MODE:"staging",DEV:!1,PROD:!0,SSR:!1})==null?void 0:t.MODE)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const n=typeof e=="function"?Pg(e):e,r=(o,i)=>Fg(n,o,i);return Object.assign(r,n),r},xl=e=>e?Vg(e):Vg;function Qe(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,o]of e)if(!Object.is(o,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Object.is(e[n[r]],t[n[r]]))return!1;return!0}var lw={value:()=>{}};function Tl(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Il(n)}function Il(e){this._=e}function aw(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",o=n.indexOf(".");if(o>=0&&(r=n.slice(o+1),n=n.slice(0,o)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Il.prototype=Tl.prototype={constructor:Il,on:function(e,t){var n=this._,r=aw(e+"",n),o,i=-1,s=r.length;if(arguments.length<2){for(;++i<s;)if((o=(e=r[i]).type)&&(o=uw(n[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<s;)if(o=(e=r[i]).type)n[o]=Bg(n[o],e.name,t);else if(t==null)for(o in n)n[o]=Bg(n[o],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Il(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var n=new Array(o),r=0,o,i;r<o;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],r=0,o=i.length;r<o;++r)i[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],o=0,i=r.length;o<i;++o)r[o].value.apply(t,n)}};function uw(e,t){for(var n=0,r=e.length,o;n<r;++n)if((o=e[n]).name===t)return o.value}function Bg(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=lw,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Fc="http://www.w3.org/1999/xhtml";const $g={svg:"http://www.w3.org/2000/svg",xhtml:Fc,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Cl(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),$g.hasOwnProperty(t)?{space:$g[t],local:e}:e}function cw(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Fc&&t.documentElement.namespaceURI===Fc?t.createElement(e):t.createElementNS(n,e)}}function fw(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function zg(e){var t=Cl(e);return(t.local?fw:cw)(t)}function dw(){}function Vc(e){return e==null?dw:function(){return this.querySelector(e)}}function pw(e){typeof e!="function"&&(e=Vc(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,l=r[o]=new Array(s),a,u,c=0;c<s;++c)(a=i[c])&&(u=e.call(a,a.__data__,c,i))&&("__data__"in a&&(u.__data__=a.__data__),l[c]=u);return new st(r,this._parents)}function hw(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function gw(){return[]}function Hg(e){return e==null?gw:function(){return this.querySelectorAll(e)}}function mw(e){return function(){return hw(e.apply(this,arguments))}}function vw(e){typeof e=="function"?e=mw(e):e=Hg(e);for(var t=this._groups,n=t.length,r=[],o=[],i=0;i<n;++i)for(var s=t[i],l=s.length,a,u=0;u<l;++u)(a=s[u])&&(r.push(e.call(a,a.__data__,u,s)),o.push(a));return new st(r,o)}function jg(e){return function(){return this.matches(e)}}function Wg(e){return function(t){return t.matches(e)}}var yw=Array.prototype.find;function Ew(e){return function(){return yw.call(this.children,e)}}function Sw(){return this.firstElementChild}function _w(e){return this.select(e==null?Sw:Ew(typeof e=="function"?e:Wg(e)))}var ww=Array.prototype.filter;function Rw(){return Array.from(this.children)}function Nw(e){return function(){return ww.call(this.children,e)}}function Ow(e){return this.selectAll(e==null?Rw:Nw(typeof e=="function"?e:Wg(e)))}function xw(e){typeof e!="function"&&(e=jg(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,l=r[o]=[],a,u=0;u<s;++u)(a=i[u])&&e.call(a,a.__data__,u,i)&&l.push(a);return new st(r,this._parents)}function Gg(e){return new Array(e.length)}function Tw(){return new st(this._enter||this._groups.map(Gg),this._parents)}function Al(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Al.prototype={constructor:Al,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Iw(e){return function(){return e}}function Cw(e,t,n,r,o,i){for(var s=0,l,a=t.length,u=i.length;s<u;++s)(l=t[s])?(l.__data__=i[s],r[s]=l):n[s]=new Al(e,i[s]);for(;s<a;++s)(l=t[s])&&(o[s]=l)}function Aw(e,t,n,r,o,i,s){var l,a,u=new Map,c=t.length,f=i.length,p=new Array(c),h;for(l=0;l<c;++l)(a=t[l])&&(p[l]=h=s.call(a,a.__data__,l,t)+"",u.has(h)?o[l]=a:u.set(h,a));for(l=0;l<f;++l)h=s.call(e,i[l],l,i)+"",(a=u.get(h))?(r[l]=a,a.__data__=i[l],u.delete(h)):n[l]=new Al(e,i[l]);for(l=0;l<c;++l)(a=t[l])&&u.get(p[l])===a&&(o[l]=a)}function bw(e){return e.__data__}function Lw(e,t){if(!arguments.length)return Array.from(this,bw);var n=t?Aw:Cw,r=this._parents,o=this._groups;typeof e!="function"&&(e=Iw(e));for(var i=o.length,s=new Array(i),l=new Array(i),a=new Array(i),u=0;u<i;++u){var c=r[u],f=o[u],p=f.length,h=Dw(e.call(c,c&&c.__data__,u,r)),v=h.length,m=l[u]=new Array(v),E=s[u]=new Array(v),d=a[u]=new Array(p);n(c,f,m,E,d,h,t);for(var g=0,y=0,S,w;g<v;++g)if(S=m[g]){for(g>=y&&(y=g+1);!(w=E[y])&&++y<v;);S._next=w||null}}return s=new st(s,r),s._enter=l,s._exit=a,s}function Dw(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function kw(){return new st(this._exit||this._groups.map(Gg),this._parents)}function Pw(e,t,n){var r=this.enter(),o=this,i=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),n==null?i.remove():n(i),r&&o?r.merge(o).order():o}function Mw(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,o=n.length,i=r.length,s=Math.min(o,i),l=new Array(o),a=0;a<s;++a)for(var u=n[a],c=r[a],f=u.length,p=l[a]=new Array(f),h,v=0;v<f;++v)(h=u[v]||c[v])&&(p[v]=h);for(;a<o;++a)l[a]=n[a];return new st(l,this._parents)}function Uw(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],o=r.length-1,i=r[o],s;--o>=0;)(s=r[o])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function Fw(e){e||(e=Vw);function t(f,p){return f&&p?e(f.__data__,p.__data__):!f-!p}for(var n=this._groups,r=n.length,o=new Array(r),i=0;i<r;++i){for(var s=n[i],l=s.length,a=o[i]=new Array(l),u,c=0;c<l;++c)(u=s[c])&&(a[c]=u);a.sort(t)}return new st(o,this._parents).order()}function Vw(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Bw(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function $w(){return Array.from(this)}function zw(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length;o<i;++o){var s=r[o];if(s)return s}return null}function Hw(){let e=0;for(const t of this)++e;return e}function jw(){return!this.node()}function Ww(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var o=t[n],i=0,s=o.length,l;i<s;++i)(l=o[i])&&e.call(l,l.__data__,i,o);return this}function Gw(e){return function(){this.removeAttribute(e)}}function Yw(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Kw(e,t){return function(){this.setAttribute(e,t)}}function Qw(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Xw(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function qw(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Zw(e,t){var n=Cl(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?Yw:Gw:typeof t=="function"?n.local?qw:Xw:n.local?Qw:Kw)(n,t))}function Yg(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Jw(e){return function(){this.style.removeProperty(e)}}function e1(e,t,n){return function(){this.style.setProperty(e,t,n)}}function t1(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function n1(e,t,n){return arguments.length>1?this.each((t==null?Jw:typeof t=="function"?t1:e1)(e,t,n??"")):so(this.node(),e)}function so(e,t){return e.style.getPropertyValue(t)||Yg(e).getComputedStyle(e,null).getPropertyValue(t)}function r1(e){return function(){delete this[e]}}function o1(e,t){return function(){this[e]=t}}function i1(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function s1(e,t){return arguments.length>1?this.each((t==null?r1:typeof t=="function"?i1:o1)(e,t)):this.node()[e]}function Kg(e){return e.trim().split(/^|\s+/)}function Bc(e){return e.classList||new Qg(e)}function Qg(e){this._node=e,this._names=Kg(e.getAttribute("class")||"")}Qg.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Xg(e,t){for(var n=Bc(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function qg(e,t){for(var n=Bc(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function l1(e){return function(){Xg(this,e)}}function a1(e){return function(){qg(this,e)}}function u1(e,t){return function(){(t.apply(this,arguments)?Xg:qg)(this,e)}}function c1(e,t){var n=Kg(e+"");if(arguments.length<2){for(var r=Bc(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each((typeof t=="function"?u1:t?l1:a1)(n,t))}function f1(){this.textContent=""}function d1(e){return function(){this.textContent=e}}function p1(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function h1(e){return arguments.length?this.each(e==null?f1:(typeof e=="function"?p1:d1)(e)):this.node().textContent}function g1(){this.innerHTML=""}function m1(e){return function(){this.innerHTML=e}}function v1(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function y1(e){return arguments.length?this.each(e==null?g1:(typeof e=="function"?v1:m1)(e)):this.node().innerHTML}function E1(){this.nextSibling&&this.parentNode.appendChild(this)}function S1(){return this.each(E1)}function _1(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function w1(){return this.each(_1)}function R1(e){var t=typeof e=="function"?e:zg(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function N1(){return null}function O1(e,t){var n=typeof e=="function"?e:zg(e),r=t==null?N1:typeof t=="function"?t:Vc(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function x1(){var e=this.parentNode;e&&e.removeChild(this)}function T1(){return this.each(x1)}function I1(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function C1(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function A1(e){return this.select(e?C1:I1)}function b1(e){return arguments.length?this.property("__data__",e):this.node().__data__}function L1(e){return function(t){e.call(this,t,this.__data__)}}function D1(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function k1(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,o=t.length,i;n<o;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++r]=i;++r?t.length=r:delete this.__on}}}function P1(e,t,n){return function(){var r=this.__on,o,i=L1(t);if(r){for(var s=0,l=r.length;s<l;++s)if((o=r[s]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=i,o.options=n),o.value=t;return}}this.addEventListener(e.type,i,n),o={type:e.type,name:e.name,value:t,listener:i,options:n},r?r.push(o):this.__on=[o]}}function M1(e,t,n){var r=D1(e+""),o,i=r.length,s;if(arguments.length<2){var l=this.node().__on;if(l){for(var a=0,u=l.length,c;a<u;++a)for(o=0,c=l[a];o<i;++o)if((s=r[o]).type===c.type&&s.name===c.name)return c.value}return}for(l=t?P1:k1,o=0;o<i;++o)this.each(l(r[o],t,n));return this}function Zg(e,t,n){var r=Yg(e),o=r.CustomEvent;typeof o=="function"?o=new o(t,n):(o=r.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function U1(e,t){return function(){return Zg(this,e,t)}}function F1(e,t){return function(){return Zg(this,e,t.apply(this,arguments))}}function V1(e,t){return this.each((typeof t=="function"?F1:U1)(e,t))}function*B1(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length,s;o<i;++o)(s=r[o])&&(yield s)}var Jg=[null];function st(e,t){this._groups=e,this._parents=t}function Ni(){return new st([[document.documentElement]],Jg)}function $1(){return this}st.prototype=Ni.prototype={constructor:st,select:pw,selectAll:vw,selectChild:_w,selectChildren:Ow,filter:xw,data:Lw,enter:Tw,exit:kw,join:Pw,merge:Mw,selection:$1,order:Uw,sort:Fw,call:Bw,nodes:$w,node:zw,size:Hw,empty:jw,each:Ww,attr:Zw,style:n1,property:s1,classed:c1,text:h1,html:y1,raise:S1,lower:w1,append:R1,insert:O1,remove:T1,clone:A1,datum:b1,on:M1,dispatch:V1,[Symbol.iterator]:B1};function Ct(e){return typeof e=="string"?new st([[document.querySelector(e)]],[document.documentElement]):new st([[e]],Jg)}function z1(e){let t;for(;t=e.sourceEvent;)e=t;return e}function zt(e,t){if(e=z1(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}const H1={passive:!1},Oi={capture:!0,passive:!1};function $c(e){e.stopImmediatePropagation()}function lo(e){e.preventDefault(),e.stopImmediatePropagation()}function em(e){var t=e.document.documentElement,n=Ct(e).on("dragstart.drag",lo,Oi);"onselectstart"in t?n.on("selectstart.drag",lo,Oi):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function tm(e,t){var n=e.document.documentElement,r=Ct(e).on("dragstart.drag",null);t&&(r.on("click.drag",lo,Oi),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const bl=e=>()=>e;function zc(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:i,x:s,y:l,dx:a,dy:u,dispatch:c}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:a,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:c}})}zc.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function j1(e){return!e.ctrlKey&&!e.button}function W1(){return this.parentNode}function G1(e,t){return t??{x:e.x,y:e.y}}function Y1(){return navigator.maxTouchPoints||"ontouchstart"in this}function K1(){var e=j1,t=W1,n=G1,r=Y1,o={},i=Tl("start","drag","end"),s=0,l,a,u,c,f=0;function p(S){S.on("mousedown.drag",h).filter(r).on("touchstart.drag",E).on("touchmove.drag",d,H1).on("touchend.drag touchcancel.drag",g).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(S,w){if(!(c||!e.call(this,S,w))){var N=y(this,t.call(this,S,w),S,w,"mouse");N&&(Ct(S.view).on("mousemove.drag",v,Oi).on("mouseup.drag",m,Oi),em(S.view),$c(S),u=!1,l=S.clientX,a=S.clientY,N("start",S))}}function v(S){if(lo(S),!u){var w=S.clientX-l,N=S.clientY-a;u=w*w+N*N>f}o.mouse("drag",S)}function m(S){Ct(S.view).on("mousemove.drag mouseup.drag",null),tm(S.view,u),lo(S),o.mouse("end",S)}function E(S,w){if(e.call(this,S,w)){var N=S.changedTouches,T=t.call(this,S,w),b=N.length,D,k;for(D=0;D<b;++D)(k=y(this,T,S,w,N[D].identifier,N[D]))&&($c(S),k("start",S,N[D]))}}function d(S){var w=S.changedTouches,N=w.length,T,b;for(T=0;T<N;++T)(b=o[w[T].identifier])&&(lo(S),b("drag",S,w[T]))}function g(S){var w=S.changedTouches,N=w.length,T,b;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),T=0;T<N;++T)(b=o[w[T].identifier])&&($c(S),b("end",S,w[T]))}function y(S,w,N,T,b,D){var k=i.copy(),B=zt(D||N,w),F,z,R;if((R=n.call(S,new zc("beforestart",{sourceEvent:N,target:p,identifier:b,active:s,x:B[0],y:B[1],dx:0,dy:0,dispatch:k}),T))!=null)return F=R.x-B[0]||0,z=R.y-B[1]||0,function P(A,C,x){var L=B,U;switch(A){case"start":o[b]=P,U=s++;break;case"end":delete o[b],--s;case"drag":B=zt(x||C,w),U=s;break}k.call(A,S,new zc(A,{sourceEvent:C,subject:R,target:p,identifier:b,active:U,x:B[0]+F,y:B[1]+z,dx:B[0]-L[0],dy:B[1]-L[1],dispatch:k}),T)}}return p.filter=function(S){return arguments.length?(e=typeof S=="function"?S:bl(!!S),p):e},p.container=function(S){return arguments.length?(t=typeof S=="function"?S:bl(S),p):t},p.subject=function(S){return arguments.length?(n=typeof S=="function"?S:bl(S),p):n},p.touchable=function(S){return arguments.length?(r=typeof S=="function"?S:bl(!!S),p):r},p.on=function(){var S=i.on.apply(i,arguments);return S===i?p:S},p.clickDistance=function(S){return arguments.length?(f=(S=+S)*S,p):Math.sqrt(f)},p}function Hc(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function nm(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function xi(){}var Ti=.7,Ll=1/Ti,ao="\\s*([+-]?\\d+)\\s*",Ii="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ht="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Q1=/^#([0-9a-f]{3,8})$/,X1=new RegExp(`^rgb\\(${ao},${ao},${ao}\\)$`),q1=new RegExp(`^rgb\\(${Ht},${Ht},${Ht}\\)$`),Z1=new RegExp(`^rgba\\(${ao},${ao},${ao},${Ii}\\)$`),J1=new RegExp(`^rgba\\(${Ht},${Ht},${Ht},${Ii}\\)$`),eR=new RegExp(`^hsl\\(${Ii},${Ht},${Ht}\\)$`),tR=new RegExp(`^hsla\\(${Ii},${Ht},${Ht},${Ii}\\)$`),rm={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Hc(xi,Ci,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:om,formatHex:om,formatHex8:nR,formatHsl:rR,formatRgb:im,toString:im});function om(){return this.rgb().formatHex()}function nR(){return this.rgb().formatHex8()}function rR(){return cm(this).formatHsl()}function im(){return this.rgb().formatRgb()}function Ci(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Q1.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?sm(t):n===3?new Xe(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Dl(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Dl(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=X1.exec(e))?new Xe(t[1],t[2],t[3],1):(t=q1.exec(e))?new Xe(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Z1.exec(e))?Dl(t[1],t[2],t[3],t[4]):(t=J1.exec(e))?Dl(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=eR.exec(e))?um(t[1],t[2]/100,t[3]/100,1):(t=tR.exec(e))?um(t[1],t[2]/100,t[3]/100,t[4]):rm.hasOwnProperty(e)?sm(rm[e]):e==="transparent"?new Xe(NaN,NaN,NaN,0):null}function sm(e){return new Xe(e>>16&255,e>>8&255,e&255,1)}function Dl(e,t,n,r){return r<=0&&(e=t=n=NaN),new Xe(e,t,n,r)}function oR(e){return e instanceof xi||(e=Ci(e)),e?(e=e.rgb(),new Xe(e.r,e.g,e.b,e.opacity)):new Xe}function jc(e,t,n,r){return arguments.length===1?oR(e):new Xe(e,t,n,r??1)}function Xe(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Hc(Xe,jc,nm(xi,{brighter(e){return e=e==null?Ll:Math.pow(Ll,e),new Xe(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ti:Math.pow(Ti,e),new Xe(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Xe(gr(this.r),gr(this.g),gr(this.b),kl(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:lm,formatHex:lm,formatHex8:iR,formatRgb:am,toString:am}));function lm(){return`#${mr(this.r)}${mr(this.g)}${mr(this.b)}`}function iR(){return`#${mr(this.r)}${mr(this.g)}${mr(this.b)}${mr((isNaN(this.opacity)?1:this.opacity)*255)}`}function am(){const e=kl(this.opacity);return`${e===1?"rgb(":"rgba("}${gr(this.r)}, ${gr(this.g)}, ${gr(this.b)}${e===1?")":`, ${e})`}`}function kl(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function gr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function mr(e){return e=gr(e),(e<16?"0":"")+e.toString(16)}function um(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new At(e,t,n,r)}function cm(e){if(e instanceof At)return new At(e.h,e.s,e.l,e.opacity);if(e instanceof xi||(e=Ci(e)),!e)return new At;if(e instanceof At)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),i=Math.max(t,n,r),s=NaN,l=i-o,a=(i+o)/2;return l?(t===i?s=(n-r)/l+(n<r)*6:n===i?s=(r-t)/l+2:s=(t-n)/l+4,l/=a<.5?i+o:2-i-o,s*=60):l=a>0&&a<1?0:s,new At(s,l,a,e.opacity)}function sR(e,t,n,r){return arguments.length===1?cm(e):new At(e,t,n,r??1)}function At(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Hc(At,sR,nm(xi,{brighter(e){return e=e==null?Ll:Math.pow(Ll,e),new At(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ti:Math.pow(Ti,e),new At(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new Xe(Wc(e>=240?e-240:e+120,o,r),Wc(e,o,r),Wc(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new At(fm(this.h),Pl(this.s),Pl(this.l),kl(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=kl(this.opacity);return`${e===1?"hsl(":"hsla("}${fm(this.h)}, ${Pl(this.s)*100}%, ${Pl(this.l)*100}%${e===1?")":`, ${e})`}`}}));function fm(e){return e=(e||0)%360,e<0?e+360:e}function Pl(e){return Math.max(0,Math.min(1,e||0))}function Wc(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const dm=e=>()=>e;function lR(e,t){return function(n){return e+n*t}}function aR(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function uR(e){return(e=+e)==1?pm:function(t,n){return n-t?aR(t,n,e):dm(isNaN(t)?n:t)}}function pm(e,t){var n=t-e;return n?lR(e,n):dm(isNaN(e)?t:e)}const hm=function e(t){var n=uR(t);function r(o,i){var s=n((o=jc(o)).r,(i=jc(i)).r),l=n(o.g,i.g),a=n(o.b,i.b),u=pm(o.opacity,i.opacity);return function(c){return o.r=s(c),o.g=l(c),o.b=a(c),o.opacity=u(c),o+""}}return r.gamma=e,r}(1);function Fn(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var Gc=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Yc=new RegExp(Gc.source,"g");function cR(e){return function(){return e}}function fR(e){return function(t){return e(t)+""}}function dR(e,t){var n=Gc.lastIndex=Yc.lastIndex=0,r,o,i,s=-1,l=[],a=[];for(e=e+"",t=t+"";(r=Gc.exec(e))&&(o=Yc.exec(t));)(i=o.index)>n&&(i=t.slice(n,i),l[s]?l[s]+=i:l[++s]=i),(r=r[0])===(o=o[0])?l[s]?l[s]+=o:l[++s]=o:(l[++s]=null,a.push({i:s,x:Fn(r,o)})),n=Yc.lastIndex;return n<t.length&&(i=t.slice(n),l[s]?l[s]+=i:l[++s]=i),l.length<2?a[0]?fR(a[0].x):cR(t):(t=a.length,function(u){for(var c=0,f;c<t;++c)l[(f=a[c]).i]=f.x(u);return l.join("")})}var gm=180/Math.PI,Kc={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function mm(e,t,n,r,o,i){var s,l,a;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(a=e*n+t*r)&&(n-=e*a,r-=t*a),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,a/=l),e*r<t*n&&(e=-e,t=-t,a=-a,s=-s),{translateX:o,translateY:i,rotate:Math.atan2(t,e)*gm,skewX:Math.atan(a)*gm,scaleX:s,scaleY:l}}var Ml;function pR(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Kc:mm(t.a,t.b,t.c,t.d,t.e,t.f)}function hR(e){return e==null||(Ml||(Ml=document.createElementNS("http://www.w3.org/2000/svg","g")),Ml.setAttribute("transform",e),!(e=Ml.transform.baseVal.consolidate()))?Kc:(e=e.matrix,mm(e.a,e.b,e.c,e.d,e.e,e.f))}function vm(e,t,n,r){function o(u){return u.length?u.pop()+" ":""}function i(u,c,f,p,h,v){if(u!==f||c!==p){var m=h.push("translate(",null,t,null,n);v.push({i:m-4,x:Fn(u,f)},{i:m-2,x:Fn(c,p)})}else(f||p)&&h.push("translate("+f+t+p+n)}function s(u,c,f,p){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),p.push({i:f.push(o(f)+"rotate(",null,r)-2,x:Fn(u,c)})):c&&f.push(o(f)+"rotate("+c+r)}function l(u,c,f,p){u!==c?p.push({i:f.push(o(f)+"skewX(",null,r)-2,x:Fn(u,c)}):c&&f.push(o(f)+"skewX("+c+r)}function a(u,c,f,p,h,v){if(u!==f||c!==p){var m=h.push(o(h)+"scale(",null,",",null,")");v.push({i:m-4,x:Fn(u,f)},{i:m-2,x:Fn(c,p)})}else(f!==1||p!==1)&&h.push(o(h)+"scale("+f+","+p+")")}return function(u,c){var f=[],p=[];return u=e(u),c=e(c),i(u.translateX,u.translateY,c.translateX,c.translateY,f,p),s(u.rotate,c.rotate,f,p),l(u.skewX,c.skewX,f,p),a(u.scaleX,u.scaleY,c.scaleX,c.scaleY,f,p),u=c=null,function(h){for(var v=-1,m=p.length,E;++v<m;)f[(E=p[v]).i]=E.x(h);return f.join("")}}}var gR=vm(pR,"px, ","px)","deg)"),mR=vm(hR,", ",")",")"),vR=1e-12;function ym(e){return((e=Math.exp(e))+1/e)/2}function yR(e){return((e=Math.exp(e))-1/e)/2}function ER(e){return((e=Math.exp(2*e))-1)/(e+1)}const SR=function e(t,n,r){function o(i,s){var l=i[0],a=i[1],u=i[2],c=s[0],f=s[1],p=s[2],h=c-l,v=f-a,m=h*h+v*v,E,d;if(m<vR)d=Math.log(p/u)/t,E=function(T){return[l+T*h,a+T*v,u*Math.exp(t*T*d)]};else{var g=Math.sqrt(m),y=(p*p-u*u+r*m)/(2*u*n*g),S=(p*p-u*u-r*m)/(2*p*n*g),w=Math.log(Math.sqrt(y*y+1)-y),N=Math.log(Math.sqrt(S*S+1)-S);d=(N-w)/t,E=function(T){var b=T*d,D=ym(w),k=u/(n*g)*(D*ER(t*b+w)-yR(w));return[l+k*h,a+k*v,u*D/ym(t*b+w)]}}return E.duration=d*1e3*t/Math.SQRT2,E}return o.rho=function(i){var s=Math.max(.001,+i),l=s*s,a=l*l;return e(s,l,a)},o}(Math.SQRT2,2,4);var uo=0,Ai=0,bi=0,Em=1e3,Ul,Li,Fl=0,vr=0,Vl=0,Di=typeof performance=="object"&&performance.now?performance:Date,Sm=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Qc(){return vr||(Sm(_R),vr=Di.now()+Vl)}function _R(){vr=0}function Bl(){this._call=this._time=this._next=null}Bl.prototype=_m.prototype={constructor:Bl,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Qc():+n)+(t==null?0:+t),!this._next&&Li!==this&&(Li?Li._next=this:Ul=this,Li=this),this._call=e,this._time=n,Xc()},stop:function(){this._call&&(this._call=null,this._time=1/0,Xc())}};function _m(e,t,n){var r=new Bl;return r.restart(e,t,n),r}function wR(){Qc(),++uo;for(var e=Ul,t;e;)(t=vr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--uo}function wm(){vr=(Fl=Di.now())+Vl,uo=Ai=0;try{wR()}finally{uo=0,NR(),vr=0}}function RR(){var e=Di.now(),t=e-Fl;t>Em&&(Vl-=t,Fl=e)}function NR(){for(var e,t=Ul,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Ul=n);Li=e,Xc(r)}function Xc(e){if(!uo){Ai&&(Ai=clearTimeout(Ai));var t=e-vr;t>24?(e<1/0&&(Ai=setTimeout(wm,e-Di.now()-Vl)),bi&&(bi=clearInterval(bi))):(bi||(Fl=Di.now(),bi=setInterval(RR,Em)),uo=1,Sm(wm))}}function Rm(e,t,n){var r=new Bl;return t=t==null?0:+t,r.restart(o=>{r.stop(),e(o+t)},t,n),r}var OR=Tl("start","end","cancel","interrupt"),xR=[],Nm=0,Om=1,qc=2,$l=3,xm=4,Zc=5,zl=6;function Hl(e,t,n,r,o,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;TR(e,n,{name:t,index:r,group:o,on:OR,tween:xR,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:Nm})}function Jc(e,t){var n=bt(e,t);if(n.state>Nm)throw new Error("too late; already scheduled");return n}function jt(e,t){var n=bt(e,t);if(n.state>$l)throw new Error("too late; already running");return n}function bt(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function TR(e,t,n){var r=e.__transition,o;r[t]=n,n.timer=_m(i,0,n.time);function i(u){n.state=Om,n.timer.restart(s,n.delay,n.time),n.delay<=u&&s(u-n.delay)}function s(u){var c,f,p,h;if(n.state!==Om)return a();for(c in r)if(h=r[c],h.name===n.name){if(h.state===$l)return Rm(s);h.state===xm?(h.state=zl,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete r[c]):+c<t&&(h.state=zl,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete r[c])}if(Rm(function(){n.state===$l&&(n.state=xm,n.timer.restart(l,n.delay,n.time),l(u))}),n.state=qc,n.on.call("start",e,e.__data__,n.index,n.group),n.state===qc){for(n.state=$l,o=new Array(p=n.tween.length),c=0,f=-1;c<p;++c)(h=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(o[++f]=h);o.length=f+1}}function l(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(a),n.state=Zc,1),f=-1,p=o.length;++f<p;)o[f].call(e,c);n.state===Zc&&(n.on.call("end",e,e.__data__,n.index,n.group),a())}function a(){n.state=zl,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}}function jl(e,t){var n=e.__transition,r,o,i=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((r=n[s]).name!==t){i=!1;continue}o=r.state>qc&&r.state<Zc,r.state=zl,r.timer.stop(),r.on.call(o?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}i&&delete e.__transition}}function IR(e){return this.each(function(){jl(this,e)})}function CR(e,t){var n,r;return function(){var o=jt(this,e),i=o.tween;if(i!==n){r=n=i;for(var s=0,l=r.length;s<l;++s)if(r[s].name===t){r=r.slice(),r.splice(s,1);break}}o.tween=r}}function AR(e,t,n){var r,o;if(typeof n!="function")throw new Error;return function(){var i=jt(this,e),s=i.tween;if(s!==r){o=(r=s).slice();for(var l={name:t,value:n},a=0,u=o.length;a<u;++a)if(o[a].name===t){o[a]=l;break}a===u&&o.push(l)}i.tween=o}}function bR(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=bt(this.node(),n).tween,o=0,i=r.length,s;o<i;++o)if((s=r[o]).name===e)return s.value;return null}return this.each((t==null?CR:AR)(n,e,t))}function ef(e,t,n){var r=e._id;return e.each(function(){var o=jt(this,r);(o.value||(o.value={}))[t]=n.apply(this,arguments)}),function(o){return bt(o,r).value[t]}}function Tm(e,t){var n;return(typeof t=="number"?Fn:t instanceof Ci?hm:(n=Ci(t))?(t=n,hm):dR)(e,t)}function LR(e){return function(){this.removeAttribute(e)}}function DR(e){return function(){this.removeAttributeNS(e.space,e.local)}}function kR(e,t,n){var r,o=n+"",i;return function(){var s=this.getAttribute(e);return s===o?null:s===r?i:i=t(r=s,n)}}function PR(e,t,n){var r,o=n+"",i;return function(){var s=this.getAttributeNS(e.space,e.local);return s===o?null:s===r?i:i=t(r=s,n)}}function MR(e,t,n){var r,o,i;return function(){var s,l=n(this),a;return l==null?void this.removeAttribute(e):(s=this.getAttribute(e),a=l+"",s===a?null:s===r&&a===o?i:(o=a,i=t(r=s,l)))}}function UR(e,t,n){var r,o,i;return function(){var s,l=n(this),a;return l==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),a=l+"",s===a?null:s===r&&a===o?i:(o=a,i=t(r=s,l)))}}function FR(e,t){var n=Cl(e),r=n==="transform"?mR:Tm;return this.attrTween(e,typeof t=="function"?(n.local?UR:MR)(n,r,ef(this,"attr."+e,t)):t==null?(n.local?DR:LR)(n):(n.local?PR:kR)(n,r,t))}function VR(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function BR(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function $R(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&BR(e,i)),n}return o._value=t,o}function zR(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&VR(e,i)),n}return o._value=t,o}function HR(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=Cl(e);return this.tween(n,(r.local?$R:zR)(r,t))}function jR(e,t){return function(){Jc(this,e).delay=+t.apply(this,arguments)}}function WR(e,t){return t=+t,function(){Jc(this,e).delay=t}}function GR(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?jR:WR)(t,e)):bt(this.node(),t).delay}function YR(e,t){return function(){jt(this,e).duration=+t.apply(this,arguments)}}function KR(e,t){return t=+t,function(){jt(this,e).duration=t}}function QR(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?YR:KR)(t,e)):bt(this.node(),t).duration}function XR(e,t){if(typeof t!="function")throw new Error;return function(){jt(this,e).ease=t}}function qR(e){var t=this._id;return arguments.length?this.each(XR(t,e)):bt(this.node(),t).ease}function ZR(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;jt(this,e).ease=n}}function JR(e){if(typeof e!="function")throw new Error;return this.each(ZR(this._id,e))}function eN(e){typeof e!="function"&&(e=jg(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,l=r[o]=[],a,u=0;u<s;++u)(a=i[u])&&e.call(a,a.__data__,u,i)&&l.push(a);return new un(r,this._parents,this._name,this._id)}function tN(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,o=n.length,i=Math.min(r,o),s=new Array(r),l=0;l<i;++l)for(var a=t[l],u=n[l],c=a.length,f=s[l]=new Array(c),p,h=0;h<c;++h)(p=a[h]||u[h])&&(f[h]=p);for(;l<r;++l)s[l]=t[l];return new un(s,this._parents,this._name,this._id)}function nN(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function rN(e,t,n){var r,o,i=nN(t)?Jc:jt;return function(){var s=i(this,e),l=s.on;l!==r&&(o=(r=l).copy()).on(t,n),s.on=o}}function oN(e,t){var n=this._id;return arguments.length<2?bt(this.node(),n).on.on(e):this.each(rN(n,e,t))}function iN(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function sN(){return this.on("end.remove",iN(this._id))}function lN(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Vc(e));for(var r=this._groups,o=r.length,i=new Array(o),s=0;s<o;++s)for(var l=r[s],a=l.length,u=i[s]=new Array(a),c,f,p=0;p<a;++p)(c=l[p])&&(f=e.call(c,c.__data__,p,l))&&("__data__"in c&&(f.__data__=c.__data__),u[p]=f,Hl(u[p],t,n,p,u,bt(c,n)));return new un(i,this._parents,t,n)}function aN(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Hg(e));for(var r=this._groups,o=r.length,i=[],s=[],l=0;l<o;++l)for(var a=r[l],u=a.length,c,f=0;f<u;++f)if(c=a[f]){for(var p=e.call(c,c.__data__,f,a),h,v=bt(c,n),m=0,E=p.length;m<E;++m)(h=p[m])&&Hl(h,t,n,m,p,v);i.push(p),s.push(c)}return new un(i,s,t,n)}var uN=Ni.prototype.constructor;function cN(){return new uN(this._groups,this._parents)}function fN(e,t){var n,r,o;return function(){var i=so(this,e),s=(this.style.removeProperty(e),so(this,e));return i===s?null:i===n&&s===r?o:o=t(n=i,r=s)}}function Im(e){return function(){this.style.removeProperty(e)}}function dN(e,t,n){var r,o=n+"",i;return function(){var s=so(this,e);return s===o?null:s===r?i:i=t(r=s,n)}}function pN(e,t,n){var r,o,i;return function(){var s=so(this,e),l=n(this),a=l+"";return l==null&&(a=l=(this.style.removeProperty(e),so(this,e))),s===a?null:s===r&&a===o?i:(o=a,i=t(r=s,l))}}function hN(e,t){var n,r,o,i="style."+t,s="end."+i,l;return function(){var a=jt(this,e),u=a.on,c=a.value[i]==null?l||(l=Im(t)):void 0;(u!==n||o!==c)&&(r=(n=u).copy()).on(s,o=c),a.on=r}}function gN(e,t,n){var r=(e+="")=="transform"?gR:Tm;return t==null?this.styleTween(e,fN(e,r)).on("end.style."+e,Im(e)):typeof t=="function"?this.styleTween(e,pN(e,r,ef(this,"style."+e,t))).each(hN(this._id,e)):this.styleTween(e,dN(e,r,t),n).on("end.style."+e,null)}function mN(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function vN(e,t,n){var r,o;function i(){var s=t.apply(this,arguments);return s!==o&&(r=(o=s)&&mN(e,s,n)),r}return i._value=t,i}function yN(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,vN(e,t,n??""))}function EN(e){return function(){this.textContent=e}}function SN(e){return function(){var t=e(this);this.textContent=t??""}}function _N(e){return this.tween("text",typeof e=="function"?SN(ef(this,"text",e)):EN(e==null?"":e+""))}function wN(e){return function(t){this.textContent=e.call(this,t)}}function RN(e){var t,n;function r(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&wN(o)),t}return r._value=e,r}function NN(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,RN(e))}function ON(){for(var e=this._name,t=this._id,n=Cm(),r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],l=s.length,a,u=0;u<l;++u)if(a=s[u]){var c=bt(a,t);Hl(a,e,n,u,s,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new un(r,this._parents,e,n)}function xN(){var e,t,n=this,r=n._id,o=n.size();return new Promise(function(i,s){var l={value:s},a={value:function(){--o===0&&i()}};n.each(function(){var u=jt(this,r),c=u.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(a)),u.on=t}),o===0&&i()})}var TN=0;function un(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Cm(){return++TN}var cn=Ni.prototype;un.prototype={constructor:un,select:lN,selectAll:aN,selectChild:cn.selectChild,selectChildren:cn.selectChildren,filter:eN,merge:tN,selection:cN,transition:ON,call:cn.call,nodes:cn.nodes,node:cn.node,size:cn.size,empty:cn.empty,each:cn.each,on:oN,attr:FR,attrTween:HR,style:gN,styleTween:yN,text:_N,textTween:NN,remove:sN,tween:bR,delay:GR,duration:QR,ease:qR,easeVarying:JR,end:xN,[Symbol.iterator]:cn[Symbol.iterator]};function IN(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var CN={time:null,delay:0,duration:250,ease:IN};function AN(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function bN(e){var t,n;e instanceof un?(t=e._id,e=e._name):(t=Cm(),(n=CN).time=Qc(),e=e==null?null:e+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],l=s.length,a,u=0;u<l;++u)(a=s[u])&&Hl(a,e,t,u,s,n||AN(a,t));return new un(r,this._parents,e,t)}Ni.prototype.interrupt=IR,Ni.prototype.transition=bN;const Wl=e=>()=>e;function LN(e,{sourceEvent:t,target:n,transform:r,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function fn(e,t,n){this.k=e,this.x=t,this.y=n}fn.prototype={constructor:fn,scale:function(e){return e===1?this:new fn(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new fn(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Vn=new fn(1,0,0);fn.prototype;function tf(e){e.stopImmediatePropagation()}function ki(e){e.preventDefault(),e.stopImmediatePropagation()}function DN(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function kN(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Am(){return this.__zoom||Vn}function PN(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function MN(){return navigator.maxTouchPoints||"ontouchstart"in this}function UN(e,t,n){var r=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function FN(){var e=DN,t=kN,n=UN,r=PN,o=MN,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],l=250,a=SR,u=Tl("start","zoom","end"),c,f,p,h=500,v=150,m=0,E=10;function d(R){R.property("__zoom",Am).on("wheel.zoom",b,{passive:!1}).on("mousedown.zoom",D).on("dblclick.zoom",k).filter(o).on("touchstart.zoom",B).on("touchmove.zoom",F).on("touchend.zoom touchcancel.zoom",z).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}d.transform=function(R,P,A,C){var x=R.selection?R.selection():R;x.property("__zoom",Am),R!==x?w(R,P,A,C):x.interrupt().each(function(){N(this,arguments).event(C).start().zoom(null,typeof P=="function"?P.apply(this,arguments):P).end()})},d.scaleBy=function(R,P,A,C){d.scaleTo(R,function(){var x=this.__zoom.k,L=typeof P=="function"?P.apply(this,arguments):P;return x*L},A,C)},d.scaleTo=function(R,P,A,C){d.transform(R,function(){var x=t.apply(this,arguments),L=this.__zoom,U=A==null?S(x):typeof A=="function"?A.apply(this,arguments):A,$=L.invert(U),j=typeof P=="function"?P.apply(this,arguments):P;return n(y(g(L,j),U,$),x,s)},A,C)},d.translateBy=function(R,P,A,C){d.transform(R,function(){return n(this.__zoom.translate(typeof P=="function"?P.apply(this,arguments):P,typeof A=="function"?A.apply(this,arguments):A),t.apply(this,arguments),s)},null,C)},d.translateTo=function(R,P,A,C,x){d.transform(R,function(){var L=t.apply(this,arguments),U=this.__zoom,$=C==null?S(L):typeof C=="function"?C.apply(this,arguments):C;return n(Vn.translate($[0],$[1]).scale(U.k).translate(typeof P=="function"?-P.apply(this,arguments):-P,typeof A=="function"?-A.apply(this,arguments):-A),L,s)},C,x)};function g(R,P){return P=Math.max(i[0],Math.min(i[1],P)),P===R.k?R:new fn(P,R.x,R.y)}function y(R,P,A){var C=P[0]-A[0]*R.k,x=P[1]-A[1]*R.k;return C===R.x&&x===R.y?R:new fn(R.k,C,x)}function S(R){return[(+R[0][0]+ +R[1][0])/2,(+R[0][1]+ +R[1][1])/2]}function w(R,P,A,C){R.on("start.zoom",function(){N(this,arguments).event(C).start()}).on("interrupt.zoom end.zoom",function(){N(this,arguments).event(C).end()}).tween("zoom",function(){var x=this,L=arguments,U=N(x,L).event(C),$=t.apply(x,L),j=A==null?S($):typeof A=="function"?A.apply(x,L):A,Q=Math.max($[1][0]-$[0][0],$[1][1]-$[0][1]),K=x.__zoom,X=typeof P=="function"?P.apply(x,L):P,q=a(K.invert(j).concat(Q/K.k),X.invert(j).concat(Q/X.k));return function(J){if(J===1)J=X;else{var ne=q(J),he=Q/ne[2];J=new fn(he,j[0]-ne[0]*he,j[1]-ne[1]*he)}U.zoom(null,J)}})}function N(R,P,A){return!A&&R.__zooming||new T(R,P)}function T(R,P){this.that=R,this.args=P,this.active=0,this.sourceEvent=null,this.extent=t.apply(R,P),this.taps=0}T.prototype={event:function(R){return R&&(this.sourceEvent=R),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(R,P){return this.mouse&&R!=="mouse"&&(this.mouse[1]=P.invert(this.mouse[0])),this.touch0&&R!=="touch"&&(this.touch0[1]=P.invert(this.touch0[0])),this.touch1&&R!=="touch"&&(this.touch1[1]=P.invert(this.touch1[0])),this.that.__zoom=P,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(R){var P=Ct(this.that).datum();u.call(R,this.that,new LN(R,{sourceEvent:this.sourceEvent,target:d,type:R,transform:this.that.__zoom,dispatch:u}),P)}};function b(R,...P){if(!e.apply(this,arguments))return;var A=N(this,P).event(R),C=this.__zoom,x=Math.max(i[0],Math.min(i[1],C.k*Math.pow(2,r.apply(this,arguments)))),L=zt(R);if(A.wheel)(A.mouse[0][0]!==L[0]||A.mouse[0][1]!==L[1])&&(A.mouse[1]=C.invert(A.mouse[0]=L)),clearTimeout(A.wheel);else{if(C.k===x)return;A.mouse=[L,C.invert(L)],jl(this),A.start()}ki(R),A.wheel=setTimeout(U,v),A.zoom("mouse",n(y(g(C,x),A.mouse[0],A.mouse[1]),A.extent,s));function U(){A.wheel=null,A.end()}}function D(R,...P){if(p||!e.apply(this,arguments))return;var A=R.currentTarget,C=N(this,P,!0).event(R),x=Ct(R.view).on("mousemove.zoom",j,!0).on("mouseup.zoom",Q,!0),L=zt(R,A),U=R.clientX,$=R.clientY;em(R.view),tf(R),C.mouse=[L,this.__zoom.invert(L)],jl(this),C.start();function j(K){if(ki(K),!C.moved){var X=K.clientX-U,q=K.clientY-$;C.moved=X*X+q*q>m}C.event(K).zoom("mouse",n(y(C.that.__zoom,C.mouse[0]=zt(K,A),C.mouse[1]),C.extent,s))}function Q(K){x.on("mousemove.zoom mouseup.zoom",null),tm(K.view,C.moved),ki(K),C.event(K).end()}}function k(R,...P){if(e.apply(this,arguments)){var A=this.__zoom,C=zt(R.changedTouches?R.changedTouches[0]:R,this),x=A.invert(C),L=A.k*(R.shiftKey?.5:2),U=n(y(g(A,L),C,x),t.apply(this,P),s);ki(R),l>0?Ct(this).transition().duration(l).call(w,U,C,R):Ct(this).call(d.transform,U,C,R)}}function B(R,...P){if(e.apply(this,arguments)){var A=R.touches,C=A.length,x=N(this,P,R.changedTouches.length===C).event(R),L,U,$,j;for(tf(R),U=0;U<C;++U)$=A[U],j=zt($,this),j=[j,this.__zoom.invert(j),$.identifier],x.touch0?!x.touch1&&x.touch0[2]!==j[2]&&(x.touch1=j,x.taps=0):(x.touch0=j,L=!0,x.taps=1+!!c);c&&(c=clearTimeout(c)),L&&(x.taps<2&&(f=j[0],c=setTimeout(function(){c=null},h)),jl(this),x.start())}}function F(R,...P){if(this.__zooming){var A=N(this,P).event(R),C=R.changedTouches,x=C.length,L,U,$,j;for(ki(R),L=0;L<x;++L)U=C[L],$=zt(U,this),A.touch0&&A.touch0[2]===U.identifier?A.touch0[0]=$:A.touch1&&A.touch1[2]===U.identifier&&(A.touch1[0]=$);if(U=A.that.__zoom,A.touch1){var Q=A.touch0[0],K=A.touch0[1],X=A.touch1[0],q=A.touch1[1],J=(J=X[0]-Q[0])*J+(J=X[1]-Q[1])*J,ne=(ne=q[0]-K[0])*ne+(ne=q[1]-K[1])*ne;U=g(U,Math.sqrt(J/ne)),$=[(Q[0]+X[0])/2,(Q[1]+X[1])/2],j=[(K[0]+q[0])/2,(K[1]+q[1])/2]}else if(A.touch0)$=A.touch0[0],j=A.touch0[1];else return;A.zoom("touch",n(y(U,$,j),A.extent,s))}}function z(R,...P){if(this.__zooming){var A=N(this,P).event(R),C=R.changedTouches,x=C.length,L,U;for(tf(R),p&&clearTimeout(p),p=setTimeout(function(){p=null},h),L=0;L<x;++L)U=C[L],A.touch0&&A.touch0[2]===U.identifier?delete A.touch0:A.touch1&&A.touch1[2]===U.identifier&&delete A.touch1;if(A.touch1&&!A.touch0&&(A.touch0=A.touch1,delete A.touch1),A.touch0)A.touch0[1]=this.__zoom.invert(A.touch0[0]);else if(A.end(),A.taps===2&&(U=zt(U,this),Math.hypot(f[0]-U[0],f[1]-U[1])<E)){var $=Ct(this).on("dblclick.zoom");$&&$.apply(this,arguments)}}}return d.wheelDelta=function(R){return arguments.length?(r=typeof R=="function"?R:Wl(+R),d):r},d.filter=function(R){return arguments.length?(e=typeof R=="function"?R:Wl(!!R),d):e},d.touchable=function(R){return arguments.length?(o=typeof R=="function"?R:Wl(!!R),d):o},d.extent=function(R){return arguments.length?(t=typeof R=="function"?R:Wl([[+R[0][0],+R[0][1]],[+R[1][0],+R[1][1]]]),d):t},d.scaleExtent=function(R){return arguments.length?(i[0]=+R[0],i[1]=+R[1],d):[i[0],i[1]]},d.translateExtent=function(R){return arguments.length?(s[0][0]=+R[0][0],s[1][0]=+R[1][0],s[0][1]=+R[0][1],s[1][1]=+R[1][1],d):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},d.constrain=function(R){return arguments.length?(n=R,d):n},d.duration=function(R){return arguments.length?(l=+R,d):l},d.interpolate=function(R){return arguments.length?(a=R,d):a},d.on=function(){var R=u.on.apply(u,arguments);return R===u?d:R},d.clickDistance=function(R){return arguments.length?(m=(R=+R)*R,d):Math.sqrt(m)},d.tapDistance=function(R){return arguments.length?(E=+R,d):E},d}const Gl=O.createContext(null),VN=Gl.Provider,dn={"001":()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001","002":()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.","003":e=>`Node type "${e}" not found. Using fallback type "default".`,"004":()=>"The React Flow parent container needs a width and a height to render the graph.","005":()=>"Only child nodes can use a parent extent.","006":()=>"Can't create edge. An edge needs a source and a target.","007":e=>`The old edge with id=${e} does not exist.`,"009":e=>`Marker type "${e}" doesn't exist.`,"008":(e,t)=>`Couldn't create edge for ${e?"target":"source"} handle id: "${e?t.targetHandle:t.sourceHandle}", edge id: ${t.id}.`,"010":()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.","011":e=>`Edge type "${e}" not found. Using fallback type "default".`},bm=dn["001"]();function de(e,t){const n=O.useContext(Gl);if(n===null)throw new Error(bm);return Fg(n,e,t)}const Ce=()=>{const e=O.useContext(Gl);if(e===null)throw new Error(bm);return O.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},BN=e=>e.userSelectionActive?"none":"all";function nf({position:e,children:t,className:n,style:r,...o}){const i=de(BN),s=`${e}`.split("-");return _("div",{className:Ke(["react-flow__panel",n,...s]),style:{...r,pointerEvents:i},...o,children:t})}function $N({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:_(nf,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:_("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const zN=({x:e,y:t,label:n,labelStyle:r={},labelShowBg:o=!0,labelBgStyle:i={},labelBgPadding:s=[2,4],labelBgBorderRadius:l=2,children:a,className:u,...c})=>{const f=O.useRef(null),[p,h]=O.useState({x:0,y:0,width:0,height:0}),v=Ke(["react-flow__edge-textwrapper",u]);return O.useEffect(()=>{if(f.current){const m=f.current.getBBox();h({x:m.x,y:m.y,width:m.width,height:m.height})}},[n]),typeof n>"u"||!n?null:V("g",{transform:`translate(${e-p.width/2} ${t-p.height/2})`,className:v,visibility:p.width?"visible":"hidden",...c,children:[o&&_("rect",{width:p.width+2*s[0],x:-s[0],y:-s[1],height:p.height+2*s[1],className:"react-flow__edge-textbg",style:i,rx:l,ry:l}),_("text",{className:"react-flow__edge-text",y:p.height/2,dy:"0.3em",ref:f,style:r,children:n}),a]})};var HN=O.memo(zN);const rf=e=>({width:e.offsetWidth,height:e.offsetHeight}),co=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),of=(e={x:0,y:0},t)=>({x:co(e.x,t[0][0],t[1][0]),y:co(e.y,t[0][1],t[1][1])}),Lm=(e,t,n)=>e<t?co(Math.abs(e-t),1,50)/50:e>n?-co(Math.abs(e-n),1,50)/50:0,Dm=(e,t)=>{const n=Lm(e.x,35,t.width-35)*20,r=Lm(e.y,35,t.height-35)*20;return[n,r]},km=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},jN=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Pm=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),WN=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Mm=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),sf=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},GN=e=>mt(e.width)&&mt(e.height)&&mt(e.x)&&mt(e.y),mt=e=>!isNaN(e)&&isFinite(e),_e=Symbol.for("internals"),Um=["Enter"," ","Escape"],Fm=(e,t)=>{},YN=e=>"nativeEvent"in e;function lf(e){var i,s;const t=YN(e)?e.nativeEvent:e,n=((s=(i=t.composedPath)==null?void 0:i.call(t))==null?void 0:s[0])||e.target,r=["INPUT","SELECT","TEXTAREA"].includes(n==null?void 0:n.nodeName)||(n==null?void 0:n.hasAttribute("contenteditable")),o=e.ctrlKey||e.metaKey||e.shiftKey;return r&&!o||!!(n!=null&&n.closest(".nokey"))}const Vm=e=>"clientX"in e,Bn=(e,t)=>{var i,s;const n=Vm(e),r=n?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,o=n?e.clientY:(s=e.touches)==null?void 0:s[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:o-((t==null?void 0:t.top)??0)}},fo=({path:e,labelX:t,labelY:n,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:a,style:u,markerEnd:c,markerStart:f,interactionWidth:p=20})=>V(Ae,{children:[_("path",{style:u,d:e,fill:"none",className:"react-flow__edge-path",markerEnd:c,markerStart:f}),p&&_("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:p,className:"react-flow__edge-interaction"}),r&&mt(t)&&mt(n)?_(HN,{x:t,y:n,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:a}):null]});fo.displayName="BaseEdge";function Pi(e,t,n){return n===void 0?n:r=>{const o=t().edges.find(i=>i.id===e);o&&n(r,{...o})}}function Bm({sourceX:e,sourceY:t,targetX:n,targetY:r}){const o=Math.abs(n-e)/2,i=n<e?n+o:n-o,s=Math.abs(r-t)/2,l=r<t?r+s:r-s;return[i,l,o,s]}function $m({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:o,sourceControlY:i,targetControlX:s,targetControlY:l}){const a=e*.125+o*.375+s*.375+n*.125,u=t*.125+i*.375+l*.375+r*.125,c=Math.abs(a-e),f=Math.abs(u-t);return[a,u,c,f]}var $n;(function(e){e.Strict="strict",e.Loose="loose"})($n||($n={}));var po;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(po||(po={}));var Mi;(function(e){e.Partial="partial",e.Full="full"})(Mi||(Mi={}));var zn;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(zn||(zn={}));var Ui;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Ui||(Ui={}));var G;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(G||(G={}));function zm({pos:e,x1:t,y1:n,x2:r,y2:o}){return e===G.Left||e===G.Right?[.5*(t+r),n]:[t,.5*(n+o)]}function Hm({sourceX:e,sourceY:t,sourcePosition:n=G.Bottom,targetX:r,targetY:o,targetPosition:i=G.Top}){const[s,l]=zm({pos:n,x1:e,y1:t,x2:r,y2:o}),[a,u]=zm({pos:i,x1:r,y1:o,x2:e,y2:t}),[c,f,p,h]=$m({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:s,sourceControlY:l,targetControlX:a,targetControlY:u});return[`M${e},${t} C${s},${l} ${a},${u} ${r},${o}`,c,f,p,h]}const af=O.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:o=G.Bottom,targetPosition:i=G.Top,label:s,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:v,interactionWidth:m})=>{const[E,d,g]=Hm({sourceX:e,sourceY:t,sourcePosition:o,targetX:n,targetY:r,targetPosition:i});return _(fo,{path:E,labelX:d,labelY:g,label:s,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:v,interactionWidth:m})});af.displayName="SimpleBezierEdge";const jm={[G.Left]:{x:-1,y:0},[G.Right]:{x:1,y:0},[G.Top]:{x:0,y:-1},[G.Bottom]:{x:0,y:1}},KN=({source:e,sourcePosition:t=G.Bottom,target:n})=>t===G.Left||t===G.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},Wm=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function QN({source:e,sourcePosition:t=G.Bottom,target:n,targetPosition:r=G.Top,center:o,offset:i}){const s=jm[t],l=jm[r],a={x:e.x+s.x*i,y:e.y+s.y*i},u={x:n.x+l.x*i,y:n.y+l.y*i},c=KN({source:a,sourcePosition:t,target:u}),f=c.x!==0?"x":"y",p=c[f];let h=[],v,m;const[E,d,g,y]=Bm({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[f]*l[f]===-1){v=o.x||E,m=o.y||d;const w=[{x:v,y:a.y},{x:v,y:u.y}],N=[{x:a.x,y:m},{x:u.x,y:m}];s[f]===p?h=f==="x"?w:N:h=f==="x"?N:w}else{const w=[{x:a.x,y:u.y}],N=[{x:u.x,y:a.y}];if(f==="x"?h=s.x===p?N:w:h=s.y===p?w:N,t!==r){const T=f==="x"?"y":"x",b=s[f]===l[T],D=a[T]>u[T],k=a[T]<u[T];(s[f]===1&&(!b&&D||b&&k)||s[f]!==1&&(!b&&k||b&&D))&&(h=f==="x"?w:N)}v=h[0].x,m=h[0].y}return[[e,a,...h,u,n],v,m,g,y]}function XN(e,t,n,r){const o=Math.min(Wm(e,t)/2,Wm(t,n)/2,r),{x:i,y:s}=t;if(e.x===i&&i===n.x||e.y===s&&s===n.y)return`L${i} ${s}`;if(e.y===s){const u=e.x<n.x?-1:1,c=e.y<n.y?1:-1;return`L ${i+o*u},${s}Q ${i},${s} ${i},${s+o*c}`}const l=e.x<n.x?1:-1,a=e.y<n.y?-1:1;return`L ${i},${s+o*a}Q ${i},${s} ${i+o*l},${s}`}function Fi({sourceX:e,sourceY:t,sourcePosition:n=G.Bottom,targetX:r,targetY:o,targetPosition:i=G.Top,borderRadius:s=5,centerX:l,centerY:a,offset:u=20}){const[c,f,p,h,v]=QN({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:i,center:{x:l,y:a},offset:u});return[c.reduce((E,d,g)=>{let y="";return g>0&&g<c.length-1?y=XN(c[g-1],d,c[g+1],s):y=`${g===0?"M":"L"}${d.x} ${d.y}`,E+=y,E},""),f,p,h,v]}const Yl=O.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:a,labelBgBorderRadius:u,style:c,sourcePosition:f=G.Bottom,targetPosition:p=G.Top,markerEnd:h,markerStart:v,pathOptions:m,interactionWidth:E})=>{const[d,g,y]=Fi({sourceX:e,sourceY:t,sourcePosition:f,targetX:n,targetY:r,targetPosition:p,borderRadius:m==null?void 0:m.borderRadius,offset:m==null?void 0:m.offset});return _(fo,{path:d,labelX:g,labelY:y,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:a,labelBgBorderRadius:u,style:c,markerEnd:h,markerStart:v,interactionWidth:E})});Yl.displayName="SmoothStepEdge";const uf=O.memo(e=>{var t;return _(Yl,{...e,pathOptions:O.useMemo(()=>{var n;return{borderRadius:0,offset:(n=e.pathOptions)==null?void 0:n.offset}},[(t=e.pathOptions)==null?void 0:t.offset])})});uf.displayName="StepEdge";function qN({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[o,i,s,l]=Bm({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,i,s,l]}const cf=O.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:a,labelBgBorderRadius:u,style:c,markerEnd:f,markerStart:p,interactionWidth:h})=>{const[v,m,E]=qN({sourceX:e,sourceY:t,targetX:n,targetY:r});return _(fo,{path:v,labelX:m,labelY:E,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:a,labelBgBorderRadius:u,style:c,markerEnd:f,markerStart:p,interactionWidth:h})});cf.displayName="StraightEdge";function Kl(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Gm({pos:e,x1:t,y1:n,x2:r,y2:o,c:i}){switch(e){case G.Left:return[t-Kl(t-r,i),n];case G.Right:return[t+Kl(r-t,i),n];case G.Top:return[t,n-Kl(n-o,i)];case G.Bottom:return[t,n+Kl(o-n,i)]}}function Ym({sourceX:e,sourceY:t,sourcePosition:n=G.Bottom,targetX:r,targetY:o,targetPosition:i=G.Top,curvature:s=.25}){const[l,a]=Gm({pos:n,x1:e,y1:t,x2:r,y2:o,c:s}),[u,c]=Gm({pos:i,x1:r,y1:o,x2:e,y2:t,c:s}),[f,p,h,v]=$m({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:l,sourceControlY:a,targetControlX:u,targetControlY:c});return[`M${e},${t} C${l},${a} ${u},${c} ${r},${o}`,f,p,h,v]}const Ql=O.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:o=G.Bottom,targetPosition:i=G.Top,label:s,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:v,pathOptions:m,interactionWidth:E})=>{const[d,g,y]=Ym({sourceX:e,sourceY:t,sourcePosition:o,targetX:n,targetY:r,targetPosition:i,curvature:m==null?void 0:m.curvature});return _(fo,{path:d,labelX:g,labelY:y,label:s,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:v,interactionWidth:E})});Ql.displayName="BezierEdge";const ff=O.createContext(null),ZN=ff.Provider;ff.Consumer;const JN=()=>O.useContext(ff),eO=e=>"id"in e&&"source"in e&&"target"in e,Km=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`reactflow__edge-${e}${t||""}-${n}${r||""}`,df=(e,t)=>typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`,tO=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),Qm=(e,t)=>{if(!e.source||!e.target)return t;let n;return eO(e)?n={...e}:n={...e,id:Km(e)},tO(n,t)?t:t.concat(n)},nO=(e,t,n)=>{if(!t.source||!t.target)return n;if(!n.find(i=>i.id===e.id))return Fm("007",dn["007"](e.id)),n;const o={...e,id:Km(t),source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle};return n.filter(i=>i.id!==e.id).concat(o)},Xm=({x:e,y:t},[n,r,o],i,[s,l])=>{const a={x:(e-n)/o,y:(t-r)/o};return i?{x:s*Math.round(a.x/s),y:l*Math.round(a.y/l)}:a},rO=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r}),ho=(e,t=[0,0])=>{if(!e)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const n=(e.width??0)*t[0],r=(e.height??0)*t[1],o={x:e.position.x-n,y:e.position.y-r};return{...o,positionAbsolute:e.positionAbsolute?{x:e.positionAbsolute.x-n,y:e.positionAbsolute.y-r}:o}},qm=(e,t=[0,0])=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,o)=>{const{x:i,y:s}=ho(o,t).positionAbsolute;return jN(r,Pm({x:i,y:s,width:o.width||0,height:o.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return WN(n)},Zm=(e,t,[n,r,o]=[0,0,1],i=!1,s=!1,l=[0,0])=>{const a={x:(t.x-n)/o,y:(t.y-r)/o,width:t.width/o,height:t.height/o},u=[];return e.forEach(c=>{const{width:f,height:p,selectable:h=!0,hidden:v=!1}=c;if(s&&!h||v)return!1;const{positionAbsolute:m}=ho(c,l),E={x:m.x,y:m.y,width:f||0,height:p||0},d=sf(a,E),g=typeof f>"u"||typeof p>"u"||f===null||p===null,y=i&&d>0,S=(f||0)*(p||0);(g||y||d>=S||c.dragging)&&u.push(c)}),u},Jm=(e,t)=>{const n=e.map(r=>r.id);return t.filter(r=>n.includes(r.source)||n.includes(r.target))},ev=(e,t,n,r,o,i=.1)=>{const s=t/(e.width*(1+i)),l=n/(e.height*(1+i)),a=Math.min(s,l),u=co(a,r,o),c=e.x+e.width/2,f=e.y+e.height/2,p=t/2-c*u,h=n/2-f*u;return[p,h,u]},yr=(e,t=0)=>e.transition().duration(t);function tv(e,t,n,r){return(t[n]||[]).reduce((o,i)=>{var s,l;return`${e.id}-${i.id}-${n}`!==r&&o.push({id:i.id||null,type:n,nodeId:e.id,x:(((s=e.positionAbsolute)==null?void 0:s.x)??0)+i.x+i.width/2,y:(((l=e.positionAbsolute)==null?void 0:l.y)??0)+i.y+i.height/2}),o},[])}function oO(e,t,n){let r=null,o=1/0;return n.forEach(i=>{const s=Math.sqrt(Math.pow(i.x-e.x,2)+Math.pow(i.y-e.y,2));s<=t&&s<o&&(o=s,r=i)}),r}const iO={source:null,target:null,sourceHandle:null,targetHandle:null};function nv(e,t,n,r,o,i,s,l){const a=i==="target",u=l.querySelector(`.react-flow__handle[data-id="${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`),{x:c,y:f}=Bn(e),p=l.elementFromPoint(c,f),h=p!=null&&p.classList.contains("react-flow__handle")?p:u,v={handleDomNode:h,isValid:!1,connection:iO};if(h){const m=rv(void 0,h),E=h.getAttribute("data-nodeid"),d=h.getAttribute("data-handleid"),g={source:a?E:r,sourceHandle:a?d:o,target:a?r:E,targetHandle:a?o:d};v.connection=g,(n===$n.Strict?a&&m==="source"||!a&&m==="target":E!==r||d!==o)&&(v.isValid=s(g))}return v}function sO({nodes:e,nodeId:t,handleId:n,handleType:r}){return e.reduce((o,i)=>{if(i[_e]){const{handleBounds:s}=i[_e];let l=[],a=[];s&&(l=tv(i,s,"source",`${t}-${n}-${r}`),a=tv(i,s,"target",`${t}-${n}-${r}`)),o.push(...l,...a)}return o},[])}function rv(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function pf(e){e==null||e.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function lO(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function ov({event:e,handleId:t,nodeId:n,onConnect:r,isTarget:o,getState:i,setState:s,isValidConnection:l,edgeUpdaterType:a,onEdgeUpdateEnd:u}){const c=km(e.target),{connectionMode:f,domNode:p,autoPanOnConnect:h,connectionRadius:v,onConnectStart:m,panBy:E,getNodes:d,cancelConnection:g}=i();let y=0,S;const{x:w,y:N}=Bn(e),T=c==null?void 0:c.elementFromPoint(w,N),b=rv(a,T),D=p==null?void 0:p.getBoundingClientRect();if(!D||!b)return;let k,B=Bn(e,D),F=!1,z=null,R=!1,P=null;const A=sO({nodes:d(),nodeId:n,handleId:t,handleType:b}),C=()=>{if(!h)return;const[U,$]=Dm(B,D);E({x:U,y:$}),y=requestAnimationFrame(C)};s({connectionPosition:B,connectionNodeId:n,connectionHandleId:t,connectionHandleType:b,connectionStatus:null}),m==null||m(e,{nodeId:n,handleId:t,handleType:b});function x(U){const{transform:$}=i();B=Bn(U,D),S=oO(Xm(B,$,!1,[1,1]),v,A),F||(C(),F=!0);const j=nv(U,S,f,n,t,o?"target":"source",l,c);if(P=j.handleDomNode,z=j.connection,R=j.isValid,s({connectionPosition:S&&R?rO({x:S.x,y:S.y},$):B,connectionStatus:lO(!!S,R)}),!S&&!R&&!P)return pf(k);z.source!==z.target&&P&&(pf(k),k=P,P.classList.add("connecting","react-flow__handle-connecting"),P.classList.toggle("valid",R),P.classList.toggle("react-flow__handle-valid",R))}function L(U){var $,j;(S||P)&&z&&R&&(r==null||r(z)),(j=($=i()).onConnectEnd)==null||j.call($,U),a&&(u==null||u(U)),pf(k),g(),cancelAnimationFrame(y),F=!1,R=!1,z=null,P=null,c.removeEventListener("mousemove",x),c.removeEventListener("mouseup",L),c.removeEventListener("touchmove",x),c.removeEventListener("touchend",L)}c.addEventListener("mousemove",x),c.addEventListener("mouseup",L),c.addEventListener("touchmove",x),c.addEventListener("touchend",L)}const aO=()=>!0,uO=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),iv=O.forwardRef(({type:e="source",position:t=G.Top,isValidConnection:n=aO,isConnectable:r=!0,id:o,onConnect:i,children:s,className:l,onMouseDown:a,onTouchStart:u,...c},f)=>{var N,T;const p=Ce(),h=JN();if(!h)return(T=(N=p.getState()).onError)==null||T.call(N,"010",dn["010"]()),null;const{connectionStartHandle:v,connectOnClick:m,noPanClassName:E}=de(uO,Qe),d=o||null,g=e==="target",y=b=>{const{defaultEdgeOptions:D,onConnect:k,hasDefaultEdges:B}=p.getState(),F={...D,...b};if(B){const{edges:z}=p.getState();p.setState({edges:Qm(F,z)})}k==null||k(F),i==null||i(F)},S=b=>{const D=Vm(b);(D&&b.button===0||!D)&&ov({event:b,handleId:d,nodeId:h,onConnect:y,isTarget:g,getState:p.getState,setState:p.setState,isValidConnection:n}),D?a==null||a(b):u==null||u(b)},w=b=>{const{onClickConnectStart:D,onClickConnectEnd:k,connectionMode:B}=p.getState();if(!v){D==null||D(b,{nodeId:h,handleId:d,handleType:e}),p.setState({connectionStartHandle:{nodeId:h,type:e,handleId:d}});return}const F=km(b.target),{connection:z,isValid:R}=nv(b,{nodeId:h,id:d,type:e},B,v.nodeId,v.handleId||null,v.type,n,F);R&&y(z),k==null||k(b),p.setState({connectionStartHandle:null})};return _("div",{"data-handleid":d,"data-nodeid":h,"data-handlepos":t,"data-id":`${h}-${d}-${e}`,className:Ke(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",E,l,{source:!g,target:g,connectable:r,connecting:(v==null?void 0:v.nodeId)===h&&(v==null?void 0:v.handleId)===d&&(v==null?void 0:v.type)===e}]),onMouseDown:S,onTouchStart:S,onClick:m?w:void 0,ref:f,...c,children:s})});iv.displayName="Handle";var go=O.memo(iv);const sv=({data:e,isConnectable:t,targetPosition:n=G.Top,sourcePosition:r=G.Bottom})=>V(Ae,{children:[_(go,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,_(go,{type:"source",position:r,isConnectable:t})]});sv.displayName="DefaultNode";var hf=O.memo(sv);const lv=({data:e,isConnectable:t,sourcePosition:n=G.Bottom})=>V(Ae,{children:[e==null?void 0:e.label,_(go,{type:"source",position:n,isConnectable:t})]});lv.displayName="InputNode";var av=O.memo(lv);const uv=({data:e,isConnectable:t,targetPosition:n=G.Top})=>V(Ae,{children:[_(go,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]});uv.displayName="OutputNode";var cv=O.memo(uv);const gf=()=>null;gf.displayName="GroupNode";const cO=e=>({selectedNodes:e.getNodes().filter(t=>t.selected),selectedEdges:e.edges.filter(t=>t.selected)}),Xl=e=>e.id;function fO(e,t){return Qe(e.selectedNodes.map(Xl),t.selectedNodes.map(Xl))&&Qe(e.selectedEdges.map(Xl),t.selectedEdges.map(Xl))}const fv=O.memo(({onSelectionChange:e})=>{const t=Ce(),{selectedNodes:n,selectedEdges:r}=de(cO,fO);return O.useEffect(()=>{var i,s;const o={nodes:n,edges:r};e==null||e(o),(s=(i=t.getState()).onSelectionChange)==null||s.call(i,o)},[n,r,e]),null});fv.displayName="SelectionListener";const dO=e=>!!e.onSelectionChange;function pO({onSelectionChange:e}){const t=de(dO);return e||t?_(fv,{onSelectionChange:e}):null}const hO=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset});function mo(e,t){O.useEffect(()=>{typeof e<"u"&&t(e)},[e])}function ee(e,t,n){O.useEffect(()=>{typeof t<"u"&&n({[e]:t})},[t])}const gO=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:o,onConnectStart:i,onConnectEnd:s,onClickConnectStart:l,onClickConnectEnd:a,nodesDraggable:u,nodesConnectable:c,nodesFocusable:f,edgesFocusable:p,elevateNodesOnSelect:h,minZoom:v,maxZoom:m,nodeExtent:E,onNodesChange:d,onEdgesChange:g,elementsSelectable:y,connectionMode:S,snapGrid:w,snapToGrid:N,translateExtent:T,connectOnClick:b,defaultEdgeOptions:D,fitView:k,fitViewOptions:B,onNodesDelete:F,onEdgesDelete:z,onNodeDrag:R,onNodeDragStart:P,onNodeDragStop:A,onSelectionDrag:C,onSelectionDragStart:x,onSelectionDragStop:L,noPanClassName:U,nodeOrigin:$,rfId:j,autoPanOnConnect:Q,autoPanOnNodeDrag:K,onError:X,connectionRadius:q})=>{const{setNodes:J,setEdges:ne,setDefaultNodesAndEdges:he,setMinZoom:ie,setMaxZoom:Pe,setTranslateExtent:Ze,setNodeExtent:ge,reset:at}=de(hO,Qe),Y=Ce();return O.useEffect(()=>{const ze=r==null?void 0:r.map(ut=>({...ut,...D}));return he(n,ze),()=>{at()}},[]),ee("defaultEdgeOptions",D,Y.setState),ee("connectionMode",S,Y.setState),ee("onConnect",o,Y.setState),ee("onConnectStart",i,Y.setState),ee("onConnectEnd",s,Y.setState),ee("onClickConnectStart",l,Y.setState),ee("onClickConnectEnd",a,Y.setState),ee("nodesDraggable",u,Y.setState),ee("nodesConnectable",c,Y.setState),ee("nodesFocusable",f,Y.setState),ee("edgesFocusable",p,Y.setState),ee("elementsSelectable",y,Y.setState),ee("elevateNodesOnSelect",h,Y.setState),ee("snapToGrid",N,Y.setState),ee("snapGrid",w,Y.setState),ee("onNodesChange",d,Y.setState),ee("onEdgesChange",g,Y.setState),ee("connectOnClick",b,Y.setState),ee("fitViewOnInit",k,Y.setState),ee("fitViewOnInitOptions",B,Y.setState),ee("onNodesDelete",F,Y.setState),ee("onEdgesDelete",z,Y.setState),ee("onNodeDrag",R,Y.setState),ee("onNodeDragStart",P,Y.setState),ee("onNodeDragStop",A,Y.setState),ee("onSelectionDrag",C,Y.setState),ee("onSelectionDragStart",x,Y.setState),ee("onSelectionDragStop",L,Y.setState),ee("noPanClassName",U,Y.setState),ee("nodeOrigin",$,Y.setState),ee("rfId",j,Y.setState),ee("autoPanOnConnect",Q,Y.setState),ee("autoPanOnNodeDrag",K,Y.setState),ee("onError",X,Y.setState),ee("connectionRadius",q,Y.setState),mo(e,J),mo(t,ne),mo(v,ie),mo(m,Pe),mo(T,Ze),mo(E,ge),null},dv={display:"none"},mO={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},pv="react-flow__node-desc",hv="react-flow__edge-desc",vO="react-flow__aria-live",yO=e=>e.ariaLiveMessage;function EO({rfId:e}){const t=de(yO);return _("div",{id:`${vO}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:mO,children:t})}function SO({rfId:e,disableKeyboardA11y:t}){return V(Ae,{children:[V("div",{id:`${pv}-${e}`,style:dv,children:["Press enter or space to select a node.",!t&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "]}),_("div",{id:`${hv}-${e}`,style:dv,children:"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."}),!t&&_(EO,{rfId:e})]})}const _O=(e,t,n)=>n===G.Left?e-t:n===G.Right?e+t:e,wO=(e,t,n)=>n===G.Top?e-t:n===G.Bottom?e+t:e,gv="react-flow__edgeupdater",mv=({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:o,onMouseEnter:i,onMouseOut:s,type:l})=>_("circle",{onMouseDown:o,onMouseEnter:i,onMouseOut:s,className:Ke([gv,`${gv}-${l}`]),cx:_O(t,r,e),cy:wO(n,r,e),r,stroke:"transparent",fill:"transparent"});var vo=e=>{const t=({id:n,className:r,type:o,data:i,onClick:s,onEdgeDoubleClick:l,selected:a,animated:u,label:c,labelStyle:f,labelShowBg:p,labelBgStyle:h,labelBgPadding:v,labelBgBorderRadius:m,style:E,source:d,target:g,sourceX:y,sourceY:S,targetX:w,targetY:N,sourcePosition:T,targetPosition:b,elementsSelectable:D,hidden:k,sourceHandleId:B,targetHandleId:F,onContextMenu:z,onMouseEnter:R,onMouseMove:P,onMouseLeave:A,edgeUpdaterRadius:C,onEdgeUpdate:x,onEdgeUpdateStart:L,onEdgeUpdateEnd:U,markerEnd:$,markerStart:j,rfId:Q,ariaLabel:K,isFocusable:X,pathOptions:q,interactionWidth:J})=>{const ne=O.useRef(null),[he,ie]=O.useState(!1),[Pe,Ze]=O.useState(!1),ge=Ce(),at=O.useMemo(()=>`url(#${df(j,Q)})`,[j,Q]),Y=O.useMemo(()=>`url(#${df($,Q)})`,[$,Q]);if(k)return null;const ze=Je=>{const{edges:Mt,addSelectedEdges:Or}=ge.getState();if(D&&(ge.setState({nodesSelectionActive:!1}),Or([n])),s){const xr=Mt.find(vn=>vn.id===n);s(Je,xr)}},ut=Pi(n,ge.getState,l),To=Pi(n,ge.getState,z),ns=Pi(n,ge.getState,R),rs=Pi(n,ge.getState,P),os=Pi(n,ge.getState,A),Jn=(Je,Mt)=>{if(Je.button!==0)return;const Or=Mt?g:d,xr=(Mt?F:B)||null,vn=Mt?"target":"source",ya=()=>!0,ls=Mt,as=ge.getState().edges.find(Tr=>Tr.id===n);Ze(!0),L==null||L(Je,as,vn);const ud=Tr=>{Ze(!1),U==null||U(Tr,as,vn)};ov({event:Je,handleId:xr,nodeId:Or,onConnect:Tr=>x==null?void 0:x(as,Tr),isTarget:ls,getState:ge.getState,setState:ge.setState,isValidConnection:ya,edgeUpdaterType:vn,onEdgeUpdateEnd:ud})},Io=Je=>Jn(Je,!0),er=Je=>Jn(Je,!1),Co=()=>ie(!0),mn=()=>ie(!1),is=!D&&!s,ss=typeof x<"u",Ao=Je=>{var Mt;if(Um.includes(Je.key)&&D){const{unselectNodesAndEdges:Or,addSelectedEdges:xr,edges:vn}=ge.getState();Je.key==="Escape"?((Mt=ne.current)==null||Mt.blur(),Or({edges:[vn.find(ls=>ls.id===n)]})):xr([n])}};return V("g",{className:Ke(["react-flow__edge",`react-flow__edge-${o}`,r,{selected:a,animated:u,inactive:is,updating:he}]),onClick:ze,onDoubleClick:ut,onContextMenu:To,onMouseEnter:ns,onMouseMove:rs,onMouseLeave:os,onKeyDown:X?Ao:void 0,tabIndex:X?0:void 0,role:X?"button":void 0,"data-testid":`rf__edge-${n}`,"aria-label":K===null?void 0:K||`Edge from ${d} to ${g}`,"aria-describedby":X?`${hv}-${Q}`:void 0,ref:ne,children:[!Pe&&_(e,{id:n,source:d,target:g,selected:a,animated:u,label:c,labelStyle:f,labelShowBg:p,labelBgStyle:h,labelBgPadding:v,labelBgBorderRadius:m,data:i,style:E,sourceX:y,sourceY:S,targetX:w,targetY:N,sourcePosition:T,targetPosition:b,sourceHandleId:B,targetHandleId:F,markerStart:at,markerEnd:Y,pathOptions:q,interactionWidth:J}),ss&&V(Ae,{children:[_(mv,{position:T,centerX:y,centerY:S,radius:C,onMouseDown:Io,onMouseEnter:Co,onMouseOut:mn,type:"source"}),_(mv,{position:b,centerX:w,centerY:N,radius:C,onMouseDown:er,onMouseEnter:Co,onMouseOut:mn,type:"target"})]})]})};return t.displayName="EdgeWrapper",O.memo(t)};function RO(e){const t={default:vo(e.default||Ql),straight:vo(e.bezier||cf),step:vo(e.step||uf),smoothstep:vo(e.step||Yl),simplebezier:vo(e.simplebezier||af)},n={},r=Object.keys(e).filter(o=>!["default","bezier"].includes(o)).reduce((o,i)=>(o[i]=vo(e[i]||Ql),o),n);return{...t,...r}}function vv(e,t,n=null){const r=((n==null?void 0:n.x)||0)+t.x,o=((n==null?void 0:n.y)||0)+t.y,i=(n==null?void 0:n.width)||t.width,s=(n==null?void 0:n.height)||t.height;switch(e){case G.Top:return{x:r+i/2,y:o};case G.Right:return{x:r+i,y:o+s/2};case G.Bottom:return{x:r+i/2,y:o+s};case G.Left:return{x:r,y:o+s/2}}}function yv(e,t){return e?t?e.find(n=>n.id===t):e.length===1?e[0]:null:null}const NO=(e,t,n,r,o,i)=>{const s=vv(n,e,t),l=vv(i,r,o);return{sourceX:s.x,sourceY:s.y,targetX:l.x,targetY:l.y}};function OO({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:r,targetWidth:o,targetHeight:i,width:s,height:l,transform:a}){const u={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+o),y2:Math.max(e.y+r,t.y+i)};u.x===u.x2&&(u.x2+=1),u.y===u.y2&&(u.y2+=1);const c=Pm({x:(0-a[0])/a[2],y:(0-a[1])/a[2],width:s/a[2],height:l/a[2]}),f=Math.max(0,Math.min(c.x2,u.x2)-Math.max(c.x,u.x)),p=Math.max(0,Math.min(c.y2,u.y2)-Math.max(c.y,u.y));return Math.ceil(f*p)>0}function Ev(e){var r,o,i,s,l;const t=((r=e==null?void 0:e[_e])==null?void 0:r.handleBounds)||null,n=t&&(e==null?void 0:e.width)&&(e==null?void 0:e.height)&&typeof((o=e==null?void 0:e.positionAbsolute)==null?void 0:o.x)<"u"&&typeof((i=e==null?void 0:e.positionAbsolute)==null?void 0:i.y)<"u";return[{x:((s=e==null?void 0:e.positionAbsolute)==null?void 0:s.x)||0,y:((l=e==null?void 0:e.positionAbsolute)==null?void 0:l.y)||0,width:(e==null?void 0:e.width)||0,height:(e==null?void 0:e.height)||0},t,!!n]}function Sv(e,t){if(!e.parentNode)return!1;const n=t.get(e.parentNode);return n?n.selected?!0:Sv(n,t):!1}function _v(e,t,n){let r=e;do{if(r!=null&&r.matches(t))return!0;if(r===n.current)return!1;r=r.parentElement}while(r);return!1}function xO(e,t,n,r){return Array.from(e.values()).filter(o=>(o.selected||o.id===r)&&(!o.parentNode||!Sv(o,e))&&(o.draggable||t&&typeof o.draggable>"u")).map(o=>{var i,s;return{id:o.id,position:o.position||{x:0,y:0},positionAbsolute:o.positionAbsolute||{x:0,y:0},distance:{x:n.x-(((i=o.positionAbsolute)==null?void 0:i.x)??0),y:n.y-(((s=o.positionAbsolute)==null?void 0:s.y)??0)},delta:{x:0,y:0},extent:o.extent,parentNode:o.parentNode,width:o.width,height:o.height}})}function wv(e,t,n,r,o=[0,0],i){let s=e.extent||r;if(e.extent==="parent")if(e.parentNode&&e.width&&e.height){const u=n.get(e.parentNode),{x:c,y:f}=ho(u,o).positionAbsolute;s=u&&mt(c)&&mt(f)&&mt(u.width)&&mt(u.height)?[[c+e.width*o[0],f+e.height*o[1]],[c+u.width-e.width+e.width*o[0],f+u.height-e.height+e.height*o[1]]]:s}else i==null||i("005",dn["005"]()),s=r;else if(e.extent&&e.parentNode){const u=n.get(e.parentNode),{x:c,y:f}=ho(u,o).positionAbsolute;s=[[e.extent[0][0]+c,e.extent[0][1]+f],[e.extent[1][0]+c,e.extent[1][1]+f]]}let l={x:0,y:0};if(e.parentNode){const u=n.get(e.parentNode);l=ho(u,o).positionAbsolute}const a=s?of(t,s):t;return{position:{x:a.x-l.x,y:a.y-l.y},positionAbsolute:a}}function mf({nodeId:e,dragItems:t,nodeInternals:n}){const r=t.map(o=>({...n.get(o.id),position:o.position,positionAbsolute:o.positionAbsolute}));return[e?r.find(o=>o.id===e):r[0],r]}const Rv=(e,t,n,r)=>{const o=t.querySelectorAll(e);if(!o||!o.length)return null;const i=Array.from(o),s=t.getBoundingClientRect(),l={x:s.width*r[0],y:s.height*r[1]};return i.map(a=>{const u=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),position:a.getAttribute("data-handlepos"),x:(u.left-s.left-l.x)/n,y:(u.top-s.top-l.y)/n,...rf(a)}})};function Vi(e,t,n){return n===void 0?n:r=>{const o=t().nodeInternals.get(e);n(r,{...o})}}function vf({id:e,store:t,unselect:n=!1}){const{addSelectedNodes:r,unselectNodesAndEdges:o,multiSelectionActive:i,nodeInternals:s}=t.getState(),l=s.get(e);t.setState({nodesSelectionActive:!1}),l.selected?(n||l.selected&&i)&&o({nodes:[l]}):r([e])}function TO(){const e=Ce();return O.useCallback(({sourceEvent:n})=>{const{transform:r,snapGrid:o,snapToGrid:i}=e.getState(),s=n.touches?n.touches[0].clientX:n.clientX,l=n.touches?n.touches[0].clientY:n.clientY,a={x:(s-r[0])/r[2],y:(l-r[1])/r[2]};return{xSnapped:i?o[0]*Math.round(a.x/o[0]):a.x,ySnapped:i?o[1]*Math.round(a.y/o[1]):a.y,...a}},[])}function yf(e){return(t,n,r)=>e==null?void 0:e(t,r)}function Nv({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:o,isSelectable:i,selectNodesOnDrag:s}){const l=Ce(),[a,u]=O.useState(!1),c=O.useRef([]),f=O.useRef({x:null,y:null}),p=O.useRef(0),h=O.useRef(null),v=O.useRef({x:0,y:0}),m=O.useRef(null),E=O.useRef(!1),d=TO();return O.useEffect(()=>{if(e!=null&&e.current){const g=Ct(e.current),y=({x:w,y:N})=>{const{nodeInternals:T,onNodeDrag:b,onSelectionDrag:D,updateNodePositions:k,nodeExtent:B,snapGrid:F,snapToGrid:z,nodeOrigin:R,onError:P}=l.getState();f.current={x:w,y:N};let A=!1;if(c.current=c.current.map(x=>{const L={x:w-x.distance.x,y:N-x.distance.y};z&&(L.x=F[0]*Math.round(L.x/F[0]),L.y=F[1]*Math.round(L.y/F[1]));const U=wv(x,L,T,B,R,P);return A=A||x.position.x!==U.position.x||x.position.y!==U.position.y,x.position=U.position,x.positionAbsolute=U.positionAbsolute,x}),!A)return;k(c.current,!0,!0),u(!0);const C=o?b:yf(D);if(C&&m.current){const[x,L]=mf({nodeId:o,dragItems:c.current,nodeInternals:T});C(m.current,x,L)}},S=()=>{if(!h.current)return;const[w,N]=Dm(v.current,h.current);if(w!==0||N!==0){const{transform:T,panBy:b}=l.getState();f.current.x=(f.current.x??0)-w/T[2],f.current.y=(f.current.y??0)-N/T[2],y(f.current),b({x:w,y:N})}p.current=requestAnimationFrame(S)};if(t)g.on(".drag",null);else{const w=K1().on("start",N=>{var A;const{nodeInternals:T,multiSelectionActive:b,domNode:D,nodesDraggable:k,unselectNodesAndEdges:B,onNodeDragStart:F,onSelectionDragStart:z}=l.getState(),R=o?F:yf(z);!s&&!b&&o&&((A=T.get(o))!=null&&A.selected||B()),o&&i&&s&&vf({id:o,store:l});const P=d(N);if(f.current=P,c.current=xO(T,k,P,o),R&&c.current){const[C,x]=mf({nodeId:o,dragItems:c.current,nodeInternals:T});R(N.sourceEvent,C,x)}h.current=(D==null?void 0:D.getBoundingClientRect())||null,v.current=Bn(N.sourceEvent,h.current)}).on("drag",N=>{const T=d(N),{autoPanOnNodeDrag:b}=l.getState();!E.current&&b&&(E.current=!0,S()),(f.current.x!==T.xSnapped||f.current.y!==T.ySnapped)&&c.current&&(m.current=N.sourceEvent,v.current=Bn(N.sourceEvent,h.current),y(T))}).on("end",N=>{if(u(!1),E.current=!1,cancelAnimationFrame(p.current),c.current){const{updateNodePositions:T,nodeInternals:b,onNodeDragStop:D,onSelectionDragStop:k}=l.getState(),B=o?D:yf(k);if(T(c.current,!1,!1),B){const[F,z]=mf({nodeId:o,dragItems:c.current,nodeInternals:b});B(N.sourceEvent,F,z)}}}).filter(N=>{const T=N.target;return!N.button&&(!n||!_v(T,`.${n}`,e))&&(!r||_v(T,r,e))});return g.call(w),()=>{g.on(".drag",null)}}}},[e,t,n,r,i,l,o,s,d]),a}function Ov(){const e=Ce();return O.useCallback(n=>{const{nodeInternals:r,nodeExtent:o,updateNodePositions:i,getNodes:s,snapToGrid:l,snapGrid:a,onError:u,nodesDraggable:c}=e.getState(),f=s().filter(g=>g.selected&&(g.draggable||c&&typeof g.draggable>"u")),p=l?a[0]:5,h=l?a[1]:5,v=n.isShiftPressed?4:1,m=n.x*p*v,E=n.y*h*v,d=f.map(g=>{if(g.positionAbsolute){const y={x:g.positionAbsolute.x+m,y:g.positionAbsolute.y+E};l&&(y.x=a[0]*Math.round(y.x/a[0]),y.y=a[1]*Math.round(y.y/a[1]));const{positionAbsolute:S,position:w}=wv(g,y,r,o,void 0,u);g.position=w,g.positionAbsolute=S}return g});i(d,!0,!1)},[])}const yo={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var Bi=e=>{const t=({id:n,type:r,data:o,xPos:i,yPos:s,xPosOrigin:l,yPosOrigin:a,selected:u,onClick:c,onMouseEnter:f,onMouseMove:p,onMouseLeave:h,onContextMenu:v,onDoubleClick:m,style:E,className:d,isDraggable:g,isSelectable:y,isConnectable:S,isFocusable:w,selectNodesOnDrag:N,sourcePosition:T,targetPosition:b,hidden:D,resizeObserver:k,dragHandle:B,zIndex:F,isParent:z,noDragClassName:R,noPanClassName:P,initialized:A,disableKeyboardA11y:C,ariaLabel:x,rfId:L})=>{const U=Ce(),$=O.useRef(null),j=O.useRef(T),Q=O.useRef(b),K=O.useRef(r),X=y||g||c||f||p||h,q=Ov(),J=Vi(n,U.getState,f),ne=Vi(n,U.getState,p),he=Vi(n,U.getState,h),ie=Vi(n,U.getState,v),Pe=Vi(n,U.getState,m),Ze=Y=>{if(y&&(!N||!g)&&vf({id:n,store:U}),c){const ze=U.getState().nodeInternals.get(n);c(Y,{...ze})}},ge=Y=>{var ze;if(!lf(Y))if(Um.includes(Y.key)&&y){const ut=Y.key==="Escape";ut&&((ze=$.current)==null||ze.blur()),vf({id:n,store:U,unselect:ut})}else!C&&g&&u&&Object.prototype.hasOwnProperty.call(yo,Y.key)&&(U.setState({ariaLiveMessage:`Moved selected node ${Y.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~i}, y: ${~~s}`}),q({x:yo[Y.key].x,y:yo[Y.key].y,isShiftPressed:Y.shiftKey}))};O.useEffect(()=>{if($.current&&!D){const Y=$.current;return k==null||k.observe(Y),()=>k==null?void 0:k.unobserve(Y)}},[D]),O.useEffect(()=>{const Y=K.current!==r,ze=j.current!==T,ut=Q.current!==b;$.current&&(Y||ze||ut)&&(Y&&(K.current=r),ze&&(j.current=T),ut&&(Q.current=b),U.getState().updateNodeDimensions([{id:n,nodeElement:$.current,forceUpdate:!0}]))},[n,r,T,b]);const at=Nv({nodeRef:$,disabled:D||!g,noDragClassName:R,handleSelector:B,nodeId:n,isSelectable:y,selectNodesOnDrag:N});return D?null:_("div",{className:Ke(["react-flow__node",`react-flow__node-${r}`,{[P]:g},d,{selected:u,selectable:y,parent:z,dragging:at}]),ref:$,style:{zIndex:F,transform:`translate(${l}px,${a}px)`,pointerEvents:X?"all":"none",visibility:A?"visible":"hidden",...E},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:J,onMouseMove:ne,onMouseLeave:he,onContextMenu:ie,onClick:Ze,onDoubleClick:Pe,onKeyDown:w?ge:void 0,tabIndex:w?0:void 0,role:w?"button":void 0,"aria-describedby":C?void 0:`${pv}-${L}`,"aria-label":x,children:_(ZN,{value:n,children:_(e,{id:n,data:o,type:r,xPos:i,yPos:s,selected:u,isConnectable:S,sourcePosition:T,targetPosition:b,dragging:at,dragHandle:B,zIndex:F})})})};return t.displayName="NodeWrapper",O.memo(t)};function IO(e){const t={input:Bi(e.input||av),default:Bi(e.default||hf),output:Bi(e.output||cv),group:Bi(e.group||gf)},n={},r=Object.keys(e).filter(o=>!["input","default","output","group"].includes(o)).reduce((o,i)=>(o[i]=Bi(e[i]||hf),o),n);return{...t,...r}}const CO=({x:e,y:t,width:n,height:r,origin:o})=>!n||!r?{x:e,y:t}:o[0]<0||o[1]<0||o[0]>1||o[1]>1?{x:e,y:t}:{x:e-n*o[0],y:t-r*o[1]},AO=typeof document<"u"?document:null;var $i=(e=null,t={target:AO})=>{const[n,r]=O.useState(!1),o=O.useRef(new Set([])),[i,s]=O.useMemo(()=>{if(e!==null){const a=(Array.isArray(e)?e:[e]).filter(c=>typeof c=="string").map(c=>c.split("+")),u=a.reduce((c,f)=>c.concat(...f),[]);return[a,u]}return[[],[]]},[e]);return O.useEffect(()=>{var l,a;if(e!==null){const u=p=>{if(lf(p))return!1;const h=Tv(p.code,s);o.current.add(p[h]),xv(i,o.current,!1)&&(p.preventDefault(),r(!0))},c=p=>{if(lf(p))return!1;const h=Tv(p.code,s);xv(i,o.current,!0)?(r(!1),o.current.clear()):o.current.delete(p[h])},f=()=>{o.current.clear(),r(!1)};return(l=t==null?void 0:t.target)==null||l.addEventListener("keydown",u),(a=t==null?void 0:t.target)==null||a.addEventListener("keyup",c),window.addEventListener("blur",f),()=>{var p,h;(p=t==null?void 0:t.target)==null||p.removeEventListener("keydown",u),(h=t==null?void 0:t.target)==null||h.removeEventListener("keyup",c),window.removeEventListener("blur",f)}}},[e,r]),n};function xv(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(o=>t.has(o)))}function Tv(e,t){return t.includes(e)?"code":"key"}function Iv(e,t,n,r){var s,l;if(!e.parentNode)return n;const o=t.get(e.parentNode),i=ho(o,r);return Iv(o,t,{x:(n.x??0)+i.x,y:(n.y??0)+i.y,z:(((s=o[_e])==null?void 0:s.z)??0)>(n.z??0)?((l=o[_e])==null?void 0:l.z)??0:n.z??0},r)}function Cv(e,t,n){e.forEach(r=>{var o;if(r.parentNode&&!e.has(r.parentNode))throw new Error(`Parent node ${r.parentNode} not found`);if(r.parentNode||n!=null&&n[r.id]){const{x:i,y:s,z:l}=Iv(r,e,{...r.position,z:((o=r[_e])==null?void 0:o.z)??0},t);r.positionAbsolute={x:i,y:s},r[_e].z=l,n!=null&&n[r.id]&&(r[_e].isParent=!0)}})}function Ef(e,t,n,r){const o=new Map,i={},s=r?1e3:0;return e.forEach(l=>{var f;const a=(mt(l.zIndex)?l.zIndex:0)+(l.selected?s:0),u=t.get(l.id),c={width:u==null?void 0:u.width,height:u==null?void 0:u.height,...l,positionAbsolute:{x:l.position.x,y:l.position.y}};l.parentNode&&(c.parentNode=l.parentNode,i[l.parentNode]=!0),Object.defineProperty(c,_e,{enumerable:!1,value:{handleBounds:(f=u==null?void 0:u[_e])==null?void 0:f.handleBounds,z:a}}),o.set(l.id,c)}),Cv(o,n,i),o}function Av(e,t={}){const{getNodes:n,width:r,height:o,minZoom:i,maxZoom:s,d3Zoom:l,d3Selection:a,fitViewOnInitDone:u,fitViewOnInit:c,nodeOrigin:f}=e(),p=t.initial&&!u&&c;if(l&&a&&(p||!t.initial)){const v=n().filter(E=>{var g;const d=t.includeHiddenNodes?E.width&&E.height:!E.hidden;return(g=t.nodes)!=null&&g.length?d&&t.nodes.some(y=>y.id===E.id):d}),m=v.every(E=>E.width&&E.height);if(v.length>0&&m){const E=qm(v,f),[d,g,y]=ev(E,r,o,t.minZoom??i,t.maxZoom??s,t.padding??.1),S=Vn.translate(d,g).scale(y);return typeof t.duration=="number"&&t.duration>0?l.transform(yr(a,t.duration),S):l.transform(a,S),!0}}return!1}function bO(e,t){return e.forEach(n=>{const r=t.get(n.id);r&&t.set(r.id,{...r,[_e]:r[_e],selected:n.selected})}),new Map(t)}function LO(e,t){return t.map(n=>{const r=e.find(o=>o.id===n.id);return r&&(n.selected=r.selected),n})}function ql({changedNodes:e,changedEdges:t,get:n,set:r}){const{nodeInternals:o,edges:i,onNodesChange:s,onEdgesChange:l,hasDefaultNodes:a,hasDefaultEdges:u}=n();e!=null&&e.length&&(a&&r({nodeInternals:bO(e,o)}),s==null||s(e)),t!=null&&t.length&&(u&&r({edges:LO(t,i)}),l==null||l(t))}const Eo=()=>{},DO={zoomIn:Eo,zoomOut:Eo,zoomTo:Eo,getZoom:()=>1,setViewport:Eo,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:Eo,fitBounds:Eo,project:e=>e,viewportInitialized:!1},kO=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection}),PO=()=>{const e=Ce(),{d3Zoom:t,d3Selection:n}=de(kO,Qe);return O.useMemo(()=>n&&t?{zoomIn:o=>t.scaleBy(yr(n,o==null?void 0:o.duration),1.2),zoomOut:o=>t.scaleBy(yr(n,o==null?void 0:o.duration),1/1.2),zoomTo:(o,i)=>t.scaleTo(yr(n,i==null?void 0:i.duration),o),getZoom:()=>e.getState().transform[2],setViewport:(o,i)=>{const[s,l,a]=e.getState().transform,u=Vn.translate(o.x??s,o.y??l).scale(o.zoom??a);t.transform(yr(n,i==null?void 0:i.duration),u)},getViewport:()=>{const[o,i,s]=e.getState().transform;return{x:o,y:i,zoom:s}},fitView:o=>Av(e.getState,o),setCenter:(o,i,s)=>{const{width:l,height:a,maxZoom:u}=e.getState(),c=typeof(s==null?void 0:s.zoom)<"u"?s.zoom:u,f=l/2-o*c,p=a/2-i*c,h=Vn.translate(f,p).scale(c);t.transform(yr(n,s==null?void 0:s.duration),h)},fitBounds:(o,i)=>{const{width:s,height:l,minZoom:a,maxZoom:u}=e.getState(),[c,f,p]=ev(o,s,l,a,u,(i==null?void 0:i.padding)??.1),h=Vn.translate(c,f).scale(p);t.transform(yr(n,i==null?void 0:i.duration),h)},project:o=>{const{transform:i,snapToGrid:s,snapGrid:l}=e.getState();return Xm(o,i,s,l)},viewportInitialized:!0}:DO,[t,n])};function Sf(){const e=PO(),t=Ce(),n=O.useCallback(()=>t.getState().getNodes().map(m=>({...m})),[]),r=O.useCallback(m=>t.getState().nodeInternals.get(m),[]),o=O.useCallback(()=>{const{edges:m=[]}=t.getState();return m.map(E=>({...E}))},[]),i=O.useCallback(m=>{const{edges:E=[]}=t.getState();return E.find(d=>d.id===m)},[]),s=O.useCallback(m=>{const{getNodes:E,setNodes:d,hasDefaultNodes:g,onNodesChange:y}=t.getState(),S=E(),w=typeof m=="function"?m(S):m;if(g)d(w);else if(y){const N=w.length===0?S.map(T=>({type:"remove",id:T.id})):w.map(T=>({item:T,type:"reset"}));y(N)}},[]),l=O.useCallback(m=>{const{edges:E=[],setEdges:d,hasDefaultEdges:g,onEdgesChange:y}=t.getState(),S=typeof m=="function"?m(E):m;if(g)d(S);else if(y){const w=S.length===0?E.map(N=>({type:"remove",id:N.id})):S.map(N=>({item:N,type:"reset"}));y(w)}},[]),a=O.useCallback(m=>{const E=Array.isArray(m)?m:[m],{getNodes:d,setNodes:g,hasDefaultNodes:y,onNodesChange:S}=t.getState();if(y){const N=[...d(),...E];g(N)}else if(S){const w=E.map(N=>({item:N,type:"add"}));S(w)}},[]),u=O.useCallback(m=>{const E=Array.isArray(m)?m:[m],{edges:d=[],setEdges:g,hasDefaultEdges:y,onEdgesChange:S}=t.getState();if(y)g([...d,...E]);else if(S){const w=E.map(N=>({item:N,type:"add"}));S(w)}},[]),c=O.useCallback(()=>{const{getNodes:m,edges:E=[],transform:d}=t.getState(),[g,y,S]=d;return{nodes:m().map(w=>({...w})),edges:E.map(w=>({...w})),viewport:{x:g,y,zoom:S}}},[]),f=O.useCallback(({nodes:m,edges:E})=>{const{nodeInternals:d,getNodes:g,edges:y,hasDefaultNodes:S,hasDefaultEdges:w,onNodesDelete:N,onEdgesDelete:T,onNodesChange:b,onEdgesChange:D}=t.getState(),k=(m||[]).map(P=>P.id),B=(E||[]).map(P=>P.id),F=g().reduce((P,A)=>{const C=!k.includes(A.id)&&A.parentNode&&P.find(L=>L.id===A.parentNode);return(typeof A.deletable=="boolean"?A.deletable:!0)&&(k.includes(A.id)||C)&&P.push(A),P},[]),z=y.filter(P=>typeof P.deletable=="boolean"?P.deletable:!0),R=z.filter(P=>B.includes(P.id));if(F||R){const P=Jm(F,z),A=[...R,...P],C=A.reduce((x,L)=>(x.includes(L.id)||x.push(L.id),x),[]);if((w||S)&&(w&&t.setState({edges:y.filter(x=>!C.includes(x.id))}),S&&(F.forEach(x=>{d.delete(x.id)}),t.setState({nodeInternals:new Map(d)}))),C.length>0&&(T==null||T(A),D&&D(C.map(x=>({id:x,type:"remove"})))),F.length>0&&(N==null||N(F),b)){const x=F.map(L=>({id:L.id,type:"remove"}));b(x)}}},[]),p=O.useCallback(m=>{const E=GN(m),d=E?null:t.getState().nodeInternals.get(m.id);return[E?m:Mm(d),d,E]},[]),h=O.useCallback((m,E=!0,d)=>{const[g,y,S]=p(m);return g?(d||t.getState().getNodes()).filter(w=>{if(!S&&(w.id===y.id||!w.positionAbsolute))return!1;const N=Mm(w),T=sf(N,g);return E&&T>0||T>=m.width*m.height}):[]},[]),v=O.useCallback((m,E,d=!0)=>{const[g]=p(m);if(!g)return!1;const y=sf(g,E);return d&&y>0||y>=m.width*m.height},[]);return O.useMemo(()=>({...e,getNodes:n,getNode:r,getEdges:o,getEdge:i,setNodes:s,setEdges:l,addNodes:a,addEdges:u,toObject:c,deleteElements:f,getIntersectingNodes:h,isNodeIntersecting:v}),[e,n,r,o,i,s,l,a,u,c,f,h,v])}var MO=({deleteKeyCode:e,multiSelectionKeyCode:t})=>{const n=Ce(),{deleteElements:r}=Sf(),o=$i(e),i=$i(t);O.useEffect(()=>{if(o){const{edges:s,getNodes:l}=n.getState(),a=l().filter(c=>c.selected),u=s.filter(c=>c.selected);r({nodes:a,edges:u}),n.setState({nodesSelectionActive:!1})}},[o]),O.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])};function UO(e){const t=Ce();O.useEffect(()=>{let n;const r=()=>{var i,s;if(!e.current)return;const o=rf(e.current);(o.height===0||o.width===0)&&((s=(i=t.getState()).onError)==null||s.call(i,"004",dn["004"]())),t.setState({width:o.width||500,height:o.height||500})};return r(),window.addEventListener("resize",r),e.current&&(n=new ResizeObserver(()=>r()),n.observe(e.current)),()=>{window.removeEventListener("resize",r),n&&e.current&&n.unobserve(e.current)}},[])}const _f={position:"absolute",width:"100%",height:"100%",top:0,left:0},FO=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,wf=e=>({x:e.x,y:e.y,zoom:e.k}),So=(e,t)=>e.target.closest(`.${t}`),bv=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),VO=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),BO=({onMove:e,onMoveStart:t,onMoveEnd:n,onPaneContextMenu:r,zoomOnScroll:o=!0,zoomOnPinch:i=!0,panOnScroll:s=!1,panOnScrollSpeed:l=.5,panOnScrollMode:a=po.Free,zoomOnDoubleClick:u=!0,elementsSelectable:c,panOnDrag:f=!0,defaultViewport:p,translateExtent:h,minZoom:v,maxZoom:m,zoomActivationKeyCode:E,preventScrolling:d=!0,children:g,noWheelClassName:y,noPanClassName:S})=>{const w=O.useRef(),N=Ce(),T=O.useRef(!1),b=O.useRef(!1),D=O.useRef(null),k=O.useRef({x:0,y:0,zoom:0}),{d3Zoom:B,d3Selection:F,d3ZoomHandler:z,userSelectionActive:R}=de(VO,Qe),P=$i(E),A=O.useRef(0);return UO(D),O.useEffect(()=>{if(D.current){const C=D.current.getBoundingClientRect(),x=FN().scaleExtent([v,m]).translateExtent(h),L=Ct(D.current).call(x),U=Vn.translate(p.x,p.y).scale(co(p.zoom,v,m)),$=[[0,0],[C.width,C.height]],j=x.constrain()(U,$,h);x.transform(L,j),N.setState({d3Zoom:x,d3Selection:L,d3ZoomHandler:L.on("wheel.zoom"),transform:[j.x,j.y,j.k],domNode:D.current.closest(".react-flow")})}},[]),O.useEffect(()=>{F&&B&&(s&&!P&&!R?F.on("wheel.zoom",C=>{if(So(C,y))return!1;C.preventDefault(),C.stopImmediatePropagation();const x=F.property("__zoom").k||1;if(C.ctrlKey&&i){const j=zt(C),Q=-C.deltaY*(C.deltaMode===1?.05:C.deltaMode?1:.002)*10,K=x*Math.pow(2,Q);B.scaleTo(F,K,j);return}const L=C.deltaMode===1?20:1,U=a===po.Vertical?0:C.deltaX*L,$=a===po.Horizontal?0:C.deltaY*L;B.translateBy(F,-(U/x)*l,-($/x)*l)}):typeof z<"u"&&F.on("wheel.zoom",function(C,x){if(!d||So(C,y))return null;C.preventDefault(),z.call(this,C,x)}))},[R,s,a,F,B,z,P,i,d,y]),O.useEffect(()=>{B&&B.on("start",C=>{var L;if(!C.sourceEvent)return null;A.current=C.sourceEvent.button;const{onViewportChangeStart:x}=N.getState();if(T.current=!0,((L=C.sourceEvent)==null?void 0:L.type)==="mousedown"&&N.setState({paneDragging:!0}),t||x){const U=wf(C.transform);k.current=U,x==null||x(U),t==null||t(C.sourceEvent,U)}})},[B,t]),O.useEffect(()=>{B&&(R&&!T.current?B.on("zoom",null):R||B.on("zoom",C=>{const{onViewportChange:x}=N.getState();if(N.setState({transform:[C.transform.x,C.transform.y,C.transform.k]}),b.current=!!(r&&bv(f,A.current??0)),e||x){const L=wf(C.transform);x==null||x(L),e==null||e(C.sourceEvent,L)}}))},[R,B,e,f,r]),O.useEffect(()=>{B&&B.on("end",C=>{if(!C.sourceEvent)return null;const{onViewportChangeEnd:x}=N.getState();if(T.current=!1,N.setState({paneDragging:!1}),r&&bv(f,A.current??0)&&!b.current&&r(C.sourceEvent),b.current=!1,(n||x)&&FO(k.current,C.transform)){const L=wf(C.transform);k.current=L,clearTimeout(w.current),w.current=setTimeout(()=>{x==null||x(L),n==null||n(C.sourceEvent,L)},s?150:0)}})},[B,s,f,n,r]),O.useEffect(()=>{B&&B.filter(C=>{const x=P||o,L=i&&C.ctrlKey;if(C.button===1&&C.type==="mousedown"&&(So(C,"react-flow__node")||So(C,"react-flow__edge")))return!0;if(!f&&!x&&!s&&!u&&!i||R||!u&&C.type==="dblclick"||So(C,y)&&C.type==="wheel"||So(C,S)&&C.type!=="wheel"||!i&&C.ctrlKey&&C.type==="wheel"||!x&&!s&&!L&&C.type==="wheel"||!f&&(C.type==="mousedown"||C.type==="touchstart")||Array.isArray(f)&&!f.includes(C.button)&&(C.type==="mousedown"||C.type==="touchstart"))return!1;const U=Array.isArray(f)&&f.includes(C.button)||!C.button||C.button<=1;return(!C.ctrlKey||C.type==="wheel")&&U})},[R,B,o,i,s,u,f,c,P]),_("div",{className:"react-flow__renderer",ref:D,style:_f,children:g})},$O=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function zO(){const{userSelectionActive:e,userSelectionRect:t}=de($O,Qe);return e&&t?_("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}function Lv(e,t){const n=e.find(r=>r.id===t.parentNode);if(n){const r=t.position.x+t.width-n.width,o=t.position.y+t.height-n.height;if(r>0||o>0||t.position.x<0||t.position.y<0){if(n.style={...n.style},n.style.width=n.style.width??n.width,n.style.height=n.style.height??n.height,r>0&&(n.style.width+=r),o>0&&(n.style.height+=o),t.position.x<0){const i=Math.abs(t.position.x);n.position.x=n.position.x-i,n.style.width+=i,t.position.x=0}if(t.position.y<0){const i=Math.abs(t.position.y);n.position.y=n.position.y-i,n.style.height+=i,t.position.y=0}n.width=n.style.width,n.height=n.style.height}}}function Dv(e,t){if(e.some(r=>r.type==="reset"))return e.filter(r=>r.type==="reset").map(r=>r.item);const n=e.filter(r=>r.type==="add").map(r=>r.item);return t.reduce((r,o)=>{const i=e.filter(l=>l.id===o.id);if(i.length===0)return r.push(o),r;const s={...o};for(const l of i)if(l)switch(l.type){case"select":{s.selected=l.selected;break}case"position":{typeof l.position<"u"&&(s.position=l.position),typeof l.positionAbsolute<"u"&&(s.positionAbsolute=l.positionAbsolute),typeof l.dragging<"u"&&(s.dragging=l.dragging),s.expandParent&&Lv(r,s);break}case"dimensions":{typeof l.dimensions<"u"&&(s.width=l.dimensions.width,s.height=l.dimensions.height),typeof l.updateStyle<"u"&&(s.style={...s.style||{},...l.dimensions}),typeof l.resizing=="boolean"&&(s.resizing=l.resizing),s.expandParent&&Lv(r,s);break}case"remove":return r}return r.push(s),r},n)}function kv(e,t){return Dv(e,t)}function HO(e,t){return Dv(e,t)}const Hn=(e,t)=>({id:e,type:"select",selected:t});function _o(e,t){return e.reduce((n,r)=>{const o=t.includes(r.id);return!r.selected&&o?(r.selected=!0,n.push(Hn(r.id,!0))):r.selected&&!o&&(r.selected=!1,n.push(Hn(r.id,!1))),n},[])}const Rf=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},jO=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),Pv=O.memo(({isSelecting:e,selectionMode:t=Mi.Full,panOnDrag:n,onSelectionStart:r,onSelectionEnd:o,onPaneClick:i,onPaneContextMenu:s,onPaneScroll:l,onPaneMouseEnter:a,onPaneMouseMove:u,onPaneMouseLeave:c,children:f})=>{const p=O.useRef(null),h=Ce(),v=O.useRef(0),m=O.useRef(0),E=O.useRef(),{userSelectionActive:d,elementsSelectable:g,dragging:y}=de(jO,Qe),S=()=>{h.setState({userSelectionActive:!1,userSelectionRect:null}),v.current=0,m.current=0},w=z=>{i==null||i(z),h.getState().resetSelectedElements(),h.setState({nodesSelectionActive:!1})},N=z=>{if(Array.isArray(n)&&(n!=null&&n.includes(2))){z.preventDefault();return}s==null||s(z)},T=l?z=>l(z):void 0,b=z=>{const{resetSelectedElements:R,domNode:P}=h.getState();if(E.current=P==null?void 0:P.getBoundingClientRect(),!g||!e||z.button!==0||z.target!==p.current||!E.current)return;const{x:A,y:C}=Bn(z,E.current);R(),h.setState({userSelectionRect:{width:0,height:0,startX:A,startY:C,x:A,y:C}}),r==null||r(z)},D=z=>{const{userSelectionRect:R,nodeInternals:P,edges:A,transform:C,onNodesChange:x,onEdgesChange:L,nodeOrigin:U,getNodes:$}=h.getState();if(!e||!E.current||!R)return;h.setState({userSelectionActive:!0,nodesSelectionActive:!1});const j=Bn(z,E.current),Q=R.startX??0,K=R.startY??0,X={...R,x:j.x<Q?j.x:Q,y:j.y<K?j.y:K,width:Math.abs(j.x-Q),height:Math.abs(j.y-K)},q=$(),J=Zm(P,X,C,t===Mi.Partial,!0,U),ne=Jm(J,A).map(ie=>ie.id),he=J.map(ie=>ie.id);if(v.current!==he.length){v.current=he.length;const ie=_o(q,he);ie.length&&(x==null||x(ie))}if(m.current!==ne.length){m.current=ne.length;const ie=_o(A,ne);ie.length&&(L==null||L(ie))}h.setState({userSelectionRect:X})},k=z=>{if(z.button!==0)return;const{userSelectionRect:R}=h.getState();!d&&R&&z.target===p.current&&(w==null||w(z)),h.setState({nodesSelectionActive:v.current>0}),S(),o==null||o(z)},B=z=>{d&&(h.setState({nodesSelectionActive:v.current>0}),o==null||o(z)),S()},F=g&&(e||d);return V("div",{className:Ke(["react-flow__pane",{dragging:y,selection:e}]),onClick:F?void 0:Rf(w,p),onContextMenu:Rf(N,p),onWheel:Rf(T,p),onMouseEnter:F?void 0:a,onMouseDown:F?b:void 0,onMouseMove:F?D:u,onMouseUp:F?k:void 0,onMouseLeave:F?B:c,ref:p,style:_f,children:[f,_(zO,{})]})});Pv.displayName="Pane";const WO=e=>{const t=e.getNodes().filter(n=>n.selected);return{...qm(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};function GO({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=Ce(),{width:o,height:i,x:s,y:l,transformString:a,userSelectionActive:u}=de(WO,Qe),c=Ov(),f=O.useRef(null);if(O.useEffect(()=>{var v;n||(v=f.current)==null||v.focus({preventScroll:!0})},[n]),Nv({nodeRef:f}),u||!o||!i)return null;const p=e?v=>{const m=r.getState().getNodes().filter(E=>E.selected);e(v,m)}:void 0,h=v=>{Object.prototype.hasOwnProperty.call(yo,v.key)&&c({x:yo[v.key].x,y:yo[v.key].y,isShiftPressed:v.shiftKey})};return _("div",{className:Ke(["react-flow__nodesselection","react-flow__container",t]),style:{transform:a},children:_("div",{ref:f,className:"react-flow__nodesselection-rect",onContextMenu:p,tabIndex:n?void 0:-1,onKeyDown:n?void 0:h,style:{width:o,height:i,top:l,left:s}})})}var YO=O.memo(GO);const KO=e=>e.nodesSelectionActive,Mv=({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:s,deleteKeyCode:l,onMove:a,onMoveStart:u,onMoveEnd:c,selectionKeyCode:f,selectionOnDrag:p,selectionMode:h,onSelectionStart:v,onSelectionEnd:m,multiSelectionKeyCode:E,panActivationKeyCode:d,zoomActivationKeyCode:g,elementsSelectable:y,zoomOnScroll:S,zoomOnPinch:w,panOnScroll:N,panOnScrollSpeed:T,panOnScrollMode:b,zoomOnDoubleClick:D,panOnDrag:k,defaultViewport:B,translateExtent:F,minZoom:z,maxZoom:R,preventScrolling:P,onSelectionContextMenu:A,noWheelClassName:C,noPanClassName:x,disableKeyboardA11y:L})=>{const U=de(KO),$=$i(f),Q=$i(d)||k,K=$||p&&Q!==!0;return MO({deleteKeyCode:l,multiSelectionKeyCode:E}),_(BO,{onMove:a,onMoveStart:u,onMoveEnd:c,onPaneContextMenu:i,elementsSelectable:y,zoomOnScroll:S,zoomOnPinch:w,panOnScroll:N,panOnScrollSpeed:T,panOnScrollMode:b,zoomOnDoubleClick:D,panOnDrag:!$&&Q,defaultViewport:B,translateExtent:F,minZoom:z,maxZoom:R,zoomActivationKeyCode:g,preventScrolling:P,noWheelClassName:C,noPanClassName:x,children:V(Pv,{onSelectionStart:v,onSelectionEnd:m,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:s,panOnDrag:Q,isSelecting:!!K,selectionMode:h,children:[e,U&&_(YO,{onSelectionContextMenu:A,noPanClassName:x,disableKeyboardA11y:L})]})})};Mv.displayName="FlowRenderer";var QO=O.memo(Mv);function XO(e){return de(O.useCallback(n=>e?Zm(n.nodeInternals,{x:0,y:0,width:n.width,height:n.height},n.transform,!0):n.getNodes(),[e]))}const qO=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),Uv=e=>{const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:o,updateNodeDimensions:i,onError:s}=de(qO,Qe),l=XO(e.onlyRenderVisibleElements),a=O.useRef(),u=O.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const c=new ResizeObserver(f=>{const p=f.map(h=>({id:h.target.getAttribute("data-id"),nodeElement:h.target,forceUpdate:!0}));i(p)});return a.current=c,c},[]);return O.useEffect(()=>()=>{var c;(c=a==null?void 0:a.current)==null||c.disconnect()},[]),_("div",{className:"react-flow__nodes",style:_f,children:l.map(c=>{var w,N;let f=c.type||"default";e.nodeTypes[f]||(s==null||s("003",dn["003"](f)),f="default");const p=e.nodeTypes[f]||e.nodeTypes.default,h=!!(c.draggable||t&&typeof c.draggable>"u"),v=!!(c.selectable||o&&typeof c.selectable>"u"),m=!!(c.connectable||n&&typeof c.connectable>"u"),E=!!(c.focusable||r&&typeof c.focusable>"u"),d=e.nodeExtent?of(c.positionAbsolute,e.nodeExtent):c.positionAbsolute,g=(d==null?void 0:d.x)??0,y=(d==null?void 0:d.y)??0,S=CO({x:g,y,width:c.width??0,height:c.height??0,origin:e.nodeOrigin});return _(p,{id:c.id,className:c.className,style:c.style,type:f,data:c.data,sourcePosition:c.sourcePosition||G.Bottom,targetPosition:c.targetPosition||G.Top,hidden:c.hidden,xPos:g,yPos:y,xPosOrigin:S.x,yPosOrigin:S.y,selectNodesOnDrag:e.selectNodesOnDrag,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,selected:!!c.selected,isDraggable:h,isSelectable:v,isConnectable:m,isFocusable:E,resizeObserver:u,dragHandle:c.dragHandle,zIndex:((w=c[_e])==null?void 0:w.z)??0,isParent:!!((N=c[_e])!=null&&N.isParent),noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!c.width&&!!c.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:c.ariaLabel},c.id)})})};Uv.displayName="NodeRenderer";var ZO=O.memo(Uv);const JO=[{level:0,isMaxLevel:!0,edges:[]}];function ex(e,t,n=!1){let r=-1;const o=e.reduce((s,l)=>{var c,f,p,h;const a=mt(l.zIndex);let u=a?l.zIndex:0;return n&&(u=a?l.zIndex:Math.max(((f=(c=t.get(l.source))==null?void 0:c[_e])==null?void 0:f.z)||0,((h=(p=t.get(l.target))==null?void 0:p[_e])==null?void 0:h.z)||0)),s[u]?s[u].push(l):s[u]=[l],r=u>r?u:r,s},{}),i=Object.entries(o).map(([s,l])=>{const a=+s;return{edges:l,level:a,isMaxLevel:a===r}});return i.length===0?JO:i}function tx(e,t,n){const r=de(O.useCallback(o=>e?o.edges.filter(i=>{const s=t.get(i.source),l=t.get(i.target);return(s==null?void 0:s.width)&&(s==null?void 0:s.height)&&(l==null?void 0:l.width)&&(l==null?void 0:l.height)&&OO({sourcePos:s.positionAbsolute||{x:0,y:0},targetPos:l.positionAbsolute||{x:0,y:0},sourceWidth:s.width,sourceHeight:s.height,targetWidth:l.width,targetHeight:l.height,width:o.width,height:o.height,transform:o.transform})}):o.edges,[e,t]));return ex(r,t,n)}const nx=({color:e="none",strokeWidth:t=1})=>_("polyline",{stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:t,fill:"none",points:"-5,-4 0,0 -5,4"}),rx=({color:e="none",strokeWidth:t=1})=>_("polyline",{stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:t,fill:e,points:"-5,-4 0,0 -5,4 -5,-4"}),Fv={[Ui.Arrow]:nx,[Ui.ArrowClosed]:rx};function ox(e){const t=Ce();return O.useMemo(()=>{var o,i;return Object.prototype.hasOwnProperty.call(Fv,e)?Fv[e]:((i=(o=t.getState()).onError)==null||i.call(o,"009",dn["009"](e)),null)},[e])}const ix=({id:e,type:t,color:n,width:r=12.5,height:o=12.5,markerUnits:i="strokeWidth",strokeWidth:s,orient:l="auto-start-reverse"})=>{const a=ox(t);return a?_("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:l,refX:"0",refY:"0",children:_(a,{color:n,strokeWidth:s})}):null},sx=({defaultColor:e,rfId:t})=>n=>{const r=[];return n.edges.reduce((o,i)=>([i.markerStart,i.markerEnd].forEach(s=>{if(s&&typeof s=="object"){const l=df(s,t);r.includes(l)||(o.push({id:l,color:s.color||e,...s}),r.push(l))}}),o),[]).sort((o,i)=>o.id.localeCompare(i.id))},Vv=({defaultColor:e,rfId:t})=>{const n=de(O.useCallback(sx({defaultColor:e,rfId:t}),[e,t]),(r,o)=>!(r.length!==o.length||r.some((i,s)=>i.id!==o[s].id)));return _("defs",{children:n.map(r=>_(ix,{id:r.id,type:r.type,color:r.color,width:r.width,height:r.height,markerUnits:r.markerUnits,strokeWidth:r.strokeWidth,orient:r.orient},r.id))})};Vv.displayName="MarkerDefinitions";var lx=O.memo(Vv);const ax=e=>({nodesConnectable:e.nodesConnectable,edgesFocusable:e.edgesFocusable,elementsSelectable:e.elementsSelectable,width:e.width,height:e.height,connectionMode:e.connectionMode,nodeInternals:e.nodeInternals,onError:e.onError}),Bv=({defaultMarkerColor:e,onlyRenderVisibleElements:t,elevateEdgesOnSelect:n,rfId:r,edgeTypes:o,noPanClassName:i,onEdgeUpdate:s,onEdgeContextMenu:l,onEdgeMouseEnter:a,onEdgeMouseMove:u,onEdgeMouseLeave:c,onEdgeClick:f,edgeUpdaterRadius:p,onEdgeDoubleClick:h,onEdgeUpdateStart:v,onEdgeUpdateEnd:m,children:E})=>{const{edgesFocusable:d,elementsSelectable:g,width:y,height:S,connectionMode:w,nodeInternals:N,onError:T}=de(ax,Qe),b=tx(t,N,n);return y?V(Ae,{children:[b.map(({level:D,edges:k,isMaxLevel:B})=>V("svg",{style:{zIndex:D},width:y,height:S,className:"react-flow__edges react-flow__container",children:[B&&_(lx,{defaultColor:e,rfId:r}),_("g",{children:k.map(F=>{const[z,R,P]=Ev(N.get(F.source)),[A,C,x]=Ev(N.get(F.target));if(!P||!x)return null;let L=F.type||"default";o[L]||(T==null||T("011",dn["011"](L)),L="default");const U=o[L]||o.default,$=w===$n.Strict?C.target:(C.target??[]).concat(C.source??[]),j=yv(R.source,F.sourceHandle),Q=yv($,F.targetHandle),K=(j==null?void 0:j.position)||G.Bottom,X=(Q==null?void 0:Q.position)||G.Top,q=!!(F.focusable||d&&typeof F.focusable>"u");if(!j||!Q)return T==null||T("008",dn["008"](j,F)),null;const{sourceX:J,sourceY:ne,targetX:he,targetY:ie}=NO(z,j,K,A,Q,X);return _(U,{id:F.id,className:Ke([F.className,i]),type:L,data:F.data,selected:!!F.selected,animated:!!F.animated,hidden:!!F.hidden,label:F.label,labelStyle:F.labelStyle,labelShowBg:F.labelShowBg,labelBgStyle:F.labelBgStyle,labelBgPadding:F.labelBgPadding,labelBgBorderRadius:F.labelBgBorderRadius,style:F.style,source:F.source,target:F.target,sourceHandleId:F.sourceHandle,targetHandleId:F.targetHandle,markerEnd:F.markerEnd,markerStart:F.markerStart,sourceX:J,sourceY:ne,targetX:he,targetY:ie,sourcePosition:K,targetPosition:X,elementsSelectable:g,onEdgeUpdate:s,onContextMenu:l,onMouseEnter:a,onMouseMove:u,onMouseLeave:c,onClick:f,edgeUpdaterRadius:p,onEdgeDoubleClick:h,onEdgeUpdateStart:v,onEdgeUpdateEnd:m,rfId:r,ariaLabel:F.ariaLabel,isFocusable:q,pathOptions:"pathOptions"in F?F.pathOptions:void 0,interactionWidth:F.interactionWidth},F.id)})})]},D)),E]}):null};Bv.displayName="EdgeRenderer";var ux=O.memo(Bv);const cx=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function fx({children:e}){const t=de(cx);return _("div",{className:"react-flow__viewport react-flow__container",style:{transform:t},children:e})}function dx(e){const t=Sf(),n=O.useRef(!1);O.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const px={[G.Left]:G.Right,[G.Right]:G.Left,[G.Top]:G.Bottom,[G.Bottom]:G.Top},$v=({nodeId:e,handleType:t,style:n,type:r=zn.Bezier,CustomComponent:o,connectionStatus:i})=>{var N,T,b;const{fromNode:s,handleId:l,toX:a,toY:u,connectionMode:c}=de(O.useCallback(D=>({fromNode:D.nodeInternals.get(e),handleId:D.connectionHandleId,toX:(D.connectionPosition.x-D.transform[0])/D.transform[2],toY:(D.connectionPosition.y-D.transform[1])/D.transform[2],connectionMode:D.connectionMode}),[e]),Qe),f=(N=s==null?void 0:s[_e])==null?void 0:N.handleBounds;let p=f==null?void 0:f[t];if(c===$n.Loose&&(p=p||(f==null?void 0:f[t==="source"?"target":"source"])),!s||!p)return null;const h=l?p.find(D=>D.id===l):p[0],v=h?h.x+h.width/2:(s.width??0)/2,m=h?h.y+h.height/2:s.height??0,E=(((T=s.positionAbsolute)==null?void 0:T.x)??0)+v,d=(((b=s.positionAbsolute)==null?void 0:b.y)??0)+m,g=h==null?void 0:h.position,y=g?px[g]:null;if(!g||!y)return null;if(o)return _(o,{connectionLineType:r,connectionLineStyle:n,fromNode:s,fromHandle:h,fromX:E,fromY:d,toX:a,toY:u,fromPosition:g,toPosition:y,connectionStatus:i});let S="";const w={sourceX:E,sourceY:d,sourcePosition:g,targetX:a,targetY:u,targetPosition:y};return r===zn.Bezier?[S]=Ym(w):r===zn.Step?[S]=Fi({...w,borderRadius:0}):r===zn.SmoothStep?[S]=Fi(w):r===zn.SimpleBezier?[S]=Hm(w):S=`M${E},${d} ${a},${u}`,_("path",{d:S,fill:"none",className:"react-flow__connection-path",style:n})};$v.displayName="ConnectionLine";const hx=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function gx({containerStyle:e,style:t,type:n,component:r}){const{nodeId:o,handleType:i,nodesConnectable:s,width:l,height:a,connectionStatus:u}=de(hx,Qe);return!(o&&i&&l&&s)?null:_("svg",{style:e,width:l,height:a,className:"react-flow__edges react-flow__connectionline react-flow__container",children:_("g",{className:Ke(["react-flow__connection",u]),children:_($v,{nodeId:o,handleType:i,style:t,type:n,CustomComponent:r,connectionStatus:u})})})}const zv=({nodeTypes:e,edgeTypes:t,onMove:n,onMoveStart:r,onMoveEnd:o,onInit:i,onNodeClick:s,onEdgeClick:l,onNodeDoubleClick:a,onEdgeDoubleClick:u,onNodeMouseEnter:c,onNodeMouseMove:f,onNodeMouseLeave:p,onNodeContextMenu:h,onSelectionContextMenu:v,onSelectionStart:m,onSelectionEnd:E,connectionLineType:d,connectionLineStyle:g,connectionLineComponent:y,connectionLineContainerStyle:S,selectionKeyCode:w,selectionOnDrag:N,selectionMode:T,multiSelectionKeyCode:b,panActivationKeyCode:D,zoomActivationKeyCode:k,deleteKeyCode:B,onlyRenderVisibleElements:F,elementsSelectable:z,selectNodesOnDrag:R,defaultViewport:P,translateExtent:A,minZoom:C,maxZoom:x,preventScrolling:L,defaultMarkerColor:U,zoomOnScroll:$,zoomOnPinch:j,panOnScroll:Q,panOnScrollSpeed:K,panOnScrollMode:X,zoomOnDoubleClick:q,panOnDrag:J,onPaneClick:ne,onPaneMouseEnter:he,onPaneMouseMove:ie,onPaneMouseLeave:Pe,onPaneScroll:Ze,onPaneContextMenu:ge,onEdgeUpdate:at,onEdgeContextMenu:Y,onEdgeMouseEnter:ze,onEdgeMouseMove:ut,onEdgeMouseLeave:To,edgeUpdaterRadius:ns,onEdgeUpdateStart:rs,onEdgeUpdateEnd:os,noDragClassName:Jn,noWheelClassName:Io,noPanClassName:er,elevateEdgesOnSelect:Co,disableKeyboardA11y:mn,nodeOrigin:is,nodeExtent:ss,rfId:Ao})=>(dx(i),_(QO,{onPaneClick:ne,onPaneMouseEnter:he,onPaneMouseMove:ie,onPaneMouseLeave:Pe,onPaneContextMenu:ge,onPaneScroll:Ze,deleteKeyCode:B,selectionKeyCode:w,selectionOnDrag:N,selectionMode:T,onSelectionStart:m,onSelectionEnd:E,multiSelectionKeyCode:b,panActivationKeyCode:D,zoomActivationKeyCode:k,elementsSelectable:z,onMove:n,onMoveStart:r,onMoveEnd:o,zoomOnScroll:$,zoomOnPinch:j,zoomOnDoubleClick:q,panOnScroll:Q,panOnScrollSpeed:K,panOnScrollMode:X,panOnDrag:J,defaultViewport:P,translateExtent:A,minZoom:C,maxZoom:x,onSelectionContextMenu:v,preventScrolling:L,noDragClassName:Jn,noWheelClassName:Io,noPanClassName:er,disableKeyboardA11y:mn,children:V(fx,{children:[_(ux,{edgeTypes:t,onEdgeClick:l,onEdgeDoubleClick:u,onEdgeUpdate:at,onlyRenderVisibleElements:F,onEdgeContextMenu:Y,onEdgeMouseEnter:ze,onEdgeMouseMove:ut,onEdgeMouseLeave:To,onEdgeUpdateStart:rs,onEdgeUpdateEnd:os,edgeUpdaterRadius:ns,defaultMarkerColor:U,noPanClassName:er,elevateEdgesOnSelect:!!Co,disableKeyboardA11y:mn,rfId:Ao,children:_(gx,{style:g,type:d,component:y,containerStyle:S})}),_("div",{className:"react-flow__edgelabel-renderer"}),_(ZO,{nodeTypes:e,onNodeClick:s,onNodeDoubleClick:a,onNodeMouseEnter:c,onNodeMouseMove:f,onNodeMouseLeave:p,onNodeContextMenu:h,selectNodesOnDrag:R,onlyRenderVisibleElements:F,noPanClassName:er,noDragClassName:Jn,disableKeyboardA11y:mn,nodeOrigin:is,nodeExtent:ss,rfId:Ao})]})}));zv.displayName="GraphView";var mx=O.memo(zv);const Nf=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],wo={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:Nf,nodeExtent:Nf,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:$n.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,multiSelectionActive:!1,connectionStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:Fm},vx=()=>Pg((e,t)=>({...wo,setNodes:n=>{const{nodeInternals:r,nodeOrigin:o,elevateNodesOnSelect:i}=t();e({nodeInternals:Ef(n,r,o,i)})},getNodes:()=>Array.from(t().nodeInternals.values()),setEdges:n=>{const{defaultEdgeOptions:r={}}=t();e({edges:n.map(o=>({...r,...o}))})},setDefaultNodesAndEdges:(n,r)=>{const o=typeof n<"u",i=typeof r<"u",s=o?Ef(n,new Map,t().nodeOrigin,t().elevateNodesOnSelect):new Map;e({nodeInternals:s,edges:i?r:[],hasDefaultNodes:o,hasDefaultEdges:i})},updateNodeDimensions:n=>{const{onNodesChange:r,nodeInternals:o,fitViewOnInit:i,fitViewOnInitDone:s,fitViewOnInitOptions:l,domNode:a,nodeOrigin:u}=t(),c=a==null?void 0:a.querySelector(".react-flow__viewport");if(!c)return;const f=window.getComputedStyle(c),{m22:p}=new window.DOMMatrixReadOnly(f.transform),h=n.reduce((m,E)=>{const d=o.get(E.id);if(d){const g=rf(E.nodeElement);!!(g.width&&g.height&&(d.width!==g.width||d.height!==g.height||E.forceUpdate))&&(o.set(d.id,{...d,[_e]:{...d[_e],handleBounds:{source:Rv(".source",E.nodeElement,p,u),target:Rv(".target",E.nodeElement,p,u)}},...g}),m.push({id:d.id,type:"dimensions",dimensions:g}))}return m},[]);Cv(o,u);const v=s||i&&!s&&Av(t,{initial:!0,...l});e({nodeInternals:new Map(o),fitViewOnInitDone:v}),(h==null?void 0:h.length)>0&&(r==null||r(h))},updateNodePositions:(n,r=!0,o=!1)=>{const{triggerNodeChanges:i}=t(),s=n.map(l=>{const a={id:l.id,type:"position",dragging:o};return r&&(a.positionAbsolute=l.positionAbsolute,a.position=l.position),a});i(s)},triggerNodeChanges:n=>{const{onNodesChange:r,nodeInternals:o,hasDefaultNodes:i,nodeOrigin:s,getNodes:l,elevateNodesOnSelect:a}=t();if(n!=null&&n.length){if(i){const u=kv(n,l()),c=Ef(u,o,s,a);e({nodeInternals:c})}r==null||r(n)}},addSelectedNodes:n=>{const{multiSelectionActive:r,edges:o,getNodes:i}=t();let s,l=null;r?s=n.map(a=>Hn(a,!0)):(s=_o(i(),n),l=_o(o,[])),ql({changedNodes:s,changedEdges:l,get:t,set:e})},addSelectedEdges:n=>{const{multiSelectionActive:r,edges:o,getNodes:i}=t();let s,l=null;r?s=n.map(a=>Hn(a,!0)):(s=_o(o,n),l=_o(i(),[])),ql({changedNodes:l,changedEdges:s,get:t,set:e})},unselectNodesAndEdges:({nodes:n,edges:r}={})=>{const{edges:o,getNodes:i}=t(),s=n||i(),l=r||o,a=s.map(c=>(c.selected=!1,Hn(c.id,!1))),u=l.map(c=>Hn(c.id,!1));ql({changedNodes:a,changedEdges:u,get:t,set:e})},setMinZoom:n=>{const{d3Zoom:r,maxZoom:o}=t();r==null||r.scaleExtent([n,o]),e({minZoom:n})},setMaxZoom:n=>{const{d3Zoom:r,minZoom:o}=t();r==null||r.scaleExtent([o,n]),e({maxZoom:n})},setTranslateExtent:n=>{var r;(r=t().d3Zoom)==null||r.translateExtent(n),e({translateExtent:n})},resetSelectedElements:()=>{const{edges:n,getNodes:r}=t(),i=r().filter(l=>l.selected).map(l=>Hn(l.id,!1)),s=n.filter(l=>l.selected).map(l=>Hn(l.id,!1));ql({changedNodes:i,changedEdges:s,get:t,set:e})},setNodeExtent:n=>{const{nodeInternals:r}=t();r.forEach(o=>{o.positionAbsolute=of(o.position,n)}),e({nodeExtent:n,nodeInternals:new Map(r)})},panBy:n=>{const{transform:r,width:o,height:i,d3Zoom:s,d3Selection:l,translateExtent:a}=t();if(!s||!l||!n.x&&!n.y)return;const u=Vn.translate(r[0]+n.x,r[1]+n.y).scale(r[2]),c=[[0,0],[o,i]],f=s==null?void 0:s.constrain()(u,c,a);s.transform(l,f)},cancelConnection:()=>e({connectionNodeId:wo.connectionNodeId,connectionHandleId:wo.connectionHandleId,connectionHandleType:wo.connectionHandleType,connectionStatus:wo.connectionStatus}),reset:()=>e({...wo})})),Hv=({children:e})=>{const t=O.useRef(null);return t.current||(t.current=vx()),_(VN,{value:t.current,children:e})};Hv.displayName="ReactFlowProvider";const jv=({children:e})=>O.useContext(Gl)?_(Ae,{children:e}):_(Hv,{children:e});jv.displayName="ReactFlowWrapper";function Wv(e,t){return O.useRef(null),O.useMemo(()=>t(e),[e])}const yx={input:av,default:hf,output:cv,group:gf},Ex={default:Ql,straight:cf,step:uf,smoothstep:Yl,simplebezier:af},Sx=[0,0],_x=[15,15],wx={x:0,y:0,zoom:1},Rx={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},Gv=O.forwardRef(({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:o,nodeTypes:i=yx,edgeTypes:s=Ex,onNodeClick:l,onEdgeClick:a,onInit:u,onMove:c,onMoveStart:f,onMoveEnd:p,onConnect:h,onConnectStart:v,onConnectEnd:m,onClickConnectStart:E,onClickConnectEnd:d,onNodeMouseEnter:g,onNodeMouseMove:y,onNodeMouseLeave:S,onNodeContextMenu:w,onNodeDoubleClick:N,onNodeDragStart:T,onNodeDrag:b,onNodeDragStop:D,onNodesDelete:k,onEdgesDelete:B,onSelectionChange:F,onSelectionDragStart:z,onSelectionDrag:R,onSelectionDragStop:P,onSelectionContextMenu:A,onSelectionStart:C,onSelectionEnd:x,connectionMode:L=$n.Strict,connectionLineType:U=zn.Bezier,connectionLineStyle:$,connectionLineComponent:j,connectionLineContainerStyle:Q,deleteKeyCode:K="Backspace",selectionKeyCode:X="Shift",selectionOnDrag:q=!1,selectionMode:J=Mi.Full,panActivationKeyCode:ne="Space",multiSelectionKeyCode:he="Meta",zoomActivationKeyCode:ie="Meta",snapToGrid:Pe=!1,snapGrid:Ze=_x,onlyRenderVisibleElements:ge=!1,selectNodesOnDrag:at=!0,nodesDraggable:Y,nodesConnectable:ze,nodesFocusable:ut,nodeOrigin:To=Sx,edgesFocusable:ns,elementsSelectable:rs,defaultViewport:os=wx,minZoom:Jn=.5,maxZoom:Io=2,translateExtent:er=Nf,preventScrolling:Co=!0,nodeExtent:mn,defaultMarkerColor:is="#b1b1b7",zoomOnScroll:ss=!0,zoomOnPinch:Ao=!0,panOnScroll:Je=!1,panOnScrollSpeed:Mt=.5,panOnScrollMode:Or=po.Free,zoomOnDoubleClick:xr=!0,panOnDrag:vn=!0,onPaneClick:ya,onPaneMouseEnter:ls,onPaneMouseMove:as,onPaneMouseLeave:ud,onPaneScroll:V0,onPaneContextMenu:Tr,children:HA,onEdgeUpdate:jA,onEdgeContextMenu:WA,onEdgeDoubleClick:GA,onEdgeMouseEnter:YA,onEdgeMouseMove:KA,onEdgeMouseLeave:QA,onEdgeUpdateStart:XA,onEdgeUpdateEnd:qA,edgeUpdaterRadius:ZA=10,onNodesChange:JA,onEdgesChange:eb,noDragClassName:tb="nodrag",noWheelClassName:nb="nowheel",noPanClassName:B0="nopan",fitView:rb=!1,fitViewOptions:ob,connectOnClick:ib=!0,attributionPosition:sb,proOptions:lb,defaultEdgeOptions:ab,elevateNodesOnSelect:ub=!0,elevateEdgesOnSelect:cb=!1,disableKeyboardA11y:$0=!1,autoPanOnConnect:fb=!0,autoPanOnNodeDrag:db=!0,connectionRadius:pb=20,onError:hb,style:gb,id:z0,...mb},vb)=>{const yb=Wv(i,IO),Eb=Wv(s,RO),cd=z0||"1";return _("div",{...mb,style:{...gb,...Rx},ref:vb,className:Ke(["react-flow",o]),"data-testid":"rf__wrapper",id:z0,children:V(jv,{children:[_(mx,{onInit:u,onMove:c,onMoveStart:f,onMoveEnd:p,onNodeClick:l,onEdgeClick:a,onNodeMouseEnter:g,onNodeMouseMove:y,onNodeMouseLeave:S,onNodeContextMenu:w,onNodeDoubleClick:N,nodeTypes:yb,edgeTypes:Eb,connectionLineType:U,connectionLineStyle:$,connectionLineComponent:j,connectionLineContainerStyle:Q,selectionKeyCode:X,selectionOnDrag:q,selectionMode:J,deleteKeyCode:K,multiSelectionKeyCode:he,panActivationKeyCode:ne,zoomActivationKeyCode:ie,onlyRenderVisibleElements:ge,selectNodesOnDrag:at,defaultViewport:os,translateExtent:er,minZoom:Jn,maxZoom:Io,preventScrolling:Co,zoomOnScroll:ss,zoomOnPinch:Ao,zoomOnDoubleClick:xr,panOnScroll:Je,panOnScrollSpeed:Mt,panOnScrollMode:Or,panOnDrag:vn,onPaneClick:ya,onPaneMouseEnter:ls,onPaneMouseMove:as,onPaneMouseLeave:ud,onPaneScroll:V0,onPaneContextMenu:Tr,onSelectionContextMenu:A,onSelectionStart:C,onSelectionEnd:x,onEdgeUpdate:jA,onEdgeContextMenu:WA,onEdgeDoubleClick:GA,onEdgeMouseEnter:YA,onEdgeMouseMove:KA,onEdgeMouseLeave:QA,onEdgeUpdateStart:XA,onEdgeUpdateEnd:qA,edgeUpdaterRadius:ZA,defaultMarkerColor:is,noDragClassName:tb,noWheelClassName:nb,noPanClassName:B0,elevateEdgesOnSelect:cb,rfId:cd,disableKeyboardA11y:$0,nodeOrigin:To,nodeExtent:mn}),_(gO,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:h,onConnectStart:v,onConnectEnd:m,onClickConnectStart:E,onClickConnectEnd:d,nodesDraggable:Y,nodesConnectable:ze,nodesFocusable:ut,edgesFocusable:ns,elementsSelectable:rs,elevateNodesOnSelect:ub,minZoom:Jn,maxZoom:Io,nodeExtent:mn,onNodesChange:JA,onEdgesChange:eb,snapToGrid:Pe,snapGrid:Ze,connectionMode:L,translateExtent:er,connectOnClick:ib,defaultEdgeOptions:ab,fitView:rb,fitViewOptions:ob,onNodesDelete:k,onEdgesDelete:B,onNodeDragStart:T,onNodeDrag:b,onNodeDragStop:D,onSelectionDrag:R,onSelectionDragStart:z,onSelectionDragStop:P,noPanClassName:B0,nodeOrigin:To,rfId:cd,autoPanOnConnect:fb,autoPanOnNodeDrag:db,onError:hb,connectionRadius:pb}),_(pO,{onSelectionChange:F}),HA,_($N,{proOptions:lb,position:sb}),_(SO,{rfId:cd,disableKeyboardA11y:$0})]})})});Gv.displayName="ReactFlow";function Nx(){return _("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:_("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function Ox(){return _("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:_("path",{d:"M0 0h32v4.2H0z"})})}function xx(){return _("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:_("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function Tx(){return _("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:_("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function Ix(){return _("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:_("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}const zi=({children:e,className:t,...n})=>_("button",{type:"button",className:Ke(["react-flow__controls-button",t]),...n,children:e});zi.displayName="ControlButton";const Cx=e=>e.nodesDraggable&&e.nodesConnectable&&e.elementsSelectable,Yv=({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:o,onZoomIn:i,onZoomOut:s,onFitView:l,onInteractiveChange:a,className:u,children:c,position:f="bottom-left"})=>{const p=Ce(),[h,v]=O.useState(!1),m=de(Cx),{zoomIn:E,zoomOut:d,fitView:g}=Sf();if(O.useEffect(()=>{v(!0)},[]),!h)return null;const y=()=>{E(),i==null||i()},S=()=>{d(),s==null||s()},w=()=>{g(o),l==null||l()},N=()=>{p.setState({nodesDraggable:!m,nodesConnectable:!m,elementsSelectable:!m}),a==null||a(!m)};return V(nf,{className:Ke(["react-flow__controls",u]),position:f,style:e,children:[t&&V(Ae,{children:[_(zi,{onClick:y,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",children:_(Nx,{})}),_(zi,{onClick:S,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",children:_(Ox,{})})]}),n&&_(zi,{className:"react-flow__controls-fitview",onClick:w,title:"fit view","aria-label":"fit view",children:_(xx,{})}),r&&_(zi,{className:"react-flow__controls-interactive",onClick:N,title:"toggle interactivity","aria-label":"toggle interactivity",children:m?_(Ix,{}):_(Tx,{})}),c]})};Yv.displayName="Controls";var Ax=O.memo(Yv);let bx=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,n)=>(n&=63,n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n>62?t+="-":t+="_",t),"");const Lx=!1,Kv="0.0.0",Qv="0.0.0",Xv={type:"floating",markerEnd:{type:Ui.Arrow,width:20,height:20,color:"#c2c8d1"},style:{stroke:"#c2c8d1",strokeWidth:1.5}},ye=()=>bx(),Dx=()=>{const e={},t=document.querySelector('meta[name="csrf-token"]');return t&&(e["X-CSRF-Token"]=t==null?void 0:t.content),e},kx=(e,t)=>{var i;const n=new Blob([JSON.stringify({nodes:e,edges:t},null,2)],{type:"application/json"}),r=window.URL.createObjectURL(n),o=window.open();(i=o==null?void 0:o.location)!=null&&i.href&&(o.location.href=r)},Px=e=>e.map(t=>typeof t=="string"?t.trim():t).filter(Boolean).join(),Of=e=>e.split(",").map(t=>t.trim()).filter(Boolean),Mx=e=>({...e,...Xv}),Ux=e=>e.type==="handleCall"?{...e,deletable:!1}:e,Zl=e=>e==="success"?"positive":"negative",Fx=e=>e.toLowerCase().replace(/ /g,"-"),xf=()=>[{result:"success",id:ye()},{result:"noAnswer",id:ye()},{result:"busy",id:ye()},{result:"decline",id:ye()},{result:"error",id:ye()}],qv={answer:()=>({}),forwardAddress:()=>({destinations:[],destinationType:"address",options:xf(),sessionTimeout:void 0,type:"single"}),forwardPhone:()=>({destinations:[],destinationType:"phone",options:xf(),sessionTimeout:void 0,type:"single"}),forwardResource:()=>({destinations:[],destinationType:"resource",options:xf(),sessionTimeout:void 0,type:"single"}),hangup:()=>({}),play:()=>({selected:"",text:"",url:""}),promptPlay:()=>({initialTimeout:5,options:[],results:[{id:ye(),result:"no_match"},{id:ye(),result:"no_input"}],selected:"",text:"",url:""}),record:()=>({beep:!1,format:"wav",options:[{id:ye(),result:"success"},{id:ye(),result:"failed"}],stereo:!1,terminators:""}),recordCallStart:()=>({beep:!1,controlId:ye(),format:"wav",label:"",options:[{id:ye(),result:"success"},{id:ye(),result:"failed"}],stereo:!1,terminators:""}),recordCallStop:()=>({controlId:""}),sendSms:()=>({body:"",fromNumber:"",media:[],region:"",tags:[],toNumber:""}),set:()=>({variables:[]}),unset:()=>({variables:[]}),request:()=>({url:"",method:"POST",headers:{},body:"",options:[{id:ye(),result:"success"},{id:ye(),result:"failed"}]}),cond:()=>({options:[],fallback:ye()})};function Lt(e){return Lt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lt(e)}function vt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Vx(e,t){if(Lt(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Lt(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Zv(e){var t=Vx(e,"string");return Lt(t)==="symbol"?t:String(t)}function Jv(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Zv(r.key),r)}}function yt(e,t,n){return t&&Jv(e.prototype,t),n&&Jv(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function jn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Tf(e,t){return Tf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},Tf(e,t)}function Jl(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Tf(e,t)}function Hi(e,t){if(t&&(Lt(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return jn(e)}function Wt(e){return Wt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Wt(e)}function pn(e,t,n){return t=Zv(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bx(e){if(Array.isArray(e))return e}function $x(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ey(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function zx(e,t){if(e){if(typeof e=="string")return ey(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ey(e,t)}}function Hx(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
61
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jx(e){return Bx(e)||$x(e)||zx(e)||Hx()}function ty(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function ny(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ty(Object(n),!0).forEach(function(r){pn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ty(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Wx={type:"logger",log:function(t){this.output("log",t)},warn:function(t){this.output("warn",t)},error:function(t){this.output("error",t)},output:function(t,n){console&&console[t]&&console[t].apply(console,n)}},Gx=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};vt(this,e),this.init(t,n)}return yt(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=r.prefix||"i18next:",this.logger=n||Wx,this.options=r,this.debug=r.debug}},{key:"setDebug",value:function(n){this.debug=n}},{key:"log",value:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return this.forward(r,"log","",!0)}},{key:"warn",value:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return this.forward(r,"warn","",!0)}},{key:"error",value:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return this.forward(r,"error","")}},{key:"deprecate",value:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return this.forward(r,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(n,r,o,i){return i&&!this.debug?null:(typeof n[0]=="string"&&(n[0]="".concat(o).concat(this.prefix," ").concat(n[0])),this.logger[r](n))}},{key:"create",value:function(n){return new e(this.logger,ny(ny({},{prefix:"".concat(this.prefix,":").concat(n,":")}),this.options))}},{key:"clone",value:function(n){return n=n||this.options,n.prefix=n.prefix||this.prefix,new e(this.logger,n)}}]),e}(),Gt=new Gx,Wn=function(){function e(){vt(this,e),this.observers={}}return yt(e,[{key:"on",value:function(n,r){var o=this;return n.split(" ").forEach(function(i){o.observers[i]=o.observers[i]||[],o.observers[i].push(r)}),this}},{key:"off",value:function(n,r){if(this.observers[n]){if(!r){delete this.observers[n];return}this.observers[n]=this.observers[n].filter(function(o){return o!==r})}}},{key:"emit",value:function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];if(this.observers[n]){var s=[].concat(this.observers[n]);s.forEach(function(a){a.apply(void 0,o)})}if(this.observers["*"]){var l=[].concat(this.observers["*"]);l.forEach(function(a){a.apply(a,[n].concat(o))})}}}]),e}();function ji(){var e,t,n=new Promise(function(r,o){e=r,t=o});return n.resolve=e,n.reject=t,n}function ry(e){return e==null?"":""+e}function Yx(e,t,n){e.forEach(function(r){t[r]&&(n[r]=t[r])})}function If(e,t,n){function r(l){return l&&l.indexOf("###")>-1?l.replace(/###/g,"."):l}function o(){return!e||typeof e=="string"}for(var i=typeof t!="string"?[].concat(t):t.split(".");i.length>1;){if(o())return{};var s=r(i.shift());!e[s]&&n&&(e[s]=new n),Object.prototype.hasOwnProperty.call(e,s)?e=e[s]:e={}}return o()?{}:{obj:e,k:r(i.shift())}}function oy(e,t,n){var r=If(e,t,Object),o=r.obj,i=r.k;o[i]=n}function Kx(e,t,n,r){var o=If(e,t,Object),i=o.obj,s=o.k;i[s]=i[s]||[],r&&(i[s]=i[s].concat(n)),r||i[s].push(n)}function ea(e,t){var n=If(e,t),r=n.obj,o=n.k;if(r)return r[o]}function iy(e,t,n){var r=ea(e,n);return r!==void 0?r:ea(t,n)}function sy(e,t,n){for(var r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?typeof e[r]=="string"||e[r]instanceof String||typeof t[r]=="string"||t[r]instanceof String?n&&(e[r]=t[r]):sy(e[r],t[r],n):e[r]=t[r]);return e}function Ro(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var Qx={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function Xx(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,function(t){return Qx[t]}):e}var ta=typeof window<"u"&&window.navigator&&typeof window.navigator.userAgentData>"u"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,qx=[" ",",","?","!",";"];function Zx(e,t,n){t=t||"",n=n||"";var r=qx.filter(function(l){return t.indexOf(l)<0&&n.indexOf(l)<0});if(r.length===0)return!0;var o=new RegExp("(".concat(r.map(function(l){return l==="?"?"\\?":l}).join("|"),")")),i=!o.test(e);if(!i){var s=e.indexOf(n);s>0&&!o.test(e.substring(0,s))&&(i=!0)}return i}function ly(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function na(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ly(Object(n),!0).forEach(function(r){pn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ly(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Jx(e){var t=eT();return function(){var r=Wt(e),o;if(t){var i=Wt(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return Hi(this,o)}}function eT(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ay(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(e){if(e[t])return e[t];for(var r=t.split(n),o=e,i=0;i<r.length;++i){if(!o||typeof o[r[i]]=="string"&&i+1<r.length)return;if(o[r[i]]===void 0){for(var s=2,l=r.slice(i,i+s).join(n),a=o[l];a===void 0&&r.length>i+s;)s++,l=r.slice(i,i+s).join(n),a=o[l];if(a===void 0)return;if(a===null)return null;if(t.endsWith(l)){if(typeof a=="string")return a;if(l&&typeof a[l]=="string")return a[l]}var u=r.slice(i+s).join(n);return u?ay(a,u,n):void 0}o=o[r[i]]}return o}}var tT=function(e){Jl(n,e);var t=Jx(n);function n(r){var o,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return vt(this,n),o=t.call(this),ta&&Wn.call(jn(o)),o.data=r||{},o.options=i,o.options.keySeparator===void 0&&(o.options.keySeparator="."),o.options.ignoreJSONStructure===void 0&&(o.options.ignoreJSONStructure=!0),o}return yt(n,[{key:"addNamespaces",value:function(o){this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}},{key:"removeNamespaces",value:function(o){var i=this.options.ns.indexOf(o);i>-1&&this.options.ns.splice(i,1)}},{key:"getResource",value:function(o,i,s){var l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},a=l.keySeparator!==void 0?l.keySeparator:this.options.keySeparator,u=l.ignoreJSONStructure!==void 0?l.ignoreJSONStructure:this.options.ignoreJSONStructure,c=[o,i];s&&typeof s!="string"&&(c=c.concat(s)),s&&typeof s=="string"&&(c=c.concat(a?s.split(a):s)),o.indexOf(".")>-1&&(c=o.split("."));var f=ea(this.data,c);return f||!u||typeof s!="string"?f:ay(this.data&&this.data[o]&&this.data[o][i],s,a)}},{key:"addResource",value:function(o,i,s,l){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},u=this.options.keySeparator;u===void 0&&(u=".");var c=[o,i];s&&(c=c.concat(u?s.split(u):s)),o.indexOf(".")>-1&&(c=o.split("."),l=i,i=c[1]),this.addNamespaces(i),oy(this.data,c,l),a.silent||this.emit("added",o,i,s,l)}},{key:"addResources",value:function(o,i,s){var l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var a in s)(typeof s[a]=="string"||Object.prototype.toString.apply(s[a])==="[object Array]")&&this.addResource(o,i,a,s[a],{silent:!0});l.silent||this.emit("added",o,i,s)}},{key:"addResourceBundle",value:function(o,i,s,l,a){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},c=[o,i];o.indexOf(".")>-1&&(c=o.split("."),l=s,s=i,i=c[1]),this.addNamespaces(i);var f=ea(this.data,c)||{};l?sy(f,s,a):f=na(na({},f),s),oy(this.data,c,f),u.silent||this.emit("added",o,i,s)}},{key:"removeResourceBundle",value:function(o,i){this.hasResourceBundle(o,i)&&delete this.data[o][i],this.removeNamespaces(i),this.emit("removed",o,i)}},{key:"hasResourceBundle",value:function(o,i){return this.getResource(o,i)!==void 0}},{key:"getResourceBundle",value:function(o,i){return i||(i=this.options.defaultNS),this.options.compatibilityAPI==="v1"?na(na({},{}),this.getResource(o,i)):this.getResource(o,i)}},{key:"getDataByLanguage",value:function(o){return this.data[o]}},{key:"hasLanguageSomeTranslations",value:function(o){var i=this.getDataByLanguage(o),s=i&&Object.keys(i)||[];return!!s.find(function(l){return i[l]&&Object.keys(i[l]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),n}(Wn),uy={processors:{},addPostProcessor:function(t){this.processors[t.name]=t},handle:function(t,n,r,o,i){var s=this;return t.forEach(function(l){s.processors[l]&&(n=s.processors[l].process(n,r,o,i))}),n}};function cy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Be(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?cy(Object(n),!0).forEach(function(r){pn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cy(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nT(e){var t=rT();return function(){var r=Wt(e),o;if(t){var i=Wt(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return Hi(this,o)}}function rT(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var fy={},dy=function(e){Jl(n,e);var t=nT(n);function n(r){var o,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return vt(this,n),o=t.call(this),ta&&Wn.call(jn(o)),Yx(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],r,jn(o)),o.options=i,o.options.keySeparator===void 0&&(o.options.keySeparator="."),o.logger=Gt.create("translator"),o}return yt(n,[{key:"changeLanguage",value:function(o){o&&(this.language=o)}},{key:"exists",value:function(o){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(o==null)return!1;var s=this.resolve(o,i);return s&&s.res!==void 0}},{key:"extractFromKey",value:function(o,i){var s=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;s===void 0&&(s=":");var l=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,a=i.ns||this.options.defaultNS||[],u=s&&o.indexOf(s)>-1,c=!this.options.userDefinedKeySeparator&&!i.keySeparator&&!this.options.userDefinedNsSeparator&&!i.nsSeparator&&!Zx(o,s,l);if(u&&!c){var f=o.match(this.interpolator.nestingRegexp);if(f&&f.length>0)return{key:o,namespaces:a};var p=o.split(s);(s!==l||s===l&&this.options.ns.indexOf(p[0])>-1)&&(a=p.shift()),o=p.join(l)}return typeof a=="string"&&(a=[a]),{key:o,namespaces:a}}},{key:"translate",value:function(o,i,s){var l=this;if(Lt(i)!=="object"&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),i||(i={}),o==null)return"";Array.isArray(o)||(o=[String(o)]);var a=i.returnDetails!==void 0?i.returnDetails:this.options.returnDetails,u=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,c=this.extractFromKey(o[o.length-1],i),f=c.key,p=c.namespaces,h=p[p.length-1],v=i.lng||this.language,m=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(v&&v.toLowerCase()==="cimode"){if(m){var E=i.nsSeparator||this.options.nsSeparator;return a?{res:"".concat(h).concat(E).concat(f),usedKey:f,exactUsedKey:f,usedLng:v,usedNS:h}:"".concat(h).concat(E).concat(f)}return a?{res:f,usedKey:f,exactUsedKey:f,usedLng:v,usedNS:h}:f}var d=this.resolve(o,i),g=d&&d.res,y=d&&d.usedKey||f,S=d&&d.exactUsedKey||f,w=Object.prototype.toString.apply(g),N=["[object Number]","[object Function]","[object RegExp]"],T=i.joinArrays!==void 0?i.joinArrays:this.options.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject,D=typeof g!="string"&&typeof g!="boolean"&&typeof g!="number";if(b&&g&&D&&N.indexOf(w)<0&&!(typeof T=="string"&&w==="[object Array]")){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var k=this.options.returnedObjectHandler?this.options.returnedObjectHandler(y,g,Be(Be({},i),{},{ns:p})):"key '".concat(f," (").concat(this.language,")' returned an object instead of string.");return a?(d.res=k,d):k}if(u){var B=w==="[object Array]",F=B?[]:{},z=B?S:y;for(var R in g)if(Object.prototype.hasOwnProperty.call(g,R)){var P="".concat(z).concat(u).concat(R);F[R]=this.translate(P,Be(Be({},i),{joinArrays:!1,ns:p})),F[R]===P&&(F[R]=g[R])}g=F}}else if(b&&typeof T=="string"&&w==="[object Array]")g=g.join(T),g&&(g=this.extendTranslation(g,o,i,s));else{var A=!1,C=!1,x=i.count!==void 0&&typeof i.count!="string",L=n.hasDefaultValue(i),U=x?this.pluralResolver.getSuffix(v,i.count,i):"",$=i["defaultValue".concat(U)]||i.defaultValue;!this.isValidLookup(g)&&L&&(A=!0,g=$),this.isValidLookup(g)||(C=!0,g=f);var j=i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,Q=j&&C?void 0:g,K=L&&$!==g&&this.options.updateMissing;if(C||A||K){if(this.logger.log(K?"updateKey":"missingKey",v,h,f,K?$:g),u){var X=this.resolve(f,Be(Be({},i),{},{keySeparator:!1}));X&&X.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var q=[],J=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo==="fallback"&&J&&J[0])for(var ne=0;ne<J.length;ne++)q.push(J[ne]);else this.options.saveMissingTo==="all"?q=this.languageUtils.toResolveHierarchy(i.lng||this.language):q.push(i.lng||this.language);var he=function(Pe,Ze,ge){var at=L&&ge!==g?ge:Q;l.options.missingKeyHandler?l.options.missingKeyHandler(Pe,h,Ze,at,K,i):l.backendConnector&&l.backendConnector.saveMissing&&l.backendConnector.saveMissing(Pe,h,Ze,at,K,i),l.emit("missingKey",Pe,h,Ze,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&x?q.forEach(function(ie){l.pluralResolver.getSuffixes(ie,i).forEach(function(Pe){he([ie],f+Pe,i["defaultValue".concat(Pe)]||$)})}):he(q,f,$))}g=this.extendTranslation(g,o,i,d,s),C&&g===f&&this.options.appendNamespaceToMissingKey&&(g="".concat(h,":").concat(f)),(C||A)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(h,":").concat(f):f,A?g:void 0):g=this.options.parseMissingKeyHandler(g))}return a?(d.res=g,d):g}},{key:"extendTranslation",value:function(o,i,s,l,a){var u=this;if(this.i18nFormat&&this.i18nFormat.parse)o=this.i18nFormat.parse(o,Be(Be({},this.options.interpolation.defaultVariables),s),l.usedLng,l.usedNS,l.usedKey,{resolved:l});else if(!s.skipInterpolation){s.interpolation&&this.interpolator.init(Be(Be({},s),{interpolation:Be(Be({},this.options.interpolation),s.interpolation)}));var c=typeof o=="string"&&(s&&s.interpolation&&s.interpolation.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables),f;if(c){var p=o.match(this.interpolator.nestingRegexp);f=p&&p.length}var h=s.replace&&typeof s.replace!="string"?s.replace:s;if(this.options.interpolation.defaultVariables&&(h=Be(Be({},this.options.interpolation.defaultVariables),h)),o=this.interpolator.interpolate(o,h,s.lng||this.language,s),c){var v=o.match(this.interpolator.nestingRegexp),m=v&&v.length;f<m&&(s.nest=!1)}s.nest!==!1&&(o=this.interpolator.nest(o,function(){for(var g=arguments.length,y=new Array(g),S=0;S<g;S++)y[S]=arguments[S];return a&&a[0]===y[0]&&!s.context?(u.logger.warn("It seems you are nesting recursively key: ".concat(y[0]," in key: ").concat(i[0])),null):u.translate.apply(u,y.concat([i]))},s)),s.interpolation&&this.interpolator.reset()}var E=s.postProcess||this.options.postProcess,d=typeof E=="string"?[E]:E;return o!=null&&d&&d.length&&s.applyPostProcessor!==!1&&(o=uy.handle(d,o,i,this.options&&this.options.postProcessPassResolved?Be({i18nResolved:l},s):s,this)),o}},{key:"resolve",value:function(o){var i=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l,a,u,c,f;return typeof o=="string"&&(o=[o]),o.forEach(function(p){if(!i.isValidLookup(l)){var h=i.extractFromKey(p,s),v=h.key;a=v;var m=h.namespaces;i.options.fallbackNS&&(m=m.concat(i.options.fallbackNS));var E=s.count!==void 0&&typeof s.count!="string",d=E&&!s.ordinal&&s.count===0&&i.pluralResolver.shouldUseIntlApi(),g=s.context!==void 0&&(typeof s.context=="string"||typeof s.context=="number")&&s.context!=="",y=s.lngs?s.lngs:i.languageUtils.toResolveHierarchy(s.lng||i.language,s.fallbackLng);m.forEach(function(S){i.isValidLookup(l)||(f=S,!fy["".concat(y[0],"-").concat(S)]&&i.utils&&i.utils.hasLoadedNamespace&&!i.utils.hasLoadedNamespace(f)&&(fy["".concat(y[0],"-").concat(S)]=!0,i.logger.warn('key "'.concat(a,'" for languages "').concat(y.join(", "),`" won't get resolved as namespace "`).concat(f,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),y.forEach(function(w){if(!i.isValidLookup(l)){c=w;var N=[v];if(i.i18nFormat&&i.i18nFormat.addLookupKeys)i.i18nFormat.addLookupKeys(N,v,w,S,s);else{var T;E&&(T=i.pluralResolver.getSuffix(w,s.count,s));var b="".concat(i.options.pluralSeparator,"zero");if(E&&(N.push(v+T),d&&N.push(v+b)),g){var D="".concat(v).concat(i.options.contextSeparator).concat(s.context);N.push(D),E&&(N.push(D+T),d&&N.push(D+b))}}for(var k;k=N.pop();)i.isValidLookup(l)||(u=k,l=i.getResource(w,S,k,s))}}))})}}),{res:l,usedKey:a,exactUsedKey:u,usedLng:c,usedNS:f}}},{key:"isValidLookup",value:function(o){return o!==void 0&&!(!this.options.returnNull&&o===null)&&!(!this.options.returnEmptyString&&o==="")}},{key:"getResource",value:function(o,i,s){var l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(o,i,s,l):this.resourceStore.getResource(o,i,s,l)}}],[{key:"hasDefaultValue",value:function(o){var i="defaultValue";for(var s in o)if(Object.prototype.hasOwnProperty.call(o,s)&&i===s.substring(0,i.length)&&o[s]!==void 0)return!0;return!1}}]),n}(Wn);function Cf(e){return e.charAt(0).toUpperCase()+e.slice(1)}var py=function(){function e(t){vt(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Gt.create("languageUtils")}return yt(e,[{key:"getScriptPartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return null;var r=n.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}},{key:"getLanguagePartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return n;var r=n.split("-");return this.formatLanguageCode(r[0])}},{key:"formatLanguageCode",value:function(n){if(typeof n=="string"&&n.indexOf("-")>-1){var r=["hans","hant","latn","cyrl","cans","mong","arab"],o=n.split("-");return this.options.lowerCaseLng?o=o.map(function(i){return i.toLowerCase()}):o.length===2?(o[0]=o[0].toLowerCase(),o[1]=o[1].toUpperCase(),r.indexOf(o[1].toLowerCase())>-1&&(o[1]=Cf(o[1].toLowerCase()))):o.length===3&&(o[0]=o[0].toLowerCase(),o[1].length===2&&(o[1]=o[1].toUpperCase()),o[0]!=="sgn"&&o[2].length===2&&(o[2]=o[2].toUpperCase()),r.indexOf(o[1].toLowerCase())>-1&&(o[1]=Cf(o[1].toLowerCase())),r.indexOf(o[2].toLowerCase())>-1&&(o[2]=Cf(o[2].toLowerCase()))),o.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?n.toLowerCase():n}},{key:"isSupportedCode",value:function(n){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(n=this.getLanguagePartFromCode(n)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(n)>-1}},{key:"getBestMatchFromCodes",value:function(n){var r=this;if(!n)return null;var o;return n.forEach(function(i){if(!o){var s=r.formatLanguageCode(i);(!r.options.supportedLngs||r.isSupportedCode(s))&&(o=s)}}),!o&&this.options.supportedLngs&&n.forEach(function(i){if(!o){var s=r.getLanguagePartFromCode(i);if(r.isSupportedCode(s))return o=s;o=r.options.supportedLngs.find(function(l){if(l.indexOf(s)===0)return l})}}),o||(o=this.getFallbackCodes(this.options.fallbackLng)[0]),o}},{key:"getFallbackCodes",value:function(n,r){if(!n)return[];if(typeof n=="function"&&(n=n(r)),typeof n=="string"&&(n=[n]),Object.prototype.toString.apply(n)==="[object Array]")return n;if(!r)return n.default||[];var o=n[r];return o||(o=n[this.getScriptPartFromCode(r)]),o||(o=n[this.formatLanguageCode(r)]),o||(o=n[this.getLanguagePartFromCode(r)]),o||(o=n.default),o||[]}},{key:"toResolveHierarchy",value:function(n,r){var o=this,i=this.getFallbackCodes(r||this.options.fallbackLng||[],n),s=[],l=function(u){u&&(o.isSupportedCode(u)?s.push(u):o.logger.warn("rejecting language code not found in supportedLngs: ".concat(u)))};return typeof n=="string"&&n.indexOf("-")>-1?(this.options.load!=="languageOnly"&&l(this.formatLanguageCode(n)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&l(this.getScriptPartFromCode(n)),this.options.load!=="currentOnly"&&l(this.getLanguagePartFromCode(n))):typeof n=="string"&&l(this.formatLanguageCode(n)),i.forEach(function(a){s.indexOf(a)<0&&l(o.formatLanguageCode(a))}),s}}]),e}(),oT=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],iT={1:function(t){return Number(t>1)},2:function(t){return Number(t!=1)},3:function(t){return 0},4:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function(t){return Number(t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function(t){return Number(t==1?0:t>=2&&t<=4?1:2)},7:function(t){return Number(t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function(t){return Number(t==1?0:t==2?1:t!=8&&t!=11?2:3)},9:function(t){return Number(t>=2)},10:function(t){return Number(t==1?0:t==2?1:t<7?2:t<11?3:4)},11:function(t){return Number(t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3)},12:function(t){return Number(t%10!=1||t%100==11)},13:function(t){return Number(t!==0)},14:function(t){return Number(t==1?0:t==2?1:t==3?2:3)},15:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function(t){return Number(t%10==1&&t%100!=11?0:t!==0?1:2)},17:function(t){return Number(t==1||t%10==1&&t%100!=11?0:1)},18:function(t){return Number(t==0?0:t==1?1:2)},19:function(t){return Number(t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function(t){return Number(t==1?0:t==0||t%100>0&&t%100<20?1:2)},21:function(t){return Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0)},22:function(t){return Number(t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3)}},sT=["v1","v2","v3"],hy={zero:0,one:1,two:2,few:3,many:4,other:5};function lT(){var e={};return oT.forEach(function(t){t.lngs.forEach(function(n){e[n]={numbers:t.nr,plurals:iT[t.fc]}})}),e}var aT=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};vt(this,e),this.languageUtils=t,this.options=n,this.logger=Gt.create("pluralResolver"),(!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=lT()}return yt(e,[{key:"addRule",value:function(n,r){this.rules[n]=r}},{key:"getRule",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(n,{type:r.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[n]||this.rules[this.languageUtils.getLanguagePartFromCode(n)]}},{key:"needsPlural",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=this.getRule(n,r);return this.shouldUseIntlApi()?o&&o.resolvedOptions().pluralCategories.length>1:o&&o.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(n,r){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(n,o).map(function(i){return"".concat(r).concat(i)})}},{key:"getSuffixes",value:function(n){var r=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=this.getRule(n,o);return i?this.shouldUseIntlApi()?i.resolvedOptions().pluralCategories.sort(function(s,l){return hy[s]-hy[l]}).map(function(s){return"".concat(r.options.prepend).concat(s)}):i.numbers.map(function(s){return r.getSuffix(n,s,o)}):[]}},{key:"getSuffix",value:function(n,r){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=this.getRule(n,o);return i?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(i.select(r)):this.getSuffixRetroCompatible(i,r):(this.logger.warn("no plural rule found for: ".concat(n)),"")}},{key:"getSuffixRetroCompatible",value:function(n,r){var o=this,i=n.noAbs?n.plurals(r):n.plurals(Math.abs(r)),s=n.numbers[i];this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1&&(s===2?s="plural":s===1&&(s=""));var l=function(){return o.options.prepend&&s.toString()?o.options.prepend+s.toString():s.toString()};return this.options.compatibilityJSON==="v1"?s===1?"":typeof s=="number"?"_plural_".concat(s.toString()):l():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1?l():this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString()}},{key:"shouldUseIntlApi",value:function(){return!sT.includes(this.options.compatibilityJSON)}}]),e}();function gy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Dt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gy(Object(n),!0).forEach(function(r){pn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gy(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var uT=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};vt(this,e),this.logger=Gt.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(n){return n},this.init(t)}return yt(e,[{key:"init",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};n.interpolation||(n.interpolation={escapeValue:!0});var r=n.interpolation;this.escape=r.escape!==void 0?r.escape:Xx,this.escapeValue=r.escapeValue!==void 0?r.escapeValue:!0,this.useRawValueToEscape=r.useRawValueToEscape!==void 0?r.useRawValueToEscape:!1,this.prefix=r.prefix?Ro(r.prefix):r.prefixEscaped||"{{",this.suffix=r.suffix?Ro(r.suffix):r.suffixEscaped||"}}",this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||",",this.unescapePrefix=r.unescapeSuffix?"":r.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":r.unescapeSuffix||"",this.nestingPrefix=r.nestingPrefix?Ro(r.nestingPrefix):r.nestingPrefixEscaped||Ro("$t("),this.nestingSuffix=r.nestingSuffix?Ro(r.nestingSuffix):r.nestingSuffixEscaped||Ro(")"),this.nestingOptionsSeparator=r.nestingOptionsSeparator?r.nestingOptionsSeparator:r.nestingOptionsSeparator||",",this.maxReplaces=r.maxReplaces?r.maxReplaces:1e3,this.alwaysFormat=r.alwaysFormat!==void 0?r.alwaysFormat:!1,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var n="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(n,"g");var r="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(r,"g");var o="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(o,"g")}},{key:"interpolate",value:function(n,r,o,i){var s=this,l,a,u,c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function f(E){return E.replace(/\$/g,"$$$$")}var p=function(d){if(d.indexOf(s.formatSeparator)<0){var g=iy(r,c,d);return s.alwaysFormat?s.format(g,void 0,o,Dt(Dt(Dt({},i),r),{},{interpolationkey:d})):g}var y=d.split(s.formatSeparator),S=y.shift().trim(),w=y.join(s.formatSeparator).trim();return s.format(iy(r,c,S),w,o,Dt(Dt(Dt({},i),r),{},{interpolationkey:S}))};this.resetRegExp();var h=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler,v=i&&i.interpolation&&i.interpolation.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,m=[{regex:this.regexpUnescape,safeValue:function(d){return f(d)}},{regex:this.regexp,safeValue:function(d){return s.escapeValue?f(s.escape(d)):f(d)}}];return m.forEach(function(E){for(u=0;l=E.regex.exec(n);){var d=l[1].trim();if(a=p(d),a===void 0)if(typeof h=="function"){var g=h(n,l,i);a=typeof g=="string"?g:""}else if(i&&Object.prototype.hasOwnProperty.call(i,d))a="";else if(v){a=l[0];continue}else s.logger.warn("missed to pass in variable ".concat(d," for interpolating ").concat(n)),a="";else typeof a!="string"&&!s.useRawValueToEscape&&(a=ry(a));var y=E.safeValue(a);if(n=n.replace(l[0],y),v?(E.regex.lastIndex+=a.length,E.regex.lastIndex-=l[0].length):E.regex.lastIndex=0,u++,u>=s.maxReplaces)break}}),n}},{key:"nest",value:function(n,r){var o=this,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,l,a;function u(h,v){var m=this.nestingOptionsSeparator;if(h.indexOf(m)<0)return h;var E=h.split(new RegExp("".concat(m,"[ ]*{"))),d="{".concat(E[1]);h=E[0],d=this.interpolate(d,a);var g=d.match(/'/g),y=d.match(/"/g);(g&&g.length%2===0&&!y||y.length%2!==0)&&(d=d.replace(/'/g,'"'));try{a=JSON.parse(d),v&&(a=Dt(Dt({},v),a))}catch(S){return this.logger.warn("failed parsing options string in nesting for key ".concat(h),S),"".concat(h).concat(m).concat(d)}return delete a.defaultValue,h}for(;s=this.nestingRegexp.exec(n);){var c=[];a=Dt({},i),a=a.replace&&typeof a.replace!="string"?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;var f=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){var p=s[1].split(this.formatSeparator).map(function(h){return h.trim()});s[1]=p.shift(),c=p,f=!0}if(l=r(u.call(this,s[1].trim(),a),a),l&&s[0]===n&&typeof l!="string")return l;typeof l!="string"&&(l=ry(l)),l||(this.logger.warn("missed to resolve ".concat(s[1]," for nesting ").concat(n)),l=""),f&&(l=c.reduce(function(h,v){return o.format(h,v,i.lng,Dt(Dt({},i),{},{interpolationkey:s[1].trim()}))},l.trim())),n=n.replace(s[0],l),this.regexp.lastIndex=0}return n}}]),e}();function my(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function hn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?my(Object(n),!0).forEach(function(r){pn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):my(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function cT(e){var t=e.toLowerCase().trim(),n={};if(e.indexOf("(")>-1){var r=e.split("(");t=r[0].toLowerCase().trim();var o=r[1].substring(0,r[1].length-1);if(t==="currency"&&o.indexOf(":")<0)n.currency||(n.currency=o.trim());else if(t==="relativetime"&&o.indexOf(":")<0)n.range||(n.range=o.trim());else{var i=o.split(";");i.forEach(function(s){if(s){var l=s.split(":"),a=jx(l),u=a[0],c=a.slice(1),f=c.join(":").trim().replace(/^'+|'+$/g,"");n[u.trim()]||(n[u.trim()]=f),f==="false"&&(n[u.trim()]=!1),f==="true"&&(n[u.trim()]=!0),isNaN(f)||(n[u.trim()]=parseInt(f,10))}})}}return{formatName:t,formatOptions:n}}function No(e){var t={};return function(r,o,i){var s=o+JSON.stringify(i),l=t[s];return l||(l=e(o,i),t[s]=l),l(r)}}var fT=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};vt(this,e),this.logger=Gt.create("formatter"),this.options=t,this.formats={number:No(function(n,r){var o=new Intl.NumberFormat(n,hn({},r));return function(i){return o.format(i)}}),currency:No(function(n,r){var o=new Intl.NumberFormat(n,hn(hn({},r),{},{style:"currency"}));return function(i){return o.format(i)}}),datetime:No(function(n,r){var o=new Intl.DateTimeFormat(n,hn({},r));return function(i){return o.format(i)}}),relativetime:No(function(n,r){var o=new Intl.RelativeTimeFormat(n,hn({},r));return function(i){return o.format(i,r.range||"day")}}),list:No(function(n,r){var o=new Intl.ListFormat(n,hn({},r));return function(i){return o.format(i)}})},this.init(t)}return yt(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},o=r.interpolation;this.formatSeparator=o.formatSeparator?o.formatSeparator:o.formatSeparator||","}},{key:"add",value:function(n,r){this.formats[n.toLowerCase().trim()]=r}},{key:"addCached",value:function(n,r){this.formats[n.toLowerCase().trim()]=No(r)}},{key:"format",value:function(n,r,o){var i=this,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},l=r.split(this.formatSeparator),a=l.reduce(function(u,c){var f=cT(c),p=f.formatName,h=f.formatOptions;if(i.formats[p]){var v=u;try{var m=s&&s.formatParams&&s.formatParams[s.interpolationkey]||{},E=m.locale||m.lng||s.locale||s.lng||o;v=i.formats[p](u,E,hn(hn(hn({},h),s),m))}catch(d){i.logger.warn(d)}return v}else i.logger.warn("there was no format function for ".concat(p));return u},n);return a}}]),e}();function vy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function yy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vy(Object(n),!0).forEach(function(r){pn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vy(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dT(e){var t=pT();return function(){var r=Wt(e),o;if(t){var i=Wt(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return Hi(this,o)}}function pT(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function hT(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}var gT=function(e){Jl(n,e);var t=dT(n);function n(r,o,i){var s,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return vt(this,n),s=t.call(this),ta&&Wn.call(jn(s)),s.backend=r,s.store=o,s.services=i,s.languageUtils=i.languageUtils,s.options=l,s.logger=Gt.create("backendConnector"),s.waitingReads=[],s.maxParallelReads=l.maxParallelReads||10,s.readingCalls=0,s.maxRetries=l.maxRetries>=0?l.maxRetries:5,s.retryTimeout=l.retryTimeout>=1?l.retryTimeout:350,s.state={},s.queue=[],s.backend&&s.backend.init&&s.backend.init(i,l.backend,l),s}return yt(n,[{key:"queueLoad",value:function(o,i,s,l){var a=this,u={},c={},f={},p={};return o.forEach(function(h){var v=!0;i.forEach(function(m){var E="".concat(h,"|").concat(m);!s.reload&&a.store.hasResourceBundle(h,m)?a.state[E]=2:a.state[E]<0||(a.state[E]===1?c[E]===void 0&&(c[E]=!0):(a.state[E]=1,v=!1,c[E]===void 0&&(c[E]=!0),u[E]===void 0&&(u[E]=!0),p[m]===void 0&&(p[m]=!0)))}),v||(f[h]=!0)}),(Object.keys(u).length||Object.keys(c).length)&&this.queue.push({pending:c,pendingCount:Object.keys(c).length,loaded:{},errors:[],callback:l}),{toLoad:Object.keys(u),pending:Object.keys(c),toLoadLanguages:Object.keys(f),toLoadNamespaces:Object.keys(p)}}},{key:"loaded",value:function(o,i,s){var l=o.split("|"),a=l[0],u=l[1];i&&this.emit("failedLoading",a,u,i),s&&this.store.addResourceBundle(a,u,s),this.state[o]=i?-1:2;var c={};this.queue.forEach(function(f){Kx(f.loaded,[a],u),hT(f,o),i&&f.errors.push(i),f.pendingCount===0&&!f.done&&(Object.keys(f.loaded).forEach(function(p){c[p]||(c[p]={});var h=f.loaded[p];h.length&&h.forEach(function(v){c[p][v]===void 0&&(c[p][v]=!0)})}),f.done=!0,f.errors.length?f.callback(f.errors):f.callback())}),this.emit("loaded",c),this.queue=this.queue.filter(function(f){return!f.done})}},{key:"read",value:function(o,i,s){var l=this,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,u=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,c=arguments.length>5?arguments[5]:void 0;if(!o.length)return c(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:o,ns:i,fcName:s,tried:a,wait:u,callback:c});return}this.readingCalls++;var f=function(m,E){if(l.readingCalls--,l.waitingReads.length>0){var d=l.waitingReads.shift();l.read(d.lng,d.ns,d.fcName,d.tried,d.wait,d.callback)}if(m&&E&&a<l.maxRetries){setTimeout(function(){l.read.call(l,o,i,s,a+1,u*2,c)},u);return}c(m,E)},p=this.backend[s].bind(this.backend);if(p.length===2){try{var h=p(o,i);h&&typeof h.then=="function"?h.then(function(v){return f(null,v)}).catch(f):f(null,h)}catch(v){f(v)}return}return p(o,i,f)}},{key:"prepareLoading",value:function(o,i){var s=this,l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),a&&a();typeof o=="string"&&(o=this.languageUtils.toResolveHierarchy(o)),typeof i=="string"&&(i=[i]);var u=this.queueLoad(o,i,l,a);if(!u.toLoad.length)return u.pending.length||a(),null;u.toLoad.forEach(function(c){s.loadOne(c)})}},{key:"load",value:function(o,i,s){this.prepareLoading(o,i,{},s)}},{key:"reload",value:function(o,i,s){this.prepareLoading(o,i,{reload:!0},s)}},{key:"loadOne",value:function(o){var i=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",l=o.split("|"),a=l[0],u=l[1];this.read(a,u,"read",void 0,void 0,function(c,f){c&&i.logger.warn("".concat(s,"loading namespace ").concat(u," for language ").concat(a," failed"),c),!c&&f&&i.logger.log("".concat(s,"loaded namespace ").concat(u," for language ").concat(a),f),i.loaded(o,c,f)})}},{key:"saveMissing",value:function(o,i,s,l,a){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},c=arguments.length>6&&arguments[6]!==void 0?arguments[6]:function(){};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(i)){this.logger.warn('did not save key "'.concat(s,'" as the namespace "').concat(i,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(s==null||s==="")){if(this.backend&&this.backend.create){var f=yy(yy({},u),{},{isUpdate:a}),p=this.backend.create.bind(this.backend);if(p.length<6)try{var h;p.length===5?h=p(o,i,s,l,f):h=p(o,i,s,l),h&&typeof h.then=="function"?h.then(function(v){return c(null,v)}).catch(c):c(null,h)}catch(v){c(v)}else p(o,i,s,l,c,f)}!o||!o[0]||this.store.addResource(o[0],i,s,l)}}}]),n}(Wn);function Ey(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){var n={};if(Lt(t[1])==="object"&&(n=t[1]),typeof t[1]=="string"&&(n.defaultValue=t[1]),typeof t[2]=="string"&&(n.tDescription=t[2]),Lt(t[2])==="object"||Lt(t[3])==="object"){var r=t[3]||t[2];Object.keys(r).forEach(function(o){n[o]=r[o]})}return n},interpolation:{escapeValue:!0,format:function(t,n,r,o){return t},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function Sy(e){return typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function _y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Yt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_y(Object(n),!0).forEach(function(r){pn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_y(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mT(e){var t=vT();return function(){var r=Wt(e),o;if(t){var i=Wt(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return Hi(this,o)}}function vT(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ra(){}function yT(e){var t=Object.getOwnPropertyNames(Object.getPrototypeOf(e));t.forEach(function(n){typeof e[n]=="function"&&(e[n]=e[n].bind(e))})}var oa=function(e){Jl(n,e);var t=mT(n);function n(){var r,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(vt(this,n),r=t.call(this),ta&&Wn.call(jn(r)),r.options=Sy(o),r.services={},r.logger=Gt,r.modules={external:[]},yT(jn(r)),i&&!r.isInitialized&&!o.isClone){if(!r.options.initImmediate)return r.init(o,i),Hi(r,jn(r));setTimeout(function(){r.init(o,i)},0)}return r}return yt(n,[{key:"init",value:function(){var o=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1?arguments[1]:void 0;typeof i=="function"&&(s=i,i={}),!i.defaultNS&&i.defaultNS!==!1&&i.ns&&(typeof i.ns=="string"?i.defaultNS=i.ns:i.ns.indexOf("translation")<0&&(i.defaultNS=i.ns[0]));var l=Ey();this.options=Yt(Yt(Yt({},l),this.options),Sy(i)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=Yt(Yt({},l.interpolation),this.options.interpolation)),i.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=i.keySeparator),i.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=i.nsSeparator);function a(d){return d?typeof d=="function"?new d:d:null}if(!this.options.isClone){this.modules.logger?Gt.init(a(this.modules.logger),this.options):Gt.init(null,this.options);var u;this.modules.formatter?u=this.modules.formatter:typeof Intl<"u"&&(u=fT);var c=new py(this.options);this.store=new tT(this.options.resources,this.options);var f=this.services;f.logger=Gt,f.resourceStore=this.store,f.languageUtils=c,f.pluralResolver=new aT(c,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),u&&(!this.options.interpolation.format||this.options.interpolation.format===l.interpolation.format)&&(f.formatter=a(u),f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new uT(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new gT(a(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",function(d){for(var g=arguments.length,y=new Array(g>1?g-1:0),S=1;S<g;S++)y[S-1]=arguments[S];o.emit.apply(o,[d].concat(y))}),this.modules.languageDetector&&(f.languageDetector=a(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=a(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new dy(this.services,this.options),this.translator.on("*",function(d){for(var g=arguments.length,y=new Array(g>1?g-1:0),S=1;S<g;S++)y[S-1]=arguments[S];o.emit.apply(o,[d].concat(y))}),this.modules.external.forEach(function(d){d.init&&d.init(o)})}if(this.format=this.options.interpolation.format,s||(s=ra),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var p=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);p.length>0&&p[0]!=="dev"&&(this.options.lng=p[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var h=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];h.forEach(function(d){o[d]=function(){var g;return(g=o.store)[d].apply(g,arguments)}});var v=["addResource","addResources","addResourceBundle","removeResourceBundle"];v.forEach(function(d){o[d]=function(){var g;return(g=o.store)[d].apply(g,arguments),o}});var m=ji(),E=function(){var g=function(S,w){o.isInitialized&&!o.initializedStoreOnce&&o.logger.warn("init: i18next is already initialized. You should call init just once!"),o.isInitialized=!0,o.options.isClone||o.logger.log("initialized",o.options),o.emit("initialized",o.options),m.resolve(w),s(S,w)};if(o.languages&&o.options.compatibilityAPI!=="v1"&&!o.isInitialized)return g(null,o.t.bind(o));o.changeLanguage(o.options.lng,g)};return this.options.resources||!this.options.initImmediate?E():setTimeout(E,0),m}},{key:"loadResources",value:function(o){var i=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ra,l=s,a=typeof o=="string"?o:this.language;if(typeof o=="function"&&(l=o),!this.options.resources||this.options.partialBundledLanguages){if(a&&a.toLowerCase()==="cimode")return l();var u=[],c=function(h){if(h){var v=i.services.languageUtils.toResolveHierarchy(h);v.forEach(function(m){u.indexOf(m)<0&&u.push(m)})}};if(a)c(a);else{var f=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);f.forEach(function(p){return c(p)})}this.options.preload&&this.options.preload.forEach(function(p){return c(p)}),this.services.backendConnector.load(u,this.options.ns,function(p){!p&&!i.resolvedLanguage&&i.language&&i.setResolvedLanguage(i.language),l(p)})}else l(null)}},{key:"reloadResources",value:function(o,i,s){var l=ji();return o||(o=this.languages),i||(i=this.options.ns),s||(s=ra),this.services.backendConnector.reload(o,i,function(a){l.resolve(),s(a)}),l}},{key:"use",value:function(o){if(!o)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!o.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return o.type==="backend"&&(this.modules.backend=o),(o.type==="logger"||o.log&&o.warn&&o.error)&&(this.modules.logger=o),o.type==="languageDetector"&&(this.modules.languageDetector=o),o.type==="i18nFormat"&&(this.modules.i18nFormat=o),o.type==="postProcessor"&&uy.addPostProcessor(o),o.type==="formatter"&&(this.modules.formatter=o),o.type==="3rdParty"&&this.modules.external.push(o),this}},{key:"setResolvedLanguage",value:function(o){if(!(!o||!this.languages)&&!(["cimode","dev"].indexOf(o)>-1))for(var i=0;i<this.languages.length;i++){var s=this.languages[i];if(!(["cimode","dev"].indexOf(s)>-1)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}}},{key:"changeLanguage",value:function(o,i){var s=this;this.isLanguageChangingTo=o;var l=ji();this.emit("languageChanging",o);var a=function(p){s.language=p,s.languages=s.services.languageUtils.toResolveHierarchy(p),s.resolvedLanguage=void 0,s.setResolvedLanguage(p)},u=function(p,h){h?(a(h),s.translator.changeLanguage(h),s.isLanguageChangingTo=void 0,s.emit("languageChanged",h),s.logger.log("languageChanged",h)):s.isLanguageChangingTo=void 0,l.resolve(function(){return s.t.apply(s,arguments)}),i&&i(p,function(){return s.t.apply(s,arguments)})},c=function(p){!o&&!p&&s.services.languageDetector&&(p=[]);var h=typeof p=="string"?p:s.services.languageUtils.getBestMatchFromCodes(p);h&&(s.language||a(h),s.translator.language||s.translator.changeLanguage(h),s.services.languageDetector&&s.services.languageDetector.cacheUserLanguage&&s.services.languageDetector.cacheUserLanguage(h)),s.loadResources(h,function(v){u(v,h)})};return!o&&this.services.languageDetector&&!this.services.languageDetector.async?c(this.services.languageDetector.detect()):!o&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(c):this.services.languageDetector.detect(c):c(o),l}},{key:"getFixedT",value:function(o,i,s){var l=this,a=function u(c,f){var p;if(Lt(f)!=="object"){for(var h=arguments.length,v=new Array(h>2?h-2:0),m=2;m<h;m++)v[m-2]=arguments[m];p=l.options.overloadTranslationOptionHandler([c,f].concat(v))}else p=Yt({},f);p.lng=p.lng||u.lng,p.lngs=p.lngs||u.lngs,p.ns=p.ns||u.ns,p.keyPrefix=p.keyPrefix||s||u.keyPrefix;var E=l.options.keySeparator||".",d;return p.keyPrefix&&Array.isArray(c)?d=c.map(function(g){return"".concat(p.keyPrefix).concat(E).concat(g)}):d=p.keyPrefix?"".concat(p.keyPrefix).concat(E).concat(c):c,l.t(d,p)};return typeof o=="string"?a.lng=o:a.lngs=o,a.ns=i,a.keyPrefix=s,a}},{key:"t",value:function(){var o;return this.translator&&(o=this.translator).translate.apply(o,arguments)}},{key:"exists",value:function(){var o;return this.translator&&(o=this.translator).exists.apply(o,arguments)}},{key:"setDefaultNamespace",value:function(o){this.options.defaultNS=o}},{key:"hasLoadedNamespace",value:function(o){var i=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var l=this.resolvedLanguage||this.languages[0],a=this.options?this.options.fallbackLng:!1,u=this.languages[this.languages.length-1];if(l.toLowerCase()==="cimode")return!0;var c=function(h,v){var m=i.services.backendConnector.state["".concat(h,"|").concat(v)];return m===-1||m===2};if(s.precheck){var f=s.precheck(this,c);if(f!==void 0)return f}return!!(this.hasResourceBundle(l,o)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||c(l,o)&&(!a||c(u,o)))}},{key:"loadNamespaces",value:function(o,i){var s=this,l=ji();return this.options.ns?(typeof o=="string"&&(o=[o]),o.forEach(function(a){s.options.ns.indexOf(a)<0&&s.options.ns.push(a)}),this.loadResources(function(a){l.resolve(),i&&i(a)}),l):(i&&i(),Promise.resolve())}},{key:"loadLanguages",value:function(o,i){var s=ji();typeof o=="string"&&(o=[o]);var l=this.options.preload||[],a=o.filter(function(u){return l.indexOf(u)<0});return a.length?(this.options.preload=l.concat(a),this.loadResources(function(u){s.resolve(),i&&i(u)}),s):(i&&i(),Promise.resolve())}},{key:"dir",value:function(o){if(o||(o=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!o)return"rtl";var i=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],s=this.services&&this.services.languageUtils||new py(Ey());return i.indexOf(s.getLanguagePartFromCode(o))>-1||o.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var o=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ra,l=Yt(Yt(Yt({},this.options),i),{isClone:!0}),a=new n(l);(i.debug!==void 0||i.prefix!==void 0)&&(a.logger=a.logger.clone(i));var u=["store","services","language"];return u.forEach(function(c){a[c]=o[c]}),a.services=Yt({},this.services),a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a.translator=new dy(a.services,a.options),a.translator.on("*",function(c){for(var f=arguments.length,p=new Array(f>1?f-1:0),h=1;h<f;h++)p[h-1]=arguments[h];a.emit.apply(a,[c].concat(p))}),a.init(l,s),a.translator.options=a.options,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),n}(Wn);pn(oa,"createInstance",function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new oa(e,t)});var Oe=oa.createInstance();Oe.createInstance=oa.createInstance,Oe.createInstance,Oe.dir,Oe.init,Oe.loadResources,Oe.reloadResources,Oe.use,Oe.changeLanguage,Oe.getFixedT,Oe.t,Oe.exists,Oe.setDefaultNamespace,Oe.hasLoadedNamespace,Oe.loadNamespaces,Oe.loadLanguages;var wy=[],ET=wy.forEach,ST=wy.slice;function _T(e){return ET.call(ST.call(arguments,1),function(t){if(t)for(var n in t)e[n]===void 0&&(e[n]=t[n])}),e}var Ry=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,wT=function(t,n,r){var o=r||{};o.path=o.path||"/";var i=encodeURIComponent(n),s="".concat(t,"=").concat(i);if(o.maxAge>0){var l=o.maxAge-0;if(Number.isNaN(l))throw new Error("maxAge should be a Number");s+="; Max-Age=".concat(Math.floor(l))}if(o.domain){if(!Ry.test(o.domain))throw new TypeError("option domain is invalid");s+="; Domain=".concat(o.domain)}if(o.path){if(!Ry.test(o.path))throw new TypeError("option path is invalid");s+="; Path=".concat(o.path)}if(o.expires){if(typeof o.expires.toUTCString!="function")throw new TypeError("option expires is invalid");s+="; Expires=".concat(o.expires.toUTCString())}if(o.httpOnly&&(s+="; HttpOnly"),o.secure&&(s+="; Secure"),o.sameSite){var a=typeof o.sameSite=="string"?o.sameSite.toLowerCase():o.sameSite;switch(a){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;case"none":s+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return s},Ny={create:function(t,n,r,o){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};r&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+r*60*1e3)),o&&(i.domain=o),document.cookie=wT(t,encodeURIComponent(n),i)},read:function(t){for(var n="".concat(t,"="),r=document.cookie.split(";"),o=0;o<r.length;o++){for(var i=r[o];i.charAt(0)===" ";)i=i.substring(1,i.length);if(i.indexOf(n)===0)return i.substring(n.length,i.length)}return null},remove:function(t){this.create(t,"",-1)}},RT={name:"cookie",lookup:function(t){var n;if(t.lookupCookie&&typeof document<"u"){var r=Ny.read(t.lookupCookie);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupCookie&&typeof document<"u"&&Ny.create(n.lookupCookie,t,n.cookieMinutes,n.cookieDomain,n.cookieOptions)}},NT={name:"querystring",lookup:function(t){var n;if(typeof window<"u"){var r=window.location.search;!window.location.search&&window.location.hash&&window.location.hash.indexOf("?")>-1&&(r=window.location.hash.substring(window.location.hash.indexOf("?")));for(var o=r.substring(1),i=o.split("&"),s=0;s<i.length;s++){var l=i[s].indexOf("=");if(l>0){var a=i[s].substring(0,l);a===t.lookupQuerystring&&(n=i[s].substring(l+1))}}}return n}},Wi=null,Oy=function(){if(Wi!==null)return Wi;try{Wi=window!=="undefined"&&window.localStorage!==null;var t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{Wi=!1}return Wi},OT={name:"localStorage",lookup:function(t){var n;if(t.lookupLocalStorage&&Oy()){var r=window.localStorage.getItem(t.lookupLocalStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupLocalStorage&&Oy()&&window.localStorage.setItem(n.lookupLocalStorage,t)}},Gi=null,xy=function(){if(Gi!==null)return Gi;try{Gi=window!=="undefined"&&window.sessionStorage!==null;var t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{Gi=!1}return Gi},xT={name:"sessionStorage",lookup:function(t){var n;if(t.lookupSessionStorage&&xy()){var r=window.sessionStorage.getItem(t.lookupSessionStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupSessionStorage&&xy()&&window.sessionStorage.setItem(n.lookupSessionStorage,t)}},TT={name:"navigator",lookup:function(t){var n=[];if(typeof navigator<"u"){if(navigator.languages)for(var r=0;r<navigator.languages.length;r++)n.push(navigator.languages[r]);navigator.userLanguage&&n.push(navigator.userLanguage),navigator.language&&n.push(navigator.language)}return n.length>0?n:void 0}},IT={name:"htmlTag",lookup:function(t){var n,r=t.htmlTag||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},CT={name:"path",lookup:function(t){var n;if(typeof window<"u"){var r=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(r instanceof Array)if(typeof t.lookupFromPathIndex=="number"){if(typeof r[t.lookupFromPathIndex]!="string")return;n=r[t.lookupFromPathIndex].replace("/","")}else n=r[0].replace("/","")}return n}},AT={name:"subdomain",lookup:function(t){var n=typeof t.lookupFromSubdomainIndex=="number"?t.lookupFromSubdomainIndex+1:1,r=typeof window<"u"&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r[n]}};function bT(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var Ty=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};vt(this,e),this.type="languageDetector",this.detectors={},this.init(t,n)}return yt(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n,this.options=_T(r,this.options||{},bT()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=o,this.addDetector(RT),this.addDetector(NT),this.addDetector(OT),this.addDetector(xT),this.addDetector(TT),this.addDetector(IT),this.addDetector(CT),this.addDetector(AT)}},{key:"addDetector",value:function(n){this.detectors[n.name]=n}},{key:"detect",value:function(n){var r=this;n||(n=this.options.order);var o=[];return n.forEach(function(i){if(r.detectors[i]){var s=r.detectors[i].lookup(r.options);s&&typeof s=="string"&&(s=[s]),s&&(o=o.concat(s))}}),this.services.languageUtils.getBestMatchFromCodes?o:o.length>0?o[0]:null}},{key:"cacheUserLanguage",value:function(n,r){var o=this;r||(r=this.options.caches),r&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(n)>-1||r.forEach(function(i){o.detectors[i]&&o.detectors[i].cacheUserLanguage(n,o.options)}))}}]),e}();Ty.type="languageDetector";var LT=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,DT={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},kT=function(t){return DT[t]},PT=function(t){return t.replace(LT,kT)};function Iy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Cy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Iy(Object(n),!0).forEach(function(r){pn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Iy(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Ay={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:PT};function MT(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ay=Cy(Cy({},Ay),e)}var UT={type:"3rdParty",init:function(t){MT(t.options.react)}};O.createContext(),function(){function e(){vt(this,e),this.usedNamespaces={}}return yt(e,[{key:"addUsedNamespaces",value:function(n){var r=this;n.forEach(function(o){r.usedNamespaces[o]||(r.usedNamespaces[o]=!0)})}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),e}();const FT={ABOUT:"About",ACTION:"Action",ADD_CONDITION:"Add Condition",ADD_OPTION:"Add Option",ADD_VARIABLE:"Add Variable",ANSWER_CALL:"Answer Call",ANSWERED:"Answered",API_VERSION:"API Version",APP_VERSION:"App Version",BEEP_SUBTITLE:"Play a beep before recording",BEEP:"Beep",BUILDER_VERSION:"Builder Version",BUSY:"Busy",CALL_ADDRESSES:"Call Addresses",CALL_NUMBERS:"Call Numbers",CALL_RESOURCES:"Call Resources",CALLER_PRESSES:"Caller Presses",CHOOSE_OPTION_SINGLE_MULTIPLE:"Choose single or multiple",CHOOSE_OPTION_TTS_AUDIO:"Choose how to play the message",CLOSE:"Close",COND_NUMBER:"Cond {{index}}",CONDITIONS:"Conditions",CONDITION_NUMBER:"Condition {{index}}",DECLINE:"Decline",DECISION:"Decision",DISCONNECT_CALL_AFTER_RINGING:"Disconnect call after ringing",ELSE:"Else",ENTER_URL:"Enter URL",ERROR_ADD_RECORDING_FIRST:"Please add a Start Call Recording node first.",ERROR_DUPLICATE_RECORDING_LABEL:"This entry already exists. Please use a unique label.",ERROR_DUPLICATE_VARIABLE_KEY:"This variable already exists. Please use a unique key.",ERROR_INVALID_JSON:"Invalid JSON",ERROR_NUMBER_IS_REQUIRED:"A number is required.",ERROR_NUMBER_MIN_MAX_IS_REQUIRED:"A number between {{min}} and {{max}} is required.",ERROR_RECORDING_LABEL_REQUIRED:"A value is required. Maximum 20 characters.",ERROR_STRING_VALUE_REQUIRED:"Invalid character. String value is required.",ERROR_TELEPHONE_KEY_REQUIRED:"A value of 0-9, *, or # is required.",ERROR_TERMINATORS:"This value should contain only 0-9, *, or #.",ERROR_TEXT_IS_REQUIRED:"A text value is required.",ERROR_URL_IS_REQUIRED:"A valid URL is required.",ERROR_VALUE_IS_REQUIRED:"A value is required.",ERROR_VARIABLE_KEY_REQUIRED:"Valid characters are lowercase letters, digits, or underscore. Maximum 20 characters.",SAVE_VARIABLES_SUBTITLE:"Store the response as variables",SAVE_VARIABLES:"Save Variables",ERROR:"Error",FAILED:"Failed",FAILURE:"Failure",FORMAT:"Format",FORWARD:"Forward",FORWARD_TO_ADDRESS:"Forward to Address",FORWARD_TO_PHONE:"Forward to Phone",FORWARD_TO_RESOURCE:"Forward to Resource",FROM_PHONE_NUMBER:"From Phone Number",FROM:"From",GATHER_INPUT:"Gather Input",HANDLE_CALL:"Handle Call",HANG_UP_CALL:"Hang Up Call",HANG_UP:"Hang Up",INFO_NODE_ANSWER:"This is the info text for the Answer node.",INFO_NODE_COND:"This is the info text for the Conditions node.",INFO_NODE_FORWARD_TO_ADDRESS:"This is the info text for the Forward to Address node.",INFO_NODE_FORWARD_TO_PHONE:"This is the info text for the Forward to Phone node.",INFO_NODE_FORWARD_TO_RESOURCE:"This is the info text for the Forward to Resource node.",INFO_NODE_GATHER_INPUT:"This is the info text for the Gather Input node.",INFO_NODE_HANG_UP:"This is the info text for the Hang Up node.",INFO_NODE_OPTION_REMOVE:"Are you sure? Removing this option will delete the flow connection and move back the following option, if there is one.",INFO_NODE_PLAY_AUDIO_FILE:"This is the info text for the Play Audio File node.",INFO_NODE_PLAY:"This is the info text for the Play node.",INFO_NODE_RECORD_CALL_START:"This is the info text for the Record Call Start node.",INFO_NODE_RECORD_CALL_STOP:"This is the info text for the Record Call Stop node.",INFO_NODE_RECORD:"This is the info text for the Record node.",INFO_NODE_REQUEST:"This is the info text for the Request node.",INFO_NODE_SEND_SMS:"This is the info text for the Send SMS node.",INFO_NODE_SET_VARIABLES_OPTION:"Are you sure you want to remove this variable?",INFO_NODE_SET_VARIABLES:"This is the info text for the Set Variables node.",INFO_NODE_TEXT_TO_SPEECH:"This is the info text for the Text to Speech node.",INFO_NODE_UNSET_VARIABLES:"This is the info text for the Unset Variables node.",INPUT:"Input",KEY:"Key",METHOD:"Method",MORE_INFO_TITLE:"More info {{title}}",MULTIPLE_ADDRESSES:"Multiple Addresses",MULTIPLE_NUMBERS:"Multiple Numbers",MULTIPLE_RESOURCES:"Multiple Resources",NAVIGATE_BACK:"Navigate Back",NO_ANSWER:"No Answer",NO_INPUT:"No Input",NO_VARIABLES_SET:"Please set variables first",NUMBER_OF_VARIABLES_SELECTED_one:"{{count}} variable selected",NUMBER_OF_VARIABLES_SELECTED_other:"{{count}} variables selected",OFF:"Off",ON:"On",OPT_NUMBER:"Opt {{index}}",OPTION_NUMBER:"Option {{index}}",OPTIONAL:"optional",OR_SAYS:"Or says",PHONE_NUMBER:"Phone Number",PLAY_AUDIO_FILE:"Play Audio File",PLAY_AUDIO_TTS:"Play Audio or TTS",PROMPT_TEXT_TO_SPEECH:"Prompt Text to Speech",REASON:"Reason",RECORD_CALL_START:"Start Call Recording",RECORD_CALL_STOP:"Stop Call Recording",RECORD:"Record",RECORDING_NAME_DEFAULT:"Recording {{index}}",RECORDING_NAME:"Recording Name",RECORDING:"Recording",RELAYML_VERSION:"RelayML Version",REMOVE_CONDITION:"Remove Condition {{index}}",REMOVE_EDGE:"Remove Edge",REMOVE_NODE:"Remove Node {{title}}",REMOVE_OPTION:"Remove Option {{index}}",REMOVE_VARIABLE:"Remove Variable {{index}}",REQUEST_BODY:"Body",REQUEST_HEADERS:"Headers (JSON)",REQUEST:"Request",SECONDS:"seconds",SELECT_VARIABLES_TO_UNSET:"Select Variables to Unset",SELECT_VARIABLES:"Select Variables",SELECT:"Select",SEND_SMS:"Send SMS",SEQUENTIALLY:"Sequentially",SET_VARIABLES:"Set Variables",SETTINGS:"Settings",SIMULTANEOUSLY:"Simultaneously",SINGLE_ADDRESS:"Single Address",SINGLE_NUMBER:"Single Number",SINGLE_RESOURCE:"Single Resource",SMS_TEXT:"SMS Text",STEREO_SUBTITLE:"Enable stereo audio",STEREO:"Stereo",SUCCESS:"Success",TERMINATORS:"Terminators",TEXT_TO_SPEECH:"Text to Speech",TEXT:"Text",TO_PHONE_NUMBER:"To Phone Number",TO:"To",UNKNOWN:"Unknown",UNSET_VARIABLES:"Unset Variables",URL:"URL",VALUE:"Value",VARIABLE_KEY:"Variable {{key}}",VOICEMAIL_RECORDING:"Voicemail Recording",WAIT_FOR_INPUT:"Wait for Input",WRITE_SOMETHING:"Write something"},I={ABOUT:"ABOUT",ACTION:"ACTION",ADD_CONDITION:"ADD_CONDITION",ADD_OPTION:"ADD_OPTION",ADD_VARIABLE:"ADD_VARIABLE",ANSWER_CALL:"ANSWER_CALL",ANSWERED:"ANSWERED",API_VERSION:"API_VERSION",APP_VERSION:"APP_VERSION",BEEP_SUBTITLE:"BEEP_SUBTITLE",BEEP:"BEEP",BUILDER_VERSION:"BUILDER_VERSION",BUSY:"BUSY",CALL_ADDRESSES:"CALL_ADDRESSES",CALL_NUMBERS:"CALL_NUMBERS",CALL_RESOURCES:"CALL_RESOURCES",CALLER_PRESSES:"CALLER_PRESSES",CHOOSE_OPTION_SINGLE_MULTIPLE:"CHOOSE_OPTION_SINGLE_MULTIPLE",CHOOSE_OPTION_TTS_AUDIO:"CHOOSE_OPTION_TTS_AUDIO",CLOSE:"CLOSE",COND_NUMBER:"COND_NUMBER",CONDITIONS:"CONDITIONS",CONDITION_NUMBER:"CONDITION_NUMBER",DECISION:"DECISION",DECLINE:"DECLINE",DISCONNECT_CALL_AFTER_RINGING:"DISCONNECT_CALL_AFTER_RINGING",ELSE:"ELSE",ENTER_URL:"ENTER_URL",ERROR_ADD_RECORDING_FIRST:"ERROR_ADD_RECORDING_FIRST",ERROR_DUPLICATE_RECORDING_LABEL:"ERROR_DUPLICATE_RECORDING_LABEL",ERROR_DUPLICATE_VARIABLE_KEY:"ERROR_DUPLICATE_VARIABLE_KEY",ERROR_INVALID_JSON:"ERROR_INVALID_JSON",ERROR_NUMBER_IS_REQUIRED:"ERROR_NUMBER_IS_REQUIRED",ERROR_NUMBER_MIN_MAX_IS_REQUIRED:"ERROR_NUMBER_MIN_MAX_IS_REQUIRED",ERROR_RECORDING_LABEL_REQUIRED:"ERROR_RECORDING_LABEL_REQUIRED",ERROR_STRING_VALUE_REQUIRED:"ERROR_STRING_VALUE_REQUIRED",ERROR_TELEPHONE_KEY_REQUIRED:"ERROR_TELEPHONE_KEY_REQUIRED",ERROR_TERMINATORS:"ERROR_TERMINATORS",ERROR_TEXT_IS_REQUIRED:"ERROR_TEXT_IS_REQUIRED",ERROR_URL_IS_REQUIRED:"ERROR_URL_IS_REQUIRED",ERROR_VALUE_IS_REQUIRED:"ERROR_VALUE_IS_REQUIRED",ERROR_VARIABLE_KEY_REQUIRED:"ERROR_VARIABLE_KEY_REQUIRED",ERROR:"ERROR",FAILED:"FAILED",FAILURE:"FAILURE",FORMAT:"FORMAT",FORWARD:"FORWARD",FORWARD_TO_ADDRESS:"FORWARD_TO_ADDRESS",FORWARD_TO_PHONE:"FORWARD_TO_PHONE",FORWARD_TO_RESOURCE:"FORWARD_TO_RESOURCE",FROM_PHONE_NUMBER:"FROM_PHONE_NUMBER",FROM:"FROM",GATHER_INPUT:"GATHER_INPUT",HANDLE_CALL:"HANDLE_CALL",HANG_UP_CALL:"HANG_UP_CALL",HANG_UP:"HANG_UP",INFO_NODE_ANSWER:"INFO_NODE_ANSWER",INFO_NODE_COND:"INFO_NODE_COND",INFO_NODE_FORWARD_TO_ADDRESS:"INFO_NODE_FORWARD_TO_ADDRESS",INFO_NODE_FORWARD_TO_PHONE:"INFO_NODE_FORWARD_TO_PHONE",INFO_NODE_FORWARD_TO_RESOURCE:"INFO_NODE_FORWARD_TO_RESOURCE",INFO_NODE_GATHER_INPUT:"INFO_NODE_GATHER_INPUT",INFO_NODE_HANG_UP:"INFO_NODE_HANG_UP",INFO_NODE_OPTION_REMOVE:"INFO_NODE_OPTION_REMOVE",INFO_NODE_PLAY_AUDIO_FILE:"INFO_NODE_PLAY_AUDIO_FILE",INFO_NODE_PLAY:"INFO_NODE_PLAY",INFO_NODE_RECORD_CALL_START:"INFO_NODE_RECORD_CALL_START",INFO_NODE_RECORD_CALL_STOP:"INFO_NODE_RECORD_CALL_STOP",INFO_NODE_RECORD:"INFO_NODE_RECORD",INFO_NODE_REQUEST:"INFO_NODE_REQUEST",INFO_NODE_SEND_SMS:"INFO_NODE_SEND_SMS",INFO_NODE_SET_VARIABLES_OPTION:"INFO_NODE_SET_VARIABLES_OPTION",INFO_NODE_SET_VARIABLES:"INFO_NODE_SET_VARIABLES",INFO_NODE_TEXT_TO_SPEECH:"INFO_NODE_TEXT_TO_SPEECH",INFO_NODE_UNSET_VARIABLES:"INFO_NODE_UNSET_VARIABLES",INPUT:"INPUT",KEY:"KEY",METHOD:"METHOD",MORE_INFO_TITLE:"MORE_INFO_TITLE",MULTIPLE_ADDRESSES:"MULTIPLE_ADDRESSES",MULTIPLE_NUMBERS:"MULTIPLE_NUMBERS",MULTIPLE_RESOURCES:"MULTIPLE_RESOURCES",NAVIGATE_BACK:"NAVIGATE_BACK",NO_ANSWER:"NO_ANSWER",NO_INPUT:"NO_INPUT",NO_VARIABLES_SET:"NO_VARIABLES_SET",NUMBER_OF_VARIABLES_SELECTED:"NUMBER_OF_VARIABLES_SELECTED",OFF:"OFF",ON:"ON",OPT_NUMBER:"OPT_NUMBER",OPTION_NUMBER:"OPTION_NUMBER",OPTIONAL:"OPTIONAL",OR_SAYS:"OR_SAYS",PHONE_NUMBER:"PHONE_NUMBER",PLAY_AUDIO_FILE:"PLAY_AUDIO_FILE",PLAY_AUDIO_TTS:"PLAY_AUDIO_TTS",PROMPT_TEXT_TO_SPEECH:"PROMPT_TEXT_TO_SPEECH",REASON:"REASON",RECORD_CALL_START:"RECORD_CALL_START",RECORD_CALL_STOP:"RECORD_CALL_STOP",RECORD:"RECORD",RECORDING_NAME_DEFAULT:"RECORDING_NAME_DEFAULT",RECORDING_NAME:"RECORDING_NAME",RECORDING:"RECORDING",RELAYML_VERSION:"RELAYML_VERSION",REMOVE_CONDITION:"REMOVE_CONDITION",REMOVE_EDGE:"REMOVE_EDGE",REMOVE_NODE:"REMOVE_NODE",REMOVE_OPTION:"REMOVE_OPTION",REMOVE_VARIABLE:"REMOVE_VARIABLE",REQUEST_BODY:"REQUEST_BODY",REQUEST_HEADERS:"REQUEST_HEADERS",REQUEST:"REQUEST",SECONDS:"SECONDS",SELECT_VARIABLES_TO_UNSET:"SELECT_VARIABLES_TO_UNSET",SELECT_VARIABLES:"SELECT_VARIABLES",SELECT:"SELECT",SEND_SMS:"SEND_SMS",SEQUENTIALLY:"SEQUENTIALLY",SET_VARIABLES:"SET_VARIABLES",SETTINGS:"SETTINGS",SIMULTANEOUSLY:"SIMULTANEOUSLY",SINGLE_ADDRESS:"SINGLE_ADDRESS",SINGLE_NUMBER:"SINGLE_NUMBER",SINGLE_RESOURCE:"SINGLE_RESOURCE",SMS_TEXT:"SMS_TEXT",STEREO_SUBTITLE:"STEREO_SUBTITLE",STEREO:"STEREO",SAVE_VARIABLES_SUBTITLE:"SAVE_VARIABLES_SUBTITLE",SAVE_VARIABLES:"SAVE_VARIABLES",SUCCESS:"SUCCESS",TERMINATORS:"TERMINATORS",TEXT_TO_SPEECH:"TEXT_TO_SPEECH",TEXT:"TEXT",TO_PHONE_NUMBER:"TO_PHONE_NUMBER",TO:"TO",UNKNOWN:"UNKNOWN",UNSET_VARIABLES:"UNSET_VARIABLES",URL:"URL",VALUE:"VALUE",VARIABLE_KEY:"VARIABLE_KEY",VOICEMAIL_RECORDING:"VOICEMAIL_RECORDING",WAIT_FOR_INPUT:"WAIT_FOR_INPUT",WRITE_SOMETHING:"WRITE_SOMETHING"},VT={order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag","path","subdomain"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage","cookie"],excludeCacheFor:["cimode"]},BT={"en-US":{translation:FT}},$T=()=>{Oe.use(Ty).use(UT).init({debug:Lx,detection:VT,fallbackLng:"en-US",interpolation:{escapeValue:!1},keySeparator:!1,resources:BT})};function M(e,t){return t?Oe.t(e,t):Oe.t(e)}const zT={entries:[],nextLabelIndex:0},Gn=xl((e,t)=>({...zT,getEntries(){return t().entries},getEntryValue(n){var r;return(r=t().entries.find(o=>o.controlId===n))==null?void 0:r.label},getGeneratedLabel(){let n="";do this.nextLabelIndex++,n=M(I.RECORDING_NAME_DEFAULT,{index:this.nextLabelIndex});while(this.isValueDuplicate(n));return n},isKeyDuplicate(n){return t().entries.some(r=>r.controlId===n)},isValueDuplicate(n,r){const o=t().entries.reduce((i,s)=>{const{label:l,controlId:a}=s;return l!==""&&l===n&&(!r||a!==r)?[...i,s]:i},[]);return Boolean(o.length)},removeEntry(n){e(r=>({entries:r.entries.filter(o=>o.controlId!==n)}))},upsertEntry:n=>{e(r=>{let o=[...r.entries];const i=Boolean(n.label.trim());return(r.isKeyDuplicate(n.controlId)||!i)&&(o=o.filter(s=>s.controlId!==n.controlId)),i&&o.push({...n}),{entries:o}})}})),HT=e=>{const t=[];e.forEach(n=>{n.type==="recordCallStart"&&n.data.controlId&&n.data.label&&t.push({controlId:n.data.controlId,label:n.data.label})}),Gn.setState({entries:t,nextLabelIndex:t.length})},jT=(e,t)=>{const n=[];return t.forEach(r=>{r.type==="recordCallStart"&&r.data.controlId&&(n.push(r.data.controlId),Gn.getState().removeEntry(r.data.controlId))}),n.length?e.reduce((r,o)=>o.type==="recordCallStop"&&n.includes(o.data.controlId)?[...r,{...o,data:{...o.data,controlId:"",missingRequiredParams:!0}}]:r,[]):[]},by={recordCallStart:e=>{const t=Gn.getState().getGeneratedLabel();return Gn.getState().upsertEntry({controlId:e.data.controlId,label:t}),{...e,data:{...e.data,label:t}}}},WT=e=>qv[e]!==void 0,GT=e=>typeof e=="object"&&e!==null&&Object.keys(e).length>0,YT=e=>by[e.type]!==void 0,Ly=(e,t={})=>{const{deletable:n=!0,position:r={x:300,y:250},selected:o=!0}=t,i=()=>({id:ye(),type:e,position:r,deletable:n,data:{missingRequiredParams:!1},selected:o}),s=(a,u)=>({...a,data:{...a.data,...u,missingRequiredParams:!0}});let l=i();if(WT(e)){const a=qv[e]();GT(a)&&(l=s(l,a))}return YT(l)&&(l=by[l.type](l)),l},ia={apiVersion:void 0,builderVersion:Qv,cfbAppVersion:Kv,relayMLVersion:void 0},KT=e=>{const t={...ia,...e};ia.apiVersion=t.apiVersion,ia.builderVersion=t.builderVersion,ia.relayMLVersion=t.relayMLVersion},Af=()=>({apiVersion:void 0,builderVersion:Qv,cfbAppVersion:Kv,relayMLVersion:void 0}),Dy=1e3,bf=It(),QT=e=>(t,n,r)=>{let o,i;const s=async()=>{const{httpService:l,nodes:a,edges:u,documentVersion:c}=n(),{builderVersion:f}=Af();bf.debug("Saving data to server"),t({dataHandlingStatus:"saving",saveFlowStatus:"saving"}),clearTimeout(i);try{if(!l)throw new Error("Missing httpService");const h={documentVersion:(await l.putFlow({documentVersion:c,builderVersion:f,nodes:a,edges:u})).document_version};switch(n().dataHandlingStatus){case"saving":t({...h,dataHandlingStatus:"queueing",saveFlowStatus:"saved"});break;case"holding":t({...h,saveFlowStatus:"awaiting-save"}),bf.debug("Setting up a new save for held changes"),i=setTimeout(()=>{s()},Dy);break;default:bf.debug("Saving data to server - invalid state")}}catch(p){console.error("Put Flow",p),t({dataHandlingStatus:"queueing",saveFlowStatus:"error"})}};return r.setState=(l,a,...u)=>{const{dataHandlingStatus:c,initializing:f}=n(),p=typeof l=="function"?l(n()):l;!f&&(p.nodes||p.edges)?c==="queueing"?(p.saveFlowStatus="awaiting-save",t(p,a,...u),clearTimeout(o),o=setTimeout(()=>{s()},Dy)):(p.dataHandlingStatus="holding",t(p,a,...u)):t(p,a,...u)},e(r.setState,n,r)},XT={variables:new Map,keyToIdMap:new Map},Er=xl((e,t)=>({...XT,_dedupeKey(n,r){const o=Array.from(r.values()).find(i=>i.key===n);o&&r.delete(o.id)},isKeyDuplicate(n,r){const o=t().keyToIdMap.get(n);return o?o!==r:!1},removeVariable(n){e(r=>{const o=new Map(r.variables),i=new Map(r.keyToIdMap),s=o.get(n);return s&&(o.delete(n),i.delete(s.key)),{keyToIdMap:i,variables:o}})},setVariables:n=>{e(()=>{const r=new Map,o=new Map;return n.forEach(i=>{const s=o.get(i.key);s&&r.delete(s),r.set(i.id,i),o.set(i.key,i.id)}),{keyToIdMap:o,variables:r}})},upsertVariable:n=>{e(r=>{const o=new Map(r.variables),i=new Map(r.keyToIdMap),s=o.get(n.id),l=i.get(n.key);return l&&o.delete(l),s&&i.delete(s.key),o.set(n.id,n),i.set(n.key,n.id),{keyToIdMap:i,variables:o}})}})),qT=e=>{const t=[];e.forEach(n=>{n.type==="set"&&n.data.variables&&t.push(...n.data.variables)}),Er.getState().setVariables(t)},ZT=e=>{if(e!=null&&e.length){const{removeVariable:t}=Er.getState();e.forEach(n=>{n.type==="set"&&n.data.variables&&n.data.variables.forEach(o=>t(o.id))})}},$e=It(),JT=Ly("handleCall",{position:{x:300,y:100},deletable:!1}),Yi={backButtonHref:void 0,colorMode:"light",dataHandlingStatus:"queueing",edges:[],edgeUpdateSuccessful:!1,getFlowURL:"",updateFlowURL:"",flowId:"",flowTitle:"",documentVersion:0,httpService:void 0,initializing:!0,isEdgeConnecting:!1,nodes:[],reactFlowInstance:void 0,rootElementId:"",saveFlowStatus:"initial",selectedNode:void 0},we=xl()(QT((e,t)=>({...Yi,reset:()=>{$e.debug("Reset!"),e({nodes:[...Yi.nodes],edges:[...Yi.edges]})},exportStoreData:()=>{const{nodes:n,edges:r}=t();kx(n,r)},addNode:n=>{$e.debug("Add Node",n);const{nodes:r,reactFlowInstance:o}=t();if(!o)throw new Error("ReactFlowInstance not found");const i=150,s=150,l=o.project({x:i,y:s}),a=Ly(n,{position:l}),u=r.map(c=>({...c,selected:!1}));u.push(a),e({nodes:u,selectedNode:a})},getNodeEdges:n=>t().edges.filter(r=>r.source===n),getTargetEdges:n=>t().edges.filter(r=>r.target===n),partialUpdateNodeData:(n,r)=>{var s;$e.debug("partialUpdateNodeData",n,r);const o=[],i=t().nodes.map(l=>{if(l.id===n){if("options"in r&&"options"in l.data){const a=l.data.options.map(c=>c.id),u=r.options.map(c=>c.id);o.push(...a.filter(c=>!u.includes(c)))}return{...l,data:{...l.data,...r}}}return l});if(o.length){const l=t().edges.filter(a=>a.sourceHandle&&o.includes(a.sourceHandle));$e.debug("Remove orphaned edges",{sourceHandleDeleted:o,edgesToDelete:l}),(s=t().reactFlowInstance)==null||s.deleteElements({edges:l})}e({nodes:i})},removeNode:n=>{$e.debug("removeNode",n);const r=t().reactFlowInstance;r&&r.deleteElements({nodes:[{id:n}]})},removeEdge:n=>{$e.debug("removeEdge",n);const r=t().reactFlowInstance;r&&r.deleteElements({edges:[{id:n}]})},onInit:async n=>{const{getFlowURL:r,updateFlowURL:o}=t();$e.log("onInit",{getFlowURL:r,updateFlowURL:o});const i=V_({getFlowURL:r,updateFlowURL:o,headers:Dx()}),s=Af(),{id:l,title:a,document_version:u,flow_data:c}=await i.getFlow();let f=c;f||(f={apiVersion:s.apiVersion,builderVersion:s.builderVersion,relayMLVersion:s.relayMLVersion,edges:Yi.edges,nodes:Yi.nodes.concat([JT])}),e({httpService:i,reactFlowInstance:n,flowId:l,flowTitle:a,documentVersion:u,initializing:!1,nodes:f.nodes.map(Ux),edges:f.edges.map(Mx)}),KT({apiVersion:f.apiVersion,builderVersion:f.builderVersion,relayMLVersion:f.relayMLVersion}),qT(f.nodes),HT(f.nodes)},onNodesChange:n=>{e({nodes:kv(n,t().nodes)})},onNodesDelete:n=>{$e.debug("onNodesDelete"),ZT(n),jT(t().nodes,n).forEach(o=>{we.getState().partialUpdateNodeData(o.id,o.data)})},onEdgesChange:n=>{e({edges:HO(n,t().edges)})},onEdgesDelete:n=>{$e.debug("onEdgesDelete [noop]",n)},onConnect:n=>{$e.debug("onConnect"),e({edges:Qm(n,t().edges)})},onConnectStart:()=>{$e.debug("onConnectStart"),e({isEdgeConnecting:!0})},onConnectEnd:()=>{$e.debug("onConnectEnd"),e({isEdgeConnecting:!1})},onEdgeUpdateStart:()=>{$e.debug("onEdgeUpdateStart"),e({edgeUpdateSuccessful:!1})},onEdgeUpdate:(n,r)=>{$e.debug("onEdgeUpdate"),e({edges:nO(n,r,t().edges),edgeUpdateSuccessful:!0})},onEdgeUpdateEnd:(n,r)=>{var o;$e.debug("onEdgeUpdateEnd"),t().edgeUpdateSuccessful?e({edgeUpdateSuccessful:!0}):(o=t().reactFlowInstance)==null||o.deleteElements({edges:[{id:r.id}]})},onSelectionChange:({nodes:n})=>{e({selectedNode:n.find(r=>r.selected)})},setColorMode:n=>{e({colorMode:n})}})));window.__useRFStore=we;const o2="";function eI({fromNode:e,fromPosition:t,fromX:n,fromY:r,toX:o,toY:i}){if(!e)return null;const[s]=Fi({borderRadius:20,sourceX:n,sourceY:r,sourcePosition:t,targetPosition:G.Top,targetX:o,targetY:i});return V("g",{children:[_("path",{fill:"none",stroke:"#222",strokeWidth:1.5,className:"animated",d:s}),_("circle",{cx:o,cy:i,fill:"#fff",r:3,stroke:"#222",strokeWidth:1.5})]})}function tI(e,t,n,r=0){const{width:o,height:i,position:s}=n,l=o??0,a=i??0,u=l/2,c=a/2,f=s.x+u,p=s.y+c,h=e,v=t,m=(h-f)/l-(v-p)/a,E=(h-f)/a+(v-p)/a,d=1/(Math.abs(m)+Math.abs(E)),g=d*m,y=d*E,S=u*(g+y)+f;return{tx:Math.min(Math.max(S,s.x+r),s.x+l-r),ty:s.y}}function nI(e){const{id:t,source:n,target:r,sourcePosition:o,sourceX:i,sourceY:s}=e,l=we(d=>d.removeEdge),a=de(O.useCallback(d=>d.nodeInternals.get(n),[n])),u=de(O.useCallback(d=>d.nodeInternals.get(r),[r]));if(!a||!u)return null;const{tx:c,ty:f}=tI(i,s,u,20),[p,h,v]=Fi({borderRadius:20,sourceX:i,sourceY:s,sourcePosition:o,targetPosition:G.Top,targetX:c,targetY:f}),m=40,E=(d,g)=>{d.stopPropagation(),l(g)};return V("g",{className:"group",children:[_(fo,{path:p,...e}),_("foreignObject",{width:m,height:m,x:h-m/2,y:v-m/2,className:"hidden group-hover:block",requiredExtensions:"http://www.w3.org/1999/xhtml",children:_("div",{className:"h-10 w-10",children:V("button",{className:"flex h-10 w-10 cursor-pointer items-center justify-center rounded-full border border-foreground/10 bg-backgroundAlt",onClick:d=>E(d,t),children:[_(kt,{tag:"trash-can",className:"text-negative"}),_("span",{className:"sr-only",children:M(I.REMOVE_EDGE)})]})})})]})}var rI={prefix:"fas",iconName:"trash-can",icon:[448,512,[61460,"trash-alt"],"f2ed","M135.2 17.7C140.6 6.8 151.7 0 163.8 0H284.2c12.1 0 23.2 6.8 28.6 17.7L320 32h96c17.7 0 32 14.3 32 32s-14.3 32-32 32H32C14.3 96 0 81.7 0 64S14.3 32 32 32h96l7.2-14.3zM32 128H416V448c0 35.3-28.7 64-64 64H96c-35.3 0-64-28.7-64-64V128zm96 64c-8.8 0-16 7.2-16 16V432c0 8.8 7.2 16 16 16s16-7.2 16-16V208c0-8.8-7.2-16-16-16zm96 0c-8.8 0-16 7.2-16 16V432c0 8.8 7.2 16 16 16s16-7.2 16-16V208c0-8.8-7.2-16-16-16zm96 0c-8.8 0-16 7.2-16 16V432c0 8.8 7.2 16 16 16s16-7.2 16-16V208c0-8.8-7.2-16-16-16z"]},oI={prefix:"fas",iconName:"arrow-left",icon:[448,512,[8592],"f060","M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.2 288 416 288c17.7 0 32-14.3 32-32s-14.3-32-32-32l-306.7 0L214.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z"]},iI={prefix:"fas",iconName:"circle-info",icon:[512,512,["info-circle"],"f05a","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM216 336h24V272H216c-13.3 0-24-10.7-24-24s10.7-24 24-24h48c13.3 0 24 10.7 24 24v88h8c13.3 0 24 10.7 24 24s-10.7 24-24 24H216c-13.3 0-24-10.7-24-24s10.7-24 24-24zm40-208a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]},sI={prefix:"fas",iconName:"xmark",icon:[320,512,[128473,10005,10006,10060,215,"close","multiply","remove","times"],"f00d","M310.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L160 210.7 54.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L114.7 256 9.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 301.3 265.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L205.3 256 310.6 150.6z"]};const lI={"arrow-left":oI,"circle-info":iI,"trash-can":rI,xmark:sI},kt=O.forwardRef(function({className:t="",size:n="",tag:r},o){const i=lI[r];return i?_("svg",{"aria-hidden":"true","data-prefix":i.prefix,"data-icon":r,className:`svg-inline--fa fa-${r} ${n?`fa-${n}`:""} ${t}`,focusable:"false",ref:o,role:"img",viewBox:`0 0 ${i.icon[0]} ${i.icon[1]}`,xmlns:"http://www.w3.org/2000/svg",children:_("path",{d:i.icon[4],fill:"currentColor"})}):(It().debug(`Unknown icon: ${r}`),null)}),aI=({isSelected:e,nodeId:t,nodeTitle:n,showDelete:r})=>{const o=we(a=>a.removeNode),i=we(a=>a.isEdgeConnecting);return V("div",{className:"flex w-full items-center justify-between p-4",children:[_("h2",{className:`text-lg font-semibold leading-6 ${e?"text-primary":""}`,children:n}),r&&!i&&V("button",{className:"opacity-0 transition-opacity group-hover/node-wrapper:opacity-100",onClick:()=>{o(t)},children:[_(kt,{tag:"trash-can",className:"text-negative"}),_("span",{className:"sr-only",children:M(I.REMOVE_NODE,{title:n})})]})]})},uI=({id:e,missingRequiredEntry:t})=>{const n=we(i=>i.getTargetEdges),[r,o]=O.useState(!1);return O.useEffect(()=>{const i=()=>n(e).length===0;o(i());const s=we.subscribe((l,a)=>{l.edges.length!==a.edges.length&&o(i()),l.nodes.length!==a.nodes.length&&o(i()),l.edgeUpdateSuccessful!==a.edgeUpdateSuccessful&&o(i())});return()=>s()},[e,n]),r||t?V("div",{className:"flex flex-col gap-y-6 px-4 pb-4 text-sm italic leading-4",children:[r&&_("p",{children:"Not Connected to Flow"}),t&&_("p",{children:"Missing Required Entry"})]}):null},cI=({id:e,isConnectable:t})=>{if(!e)throw new Error("TargetHandle: id is required");return _(go,{type:"target",id:`target-${e}`,position:G.Top,isConnectable:t,className:"mt-1 h-4 w-full rounded-none rounded-t-md border-none bg-primary opacity-0 transition-opacity hover:opacity-100"})},qe=({children:e,id:t,isConnectable:n=!0,missingRequiredEntry:r,nodeTitle:o,selected:i,showDelete:s,showValidation:l=!0,target:a=!0})=>V("section",{className:`${i?"shadow-xl":""} group/node-wrapper min-w-[300px] rounded-lg border border-foreground/10 bg-background transition-[visibility]`,children:[a&&t&&_(cI,{id:t,isConnectable:n}),_(aI,{nodeId:t,isSelected:i,nodeTitle:o,showDelete:s}),l&&_(uI,{id:t,missingRequiredEntry:r??!1}),e]}),fI=({children:e,handleClick:t,...n})=>_("li",{role:"presentation",children:V("div",{className:"flex items-center gap-2 rounded-lg bg-secondary p-2 pr-1",role:"option","aria-selected":"true",tabIndex:0,children:[_("span",{className:"text-sm text-foreground",children:e}),V("button",{className:" px-1",onClick:t,onKeyDown:o=>{(o.key==="Backspace"||o.key==="Delete")&&(o.stopPropagation(),t==null||t())},type:"button",...n,children:[_("span",{className:"sr-only",children:"Remove"}),_(kt,{tag:"xmark",size:"xs"})]})]})}),Sr=e=>_("div",{className:"relative after:absolute after:right-3 after:top-3 after:h-[7px] after:w-[7px] after:rotate-45 after:border-r after:border-b after:border-foreground after:content-['']",children:_("select",{className:"pr-8",...e,children:e.children})}),dI={positive:"border-positive hover:bg-positive",negative:"border-negative hover:bg-negative",disabled:"border-disabled"},Yn=({color:e="positive",enabled:t=!0,id:n,isConnectable:r,position:o=G.Bottom,positionClasses:i="-bottom-2.5"})=>{if(!n)throw new Error("SourceHandle: id is required");return _(go,{type:"source",id:n,position:o,isConnectable:r&&t,className:`absolute h-5 w-5 rounded-full border-[3px] bg-background transition-colors ${i} ${dI[t?e:"disabled"]??""}`})},Oo=({children:e})=>_("div",{className:"divide-foreground/10 flex w-full items-center divide-x",children:e}),Kn=({color:e="positive",enabled:t=!0,id:n,isConnectable:r,optionText:o,position:i=G.Bottom,positionClasses:s="-bottom-2.5"})=>V("div",{className:"relative w-full min-w-[104px] whitespace-nowrap border-t border-foreground/10 py-4",children:[_("div",{className:"flex flex-col items-center justify-center",children:_("p",{className:`${t?"":"text-disabled"} min-h-[1rem] text-sm leading-4`,children:o})}),_(Yn,{color:e,enabled:t,id:n,isConnectable:r,position:i,positionClasses:s})]}),pI=({checked:e=!1,name:t,onClick:n})=>V("button",{name:t,onClick:n,type:"button",className:`${e?"bg-primary":"bg-secondary"} relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out`,role:"switch","aria-checked":e?"true":"false",children:[_("span",{className:"sr-only",children:M(e?I.ON:I.OFF)}),_("span",{className:`pointer-events-none inline-block h-5 w-5 ${e?"translate-x-5":"translate-x-0"} transform rounded-full bg-white shadow transition duration-200 ease-in-out`})]}),ky=({checked:e,clickHandler:t,name:n,subtitle:r,title:o})=>V("div",{className:"mb-2 flex items-center justify-between",children:[V("div",{className:"flex flex-grow flex-col",children:[_("span",{className:"text-base font-medium leading-6 text-foreground",children:o}),r&&_("span",{className:"text-xs text-foreground/50",children:r})]}),_(pI,{checked:e,name:n,onClick:t})]}),Ki=({errorText:e,label:t,name:n,onChange:r,required:o,valid:i,value:s,...l})=>V("label",{children:[_("span",{className:"sr-only",children:t}),_("textarea",{"aria-invalid":i?void 0:"true",className:`peer min-h-[77px] w-full resize-none ${i?"":"invalid"}`,inputMode:"text",minLength:1,name:n,onChange:r,required:o,value:s,...l}),_("p",{className:"requirements",role:"alert",children:e})]}),hI=({dragging:e,id:t,isConnectable:n,selected:r})=>_(qe,{id:t,isConnectable:n,missingRequiredEntry:!1,nodeTitle:"Answer Call",selected:r,showDelete:!e,children:_(Yn,{id:t,isConnectable:n,color:"positive"})}),gI={success:I.SUCCESS,noAnswer:I.NO_ANSWER,busy:I.BUSY,decline:I.DECLINE,error:I.ERROR},mI={address:I.FORWARD_TO_ADDRESS,phone:I.FORWARD_TO_PHONE,resource:I.FORWARD_TO_RESOURCE},Lf=({id:e,data:t,dragging:n,isConnectable:r,selected:o})=>V(qe,{id:e,isConnectable:r,missingRequiredEntry:t.missingRequiredParams,nodeTitle:M(mI[t.destinationType]),selected:o,showDelete:!n,children:[t.destinations.length>0?_("section",{className:"p-4 pt-2",children:_("ul",{className:"space-y-2",children:t.destinations.map((i,s)=>_("li",{className:"text-sm",children:i},`node-${i}-${s}`))})}):null,_(Oo,{children:t.options.map(i=>_(Kn,{id:i.id,optionText:M(gI[i.result]),color:Zl(i.result),isConnectable:r},i.id))})]}),vI=({id:e,data:t,dragging:n,isConnectable:r,selected:o})=>_(qe,{id:e,isConnectable:r,missingRequiredEntry:t.missingRequiredParams,nodeTitle:"Gather Input",selected:o,showDelete:!n,children:V(Oo,{children:[t.options.map((i,s)=>{const l=Boolean(i.command||i.digit);return _(Kn,{color:"positive",enabled:l,id:i.id,isConnectable:r,optionText:M(I.OPT_NUMBER,{index:s+1})},i.id)}),t.results.map(i=>_(Kn,{color:"negative",id:i.id,isConnectable:r,optionText:i.result==="no_input"?M(I.NO_INPUT):M(I.UNKNOWN)},i.id))]})}),yI=({id:e,isConnectable:t,selected:n})=>_(qe,{allowDelete:!1,id:e,isConnectable:t,nodeTitle:M(I.HANDLE_CALL),selected:n,showDelete:!1,showValidation:!1,target:!1,children:_(Yn,{id:e,color:"positive",isConnectable:t})}),Df={busy:I.BUSY,decline:I.DECLINE,hangup:I.HANG_UP},EI=({data:e,dragging:t,id:n,isConnectable:r,selected:o})=>_(qe,{id:n,isConnectable:r,missingRequiredEntry:!1,nodeTitle:M(I.HANG_UP_CALL),selected:o,showDelete:!t,children:e.reason&&_("section",{className:"p-4 pt-2",children:_("p",{children:M(Df[e.reason])})})}),SI=e=>{try{return new URL(e).pathname.split("/").at(-1)}catch{return""}},_I=({data:e,dragging:t,id:n,isConnectable:r,selected:o})=>{let i=e.selected&&e[e.selected];return i&&e.selected==="url"&&(i=SI(i)||"Play Audio"),V(qe,{id:n,isConnectable:r,missingRequiredEntry:e.missingRequiredParams,nodeTitle:M(I.PLAY_AUDIO_TTS),selected:o,showDelete:!t,children:[i&&_("div",{className:"max-w-[300px] p-4 pt-0",children:e.selected==="url"?_("a",{className:"break-words text-primary underline line-clamp-3",href:e.url,target:"_blank",rel:"noopener noreferrer",children:i}):_("p",{className:"break-words line-clamp-3",children:i})}),_(Yn,{id:n,isConnectable:r})]})},wI=({id:e,data:t,dragging:n,isConnectable:r,selected:o})=>V(qe,{id:e,isConnectable:r,missingRequiredEntry:t.missingRequiredParams,nodeTitle:M(I.SET_VARIABLES),selected:o,showDelete:!n,children:[t.variables.length>0&&_("div",{className:"flow-root",children:_("div",{className:"inline-block p-4 pt-0 align-middle",children:V("table",{className:"w-80 table-fixed divide-y divide-foreground/10",children:[_("thead",{children:V("tr",{children:[_("th",{scope:"col",className:"py-3.5 text-left text-sm font-semibold",children:M(I.KEY)}),_("th",{scope:"col",className:"px-2 py-3.5 text-left text-sm font-semibold",children:M(I.VALUE)})]})}),_("tbody",{className:"divide-y divide-foreground/10 bg-background text-sm",children:t.variables.map(i=>i.key?V("tr",{children:[_("td",{className:"overflow-hidden text-ellipsis whitespace-nowrap py-2 text-sm",children:i.key}),_("td",{className:"overflow-hidden text-ellipsis whitespace-nowrap break-all px-2 py-2 text-sm",children:i.value})]},i.id):null)})]})})}),_(Yn,{id:e,isConnectable:r,color:"positive"})]}),RI=({id:e,data:t,dragging:n,isConnectable:r,selected:o})=>{const i=we(s=>s.partialUpdateNodeData);return O.useEffect(()=>{const s=Er.subscribe(l=>{const u=Array.from(l.variables.values()).reduce((c,f)=>{const p=t.variables.find(h=>h.setId===f.id);return p&&c.push({...p,key:f.key}),c},[]);i(e,{variables:u,missingRequiredParams:u.length===0})});return()=>s()},[i,e,t.variables]),_(qe,{id:e,isConnectable:r,missingRequiredEntry:t.missingRequiredParams,nodeTitle:M(I.UNSET_VARIABLES),selected:o,showDelete:!n,children:_(Yn,{id:e,isConnectable:r,color:"positive"})})},NI={success:I.SUCCESS,failed:I.FAILURE},OI=({data:e,dragging:t,id:n,isConnectable:r,selected:o})=>{var i;return _(qe,{id:n,isConnectable:r,missingRequiredEntry:e.missingRequiredParams,nodeTitle:M(I.VOICEMAIL_RECORDING),selected:o,showDelete:!t,children:_(Oo,{children:(i=e==null?void 0:e.options)==null?void 0:i.map(s=>_(Kn,{id:s.id,optionText:M(NI[s.result]),color:Zl(s.result),isConnectable:r},s.id))})})},xI={success:I.SUCCESS,failed:I.FAILURE},TI=({data:e,dragging:t,id:n,isConnectable:r,selected:o})=>{const{label:i,missingRequiredParams:s,options:l}=e;return V(qe,{id:n,isConnectable:r,missingRequiredEntry:s,nodeTitle:M(I.RECORD_CALL_START),selected:o,showDelete:!t,children:[i&&_("section",{className:"whitespace-nowrap px-4 pb-4 text-sm",children:i}),_(Oo,{children:l==null?void 0:l.map(a=>_(Kn,{id:a.id,optionText:M(xI[a.result]),color:Zl(a.result),isConnectable:r},a.id))})]})},II=({data:e,dragging:t,id:n,isConnectable:r,selected:o})=>{var l;const i=(l=Gn(a=>a.entries))==null?void 0:l.find(a=>a.controlId===e.controlId),s=i==null?void 0:i.label;return V(qe,{id:n,isConnectable:r,missingRequiredEntry:!s,nodeTitle:M(I.RECORD_CALL_STOP),selected:o,showDelete:!t,children:[s&&_("section",{className:"whitespace-nowrap px-4 pb-4 text-sm",children:s}),_(Yn,{id:n,color:"positive",isConnectable:r})]})},CI=({data:e,dragging:t,id:n,isConnectable:r,selected:o})=>V(qe,{id:n,isConnectable:r,missingRequiredEntry:e.missingRequiredParams,nodeTitle:M(I.SEND_SMS),selected:o,showDelete:!t,children:[(e.body||e.toNumber)&&V("div",{className:"max-w-[300px] p-4 pt-0",children:[e.fromNumber&&V("p",{className:`whitespace-nowrap ${e.body?"pb-2":""}`,children:[M(I.FROM),": ",e.fromNumber]}),e.toNumber&&V("p",{className:`whitespace-nowrap ${e.body?"pb-2":""}`,children:[M(I.TO),": ",e.toNumber]}),e.body&&_("p",{className:"break-words pt-1 line-clamp-3",children:e.body})]}),_(Yn,{id:n,isConnectable:r})]}),AI={success:I.SUCCESS,failed:I.FAILED},bI={answer:hI,forwardAddress:Lf,forwardPhone:Lf,forwardResource:Lf,handleCall:yI,hangup:EI,play:_I,promptPlay:vI,record:OI,recordCallStart:TI,recordCallStop:II,sendSms:CI,set:wI,unset:RI,request:({data:e,dragging:t,id:n,isConnectable:r,selected:o})=>{var i;return _(qe,{id:n,isConnectable:r,missingRequiredEntry:e.missingRequiredParams,nodeTitle:M(I.REQUEST),selected:o,showDelete:!t,children:_(Oo,{children:(i=e==null?void 0:e.options)==null?void 0:i.map(s=>_(Kn,{id:s.id,optionText:M(AI[s.result]),color:Zl(s.result),isConnectable:r},s.id))})})},cond:({id:e,data:t,dragging:n,isConnectable:r,selected:o})=>_(qe,{id:e,isConnectable:r,missingRequiredEntry:t.missingRequiredParams,nodeTitle:M(I.CONDITIONS),selected:o,showDelete:!n,children:V(Oo,{children:[t.options.map((i,s)=>{const l=Boolean(i.value);return _(Kn,{color:"positive",enabled:l,id:i.id,isConnectable:r,optionText:M(I.COND_NUMBER,{index:s+1})},i.id)}),_(Kn,{color:"negative",id:t.fallback,isConnectable:r,optionText:M(I.ELSE)},t.fallback)]})})},LI={floating:nI},DI={duration:1e3,includeHiddenNodes:!0,padding:.3},kI=e=>({edges:e.edges,nodes:e.nodes,onConnect:e.onConnect,onConnectEnd:e.onConnectEnd,onConnectStart:e.onConnectStart,onEdgesChange:e.onEdgesChange,onEdgeUpdate:e.onEdgeUpdate,onEdgesDelete:e.onEdgesDelete,onEdgeUpdateEnd:e.onEdgeUpdateEnd,onEdgeUpdateStart:e.onEdgeUpdateStart,onInit:e.onInit,onNodesChange:e.onNodesChange,onNodesDelete:e.onNodesDelete,onSelectionChange:e.onSelectionChange}),PI=({children:e})=>{const{edges:t,nodes:n,onConnect:r,onConnectEnd:o,onConnectStart:i,onEdgesChange:s,onEdgeUpdate:l,onEdgesDelete:a,onEdgeUpdateEnd:u,onEdgeUpdateStart:c,onInit:f,onNodesChange:p,onNodesDelete:h,onSelectionChange:v}=we(kI,Qe);return _(Gv,{className:"bg-sw-white !h-auto",connectionLineComponent:eI,connectionMode:$n.Strict,defaultEdgeOptions:Xv,edges:t,edgeTypes:LI,fitView:!0,fitViewOptions:DI,nodes:n,nodeTypes:bI,onConnect:r,onConnectEnd:o,onConnectStart:i,onEdgesChange:s,onEdgeUpdate:l,onEdgesDelete:a,onEdgeUpdateEnd:u,onEdgeUpdateStart:c,onInit:f,onNodesChange:p,onNodesDelete:h,onSelectionChange:v,children:e})},Py=/^[\w\d ']+$/,My=/^\d+$/,Uy=/^\d|\*|#$/,MI=/^[\d|\*|#$]{0,12}$/,UI=/^.{1,20}$/,Fy=/^[a-z0-9_]{1,20}$/,sa={MIN:1,MAX:99},_r=e=>(/(?:\/\^)(.+)(?:\$\/)/.exec(e.toString())??[])[1],kf=e=>t=>Boolean(e.exec(t)),Pf=e=>kf(Uy)(e),Mf=e=>kf(Py)(e),Vy=e=>kf(Fy)(e),By=e=>typeof e=="string"&&e===""||Array.isArray(e)&&e.length===0?!1:typeof e=="object"&&e!==null?Object.keys(e).length===0?!1:Object.values(e).every(By):!0,Kt=e=>{const[t,n]=O.useReducer((r,o)=>({...r,...o}),e);return[t,n]},Qi=({displayData:e,formRef:t,setCompleted:n})=>{O.useEffect(()=>{var l,a;const r=t.current,o=new FormData(r),i=Object.fromEntries(o.entries());let s=!0;for(const u of Object.keys(i)){if(((l=e[u])==null?void 0:l.valid)!==void 0&&(s=s&&Boolean((a=e[u])==null?void 0:a.valid),s)){const c=r.elements.namedItem(u);c&&"checkValidity"in c&&(s=s&&c.checkValidity())}if(!s)break}n(s)},[e,t,n])},$y={url:I.PLAY_AUDIO_FILE,text:I.TEXT_TO_SPEECH},zy=({displayData:e,label:t,handleOnUpdate:n,setDisplayData:r,showDefaultOption:o})=>{var a,u;const i=e.selected.value,s=c=>{const f=c.currentTarget.value;r({selected:{value:f,valid:Boolean(f)||!o}}),n({selected:f})},l=c=>{const f=c.target,{name:p,value:h}=f,v=h.trim();let m=!0;switch(p){case"url":m=f.checkValidity(),r({[p]:{value:h,valid:m}}),n({text:"",url:m?v:""});break;case"text":m=f.checkValidity()&&v.length>0,r({[p]:{value:h,valid:m}}),n({text:m?v:"",url:""});break;default:throw new Error(`Unhandled input name: ${p}`)}};return V("div",{children:[V("label",{children:[_("span",{className:"sr-only",children:t}),V(Sr,{className:"w-full",name:"selected",onChange:s,value:i,children:[o&&_("option",{value:"",children:M(I.SELECT)}),Object.keys($y).map(c=>_("option",{value:c,children:M($y[c])},c))]})]}),i&&_(FI,{name:i,onChange:l,required:!0,selected:i,valid:(a=e[i])==null?void 0:a.valid,value:(u=e[i])==null?void 0:u.value})]})},FI=({name:e,onChange:t,required:n,selected:r,valid:o,value:i})=>{const l={url:_(Ki,{errorText:M(I.ERROR_URL_IS_REQUIRED),inputMode:"url",label:M(I.PLAY_AUDIO_FILE),name:e,onChange:t,placeholder:M(I.ENTER_URL),required:n,valid:o,value:i}),text:_(Ki,{errorText:M(I.ERROR_VALUE_IS_REQUIRED),inputMode:"text",label:M(I.TEXT_TO_SPEECH),name:e,onChange:t,placeholder:M(I.WRITE_SOMETHING),required:n,valid:o,value:i})}[r];return _(Ae,{children:l})},VI=[{field:"stereo",title:I.STEREO,subtitle:I.STEREO_SUBTITLE},{field:"beep",title:I.BEEP,subtitle:I.BEEP_SUBTITLE}],Hy=({displayData:e,handleOnUpdate:t,setDisplayData:n})=>{const r=s=>{const l=s.target.name,a=!e[l].value,u={[l]:{value:a}};n(u),t({[l]:a})},o=s=>{const l=s.target,{name:a,value:u}=l,c=l.checkValidity(),f={[a]:{value:u,valid:c}};n(f),t({[a]:c?u.trim():""})},i=s=>{const l=s.target.name,a=s.target.value,u={[l]:{value:a,valid:!0}};n(u),t({[l]:a})};return V(Ae,{children:[_("div",{className:"mb-5",children:VI.map(s=>{const l=e[s.field].value;return _("div",{children:_(ky,{checked:l,clickHandler:r,name:s.field,subtitle:M(s.subtitle),title:M(s.title)})},s.field)})}),V("label",{children:[M(I.TERMINATORS),_("input",{className:`w-full ${e.terminators.valid?"":"invalid"}`,defaultValue:e.terminators.value||"",name:"terminators",onChange:o,pattern:_r(MI),placeholder:"#*0",type:"text"}),_("p",{className:"requirements",role:"alert",children:M(I.ERROR_TERMINATORS)})]}),V("label",{children:[M(I.FORMAT),V(Sr,{className:"w-full",value:e.format.value,name:"format",onChange:i,children:[_("option",{value:"mp3",children:"MP3"}),_("option",{value:"wav",children:"WAV"})]})]})]})};/*!
60
+ */var Ol=O,q_=Mc;function Z_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var J_=typeof Object.is=="function"?Object.is:Z_,ew=q_.useSyncExternalStore,tw=Ol.useRef,nw=Ol.useEffect,rw=Ol.useMemo,ow=Ol.useDebugValue;Mg.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=tw(null);if(i.current===null){var s={hasValue:!1,value:null};i.current=s}else s=i.current;i=rw(function(){function a(h){if(!u){if(u=!0,c=h,h=r(h),o!==void 0&&s.hasValue){var v=s.value;if(o(v,h))return f=v}return f=h}if(v=f,J_(c,h))return v;var m=r(h);return o!==void 0&&o(v,m)?v:(c=h,f=m)}var u=!1,c,f,p=n===void 0?null:n;return[function(){return a(t())},p===null?void 0:function(){return a(p())}]},[t,n,r,o]);var l=ew(e,i[0],i[1]);return nw(function(){s.hasValue=!0,s.value=l},[l]),ow(l),l},function(e){e.exports=Mg}(B_);const iw=fd(Pc),{useSyncExternalStoreWithSelector:sw}=iw;function Fg(e,t=e.getState,n){const r=sw(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return O.useDebugValue(r),r}const Vg=e=>{var t;((t={VITE_BASE_URL:"",VITE_BASIC_AUTH:"signalwire:1aG93uXk",VITE_DEFAULT_STYLE_HREF:"https://cdn.swire.io/npm/@signalwire/cfb@dev/dist/style.css",BASE_URL:"/cfb/",MODE:"staging",DEV:!1,PROD:!0,SSR:!1})==null?void 0:t.MODE)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const n=typeof e=="function"?Pg(e):e,r=(o,i)=>Fg(n,o,i);return Object.assign(r,n),r},xl=e=>e?Vg(e):Vg;function Qe(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,o]of e)if(!Object.is(o,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Object.is(e[n[r]],t[n[r]]))return!1;return!0}var lw={value:()=>{}};function Tl(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Il(n)}function Il(e){this._=e}function aw(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",o=n.indexOf(".");if(o>=0&&(r=n.slice(o+1),n=n.slice(0,o)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Il.prototype=Tl.prototype={constructor:Il,on:function(e,t){var n=this._,r=aw(e+"",n),o,i=-1,s=r.length;if(arguments.length<2){for(;++i<s;)if((o=(e=r[i]).type)&&(o=uw(n[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<s;)if(o=(e=r[i]).type)n[o]=Bg(n[o],e.name,t);else if(t==null)for(o in n)n[o]=Bg(n[o],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Il(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var n=new Array(o),r=0,o,i;r<o;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],r=0,o=i.length;r<o;++r)i[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],o=0,i=r.length;o<i;++o)r[o].value.apply(t,n)}};function uw(e,t){for(var n=0,r=e.length,o;n<r;++n)if((o=e[n]).name===t)return o.value}function Bg(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=lw,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Fc="http://www.w3.org/1999/xhtml";const $g={svg:"http://www.w3.org/2000/svg",xhtml:Fc,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Cl(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),$g.hasOwnProperty(t)?{space:$g[t],local:e}:e}function cw(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Fc&&t.documentElement.namespaceURI===Fc?t.createElement(e):t.createElementNS(n,e)}}function fw(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function zg(e){var t=Cl(e);return(t.local?fw:cw)(t)}function dw(){}function Vc(e){return e==null?dw:function(){return this.querySelector(e)}}function pw(e){typeof e!="function"&&(e=Vc(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,l=r[o]=new Array(s),a,u,c=0;c<s;++c)(a=i[c])&&(u=e.call(a,a.__data__,c,i))&&("__data__"in a&&(u.__data__=a.__data__),l[c]=u);return new st(r,this._parents)}function hw(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function gw(){return[]}function Hg(e){return e==null?gw:function(){return this.querySelectorAll(e)}}function mw(e){return function(){return hw(e.apply(this,arguments))}}function vw(e){typeof e=="function"?e=mw(e):e=Hg(e);for(var t=this._groups,n=t.length,r=[],o=[],i=0;i<n;++i)for(var s=t[i],l=s.length,a,u=0;u<l;++u)(a=s[u])&&(r.push(e.call(a,a.__data__,u,s)),o.push(a));return new st(r,o)}function jg(e){return function(){return this.matches(e)}}function Wg(e){return function(t){return t.matches(e)}}var yw=Array.prototype.find;function Ew(e){return function(){return yw.call(this.children,e)}}function Sw(){return this.firstElementChild}function _w(e){return this.select(e==null?Sw:Ew(typeof e=="function"?e:Wg(e)))}var ww=Array.prototype.filter;function Rw(){return Array.from(this.children)}function Nw(e){return function(){return ww.call(this.children,e)}}function Ow(e){return this.selectAll(e==null?Rw:Nw(typeof e=="function"?e:Wg(e)))}function xw(e){typeof e!="function"&&(e=jg(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,l=r[o]=[],a,u=0;u<s;++u)(a=i[u])&&e.call(a,a.__data__,u,i)&&l.push(a);return new st(r,this._parents)}function Gg(e){return new Array(e.length)}function Tw(){return new st(this._enter||this._groups.map(Gg),this._parents)}function Al(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Al.prototype={constructor:Al,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Iw(e){return function(){return e}}function Cw(e,t,n,r,o,i){for(var s=0,l,a=t.length,u=i.length;s<u;++s)(l=t[s])?(l.__data__=i[s],r[s]=l):n[s]=new Al(e,i[s]);for(;s<a;++s)(l=t[s])&&(o[s]=l)}function Aw(e,t,n,r,o,i,s){var l,a,u=new Map,c=t.length,f=i.length,p=new Array(c),h;for(l=0;l<c;++l)(a=t[l])&&(p[l]=h=s.call(a,a.__data__,l,t)+"",u.has(h)?o[l]=a:u.set(h,a));for(l=0;l<f;++l)h=s.call(e,i[l],l,i)+"",(a=u.get(h))?(r[l]=a,a.__data__=i[l],u.delete(h)):n[l]=new Al(e,i[l]);for(l=0;l<c;++l)(a=t[l])&&u.get(p[l])===a&&(o[l]=a)}function bw(e){return e.__data__}function Lw(e,t){if(!arguments.length)return Array.from(this,bw);var n=t?Aw:Cw,r=this._parents,o=this._groups;typeof e!="function"&&(e=Iw(e));for(var i=o.length,s=new Array(i),l=new Array(i),a=new Array(i),u=0;u<i;++u){var c=r[u],f=o[u],p=f.length,h=Dw(e.call(c,c&&c.__data__,u,r)),v=h.length,m=l[u]=new Array(v),E=s[u]=new Array(v),d=a[u]=new Array(p);n(c,f,m,E,d,h,t);for(var g=0,y=0,S,w;g<v;++g)if(S=m[g]){for(g>=y&&(y=g+1);!(w=E[y])&&++y<v;);S._next=w||null}}return s=new st(s,r),s._enter=l,s._exit=a,s}function Dw(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function kw(){return new st(this._exit||this._groups.map(Gg),this._parents)}function Pw(e,t,n){var r=this.enter(),o=this,i=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),n==null?i.remove():n(i),r&&o?r.merge(o).order():o}function Mw(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,o=n.length,i=r.length,s=Math.min(o,i),l=new Array(o),a=0;a<s;++a)for(var u=n[a],c=r[a],f=u.length,p=l[a]=new Array(f),h,v=0;v<f;++v)(h=u[v]||c[v])&&(p[v]=h);for(;a<o;++a)l[a]=n[a];return new st(l,this._parents)}function Uw(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],o=r.length-1,i=r[o],s;--o>=0;)(s=r[o])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function Fw(e){e||(e=Vw);function t(f,p){return f&&p?e(f.__data__,p.__data__):!f-!p}for(var n=this._groups,r=n.length,o=new Array(r),i=0;i<r;++i){for(var s=n[i],l=s.length,a=o[i]=new Array(l),u,c=0;c<l;++c)(u=s[c])&&(a[c]=u);a.sort(t)}return new st(o,this._parents).order()}function Vw(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Bw(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function $w(){return Array.from(this)}function zw(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length;o<i;++o){var s=r[o];if(s)return s}return null}function Hw(){let e=0;for(const t of this)++e;return e}function jw(){return!this.node()}function Ww(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var o=t[n],i=0,s=o.length,l;i<s;++i)(l=o[i])&&e.call(l,l.__data__,i,o);return this}function Gw(e){return function(){this.removeAttribute(e)}}function Yw(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Kw(e,t){return function(){this.setAttribute(e,t)}}function Qw(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Xw(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function qw(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Zw(e,t){var n=Cl(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?Yw:Gw:typeof t=="function"?n.local?qw:Xw:n.local?Qw:Kw)(n,t))}function Yg(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Jw(e){return function(){this.style.removeProperty(e)}}function e1(e,t,n){return function(){this.style.setProperty(e,t,n)}}function t1(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function n1(e,t,n){return arguments.length>1?this.each((t==null?Jw:typeof t=="function"?t1:e1)(e,t,n??"")):so(this.node(),e)}function so(e,t){return e.style.getPropertyValue(t)||Yg(e).getComputedStyle(e,null).getPropertyValue(t)}function r1(e){return function(){delete this[e]}}function o1(e,t){return function(){this[e]=t}}function i1(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function s1(e,t){return arguments.length>1?this.each((t==null?r1:typeof t=="function"?i1:o1)(e,t)):this.node()[e]}function Kg(e){return e.trim().split(/^|\s+/)}function Bc(e){return e.classList||new Qg(e)}function Qg(e){this._node=e,this._names=Kg(e.getAttribute("class")||"")}Qg.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Xg(e,t){for(var n=Bc(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function qg(e,t){for(var n=Bc(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function l1(e){return function(){Xg(this,e)}}function a1(e){return function(){qg(this,e)}}function u1(e,t){return function(){(t.apply(this,arguments)?Xg:qg)(this,e)}}function c1(e,t){var n=Kg(e+"");if(arguments.length<2){for(var r=Bc(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each((typeof t=="function"?u1:t?l1:a1)(n,t))}function f1(){this.textContent=""}function d1(e){return function(){this.textContent=e}}function p1(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function h1(e){return arguments.length?this.each(e==null?f1:(typeof e=="function"?p1:d1)(e)):this.node().textContent}function g1(){this.innerHTML=""}function m1(e){return function(){this.innerHTML=e}}function v1(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function y1(e){return arguments.length?this.each(e==null?g1:(typeof e=="function"?v1:m1)(e)):this.node().innerHTML}function E1(){this.nextSibling&&this.parentNode.appendChild(this)}function S1(){return this.each(E1)}function _1(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function w1(){return this.each(_1)}function R1(e){var t=typeof e=="function"?e:zg(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function N1(){return null}function O1(e,t){var n=typeof e=="function"?e:zg(e),r=t==null?N1:typeof t=="function"?t:Vc(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function x1(){var e=this.parentNode;e&&e.removeChild(this)}function T1(){return this.each(x1)}function I1(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function C1(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function A1(e){return this.select(e?C1:I1)}function b1(e){return arguments.length?this.property("__data__",e):this.node().__data__}function L1(e){return function(t){e.call(this,t,this.__data__)}}function D1(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function k1(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,o=t.length,i;n<o;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++r]=i;++r?t.length=r:delete this.__on}}}function P1(e,t,n){return function(){var r=this.__on,o,i=L1(t);if(r){for(var s=0,l=r.length;s<l;++s)if((o=r[s]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=i,o.options=n),o.value=t;return}}this.addEventListener(e.type,i,n),o={type:e.type,name:e.name,value:t,listener:i,options:n},r?r.push(o):this.__on=[o]}}function M1(e,t,n){var r=D1(e+""),o,i=r.length,s;if(arguments.length<2){var l=this.node().__on;if(l){for(var a=0,u=l.length,c;a<u;++a)for(o=0,c=l[a];o<i;++o)if((s=r[o]).type===c.type&&s.name===c.name)return c.value}return}for(l=t?P1:k1,o=0;o<i;++o)this.each(l(r[o],t,n));return this}function Zg(e,t,n){var r=Yg(e),o=r.CustomEvent;typeof o=="function"?o=new o(t,n):(o=r.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function U1(e,t){return function(){return Zg(this,e,t)}}function F1(e,t){return function(){return Zg(this,e,t.apply(this,arguments))}}function V1(e,t){return this.each((typeof t=="function"?F1:U1)(e,t))}function*B1(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length,s;o<i;++o)(s=r[o])&&(yield s)}var Jg=[null];function st(e,t){this._groups=e,this._parents=t}function Ni(){return new st([[document.documentElement]],Jg)}function $1(){return this}st.prototype=Ni.prototype={constructor:st,select:pw,selectAll:vw,selectChild:_w,selectChildren:Ow,filter:xw,data:Lw,enter:Tw,exit:kw,join:Pw,merge:Mw,selection:$1,order:Uw,sort:Fw,call:Bw,nodes:$w,node:zw,size:Hw,empty:jw,each:Ww,attr:Zw,style:n1,property:s1,classed:c1,text:h1,html:y1,raise:S1,lower:w1,append:R1,insert:O1,remove:T1,clone:A1,datum:b1,on:M1,dispatch:V1,[Symbol.iterator]:B1};function It(e){return typeof e=="string"?new st([[document.querySelector(e)]],[document.documentElement]):new st([[e]],Jg)}function z1(e){let t;for(;t=e.sourceEvent;)e=t;return e}function zt(e,t){if(e=z1(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}const H1={passive:!1},Oi={capture:!0,passive:!1};function $c(e){e.stopImmediatePropagation()}function lo(e){e.preventDefault(),e.stopImmediatePropagation()}function em(e){var t=e.document.documentElement,n=It(e).on("dragstart.drag",lo,Oi);"onselectstart"in t?n.on("selectstart.drag",lo,Oi):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function tm(e,t){var n=e.document.documentElement,r=It(e).on("dragstart.drag",null);t&&(r.on("click.drag",lo,Oi),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const bl=e=>()=>e;function zc(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:i,x:s,y:l,dx:a,dy:u,dispatch:c}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:a,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:c}})}zc.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function j1(e){return!e.ctrlKey&&!e.button}function W1(){return this.parentNode}function G1(e,t){return t??{x:e.x,y:e.y}}function Y1(){return navigator.maxTouchPoints||"ontouchstart"in this}function K1(){var e=j1,t=W1,n=G1,r=Y1,o={},i=Tl("start","drag","end"),s=0,l,a,u,c,f=0;function p(S){S.on("mousedown.drag",h).filter(r).on("touchstart.drag",E).on("touchmove.drag",d,H1).on("touchend.drag touchcancel.drag",g).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(S,w){if(!(c||!e.call(this,S,w))){var N=y(this,t.call(this,S,w),S,w,"mouse");N&&(It(S.view).on("mousemove.drag",v,Oi).on("mouseup.drag",m,Oi),em(S.view),$c(S),u=!1,l=S.clientX,a=S.clientY,N("start",S))}}function v(S){if(lo(S),!u){var w=S.clientX-l,N=S.clientY-a;u=w*w+N*N>f}o.mouse("drag",S)}function m(S){It(S.view).on("mousemove.drag mouseup.drag",null),tm(S.view,u),lo(S),o.mouse("end",S)}function E(S,w){if(e.call(this,S,w)){var N=S.changedTouches,T=t.call(this,S,w),b=N.length,D,k;for(D=0;D<b;++D)(k=y(this,T,S,w,N[D].identifier,N[D]))&&($c(S),k("start",S,N[D]))}}function d(S){var w=S.changedTouches,N=w.length,T,b;for(T=0;T<N;++T)(b=o[w[T].identifier])&&(lo(S),b("drag",S,w[T]))}function g(S){var w=S.changedTouches,N=w.length,T,b;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),T=0;T<N;++T)(b=o[w[T].identifier])&&($c(S),b("end",S,w[T]))}function y(S,w,N,T,b,D){var k=i.copy(),B=zt(D||N,w),F,z,R;if((R=n.call(S,new zc("beforestart",{sourceEvent:N,target:p,identifier:b,active:s,x:B[0],y:B[1],dx:0,dy:0,dispatch:k}),T))!=null)return F=R.x-B[0]||0,z=R.y-B[1]||0,function P(A,C,x){var L=B,U;switch(A){case"start":o[b]=P,U=s++;break;case"end":delete o[b],--s;case"drag":B=zt(x||C,w),U=s;break}k.call(A,S,new zc(A,{sourceEvent:C,subject:R,target:p,identifier:b,active:U,x:B[0]+F,y:B[1]+z,dx:B[0]-L[0],dy:B[1]-L[1],dispatch:k}),T)}}return p.filter=function(S){return arguments.length?(e=typeof S=="function"?S:bl(!!S),p):e},p.container=function(S){return arguments.length?(t=typeof S=="function"?S:bl(S),p):t},p.subject=function(S){return arguments.length?(n=typeof S=="function"?S:bl(S),p):n},p.touchable=function(S){return arguments.length?(r=typeof S=="function"?S:bl(!!S),p):r},p.on=function(){var S=i.on.apply(i,arguments);return S===i?p:S},p.clickDistance=function(S){return arguments.length?(f=(S=+S)*S,p):Math.sqrt(f)},p}function Hc(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function nm(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function xi(){}var Ti=.7,Ll=1/Ti,ao="\\s*([+-]?\\d+)\\s*",Ii="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ht="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Q1=/^#([0-9a-f]{3,8})$/,X1=new RegExp(`^rgb\\(${ao},${ao},${ao}\\)$`),q1=new RegExp(`^rgb\\(${Ht},${Ht},${Ht}\\)$`),Z1=new RegExp(`^rgba\\(${ao},${ao},${ao},${Ii}\\)$`),J1=new RegExp(`^rgba\\(${Ht},${Ht},${Ht},${Ii}\\)$`),eR=new RegExp(`^hsl\\(${Ii},${Ht},${Ht}\\)$`),tR=new RegExp(`^hsla\\(${Ii},${Ht},${Ht},${Ii}\\)$`),rm={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Hc(xi,Ci,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:om,formatHex:om,formatHex8:nR,formatHsl:rR,formatRgb:im,toString:im});function om(){return this.rgb().formatHex()}function nR(){return this.rgb().formatHex8()}function rR(){return cm(this).formatHsl()}function im(){return this.rgb().formatRgb()}function Ci(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Q1.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?sm(t):n===3?new Xe(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Dl(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Dl(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=X1.exec(e))?new Xe(t[1],t[2],t[3],1):(t=q1.exec(e))?new Xe(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Z1.exec(e))?Dl(t[1],t[2],t[3],t[4]):(t=J1.exec(e))?Dl(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=eR.exec(e))?um(t[1],t[2]/100,t[3]/100,1):(t=tR.exec(e))?um(t[1],t[2]/100,t[3]/100,t[4]):rm.hasOwnProperty(e)?sm(rm[e]):e==="transparent"?new Xe(NaN,NaN,NaN,0):null}function sm(e){return new Xe(e>>16&255,e>>8&255,e&255,1)}function Dl(e,t,n,r){return r<=0&&(e=t=n=NaN),new Xe(e,t,n,r)}function oR(e){return e instanceof xi||(e=Ci(e)),e?(e=e.rgb(),new Xe(e.r,e.g,e.b,e.opacity)):new Xe}function jc(e,t,n,r){return arguments.length===1?oR(e):new Xe(e,t,n,r??1)}function Xe(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Hc(Xe,jc,nm(xi,{brighter(e){return e=e==null?Ll:Math.pow(Ll,e),new Xe(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ti:Math.pow(Ti,e),new Xe(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Xe(gr(this.r),gr(this.g),gr(this.b),kl(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:lm,formatHex:lm,formatHex8:iR,formatRgb:am,toString:am}));function lm(){return`#${mr(this.r)}${mr(this.g)}${mr(this.b)}`}function iR(){return`#${mr(this.r)}${mr(this.g)}${mr(this.b)}${mr((isNaN(this.opacity)?1:this.opacity)*255)}`}function am(){const e=kl(this.opacity);return`${e===1?"rgb(":"rgba("}${gr(this.r)}, ${gr(this.g)}, ${gr(this.b)}${e===1?")":`, ${e})`}`}function kl(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function gr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function mr(e){return e=gr(e),(e<16?"0":"")+e.toString(16)}function um(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ct(e,t,n,r)}function cm(e){if(e instanceof Ct)return new Ct(e.h,e.s,e.l,e.opacity);if(e instanceof xi||(e=Ci(e)),!e)return new Ct;if(e instanceof Ct)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),i=Math.max(t,n,r),s=NaN,l=i-o,a=(i+o)/2;return l?(t===i?s=(n-r)/l+(n<r)*6:n===i?s=(r-t)/l+2:s=(t-n)/l+4,l/=a<.5?i+o:2-i-o,s*=60):l=a>0&&a<1?0:s,new Ct(s,l,a,e.opacity)}function sR(e,t,n,r){return arguments.length===1?cm(e):new Ct(e,t,n,r??1)}function Ct(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Hc(Ct,sR,nm(xi,{brighter(e){return e=e==null?Ll:Math.pow(Ll,e),new Ct(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ti:Math.pow(Ti,e),new Ct(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new Xe(Wc(e>=240?e-240:e+120,o,r),Wc(e,o,r),Wc(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new Ct(fm(this.h),Pl(this.s),Pl(this.l),kl(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=kl(this.opacity);return`${e===1?"hsl(":"hsla("}${fm(this.h)}, ${Pl(this.s)*100}%, ${Pl(this.l)*100}%${e===1?")":`, ${e})`}`}}));function fm(e){return e=(e||0)%360,e<0?e+360:e}function Pl(e){return Math.max(0,Math.min(1,e||0))}function Wc(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const dm=e=>()=>e;function lR(e,t){return function(n){return e+n*t}}function aR(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function uR(e){return(e=+e)==1?pm:function(t,n){return n-t?aR(t,n,e):dm(isNaN(t)?n:t)}}function pm(e,t){var n=t-e;return n?lR(e,n):dm(isNaN(e)?t:e)}const hm=function e(t){var n=uR(t);function r(o,i){var s=n((o=jc(o)).r,(i=jc(i)).r),l=n(o.g,i.g),a=n(o.b,i.b),u=pm(o.opacity,i.opacity);return function(c){return o.r=s(c),o.g=l(c),o.b=a(c),o.opacity=u(c),o+""}}return r.gamma=e,r}(1);function Fn(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var Gc=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Yc=new RegExp(Gc.source,"g");function cR(e){return function(){return e}}function fR(e){return function(t){return e(t)+""}}function dR(e,t){var n=Gc.lastIndex=Yc.lastIndex=0,r,o,i,s=-1,l=[],a=[];for(e=e+"",t=t+"";(r=Gc.exec(e))&&(o=Yc.exec(t));)(i=o.index)>n&&(i=t.slice(n,i),l[s]?l[s]+=i:l[++s]=i),(r=r[0])===(o=o[0])?l[s]?l[s]+=o:l[++s]=o:(l[++s]=null,a.push({i:s,x:Fn(r,o)})),n=Yc.lastIndex;return n<t.length&&(i=t.slice(n),l[s]?l[s]+=i:l[++s]=i),l.length<2?a[0]?fR(a[0].x):cR(t):(t=a.length,function(u){for(var c=0,f;c<t;++c)l[(f=a[c]).i]=f.x(u);return l.join("")})}var gm=180/Math.PI,Kc={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function mm(e,t,n,r,o,i){var s,l,a;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(a=e*n+t*r)&&(n-=e*a,r-=t*a),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,a/=l),e*r<t*n&&(e=-e,t=-t,a=-a,s=-s),{translateX:o,translateY:i,rotate:Math.atan2(t,e)*gm,skewX:Math.atan(a)*gm,scaleX:s,scaleY:l}}var Ml;function pR(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Kc:mm(t.a,t.b,t.c,t.d,t.e,t.f)}function hR(e){return e==null||(Ml||(Ml=document.createElementNS("http://www.w3.org/2000/svg","g")),Ml.setAttribute("transform",e),!(e=Ml.transform.baseVal.consolidate()))?Kc:(e=e.matrix,mm(e.a,e.b,e.c,e.d,e.e,e.f))}function vm(e,t,n,r){function o(u){return u.length?u.pop()+" ":""}function i(u,c,f,p,h,v){if(u!==f||c!==p){var m=h.push("translate(",null,t,null,n);v.push({i:m-4,x:Fn(u,f)},{i:m-2,x:Fn(c,p)})}else(f||p)&&h.push("translate("+f+t+p+n)}function s(u,c,f,p){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),p.push({i:f.push(o(f)+"rotate(",null,r)-2,x:Fn(u,c)})):c&&f.push(o(f)+"rotate("+c+r)}function l(u,c,f,p){u!==c?p.push({i:f.push(o(f)+"skewX(",null,r)-2,x:Fn(u,c)}):c&&f.push(o(f)+"skewX("+c+r)}function a(u,c,f,p,h,v){if(u!==f||c!==p){var m=h.push(o(h)+"scale(",null,",",null,")");v.push({i:m-4,x:Fn(u,f)},{i:m-2,x:Fn(c,p)})}else(f!==1||p!==1)&&h.push(o(h)+"scale("+f+","+p+")")}return function(u,c){var f=[],p=[];return u=e(u),c=e(c),i(u.translateX,u.translateY,c.translateX,c.translateY,f,p),s(u.rotate,c.rotate,f,p),l(u.skewX,c.skewX,f,p),a(u.scaleX,u.scaleY,c.scaleX,c.scaleY,f,p),u=c=null,function(h){for(var v=-1,m=p.length,E;++v<m;)f[(E=p[v]).i]=E.x(h);return f.join("")}}}var gR=vm(pR,"px, ","px)","deg)"),mR=vm(hR,", ",")",")"),vR=1e-12;function ym(e){return((e=Math.exp(e))+1/e)/2}function yR(e){return((e=Math.exp(e))-1/e)/2}function ER(e){return((e=Math.exp(2*e))-1)/(e+1)}const SR=function e(t,n,r){function o(i,s){var l=i[0],a=i[1],u=i[2],c=s[0],f=s[1],p=s[2],h=c-l,v=f-a,m=h*h+v*v,E,d;if(m<vR)d=Math.log(p/u)/t,E=function(T){return[l+T*h,a+T*v,u*Math.exp(t*T*d)]};else{var g=Math.sqrt(m),y=(p*p-u*u+r*m)/(2*u*n*g),S=(p*p-u*u-r*m)/(2*p*n*g),w=Math.log(Math.sqrt(y*y+1)-y),N=Math.log(Math.sqrt(S*S+1)-S);d=(N-w)/t,E=function(T){var b=T*d,D=ym(w),k=u/(n*g)*(D*ER(t*b+w)-yR(w));return[l+k*h,a+k*v,u*D/ym(t*b+w)]}}return E.duration=d*1e3*t/Math.SQRT2,E}return o.rho=function(i){var s=Math.max(.001,+i),l=s*s,a=l*l;return e(s,l,a)},o}(Math.SQRT2,2,4);var uo=0,Ai=0,bi=0,Em=1e3,Ul,Li,Fl=0,vr=0,Vl=0,Di=typeof performance=="object"&&performance.now?performance:Date,Sm=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Qc(){return vr||(Sm(_R),vr=Di.now()+Vl)}function _R(){vr=0}function Bl(){this._call=this._time=this._next=null}Bl.prototype=_m.prototype={constructor:Bl,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Qc():+n)+(t==null?0:+t),!this._next&&Li!==this&&(Li?Li._next=this:Ul=this,Li=this),this._call=e,this._time=n,Xc()},stop:function(){this._call&&(this._call=null,this._time=1/0,Xc())}};function _m(e,t,n){var r=new Bl;return r.restart(e,t,n),r}function wR(){Qc(),++uo;for(var e=Ul,t;e;)(t=vr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--uo}function wm(){vr=(Fl=Di.now())+Vl,uo=Ai=0;try{wR()}finally{uo=0,NR(),vr=0}}function RR(){var e=Di.now(),t=e-Fl;t>Em&&(Vl-=t,Fl=e)}function NR(){for(var e,t=Ul,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Ul=n);Li=e,Xc(r)}function Xc(e){if(!uo){Ai&&(Ai=clearTimeout(Ai));var t=e-vr;t>24?(e<1/0&&(Ai=setTimeout(wm,e-Di.now()-Vl)),bi&&(bi=clearInterval(bi))):(bi||(Fl=Di.now(),bi=setInterval(RR,Em)),uo=1,Sm(wm))}}function Rm(e,t,n){var r=new Bl;return t=t==null?0:+t,r.restart(o=>{r.stop(),e(o+t)},t,n),r}var OR=Tl("start","end","cancel","interrupt"),xR=[],Nm=0,Om=1,qc=2,$l=3,xm=4,Zc=5,zl=6;function Hl(e,t,n,r,o,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;TR(e,n,{name:t,index:r,group:o,on:OR,tween:xR,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:Nm})}function Jc(e,t){var n=At(e,t);if(n.state>Nm)throw new Error("too late; already scheduled");return n}function jt(e,t){var n=At(e,t);if(n.state>$l)throw new Error("too late; already running");return n}function At(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function TR(e,t,n){var r=e.__transition,o;r[t]=n,n.timer=_m(i,0,n.time);function i(u){n.state=Om,n.timer.restart(s,n.delay,n.time),n.delay<=u&&s(u-n.delay)}function s(u){var c,f,p,h;if(n.state!==Om)return a();for(c in r)if(h=r[c],h.name===n.name){if(h.state===$l)return Rm(s);h.state===xm?(h.state=zl,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete r[c]):+c<t&&(h.state=zl,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete r[c])}if(Rm(function(){n.state===$l&&(n.state=xm,n.timer.restart(l,n.delay,n.time),l(u))}),n.state=qc,n.on.call("start",e,e.__data__,n.index,n.group),n.state===qc){for(n.state=$l,o=new Array(p=n.tween.length),c=0,f=-1;c<p;++c)(h=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(o[++f]=h);o.length=f+1}}function l(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(a),n.state=Zc,1),f=-1,p=o.length;++f<p;)o[f].call(e,c);n.state===Zc&&(n.on.call("end",e,e.__data__,n.index,n.group),a())}function a(){n.state=zl,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}}function jl(e,t){var n=e.__transition,r,o,i=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((r=n[s]).name!==t){i=!1;continue}o=r.state>qc&&r.state<Zc,r.state=zl,r.timer.stop(),r.on.call(o?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}i&&delete e.__transition}}function IR(e){return this.each(function(){jl(this,e)})}function CR(e,t){var n,r;return function(){var o=jt(this,e),i=o.tween;if(i!==n){r=n=i;for(var s=0,l=r.length;s<l;++s)if(r[s].name===t){r=r.slice(),r.splice(s,1);break}}o.tween=r}}function AR(e,t,n){var r,o;if(typeof n!="function")throw new Error;return function(){var i=jt(this,e),s=i.tween;if(s!==r){o=(r=s).slice();for(var l={name:t,value:n},a=0,u=o.length;a<u;++a)if(o[a].name===t){o[a]=l;break}a===u&&o.push(l)}i.tween=o}}function bR(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=At(this.node(),n).tween,o=0,i=r.length,s;o<i;++o)if((s=r[o]).name===e)return s.value;return null}return this.each((t==null?CR:AR)(n,e,t))}function ef(e,t,n){var r=e._id;return e.each(function(){var o=jt(this,r);(o.value||(o.value={}))[t]=n.apply(this,arguments)}),function(o){return At(o,r).value[t]}}function Tm(e,t){var n;return(typeof t=="number"?Fn:t instanceof Ci?hm:(n=Ci(t))?(t=n,hm):dR)(e,t)}function LR(e){return function(){this.removeAttribute(e)}}function DR(e){return function(){this.removeAttributeNS(e.space,e.local)}}function kR(e,t,n){var r,o=n+"",i;return function(){var s=this.getAttribute(e);return s===o?null:s===r?i:i=t(r=s,n)}}function PR(e,t,n){var r,o=n+"",i;return function(){var s=this.getAttributeNS(e.space,e.local);return s===o?null:s===r?i:i=t(r=s,n)}}function MR(e,t,n){var r,o,i;return function(){var s,l=n(this),a;return l==null?void this.removeAttribute(e):(s=this.getAttribute(e),a=l+"",s===a?null:s===r&&a===o?i:(o=a,i=t(r=s,l)))}}function UR(e,t,n){var r,o,i;return function(){var s,l=n(this),a;return l==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),a=l+"",s===a?null:s===r&&a===o?i:(o=a,i=t(r=s,l)))}}function FR(e,t){var n=Cl(e),r=n==="transform"?mR:Tm;return this.attrTween(e,typeof t=="function"?(n.local?UR:MR)(n,r,ef(this,"attr."+e,t)):t==null?(n.local?DR:LR)(n):(n.local?PR:kR)(n,r,t))}function VR(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function BR(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function $R(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&BR(e,i)),n}return o._value=t,o}function zR(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&VR(e,i)),n}return o._value=t,o}function HR(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=Cl(e);return this.tween(n,(r.local?$R:zR)(r,t))}function jR(e,t){return function(){Jc(this,e).delay=+t.apply(this,arguments)}}function WR(e,t){return t=+t,function(){Jc(this,e).delay=t}}function GR(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?jR:WR)(t,e)):At(this.node(),t).delay}function YR(e,t){return function(){jt(this,e).duration=+t.apply(this,arguments)}}function KR(e,t){return t=+t,function(){jt(this,e).duration=t}}function QR(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?YR:KR)(t,e)):At(this.node(),t).duration}function XR(e,t){if(typeof t!="function")throw new Error;return function(){jt(this,e).ease=t}}function qR(e){var t=this._id;return arguments.length?this.each(XR(t,e)):At(this.node(),t).ease}function ZR(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;jt(this,e).ease=n}}function JR(e){if(typeof e!="function")throw new Error;return this.each(ZR(this._id,e))}function eN(e){typeof e!="function"&&(e=jg(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,l=r[o]=[],a,u=0;u<s;++u)(a=i[u])&&e.call(a,a.__data__,u,i)&&l.push(a);return new un(r,this._parents,this._name,this._id)}function tN(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,o=n.length,i=Math.min(r,o),s=new Array(r),l=0;l<i;++l)for(var a=t[l],u=n[l],c=a.length,f=s[l]=new Array(c),p,h=0;h<c;++h)(p=a[h]||u[h])&&(f[h]=p);for(;l<r;++l)s[l]=t[l];return new un(s,this._parents,this._name,this._id)}function nN(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function rN(e,t,n){var r,o,i=nN(t)?Jc:jt;return function(){var s=i(this,e),l=s.on;l!==r&&(o=(r=l).copy()).on(t,n),s.on=o}}function oN(e,t){var n=this._id;return arguments.length<2?At(this.node(),n).on.on(e):this.each(rN(n,e,t))}function iN(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function sN(){return this.on("end.remove",iN(this._id))}function lN(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Vc(e));for(var r=this._groups,o=r.length,i=new Array(o),s=0;s<o;++s)for(var l=r[s],a=l.length,u=i[s]=new Array(a),c,f,p=0;p<a;++p)(c=l[p])&&(f=e.call(c,c.__data__,p,l))&&("__data__"in c&&(f.__data__=c.__data__),u[p]=f,Hl(u[p],t,n,p,u,At(c,n)));return new un(i,this._parents,t,n)}function aN(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Hg(e));for(var r=this._groups,o=r.length,i=[],s=[],l=0;l<o;++l)for(var a=r[l],u=a.length,c,f=0;f<u;++f)if(c=a[f]){for(var p=e.call(c,c.__data__,f,a),h,v=At(c,n),m=0,E=p.length;m<E;++m)(h=p[m])&&Hl(h,t,n,m,p,v);i.push(p),s.push(c)}return new un(i,s,t,n)}var uN=Ni.prototype.constructor;function cN(){return new uN(this._groups,this._parents)}function fN(e,t){var n,r,o;return function(){var i=so(this,e),s=(this.style.removeProperty(e),so(this,e));return i===s?null:i===n&&s===r?o:o=t(n=i,r=s)}}function Im(e){return function(){this.style.removeProperty(e)}}function dN(e,t,n){var r,o=n+"",i;return function(){var s=so(this,e);return s===o?null:s===r?i:i=t(r=s,n)}}function pN(e,t,n){var r,o,i;return function(){var s=so(this,e),l=n(this),a=l+"";return l==null&&(a=l=(this.style.removeProperty(e),so(this,e))),s===a?null:s===r&&a===o?i:(o=a,i=t(r=s,l))}}function hN(e,t){var n,r,o,i="style."+t,s="end."+i,l;return function(){var a=jt(this,e),u=a.on,c=a.value[i]==null?l||(l=Im(t)):void 0;(u!==n||o!==c)&&(r=(n=u).copy()).on(s,o=c),a.on=r}}function gN(e,t,n){var r=(e+="")=="transform"?gR:Tm;return t==null?this.styleTween(e,fN(e,r)).on("end.style."+e,Im(e)):typeof t=="function"?this.styleTween(e,pN(e,r,ef(this,"style."+e,t))).each(hN(this._id,e)):this.styleTween(e,dN(e,r,t),n).on("end.style."+e,null)}function mN(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function vN(e,t,n){var r,o;function i(){var s=t.apply(this,arguments);return s!==o&&(r=(o=s)&&mN(e,s,n)),r}return i._value=t,i}function yN(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,vN(e,t,n??""))}function EN(e){return function(){this.textContent=e}}function SN(e){return function(){var t=e(this);this.textContent=t??""}}function _N(e){return this.tween("text",typeof e=="function"?SN(ef(this,"text",e)):EN(e==null?"":e+""))}function wN(e){return function(t){this.textContent=e.call(this,t)}}function RN(e){var t,n;function r(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&wN(o)),t}return r._value=e,r}function NN(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,RN(e))}function ON(){for(var e=this._name,t=this._id,n=Cm(),r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],l=s.length,a,u=0;u<l;++u)if(a=s[u]){var c=At(a,t);Hl(a,e,n,u,s,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new un(r,this._parents,e,n)}function xN(){var e,t,n=this,r=n._id,o=n.size();return new Promise(function(i,s){var l={value:s},a={value:function(){--o===0&&i()}};n.each(function(){var u=jt(this,r),c=u.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(a)),u.on=t}),o===0&&i()})}var TN=0;function un(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Cm(){return++TN}var cn=Ni.prototype;un.prototype={constructor:un,select:lN,selectAll:aN,selectChild:cn.selectChild,selectChildren:cn.selectChildren,filter:eN,merge:tN,selection:cN,transition:ON,call:cn.call,nodes:cn.nodes,node:cn.node,size:cn.size,empty:cn.empty,each:cn.each,on:oN,attr:FR,attrTween:HR,style:gN,styleTween:yN,text:_N,textTween:NN,remove:sN,tween:bR,delay:GR,duration:QR,ease:qR,easeVarying:JR,end:xN,[Symbol.iterator]:cn[Symbol.iterator]};function IN(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var CN={time:null,delay:0,duration:250,ease:IN};function AN(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function bN(e){var t,n;e instanceof un?(t=e._id,e=e._name):(t=Cm(),(n=CN).time=Qc(),e=e==null?null:e+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],l=s.length,a,u=0;u<l;++u)(a=s[u])&&Hl(a,e,t,u,s,n||AN(a,t));return new un(r,this._parents,e,t)}Ni.prototype.interrupt=IR,Ni.prototype.transition=bN;const Wl=e=>()=>e;function LN(e,{sourceEvent:t,target:n,transform:r,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function fn(e,t,n){this.k=e,this.x=t,this.y=n}fn.prototype={constructor:fn,scale:function(e){return e===1?this:new fn(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new fn(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Vn=new fn(1,0,0);fn.prototype;function tf(e){e.stopImmediatePropagation()}function ki(e){e.preventDefault(),e.stopImmediatePropagation()}function DN(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function kN(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Am(){return this.__zoom||Vn}function PN(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function MN(){return navigator.maxTouchPoints||"ontouchstart"in this}function UN(e,t,n){var r=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function FN(){var e=DN,t=kN,n=UN,r=PN,o=MN,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],l=250,a=SR,u=Tl("start","zoom","end"),c,f,p,h=500,v=150,m=0,E=10;function d(R){R.property("__zoom",Am).on("wheel.zoom",b,{passive:!1}).on("mousedown.zoom",D).on("dblclick.zoom",k).filter(o).on("touchstart.zoom",B).on("touchmove.zoom",F).on("touchend.zoom touchcancel.zoom",z).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}d.transform=function(R,P,A,C){var x=R.selection?R.selection():R;x.property("__zoom",Am),R!==x?w(R,P,A,C):x.interrupt().each(function(){N(this,arguments).event(C).start().zoom(null,typeof P=="function"?P.apply(this,arguments):P).end()})},d.scaleBy=function(R,P,A,C){d.scaleTo(R,function(){var x=this.__zoom.k,L=typeof P=="function"?P.apply(this,arguments):P;return x*L},A,C)},d.scaleTo=function(R,P,A,C){d.transform(R,function(){var x=t.apply(this,arguments),L=this.__zoom,U=A==null?S(x):typeof A=="function"?A.apply(this,arguments):A,$=L.invert(U),j=typeof P=="function"?P.apply(this,arguments):P;return n(y(g(L,j),U,$),x,s)},A,C)},d.translateBy=function(R,P,A,C){d.transform(R,function(){return n(this.__zoom.translate(typeof P=="function"?P.apply(this,arguments):P,typeof A=="function"?A.apply(this,arguments):A),t.apply(this,arguments),s)},null,C)},d.translateTo=function(R,P,A,C,x){d.transform(R,function(){var L=t.apply(this,arguments),U=this.__zoom,$=C==null?S(L):typeof C=="function"?C.apply(this,arguments):C;return n(Vn.translate($[0],$[1]).scale(U.k).translate(typeof P=="function"?-P.apply(this,arguments):-P,typeof A=="function"?-A.apply(this,arguments):-A),L,s)},C,x)};function g(R,P){return P=Math.max(i[0],Math.min(i[1],P)),P===R.k?R:new fn(P,R.x,R.y)}function y(R,P,A){var C=P[0]-A[0]*R.k,x=P[1]-A[1]*R.k;return C===R.x&&x===R.y?R:new fn(R.k,C,x)}function S(R){return[(+R[0][0]+ +R[1][0])/2,(+R[0][1]+ +R[1][1])/2]}function w(R,P,A,C){R.on("start.zoom",function(){N(this,arguments).event(C).start()}).on("interrupt.zoom end.zoom",function(){N(this,arguments).event(C).end()}).tween("zoom",function(){var x=this,L=arguments,U=N(x,L).event(C),$=t.apply(x,L),j=A==null?S($):typeof A=="function"?A.apply(x,L):A,Q=Math.max($[1][0]-$[0][0],$[1][1]-$[0][1]),K=x.__zoom,X=typeof P=="function"?P.apply(x,L):P,q=a(K.invert(j).concat(Q/K.k),X.invert(j).concat(Q/X.k));return function(J){if(J===1)J=X;else{var ne=q(J),he=Q/ne[2];J=new fn(he,j[0]-ne[0]*he,j[1]-ne[1]*he)}U.zoom(null,J)}})}function N(R,P,A){return!A&&R.__zooming||new T(R,P)}function T(R,P){this.that=R,this.args=P,this.active=0,this.sourceEvent=null,this.extent=t.apply(R,P),this.taps=0}T.prototype={event:function(R){return R&&(this.sourceEvent=R),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(R,P){return this.mouse&&R!=="mouse"&&(this.mouse[1]=P.invert(this.mouse[0])),this.touch0&&R!=="touch"&&(this.touch0[1]=P.invert(this.touch0[0])),this.touch1&&R!=="touch"&&(this.touch1[1]=P.invert(this.touch1[0])),this.that.__zoom=P,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(R){var P=It(this.that).datum();u.call(R,this.that,new LN(R,{sourceEvent:this.sourceEvent,target:d,type:R,transform:this.that.__zoom,dispatch:u}),P)}};function b(R,...P){if(!e.apply(this,arguments))return;var A=N(this,P).event(R),C=this.__zoom,x=Math.max(i[0],Math.min(i[1],C.k*Math.pow(2,r.apply(this,arguments)))),L=zt(R);if(A.wheel)(A.mouse[0][0]!==L[0]||A.mouse[0][1]!==L[1])&&(A.mouse[1]=C.invert(A.mouse[0]=L)),clearTimeout(A.wheel);else{if(C.k===x)return;A.mouse=[L,C.invert(L)],jl(this),A.start()}ki(R),A.wheel=setTimeout(U,v),A.zoom("mouse",n(y(g(C,x),A.mouse[0],A.mouse[1]),A.extent,s));function U(){A.wheel=null,A.end()}}function D(R,...P){if(p||!e.apply(this,arguments))return;var A=R.currentTarget,C=N(this,P,!0).event(R),x=It(R.view).on("mousemove.zoom",j,!0).on("mouseup.zoom",Q,!0),L=zt(R,A),U=R.clientX,$=R.clientY;em(R.view),tf(R),C.mouse=[L,this.__zoom.invert(L)],jl(this),C.start();function j(K){if(ki(K),!C.moved){var X=K.clientX-U,q=K.clientY-$;C.moved=X*X+q*q>m}C.event(K).zoom("mouse",n(y(C.that.__zoom,C.mouse[0]=zt(K,A),C.mouse[1]),C.extent,s))}function Q(K){x.on("mousemove.zoom mouseup.zoom",null),tm(K.view,C.moved),ki(K),C.event(K).end()}}function k(R,...P){if(e.apply(this,arguments)){var A=this.__zoom,C=zt(R.changedTouches?R.changedTouches[0]:R,this),x=A.invert(C),L=A.k*(R.shiftKey?.5:2),U=n(y(g(A,L),C,x),t.apply(this,P),s);ki(R),l>0?It(this).transition().duration(l).call(w,U,C,R):It(this).call(d.transform,U,C,R)}}function B(R,...P){if(e.apply(this,arguments)){var A=R.touches,C=A.length,x=N(this,P,R.changedTouches.length===C).event(R),L,U,$,j;for(tf(R),U=0;U<C;++U)$=A[U],j=zt($,this),j=[j,this.__zoom.invert(j),$.identifier],x.touch0?!x.touch1&&x.touch0[2]!==j[2]&&(x.touch1=j,x.taps=0):(x.touch0=j,L=!0,x.taps=1+!!c);c&&(c=clearTimeout(c)),L&&(x.taps<2&&(f=j[0],c=setTimeout(function(){c=null},h)),jl(this),x.start())}}function F(R,...P){if(this.__zooming){var A=N(this,P).event(R),C=R.changedTouches,x=C.length,L,U,$,j;for(ki(R),L=0;L<x;++L)U=C[L],$=zt(U,this),A.touch0&&A.touch0[2]===U.identifier?A.touch0[0]=$:A.touch1&&A.touch1[2]===U.identifier&&(A.touch1[0]=$);if(U=A.that.__zoom,A.touch1){var Q=A.touch0[0],K=A.touch0[1],X=A.touch1[0],q=A.touch1[1],J=(J=X[0]-Q[0])*J+(J=X[1]-Q[1])*J,ne=(ne=q[0]-K[0])*ne+(ne=q[1]-K[1])*ne;U=g(U,Math.sqrt(J/ne)),$=[(Q[0]+X[0])/2,(Q[1]+X[1])/2],j=[(K[0]+q[0])/2,(K[1]+q[1])/2]}else if(A.touch0)$=A.touch0[0],j=A.touch0[1];else return;A.zoom("touch",n(y(U,$,j),A.extent,s))}}function z(R,...P){if(this.__zooming){var A=N(this,P).event(R),C=R.changedTouches,x=C.length,L,U;for(tf(R),p&&clearTimeout(p),p=setTimeout(function(){p=null},h),L=0;L<x;++L)U=C[L],A.touch0&&A.touch0[2]===U.identifier?delete A.touch0:A.touch1&&A.touch1[2]===U.identifier&&delete A.touch1;if(A.touch1&&!A.touch0&&(A.touch0=A.touch1,delete A.touch1),A.touch0)A.touch0[1]=this.__zoom.invert(A.touch0[0]);else if(A.end(),A.taps===2&&(U=zt(U,this),Math.hypot(f[0]-U[0],f[1]-U[1])<E)){var $=It(this).on("dblclick.zoom");$&&$.apply(this,arguments)}}}return d.wheelDelta=function(R){return arguments.length?(r=typeof R=="function"?R:Wl(+R),d):r},d.filter=function(R){return arguments.length?(e=typeof R=="function"?R:Wl(!!R),d):e},d.touchable=function(R){return arguments.length?(o=typeof R=="function"?R:Wl(!!R),d):o},d.extent=function(R){return arguments.length?(t=typeof R=="function"?R:Wl([[+R[0][0],+R[0][1]],[+R[1][0],+R[1][1]]]),d):t},d.scaleExtent=function(R){return arguments.length?(i[0]=+R[0],i[1]=+R[1],d):[i[0],i[1]]},d.translateExtent=function(R){return arguments.length?(s[0][0]=+R[0][0],s[1][0]=+R[1][0],s[0][1]=+R[0][1],s[1][1]=+R[1][1],d):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},d.constrain=function(R){return arguments.length?(n=R,d):n},d.duration=function(R){return arguments.length?(l=+R,d):l},d.interpolate=function(R){return arguments.length?(a=R,d):a},d.on=function(){var R=u.on.apply(u,arguments);return R===u?d:R},d.clickDistance=function(R){return arguments.length?(m=(R=+R)*R,d):Math.sqrt(m)},d.tapDistance=function(R){return arguments.length?(E=+R,d):E},d}const Gl=O.createContext(null),VN=Gl.Provider,dn={"001":()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001","002":()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.","003":e=>`Node type "${e}" not found. Using fallback type "default".`,"004":()=>"The React Flow parent container needs a width and a height to render the graph.","005":()=>"Only child nodes can use a parent extent.","006":()=>"Can't create edge. An edge needs a source and a target.","007":e=>`The old edge with id=${e} does not exist.`,"009":e=>`Marker type "${e}" doesn't exist.`,"008":(e,t)=>`Couldn't create edge for ${e?"target":"source"} handle id: "${e?t.targetHandle:t.sourceHandle}", edge id: ${t.id}.`,"010":()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.","011":e=>`Edge type "${e}" not found. Using fallback type "default".`},bm=dn["001"]();function de(e,t){const n=O.useContext(Gl);if(n===null)throw new Error(bm);return Fg(n,e,t)}const Ce=()=>{const e=O.useContext(Gl);if(e===null)throw new Error(bm);return O.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},BN=e=>e.userSelectionActive?"none":"all";function nf({position:e,children:t,className:n,style:r,...o}){const i=de(BN),s=`${e}`.split("-");return _("div",{className:Ke(["react-flow__panel",n,...s]),style:{...r,pointerEvents:i},...o,children:t})}function $N({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:_(nf,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:_("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const zN=({x:e,y:t,label:n,labelStyle:r={},labelShowBg:o=!0,labelBgStyle:i={},labelBgPadding:s=[2,4],labelBgBorderRadius:l=2,children:a,className:u,...c})=>{const f=O.useRef(null),[p,h]=O.useState({x:0,y:0,width:0,height:0}),v=Ke(["react-flow__edge-textwrapper",u]);return O.useEffect(()=>{if(f.current){const m=f.current.getBBox();h({x:m.x,y:m.y,width:m.width,height:m.height})}},[n]),typeof n>"u"||!n?null:V("g",{transform:`translate(${e-p.width/2} ${t-p.height/2})`,className:v,visibility:p.width?"visible":"hidden",...c,children:[o&&_("rect",{width:p.width+2*s[0],x:-s[0],y:-s[1],height:p.height+2*s[1],className:"react-flow__edge-textbg",style:i,rx:l,ry:l}),_("text",{className:"react-flow__edge-text",y:p.height/2,dy:"0.3em",ref:f,style:r,children:n}),a]})};var HN=O.memo(zN);const rf=e=>({width:e.offsetWidth,height:e.offsetHeight}),co=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),of=(e={x:0,y:0},t)=>({x:co(e.x,t[0][0],t[1][0]),y:co(e.y,t[0][1],t[1][1])}),Lm=(e,t,n)=>e<t?co(Math.abs(e-t),1,50)/50:e>n?-co(Math.abs(e-n),1,50)/50:0,Dm=(e,t)=>{const n=Lm(e.x,35,t.width-35)*20,r=Lm(e.y,35,t.height-35)*20;return[n,r]},km=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},jN=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Pm=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),WN=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Mm=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),sf=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},GN=e=>mt(e.width)&&mt(e.height)&&mt(e.x)&&mt(e.y),mt=e=>!isNaN(e)&&isFinite(e),_e=Symbol.for("internals"),Um=["Enter"," ","Escape"],Fm=(e,t)=>{},YN=e=>"nativeEvent"in e;function lf(e){var i,s;const t=YN(e)?e.nativeEvent:e,n=((s=(i=t.composedPath)==null?void 0:i.call(t))==null?void 0:s[0])||e.target,r=["INPUT","SELECT","TEXTAREA"].includes(n==null?void 0:n.nodeName)||(n==null?void 0:n.hasAttribute("contenteditable")),o=e.ctrlKey||e.metaKey||e.shiftKey;return r&&!o||!!(n!=null&&n.closest(".nokey"))}const Vm=e=>"clientX"in e,Bn=(e,t)=>{var i,s;const n=Vm(e),r=n?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,o=n?e.clientY:(s=e.touches)==null?void 0:s[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:o-((t==null?void 0:t.top)??0)}},fo=({path:e,labelX:t,labelY:n,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:a,style:u,markerEnd:c,markerStart:f,interactionWidth:p=20})=>V(Ae,{children:[_("path",{style:u,d:e,fill:"none",className:"react-flow__edge-path",markerEnd:c,markerStart:f}),p&&_("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:p,className:"react-flow__edge-interaction"}),r&&mt(t)&&mt(n)?_(HN,{x:t,y:n,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:a}):null]});fo.displayName="BaseEdge";function Pi(e,t,n){return n===void 0?n:r=>{const o=t().edges.find(i=>i.id===e);o&&n(r,{...o})}}function Bm({sourceX:e,sourceY:t,targetX:n,targetY:r}){const o=Math.abs(n-e)/2,i=n<e?n+o:n-o,s=Math.abs(r-t)/2,l=r<t?r+s:r-s;return[i,l,o,s]}function $m({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:o,sourceControlY:i,targetControlX:s,targetControlY:l}){const a=e*.125+o*.375+s*.375+n*.125,u=t*.125+i*.375+l*.375+r*.125,c=Math.abs(a-e),f=Math.abs(u-t);return[a,u,c,f]}var $n;(function(e){e.Strict="strict",e.Loose="loose"})($n||($n={}));var po;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(po||(po={}));var Mi;(function(e){e.Partial="partial",e.Full="full"})(Mi||(Mi={}));var zn;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(zn||(zn={}));var Ui;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Ui||(Ui={}));var G;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(G||(G={}));function zm({pos:e,x1:t,y1:n,x2:r,y2:o}){return e===G.Left||e===G.Right?[.5*(t+r),n]:[t,.5*(n+o)]}function Hm({sourceX:e,sourceY:t,sourcePosition:n=G.Bottom,targetX:r,targetY:o,targetPosition:i=G.Top}){const[s,l]=zm({pos:n,x1:e,y1:t,x2:r,y2:o}),[a,u]=zm({pos:i,x1:r,y1:o,x2:e,y2:t}),[c,f,p,h]=$m({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:s,sourceControlY:l,targetControlX:a,targetControlY:u});return[`M${e},${t} C${s},${l} ${a},${u} ${r},${o}`,c,f,p,h]}const af=O.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:o=G.Bottom,targetPosition:i=G.Top,label:s,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:v,interactionWidth:m})=>{const[E,d,g]=Hm({sourceX:e,sourceY:t,sourcePosition:o,targetX:n,targetY:r,targetPosition:i});return _(fo,{path:E,labelX:d,labelY:g,label:s,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:v,interactionWidth:m})});af.displayName="SimpleBezierEdge";const jm={[G.Left]:{x:-1,y:0},[G.Right]:{x:1,y:0},[G.Top]:{x:0,y:-1},[G.Bottom]:{x:0,y:1}},KN=({source:e,sourcePosition:t=G.Bottom,target:n})=>t===G.Left||t===G.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},Wm=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function QN({source:e,sourcePosition:t=G.Bottom,target:n,targetPosition:r=G.Top,center:o,offset:i}){const s=jm[t],l=jm[r],a={x:e.x+s.x*i,y:e.y+s.y*i},u={x:n.x+l.x*i,y:n.y+l.y*i},c=KN({source:a,sourcePosition:t,target:u}),f=c.x!==0?"x":"y",p=c[f];let h=[],v,m;const[E,d,g,y]=Bm({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[f]*l[f]===-1){v=o.x||E,m=o.y||d;const w=[{x:v,y:a.y},{x:v,y:u.y}],N=[{x:a.x,y:m},{x:u.x,y:m}];s[f]===p?h=f==="x"?w:N:h=f==="x"?N:w}else{const w=[{x:a.x,y:u.y}],N=[{x:u.x,y:a.y}];if(f==="x"?h=s.x===p?N:w:h=s.y===p?w:N,t!==r){const T=f==="x"?"y":"x",b=s[f]===l[T],D=a[T]>u[T],k=a[T]<u[T];(s[f]===1&&(!b&&D||b&&k)||s[f]!==1&&(!b&&k||b&&D))&&(h=f==="x"?w:N)}v=h[0].x,m=h[0].y}return[[e,a,...h,u,n],v,m,g,y]}function XN(e,t,n,r){const o=Math.min(Wm(e,t)/2,Wm(t,n)/2,r),{x:i,y:s}=t;if(e.x===i&&i===n.x||e.y===s&&s===n.y)return`L${i} ${s}`;if(e.y===s){const u=e.x<n.x?-1:1,c=e.y<n.y?1:-1;return`L ${i+o*u},${s}Q ${i},${s} ${i},${s+o*c}`}const l=e.x<n.x?1:-1,a=e.y<n.y?-1:1;return`L ${i},${s+o*a}Q ${i},${s} ${i+o*l},${s}`}function Fi({sourceX:e,sourceY:t,sourcePosition:n=G.Bottom,targetX:r,targetY:o,targetPosition:i=G.Top,borderRadius:s=5,centerX:l,centerY:a,offset:u=20}){const[c,f,p,h,v]=QN({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:i,center:{x:l,y:a},offset:u});return[c.reduce((E,d,g)=>{let y="";return g>0&&g<c.length-1?y=XN(c[g-1],d,c[g+1],s):y=`${g===0?"M":"L"}${d.x} ${d.y}`,E+=y,E},""),f,p,h,v]}const Yl=O.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:a,labelBgBorderRadius:u,style:c,sourcePosition:f=G.Bottom,targetPosition:p=G.Top,markerEnd:h,markerStart:v,pathOptions:m,interactionWidth:E})=>{const[d,g,y]=Fi({sourceX:e,sourceY:t,sourcePosition:f,targetX:n,targetY:r,targetPosition:p,borderRadius:m==null?void 0:m.borderRadius,offset:m==null?void 0:m.offset});return _(fo,{path:d,labelX:g,labelY:y,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:a,labelBgBorderRadius:u,style:c,markerEnd:h,markerStart:v,interactionWidth:E})});Yl.displayName="SmoothStepEdge";const uf=O.memo(e=>{var t;return _(Yl,{...e,pathOptions:O.useMemo(()=>{var n;return{borderRadius:0,offset:(n=e.pathOptions)==null?void 0:n.offset}},[(t=e.pathOptions)==null?void 0:t.offset])})});uf.displayName="StepEdge";function qN({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[o,i,s,l]=Bm({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,i,s,l]}const cf=O.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:a,labelBgBorderRadius:u,style:c,markerEnd:f,markerStart:p,interactionWidth:h})=>{const[v,m,E]=qN({sourceX:e,sourceY:t,targetX:n,targetY:r});return _(fo,{path:v,labelX:m,labelY:E,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:a,labelBgBorderRadius:u,style:c,markerEnd:f,markerStart:p,interactionWidth:h})});cf.displayName="StraightEdge";function Kl(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Gm({pos:e,x1:t,y1:n,x2:r,y2:o,c:i}){switch(e){case G.Left:return[t-Kl(t-r,i),n];case G.Right:return[t+Kl(r-t,i),n];case G.Top:return[t,n-Kl(n-o,i)];case G.Bottom:return[t,n+Kl(o-n,i)]}}function Ym({sourceX:e,sourceY:t,sourcePosition:n=G.Bottom,targetX:r,targetY:o,targetPosition:i=G.Top,curvature:s=.25}){const[l,a]=Gm({pos:n,x1:e,y1:t,x2:r,y2:o,c:s}),[u,c]=Gm({pos:i,x1:r,y1:o,x2:e,y2:t,c:s}),[f,p,h,v]=$m({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:l,sourceControlY:a,targetControlX:u,targetControlY:c});return[`M${e},${t} C${l},${a} ${u},${c} ${r},${o}`,f,p,h,v]}const Ql=O.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:o=G.Bottom,targetPosition:i=G.Top,label:s,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:v,pathOptions:m,interactionWidth:E})=>{const[d,g,y]=Ym({sourceX:e,sourceY:t,sourcePosition:o,targetX:n,targetY:r,targetPosition:i,curvature:m==null?void 0:m.curvature});return _(fo,{path:d,labelX:g,labelY:y,label:s,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:v,interactionWidth:E})});Ql.displayName="BezierEdge";const ff=O.createContext(null),ZN=ff.Provider;ff.Consumer;const JN=()=>O.useContext(ff),eO=e=>"id"in e&&"source"in e&&"target"in e,Km=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`reactflow__edge-${e}${t||""}-${n}${r||""}`,df=(e,t)=>typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`,tO=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),Qm=(e,t)=>{if(!e.source||!e.target)return t;let n;return eO(e)?n={...e}:n={...e,id:Km(e)},tO(n,t)?t:t.concat(n)},nO=(e,t,n)=>{if(!t.source||!t.target)return n;if(!n.find(i=>i.id===e.id))return Fm("007",dn["007"](e.id)),n;const o={...e,id:Km(t),source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle};return n.filter(i=>i.id!==e.id).concat(o)},Xm=({x:e,y:t},[n,r,o],i,[s,l])=>{const a={x:(e-n)/o,y:(t-r)/o};return i?{x:s*Math.round(a.x/s),y:l*Math.round(a.y/l)}:a},rO=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r}),ho=(e,t=[0,0])=>{if(!e)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const n=(e.width??0)*t[0],r=(e.height??0)*t[1],o={x:e.position.x-n,y:e.position.y-r};return{...o,positionAbsolute:e.positionAbsolute?{x:e.positionAbsolute.x-n,y:e.positionAbsolute.y-r}:o}},qm=(e,t=[0,0])=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,o)=>{const{x:i,y:s}=ho(o,t).positionAbsolute;return jN(r,Pm({x:i,y:s,width:o.width||0,height:o.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return WN(n)},Zm=(e,t,[n,r,o]=[0,0,1],i=!1,s=!1,l=[0,0])=>{const a={x:(t.x-n)/o,y:(t.y-r)/o,width:t.width/o,height:t.height/o},u=[];return e.forEach(c=>{const{width:f,height:p,selectable:h=!0,hidden:v=!1}=c;if(s&&!h||v)return!1;const{positionAbsolute:m}=ho(c,l),E={x:m.x,y:m.y,width:f||0,height:p||0},d=sf(a,E),g=typeof f>"u"||typeof p>"u"||f===null||p===null,y=i&&d>0,S=(f||0)*(p||0);(g||y||d>=S||c.dragging)&&u.push(c)}),u},Jm=(e,t)=>{const n=e.map(r=>r.id);return t.filter(r=>n.includes(r.source)||n.includes(r.target))},ev=(e,t,n,r,o,i=.1)=>{const s=t/(e.width*(1+i)),l=n/(e.height*(1+i)),a=Math.min(s,l),u=co(a,r,o),c=e.x+e.width/2,f=e.y+e.height/2,p=t/2-c*u,h=n/2-f*u;return[p,h,u]},yr=(e,t=0)=>e.transition().duration(t);function tv(e,t,n,r){return(t[n]||[]).reduce((o,i)=>{var s,l;return`${e.id}-${i.id}-${n}`!==r&&o.push({id:i.id||null,type:n,nodeId:e.id,x:(((s=e.positionAbsolute)==null?void 0:s.x)??0)+i.x+i.width/2,y:(((l=e.positionAbsolute)==null?void 0:l.y)??0)+i.y+i.height/2}),o},[])}function oO(e,t,n){let r=null,o=1/0;return n.forEach(i=>{const s=Math.sqrt(Math.pow(i.x-e.x,2)+Math.pow(i.y-e.y,2));s<=t&&s<o&&(o=s,r=i)}),r}const iO={source:null,target:null,sourceHandle:null,targetHandle:null};function nv(e,t,n,r,o,i,s,l){const a=i==="target",u=l.querySelector(`.react-flow__handle[data-id="${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`),{x:c,y:f}=Bn(e),p=l.elementFromPoint(c,f),h=p!=null&&p.classList.contains("react-flow__handle")?p:u,v={handleDomNode:h,isValid:!1,connection:iO};if(h){const m=rv(void 0,h),E=h.getAttribute("data-nodeid"),d=h.getAttribute("data-handleid"),g={source:a?E:r,sourceHandle:a?d:o,target:a?r:E,targetHandle:a?o:d};v.connection=g,(n===$n.Strict?a&&m==="source"||!a&&m==="target":E!==r||d!==o)&&(v.isValid=s(g))}return v}function sO({nodes:e,nodeId:t,handleId:n,handleType:r}){return e.reduce((o,i)=>{if(i[_e]){const{handleBounds:s}=i[_e];let l=[],a=[];s&&(l=tv(i,s,"source",`${t}-${n}-${r}`),a=tv(i,s,"target",`${t}-${n}-${r}`)),o.push(...l,...a)}return o},[])}function rv(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function pf(e){e==null||e.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function lO(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function ov({event:e,handleId:t,nodeId:n,onConnect:r,isTarget:o,getState:i,setState:s,isValidConnection:l,edgeUpdaterType:a,onEdgeUpdateEnd:u}){const c=km(e.target),{connectionMode:f,domNode:p,autoPanOnConnect:h,connectionRadius:v,onConnectStart:m,panBy:E,getNodes:d,cancelConnection:g}=i();let y=0,S;const{x:w,y:N}=Bn(e),T=c==null?void 0:c.elementFromPoint(w,N),b=rv(a,T),D=p==null?void 0:p.getBoundingClientRect();if(!D||!b)return;let k,B=Bn(e,D),F=!1,z=null,R=!1,P=null;const A=sO({nodes:d(),nodeId:n,handleId:t,handleType:b}),C=()=>{if(!h)return;const[U,$]=Dm(B,D);E({x:U,y:$}),y=requestAnimationFrame(C)};s({connectionPosition:B,connectionNodeId:n,connectionHandleId:t,connectionHandleType:b,connectionStatus:null}),m==null||m(e,{nodeId:n,handleId:t,handleType:b});function x(U){const{transform:$}=i();B=Bn(U,D),S=oO(Xm(B,$,!1,[1,1]),v,A),F||(C(),F=!0);const j=nv(U,S,f,n,t,o?"target":"source",l,c);if(P=j.handleDomNode,z=j.connection,R=j.isValid,s({connectionPosition:S&&R?rO({x:S.x,y:S.y},$):B,connectionStatus:lO(!!S,R)}),!S&&!R&&!P)return pf(k);z.source!==z.target&&P&&(pf(k),k=P,P.classList.add("connecting","react-flow__handle-connecting"),P.classList.toggle("valid",R),P.classList.toggle("react-flow__handle-valid",R))}function L(U){var $,j;(S||P)&&z&&R&&(r==null||r(z)),(j=($=i()).onConnectEnd)==null||j.call($,U),a&&(u==null||u(U)),pf(k),g(),cancelAnimationFrame(y),F=!1,R=!1,z=null,P=null,c.removeEventListener("mousemove",x),c.removeEventListener("mouseup",L),c.removeEventListener("touchmove",x),c.removeEventListener("touchend",L)}c.addEventListener("mousemove",x),c.addEventListener("mouseup",L),c.addEventListener("touchmove",x),c.addEventListener("touchend",L)}const aO=()=>!0,uO=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),iv=O.forwardRef(({type:e="source",position:t=G.Top,isValidConnection:n=aO,isConnectable:r=!0,id:o,onConnect:i,children:s,className:l,onMouseDown:a,onTouchStart:u,...c},f)=>{var N,T;const p=Ce(),h=JN();if(!h)return(T=(N=p.getState()).onError)==null||T.call(N,"010",dn["010"]()),null;const{connectionStartHandle:v,connectOnClick:m,noPanClassName:E}=de(uO,Qe),d=o||null,g=e==="target",y=b=>{const{defaultEdgeOptions:D,onConnect:k,hasDefaultEdges:B}=p.getState(),F={...D,...b};if(B){const{edges:z}=p.getState();p.setState({edges:Qm(F,z)})}k==null||k(F),i==null||i(F)},S=b=>{const D=Vm(b);(D&&b.button===0||!D)&&ov({event:b,handleId:d,nodeId:h,onConnect:y,isTarget:g,getState:p.getState,setState:p.setState,isValidConnection:n}),D?a==null||a(b):u==null||u(b)},w=b=>{const{onClickConnectStart:D,onClickConnectEnd:k,connectionMode:B}=p.getState();if(!v){D==null||D(b,{nodeId:h,handleId:d,handleType:e}),p.setState({connectionStartHandle:{nodeId:h,type:e,handleId:d}});return}const F=km(b.target),{connection:z,isValid:R}=nv(b,{nodeId:h,id:d,type:e},B,v.nodeId,v.handleId||null,v.type,n,F);R&&y(z),k==null||k(b),p.setState({connectionStartHandle:null})};return _("div",{"data-handleid":d,"data-nodeid":h,"data-handlepos":t,"data-id":`${h}-${d}-${e}`,className:Ke(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",E,l,{source:!g,target:g,connectable:r,connecting:(v==null?void 0:v.nodeId)===h&&(v==null?void 0:v.handleId)===d&&(v==null?void 0:v.type)===e}]),onMouseDown:S,onTouchStart:S,onClick:m?w:void 0,ref:f,...c,children:s})});iv.displayName="Handle";var go=O.memo(iv);const sv=({data:e,isConnectable:t,targetPosition:n=G.Top,sourcePosition:r=G.Bottom})=>V(Ae,{children:[_(go,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,_(go,{type:"source",position:r,isConnectable:t})]});sv.displayName="DefaultNode";var hf=O.memo(sv);const lv=({data:e,isConnectable:t,sourcePosition:n=G.Bottom})=>V(Ae,{children:[e==null?void 0:e.label,_(go,{type:"source",position:n,isConnectable:t})]});lv.displayName="InputNode";var av=O.memo(lv);const uv=({data:e,isConnectable:t,targetPosition:n=G.Top})=>V(Ae,{children:[_(go,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]});uv.displayName="OutputNode";var cv=O.memo(uv);const gf=()=>null;gf.displayName="GroupNode";const cO=e=>({selectedNodes:e.getNodes().filter(t=>t.selected),selectedEdges:e.edges.filter(t=>t.selected)}),Xl=e=>e.id;function fO(e,t){return Qe(e.selectedNodes.map(Xl),t.selectedNodes.map(Xl))&&Qe(e.selectedEdges.map(Xl),t.selectedEdges.map(Xl))}const fv=O.memo(({onSelectionChange:e})=>{const t=Ce(),{selectedNodes:n,selectedEdges:r}=de(cO,fO);return O.useEffect(()=>{var i,s;const o={nodes:n,edges:r};e==null||e(o),(s=(i=t.getState()).onSelectionChange)==null||s.call(i,o)},[n,r,e]),null});fv.displayName="SelectionListener";const dO=e=>!!e.onSelectionChange;function pO({onSelectionChange:e}){const t=de(dO);return e||t?_(fv,{onSelectionChange:e}):null}const hO=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset});function mo(e,t){O.useEffect(()=>{typeof e<"u"&&t(e)},[e])}function ee(e,t,n){O.useEffect(()=>{typeof t<"u"&&n({[e]:t})},[t])}const gO=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:o,onConnectStart:i,onConnectEnd:s,onClickConnectStart:l,onClickConnectEnd:a,nodesDraggable:u,nodesConnectable:c,nodesFocusable:f,edgesFocusable:p,elevateNodesOnSelect:h,minZoom:v,maxZoom:m,nodeExtent:E,onNodesChange:d,onEdgesChange:g,elementsSelectable:y,connectionMode:S,snapGrid:w,snapToGrid:N,translateExtent:T,connectOnClick:b,defaultEdgeOptions:D,fitView:k,fitViewOptions:B,onNodesDelete:F,onEdgesDelete:z,onNodeDrag:R,onNodeDragStart:P,onNodeDragStop:A,onSelectionDrag:C,onSelectionDragStart:x,onSelectionDragStop:L,noPanClassName:U,nodeOrigin:$,rfId:j,autoPanOnConnect:Q,autoPanOnNodeDrag:K,onError:X,connectionRadius:q})=>{const{setNodes:J,setEdges:ne,setDefaultNodesAndEdges:he,setMinZoom:ie,setMaxZoom:Pe,setTranslateExtent:Ze,setNodeExtent:ge,reset:at}=de(hO,Qe),Y=Ce();return O.useEffect(()=>{const ze=r==null?void 0:r.map(ut=>({...ut,...D}));return he(n,ze),()=>{at()}},[]),ee("defaultEdgeOptions",D,Y.setState),ee("connectionMode",S,Y.setState),ee("onConnect",o,Y.setState),ee("onConnectStart",i,Y.setState),ee("onConnectEnd",s,Y.setState),ee("onClickConnectStart",l,Y.setState),ee("onClickConnectEnd",a,Y.setState),ee("nodesDraggable",u,Y.setState),ee("nodesConnectable",c,Y.setState),ee("nodesFocusable",f,Y.setState),ee("edgesFocusable",p,Y.setState),ee("elementsSelectable",y,Y.setState),ee("elevateNodesOnSelect",h,Y.setState),ee("snapToGrid",N,Y.setState),ee("snapGrid",w,Y.setState),ee("onNodesChange",d,Y.setState),ee("onEdgesChange",g,Y.setState),ee("connectOnClick",b,Y.setState),ee("fitViewOnInit",k,Y.setState),ee("fitViewOnInitOptions",B,Y.setState),ee("onNodesDelete",F,Y.setState),ee("onEdgesDelete",z,Y.setState),ee("onNodeDrag",R,Y.setState),ee("onNodeDragStart",P,Y.setState),ee("onNodeDragStop",A,Y.setState),ee("onSelectionDrag",C,Y.setState),ee("onSelectionDragStart",x,Y.setState),ee("onSelectionDragStop",L,Y.setState),ee("noPanClassName",U,Y.setState),ee("nodeOrigin",$,Y.setState),ee("rfId",j,Y.setState),ee("autoPanOnConnect",Q,Y.setState),ee("autoPanOnNodeDrag",K,Y.setState),ee("onError",X,Y.setState),ee("connectionRadius",q,Y.setState),mo(e,J),mo(t,ne),mo(v,ie),mo(m,Pe),mo(T,Ze),mo(E,ge),null},dv={display:"none"},mO={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},pv="react-flow__node-desc",hv="react-flow__edge-desc",vO="react-flow__aria-live",yO=e=>e.ariaLiveMessage;function EO({rfId:e}){const t=de(yO);return _("div",{id:`${vO}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:mO,children:t})}function SO({rfId:e,disableKeyboardA11y:t}){return V(Ae,{children:[V("div",{id:`${pv}-${e}`,style:dv,children:["Press enter or space to select a node.",!t&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "]}),_("div",{id:`${hv}-${e}`,style:dv,children:"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."}),!t&&_(EO,{rfId:e})]})}const _O=(e,t,n)=>n===G.Left?e-t:n===G.Right?e+t:e,wO=(e,t,n)=>n===G.Top?e-t:n===G.Bottom?e+t:e,gv="react-flow__edgeupdater",mv=({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:o,onMouseEnter:i,onMouseOut:s,type:l})=>_("circle",{onMouseDown:o,onMouseEnter:i,onMouseOut:s,className:Ke([gv,`${gv}-${l}`]),cx:_O(t,r,e),cy:wO(n,r,e),r,stroke:"transparent",fill:"transparent"});var vo=e=>{const t=({id:n,className:r,type:o,data:i,onClick:s,onEdgeDoubleClick:l,selected:a,animated:u,label:c,labelStyle:f,labelShowBg:p,labelBgStyle:h,labelBgPadding:v,labelBgBorderRadius:m,style:E,source:d,target:g,sourceX:y,sourceY:S,targetX:w,targetY:N,sourcePosition:T,targetPosition:b,elementsSelectable:D,hidden:k,sourceHandleId:B,targetHandleId:F,onContextMenu:z,onMouseEnter:R,onMouseMove:P,onMouseLeave:A,edgeUpdaterRadius:C,onEdgeUpdate:x,onEdgeUpdateStart:L,onEdgeUpdateEnd:U,markerEnd:$,markerStart:j,rfId:Q,ariaLabel:K,isFocusable:X,pathOptions:q,interactionWidth:J})=>{const ne=O.useRef(null),[he,ie]=O.useState(!1),[Pe,Ze]=O.useState(!1),ge=Ce(),at=O.useMemo(()=>`url(#${df(j,Q)})`,[j,Q]),Y=O.useMemo(()=>`url(#${df($,Q)})`,[$,Q]);if(k)return null;const ze=Je=>{const{edges:Pt,addSelectedEdges:Or}=ge.getState();if(D&&(ge.setState({nodesSelectionActive:!1}),Or([n])),s){const xr=Pt.find(vn=>vn.id===n);s(Je,xr)}},ut=Pi(n,ge.getState,l),To=Pi(n,ge.getState,z),ns=Pi(n,ge.getState,R),rs=Pi(n,ge.getState,P),os=Pi(n,ge.getState,A),Jn=(Je,Pt)=>{if(Je.button!==0)return;const Or=Pt?g:d,xr=(Pt?F:B)||null,vn=Pt?"target":"source",ya=()=>!0,ls=Pt,as=ge.getState().edges.find(Tr=>Tr.id===n);Ze(!0),L==null||L(Je,as,vn);const ud=Tr=>{Ze(!1),U==null||U(Tr,as,vn)};ov({event:Je,handleId:xr,nodeId:Or,onConnect:Tr=>x==null?void 0:x(as,Tr),isTarget:ls,getState:ge.getState,setState:ge.setState,isValidConnection:ya,edgeUpdaterType:vn,onEdgeUpdateEnd:ud})},Io=Je=>Jn(Je,!0),er=Je=>Jn(Je,!1),Co=()=>ie(!0),mn=()=>ie(!1),is=!D&&!s,ss=typeof x<"u",Ao=Je=>{var Pt;if(Um.includes(Je.key)&&D){const{unselectNodesAndEdges:Or,addSelectedEdges:xr,edges:vn}=ge.getState();Je.key==="Escape"?((Pt=ne.current)==null||Pt.blur(),Or({edges:[vn.find(ls=>ls.id===n)]})):xr([n])}};return V("g",{className:Ke(["react-flow__edge",`react-flow__edge-${o}`,r,{selected:a,animated:u,inactive:is,updating:he}]),onClick:ze,onDoubleClick:ut,onContextMenu:To,onMouseEnter:ns,onMouseMove:rs,onMouseLeave:os,onKeyDown:X?Ao:void 0,tabIndex:X?0:void 0,role:X?"button":void 0,"data-testid":`rf__edge-${n}`,"aria-label":K===null?void 0:K||`Edge from ${d} to ${g}`,"aria-describedby":X?`${hv}-${Q}`:void 0,ref:ne,children:[!Pe&&_(e,{id:n,source:d,target:g,selected:a,animated:u,label:c,labelStyle:f,labelShowBg:p,labelBgStyle:h,labelBgPadding:v,labelBgBorderRadius:m,data:i,style:E,sourceX:y,sourceY:S,targetX:w,targetY:N,sourcePosition:T,targetPosition:b,sourceHandleId:B,targetHandleId:F,markerStart:at,markerEnd:Y,pathOptions:q,interactionWidth:J}),ss&&V(Ae,{children:[_(mv,{position:T,centerX:y,centerY:S,radius:C,onMouseDown:Io,onMouseEnter:Co,onMouseOut:mn,type:"source"}),_(mv,{position:b,centerX:w,centerY:N,radius:C,onMouseDown:er,onMouseEnter:Co,onMouseOut:mn,type:"target"})]})]})};return t.displayName="EdgeWrapper",O.memo(t)};function RO(e){const t={default:vo(e.default||Ql),straight:vo(e.bezier||cf),step:vo(e.step||uf),smoothstep:vo(e.step||Yl),simplebezier:vo(e.simplebezier||af)},n={},r=Object.keys(e).filter(o=>!["default","bezier"].includes(o)).reduce((o,i)=>(o[i]=vo(e[i]||Ql),o),n);return{...t,...r}}function vv(e,t,n=null){const r=((n==null?void 0:n.x)||0)+t.x,o=((n==null?void 0:n.y)||0)+t.y,i=(n==null?void 0:n.width)||t.width,s=(n==null?void 0:n.height)||t.height;switch(e){case G.Top:return{x:r+i/2,y:o};case G.Right:return{x:r+i,y:o+s/2};case G.Bottom:return{x:r+i/2,y:o+s};case G.Left:return{x:r,y:o+s/2}}}function yv(e,t){return e?t?e.find(n=>n.id===t):e.length===1?e[0]:null:null}const NO=(e,t,n,r,o,i)=>{const s=vv(n,e,t),l=vv(i,r,o);return{sourceX:s.x,sourceY:s.y,targetX:l.x,targetY:l.y}};function OO({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:r,targetWidth:o,targetHeight:i,width:s,height:l,transform:a}){const u={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+o),y2:Math.max(e.y+r,t.y+i)};u.x===u.x2&&(u.x2+=1),u.y===u.y2&&(u.y2+=1);const c=Pm({x:(0-a[0])/a[2],y:(0-a[1])/a[2],width:s/a[2],height:l/a[2]}),f=Math.max(0,Math.min(c.x2,u.x2)-Math.max(c.x,u.x)),p=Math.max(0,Math.min(c.y2,u.y2)-Math.max(c.y,u.y));return Math.ceil(f*p)>0}function Ev(e){var r,o,i,s,l;const t=((r=e==null?void 0:e[_e])==null?void 0:r.handleBounds)||null,n=t&&(e==null?void 0:e.width)&&(e==null?void 0:e.height)&&typeof((o=e==null?void 0:e.positionAbsolute)==null?void 0:o.x)<"u"&&typeof((i=e==null?void 0:e.positionAbsolute)==null?void 0:i.y)<"u";return[{x:((s=e==null?void 0:e.positionAbsolute)==null?void 0:s.x)||0,y:((l=e==null?void 0:e.positionAbsolute)==null?void 0:l.y)||0,width:(e==null?void 0:e.width)||0,height:(e==null?void 0:e.height)||0},t,!!n]}function Sv(e,t){if(!e.parentNode)return!1;const n=t.get(e.parentNode);return n?n.selected?!0:Sv(n,t):!1}function _v(e,t,n){let r=e;do{if(r!=null&&r.matches(t))return!0;if(r===n.current)return!1;r=r.parentElement}while(r);return!1}function xO(e,t,n,r){return Array.from(e.values()).filter(o=>(o.selected||o.id===r)&&(!o.parentNode||!Sv(o,e))&&(o.draggable||t&&typeof o.draggable>"u")).map(o=>{var i,s;return{id:o.id,position:o.position||{x:0,y:0},positionAbsolute:o.positionAbsolute||{x:0,y:0},distance:{x:n.x-(((i=o.positionAbsolute)==null?void 0:i.x)??0),y:n.y-(((s=o.positionAbsolute)==null?void 0:s.y)??0)},delta:{x:0,y:0},extent:o.extent,parentNode:o.parentNode,width:o.width,height:o.height}})}function wv(e,t,n,r,o=[0,0],i){let s=e.extent||r;if(e.extent==="parent")if(e.parentNode&&e.width&&e.height){const u=n.get(e.parentNode),{x:c,y:f}=ho(u,o).positionAbsolute;s=u&&mt(c)&&mt(f)&&mt(u.width)&&mt(u.height)?[[c+e.width*o[0],f+e.height*o[1]],[c+u.width-e.width+e.width*o[0],f+u.height-e.height+e.height*o[1]]]:s}else i==null||i("005",dn["005"]()),s=r;else if(e.extent&&e.parentNode){const u=n.get(e.parentNode),{x:c,y:f}=ho(u,o).positionAbsolute;s=[[e.extent[0][0]+c,e.extent[0][1]+f],[e.extent[1][0]+c,e.extent[1][1]+f]]}let l={x:0,y:0};if(e.parentNode){const u=n.get(e.parentNode);l=ho(u,o).positionAbsolute}const a=s?of(t,s):t;return{position:{x:a.x-l.x,y:a.y-l.y},positionAbsolute:a}}function mf({nodeId:e,dragItems:t,nodeInternals:n}){const r=t.map(o=>({...n.get(o.id),position:o.position,positionAbsolute:o.positionAbsolute}));return[e?r.find(o=>o.id===e):r[0],r]}const Rv=(e,t,n,r)=>{const o=t.querySelectorAll(e);if(!o||!o.length)return null;const i=Array.from(o),s=t.getBoundingClientRect(),l={x:s.width*r[0],y:s.height*r[1]};return i.map(a=>{const u=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),position:a.getAttribute("data-handlepos"),x:(u.left-s.left-l.x)/n,y:(u.top-s.top-l.y)/n,...rf(a)}})};function Vi(e,t,n){return n===void 0?n:r=>{const o=t().nodeInternals.get(e);n(r,{...o})}}function vf({id:e,store:t,unselect:n=!1}){const{addSelectedNodes:r,unselectNodesAndEdges:o,multiSelectionActive:i,nodeInternals:s}=t.getState(),l=s.get(e);t.setState({nodesSelectionActive:!1}),l.selected?(n||l.selected&&i)&&o({nodes:[l]}):r([e])}function TO(){const e=Ce();return O.useCallback(({sourceEvent:n})=>{const{transform:r,snapGrid:o,snapToGrid:i}=e.getState(),s=n.touches?n.touches[0].clientX:n.clientX,l=n.touches?n.touches[0].clientY:n.clientY,a={x:(s-r[0])/r[2],y:(l-r[1])/r[2]};return{xSnapped:i?o[0]*Math.round(a.x/o[0]):a.x,ySnapped:i?o[1]*Math.round(a.y/o[1]):a.y,...a}},[])}function yf(e){return(t,n,r)=>e==null?void 0:e(t,r)}function Nv({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:o,isSelectable:i,selectNodesOnDrag:s}){const l=Ce(),[a,u]=O.useState(!1),c=O.useRef([]),f=O.useRef({x:null,y:null}),p=O.useRef(0),h=O.useRef(null),v=O.useRef({x:0,y:0}),m=O.useRef(null),E=O.useRef(!1),d=TO();return O.useEffect(()=>{if(e!=null&&e.current){const g=It(e.current),y=({x:w,y:N})=>{const{nodeInternals:T,onNodeDrag:b,onSelectionDrag:D,updateNodePositions:k,nodeExtent:B,snapGrid:F,snapToGrid:z,nodeOrigin:R,onError:P}=l.getState();f.current={x:w,y:N};let A=!1;if(c.current=c.current.map(x=>{const L={x:w-x.distance.x,y:N-x.distance.y};z&&(L.x=F[0]*Math.round(L.x/F[0]),L.y=F[1]*Math.round(L.y/F[1]));const U=wv(x,L,T,B,R,P);return A=A||x.position.x!==U.position.x||x.position.y!==U.position.y,x.position=U.position,x.positionAbsolute=U.positionAbsolute,x}),!A)return;k(c.current,!0,!0),u(!0);const C=o?b:yf(D);if(C&&m.current){const[x,L]=mf({nodeId:o,dragItems:c.current,nodeInternals:T});C(m.current,x,L)}},S=()=>{if(!h.current)return;const[w,N]=Dm(v.current,h.current);if(w!==0||N!==0){const{transform:T,panBy:b}=l.getState();f.current.x=(f.current.x??0)-w/T[2],f.current.y=(f.current.y??0)-N/T[2],y(f.current),b({x:w,y:N})}p.current=requestAnimationFrame(S)};if(t)g.on(".drag",null);else{const w=K1().on("start",N=>{var A;const{nodeInternals:T,multiSelectionActive:b,domNode:D,nodesDraggable:k,unselectNodesAndEdges:B,onNodeDragStart:F,onSelectionDragStart:z}=l.getState(),R=o?F:yf(z);!s&&!b&&o&&((A=T.get(o))!=null&&A.selected||B()),o&&i&&s&&vf({id:o,store:l});const P=d(N);if(f.current=P,c.current=xO(T,k,P,o),R&&c.current){const[C,x]=mf({nodeId:o,dragItems:c.current,nodeInternals:T});R(N.sourceEvent,C,x)}h.current=(D==null?void 0:D.getBoundingClientRect())||null,v.current=Bn(N.sourceEvent,h.current)}).on("drag",N=>{const T=d(N),{autoPanOnNodeDrag:b}=l.getState();!E.current&&b&&(E.current=!0,S()),(f.current.x!==T.xSnapped||f.current.y!==T.ySnapped)&&c.current&&(m.current=N.sourceEvent,v.current=Bn(N.sourceEvent,h.current),y(T))}).on("end",N=>{if(u(!1),E.current=!1,cancelAnimationFrame(p.current),c.current){const{updateNodePositions:T,nodeInternals:b,onNodeDragStop:D,onSelectionDragStop:k}=l.getState(),B=o?D:yf(k);if(T(c.current,!1,!1),B){const[F,z]=mf({nodeId:o,dragItems:c.current,nodeInternals:b});B(N.sourceEvent,F,z)}}}).filter(N=>{const T=N.target;return!N.button&&(!n||!_v(T,`.${n}`,e))&&(!r||_v(T,r,e))});return g.call(w),()=>{g.on(".drag",null)}}}},[e,t,n,r,i,l,o,s,d]),a}function Ov(){const e=Ce();return O.useCallback(n=>{const{nodeInternals:r,nodeExtent:o,updateNodePositions:i,getNodes:s,snapToGrid:l,snapGrid:a,onError:u,nodesDraggable:c}=e.getState(),f=s().filter(g=>g.selected&&(g.draggable||c&&typeof g.draggable>"u")),p=l?a[0]:5,h=l?a[1]:5,v=n.isShiftPressed?4:1,m=n.x*p*v,E=n.y*h*v,d=f.map(g=>{if(g.positionAbsolute){const y={x:g.positionAbsolute.x+m,y:g.positionAbsolute.y+E};l&&(y.x=a[0]*Math.round(y.x/a[0]),y.y=a[1]*Math.round(y.y/a[1]));const{positionAbsolute:S,position:w}=wv(g,y,r,o,void 0,u);g.position=w,g.positionAbsolute=S}return g});i(d,!0,!1)},[])}const yo={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var Bi=e=>{const t=({id:n,type:r,data:o,xPos:i,yPos:s,xPosOrigin:l,yPosOrigin:a,selected:u,onClick:c,onMouseEnter:f,onMouseMove:p,onMouseLeave:h,onContextMenu:v,onDoubleClick:m,style:E,className:d,isDraggable:g,isSelectable:y,isConnectable:S,isFocusable:w,selectNodesOnDrag:N,sourcePosition:T,targetPosition:b,hidden:D,resizeObserver:k,dragHandle:B,zIndex:F,isParent:z,noDragClassName:R,noPanClassName:P,initialized:A,disableKeyboardA11y:C,ariaLabel:x,rfId:L})=>{const U=Ce(),$=O.useRef(null),j=O.useRef(T),Q=O.useRef(b),K=O.useRef(r),X=y||g||c||f||p||h,q=Ov(),J=Vi(n,U.getState,f),ne=Vi(n,U.getState,p),he=Vi(n,U.getState,h),ie=Vi(n,U.getState,v),Pe=Vi(n,U.getState,m),Ze=Y=>{if(y&&(!N||!g)&&vf({id:n,store:U}),c){const ze=U.getState().nodeInternals.get(n);c(Y,{...ze})}},ge=Y=>{var ze;if(!lf(Y))if(Um.includes(Y.key)&&y){const ut=Y.key==="Escape";ut&&((ze=$.current)==null||ze.blur()),vf({id:n,store:U,unselect:ut})}else!C&&g&&u&&Object.prototype.hasOwnProperty.call(yo,Y.key)&&(U.setState({ariaLiveMessage:`Moved selected node ${Y.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~i}, y: ${~~s}`}),q({x:yo[Y.key].x,y:yo[Y.key].y,isShiftPressed:Y.shiftKey}))};O.useEffect(()=>{if($.current&&!D){const Y=$.current;return k==null||k.observe(Y),()=>k==null?void 0:k.unobserve(Y)}},[D]),O.useEffect(()=>{const Y=K.current!==r,ze=j.current!==T,ut=Q.current!==b;$.current&&(Y||ze||ut)&&(Y&&(K.current=r),ze&&(j.current=T),ut&&(Q.current=b),U.getState().updateNodeDimensions([{id:n,nodeElement:$.current,forceUpdate:!0}]))},[n,r,T,b]);const at=Nv({nodeRef:$,disabled:D||!g,noDragClassName:R,handleSelector:B,nodeId:n,isSelectable:y,selectNodesOnDrag:N});return D?null:_("div",{className:Ke(["react-flow__node",`react-flow__node-${r}`,{[P]:g},d,{selected:u,selectable:y,parent:z,dragging:at}]),ref:$,style:{zIndex:F,transform:`translate(${l}px,${a}px)`,pointerEvents:X?"all":"none",visibility:A?"visible":"hidden",...E},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:J,onMouseMove:ne,onMouseLeave:he,onContextMenu:ie,onClick:Ze,onDoubleClick:Pe,onKeyDown:w?ge:void 0,tabIndex:w?0:void 0,role:w?"button":void 0,"aria-describedby":C?void 0:`${pv}-${L}`,"aria-label":x,children:_(ZN,{value:n,children:_(e,{id:n,data:o,type:r,xPos:i,yPos:s,selected:u,isConnectable:S,sourcePosition:T,targetPosition:b,dragging:at,dragHandle:B,zIndex:F})})})};return t.displayName="NodeWrapper",O.memo(t)};function IO(e){const t={input:Bi(e.input||av),default:Bi(e.default||hf),output:Bi(e.output||cv),group:Bi(e.group||gf)},n={},r=Object.keys(e).filter(o=>!["input","default","output","group"].includes(o)).reduce((o,i)=>(o[i]=Bi(e[i]||hf),o),n);return{...t,...r}}const CO=({x:e,y:t,width:n,height:r,origin:o})=>!n||!r?{x:e,y:t}:o[0]<0||o[1]<0||o[0]>1||o[1]>1?{x:e,y:t}:{x:e-n*o[0],y:t-r*o[1]},AO=typeof document<"u"?document:null;var $i=(e=null,t={target:AO})=>{const[n,r]=O.useState(!1),o=O.useRef(new Set([])),[i,s]=O.useMemo(()=>{if(e!==null){const a=(Array.isArray(e)?e:[e]).filter(c=>typeof c=="string").map(c=>c.split("+")),u=a.reduce((c,f)=>c.concat(...f),[]);return[a,u]}return[[],[]]},[e]);return O.useEffect(()=>{var l,a;if(e!==null){const u=p=>{if(lf(p))return!1;const h=Tv(p.code,s);o.current.add(p[h]),xv(i,o.current,!1)&&(p.preventDefault(),r(!0))},c=p=>{if(lf(p))return!1;const h=Tv(p.code,s);xv(i,o.current,!0)?(r(!1),o.current.clear()):o.current.delete(p[h])},f=()=>{o.current.clear(),r(!1)};return(l=t==null?void 0:t.target)==null||l.addEventListener("keydown",u),(a=t==null?void 0:t.target)==null||a.addEventListener("keyup",c),window.addEventListener("blur",f),()=>{var p,h;(p=t==null?void 0:t.target)==null||p.removeEventListener("keydown",u),(h=t==null?void 0:t.target)==null||h.removeEventListener("keyup",c),window.removeEventListener("blur",f)}}},[e,r]),n};function xv(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(o=>t.has(o)))}function Tv(e,t){return t.includes(e)?"code":"key"}function Iv(e,t,n,r){var s,l;if(!e.parentNode)return n;const o=t.get(e.parentNode),i=ho(o,r);return Iv(o,t,{x:(n.x??0)+i.x,y:(n.y??0)+i.y,z:(((s=o[_e])==null?void 0:s.z)??0)>(n.z??0)?((l=o[_e])==null?void 0:l.z)??0:n.z??0},r)}function Cv(e,t,n){e.forEach(r=>{var o;if(r.parentNode&&!e.has(r.parentNode))throw new Error(`Parent node ${r.parentNode} not found`);if(r.parentNode||n!=null&&n[r.id]){const{x:i,y:s,z:l}=Iv(r,e,{...r.position,z:((o=r[_e])==null?void 0:o.z)??0},t);r.positionAbsolute={x:i,y:s},r[_e].z=l,n!=null&&n[r.id]&&(r[_e].isParent=!0)}})}function Ef(e,t,n,r){const o=new Map,i={},s=r?1e3:0;return e.forEach(l=>{var f;const a=(mt(l.zIndex)?l.zIndex:0)+(l.selected?s:0),u=t.get(l.id),c={width:u==null?void 0:u.width,height:u==null?void 0:u.height,...l,positionAbsolute:{x:l.position.x,y:l.position.y}};l.parentNode&&(c.parentNode=l.parentNode,i[l.parentNode]=!0),Object.defineProperty(c,_e,{enumerable:!1,value:{handleBounds:(f=u==null?void 0:u[_e])==null?void 0:f.handleBounds,z:a}}),o.set(l.id,c)}),Cv(o,n,i),o}function Av(e,t={}){const{getNodes:n,width:r,height:o,minZoom:i,maxZoom:s,d3Zoom:l,d3Selection:a,fitViewOnInitDone:u,fitViewOnInit:c,nodeOrigin:f}=e(),p=t.initial&&!u&&c;if(l&&a&&(p||!t.initial)){const v=n().filter(E=>{var g;const d=t.includeHiddenNodes?E.width&&E.height:!E.hidden;return(g=t.nodes)!=null&&g.length?d&&t.nodes.some(y=>y.id===E.id):d}),m=v.every(E=>E.width&&E.height);if(v.length>0&&m){const E=qm(v,f),[d,g,y]=ev(E,r,o,t.minZoom??i,t.maxZoom??s,t.padding??.1),S=Vn.translate(d,g).scale(y);return typeof t.duration=="number"&&t.duration>0?l.transform(yr(a,t.duration),S):l.transform(a,S),!0}}return!1}function bO(e,t){return e.forEach(n=>{const r=t.get(n.id);r&&t.set(r.id,{...r,[_e]:r[_e],selected:n.selected})}),new Map(t)}function LO(e,t){return t.map(n=>{const r=e.find(o=>o.id===n.id);return r&&(n.selected=r.selected),n})}function ql({changedNodes:e,changedEdges:t,get:n,set:r}){const{nodeInternals:o,edges:i,onNodesChange:s,onEdgesChange:l,hasDefaultNodes:a,hasDefaultEdges:u}=n();e!=null&&e.length&&(a&&r({nodeInternals:bO(e,o)}),s==null||s(e)),t!=null&&t.length&&(u&&r({edges:LO(t,i)}),l==null||l(t))}const Eo=()=>{},DO={zoomIn:Eo,zoomOut:Eo,zoomTo:Eo,getZoom:()=>1,setViewport:Eo,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:Eo,fitBounds:Eo,project:e=>e,viewportInitialized:!1},kO=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection}),PO=()=>{const e=Ce(),{d3Zoom:t,d3Selection:n}=de(kO,Qe);return O.useMemo(()=>n&&t?{zoomIn:o=>t.scaleBy(yr(n,o==null?void 0:o.duration),1.2),zoomOut:o=>t.scaleBy(yr(n,o==null?void 0:o.duration),1/1.2),zoomTo:(o,i)=>t.scaleTo(yr(n,i==null?void 0:i.duration),o),getZoom:()=>e.getState().transform[2],setViewport:(o,i)=>{const[s,l,a]=e.getState().transform,u=Vn.translate(o.x??s,o.y??l).scale(o.zoom??a);t.transform(yr(n,i==null?void 0:i.duration),u)},getViewport:()=>{const[o,i,s]=e.getState().transform;return{x:o,y:i,zoom:s}},fitView:o=>Av(e.getState,o),setCenter:(o,i,s)=>{const{width:l,height:a,maxZoom:u}=e.getState(),c=typeof(s==null?void 0:s.zoom)<"u"?s.zoom:u,f=l/2-o*c,p=a/2-i*c,h=Vn.translate(f,p).scale(c);t.transform(yr(n,s==null?void 0:s.duration),h)},fitBounds:(o,i)=>{const{width:s,height:l,minZoom:a,maxZoom:u}=e.getState(),[c,f,p]=ev(o,s,l,a,u,(i==null?void 0:i.padding)??.1),h=Vn.translate(c,f).scale(p);t.transform(yr(n,i==null?void 0:i.duration),h)},project:o=>{const{transform:i,snapToGrid:s,snapGrid:l}=e.getState();return Xm(o,i,s,l)},viewportInitialized:!0}:DO,[t,n])};function Sf(){const e=PO(),t=Ce(),n=O.useCallback(()=>t.getState().getNodes().map(m=>({...m})),[]),r=O.useCallback(m=>t.getState().nodeInternals.get(m),[]),o=O.useCallback(()=>{const{edges:m=[]}=t.getState();return m.map(E=>({...E}))},[]),i=O.useCallback(m=>{const{edges:E=[]}=t.getState();return E.find(d=>d.id===m)},[]),s=O.useCallback(m=>{const{getNodes:E,setNodes:d,hasDefaultNodes:g,onNodesChange:y}=t.getState(),S=E(),w=typeof m=="function"?m(S):m;if(g)d(w);else if(y){const N=w.length===0?S.map(T=>({type:"remove",id:T.id})):w.map(T=>({item:T,type:"reset"}));y(N)}},[]),l=O.useCallback(m=>{const{edges:E=[],setEdges:d,hasDefaultEdges:g,onEdgesChange:y}=t.getState(),S=typeof m=="function"?m(E):m;if(g)d(S);else if(y){const w=S.length===0?E.map(N=>({type:"remove",id:N.id})):S.map(N=>({item:N,type:"reset"}));y(w)}},[]),a=O.useCallback(m=>{const E=Array.isArray(m)?m:[m],{getNodes:d,setNodes:g,hasDefaultNodes:y,onNodesChange:S}=t.getState();if(y){const N=[...d(),...E];g(N)}else if(S){const w=E.map(N=>({item:N,type:"add"}));S(w)}},[]),u=O.useCallback(m=>{const E=Array.isArray(m)?m:[m],{edges:d=[],setEdges:g,hasDefaultEdges:y,onEdgesChange:S}=t.getState();if(y)g([...d,...E]);else if(S){const w=E.map(N=>({item:N,type:"add"}));S(w)}},[]),c=O.useCallback(()=>{const{getNodes:m,edges:E=[],transform:d}=t.getState(),[g,y,S]=d;return{nodes:m().map(w=>({...w})),edges:E.map(w=>({...w})),viewport:{x:g,y,zoom:S}}},[]),f=O.useCallback(({nodes:m,edges:E})=>{const{nodeInternals:d,getNodes:g,edges:y,hasDefaultNodes:S,hasDefaultEdges:w,onNodesDelete:N,onEdgesDelete:T,onNodesChange:b,onEdgesChange:D}=t.getState(),k=(m||[]).map(P=>P.id),B=(E||[]).map(P=>P.id),F=g().reduce((P,A)=>{const C=!k.includes(A.id)&&A.parentNode&&P.find(L=>L.id===A.parentNode);return(typeof A.deletable=="boolean"?A.deletable:!0)&&(k.includes(A.id)||C)&&P.push(A),P},[]),z=y.filter(P=>typeof P.deletable=="boolean"?P.deletable:!0),R=z.filter(P=>B.includes(P.id));if(F||R){const P=Jm(F,z),A=[...R,...P],C=A.reduce((x,L)=>(x.includes(L.id)||x.push(L.id),x),[]);if((w||S)&&(w&&t.setState({edges:y.filter(x=>!C.includes(x.id))}),S&&(F.forEach(x=>{d.delete(x.id)}),t.setState({nodeInternals:new Map(d)}))),C.length>0&&(T==null||T(A),D&&D(C.map(x=>({id:x,type:"remove"})))),F.length>0&&(N==null||N(F),b)){const x=F.map(L=>({id:L.id,type:"remove"}));b(x)}}},[]),p=O.useCallback(m=>{const E=GN(m),d=E?null:t.getState().nodeInternals.get(m.id);return[E?m:Mm(d),d,E]},[]),h=O.useCallback((m,E=!0,d)=>{const[g,y,S]=p(m);return g?(d||t.getState().getNodes()).filter(w=>{if(!S&&(w.id===y.id||!w.positionAbsolute))return!1;const N=Mm(w),T=sf(N,g);return E&&T>0||T>=m.width*m.height}):[]},[]),v=O.useCallback((m,E,d=!0)=>{const[g]=p(m);if(!g)return!1;const y=sf(g,E);return d&&y>0||y>=m.width*m.height},[]);return O.useMemo(()=>({...e,getNodes:n,getNode:r,getEdges:o,getEdge:i,setNodes:s,setEdges:l,addNodes:a,addEdges:u,toObject:c,deleteElements:f,getIntersectingNodes:h,isNodeIntersecting:v}),[e,n,r,o,i,s,l,a,u,c,f,h,v])}var MO=({deleteKeyCode:e,multiSelectionKeyCode:t})=>{const n=Ce(),{deleteElements:r}=Sf(),o=$i(e),i=$i(t);O.useEffect(()=>{if(o){const{edges:s,getNodes:l}=n.getState(),a=l().filter(c=>c.selected),u=s.filter(c=>c.selected);r({nodes:a,edges:u}),n.setState({nodesSelectionActive:!1})}},[o]),O.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])};function UO(e){const t=Ce();O.useEffect(()=>{let n;const r=()=>{var i,s;if(!e.current)return;const o=rf(e.current);(o.height===0||o.width===0)&&((s=(i=t.getState()).onError)==null||s.call(i,"004",dn["004"]())),t.setState({width:o.width||500,height:o.height||500})};return r(),window.addEventListener("resize",r),e.current&&(n=new ResizeObserver(()=>r()),n.observe(e.current)),()=>{window.removeEventListener("resize",r),n&&e.current&&n.unobserve(e.current)}},[])}const _f={position:"absolute",width:"100%",height:"100%",top:0,left:0},FO=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,wf=e=>({x:e.x,y:e.y,zoom:e.k}),So=(e,t)=>e.target.closest(`.${t}`),bv=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),VO=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),BO=({onMove:e,onMoveStart:t,onMoveEnd:n,onPaneContextMenu:r,zoomOnScroll:o=!0,zoomOnPinch:i=!0,panOnScroll:s=!1,panOnScrollSpeed:l=.5,panOnScrollMode:a=po.Free,zoomOnDoubleClick:u=!0,elementsSelectable:c,panOnDrag:f=!0,defaultViewport:p,translateExtent:h,minZoom:v,maxZoom:m,zoomActivationKeyCode:E,preventScrolling:d=!0,children:g,noWheelClassName:y,noPanClassName:S})=>{const w=O.useRef(),N=Ce(),T=O.useRef(!1),b=O.useRef(!1),D=O.useRef(null),k=O.useRef({x:0,y:0,zoom:0}),{d3Zoom:B,d3Selection:F,d3ZoomHandler:z,userSelectionActive:R}=de(VO,Qe),P=$i(E),A=O.useRef(0);return UO(D),O.useEffect(()=>{if(D.current){const C=D.current.getBoundingClientRect(),x=FN().scaleExtent([v,m]).translateExtent(h),L=It(D.current).call(x),U=Vn.translate(p.x,p.y).scale(co(p.zoom,v,m)),$=[[0,0],[C.width,C.height]],j=x.constrain()(U,$,h);x.transform(L,j),N.setState({d3Zoom:x,d3Selection:L,d3ZoomHandler:L.on("wheel.zoom"),transform:[j.x,j.y,j.k],domNode:D.current.closest(".react-flow")})}},[]),O.useEffect(()=>{F&&B&&(s&&!P&&!R?F.on("wheel.zoom",C=>{if(So(C,y))return!1;C.preventDefault(),C.stopImmediatePropagation();const x=F.property("__zoom").k||1;if(C.ctrlKey&&i){const j=zt(C),Q=-C.deltaY*(C.deltaMode===1?.05:C.deltaMode?1:.002)*10,K=x*Math.pow(2,Q);B.scaleTo(F,K,j);return}const L=C.deltaMode===1?20:1,U=a===po.Vertical?0:C.deltaX*L,$=a===po.Horizontal?0:C.deltaY*L;B.translateBy(F,-(U/x)*l,-($/x)*l)}):typeof z<"u"&&F.on("wheel.zoom",function(C,x){if(!d||So(C,y))return null;C.preventDefault(),z.call(this,C,x)}))},[R,s,a,F,B,z,P,i,d,y]),O.useEffect(()=>{B&&B.on("start",C=>{var L;if(!C.sourceEvent)return null;A.current=C.sourceEvent.button;const{onViewportChangeStart:x}=N.getState();if(T.current=!0,((L=C.sourceEvent)==null?void 0:L.type)==="mousedown"&&N.setState({paneDragging:!0}),t||x){const U=wf(C.transform);k.current=U,x==null||x(U),t==null||t(C.sourceEvent,U)}})},[B,t]),O.useEffect(()=>{B&&(R&&!T.current?B.on("zoom",null):R||B.on("zoom",C=>{const{onViewportChange:x}=N.getState();if(N.setState({transform:[C.transform.x,C.transform.y,C.transform.k]}),b.current=!!(r&&bv(f,A.current??0)),e||x){const L=wf(C.transform);x==null||x(L),e==null||e(C.sourceEvent,L)}}))},[R,B,e,f,r]),O.useEffect(()=>{B&&B.on("end",C=>{if(!C.sourceEvent)return null;const{onViewportChangeEnd:x}=N.getState();if(T.current=!1,N.setState({paneDragging:!1}),r&&bv(f,A.current??0)&&!b.current&&r(C.sourceEvent),b.current=!1,(n||x)&&FO(k.current,C.transform)){const L=wf(C.transform);k.current=L,clearTimeout(w.current),w.current=setTimeout(()=>{x==null||x(L),n==null||n(C.sourceEvent,L)},s?150:0)}})},[B,s,f,n,r]),O.useEffect(()=>{B&&B.filter(C=>{const x=P||o,L=i&&C.ctrlKey;if(C.button===1&&C.type==="mousedown"&&(So(C,"react-flow__node")||So(C,"react-flow__edge")))return!0;if(!f&&!x&&!s&&!u&&!i||R||!u&&C.type==="dblclick"||So(C,y)&&C.type==="wheel"||So(C,S)&&C.type!=="wheel"||!i&&C.ctrlKey&&C.type==="wheel"||!x&&!s&&!L&&C.type==="wheel"||!f&&(C.type==="mousedown"||C.type==="touchstart")||Array.isArray(f)&&!f.includes(C.button)&&(C.type==="mousedown"||C.type==="touchstart"))return!1;const U=Array.isArray(f)&&f.includes(C.button)||!C.button||C.button<=1;return(!C.ctrlKey||C.type==="wheel")&&U})},[R,B,o,i,s,u,f,c,P]),_("div",{className:"react-flow__renderer",ref:D,style:_f,children:g})},$O=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function zO(){const{userSelectionActive:e,userSelectionRect:t}=de($O,Qe);return e&&t?_("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}function Lv(e,t){const n=e.find(r=>r.id===t.parentNode);if(n){const r=t.position.x+t.width-n.width,o=t.position.y+t.height-n.height;if(r>0||o>0||t.position.x<0||t.position.y<0){if(n.style={...n.style},n.style.width=n.style.width??n.width,n.style.height=n.style.height??n.height,r>0&&(n.style.width+=r),o>0&&(n.style.height+=o),t.position.x<0){const i=Math.abs(t.position.x);n.position.x=n.position.x-i,n.style.width+=i,t.position.x=0}if(t.position.y<0){const i=Math.abs(t.position.y);n.position.y=n.position.y-i,n.style.height+=i,t.position.y=0}n.width=n.style.width,n.height=n.style.height}}}function Dv(e,t){if(e.some(r=>r.type==="reset"))return e.filter(r=>r.type==="reset").map(r=>r.item);const n=e.filter(r=>r.type==="add").map(r=>r.item);return t.reduce((r,o)=>{const i=e.filter(l=>l.id===o.id);if(i.length===0)return r.push(o),r;const s={...o};for(const l of i)if(l)switch(l.type){case"select":{s.selected=l.selected;break}case"position":{typeof l.position<"u"&&(s.position=l.position),typeof l.positionAbsolute<"u"&&(s.positionAbsolute=l.positionAbsolute),typeof l.dragging<"u"&&(s.dragging=l.dragging),s.expandParent&&Lv(r,s);break}case"dimensions":{typeof l.dimensions<"u"&&(s.width=l.dimensions.width,s.height=l.dimensions.height),typeof l.updateStyle<"u"&&(s.style={...s.style||{},...l.dimensions}),typeof l.resizing=="boolean"&&(s.resizing=l.resizing),s.expandParent&&Lv(r,s);break}case"remove":return r}return r.push(s),r},n)}function kv(e,t){return Dv(e,t)}function HO(e,t){return Dv(e,t)}const Hn=(e,t)=>({id:e,type:"select",selected:t});function _o(e,t){return e.reduce((n,r)=>{const o=t.includes(r.id);return!r.selected&&o?(r.selected=!0,n.push(Hn(r.id,!0))):r.selected&&!o&&(r.selected=!1,n.push(Hn(r.id,!1))),n},[])}const Rf=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},jO=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),Pv=O.memo(({isSelecting:e,selectionMode:t=Mi.Full,panOnDrag:n,onSelectionStart:r,onSelectionEnd:o,onPaneClick:i,onPaneContextMenu:s,onPaneScroll:l,onPaneMouseEnter:a,onPaneMouseMove:u,onPaneMouseLeave:c,children:f})=>{const p=O.useRef(null),h=Ce(),v=O.useRef(0),m=O.useRef(0),E=O.useRef(),{userSelectionActive:d,elementsSelectable:g,dragging:y}=de(jO,Qe),S=()=>{h.setState({userSelectionActive:!1,userSelectionRect:null}),v.current=0,m.current=0},w=z=>{i==null||i(z),h.getState().resetSelectedElements(),h.setState({nodesSelectionActive:!1})},N=z=>{if(Array.isArray(n)&&(n!=null&&n.includes(2))){z.preventDefault();return}s==null||s(z)},T=l?z=>l(z):void 0,b=z=>{const{resetSelectedElements:R,domNode:P}=h.getState();if(E.current=P==null?void 0:P.getBoundingClientRect(),!g||!e||z.button!==0||z.target!==p.current||!E.current)return;const{x:A,y:C}=Bn(z,E.current);R(),h.setState({userSelectionRect:{width:0,height:0,startX:A,startY:C,x:A,y:C}}),r==null||r(z)},D=z=>{const{userSelectionRect:R,nodeInternals:P,edges:A,transform:C,onNodesChange:x,onEdgesChange:L,nodeOrigin:U,getNodes:$}=h.getState();if(!e||!E.current||!R)return;h.setState({userSelectionActive:!0,nodesSelectionActive:!1});const j=Bn(z,E.current),Q=R.startX??0,K=R.startY??0,X={...R,x:j.x<Q?j.x:Q,y:j.y<K?j.y:K,width:Math.abs(j.x-Q),height:Math.abs(j.y-K)},q=$(),J=Zm(P,X,C,t===Mi.Partial,!0,U),ne=Jm(J,A).map(ie=>ie.id),he=J.map(ie=>ie.id);if(v.current!==he.length){v.current=he.length;const ie=_o(q,he);ie.length&&(x==null||x(ie))}if(m.current!==ne.length){m.current=ne.length;const ie=_o(A,ne);ie.length&&(L==null||L(ie))}h.setState({userSelectionRect:X})},k=z=>{if(z.button!==0)return;const{userSelectionRect:R}=h.getState();!d&&R&&z.target===p.current&&(w==null||w(z)),h.setState({nodesSelectionActive:v.current>0}),S(),o==null||o(z)},B=z=>{d&&(h.setState({nodesSelectionActive:v.current>0}),o==null||o(z)),S()},F=g&&(e||d);return V("div",{className:Ke(["react-flow__pane",{dragging:y,selection:e}]),onClick:F?void 0:Rf(w,p),onContextMenu:Rf(N,p),onWheel:Rf(T,p),onMouseEnter:F?void 0:a,onMouseDown:F?b:void 0,onMouseMove:F?D:u,onMouseUp:F?k:void 0,onMouseLeave:F?B:c,ref:p,style:_f,children:[f,_(zO,{})]})});Pv.displayName="Pane";const WO=e=>{const t=e.getNodes().filter(n=>n.selected);return{...qm(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};function GO({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=Ce(),{width:o,height:i,x:s,y:l,transformString:a,userSelectionActive:u}=de(WO,Qe),c=Ov(),f=O.useRef(null);if(O.useEffect(()=>{var v;n||(v=f.current)==null||v.focus({preventScroll:!0})},[n]),Nv({nodeRef:f}),u||!o||!i)return null;const p=e?v=>{const m=r.getState().getNodes().filter(E=>E.selected);e(v,m)}:void 0,h=v=>{Object.prototype.hasOwnProperty.call(yo,v.key)&&c({x:yo[v.key].x,y:yo[v.key].y,isShiftPressed:v.shiftKey})};return _("div",{className:Ke(["react-flow__nodesselection","react-flow__container",t]),style:{transform:a},children:_("div",{ref:f,className:"react-flow__nodesselection-rect",onContextMenu:p,tabIndex:n?void 0:-1,onKeyDown:n?void 0:h,style:{width:o,height:i,top:l,left:s}})})}var YO=O.memo(GO);const KO=e=>e.nodesSelectionActive,Mv=({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:s,deleteKeyCode:l,onMove:a,onMoveStart:u,onMoveEnd:c,selectionKeyCode:f,selectionOnDrag:p,selectionMode:h,onSelectionStart:v,onSelectionEnd:m,multiSelectionKeyCode:E,panActivationKeyCode:d,zoomActivationKeyCode:g,elementsSelectable:y,zoomOnScroll:S,zoomOnPinch:w,panOnScroll:N,panOnScrollSpeed:T,panOnScrollMode:b,zoomOnDoubleClick:D,panOnDrag:k,defaultViewport:B,translateExtent:F,minZoom:z,maxZoom:R,preventScrolling:P,onSelectionContextMenu:A,noWheelClassName:C,noPanClassName:x,disableKeyboardA11y:L})=>{const U=de(KO),$=$i(f),Q=$i(d)||k,K=$||p&&Q!==!0;return MO({deleteKeyCode:l,multiSelectionKeyCode:E}),_(BO,{onMove:a,onMoveStart:u,onMoveEnd:c,onPaneContextMenu:i,elementsSelectable:y,zoomOnScroll:S,zoomOnPinch:w,panOnScroll:N,panOnScrollSpeed:T,panOnScrollMode:b,zoomOnDoubleClick:D,panOnDrag:!$&&Q,defaultViewport:B,translateExtent:F,minZoom:z,maxZoom:R,zoomActivationKeyCode:g,preventScrolling:P,noWheelClassName:C,noPanClassName:x,children:V(Pv,{onSelectionStart:v,onSelectionEnd:m,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:s,panOnDrag:Q,isSelecting:!!K,selectionMode:h,children:[e,U&&_(YO,{onSelectionContextMenu:A,noPanClassName:x,disableKeyboardA11y:L})]})})};Mv.displayName="FlowRenderer";var QO=O.memo(Mv);function XO(e){return de(O.useCallback(n=>e?Zm(n.nodeInternals,{x:0,y:0,width:n.width,height:n.height},n.transform,!0):n.getNodes(),[e]))}const qO=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),Uv=e=>{const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:o,updateNodeDimensions:i,onError:s}=de(qO,Qe),l=XO(e.onlyRenderVisibleElements),a=O.useRef(),u=O.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const c=new ResizeObserver(f=>{const p=f.map(h=>({id:h.target.getAttribute("data-id"),nodeElement:h.target,forceUpdate:!0}));i(p)});return a.current=c,c},[]);return O.useEffect(()=>()=>{var c;(c=a==null?void 0:a.current)==null||c.disconnect()},[]),_("div",{className:"react-flow__nodes",style:_f,children:l.map(c=>{var w,N;let f=c.type||"default";e.nodeTypes[f]||(s==null||s("003",dn["003"](f)),f="default");const p=e.nodeTypes[f]||e.nodeTypes.default,h=!!(c.draggable||t&&typeof c.draggable>"u"),v=!!(c.selectable||o&&typeof c.selectable>"u"),m=!!(c.connectable||n&&typeof c.connectable>"u"),E=!!(c.focusable||r&&typeof c.focusable>"u"),d=e.nodeExtent?of(c.positionAbsolute,e.nodeExtent):c.positionAbsolute,g=(d==null?void 0:d.x)??0,y=(d==null?void 0:d.y)??0,S=CO({x:g,y,width:c.width??0,height:c.height??0,origin:e.nodeOrigin});return _(p,{id:c.id,className:c.className,style:c.style,type:f,data:c.data,sourcePosition:c.sourcePosition||G.Bottom,targetPosition:c.targetPosition||G.Top,hidden:c.hidden,xPos:g,yPos:y,xPosOrigin:S.x,yPosOrigin:S.y,selectNodesOnDrag:e.selectNodesOnDrag,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,selected:!!c.selected,isDraggable:h,isSelectable:v,isConnectable:m,isFocusable:E,resizeObserver:u,dragHandle:c.dragHandle,zIndex:((w=c[_e])==null?void 0:w.z)??0,isParent:!!((N=c[_e])!=null&&N.isParent),noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!c.width&&!!c.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:c.ariaLabel},c.id)})})};Uv.displayName="NodeRenderer";var ZO=O.memo(Uv);const JO=[{level:0,isMaxLevel:!0,edges:[]}];function ex(e,t,n=!1){let r=-1;const o=e.reduce((s,l)=>{var c,f,p,h;const a=mt(l.zIndex);let u=a?l.zIndex:0;return n&&(u=a?l.zIndex:Math.max(((f=(c=t.get(l.source))==null?void 0:c[_e])==null?void 0:f.z)||0,((h=(p=t.get(l.target))==null?void 0:p[_e])==null?void 0:h.z)||0)),s[u]?s[u].push(l):s[u]=[l],r=u>r?u:r,s},{}),i=Object.entries(o).map(([s,l])=>{const a=+s;return{edges:l,level:a,isMaxLevel:a===r}});return i.length===0?JO:i}function tx(e,t,n){const r=de(O.useCallback(o=>e?o.edges.filter(i=>{const s=t.get(i.source),l=t.get(i.target);return(s==null?void 0:s.width)&&(s==null?void 0:s.height)&&(l==null?void 0:l.width)&&(l==null?void 0:l.height)&&OO({sourcePos:s.positionAbsolute||{x:0,y:0},targetPos:l.positionAbsolute||{x:0,y:0},sourceWidth:s.width,sourceHeight:s.height,targetWidth:l.width,targetHeight:l.height,width:o.width,height:o.height,transform:o.transform})}):o.edges,[e,t]));return ex(r,t,n)}const nx=({color:e="none",strokeWidth:t=1})=>_("polyline",{stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:t,fill:"none",points:"-5,-4 0,0 -5,4"}),rx=({color:e="none",strokeWidth:t=1})=>_("polyline",{stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:t,fill:e,points:"-5,-4 0,0 -5,4 -5,-4"}),Fv={[Ui.Arrow]:nx,[Ui.ArrowClosed]:rx};function ox(e){const t=Ce();return O.useMemo(()=>{var o,i;return Object.prototype.hasOwnProperty.call(Fv,e)?Fv[e]:((i=(o=t.getState()).onError)==null||i.call(o,"009",dn["009"](e)),null)},[e])}const ix=({id:e,type:t,color:n,width:r=12.5,height:o=12.5,markerUnits:i="strokeWidth",strokeWidth:s,orient:l="auto-start-reverse"})=>{const a=ox(t);return a?_("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:l,refX:"0",refY:"0",children:_(a,{color:n,strokeWidth:s})}):null},sx=({defaultColor:e,rfId:t})=>n=>{const r=[];return n.edges.reduce((o,i)=>([i.markerStart,i.markerEnd].forEach(s=>{if(s&&typeof s=="object"){const l=df(s,t);r.includes(l)||(o.push({id:l,color:s.color||e,...s}),r.push(l))}}),o),[]).sort((o,i)=>o.id.localeCompare(i.id))},Vv=({defaultColor:e,rfId:t})=>{const n=de(O.useCallback(sx({defaultColor:e,rfId:t}),[e,t]),(r,o)=>!(r.length!==o.length||r.some((i,s)=>i.id!==o[s].id)));return _("defs",{children:n.map(r=>_(ix,{id:r.id,type:r.type,color:r.color,width:r.width,height:r.height,markerUnits:r.markerUnits,strokeWidth:r.strokeWidth,orient:r.orient},r.id))})};Vv.displayName="MarkerDefinitions";var lx=O.memo(Vv);const ax=e=>({nodesConnectable:e.nodesConnectable,edgesFocusable:e.edgesFocusable,elementsSelectable:e.elementsSelectable,width:e.width,height:e.height,connectionMode:e.connectionMode,nodeInternals:e.nodeInternals,onError:e.onError}),Bv=({defaultMarkerColor:e,onlyRenderVisibleElements:t,elevateEdgesOnSelect:n,rfId:r,edgeTypes:o,noPanClassName:i,onEdgeUpdate:s,onEdgeContextMenu:l,onEdgeMouseEnter:a,onEdgeMouseMove:u,onEdgeMouseLeave:c,onEdgeClick:f,edgeUpdaterRadius:p,onEdgeDoubleClick:h,onEdgeUpdateStart:v,onEdgeUpdateEnd:m,children:E})=>{const{edgesFocusable:d,elementsSelectable:g,width:y,height:S,connectionMode:w,nodeInternals:N,onError:T}=de(ax,Qe),b=tx(t,N,n);return y?V(Ae,{children:[b.map(({level:D,edges:k,isMaxLevel:B})=>V("svg",{style:{zIndex:D},width:y,height:S,className:"react-flow__edges react-flow__container",children:[B&&_(lx,{defaultColor:e,rfId:r}),_("g",{children:k.map(F=>{const[z,R,P]=Ev(N.get(F.source)),[A,C,x]=Ev(N.get(F.target));if(!P||!x)return null;let L=F.type||"default";o[L]||(T==null||T("011",dn["011"](L)),L="default");const U=o[L]||o.default,$=w===$n.Strict?C.target:(C.target??[]).concat(C.source??[]),j=yv(R.source,F.sourceHandle),Q=yv($,F.targetHandle),K=(j==null?void 0:j.position)||G.Bottom,X=(Q==null?void 0:Q.position)||G.Top,q=!!(F.focusable||d&&typeof F.focusable>"u");if(!j||!Q)return T==null||T("008",dn["008"](j,F)),null;const{sourceX:J,sourceY:ne,targetX:he,targetY:ie}=NO(z,j,K,A,Q,X);return _(U,{id:F.id,className:Ke([F.className,i]),type:L,data:F.data,selected:!!F.selected,animated:!!F.animated,hidden:!!F.hidden,label:F.label,labelStyle:F.labelStyle,labelShowBg:F.labelShowBg,labelBgStyle:F.labelBgStyle,labelBgPadding:F.labelBgPadding,labelBgBorderRadius:F.labelBgBorderRadius,style:F.style,source:F.source,target:F.target,sourceHandleId:F.sourceHandle,targetHandleId:F.targetHandle,markerEnd:F.markerEnd,markerStart:F.markerStart,sourceX:J,sourceY:ne,targetX:he,targetY:ie,sourcePosition:K,targetPosition:X,elementsSelectable:g,onEdgeUpdate:s,onContextMenu:l,onMouseEnter:a,onMouseMove:u,onMouseLeave:c,onClick:f,edgeUpdaterRadius:p,onEdgeDoubleClick:h,onEdgeUpdateStart:v,onEdgeUpdateEnd:m,rfId:r,ariaLabel:F.ariaLabel,isFocusable:q,pathOptions:"pathOptions"in F?F.pathOptions:void 0,interactionWidth:F.interactionWidth},F.id)})})]},D)),E]}):null};Bv.displayName="EdgeRenderer";var ux=O.memo(Bv);const cx=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function fx({children:e}){const t=de(cx);return _("div",{className:"react-flow__viewport react-flow__container",style:{transform:t},children:e})}function dx(e){const t=Sf(),n=O.useRef(!1);O.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const px={[G.Left]:G.Right,[G.Right]:G.Left,[G.Top]:G.Bottom,[G.Bottom]:G.Top},$v=({nodeId:e,handleType:t,style:n,type:r=zn.Bezier,CustomComponent:o,connectionStatus:i})=>{var N,T,b;const{fromNode:s,handleId:l,toX:a,toY:u,connectionMode:c}=de(O.useCallback(D=>({fromNode:D.nodeInternals.get(e),handleId:D.connectionHandleId,toX:(D.connectionPosition.x-D.transform[0])/D.transform[2],toY:(D.connectionPosition.y-D.transform[1])/D.transform[2],connectionMode:D.connectionMode}),[e]),Qe),f=(N=s==null?void 0:s[_e])==null?void 0:N.handleBounds;let p=f==null?void 0:f[t];if(c===$n.Loose&&(p=p||(f==null?void 0:f[t==="source"?"target":"source"])),!s||!p)return null;const h=l?p.find(D=>D.id===l):p[0],v=h?h.x+h.width/2:(s.width??0)/2,m=h?h.y+h.height/2:s.height??0,E=(((T=s.positionAbsolute)==null?void 0:T.x)??0)+v,d=(((b=s.positionAbsolute)==null?void 0:b.y)??0)+m,g=h==null?void 0:h.position,y=g?px[g]:null;if(!g||!y)return null;if(o)return _(o,{connectionLineType:r,connectionLineStyle:n,fromNode:s,fromHandle:h,fromX:E,fromY:d,toX:a,toY:u,fromPosition:g,toPosition:y,connectionStatus:i});let S="";const w={sourceX:E,sourceY:d,sourcePosition:g,targetX:a,targetY:u,targetPosition:y};return r===zn.Bezier?[S]=Ym(w):r===zn.Step?[S]=Fi({...w,borderRadius:0}):r===zn.SmoothStep?[S]=Fi(w):r===zn.SimpleBezier?[S]=Hm(w):S=`M${E},${d} ${a},${u}`,_("path",{d:S,fill:"none",className:"react-flow__connection-path",style:n})};$v.displayName="ConnectionLine";const hx=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function gx({containerStyle:e,style:t,type:n,component:r}){const{nodeId:o,handleType:i,nodesConnectable:s,width:l,height:a,connectionStatus:u}=de(hx,Qe);return!(o&&i&&l&&s)?null:_("svg",{style:e,width:l,height:a,className:"react-flow__edges react-flow__connectionline react-flow__container",children:_("g",{className:Ke(["react-flow__connection",u]),children:_($v,{nodeId:o,handleType:i,style:t,type:n,CustomComponent:r,connectionStatus:u})})})}const zv=({nodeTypes:e,edgeTypes:t,onMove:n,onMoveStart:r,onMoveEnd:o,onInit:i,onNodeClick:s,onEdgeClick:l,onNodeDoubleClick:a,onEdgeDoubleClick:u,onNodeMouseEnter:c,onNodeMouseMove:f,onNodeMouseLeave:p,onNodeContextMenu:h,onSelectionContextMenu:v,onSelectionStart:m,onSelectionEnd:E,connectionLineType:d,connectionLineStyle:g,connectionLineComponent:y,connectionLineContainerStyle:S,selectionKeyCode:w,selectionOnDrag:N,selectionMode:T,multiSelectionKeyCode:b,panActivationKeyCode:D,zoomActivationKeyCode:k,deleteKeyCode:B,onlyRenderVisibleElements:F,elementsSelectable:z,selectNodesOnDrag:R,defaultViewport:P,translateExtent:A,minZoom:C,maxZoom:x,preventScrolling:L,defaultMarkerColor:U,zoomOnScroll:$,zoomOnPinch:j,panOnScroll:Q,panOnScrollSpeed:K,panOnScrollMode:X,zoomOnDoubleClick:q,panOnDrag:J,onPaneClick:ne,onPaneMouseEnter:he,onPaneMouseMove:ie,onPaneMouseLeave:Pe,onPaneScroll:Ze,onPaneContextMenu:ge,onEdgeUpdate:at,onEdgeContextMenu:Y,onEdgeMouseEnter:ze,onEdgeMouseMove:ut,onEdgeMouseLeave:To,edgeUpdaterRadius:ns,onEdgeUpdateStart:rs,onEdgeUpdateEnd:os,noDragClassName:Jn,noWheelClassName:Io,noPanClassName:er,elevateEdgesOnSelect:Co,disableKeyboardA11y:mn,nodeOrigin:is,nodeExtent:ss,rfId:Ao})=>(dx(i),_(QO,{onPaneClick:ne,onPaneMouseEnter:he,onPaneMouseMove:ie,onPaneMouseLeave:Pe,onPaneContextMenu:ge,onPaneScroll:Ze,deleteKeyCode:B,selectionKeyCode:w,selectionOnDrag:N,selectionMode:T,onSelectionStart:m,onSelectionEnd:E,multiSelectionKeyCode:b,panActivationKeyCode:D,zoomActivationKeyCode:k,elementsSelectable:z,onMove:n,onMoveStart:r,onMoveEnd:o,zoomOnScroll:$,zoomOnPinch:j,zoomOnDoubleClick:q,panOnScroll:Q,panOnScrollSpeed:K,panOnScrollMode:X,panOnDrag:J,defaultViewport:P,translateExtent:A,minZoom:C,maxZoom:x,onSelectionContextMenu:v,preventScrolling:L,noDragClassName:Jn,noWheelClassName:Io,noPanClassName:er,disableKeyboardA11y:mn,children:V(fx,{children:[_(ux,{edgeTypes:t,onEdgeClick:l,onEdgeDoubleClick:u,onEdgeUpdate:at,onlyRenderVisibleElements:F,onEdgeContextMenu:Y,onEdgeMouseEnter:ze,onEdgeMouseMove:ut,onEdgeMouseLeave:To,onEdgeUpdateStart:rs,onEdgeUpdateEnd:os,edgeUpdaterRadius:ns,defaultMarkerColor:U,noPanClassName:er,elevateEdgesOnSelect:!!Co,disableKeyboardA11y:mn,rfId:Ao,children:_(gx,{style:g,type:d,component:y,containerStyle:S})}),_("div",{className:"react-flow__edgelabel-renderer"}),_(ZO,{nodeTypes:e,onNodeClick:s,onNodeDoubleClick:a,onNodeMouseEnter:c,onNodeMouseMove:f,onNodeMouseLeave:p,onNodeContextMenu:h,selectNodesOnDrag:R,onlyRenderVisibleElements:F,noPanClassName:er,noDragClassName:Jn,disableKeyboardA11y:mn,nodeOrigin:is,nodeExtent:ss,rfId:Ao})]})}));zv.displayName="GraphView";var mx=O.memo(zv);const Nf=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],wo={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:Nf,nodeExtent:Nf,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:$n.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,multiSelectionActive:!1,connectionStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:Fm},vx=()=>Pg((e,t)=>({...wo,setNodes:n=>{const{nodeInternals:r,nodeOrigin:o,elevateNodesOnSelect:i}=t();e({nodeInternals:Ef(n,r,o,i)})},getNodes:()=>Array.from(t().nodeInternals.values()),setEdges:n=>{const{defaultEdgeOptions:r={}}=t();e({edges:n.map(o=>({...r,...o}))})},setDefaultNodesAndEdges:(n,r)=>{const o=typeof n<"u",i=typeof r<"u",s=o?Ef(n,new Map,t().nodeOrigin,t().elevateNodesOnSelect):new Map;e({nodeInternals:s,edges:i?r:[],hasDefaultNodes:o,hasDefaultEdges:i})},updateNodeDimensions:n=>{const{onNodesChange:r,nodeInternals:o,fitViewOnInit:i,fitViewOnInitDone:s,fitViewOnInitOptions:l,domNode:a,nodeOrigin:u}=t(),c=a==null?void 0:a.querySelector(".react-flow__viewport");if(!c)return;const f=window.getComputedStyle(c),{m22:p}=new window.DOMMatrixReadOnly(f.transform),h=n.reduce((m,E)=>{const d=o.get(E.id);if(d){const g=rf(E.nodeElement);!!(g.width&&g.height&&(d.width!==g.width||d.height!==g.height||E.forceUpdate))&&(o.set(d.id,{...d,[_e]:{...d[_e],handleBounds:{source:Rv(".source",E.nodeElement,p,u),target:Rv(".target",E.nodeElement,p,u)}},...g}),m.push({id:d.id,type:"dimensions",dimensions:g}))}return m},[]);Cv(o,u);const v=s||i&&!s&&Av(t,{initial:!0,...l});e({nodeInternals:new Map(o),fitViewOnInitDone:v}),(h==null?void 0:h.length)>0&&(r==null||r(h))},updateNodePositions:(n,r=!0,o=!1)=>{const{triggerNodeChanges:i}=t(),s=n.map(l=>{const a={id:l.id,type:"position",dragging:o};return r&&(a.positionAbsolute=l.positionAbsolute,a.position=l.position),a});i(s)},triggerNodeChanges:n=>{const{onNodesChange:r,nodeInternals:o,hasDefaultNodes:i,nodeOrigin:s,getNodes:l,elevateNodesOnSelect:a}=t();if(n!=null&&n.length){if(i){const u=kv(n,l()),c=Ef(u,o,s,a);e({nodeInternals:c})}r==null||r(n)}},addSelectedNodes:n=>{const{multiSelectionActive:r,edges:o,getNodes:i}=t();let s,l=null;r?s=n.map(a=>Hn(a,!0)):(s=_o(i(),n),l=_o(o,[])),ql({changedNodes:s,changedEdges:l,get:t,set:e})},addSelectedEdges:n=>{const{multiSelectionActive:r,edges:o,getNodes:i}=t();let s,l=null;r?s=n.map(a=>Hn(a,!0)):(s=_o(o,n),l=_o(i(),[])),ql({changedNodes:l,changedEdges:s,get:t,set:e})},unselectNodesAndEdges:({nodes:n,edges:r}={})=>{const{edges:o,getNodes:i}=t(),s=n||i(),l=r||o,a=s.map(c=>(c.selected=!1,Hn(c.id,!1))),u=l.map(c=>Hn(c.id,!1));ql({changedNodes:a,changedEdges:u,get:t,set:e})},setMinZoom:n=>{const{d3Zoom:r,maxZoom:o}=t();r==null||r.scaleExtent([n,o]),e({minZoom:n})},setMaxZoom:n=>{const{d3Zoom:r,minZoom:o}=t();r==null||r.scaleExtent([o,n]),e({maxZoom:n})},setTranslateExtent:n=>{var r;(r=t().d3Zoom)==null||r.translateExtent(n),e({translateExtent:n})},resetSelectedElements:()=>{const{edges:n,getNodes:r}=t(),i=r().filter(l=>l.selected).map(l=>Hn(l.id,!1)),s=n.filter(l=>l.selected).map(l=>Hn(l.id,!1));ql({changedNodes:i,changedEdges:s,get:t,set:e})},setNodeExtent:n=>{const{nodeInternals:r}=t();r.forEach(o=>{o.positionAbsolute=of(o.position,n)}),e({nodeExtent:n,nodeInternals:new Map(r)})},panBy:n=>{const{transform:r,width:o,height:i,d3Zoom:s,d3Selection:l,translateExtent:a}=t();if(!s||!l||!n.x&&!n.y)return;const u=Vn.translate(r[0]+n.x,r[1]+n.y).scale(r[2]),c=[[0,0],[o,i]],f=s==null?void 0:s.constrain()(u,c,a);s.transform(l,f)},cancelConnection:()=>e({connectionNodeId:wo.connectionNodeId,connectionHandleId:wo.connectionHandleId,connectionHandleType:wo.connectionHandleType,connectionStatus:wo.connectionStatus}),reset:()=>e({...wo})})),Hv=({children:e})=>{const t=O.useRef(null);return t.current||(t.current=vx()),_(VN,{value:t.current,children:e})};Hv.displayName="ReactFlowProvider";const jv=({children:e})=>O.useContext(Gl)?_(Ae,{children:e}):_(Hv,{children:e});jv.displayName="ReactFlowWrapper";function Wv(e,t){return O.useRef(null),O.useMemo(()=>t(e),[e])}const yx={input:av,default:hf,output:cv,group:gf},Ex={default:Ql,straight:cf,step:uf,smoothstep:Yl,simplebezier:af},Sx=[0,0],_x=[15,15],wx={x:0,y:0,zoom:1},Rx={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},Gv=O.forwardRef(({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:o,nodeTypes:i=yx,edgeTypes:s=Ex,onNodeClick:l,onEdgeClick:a,onInit:u,onMove:c,onMoveStart:f,onMoveEnd:p,onConnect:h,onConnectStart:v,onConnectEnd:m,onClickConnectStart:E,onClickConnectEnd:d,onNodeMouseEnter:g,onNodeMouseMove:y,onNodeMouseLeave:S,onNodeContextMenu:w,onNodeDoubleClick:N,onNodeDragStart:T,onNodeDrag:b,onNodeDragStop:D,onNodesDelete:k,onEdgesDelete:B,onSelectionChange:F,onSelectionDragStart:z,onSelectionDrag:R,onSelectionDragStop:P,onSelectionContextMenu:A,onSelectionStart:C,onSelectionEnd:x,connectionMode:L=$n.Strict,connectionLineType:U=zn.Bezier,connectionLineStyle:$,connectionLineComponent:j,connectionLineContainerStyle:Q,deleteKeyCode:K="Backspace",selectionKeyCode:X="Shift",selectionOnDrag:q=!1,selectionMode:J=Mi.Full,panActivationKeyCode:ne="Space",multiSelectionKeyCode:he="Meta",zoomActivationKeyCode:ie="Meta",snapToGrid:Pe=!1,snapGrid:Ze=_x,onlyRenderVisibleElements:ge=!1,selectNodesOnDrag:at=!0,nodesDraggable:Y,nodesConnectable:ze,nodesFocusable:ut,nodeOrigin:To=Sx,edgesFocusable:ns,elementsSelectable:rs,defaultViewport:os=wx,minZoom:Jn=.5,maxZoom:Io=2,translateExtent:er=Nf,preventScrolling:Co=!0,nodeExtent:mn,defaultMarkerColor:is="#b1b1b7",zoomOnScroll:ss=!0,zoomOnPinch:Ao=!0,panOnScroll:Je=!1,panOnScrollSpeed:Pt=.5,panOnScrollMode:Or=po.Free,zoomOnDoubleClick:xr=!0,panOnDrag:vn=!0,onPaneClick:ya,onPaneMouseEnter:ls,onPaneMouseMove:as,onPaneMouseLeave:ud,onPaneScroll:V0,onPaneContextMenu:Tr,children:HA,onEdgeUpdate:jA,onEdgeContextMenu:WA,onEdgeDoubleClick:GA,onEdgeMouseEnter:YA,onEdgeMouseMove:KA,onEdgeMouseLeave:QA,onEdgeUpdateStart:XA,onEdgeUpdateEnd:qA,edgeUpdaterRadius:ZA=10,onNodesChange:JA,onEdgesChange:eb,noDragClassName:tb="nodrag",noWheelClassName:nb="nowheel",noPanClassName:B0="nopan",fitView:rb=!1,fitViewOptions:ob,connectOnClick:ib=!0,attributionPosition:sb,proOptions:lb,defaultEdgeOptions:ab,elevateNodesOnSelect:ub=!0,elevateEdgesOnSelect:cb=!1,disableKeyboardA11y:$0=!1,autoPanOnConnect:fb=!0,autoPanOnNodeDrag:db=!0,connectionRadius:pb=20,onError:hb,style:gb,id:z0,...mb},vb)=>{const yb=Wv(i,IO),Eb=Wv(s,RO),cd=z0||"1";return _("div",{...mb,style:{...gb,...Rx},ref:vb,className:Ke(["react-flow",o]),"data-testid":"rf__wrapper",id:z0,children:V(jv,{children:[_(mx,{onInit:u,onMove:c,onMoveStart:f,onMoveEnd:p,onNodeClick:l,onEdgeClick:a,onNodeMouseEnter:g,onNodeMouseMove:y,onNodeMouseLeave:S,onNodeContextMenu:w,onNodeDoubleClick:N,nodeTypes:yb,edgeTypes:Eb,connectionLineType:U,connectionLineStyle:$,connectionLineComponent:j,connectionLineContainerStyle:Q,selectionKeyCode:X,selectionOnDrag:q,selectionMode:J,deleteKeyCode:K,multiSelectionKeyCode:he,panActivationKeyCode:ne,zoomActivationKeyCode:ie,onlyRenderVisibleElements:ge,selectNodesOnDrag:at,defaultViewport:os,translateExtent:er,minZoom:Jn,maxZoom:Io,preventScrolling:Co,zoomOnScroll:ss,zoomOnPinch:Ao,zoomOnDoubleClick:xr,panOnScroll:Je,panOnScrollSpeed:Pt,panOnScrollMode:Or,panOnDrag:vn,onPaneClick:ya,onPaneMouseEnter:ls,onPaneMouseMove:as,onPaneMouseLeave:ud,onPaneScroll:V0,onPaneContextMenu:Tr,onSelectionContextMenu:A,onSelectionStart:C,onSelectionEnd:x,onEdgeUpdate:jA,onEdgeContextMenu:WA,onEdgeDoubleClick:GA,onEdgeMouseEnter:YA,onEdgeMouseMove:KA,onEdgeMouseLeave:QA,onEdgeUpdateStart:XA,onEdgeUpdateEnd:qA,edgeUpdaterRadius:ZA,defaultMarkerColor:is,noDragClassName:tb,noWheelClassName:nb,noPanClassName:B0,elevateEdgesOnSelect:cb,rfId:cd,disableKeyboardA11y:$0,nodeOrigin:To,nodeExtent:mn}),_(gO,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:h,onConnectStart:v,onConnectEnd:m,onClickConnectStart:E,onClickConnectEnd:d,nodesDraggable:Y,nodesConnectable:ze,nodesFocusable:ut,edgesFocusable:ns,elementsSelectable:rs,elevateNodesOnSelect:ub,minZoom:Jn,maxZoom:Io,nodeExtent:mn,onNodesChange:JA,onEdgesChange:eb,snapToGrid:Pe,snapGrid:Ze,connectionMode:L,translateExtent:er,connectOnClick:ib,defaultEdgeOptions:ab,fitView:rb,fitViewOptions:ob,onNodesDelete:k,onEdgesDelete:B,onNodeDragStart:T,onNodeDrag:b,onNodeDragStop:D,onSelectionDrag:R,onSelectionDragStart:z,onSelectionDragStop:P,noPanClassName:B0,nodeOrigin:To,rfId:cd,autoPanOnConnect:fb,autoPanOnNodeDrag:db,onError:hb,connectionRadius:pb}),_(pO,{onSelectionChange:F}),HA,_($N,{proOptions:lb,position:sb}),_(SO,{rfId:cd,disableKeyboardA11y:$0})]})})});Gv.displayName="ReactFlow";function Nx(){return _("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:_("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function Ox(){return _("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:_("path",{d:"M0 0h32v4.2H0z"})})}function xx(){return _("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:_("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function Tx(){return _("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:_("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function Ix(){return _("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:_("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}const zi=({children:e,className:t,...n})=>_("button",{type:"button",className:Ke(["react-flow__controls-button",t]),...n,children:e});zi.displayName="ControlButton";const Cx=e=>e.nodesDraggable&&e.nodesConnectable&&e.elementsSelectable,Yv=({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:o,onZoomIn:i,onZoomOut:s,onFitView:l,onInteractiveChange:a,className:u,children:c,position:f="bottom-left"})=>{const p=Ce(),[h,v]=O.useState(!1),m=de(Cx),{zoomIn:E,zoomOut:d,fitView:g}=Sf();if(O.useEffect(()=>{v(!0)},[]),!h)return null;const y=()=>{E(),i==null||i()},S=()=>{d(),s==null||s()},w=()=>{g(o),l==null||l()},N=()=>{p.setState({nodesDraggable:!m,nodesConnectable:!m,elementsSelectable:!m}),a==null||a(!m)};return V(nf,{className:Ke(["react-flow__controls",u]),position:f,style:e,children:[t&&V(Ae,{children:[_(zi,{onClick:y,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",children:_(Nx,{})}),_(zi,{onClick:S,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",children:_(Ox,{})})]}),n&&_(zi,{className:"react-flow__controls-fitview",onClick:w,title:"fit view","aria-label":"fit view",children:_(xx,{})}),r&&_(zi,{className:"react-flow__controls-interactive",onClick:N,title:"toggle interactivity","aria-label":"toggle interactivity",children:m?_(Ix,{}):_(Tx,{})}),c]})};Yv.displayName="Controls";var Ax=O.memo(Yv);let bx=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,n)=>(n&=63,n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n>62?t+="-":t+="_",t),"");const Lx=!1,Kv="0.0.0",Qv="0.0.0",Xv={type:"floating",markerEnd:{type:Ui.Arrow,width:20,height:20,color:"#c2c8d1"},style:{stroke:"#c2c8d1",strokeWidth:1.5}},ye=()=>bx(),Dx=()=>{const e={},t=document.querySelector('meta[name="csrf-token"]');return t&&(e["X-CSRF-Token"]=t==null?void 0:t.content),e},kx=(e,t)=>{var i;const n=new Blob([JSON.stringify({nodes:e,edges:t},null,2)],{type:"application/json"}),r=window.URL.createObjectURL(n),o=window.open();(i=o==null?void 0:o.location)!=null&&i.href&&(o.location.href=r)},Px=e=>e.map(t=>typeof t=="string"?t.trim():t).filter(Boolean).join(),Of=e=>e.split(",").map(t=>t.trim()).filter(Boolean),Mx=e=>({...e,...Xv}),Ux=e=>e.type==="handleCall"?{...e,deletable:!1}:e,Zl=e=>e==="success"?"positive":"negative",Fx=e=>e.toLowerCase().replace(/ /g,"-"),xf=()=>[{result:"success",id:ye()},{result:"noAnswer",id:ye()},{result:"busy",id:ye()},{result:"decline",id:ye()},{result:"error",id:ye()}],qv={answer:()=>({}),forwardAddress:()=>({destinations:[],destinationType:"address",options:xf(),sessionTimeout:void 0,type:"single"}),forwardPhone:()=>({destinations:[],destinationType:"phone",options:xf(),sessionTimeout:void 0,type:"single"}),forwardResource:()=>({destinations:[],destinationType:"resource",options:xf(),sessionTimeout:void 0,type:"single"}),hangup:()=>({}),play:()=>({selected:"",text:"",url:""}),promptPlay:()=>({initialTimeout:5,options:[],results:[{id:ye(),result:"no_match"},{id:ye(),result:"no_input"}],selected:"",text:"",url:""}),record:()=>({beep:!1,format:"wav",options:[{id:ye(),result:"success"},{id:ye(),result:"failed"}],stereo:!1,terminators:""}),recordCallStart:()=>({beep:!1,controlId:ye(),format:"wav",label:"",options:[{id:ye(),result:"success"},{id:ye(),result:"failed"}],stereo:!1,terminators:""}),recordCallStop:()=>({controlId:""}),sendSms:()=>({body:"",fromNumber:"",media:[],region:"",tags:[],toNumber:""}),set:()=>({variables:[]}),unset:()=>({variables:[]}),request:()=>({url:"",method:"POST",headers:{},body:"",options:[{id:ye(),result:"success"},{id:ye(),result:"failed"}]}),cond:()=>({options:[],fallback:ye()})};function bt(e){return bt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bt(e)}function vt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Vx(e,t){if(bt(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(bt(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Zv(e){var t=Vx(e,"string");return bt(t)==="symbol"?t:String(t)}function Jv(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Zv(r.key),r)}}function yt(e,t,n){return t&&Jv(e.prototype,t),n&&Jv(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function jn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Tf(e,t){return Tf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},Tf(e,t)}function Jl(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Tf(e,t)}function Hi(e,t){if(t&&(bt(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return jn(e)}function Wt(e){return Wt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Wt(e)}function pn(e,t,n){return t=Zv(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bx(e){if(Array.isArray(e))return e}function $x(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ey(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function zx(e,t){if(e){if(typeof e=="string")return ey(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ey(e,t)}}function Hx(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
61
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jx(e){return Bx(e)||$x(e)||zx(e)||Hx()}function ty(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function ny(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ty(Object(n),!0).forEach(function(r){pn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ty(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Wx={type:"logger",log:function(t){this.output("log",t)},warn:function(t){this.output("warn",t)},error:function(t){this.output("error",t)},output:function(t,n){console&&console[t]&&console[t].apply(console,n)}},Gx=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};vt(this,e),this.init(t,n)}return yt(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=r.prefix||"i18next:",this.logger=n||Wx,this.options=r,this.debug=r.debug}},{key:"setDebug",value:function(n){this.debug=n}},{key:"log",value:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return this.forward(r,"log","",!0)}},{key:"warn",value:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return this.forward(r,"warn","",!0)}},{key:"error",value:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return this.forward(r,"error","")}},{key:"deprecate",value:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return this.forward(r,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(n,r,o,i){return i&&!this.debug?null:(typeof n[0]=="string"&&(n[0]="".concat(o).concat(this.prefix," ").concat(n[0])),this.logger[r](n))}},{key:"create",value:function(n){return new e(this.logger,ny(ny({},{prefix:"".concat(this.prefix,":").concat(n,":")}),this.options))}},{key:"clone",value:function(n){return n=n||this.options,n.prefix=n.prefix||this.prefix,new e(this.logger,n)}}]),e}(),Gt=new Gx,Wn=function(){function e(){vt(this,e),this.observers={}}return yt(e,[{key:"on",value:function(n,r){var o=this;return n.split(" ").forEach(function(i){o.observers[i]=o.observers[i]||[],o.observers[i].push(r)}),this}},{key:"off",value:function(n,r){if(this.observers[n]){if(!r){delete this.observers[n];return}this.observers[n]=this.observers[n].filter(function(o){return o!==r})}}},{key:"emit",value:function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];if(this.observers[n]){var s=[].concat(this.observers[n]);s.forEach(function(a){a.apply(void 0,o)})}if(this.observers["*"]){var l=[].concat(this.observers["*"]);l.forEach(function(a){a.apply(a,[n].concat(o))})}}}]),e}();function ji(){var e,t,n=new Promise(function(r,o){e=r,t=o});return n.resolve=e,n.reject=t,n}function ry(e){return e==null?"":""+e}function Yx(e,t,n){e.forEach(function(r){t[r]&&(n[r]=t[r])})}function If(e,t,n){function r(l){return l&&l.indexOf("###")>-1?l.replace(/###/g,"."):l}function o(){return!e||typeof e=="string"}for(var i=typeof t!="string"?[].concat(t):t.split(".");i.length>1;){if(o())return{};var s=r(i.shift());!e[s]&&n&&(e[s]=new n),Object.prototype.hasOwnProperty.call(e,s)?e=e[s]:e={}}return o()?{}:{obj:e,k:r(i.shift())}}function oy(e,t,n){var r=If(e,t,Object),o=r.obj,i=r.k;o[i]=n}function Kx(e,t,n,r){var o=If(e,t,Object),i=o.obj,s=o.k;i[s]=i[s]||[],r&&(i[s]=i[s].concat(n)),r||i[s].push(n)}function ea(e,t){var n=If(e,t),r=n.obj,o=n.k;if(r)return r[o]}function iy(e,t,n){var r=ea(e,n);return r!==void 0?r:ea(t,n)}function sy(e,t,n){for(var r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?typeof e[r]=="string"||e[r]instanceof String||typeof t[r]=="string"||t[r]instanceof String?n&&(e[r]=t[r]):sy(e[r],t[r],n):e[r]=t[r]);return e}function Ro(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var Qx={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function Xx(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,function(t){return Qx[t]}):e}var ta=typeof window<"u"&&window.navigator&&typeof window.navigator.userAgentData>"u"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,qx=[" ",",","?","!",";"];function Zx(e,t,n){t=t||"",n=n||"";var r=qx.filter(function(l){return t.indexOf(l)<0&&n.indexOf(l)<0});if(r.length===0)return!0;var o=new RegExp("(".concat(r.map(function(l){return l==="?"?"\\?":l}).join("|"),")")),i=!o.test(e);if(!i){var s=e.indexOf(n);s>0&&!o.test(e.substring(0,s))&&(i=!0)}return i}function ly(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function na(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ly(Object(n),!0).forEach(function(r){pn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ly(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Jx(e){var t=eT();return function(){var r=Wt(e),o;if(t){var i=Wt(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return Hi(this,o)}}function eT(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ay(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(e){if(e[t])return e[t];for(var r=t.split(n),o=e,i=0;i<r.length;++i){if(!o||typeof o[r[i]]=="string"&&i+1<r.length)return;if(o[r[i]]===void 0){for(var s=2,l=r.slice(i,i+s).join(n),a=o[l];a===void 0&&r.length>i+s;)s++,l=r.slice(i,i+s).join(n),a=o[l];if(a===void 0)return;if(a===null)return null;if(t.endsWith(l)){if(typeof a=="string")return a;if(l&&typeof a[l]=="string")return a[l]}var u=r.slice(i+s).join(n);return u?ay(a,u,n):void 0}o=o[r[i]]}return o}}var tT=function(e){Jl(n,e);var t=Jx(n);function n(r){var o,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return vt(this,n),o=t.call(this),ta&&Wn.call(jn(o)),o.data=r||{},o.options=i,o.options.keySeparator===void 0&&(o.options.keySeparator="."),o.options.ignoreJSONStructure===void 0&&(o.options.ignoreJSONStructure=!0),o}return yt(n,[{key:"addNamespaces",value:function(o){this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}},{key:"removeNamespaces",value:function(o){var i=this.options.ns.indexOf(o);i>-1&&this.options.ns.splice(i,1)}},{key:"getResource",value:function(o,i,s){var l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},a=l.keySeparator!==void 0?l.keySeparator:this.options.keySeparator,u=l.ignoreJSONStructure!==void 0?l.ignoreJSONStructure:this.options.ignoreJSONStructure,c=[o,i];s&&typeof s!="string"&&(c=c.concat(s)),s&&typeof s=="string"&&(c=c.concat(a?s.split(a):s)),o.indexOf(".")>-1&&(c=o.split("."));var f=ea(this.data,c);return f||!u||typeof s!="string"?f:ay(this.data&&this.data[o]&&this.data[o][i],s,a)}},{key:"addResource",value:function(o,i,s,l){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},u=this.options.keySeparator;u===void 0&&(u=".");var c=[o,i];s&&(c=c.concat(u?s.split(u):s)),o.indexOf(".")>-1&&(c=o.split("."),l=i,i=c[1]),this.addNamespaces(i),oy(this.data,c,l),a.silent||this.emit("added",o,i,s,l)}},{key:"addResources",value:function(o,i,s){var l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var a in s)(typeof s[a]=="string"||Object.prototype.toString.apply(s[a])==="[object Array]")&&this.addResource(o,i,a,s[a],{silent:!0});l.silent||this.emit("added",o,i,s)}},{key:"addResourceBundle",value:function(o,i,s,l,a){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},c=[o,i];o.indexOf(".")>-1&&(c=o.split("."),l=s,s=i,i=c[1]),this.addNamespaces(i);var f=ea(this.data,c)||{};l?sy(f,s,a):f=na(na({},f),s),oy(this.data,c,f),u.silent||this.emit("added",o,i,s)}},{key:"removeResourceBundle",value:function(o,i){this.hasResourceBundle(o,i)&&delete this.data[o][i],this.removeNamespaces(i),this.emit("removed",o,i)}},{key:"hasResourceBundle",value:function(o,i){return this.getResource(o,i)!==void 0}},{key:"getResourceBundle",value:function(o,i){return i||(i=this.options.defaultNS),this.options.compatibilityAPI==="v1"?na(na({},{}),this.getResource(o,i)):this.getResource(o,i)}},{key:"getDataByLanguage",value:function(o){return this.data[o]}},{key:"hasLanguageSomeTranslations",value:function(o){var i=this.getDataByLanguage(o),s=i&&Object.keys(i)||[];return!!s.find(function(l){return i[l]&&Object.keys(i[l]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),n}(Wn),uy={processors:{},addPostProcessor:function(t){this.processors[t.name]=t},handle:function(t,n,r,o,i){var s=this;return t.forEach(function(l){s.processors[l]&&(n=s.processors[l].process(n,r,o,i))}),n}};function cy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Be(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?cy(Object(n),!0).forEach(function(r){pn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cy(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nT(e){var t=rT();return function(){var r=Wt(e),o;if(t){var i=Wt(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return Hi(this,o)}}function rT(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var fy={},dy=function(e){Jl(n,e);var t=nT(n);function n(r){var o,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return vt(this,n),o=t.call(this),ta&&Wn.call(jn(o)),Yx(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],r,jn(o)),o.options=i,o.options.keySeparator===void 0&&(o.options.keySeparator="."),o.logger=Gt.create("translator"),o}return yt(n,[{key:"changeLanguage",value:function(o){o&&(this.language=o)}},{key:"exists",value:function(o){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(o==null)return!1;var s=this.resolve(o,i);return s&&s.res!==void 0}},{key:"extractFromKey",value:function(o,i){var s=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;s===void 0&&(s=":");var l=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,a=i.ns||this.options.defaultNS||[],u=s&&o.indexOf(s)>-1,c=!this.options.userDefinedKeySeparator&&!i.keySeparator&&!this.options.userDefinedNsSeparator&&!i.nsSeparator&&!Zx(o,s,l);if(u&&!c){var f=o.match(this.interpolator.nestingRegexp);if(f&&f.length>0)return{key:o,namespaces:a};var p=o.split(s);(s!==l||s===l&&this.options.ns.indexOf(p[0])>-1)&&(a=p.shift()),o=p.join(l)}return typeof a=="string"&&(a=[a]),{key:o,namespaces:a}}},{key:"translate",value:function(o,i,s){var l=this;if(bt(i)!=="object"&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),i||(i={}),o==null)return"";Array.isArray(o)||(o=[String(o)]);var a=i.returnDetails!==void 0?i.returnDetails:this.options.returnDetails,u=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,c=this.extractFromKey(o[o.length-1],i),f=c.key,p=c.namespaces,h=p[p.length-1],v=i.lng||this.language,m=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(v&&v.toLowerCase()==="cimode"){if(m){var E=i.nsSeparator||this.options.nsSeparator;return a?{res:"".concat(h).concat(E).concat(f),usedKey:f,exactUsedKey:f,usedLng:v,usedNS:h}:"".concat(h).concat(E).concat(f)}return a?{res:f,usedKey:f,exactUsedKey:f,usedLng:v,usedNS:h}:f}var d=this.resolve(o,i),g=d&&d.res,y=d&&d.usedKey||f,S=d&&d.exactUsedKey||f,w=Object.prototype.toString.apply(g),N=["[object Number]","[object Function]","[object RegExp]"],T=i.joinArrays!==void 0?i.joinArrays:this.options.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject,D=typeof g!="string"&&typeof g!="boolean"&&typeof g!="number";if(b&&g&&D&&N.indexOf(w)<0&&!(typeof T=="string"&&w==="[object Array]")){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var k=this.options.returnedObjectHandler?this.options.returnedObjectHandler(y,g,Be(Be({},i),{},{ns:p})):"key '".concat(f," (").concat(this.language,")' returned an object instead of string.");return a?(d.res=k,d):k}if(u){var B=w==="[object Array]",F=B?[]:{},z=B?S:y;for(var R in g)if(Object.prototype.hasOwnProperty.call(g,R)){var P="".concat(z).concat(u).concat(R);F[R]=this.translate(P,Be(Be({},i),{joinArrays:!1,ns:p})),F[R]===P&&(F[R]=g[R])}g=F}}else if(b&&typeof T=="string"&&w==="[object Array]")g=g.join(T),g&&(g=this.extendTranslation(g,o,i,s));else{var A=!1,C=!1,x=i.count!==void 0&&typeof i.count!="string",L=n.hasDefaultValue(i),U=x?this.pluralResolver.getSuffix(v,i.count,i):"",$=i["defaultValue".concat(U)]||i.defaultValue;!this.isValidLookup(g)&&L&&(A=!0,g=$),this.isValidLookup(g)||(C=!0,g=f);var j=i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,Q=j&&C?void 0:g,K=L&&$!==g&&this.options.updateMissing;if(C||A||K){if(this.logger.log(K?"updateKey":"missingKey",v,h,f,K?$:g),u){var X=this.resolve(f,Be(Be({},i),{},{keySeparator:!1}));X&&X.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var q=[],J=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo==="fallback"&&J&&J[0])for(var ne=0;ne<J.length;ne++)q.push(J[ne]);else this.options.saveMissingTo==="all"?q=this.languageUtils.toResolveHierarchy(i.lng||this.language):q.push(i.lng||this.language);var he=function(Pe,Ze,ge){var at=L&&ge!==g?ge:Q;l.options.missingKeyHandler?l.options.missingKeyHandler(Pe,h,Ze,at,K,i):l.backendConnector&&l.backendConnector.saveMissing&&l.backendConnector.saveMissing(Pe,h,Ze,at,K,i),l.emit("missingKey",Pe,h,Ze,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&x?q.forEach(function(ie){l.pluralResolver.getSuffixes(ie,i).forEach(function(Pe){he([ie],f+Pe,i["defaultValue".concat(Pe)]||$)})}):he(q,f,$))}g=this.extendTranslation(g,o,i,d,s),C&&g===f&&this.options.appendNamespaceToMissingKey&&(g="".concat(h,":").concat(f)),(C||A)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(h,":").concat(f):f,A?g:void 0):g=this.options.parseMissingKeyHandler(g))}return a?(d.res=g,d):g}},{key:"extendTranslation",value:function(o,i,s,l,a){var u=this;if(this.i18nFormat&&this.i18nFormat.parse)o=this.i18nFormat.parse(o,Be(Be({},this.options.interpolation.defaultVariables),s),l.usedLng,l.usedNS,l.usedKey,{resolved:l});else if(!s.skipInterpolation){s.interpolation&&this.interpolator.init(Be(Be({},s),{interpolation:Be(Be({},this.options.interpolation),s.interpolation)}));var c=typeof o=="string"&&(s&&s.interpolation&&s.interpolation.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables),f;if(c){var p=o.match(this.interpolator.nestingRegexp);f=p&&p.length}var h=s.replace&&typeof s.replace!="string"?s.replace:s;if(this.options.interpolation.defaultVariables&&(h=Be(Be({},this.options.interpolation.defaultVariables),h)),o=this.interpolator.interpolate(o,h,s.lng||this.language,s),c){var v=o.match(this.interpolator.nestingRegexp),m=v&&v.length;f<m&&(s.nest=!1)}s.nest!==!1&&(o=this.interpolator.nest(o,function(){for(var g=arguments.length,y=new Array(g),S=0;S<g;S++)y[S]=arguments[S];return a&&a[0]===y[0]&&!s.context?(u.logger.warn("It seems you are nesting recursively key: ".concat(y[0]," in key: ").concat(i[0])),null):u.translate.apply(u,y.concat([i]))},s)),s.interpolation&&this.interpolator.reset()}var E=s.postProcess||this.options.postProcess,d=typeof E=="string"?[E]:E;return o!=null&&d&&d.length&&s.applyPostProcessor!==!1&&(o=uy.handle(d,o,i,this.options&&this.options.postProcessPassResolved?Be({i18nResolved:l},s):s,this)),o}},{key:"resolve",value:function(o){var i=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l,a,u,c,f;return typeof o=="string"&&(o=[o]),o.forEach(function(p){if(!i.isValidLookup(l)){var h=i.extractFromKey(p,s),v=h.key;a=v;var m=h.namespaces;i.options.fallbackNS&&(m=m.concat(i.options.fallbackNS));var E=s.count!==void 0&&typeof s.count!="string",d=E&&!s.ordinal&&s.count===0&&i.pluralResolver.shouldUseIntlApi(),g=s.context!==void 0&&(typeof s.context=="string"||typeof s.context=="number")&&s.context!=="",y=s.lngs?s.lngs:i.languageUtils.toResolveHierarchy(s.lng||i.language,s.fallbackLng);m.forEach(function(S){i.isValidLookup(l)||(f=S,!fy["".concat(y[0],"-").concat(S)]&&i.utils&&i.utils.hasLoadedNamespace&&!i.utils.hasLoadedNamespace(f)&&(fy["".concat(y[0],"-").concat(S)]=!0,i.logger.warn('key "'.concat(a,'" for languages "').concat(y.join(", "),`" won't get resolved as namespace "`).concat(f,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),y.forEach(function(w){if(!i.isValidLookup(l)){c=w;var N=[v];if(i.i18nFormat&&i.i18nFormat.addLookupKeys)i.i18nFormat.addLookupKeys(N,v,w,S,s);else{var T;E&&(T=i.pluralResolver.getSuffix(w,s.count,s));var b="".concat(i.options.pluralSeparator,"zero");if(E&&(N.push(v+T),d&&N.push(v+b)),g){var D="".concat(v).concat(i.options.contextSeparator).concat(s.context);N.push(D),E&&(N.push(D+T),d&&N.push(D+b))}}for(var k;k=N.pop();)i.isValidLookup(l)||(u=k,l=i.getResource(w,S,k,s))}}))})}}),{res:l,usedKey:a,exactUsedKey:u,usedLng:c,usedNS:f}}},{key:"isValidLookup",value:function(o){return o!==void 0&&!(!this.options.returnNull&&o===null)&&!(!this.options.returnEmptyString&&o==="")}},{key:"getResource",value:function(o,i,s){var l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(o,i,s,l):this.resourceStore.getResource(o,i,s,l)}}],[{key:"hasDefaultValue",value:function(o){var i="defaultValue";for(var s in o)if(Object.prototype.hasOwnProperty.call(o,s)&&i===s.substring(0,i.length)&&o[s]!==void 0)return!0;return!1}}]),n}(Wn);function Cf(e){return e.charAt(0).toUpperCase()+e.slice(1)}var py=function(){function e(t){vt(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Gt.create("languageUtils")}return yt(e,[{key:"getScriptPartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return null;var r=n.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}},{key:"getLanguagePartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return n;var r=n.split("-");return this.formatLanguageCode(r[0])}},{key:"formatLanguageCode",value:function(n){if(typeof n=="string"&&n.indexOf("-")>-1){var r=["hans","hant","latn","cyrl","cans","mong","arab"],o=n.split("-");return this.options.lowerCaseLng?o=o.map(function(i){return i.toLowerCase()}):o.length===2?(o[0]=o[0].toLowerCase(),o[1]=o[1].toUpperCase(),r.indexOf(o[1].toLowerCase())>-1&&(o[1]=Cf(o[1].toLowerCase()))):o.length===3&&(o[0]=o[0].toLowerCase(),o[1].length===2&&(o[1]=o[1].toUpperCase()),o[0]!=="sgn"&&o[2].length===2&&(o[2]=o[2].toUpperCase()),r.indexOf(o[1].toLowerCase())>-1&&(o[1]=Cf(o[1].toLowerCase())),r.indexOf(o[2].toLowerCase())>-1&&(o[2]=Cf(o[2].toLowerCase()))),o.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?n.toLowerCase():n}},{key:"isSupportedCode",value:function(n){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(n=this.getLanguagePartFromCode(n)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(n)>-1}},{key:"getBestMatchFromCodes",value:function(n){var r=this;if(!n)return null;var o;return n.forEach(function(i){if(!o){var s=r.formatLanguageCode(i);(!r.options.supportedLngs||r.isSupportedCode(s))&&(o=s)}}),!o&&this.options.supportedLngs&&n.forEach(function(i){if(!o){var s=r.getLanguagePartFromCode(i);if(r.isSupportedCode(s))return o=s;o=r.options.supportedLngs.find(function(l){if(l.indexOf(s)===0)return l})}}),o||(o=this.getFallbackCodes(this.options.fallbackLng)[0]),o}},{key:"getFallbackCodes",value:function(n,r){if(!n)return[];if(typeof n=="function"&&(n=n(r)),typeof n=="string"&&(n=[n]),Object.prototype.toString.apply(n)==="[object Array]")return n;if(!r)return n.default||[];var o=n[r];return o||(o=n[this.getScriptPartFromCode(r)]),o||(o=n[this.formatLanguageCode(r)]),o||(o=n[this.getLanguagePartFromCode(r)]),o||(o=n.default),o||[]}},{key:"toResolveHierarchy",value:function(n,r){var o=this,i=this.getFallbackCodes(r||this.options.fallbackLng||[],n),s=[],l=function(u){u&&(o.isSupportedCode(u)?s.push(u):o.logger.warn("rejecting language code not found in supportedLngs: ".concat(u)))};return typeof n=="string"&&n.indexOf("-")>-1?(this.options.load!=="languageOnly"&&l(this.formatLanguageCode(n)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&l(this.getScriptPartFromCode(n)),this.options.load!=="currentOnly"&&l(this.getLanguagePartFromCode(n))):typeof n=="string"&&l(this.formatLanguageCode(n)),i.forEach(function(a){s.indexOf(a)<0&&l(o.formatLanguageCode(a))}),s}}]),e}(),oT=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],iT={1:function(t){return Number(t>1)},2:function(t){return Number(t!=1)},3:function(t){return 0},4:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function(t){return Number(t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function(t){return Number(t==1?0:t>=2&&t<=4?1:2)},7:function(t){return Number(t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function(t){return Number(t==1?0:t==2?1:t!=8&&t!=11?2:3)},9:function(t){return Number(t>=2)},10:function(t){return Number(t==1?0:t==2?1:t<7?2:t<11?3:4)},11:function(t){return Number(t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3)},12:function(t){return Number(t%10!=1||t%100==11)},13:function(t){return Number(t!==0)},14:function(t){return Number(t==1?0:t==2?1:t==3?2:3)},15:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function(t){return Number(t%10==1&&t%100!=11?0:t!==0?1:2)},17:function(t){return Number(t==1||t%10==1&&t%100!=11?0:1)},18:function(t){return Number(t==0?0:t==1?1:2)},19:function(t){return Number(t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function(t){return Number(t==1?0:t==0||t%100>0&&t%100<20?1:2)},21:function(t){return Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0)},22:function(t){return Number(t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3)}},sT=["v1","v2","v3"],hy={zero:0,one:1,two:2,few:3,many:4,other:5};function lT(){var e={};return oT.forEach(function(t){t.lngs.forEach(function(n){e[n]={numbers:t.nr,plurals:iT[t.fc]}})}),e}var aT=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};vt(this,e),this.languageUtils=t,this.options=n,this.logger=Gt.create("pluralResolver"),(!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=lT()}return yt(e,[{key:"addRule",value:function(n,r){this.rules[n]=r}},{key:"getRule",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(n,{type:r.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[n]||this.rules[this.languageUtils.getLanguagePartFromCode(n)]}},{key:"needsPlural",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=this.getRule(n,r);return this.shouldUseIntlApi()?o&&o.resolvedOptions().pluralCategories.length>1:o&&o.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(n,r){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(n,o).map(function(i){return"".concat(r).concat(i)})}},{key:"getSuffixes",value:function(n){var r=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=this.getRule(n,o);return i?this.shouldUseIntlApi()?i.resolvedOptions().pluralCategories.sort(function(s,l){return hy[s]-hy[l]}).map(function(s){return"".concat(r.options.prepend).concat(s)}):i.numbers.map(function(s){return r.getSuffix(n,s,o)}):[]}},{key:"getSuffix",value:function(n,r){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=this.getRule(n,o);return i?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(i.select(r)):this.getSuffixRetroCompatible(i,r):(this.logger.warn("no plural rule found for: ".concat(n)),"")}},{key:"getSuffixRetroCompatible",value:function(n,r){var o=this,i=n.noAbs?n.plurals(r):n.plurals(Math.abs(r)),s=n.numbers[i];this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1&&(s===2?s="plural":s===1&&(s=""));var l=function(){return o.options.prepend&&s.toString()?o.options.prepend+s.toString():s.toString()};return this.options.compatibilityJSON==="v1"?s===1?"":typeof s=="number"?"_plural_".concat(s.toString()):l():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1?l():this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString()}},{key:"shouldUseIntlApi",value:function(){return!sT.includes(this.options.compatibilityJSON)}}]),e}();function gy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Lt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gy(Object(n),!0).forEach(function(r){pn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gy(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var uT=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};vt(this,e),this.logger=Gt.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(n){return n},this.init(t)}return yt(e,[{key:"init",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};n.interpolation||(n.interpolation={escapeValue:!0});var r=n.interpolation;this.escape=r.escape!==void 0?r.escape:Xx,this.escapeValue=r.escapeValue!==void 0?r.escapeValue:!0,this.useRawValueToEscape=r.useRawValueToEscape!==void 0?r.useRawValueToEscape:!1,this.prefix=r.prefix?Ro(r.prefix):r.prefixEscaped||"{{",this.suffix=r.suffix?Ro(r.suffix):r.suffixEscaped||"}}",this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||",",this.unescapePrefix=r.unescapeSuffix?"":r.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":r.unescapeSuffix||"",this.nestingPrefix=r.nestingPrefix?Ro(r.nestingPrefix):r.nestingPrefixEscaped||Ro("$t("),this.nestingSuffix=r.nestingSuffix?Ro(r.nestingSuffix):r.nestingSuffixEscaped||Ro(")"),this.nestingOptionsSeparator=r.nestingOptionsSeparator?r.nestingOptionsSeparator:r.nestingOptionsSeparator||",",this.maxReplaces=r.maxReplaces?r.maxReplaces:1e3,this.alwaysFormat=r.alwaysFormat!==void 0?r.alwaysFormat:!1,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var n="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(n,"g");var r="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(r,"g");var o="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(o,"g")}},{key:"interpolate",value:function(n,r,o,i){var s=this,l,a,u,c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function f(E){return E.replace(/\$/g,"$$$$")}var p=function(d){if(d.indexOf(s.formatSeparator)<0){var g=iy(r,c,d);return s.alwaysFormat?s.format(g,void 0,o,Lt(Lt(Lt({},i),r),{},{interpolationkey:d})):g}var y=d.split(s.formatSeparator),S=y.shift().trim(),w=y.join(s.formatSeparator).trim();return s.format(iy(r,c,S),w,o,Lt(Lt(Lt({},i),r),{},{interpolationkey:S}))};this.resetRegExp();var h=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler,v=i&&i.interpolation&&i.interpolation.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,m=[{regex:this.regexpUnescape,safeValue:function(d){return f(d)}},{regex:this.regexp,safeValue:function(d){return s.escapeValue?f(s.escape(d)):f(d)}}];return m.forEach(function(E){for(u=0;l=E.regex.exec(n);){var d=l[1].trim();if(a=p(d),a===void 0)if(typeof h=="function"){var g=h(n,l,i);a=typeof g=="string"?g:""}else if(i&&Object.prototype.hasOwnProperty.call(i,d))a="";else if(v){a=l[0];continue}else s.logger.warn("missed to pass in variable ".concat(d," for interpolating ").concat(n)),a="";else typeof a!="string"&&!s.useRawValueToEscape&&(a=ry(a));var y=E.safeValue(a);if(n=n.replace(l[0],y),v?(E.regex.lastIndex+=a.length,E.regex.lastIndex-=l[0].length):E.regex.lastIndex=0,u++,u>=s.maxReplaces)break}}),n}},{key:"nest",value:function(n,r){var o=this,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,l,a;function u(h,v){var m=this.nestingOptionsSeparator;if(h.indexOf(m)<0)return h;var E=h.split(new RegExp("".concat(m,"[ ]*{"))),d="{".concat(E[1]);h=E[0],d=this.interpolate(d,a);var g=d.match(/'/g),y=d.match(/"/g);(g&&g.length%2===0&&!y||y.length%2!==0)&&(d=d.replace(/'/g,'"'));try{a=JSON.parse(d),v&&(a=Lt(Lt({},v),a))}catch(S){return this.logger.warn("failed parsing options string in nesting for key ".concat(h),S),"".concat(h).concat(m).concat(d)}return delete a.defaultValue,h}for(;s=this.nestingRegexp.exec(n);){var c=[];a=Lt({},i),a=a.replace&&typeof a.replace!="string"?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;var f=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){var p=s[1].split(this.formatSeparator).map(function(h){return h.trim()});s[1]=p.shift(),c=p,f=!0}if(l=r(u.call(this,s[1].trim(),a),a),l&&s[0]===n&&typeof l!="string")return l;typeof l!="string"&&(l=ry(l)),l||(this.logger.warn("missed to resolve ".concat(s[1]," for nesting ").concat(n)),l=""),f&&(l=c.reduce(function(h,v){return o.format(h,v,i.lng,Lt(Lt({},i),{},{interpolationkey:s[1].trim()}))},l.trim())),n=n.replace(s[0],l),this.regexp.lastIndex=0}return n}}]),e}();function my(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function hn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?my(Object(n),!0).forEach(function(r){pn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):my(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function cT(e){var t=e.toLowerCase().trim(),n={};if(e.indexOf("(")>-1){var r=e.split("(");t=r[0].toLowerCase().trim();var o=r[1].substring(0,r[1].length-1);if(t==="currency"&&o.indexOf(":")<0)n.currency||(n.currency=o.trim());else if(t==="relativetime"&&o.indexOf(":")<0)n.range||(n.range=o.trim());else{var i=o.split(";");i.forEach(function(s){if(s){var l=s.split(":"),a=jx(l),u=a[0],c=a.slice(1),f=c.join(":").trim().replace(/^'+|'+$/g,"");n[u.trim()]||(n[u.trim()]=f),f==="false"&&(n[u.trim()]=!1),f==="true"&&(n[u.trim()]=!0),isNaN(f)||(n[u.trim()]=parseInt(f,10))}})}}return{formatName:t,formatOptions:n}}function No(e){var t={};return function(r,o,i){var s=o+JSON.stringify(i),l=t[s];return l||(l=e(o,i),t[s]=l),l(r)}}var fT=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};vt(this,e),this.logger=Gt.create("formatter"),this.options=t,this.formats={number:No(function(n,r){var o=new Intl.NumberFormat(n,hn({},r));return function(i){return o.format(i)}}),currency:No(function(n,r){var o=new Intl.NumberFormat(n,hn(hn({},r),{},{style:"currency"}));return function(i){return o.format(i)}}),datetime:No(function(n,r){var o=new Intl.DateTimeFormat(n,hn({},r));return function(i){return o.format(i)}}),relativetime:No(function(n,r){var o=new Intl.RelativeTimeFormat(n,hn({},r));return function(i){return o.format(i,r.range||"day")}}),list:No(function(n,r){var o=new Intl.ListFormat(n,hn({},r));return function(i){return o.format(i)}})},this.init(t)}return yt(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},o=r.interpolation;this.formatSeparator=o.formatSeparator?o.formatSeparator:o.formatSeparator||","}},{key:"add",value:function(n,r){this.formats[n.toLowerCase().trim()]=r}},{key:"addCached",value:function(n,r){this.formats[n.toLowerCase().trim()]=No(r)}},{key:"format",value:function(n,r,o){var i=this,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},l=r.split(this.formatSeparator),a=l.reduce(function(u,c){var f=cT(c),p=f.formatName,h=f.formatOptions;if(i.formats[p]){var v=u;try{var m=s&&s.formatParams&&s.formatParams[s.interpolationkey]||{},E=m.locale||m.lng||s.locale||s.lng||o;v=i.formats[p](u,E,hn(hn(hn({},h),s),m))}catch(d){i.logger.warn(d)}return v}else i.logger.warn("there was no format function for ".concat(p));return u},n);return a}}]),e}();function vy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function yy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vy(Object(n),!0).forEach(function(r){pn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vy(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dT(e){var t=pT();return function(){var r=Wt(e),o;if(t){var i=Wt(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return Hi(this,o)}}function pT(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function hT(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}var gT=function(e){Jl(n,e);var t=dT(n);function n(r,o,i){var s,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return vt(this,n),s=t.call(this),ta&&Wn.call(jn(s)),s.backend=r,s.store=o,s.services=i,s.languageUtils=i.languageUtils,s.options=l,s.logger=Gt.create("backendConnector"),s.waitingReads=[],s.maxParallelReads=l.maxParallelReads||10,s.readingCalls=0,s.maxRetries=l.maxRetries>=0?l.maxRetries:5,s.retryTimeout=l.retryTimeout>=1?l.retryTimeout:350,s.state={},s.queue=[],s.backend&&s.backend.init&&s.backend.init(i,l.backend,l),s}return yt(n,[{key:"queueLoad",value:function(o,i,s,l){var a=this,u={},c={},f={},p={};return o.forEach(function(h){var v=!0;i.forEach(function(m){var E="".concat(h,"|").concat(m);!s.reload&&a.store.hasResourceBundle(h,m)?a.state[E]=2:a.state[E]<0||(a.state[E]===1?c[E]===void 0&&(c[E]=!0):(a.state[E]=1,v=!1,c[E]===void 0&&(c[E]=!0),u[E]===void 0&&(u[E]=!0),p[m]===void 0&&(p[m]=!0)))}),v||(f[h]=!0)}),(Object.keys(u).length||Object.keys(c).length)&&this.queue.push({pending:c,pendingCount:Object.keys(c).length,loaded:{},errors:[],callback:l}),{toLoad:Object.keys(u),pending:Object.keys(c),toLoadLanguages:Object.keys(f),toLoadNamespaces:Object.keys(p)}}},{key:"loaded",value:function(o,i,s){var l=o.split("|"),a=l[0],u=l[1];i&&this.emit("failedLoading",a,u,i),s&&this.store.addResourceBundle(a,u,s),this.state[o]=i?-1:2;var c={};this.queue.forEach(function(f){Kx(f.loaded,[a],u),hT(f,o),i&&f.errors.push(i),f.pendingCount===0&&!f.done&&(Object.keys(f.loaded).forEach(function(p){c[p]||(c[p]={});var h=f.loaded[p];h.length&&h.forEach(function(v){c[p][v]===void 0&&(c[p][v]=!0)})}),f.done=!0,f.errors.length?f.callback(f.errors):f.callback())}),this.emit("loaded",c),this.queue=this.queue.filter(function(f){return!f.done})}},{key:"read",value:function(o,i,s){var l=this,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,u=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,c=arguments.length>5?arguments[5]:void 0;if(!o.length)return c(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:o,ns:i,fcName:s,tried:a,wait:u,callback:c});return}this.readingCalls++;var f=function(m,E){if(l.readingCalls--,l.waitingReads.length>0){var d=l.waitingReads.shift();l.read(d.lng,d.ns,d.fcName,d.tried,d.wait,d.callback)}if(m&&E&&a<l.maxRetries){setTimeout(function(){l.read.call(l,o,i,s,a+1,u*2,c)},u);return}c(m,E)},p=this.backend[s].bind(this.backend);if(p.length===2){try{var h=p(o,i);h&&typeof h.then=="function"?h.then(function(v){return f(null,v)}).catch(f):f(null,h)}catch(v){f(v)}return}return p(o,i,f)}},{key:"prepareLoading",value:function(o,i){var s=this,l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),a&&a();typeof o=="string"&&(o=this.languageUtils.toResolveHierarchy(o)),typeof i=="string"&&(i=[i]);var u=this.queueLoad(o,i,l,a);if(!u.toLoad.length)return u.pending.length||a(),null;u.toLoad.forEach(function(c){s.loadOne(c)})}},{key:"load",value:function(o,i,s){this.prepareLoading(o,i,{},s)}},{key:"reload",value:function(o,i,s){this.prepareLoading(o,i,{reload:!0},s)}},{key:"loadOne",value:function(o){var i=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",l=o.split("|"),a=l[0],u=l[1];this.read(a,u,"read",void 0,void 0,function(c,f){c&&i.logger.warn("".concat(s,"loading namespace ").concat(u," for language ").concat(a," failed"),c),!c&&f&&i.logger.log("".concat(s,"loaded namespace ").concat(u," for language ").concat(a),f),i.loaded(o,c,f)})}},{key:"saveMissing",value:function(o,i,s,l,a){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},c=arguments.length>6&&arguments[6]!==void 0?arguments[6]:function(){};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(i)){this.logger.warn('did not save key "'.concat(s,'" as the namespace "').concat(i,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(s==null||s==="")){if(this.backend&&this.backend.create){var f=yy(yy({},u),{},{isUpdate:a}),p=this.backend.create.bind(this.backend);if(p.length<6)try{var h;p.length===5?h=p(o,i,s,l,f):h=p(o,i,s,l),h&&typeof h.then=="function"?h.then(function(v){return c(null,v)}).catch(c):c(null,h)}catch(v){c(v)}else p(o,i,s,l,c,f)}!o||!o[0]||this.store.addResource(o[0],i,s,l)}}}]),n}(Wn);function Ey(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){var n={};if(bt(t[1])==="object"&&(n=t[1]),typeof t[1]=="string"&&(n.defaultValue=t[1]),typeof t[2]=="string"&&(n.tDescription=t[2]),bt(t[2])==="object"||bt(t[3])==="object"){var r=t[3]||t[2];Object.keys(r).forEach(function(o){n[o]=r[o]})}return n},interpolation:{escapeValue:!0,format:function(t,n,r,o){return t},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function Sy(e){return typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function _y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Yt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_y(Object(n),!0).forEach(function(r){pn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_y(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mT(e){var t=vT();return function(){var r=Wt(e),o;if(t){var i=Wt(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return Hi(this,o)}}function vT(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ra(){}function yT(e){var t=Object.getOwnPropertyNames(Object.getPrototypeOf(e));t.forEach(function(n){typeof e[n]=="function"&&(e[n]=e[n].bind(e))})}var oa=function(e){Jl(n,e);var t=mT(n);function n(){var r,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(vt(this,n),r=t.call(this),ta&&Wn.call(jn(r)),r.options=Sy(o),r.services={},r.logger=Gt,r.modules={external:[]},yT(jn(r)),i&&!r.isInitialized&&!o.isClone){if(!r.options.initImmediate)return r.init(o,i),Hi(r,jn(r));setTimeout(function(){r.init(o,i)},0)}return r}return yt(n,[{key:"init",value:function(){var o=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1?arguments[1]:void 0;typeof i=="function"&&(s=i,i={}),!i.defaultNS&&i.defaultNS!==!1&&i.ns&&(typeof i.ns=="string"?i.defaultNS=i.ns:i.ns.indexOf("translation")<0&&(i.defaultNS=i.ns[0]));var l=Ey();this.options=Yt(Yt(Yt({},l),this.options),Sy(i)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=Yt(Yt({},l.interpolation),this.options.interpolation)),i.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=i.keySeparator),i.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=i.nsSeparator);function a(d){return d?typeof d=="function"?new d:d:null}if(!this.options.isClone){this.modules.logger?Gt.init(a(this.modules.logger),this.options):Gt.init(null,this.options);var u;this.modules.formatter?u=this.modules.formatter:typeof Intl<"u"&&(u=fT);var c=new py(this.options);this.store=new tT(this.options.resources,this.options);var f=this.services;f.logger=Gt,f.resourceStore=this.store,f.languageUtils=c,f.pluralResolver=new aT(c,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),u&&(!this.options.interpolation.format||this.options.interpolation.format===l.interpolation.format)&&(f.formatter=a(u),f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new uT(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new gT(a(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",function(d){for(var g=arguments.length,y=new Array(g>1?g-1:0),S=1;S<g;S++)y[S-1]=arguments[S];o.emit.apply(o,[d].concat(y))}),this.modules.languageDetector&&(f.languageDetector=a(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=a(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new dy(this.services,this.options),this.translator.on("*",function(d){for(var g=arguments.length,y=new Array(g>1?g-1:0),S=1;S<g;S++)y[S-1]=arguments[S];o.emit.apply(o,[d].concat(y))}),this.modules.external.forEach(function(d){d.init&&d.init(o)})}if(this.format=this.options.interpolation.format,s||(s=ra),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var p=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);p.length>0&&p[0]!=="dev"&&(this.options.lng=p[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var h=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];h.forEach(function(d){o[d]=function(){var g;return(g=o.store)[d].apply(g,arguments)}});var v=["addResource","addResources","addResourceBundle","removeResourceBundle"];v.forEach(function(d){o[d]=function(){var g;return(g=o.store)[d].apply(g,arguments),o}});var m=ji(),E=function(){var g=function(S,w){o.isInitialized&&!o.initializedStoreOnce&&o.logger.warn("init: i18next is already initialized. You should call init just once!"),o.isInitialized=!0,o.options.isClone||o.logger.log("initialized",o.options),o.emit("initialized",o.options),m.resolve(w),s(S,w)};if(o.languages&&o.options.compatibilityAPI!=="v1"&&!o.isInitialized)return g(null,o.t.bind(o));o.changeLanguage(o.options.lng,g)};return this.options.resources||!this.options.initImmediate?E():setTimeout(E,0),m}},{key:"loadResources",value:function(o){var i=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ra,l=s,a=typeof o=="string"?o:this.language;if(typeof o=="function"&&(l=o),!this.options.resources||this.options.partialBundledLanguages){if(a&&a.toLowerCase()==="cimode")return l();var u=[],c=function(h){if(h){var v=i.services.languageUtils.toResolveHierarchy(h);v.forEach(function(m){u.indexOf(m)<0&&u.push(m)})}};if(a)c(a);else{var f=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);f.forEach(function(p){return c(p)})}this.options.preload&&this.options.preload.forEach(function(p){return c(p)}),this.services.backendConnector.load(u,this.options.ns,function(p){!p&&!i.resolvedLanguage&&i.language&&i.setResolvedLanguage(i.language),l(p)})}else l(null)}},{key:"reloadResources",value:function(o,i,s){var l=ji();return o||(o=this.languages),i||(i=this.options.ns),s||(s=ra),this.services.backendConnector.reload(o,i,function(a){l.resolve(),s(a)}),l}},{key:"use",value:function(o){if(!o)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!o.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return o.type==="backend"&&(this.modules.backend=o),(o.type==="logger"||o.log&&o.warn&&o.error)&&(this.modules.logger=o),o.type==="languageDetector"&&(this.modules.languageDetector=o),o.type==="i18nFormat"&&(this.modules.i18nFormat=o),o.type==="postProcessor"&&uy.addPostProcessor(o),o.type==="formatter"&&(this.modules.formatter=o),o.type==="3rdParty"&&this.modules.external.push(o),this}},{key:"setResolvedLanguage",value:function(o){if(!(!o||!this.languages)&&!(["cimode","dev"].indexOf(o)>-1))for(var i=0;i<this.languages.length;i++){var s=this.languages[i];if(!(["cimode","dev"].indexOf(s)>-1)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}}},{key:"changeLanguage",value:function(o,i){var s=this;this.isLanguageChangingTo=o;var l=ji();this.emit("languageChanging",o);var a=function(p){s.language=p,s.languages=s.services.languageUtils.toResolveHierarchy(p),s.resolvedLanguage=void 0,s.setResolvedLanguage(p)},u=function(p,h){h?(a(h),s.translator.changeLanguage(h),s.isLanguageChangingTo=void 0,s.emit("languageChanged",h),s.logger.log("languageChanged",h)):s.isLanguageChangingTo=void 0,l.resolve(function(){return s.t.apply(s,arguments)}),i&&i(p,function(){return s.t.apply(s,arguments)})},c=function(p){!o&&!p&&s.services.languageDetector&&(p=[]);var h=typeof p=="string"?p:s.services.languageUtils.getBestMatchFromCodes(p);h&&(s.language||a(h),s.translator.language||s.translator.changeLanguage(h),s.services.languageDetector&&s.services.languageDetector.cacheUserLanguage&&s.services.languageDetector.cacheUserLanguage(h)),s.loadResources(h,function(v){u(v,h)})};return!o&&this.services.languageDetector&&!this.services.languageDetector.async?c(this.services.languageDetector.detect()):!o&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(c):this.services.languageDetector.detect(c):c(o),l}},{key:"getFixedT",value:function(o,i,s){var l=this,a=function u(c,f){var p;if(bt(f)!=="object"){for(var h=arguments.length,v=new Array(h>2?h-2:0),m=2;m<h;m++)v[m-2]=arguments[m];p=l.options.overloadTranslationOptionHandler([c,f].concat(v))}else p=Yt({},f);p.lng=p.lng||u.lng,p.lngs=p.lngs||u.lngs,p.ns=p.ns||u.ns,p.keyPrefix=p.keyPrefix||s||u.keyPrefix;var E=l.options.keySeparator||".",d;return p.keyPrefix&&Array.isArray(c)?d=c.map(function(g){return"".concat(p.keyPrefix).concat(E).concat(g)}):d=p.keyPrefix?"".concat(p.keyPrefix).concat(E).concat(c):c,l.t(d,p)};return typeof o=="string"?a.lng=o:a.lngs=o,a.ns=i,a.keyPrefix=s,a}},{key:"t",value:function(){var o;return this.translator&&(o=this.translator).translate.apply(o,arguments)}},{key:"exists",value:function(){var o;return this.translator&&(o=this.translator).exists.apply(o,arguments)}},{key:"setDefaultNamespace",value:function(o){this.options.defaultNS=o}},{key:"hasLoadedNamespace",value:function(o){var i=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var l=this.resolvedLanguage||this.languages[0],a=this.options?this.options.fallbackLng:!1,u=this.languages[this.languages.length-1];if(l.toLowerCase()==="cimode")return!0;var c=function(h,v){var m=i.services.backendConnector.state["".concat(h,"|").concat(v)];return m===-1||m===2};if(s.precheck){var f=s.precheck(this,c);if(f!==void 0)return f}return!!(this.hasResourceBundle(l,o)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||c(l,o)&&(!a||c(u,o)))}},{key:"loadNamespaces",value:function(o,i){var s=this,l=ji();return this.options.ns?(typeof o=="string"&&(o=[o]),o.forEach(function(a){s.options.ns.indexOf(a)<0&&s.options.ns.push(a)}),this.loadResources(function(a){l.resolve(),i&&i(a)}),l):(i&&i(),Promise.resolve())}},{key:"loadLanguages",value:function(o,i){var s=ji();typeof o=="string"&&(o=[o]);var l=this.options.preload||[],a=o.filter(function(u){return l.indexOf(u)<0});return a.length?(this.options.preload=l.concat(a),this.loadResources(function(u){s.resolve(),i&&i(u)}),s):(i&&i(),Promise.resolve())}},{key:"dir",value:function(o){if(o||(o=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!o)return"rtl";var i=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],s=this.services&&this.services.languageUtils||new py(Ey());return i.indexOf(s.getLanguagePartFromCode(o))>-1||o.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var o=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ra,l=Yt(Yt(Yt({},this.options),i),{isClone:!0}),a=new n(l);(i.debug!==void 0||i.prefix!==void 0)&&(a.logger=a.logger.clone(i));var u=["store","services","language"];return u.forEach(function(c){a[c]=o[c]}),a.services=Yt({},this.services),a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a.translator=new dy(a.services,a.options),a.translator.on("*",function(c){for(var f=arguments.length,p=new Array(f>1?f-1:0),h=1;h<f;h++)p[h-1]=arguments[h];a.emit.apply(a,[c].concat(p))}),a.init(l,s),a.translator.options=a.options,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),n}(Wn);pn(oa,"createInstance",function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new oa(e,t)});var Oe=oa.createInstance();Oe.createInstance=oa.createInstance,Oe.createInstance,Oe.dir,Oe.init,Oe.loadResources,Oe.reloadResources,Oe.use,Oe.changeLanguage,Oe.getFixedT,Oe.t,Oe.exists,Oe.setDefaultNamespace,Oe.hasLoadedNamespace,Oe.loadNamespaces,Oe.loadLanguages;var wy=[],ET=wy.forEach,ST=wy.slice;function _T(e){return ET.call(ST.call(arguments,1),function(t){if(t)for(var n in t)e[n]===void 0&&(e[n]=t[n])}),e}var Ry=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,wT=function(t,n,r){var o=r||{};o.path=o.path||"/";var i=encodeURIComponent(n),s="".concat(t,"=").concat(i);if(o.maxAge>0){var l=o.maxAge-0;if(Number.isNaN(l))throw new Error("maxAge should be a Number");s+="; Max-Age=".concat(Math.floor(l))}if(o.domain){if(!Ry.test(o.domain))throw new TypeError("option domain is invalid");s+="; Domain=".concat(o.domain)}if(o.path){if(!Ry.test(o.path))throw new TypeError("option path is invalid");s+="; Path=".concat(o.path)}if(o.expires){if(typeof o.expires.toUTCString!="function")throw new TypeError("option expires is invalid");s+="; Expires=".concat(o.expires.toUTCString())}if(o.httpOnly&&(s+="; HttpOnly"),o.secure&&(s+="; Secure"),o.sameSite){var a=typeof o.sameSite=="string"?o.sameSite.toLowerCase():o.sameSite;switch(a){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;case"none":s+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return s},Ny={create:function(t,n,r,o){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};r&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+r*60*1e3)),o&&(i.domain=o),document.cookie=wT(t,encodeURIComponent(n),i)},read:function(t){for(var n="".concat(t,"="),r=document.cookie.split(";"),o=0;o<r.length;o++){for(var i=r[o];i.charAt(0)===" ";)i=i.substring(1,i.length);if(i.indexOf(n)===0)return i.substring(n.length,i.length)}return null},remove:function(t){this.create(t,"",-1)}},RT={name:"cookie",lookup:function(t){var n;if(t.lookupCookie&&typeof document<"u"){var r=Ny.read(t.lookupCookie);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupCookie&&typeof document<"u"&&Ny.create(n.lookupCookie,t,n.cookieMinutes,n.cookieDomain,n.cookieOptions)}},NT={name:"querystring",lookup:function(t){var n;if(typeof window<"u"){var r=window.location.search;!window.location.search&&window.location.hash&&window.location.hash.indexOf("?")>-1&&(r=window.location.hash.substring(window.location.hash.indexOf("?")));for(var o=r.substring(1),i=o.split("&"),s=0;s<i.length;s++){var l=i[s].indexOf("=");if(l>0){var a=i[s].substring(0,l);a===t.lookupQuerystring&&(n=i[s].substring(l+1))}}}return n}},Wi=null,Oy=function(){if(Wi!==null)return Wi;try{Wi=window!=="undefined"&&window.localStorage!==null;var t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{Wi=!1}return Wi},OT={name:"localStorage",lookup:function(t){var n;if(t.lookupLocalStorage&&Oy()){var r=window.localStorage.getItem(t.lookupLocalStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupLocalStorage&&Oy()&&window.localStorage.setItem(n.lookupLocalStorage,t)}},Gi=null,xy=function(){if(Gi!==null)return Gi;try{Gi=window!=="undefined"&&window.sessionStorage!==null;var t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{Gi=!1}return Gi},xT={name:"sessionStorage",lookup:function(t){var n;if(t.lookupSessionStorage&&xy()){var r=window.sessionStorage.getItem(t.lookupSessionStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupSessionStorage&&xy()&&window.sessionStorage.setItem(n.lookupSessionStorage,t)}},TT={name:"navigator",lookup:function(t){var n=[];if(typeof navigator<"u"){if(navigator.languages)for(var r=0;r<navigator.languages.length;r++)n.push(navigator.languages[r]);navigator.userLanguage&&n.push(navigator.userLanguage),navigator.language&&n.push(navigator.language)}return n.length>0?n:void 0}},IT={name:"htmlTag",lookup:function(t){var n,r=t.htmlTag||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},CT={name:"path",lookup:function(t){var n;if(typeof window<"u"){var r=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(r instanceof Array)if(typeof t.lookupFromPathIndex=="number"){if(typeof r[t.lookupFromPathIndex]!="string")return;n=r[t.lookupFromPathIndex].replace("/","")}else n=r[0].replace("/","")}return n}},AT={name:"subdomain",lookup:function(t){var n=typeof t.lookupFromSubdomainIndex=="number"?t.lookupFromSubdomainIndex+1:1,r=typeof window<"u"&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r[n]}};function bT(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var Ty=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};vt(this,e),this.type="languageDetector",this.detectors={},this.init(t,n)}return yt(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n,this.options=_T(r,this.options||{},bT()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=o,this.addDetector(RT),this.addDetector(NT),this.addDetector(OT),this.addDetector(xT),this.addDetector(TT),this.addDetector(IT),this.addDetector(CT),this.addDetector(AT)}},{key:"addDetector",value:function(n){this.detectors[n.name]=n}},{key:"detect",value:function(n){var r=this;n||(n=this.options.order);var o=[];return n.forEach(function(i){if(r.detectors[i]){var s=r.detectors[i].lookup(r.options);s&&typeof s=="string"&&(s=[s]),s&&(o=o.concat(s))}}),this.services.languageUtils.getBestMatchFromCodes?o:o.length>0?o[0]:null}},{key:"cacheUserLanguage",value:function(n,r){var o=this;r||(r=this.options.caches),r&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(n)>-1||r.forEach(function(i){o.detectors[i]&&o.detectors[i].cacheUserLanguage(n,o.options)}))}}]),e}();Ty.type="languageDetector";var LT=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,DT={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},kT=function(t){return DT[t]},PT=function(t){return t.replace(LT,kT)};function Iy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Cy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Iy(Object(n),!0).forEach(function(r){pn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Iy(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Ay={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:PT};function MT(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ay=Cy(Cy({},Ay),e)}var UT={type:"3rdParty",init:function(t){MT(t.options.react)}};O.createContext(),function(){function e(){vt(this,e),this.usedNamespaces={}}return yt(e,[{key:"addUsedNamespaces",value:function(n){var r=this;n.forEach(function(o){r.usedNamespaces[o]||(r.usedNamespaces[o]=!0)})}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),e}();const FT={ABOUT:"About",ACTION:"Action",ADD_CONDITION:"Add Condition",ADD_OPTION:"Add Option",ADD_VARIABLE:"Add Variable",ANSWER_CALL:"Answer Call",ANSWERED:"Answered",API_VERSION:"API Version",APP_VERSION:"App Version",BEEP_SUBTITLE:"Play a beep before recording",BEEP:"Beep",BUILDER_VERSION:"Builder Version",BUSY:"Busy",CALL_ADDRESSES:"Call Addresses",CALL_NUMBERS:"Call Numbers",CALL_RESOURCES:"Call Resources",CALLER_PRESSES:"Caller Presses",CHOOSE_OPTION_SINGLE_MULTIPLE:"Choose single or multiple",CHOOSE_OPTION_TTS_AUDIO:"Choose how to play the message",CLOSE:"Close",COND_NUMBER:"Cond {{index}}",CONDITIONS:"Conditions",CONDITION_NUMBER:"Condition {{index}}",DECLINE:"Decline",DECISION:"Decision",DISCONNECT_CALL_AFTER_RINGING:"Disconnect call after ringing",ELSE:"Else",ENTER_URL:"Enter URL",ERROR_ADD_RECORDING_FIRST:"Please add a Start Call Recording node first.",ERROR_DUPLICATE_RECORDING_LABEL:"This entry already exists. Please use a unique label.",ERROR_DUPLICATE_VARIABLE_KEY:"This variable already exists. Please use a unique key.",ERROR_INVALID_JSON:"Invalid JSON",ERROR_NUMBER_IS_REQUIRED:"A number is required.",ERROR_NUMBER_MIN_MAX_IS_REQUIRED:"A number between {{min}} and {{max}} is required.",ERROR_RECORDING_LABEL_REQUIRED:"A value is required. Maximum 20 characters.",ERROR_STRING_VALUE_REQUIRED:"Invalid character. String value is required.",ERROR_TELEPHONE_KEY_REQUIRED:"A value of 0-9, *, or # is required.",ERROR_TERMINATORS:"This value should contain only 0-9, *, or #.",ERROR_TEXT_IS_REQUIRED:"A text value is required.",ERROR_URL_IS_REQUIRED:"A valid URL is required.",ERROR_VALUE_IS_REQUIRED:"A value is required.",ERROR_VARIABLE_KEY_REQUIRED:"Valid characters are lowercase letters, digits, or underscore. Maximum 20 characters.",SAVE_VARIABLES_SUBTITLE:"Store the response as variables",SAVE_VARIABLES:"Save Variables",ERROR:"Error",FAILED:"Failed",FAILURE:"Failure",FORMAT:"Format",FORWARD:"Forward",FORWARD_TO_ADDRESS:"Forward to Address",FORWARD_TO_PHONE:"Forward to Phone",FORWARD_TO_RESOURCE:"Forward to Resource",FROM_PHONE_NUMBER:"From Phone Number",FROM:"From",GATHER_INPUT:"Gather Input",HANDLE_CALL:"Handle Call",HANG_UP_CALL:"Hang Up Call",HANG_UP:"Hang Up",INFO_NODE_ANSWER:"This is the info text for the Answer node.",INFO_NODE_COND:"This is the info text for the Conditions node.",INFO_NODE_FORWARD_TO_ADDRESS:"This is the info text for the Forward to Address node.",INFO_NODE_FORWARD_TO_PHONE:"This is the info text for the Forward to Phone node.",INFO_NODE_FORWARD_TO_RESOURCE:"This is the info text for the Forward to Resource node.",INFO_NODE_GATHER_INPUT:"This is the info text for the Gather Input node.",INFO_NODE_HANG_UP:"This is the info text for the Hang Up node.",INFO_NODE_OPTION_REMOVE:"Are you sure? Removing this option will delete the flow connection and move back the following option, if there is one.",INFO_NODE_PLAY_AUDIO_FILE:"This is the info text for the Play Audio File node.",INFO_NODE_PLAY:"This is the info text for the Play node.",INFO_NODE_RECORD_CALL_START:"This is the info text for the Record Call Start node.",INFO_NODE_RECORD_CALL_STOP:"This is the info text for the Record Call Stop node.",INFO_NODE_RECORD:"This is the info text for the Record node.",INFO_NODE_REQUEST:"This is the info text for the Request node.",INFO_NODE_SEND_SMS:"This is the info text for the Send SMS node.",INFO_NODE_SET_VARIABLES_OPTION:"Are you sure you want to remove this variable?",INFO_NODE_SET_VARIABLES:"This is the info text for the Set Variables node.",INFO_NODE_TEXT_TO_SPEECH:"This is the info text for the Text to Speech node.",INFO_NODE_UNSET_VARIABLES:"This is the info text for the Unset Variables node.",INPUT:"Input",KEY:"Key",METHOD:"Method",MORE_INFO_TITLE:"More info {{title}}",MULTIPLE_ADDRESSES:"Multiple Addresses",MULTIPLE_NUMBERS:"Multiple Numbers",MULTIPLE_RESOURCES:"Multiple Resources",NAVIGATE_BACK:"Navigate Back",NO_ANSWER:"No Answer",NO_INPUT:"No Input",NO_VARIABLES_SET:"Please set variables first",NUMBER_OF_VARIABLES_SELECTED_one:"{{count}} variable selected",NUMBER_OF_VARIABLES_SELECTED_other:"{{count}} variables selected",OFF:"Off",ON:"On",OPT_NUMBER:"Opt {{index}}",OPTION_NUMBER:"Option {{index}}",OPTIONAL:"optional",OR_SAYS:"Or says",PHONE_NUMBER:"Phone Number",PLAY_AUDIO_FILE:"Play Audio File",PLAY_AUDIO_TTS:"Play Audio or TTS",PROMPT_TEXT_TO_SPEECH:"Prompt Text to Speech",REASON:"Reason",RECORD_CALL_START:"Start Call Recording",RECORD_CALL_STOP:"Stop Call Recording",RECORD:"Record",RECORDING_NAME_DEFAULT:"Recording {{index}}",RECORDING_NAME:"Recording Name",RECORDING:"Recording",RELAYML_VERSION:"RelayML Version",REMOVE_CONDITION:"Remove Condition {{index}}",REMOVE_EDGE:"Remove Edge",REMOVE_NODE:"Remove Node {{title}}",REMOVE_OPTION:"Remove Option {{index}}",REMOVE_VARIABLE:"Remove Variable {{index}}",REQUEST_BODY:"Body",REQUEST_HEADERS:"Headers (JSON)",REQUEST:"Request",SECONDS:"seconds",SELECT_VARIABLES_TO_UNSET:"Select Variables to Unset",SELECT_VARIABLES:"Select Variables",SELECT:"Select",SEND_SMS:"Send SMS",SEQUENTIALLY:"Sequentially",SET_VARIABLES:"Set Variables",SETTINGS:"Settings",SIMULTANEOUSLY:"Simultaneously",SINGLE_ADDRESS:"Single Address",SINGLE_NUMBER:"Single Number",SINGLE_RESOURCE:"Single Resource",SMS_TEXT:"SMS Text",STEREO_SUBTITLE:"Enable stereo audio",STEREO:"Stereo",SUCCESS:"Success",TERMINATORS:"Terminators",TEXT_TO_SPEECH:"Text to Speech",TEXT:"Text",TO_PHONE_NUMBER:"To Phone Number",TO:"To",UNKNOWN:"Unknown",UNSET_VARIABLES:"Unset Variables",URL:"URL",VALUE:"Value",VARIABLE_KEY:"Variable {{key}}",VOICEMAIL_RECORDING:"Voicemail Recording",WAIT_FOR_INPUT:"Wait for Input",WRITE_SOMETHING:"Write something"},I={ABOUT:"ABOUT",ACTION:"ACTION",ADD_CONDITION:"ADD_CONDITION",ADD_OPTION:"ADD_OPTION",ADD_VARIABLE:"ADD_VARIABLE",ANSWER_CALL:"ANSWER_CALL",ANSWERED:"ANSWERED",API_VERSION:"API_VERSION",APP_VERSION:"APP_VERSION",BEEP_SUBTITLE:"BEEP_SUBTITLE",BEEP:"BEEP",BUILDER_VERSION:"BUILDER_VERSION",BUSY:"BUSY",CALL_ADDRESSES:"CALL_ADDRESSES",CALL_NUMBERS:"CALL_NUMBERS",CALL_RESOURCES:"CALL_RESOURCES",CALLER_PRESSES:"CALLER_PRESSES",CHOOSE_OPTION_SINGLE_MULTIPLE:"CHOOSE_OPTION_SINGLE_MULTIPLE",CHOOSE_OPTION_TTS_AUDIO:"CHOOSE_OPTION_TTS_AUDIO",CLOSE:"CLOSE",COND_NUMBER:"COND_NUMBER",CONDITIONS:"CONDITIONS",CONDITION_NUMBER:"CONDITION_NUMBER",DECISION:"DECISION",DECLINE:"DECLINE",DISCONNECT_CALL_AFTER_RINGING:"DISCONNECT_CALL_AFTER_RINGING",ELSE:"ELSE",ENTER_URL:"ENTER_URL",ERROR_ADD_RECORDING_FIRST:"ERROR_ADD_RECORDING_FIRST",ERROR_DUPLICATE_RECORDING_LABEL:"ERROR_DUPLICATE_RECORDING_LABEL",ERROR_DUPLICATE_VARIABLE_KEY:"ERROR_DUPLICATE_VARIABLE_KEY",ERROR_INVALID_JSON:"ERROR_INVALID_JSON",ERROR_NUMBER_IS_REQUIRED:"ERROR_NUMBER_IS_REQUIRED",ERROR_NUMBER_MIN_MAX_IS_REQUIRED:"ERROR_NUMBER_MIN_MAX_IS_REQUIRED",ERROR_RECORDING_LABEL_REQUIRED:"ERROR_RECORDING_LABEL_REQUIRED",ERROR_STRING_VALUE_REQUIRED:"ERROR_STRING_VALUE_REQUIRED",ERROR_TELEPHONE_KEY_REQUIRED:"ERROR_TELEPHONE_KEY_REQUIRED",ERROR_TERMINATORS:"ERROR_TERMINATORS",ERROR_TEXT_IS_REQUIRED:"ERROR_TEXT_IS_REQUIRED",ERROR_URL_IS_REQUIRED:"ERROR_URL_IS_REQUIRED",ERROR_VALUE_IS_REQUIRED:"ERROR_VALUE_IS_REQUIRED",ERROR_VARIABLE_KEY_REQUIRED:"ERROR_VARIABLE_KEY_REQUIRED",ERROR:"ERROR",FAILED:"FAILED",FAILURE:"FAILURE",FORMAT:"FORMAT",FORWARD:"FORWARD",FORWARD_TO_ADDRESS:"FORWARD_TO_ADDRESS",FORWARD_TO_PHONE:"FORWARD_TO_PHONE",FORWARD_TO_RESOURCE:"FORWARD_TO_RESOURCE",FROM_PHONE_NUMBER:"FROM_PHONE_NUMBER",FROM:"FROM",GATHER_INPUT:"GATHER_INPUT",HANDLE_CALL:"HANDLE_CALL",HANG_UP_CALL:"HANG_UP_CALL",HANG_UP:"HANG_UP",INFO_NODE_ANSWER:"INFO_NODE_ANSWER",INFO_NODE_COND:"INFO_NODE_COND",INFO_NODE_FORWARD_TO_ADDRESS:"INFO_NODE_FORWARD_TO_ADDRESS",INFO_NODE_FORWARD_TO_PHONE:"INFO_NODE_FORWARD_TO_PHONE",INFO_NODE_FORWARD_TO_RESOURCE:"INFO_NODE_FORWARD_TO_RESOURCE",INFO_NODE_GATHER_INPUT:"INFO_NODE_GATHER_INPUT",INFO_NODE_HANG_UP:"INFO_NODE_HANG_UP",INFO_NODE_OPTION_REMOVE:"INFO_NODE_OPTION_REMOVE",INFO_NODE_PLAY_AUDIO_FILE:"INFO_NODE_PLAY_AUDIO_FILE",INFO_NODE_PLAY:"INFO_NODE_PLAY",INFO_NODE_RECORD_CALL_START:"INFO_NODE_RECORD_CALL_START",INFO_NODE_RECORD_CALL_STOP:"INFO_NODE_RECORD_CALL_STOP",INFO_NODE_RECORD:"INFO_NODE_RECORD",INFO_NODE_REQUEST:"INFO_NODE_REQUEST",INFO_NODE_SEND_SMS:"INFO_NODE_SEND_SMS",INFO_NODE_SET_VARIABLES_OPTION:"INFO_NODE_SET_VARIABLES_OPTION",INFO_NODE_SET_VARIABLES:"INFO_NODE_SET_VARIABLES",INFO_NODE_TEXT_TO_SPEECH:"INFO_NODE_TEXT_TO_SPEECH",INFO_NODE_UNSET_VARIABLES:"INFO_NODE_UNSET_VARIABLES",INPUT:"INPUT",KEY:"KEY",METHOD:"METHOD",MORE_INFO_TITLE:"MORE_INFO_TITLE",MULTIPLE_ADDRESSES:"MULTIPLE_ADDRESSES",MULTIPLE_NUMBERS:"MULTIPLE_NUMBERS",MULTIPLE_RESOURCES:"MULTIPLE_RESOURCES",NAVIGATE_BACK:"NAVIGATE_BACK",NO_ANSWER:"NO_ANSWER",NO_INPUT:"NO_INPUT",NO_VARIABLES_SET:"NO_VARIABLES_SET",NUMBER_OF_VARIABLES_SELECTED:"NUMBER_OF_VARIABLES_SELECTED",OFF:"OFF",ON:"ON",OPT_NUMBER:"OPT_NUMBER",OPTION_NUMBER:"OPTION_NUMBER",OPTIONAL:"OPTIONAL",OR_SAYS:"OR_SAYS",PHONE_NUMBER:"PHONE_NUMBER",PLAY_AUDIO_FILE:"PLAY_AUDIO_FILE",PLAY_AUDIO_TTS:"PLAY_AUDIO_TTS",PROMPT_TEXT_TO_SPEECH:"PROMPT_TEXT_TO_SPEECH",REASON:"REASON",RECORD_CALL_START:"RECORD_CALL_START",RECORD_CALL_STOP:"RECORD_CALL_STOP",RECORD:"RECORD",RECORDING_NAME_DEFAULT:"RECORDING_NAME_DEFAULT",RECORDING_NAME:"RECORDING_NAME",RECORDING:"RECORDING",RELAYML_VERSION:"RELAYML_VERSION",REMOVE_CONDITION:"REMOVE_CONDITION",REMOVE_EDGE:"REMOVE_EDGE",REMOVE_NODE:"REMOVE_NODE",REMOVE_OPTION:"REMOVE_OPTION",REMOVE_VARIABLE:"REMOVE_VARIABLE",REQUEST_BODY:"REQUEST_BODY",REQUEST_HEADERS:"REQUEST_HEADERS",REQUEST:"REQUEST",SECONDS:"SECONDS",SELECT_VARIABLES_TO_UNSET:"SELECT_VARIABLES_TO_UNSET",SELECT_VARIABLES:"SELECT_VARIABLES",SELECT:"SELECT",SEND_SMS:"SEND_SMS",SEQUENTIALLY:"SEQUENTIALLY",SET_VARIABLES:"SET_VARIABLES",SETTINGS:"SETTINGS",SIMULTANEOUSLY:"SIMULTANEOUSLY",SINGLE_ADDRESS:"SINGLE_ADDRESS",SINGLE_NUMBER:"SINGLE_NUMBER",SINGLE_RESOURCE:"SINGLE_RESOURCE",SMS_TEXT:"SMS_TEXT",STEREO_SUBTITLE:"STEREO_SUBTITLE",STEREO:"STEREO",SAVE_VARIABLES_SUBTITLE:"SAVE_VARIABLES_SUBTITLE",SAVE_VARIABLES:"SAVE_VARIABLES",SUCCESS:"SUCCESS",TERMINATORS:"TERMINATORS",TEXT_TO_SPEECH:"TEXT_TO_SPEECH",TEXT:"TEXT",TO_PHONE_NUMBER:"TO_PHONE_NUMBER",TO:"TO",UNKNOWN:"UNKNOWN",UNSET_VARIABLES:"UNSET_VARIABLES",URL:"URL",VALUE:"VALUE",VARIABLE_KEY:"VARIABLE_KEY",VOICEMAIL_RECORDING:"VOICEMAIL_RECORDING",WAIT_FOR_INPUT:"WAIT_FOR_INPUT",WRITE_SOMETHING:"WRITE_SOMETHING"},VT={order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag","path","subdomain"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage","cookie"],excludeCacheFor:["cimode"]},BT={"en-US":{translation:FT}},$T=()=>{Oe.use(Ty).use(UT).init({debug:Lx,detection:VT,fallbackLng:"en-US",interpolation:{escapeValue:!1},keySeparator:!1,resources:BT})};function M(e,t){return t?Oe.t(e,t):Oe.t(e)}const zT={entries:[],nextLabelIndex:0},Gn=xl((e,t)=>({...zT,getEntries(){return t().entries},getEntryValue(n){var r;return(r=t().entries.find(o=>o.controlId===n))==null?void 0:r.label},getGeneratedLabel(){let n="";do this.nextLabelIndex++,n=M(I.RECORDING_NAME_DEFAULT,{index:this.nextLabelIndex});while(this.isValueDuplicate(n));return n},isKeyDuplicate(n){return t().entries.some(r=>r.controlId===n)},isValueDuplicate(n,r){const o=t().entries.reduce((i,s)=>{const{label:l,controlId:a}=s;return l!==""&&l===n&&(!r||a!==r)?[...i,s]:i},[]);return Boolean(o.length)},removeEntry(n){e(r=>({entries:r.entries.filter(o=>o.controlId!==n)}))},upsertEntry:n=>{e(r=>{let o=[...r.entries];const i=Boolean(n.label.trim());return(r.isKeyDuplicate(n.controlId)||!i)&&(o=o.filter(s=>s.controlId!==n.controlId)),i&&o.push({...n}),{entries:o}})}})),HT=e=>{const t=[];e.forEach(n=>{n.type==="recordCallStart"&&n.data.controlId&&n.data.label&&t.push({controlId:n.data.controlId,label:n.data.label})}),Gn.setState({entries:t,nextLabelIndex:t.length})},jT=(e,t)=>{const n=[];return t.forEach(r=>{r.type==="recordCallStart"&&r.data.controlId&&(n.push(r.data.controlId),Gn.getState().removeEntry(r.data.controlId))}),n.length?e.reduce((r,o)=>o.type==="recordCallStop"&&n.includes(o.data.controlId)?[...r,{...o,data:{...o.data,controlId:"",missingRequiredParams:!0}}]:r,[]):[]},by={recordCallStart:e=>{const t=Gn.getState().getGeneratedLabel();return Gn.getState().upsertEntry({controlId:e.data.controlId,label:t}),{...e,data:{...e.data,label:t}}}},WT=e=>qv[e]!==void 0,GT=e=>typeof e=="object"&&e!==null&&Object.keys(e).length>0,YT=e=>by[e.type]!==void 0,Ly=(e,t={})=>{const{deletable:n=!0,position:r={x:300,y:250},selected:o=!0}=t,i=()=>({id:ye(),type:e,position:r,deletable:n,data:{missingRequiredParams:!1},selected:o}),s=(a,u)=>({...a,data:{...a.data,...u,missingRequiredParams:!0}});let l=i();if(WT(e)){const a=qv[e]();GT(a)&&(l=s(l,a))}return YT(l)&&(l=by[l.type](l)),l},ia={apiVersion:void 0,builderVersion:Qv,cfbAppVersion:Kv,relayMLVersion:void 0},KT=e=>{const t={...ia,...e};ia.apiVersion=t.apiVersion,ia.builderVersion=t.builderVersion,ia.relayMLVersion=t.relayMLVersion},Af=()=>({apiVersion:void 0,builderVersion:Qv,cfbAppVersion:Kv,relayMLVersion:void 0}),Dy=1e3,bf=$t(),QT=e=>(t,n,r)=>{let o,i;const s=async()=>{const{httpService:l,nodes:a,edges:u,documentVersion:c}=n(),{builderVersion:f}=Af();bf.debug("Saving data to server"),t({dataHandlingStatus:"saving",saveFlowStatus:"saving"}),clearTimeout(i);try{if(!l)throw new Error("Missing httpService");const h={documentVersion:(await l.putFlow({documentVersion:c,builderVersion:f,nodes:a,edges:u})).document_version};switch(n().dataHandlingStatus){case"saving":t({...h,dataHandlingStatus:"queueing",saveFlowStatus:"saved"});break;case"holding":t({...h,saveFlowStatus:"awaiting-save"}),bf.debug("Setting up a new save for held changes"),i=setTimeout(()=>{s()},Dy);break;default:bf.debug("Saving data to server - invalid state")}}catch(p){console.error("Put Flow",p),t({dataHandlingStatus:"queueing",saveFlowStatus:"error"})}};return r.setState=(l,a,...u)=>{const{dataHandlingStatus:c,initializing:f}=n(),p=typeof l=="function"?l(n()):l;!f&&(p.nodes||p.edges)?c==="queueing"?(p.saveFlowStatus="awaiting-save",t(p,a,...u),clearTimeout(o),o=setTimeout(()=>{s()},Dy)):(p.dataHandlingStatus="holding",t(p,a,...u)):t(p,a,...u)},e(r.setState,n,r)},XT={variables:new Map,keyToIdMap:new Map},Er=xl((e,t)=>({...XT,_dedupeKey(n,r){const o=Array.from(r.values()).find(i=>i.key===n);o&&r.delete(o.id)},isKeyDuplicate(n,r){const o=t().keyToIdMap.get(n);return o?o!==r:!1},removeVariable(n){e(r=>{const o=new Map(r.variables),i=new Map(r.keyToIdMap),s=o.get(n);return s&&(o.delete(n),i.delete(s.key)),{keyToIdMap:i,variables:o}})},setVariables:n=>{e(()=>{const r=new Map,o=new Map;return n.forEach(i=>{const s=o.get(i.key);s&&r.delete(s),r.set(i.id,i),o.set(i.key,i.id)}),{keyToIdMap:o,variables:r}})},upsertVariable:n=>{e(r=>{const o=new Map(r.variables),i=new Map(r.keyToIdMap),s=o.get(n.id),l=i.get(n.key);return l&&o.delete(l),s&&i.delete(s.key),o.set(n.id,n),i.set(n.key,n.id),{keyToIdMap:i,variables:o}})}})),qT=e=>{const t=[];e.forEach(n=>{n.type==="set"&&n.data.variables&&t.push(...n.data.variables)}),Er.getState().setVariables(t)},ZT=e=>{if(e!=null&&e.length){const{removeVariable:t}=Er.getState();e.forEach(n=>{n.type==="set"&&n.data.variables&&n.data.variables.forEach(o=>t(o.id))})}},$e=$t(),JT=Ly("handleCall",{position:{x:300,y:100},deletable:!1}),Yi={backButtonHref:void 0,colorMode:"light",dataHandlingStatus:"queueing",edges:[],edgeUpdateSuccessful:!1,getFlowURL:"",updateFlowURL:"",flowId:"",flowTitle:"",documentVersion:0,httpService:void 0,initializing:!0,isEdgeConnecting:!1,nodes:[],reactFlowInstance:void 0,rootElementId:"",saveFlowStatus:"initial",selectedNode:void 0},we=xl()(QT((e,t)=>({...Yi,reset:()=>{$e.debug("Reset!"),e({nodes:[...Yi.nodes],edges:[...Yi.edges]})},exportStoreData:()=>{const{nodes:n,edges:r}=t();kx(n,r)},addNode:n=>{$e.debug("Add Node",n);const{nodes:r,reactFlowInstance:o}=t();if(!o)throw new Error("ReactFlowInstance not found");const i=150,s=150,l=o.project({x:i,y:s}),a=Ly(n,{position:l}),u=r.map(c=>({...c,selected:!1}));u.push(a),e({nodes:u,selectedNode:a})},getNodeEdges:n=>t().edges.filter(r=>r.source===n),getTargetEdges:n=>t().edges.filter(r=>r.target===n),partialUpdateNodeData:(n,r)=>{var s;$e.debug("partialUpdateNodeData",n,r);const o=[],i=t().nodes.map(l=>{if(l.id===n){if("options"in r&&"options"in l.data){const a=l.data.options.map(c=>c.id),u=r.options.map(c=>c.id);o.push(...a.filter(c=>!u.includes(c)))}return{...l,data:{...l.data,...r}}}return l});if(o.length){const l=t().edges.filter(a=>a.sourceHandle&&o.includes(a.sourceHandle));$e.debug("Remove orphaned edges",{sourceHandleDeleted:o,edgesToDelete:l}),(s=t().reactFlowInstance)==null||s.deleteElements({edges:l})}e({nodes:i})},removeNode:n=>{$e.debug("removeNode",n);const r=t().reactFlowInstance;r&&r.deleteElements({nodes:[{id:n}]})},removeEdge:n=>{$e.debug("removeEdge",n);const r=t().reactFlowInstance;r&&r.deleteElements({edges:[{id:n}]})},onInit:async n=>{const{getFlowURL:r,updateFlowURL:o}=t();$e.log("onInit",{getFlowURL:r,updateFlowURL:o});const i=V_({getFlowURL:r,updateFlowURL:o,headers:Dx()}),s=Af(),{id:l,title:a,document_version:u,flow_data:c}=await i.getFlow();let f=c;f||(f={apiVersion:s.apiVersion,builderVersion:s.builderVersion,relayMLVersion:s.relayMLVersion,edges:Yi.edges,nodes:Yi.nodes.concat([JT])}),e({httpService:i,reactFlowInstance:n,flowId:l,flowTitle:a,documentVersion:u,initializing:!1,nodes:f.nodes.map(Ux),edges:f.edges.map(Mx)}),KT({apiVersion:f.apiVersion,builderVersion:f.builderVersion,relayMLVersion:f.relayMLVersion}),qT(f.nodes),HT(f.nodes)},onNodesChange:n=>{e({nodes:kv(n,t().nodes)})},onNodesDelete:n=>{$e.debug("onNodesDelete"),ZT(n),jT(t().nodes,n).forEach(o=>{we.getState().partialUpdateNodeData(o.id,o.data)})},onEdgesChange:n=>{e({edges:HO(n,t().edges)})},onEdgesDelete:n=>{$e.debug("onEdgesDelete [noop]",n)},onConnect:n=>{$e.debug("onConnect"),e({edges:Qm(n,t().edges)})},onConnectStart:()=>{$e.debug("onConnectStart"),e({isEdgeConnecting:!0})},onConnectEnd:()=>{$e.debug("onConnectEnd"),e({isEdgeConnecting:!1})},onEdgeUpdateStart:()=>{$e.debug("onEdgeUpdateStart"),e({edgeUpdateSuccessful:!1})},onEdgeUpdate:(n,r)=>{$e.debug("onEdgeUpdate"),e({edges:nO(n,r,t().edges),edgeUpdateSuccessful:!0})},onEdgeUpdateEnd:(n,r)=>{var o;$e.debug("onEdgeUpdateEnd"),t().edgeUpdateSuccessful?e({edgeUpdateSuccessful:!0}):(o=t().reactFlowInstance)==null||o.deleteElements({edges:[{id:r.id}]})},onSelectionChange:({nodes:n})=>{e({selectedNode:n.find(r=>r.selected)})},setColorMode:n=>{e({colorMode:n})}})));window.__useRFStore=we;const o2="";function eI({fromNode:e,fromPosition:t,fromX:n,fromY:r,toX:o,toY:i}){if(!e)return null;const[s]=Fi({borderRadius:20,sourceX:n,sourceY:r,sourcePosition:t,targetPosition:G.Top,targetX:o,targetY:i});return V("g",{children:[_("path",{fill:"none",stroke:"#222",strokeWidth:1.5,className:"animated",d:s}),_("circle",{cx:o,cy:i,fill:"#fff",r:3,stroke:"#222",strokeWidth:1.5})]})}function tI(e,t,n,r=0){const{width:o,height:i,position:s}=n,l=o??0,a=i??0,u=l/2,c=a/2,f=s.x+u,p=s.y+c,h=e,v=t,m=(h-f)/l-(v-p)/a,E=(h-f)/a+(v-p)/a,d=1/(Math.abs(m)+Math.abs(E)),g=d*m,y=d*E,S=u*(g+y)+f;return{tx:Math.min(Math.max(S,s.x+r),s.x+l-r),ty:s.y}}function nI(e){const{id:t,source:n,target:r,sourcePosition:o,sourceX:i,sourceY:s}=e,l=we(d=>d.removeEdge),a=de(O.useCallback(d=>d.nodeInternals.get(n),[n])),u=de(O.useCallback(d=>d.nodeInternals.get(r),[r]));if(!a||!u)return null;const{tx:c,ty:f}=tI(i,s,u,20),[p,h,v]=Fi({borderRadius:20,sourceX:i,sourceY:s,sourcePosition:o,targetPosition:G.Top,targetX:c,targetY:f}),m=40,E=(d,g)=>{d.stopPropagation(),l(g)};return V("g",{className:"group",children:[_(fo,{path:p,...e}),_("foreignObject",{width:m,height:m,x:h-m/2,y:v-m/2,className:"hidden group-hover:block",requiredExtensions:"http://www.w3.org/1999/xhtml",children:_("div",{className:"h-10 w-10",children:V("button",{className:"flex h-10 w-10 cursor-pointer items-center justify-center rounded-full border border-foreground/10 bg-backgroundAlt",onClick:d=>E(d,t),children:[_(Dt,{tag:"trash-can",className:"text-negative"}),_("span",{className:"sr-only",children:M(I.REMOVE_EDGE)})]})})})]})}var rI={prefix:"fas",iconName:"trash-can",icon:[448,512,[61460,"trash-alt"],"f2ed","M135.2 17.7C140.6 6.8 151.7 0 163.8 0H284.2c12.1 0 23.2 6.8 28.6 17.7L320 32h96c17.7 0 32 14.3 32 32s-14.3 32-32 32H32C14.3 96 0 81.7 0 64S14.3 32 32 32h96l7.2-14.3zM32 128H416V448c0 35.3-28.7 64-64 64H96c-35.3 0-64-28.7-64-64V128zm96 64c-8.8 0-16 7.2-16 16V432c0 8.8 7.2 16 16 16s16-7.2 16-16V208c0-8.8-7.2-16-16-16zm96 0c-8.8 0-16 7.2-16 16V432c0 8.8 7.2 16 16 16s16-7.2 16-16V208c0-8.8-7.2-16-16-16zm96 0c-8.8 0-16 7.2-16 16V432c0 8.8 7.2 16 16 16s16-7.2 16-16V208c0-8.8-7.2-16-16-16z"]},oI={prefix:"fas",iconName:"arrow-left",icon:[448,512,[8592],"f060","M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.2 288 416 288c17.7 0 32-14.3 32-32s-14.3-32-32-32l-306.7 0L214.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z"]},iI={prefix:"fas",iconName:"circle-info",icon:[512,512,["info-circle"],"f05a","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM216 336h24V272H216c-13.3 0-24-10.7-24-24s10.7-24 24-24h48c13.3 0 24 10.7 24 24v88h8c13.3 0 24 10.7 24 24s-10.7 24-24 24H216c-13.3 0-24-10.7-24-24s10.7-24 24-24zm40-208a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]},sI={prefix:"fas",iconName:"xmark",icon:[320,512,[128473,10005,10006,10060,215,"close","multiply","remove","times"],"f00d","M310.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L160 210.7 54.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L114.7 256 9.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 301.3 265.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L205.3 256 310.6 150.6z"]};const lI={"arrow-left":oI,"circle-info":iI,"trash-can":rI,xmark:sI},Dt=O.forwardRef(function({className:t="",size:n="",tag:r},o){const i=lI[r];return i?_("svg",{"aria-hidden":"true","data-prefix":i.prefix,"data-icon":r,className:`svg-inline--fa fa-${r} ${n?`fa-${n}`:""} ${t}`,focusable:"false",ref:o,role:"img",viewBox:`0 0 ${i.icon[0]} ${i.icon[1]}`,xmlns:"http://www.w3.org/2000/svg",children:_("path",{d:i.icon[4],fill:"currentColor"})}):($t().debug(`Unknown icon: ${r}`),null)}),aI=({isSelected:e,nodeId:t,nodeTitle:n,showDelete:r})=>{const o=we(a=>a.removeNode),i=we(a=>a.isEdgeConnecting);return V("div",{className:"flex w-full items-center justify-between p-4",children:[_("h2",{className:`text-lg font-semibold leading-6 ${e?"text-primary":""}`,children:n}),r&&!i&&V("button",{className:"opacity-0 transition-opacity group-hover/node-wrapper:opacity-100",onClick:()=>{o(t)},children:[_(Dt,{tag:"trash-can",className:"text-negative"}),_("span",{className:"sr-only",children:M(I.REMOVE_NODE,{title:n})})]})]})},uI=({id:e,missingRequiredEntry:t})=>{const n=we(i=>i.getTargetEdges),[r,o]=O.useState(!1);return O.useEffect(()=>{const i=()=>n(e).length===0;o(i());const s=we.subscribe((l,a)=>{l.edges.length!==a.edges.length&&o(i()),l.nodes.length!==a.nodes.length&&o(i()),l.edgeUpdateSuccessful!==a.edgeUpdateSuccessful&&o(i())});return()=>s()},[e,n]),r||t?V("div",{className:"flex flex-col gap-y-6 px-4 pb-4 text-sm italic leading-4",children:[r&&_("p",{children:"Not Connected to Flow"}),t&&_("p",{children:"Missing Required Entry"})]}):null},cI=({id:e,isConnectable:t})=>{if(!e)throw new Error("TargetHandle: id is required");return _(go,{type:"target",id:`target-${e}`,position:G.Top,isConnectable:t,className:"mt-1 h-4 w-full rounded-none rounded-t-md border-none bg-primary opacity-0 transition-opacity hover:opacity-100"})},qe=({children:e,id:t,isConnectable:n=!0,missingRequiredEntry:r,nodeTitle:o,selected:i,showDelete:s,showValidation:l=!0,target:a=!0})=>V("section",{className:`${i?"shadow-xl":""} group/node-wrapper min-w-[300px] rounded-lg border border-foreground/10 bg-background transition-[visibility]`,children:[a&&t&&_(cI,{id:t,isConnectable:n}),_(aI,{nodeId:t,isSelected:i,nodeTitle:o,showDelete:s}),l&&_(uI,{id:t,missingRequiredEntry:r??!1}),e]}),fI=({children:e,handleClick:t,...n})=>_("li",{role:"presentation",children:V("div",{className:"flex items-center gap-2 rounded-lg bg-secondary p-2 pr-1",role:"option","aria-selected":"true",tabIndex:0,children:[_("span",{className:"text-sm text-foreground",children:e}),V("button",{className:" px-1",onClick:t,onKeyDown:o=>{(o.key==="Backspace"||o.key==="Delete")&&(o.stopPropagation(),t==null||t())},type:"button",...n,children:[_("span",{className:"sr-only",children:"Remove"}),_(Dt,{tag:"xmark",size:"xs"})]})]})}),Sr=e=>_("div",{className:"relative after:absolute after:right-3 after:top-3 after:h-[7px] after:w-[7px] after:rotate-45 after:border-r after:border-b after:border-foreground after:content-['']",children:_("select",{className:"pr-8",...e,children:e.children})}),dI={positive:"border-positive hover:bg-positive",negative:"border-negative hover:bg-negative",disabled:"border-disabled"},Yn=({color:e="positive",enabled:t=!0,id:n,isConnectable:r,position:o=G.Bottom,positionClasses:i="-bottom-2.5"})=>{if(!n)throw new Error("SourceHandle: id is required");return _(go,{type:"source",id:n,position:o,isConnectable:r&&t,className:`absolute h-5 w-5 rounded-full border-[3px] bg-background transition-colors ${i} ${dI[t?e:"disabled"]??""}`})},Oo=({children:e})=>_("div",{className:"divide-foreground/10 flex w-full items-center divide-x",children:e}),Kn=({color:e="positive",enabled:t=!0,id:n,isConnectable:r,optionText:o,position:i=G.Bottom,positionClasses:s="-bottom-2.5"})=>V("div",{className:"relative w-full min-w-[104px] whitespace-nowrap border-t border-foreground/10 py-4",children:[_("div",{className:"flex flex-col items-center justify-center",children:_("p",{className:`${t?"":"text-disabled"} min-h-[1rem] text-sm leading-4`,children:o})}),_(Yn,{color:e,enabled:t,id:n,isConnectable:r,position:i,positionClasses:s})]}),pI=({checked:e=!1,name:t,onClick:n})=>V("button",{name:t,onClick:n,type:"button",className:`${e?"bg-primary":"bg-secondary"} relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out`,role:"switch","aria-checked":e?"true":"false",children:[_("span",{className:"sr-only",children:M(e?I.ON:I.OFF)}),_("span",{className:`pointer-events-none inline-block h-5 w-5 ${e?"translate-x-5":"translate-x-0"} transform rounded-full bg-white shadow transition duration-200 ease-in-out`})]}),ky=({checked:e,clickHandler:t,name:n,subtitle:r,title:o})=>V("div",{className:"mb-2 flex items-center justify-between",children:[V("div",{className:"flex flex-grow flex-col",children:[_("span",{className:"text-base font-medium leading-6 text-foreground",children:o}),r&&_("span",{className:"text-xs text-foreground/50",children:r})]}),_(pI,{checked:e,name:n,onClick:t})]}),Ki=({errorText:e,label:t,name:n,onChange:r,required:o,valid:i,value:s,...l})=>V("label",{children:[_("span",{className:"sr-only",children:t}),_("textarea",{"aria-invalid":i?void 0:"true",className:`peer min-h-[77px] w-full resize-none ${i?"":"invalid"}`,inputMode:"text",minLength:1,name:n,onChange:r,required:o,value:s,...l}),_("p",{className:"requirements",role:"alert",children:e})]}),hI=({dragging:e,id:t,isConnectable:n,selected:r})=>_(qe,{id:t,isConnectable:n,missingRequiredEntry:!1,nodeTitle:"Answer Call",selected:r,showDelete:!e,children:_(Yn,{id:t,isConnectable:n,color:"positive"})}),gI={success:I.SUCCESS,noAnswer:I.NO_ANSWER,busy:I.BUSY,decline:I.DECLINE,error:I.ERROR},mI={address:I.FORWARD_TO_ADDRESS,phone:I.FORWARD_TO_PHONE,resource:I.FORWARD_TO_RESOURCE},Lf=({id:e,data:t,dragging:n,isConnectable:r,selected:o})=>V(qe,{id:e,isConnectable:r,missingRequiredEntry:t.missingRequiredParams,nodeTitle:M(mI[t.destinationType]),selected:o,showDelete:!n,children:[t.destinations.length>0?_("section",{className:"p-4 pt-2",children:_("ul",{className:"space-y-2",children:t.destinations.map((i,s)=>_("li",{className:"text-sm",children:i},`node-${i}-${s}`))})}):null,_(Oo,{children:t.options.map(i=>_(Kn,{id:i.id,optionText:M(gI[i.result]),color:Zl(i.result),isConnectable:r},i.id))})]}),vI=({id:e,data:t,dragging:n,isConnectable:r,selected:o})=>_(qe,{id:e,isConnectable:r,missingRequiredEntry:t.missingRequiredParams,nodeTitle:"Gather Input",selected:o,showDelete:!n,children:V(Oo,{children:[t.options.map((i,s)=>{const l=Boolean(i.command||i.digit);return _(Kn,{color:"positive",enabled:l,id:i.id,isConnectable:r,optionText:M(I.OPT_NUMBER,{index:s+1})},i.id)}),t.results.map(i=>_(Kn,{color:"negative",id:i.id,isConnectable:r,optionText:i.result==="no_input"?M(I.NO_INPUT):M(I.UNKNOWN)},i.id))]})}),yI=({id:e,isConnectable:t,selected:n})=>_(qe,{allowDelete:!1,id:e,isConnectable:t,nodeTitle:M(I.HANDLE_CALL),selected:n,showDelete:!1,showValidation:!1,target:!1,children:_(Yn,{id:e,color:"positive",isConnectable:t})}),Df={busy:I.BUSY,decline:I.DECLINE,hangup:I.HANG_UP},EI=({data:e,dragging:t,id:n,isConnectable:r,selected:o})=>_(qe,{id:n,isConnectable:r,missingRequiredEntry:!1,nodeTitle:M(I.HANG_UP_CALL),selected:o,showDelete:!t,children:e.reason&&_("section",{className:"p-4 pt-2",children:_("p",{children:M(Df[e.reason])})})}),SI=e=>{try{return new URL(e).pathname.split("/").at(-1)}catch{return""}},_I=({data:e,dragging:t,id:n,isConnectable:r,selected:o})=>{let i=e.selected&&e[e.selected];return i&&e.selected==="url"&&(i=SI(i)||"Play Audio"),V(qe,{id:n,isConnectable:r,missingRequiredEntry:e.missingRequiredParams,nodeTitle:M(I.PLAY_AUDIO_TTS),selected:o,showDelete:!t,children:[i&&_("div",{className:"max-w-[300px] p-4 pt-0",children:e.selected==="url"?_("a",{className:"break-words text-primary underline line-clamp-3",href:e.url,target:"_blank",rel:"noopener noreferrer",children:i}):_("p",{className:"break-words line-clamp-3",children:i})}),_(Yn,{id:n,isConnectable:r})]})},wI=({id:e,data:t,dragging:n,isConnectable:r,selected:o})=>V(qe,{id:e,isConnectable:r,missingRequiredEntry:t.missingRequiredParams,nodeTitle:M(I.SET_VARIABLES),selected:o,showDelete:!n,children:[t.variables.length>0&&_("div",{className:"flow-root",children:_("div",{className:"inline-block p-4 pt-0 align-middle",children:V("table",{className:"w-80 table-fixed divide-y divide-foreground/10",children:[_("thead",{children:V("tr",{children:[_("th",{scope:"col",className:"py-3.5 text-left text-sm font-semibold",children:M(I.KEY)}),_("th",{scope:"col",className:"px-2 py-3.5 text-left text-sm font-semibold",children:M(I.VALUE)})]})}),_("tbody",{className:"divide-y divide-foreground/10 bg-background text-sm",children:t.variables.map(i=>i.key?V("tr",{children:[_("td",{className:"overflow-hidden text-ellipsis whitespace-nowrap py-2 text-sm",children:i.key}),_("td",{className:"overflow-hidden text-ellipsis whitespace-nowrap break-all px-2 py-2 text-sm",children:i.value})]},i.id):null)})]})})}),_(Yn,{id:e,isConnectable:r,color:"positive"})]}),RI=({id:e,data:t,dragging:n,isConnectable:r,selected:o})=>{const i=we(s=>s.partialUpdateNodeData);return O.useEffect(()=>{const s=Er.subscribe(l=>{const u=Array.from(l.variables.values()).reduce((c,f)=>{const p=t.variables.find(h=>h.setId===f.id);return p&&c.push({...p,key:f.key}),c},[]);i(e,{variables:u,missingRequiredParams:u.length===0})});return()=>s()},[i,e,t.variables]),_(qe,{id:e,isConnectable:r,missingRequiredEntry:t.missingRequiredParams,nodeTitle:M(I.UNSET_VARIABLES),selected:o,showDelete:!n,children:_(Yn,{id:e,isConnectable:r,color:"positive"})})},NI={success:I.SUCCESS,failed:I.FAILURE},OI=({data:e,dragging:t,id:n,isConnectable:r,selected:o})=>{var i;return _(qe,{id:n,isConnectable:r,missingRequiredEntry:e.missingRequiredParams,nodeTitle:M(I.VOICEMAIL_RECORDING),selected:o,showDelete:!t,children:_(Oo,{children:(i=e==null?void 0:e.options)==null?void 0:i.map(s=>_(Kn,{id:s.id,optionText:M(NI[s.result]),color:Zl(s.result),isConnectable:r},s.id))})})},xI={success:I.SUCCESS,failed:I.FAILURE},TI=({data:e,dragging:t,id:n,isConnectable:r,selected:o})=>{const{label:i,missingRequiredParams:s,options:l}=e;return V(qe,{id:n,isConnectable:r,missingRequiredEntry:s,nodeTitle:M(I.RECORD_CALL_START),selected:o,showDelete:!t,children:[i&&_("section",{className:"whitespace-nowrap px-4 pb-4 text-sm",children:i}),_(Oo,{children:l==null?void 0:l.map(a=>_(Kn,{id:a.id,optionText:M(xI[a.result]),color:Zl(a.result),isConnectable:r},a.id))})]})},II=({data:e,dragging:t,id:n,isConnectable:r,selected:o})=>{var l;const i=(l=Gn(a=>a.entries))==null?void 0:l.find(a=>a.controlId===e.controlId),s=i==null?void 0:i.label;return V(qe,{id:n,isConnectable:r,missingRequiredEntry:!s,nodeTitle:M(I.RECORD_CALL_STOP),selected:o,showDelete:!t,children:[s&&_("section",{className:"whitespace-nowrap px-4 pb-4 text-sm",children:s}),_(Yn,{id:n,color:"positive",isConnectable:r})]})},CI=({data:e,dragging:t,id:n,isConnectable:r,selected:o})=>V(qe,{id:n,isConnectable:r,missingRequiredEntry:e.missingRequiredParams,nodeTitle:M(I.SEND_SMS),selected:o,showDelete:!t,children:[(e.body||e.toNumber)&&V("div",{className:"max-w-[300px] p-4 pt-0",children:[e.fromNumber&&V("p",{className:`whitespace-nowrap ${e.body?"pb-2":""}`,children:[M(I.FROM),": ",e.fromNumber]}),e.toNumber&&V("p",{className:`whitespace-nowrap ${e.body?"pb-2":""}`,children:[M(I.TO),": ",e.toNumber]}),e.body&&_("p",{className:"break-words pt-1 line-clamp-3",children:e.body})]}),_(Yn,{id:n,isConnectable:r})]}),AI={success:I.SUCCESS,failed:I.FAILED},bI={answer:hI,forwardAddress:Lf,forwardPhone:Lf,forwardResource:Lf,handleCall:yI,hangup:EI,play:_I,promptPlay:vI,record:OI,recordCallStart:TI,recordCallStop:II,sendSms:CI,set:wI,unset:RI,request:({data:e,dragging:t,id:n,isConnectable:r,selected:o})=>{var i;return _(qe,{id:n,isConnectable:r,missingRequiredEntry:e.missingRequiredParams,nodeTitle:M(I.REQUEST),selected:o,showDelete:!t,children:_(Oo,{children:(i=e==null?void 0:e.options)==null?void 0:i.map(s=>_(Kn,{id:s.id,optionText:M(AI[s.result]),color:Zl(s.result),isConnectable:r},s.id))})})},cond:({id:e,data:t,dragging:n,isConnectable:r,selected:o})=>_(qe,{id:e,isConnectable:r,missingRequiredEntry:t.missingRequiredParams,nodeTitle:M(I.CONDITIONS),selected:o,showDelete:!n,children:V(Oo,{children:[t.options.map((i,s)=>{const l=Boolean(i.value);return _(Kn,{color:"positive",enabled:l,id:i.id,isConnectable:r,optionText:M(I.COND_NUMBER,{index:s+1})},i.id)}),_(Kn,{color:"negative",id:t.fallback,isConnectable:r,optionText:M(I.ELSE)},t.fallback)]})})},LI={floating:nI},DI={duration:1e3,includeHiddenNodes:!0,padding:.3},kI=e=>({edges:e.edges,nodes:e.nodes,onConnect:e.onConnect,onConnectEnd:e.onConnectEnd,onConnectStart:e.onConnectStart,onEdgesChange:e.onEdgesChange,onEdgeUpdate:e.onEdgeUpdate,onEdgesDelete:e.onEdgesDelete,onEdgeUpdateEnd:e.onEdgeUpdateEnd,onEdgeUpdateStart:e.onEdgeUpdateStart,onInit:e.onInit,onNodesChange:e.onNodesChange,onNodesDelete:e.onNodesDelete,onSelectionChange:e.onSelectionChange}),PI=({children:e})=>{const{edges:t,nodes:n,onConnect:r,onConnectEnd:o,onConnectStart:i,onEdgesChange:s,onEdgeUpdate:l,onEdgesDelete:a,onEdgeUpdateEnd:u,onEdgeUpdateStart:c,onInit:f,onNodesChange:p,onNodesDelete:h,onSelectionChange:v}=we(kI,Qe);return _(Gv,{className:"bg-sw-white !h-auto",connectionLineComponent:eI,connectionMode:$n.Strict,defaultEdgeOptions:Xv,edges:t,edgeTypes:LI,fitView:!0,fitViewOptions:DI,nodes:n,nodeTypes:bI,onConnect:r,onConnectEnd:o,onConnectStart:i,onEdgesChange:s,onEdgeUpdate:l,onEdgesDelete:a,onEdgeUpdateEnd:u,onEdgeUpdateStart:c,onInit:f,onNodesChange:p,onNodesDelete:h,onSelectionChange:v,children:e})},Py=/^[\w\d ']+$/,My=/^\d+$/,Uy=/^\d|\*|#$/,MI=/^[\d|\*|#$]{0,12}$/,UI=/^.{1,20}$/,Fy=/^[a-z0-9_]{1,20}$/,sa={MIN:1,MAX:99},_r=e=>(/(?:\/\^)(.+)(?:\$\/)/.exec(e.toString())??[])[1],kf=e=>t=>Boolean(e.exec(t)),Pf=e=>kf(Uy)(e),Mf=e=>kf(Py)(e),Vy=e=>kf(Fy)(e),By=e=>typeof e=="string"&&e===""||Array.isArray(e)&&e.length===0?!1:typeof e=="object"&&e!==null?Object.keys(e).length===0?!1:Object.values(e).every(By):!0,Kt=e=>{const[t,n]=O.useReducer((r,o)=>({...r,...o}),e);return[t,n]},Qi=({displayData:e,formRef:t,setCompleted:n})=>{O.useEffect(()=>{var l,a;const r=t.current,o=new FormData(r),i=Object.fromEntries(o.entries());let s=!0;for(const u of Object.keys(i)){if(((l=e[u])==null?void 0:l.valid)!==void 0&&(s=s&&Boolean((a=e[u])==null?void 0:a.valid),s)){const c=r.elements.namedItem(u);c&&"checkValidity"in c&&(s=s&&c.checkValidity())}if(!s)break}n(s)},[e,t,n])},$y={url:I.PLAY_AUDIO_FILE,text:I.TEXT_TO_SPEECH},zy=({displayData:e,label:t,handleOnUpdate:n,setDisplayData:r,showDefaultOption:o})=>{var a,u;const i=e.selected.value,s=c=>{const f=c.currentTarget.value;r({selected:{value:f,valid:Boolean(f)||!o}}),n({selected:f})},l=c=>{const f=c.target,{name:p,value:h}=f,v=h.trim();let m=!0;switch(p){case"url":m=f.checkValidity(),r({[p]:{value:h,valid:m}}),n({text:"",url:m?v:""});break;case"text":m=f.checkValidity()&&v.length>0,r({[p]:{value:h,valid:m}}),n({text:m?v:"",url:""});break;default:throw new Error(`Unhandled input name: ${p}`)}};return V("div",{children:[V("label",{children:[_("span",{className:"sr-only",children:t}),V(Sr,{className:"w-full",name:"selected",onChange:s,value:i,children:[o&&_("option",{value:"",children:M(I.SELECT)}),Object.keys($y).map(c=>_("option",{value:c,children:M($y[c])},c))]})]}),i&&_(FI,{name:i,onChange:l,required:!0,selected:i,valid:(a=e[i])==null?void 0:a.valid,value:(u=e[i])==null?void 0:u.value})]})},FI=({name:e,onChange:t,required:n,selected:r,valid:o,value:i})=>{const l={url:_(Ki,{errorText:M(I.ERROR_URL_IS_REQUIRED),inputMode:"url",label:M(I.PLAY_AUDIO_FILE),name:e,onChange:t,placeholder:M(I.ENTER_URL),required:n,valid:o,value:i}),text:_(Ki,{errorText:M(I.ERROR_VALUE_IS_REQUIRED),inputMode:"text",label:M(I.TEXT_TO_SPEECH),name:e,onChange:t,placeholder:M(I.WRITE_SOMETHING),required:n,valid:o,value:i})}[r];return _(Ae,{children:l})},VI=[{field:"stereo",title:I.STEREO,subtitle:I.STEREO_SUBTITLE},{field:"beep",title:I.BEEP,subtitle:I.BEEP_SUBTITLE}],Hy=({displayData:e,handleOnUpdate:t,setDisplayData:n})=>{const r=s=>{const l=s.target.name,a=!e[l].value,u={[l]:{value:a}};n(u),t({[l]:a})},o=s=>{const l=s.target,{name:a,value:u}=l,c=l.checkValidity(),f={[a]:{value:u,valid:c}};n(f),t({[a]:c?u.trim():""})},i=s=>{const l=s.target.name,a=s.target.value,u={[l]:{value:a,valid:!0}};n(u),t({[l]:a})};return V(Ae,{children:[_("div",{className:"mb-5",children:VI.map(s=>{const l=e[s.field].value;return _("div",{children:_(ky,{checked:l,clickHandler:r,name:s.field,subtitle:M(s.subtitle),title:M(s.title)})},s.field)})}),V("label",{children:[M(I.TERMINATORS),_("input",{className:`w-full ${e.terminators.valid?"":"invalid"}`,defaultValue:e.terminators.value||"",name:"terminators",onChange:o,pattern:_r(MI),placeholder:"#*0",type:"text"}),_("p",{className:"requirements",role:"alert",children:M(I.ERROR_TERMINATORS)})]}),V("label",{children:[M(I.FORMAT),V(Sr,{className:"w-full",value:e.format.value,name:"format",onChange:i,children:[_("option",{value:"mp3",children:"MP3"}),_("option",{value:"wav",children:"WAV"})]})]})]})};/*!
62
62
  * tabbable 6.1.1
63
63
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
64
- */var BI=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Uf=BI.join(","),jy=typeof Element>"u",Xi=jy?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,la=!jy&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},aa=function e(t,n){var r;n===void 0&&(n=!0);var o=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),i=o===""||o==="true",s=i||n&&t&&e(t.parentNode);return s},$I=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},zI=function(t,n,r){if(aa(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(Uf));return n&&Xi.call(t,Uf)&&o.unshift(t),o=o.filter(r),o},HI=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var s=i.shift();if(!aa(s,!1))if(s.tagName==="SLOT"){var l=s.assignedElements(),a=l.length?l:s.children,u=e(a,!0,r);r.flatten?o.push.apply(o,u):o.push({scopeParent:s,candidates:u})}else{var c=Xi.call(s,Uf);c&&r.filter(s)&&(n||!t.includes(s))&&o.push(s);var f=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),p=!aa(f,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(f&&p){var h=e(f===!0?s.children:f.children,!0,r);r.flatten?o.push.apply(o,h):o.push({scopeParent:s,candidates:h})}else i.unshift.apply(i,s.children)}}return o},Wy=function(t,n){return t.tabIndex<0&&(n||/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||$I(t))&&isNaN(parseInt(t.getAttribute("tabindex"),10))?0:t.tabIndex},jI=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Gy=function(t){return t.tagName==="INPUT"},WI=function(t){return Gy(t)&&t.type==="hidden"},GI=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},YI=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},KI=function(t){if(!t.name)return!0;var n=t.form||la(t),r=function(l){return n.querySelectorAll('input[type="radio"][name="'+l+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(s){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",s.message),!1}var i=YI(o,t.form);return!i||i===t},QI=function(t){return Gy(t)&&t.type==="radio"},XI=function(t){return QI(t)&&!KI(t)},qI=function(t){var n,r=t&&la(t),o=(n=r)===null||n===void 0?void 0:n.host,i=!1;if(r&&r!==t){var s,l,a;for(i=!!((s=o)!==null&&s!==void 0&&(l=s.ownerDocument)!==null&&l!==void 0&&l.contains(o)||t!=null&&(a=t.ownerDocument)!==null&&a!==void 0&&a.contains(t));!i&&o;){var u,c,f;r=la(o),o=(u=r)===null||u===void 0?void 0:u.host,i=!!((c=o)!==null&&c!==void 0&&(f=c.ownerDocument)!==null&&f!==void 0&&f.contains(o))}}return i},Yy=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},ZI=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var i=Xi.call(t,"details>summary:first-of-type"),s=i?t.parentElement:t;if(Xi.call(s,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof o=="function"){for(var l=t;t;){var a=t.parentElement,u=la(t);if(a&&!a.shadowRoot&&o(a)===!0)return Yy(t);t.assignedSlot?t=t.assignedSlot:!a&&u!==t.ownerDocument?t=u.host:t=a}t=l}if(qI(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Yy(t);return!1},JI=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return Xi.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},eC=function(t,n){return!(n.disabled||aa(n)||WI(n)||ZI(n,t)||GI(n)||JI(n))},Ky=function(t,n){return!(XI(n)||Wy(n)<0||!eC(t,n))},tC=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},nC=function e(t){var n=[],r=[];return t.forEach(function(o,i){var s=!!o.scopeParent,l=s?o.scopeParent:o,a=Wy(l,s),u=s?e(o.candidates):l;a===0?s?n.push.apply(n,u):n.push(l):r.push({documentOrder:i,tabIndex:a,item:o,isScope:s,content:u})}),r.sort(jI).reduce(function(o,i){return i.isScope?o.push.apply(o,i.content):o.push(i.content),o},[]).concat(n)},Qy=function(t,n){n=n||{};var r;return n.getShadowRoot?r=HI([t],n.includeContainer,{filter:Ky.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:tC}):r=zI(t,n.includeContainer,Ky.bind(null,n)),nC(r)};function qi(e){return e.split("-")[1]}function Ff(e){return e==="y"?"height":"width"}function wr(e){return e.split("-")[0]}function Zi(e){return["top","bottom"].includes(wr(e))?"x":"y"}function Xy(e,t,n){let{reference:r,floating:o}=e;const i=r.x+r.width/2-o.width/2,s=r.y+r.height/2-o.height/2,l=Zi(t),a=Ff(l),u=r[a]/2-o[a]/2,c=l==="x";let f;switch(wr(t)){case"top":f={x:i,y:r.y-o.height};break;case"bottom":f={x:i,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:s};break;case"left":f={x:r.x-o.width,y:s};break;default:f={x:r.x,y:r.y}}switch(qi(t)){case"start":f[l]-=u*(n&&c?-1:1);break;case"end":f[l]+=u*(n&&c?-1:1)}return f}const rC=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,l=i.filter(Boolean),a=await(s.isRTL==null?void 0:s.isRTL(t));let u=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:f}=Xy(u,r,a),p=r,h={},v=0;for(let m=0;m<l.length;m++){const{name:E,fn:d}=l[m],{x:g,y,data:S,reset:w}=await d({x:c,y:f,initialPlacement:r,placement:p,strategy:o,middlewareData:h,rects:u,platform:s,elements:{reference:e,floating:t}});c=g??c,f=y??f,h={...h,[E]:{...h[E],...S}},w&&v<=50&&(v++,typeof w=="object"&&(w.placement&&(p=w.placement),w.rects&&(u=w.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):w.rects),{x:c,y:f}=Xy(u,p,a)),m=-1)}return{x:c,y:f,placement:p,strategy:o,middlewareData:h}};function qy(e){return typeof e!="number"?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(e):{top:e,right:e,bottom:e,left:e}}function Vf(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function Zy(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:l,strategy:a}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:p=!1,padding:h=0}=t,v=qy(h),m=l[p?f==="floating"?"reference":"floating":f],E=Vf(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(m)))==null||n?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:u,rootBoundary:c,strategy:a})),d=f==="floating"?{...s.floating,x:r,y:o}:s.reference,g=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),y=await(i.isElement==null?void 0:i.isElement(g))&&await(i.getScale==null?void 0:i.getScale(g))||{x:1,y:1},S=Vf(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:d,offsetParent:g,strategy:a}):d);return{top:(E.top-S.top+v.top)/y.y,bottom:(S.bottom-E.bottom+v.bottom)/y.y,left:(E.left-S.left+v.left)/y.x,right:(S.right-E.right+v.right)/y.x}}const oC=Math.min,iC=Math.max;function Bf(e,t,n){return iC(e,oC(t,n))}const Jy=e=>({name:"arrow",options:e,async fn(t){const{element:n,padding:r=0}=e||{},{x:o,y:i,placement:s,rects:l,platform:a}=t;if(n==null)return{};const u=qy(r),c={x:o,y:i},f=Zi(s),p=Ff(f),h=await a.getDimensions(n),v=f==="y"?"top":"left",m=f==="y"?"bottom":"right",E=l.reference[p]+l.reference[f]-c[f]-l.floating[p],d=c[f]-l.reference[f],g=await(a.getOffsetParent==null?void 0:a.getOffsetParent(n));let y=g?f==="y"?g.clientHeight||0:g.clientWidth||0:0;y===0&&(y=l.floating[p]);const S=E/2-d/2,w=u[v],N=y-h[p]-u[m],T=y/2-h[p]/2+S,b=Bf(w,T,N),D=qi(s)!=null&&T!=b&&l.reference[p]/2-(T<w?u[v]:u[m])-h[p]/2<0;return{[f]:c[f]-(D?T<w?w-T:N-T:0),data:{[f]:b,centerOffset:T-b}}}});["top","right","bottom","left"].reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]);const sC={left:"right",right:"left",bottom:"top",top:"bottom"};function ua(e){return e.replace(/left|right|bottom|top/g,t=>sC[t])}function lC(e,t,n){n===void 0&&(n=!1);const r=qi(e),o=Zi(e),i=Ff(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=ua(s)),{main:s,cross:ua(s)}}const aC={start:"end",end:"start"};function $f(e){return e.replace(/start|end/g,t=>aC[t])}const uC=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:o,rects:i,initialPlacement:s,platform:l,elements:a}=t,{mainAxis:u=!0,crossAxis:c=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:v=!0,...m}=e,E=wr(r),d=wr(s)===s,g=await(l.isRTL==null?void 0:l.isRTL(a.floating)),y=f||(d||!v?[ua(s)]:function(B){const F=ua(B);return[$f(B),F,$f(F)]}(s));f||h==="none"||y.push(...function(B,F,z,R){const P=qi(B);let A=function(C,x,L){const U=["left","right"],$=["right","left"],j=["top","bottom"],Q=["bottom","top"];switch(C){case"top":case"bottom":return L?x?$:U:x?U:$;case"left":case"right":return x?j:Q;default:return[]}}(wr(B),z==="start",R);return P&&(A=A.map(C=>C+"-"+P),F&&(A=A.concat(A.map($f)))),A}(s,v,h,g));const S=[s,...y],w=await Zy(t,m),N=[];let T=((n=o.flip)==null?void 0:n.overflows)||[];if(u&&N.push(w[E]),c){const{main:B,cross:F}=lC(r,i,g);N.push(w[B],w[F])}if(T=[...T,{placement:r,overflows:N}],!N.every(B=>B<=0)){var b,D;const B=(((b=o.flip)==null?void 0:b.index)||0)+1,F=S[B];if(F)return{data:{index:B,overflows:T},reset:{placement:F}};let z=(D=T.filter(R=>R.overflows[0]<=0).sort((R,P)=>R.overflows[1]-P.overflows[1])[0])==null?void 0:D.placement;if(!z)switch(p){case"bestFit":{var k;const R=(k=T.map(P=>[P.placement,P.overflows.filter(A=>A>0).reduce((A,C)=>A+C,0)]).sort((P,A)=>P[1]-A[1])[0])==null?void 0:k[0];R&&(z=R);break}case"initialPlacement":z=s}if(r!==z)return{reset:{placement:z}}}return{}}}},cC=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await async function(i,s){const{placement:l,platform:a,elements:u}=i,c=await(a.isRTL==null?void 0:a.isRTL(u.floating)),f=wr(l),p=qi(l),h=Zi(l)==="x",v=["left","top"].includes(f)?-1:1,m=c&&h?-1:1,E=typeof s=="function"?s(i):s;let{mainAxis:d,crossAxis:g,alignmentAxis:y}=typeof E=="number"?{mainAxis:E,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...E};return p&&typeof y=="number"&&(g=p==="end"?-1*y:y),h?{x:g*m,y:d*v}:{x:d*v,y:g*m}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}};function fC(e){return e==="x"?"y":"x"}const dC=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:l={fn:E=>{let{x:d,y:g}=E;return{x:d,y:g}}},...a}=e,u={x:n,y:r},c=await Zy(t,a),f=Zi(wr(o)),p=fC(f);let h=u[f],v=u[p];if(i){const E=f==="y"?"bottom":"right";h=Bf(h+c[f==="y"?"top":"left"],h,h-c[E])}if(s){const E=p==="y"?"bottom":"right";v=Bf(v+c[p==="y"?"top":"left"],v,v-c[E])}const m=l.fn({...t,[f]:h,[p]:v});return{...m,data:{x:m.x-n,y:m.y-r}}}}};function lt(e){var t;return((t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Qt(e){return lt(e).getComputedStyle(e)}const e0=Math.min,Ji=Math.max,ca=Math.round;function t0(e){const t=Qt(e);let n=parseFloat(t.width),r=parseFloat(t.height);const o=e.offsetWidth,i=e.offsetHeight,s=ca(n)!==o||ca(r)!==i;return s&&(n=o,r=i),{width:n,height:r,fallback:s}}function Qn(e){return r0(e)?(e.nodeName||"").toLowerCase():""}let fa;function n0(){if(fa)return fa;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(fa=e.brands.map(t=>t.brand+"/"+t.version).join(" "),fa):navigator.userAgent}function Xt(e){return e instanceof lt(e).HTMLElement}function Pt(e){return e instanceof lt(e).Element}function r0(e){return e instanceof lt(e).Node}function o0(e){return typeof ShadowRoot>"u"?!1:e instanceof lt(e).ShadowRoot||e instanceof ShadowRoot}function da(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Qt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function pC(e){return["table","td","th"].includes(Qn(e))}function zf(e){const t=/firefox/i.test(n0()),n=Qt(e),r=n.backdropFilter||n.WebkitBackdropFilter;return n.transform!=="none"||n.perspective!=="none"||!!r&&r!=="none"||t&&n.willChange==="filter"||t&&!!n.filter&&n.filter!=="none"||["transform","perspective"].some(o=>n.willChange.includes(o))||["paint","layout","strict","content"].some(o=>{const i=n.contain;return i!=null&&i.includes(o)})}function Hf(){return/^((?!chrome|android).)*safari/i.test(n0())}function jf(e){return["html","body","#document"].includes(Qn(e))}function i0(e){return Pt(e)?e:e.contextElement}const s0={x:1,y:1};function xo(e){const t=i0(e);if(!Xt(t))return s0;const n=t.getBoundingClientRect(),{width:r,height:o,fallback:i}=t0(t);let s=(i?ca(n.width):n.width)/r,l=(i?ca(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),l&&Number.isFinite(l)||(l=1),{x:s,y:l}}function Rr(e,t,n,r){var o,i;t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),l=i0(e);let a=s0;t&&(r?Pt(r)&&(a=xo(r)):a=xo(e));const u=l?lt(l):window,c=Hf()&&n;let f=(s.left+(c&&((o=u.visualViewport)==null?void 0:o.offsetLeft)||0))/a.x,p=(s.top+(c&&((i=u.visualViewport)==null?void 0:i.offsetTop)||0))/a.y,h=s.width/a.x,v=s.height/a.y;if(l){const m=lt(l),E=r&&Pt(r)?lt(r):r;let d=m.frameElement;for(;d&&r&&E!==m;){const g=xo(d),y=d.getBoundingClientRect(),S=getComputedStyle(d);y.x+=(d.clientLeft+parseFloat(S.paddingLeft))*g.x,y.y+=(d.clientTop+parseFloat(S.paddingTop))*g.y,f*=g.x,p*=g.y,h*=g.x,v*=g.y,f+=y.x,p+=y.y,d=lt(d).frameElement}}return{width:h,height:v,top:p,right:f+h,bottom:p+v,left:f,x:f,y:p}}function Xn(e){return((r0(e)?e.ownerDocument:e.document)||window.document).documentElement}function pa(e){return Pt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function l0(e){return Rr(Xn(e)).left+pa(e).scrollLeft}function es(e){if(Qn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||o0(e)&&e.host||Xn(e);return o0(t)?t.host:t}function a0(e){const t=es(e);return jf(t)?t.ownerDocument.body:Xt(t)&&da(t)?t:a0(t)}function qn(e,t){var n;t===void 0&&(t=[]);const r=a0(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),i=lt(r);return o?t.concat(i,i.visualViewport||[],da(r)?r:[]):t.concat(r,qn(r))}function u0(e,t,n){let r;if(t==="viewport")r=function(s,l){const a=lt(s),u=Xn(s),c=a.visualViewport;let f=u.clientWidth,p=u.clientHeight,h=0,v=0;if(c){f=c.width,p=c.height;const m=Hf();(!m||m&&l==="fixed")&&(h=c.offsetLeft,v=c.offsetTop)}return{width:f,height:p,x:h,y:v}}(e,n);else if(t==="document")r=function(s){const l=Xn(s),a=pa(s),u=s.ownerDocument.body,c=Ji(l.scrollWidth,l.clientWidth,u.scrollWidth,u.clientWidth),f=Ji(l.scrollHeight,l.clientHeight,u.scrollHeight,u.clientHeight);let p=-a.scrollLeft+l0(s);const h=-a.scrollTop;return Qt(u).direction==="rtl"&&(p+=Ji(l.clientWidth,u.clientWidth)-c),{width:c,height:f,x:p,y:h}}(Xn(e));else if(Pt(t))r=function(s,l){const a=Rr(s,!0,l==="fixed"),u=a.top+s.clientTop,c=a.left+s.clientLeft,f=Xt(s)?xo(s):{x:1,y:1};return{width:s.clientWidth*f.x,height:s.clientHeight*f.y,x:c*f.x,y:u*f.y}}(t,n);else{const s={...t};if(Hf()){var o,i;const l=lt(e);s.x-=((o=l.visualViewport)==null?void 0:o.offsetLeft)||0,s.y-=((i=l.visualViewport)==null?void 0:i.offsetTop)||0}r=s}return Vf(r)}function c0(e,t){return Xt(e)&&Qt(e).position!=="fixed"?t?t(e):e.offsetParent:null}function f0(e,t){const n=lt(e);let r=c0(e,t);for(;r&&pC(r)&&Qt(r).position==="static";)r=c0(r,t);return r&&(Qn(r)==="html"||Qn(r)==="body"&&Qt(r).position==="static"&&!zf(r))?n:r||function(o){let i=es(o);for(;Xt(i)&&!jf(i);){if(zf(i))return i;i=es(i)}return null}(e)||n}function hC(e,t,n){const r=Xt(t),o=Xn(t),i=Rr(e,!0,n==="fixed",t);let s={scrollLeft:0,scrollTop:0};const l={x:0,y:0};if(r||!r&&n!=="fixed")if((Qn(t)!=="body"||da(o))&&(s=pa(t)),Xt(t)){const a=Rr(t,!0);l.x=a.x+t.clientLeft,l.y=a.y+t.clientTop}else o&&(l.x=l0(o));return{x:i.left+s.scrollLeft-l.x,y:i.top+s.scrollTop-l.y,width:i.width,height:i.height}}const gC={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=n==="clippingAncestors"?function(u,c){const f=c.get(u);if(f)return f;let p=qn(u).filter(E=>Pt(E)&&Qn(E)!=="body"),h=null;const v=Qt(u).position==="fixed";let m=v?es(u):u;for(;Pt(m)&&!jf(m);){const E=Qt(m),d=zf(m);E.position==="fixed"?h=null:(v?d||h:d||E.position!=="static"||!h||!["absolute","fixed"].includes(h.position))?h=E:p=p.filter(g=>g!==m),m=es(m)}return c.set(u,p),p}(t,this._c):[].concat(n),s=[...i,r],l=s[0],a=s.reduce((u,c)=>{const f=u0(t,c,o);return u.top=Ji(f.top,u.top),u.right=e0(f.right,u.right),u.bottom=e0(f.bottom,u.bottom),u.left=Ji(f.left,u.left),u},u0(t,l,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=Xt(n),i=Xn(n);if(n===i)return t;let s={scrollLeft:0,scrollTop:0},l={x:1,y:1};const a={x:0,y:0};if((o||!o&&r!=="fixed")&&((Qn(n)!=="body"||da(i))&&(s=pa(n)),Xt(n))){const u=Rr(n);l=xo(n),a.x=u.x+n.clientLeft,a.y=u.y+n.clientTop}return{width:t.width*l.x,height:t.height*l.y,x:t.x*l.x-s.scrollLeft*l.x+a.x,y:t.y*l.y-s.scrollTop*l.y+a.y}},isElement:Pt,getDimensions:function(e){return Xt(e)?t0(e):e.getBoundingClientRect()},getOffsetParent:f0,getDocumentElement:Xn,getScale:xo,async getElementRects(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||f0,i=this.getDimensions;return{reference:hC(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>Qt(e).direction==="rtl"};function mC(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=!0,animationFrame:l=!1}=r,a=o&&!l,u=a||i?[...Pt(e)?qn(e):e.contextElement?qn(e.contextElement):[],...qn(t)]:[];u.forEach(h=>{a&&h.addEventListener("scroll",n,{passive:!0}),i&&h.addEventListener("resize",n)});let c,f=null;if(s){let h=!0;f=new ResizeObserver(()=>{h||n(),h=!1}),Pt(e)&&!l&&f.observe(e),Pt(e)||!e.contextElement||l||f.observe(e.contextElement),f.observe(t)}let p=l?Rr(e):null;return l&&function h(){const v=Rr(e);!p||v.x===p.x&&v.y===p.y&&v.width===p.width&&v.height===p.height||n(),p=v,c=requestAnimationFrame(h)}(),n(),()=>{var h;u.forEach(v=>{a&&v.removeEventListener("scroll",n),i&&v.removeEventListener("resize",n)}),(h=f)==null||h.disconnect(),f=null,l&&cancelAnimationFrame(c)}}const vC=(e,t,n)=>{const r=new Map,o={platform:gC,...n},i={...o.platform,_c:r};return rC(e,t,{...o,platform:i})},yC=e=>{const{element:t,padding:n}=e;function r(o){return Object.prototype.hasOwnProperty.call(o,"current")}return{name:"arrow",options:e,fn(o){return r(t)?t.current!=null?Jy({element:t.current,padding:n}).fn(o):{}:t?Jy({element:t,padding:n}).fn(o):{}}}};var ha=typeof document<"u"?O.useLayoutEffect:O.useEffect;function ga(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!ga(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!ga(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function d0(e){const t=O.useRef(e);return ha(()=>{t.current=e}),t}function EC(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,whileElementsMounted:i,open:s}=e,[l,a]=O.useState({x:null,y:null,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[u,c]=O.useState(r);ga(u,r)||c(r);const f=O.useRef(null),p=O.useRef(null),h=O.useRef(l),v=d0(i),m=d0(o),[E,d]=O.useState(null),[g,y]=O.useState(null),S=O.useCallback(k=>{f.current!==k&&(f.current=k,d(k))},[]),w=O.useCallback(k=>{p.current!==k&&(p.current=k,y(k))},[]),N=O.useCallback(()=>{if(!f.current||!p.current)return;const k={placement:t,strategy:n,middleware:u};m.current&&(k.platform=m.current),vC(f.current,p.current,k).then(B=>{const F={...B,isPositioned:!0};T.current&&!ga(h.current,F)&&(h.current=F,Ar.flushSync(()=>{a(F)}))})},[u,t,n,m]);ha(()=>{s===!1&&h.current.isPositioned&&(h.current.isPositioned=!1,a(k=>({...k,isPositioned:!1})))},[s]);const T=O.useRef(!1);ha(()=>(T.current=!0,()=>{T.current=!1}),[]),ha(()=>{if(E&&g){if(v.current)return v.current(E,g,N);N()}},[E,g,N,v]);const b=O.useMemo(()=>({reference:f,floating:p,setReference:S,setFloating:w}),[S,w]),D=O.useMemo(()=>({reference:E,floating:g}),[E,g]);return O.useMemo(()=>({...l,update:N,refs:b,elements:D,reference:S,floating:w}),[l,N,b,D,S,w])}var Nr=typeof document<"u"?O.useLayoutEffect:O.useEffect;let Wf=!1,SC=0;const p0=()=>"floating-ui-"+SC++;function _C(){const[e,t]=O.useState(()=>Wf?p0():void 0);return Nr(()=>{e==null&&t(p0())},[]),O.useEffect(()=>{Wf||(Wf=!0)},[]),e}const Gf=wd["useId".toString()]||_C;function wC(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){e.set(t,(e.get(t)||[]).filter(r=>r!==n))}}}const RC=O.createContext(null),NC=O.createContext(null),h0=()=>{var e;return((e=O.useContext(RC))==null?void 0:e.id)||null},Yf=()=>O.useContext(NC);function gn(e){return(e==null?void 0:e.ownerDocument)||document}function g0(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function OC(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function Kf(e){return gn(e).defaultView||window}function qt(e){return e?e instanceof Kf(e).Element:!1}function m0(e){return e?e instanceof Kf(e).HTMLElement:!1}function xC(e){if(typeof ShadowRoot>"u")return!1;const t=Kf(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function TC(e){if(e.mozInputSource===0&&e.isTrusted)return!0;const t=/Android/i;return(t.test(g0())||t.test(OC()))&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function IC(e){return e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType!=="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0}function v0(){return/apple/i.test(navigator.vendor)}function CC(){return g0().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function y0(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function E0(e){const t=O.useRef(e);return Nr(()=>{t.current=e}),t}const S0="data-floating-ui-safe-polygon";function Qf(e,t,n){return n&&!y0(n)?0:typeof e=="number"?e:e==null?void 0:e[t]}const AC=function(e,t){let{enabled:n=!0,delay:r=0,handleClose:o=null,mouseOnly:i=!1,restMs:s=0,move:l=!0}=t===void 0?{}:t;const{open:a,onOpenChange:u,dataRef:c,events:f,elements:{domReference:p,floating:h},refs:v}=e,m=Yf(),E=h0(),d=E0(o),g=E0(r),y=O.useRef(),S=O.useRef(),w=O.useRef(),N=O.useRef(),T=O.useRef(!0),b=O.useRef(!1),D=O.useRef(()=>{}),k=O.useCallback(()=>{var R;const P=(R=c.current.openEvent)==null?void 0:R.type;return(P==null?void 0:P.includes("mouse"))&&P!=="mousedown"},[c]);O.useEffect(()=>{if(!n)return;function R(){clearTimeout(S.current),clearTimeout(N.current),T.current=!0}return f.on("dismiss",R),()=>{f.off("dismiss",R)}},[n,f]),O.useEffect(()=>{if(!n||!d.current||!a)return;function R(){k()&&u(!1)}const P=gn(h).documentElement;return P.addEventListener("mouseleave",R),()=>{P.removeEventListener("mouseleave",R)}},[h,a,u,n,d,c,k]);const B=O.useCallback(function(R){R===void 0&&(R=!0);const P=Qf(g.current,"close",y.current);P&&!w.current?(clearTimeout(S.current),S.current=setTimeout(()=>u(!1),P)):R&&(clearTimeout(S.current),u(!1))},[g,u]),F=O.useCallback(()=>{D.current(),w.current=void 0},[]),z=O.useCallback(()=>{if(b.current){const R=gn(v.floating.current).body;R.style.pointerEvents="",R.removeAttribute(S0),b.current=!1}},[v]);return O.useEffect(()=>{if(!n)return;function R(){return c.current.openEvent?["click","mousedown"].includes(c.current.openEvent.type):!1}function P(x){if(clearTimeout(S.current),T.current=!1,i&&!y0(y.current)||s>0&&Qf(g.current,"open")===0)return;c.current.openEvent=x;const L=Qf(g.current,"open",y.current);L?S.current=setTimeout(()=>{u(!0)},L):u(!0)}function A(x){if(R())return;D.current();const L=gn(h);if(clearTimeout(N.current),d.current){a||clearTimeout(S.current),w.current=d.current({...e,tree:m,x:x.clientX,y:x.clientY,onClose(){z(),F(),B()}});const U=w.current;L.addEventListener("mousemove",U),D.current=()=>{L.removeEventListener("mousemove",U)};return}B()}function C(x){R()||d.current==null||d.current({...e,tree:m,x:x.clientX,y:x.clientY,onClose(){z(),F(),B()}})(x)}if(qt(p)){const x=p;return a&&x.addEventListener("mouseleave",C),h==null||h.addEventListener("mouseleave",C),l&&x.addEventListener("mousemove",P,{once:!0}),x.addEventListener("mouseenter",P),x.addEventListener("mouseleave",A),()=>{a&&x.removeEventListener("mouseleave",C),h==null||h.removeEventListener("mouseleave",C),l&&x.removeEventListener("mousemove",P),x.removeEventListener("mouseenter",P),x.removeEventListener("mouseleave",A)}}},[p,h,n,e,i,s,l,B,F,z,u,a,m,g,d,c]),Nr(()=>{var R;if(n&&a&&(R=d.current)!=null&&R.__options.blockPointerEvents&&k()){const C=gn(h).body;if(C.setAttribute(S0,""),C.style.pointerEvents="none",b.current=!0,qt(p)&&h){var P,A;const x=p,L=m==null||(P=m.nodesRef.current.find(U=>U.id===E))==null||(A=P.context)==null?void 0:A.elements.floating;return L&&(L.style.pointerEvents=""),x.style.pointerEvents="auto",h.style.pointerEvents="auto",()=>{x.style.pointerEvents="",h.style.pointerEvents=""}}}},[n,a,E,h,p,m,d,c,k]),Nr(()=>{a||(y.current=void 0,F(),z())},[a,F,z]),O.useEffect(()=>()=>{F(),clearTimeout(S.current),clearTimeout(N.current),z()},[n,F,z]),O.useMemo(()=>{if(!n)return{};function R(P){y.current=P.pointerType}return{reference:{onPointerDown:R,onPointerEnter:R,onMouseMove(){a||s===0||(clearTimeout(N.current),N.current=setTimeout(()=>{T.current||u(!0)},s))}},floating:{onMouseEnter(){clearTimeout(S.current)},onMouseLeave(){f.emit("dismiss",{type:"mouseLeave",data:{returnFocus:!1}}),B(!1)}}}},[f,n,s,a,u,B])};function Xf(){return Xf=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xf.apply(this,arguments)}function _0(e){let t=e.activeElement;for(;((n=t)==null||(r=n.shadowRoot)==null?void 0:r.activeElement)!=null;){var n,r;t=t.shadowRoot.activeElement}return t}function qf(e,t){if(!e||!t)return!1;const n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&xC(n)){let r=t;do{if(r&&e===r)return!0;r=r.parentNode||r.host}while(r)}return!1}function Zf(e,t){let n=e.filter(o=>{var i;return o.parentId===t&&((i=o.context)==null?void 0:i.open)})||[],r=n;for(;r.length;)r=e.filter(o=>{var i;return(i=r)==null?void 0:i.some(s=>{var l;return o.parentId===s.id&&((l=o.context)==null?void 0:l.open)})})||[],n=n.concat(r);return n}function bC(e){return"composedPath"in e?e.composedPath()[0]:e.target}const w0=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function R0(e,t){const n=Qy(e,w0());t==="prev"&&n.reverse();const r=n.indexOf(_0(gn(e)));return n.slice(r+1)[0]}function LC(){return R0(document.body,"next")}function DC(){return R0(document.body,"prev")}function Jf(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!qf(n,r)}function kC(e){Qy(e,w0()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function PC(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const MC=wd["useInsertionEffect".toString()]||(e=>e());function ed(e){const t=O.useRef(()=>{});return MC(()=>{t.current=e}),O.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}const N0={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};let td,nd;function O0(e){e.key==="Tab"&&(td=e.target,clearTimeout(nd))}function UC(e){const t=td===e.relatedTarget;return td=e.relatedTarget,clearTimeout(nd),t}const x0=O.forwardRef(function(t,n){const r=ed(t.onFocus),[o,i]=O.useState();return Nr(()=>(v0()&&i("button"),document.addEventListener("keydown",O0),()=>{document.removeEventListener("keydown",O0)}),[]),O.createElement("span",Xf({},t,{ref:n,tabIndex:0,role:o,"aria-hidden":o?void 0:!0,"data-floating-ui-focus-guard":"",style:N0,onFocus:s=>{v0()&&CC()&&!UC(s)?(s.persist(),nd=window.setTimeout(()=>{r(s)},50)):r(s)}}))}),T0=O.createContext(null),FC=function(e){let{id:t,enabled:n=!0}=e===void 0?{}:e;const[r,o]=O.useState(null),i=Gf(),s=BC();return Nr(()=>{if(!n)return;const l=t?document.getElementById(t):null;if(l)l.setAttribute("data-floating-ui-portal",""),o(l);else{const a=document.createElement("div");t!==""&&(a.id=t||i),a.setAttribute("data-floating-ui-portal",""),o(a);const u=(s==null?void 0:s.portalNode)||document.body;return u.appendChild(a),()=>{u.removeChild(a)}}},[t,s,i,n]),r},VC=e=>{let{children:t,id:n,root:r=null,preserveTabOrder:o=!0}=e;const i=FC({id:n,enabled:!r}),[s,l]=O.useState(null),a=O.useRef(null),u=O.useRef(null),c=O.useRef(null),f=O.useRef(null),p=!!s&&!s.modal&&!!(r||i)&&o;return O.useEffect(()=>{if(!i||!o||s!=null&&s.modal)return;function h(v){i&&Jf(v)&&(v.type==="focusin"?PC:kC)(i)}return i.addEventListener("focusin",h,!0),i.addEventListener("focusout",h,!0),()=>{i.removeEventListener("focusin",h,!0),i.removeEventListener("focusout",h,!0)}},[i,o,s==null?void 0:s.modal]),O.createElement(T0.Provider,{value:O.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:a,afterOutsideRef:u,beforeInsideRef:c,afterInsideRef:f,portalNode:i,setFocusManagerState:l}),[o,i])},p&&i&&O.createElement(x0,{"data-type":"outside",ref:a,onFocus:h=>{if(Jf(h,i)){var v;(v=c.current)==null||v.focus()}else{const m=DC()||(s==null?void 0:s.refs.domReference.current);m==null||m.focus()}}}),p&&i&&O.createElement("span",{"aria-owns":i.id,style:N0}),r?Ar.createPortal(t,r):i?Ar.createPortal(t,i):null,p&&i&&O.createElement(x0,{"data-type":"outside",ref:u,onFocus:h=>{if(Jf(h,i)){var v;(v=f.current)==null||v.focus()}else{const m=LC()||(s==null?void 0:s.refs.domReference.current);m==null||m.focus(),s!=null&&s.closeOnFocusOut&&(s==null||s.onOpenChange(!1))}}}))},BC=()=>O.useContext(T0);function ma(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}const $C={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},zC={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},HC=function(e){var t,n;return e===void 0&&(e=!0),{escapeKeyBubbles:typeof e=="boolean"?e:(t=e.escapeKey)!=null?t:!0,outsidePressBubbles:typeof e=="boolean"?e:(n=e.outsidePress)!=null?n:!0}},jC=function(e,t){let{open:n,onOpenChange:r,events:o,nodeId:i,elements:{reference:s,domReference:l,floating:a},dataRef:u}=e,{enabled:c=!0,escapeKey:f=!0,outsidePress:p=!0,outsidePressEvent:h="pointerdown",referencePress:v=!1,referencePressEvent:m="pointerdown",ancestorScroll:E=!1,bubbles:d=!0}=t===void 0?{}:t;const g=Yf(),y=h0()!=null,S=ed(typeof p=="function"?p:()=>!1),w=typeof p=="function"?S:p,N=O.useRef(!1),{escapeKeyBubbles:T,outsidePressBubbles:b}=HC(d);return O.useEffect(()=>{if(!n||!c)return;u.current.__escapeKeyBubbles=T,u.current.__outsidePressBubbles=b;function D(R){if(R.key==="Escape"){const P=g?Zf(g.nodesRef.current,i):[];if(P.length>0){let A=!0;if(P.forEach(C=>{var x;if((x=C.context)!=null&&x.open&&!C.context.dataRef.current.__escapeKeyBubbles){A=!1;return}}),!A)return}o.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),r(!1)}}function k(R){const P=N.current;if(N.current=!1,P||typeof w=="function"&&!w(R))return;const A=bC(R);if(m0(A)&&a){const L=a.ownerDocument.defaultView||window,U=A.scrollWidth>A.clientWidth,$=A.scrollHeight>A.clientHeight;let j=$&&R.offsetX>A.clientWidth;if($&&L.getComputedStyle(A).direction==="rtl"&&(j=R.offsetX<=A.offsetWidth-A.clientWidth),j||U&&R.offsetY>A.clientHeight)return}const C=g&&Zf(g.nodesRef.current,i).some(L=>{var U;return ma(R,(U=L.context)==null?void 0:U.elements.floating)});if(ma(R,a)||ma(R,l)||C)return;const x=g?Zf(g.nodesRef.current,i):[];if(x.length>0){let L=!0;if(x.forEach(U=>{var $;if(($=U.context)!=null&&$.open&&!U.context.dataRef.current.__outsidePressBubbles){L=!1;return}}),!L)return}o.emit("dismiss",{type:"outsidePress",data:{returnFocus:y?{preventScroll:!0}:TC(R)||IC(R)}}),r(!1)}function B(){r(!1)}const F=gn(a);f&&F.addEventListener("keydown",D),w&&F.addEventListener(h,k);let z=[];return E&&(qt(l)&&(z=qn(l)),qt(a)&&(z=z.concat(qn(a))),!qt(s)&&s&&s.contextElement&&(z=z.concat(qn(s.contextElement)))),z=z.filter(R=>{var P;return R!==((P=F.defaultView)==null?void 0:P.visualViewport)}),z.forEach(R=>{R.addEventListener("scroll",B,{passive:!0})}),()=>{f&&F.removeEventListener("keydown",D),w&&F.removeEventListener(h,k),z.forEach(R=>{R.removeEventListener("scroll",B)})}},[u,a,l,s,f,w,h,o,g,i,n,r,E,c,T,b,y]),O.useEffect(()=>{N.current=!1},[w,h]),O.useMemo(()=>c?{reference:{[$C[m]]:()=>{v&&(o.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),r(!1))}},floating:{[zC[h]]:()=>{N.current=!0}}}:{},[c,o,v,h,m,r])},WC=function(e,t){let{open:n,onOpenChange:r,dataRef:o,events:i,refs:s,elements:{floating:l,domReference:a}}=e,{enabled:u=!0,keyboardOnly:c=!0}=t===void 0?{}:t;const f=O.useRef(""),p=O.useRef(!1),h=O.useRef();return O.useEffect(()=>{if(!u)return;const m=gn(l).defaultView||window;function E(){!n&&m0(a)&&a===_0(gn(a))&&(p.current=!0)}return m.addEventListener("blur",E),()=>{m.removeEventListener("blur",E)}},[l,a,n,u]),O.useEffect(()=>{if(!u)return;function v(m){(m.type==="referencePress"||m.type==="escapeKey")&&(p.current=!0)}return i.on("dismiss",v),()=>{i.off("dismiss",v)}},[i,u]),O.useEffect(()=>()=>{clearTimeout(h.current)},[]),O.useMemo(()=>u?{reference:{onPointerDown(v){let{pointerType:m}=v;f.current=m,p.current=!!(m&&c)},onMouseLeave(){p.current=!1},onFocus(v){var m;p.current||v.type==="focus"&&((m=o.current.openEvent)==null?void 0:m.type)==="mousedown"&&o.current.openEvent&&ma(o.current.openEvent,a)||(o.current.openEvent=v.nativeEvent,r(!0))},onBlur(v){p.current=!1;const m=v.relatedTarget,E=qt(m)&&m.hasAttribute("data-floating-ui-focus-guard")&&m.getAttribute("data-type")==="outside";h.current=setTimeout(()=>{qf(s.floating.current,m)||qf(a,m)||E||r(!1)})}}}:{},[u,c,a,s,o,r])};function I0(e){return O.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})},e)}const GC=function(e,t){let{open:n}=e,{enabled:r=!0,role:o="dialog"}=t===void 0?{}:t;const i=Gf(),s=Gf();return O.useMemo(()=>{const l={id:i,role:o};return r?o==="tooltip"?{reference:{"aria-describedby":n?i:void 0},floating:l}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":o==="alertdialog"?"dialog":o,"aria-controls":n?i:void 0,...o==="listbox"&&{role:"combobox"},...o==="menu"&&{id:s}},floating:{...l,...o==="menu"&&{"aria-labelledby":s}}}:{}},[r,o,n,i,s])};function YC(e){e===void 0&&(e={});const{open:t=!1,onOpenChange:n,nodeId:r}=e,o=EC(e),i=Yf(),s=O.useRef(null),l=O.useRef({}),a=O.useState(()=>wC())[0],[u,c]=O.useState(null),f=O.useCallback(d=>{const g=qt(d)?{getBoundingClientRect:()=>d.getBoundingClientRect(),contextElement:d}:d;o.refs.setReference(g)},[o.refs]),p=O.useCallback(d=>{(qt(d)||d===null)&&(s.current=d,c(d)),(qt(o.refs.reference.current)||o.refs.reference.current===null||d!==null&&!qt(d))&&o.refs.setReference(d)},[o.refs]),h=O.useMemo(()=>({...o.refs,setReference:p,setPositionReference:f,domReference:s}),[o.refs,p,f]),v=O.useMemo(()=>({...o.elements,domReference:u}),[o.elements,u]),m=ed(n),E=O.useMemo(()=>({...o,refs:h,elements:v,dataRef:l,nodeId:r,events:a,open:t,onOpenChange:m}),[o,r,a,t,m,h,v]);return Nr(()=>{const d=i==null?void 0:i.nodesRef.current.find(g=>g.id===r);d&&(d.context=E)}),O.useMemo(()=>({...o,context:E,refs:h,reference:p,positionReference:f}),[o,h,E,p,f])}function rd(e,t,n){const r=new Map;return{...n==="floating"&&{tabIndex:-1},...e,...t.map(o=>o?o[n]:null).concat(e).reduce((o,i)=>(i&&Object.entries(i).forEach(s=>{let[l,a]=s;if(l.indexOf("on")===0){if(r.has(l)||r.set(l,[]),typeof a=="function"){var u;(u=r.get(l))==null||u.push(a),o[l]=function(){for(var c,f=arguments.length,p=new Array(f),h=0;h<f;h++)p[h]=arguments[h];(c=r.get(l))==null||c.forEach(v=>v(...p))}}}else o[l]=a}),o),{})}}const KC=function(e){e===void 0&&(e=[]);const t=e,n=O.useCallback(i=>rd(i,e,"reference"),t),r=O.useCallback(i=>rd(i,e,"floating"),t),o=O.useCallback(i=>rd(i,e,"item"),e.map(i=>i==null?void 0:i.item));return O.useMemo(()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:o}),[n,r,o])};function QC({initialOpen:e=!1,placement:t="top",open:n,onOpenChange:r}={}){const o=St.useRef(null),[i,s]=St.useState(e),l=n??i,a=r??s,u=YC({placement:t,open:l,onOpenChange:a,whileElementsMounted:mC,strategy:"fixed",middleware:[cC(8),uC(),dC({padding:8}),yC({element:o})]}),c=u.context,f=AC(c,{move:!1,enabled:n==null}),p=WC(c,{enabled:n==null}),h=jC(c),v=GC(c,{role:"tooltip"}),m=KC([f,p,h,v]);return St.useMemo(()=>({open:l,setOpen:a,arrowRef:o,...m,...u}),[l,a,m,u])}const C0=St.createContext(null),od=()=>{const e=St.useContext(C0);if(e==null)throw new Error("Tooltip components must be wrapped in <Tooltip />");return e};function XC({children:e,...t}){const n=QC(t);return _(C0.Provider,{value:n,children:e})}const qC={top:"-bottom-1 before:border-t-0 before:border-l-0",bottom:"-top-1 before:border-b-0 before:border-r-0",right:"-right-1 before:border-r-0 before:border-t-0",left:"-left-1 before:border-l-0 before:border-b-0"},ZC=({placement:e="top"})=>{const t=od(),[n,r]=O.useState(t.middlewareData.arrow);O.useEffect(()=>{t.middlewareData.arrow&&r(t.middlewareData.arrow)},[t.middlewareData.arrow]);const o={top:n!=null&&n.y?`${n.y??0}px`:void 0,left:n!=null&&n.x?`${n.x??0}px`:void 0},i=`${qC[e]}`;return _("div",{ref:t.arrowRef,style:o,className:`tooltip-arrow absolute w-2 h-2 bg-inherit rotate-45
64
+ */var BI=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Uf=BI.join(","),jy=typeof Element>"u",Xi=jy?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,la=!jy&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},aa=function e(t,n){var r;n===void 0&&(n=!0);var o=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),i=o===""||o==="true",s=i||n&&t&&e(t.parentNode);return s},$I=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},zI=function(t,n,r){if(aa(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(Uf));return n&&Xi.call(t,Uf)&&o.unshift(t),o=o.filter(r),o},HI=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var s=i.shift();if(!aa(s,!1))if(s.tagName==="SLOT"){var l=s.assignedElements(),a=l.length?l:s.children,u=e(a,!0,r);r.flatten?o.push.apply(o,u):o.push({scopeParent:s,candidates:u})}else{var c=Xi.call(s,Uf);c&&r.filter(s)&&(n||!t.includes(s))&&o.push(s);var f=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),p=!aa(f,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(f&&p){var h=e(f===!0?s.children:f.children,!0,r);r.flatten?o.push.apply(o,h):o.push({scopeParent:s,candidates:h})}else i.unshift.apply(i,s.children)}}return o},Wy=function(t,n){return t.tabIndex<0&&(n||/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||$I(t))&&isNaN(parseInt(t.getAttribute("tabindex"),10))?0:t.tabIndex},jI=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Gy=function(t){return t.tagName==="INPUT"},WI=function(t){return Gy(t)&&t.type==="hidden"},GI=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},YI=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},KI=function(t){if(!t.name)return!0;var n=t.form||la(t),r=function(l){return n.querySelectorAll('input[type="radio"][name="'+l+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(s){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",s.message),!1}var i=YI(o,t.form);return!i||i===t},QI=function(t){return Gy(t)&&t.type==="radio"},XI=function(t){return QI(t)&&!KI(t)},qI=function(t){var n,r=t&&la(t),o=(n=r)===null||n===void 0?void 0:n.host,i=!1;if(r&&r!==t){var s,l,a;for(i=!!((s=o)!==null&&s!==void 0&&(l=s.ownerDocument)!==null&&l!==void 0&&l.contains(o)||t!=null&&(a=t.ownerDocument)!==null&&a!==void 0&&a.contains(t));!i&&o;){var u,c,f;r=la(o),o=(u=r)===null||u===void 0?void 0:u.host,i=!!((c=o)!==null&&c!==void 0&&(f=c.ownerDocument)!==null&&f!==void 0&&f.contains(o))}}return i},Yy=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},ZI=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var i=Xi.call(t,"details>summary:first-of-type"),s=i?t.parentElement:t;if(Xi.call(s,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof o=="function"){for(var l=t;t;){var a=t.parentElement,u=la(t);if(a&&!a.shadowRoot&&o(a)===!0)return Yy(t);t.assignedSlot?t=t.assignedSlot:!a&&u!==t.ownerDocument?t=u.host:t=a}t=l}if(qI(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Yy(t);return!1},JI=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return Xi.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},eC=function(t,n){return!(n.disabled||aa(n)||WI(n)||ZI(n,t)||GI(n)||JI(n))},Ky=function(t,n){return!(XI(n)||Wy(n)<0||!eC(t,n))},tC=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},nC=function e(t){var n=[],r=[];return t.forEach(function(o,i){var s=!!o.scopeParent,l=s?o.scopeParent:o,a=Wy(l,s),u=s?e(o.candidates):l;a===0?s?n.push.apply(n,u):n.push(l):r.push({documentOrder:i,tabIndex:a,item:o,isScope:s,content:u})}),r.sort(jI).reduce(function(o,i){return i.isScope?o.push.apply(o,i.content):o.push(i.content),o},[]).concat(n)},Qy=function(t,n){n=n||{};var r;return n.getShadowRoot?r=HI([t],n.includeContainer,{filter:Ky.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:tC}):r=zI(t,n.includeContainer,Ky.bind(null,n)),nC(r)};function qi(e){return e.split("-")[1]}function Ff(e){return e==="y"?"height":"width"}function wr(e){return e.split("-")[0]}function Zi(e){return["top","bottom"].includes(wr(e))?"x":"y"}function Xy(e,t,n){let{reference:r,floating:o}=e;const i=r.x+r.width/2-o.width/2,s=r.y+r.height/2-o.height/2,l=Zi(t),a=Ff(l),u=r[a]/2-o[a]/2,c=l==="x";let f;switch(wr(t)){case"top":f={x:i,y:r.y-o.height};break;case"bottom":f={x:i,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:s};break;case"left":f={x:r.x-o.width,y:s};break;default:f={x:r.x,y:r.y}}switch(qi(t)){case"start":f[l]-=u*(n&&c?-1:1);break;case"end":f[l]+=u*(n&&c?-1:1)}return f}const rC=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,l=i.filter(Boolean),a=await(s.isRTL==null?void 0:s.isRTL(t));let u=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:f}=Xy(u,r,a),p=r,h={},v=0;for(let m=0;m<l.length;m++){const{name:E,fn:d}=l[m],{x:g,y,data:S,reset:w}=await d({x:c,y:f,initialPlacement:r,placement:p,strategy:o,middlewareData:h,rects:u,platform:s,elements:{reference:e,floating:t}});c=g??c,f=y??f,h={...h,[E]:{...h[E],...S}},w&&v<=50&&(v++,typeof w=="object"&&(w.placement&&(p=w.placement),w.rects&&(u=w.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):w.rects),{x:c,y:f}=Xy(u,p,a)),m=-1)}return{x:c,y:f,placement:p,strategy:o,middlewareData:h}};function qy(e){return typeof e!="number"?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(e):{top:e,right:e,bottom:e,left:e}}function Vf(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function Zy(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:l,strategy:a}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:p=!1,padding:h=0}=t,v=qy(h),m=l[p?f==="floating"?"reference":"floating":f],E=Vf(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(m)))==null||n?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:u,rootBoundary:c,strategy:a})),d=f==="floating"?{...s.floating,x:r,y:o}:s.reference,g=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),y=await(i.isElement==null?void 0:i.isElement(g))&&await(i.getScale==null?void 0:i.getScale(g))||{x:1,y:1},S=Vf(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:d,offsetParent:g,strategy:a}):d);return{top:(E.top-S.top+v.top)/y.y,bottom:(S.bottom-E.bottom+v.bottom)/y.y,left:(E.left-S.left+v.left)/y.x,right:(S.right-E.right+v.right)/y.x}}const oC=Math.min,iC=Math.max;function Bf(e,t,n){return iC(e,oC(t,n))}const Jy=e=>({name:"arrow",options:e,async fn(t){const{element:n,padding:r=0}=e||{},{x:o,y:i,placement:s,rects:l,platform:a}=t;if(n==null)return{};const u=qy(r),c={x:o,y:i},f=Zi(s),p=Ff(f),h=await a.getDimensions(n),v=f==="y"?"top":"left",m=f==="y"?"bottom":"right",E=l.reference[p]+l.reference[f]-c[f]-l.floating[p],d=c[f]-l.reference[f],g=await(a.getOffsetParent==null?void 0:a.getOffsetParent(n));let y=g?f==="y"?g.clientHeight||0:g.clientWidth||0:0;y===0&&(y=l.floating[p]);const S=E/2-d/2,w=u[v],N=y-h[p]-u[m],T=y/2-h[p]/2+S,b=Bf(w,T,N),D=qi(s)!=null&&T!=b&&l.reference[p]/2-(T<w?u[v]:u[m])-h[p]/2<0;return{[f]:c[f]-(D?T<w?w-T:N-T:0),data:{[f]:b,centerOffset:T-b}}}});["top","right","bottom","left"].reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]);const sC={left:"right",right:"left",bottom:"top",top:"bottom"};function ua(e){return e.replace(/left|right|bottom|top/g,t=>sC[t])}function lC(e,t,n){n===void 0&&(n=!1);const r=qi(e),o=Zi(e),i=Ff(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=ua(s)),{main:s,cross:ua(s)}}const aC={start:"end",end:"start"};function $f(e){return e.replace(/start|end/g,t=>aC[t])}const uC=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:o,rects:i,initialPlacement:s,platform:l,elements:a}=t,{mainAxis:u=!0,crossAxis:c=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:v=!0,...m}=e,E=wr(r),d=wr(s)===s,g=await(l.isRTL==null?void 0:l.isRTL(a.floating)),y=f||(d||!v?[ua(s)]:function(B){const F=ua(B);return[$f(B),F,$f(F)]}(s));f||h==="none"||y.push(...function(B,F,z,R){const P=qi(B);let A=function(C,x,L){const U=["left","right"],$=["right","left"],j=["top","bottom"],Q=["bottom","top"];switch(C){case"top":case"bottom":return L?x?$:U:x?U:$;case"left":case"right":return x?j:Q;default:return[]}}(wr(B),z==="start",R);return P&&(A=A.map(C=>C+"-"+P),F&&(A=A.concat(A.map($f)))),A}(s,v,h,g));const S=[s,...y],w=await Zy(t,m),N=[];let T=((n=o.flip)==null?void 0:n.overflows)||[];if(u&&N.push(w[E]),c){const{main:B,cross:F}=lC(r,i,g);N.push(w[B],w[F])}if(T=[...T,{placement:r,overflows:N}],!N.every(B=>B<=0)){var b,D;const B=(((b=o.flip)==null?void 0:b.index)||0)+1,F=S[B];if(F)return{data:{index:B,overflows:T},reset:{placement:F}};let z=(D=T.filter(R=>R.overflows[0]<=0).sort((R,P)=>R.overflows[1]-P.overflows[1])[0])==null?void 0:D.placement;if(!z)switch(p){case"bestFit":{var k;const R=(k=T.map(P=>[P.placement,P.overflows.filter(A=>A>0).reduce((A,C)=>A+C,0)]).sort((P,A)=>P[1]-A[1])[0])==null?void 0:k[0];R&&(z=R);break}case"initialPlacement":z=s}if(r!==z)return{reset:{placement:z}}}return{}}}},cC=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await async function(i,s){const{placement:l,platform:a,elements:u}=i,c=await(a.isRTL==null?void 0:a.isRTL(u.floating)),f=wr(l),p=qi(l),h=Zi(l)==="x",v=["left","top"].includes(f)?-1:1,m=c&&h?-1:1,E=typeof s=="function"?s(i):s;let{mainAxis:d,crossAxis:g,alignmentAxis:y}=typeof E=="number"?{mainAxis:E,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...E};return p&&typeof y=="number"&&(g=p==="end"?-1*y:y),h?{x:g*m,y:d*v}:{x:d*v,y:g*m}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}};function fC(e){return e==="x"?"y":"x"}const dC=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:l={fn:E=>{let{x:d,y:g}=E;return{x:d,y:g}}},...a}=e,u={x:n,y:r},c=await Zy(t,a),f=Zi(wr(o)),p=fC(f);let h=u[f],v=u[p];if(i){const E=f==="y"?"bottom":"right";h=Bf(h+c[f==="y"?"top":"left"],h,h-c[E])}if(s){const E=p==="y"?"bottom":"right";v=Bf(v+c[p==="y"?"top":"left"],v,v-c[E])}const m=l.fn({...t,[f]:h,[p]:v});return{...m,data:{x:m.x-n,y:m.y-r}}}}};function lt(e){var t;return((t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Qt(e){return lt(e).getComputedStyle(e)}const e0=Math.min,Ji=Math.max,ca=Math.round;function t0(e){const t=Qt(e);let n=parseFloat(t.width),r=parseFloat(t.height);const o=e.offsetWidth,i=e.offsetHeight,s=ca(n)!==o||ca(r)!==i;return s&&(n=o,r=i),{width:n,height:r,fallback:s}}function Qn(e){return r0(e)?(e.nodeName||"").toLowerCase():""}let fa;function n0(){if(fa)return fa;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(fa=e.brands.map(t=>t.brand+"/"+t.version).join(" "),fa):navigator.userAgent}function Xt(e){return e instanceof lt(e).HTMLElement}function kt(e){return e instanceof lt(e).Element}function r0(e){return e instanceof lt(e).Node}function o0(e){return typeof ShadowRoot>"u"?!1:e instanceof lt(e).ShadowRoot||e instanceof ShadowRoot}function da(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Qt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function pC(e){return["table","td","th"].includes(Qn(e))}function zf(e){const t=/firefox/i.test(n0()),n=Qt(e),r=n.backdropFilter||n.WebkitBackdropFilter;return n.transform!=="none"||n.perspective!=="none"||!!r&&r!=="none"||t&&n.willChange==="filter"||t&&!!n.filter&&n.filter!=="none"||["transform","perspective"].some(o=>n.willChange.includes(o))||["paint","layout","strict","content"].some(o=>{const i=n.contain;return i!=null&&i.includes(o)})}function Hf(){return/^((?!chrome|android).)*safari/i.test(n0())}function jf(e){return["html","body","#document"].includes(Qn(e))}function i0(e){return kt(e)?e:e.contextElement}const s0={x:1,y:1};function xo(e){const t=i0(e);if(!Xt(t))return s0;const n=t.getBoundingClientRect(),{width:r,height:o,fallback:i}=t0(t);let s=(i?ca(n.width):n.width)/r,l=(i?ca(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),l&&Number.isFinite(l)||(l=1),{x:s,y:l}}function Rr(e,t,n,r){var o,i;t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),l=i0(e);let a=s0;t&&(r?kt(r)&&(a=xo(r)):a=xo(e));const u=l?lt(l):window,c=Hf()&&n;let f=(s.left+(c&&((o=u.visualViewport)==null?void 0:o.offsetLeft)||0))/a.x,p=(s.top+(c&&((i=u.visualViewport)==null?void 0:i.offsetTop)||0))/a.y,h=s.width/a.x,v=s.height/a.y;if(l){const m=lt(l),E=r&&kt(r)?lt(r):r;let d=m.frameElement;for(;d&&r&&E!==m;){const g=xo(d),y=d.getBoundingClientRect(),S=getComputedStyle(d);y.x+=(d.clientLeft+parseFloat(S.paddingLeft))*g.x,y.y+=(d.clientTop+parseFloat(S.paddingTop))*g.y,f*=g.x,p*=g.y,h*=g.x,v*=g.y,f+=y.x,p+=y.y,d=lt(d).frameElement}}return{width:h,height:v,top:p,right:f+h,bottom:p+v,left:f,x:f,y:p}}function Xn(e){return((r0(e)?e.ownerDocument:e.document)||window.document).documentElement}function pa(e){return kt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function l0(e){return Rr(Xn(e)).left+pa(e).scrollLeft}function es(e){if(Qn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||o0(e)&&e.host||Xn(e);return o0(t)?t.host:t}function a0(e){const t=es(e);return jf(t)?t.ownerDocument.body:Xt(t)&&da(t)?t:a0(t)}function qn(e,t){var n;t===void 0&&(t=[]);const r=a0(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),i=lt(r);return o?t.concat(i,i.visualViewport||[],da(r)?r:[]):t.concat(r,qn(r))}function u0(e,t,n){let r;if(t==="viewport")r=function(s,l){const a=lt(s),u=Xn(s),c=a.visualViewport;let f=u.clientWidth,p=u.clientHeight,h=0,v=0;if(c){f=c.width,p=c.height;const m=Hf();(!m||m&&l==="fixed")&&(h=c.offsetLeft,v=c.offsetTop)}return{width:f,height:p,x:h,y:v}}(e,n);else if(t==="document")r=function(s){const l=Xn(s),a=pa(s),u=s.ownerDocument.body,c=Ji(l.scrollWidth,l.clientWidth,u.scrollWidth,u.clientWidth),f=Ji(l.scrollHeight,l.clientHeight,u.scrollHeight,u.clientHeight);let p=-a.scrollLeft+l0(s);const h=-a.scrollTop;return Qt(u).direction==="rtl"&&(p+=Ji(l.clientWidth,u.clientWidth)-c),{width:c,height:f,x:p,y:h}}(Xn(e));else if(kt(t))r=function(s,l){const a=Rr(s,!0,l==="fixed"),u=a.top+s.clientTop,c=a.left+s.clientLeft,f=Xt(s)?xo(s):{x:1,y:1};return{width:s.clientWidth*f.x,height:s.clientHeight*f.y,x:c*f.x,y:u*f.y}}(t,n);else{const s={...t};if(Hf()){var o,i;const l=lt(e);s.x-=((o=l.visualViewport)==null?void 0:o.offsetLeft)||0,s.y-=((i=l.visualViewport)==null?void 0:i.offsetTop)||0}r=s}return Vf(r)}function c0(e,t){return Xt(e)&&Qt(e).position!=="fixed"?t?t(e):e.offsetParent:null}function f0(e,t){const n=lt(e);let r=c0(e,t);for(;r&&pC(r)&&Qt(r).position==="static";)r=c0(r,t);return r&&(Qn(r)==="html"||Qn(r)==="body"&&Qt(r).position==="static"&&!zf(r))?n:r||function(o){let i=es(o);for(;Xt(i)&&!jf(i);){if(zf(i))return i;i=es(i)}return null}(e)||n}function hC(e,t,n){const r=Xt(t),o=Xn(t),i=Rr(e,!0,n==="fixed",t);let s={scrollLeft:0,scrollTop:0};const l={x:0,y:0};if(r||!r&&n!=="fixed")if((Qn(t)!=="body"||da(o))&&(s=pa(t)),Xt(t)){const a=Rr(t,!0);l.x=a.x+t.clientLeft,l.y=a.y+t.clientTop}else o&&(l.x=l0(o));return{x:i.left+s.scrollLeft-l.x,y:i.top+s.scrollTop-l.y,width:i.width,height:i.height}}const gC={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=n==="clippingAncestors"?function(u,c){const f=c.get(u);if(f)return f;let p=qn(u).filter(E=>kt(E)&&Qn(E)!=="body"),h=null;const v=Qt(u).position==="fixed";let m=v?es(u):u;for(;kt(m)&&!jf(m);){const E=Qt(m),d=zf(m);E.position==="fixed"?h=null:(v?d||h:d||E.position!=="static"||!h||!["absolute","fixed"].includes(h.position))?h=E:p=p.filter(g=>g!==m),m=es(m)}return c.set(u,p),p}(t,this._c):[].concat(n),s=[...i,r],l=s[0],a=s.reduce((u,c)=>{const f=u0(t,c,o);return u.top=Ji(f.top,u.top),u.right=e0(f.right,u.right),u.bottom=e0(f.bottom,u.bottom),u.left=Ji(f.left,u.left),u},u0(t,l,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=Xt(n),i=Xn(n);if(n===i)return t;let s={scrollLeft:0,scrollTop:0},l={x:1,y:1};const a={x:0,y:0};if((o||!o&&r!=="fixed")&&((Qn(n)!=="body"||da(i))&&(s=pa(n)),Xt(n))){const u=Rr(n);l=xo(n),a.x=u.x+n.clientLeft,a.y=u.y+n.clientTop}return{width:t.width*l.x,height:t.height*l.y,x:t.x*l.x-s.scrollLeft*l.x+a.x,y:t.y*l.y-s.scrollTop*l.y+a.y}},isElement:kt,getDimensions:function(e){return Xt(e)?t0(e):e.getBoundingClientRect()},getOffsetParent:f0,getDocumentElement:Xn,getScale:xo,async getElementRects(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||f0,i=this.getDimensions;return{reference:hC(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>Qt(e).direction==="rtl"};function mC(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=!0,animationFrame:l=!1}=r,a=o&&!l,u=a||i?[...kt(e)?qn(e):e.contextElement?qn(e.contextElement):[],...qn(t)]:[];u.forEach(h=>{a&&h.addEventListener("scroll",n,{passive:!0}),i&&h.addEventListener("resize",n)});let c,f=null;if(s){let h=!0;f=new ResizeObserver(()=>{h||n(),h=!1}),kt(e)&&!l&&f.observe(e),kt(e)||!e.contextElement||l||f.observe(e.contextElement),f.observe(t)}let p=l?Rr(e):null;return l&&function h(){const v=Rr(e);!p||v.x===p.x&&v.y===p.y&&v.width===p.width&&v.height===p.height||n(),p=v,c=requestAnimationFrame(h)}(),n(),()=>{var h;u.forEach(v=>{a&&v.removeEventListener("scroll",n),i&&v.removeEventListener("resize",n)}),(h=f)==null||h.disconnect(),f=null,l&&cancelAnimationFrame(c)}}const vC=(e,t,n)=>{const r=new Map,o={platform:gC,...n},i={...o.platform,_c:r};return rC(e,t,{...o,platform:i})},yC=e=>{const{element:t,padding:n}=e;function r(o){return Object.prototype.hasOwnProperty.call(o,"current")}return{name:"arrow",options:e,fn(o){return r(t)?t.current!=null?Jy({element:t.current,padding:n}).fn(o):{}:t?Jy({element:t,padding:n}).fn(o):{}}}};var ha=typeof document<"u"?O.useLayoutEffect:O.useEffect;function ga(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!ga(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!ga(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function d0(e){const t=O.useRef(e);return ha(()=>{t.current=e}),t}function EC(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,whileElementsMounted:i,open:s}=e,[l,a]=O.useState({x:null,y:null,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[u,c]=O.useState(r);ga(u,r)||c(r);const f=O.useRef(null),p=O.useRef(null),h=O.useRef(l),v=d0(i),m=d0(o),[E,d]=O.useState(null),[g,y]=O.useState(null),S=O.useCallback(k=>{f.current!==k&&(f.current=k,d(k))},[]),w=O.useCallback(k=>{p.current!==k&&(p.current=k,y(k))},[]),N=O.useCallback(()=>{if(!f.current||!p.current)return;const k={placement:t,strategy:n,middleware:u};m.current&&(k.platform=m.current),vC(f.current,p.current,k).then(B=>{const F={...B,isPositioned:!0};T.current&&!ga(h.current,F)&&(h.current=F,Ar.flushSync(()=>{a(F)}))})},[u,t,n,m]);ha(()=>{s===!1&&h.current.isPositioned&&(h.current.isPositioned=!1,a(k=>({...k,isPositioned:!1})))},[s]);const T=O.useRef(!1);ha(()=>(T.current=!0,()=>{T.current=!1}),[]),ha(()=>{if(E&&g){if(v.current)return v.current(E,g,N);N()}},[E,g,N,v]);const b=O.useMemo(()=>({reference:f,floating:p,setReference:S,setFloating:w}),[S,w]),D=O.useMemo(()=>({reference:E,floating:g}),[E,g]);return O.useMemo(()=>({...l,update:N,refs:b,elements:D,reference:S,floating:w}),[l,N,b,D,S,w])}var Nr=typeof document<"u"?O.useLayoutEffect:O.useEffect;let Wf=!1,SC=0;const p0=()=>"floating-ui-"+SC++;function _C(){const[e,t]=O.useState(()=>Wf?p0():void 0);return Nr(()=>{e==null&&t(p0())},[]),O.useEffect(()=>{Wf||(Wf=!0)},[]),e}const Gf=wd["useId".toString()]||_C;function wC(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){e.set(t,(e.get(t)||[]).filter(r=>r!==n))}}}const RC=O.createContext(null),NC=O.createContext(null),h0=()=>{var e;return((e=O.useContext(RC))==null?void 0:e.id)||null},Yf=()=>O.useContext(NC);function gn(e){return(e==null?void 0:e.ownerDocument)||document}function g0(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function OC(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function Kf(e){return gn(e).defaultView||window}function qt(e){return e?e instanceof Kf(e).Element:!1}function m0(e){return e?e instanceof Kf(e).HTMLElement:!1}function xC(e){if(typeof ShadowRoot>"u")return!1;const t=Kf(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function TC(e){if(e.mozInputSource===0&&e.isTrusted)return!0;const t=/Android/i;return(t.test(g0())||t.test(OC()))&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function IC(e){return e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType!=="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0}function v0(){return/apple/i.test(navigator.vendor)}function CC(){return g0().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function y0(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function E0(e){const t=O.useRef(e);return Nr(()=>{t.current=e}),t}const S0="data-floating-ui-safe-polygon";function Qf(e,t,n){return n&&!y0(n)?0:typeof e=="number"?e:e==null?void 0:e[t]}const AC=function(e,t){let{enabled:n=!0,delay:r=0,handleClose:o=null,mouseOnly:i=!1,restMs:s=0,move:l=!0}=t===void 0?{}:t;const{open:a,onOpenChange:u,dataRef:c,events:f,elements:{domReference:p,floating:h},refs:v}=e,m=Yf(),E=h0(),d=E0(o),g=E0(r),y=O.useRef(),S=O.useRef(),w=O.useRef(),N=O.useRef(),T=O.useRef(!0),b=O.useRef(!1),D=O.useRef(()=>{}),k=O.useCallback(()=>{var R;const P=(R=c.current.openEvent)==null?void 0:R.type;return(P==null?void 0:P.includes("mouse"))&&P!=="mousedown"},[c]);O.useEffect(()=>{if(!n)return;function R(){clearTimeout(S.current),clearTimeout(N.current),T.current=!0}return f.on("dismiss",R),()=>{f.off("dismiss",R)}},[n,f]),O.useEffect(()=>{if(!n||!d.current||!a)return;function R(){k()&&u(!1)}const P=gn(h).documentElement;return P.addEventListener("mouseleave",R),()=>{P.removeEventListener("mouseleave",R)}},[h,a,u,n,d,c,k]);const B=O.useCallback(function(R){R===void 0&&(R=!0);const P=Qf(g.current,"close",y.current);P&&!w.current?(clearTimeout(S.current),S.current=setTimeout(()=>u(!1),P)):R&&(clearTimeout(S.current),u(!1))},[g,u]),F=O.useCallback(()=>{D.current(),w.current=void 0},[]),z=O.useCallback(()=>{if(b.current){const R=gn(v.floating.current).body;R.style.pointerEvents="",R.removeAttribute(S0),b.current=!1}},[v]);return O.useEffect(()=>{if(!n)return;function R(){return c.current.openEvent?["click","mousedown"].includes(c.current.openEvent.type):!1}function P(x){if(clearTimeout(S.current),T.current=!1,i&&!y0(y.current)||s>0&&Qf(g.current,"open")===0)return;c.current.openEvent=x;const L=Qf(g.current,"open",y.current);L?S.current=setTimeout(()=>{u(!0)},L):u(!0)}function A(x){if(R())return;D.current();const L=gn(h);if(clearTimeout(N.current),d.current){a||clearTimeout(S.current),w.current=d.current({...e,tree:m,x:x.clientX,y:x.clientY,onClose(){z(),F(),B()}});const U=w.current;L.addEventListener("mousemove",U),D.current=()=>{L.removeEventListener("mousemove",U)};return}B()}function C(x){R()||d.current==null||d.current({...e,tree:m,x:x.clientX,y:x.clientY,onClose(){z(),F(),B()}})(x)}if(qt(p)){const x=p;return a&&x.addEventListener("mouseleave",C),h==null||h.addEventListener("mouseleave",C),l&&x.addEventListener("mousemove",P,{once:!0}),x.addEventListener("mouseenter",P),x.addEventListener("mouseleave",A),()=>{a&&x.removeEventListener("mouseleave",C),h==null||h.removeEventListener("mouseleave",C),l&&x.removeEventListener("mousemove",P),x.removeEventListener("mouseenter",P),x.removeEventListener("mouseleave",A)}}},[p,h,n,e,i,s,l,B,F,z,u,a,m,g,d,c]),Nr(()=>{var R;if(n&&a&&(R=d.current)!=null&&R.__options.blockPointerEvents&&k()){const C=gn(h).body;if(C.setAttribute(S0,""),C.style.pointerEvents="none",b.current=!0,qt(p)&&h){var P,A;const x=p,L=m==null||(P=m.nodesRef.current.find(U=>U.id===E))==null||(A=P.context)==null?void 0:A.elements.floating;return L&&(L.style.pointerEvents=""),x.style.pointerEvents="auto",h.style.pointerEvents="auto",()=>{x.style.pointerEvents="",h.style.pointerEvents=""}}}},[n,a,E,h,p,m,d,c,k]),Nr(()=>{a||(y.current=void 0,F(),z())},[a,F,z]),O.useEffect(()=>()=>{F(),clearTimeout(S.current),clearTimeout(N.current),z()},[n,F,z]),O.useMemo(()=>{if(!n)return{};function R(P){y.current=P.pointerType}return{reference:{onPointerDown:R,onPointerEnter:R,onMouseMove(){a||s===0||(clearTimeout(N.current),N.current=setTimeout(()=>{T.current||u(!0)},s))}},floating:{onMouseEnter(){clearTimeout(S.current)},onMouseLeave(){f.emit("dismiss",{type:"mouseLeave",data:{returnFocus:!1}}),B(!1)}}}},[f,n,s,a,u,B])};function Xf(){return Xf=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xf.apply(this,arguments)}function _0(e){let t=e.activeElement;for(;((n=t)==null||(r=n.shadowRoot)==null?void 0:r.activeElement)!=null;){var n,r;t=t.shadowRoot.activeElement}return t}function qf(e,t){if(!e||!t)return!1;const n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&xC(n)){let r=t;do{if(r&&e===r)return!0;r=r.parentNode||r.host}while(r)}return!1}function Zf(e,t){let n=e.filter(o=>{var i;return o.parentId===t&&((i=o.context)==null?void 0:i.open)})||[],r=n;for(;r.length;)r=e.filter(o=>{var i;return(i=r)==null?void 0:i.some(s=>{var l;return o.parentId===s.id&&((l=o.context)==null?void 0:l.open)})})||[],n=n.concat(r);return n}function bC(e){return"composedPath"in e?e.composedPath()[0]:e.target}const w0=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function R0(e,t){const n=Qy(e,w0());t==="prev"&&n.reverse();const r=n.indexOf(_0(gn(e)));return n.slice(r+1)[0]}function LC(){return R0(document.body,"next")}function DC(){return R0(document.body,"prev")}function Jf(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!qf(n,r)}function kC(e){Qy(e,w0()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function PC(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const MC=wd["useInsertionEffect".toString()]||(e=>e());function ed(e){const t=O.useRef(()=>{});return MC(()=>{t.current=e}),O.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}const N0={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};let td,nd;function O0(e){e.key==="Tab"&&(td=e.target,clearTimeout(nd))}function UC(e){const t=td===e.relatedTarget;return td=e.relatedTarget,clearTimeout(nd),t}const x0=O.forwardRef(function(t,n){const r=ed(t.onFocus),[o,i]=O.useState();return Nr(()=>(v0()&&i("button"),document.addEventListener("keydown",O0),()=>{document.removeEventListener("keydown",O0)}),[]),O.createElement("span",Xf({},t,{ref:n,tabIndex:0,role:o,"aria-hidden":o?void 0:!0,"data-floating-ui-focus-guard":"",style:N0,onFocus:s=>{v0()&&CC()&&!UC(s)?(s.persist(),nd=window.setTimeout(()=>{r(s)},50)):r(s)}}))}),T0=O.createContext(null),FC=function(e){let{id:t,enabled:n=!0}=e===void 0?{}:e;const[r,o]=O.useState(null),i=Gf(),s=BC();return Nr(()=>{if(!n)return;const l=t?document.getElementById(t):null;if(l)l.setAttribute("data-floating-ui-portal",""),o(l);else{const a=document.createElement("div");t!==""&&(a.id=t||i),a.setAttribute("data-floating-ui-portal",""),o(a);const u=(s==null?void 0:s.portalNode)||document.body;return u.appendChild(a),()=>{u.removeChild(a)}}},[t,s,i,n]),r},VC=e=>{let{children:t,id:n,root:r=null,preserveTabOrder:o=!0}=e;const i=FC({id:n,enabled:!r}),[s,l]=O.useState(null),a=O.useRef(null),u=O.useRef(null),c=O.useRef(null),f=O.useRef(null),p=!!s&&!s.modal&&!!(r||i)&&o;return O.useEffect(()=>{if(!i||!o||s!=null&&s.modal)return;function h(v){i&&Jf(v)&&(v.type==="focusin"?PC:kC)(i)}return i.addEventListener("focusin",h,!0),i.addEventListener("focusout",h,!0),()=>{i.removeEventListener("focusin",h,!0),i.removeEventListener("focusout",h,!0)}},[i,o,s==null?void 0:s.modal]),O.createElement(T0.Provider,{value:O.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:a,afterOutsideRef:u,beforeInsideRef:c,afterInsideRef:f,portalNode:i,setFocusManagerState:l}),[o,i])},p&&i&&O.createElement(x0,{"data-type":"outside",ref:a,onFocus:h=>{if(Jf(h,i)){var v;(v=c.current)==null||v.focus()}else{const m=DC()||(s==null?void 0:s.refs.domReference.current);m==null||m.focus()}}}),p&&i&&O.createElement("span",{"aria-owns":i.id,style:N0}),r?Ar.createPortal(t,r):i?Ar.createPortal(t,i):null,p&&i&&O.createElement(x0,{"data-type":"outside",ref:u,onFocus:h=>{if(Jf(h,i)){var v;(v=f.current)==null||v.focus()}else{const m=LC()||(s==null?void 0:s.refs.domReference.current);m==null||m.focus(),s!=null&&s.closeOnFocusOut&&(s==null||s.onOpenChange(!1))}}}))},BC=()=>O.useContext(T0);function ma(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}const $C={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},zC={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},HC=function(e){var t,n;return e===void 0&&(e=!0),{escapeKeyBubbles:typeof e=="boolean"?e:(t=e.escapeKey)!=null?t:!0,outsidePressBubbles:typeof e=="boolean"?e:(n=e.outsidePress)!=null?n:!0}},jC=function(e,t){let{open:n,onOpenChange:r,events:o,nodeId:i,elements:{reference:s,domReference:l,floating:a},dataRef:u}=e,{enabled:c=!0,escapeKey:f=!0,outsidePress:p=!0,outsidePressEvent:h="pointerdown",referencePress:v=!1,referencePressEvent:m="pointerdown",ancestorScroll:E=!1,bubbles:d=!0}=t===void 0?{}:t;const g=Yf(),y=h0()!=null,S=ed(typeof p=="function"?p:()=>!1),w=typeof p=="function"?S:p,N=O.useRef(!1),{escapeKeyBubbles:T,outsidePressBubbles:b}=HC(d);return O.useEffect(()=>{if(!n||!c)return;u.current.__escapeKeyBubbles=T,u.current.__outsidePressBubbles=b;function D(R){if(R.key==="Escape"){const P=g?Zf(g.nodesRef.current,i):[];if(P.length>0){let A=!0;if(P.forEach(C=>{var x;if((x=C.context)!=null&&x.open&&!C.context.dataRef.current.__escapeKeyBubbles){A=!1;return}}),!A)return}o.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),r(!1)}}function k(R){const P=N.current;if(N.current=!1,P||typeof w=="function"&&!w(R))return;const A=bC(R);if(m0(A)&&a){const L=a.ownerDocument.defaultView||window,U=A.scrollWidth>A.clientWidth,$=A.scrollHeight>A.clientHeight;let j=$&&R.offsetX>A.clientWidth;if($&&L.getComputedStyle(A).direction==="rtl"&&(j=R.offsetX<=A.offsetWidth-A.clientWidth),j||U&&R.offsetY>A.clientHeight)return}const C=g&&Zf(g.nodesRef.current,i).some(L=>{var U;return ma(R,(U=L.context)==null?void 0:U.elements.floating)});if(ma(R,a)||ma(R,l)||C)return;const x=g?Zf(g.nodesRef.current,i):[];if(x.length>0){let L=!0;if(x.forEach(U=>{var $;if(($=U.context)!=null&&$.open&&!U.context.dataRef.current.__outsidePressBubbles){L=!1;return}}),!L)return}o.emit("dismiss",{type:"outsidePress",data:{returnFocus:y?{preventScroll:!0}:TC(R)||IC(R)}}),r(!1)}function B(){r(!1)}const F=gn(a);f&&F.addEventListener("keydown",D),w&&F.addEventListener(h,k);let z=[];return E&&(qt(l)&&(z=qn(l)),qt(a)&&(z=z.concat(qn(a))),!qt(s)&&s&&s.contextElement&&(z=z.concat(qn(s.contextElement)))),z=z.filter(R=>{var P;return R!==((P=F.defaultView)==null?void 0:P.visualViewport)}),z.forEach(R=>{R.addEventListener("scroll",B,{passive:!0})}),()=>{f&&F.removeEventListener("keydown",D),w&&F.removeEventListener(h,k),z.forEach(R=>{R.removeEventListener("scroll",B)})}},[u,a,l,s,f,w,h,o,g,i,n,r,E,c,T,b,y]),O.useEffect(()=>{N.current=!1},[w,h]),O.useMemo(()=>c?{reference:{[$C[m]]:()=>{v&&(o.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),r(!1))}},floating:{[zC[h]]:()=>{N.current=!0}}}:{},[c,o,v,h,m,r])},WC=function(e,t){let{open:n,onOpenChange:r,dataRef:o,events:i,refs:s,elements:{floating:l,domReference:a}}=e,{enabled:u=!0,keyboardOnly:c=!0}=t===void 0?{}:t;const f=O.useRef(""),p=O.useRef(!1),h=O.useRef();return O.useEffect(()=>{if(!u)return;const m=gn(l).defaultView||window;function E(){!n&&m0(a)&&a===_0(gn(a))&&(p.current=!0)}return m.addEventListener("blur",E),()=>{m.removeEventListener("blur",E)}},[l,a,n,u]),O.useEffect(()=>{if(!u)return;function v(m){(m.type==="referencePress"||m.type==="escapeKey")&&(p.current=!0)}return i.on("dismiss",v),()=>{i.off("dismiss",v)}},[i,u]),O.useEffect(()=>()=>{clearTimeout(h.current)},[]),O.useMemo(()=>u?{reference:{onPointerDown(v){let{pointerType:m}=v;f.current=m,p.current=!!(m&&c)},onMouseLeave(){p.current=!1},onFocus(v){var m;p.current||v.type==="focus"&&((m=o.current.openEvent)==null?void 0:m.type)==="mousedown"&&o.current.openEvent&&ma(o.current.openEvent,a)||(o.current.openEvent=v.nativeEvent,r(!0))},onBlur(v){p.current=!1;const m=v.relatedTarget,E=qt(m)&&m.hasAttribute("data-floating-ui-focus-guard")&&m.getAttribute("data-type")==="outside";h.current=setTimeout(()=>{qf(s.floating.current,m)||qf(a,m)||E||r(!1)})}}}:{},[u,c,a,s,o,r])};function I0(e){return O.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})},e)}const GC=function(e,t){let{open:n}=e,{enabled:r=!0,role:o="dialog"}=t===void 0?{}:t;const i=Gf(),s=Gf();return O.useMemo(()=>{const l={id:i,role:o};return r?o==="tooltip"?{reference:{"aria-describedby":n?i:void 0},floating:l}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":o==="alertdialog"?"dialog":o,"aria-controls":n?i:void 0,...o==="listbox"&&{role:"combobox"},...o==="menu"&&{id:s}},floating:{...l,...o==="menu"&&{"aria-labelledby":s}}}:{}},[r,o,n,i,s])};function YC(e){e===void 0&&(e={});const{open:t=!1,onOpenChange:n,nodeId:r}=e,o=EC(e),i=Yf(),s=O.useRef(null),l=O.useRef({}),a=O.useState(()=>wC())[0],[u,c]=O.useState(null),f=O.useCallback(d=>{const g=qt(d)?{getBoundingClientRect:()=>d.getBoundingClientRect(),contextElement:d}:d;o.refs.setReference(g)},[o.refs]),p=O.useCallback(d=>{(qt(d)||d===null)&&(s.current=d,c(d)),(qt(o.refs.reference.current)||o.refs.reference.current===null||d!==null&&!qt(d))&&o.refs.setReference(d)},[o.refs]),h=O.useMemo(()=>({...o.refs,setReference:p,setPositionReference:f,domReference:s}),[o.refs,p,f]),v=O.useMemo(()=>({...o.elements,domReference:u}),[o.elements,u]),m=ed(n),E=O.useMemo(()=>({...o,refs:h,elements:v,dataRef:l,nodeId:r,events:a,open:t,onOpenChange:m}),[o,r,a,t,m,h,v]);return Nr(()=>{const d=i==null?void 0:i.nodesRef.current.find(g=>g.id===r);d&&(d.context=E)}),O.useMemo(()=>({...o,context:E,refs:h,reference:p,positionReference:f}),[o,h,E,p,f])}function rd(e,t,n){const r=new Map;return{...n==="floating"&&{tabIndex:-1},...e,...t.map(o=>o?o[n]:null).concat(e).reduce((o,i)=>(i&&Object.entries(i).forEach(s=>{let[l,a]=s;if(l.indexOf("on")===0){if(r.has(l)||r.set(l,[]),typeof a=="function"){var u;(u=r.get(l))==null||u.push(a),o[l]=function(){for(var c,f=arguments.length,p=new Array(f),h=0;h<f;h++)p[h]=arguments[h];(c=r.get(l))==null||c.forEach(v=>v(...p))}}}else o[l]=a}),o),{})}}const KC=function(e){e===void 0&&(e=[]);const t=e,n=O.useCallback(i=>rd(i,e,"reference"),t),r=O.useCallback(i=>rd(i,e,"floating"),t),o=O.useCallback(i=>rd(i,e,"item"),e.map(i=>i==null?void 0:i.item));return O.useMemo(()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:o}),[n,r,o])};function QC({initialOpen:e=!1,placement:t="top",open:n,onOpenChange:r}={}){const o=St.useRef(null),[i,s]=St.useState(e),l=n??i,a=r??s,u=YC({placement:t,open:l,onOpenChange:a,whileElementsMounted:mC,strategy:"fixed",middleware:[cC(8),uC(),dC({padding:8}),yC({element:o})]}),c=u.context,f=AC(c,{move:!1,enabled:n==null}),p=WC(c,{enabled:n==null}),h=jC(c),v=GC(c,{role:"tooltip"}),m=KC([f,p,h,v]);return St.useMemo(()=>({open:l,setOpen:a,arrowRef:o,...m,...u}),[l,a,m,u])}const C0=St.createContext(null),od=()=>{const e=St.useContext(C0);if(e==null)throw new Error("Tooltip components must be wrapped in <Tooltip />");return e};function XC({children:e,...t}){const n=QC(t);return _(C0.Provider,{value:n,children:e})}const qC={top:"-bottom-1 before:border-t-0 before:border-l-0",bottom:"-top-1 before:border-b-0 before:border-r-0",right:"-right-1 before:border-r-0 before:border-t-0",left:"-left-1 before:border-l-0 before:border-b-0"},ZC=({placement:e="top"})=>{const t=od(),[n,r]=O.useState(t.middlewareData.arrow);O.useEffect(()=>{t.middlewareData.arrow&&r(t.middlewareData.arrow)},[t.middlewareData.arrow]);const o={top:n!=null&&n.y?`${n.y??0}px`:void 0,left:n!=null&&n.x?`${n.x??0}px`:void 0},i=`${qC[e]}`;return _("div",{ref:t.arrowRef,style:o,className:`tooltip-arrow absolute w-2 h-2 bg-inherit rotate-45
65
65
  before:absolute before:w-2 before:h-2 before:content-[''] before:border before:border-foreground/30
66
- ${i}`})},JC=St.forwardRef(function(t,n){var a;const r=we(u=>u.rootElementId),o=O.useRef(null),i=od(),s=document.getElementById(r);if(s&&!o.current&&(o.current=(a=s.shadowRoot)==null?void 0:a.getRootNode()),!o.current)throw new Error(`shadowRoot id:${r} not found. Floating portal cannot be rendered`);const l=I0([i.refs.setFloating,n]);return _(VC,{root:o.current,children:i.open&&V("div",{className:"relative max-w-sm rounded-md bg-foreground p-2 text-sm leading-4 text-background shadow-sm",ref:l,style:{position:i.strategy,top:i.y??0,left:i.x??0,visibility:i.x==null?"hidden":"visible",...t.style},...i.getFloatingProps(t),children:[t.children,_(ZC,{placement:i.placement})]})})}),eA=St.forwardRef(function({children:t,asChild:n=!1,...r},o){const i=od(),s=I0([i.refs.setReference,o,t==null?void 0:t.ref]);return n&&St.isValidElement(t)?St.cloneElement(t,i.getReferenceProps({ref:s,...r,...t.props,"data-state":i.open?"open":"closed"})):_("button",{ref:s,"data-state":i.open?"open":"closed",...i.getReferenceProps(r),children:t})}),va=({asChild:e=!0,children:t,placement:n="top",trigger:r=_(kt,{tag:"circle-info"})})=>V(XC,{placement:n,children:[_(eA,{asChild:e,children:r}),_(JC,{children:t})]}),Et=({children:e,formRef:t,info:n,handleOnChange:r=()=>null,title:o})=>_("form",{className:"flex h-full flex-col overflow-hidden",noValidate:!0,onChange:r,ref:t,children:V("div",{className:"flex flex-col overflow-hidden",children:[V("legend",{className:"mb-2 flex w-full shrink-0 items-center justify-between px-4",children:[_("span",{className:"text-lg font-semibold leading-6",children:o}),n&&_(va,{trigger:V("div",{role:"tooltip",tabIndex:0,children:[_("span",{className:"sr-only",children:M(I.MORE_INFO_TITLE,{title:o})}),_(kt,{tag:"circle-info"})]}),children:n})]}),_("div",{className:"mx-1 flex-1 overflow-y-auto px-3",children:e})]})}),tA={address:{info:I.INFO_NODE_FORWARD_TO_ADDRESS,title:I.FORWARD_TO_ADDRESS,call:I.CALL_ADDRESSES,single:I.SINGLE_ADDRESS,multiple:I.MULTIPLE_ADDRESSES},phone:{info:I.INFO_NODE_FORWARD_TO_PHONE,title:I.FORWARD_TO_PHONE,call:I.CALL_NUMBERS,single:I.SINGLE_NUMBER,multiple:I.MULTIPLE_NUMBERS},resource:{info:I.INFO_NODE_FORWARD_TO_RESOURCE,title:I.FORWARD_TO_RESOURCE,call:I.CALL_RESOURCES,single:I.SINGLE_RESOURCE,multiple:I.MULTIPLE_RESOURCES}},id=({destinationType:e,nodeData:t,handleOnUpdate:n})=>{const r=O.useRef(),o=tA[e],i={single:o.single,multiple:o.multiple},s={callOrder:{value:"serial"},destinationList:{value:Px(t.destinations),valid:!0},destinationSingle:{value:t.destinations.length===1&&t.destinations[0]?t.destinations[0]:"",valid:!0},sessionTimeout:{value:void 0,valid:!0},type:{value:t.type??"single"}},[l,a]=Kt(s);Qi({displayData:l,formRef:r,setCompleted:h=>{n({},h)}});const c=h=>{const v=h.currentTarget.value,m=l.destinationSingle.value;let E="single",d=m.trim()?[m.trim()]:[];v==="multiple"&&(E=l.callOrder.value,d=Of(l.destinationList.value)),a({type:{value:E}}),n({destinations:d,type:E})},f=h=>{const v=h.currentTarget.value;a({type:{value:v}}),n({type:v})},p=h=>{const v=h.target,{name:m,value:E}=v;let d=!0;switch(m){case"destinationSingle":d=v.checkValidity()&&E.trim().length>0,a({[m]:{value:E,valid:d}}),n({destinations:d?[E.trim()]:[]});break;case"destinationList":d=v.checkValidity()&&Boolean(Of(E).length),a({[m]:{value:E,valid:d}}),n({destinations:d?Of(E):[]});break;case"sessionTimeout":d=v.checkValidity(),a({[m]:{value:E?Number.parseInt(E,10):void 0,valid:d}}),n({sessionTimeout:d&&E?Number.parseInt(E,10):void 0});break;default:throw new Error(`Unhandled input name: ${m}`)}};return V(Et,{info:M(o.info),title:M(o.title),formRef:r,children:[_("div",{className:"mb-1",children:V("label",{children:[_("span",{className:"sr-only",children:M(I.CHOOSE_OPTION_SINGLE_MULTIPLE)}),_(Sr,{className:"w-full",name:"quantity",onChange:c,value:l.type.value==="single"?"single":"multiple",children:Object.keys(i).map(h=>_("option",{value:h,children:M(i[h])},h))})]})}),_("div",{children:l.type.value==="single"?_(nA,{displayData:l,destinationType:e,handleChange:p}):_(rA,{displayData:l,destinationType:e,handleCallOrderSelectChange:f,handleChange:p,labels:o})}),e!=="phone"&&V("label",{children:[_("div",{children:M(I.DISCONNECT_CALL_AFTER_RINGING)}),V("div",{className:"flex flex-wrap items-center gap-x-2",children:[_("input",{className:`w-14 ${l.sessionTimeout.valid?"":"invalid"}`,defaultValue:l.sessionTimeout.value,min:0,name:"sessionTimeout",onChange:p,pattern:_r(My),type:"number",inputMode:"numeric"}),M(I.SECONDS),_("p",{className:"requirements w-full",role:"alert",children:M(I.ERROR_NUMBER_IS_REQUIRED)})]})]})]})},nA=({displayData:e,destinationType:t,handleChange:n})=>V(Ae,{children:[V("label",{children:[_("span",{className:"sr-only",children:M(I.SINGLE_NUMBER)}),_("input",{className:`w-full ${e.destinationSingle.valid?"":"invalid"}`,defaultValue:e.destinationSingle.value,name:"destinationSingle",onChange:n,placeholder:"+1 (204) 000 0000",required:!0,type:t==="phone"?"tel":"text"}),_("p",{className:"requirements",role:"alert",children:M(I.ERROR_VALUE_IS_REQUIRED)})]}),t!=="phone"&&_("div",{className:"mb-4 pt-4 text-xs uppercase",children:M(I.SETTINGS)})]}),rA=({displayData:e,destinationType:t,handleCallOrderSelectChange:n,handleChange:r,labels:o})=>{const i={serial:I.SEQUENTIALLY,parallel:I.SIMULTANEOUSLY};return V(Ae,{children:[V("label",{children:[_("span",{className:"sr-only",children:M(I.MULTIPLE_NUMBERS)}),_("textarea",{className:`min-h-[77px] w-full ${e.destinationList.valid?"":"invalid"}`,name:"destinationList",onChange:r,placeholder:"+1 (204) 123 0000, +1 (204) 456 0000, +1 (204) 789 0000",required:!0,value:e.destinationList.value}),_("p",{className:"requirements",role:"alert",children:M(I.ERROR_VALUE_IS_REQUIRED)})]}),_("div",{className:"mb-4 pt-4 text-xs uppercase",children:M(I.SETTINGS)}),_("div",{className:`${t==="phone"?"":"mb-4"}`,children:V("label",{children:[M(o.call),_(Sr,{className:"w-full",name:"callOrder",onChange:n,value:e.type.value,children:Object.keys(i).map(s=>_("option",{value:s,children:M(i[s])},s))})]})})]})},A0=()=>({value:{id:ye(),command:"",digit:""},valid:!0}),sd=e=>e.every(t=>t.valid),oA=({nodeData:e,handleOnUpdate:t})=>{const n=O.useRef(),r={initialTimeout:{value:e.initialTimeout??5,valid:!0},url:{value:e.url,valid:!0},text:{value:e.text,valid:!0},selected:{value:e.selected||"text",valid:!0},options:{value:e.options.length?e.options.map(v=>({value:v,valid:Boolean(v.command||v.digit)})):[A0()],valid:!0}},[o,i]=Kt(r);Qi({displayData:o,formRef:n,setCompleted:v=>{t({},v)}});const l=v=>{v.preventDefault();const m=[...o.options.value,A0()];i({options:{value:m,valid:sd(m)}}),t({options:m.map(E=>E.value)})},a=v=>{const E=o.options.value.filter((d,g)=>g!==v);i({options:{value:E,valid:sd(E)}}),t({options:E.map(d=>d.value)})},u=(v,m)=>v.map(d=>d.value.id===m.value.id?{...d,...m}:d),c=v=>v.map(m=>{const E=m.value.command.trim(),d=m.value.digit.trim();return{...m.value,command:Mf(E)?E:"",digit:Pf(d)?d:""}}),f=(v,m)=>{const E=o.options.value;if(!E[v])throw new Error(`Option not found at index ${v}`);const d=E[v],g={...d==null?void 0:d.value,...m},y=g.command.trim(),S=g.digit.trim(),w=Boolean(y)&&Mf(y)||Boolean(S)&&Pf(S),N={value:g,valid:w},T=u(o.options.value,N);i({options:{value:T,valid:sd(T)}}),t({options:c(T)})},p=(v,m)=>{const E=v.target,{name:d,value:g}=E;let y=!0;switch(d){case"digit":case"command":m!==void 0&&f(m,{[d]:g});break;case"initialTimeout":{y=E.checkValidity(),i({[d]:{value:Number.parseInt(g,10),valid:y}}),t({initialTimeout:y&&g?parseInt(g,10):5});break}default:throw new Error(`Unhandled input name: ${d}`)}},h=o.options.value;return _(Et,{formRef:n,info:M(I.INFO_NODE_GATHER_INPUT),title:M(I.GATHER_INPUT),children:V("div",{className:"divide-y divide-foreground/10",children:[_("div",{className:"mb-2",children:_(zy,{displayData:o,label:M(I.CHOOSE_OPTION_TTS_AUDIO),handleOnUpdate:t,setDisplayData:i})}),_("ul",{children:h.map((v,m,E)=>V("li",{className:"mb-3",children:[V("div",{className:"flex items-center",children:[_("h2",{className:"nowrap flex-1 py-6 text-sm font-medium uppercase leading-4 text-foreground/50",children:M(I.OPTION_NUMBER,{index:m+1})}),Boolean(h.length>1)&&_(va,{trigger:V("button",{className:"px-2",onClick:()=>a(m),type:"button",children:[_("span",{className:"sr-only",children:M(I.REMOVE_OPTION,{index:m+1})}),_(kt,{tag:"xmark"})]}),children:M(I.INFO_NODE_OPTION_REMOVE)})]}),V("label",{className:"flex flex-col",children:[M(I.CALLER_PRESSES),_("input",{className:`w-1/4 ${!v.valid||v.value.digit&&!Pf(v.value.digit)?"invalid":""}`,defaultValue:v.value.digit,name:"digit",onChange:d=>p(d,m),pattern:_r(Uy),type:"text"}),_("p",{className:"requirements",role:"alert",children:M(I.ERROR_TELEPHONE_KEY_REQUIRED)})]}),V("label",{className:"flex flex-col",children:[M(I.OR_SAYS),_("input",{className:`w-full ${!v.valid||v.value.command&&!Mf(v.value.command)?"invalid":""}`,defaultValue:v.value.command,name:"command",onChange:d=>p(d,m),pattern:`${_r(Py)}|''`,type:"text"}),_("p",{className:"requirements",role:"alert",children:M(I.ERROR_TEXT_IS_REQUIRED)})]}),m===E.length-1&&V("button",{onClick:l,type:"button",className:"mb-3 text-primary",children:["+ ",M(I.ADD_OPTION)]})]},v.value.id))}),V("div",{className:"pt-6",children:[_("h2",{className:"pb-6 text-sm uppercase leading-4 text-foreground/50",children:M(I.SETTINGS)}),V("label",{children:[_("div",{className:"w-full",children:M(I.WAIT_FOR_INPUT)}),V("div",{className:"flex flex-wrap items-center gap-x-2",children:[_("input",{className:`w-14 ${o.initialTimeout.valid?"":"invalid"}`,defaultValue:o.initialTimeout.value,min:sa.MIN,max:sa.MAX,name:"initialTimeout",onChange:p,pattern:_r(My),type:"number",inputMode:"numeric"}),M(I.SECONDS),_("p",{className:"requirements w-full",role:"alert",children:M(I.ERROR_NUMBER_MIN_MAX_IS_REQUIRED,{min:sa.MIN,max:sa.MAX})})]})]})]})]})})},iA=({nodeData:e,handleOnChange:t})=>_(Et,{handleOnChange:t,info:M(I.INFO_NODE_HANG_UP),title:M(I.HANG_UP_CALL),children:V("label",{children:[V("p",{className:"mb-2 whitespace-nowrap",children:[M(I.REASON)," (",M(I.OPTIONAL),")"]}),V(Sr,{className:"w-full",defaultValue:e.reason,name:"reason",children:[_("option",{value:"",children:M(I.SELECT)}),Object.keys(Df).map(n=>_("option",{value:n,children:M(Df[n])},n))]})]})}),sA=({nodeData:e,handleOnUpdate:t})=>{const n=O.useRef(),r={url:{value:e.url,valid:!0},text:{value:e.text,valid:!0},selected:{value:e.selected,valid:Boolean(e.selected)}},[o,i]=Kt(r);return Qi({displayData:o,formRef:n,setCompleted:l=>{t({},l)}}),_(Et,{formRef:n,info:M(I.INFO_NODE_PLAY),title:M(I.PLAY_AUDIO_TTS),children:_(zy,{displayData:o,label:M(I.CHOOSE_OPTION_TTS_AUDIO),handleOnUpdate:t,setDisplayData:i,showDefaultOption:!0})})},b0=()=>({id:ye(),key:"",value:"",valid:!0}),L0=e=>e.reduce((t,{id:n,key:r,value:o,valid:i})=>(i&&r.trim().length>0&&t.push({id:n,key:r,value:o}),t),[]),lA=({nodeData:e,handleOnUpdate:t})=>{var m;const n=Er(E=>E.isKeyDuplicate),r={variables:{value:e.variables.length>0?e.variables.map(E=>({...E,valid:!0})):[b0()],valid:!0}},[o,i]=Kt(r),s=Er(E=>E.upsertVariable),l=Er(E=>E.removeVariable),a=E=>{E.preventDefault(),i({variables:{value:[...o.variables.value,b0()],valid:!0}})},u=E=>E.key.trim().length>0&&!n(E.key,E.id)&&Vy(E.key),c=E=>E.every(d=>d.valid),f=E=>o.variables.value.map(d=>d.id===E.id?{...d,...E}:d),p=(E,d)=>{const g=o.variables.value[E];if(!g)throw new Error(`Variable not found at index ${E}`);const y={...g,...d};y.valid=u(y);const S=f(y),w=c(S);i({variables:{value:S,valid:w}}),t({variables:L0(S)},w),y.valid?s({id:y.id,key:y.key,value:y.value}):l(y.id)},h=E=>{const d=o.variables.value[E];if(d){const g=o.variables.value.filter((S,w)=>w!==E),y=c(g);i({variables:{value:g,valid:y}}),t({variables:L0(g)},y),l(d.id)}},v=(E,d)=>{const g=E.target,y=g.name;if(g.checkValidity())switch(y){case"key":case"value":p(d,{[y]:g.value});break;default:throw new Error(`Unhandled input name: ${y}`)}else p(d,{[y]:"",valid:!1})};return _(Et,{info:M(I.INFO_NODE_SET_VARIABLES),title:M(I.SET_VARIABLES),children:_("div",{className:"divide-y divide-foreground/10",children:(m=o.variables.value)==null?void 0:m.map((E,d,g)=>{const y=n(E.key,E.id);return V("div",{className:"mb-3",children:[V("div",{className:"flex flex-nowrap",children:[_("h3",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap py-6 text-sm font-medium uppercase leading-4 text-foreground/50",children:M(I.VARIABLE_KEY,{key:E.key})}),Boolean(g.length>1)&&_(va,{trigger:V("button",{className:"px-2",onClick:()=>h(d),type:"button",children:[_("span",{className:"sr-only",children:M(I.REMOVE_VARIABLE,{key:E.key})}),_(kt,{tag:"xmark"})]}),children:M(I.INFO_NODE_SET_VARIABLES_OPTION)})]}),V("label",{className:"flex flex-col",children:[M(I.KEY),_("input",{className:`w-full ${(E.valid||Vy(E.key))&&!y?"":"invalid"}`,defaultValue:E.key,name:"key",onChange:S=>v(S,d),pattern:_r(Fy),type:"text"}),_("p",{className:"requirements",children:M(y?I.ERROR_DUPLICATE_VARIABLE_KEY:I.ERROR_VARIABLE_KEY_REQUIRED)})]}),V("label",{className:"flex flex-col",children:[M(I.VALUE),_("input",{className:"w-full",defaultValue:E.value,name:"value",onChange:S=>v(S,d),type:"text"}),_("p",{className:"requirements",children:M(I.ERROR_TEXT_IS_REQUIRED)})]}),d===g.length-1&&V("button",{onClick:a,type:"button",className:"mb-3 text-primary",children:["+ ",M(I.ADD_VARIABLE)]})]},E.id)})})})},aA=(e,t)=>{O.useEffect(()=>{var o;const n=(o=e.current)==null?void 0:o.getRootNode(),r=i=>{var l;const s=i.target;s instanceof Node&&!((l=e.current)!=null&&l.contains(s))&&t(i)};return n&&n.addEventListener("pointerdown",r),()=>{n&&n.removeEventListener("pointerdown",r)}},[e,t])},uA=({key:e,setId:t})=>({id:ye(),key:e,setId:t}),cA=e=>e.length>0,fA=({nodeData:e,handleOnUpdate:t})=>{const r={currentFocus:void 0,listOpen:!1,setVariablesList:Array.from(Er(v=>v.variables).values()).map(v=>({...v,selected:Boolean(e.variables.find(m=>m.setId===v.id))})).sort((v,m)=>v.key.toLowerCase().localeCompare(m.key.toLowerCase())),unsetVariables:e.variables},[o,i]=Kt(r),s=v=>o.setVariablesList.map(m=>m.id===v?{...m,selected:!m.selected}:m),l=v=>{const m=o.setVariablesList[v];if(!m)throw new Error("Variable not found");if(m.selected){const E=o.unsetVariables.findIndex(d=>d.setId===m.id);a(E)}else{const E=[...o.unsetVariables,uA({key:m.key,setId:m.id})];i({unsetVariables:E,setVariablesList:s(m.id)}),t({variables:E},!0)}},a=v=>{const m=o.unsetVariables[v];if(!m)throw new Error("Cannot Remove Variable, not found");const E=o.unsetVariables.filter(d=>d.id!==m.id);i({unsetVariables:E,setVariablesList:s(m.setId)}),t({variables:E},cA(E))},u=O.useRef(null);aA(u,()=>i({listOpen:!1}));const c=v=>{(v.key==="Escape"||v.key==="Esc")&&i({listOpen:!1})},f=(v,m)=>{v.preventDefault(),(v.key===" "||v.code==="Space"||v.key==="Enter")&&l(m),c(v)},p=()=>{i({listOpen:!o.listOpen})},h=o.unsetVariables.length;return V(Et,{info:M(I.INFO_NODE_UNSET_VARIABLES),title:M(I.UNSET_VARIABLES),children:[V("div",{className:"my-1 flex flex-col",children:[_("label",{id:"listbox-label",className:"sr-only",children:M(I.SELECT_VARIABLES_TO_UNSET)}),V("div",{className:"relative",ref:u,children:[_("button",{"aria-expanded":"true","aria-haspopup":"listbox","aria-labelledby":"listbox-label",className:`relative w-full cursor-pointer rounded-md border border-foreground/10 bg-transparent py-1.5 px-3 text-left shadow-sm
66
+ ${i}`})},JC=St.forwardRef(function(t,n){var a;const r=we(u=>u.rootElementId),o=O.useRef(null),i=od(),s=document.getElementById(r);if(s&&!o.current&&(o.current=(a=s.shadowRoot)==null?void 0:a.getRootNode()),!o.current)throw new Error(`shadowRoot id:${r} not found. Floating portal cannot be rendered`);const l=I0([i.refs.setFloating,n]);return _(VC,{root:o.current,children:i.open&&V("div",{className:"relative max-w-sm rounded-md bg-foreground p-2 text-sm leading-4 text-background shadow-sm",ref:l,style:{position:i.strategy,top:i.y??0,left:i.x??0,visibility:i.x==null?"hidden":"visible",...t.style},...i.getFloatingProps(t),children:[t.children,_(ZC,{placement:i.placement})]})})}),eA=St.forwardRef(function({children:t,asChild:n=!1,...r},o){const i=od(),s=I0([i.refs.setReference,o,t==null?void 0:t.ref]);return n&&St.isValidElement(t)?St.cloneElement(t,i.getReferenceProps({ref:s,...r,...t.props,"data-state":i.open?"open":"closed"})):_("button",{ref:s,"data-state":i.open?"open":"closed",...i.getReferenceProps(r),children:t})}),va=({asChild:e=!0,children:t,placement:n="top",trigger:r=_(Dt,{tag:"circle-info"})})=>V(XC,{placement:n,children:[_(eA,{asChild:e,children:r}),_(JC,{children:t})]}),Et=({children:e,formRef:t,info:n,handleOnChange:r=()=>null,title:o})=>_("form",{className:"flex h-full flex-col overflow-hidden",noValidate:!0,onChange:r,ref:t,children:V("div",{className:"flex flex-col overflow-hidden",children:[V("legend",{className:"mb-2 flex w-full shrink-0 items-center justify-between px-4",children:[_("span",{className:"text-lg font-semibold leading-6",children:o}),n&&_(va,{trigger:V("div",{role:"tooltip",tabIndex:0,children:[_("span",{className:"sr-only",children:M(I.MORE_INFO_TITLE,{title:o})}),_(Dt,{tag:"circle-info"})]}),children:n})]}),_("div",{className:"mx-1 flex-1 overflow-y-auto px-3",children:e})]})}),tA={address:{info:I.INFO_NODE_FORWARD_TO_ADDRESS,title:I.FORWARD_TO_ADDRESS,call:I.CALL_ADDRESSES,single:I.SINGLE_ADDRESS,multiple:I.MULTIPLE_ADDRESSES},phone:{info:I.INFO_NODE_FORWARD_TO_PHONE,title:I.FORWARD_TO_PHONE,call:I.CALL_NUMBERS,single:I.SINGLE_NUMBER,multiple:I.MULTIPLE_NUMBERS},resource:{info:I.INFO_NODE_FORWARD_TO_RESOURCE,title:I.FORWARD_TO_RESOURCE,call:I.CALL_RESOURCES,single:I.SINGLE_RESOURCE,multiple:I.MULTIPLE_RESOURCES}},id=({destinationType:e,nodeData:t,handleOnUpdate:n})=>{const r=O.useRef(),o=tA[e],i={single:o.single,multiple:o.multiple},s={callOrder:{value:"serial"},destinationList:{value:Px(t.destinations),valid:!0},destinationSingle:{value:t.destinations.length===1&&t.destinations[0]?t.destinations[0]:"",valid:!0},sessionTimeout:{value:void 0,valid:!0},type:{value:t.type??"single"}},[l,a]=Kt(s);Qi({displayData:l,formRef:r,setCompleted:h=>{n({},h)}});const c=h=>{const v=h.currentTarget.value,m=l.destinationSingle.value;let E="single",d=m.trim()?[m.trim()]:[];v==="multiple"&&(E=l.callOrder.value,d=Of(l.destinationList.value)),a({type:{value:E}}),n({destinations:d,type:E})},f=h=>{const v=h.currentTarget.value;a({type:{value:v}}),n({type:v})},p=h=>{const v=h.target,{name:m,value:E}=v;let d=!0;switch(m){case"destinationSingle":d=v.checkValidity()&&E.trim().length>0,a({[m]:{value:E,valid:d}}),n({destinations:d?[E.trim()]:[]});break;case"destinationList":d=v.checkValidity()&&Boolean(Of(E).length),a({[m]:{value:E,valid:d}}),n({destinations:d?Of(E):[]});break;case"sessionTimeout":d=v.checkValidity(),a({[m]:{value:E?Number.parseInt(E,10):void 0,valid:d}}),n({sessionTimeout:d&&E?Number.parseInt(E,10):void 0});break;default:throw new Error(`Unhandled input name: ${m}`)}};return V(Et,{info:M(o.info),title:M(o.title),formRef:r,children:[_("div",{className:"mb-1",children:V("label",{children:[_("span",{className:"sr-only",children:M(I.CHOOSE_OPTION_SINGLE_MULTIPLE)}),_(Sr,{className:"w-full",name:"quantity",onChange:c,value:l.type.value==="single"?"single":"multiple",children:Object.keys(i).map(h=>_("option",{value:h,children:M(i[h])},h))})]})}),_("div",{children:l.type.value==="single"?_(nA,{displayData:l,destinationType:e,handleChange:p}):_(rA,{displayData:l,destinationType:e,handleCallOrderSelectChange:f,handleChange:p,labels:o})}),e!=="phone"&&V("label",{children:[_("div",{children:M(I.DISCONNECT_CALL_AFTER_RINGING)}),V("div",{className:"flex flex-wrap items-center gap-x-2",children:[_("input",{className:`w-14 ${l.sessionTimeout.valid?"":"invalid"}`,defaultValue:l.sessionTimeout.value,min:0,name:"sessionTimeout",onChange:p,pattern:_r(My),type:"number",inputMode:"numeric"}),M(I.SECONDS),_("p",{className:"requirements w-full",role:"alert",children:M(I.ERROR_NUMBER_IS_REQUIRED)})]})]})]})},nA=({displayData:e,destinationType:t,handleChange:n})=>V(Ae,{children:[V("label",{children:[_("span",{className:"sr-only",children:M(I.SINGLE_NUMBER)}),_("input",{className:`w-full ${e.destinationSingle.valid?"":"invalid"}`,defaultValue:e.destinationSingle.value,name:"destinationSingle",onChange:n,placeholder:"+1 (204) 000 0000",required:!0,type:t==="phone"?"tel":"text"}),_("p",{className:"requirements",role:"alert",children:M(I.ERROR_VALUE_IS_REQUIRED)})]}),t!=="phone"&&_("div",{className:"mb-4 pt-4 text-xs uppercase",children:M(I.SETTINGS)})]}),rA=({displayData:e,destinationType:t,handleCallOrderSelectChange:n,handleChange:r,labels:o})=>{const i={serial:I.SEQUENTIALLY,parallel:I.SIMULTANEOUSLY};return V(Ae,{children:[V("label",{children:[_("span",{className:"sr-only",children:M(I.MULTIPLE_NUMBERS)}),_("textarea",{className:`min-h-[77px] w-full ${e.destinationList.valid?"":"invalid"}`,name:"destinationList",onChange:r,placeholder:"+1 (204) 123 0000, +1 (204) 456 0000, +1 (204) 789 0000",required:!0,value:e.destinationList.value}),_("p",{className:"requirements",role:"alert",children:M(I.ERROR_VALUE_IS_REQUIRED)})]}),_("div",{className:"mb-4 pt-4 text-xs uppercase",children:M(I.SETTINGS)}),_("div",{className:`${t==="phone"?"":"mb-4"}`,children:V("label",{children:[M(o.call),_(Sr,{className:"w-full",name:"callOrder",onChange:n,value:e.type.value,children:Object.keys(i).map(s=>_("option",{value:s,children:M(i[s])},s))})]})})]})},A0=()=>({value:{id:ye(),command:"",digit:""},valid:!0}),sd=e=>e.every(t=>t.valid),oA=({nodeData:e,handleOnUpdate:t})=>{const n=O.useRef(),r={initialTimeout:{value:e.initialTimeout??5,valid:!0},url:{value:e.url,valid:!0},text:{value:e.text,valid:!0},selected:{value:e.selected||"text",valid:!0},options:{value:e.options.length?e.options.map(v=>({value:v,valid:Boolean(v.command||v.digit)})):[A0()],valid:!0}},[o,i]=Kt(r);Qi({displayData:o,formRef:n,setCompleted:v=>{t({},v)}});const l=v=>{v.preventDefault();const m=[...o.options.value,A0()];i({options:{value:m,valid:sd(m)}}),t({options:m.map(E=>E.value)})},a=v=>{const E=o.options.value.filter((d,g)=>g!==v);i({options:{value:E,valid:sd(E)}}),t({options:E.map(d=>d.value)})},u=(v,m)=>v.map(d=>d.value.id===m.value.id?{...d,...m}:d),c=v=>v.map(m=>{const E=m.value.command.trim(),d=m.value.digit.trim();return{...m.value,command:Mf(E)?E:"",digit:Pf(d)?d:""}}),f=(v,m)=>{const E=o.options.value;if(!E[v])throw new Error(`Option not found at index ${v}`);const d=E[v],g={...d==null?void 0:d.value,...m},y=g.command.trim(),S=g.digit.trim(),w=Boolean(y)&&Mf(y)||Boolean(S)&&Pf(S),N={value:g,valid:w},T=u(o.options.value,N);i({options:{value:T,valid:sd(T)}}),t({options:c(T)})},p=(v,m)=>{const E=v.target,{name:d,value:g}=E;let y=!0;switch(d){case"digit":case"command":m!==void 0&&f(m,{[d]:g});break;case"initialTimeout":{y=E.checkValidity(),i({[d]:{value:Number.parseInt(g,10),valid:y}}),t({initialTimeout:y&&g?parseInt(g,10):5});break}default:throw new Error(`Unhandled input name: ${d}`)}},h=o.options.value;return _(Et,{formRef:n,info:M(I.INFO_NODE_GATHER_INPUT),title:M(I.GATHER_INPUT),children:V("div",{className:"divide-y divide-foreground/10",children:[_("div",{className:"mb-2",children:_(zy,{displayData:o,label:M(I.CHOOSE_OPTION_TTS_AUDIO),handleOnUpdate:t,setDisplayData:i})}),_("ul",{children:h.map((v,m,E)=>V("li",{className:"mb-3",children:[V("div",{className:"flex items-center",children:[_("h2",{className:"nowrap flex-1 py-6 text-sm font-medium uppercase leading-4 text-foreground/50",children:M(I.OPTION_NUMBER,{index:m+1})}),Boolean(h.length>1)&&_(va,{trigger:V("button",{className:"px-2",onClick:()=>a(m),type:"button",children:[_("span",{className:"sr-only",children:M(I.REMOVE_OPTION,{index:m+1})}),_(Dt,{tag:"xmark"})]}),children:M(I.INFO_NODE_OPTION_REMOVE)})]}),V("label",{className:"flex flex-col",children:[M(I.CALLER_PRESSES),_("input",{className:`w-1/4 ${!v.valid||v.value.digit&&!Pf(v.value.digit)?"invalid":""}`,defaultValue:v.value.digit,name:"digit",onChange:d=>p(d,m),pattern:_r(Uy),type:"text"}),_("p",{className:"requirements",role:"alert",children:M(I.ERROR_TELEPHONE_KEY_REQUIRED)})]}),V("label",{className:"flex flex-col",children:[M(I.OR_SAYS),_("input",{className:`w-full ${!v.valid||v.value.command&&!Mf(v.value.command)?"invalid":""}`,defaultValue:v.value.command,name:"command",onChange:d=>p(d,m),pattern:`${_r(Py)}|''`,type:"text"}),_("p",{className:"requirements",role:"alert",children:M(I.ERROR_TEXT_IS_REQUIRED)})]}),m===E.length-1&&V("button",{onClick:l,type:"button",className:"mb-3 text-primary",children:["+ ",M(I.ADD_OPTION)]})]},v.value.id))}),V("div",{className:"pt-6",children:[_("h2",{className:"pb-6 text-sm uppercase leading-4 text-foreground/50",children:M(I.SETTINGS)}),V("label",{children:[_("div",{className:"w-full",children:M(I.WAIT_FOR_INPUT)}),V("div",{className:"flex flex-wrap items-center gap-x-2",children:[_("input",{className:`w-14 ${o.initialTimeout.valid?"":"invalid"}`,defaultValue:o.initialTimeout.value,min:sa.MIN,max:sa.MAX,name:"initialTimeout",onChange:p,pattern:_r(My),type:"number",inputMode:"numeric"}),M(I.SECONDS),_("p",{className:"requirements w-full",role:"alert",children:M(I.ERROR_NUMBER_MIN_MAX_IS_REQUIRED,{min:sa.MIN,max:sa.MAX})})]})]})]})]})})},iA=({nodeData:e,handleOnChange:t})=>_(Et,{handleOnChange:t,info:M(I.INFO_NODE_HANG_UP),title:M(I.HANG_UP_CALL),children:V("label",{children:[V("p",{className:"mb-2 whitespace-nowrap",children:[M(I.REASON)," (",M(I.OPTIONAL),")"]}),V(Sr,{className:"w-full",defaultValue:e.reason,name:"reason",children:[_("option",{value:"",children:M(I.SELECT)}),Object.keys(Df).map(n=>_("option",{value:n,children:M(Df[n])},n))]})]})}),sA=({nodeData:e,handleOnUpdate:t})=>{const n=O.useRef(),r={url:{value:e.url,valid:!0},text:{value:e.text,valid:!0},selected:{value:e.selected,valid:Boolean(e.selected)}},[o,i]=Kt(r);return Qi({displayData:o,formRef:n,setCompleted:l=>{t({},l)}}),_(Et,{formRef:n,info:M(I.INFO_NODE_PLAY),title:M(I.PLAY_AUDIO_TTS),children:_(zy,{displayData:o,label:M(I.CHOOSE_OPTION_TTS_AUDIO),handleOnUpdate:t,setDisplayData:i,showDefaultOption:!0})})},b0=()=>({id:ye(),key:"",value:"",valid:!0}),L0=e=>e.reduce((t,{id:n,key:r,value:o,valid:i})=>(i&&r.trim().length>0&&t.push({id:n,key:r,value:o}),t),[]),lA=({nodeData:e,handleOnUpdate:t})=>{var m;const n=Er(E=>E.isKeyDuplicate),r={variables:{value:e.variables.length>0?e.variables.map(E=>({...E,valid:!0})):[b0()],valid:!0}},[o,i]=Kt(r),s=Er(E=>E.upsertVariable),l=Er(E=>E.removeVariable),a=E=>{E.preventDefault(),i({variables:{value:[...o.variables.value,b0()],valid:!0}})},u=E=>E.key.trim().length>0&&!n(E.key,E.id)&&Vy(E.key),c=E=>E.every(d=>d.valid),f=E=>o.variables.value.map(d=>d.id===E.id?{...d,...E}:d),p=(E,d)=>{const g=o.variables.value[E];if(!g)throw new Error(`Variable not found at index ${E}`);const y={...g,...d};y.valid=u(y);const S=f(y),w=c(S);i({variables:{value:S,valid:w}}),t({variables:L0(S)},w),y.valid?s({id:y.id,key:y.key,value:y.value}):l(y.id)},h=E=>{const d=o.variables.value[E];if(d){const g=o.variables.value.filter((S,w)=>w!==E),y=c(g);i({variables:{value:g,valid:y}}),t({variables:L0(g)},y),l(d.id)}},v=(E,d)=>{const g=E.target,y=g.name;if(g.checkValidity())switch(y){case"key":case"value":p(d,{[y]:g.value});break;default:throw new Error(`Unhandled input name: ${y}`)}else p(d,{[y]:"",valid:!1})};return _(Et,{info:M(I.INFO_NODE_SET_VARIABLES),title:M(I.SET_VARIABLES),children:_("div",{className:"divide-y divide-foreground/10",children:(m=o.variables.value)==null?void 0:m.map((E,d,g)=>{const y=n(E.key,E.id);return V("div",{className:"mb-3",children:[V("div",{className:"flex flex-nowrap",children:[_("h3",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap py-6 text-sm font-medium uppercase leading-4 text-foreground/50",children:M(I.VARIABLE_KEY,{key:E.key})}),Boolean(g.length>1)&&_(va,{trigger:V("button",{className:"px-2",onClick:()=>h(d),type:"button",children:[_("span",{className:"sr-only",children:M(I.REMOVE_VARIABLE,{key:E.key})}),_(Dt,{tag:"xmark"})]}),children:M(I.INFO_NODE_SET_VARIABLES_OPTION)})]}),V("label",{className:"flex flex-col",children:[M(I.KEY),_("input",{className:`w-full ${(E.valid||Vy(E.key))&&!y?"":"invalid"}`,defaultValue:E.key,name:"key",onChange:S=>v(S,d),pattern:_r(Fy),type:"text"}),_("p",{className:"requirements",children:M(y?I.ERROR_DUPLICATE_VARIABLE_KEY:I.ERROR_VARIABLE_KEY_REQUIRED)})]}),V("label",{className:"flex flex-col",children:[M(I.VALUE),_("input",{className:"w-full",defaultValue:E.value,name:"value",onChange:S=>v(S,d),type:"text"}),_("p",{className:"requirements",children:M(I.ERROR_TEXT_IS_REQUIRED)})]}),d===g.length-1&&V("button",{onClick:a,type:"button",className:"mb-3 text-primary",children:["+ ",M(I.ADD_VARIABLE)]})]},E.id)})})})},aA=(e,t)=>{O.useEffect(()=>{var o;const n=(o=e.current)==null?void 0:o.getRootNode(),r=i=>{var l;const s=i.target;s instanceof Node&&!((l=e.current)!=null&&l.contains(s))&&t(i)};return n&&n.addEventListener("pointerdown",r),()=>{n&&n.removeEventListener("pointerdown",r)}},[e,t])},uA=({key:e,setId:t})=>({id:ye(),key:e,setId:t}),cA=e=>e.length>0,fA=({nodeData:e,handleOnUpdate:t})=>{const r={currentFocus:void 0,listOpen:!1,setVariablesList:Array.from(Er(v=>v.variables).values()).map(v=>({...v,selected:Boolean(e.variables.find(m=>m.setId===v.id))})).sort((v,m)=>v.key.toLowerCase().localeCompare(m.key.toLowerCase())),unsetVariables:e.variables},[o,i]=Kt(r),s=v=>o.setVariablesList.map(m=>m.id===v?{...m,selected:!m.selected}:m),l=v=>{const m=o.setVariablesList[v];if(!m)throw new Error("Variable not found");if(m.selected){const E=o.unsetVariables.findIndex(d=>d.setId===m.id);a(E)}else{const E=[...o.unsetVariables,uA({key:m.key,setId:m.id})];i({unsetVariables:E,setVariablesList:s(m.id)}),t({variables:E},!0)}},a=v=>{const m=o.unsetVariables[v];if(!m)throw new Error("Cannot Remove Variable, not found");const E=o.unsetVariables.filter(d=>d.id!==m.id);i({unsetVariables:E,setVariablesList:s(m.setId)}),t({variables:E},cA(E))},u=O.useRef(null);aA(u,()=>i({listOpen:!1}));const c=v=>{(v.key==="Escape"||v.key==="Esc")&&i({listOpen:!1})},f=(v,m)=>{v.preventDefault(),(v.key===" "||v.code==="Space"||v.key==="Enter")&&l(m),c(v)},p=()=>{i({listOpen:!o.listOpen})},h=o.unsetVariables.length;return V(Et,{info:M(I.INFO_NODE_UNSET_VARIABLES),title:M(I.UNSET_VARIABLES),children:[V("div",{className:"my-1 flex flex-col",children:[_("label",{id:"listbox-label",className:"sr-only",children:M(I.SELECT_VARIABLES_TO_UNSET)}),V("div",{className:"relative",ref:u,children:[_("button",{"aria-expanded":"true","aria-haspopup":"listbox","aria-labelledby":"listbox-label",className:`relative w-full cursor-pointer rounded-md border border-foreground/10 bg-transparent py-1.5 px-3 text-left shadow-sm
67
67
  after:absolute after:right-3 after:top-3 after:h-[7px] after:w-[7px] after:rotate-45 after:border-r after:border-b after:border-foreground after:content-['']
68
- focus:outline-none focus:ring-1 focus:ring-foreground`,onClick:p,onKeyDown:c,type:"button",children:h>0?M(I.NUMBER_OF_VARIABLES_SELECTED,{count:h}):M(I.SELECT_VARIABLES)}),o.listOpen&&V("ul",{"aria-activedescendant":o.currentFocus,"aria-labelledby":"listbox-label","aria-multiselectable":"true",className:"mt-1 max-h-60 w-full overflow-auto rounded-lg border border-foreground/10 bg-backgroundAlt py-1 shadow-xl",role:"listbox",children:[!o.setVariablesList.length&&_("li",{"aria-disabled":"true",className:"relative",role:"option",children:_("label",{className:"flex select-none items-center py-2 pl-3 pr-9",children:M(I.NO_VARIABLES_SET)})}),o.setVariablesList.map((v,m)=>_("li",{"aria-selected":v.selected,className:"relative",id:v.id,role:"option",children:V("label",{className:"flex select-none items-center py-2 pl-3 pr-9",children:[_("input",{checked:v.selected,className:"mr-2 h-4 w-4 rounded accent-primary",onChange:()=>l(m),onKeyDown:E=>f(E,m),type:"checkbox"}),v.key]})},v.id))]})]})]}),h>0&&V("section",{className:"pt-3",children:[_("h3",{className:"mb-2 leading-5 text-foreground",children:M(I.UNSET_VARIABLES)}),_("ul",{className:"flex flex-wrap gap-2",children:o.unsetVariables.map((v,m)=>_(fI,{handleClick:()=>a(m),children:v.key},v.id))})]})]})},dA=({nodeData:e,handleOnUpdate:t})=>{const n={beep:{value:e.beep},format:{value:e.format,valid:!0},stereo:{value:e.stereo},terminators:{value:e.terminators,valid:!0}},[r,o]=Kt(n);return _(Et,{info:M(I.INFO_NODE_RECORD),title:M(I.VOICEMAIL_RECORDING),children:_(Hy,{handleOnUpdate:t,displayData:r,setDisplayData:o})})},pA=({nodeData:e,handleOnUpdate:t})=>{const n={beep:{value:e.beep},controlId:{value:e.controlId},format:{value:e.format,valid:!0},label:{value:e.label,valid:!0},stereo:{value:e.stereo},terminators:{value:e.terminators,valid:!0}},r=O.useRef(),[o,i]=Kt(n),[s,l]=O.useState(!1),a=Gn(p=>p.upsertEntry),u=Gn(p=>p.isValueDuplicate);Qi({displayData:o,formRef:r,setCompleted:p=>{t({},p)}});const f=p=>{let h=!0;const v=p.target,{name:m,value:E}=v,d=E.trim(),g=u(d,e.controlId);l(g),h=v.checkValidity()&&Boolean(d)&&!g,i({[m]:{value:E,valid:h}}),t({[m]:h?d:""}),a({controlId:e.controlId,label:h?d:""})};return V(Et,{info:M(I.INFO_NODE_RECORD_CALL_START),title:M(I.RECORD_CALL_START),formRef:r,children:[V("label",{children:[M(I.RECORDING_NAME),_("input",{className:`w-full ${o.label.valid?"":"invalid"}`,defaultValue:o.label.value,name:"label",onChange:f,pattern:_r(UI),required:!0,type:"text"}),_("p",{className:"requirements",role:"alert",children:M(s?I.ERROR_DUPLICATE_RECORDING_LABEL:I.ERROR_RECORDING_LABEL_REQUIRED)})]}),_(Hy,{handleOnUpdate:t,displayData:o,setDisplayData:i})]})},hA=({nodeData:e,handleOnChange:t})=>{const r=Gn(o=>o.getEntries)().sort((o,i)=>o.label.toLowerCase().localeCompare(i.label.toLowerCase()));return _(Et,{handleOnChange:t,info:M(I.INFO_NODE_RECORD_CALL_STOP),title:M(I.RECORD_CALL_STOP),children:r.length?V("label",{children:[_("p",{className:"mb-2 whitespace-nowrap",children:M(I.RECORDING_NAME)}),V(Sr,{className:"w-full",defaultValue:e.controlId,name:"controlId",children:[_("option",{value:"",children:M(I.SELECT)}),r.map(o=>_("option",{value:o.controlId,children:o.label},o.controlId))]})]}):_("p",{className:"text-negative",children:M(I.ERROR_ADD_RECORDING_FIRST)})})},gA=({nodeData:e,handleOnUpdate:t})=>{const n={body:{value:e.body,valid:!0},fromNumber:{value:e.fromNumber,valid:!0},toNumber:{value:e.toNumber,valid:!0}},[r,o]=Kt(n),i=s=>{const l=s.target,{name:a,value:u}=l,c=typeof u=="string"?u.trim():u;let f=!0;switch(a){case"body":case"fromNumber":case"toNumber":f=l.checkValidity()&&!!c,o({[a]:{value:u,valid:f}}),t({[a]:f?c:""});break;default:throw new Error(`Unhandled input name: ${a}`)}};return V(Et,{info:M(I.INFO_NODE_SEND_SMS),title:M(I.SEND_SMS),children:[V("label",{className:"mb-1",children:[_("div",{children:M(I.FROM_PHONE_NUMBER)}),_("input",{className:`w-full ${r.fromNumber.valid?"":"invalid"}`,defaultValue:r.fromNumber.value,name:"fromNumber",onChange:i,placeholder:"+1 (204) 000 0000",required:!0,type:"tel"}),_("p",{className:"requirements w-full",role:"alert",children:M(I.ERROR_VALUE_IS_REQUIRED)})]}),V("label",{className:"mb-1",children:[_("div",{children:M(I.TO_PHONE_NUMBER)}),_("input",{className:`w-full ${r.toNumber.valid?"":"invalid"}`,defaultValue:r.toNumber.value,name:"toNumber",onChange:i,placeholder:"+1 (204) 000 0000",required:!0,type:"tel"}),_("p",{className:"requirements w-full",role:"alert",children:M(I.ERROR_VALUE_IS_REQUIRED)})]}),V("label",{children:[_("div",{children:M(I.TEXT)}),_(Ki,{errorText:M(I.ERROR_VALUE_IS_REQUIRED),inputMode:"text",valid:Boolean(r.body.valid),label:M(I.SMS_TEXT),name:"body",onChange:i,placeholder:M(I.WRITE_SOMETHING),required:!0,value:r.body.value})]})]})},mA=["GET","POST","PUT","DELETE"],vA=e=>{console.log("bodyToTextArea",e);try{return typeof e=="string"?e:JSON.stringify(e)}catch{return e}},yA=({nodeData:e,handleOnUpdate:t})=>{const n={url:{value:e.url,valid:!0},method:{value:e.method,valid:!0},headers:{value:e.headers,valid:!0},body:{value:e.body,valid:!0},saveVariables:{value:Boolean(e.saveVariables),valid:!0}},[r,o]=Kt(n),i=a=>{const u=a.target,{name:c,value:f}=u,p=typeof f=="string"?f.trim():f;let h=!0;switch(c){case"url":case"method":h=u.checkValidity()&&!!p,o({[c]:{value:f,valid:h}}),t({[c]:h?p:""});break;case"headers":if(!f){o({[c]:{value:{},valid:!0}}),t({[c]:{}});return}try{const v=JSON.parse(f);o({[c]:{valid:!0}}),t({[c]:v})}catch{o({[c]:{valid:!1}}),t({[c]:{}})}break;case"body":try{const v=JSON.parse(f);o({[c]:{value:f,valid:!0}}),t({[c]:v})}catch{o({[c]:{value:f,valid:!0}}),t({[c]:f})}break;default:throw new Error(`Unhandled input name: ${c}`)}},s=a=>{const u=a.target.name,c=a.target.value,f={[u]:c};o(f),t(f)},l=a=>{const u=a.target.name,c=!r[u].value;o({[u]:{value:c}}),t({[u]:c})};return V(Et,{info:M(I.INFO_NODE_REQUEST),title:M(I.REQUEST),children:[V("label",{children:[_("div",{children:M(I.URL)}),_("input",{className:`w-full ${r.url.valid?"":"invalid"}`,defaultValue:r.url.value,name:"url",onChange:i,placeholder:"https://user:password@example.com/api/status",required:!0,type:"text"}),_("p",{className:"requirements w-full",role:"alert",children:M(I.ERROR_VALUE_IS_REQUIRED)})]}),V("label",{className:"mb-3 block",children:[M(I.METHOD),_(Sr,{className:"w-full",value:r.method.value,name:"method",onChange:s,children:mA.map(a=>_("option",{value:a,children:a},a))})]}),_("div",{className:"mb-4",children:_(ky,{checked:r.saveVariables.value,clickHandler:l,name:"saveVariables",subtitle:M(I.SAVE_VARIABLES_SUBTITLE),title:M(I.SAVE_VARIABLES)})}),V("label",{children:[_("div",{children:M(I.REQUEST_HEADERS)}),_(Ki,{errorText:M(I.ERROR_INVALID_JSON),inputMode:"text",valid:Boolean(r.headers.valid),label:M(I.REQUEST_HEADERS),name:"headers",onChange:i,placeholder:'{"Content-Type": "application/json", "X-Custom-Header": "foo"}',required:!0,value:JSON.stringify(r.headers.value)})]}),V("label",{children:[_("div",{children:M(I.REQUEST_BODY)}),_(Ki,{inputMode:"text",valid:!0,label:M(I.REQUEST_BODY),name:"body",onChange:i,placeholder:"String or JSON to serialize",value:vA(r.body.value)})]})]})},D0=()=>({value:{id:ye(),value:""},valid:!0}),ld=e=>e.every(t=>t.valid),EA=({nodeData:e,handleOnUpdate:t})=>{const n=O.useRef(),r={options:{value:e.options.length?e.options.map(v=>({value:v,valid:Boolean(v.value)})):[D0()],valid:!0}},[o,i]=Kt(r);Qi({displayData:o,formRef:n,setCompleted:v=>{t({},v)}});const l=v=>{v.preventDefault();const m=[...o.options.value,D0()];i({options:{value:m,valid:ld(m)}}),t({options:m.map(E=>E.value)})},a=v=>{const E=o.options.value.filter((d,g)=>g!==v);i({options:{value:E,valid:ld(E)}}),t({options:E.map(d=>d.value)})},u=(v,m)=>v.map(d=>d.value.id===m.value.id?{...d,...m}:d),c=v=>v.map(m=>({...m.value,value:m.value.value.trim()})),f=(v,m)=>{const E=o.options.value;E[v]||It().error(`Option not found at index ${v}`);const d=E[v],g={...d==null?void 0:d.value,...m},y=Boolean(g.value.trim()),S={value:g,valid:y},w=u(o.options.value,S);i({options:{value:w,valid:ld(w)}}),t({options:c(w)})},p=(v,m)=>{const E=v.target,{name:d,value:g}=E;switch(d){case"value":m!==void 0&&f(m,{[d]:g});break;default:It().error(`Unhandled input name: ${d}`)}},h=o.options.value;return _(Et,{formRef:n,info:M(I.INFO_NODE_COND),title:M(I.CONDITIONS),children:_("div",{className:"divide-y divide-foreground/10",children:h.map((v,m,E)=>V("div",{className:"mb-3",children:[V("div",{className:"flex items-center",children:[_("h2",{className:"nowrap flex-1 py-4 text-sm font-medium uppercase leading-4 text-foreground/50",children:M(I.CONDITION_NUMBER,{index:m+1})}),Boolean(h.length>1)&&_(va,{trigger:V("button",{className:"px-2",onClick:()=>a(m),type:"button",children:[_("span",{className:"sr-only",children:M(I.REMOVE_CONDITION,{index:m+1})}),_(kt,{tag:"xmark"})]}),children:M(I.INFO_NODE_OPTION_REMOVE)})]}),V("label",{className:"flex flex-col",children:[_("input",{className:`w-full ${v.valid?"":"invalid"}`,defaultValue:v.value.value,name:"value",onChange:d=>p(d,m),placeholder:"${count} > 3, /hello/.test('${foo}')",type:"text"}),_("p",{className:"requirements",role:"alert",children:M(I.ERROR_VALUE_IS_REQUIRED)})]}),m===E.length-1&&V("button",{onClick:l,type:"button",className:"mb-3 text-primary",children:["+ ",M(I.ADD_CONDITION)]})]},v.value.id))})})},SA=()=>{const e=we(u=>u.selectedNode),t=we(u=>u.partialUpdateNodeData),n=e==null?void 0:e.data,r=e==null?void 0:e.id;if(!(e&&n&&r))return null;const o=u=>{const c=new FormData(u.currentTarget),f=Object.fromEntries(c.entries());t(r,{...f,missingRequiredParams:!By(f)})},i=(u,c)=>{typeof c=="boolean"&&(u.missingRequiredParams=!c),t(r,u)},s={forwardAddress:()=>_(id,{destinationType:"address",nodeData:n,handleOnUpdate:i}),forwardPhone:()=>_(id,{destinationType:"phone",nodeData:n,handleOnUpdate:i}),forwardResource:()=>_(id,{destinationType:"resource",nodeData:n,handleOnUpdate:i}),hangup:()=>_(iA,{nodeData:n,handleOnChange:o}),play:()=>_(sA,{nodeData:n,handleOnUpdate:i}),promptPlay:()=>_(oA,{nodeData:n,handleOnUpdate:i}),set:()=>_(lA,{nodeData:n,handleOnUpdate:i}),unset:()=>_(fA,{nodeData:n,handleOnUpdate:i}),record:()=>_(dA,{nodeData:n,handleOnUpdate:i}),recordCallStart:()=>_(pA,{nodeData:n,handleOnUpdate:i}),recordCallStop:()=>_(hA,{nodeData:n,handleOnChange:o}),sendSms:()=>_(gA,{nodeData:n,handleOnUpdate:i}),request:()=>_(yA,{nodeData:n,handleOnUpdate:i}),cond:()=>_(EA,{nodeData:n,handleOnUpdate:i})};if(!(u=>Boolean(u in s))(e.type))return null;const a=s[e.type];return _(nf,{className:"nokey flex max-h-[95%] w-[300px] flex-col overflow-hidden rounded-md border border-foreground/10 bg-background py-4",position:"top-right",children:_(a,{})})};function k0(e){let t;try{t=e()}catch{return}return{getItem:r=>{var o;const i=l=>l===null?null:JSON.parse(l),s=(o=t.getItem(r))!=null?o:null;return s instanceof Promise?s.then(i):i(s)},setItem:(r,o)=>t.setItem(r,JSON.stringify(o)),removeItem:r=>t.removeItem(r)}}const ts=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return ts(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return ts(r)(n)}}}},_A=(e,t)=>(n,r,o)=>{let i={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:E=>E,version:0,merge:(E,d)=>({...d,...E}),...t},s=!1;const l=new Set,a=new Set;let u;try{u=i.getStorage()}catch{}if(!u)return e((...E)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...E)},r,o);const c=ts(i.serialize),f=()=>{const E=i.partialize({...r()});let d;const g=c({state:E,version:i.version}).then(y=>u.setItem(i.name,y)).catch(y=>{d=y});if(d)throw d;return g},p=o.setState;o.setState=(E,d)=>{p(E,d),f()};const h=e((...E)=>{n(...E),f()},r,o);let v;const m=()=>{var E;if(!u)return;s=!1,l.forEach(g=>g(r()));const d=((E=i.onRehydrateStorage)==null?void 0:E.call(i,r()))||void 0;return ts(u.getItem.bind(u))(i.name).then(g=>{if(g)return i.deserialize(g)}).then(g=>{if(g)if(typeof g.version=="number"&&g.version!==i.version){if(i.migrate)return i.migrate(g.state,g.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return g.state}).then(g=>{var y;return v=i.merge(g,(y=r())!=null?y:h),n(v,!0),f()}).then(()=>{d==null||d(v,void 0),s=!0,a.forEach(g=>g(v))}).catch(g=>{d==null||d(void 0,g)})};return o.persist={setOptions:E=>{i={...i,...E},E.getStorage&&(u=E.getStorage())},clearStorage:()=>{u==null||u.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>m(),hasHydrated:()=>s,onHydrate:E=>(l.add(E),()=>{l.delete(E)}),onFinishHydration:E=>(a.add(E),()=>{a.delete(E)})},m(),v||h},wA=(e,t)=>(n,r,o)=>{let i={storage:k0(()=>localStorage),partialize:m=>m,version:0,merge:(m,E)=>({...E,...m}),...t},s=!1;const l=new Set,a=new Set;let u=i.storage;if(!u)return e((...m)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...m)},r,o);const c=()=>{const m=i.partialize({...r()});return u.setItem(i.name,{state:m,version:i.version})},f=o.setState;o.setState=(m,E)=>{f(m,E),c()};const p=e((...m)=>{n(...m),c()},r,o);let h;const v=()=>{var m;if(!u)return;s=!1,l.forEach(d=>d(r()));const E=((m=i.onRehydrateStorage)==null?void 0:m.call(i,r()))||void 0;return ts(u.getItem.bind(u))(i.name).then(d=>{if(d)if(typeof d.version=="number"&&d.version!==i.version){if(i.migrate)return i.migrate(d.state,d.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return d.state}).then(d=>{var g;return h=i.merge(d,(g=r())!=null?g:p),n(h,!0),c()}).then(()=>{E==null||E(h,void 0),s=!0,a.forEach(d=>d(h))}).catch(d=>{E==null||E(void 0,d)})};return o.persist={setOptions:m=>{i={...i,...m},m.storage&&(u=m.storage)},clearStorage:()=>{u==null||u.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>v(),hasHydrated:()=>s,onHydrate:m=>(l.add(m),()=>{l.delete(m)}),onFinishHydration:m=>(a.add(m),()=>{a.delete(m)})},v(),h||p},RA=(e,t)=>{var n;return"getStorage"in t||"serialize"in t||"deserialize"in t?(((n={VITE_BASE_URL:"",VITE_BASIC_AUTH:"signalwire:1aG93uXk",VITE_DEFAULT_STYLE_HREF:"https://cdn.swire.io/npm/@signalwire/cfb@dev/dist/style.css",BASE_URL:"/cfb/",MODE:"staging",DEV:!1,PROD:!0,SSR:!1})==null?void 0:n.MODE)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),_A(e,t)):wA(e,t)},P0=window,M0={showAllNodes:!1,showDevOptions:!1,showSavedState:!1},Zn=xl()(RA(e=>({...M0,toggleFlag:t=>{e(n=>({...n,[t]:!n[t]}))}}),{name:"flags",storage:k0(()=>localStorage),version:0}));Zn.subscribe(e=>{console.log("feature flags changed",e)});const NA=e=>{const t=(r,o)=>{Zn.setState(i=>({...i,[r]:o}))},n=r=>{const o=Zn.getState(),i={...r};return Object.entries(o).forEach(([s,l])=>{s in i&&typeof l=="boolean"&&(i[s]=l)}),i};if(P0){const r=new Proxy(n(e),{get:(o,i)=>Reflect.get(o,i),set:(o,i,s)=>{if(typeof s=="boolean"&&i in o)t(i,s);else throw new Error("unknown flag");return Reflect.set(o,i,s)}});P0.swFlags=r}},OA=()=>NA(M0),U0=e=>(e.preventDefault(),e.returnValue=""),xA=()=>{const e=we(n=>n.saveFlowStatus),t=Zn(n=>n.showSavedState);return e==="initial"?null:(e==="saved"?removeEventListener("beforeunload",U0,{capture:!0}):addEventListener("beforeunload",U0,{capture:!0}),t?_("div",{className:"absolute top-2 left-2 bg-primary/60 p-1 px-2 text-sm text-white",children:e}):null)},TA=()=>V("div",{className:"rounded-sm border border-gray-200 p-2",children:[_("h3",{className:"w-full",children:"Feature Flags"}),V("div",{className:"flex flex-col gap-y-2 py-2",children:[_(ad,{flagName:"showAllNodes"}),_(ad,{flagName:"showDevOptions"}),_(ad,{flagName:"showSavedState"})]})]}),ad=({flagName:e})=>{const t=Zn(o=>o.toggleFlag),r=Zn(o=>o[e])?"translate-x-5 bg-positive":"translate-x-0 bg-negative";return V("label",{className:"flex cursor-pointer items-center",children:[V("div",{className:"relative",children:[_("input",{type:"checkbox",className:"sr-only",onChange:()=>t(e)}),_("div",{className:"h-5 w-10 rounded-full bg-foreground/70",children:_("div",{className:`absolute left-1 top-1 h-3 w-3 rounded-full transition ${r}`})})]}),_("p",{className:"ml-3 text-sm font-medium",children:e})]})},F0={action:{label:I.ACTION,nodes:{answer:{active:!0,label:I.ANSWER_CALL},hangup:{active:!0,label:I.HANG_UP_CALL},sendSms:{active:!0,label:I.SEND_SMS},play:{active:!0,label:I.PLAY_AUDIO_TTS}}},decision:{label:I.DECISION,nodes:{cond:{active:!0,label:I.CONDITIONS},set:{active:!0,label:I.SET_VARIABLES},unset:{active:!0,label:I.UNSET_VARIABLES}}},forwardTo:{label:I.FORWARD,nodes:{forwardAddress:{active:!1,label:I.FORWARD_TO_ADDRESS},forwardPhone:{active:!0,label:I.FORWARD_TO_PHONE},forwardResource:{active:!1,label:I.FORWARD_TO_RESOURCE}}},input:{label:I.INPUT,nodes:{promptPlay:{active:!0,label:I.GATHER_INPUT},request:{active:!0,label:I.REQUEST}}},recording:{label:I.RECORD,nodes:{record:{active:!0,label:I.VOICEMAIL_RECORDING},recordCallStart:{active:!0,label:I.RECORD_CALL_START},recordCallStop:{active:!0,label:I.RECORD_CALL_STOP}}}},IA=(e,t)=>({label:M(F0[e].label),nodes:Object.entries(F0[e].nodes).map(([n,r])=>(r.active||t)&&{title:M(r.label),type:n}).filter(Boolean).sort((n,r)=>n.title.localeCompare(r.title))}),{apiVersion:CA,builderVersion:AA,cfbAppVersion:bA,relayMLVersion:LA}=Af(),DA={[I.API_VERSION]:CA,[I.APP_VERSION]:bA,[I.BUILDER_VERSION]:AA,[I.RELAYML_VERSION]:LA},kA=()=>{const e=()=>{var r;((r=n.current)==null?void 0:r.open)===!1&&n.current.showModal()},t=()=>{var r;(r=n.current)!=null&&r.open&&n.current.close()},n=St.useRef(null);return V("section",{className:"ml-4 mt-4",children:[_("menu",{children:_("button",{className:"text-xs text-foreground hover:underline",onClick:e,children:M(I.ABOUT)})}),_("dialog",{ref:n,className:"aspect-[5/4] w-72 max-w-xs overflow-hidden rounded-lg border border-foreground/10 bg-background text-foreground shadow-xl backdrop:backdrop-blur-sm backdrop:backdrop-brightness-95",children:V("div",{className:"h-full px-2 pb-10",children:[V("div",{className:"flex items-center justify-between",children:[_("h2",{className:"text-2xl leading-10",children:M(I.ABOUT)}),V("button",{className:"my-0.5 -mr-1.5 rounded-md py-0.5 px-1.5 ",onClick:t,children:[_("span",{className:"sr-only",children:M(I.CLOSE)}),_(kt,{tag:"xmark",size:"lg"})]})]}),V("div",{className:"h-full overflow-y-auto",children:[_("ul",{className:"mt-1 flex flex-col items-center justify-center text-sm",children:Object.entries(DA).map(([r,o])=>_("li",{className:"text-foreground/70",children:V("p",{children:[M(r),": ",o]})},r))}),_("div",{className:"mt-6 flex items-center justify-center ",children:_("button",{className:"rounded border border-foreground/10 bg-positive py-1.5 px-2.5 text-sm font-medium tracking-wider text-background ",onClick:t,children:M(I.CLOSE)})})]})]})})]})},PA=()=>{const e=we(t=>t.backButtonHref);return e?V("a",{href:e,children:[_("span",{className:"sr-only",children:M(I.NAVIGATE_BACK)}),_(kt,{tag:"arrow-left",className:"text-negative",size:"lg"})]}):null},MA=["action","forwardTo","recording","input","decision"],UA=()=>{const e=Zn(a=>a.showAllNodes),t=Zn(a=>a.showDevOptions),n=we(a=>a.addNode),r=we(a=>a.flowTitle),o=we(a=>a.exportStoreData),i=O.useRef(null),s=a=>{a.preventDefault(),i.current&&i.current.showModal()},l=(a,u)=>{a.preventDefault(),n(u)};return V(Ae,{children:[V("section",{className:"flex h-full w-1/6 shrink-0 flex-col bg-background py-4 text-foreground",children:[V("nav",{className:"mx-4 flex items-center justify-between",children:[_(PA,{}),t&&_("button",{className:"rounded bg-positive p-1 px-2 text-xs text-white",onClick:s,children:"Dev Options"})]}),_("h1",{className:"m-4 block text-lg font-semibold leading-tight line-clamp-2",children:r}),_("ul",{id:"sidebar-node-list",children:MA.map(a=>_("li",{children:_(FA,{group:a,handleOnClick:l,showAllNodes:e})},a))}),_(kA,{})]}),t&&_("dialog",{className:"z-50 my-10 rounded-lg border border-foreground/10 bg-background text-foreground",ref:i,children:_("form",{children:V("fieldset",{children:[V("legend",{className:"flex w-full justify-between pb-2",children:[_("h1",{className:"text-2xl leading-10",children:"Dev Options"}),V("button",{className:"p-1 pt-0 font-semibold",formMethod:"dialog",children:[_("span",{className:"sr-only",children:"Close"}),_(kt,{tag:"xmark",size:"lg"})]})]}),V("div",{className:"mb-1 rounded-sm border border-gray-200 p-2",children:[_("h3",{className:"w-full",children:"Flow Data"}),_("div",{className:"flex flex-row gap-x-2 py-2",children:_("div",{className:"flex items-center",children:_("button",{type:"button",className:"rounded border bg-background px-2 py-1 text-sm hover:scale-105 hover:bg-background/80 active:scale-95",onClick:o,children:"View JSON File"})})})]}),_(TA,{})]})})})]})},FA=({group:e,handleOnClick:t,showAllNodes:n})=>{const r=IA(e,n),o=`ngm-heading-${Fx(r.label)}`;return V(Ae,{children:[_("h2",{className:"px-4 pb-2 text-sm uppercase text-foreground/50",id:o,children:r.label}),_("ul",{"aria-labelledby":o,className:"flex-1 overflow-y-auto px-4 pb-2",children:r.nodes.map(i=>_("li",{children:_("button",{className:"mb-2 block w-full rounded-lg border border-foreground/10 p-3 text-center text-sm hover:shadow-md",onClick:s=>t(s,i.type),children:i.title})},i.type))})]})},f2="";function VA(){It().warn("Hello World!");const e=we(t=>t.colorMode)??"";return V(Ae,{children:[V("div",{className:`${e} flex h-full w-full bg-backgroundAlt text-foreground`,children:[_(UA,{}),V(PI,{children:[_(Ax,{}),_(SA,{})]})]}),_(xA,{})]})}const BA=`@font-face{font-family:SWInter;font-style:normal;font-weight:400;font-display:swap;src:url(//cdn.signalwire.com/fonts/inter/Inter-Regular.woff2) format("woff2"),url(//cdn.signalwire.com/fonts/inter/Inter-Regular.woff) format("woff")}
68
+ focus:outline-none focus:ring-1 focus:ring-foreground`,onClick:p,onKeyDown:c,type:"button",children:h>0?M(I.NUMBER_OF_VARIABLES_SELECTED,{count:h}):M(I.SELECT_VARIABLES)}),o.listOpen&&V("ul",{"aria-activedescendant":o.currentFocus,"aria-labelledby":"listbox-label","aria-multiselectable":"true",className:"mt-1 max-h-60 w-full overflow-auto rounded-lg border border-foreground/10 bg-backgroundAlt py-1 shadow-xl",role:"listbox",children:[!o.setVariablesList.length&&_("li",{"aria-disabled":"true",className:"relative",role:"option",children:_("label",{className:"flex select-none items-center py-2 pl-3 pr-9",children:M(I.NO_VARIABLES_SET)})}),o.setVariablesList.map((v,m)=>_("li",{"aria-selected":v.selected,className:"relative",id:v.id,role:"option",children:V("label",{className:"flex select-none items-center py-2 pl-3 pr-9",children:[_("input",{checked:v.selected,className:"mr-2 h-4 w-4 rounded accent-primary",onChange:()=>l(m),onKeyDown:E=>f(E,m),type:"checkbox"}),v.key]})},v.id))]})]})]}),h>0&&V("section",{className:"pt-3",children:[_("h3",{className:"mb-2 leading-5 text-foreground",children:M(I.UNSET_VARIABLES)}),_("ul",{className:"flex flex-wrap gap-2",children:o.unsetVariables.map((v,m)=>_(fI,{handleClick:()=>a(m),children:v.key},v.id))})]})]})},dA=({nodeData:e,handleOnUpdate:t})=>{const n={beep:{value:e.beep},format:{value:e.format,valid:!0},stereo:{value:e.stereo},terminators:{value:e.terminators,valid:!0}},[r,o]=Kt(n);return _(Et,{info:M(I.INFO_NODE_RECORD),title:M(I.VOICEMAIL_RECORDING),children:_(Hy,{handleOnUpdate:t,displayData:r,setDisplayData:o})})},pA=({nodeData:e,handleOnUpdate:t})=>{const n={beep:{value:e.beep},controlId:{value:e.controlId},format:{value:e.format,valid:!0},label:{value:e.label,valid:!0},stereo:{value:e.stereo},terminators:{value:e.terminators,valid:!0}},r=O.useRef(),[o,i]=Kt(n),[s,l]=O.useState(!1),a=Gn(p=>p.upsertEntry),u=Gn(p=>p.isValueDuplicate);Qi({displayData:o,formRef:r,setCompleted:p=>{t({},p)}});const f=p=>{let h=!0;const v=p.target,{name:m,value:E}=v,d=E.trim(),g=u(d,e.controlId);l(g),h=v.checkValidity()&&Boolean(d)&&!g,i({[m]:{value:E,valid:h}}),t({[m]:h?d:""}),a({controlId:e.controlId,label:h?d:""})};return V(Et,{info:M(I.INFO_NODE_RECORD_CALL_START),title:M(I.RECORD_CALL_START),formRef:r,children:[V("label",{children:[M(I.RECORDING_NAME),_("input",{className:`w-full ${o.label.valid?"":"invalid"}`,defaultValue:o.label.value,name:"label",onChange:f,pattern:_r(UI),required:!0,type:"text"}),_("p",{className:"requirements",role:"alert",children:M(s?I.ERROR_DUPLICATE_RECORDING_LABEL:I.ERROR_RECORDING_LABEL_REQUIRED)})]}),_(Hy,{handleOnUpdate:t,displayData:o,setDisplayData:i})]})},hA=({nodeData:e,handleOnChange:t})=>{const r=Gn(o=>o.getEntries)().sort((o,i)=>o.label.toLowerCase().localeCompare(i.label.toLowerCase()));return _(Et,{handleOnChange:t,info:M(I.INFO_NODE_RECORD_CALL_STOP),title:M(I.RECORD_CALL_STOP),children:r.length?V("label",{children:[_("p",{className:"mb-2 whitespace-nowrap",children:M(I.RECORDING_NAME)}),V(Sr,{className:"w-full",defaultValue:e.controlId,name:"controlId",children:[_("option",{value:"",children:M(I.SELECT)}),r.map(o=>_("option",{value:o.controlId,children:o.label},o.controlId))]})]}):_("p",{className:"text-negative",children:M(I.ERROR_ADD_RECORDING_FIRST)})})},gA=({nodeData:e,handleOnUpdate:t})=>{const n={body:{value:e.body,valid:!0},fromNumber:{value:e.fromNumber,valid:!0},toNumber:{value:e.toNumber,valid:!0}},[r,o]=Kt(n),i=s=>{const l=s.target,{name:a,value:u}=l,c=typeof u=="string"?u.trim():u;let f=!0;switch(a){case"body":case"fromNumber":case"toNumber":f=l.checkValidity()&&!!c,o({[a]:{value:u,valid:f}}),t({[a]:f?c:""});break;default:throw new Error(`Unhandled input name: ${a}`)}};return V(Et,{info:M(I.INFO_NODE_SEND_SMS),title:M(I.SEND_SMS),children:[V("label",{className:"mb-1",children:[_("div",{children:M(I.FROM_PHONE_NUMBER)}),_("input",{className:`w-full ${r.fromNumber.valid?"":"invalid"}`,defaultValue:r.fromNumber.value,name:"fromNumber",onChange:i,placeholder:"+1 (204) 000 0000",required:!0,type:"tel"}),_("p",{className:"requirements w-full",role:"alert",children:M(I.ERROR_VALUE_IS_REQUIRED)})]}),V("label",{className:"mb-1",children:[_("div",{children:M(I.TO_PHONE_NUMBER)}),_("input",{className:`w-full ${r.toNumber.valid?"":"invalid"}`,defaultValue:r.toNumber.value,name:"toNumber",onChange:i,placeholder:"+1 (204) 000 0000",required:!0,type:"tel"}),_("p",{className:"requirements w-full",role:"alert",children:M(I.ERROR_VALUE_IS_REQUIRED)})]}),V("label",{children:[_("div",{children:M(I.TEXT)}),_(Ki,{errorText:M(I.ERROR_VALUE_IS_REQUIRED),inputMode:"text",valid:Boolean(r.body.valid),label:M(I.SMS_TEXT),name:"body",onChange:i,placeholder:M(I.WRITE_SOMETHING),required:!0,value:r.body.value})]})]})},mA=["GET","POST","PUT","DELETE"],vA=e=>{console.log("bodyToTextArea",e);try{return typeof e=="string"?e:JSON.stringify(e)}catch{return e}},yA=({nodeData:e,handleOnUpdate:t})=>{const n={url:{value:e.url,valid:!0},method:{value:e.method,valid:!0},headers:{value:e.headers,valid:!0},body:{value:e.body,valid:!0},saveVariables:{value:Boolean(e.saveVariables),valid:!0}},[r,o]=Kt(n),i=a=>{const u=a.target,{name:c,value:f}=u,p=typeof f=="string"?f.trim():f;let h=!0;switch(c){case"url":case"method":h=u.checkValidity()&&!!p,o({[c]:{value:f,valid:h}}),t({[c]:h?p:""});break;case"headers":if(!f){o({[c]:{value:{},valid:!0}}),t({[c]:{}});return}try{const v=JSON.parse(f);o({[c]:{valid:!0}}),t({[c]:v})}catch{o({[c]:{valid:!1}}),t({[c]:{}})}break;case"body":try{const v=JSON.parse(f);o({[c]:{value:f,valid:!0}}),t({[c]:v})}catch{o({[c]:{value:f,valid:!0}}),t({[c]:f})}break;default:throw new Error(`Unhandled input name: ${c}`)}},s=a=>{const u=a.target.name,c=a.target.value,f={[u]:c};o(f),t(f)},l=a=>{const u=a.target.name,c=!r[u].value;o({[u]:{value:c}}),t({[u]:c})};return V(Et,{info:M(I.INFO_NODE_REQUEST),title:M(I.REQUEST),children:[V("label",{children:[_("div",{children:M(I.URL)}),_("input",{className:`w-full ${r.url.valid?"":"invalid"}`,defaultValue:r.url.value,name:"url",onChange:i,placeholder:"https://user:password@example.com/api/status",required:!0,type:"text"}),_("p",{className:"requirements w-full",role:"alert",children:M(I.ERROR_VALUE_IS_REQUIRED)})]}),V("label",{className:"mb-3 block",children:[M(I.METHOD),_(Sr,{className:"w-full",value:r.method.value,name:"method",onChange:s,children:mA.map(a=>_("option",{value:a,children:a},a))})]}),_("div",{className:"mb-4",children:_(ky,{checked:r.saveVariables.value,clickHandler:l,name:"saveVariables",subtitle:M(I.SAVE_VARIABLES_SUBTITLE),title:M(I.SAVE_VARIABLES)})}),V("label",{children:[_("div",{children:M(I.REQUEST_HEADERS)}),_(Ki,{errorText:M(I.ERROR_INVALID_JSON),inputMode:"text",valid:Boolean(r.headers.valid),label:M(I.REQUEST_HEADERS),name:"headers",onChange:i,placeholder:'{"Content-Type": "application/json", "X-Custom-Header": "foo"}',required:!0,value:JSON.stringify(r.headers.value)})]}),V("label",{children:[_("div",{children:M(I.REQUEST_BODY)}),_(Ki,{inputMode:"text",valid:!0,label:M(I.REQUEST_BODY),name:"body",onChange:i,placeholder:"String or JSON to serialize",value:vA(r.body.value)})]})]})},D0=()=>({value:{id:ye(),value:""},valid:!0}),ld=e=>e.every(t=>t.valid),EA=({nodeData:e,handleOnUpdate:t})=>{const n=O.useRef(),r={options:{value:e.options.length?e.options.map(v=>({value:v,valid:Boolean(v.value)})):[D0()],valid:!0}},[o,i]=Kt(r);Qi({displayData:o,formRef:n,setCompleted:v=>{t({},v)}});const l=v=>{v.preventDefault();const m=[...o.options.value,D0()];i({options:{value:m,valid:ld(m)}}),t({options:m.map(E=>E.value)})},a=v=>{const E=o.options.value.filter((d,g)=>g!==v);i({options:{value:E,valid:ld(E)}}),t({options:E.map(d=>d.value)})},u=(v,m)=>v.map(d=>d.value.id===m.value.id?{...d,...m}:d),c=v=>v.map(m=>({...m.value,value:m.value.value.trim()})),f=(v,m)=>{const E=o.options.value;E[v]||$t().error(`Option not found at index ${v}`);const d=E[v],g={...d==null?void 0:d.value,...m},y=Boolean(g.value.trim()),S={value:g,valid:y},w=u(o.options.value,S);i({options:{value:w,valid:ld(w)}}),t({options:c(w)})},p=(v,m)=>{const E=v.target,{name:d,value:g}=E;switch(d){case"value":m!==void 0&&f(m,{[d]:g});break;default:$t().error(`Unhandled input name: ${d}`)}},h=o.options.value;return _(Et,{formRef:n,info:M(I.INFO_NODE_COND),title:M(I.CONDITIONS),children:_("div",{className:"divide-y divide-foreground/10",children:h.map((v,m,E)=>V("div",{className:"mb-3",children:[V("div",{className:"flex items-center",children:[_("h2",{className:"nowrap flex-1 py-4 text-sm font-medium uppercase leading-4 text-foreground/50",children:M(I.CONDITION_NUMBER,{index:m+1})}),Boolean(h.length>1)&&_(va,{trigger:V("button",{className:"px-2",onClick:()=>a(m),type:"button",children:[_("span",{className:"sr-only",children:M(I.REMOVE_CONDITION,{index:m+1})}),_(Dt,{tag:"xmark"})]}),children:M(I.INFO_NODE_OPTION_REMOVE)})]}),V("label",{className:"flex flex-col",children:[_("input",{className:`w-full ${v.valid?"":"invalid"}`,defaultValue:v.value.value,name:"value",onChange:d=>p(d,m),placeholder:"${count} > 3, /hello/.test('${foo}')",type:"text"}),_("p",{className:"requirements",role:"alert",children:M(I.ERROR_VALUE_IS_REQUIRED)})]}),m===E.length-1&&V("button",{onClick:l,type:"button",className:"mb-3 text-primary",children:["+ ",M(I.ADD_CONDITION)]})]},v.value.id))})})},SA=()=>{const e=we(u=>u.selectedNode),t=we(u=>u.partialUpdateNodeData),n=e==null?void 0:e.data,r=e==null?void 0:e.id;if(!(e&&n&&r))return null;const o=u=>{const c=new FormData(u.currentTarget),f=Object.fromEntries(c.entries());t(r,{...f,missingRequiredParams:!By(f)})},i=(u,c)=>{typeof c=="boolean"&&(u.missingRequiredParams=!c),t(r,u)},s={forwardAddress:()=>_(id,{destinationType:"address",nodeData:n,handleOnUpdate:i}),forwardPhone:()=>_(id,{destinationType:"phone",nodeData:n,handleOnUpdate:i}),forwardResource:()=>_(id,{destinationType:"resource",nodeData:n,handleOnUpdate:i}),hangup:()=>_(iA,{nodeData:n,handleOnChange:o}),play:()=>_(sA,{nodeData:n,handleOnUpdate:i}),promptPlay:()=>_(oA,{nodeData:n,handleOnUpdate:i}),set:()=>_(lA,{nodeData:n,handleOnUpdate:i}),unset:()=>_(fA,{nodeData:n,handleOnUpdate:i}),record:()=>_(dA,{nodeData:n,handleOnUpdate:i}),recordCallStart:()=>_(pA,{nodeData:n,handleOnUpdate:i}),recordCallStop:()=>_(hA,{nodeData:n,handleOnChange:o}),sendSms:()=>_(gA,{nodeData:n,handleOnUpdate:i}),request:()=>_(yA,{nodeData:n,handleOnUpdate:i}),cond:()=>_(EA,{nodeData:n,handleOnUpdate:i})};if(!(u=>Boolean(u in s))(e.type))return null;const a=s[e.type];return _(nf,{className:"nokey flex max-h-[95%] w-[300px] flex-col overflow-hidden rounded-md border border-foreground/10 bg-background py-4",position:"top-right",children:_(a,{})})};function k0(e){let t;try{t=e()}catch{return}return{getItem:r=>{var o;const i=l=>l===null?null:JSON.parse(l),s=(o=t.getItem(r))!=null?o:null;return s instanceof Promise?s.then(i):i(s)},setItem:(r,o)=>t.setItem(r,JSON.stringify(o)),removeItem:r=>t.removeItem(r)}}const ts=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return ts(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return ts(r)(n)}}}},_A=(e,t)=>(n,r,o)=>{let i={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:E=>E,version:0,merge:(E,d)=>({...d,...E}),...t},s=!1;const l=new Set,a=new Set;let u;try{u=i.getStorage()}catch{}if(!u)return e((...E)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...E)},r,o);const c=ts(i.serialize),f=()=>{const E=i.partialize({...r()});let d;const g=c({state:E,version:i.version}).then(y=>u.setItem(i.name,y)).catch(y=>{d=y});if(d)throw d;return g},p=o.setState;o.setState=(E,d)=>{p(E,d),f()};const h=e((...E)=>{n(...E),f()},r,o);let v;const m=()=>{var E;if(!u)return;s=!1,l.forEach(g=>g(r()));const d=((E=i.onRehydrateStorage)==null?void 0:E.call(i,r()))||void 0;return ts(u.getItem.bind(u))(i.name).then(g=>{if(g)return i.deserialize(g)}).then(g=>{if(g)if(typeof g.version=="number"&&g.version!==i.version){if(i.migrate)return i.migrate(g.state,g.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return g.state}).then(g=>{var y;return v=i.merge(g,(y=r())!=null?y:h),n(v,!0),f()}).then(()=>{d==null||d(v,void 0),s=!0,a.forEach(g=>g(v))}).catch(g=>{d==null||d(void 0,g)})};return o.persist={setOptions:E=>{i={...i,...E},E.getStorage&&(u=E.getStorage())},clearStorage:()=>{u==null||u.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>m(),hasHydrated:()=>s,onHydrate:E=>(l.add(E),()=>{l.delete(E)}),onFinishHydration:E=>(a.add(E),()=>{a.delete(E)})},m(),v||h},wA=(e,t)=>(n,r,o)=>{let i={storage:k0(()=>localStorage),partialize:m=>m,version:0,merge:(m,E)=>({...E,...m}),...t},s=!1;const l=new Set,a=new Set;let u=i.storage;if(!u)return e((...m)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...m)},r,o);const c=()=>{const m=i.partialize({...r()});return u.setItem(i.name,{state:m,version:i.version})},f=o.setState;o.setState=(m,E)=>{f(m,E),c()};const p=e((...m)=>{n(...m),c()},r,o);let h;const v=()=>{var m;if(!u)return;s=!1,l.forEach(d=>d(r()));const E=((m=i.onRehydrateStorage)==null?void 0:m.call(i,r()))||void 0;return ts(u.getItem.bind(u))(i.name).then(d=>{if(d)if(typeof d.version=="number"&&d.version!==i.version){if(i.migrate)return i.migrate(d.state,d.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return d.state}).then(d=>{var g;return h=i.merge(d,(g=r())!=null?g:p),n(h,!0),c()}).then(()=>{E==null||E(h,void 0),s=!0,a.forEach(d=>d(h))}).catch(d=>{E==null||E(void 0,d)})};return o.persist={setOptions:m=>{i={...i,...m},m.storage&&(u=m.storage)},clearStorage:()=>{u==null||u.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>v(),hasHydrated:()=>s,onHydrate:m=>(l.add(m),()=>{l.delete(m)}),onFinishHydration:m=>(a.add(m),()=>{a.delete(m)})},v(),h||p},RA=(e,t)=>{var n;return"getStorage"in t||"serialize"in t||"deserialize"in t?(((n={VITE_BASE_URL:"",VITE_BASIC_AUTH:"signalwire:1aG93uXk",VITE_DEFAULT_STYLE_HREF:"https://cdn.swire.io/npm/@signalwire/cfb@dev/dist/style.css",BASE_URL:"/cfb/",MODE:"staging",DEV:!1,PROD:!0,SSR:!1})==null?void 0:n.MODE)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),_A(e,t)):wA(e,t)},P0=window,M0={showAllNodes:!1,showDevOptions:!1,showSavedState:!1},Zn=xl()(RA(e=>({...M0,toggleFlag:t=>{e(n=>({...n,[t]:!n[t]}))}}),{name:"flags",storage:k0(()=>localStorage),version:0}));Zn.subscribe(e=>{console.log("feature flags changed",e)});const NA=e=>{const t=(r,o)=>{Zn.setState(i=>({...i,[r]:o}))},n=r=>{const o=Zn.getState(),i={...r};return Object.entries(o).forEach(([s,l])=>{s in i&&typeof l=="boolean"&&(i[s]=l)}),i};if(P0){const r=new Proxy(n(e),{get:(o,i)=>Reflect.get(o,i),set:(o,i,s)=>{if(typeof s=="boolean"&&i in o)t(i,s);else throw new Error("unknown flag");return Reflect.set(o,i,s)}});P0.swFlags=r}},OA=()=>NA(M0),U0=e=>(e.preventDefault(),e.returnValue=""),xA=()=>{const e=we(n=>n.saveFlowStatus),t=Zn(n=>n.showSavedState);return e==="initial"?null:(e==="saved"?removeEventListener("beforeunload",U0,{capture:!0}):addEventListener("beforeunload",U0,{capture:!0}),t?_("div",{className:"absolute top-2 left-2 bg-primary/60 p-1 px-2 text-sm text-white",children:e}):null)},TA=()=>V("div",{className:"rounded-sm border border-gray-200 p-2",children:[_("h3",{className:"w-full",children:"Feature Flags"}),V("div",{className:"flex flex-col gap-y-2 py-2",children:[_(ad,{flagName:"showAllNodes"}),_(ad,{flagName:"showDevOptions"}),_(ad,{flagName:"showSavedState"})]})]}),ad=({flagName:e})=>{const t=Zn(o=>o.toggleFlag),r=Zn(o=>o[e])?"translate-x-5 bg-positive":"translate-x-0 bg-negative";return V("label",{className:"flex cursor-pointer items-center",children:[V("div",{className:"relative",children:[_("input",{type:"checkbox",className:"sr-only",onChange:()=>t(e)}),_("div",{className:"h-5 w-10 rounded-full bg-foreground/70",children:_("div",{className:`absolute left-1 top-1 h-3 w-3 rounded-full transition ${r}`})})]}),_("p",{className:"ml-3 text-sm font-medium",children:e})]})},F0={action:{label:I.ACTION,nodes:{answer:{active:!0,label:I.ANSWER_CALL},hangup:{active:!0,label:I.HANG_UP_CALL},sendSms:{active:!0,label:I.SEND_SMS},play:{active:!0,label:I.PLAY_AUDIO_TTS}}},decision:{label:I.DECISION,nodes:{cond:{active:!0,label:I.CONDITIONS},set:{active:!0,label:I.SET_VARIABLES},unset:{active:!0,label:I.UNSET_VARIABLES}}},forwardTo:{label:I.FORWARD,nodes:{forwardAddress:{active:!1,label:I.FORWARD_TO_ADDRESS},forwardPhone:{active:!0,label:I.FORWARD_TO_PHONE},forwardResource:{active:!1,label:I.FORWARD_TO_RESOURCE}}},input:{label:I.INPUT,nodes:{promptPlay:{active:!0,label:I.GATHER_INPUT},request:{active:!0,label:I.REQUEST}}},recording:{label:I.RECORD,nodes:{record:{active:!0,label:I.VOICEMAIL_RECORDING},recordCallStart:{active:!0,label:I.RECORD_CALL_START},recordCallStop:{active:!0,label:I.RECORD_CALL_STOP}}}},IA=(e,t)=>({label:M(F0[e].label),nodes:Object.entries(F0[e].nodes).map(([n,r])=>(r.active||t)&&{title:M(r.label),type:n}).filter(Boolean).sort((n,r)=>n.title.localeCompare(r.title))}),{apiVersion:CA,builderVersion:AA,cfbAppVersion:bA,relayMLVersion:LA}=Af(),DA={[I.API_VERSION]:CA,[I.APP_VERSION]:bA,[I.BUILDER_VERSION]:AA,[I.RELAYML_VERSION]:LA},kA=()=>{const e=()=>{var r;((r=n.current)==null?void 0:r.open)===!1&&n.current.showModal()},t=()=>{var r;(r=n.current)!=null&&r.open&&n.current.close()},n=St.useRef(null);return V("section",{className:"ml-4 mt-4",children:[_("menu",{children:_("button",{className:"text-xs text-foreground hover:underline",onClick:e,children:M(I.ABOUT)})}),_("dialog",{ref:n,className:"aspect-[5/4] w-72 max-w-xs overflow-hidden rounded-lg border border-foreground/10 bg-background text-foreground shadow-xl backdrop:backdrop-blur-sm backdrop:backdrop-brightness-95",children:V("div",{className:"h-full px-2 pb-10",children:[V("div",{className:"flex items-center justify-between",children:[_("h2",{className:"text-2xl leading-10",children:M(I.ABOUT)}),V("button",{className:"my-0.5 -mr-1.5 rounded-md py-0.5 px-1.5 ",onClick:t,children:[_("span",{className:"sr-only",children:M(I.CLOSE)}),_(Dt,{tag:"xmark",size:"lg"})]})]}),V("div",{className:"h-full overflow-y-auto",children:[_("ul",{className:"mt-1 flex flex-col items-center justify-center text-sm",children:Object.entries(DA).map(([r,o])=>_("li",{className:"text-foreground/70",children:V("p",{children:[M(r),": ",o]})},r))}),_("div",{className:"mt-6 flex items-center justify-center ",children:_("button",{className:"rounded border border-foreground/10 bg-positive py-1.5 px-2.5 text-sm font-medium tracking-wider text-background ",onClick:t,children:M(I.CLOSE)})})]})]})})]})},PA=()=>{const e=we(t=>t.backButtonHref);return e?V("a",{href:e,children:[_("span",{className:"sr-only",children:M(I.NAVIGATE_BACK)}),_(Dt,{tag:"arrow-left",className:"text-negative",size:"lg"})]}):null},MA=["action","forwardTo","recording","input","decision"],UA=()=>{const e=Zn(a=>a.showAllNodes),t=Zn(a=>a.showDevOptions),n=we(a=>a.addNode),r=we(a=>a.flowTitle),o=we(a=>a.exportStoreData),i=O.useRef(null),s=a=>{a.preventDefault(),i.current&&i.current.showModal()},l=(a,u)=>{a.preventDefault(),n(u)};return V(Ae,{children:[V("section",{className:"flex h-full w-1/6 shrink-0 flex-col bg-background py-4 text-foreground",children:[V("nav",{className:"mx-4 flex shrink-0 items-center justify-between",children:[_(PA,{}),t&&_("button",{className:"rounded bg-positive p-1 px-2 text-xs text-white",onClick:s,children:"Dev Options"})]}),_("h1",{className:"m-4 block shrink-0 text-lg font-semibold leading-tight line-clamp-2",children:r}),_("ul",{className:"overflow-y-auto",id:"sidebar-node-list",children:MA.map(a=>_("li",{children:_(FA,{group:a,handleOnClick:l,showAllNodes:e})},a))}),_(kA,{})]}),t&&_("dialog",{className:"z-50 my-10 rounded-lg border border-foreground/10 bg-background text-foreground",ref:i,children:_("form",{children:V("fieldset",{children:[V("legend",{className:"flex w-full justify-between pb-2",children:[_("h1",{className:"text-2xl leading-10",children:"Dev Options"}),V("button",{className:"p-1 pt-0 font-semibold",formMethod:"dialog",children:[_("span",{className:"sr-only",children:"Close"}),_(Dt,{tag:"xmark",size:"lg"})]})]}),V("div",{className:"mb-1 rounded-sm border border-gray-200 p-2",children:[_("h3",{className:"w-full",children:"Flow Data"}),_("div",{className:"flex flex-row gap-x-2 py-2",children:_("div",{className:"flex items-center",children:_("button",{type:"button",className:"rounded border bg-background px-2 py-1 text-sm hover:scale-105 hover:bg-background/80 active:scale-95",onClick:o,children:"View JSON File"})})})]}),_(TA,{})]})})})]})},FA=({group:e,handleOnClick:t,showAllNodes:n})=>{const r=IA(e,n),o=`ngm-heading-${Fx(r.label)}`;return V(Ae,{children:[_("h2",{className:"px-4 pb-2 text-sm uppercase text-foreground/50",id:o,children:r.label}),_("ul",{"aria-labelledby":o,className:"flex-1 overflow-y-auto px-4 pb-2",children:r.nodes.map(i=>_("li",{children:_("button",{className:"mb-2 block w-full rounded-lg border border-foreground/10 p-3 text-center text-sm hover:shadow-md",onClick:s=>t(s,i.type),children:i.title})},i.type))})]})},f2="";function VA(){$t().warn("Hello World!");const e=we(t=>t.colorMode)??"";return V(Ae,{children:[V("div",{className:`${e} flex h-full w-full bg-backgroundAlt text-foreground`,children:[_(UA,{}),V(PI,{children:[_(Ax,{}),_(SA,{})]})]}),_(xA,{})]})}const BA=`@font-face{font-family:SWInter;font-style:normal;font-weight:400;font-display:swap;src:url(//cdn.signalwire.com/fonts/inter/Inter-Regular.woff2) format("woff2"),url(//cdn.signalwire.com/fonts/inter/Inter-Regular.woff) format("woff")}
69
69
  `,$A=e=>{if(!e||!e.getFlowURL||!e.updateFlowURL)throw new TypeError("Invalid or missing required params")};function zA(e){$A(e);const{backButtonHref:t,rootElementId:n="sw-cfb-root",styleHref:r="https://cdn.swire.io/npm/@signalwire/cfb@dev/dist/style.css",getFlowURL:o,updateFlowURL:i}=e;we.setState({rootElementId:n,backButtonHref:t,getFlowURL:o,updateFlowURL:i}),$T(),OA();const s=document.getElementById(n);if(!s)throw new Error(`Id: '${n}' not found in the DOM`);s.attachShadow({mode:"open"}),s.shadowRoot&&Na.createRoot(s.shadowRoot).render(V(O.StrictMode,{children:[_("link",{type:"text/css",rel:"stylesheet",href:r}),_(VA,{})]}));const l=document.createElement("style");document.head.appendChild(l),l.appendChild(document.createTextNode(BA))}Ir.main=zA,Object.defineProperty(Ir,Symbol.toStringTag,{value:"Module"})});